This section describes the programming interface of the LTC EDMA AES driver.
|
#define | LTC_AES_DecryptCtrEDMA(base, handle, input, output, size, counter, key, keySize, counterlast, szLeft) LTC_AES_CryptCtrEDMA(base, handle, input, output, size, counter, key, keySize, counterlast, szLeft) |
| AES CTR decrypt is mapped to the AES CTR generic operation.
|
|
#define | LTC_AES_EncryptCtrEDMA(base, handle, input, output, size, counter, key, keySize, counterlast, szLeft) LTC_AES_CryptCtrEDMA(base, handle, input, output, size, counter, key, keySize, counterlast, szLeft) |
| AES CTR encrypt is mapped to the AES CTR generic operation.
|
|
|
status_t | LTC_AES_EncryptEcbEDMA (LTC_Type *base, ltc_edma_handle_t *handle, const uint8_t *plaintext, uint8_t *ciphertext, uint32_t size, const uint8_t *key, uint32_t keySize) |
| Encrypts AES using the ECB block mode. More...
|
|
status_t | LTC_AES_DecryptEcbEDMA (LTC_Type *base, ltc_edma_handle_t *handle, const uint8_t *ciphertext, uint8_t *plaintext, uint32_t size, const uint8_t *key, uint32_t keySize, ltc_aes_key_t keyType) |
| Decrypts AES using ECB block mode. More...
|
|
status_t | LTC_AES_EncryptCbcEDMA (LTC_Type *base, ltc_edma_handle_t *handle, const uint8_t *plaintext, uint8_t *ciphertext, uint32_t size, const uint8_t iv[LTC_AES_IV_SIZE], const uint8_t *key, uint32_t keySize) |
| Encrypts AES using CBC block mode. More...
|
|
status_t | LTC_AES_DecryptCbcEDMA (LTC_Type *base, ltc_edma_handle_t *handle, const uint8_t *ciphertext, uint8_t *plaintext, uint32_t size, const uint8_t iv[LTC_AES_IV_SIZE], const uint8_t *key, uint32_t keySize, ltc_aes_key_t keyType) |
| Decrypts AES using CBC block mode. More...
|
|
status_t | LTC_AES_CryptCtrEDMA (LTC_Type *base, ltc_edma_handle_t *handle, const uint8_t *input, uint8_t *output, uint32_t size, uint8_t counter[LTC_AES_BLOCK_SIZE], const uint8_t *key, uint32_t keySize, uint8_t counterlast[LTC_AES_BLOCK_SIZE], uint32_t *szLeft) |
| Encrypts or decrypts AES using CTR block mode. More...
|
|
status_t LTC_AES_EncryptEcbEDMA |
( |
LTC_Type * |
base, |
|
|
ltc_edma_handle_t * |
handle, |
|
|
const uint8_t * |
plaintext, |
|
|
uint8_t * |
ciphertext, |
|
|
uint32_t |
size, |
|
|
const uint8_t * |
key, |
|
|
uint32_t |
keySize |
|
) |
| |
Encrypts AES using the ECB block mode.
- Parameters
-
| base | LTC peripheral base address |
| handle | pointer to ltc_edma_handle_t structure which stores the transaction state. |
| plaintext | Input plain text to encrypt |
[out] | ciphertext | Output cipher text |
| size | Size of input and output data in bytes. Must be multiple of 16 bytes. |
| key | Input key to use for encryption |
| keySize | Size of the input key, in bytes. Must be 16, 24, or 32. |
- Returns
- Status from encrypt operation
status_t LTC_AES_DecryptEcbEDMA |
( |
LTC_Type * |
base, |
|
|
ltc_edma_handle_t * |
handle, |
|
|
const uint8_t * |
ciphertext, |
|
|
uint8_t * |
plaintext, |
|
|
uint32_t |
size, |
|
|
const uint8_t * |
key, |
|
|
uint32_t |
keySize, |
|
|
ltc_aes_key_t |
keyType |
|
) |
| |
Decrypts AES using ECB block mode.
- Parameters
-
| base | LTC peripheral base address |
| handle | pointer to ltc_edma_handle_t structure which stores the transaction state. |
| ciphertext | Input cipher text to decrypt |
[out] | plaintext | Output plain text |
| size | Size of input and output data in bytes. Must be multiple of 16 bytes. |
| key | Input key. |
| keySize | Size of the input key, in bytes. Must be 16, 24, or 32. |
| keyType | Input type of the key (allows to directly load decrypt key for AES ECB decrypt operation.) |
- Returns
- Status from decrypt operation
status_t LTC_AES_EncryptCbcEDMA |
( |
LTC_Type * |
base, |
|
|
ltc_edma_handle_t * |
handle, |
|
|
const uint8_t * |
plaintext, |
|
|
uint8_t * |
ciphertext, |
|
|
uint32_t |
size, |
|
|
const uint8_t |
iv[LTC_AES_IV_SIZE], |
|
|
const uint8_t * |
key, |
|
|
uint32_t |
keySize |
|
) |
| |
- Parameters
-
| base | LTC peripheral base address |
| handle | pointer to ltc_edma_handle_t structure which stores the transaction state. |
| plaintext | Input plain text to encrypt |
[out] | ciphertext | Output cipher text |
| size | Size of input and output data in bytes. Must be multiple of 16 bytes. |
| iv | Input initial vector to combine with the first input block. |
| key | Input key to use for encryption |
| keySize | Size of the input key, in bytes. Must be 16, 24, or 32. |
- Returns
- Status from encrypt operation
status_t LTC_AES_DecryptCbcEDMA |
( |
LTC_Type * |
base, |
|
|
ltc_edma_handle_t * |
handle, |
|
|
const uint8_t * |
ciphertext, |
|
|
uint8_t * |
plaintext, |
|
|
uint32_t |
size, |
|
|
const uint8_t |
iv[LTC_AES_IV_SIZE], |
|
|
const uint8_t * |
key, |
|
|
uint32_t |
keySize, |
|
|
ltc_aes_key_t |
keyType |
|
) |
| |
- Parameters
-
| base | LTC peripheral base address |
| handle | pointer to ltc_edma_handle_t structure which stores the transaction state. |
| ciphertext | Input cipher text to decrypt |
[out] | plaintext | Output plain text |
| size | Size of input and output data in bytes. Must be multiple of 16 bytes. |
| iv | Input initial vector to combine with the first input block. |
| key | Input key to use for decryption |
| keySize | Size of the input key, in bytes. Must be 16, 24, or 32. |
| keyType | Input type of the key (allows to directly load decrypt key for AES CBC decrypt operation.) |
- Returns
- Status from decrypt operation
status_t LTC_AES_CryptCtrEDMA |
( |
LTC_Type * |
base, |
|
|
ltc_edma_handle_t * |
handle, |
|
|
const uint8_t * |
input, |
|
|
uint8_t * |
output, |
|
|
uint32_t |
size, |
|
|
uint8_t |
counter[LTC_AES_BLOCK_SIZE], |
|
|
const uint8_t * |
key, |
|
|
uint32_t |
keySize, |
|
|
uint8_t |
counterlast[LTC_AES_BLOCK_SIZE], |
|
|
uint32_t * |
szLeft |
|
) |
| |
Encrypts or decrypts AES using CTR block mode. AES CTR mode uses only forward AES cipher and same algorithm for encryption and decryption. The only difference between encryption and decryption is that, for encryption, the input argument is plain text and the output argument is cipher text. For decryption, the input argument is cipher text and the output argument is plain text.
- Parameters
-
| base | LTC peripheral base address |
| handle | pointer to ltc_edma_handle_t structure which stores the transaction state. |
| input | Input data for CTR block mode |
[out] | output | Output data for CTR block mode |
| size | Size of input and output data in bytes |
[in,out] | counter | Input counter (updates on return) |
| key | Input key to use for forward AES cipher |
| keySize | Size of the input key, in bytes. Must be 16, 24, or 32. |
[out] | counterlast | Output cipher of last counter, for chained CTR calls. NULL can be passed if chained calls are not used. |
[out] | szLeft | Output number of bytes in left unused in counterlast block. NULL can be passed if chained calls are not used. |
- Returns
- Status from encrypt operation