Microchip® Advanced Software Framework

quick_start_dma.c File Reference

AES example for SAM.

Copyright (c) 2014-2018 Microchip Technology Inc. and its subsidiaries.

#include <asf.h>
#include <string.h>

Macros

#define AES_EXAMPLE_REFBUF_SIZE   4
 [cipher_data] More...
 

sample data from NIST-800-38A appendix F

uint32_t ref_plain_text [AES_EXAMPLE_REFBUF_SIZE]
 Reference plain data. More...
 
uint32_t ref_cipher_text_ecb [AES_EXAMPLE_REFBUF_SIZE]
 Reference ECB cipher data. More...
 
const uint32_t key128 [4]
 Cipher 128 bits key array. More...
 
static uint32_t output_data [AES_EXAMPLE_REFBUF_SIZE]
 [cipher_data] More...
 
volatile bool state = false
 
struct aes_config g_aes_cfg
 AES configuration. More...
 
struct aes_module aes_instance
 
struct usart_module usart_instance
 
struct dma_resource example_resource_tx
 [module_var] More...
 
struct dma_resource example_resource_rx
 
DmacDescriptor
example_descriptor_tx 
SECTION_DMAC_DESCRIPTOR
 
static void configure_usart (void)
 [module_var_dma] More...
 
static void ecb_mode_test_dma (void)
 ECB mode encryption test with DMA. More...
 
static void transfer_tx_rx_done (struct dma_resource *const resource)
 
static void configure_dma_aes_wr (void)
 
static void configure_dma_aes_rd (void)
 
int main (void)
 [setup] More...
 

#define AES_EXAMPLE_REFBUF_SIZE   4

[cipher_data]

Referenced by configure_dma_aes_rd(), and configure_dma_aes_wr().

int main ( void  )

[setup]

The main function.

[setup_init]

[setup_dma]

[setup_dma]

[setup_config]

[setup_config] [setup_config_defaults]

[setup_config_defaults]

[module_enable]

[module_enable]

[setup_init]

[encryption_decryption]

[encryption_decryption]

References aes_enable(), aes_get_config_defaults(), aes_init(), aes_instance, configure_dma_aes_rd(), configure_dma_aes_wr(), configure_usart(), DMA_CALLBACK_TRANSFER_DONE, dma_enable_callback(), dma_register_callback(), ecb_mode_test_dma(), example_resource_rx, example_resource_tx, g_aes_cfg, system_init(), and transfer_tx_rx_done().

static void transfer_tx_rx_done ( struct dma_resource *const  resource)
static

References state.

Referenced by main().

struct aes_module aes_instance
struct dma_resource example_resource_rx
struct dma_resource example_resource_tx

[module_var]

[module_var_dma]

Referenced by configure_dma_aes_wr(), ecb_mode_test_dma(), main(), and run_ecb_mode_test_dma().

struct aes_config g_aes_cfg

AES configuration.

const uint32_t key128[4]
Initial value:
= {
0x16157e2b,
0xa6d2ae28,
0x8815f7ab,
0x3c4fcf09
}

Cipher 128 bits key array.

uint32_t output_data[AES_EXAMPLE_REFBUF_SIZE]
static

[cipher_data]

[module_var]

Referenced by configure_dma_aes_rd(), and ecb_mode_test_dma().

uint32_t ref_cipher_text_ecb[AES_EXAMPLE_REFBUF_SIZE]
Initial value:
= {
0xb47bd73a,
0x60367a0d,
0xf3ca9ea8,
0x97ef6624
}

Reference ECB cipher data.

uint32_t ref_plain_text[AES_EXAMPLE_REFBUF_SIZE]
Initial value:
= {
0xe2bec16b,
0x969f402e,
0x117e3de9,
0x2a179373
}

Reference plain data.

DmacDescriptor example_descriptor_rx SECTION_DMAC_DESCRIPTOR
volatile bool state = false
struct usart_module usart_instance