public class HashSP800DRBG extends java.lang.Object implements SP80090DRBG
| Constructor and Description |
|---|
HashSP800DRBG(Digest digest,
int securityStrength,
EntropySource entropySource,
byte[] personalizationString,
byte[] nonce)
Construct a SP800-90A Hash DRBG.
|
| Modifier and Type | Method and Description |
|---|---|
int |
generate(byte[] output,
byte[] additionalInput,
boolean predictionResistant)
Populate a passed in array with random data.
|
int |
getBlockSize()
Return the block size (in bits) of the DRBG.
|
void |
reseed(byte[] additionalInput)
Reseed the DRBG.
|
public HashSP800DRBG(Digest digest, int securityStrength, EntropySource entropySource, byte[] personalizationString, byte[] nonce)
Minimum entropy requirement is the security strength requested.
digest - source digest to use for DRB stream.securityStrength - security strength required (in bits)entropySource - source of entropy to use for seeding/reseeding.personalizationString - personalization string to distinguish this DRBG (may be null).nonce - nonce to further distinguish this DRBG. SP 800-90A Rev. 1 sec. 8.6.7 requires either a
value with at least (securityStrength / 2) bits of entropy, or a value expected to repeat no more often
than a (securityStrength / 2)-bit random string would. The nonce may be null if the entropy source
supplies the nonce's entropy along with the entropy input, that is, at least (3 * securityStrength / 2)
bits on each request (SP 800-90A Rev. 1 sec. 8.6.7 and 9.1). A null nonce with an entropy source
supplying less is still accepted, but the DRBG is then not compliant; this is not checked.public int getBlockSize()
getBlockSize in interface SP80090DRBGpublic int generate(byte[] output,
byte[] additionalInput,
boolean predictionResistant)
generate in interface SP80090DRBGoutput - output array for generated bits.additionalInput - additional input to be added to the DRBG in this step.predictionResistant - true if a reseed should be forced, false otherwise.public void reseed(byte[] additionalInput)
reseed in interface SP80090DRBGadditionalInput - additional input to be added to the DRBG in this step.