X-Git-Url: https://git.cryptolib.org/?a=blobdiff_plain;f=test_src%2Fmain-sha1-test.c;fp=test_src%2Fmain-sha1-test.c;h=77104b945acb07a5a989418f74e048d0567ba429;hb=dca8c6894a08717979d3e4f64908702620171dee;hp=1dc476c4c0cc420d0de777fc58f615971015f397;hpb=2deab9197b8d9d74c01156777b250746c36fba07;p=avr-crypto-lib.git diff --git a/test_src/main-sha1-test.c b/test_src/main-sha1-test.c index 1dc476c..77104b9 100644 --- a/test_src/main-sha1-test.c +++ b/test_src/main-sha1-test.c @@ -28,7 +28,8 @@ #include "sha1.h" #include "nessie_hash_test.h" -#include "performance_test.h" +#include "hfal_sha1.h" +#include "hfal-performance.h" #include #include @@ -40,6 +41,10 @@ char* algo_name = "SHA-1"; +const hfdesc_t* algolist[] PROGMEM = { + (hfdesc_t*)&sha1_desc, + NULL +}; /***************************************************************************** * additional validation-functions * *****************************************************************************/ @@ -119,40 +124,7 @@ void testrun_sha1_2(void){ void testrun_performance_sha1(void){ - uint64_t t; - char str[16]; - uint8_t data[32]; - sha1_ctx_t ctx; - - calibrateTimer(); - print_overhead(); - - memset(data, 0, 32); - - startTimer(1); - sha1_init(&ctx); - t = stopTimer(); - cli_putstr_P(PSTR("\r\n\tctx-gen time: ")); - ultoa((unsigned long)t, str, 10); - cli_putstr(str); - - - startTimer(1); - sha1_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); - sha1_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); } @@ -184,11 +156,6 @@ cmdlist_entry_t cmdlist[] PROGMEM = { { NULL, NULL, NULL} }; -const hfdesc_t* algolist[] PROGMEM = { - (hfdesc_t*)&sha1_desc, - NULL -}; - int main (void){ DEBUG_INIT();