X-Git-Url: https://git.cryptolib.org/?a=blobdiff_plain;f=test_src%2Fmain-skein-test.c;h=6ecf5988d683f143dab05463bd8f0dba61dee1c5;hb=c88d9d78db096516eb8aa2aff12c8db1f590738b;hp=98102d8508885d25b6c50749c22f88f472c300c1;hpb=5c68d38237aa51b91a26309c24e8e38c7fbdffbe;p=avr-crypto-lib.git diff --git a/test_src/main-skein-test.c b/test_src/main-skein-test.c index 98102d8..6ecf598 100644 --- a/test_src/main-skein-test.c +++ b/test_src/main-skein-test.c @@ -22,8 +22,8 @@ */ #include "config.h" -#include "serial-tools.h" -#include "uart.h" + +#include "uart_i.h" #include "debug.h" #include "skein.h" @@ -32,7 +32,11 @@ #include "hfal_skein1024.h" #include "cli.h" #include "shavs.h" +#include "nessie_hash_test.h" #include "performance_test.h" +#include "hfal-performance.h" +#include "hfal-nessie.h" + #include #include @@ -40,6 +44,32 @@ char* algo_name = "Skein"; +const hfdesc_t* algolist[] PROGMEM = { + (hfdesc_t*)&skein256_128_desc, + (hfdesc_t*)&skein256_160_desc, + (hfdesc_t*)&skein256_224_desc, + (hfdesc_t*)&skein256_256_desc, + (hfdesc_t*)&skein256_384_desc, + (hfdesc_t*)&skein256_512_desc, + + (hfdesc_t*)&skein512_128_desc, + (hfdesc_t*)&skein512_160_desc, + (hfdesc_t*)&skein512_224_desc, + (hfdesc_t*)&skein512_256_desc, + (hfdesc_t*)&skein512_384_desc, + (hfdesc_t*)&skein512_512_desc, + (hfdesc_t*)&skein512_1024_desc, + + (hfdesc_t*)&skein1024_128_desc, + (hfdesc_t*)&skein1024_160_desc, + (hfdesc_t*)&skein1024_224_desc, + (hfdesc_t*)&skein1024_256_desc, + (hfdesc_t*)&skein1024_384_desc, + (hfdesc_t*)&skein1024_512_desc, + (hfdesc_t*)&skein1024_1024_desc, + NULL +}; + /***************************************************************************** * additional validation-functions * *****************************************************************************/ @@ -174,35 +204,20 @@ void zeromsg_test_common(char* p){ } } +void performance_skein(void){ + hfal_performance_multiple(algolist); +} + +void testrun_nessie_skein(void){ + nessie_hash_quick = 1; + hfal_nessie_multiple(algolist); +} + + /***************************************************************************** * main * *****************************************************************************/ -const hfdesc_t* algolist[] PROGMEM = { - (hfdesc_t*)&skein256_128_desc, - (hfdesc_t*)&skein256_160_desc, - (hfdesc_t*)&skein256_224_desc, - (hfdesc_t*)&skein256_256_desc, - (hfdesc_t*)&skein256_384_desc, - (hfdesc_t*)&skein256_512_desc, - - (hfdesc_t*)&skein512_128_desc, - (hfdesc_t*)&skein512_160_desc, - (hfdesc_t*)&skein512_224_desc, - (hfdesc_t*)&skein512_256_desc, - (hfdesc_t*)&skein512_384_desc, - (hfdesc_t*)&skein512_512_desc, - (hfdesc_t*)&skein512_1024_desc, - - (hfdesc_t*)&skein1024_128_desc, - (hfdesc_t*)&skein1024_160_desc, - (hfdesc_t*)&skein1024_224_desc, - (hfdesc_t*)&skein1024_256_desc, - (hfdesc_t*)&skein1024_384_desc, - (hfdesc_t*)&skein1024_512_desc, - (hfdesc_t*)&skein1024_1024_desc, - NULL -}; const char nessie_str[] PROGMEM = "nessie"; const char test_str[] PROGMEM = "test"; @@ -214,7 +229,8 @@ const char shavs_set_str[] PROGMEM = "shavs_set"; const char shavs_test1_str[] PROGMEM = "shavs_test1"; cmdlist_entry_t cmdlist[] PROGMEM = { -// { nessie_str, NULL, testrun_nessie_skein}, + { nessie_str, NULL, testrun_nessie_skein}, + { performance_str, NULL, performance_skein}, { test_str, NULL, testrun_stdtest_skein}, { ztest_str, (void*)1, (void_fpt)zeromsg_test_common}, { shavs_list_str, NULL, shavs_listalgos}, @@ -227,8 +243,8 @@ cmdlist_entry_t cmdlist[] PROGMEM = { int main (void){ DEBUG_INIT(); - cli_rx = uart_getc; - cli_tx = uart_putc; + cli_rx = (cli_rx_fpt)uart0_getc; + cli_tx = (cli_tx_fpt)uart0_putc; shavs_algolist=(hfdesc_t**)algolist; shavs_algo=(hfdesc_t*)&skein256_256_desc; for(;;){