Microchip® Advanced Software Framework

aesa.h File Reference

AES software driver for SAM.

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...
 
struct  aes_dev_inst
 AES driver software instance structure. More...
 

Typedefs

typedef void(* aes_callback_t )(void)
 Interrupt callback function type for AES. 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 CFB size. More...
 
enum  aes_countermeature_type {
  AES_COUNTERMEASURE_TYPE_1 = 0x01,
  AES_COUNTERMEASURE_TYPE_2 = 0x02,
  AES_COUNTERMEASURE_TYPE_3 = 0x04,
  AES_COUNTERMEASURE_TYPE_4 = 0x08,
  AES_COUNTERMEASURE_TYPE_ALL = 0x0F
}
 AES CounterMeasure type. More...
 
enum  aes_dma_mode {
  AES_MANUAL_MODE = 0,
  AES_DMA_MODE
}
 AES DMA mode. More...
 
enum  aes_encrypt_mode {
  AES_DECRYPTION = 0,
  AES_ENCRYPTION
}
 AES Processing mode. More...
 
enum  aes_interrupt_source {
  AES_INTERRUPT_INPUT_BUFFER_READY = AESA_IER_ODATARDY,
  AES_INTERRUPT_OUTPUT_DATA_READY = AESA_IER_IBUFRDY
}
 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 Confidentiality mode. More...
 

Functions

static void aes_decryption_key_generate (struct aes_dev_inst *const dev_inst)
 Starts the computation of the last Nk words of the expanded key. More...
 
void aes_disable (struct aes_dev_inst *const dev_inst)
 Disable the AES. More...
 
static void aes_disable_interrupt (struct aes_dev_inst *const dev_inst, aes_interrupt_source_t source)
 Disable the AES interrupt. More...
 
void aes_enable (struct aes_dev_inst *const dev_inst)
 Enable the AES. More...
 
static void aes_enable_interrupt (struct aes_dev_inst *const dev_inst, aes_interrupt_source_t source)
 Enable the AES interrupt. More...
 
void aes_get_config_defaults (struct aes_config *const cfg)
 Initializes a AES configuration structure to defaults. More...
 
bool aes_init (struct aes_dev_inst *const dev_inst, Aesa *const aes, struct aes_config *const cfg)
 Initialize the AES module. More...
 
static uint32_t aes_read_input_buffer_pointer (struct aes_dev_inst *const dev_inst)
 Read the input buffer pointer position. More...
 
static uint32_t aes_read_interrupt_mask (struct aes_dev_inst *const dev_inst)
 Get the AES interrupt mask status. More...
 
static uint32_t aes_read_output_buffer_pointer (struct aes_dev_inst *const dev_inst)
 Read the output buffer pointer position. More...
 
static uint32_t aes_read_output_data (struct aes_dev_inst *const dev_inst)
 Read the output data. More...
 
static uint32_t aes_read_status (struct aes_dev_inst *const dev_inst)
 Get the AES status. More...
 
static void aes_reset (struct aes_dev_inst *const dev_inst)
 Perform a software reset of the AES. More...
 
void aes_set_callback (struct aes_dev_inst *const dev_inst, aes_interrupt_source_t source, aes_callback_t callback, uint8_t irq_level)
 Set callback for AES. More...
 
static void aes_set_config (struct aes_dev_inst *const dev_inst)
 Configure the AES. More...
 
static void aes_set_new_message (struct aes_dev_inst *const dev_inst)
 Notifies the module that the next input data block is the beginning of a new message. More...
 
static void aes_write_drng_seed (struct aes_dev_inst *const dev_inst, uint32_t ul_drng_seed)
 Write the DRNG seed. More...
 
void aes_write_initvector (struct aes_dev_inst *const dev_inst, const uint32_t *p_vector)
 Write the initialization vector (for the CBC, CFB, OFB & CTR cipher modes) More...
 
static void aes_write_input_buffer_pointer (struct aes_dev_inst *const dev_inst, uint32_t ul_in_position)
 Write the input buffer pointer position. More...
 
static void aes_write_input_data (struct aes_dev_inst *const dev_inst, uint32_t ul_data)
 Write the input data. More...
 
void aes_write_key (struct aes_dev_inst *const dev_inst, const uint32_t *p_key)
 Write the 128/192/256bit cryptographic key. More...
 
static void aes_write_output_buffer_pointer (struct aes_dev_inst *const dev_inst, uint32_t ul_out_position)
 Write the output buffer pointer position. More...