]> git.cryptolib.org Git - avr-crypto-lib.git/blobdiff - test_src/main-aes128-test.c
some modifications in test suits
[avr-crypto-lib.git] / test_src / main-aes128-test.c
index 72e06f6198bbcd0819395eb3ddbdbe79b810b255..1934026022b6c9e3c72f057da0e4ed58ab500fc9 100644 (file)
@@ -30,6 +30,9 @@
 #include "nessie_bc_test.h"
 #include "cli.h"
 #include "performance_test.h"
+#include "blockcipher_descriptor.h"
+#include "bcal-performance.h"
+#include "bcal_aes128.h"
 #include <stdint.h>
 #include <string.h>
 #include <stdlib.h>
 
 char* algo_name = "AES-128";
 
+const bcdesc_t* algolist[] PROGMEM = {
+       (bcdesc_t*)&aes128_desc,
+       NULL
+};
+
+
 /*****************************************************************************
  *  additional validation-functions                                                                                     *
  *****************************************************************************/
@@ -102,48 +111,8 @@ void testrun_testkey_aes(void){
 
 /*****************************************************************************/
 
-void testrun_performance_aes128(void){
-       uint64_t t;
-       char str[16];
-       uint8_t key[32], data[16];
-       aes128_ctx_t ctx;
-
-       calibrateTimer();
-       print_overhead();
-
-       memset(key,  0, 32);
-       memset(data, 0, 16);
-
-       startTimer(1);
-       aes128_init(key, &ctx);
-       t = stopTimer();
-       cli_putstr_P(PSTR("\r\n\tctx-gen time: "));
-       ultoa((unsigned long)t, str, 10);
-       cli_putstr(str);
-
-
-       startTimer(1);
-       aes128_enc(data, &ctx);
-       t = stopTimer();
-       cli_putstr_P(PSTR("\r\n\tencrypt time: "));
-       ultoa((unsigned long)t, str, 10);
-       cli_putstr(str);
-
-
-       startTimer(1);
-       aes128_dec(data, &ctx);
-       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"));
-}
-
 void testrun_performance_aes(void){
-       cli_putstr_P(PSTR("\r\n -=AES Performance Test=-\r\n"));
-       cli_putstr_P(PSTR("\r\n       AES-128\r\n"));
-       testrun_performance_aes128();
+       bcal_performance_multiple(algolist);
 }
 
 /*****************************************************************************