14#ifndef MCUXCLEXAMPLE_RNG_HELPER_H_
15#define MCUXCLEXAMPLE_RNG_HELPER_H_
17#include <mcuxClConfig.h>
18#include <mcuxClCore_Platform.h>
26#define MCUXCLEXAMPLE_ALLOCATE_RNG_CTXT(rngCtxLength) (rngCtxLength?((rngCtxLength + sizeof(uint32_t) - 1u) / sizeof(uint32_t)):1u)
35#define MCUXCLEXAMPLE_ALLOCATE_AND_INITIALIZE_RNG(pSession, rngCtxLength, mode) \
36 uint32_t context[MCUXCLEXAMPLE_ALLOCATE_RNG_CTXT(rngCtxLength)] = {0}; \
37 mcuxClRandom_Context_t pRng_ctx = (mcuxClRandom_Context_t)context; \
40 MCUX_CSSL_FP_FUNCTION_CALL_BEGIN(randomInit_result, randomInit_token, mcuxClRandom_init(pSession, \
43 if((MCUX_CSSL_FP_FUNCTION_CALLED(mcuxClRandom_init) != randomInit_token) || (MCUXCLRANDOM_STATUS_OK != randomInit_result)) \
45 return MCUXCLEXAMPLE_STATUS_ERROR; \
47 MCUX_CSSL_FP_FUNCTION_CALL_END(); \
49 MCUXCLEXAMPLE_INITIALIZE_PRNG(pSession);
52#define MCUXCLEXAMPLE_INITIALIZE_PRNG(session) \
54 MCUX_CSSL_ANALYSIS_START_SUPPRESS_DEREFERENCE_NULL_POINTER("session->apiCall is not NULL") \
55 MCUX_CSSL_FP_FUNCTION_CALL_BEGIN(prngInit_result, prngInit_token, mcuxClRandom_ncInit(session)); \
56 MCUX_CSSL_ANALYSIS_STOP_SUPPRESS_DEREFERENCE_NULL_POINTER() \
57 if((MCUX_CSSL_FP_FUNCTION_CALLED(mcuxClRandom_ncInit) != prngInit_token) || (MCUXCLRANDOM_STATUS_OK != prngInit_result)) \
59 return MCUXCLEXAMPLE_STATUS_ERROR; \
61 MCUX_CSSL_FP_FUNCTION_CALL_END()
Definition of function identifiers for the flow protection mechanism.
Top level header of mcuxClRandom component.
Top level header of mcuxClRandomModes component.
Provides the API for the CSSL flow protection mechanism.