Microchip® Advanced Software Framework

Quick Start Guide for the AES driver

This is the quick start guide for the group_sam_drivers_aes, with step-by-step instructions on how to configure and use the driver for a specific use case.The code examples can be copied into e.g the main application loop or any other function that will need to control the AES module.

Use cases

AES Basic Usage

This use case will demonstrate how to initialize the AES module to encryption or decryption data.

Setup steps

Prerequisites

This module requires the following service

Code

Add this to the main loop or a setup function:

Workflow

  1. Enable the AES module
  2. Set the AES interrupt and callback
  3. Initialize the AES to ECB cipher mode

Usage steps

Code

We can then encrypt the plain text by

We can get the cipher text after it's ready by

output_data[0] = aes_read_output_data(&g_aes_inst);
output_data[1] = aes_read_output_data(&g_aes_inst);
output_data[2] = aes_read_output_data(&g_aes_inst);
output_data[3] = aes_read_output_data(&g_aes_inst);