]> git.cryptolib.org Git - avr-crypto-lib.git/blobdiff - test_src/main-hmac-md5-test.c
fixing E-Mail-Address & Copyright
[avr-crypto-lib.git] / test_src / main-hmac-md5-test.c
index a2b2a2257c3f40876a036c722e35f358ea13fadc..6843935a5631a464364fafb1f1bf74875773a23c 100644 (file)
@@ -1,7 +1,7 @@
 /* main-hmac-md5-test.c */
 /*
     This file is part of the AVR-Crypto-Lib.
-    Copyright (C) 2008  Daniel Otte (daniel.otte@rub.de)
+    Copyright (C) 2006-2015 Daniel Otte (bg@nerilex.org)
 
     This program is free software: you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
  * 
 */
 
-#include "config.h"
-#include "serial-tools.h"
-#include "uart.h"
-#include "debug.h"
+#include "main-test-common.h"
 
 #include "md5.h"
 #include "hmac-md5.h"
-#include "base64_enc.h"
-#include "base64_dec.h"
-
 #include "nessie_mac_test.h"
 
-#include <stdint.h>
-#include <string.h>
-#include "cli.h"
-
-char* algo_name = "HMAC-MD5";
+char *algo_name = "HMAC-MD5";
 
 /*****************************************************************************
  *  additional validation-functions                                                                                     *
@@ -97,7 +87,7 @@ void hmacmd5_interactive(void){
        cli_hexdump(hmac, HMAC_MD5_BYTES);
 }
 
-void strhexdump(char* dest, void* src, uint16_t length){
+void strhexdump(char *dest, void *src, uint16_t length){
        char table[] = { '0', '1', '2', '3', 
                         '4', '5', '6', '7', 
                                         '8', '9', 'a', 'b', 
@@ -109,6 +99,7 @@ void strhexdump(char* dest, void* src, uint16_t length){
        }
 }
 
+/*
 void cram_md5_interactive(void){
        char key[101];
        char msg_b64[101];
@@ -137,9 +128,9 @@ void cram_md5_interactive(void){
        cli_putstr_P(PSTR("\r\nresponse: "));
        cli_hexdump(hmac, HMAC_MD5_BYTES);
        cli_putstr_P(PSTR("\r\nresponse (b64): "));
-       cli_putstr(msg_b64);
-       
+       cli_putstr(msg_b64);    
 }
+*/
 
 
 void md5_interactive(void){
@@ -164,15 +155,15 @@ const char test_str[]        PROGMEM = "test";
 /* const char performance_str[] PROGMEM = "performance"; */
 const char echo_str[]        PROGMEM = "echo";
 const char hmd5i_str[]       PROGMEM = "hmac-md5";
-const char crammd5i_str[]    PROGMEM = "cram-md5";
+/* const char crammd5i_str[]    PROGMEM = "cram-md5"; */
 const char md5i_str[]        PROGMEM = "md5";
 
 
-cmdlist_entry_t cmdlist[] PROGMEM = {
+const cmdlist_entry_t cmdlist[] PROGMEM = {
        { nessie_str,      NULL, testrun_nessie_hmacmd5},
        { test_str,        NULL, testrun_test_hmacmd5},
        { hmd5i_str,       NULL, hmacmd5_interactive},
-       { crammd5i_str,    NULL, cram_md5_interactive},
+/*     { crammd5i_str,    NULL, cram_md5_interactive},        */
        { md5i_str,        NULL, md5_interactive},
 /*     { performance_str, NULL, testrun_performance_hmacmd5}, */
        { echo_str,    (void*)1, (void_fpt)echo_ctrl},
@@ -180,13 +171,10 @@ cmdlist_entry_t cmdlist[] PROGMEM = {
 };
 
 int main (void){
-       DEBUG_INIT();
-       cli_rx = uart_getc;
-       cli_tx = uart_putc;             
-       for(;;){
-               cli_putstr_P(PSTR("\r\n\r\nCrypto-VS ("));
-               cli_putstr(algo_name);
-               cli_putstr_P(PSTR(")\r\nloaded and running\r\n"));
-               cmd_interface(cmdlist);
+    main_setup();
+
+    for(;;){
+        welcome_msg(algo_name);
+        cmd_interface(cmdlist);
        }
 }