Example constant-time memory set (CSSL component mcuxCsslMemory).
#include <mcuxClToolchain.h>
#include <mcuxCsslMemory_Examples.h>
MCUXCSSL_MEMORY_EX_FUNCTION(mcuxCsslMemory_Set_example)
{
ALIGNED uint8_t arr[33] = { 0u };
MCUX_CSSL_PI_PROTECT(arr, 42u, 0u, sizeof(arr)),
arr,
42u,
0u,
sizeof(arr)
));
{
return MCUXCSSLMEMORY_EX_ERROR;
}
MCUX_CSSL_ANALYSIS_START_SUPPRESS_NULL_POINTER_CONSTANT("NULL is used in code")
MCUX_CSSL_PI_PROTECT(NULL, 42u, sizeof(arr), sizeof(arr)),
NULL,
42u,
sizeof(arr),
sizeof(arr)
));
MCUX_CSSL_ANALYSIS_STOP_SUPPRESS_NULL_POINTER_CONSTANT()
{
return MCUXCSSLMEMORY_EX_ERROR;
}
MCUX_CSSL_PI_PROTECT(arr, 42u, sizeof(arr), sizeof(arr)),
arr,
42u,
sizeof(arr),
sizeof(arr)
));
{
return MCUXCSSLMEMORY_EX_ERROR;
}
return MCUXCSSLMEMORY_EX_OK;
}
Provides the API for the CSSL flow protection mechanism.
Definition of function identifiers for the flow protection mechanism.
Top-level include file for the CSSL memory functions.
Top-level include file for the parameter integrity protection mechanism.
#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 MCUXCSSLMEMORY_STATUS_INVALID_PARAMETER
A parameter was invalid.
Definition mcuxCsslMemory_Constants.h:52
#define MCUXCSSLMEMORY_STATUS_OK
The operation was successful.
Definition mcuxCsslMemory_Constants.h:48
mcuxCsslMemory_Status_t mcuxCsslMemory_Set(mcuxCsslParamIntegrity_Checksum_t chk, void *pDst, uint8_t val, uint32_t length, uint32_t bufLength)
Set length bytes of data at pDst.