com.ibm.crypto.fips.provider
Interface IHashDrbg
-
-
Method Summary
Methods Modifier and Type Method and Description byte[]generate(int requested_no_of_bytes, boolean prediction_resistant, byte[] additionalInput)Generate the requested number of bytes from the DRBG From section 10.1.1.4 of NIST SP 800-90intinit(java.lang.String algorithm, int bitStrengthRequested, java.nio.ByteBuffer entropySource, boolean predictionResistant)Not really discussed in NIST document, but seems to be necessary to implement.voidinstantiate(byte[] nonce, byte[] personalization)Initialize the DRBGvoidreseed(byte[] addlInput)Add additional entropy to the DRBG.
-
-
-
Method Detail
-
instantiate
void instantiate(byte[] nonce, byte[] personalization)Initialize the DRBG- Parameters:
nonce- caller-supplied nonce (optional, may be NULL)personalization- caller-supplied personalization data (optional, may be NULL) From NIST SP 800-90, Section 10.1.1.2
-
reseed
void reseed(byte[] addlInput)
Add additional entropy to the DRBG. From NIST SP 800-90, Section 10.1.1.3- Parameters:
additionalInput- caller-supplied additional input (optional, may be NULL)
-
generate
byte[] generate(int requested_no_of_bytes, boolean prediction_resistant, byte[] additionalInput) throws java.lang.IllegalStateExceptionGenerate the requested number of bytes from the DRBG From section 10.1.1.4 of NIST SP 800-90- Parameters:
requested_no_of_bytes- how many bytes to produceprediction_resistant- whether additional entropy has been supplied through the entropySource for the generate operationadditionalInput- caller-supplied additional input (optional, may be NULL)- Returns:
- the requested number of bytes of data
- Throws:
java.lang.IllegalStateException
-
init
int init(java.lang.String algorithm, int bitStrengthRequested, java.nio.ByteBuffer entropySource, boolean predictionResistant) throws java.lang.IllegalArgumentExceptionNot really discussed in NIST document, but seems to be necessary to implement.- Parameters:
algorithm- the name of the hash algorithm to employbitStrengthRequested- the strength of the expected output (depends on strength of the algorithm above, typical values 112, 128, 192, 256)entropySource- a ByteBuffer the caller will use to supply entropy, or NULL if caller chooses not topredictionResistant- whether additional entropy will be supplied through the entropySource before generate operations- Returns:
- the number of bits of security strength the DRBG will provide (and the entropy the caller must supply through entropySource (if supplied by caller))
- Throws:
java.lang.IllegalArgumentException
-
-