* \email daniel.otte@rub.de
* \date 2009-05-10
* \license GPLv3 or later
- *
+ *
*/
#include "hfal-performance.h"
uint8_t data[(hf.blocksize_b+7)/8];
uint8_t digest[(hf.hashsize_b+7)/8];
uint64_t t;
-
+
if(hf.type!=HFDESC_TYPE_HASHFUNCTION)
return;
calibrateTimer();
+ print_overhead();
cli_putstr_P(PSTR("\r\n\r\n === "));
cli_putstr_P(hf.name);
cli_putstr_P(PSTR(" performance === "
+ "\r\n type: hashfunction"
"\r\n hashsize (bits): "));
printvalue(hf.hashsize_b);
-
+
cli_putstr_P(PSTR("\r\n ctxsize (bytes): "));
printvalue(hf.ctxsize_B);
-
+
cli_putstr_P(PSTR("\r\n blocksize (bits): "));
printvalue(hf.blocksize_b);
-
- startTimer(1);
+
+ startTimer(0);
+ START_TIMER;
hf.init(&ctx);
+ STOP_TIMER;
t = stopTimer();
cli_putstr_P(PSTR("\r\n init (cycles): "));
printvalue(t);
-
- startTimer(1);
+
+ startTimer(0);
+ START_TIMER;
hf.nextBlock(&ctx, data);
+ STOP_TIMER;
t = stopTimer();
cli_putstr_P(PSTR("\r\n nextBlock (cycles): "));
printvalue(t);
-
- startTimer(1);
+
+ startTimer(0);
+ START_TIMER;
hf.lastBlock(&ctx, data, 0);
+ STOP_TIMER;
t = stopTimer();
cli_putstr_P(PSTR("\r\n lastBlock (cycles): "));
printvalue(t);
-
- startTimer(1);
+
+ startTimer(0);
+ START_TIMER;
hf.ctx2hash(digest, &ctx);
+ STOP_TIMER;
t = stopTimer();
cli_putstr_P(PSTR("\r\n ctx2hash (cycles): "));
printvalue(t);
const hfdesc_t* hd;
for(;;){
hd = (void*)pgm_read_word(hd_list);
- if(!hd)
+ if(!hd){
+ cli_putstr_P(PSTR("\r\n\r\n End of performance figures\r\n"));
return;
+ }
hfal_performance(hd);
hd_list = (void*)((uint8_t*)hd_list + 2);
}