X-Git-Url: https://git.cryptolib.org/?a=blobdiff_plain;f=test_src%2Fmain-des-test.c;h=f6d237c7e58e270894049714c21b9a07311a731b;hb=e2a5b474634f8c07d75119c2affdc6bb7f4e7848;hp=26a641516365c63071a0bae6e7d10ef6d31aeb86;hpb=83d0614d8b17eac97f891f7de2bb3ef265751dea;p=avr-crypto-lib.git diff --git a/test_src/main-des-test.c b/test_src/main-des-test.c index 26a6415..f6d237c 100644 --- a/test_src/main-des-test.c +++ b/test_src/main-des-test.c @@ -22,14 +22,16 @@ */ #include "config.h" -#include "serial-tools.h" -#include "uart.h" + +#include "uart_i.h" #include "debug.h" #include "des.h" #include "nessie_bc_test.h" #include "cli.h" #include "performance_test.h" +#include "bcal-performance.h" +#include "bcal_des.h" #include #include @@ -37,6 +39,10 @@ char* algo_name = "DES"; +const bcdesc_t* algolist[] PROGMEM = { + (bcdesc_t*)&des_desc, + NULL +}; /***************************************************************************** * additional validation-functions * *****************************************************************************/ @@ -67,31 +73,7 @@ void testrun_nessie_des(void){ void testrun_performance_des(void){ - uint64_t t; - char str[16]; - uint8_t key[8], data[8]; - - - calibrateTimer(); - print_overhead(); - - memset(key, 0, 8); - memset(data, 0, 8); - - startTimer(1); - des_enc(data, data, key); - t = stopTimer(); - cli_putstr_P(PSTR("\r\n\tencrypt time: ")); - ultoa((unsigned long)t, str, 10); - cli_putstr(str); - - startTimer(1); - des_dec(data, data, key); - t = stopTimer(); - cli_putstr_P(PSTR("\r\n\tdecrypt time: ")); - ultoa((unsigned long)t, str, 10); - cli_putstr(str); - cli_putstr_P(PSTR("\r\n")); + bcal_performance_multiple(algolist); } /***************************************************************************** * main @@ -113,8 +95,8 @@ cmdlist_entry_t cmdlist[] PROGMEM = { 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; for(;;){ cli_putstr_P(PSTR("\r\n\r\nCrypto-VS (")); cli_putstr(algo_name);