7 #include "serial-tools.h"
17 /*****************************************************************************
18 * additional validation-functions *
19 *****************************************************************************/
21 /*****************************************************************************
23 *****************************************************************************/
27 * MD5 ("") = d41d8cd98f00b204e9800998ecf8427e
28 * MD5 ("a") = 0cc175b9c0f1b6a831c399e269772661
29 * MD5 ("abc") = 900150983cd24fb0d6963f7d28e17f72
30 * MD5 ("message digest") = f96b697d7cb7938d525a2f31aaf161d0
31 * MD5 ("abcdefghijklmnopqrstuvwxyz") = c3fcd3d76192e4007dfb496cca67e13b
32 * MD5 ("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789") =
33 * d174ab98d277d9f5a5611c2c9f419d9f
34 * MD5 ("123456789012345678901234567890123456789012345678901234567890123456
35 * 78901234567890") = 57edf4a22be3c955ac49da2e2107b67a
38 void testrun_md5(void){
40 char* testv[]={"", "a", "abc", "message digest", "abcdefghijklmnopqrstuvwxyz",
41 "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",
42 "12345678901234567890123456789012345678901234567890123456789012345678901234567890"};
45 uart_putstr("\r\n=== MD5 test suit ===");
47 uart_putstr("\r\n MD5 (\"");
48 uart_putstr(testv[i]);
49 uart_putstr("\") = \r\n");
51 md5_lastBlock(&s, testv[i], strlen(testv[i])*8);
52 uart_hexdump(&s.a[0], 16);
58 /*****************************************************************************
60 *****************************************************************************/
69 uart_putstr("\r\n\r\nCrypto-VS (MD5)\r\nloaded and running\r\n");
72 if (!getnextwordn(str,20)) {DEBUG_S("DBG: W1\r\n"); goto error;}
73 if (strcmp(str, "test")) {DEBUG_S("DBG: 1b\r\n"); goto error;}
78 uart_putstr("ERROR\r\n");