Microchip® Advanced Software Framework

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

Functions

static void configure_usart (void)
 [module_var] More...
 
static void ecb_mode_test (void)
 ECB mode encryption and decryption test. More...
 
int main (void)
 [setup] More...
 

Variables

struct aes_module aes_instance
 
struct aes_config g_aes_cfg
 
static uint32_t output_data [AES_EXAMPLE_REFBUF_SIZE]
 [cipher_data] More...
 
volatile bool state = false
 
struct usart_module usart_instance
 [module_inst] 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...
 

#define AES_EXAMPLE_REFBUF_SIZE   4

[cipher_data]

int main ( void  )

[setup]

The main function.

[setup_init]

[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_usart(), ecb_mode_test(), g_aes_cfg, and system_init().

struct aes_module aes_instance
struct aes_config g_aes_cfg
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 ecb_mode_test().

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.

volatile bool state = false
struct usart_module usart_instance

[module_inst]