X-Git-Url: https://git.cryptolib.org/?p=avr-crypto-lib.git;a=blobdiff_plain;f=test_src%2Fmain-arcfour-test.c;h=7f402155138f89e27d11f68147c366145740f4af;hp=30801f8a6052a3bbe908a8ca296e6d2eac7cb281;hb=4b5da1dc27a791b5c448274a3db09cd035b33493;hpb=27f4804c185ae24b3b6367bb2fdb898d6692d0f6 diff --git a/test_src/main-arcfour-test.c b/test_src/main-arcfour-test.c index 30801f8..7f40215 100644 --- a/test_src/main-arcfour-test.c +++ b/test_src/main-arcfour-test.c @@ -1,7 +1,7 @@ /* main-arcfour-test.c */ /* This file is part of the AVR-Crypto-Lib. - Copyright (C) 2008 Daniel Otte (daniel.otte@rub.de) + Copyright (C) 2006-2015 Daniel Otte (bg@nerilex.org) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -31,12 +31,12 @@ #include "scal-basic.h" #include "scal-nessie.h" -char* algo_name = "Arcfour"; +char *algo_name = "Arcfour"; /***************************************************************************** * additional validation-functions * *****************************************************************************/ -void arcfour_genctx_dummy(uint8_t* key, uint16_t keysize, void* ctx){ +void arcfour_genctx_dummy(uint8_t *key, uint16_t keysize, void *ctx){ arcfour_init(key, (uint8_t)((keysize+7)/8), ctx); } @@ -45,8 +45,7 @@ void testrun_nessie_arcfour(void){ } void testrun_performance_arcfour(void){ - uint64_t t; - char str[16]; + uint32_t t; uint8_t key[16]; arcfour_ctx_t ctx; @@ -55,21 +54,16 @@ void testrun_performance_arcfour(void){ memset(key, 0, 16); + uart0_flush(); startTimer(1); arcfour_init(key, 16, &ctx); t = stopTimer(); - cli_putstr_P(PSTR("\r\n\tctx-gen time: ")); - ultoa((unsigned long)t, str, 10); - cli_putstr(str); - + printf_P(PSTR("\tctx-gen time: %10"PRIu32"\n"), t); + uart0_flush(); startTimer(1); arcfour_gen(&ctx); t = stopTimer(); - cli_putstr_P(PSTR("\r\n\tencrypt time: ")); - ultoa((unsigned long)t, str, 10); - cli_putstr(str); - - cli_putstr_P(PSTR("\r\n")); + printf_P(PSTR("\tencrypt time: %10"PRIu32"\n"), t); } @@ -93,9 +87,6 @@ const cmdlist_entry_t cmdlist[] PROGMEM = { int main(void) { main_setup(); - shavs_algolist=(hfdesc_t**)algolist; - shavs_algo=(hfdesc_t*)&sha256_desc; - for(;;){ welcome_msg(algo_name); cmd_interface(cmdlist);