public class DSARandomBitsSource extends RandomBitsSource
RandomBitsSource, EntropySource| Constructor and Description |
|---|
DSARandomBitsSource()
Creates a new seeded
DSARandomBitsSource. |
DSARandomBitsSource(boolean seed)
Creates a new, optionally seeded
DSARandomBitsSource. |
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
Returns the internal values used by this PRNG to their initial unseeded state.
|
byte |
randomByte()
Returns the next output byte.
|
byte[] |
randomBytes(byte[] bytes)
Fills the supplied array with the requsite number of output bytes.
|
void |
seed(byte[] seed)
Seeds this PRNG with the bytes in the given byte array.
|
void |
seed(EntropySource es)
Seed this PRNG with 20 bytes generated by the given EntropySource.
|
getDefault, getRNGTest, randomBigInt, randomBigInteger, seed, setDefaultpublic DSARandomBitsSource()
DSARandomBitsSource.public DSARandomBitsSource(boolean seed)
DSARandomBitsSource.seed - If true, the seed(byte[]) method will be invoked by tis constructor.public void clear()
clear in class RandomBitsSourcepublic void seed(byte[] seed)
seed in class RandomBitsSourceseed - The seeding material.java.lang.IllegalArgumentException - If the the length of seed is less than 20 bytes or greater than 64 bytes.public void seed(EntropySource es)
seed in class RandomBitsSourcees - The EntropySource.EntropySourcepublic byte randomByte()
IllegalStateException is thrown.Specified by:randomByte in class RandomBitsSourcejava.lang.IllegalStateException - If the PRNG is in an unseeded state.public byte[] randomBytes(byte[] bytes)
randomBytes in class RandomBitsSource