TrustCore SDK Crypto Interface API reference  version 2.0
crypto_interface_fips186.h File Reference

Cryptographic Interface header file for declaring FIPS-186 RNG functions for the Crypto Interface. More...

Go to the source code of this file.

Functions

MOC_EXTERN MSTATUS CRYPTO_INTERFACE_RANDOM_deleteFIPS186Context (randomContext **ppRandomContext)
 Deletes a previously allocated FIPS186 Random Context. More...
 
MOC_EXTERN MSTATUS CRYPTO_INTERFACE_RANDOM_KSrcGenerator (randomContext *pRandomContext, ubyte buffer[40])
 Uses previously allocated FIPS186 Random Context for KSrc Generation. More...
 
MOC_EXTERN MSTATUS CRYPTO_INTERFACE_RANDOM_newFIPS186Context (randomContext **ppRandomContext, ubyte b, const ubyte pXKey[], sbyte4 seedLen, const ubyte pXSeed[])
 Allocates a new FIPS186 Random Context. More...
 
MOC_EXTERN MSTATUS CRYPTO_INTERFACE_RANDOM_numberGeneratorFIPS186 (randomContext *pRandomContext, ubyte *pRetRandomBytes, sbyte4 numRandomBytes)
 Generates pseudo-random bytes via a previously allocated FIPS186 Random Context. More...
 
MOC_EXTERN MSTATUS CRYPTO_INTERFACE_RANDOM_seedFIPS186Context (randomContext *pRandomCtx, ubyte *pSeed, ubyte4 seedLen)
 Seed a previously allocated FIPS186 Random Context. More...
 

Detailed Description

crypto_interface_fips186.h

Copyright 2019-2024 DigiCert, Inc. All Rights Reserved. Proprietary and Confidential Material.

Function Documentation

◆ CRYPTO_INTERFACE_RANDOM_deleteFIPS186Context()

MOC_EXTERN MSTATUS CRYPTO_INTERFACE_RANDOM_deleteFIPS186Context ( randomContext **  ppRandomContext)
Parameters
ppRandomContextThe location of the pointer to the context to be deleted.
Returns
OK (0) if successful; otherwise a negative number error code definition from merrors.h. To retrieve a string containing an English text error identifier corresponding to the function's returned error status, use the DISPLAY_ERROR macro.

◆ CRYPTO_INTERFACE_RANDOM_KSrcGenerator()

MOC_EXTERN MSTATUS CRYPTO_INTERFACE_RANDOM_KSrcGenerator ( randomContext *  pRandomContext,
ubyte  buffer[40] 
)
Parameters
pRandomContextPointer to a previously allocated random context.
bufferBuffer to hold the resulting generated bytes.
Returns
OK (0) if successful; otherwise a negative number error code definition from merrors.h. To retrieve a string containing an English text error identifier corresponding to the function's returned error status, use the DISPLAY_ERROR macro.

◆ CRYPTO_INTERFACE_RANDOM_newFIPS186Context()

MOC_EXTERN MSTATUS CRYPTO_INTERFACE_RANDOM_newFIPS186Context ( randomContext **  ppRandomContext,
ubyte  b,
const ubyte  pXKey[],
sbyte4  seedLen,
const ubyte  pXSeed[] 
)
Parameters
ppRandomContextThe location that will hold the pointer to the new context.
bNumber of bytes in the X key (pXKey).
pXKeyX key value.
seedLenNumber of bytes in the X seed (pXSeed).
pXSeedX seed value.
Returns
OK (0) if successful; otherwise a negative number error code definition from merrors.h. To retrieve a string containing an English text error identifier corresponding to the function's returned error status, use the DISPLAY_ERROR macro.

◆ CRYPTO_INTERFACE_RANDOM_numberGeneratorFIPS186()

MOC_EXTERN MSTATUS CRYPTO_INTERFACE_RANDOM_numberGeneratorFIPS186 ( randomContext *  pRandomContext,
ubyte *  pRetRandomBytes,
sbyte4  numRandomBytes 
)
Parameters
pRandomCtxPointer to a previously allocated random context.
pRetRandomBytesBuffer to hold the resulting pseudo-random bytes.
numRandomBytesThe number of bytes requested.
Returns
OK (0) if successful; otherwise a negative number error code definition from merrors.h. To retrieve a string containing an English text error identifier corresponding to the function's returned error status, use the DISPLAY_ERROR macro.

◆ CRYPTO_INTERFACE_RANDOM_seedFIPS186Context()

MOC_EXTERN MSTATUS CRYPTO_INTERFACE_RANDOM_seedFIPS186Context ( randomContext *  pRandomCtx,
ubyte *  pSeed,
ubyte4  seedLen 
)
Parameters
pRandomCtxPointer to a previously allocated random context.
pSeedPointer to a buffer containing the new seed material.
seedLenLength in bytes of the new seed material, must be between 20 and 64 bytes.
Returns
OK (0) if successful; otherwise a negative number error code definition from merrors.h. To retrieve a string containing an English text error identifier corresponding to the function's returned error status, use the DISPLAY_ERROR macro.