|
For the latest news and information visit The GNU Crypto project |
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectgnu.crypto.prng.BasePRNG
gnu.crypto.prng.Fortuna
The Fortuna continuously-seeded pseudo-random number generator. This generator is composed of two major pieces: the entropy accumulator and the generator function. The former takes in random bits and incorporates them into the generator's state. The latter takes this base entropy and generates pseudo-random bits from it.
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:
Nested Class Summary | |
---|---|
static class |
Fortuna.Generator
The Fortuna generator function. |
Field Summary | |
---|---|
static String |
SEED
|
Fields inherited from class gnu.crypto.prng.BasePRNG |
---|
buffer, initialised, name, ndx |
Constructor Summary | |
---|---|
Fortuna()
|
Method Summary | |
---|---|
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 |
addRandomEvent(RandomEvent event)
|
void |
fillBlock()
|
void |
setup(Map attributes)
|
Methods inherited from class gnu.crypto.prng.BasePRNG |
---|
addRandomBytes, clone, init, isInitialised, name, nextByte, nextBytes, nextBytes |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final String SEED
Constructor Detail |
public Fortuna()
Method Detail |
public void setup(Map attributes)
setup
in class BasePRNG
public void fillBlock() throws LimitReachedException
fillBlock
in class BasePRNG
LimitReachedException
public void addRandomByte(byte b)
IRandom
Supplement, 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 IRandom
addRandomByte
in class BasePRNG
public void addRandomBytes(byte[] buf, int offset, int length)
IRandom
Supplement, 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 IRandom
addRandomBytes
in class BasePRNG
public void addRandomEvent(RandomEvent event)
addRandomEvent
in interface RandomEventListener
|
For the latest news and information visit The GNU Crypto project |
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |