]> git.cryptolib.org Git - avr-crypto-lib.git/blobdiff - test_src/main-twister256-test.c
renaming to AVR-Crypto-Lib
[avr-crypto-lib.git] / test_src / main-twister256-test.c
index e6bb300a258b4a7c9c72446efb7e6feb626a802a..25ae0896f8bc134b549d5fbe4d87c917be3c9804 100644 (file)
@@ -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
 }