MCUX CLNS
MCUX Crypto Library Normal Secure
 
Loading...
Searching...
No Matches
mcuxClEls_Aead_Functions

Defines all functions of mcuxClEls_Aead. More...

Functions

MCUXCLELS_API mcuxClEls_Status_t mcuxClEls_Aead_Init_Async (mcuxClEls_AeadOption_t options, mcuxClEls_KeyIndex_t keyIdx, uint8_t const *pKey, size_t keyLength, uint8_t const *pIV, size_t ivLength, uint8_t *pAeadCtx)
 AES-GCM initialization.
 
MCUXCLELS_API mcuxClEls_Status_t mcuxClEls_Aead_PartialInit_Async (mcuxClEls_AeadOption_t options, mcuxClEls_KeyIndex_t keyIdx, uint8_t const *pKey, size_t keyLength, uint8_t const *pIV, size_t ivLength, uint8_t *pAeadCtx)
 AES-GCM partial initialization.
 
MCUXCLELS_API mcuxClEls_Status_t mcuxClEls_Aead_UpdateAad_Async (mcuxClEls_AeadOption_t options, mcuxClEls_KeyIndex_t keyIdx, uint8_t const *pKey, size_t keyLength, uint8_t const *pAad, size_t aadLength, uint8_t *pAeadCtx)
 AES-GCM update of the Additional Authenticated Data (AAD)
 
MCUXCLELS_API mcuxClEls_Status_t mcuxClEls_Aead_UpdateData_Async (mcuxClEls_AeadOption_t options, mcuxClEls_KeyIndex_t keyIdx, uint8_t const *pKey, size_t keyLength, uint8_t const *pInput, size_t inputLength, uint8_t *pOutput, uint8_t *pAeadCtx)
 AES-GCM update of the encrypted data.
 
MCUXCLELS_API mcuxClEls_Status_t mcuxClEls_Aead_Finalize_Async (mcuxClEls_AeadOption_t options, mcuxClEls_KeyIndex_t keyIdx, uint8_t const *pKey, size_t keyLength, size_t aadLength, size_t dataLength, uint8_t *pTag, uint8_t *pAeadCtx)
 AES-GCM final encryption/decryption.
 

Detailed Description

Defines all functions of mcuxClEls_Aead.

Function Documentation

◆ mcuxClEls_Aead_Init_Async()

MCUXCLELS_API mcuxClEls_Status_t mcuxClEls_Aead_Init_Async ( mcuxClEls_AeadOption_t  options,
mcuxClEls_KeyIndex_t  keyIdx,
uint8_t const *  pKey,
size_t  keyLength,
uint8_t const *  pIV,
size_t  ivLength,
uint8_t *  pAeadCtx 
)

AES-GCM initialization.

This is the first stage of AEAD encryption/decryption. This generates the initial context out of the IV pIV and the key (pKey or keyIdx).

Call mcuxClEls_WaitForOperation to complete the operation.

Parameters
[in]optionsThe AEAD command options. For more information, see mcuxClEls_AeadOption_t.
[in]keyIdxIndex of the key inside the ELS keystore
[in]pKeyPointer to the key
[in]keyLengthSize of pKey in bytes
[in]pIVPointer to memory area that contains the IV
[in]ivLengthSize of pIV in bytes, with padding
[out]pAeadCtxPointer to the memory area that receives the AEAD context structure. Must be at least MCUXCLELS_AEAD_CONTEXT_SIZE bytes long.

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

Parameter properties
options.extkey == MCUXCLELS_AEAD_EXTERN_KEY

keyIdx is ignored.

pKey must be a valid AES key and keyLength a valid AES key size (see MCUXCLELS_CIPHER_KEY_SIZE_AES_).

options.extkey == MCUXCLELS_AEAD_INTERN_KEY

keyIdx must be a valid key index with the correct usage rights.

pKey and keyLength are ignored.

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

◆ mcuxClEls_Aead_PartialInit_Async()

MCUXCLELS_API mcuxClEls_Status_t mcuxClEls_Aead_PartialInit_Async ( mcuxClEls_AeadOption_t  options,
mcuxClEls_KeyIndex_t  keyIdx,
uint8_t const *  pKey,
size_t  keyLength,
uint8_t const *  pIV,
size_t  ivLength,
uint8_t *  pAeadCtx 
)

AES-GCM partial initialization.

This is the first stage of AEAD encryption/decryption. This generates the initial context out of the IV pIV and the key (pKey or keyIdx).

Call mcuxClEls_WaitForOperation to complete the operation.

Parameters
[in]optionsThe AEAD command options. For more information, see mcuxClEls_AeadOption_t.
[in]keyIdxIndex of the key inside the ELS keystore
[in]pKeyPointer to the key
[in]keyLengthSize of pKey in bytes
[in]pIVPointer to memory area that contains the IV
[in]ivLengthSize of pIV in bytes, with padding
[out]pAeadCtxPointer to the memory area that receives the AEAD context structure. Must be at least MCUXCLELS_AEAD_CONTEXT_SIZE bytes long.

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

Parameter properties
options.extkey == MCUXCLELS_AEAD_EXTERN_KEY

keyIdx is ignored.

pKey must be a valid AES key and keyLength a valid AES key size (see MCUXCLELS_CIPHER_KEY_SIZE_AES_).

options.extkey == MCUXCLELS_AEAD_INTERN_KEY

keyIdx must be a valid key index with the correct usage rights.

pKey and keyLength are ignored.

options.msgendw
This field is ignored
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

◆ mcuxClEls_Aead_UpdateAad_Async()

