public class MetaSeedGenerator extends VarLengthSeedGenerator
To use it, first set the initial seed via one of the static setSeed() methods. Then create as many instances as you like using the constructors. It is anticipated that this seed generator will often be used as the default seed generator following an initialization from user input.
NOTE: For obvious reasons, the initial seed should be as least as long as the longest seed that later is to be deducted from it. Also, as this classes uses the system's default PRNG (usually SHA256SRandom), so it can never generate true random seeds longer than the PRNG digest (256 bits for SHA256Random).
seedGenListener
Constructor and Description |
---|
MetaSeedGenerator()
Initialize generation of a seed with the default amount of randomness (160
bit).
|
MetaSeedGenerator(int numBits)
Initialize generation of a seed with the specified amount of randomness.
|
Modifier and Type | Method and Description |
---|---|
byte[] |
getSeed()
Get the seed.
|
int[] |
getStatus()
Return the status of seed generation.
|
static void |
setSeed(byte[] seed)
Set the initial seed to this byte array.
|
getDefault, getSeedLength, hasSeedLengthChanged, reinit, setDefault, setSeedLength
callSeedGenListener, getDefault, getDefaultSeedGenerator, seedAvailable, setDefaultSeedGenerator, setSeedGenListener
public MetaSeedGenerator()
public MetaSeedGenerator(int numBits) throws RandomException
setSeed()
. See the notes at the top of this class about the
value of this number.RandomException
public static void setSeed(byte[] seed)
public int[] getStatus()
{numBits, numBits}
, i.e. it is always ok to call getSeed().getStatus
in class SeedGenerator
public byte[] getSeed()
numBits
getSeed
in class SeedGenerator