MCUX CLNS
MCUX Crypto Library Normal Secure
mcuxClEls_Cipher_Functions

Defines all functions of mcuxClEls_Cipher. More...

Functions

MCUXCLELS_API MCUX_CSSL_FP_PROTECTED_TYPE (mcuxClEls_Status_t) mcuxClEls_Cipher_Async(mcuxClEls_CipherOption_t options
 Performs AES encryption/decryption. More...
 

Variables

MCUXCLELS_API mcuxClEls_KeyIndex_t keyIdx
 
MCUXCLELS_API mcuxClEls_KeyIndex_t uint8_t const * pKey
 
MCUXCLELS_API mcuxClEls_KeyIndex_t uint8_t const size_t keyLength
 
MCUXCLELS_API mcuxClEls_KeyIndex_t uint8_t const size_t uint8_t const * pInput
 
MCUXCLELS_API mcuxClEls_KeyIndex_t uint8_t const size_t uint8_t const size_t inputLength
 
MCUXCLELS_API mcuxClEls_KeyIndex_t uint8_t const size_t uint8_t const size_t uint8_t * pIV
 
MCUXCLELS_API mcuxClEls_KeyIndex_t uint8_t const size_t uint8_t const size_t uint8_t uint8_t * pOutput
 

Detailed Description

Defines all functions of mcuxClEls_Cipher.

Function Documentation

◆ MCUX_CSSL_FP_PROTECTED_TYPE()

MCUXCLELS_API MCUX_CSSL_FP_PROTECTED_TYPE ( mcuxClEls_Status_t  )

Performs AES encryption/decryption.

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.

Performs an AES encryption/decryption. Call #mcuxClEls_WaitForOperation to complete the operation.

Parameters
[in]optionsEncryption/decryption command options. For detailed information, see mcuxClEls_CipherOption_t.
[in]keyIdxIndex of the key inside the ELS keystore. See parameter properties section in function description.
[in]pKeyMemory area that contains the key. See parameter properties section in function description.
[in]keyLengthSize of pKey in bytes. Must be a valid key size of MCUXCLELS_CIPHER_KEY_SIZE_AES_. See parameter properties section in function description.
[in]pInputPointer to the input data to be encrypted/decrypted. Padding must be already applied.
[in]inputLengthSize of pInput in bytes, must be a multiple of the block size.
[in,out]pIVA pointer to the memory location which contains/receives the IV/state of cipher. See parameter properties section in function description.
[out]pOutputPointer to the output buffer to store encrypted/decrypted data.

The properties of some parameters change with respect to selected options.

Parameter properties
options.cphmde == MCUXCLELS_CIPHERPARAM_ALGORITHM_AES_ECB

pIV is ignored.

options.cphmde == MCUXCLELS_CIPHERPARAM_ALGORITHM_AES_CBC

pIV must be set to the IV (when encrypting the first block) or to the last block of the ciphertext of the previous operation. ELS will always read and write to this location.

options.cphsie is ignored.

     @p options.cphsoe is ignored.</dd>

 <dt>@p options.cphmde == #MCUXCLELS_CIPHERPARAM_ALGORITHM_AES_CTR</dt>
     <dd>@p pIV must be set to the IV (when encrypting the first block) or to the state output of the previous
     encryption/decryption operation. ELS will write to this location if @p options.cphsoe == #MCUXCLELS_CIPHER_STATE_OUT_ENABLE.</dd>

 <dt>@p options.extkey == #MCUXCLELS_CIPHER_EXTERNAL_KEY</dt>
     <dd>@p keyIdx is ignored.</dd>

 <dt>@p options.extkey == #MCUXCLELS_CIPHER_INTERNAL_KEY</dt>
     <dd>@p pKey is ignored.

     @p keyLength is ignored.</dd>

Returns
An error code that can be any error code in MCUXCLELS_STATUS_, see individual documentation for more information
Return values
MCUXCLELS_STATUS_SW_INVALID_PARAMif invalid parameters were specified
MCUXCLELS_STATUS_SW_CANNOT_INTERRUPTif a running operation prevented the request
MCUXCLELS_STATUS_OK_WAITon successful request