MCUX CLNS
MCUX Crypto Library Normal Secure
mcuxClRandom_Functions

Defines all functions of mcuxClRandom. More...

Functions

mcuxClRandom_Status_t mcuxClRandom_init (mcuxClSession_Handle_t pSession, mcuxClRandom_Context_t pContext, mcuxClRandom_Mode_t mode)
 Random data generator initialization function. More...
 
mcuxClRandom_Status_t mcuxClRandom_reseed (mcuxClSession_Handle_t pSession)
 Random data generator reseed function. More...
 
mcuxClRandom_Status_t mcuxClRandom_generate (mcuxClSession_Handle_t pSession, uint8_t *pOut, uint32_t outLength)
 Random data generation function. More...
 
mcuxClRandom_Status_t mcuxClRandom_uninit (mcuxClSession_Handle_t pSession)
 Random data generator uninitialization function. More...
 
mcuxClRandom_Status_t mcuxClRandom_selftest (mcuxClSession_Handle_t pSession, mcuxClRandom_Mode_t mode)
 Random data generator self-test function. More...
 
mcuxClRandom_Status_t mcuxClRandom_checkSecurityStrength (mcuxClSession_Handle_t pSession, uint32_t securityStrength)
 Random data generator security strength check. More...
 
mcuxClRandom_Status_t mcuxClRandom_ncInit (mcuxClSession_Handle_t pSession)
 Non-cryptographic PRNG initialization function. More...
 
mcuxClRandom_Status_t mcuxClRandom_ncGenerate (mcuxClSession_Handle_t pSession, uint8_t *pOut, uint32_t outLength)
 Non-cryptographic PRNG data generation function. More...
 

Detailed Description

Defines all functions of mcuxClRandom.

Function Documentation

◆ mcuxClRandom_init()

mcuxClRandom_Status_t mcuxClRandom_init ( mcuxClSession_Handle_t  pSession,
mcuxClRandom_Context_t  pContext,
mcuxClRandom_Mode_t  mode 
)

Random data generator initialization function.

This function performs the initialization of a random data generator. This operation initializes the Random context referenced in the session handle.

Parameters
[in]pSessionHandle for the current CL session.
[in]pContextPointer to a Random data context buffer large enough to hold the context for the selected mode
[in]modeMode of operation for random data generator.
Returns
status
Examples
mcuxClRandomModes_CtrDrbg_AES256_DRG3_example.c, mcuxClRandomModes_CtrDrbg_AES256_DRG4_example.c, mcuxClRandomModes_CtrDrbg_AES256_ELS_example.c, mcuxClRandomModes_Different_Sessions_example.c, mcuxClRandomModes_ELS_example.c, mcuxClRandomModes_PatchMode_CtrDrbg_AES256_DRG3_example.c, mcuxClRandomModes_TestMode_CtrDrbg_AES256_DRG4_example.c, and mcuxClRandomModes_TestMode_CtrDrbg_AES256_PTG3_example.c.

◆ mcuxClRandom_reseed()

mcuxClRandom_Status_t mcuxClRandom_reseed ( mcuxClSession_Handle_t  pSession)

Random data generator reseed function.

This function performs the reseeding of a random data generator. This operation fetches a fresh seed from a TRNG and updates the state in the Random context referenced in the session handle.

Parameters
[in]pSessionHandle for the current CL session.
Returns
status
Examples
mcuxClRandomModes_CtrDrbg_AES256_DRG3_example.c, mcuxClRandomModes_CtrDrbg_AES256_DRG4_example.c, mcuxClRandomModes_CtrDrbg_AES256_ELS_example.c, mcuxClRandomModes_Different_Sessions_example.c, mcuxClRandomModes_TestMode_CtrDrbg_AES256_DRG4_example.c, and mcuxClRandomModes_TestMode_CtrDrbg_AES256_PTG3_example.c.

◆ mcuxClRandom_generate()

mcuxClRandom_Status_t mcuxClRandom_generate ( mcuxClSession_Handle_t  pSession,
uint8_t *  pOut,
uint32_t  outLength 
)

Random data generation function.

This function generates random data based on the information contained in the Random context referenced in the session handle.

