Example for the mcuxClRandomModes component.
#include <mcuxClToolchain.h>
#include <mcuxClExample_Session_Helper.h>
#include <mcuxClCore_Examples.h>
MCUXCLEXAMPLE_FUNCTION(mcuxClRandomModes_CtrDrbg_AES256_DRG4_example)
{
mcuxClSession_Descriptor_t sessionDesc;
MCUXCLEXAMPLE_ALLOCATE_AND_INITIALIZE_SESSION(session, MCUXCLRANDOMMODES_MAX_CPU_WA_BUFFER_SIZE, 0u);
session,
));
{
return MCUXCLEXAMPLE_STATUS_ERROR;
}
uint32_t context[MCUXCLRANDOMMODES_CTR_DRBG_AES256_CONTEXT_SIZE_IN_WORDS] = {0};
session,
));
{
return MCUXCLEXAMPLE_STATUS_ERROR;
}
ALIGNED uint8_t drbg_data1[3u];
ALIGNED uint8_t drbg_data2[16u];
ALIGNED uint8_t drbg_data3[31u];
session,
drbgBuf1,
sizeof(drbg_data1)));
{
return MCUXCLEXAMPLE_STATUS_ERROR;
}
session,
drbgBuf2,
sizeof(drbg_data2)));
{
return MCUXCLEXAMPLE_STATUS_ERROR;
}
{
return MCUXCLEXAMPLE_STATUS_ERROR;
}
session,
drbgBuf3,
sizeof(drbg_data3)));
{
return MCUXCLEXAMPLE_STATUS_ERROR;
}
{
return MCUXCLEXAMPLE_STATUS_ERROR;
}
if(!mcuxClExample_Session_Clean(session))
{
return MCUXCLEXAMPLE_STATUS_ERROR;
}
return MCUXCLEXAMPLE_STATUS_OK;
}
Definition of function identifiers for the flow protection mechanism.
Top level header of mcuxClRandom component.
Top level header of mcuxClRandomModes component.
Top-level include file for the mcuxClSession component.
Provides the API for the CSSL flow protection mechanism.
#define MCUXCLBUFFER_INIT(name, info, ptr, size)
Initialize an input/output buffer (mcuxCl_Buffer_t).
Definition mcuxClBuffer.h:67
mcuxClRandom_Status_t mcuxClRandom_selftest(mcuxClSession_Handle_t pSession, mcuxClRandom_Mode_t mode)
Random data generator self-test function.
mcuxClRandom_Status_t mcuxClRandom_reseed(mcuxClSession_Handle_t pSession)
Random data generator reseed function.
mcuxClRandom_Status_t mcuxClRandom_generate(mcuxClSession_Handle_t pSession, mcuxCl_Buffer_t pOut, uint32_t outLength)
Random data generation function.
mcuxClRandom_Status_t mcuxClRandom_uninit(mcuxClSession_Handle_t pSession)
Random data generator uninitialization function.
mcuxClRandom_Status_t mcuxClRandom_init(mcuxClSession_Handle_t pSession, mcuxClRandom_Context_t pContext, mcuxClRandom_Mode_t mode)
Random data generator initialization function.
mcuxClRandom_ContextDescriptor_t * mcuxClRandom_Context_t
Random context type.
Definition mcuxClRandom_Types.h:71
#define mcuxClRandomModes_Mode_CtrDrbg_AES256_DRG4
Mode for a NIST SP800-90A CTR_DRBG based on AES-256 configured to not provide prediction resistance a...
Definition mcuxClRandomModes_Constants.h:74
mcuxClSession_Descriptor_t *const mcuxClSession_Handle_t
Type for mcuxClSession Handle.
Definition mcuxClSession_Types.h:98
#define MCUX_CSSL_FP_FUNCTION_CALL_BEGIN(...)
Call a flow protected function and check the protection token.
Definition mcuxCsslFlowProtection.h:623
#define MCUX_CSSL_FP_FUNCTION_CALLED(...)
Expectation of a called function.
Definition mcuxCsslFlowProtection.h:777
#define MCUX_CSSL_FP_FUNCTION_CALL_END(...)
End a function call section started by MCUX_CSSL_FP_FUNCTION_CALL_BEGIN.
Definition mcuxCsslFlowProtection.h:658
#define MCUXCLRANDOM_STATUS_OK
Random function returned successfully.
Definition mcuxClRandom_Constants.h:46