SAM Advanced Encryption Standard driver.
This file defines a useful set of functions for the AES on SAM devices.
Copyright (c) 2013-2018 Microchip Technology Inc. and its subsidiaries.
#include <compiler.h>
Data Structures | |
struct | aes_config |
AES Configuration structure. More... | |
Macros | |
#define | AES_DMA_RX_IDX 12 |
AES DMAC RX channel interface number. More... | |
#define | AES_DMA_TX_IDX 11 |
AES DMAC TX channel interface number. More... | |
Typedefs | |
typedef void(* | aes_callback_t )(void) |
AES interrupt callback function type. More... | |
typedef enum aes_interrupt_source | aes_interrupt_source_t |
AES interrupt source type. More... | |
Enumerations | |
enum | aes_cfb_size { AES_CFB_SIZE_128 = 0, AES_CFB_SIZE_64, AES_CFB_SIZE_32, AES_CFB_SIZE_16, AES_CFB_SIZE_8 } |
AES Cipher FeedBack (CFB) size. More... | |
enum | aes_encrypt_mode { AES_DECRYPTION = 0, AES_ENCRYPTION } |
AES processing mode. More... | |
enum | aes_interrupt_source { AES_INTERRUPT_DATA_READY = AES_IER_DATRDY, AES_INTERRUPT_UNSPECIFIED_REGISTER_ACCESS = AES_IER_URAD, AES_INTERRUPT_END_OF_RECEIVE_BUFFER = AES_IER_ENDRX, AES_INTERRUPT_END_OF_TRANSMIT_BUFFER = AES_IER_ENDTX, AES_INTERRUPT_RECEIVE_BUFFER_FULL = AES_IER_RXBUFF, AES_INTERRUPT_TRANSMIT_BUFFER_FULL = AES_IER_TXBUFE } |
AES interrupt source type. More... | |
enum | aes_key_size { AES_KEY_SIZE_128 = 0, AES_KEY_SIZE_192, AES_KEY_SIZE_256 } |
AES cryptographic key size. More... | |
enum | aes_opmode { AES_ECB_MODE = 0, AES_CBC_MODE, AES_OFB_MODE, AES_CFB_MODE, AES_CTR_MODE, AES_GCM_MODE } |
AES cipher block mode. More... | |
enum | aes_start_mode { AES_MANUAL_START = 0, AES_AUTO_START, AES_IDATAR0_START } |
AES start mode. More... | |
Functions | |
void | aes_disable (void) |
Disable the AES module. More... | |
static void | aes_disable_interrupt (Aes *const p_aes, aes_interrupt_source_t source) |
Disable an AES interrupt. More... | |
void | aes_enable (void) |
Enable the AES module. More... | |
static void | aes_enable_interrupt (Aes *const p_aes, aes_interrupt_source_t source) |
Enable an AES interrupt. More... | |
void | aes_get_config_defaults (struct aes_config *const p_cfg) |
Initializes an AES configuration structure to defaults. More... | |
Pdc * | aes_get_pdc_base (Aes *p_aes) |
Get AES PDC base address. More... | |
void | aes_init (Aes *const p_aes, struct aes_config *const p_cfg) |
Initialize the AES module. More... | |
static uint32_t | aes_read_authen_datalength (Aes *const p_aes) |
Get the AES Additional Authenticated Data (AAD) length in bytes. More... | |
static uint32_t | aes_read_gcm_counter (Aes *const p_aes) |
Get the AES GCM Encryption Counter. More... | |
static uint32_t | aes_read_gcmh (Aes *const p_aes, uint32_t id) |
Get AES GCM Hash subkey word. More... | |
static uint32_t | aes_read_ghash (Aes *const p_aes, uint32_t id) |
Get the AES GCM Intermediate Hash Word. More... | |
static uint32_t | aes_read_interrupt_mask (Aes *const p_aes) |
Get the AES interrupt mask status. More... | |
static uint32_t | aes_read_interrupt_status (Aes *const p_aes) |
Get the AES interrupt status. More... | |
void | aes_read_output_data (Aes *const p_aes, uint32_t *p_output_data_buffer) |
Read the output data. More... | |
static uint32_t | aes_read_pctext_length (Aes *const p_aes) |
Get the AES plaintext/ciphertext length in bytes. More... | |
static uint32_t | aes_read_tag (Aes *const p_aes, uint32_t id) |
Get AES GCM Authentication Tag Word. More... | |
static void | aes_reset (Aes *const p_aes) |
Perform an AES software reset. More... | |
void | aes_set_callback (Aes *const p_aes, aes_interrupt_source_t source, aes_callback_t callback, uint8_t irq_level) |
Set the AES interrupt callback. More... | |
void | aes_set_config (Aes *const p_aes, struct aes_config *const p_cfg) |
Configure the AES module. More... | |
static void | aes_start (Aes *const p_aes) |
Start a manual encryption/decryption process. More... | |
static void | aes_write_authen_datalength (Aes *const p_aes, uint32_t length) |
Set the AES Additional Authenticated Data (AAD) length in bytes. More... | |
static void | aes_write_gcmh (Aes *const p_aes, uint32_t id, uint32_t hword) |
Set the AES GCM Hash subkey word. More... | |
static void | aes_write_ghash (Aes *const p_aes, uint32_t id, uint32_t ghash) |
Set the AES GCM Intermediate Hash Word. More... | |
void | aes_write_initvector (Aes *const p_aes, const uint32_t *p_vector) |
Write the initialization vector (for the CBC, CFB, OFB, CTR & GCM cipher modes). More... | |
void | aes_write_input_data (Aes *const p_aes, const uint32_t *p_input_data_buffer) |
Write the input data (four consecutive 32-bit words). More... | |
void | aes_write_key (Aes *const p_aes, const uint32_t *p_key) |
Write the 128/192/256-bit cryptographic key. More... | |
static void | aes_write_pctext_length (Aes *const p_aes, uint32_t length) |
Set the AES plaintext/ciphertext length in bytes. More... | |