13 const int size_mesg=64;
15 typedef unsigned char byte;
25 int main(int argc, char** argv) {
28 printf("\nTesting AES128\n\n");
30 printf("\nTesting AES192\n\n");
32 printf("\nTesting AES256\n\n");
34 printf("You need to specify a symbol between AES128, AES192 or AES256. Exiting");
40 byte plain[size_mesg];
41 byte cipher [size_mesg] ;
42 byte check [size_mesg] ;
50 for(int i=0;i<16;i++) {
55 for(int i=0;i<8;i++) {
63 for(int i=0;i<size_mesg;i++) {
66 for(int i=0;i<size_mesg;i++) {
67 printf("%d ",plain[i]);
75 // AES_init_ctx_iv(&ctx, mykey, iv);
76 My_KeyExpansion(ctx.RoundKey, mykey);
77 memcpy (ctx.Iv, iv, AES_BLOCKLEN);
78 My_AES_CTR_xcrypt_buffer(&ctx, plain, size_mesg);
82 for(int i=0;i<size_mesg;i++) {
83 printf("%d ",plain[i]);
87 // AES_init_ctx_iv(&ctx, mykey, iv);
88 My_KeyExpansion(ctx.RoundKey, mykey);
89 memcpy (ctx.Iv, iv, AES_BLOCKLEN);
92 My_AES_CTR_xcrypt_buffer(&ctx, plain, size_mesg);
95 for(int i=0;i<size_mesg;i++) {
96 printf("%d ",plain[i]);