ippsHashDRBG_InstantiateTest

ippsHashDRBG_InstantiateTest#

Performs known-answer testing the ippsHashDRBG_Instantiate function on demand.

Syntax#

IppStatus ippsHashDRBG_InstantiateTest(IppsHashDRBG_EntropyInputCtx* pEntrInputCtxTempBuf,
                                       IppsHashDRBGState* pDrbgCtxTempBuf);

Include Files#

ippcp.h

Parameters#

pEntrInputCtxTempBuf

Pointer to a temporarily allocated buffer used to store the Entropy input context.

pDrbgCtxTempBuf

Pointer to a temporarily allocated buffer used to store the Hash DRBG state.

Note

Important

Separate buffers must be allocated for the Entropy input context and the Hash DRBG state and passed to the ippsHashDRBG_InstantiateTest function. Otherwise, the current state of working buffers will be corrupted, resulting in incorrect pseudorandom number sequences.

Description#

This function initializes pEntrInputCtxTempBuf and pDrbgCtxTempBuf context buffers and then performs known-answer testing the ippsHashDRBG_Instantiate function using the minimum security strength, representative values for the entropy input, nonce and personalization string, and the requested prediction resistance.

Return Values#

ippStsNoErr

Indicates no error. All single operations executed without errors. The values used during the test produce the expected results.

ippStsNullPtrErr

pEntrInputCtxTempBuf or pDrbgCtxTempBuf is a NULL pointer. The pointer to the buffer that contains the entropy input is NULL.

ippStsContextMatchErr

If the Entropy input context identifier or the Hash DRBG identifier doesn’t match.

ippStsOutOfRangeErr

entrInputBufBitsLen < 1.

ippStsNotSupportedModeErr

The CPU does not support the RDSEED and/or RDRAND instructions.

ippStsHashOperationErr

An error status code was returned during hashing operations.