]> git.cryptolib.org Git - avr-crypto-lib.git/blobdiff - test_src/main-bmw-test.c
switching to new main-*-test layout and to stdio streams
[avr-crypto-lib.git] / test_src / main-bmw-test.c
index 1aadbf1aa5a27ffb952639e5b46b8f41696898ae..18d91a68ff3cc891c79fafeb751335b6f60f4a3e 100644 (file)
  *
 */
 
-#include "config.h"
-#include "uart_i.h"
-#include "debug.h"
+#include "main-test-common.h"
 
 #include "bmw_small.h"
 #include "bmw_large.h"
-#include "cli.h"
 #include "hfal_bmw_small.h"
 #include "hfal_bmw_large.h"
+
 #include "shavs.h"
 #include "nessie_hash_test.h"
-#include "performance_test.h"
 #include "hfal-nessie.h"
 #include "hfal-performance.h"
 #include "hfal-test.h"
-
-#include <stdint.h>
-#include <string.h>
-#include <stdlib.h>
+#include "performance_test.h"
 
 char* algo_name = "BlueMidnightWish";
 
 
-const hfdesc_t* algolist[] PROGMEM = {
+const hfdesc_t* const algolist[] PROGMEM = {
        (hfdesc_t*)&bmw224_desc,
        (hfdesc_t*)&bmw256_desc,
        (hfdesc_t*)&bmw384_desc,
@@ -156,38 +150,29 @@ const char shavs_set_str[]   PROGMEM = "shavs_set";
 const char shavs_test1_str[] PROGMEM = "shavs_test1";
 const char shavs_test3_str[] PROGMEM = "shavs_test3";
 
-cmdlist_entry_t cmdlist[] PROGMEM = {
-       { nessie_str,          NULL, testrun_nessie_bmw},
-       { test_str,            NULL, testrun_stdtest_bmw},
-       { testshort_str,       NULL, testshort},
-       { testlshort_str,      NULL, testlshort},
-       { test506_str,         NULL, test506},
-       { test507_str,         NULL, test507},
-       { performance_str,     NULL, performance_bmw},
-       { shavs_list_str,      NULL, shavs_listalgos},
-       { shavs_set_str,   (void*)1, (void_fpt)shavs_setalgo},
-       { shavs_test1_str,     NULL, shavs_test1},
-       { shavs_test3_str,     NULL, shavs_test3},
-       { echo_str,        (void*)1, (void_fpt)echo_ctrl},
-       { NULL,                NULL, NULL}
+const cmdlist_entry_t cmdlist[] PROGMEM = {
+       { nessie_str,                  NULL, testrun_nessie_bmw            },
+       { test_str,                    NULL, testrun_stdtest_bmw           },
+       { testshort_str,               NULL, testshort                     },
+       { testlshort_str,              NULL, testlshort                    },
+       { test506_str,                 NULL, test506                       },
+       { test507_str,                 NULL, test507                       },
+       { performance_str,             NULL, performance_bmw               },
+       { shavs_list_str,              NULL, shavs_listalgos               },
+       { shavs_set_str,           (void*)1, (void_fpt)shavs_setalgo       },
+       { shavs_test1_str,             NULL, shavs_test1                   },
+       { shavs_test3_str,             NULL, shavs_test3                   },
+       { echo_str,                (void*)1, (void_fpt)echo_ctrl           },
+       { NULL,                        NULL, NULL                          }
 };
 
 int main (void){
-       DEBUG_INIT();
+    main_setup();
 
-       cli_rx = (cli_rx_fpt)uart0_getc;
-       cli_tx = (cli_tx_fpt)uart0_putc;
-       shavs_algolist=(hfdesc_t**)algolist;
+    shavs_algolist=(hfdesc_t**)algolist;
        shavs_algo=(hfdesc_t*)&bmw256_desc;
        for(;;){
-               cli_putstr_P(PSTR("\r\n\r\nCrypto-VS ("));
-               cli_putstr(algo_name);
-               cli_putstr_P(PSTR("; "));
-               cli_putstr(__DATE__);
-               cli_putstr_P(PSTR(" "));
-               cli_putstr(__TIME__);
-               cli_putstr_P(PSTR(")\r\nloaded and running\r\n"));
-
+           welcome_msg(algo_name);
                cmd_interface(cmdlist);
        }
 }