public abstract class RandomSource
extends java.util.Random
| Constructor and Description |
|---|
RandomSource() |
| Modifier and Type | Method and Description |
|---|---|
abstract int |
acceptEntropy(EntropySource source,
long data,
int entropyGuess)
Accepts entropy data from a source
|
abstract int |
acceptEntropyBytes(EntropySource myPacketDataSource,
byte[] buf,
int offset,
int length,
double bias)
Accepts larger amounts of entropy data from a source, with a bias
|
abstract int |
acceptTimerEntropy(EntropySource timer)
Accepts entropy in the form of timing data from a source
|
abstract int |
acceptTimerEntropy(EntropySource fnpTimingSource,
double bias)
Accept entropy from a source with a bias
|
abstract void |
close()
If the RandomSource has any resources it wants to close, it can
do so when this method is called
|
protected int |
next(int bits) |
double |
nextFullDouble()
Returns a 64 bit random double.
|
float |
nextFullFloat()
Returns a 32 bit random floating point number.
|
void |
waitForEntropy(int bits)
If entropy estimation is supported, this method will block
until the specified number of bits of entropy are available.
|
public float nextFullFloat()
Random.nextFloat()public double nextFullDouble()
Random.nextDouble()public abstract int acceptEntropy(EntropySource source, long data, int entropyGuess)
public abstract int acceptTimerEntropy(EntropySource timer)
public abstract int acceptTimerEntropy(EntropySource fnpTimingSource, double bias)
bias - Value by which we multiply the entropy before counting it.
Must be <= 1.0.public abstract int acceptEntropyBytes(EntropySource myPacketDataSource, byte[] buf, int offset, int length, double bias)
myPacketDataSource - The source from which the data has come.buf - The buffer to read bytes from.offset - The offset to start reading from.length - The number of bytes to read.bias - The bias. Value by which we multiply the entropy before counting it.
Must be <= 1.0.public void waitForEntropy(int bits)
public abstract void close()
protected int next(int bits)
next in class java.util.Random