MCUXCLELS_API mcuxClEls_Status_t mcuxClEls_Aead_UpdateAad_Async ( mcuxClEls_AeadOption_t  options,
mcuxClEls_KeyIndex_t  keyIdx,
uint8_t const *  pKey,
size_t  keyLength,
uint8_t const *  pAad,
size_t  aadLength,
uint8_t *  pAeadCtx 
)

AES-GCM update of the Additional Authenticated Data (AAD)

This is the second stage of AEAD encryption/decryption. This updates the internal authentication tag with the AAD.

mcuxClEls_Aead_Init_Async must have been called before calling this function.

Call mcuxClEls_WaitForOperation to complete the operation.

Parameters
[in]optionsThe AEAD command options. For more information, see mcuxClEls_AeadOption_t.
[in]keyIdxIndex of the key inside the ELS keystore
[in]pKeyPointer to the key
[in]keyLengthSize of pKey in bytes
[in]pAadMemory area that contains the AAD
[in]aadLengthLength of the pAad in bytes with padding
[in,out]pAeadCtxPointer to the AEAD context structure. Must be at least MCUXCLELS_AEAD_CONTEXT_SIZE bytes long.

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

Parameter properties
options.extkey == MCUXCLELS_AEAD_EXTERN_KEY

keyIdx is ignored.

pKey must be a valid AES key and keyLength a valid AES key size (see MCUXCLELS_CIPHER_KEY_SIZE_AES_).

options.extkey == MCUXCLELS_AEAD_INTERN_KEY

keyIdx must be a valid key index with the correct usage rights.

pKey and keyLength are ignored.

options.msgendw
This field is ignored
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

◆ mcuxClEls_Aead_UpdateData_Async()

MCUXCLELS_API mcuxClEls_Status_t mcuxClEls_Aead_UpdateData_Async ( mcuxClEls_AeadOption_t  options,
mcuxClEls_KeyIndex_t  keyIdx,
uint8_t const *  pKey,
size_t  keyLength,
uint8_t const *  pInput,
size_t  inputLength,
uint8_t *  pOutput,
uint8_t *  pAeadCtx 
)

AES-GCM update of the encrypted data.

This is the third stage of AEAD encryption/decryption. This processes the given plaintext (in case of encryption) or ciphertext (in case of decryption) and outputs the ciphertext (in case of encryption) or plaintext (in case of decryption).

mcuxClEls_Aead_Init_Async, mcuxClEls_Aead_UpdateAad_Async must have been called before calling this function.

Call mcuxClEls_WaitForOperation to complete the operation.

Parameters
[in]optionsThe AEAD command options. For more information, see mcuxClEls_AeadOption_t.
[in]keyIdxIndex of the key inside the ELS keystore
[in]pKeyPointer to the key
[in]keyLengthSize of pKey in bytes
[in]pInputPointer to the memory location of the data to be processed
[in]inputLengthSize of pInput in bytes with padding
[out]pOutputPointer to the processed data memory location
[in,out]pAeadCtxPointer to the AEAD context structure. Must be at least MCUXCLELS_AEAD_CONTEXT_SIZE bytes long.

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

Parameter properties
options.extkey == MCUXCLELS_AEAD_EXTERN_KEY

keyIdx is ignored.

pKey must be a valid AES key and keyLength a valid AES key size (see MCUXCLELS_CIPHER_KEY_SIZE_AES_).

options.extkey == MCUXCLELS_AEAD_INTERN_KEY

keyIdx must be a valid key index with the correct usage rights.

pKey and keyLength are ignored.

options.msgendw
This field has to be set to the size of the last data block (plain/cipher text) in bytes, without padding. In case the last block is a full block, this field has to be set to 0.
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

◆ mcuxClEls_Aead_Finalize_Async()

MCUXCLELS_API mcuxClEls_Status_t mcuxClEls_Aead_Finalize_Async ( mcuxClEls_AeadOption_t  options,
mcuxClEls_KeyIndex_t  keyIdx,
uint8_t const *  pKey,
size_t  keyLength,
size_t  aadLength,
size_t  dataLength,
uint8_t *  pTag,
uint8_t *  pAeadCtx 
)

AES-GCM final encryption/decryption.

This is the fourth stage of AEAD encryption/decryption. This updates the authentication tag with the final data length block and outputs the tag at the desired location.

mcuxClEls_Aead_Init_Async, mcuxClEls_Aead_UpdateAad_Async and mcuxClEls_Aead_UpdateData_Async must have been called before calling this function.

Call mcuxClEls_WaitForOperation to complete the operation.

Parameters
[in]optionsThe AEAD command options. For more information, see mcuxClEls_AeadOption_t.
[in]keyIdxIndex of the key inside the ELS keystore
[in]pKeyPointer to the key
[in]keyLengthSize of pKey in bytes
[in]aadLengthLength of the complete Additional Authenticated Data (AAD) in bytes, without padding.
[in]dataLengthLength of the complete plaintext/ciphertext in bytes, without padding.
[out]pTagPointer where the resulting tag will be stored
[in]pAeadCtxPointer to the AEAD context structure. Must be at least MCUXCLELS_AEAD_CONTEXT_SIZE bytes long.

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

Parameter properties
options.extkey == MCUXCLELS_AEAD_EXTERN_KEY

keyIdx is ignored.

pKey must be a valid AES key and keyLength a valid AES key size (see MCUXCLELS_CIPHER_KEY_SIZE_AES_).

options.extkey == MCUXCLELS_AEAD_INTERN_KEY

keyIdx must be a valid key index with the correct usage rights.

pKey and keyLength are ignored.

options.msgendw
This field is ignored
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