#include "config.h"
#include "serial-tools.h"
-#include "uart.h"
+#include "uart_i.h"
#include "debug.h"
#include "sha1.h"
#include "nessie_hash_test.h"
-#include "performance_test.h"
+#include "hfal_sha1.h"
+#include "hfal-performance.h"
#include <stdint.h>
#include <string.h>
char* algo_name = "SHA-1";
+const hfdesc_t* algolist[] PROGMEM = {
+ (hfdesc_t*)&sha1_desc,
+ NULL
+};
/*****************************************************************************
* additional validation-functions *
*****************************************************************************/
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);
}
{ NULL, NULL, NULL}
};
-const hfdesc_t* algolist[] PROGMEM = {
- (hfdesc_t*)&sha1_desc,
- NULL
-};
-
int main (void){
DEBUG_INIT();
- cli_rx = uart_getc;
- cli_tx = uart_putc;
+ cli_rx = (cli_rx_fpt)uart0_getc;
+ cli_tx = (cli_tx_fpt)uart0_putc;
shavs_algolist=(hfdesc_t**)algolist;
shavs_algo=(hfdesc_t*)&sha1_desc;
for(;;){