Microchip® Advanced Software Framework

aes.h File Reference

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...
 

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 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...
 
void aes_init (Aes *const p_aes, struct aes_config *const p_cfg)
 Initialize the AES module. 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 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...
 
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...