X-Git-Url: https://git.cryptolib.org/?a=blobdiff_plain;f=test_src%2Fmain-twister256-test.c;h=25ae0896f8bc134b549d5fbe4d87c917be3c9804;hb=17332291e15183d71d88ed868275e3cb53917180;hp=e6bb300a258b4a7c9c72446efb7e6feb626a802a;hpb=4469def3e210fc904cfefc5b158fc6d4dc5f6e47;p=avr-crypto-lib.git diff --git a/test_src/main-twister256-test.c b/test_src/main-twister256-test.c index e6bb300..25ae089 100644 --- a/test_src/main-twister256-test.c +++ b/test_src/main-twister256-test.c @@ -1,6 +1,6 @@ /* main-twister256-test.c */ /* - This file is part of the Crypto-avr-lib/microcrypt-lib. + This file is part of the This file is part of the AVR-Crypto-Lib. Copyright (C) 2008 Daniel Otte (daniel.otte@rub.de) This program is free software: you can redistribute it and/or modify @@ -71,9 +71,14 @@ void testrun_nessie_twister256(void){ } /***************************************************************************** - * self tests * + * selftests + * *****************************************************************************/ +void print_hash(void* hash){ + uart_hexdump(hash, 256/8); +} + void testrun_twister256(void){ twister256_hash_t hash; char* testv[]={ @@ -92,7 +97,7 @@ void testrun_twister256(void){ uart_putstr(testv[i]); uart_putstr_P(PSTR("\") = \r\n\t")); twister256(&hash, testv[i], strlen(testv[i])*8); - uart_hexdump(hash, 256/8); + print_hash(hash); } uart_putstr_P(PSTR("\r\n\r\n=== TWISTER-256 test suit (short test values) ===")); @@ -103,9 +108,10 @@ void testrun_twister256(void){ uart_hexdump(&(stestv[i]), 1); uart_putstr_P(PSTR("\") = \r\n\t")); twister256(&hash, &(stestv[i]), stestl[i]); - uart_hexdump(hash, 256/8); + print_hash(hash); } - + +#ifdef TWISTER_LONGTEST uart_putstr_P(PSTR("\r\n\r\n=== TWISTER-256 test suit (long test) ===")); char* ltest= "abcdefghbcdefghicdefghijdefghijk" "efghijklfghijklmghijklmnhijklmno"; @@ -118,7 +124,8 @@ void testrun_twister256(void){ twister224_nextBlock(&ctx, ltest); } twister256_ctx2hash(hash, &ctx); - uart_hexdump(hash, 256/8); + print_hash(hash); +#endif }