53#ifndef MCUXCLELS_CIPHER_H_
54#define MCUXCLELS_CIPHER_H_
56#include <mcuxClConfig.h>
82#define MCUXCLELS_CIPHER_ENCRYPT 0U
83#define MCUXCLELS_CIPHER_DECRYPT 1U
85#define MCUXCLELS_CIPHER_STATE_OUT_ENABLE 1U
86#define MCUXCLELS_CIPHER_STATE_OUT_DISABLE 0U
88#ifndef MCUXCL_FEATURE_ELS_NO_INTERNAL_STATE_FLAGS
89#define MCUXCLELS_CIPHER_STATE_IN_ENABLE 1U
90#define MCUXCLELS_CIPHER_STATE_IN_DISABLE 0U
93#define MCUXCLELS_CIPHER_EXTERNAL_KEY 1U
94#define MCUXCLELS_CIPHER_INTERNAL_KEY 0U
96#define MCUXCLELS_CIPHERPARAM_ALGORITHM_AES_ECB 0x00U
97#define MCUXCLELS_CIPHERPARAM_ALGORITHM_AES_CBC 0x01U
98#define MCUXCLELS_CIPHERPARAM_ALGORITHM_AES_CTR 0x02U
107#define MCUXCLELS_CIPHER_BLOCK_SIZE_AES ((size_t) 16U)
116#define MCUXCLELS_CIPHER_KEY_SIZE_AES_128 ((size_t) 16U)
117#define MCUXCLELS_CIPHER_KEY_SIZE_AES_192 ((size_t) 24U)
118#define MCUXCLELS_CIPHER_KEY_SIZE_AES_256 ((size_t) 32U)
152#ifndef MCUXCL_FEATURE_ELS_NO_INTERNAL_STATE_FLAGS
239 uint8_t const * pKey,
241 uint8_t const * pInput,
ELS header for common functionality.
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.
#define MCUXCLELS_API
Marks a function as a public API function of the mcuxClEls component.
Definition mcuxClEls_Common.h:66
uint32_t mcuxClEls_Status_t
Type for ELS driver status codes.
Definition mcuxClEls_Types.h:232
uint32_t mcuxClEls_KeyIndex_t
Type for ELS keystore indices.
Definition mcuxClEls_Types.h:242
#define MCUX_CSSL_FP_FUNCTION_DECL(...)
Declaration of a flow protected function.
Definition mcuxCsslFlowProtection.h:145
#define MCUX_CSSL_FP_PROTECTED_TYPE(resultType)
Based on a given base type, builds a return type with flow protection.
Definition mcuxCsslFlowProtection.h:101
Command option bit field for mcuxClEls_Cipher_Async.
Definition mcuxClEls_Cipher.h:141
uint32_t value
Accesses the bit field as a full word.
Definition mcuxClEls_Cipher.h:144
uint32_t cphmde
Define cipher mode.
Definition mcuxClEls_Cipher.h:150
uint32_t extkey
Define whether an external key from memory or ELS internal key should be used.
Definition mcuxClEls_Cipher.h:158
uint32_t cphsoe
Define whether the ELS internal cipher state should be extracted to external memory or kept internall...
Definition mcuxClEls_Cipher.h:151
uint32_t dcrpt
Define operation mode.
Definition mcuxClEls_Cipher.h:149
uint32_t cphsie
Define whether an external provided cipher state should be imported from external memory.
Definition mcuxClEls_Cipher.h:153