public class FortunaStandalone extends BasePRNGStandalone implements Serializable
There are some things users of this class must be aware of:
Serializable in such a way that it
writes a 64 byte seed to the stream, and reads it back again when being
deserialized. This is the extent of seed file management, however, and
those using this class are encouraged to think deeply about when, how
often, and where to store the seed.References:
| Modifier and Type | Field and Description |
|---|---|
protected IRandomStandalone |
generator |
protected long |
lastReseed |
(package private) static int |
MIN_POOL_SIZE |
(package private) static int |
NUM_POOLS |
protected int |
pool0Count |
protected MessageDigest[] |
pools
null if using DevRandom
|
protected int |
reseedCount |
static String |
SEED |
buffer, initialised, name, ndx| Constructor and Description |
|---|
FortunaStandalone() |
FortunaStandalone(boolean useDevRandom) |
| Modifier and Type | Method and Description |
|---|---|
void |
addRandomByte(byte b)
Supplement, or possibly replace, the random state of this PRNG with
a random byte.
|
void |
addRandomBytes(byte[] buf,
int offset,
int length)
Supplement, or possibly replace, the random state of this PRNG with
a sequence of new random bytes.
|
void |
fillBlock()
Unused, see AsyncFortunaStandalone
|
void |
seed(byte[] val)
Unused, see AsyncFortunaStandalone
|
void |
setup(Map<String,byte[]> attributes) |
addRandomBytes, clone, init, isInitialised, name, nextByte, nextBytes, nextBytesprotected final IRandomStandalone generator
protected long lastReseed
static final int MIN_POOL_SIZE
static final int NUM_POOLS
protected int pool0Count
protected final MessageDigest[] pools
protected int reseedCount
public static final String SEED
public FortunaStandalone()
public FortunaStandalone(boolean useDevRandom)
public void addRandomByte(byte b)
IRandomStandaloneSupplement, or possibly replace, the random state of this PRNG with a random byte.
Implementations are not required to implement this method in any
meaningful way; this may be a no-operation, and implementations may
throw an UnsupportedOperationException.
addRandomByte in interface IRandomStandaloneaddRandomByte in class BasePRNGStandaloneb - The byte to add.public void addRandomBytes(byte[] buf,
int offset,
int length)
IRandomStandaloneSupplement, or possibly replace, the random state of this PRNG with a sequence of new random bytes.
Implementations are not required to implement this method in any
meaningful way; this may be a no-operation, and implementations may
throw an UnsupportedOperationException.
addRandomBytes in interface IRandomStandaloneaddRandomBytes in class BasePRNGStandalonebuf - The buffer of new random bytes to add.offset - The offset from whence to begin reading random bytes.length - The number of random bytes to add.public void fillBlock()
fillBlock in class BasePRNGStandalonepublic void seed(byte[] val)
public void setup(Map<String,byte[]> attributes)
setup in class BasePRNGStandalone