34#ifndef MCUXCLEXAMPLE_RNG_HELPER_H_
35#define MCUXCLEXAMPLE_RNG_HELPER_H_
37#include <mcuxClConfig.h>
38#include <mcuxClCore_Platform.h>
46#define MCUXCLEXAMPLE_ALLOCATE_RNG_CTXT(rngCtxLength) (rngCtxLength?((rngCtxLength + sizeof(uint32_t) - 1u) / sizeof(uint32_t)):1u)
55#define MCUXCLEXAMPLE_ALLOCATE_AND_INITIALIZE_RNG(pSession, rngCtxLength, mode) \
56 uint32_t context[MCUXCLEXAMPLE_ALLOCATE_RNG_CTXT(rngCtxLength)] = {0}; \
57 mcuxClRandom_Context_t pRng_ctx = (mcuxClRandom_Context_t)context; \
60 MCUX_CSSL_FP_FUNCTION_CALL_BEGIN(randomInit_result, randomInit_token, mcuxClRandom_init(pSession, \
63 if((MCUX_CSSL_FP_FUNCTION_CALLED(mcuxClRandom_init) != randomInit_token) || (MCUXCLRANDOM_STATUS_OK != randomInit_result)) \
65 return MCUXCLEXAMPLE_STATUS_ERROR; \
67 MCUX_CSSL_FP_FUNCTION_CALL_END(); \
69 MCUXCLEXAMPLE_INITIALIZE_PRNG(pSession);
72#define MCUXCLEXAMPLE_INITIALIZE_PRNG(session) \
74 MCUX_CSSL_ANALYSIS_START_SUPPRESS_DEREFERENCE_NULL_POINTER("session->apiCall is not NULL") \
75 MCUX_CSSL_FP_FUNCTION_CALL_BEGIN(prngInit_result, prngInit_token, mcuxClRandom_ncInit(session)); \
76 MCUX_CSSL_ANALYSIS_STOP_SUPPRESS_DEREFERENCE_NULL_POINTER() \
77 if((MCUX_CSSL_FP_FUNCTION_CALLED(mcuxClRandom_ncInit) != prngInit_token) || (MCUXCLRANDOM_STATUS_OK != prngInit_result)) \
79 return MCUXCLEXAMPLE_STATUS_ERROR; \
81 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.