MCUX CLNS
MCUX Crypto Library Normal Secure
mcuxCsslMemory_Compare Function Definitions

mcuxCsslMemory_Compare Function Definitions More...

Functions

 MCUX_CSSL_FP_PROTECTED_TYPE (mcuxCsslMemory_Status_t) mcuxCsslMemory_Compare(mcuxCsslParamIntegrity_Checksum_t chk
 Compares the two memory regions lhs and rhs. More...
 

Variables

void const * pLhs
 
void const void const * pRhs
 
void const void const size_t length
 

Detailed Description

mcuxCsslMemory_Compare Function Definitions

Function Documentation

◆ MCUX_CSSL_FP_PROTECTED_TYPE()

MCUX_CSSL_FP_PROTECTED_TYPE ( mcuxCsslMemory_Status_t  )

Compares the two memory regions lhs and rhs.

Deprecated type for mcuxClSession protected status codes.

Deprecated type for RSA protected status codes.

Deprecated type for error codes used by code-flow protected PKC component functions.

Deprecated type for error codes used by code-flow protected mcuxClMemory component functions.

Deprecated type for error codes used by code-flow protected Math component functions.

Deprecated type for Key component error codes, returned by functions with code-flow protection.

Deprecated type for ELS driver protected status codes.

Deprecated type for mcuxClEcc component return codes.

The implementation is secure in the following aspects:

  • Constant execution time: The execution sequence of the code is always identical for equal length parameters, i.e. no branches are performed based on the data in pLhs or pRhs.
  • 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.
Parameters
chkThe parameter checksum, generated with mcuxCsslParamIntegrity_Protect.
pLhsThe left-hand side data to compare. Must not be NULL.
pRhsThe right-hand side data to compare. Must not be NULL.
lengthThe number of bytes to compare. Must be different from zero.
Returns
A status code encapsulated in a flow-protection type.
Return values
MCUXCSSLMEMORY_STATUS_EQUALIf the contents of lhs and rhs are equal.
MCUXCSSLMEMORY_STATUS_NOT_EQUALIf the contents of lhs and rhs are not equal.
MCUXCSSLMEMORY_STATUS_INVALID_PARAMETERIf one of the parameters was invalid (i.e. lhs or rhs was NULL or length was zero).
MCUXCSSLMEMORY_STATUS_FAULTIf a fault was detected.