#include "Device/Include/stm32f10x.h" // Device header #include #include"AES_CBC_SW.h" #define AES_MAXROUNDS 14 #define AES_BLOCKSIZE 16 #define AES_IV_SIZE 16 #define KEYSIZE 16 #define MSG_SIZE KEYSIZE * 4 static const uint8_t key[KEYSIZE] = { 0xff, 0xde, 0x00, 0xad, 0xff, 0xb0, 0x00, 0x0b, 0xff, 0xde, 0x00, 0xad, 0xff, 0xb0, 0x00, 0x0b }; static const uint8_t iv[KEYSIZE] = { 0xff, 0xc0, 0x00, 0xfe, 0xff, 0xc0, 0x00, 0x7d, 0xff, 0xc0, 0x00, 0xfe, 0xff, 0xc0, 0x00, 0x7d }; static const uint8_t original_msg[MSG_SIZE] = { 0xf4, 0xfc, 0xa2, 0xf4, 0x93, 0xfa, 0x64, 0xeb, 0x87, 0xca, 0xeb, 0x62, 0x90, 0x89, 0x34, 0xdb, 0x34, 0xe3, 0xf8, 0xc6, 0xd7, 0xf6, 0x89, 0xe7, 0xc0, 0x37, 0x43, 0xcd, 0x32, 0x69, 0xcd, 0xbd, 0x05, 0xec, 0x97, 0xbf, 0x05, 0x92, 0xc9, 0xf7, 0x8d, 0x4b, 0xb0, 0x88, 0x1a, 0xc2, 0x15, 0x2e, 0xba, 0x46, 0x58, 0xf9, 0x4d, 0x1f, 0xe9, 0xef, 0xa8, 0x6b, 0x5a, 0x6f, 0x8b, 0xe6, 0x7d, 0x51 }; static uint8_t out[MSG_SIZE] ; static uint8_t msg[MSG_SIZE] ; static AES_CTX context ; void test_setup() { } void test_clear() { uint8_t i =0; memcpy(msg, original_msg, MSG_SIZE); memset(out, 0, MSG_SIZE); memset(&context, 0, sizeof(context)); printf("\r\n original_msg[%d]\r\n",MSG_SIZE); for(i = 0 ; i