Defines all functions of mcuxClEls_Cipher. More...
Functions | |
MCUXCLELS_API mcuxClEls_Status_t | mcuxClEls_Cipher_Async (mcuxClEls_CipherOption_t options, mcuxClEls_KeyIndex_t keyIdx, uint8_t const *pKey, size_t keyLength, uint8_t const *pInput, size_t inputLength, uint8_t *pIV, uint8_t *pOutput) |
Performs AES encryption/decryption. More... | |
Defines all functions of mcuxClEls_Cipher.
MCUXCLELS_API mcuxClEls_Status_t mcuxClEls_Cipher_Async | ( | mcuxClEls_CipherOption_t | options, |
mcuxClEls_KeyIndex_t | keyIdx, | ||
uint8_t const * | pKey, | ||
size_t | keyLength, | ||
uint8_t const * | pInput, | ||
size_t | inputLength, | ||
uint8_t * | pIV, | ||
uint8_t * | pOutput | ||
) |
Performs AES encryption/decryption.
Performs an AES encryption/decryption. Call mcuxClEls_WaitForOperation to complete the operation.
[in] | options | Encryption/decryption command options. For detailed information, see mcuxClEls_CipherOption_t. |
[in] | keyIdx | Index of the key inside the ELS keystore. See parameter properties section in function description. |
[in] | pKey | Memory area that contains the key. See parameter properties section in function description. |
[in] | keyLength | Size of pKey in bytes. Must be a valid key size of MCUXCLELS_CIPHER_KEY_SIZE_AES_. See parameter properties section in function description. |
[in] | pInput | Pointer to the input data to be encrypted/decrypted. Padding must be already applied. |
[in] | inputLength | Size of pInput in bytes, must be a multiple of the block size. |
[in,out] | pIV | A pointer to the memory location which contains/receives the IV/state of cipher. See parameter properties section in function description. |
[out] | pOutput | Pointer to the output buffer to store encrypted/decrypted data. |
The properties of some parameters change with respect to selected options.
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>
MCUXCLELS_STATUS_SW_CANNOT_INTERRUPT | if a running operation prevented the request |
MCUXCLELS_STATUS_OK_WAIT | on successful request |