Ultra lite Security Accelerator(SA2_UL) subsystem is designed to provide low-cost hardware cryptographic acceleration for the Encryption and authentication.
This sequence performs Encryption and decryption operations for AES-CBC/ECB algorithms. Supported key lengths are 128 and 256 bit.
This sequence performs SHA-512 and SHA-256.
This sequence performs HMAC SHA-512, SHA-256 and SHA1.
This sequence performs AES CMAC-128 and CMAC-256.
This sequence to get RNG (Random number generation).
This sequence performs PKA operations.
#include<stdio.h>
#define APP_CRYPTO_AES_CBC_256_INOUT_LENGTH (16U)
#define APP_CRYPTO_AES_CBC_256_MAX_KEY_LENGTH (32U)
#define APP_CRYPTO_AES_CBC_256_MAX_IV_LENGTH (16U)
#define APP_CRYPTO_AES_CBC_256_KEY_LENGTH_IN_BITS (256U)
#define APP_CRYPTO_AES_CBC_ALIGNMENT (128U)
static uint8_t gCryptoAesCbc256InputBuf[APP_CRYPTO_AES_CBC_256_INOUT_LENGTH] =
{
0x81, 0xEA, 0x5B, 0xA4, 0x69, 0x45, 0xC1, 0x70,
0x5F, 0x6F, 0x89, 0x77, 0x88, 0x68, 0xCC, 0x67
};
static uint8_t gCryptoAesCbc256Key[APP_CRYPTO_AES_CBC_256_MAX_KEY_LENGTH] =
{
0x33, 0xA3, 0x66, 0x46, 0xFE, 0x56, 0xF7, 0x0D,
0xC0, 0xC5, 0x1A, 0x31, 0x17, 0xE6, 0x39, 0xF1,
0x82, 0xDE, 0xF8, 0xCA, 0xB5, 0xC0, 0x66, 0x71,
0xEE, 0xA0, 0x40, 0x7C, 0x48, 0xA9, 0xC7, 0x57
};
static uint8_t gCryptoAesCbc256Iv[APP_CRYPTO_AES_CBC_256_MAX_IV_LENGTH] =
{
0x7C, 0xE2, 0xAB, 0xAF, 0x8B, 0xEF, 0x23, 0xC4,
0x81, 0x6D, 0xC8, 0xCE, 0x84, 0x20, 0x48, 0xA7
};
uint8_t gCryptoAesCbc256EncResultBuf[APP_CRYPTO_AES_CBC_256_INOUT_LENGTH]
__attribute__ ((aligned (APP_CRYPTO_AES_CBC_ALIGNMENT)));
uint8_t gCryptoAesCbc256DecResultBuf[APP_CRYPTO_AES_CBC_256_INOUT_LENGTH]
__attribute__ ((aligned (APP_CRYPTO_AES_CBC_ALIGNMENT)));