X-Git-Url: https://git.cryptolib.org/?a=blobdiff_plain;f=test_src%2Fmain-md5-test.c;h=7cd6049d1830b8f173d3e62f823366c8bd05b108;hb=206e5aa6d34ac3fb32bdf9e6affc153547e189d8;hp=be4f69271d15ef3c1d2fc0937c73293d0cce761a;hpb=5c68d38237aa51b91a26309c24e8e38c7fbdffbe;p=avr-crypto-lib.git diff --git a/test_src/main-md5-test.c b/test_src/main-md5-test.c index be4f692..7cd6049 100644 --- a/test_src/main-md5-test.c +++ b/test_src/main-md5-test.c @@ -29,6 +29,8 @@ #include "md5.h" #include "nessie_hash_test.h" #include "performance_test.h" +#include "hfal_md5.h" +#include "hfal-performance.h" #include #include @@ -37,6 +39,11 @@ char* algo_name = "MD5"; +const hfdesc_t* algolist[] PROGMEM = { + (hfdesc_t*)&md5_desc, + NULL +}; + /***************************************************************************** * additional validation-functions * *****************************************************************************/ @@ -111,40 +118,7 @@ void testrun_md5(void){ void testrun_performance_md5(void){ - uint64_t t; - char str[16]; - uint8_t data[32]; - md5_ctx_t ctx; - - calibrateTimer(); - print_overhead(); - - memset(data, 0, 32); - - startTimer(1); - md5_init(&ctx); - t = stopTimer(); - cli_putstr_P(PSTR("\r\n\tctx-gen time: ")); - ultoa((unsigned long)t, str, 10); - cli_putstr(str); - - - startTimer(1); - md5_nextBlock(&ctx, data); - t = stopTimer(); - cli_putstr_P(PSTR("\r\n\tone-block time: ")); - ultoa((unsigned long)t, str, 10); - cli_putstr(str); - - - startTimer(1); - md5_lastBlock(&ctx, data, 0); - t = stopTimer(); - cli_putstr_P(PSTR("\r\n\tlast block time: ")); - ultoa((unsigned long)t, str, 10); - cli_putstr(str); - - cli_putstr_P(PSTR("\r\n")); + hfal_performance_multiple(algolist); }