2 * \file main-shabea-test.c
5 * \brief test suit for SHABEA
11 #include "serial-tools.h"
19 #include <util/delay.h>
21 /*****************************************************************************
22 * additional validation-functions *
23 *****************************************************************************/
25 /*****************************************************************************
27 *****************************************************************************/
29 void testencrypt(uint8_t* block, uint8_t* key){
30 uart_putstr("\r\n==testy-encrypt==\r\n key: ");
32 uart_putstr("\r\n plain: ");
33 uart_hexdump(block,32);
35 shabea256(block,key,128,1,16);
36 uart_putstr("\r\n crypt: ");
37 uart_hexdump(block,32);
40 void testdecrypt(uint8_t* block, uint8_t* key){
42 uart_putstr("\r\n==testy-decrypt==\r\n key: ");
44 uart_putstr("\r\n crypt: ");
45 uart_hexdump(block,32);
47 shabea256(block,key,128,0,16);
48 uart_putstr("\r\n plain: ");
49 uart_hexdump(block,32);
52 void testrun_shabea(void){
54 { { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
55 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
56 { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
57 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f },
58 { 0x47, 0x06, 0x48, 0x08, 0x51, 0xE6, 0x1B, 0xE8,
59 0x5D, 0x74, 0xBF, 0xB3, 0xFD, 0x95, 0x61, 0x85 },
60 { 0x28, 0xDB, 0xC3, 0xBC, 0x49, 0xFF, 0xD8, 0x7D,
61 0xCF, 0xA5, 0x09, 0xB1, 0x1D, 0x42, 0x2B, 0xE7,}
64 { { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
65 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
66 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
67 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f },
68 { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
69 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
70 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
71 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
72 { 0x83, 0xA2, 0xF8, 0xA2, 0x88, 0x64, 0x1F, 0xB9,
73 0xA4, 0xE9, 0xA5, 0xCC, 0x2F, 0x13, 0x1C, 0x7D,
74 0x83, 0xA2, 0xF8, 0xA2, 0x88, 0x64, 0x1F, 0xB9,
75 0xA4, 0xE9, 0xA5, 0xCC, 0x2F, 0x13, 0x1C, 0x7D },
76 { 0xB4, 0x1E, 0x6B, 0xE2, 0xEB, 0xA8, 0x4A, 0x14,
77 0x8E, 0x2E, 0xED, 0x84, 0x59, 0x3C, 0x5E, 0xC7,
78 0xB4, 0x1E, 0x6B, 0xE2, 0xEB, 0xA8, 0x4A, 0x14,
79 0x8E, 0x2E, 0xED, 0x84, 0x59, 0x3C, 0x5E, 0xC7 }
83 testencrypt(datas[i],keys[i]);
84 testdecrypt(datas[i],keys[i]);
86 // testdecrypt(data,key);
91 /*****************************************************************************
93 *****************************************************************************/
101 uart_putstr("\r\n\r\nCrypto-VS (shabea)\r\nloaded and running\r\n");
105 if (!getnextwordn(str,20)) {DEBUG_S("DBG: W1\r\n"); goto error;}
106 if (strcmp(str, "test")) {DEBUG_S("DBG: 1b\r\n"); goto error;}
111 uart_putstr("ERROR\r\n");