Parameters
[in]pSessionHandle for the current CL session.
[out]pOutBuffer in which the generated random data must be written.
[in]outLengthNumber of random data bytes that must be written in the pOut buffer.
Returns
status
Examples
mcuxClRandomModes_CtrDrbg_AES256_DRG3_example.c, mcuxClRandomModes_CtrDrbg_AES256_DRG4_example.c, mcuxClRandomModes_CtrDrbg_AES256_ELS_example.c, mcuxClRandomModes_Different_Sessions_example.c, mcuxClRandomModes_ELS_example.c, mcuxClRandomModes_PatchMode_CtrDrbg_AES256_DRG3_example.c, mcuxClRandomModes_TestMode_CtrDrbg_AES256_DRG4_example.c, and mcuxClRandomModes_TestMode_CtrDrbg_AES256_PTG3_example.c.

◆ mcuxClRandom_uninit()

mcuxClRandom_Status_t mcuxClRandom_uninit ( mcuxClSession_Handle_t  pSession)

Random data generator uninitialization function.

This function performs the cleanup of a random data generator. This operation cleans up the Random context referenced in the session handle.

Parameters
[in]pSessionHandle for the current CL session.
Returns
status
Examples
mcuxClRandomModes_CtrDrbg_AES256_DRG3_example.c, mcuxClRandomModes_CtrDrbg_AES256_DRG4_example.c, mcuxClRandomModes_CtrDrbg_AES256_ELS_example.c, mcuxClRandomModes_Different_Sessions_example.c, mcuxClRandomModes_ELS_example.c, mcuxClRandomModes_PatchMode_CtrDrbg_AES256_DRG3_example.c, mcuxClRandomModes_TestMode_CtrDrbg_AES256_DRG4_example.c, and mcuxClRandomModes_TestMode_CtrDrbg_AES256_PTG3_example.c.

◆ mcuxClRandom_selftest()

mcuxClRandom_Status_t mcuxClRandom_selftest ( mcuxClSession_Handle_t  pSession,
mcuxClRandom_Mode_t  mode 
)

Random data generator self-test function.

This function performs a series of selft-tests on the random data generator. These tests are performed on the random data generator defined by Random context referenced in the session handle.

Parameters
[in]pSessionHandle for the current CL session.
Returns
status
Examples
mcuxClRandomModes_CtrDrbg_AES256_DRG3_example.c, mcuxClRandomModes_CtrDrbg_AES256_DRG4_example.c, mcuxClRandomModes_CtrDrbg_AES256_ELS_example.c, and mcuxClRandomModes_Different_Sessions_example.c.

◆ mcuxClRandom_checkSecurityStrength()

mcuxClRandom_Status_t mcuxClRandom_checkSecurityStrength ( mcuxClSession_Handle_t  pSession,
uint32_t  securityStrength 
)

Random data generator security strength check.

This function reports whether the the random data generator can provide the requested security strength.

Parameters
[in]pSessionHandle for the current CL session.
[in]securityStrengthRequested security strength in bits.
Returns
status

◆ mcuxClRandom_ncInit()

mcuxClRandom_Status_t mcuxClRandom_ncInit ( mcuxClSession_Handle_t  pSession)

Non-cryptographic PRNG initialization function.

This function performs the initialization of the non-cryptographic random number generator.

Parameters
[in]pSessionHandle for the current CL session.
Returns
status
Examples
mcuxClRandomModes_ELS_example.c, mcuxClRsa_sign_NoEncode_example.c, mcuxClRsa_sign_pss_sha2_256_example.c, mcuxClRsa_verify_NoVerify_example.c, and mcuxClRsa_verify_pssverify_sha2_256_example.c.

◆ mcuxClRandom_ncGenerate()

mcuxClRandom_Status_t mcuxClRandom_ncGenerate ( mcuxClSession_Handle_t  pSession,
uint8_t *  pOut,
uint32_t  outLength 
)

Non-cryptographic PRNG data generation function.

This function generates non-cryptographic random data

Parameters
[in]pSessionHandle for the current CL session.
[out]pOutBuffer in which the generated random data must be written.
[in]outLengthNumber of random data bytes that must be written in the pOut buffer.
Returns
status
Examples
mcuxClRandomModes_ELS_example.c.