MCUX CLNS
MCUX Crypto Library Normal Secure
mcuxCsslMemory_Copy Function Definitions

mcuxCsslMemory_Copy Function Definitions More...

Functions

mcuxCsslMemory_Status_t mcuxCsslMemory_Copy (mcuxCsslParamIntegrity_Checksum_t chk, void const *pSrc, void *pDst, size_t dstLength, size_t length)
 Copies length bytes of data from pSrc to pDst. More...
 

Detailed Description

mcuxCsslMemory_Copy Function Definitions

Function Documentation

◆ mcuxCsslMemory_Copy()

mcuxCsslMemory_Status_t mcuxCsslMemory_Copy ( mcuxCsslParamIntegrity_Checksum_t  chk,
void const *  pSrc,
void *  pDst,
size_t  dstLength,
size_t  length 
)

Copies length bytes of data from pSrc to pDst.

The implementation is secure in the following aspects:

  • Constant execution time: If pSrc and pDst have the same offset to the nearest 16-byte boundary, and if length is the same, the execution sequence of the code is always identical.
  • Parameter integrity protection: An incorrect parameter checksum makes the function return immediately.
  • Code flow protection: The function call is protected. Additionally, the result depends on all steps of the calculation.
  • Buffer overflow protection: No data is written to pDst beyond dstLength bytes.
Parameters
[in]chkThe parameter checksum, generated with mcuxCsslParamIntegrity_Protect.
[in]pSrcThe data to be copied. Must not be NULL. Must not overlap with pDst.
[out]pDstThe destination pointer. Must not be NULL. Must not overlap with pSrc.
[in]dstLengthThe size of the destination data buffer in bytes.
[in]lengthThe number of bytes to copy. Must be different from zero.
Returns
A status code encapsulated in a flow-protection type.
Return values
MCUXCSSLMEMORY_STATUS_OKIf the operation was successful.
MCUXCSSLMEMORY_STATUS_INVALID_PARAMETERIf one of the parameters was invalid (i.e. pSrc or pDst was NULL or length was zero).
MCUXCSSLMEMORY_STATUS_FAULTIf a fault was detected.