ippsHashDRBG_Instantiate#
Instantiates the Hash DRBG.
Syntax#
IppStatus ippsHashDRBG_Instantiate(const int requestedInstSecurityStrength,
const int predictionResistanceFlag,
const Ipp8u* persStr,
const int persStrBitsLen,
IppsHashDRBG_EntropyInputCtx* pEntrInputCtx,
IppsHashDRBGState* pDrbgCtx);
Include Files#
ippcp.h
Parameters#
requestedInstSecurityStrength |
A requested security strength for the instantiation. |
predictionResistanceFlag |
Indicates whether or not prediction resistance may be required during requests for pseudorandom bits. |
persStr |
Pointer to the array providing additional bytes for producing a seed (optional but recommended). |
persStrBitsLen |
Length of the |
pEntrInputCtx |
Pointer to the Entropy input context.
The size is equal to the value returned by |
pDrbgCtx |
Pointer to the |
Note
Based on the value of
requestedInstSecurityStrength, the security strength of the Hash DRBG can be changed and set to the value greater than or equal torequestedInstSecurityStrengthfrom the set {128, 192, 256}.The entropy input used in the
ippsHashDRBG_Instantiateshall consist of entropy and a nonce, with a total length equal to or greater than the sum of the security strength and one-half the security strength.
Description#
The instantiate function:
Obtains entropy input (including nonce) using the following priority order:
Custom callback: calls
getEntropyInput()if not NULL.Hardware RDSEED: calls
ippsTRNGenRDSEED()if CPU supports RDSEED instruction.Hardware RDRAND: calls
ippsPRNGenRDRAND()if CPU supports RDRAND instruction.
Checks whether the entropy is sufficient to support the security strength.
Combines entropy input with a personalization string, produces a seed and updates the state.
Return Values#
ippStsNoErr |
Indicates no error. All single operations executed without errors. Any other value indicates an error. |
ippStsNullPtrErr |
|
ippStsContextMatchErr |
If the Hash DRBG identifier doesn’t match. If the Entropy input context identifier doesn’t match. |
ippStsOutOfRangeErr |
The length of the |
ippStsBadArgErr |
The |
ippStsNotSupportedModeErr |
The CPU supports neither |
ippStsHashOperationErr |
An error status code was returned during hashing operations. |