}
/*****************************************************************************
- * self tests *
+ * selftests
+ *
*****************************************************************************/
+void print_hash(void* hash){
+ uart_hexdump(hash, 256/8);
+}
+
void testrun_twister256(void){
twister256_hash_t hash;
char* testv[]={
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) ==="));
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";
twister224_nextBlock(&ctx, ltest);
}
twister256_ctx2hash(hash, &ctx);
- uart_hexdump(hash, 256/8);
+ print_hash(hash);
+#endif
}