*/
#include "config.h"
-#include "serial-tools.h"
-#include "uart.h"
+
+#include "uart_i.h"
#include "debug.h"
#include "md5.h"
#include "nessie_hash_test.h"
#include "performance_test.h"
+#include "hfal_md5.h"
+#include "hfal-performance.h"
#include <stdint.h>
#include <string.h>
char* algo_name = "MD5";
+const hfdesc_t* algolist[] PROGMEM = {
+ (hfdesc_t*)&md5_desc,
+ NULL
+};
+
/*****************************************************************************
* additional validation-functions *
*****************************************************************************/
void testrun_performance_md5(void){
- uint64_t t;
- char str[16];
- uint8_t data[32];
- md5_ctx_t ctx;
-
- calibrateTimer();
- print_overhead();
-
- memset(data, 0, 32);
-
- startTimer(1);
- md5_init(&ctx);
- t = stopTimer();
- cli_putstr_P(PSTR("\r\n\tctx-gen time: "));
- ultoa((unsigned long)t, str, 10);
- cli_putstr(str);
-
-
- startTimer(1);
- md5_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);
- md5_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);
}
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;
+ testrun_md5();
for(;;){
cli_putstr_P(PSTR("\r\n\r\nCrypto-VS ("));
cli_putstr(algo_name);