14 #ifndef MCUXCLEXAMPLE_SESSION_HELPER_H_ 15 #define MCUXCLEXAMPLE_SESSION_HELPER_H_ 17 #include <mcuxClConfig.h> 18 #include <mcuxClCore_Platform.h> 22 #include <platform_specific_headers.h> 33 #define MCUXCLEXAMPLE_ALLOCATE_CPUWA(cpuWaLength) ((cpuWaLength?cpuWaLength:(sizeof(uint32_t))) / (sizeof(uint32_t))) // always allocate a minimum size buffer to avoid issues 34 #define MCUXCLEXAMPLE_ALLOCATE_PKCWA(pkcWaLength) ((pkcWaLength?pkcWaLength:(sizeof(uint32_t))) / (sizeof(uint32_t))) // always allocate a minimum size buffer to avoid issues 36 #define MCUXCLEXAMPLE_ALLOCATE_CPUWA(cpuWaLength) (cpuWaLength?cpuWaLength:1u) // always allocate a minimum size buffer to avoid issues 37 #define MCUXCLEXAMPLE_ALLOCATE_PKCWA(pkcWaLength) (pkcWaLength?pkcWaLength:1u) // always allocate a minimum size buffer to avoid issues 40 #define MCUXCLEXAMPLE_ALLOCATE_AND_INITIALIZE_SESSION(pSession, cpuWaLength, pkcWaLength) \ 41 uint32_t cpuWaBuffer[MCUXCLEXAMPLE_ALLOCATE_CPUWA(cpuWaLength)]; \ 42 MCUX_CSSL_FP_FUNCTION_CALL_BEGIN(si_status, token, mcuxClSession_init( \ 46 (uint32_t *) PKC_RAM_ADDR, \ 50 if((MCUX_CSSL_FP_FUNCTION_CALLED(mcuxClSession_init) != token) || (MCUXCLSESSION_STATUS_OK != si_status)) \ 54 MCUX_CSSL_FP_FUNCTION_CALL_END(); #define MCUX_CSSL_FP_FUNCTION_CALLED(...)
Expectation of a called function.
Definition: mcuxCsslFlowProtection.h:730
Provides the API for the CSSL flow protection mechanism.
mcuxClSession_Status_t mcuxClSession_cleanup(mcuxClSession_Handle_t pSession)
Clean up a Crypto Library session.
#define MCUXCLSESSION_STATUS_OK
Session operation successful.
Definition: mcuxClSession_Types.h:44
mcuxClSession_Status_t mcuxClSession_destroy(mcuxClSession_Handle_t pSession)
Destroy a Crypto Library session.
#define MCUX_CSSL_FP_FUNCTION_CALL_BEGIN(...)
Call a flow protected function and check the protection token.
Definition: mcuxCsslFlowProtection.h:576
#define MCUX_CSSL_FP_FUNCTION_DEF(...)
Definition of a flow protected function.
Definition: mcuxCsslFlowProtection.h:159
Top-level include file for the mcuxClSession component.
mcuxClSession_Descriptor_t *const mcuxClSession_Handle_t
Type for mcuxClSession Handle.
Definition: mcuxClSession_Types.h:133
Definition of function identifiers for the flow protection mechanism.
#define MCUX_CSSL_FP_FUNCTION_CALL_END(...)
End a function call section started by MCUX_CSSL_FP_FUNCTION_CALL_BEGIN.
Definition: mcuxCsslFlowProtection.h:611