From 7cff22c4b0a14d26028302c1fc1c0e3e2f0cfee2 Mon Sep 17 00:00:00 2001 From: John Safranek Date: Fri, 30 Jan 2015 10:43:31 -0800 Subject: [PATCH] moved the buffers, key, and iv around in the file so lean-psk would still build --- wolfcrypt/benchmark/benchmark.c | 66 +++++++++++++++++---------------- 1 file changed, 35 insertions(+), 31 deletions(-) diff --git a/wolfcrypt/benchmark/benchmark.c b/wolfcrypt/benchmark/benchmark.c index 171cbfad0..9350f168a 100644 --- a/wolfcrypt/benchmark/benchmark.c +++ b/wolfcrypt/benchmark/benchmark.c @@ -173,6 +173,36 @@ static int OpenNitroxDevice(int dma_mode,int dev_id) static RNG rng; #endif +/* use kB instead of mB for embedded benchmarking */ +#ifdef BENCH_EMBEDDED + static byte plain [1024]; +#else + static byte plain [1024*1024]; +#endif + + +/* use kB instead of mB for embedded benchmarking */ +#ifdef BENCH_EMBEDDED + static byte cipher[1024]; +#else + static byte cipher[1024*1024]; +#endif + + +static const byte key[] = +{ + 0x01,0x23,0x45,0x67,0x89,0xab,0xcd,0xef, + 0xfe,0xde,0xba,0x98,0x76,0x54,0x32,0x10, + 0x89,0xab,0xcd,0xef,0x01,0x23,0x45,0x67 +}; + +static const byte iv[] = +{ + 0x12,0x34,0x56,0x78,0x90,0xab,0xcd,0xef, + 0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, + 0x11,0x21,0x31,0x41,0x51,0x61,0x71,0x81 +}; + /* so embedded projects can pull in tests on their own */ #if !defined(NO_MAIN_DRIVER) @@ -191,6 +221,11 @@ int benchmark_test(void *args) wolfSSL_Debugging_ON(); #endif + (void)plain; + (void)cipher; + (void)key; + (void)iv; + #ifdef HAVE_CAVIUM int ret = OpenNitroxDevice(CAVIUM_DIRECT, CAVIUM_DEV_ID); if (ret != 0) { @@ -327,37 +362,6 @@ static const char blockType[] = "megs"; /* used in printf output */ #endif -/* use kB instead of mB for embedded benchmarking */ -#ifdef BENCH_EMBEDDED -static byte plain [1024]; -#else -static byte plain [1024*1024]; -#endif - - -static const byte key[] = -{ - 0x01,0x23,0x45,0x67,0x89,0xab,0xcd,0xef, - 0xfe,0xde,0xba,0x98,0x76,0x54,0x32,0x10, - 0x89,0xab,0xcd,0xef,0x01,0x23,0x45,0x67 -}; - -static const byte iv[] = -{ - 0x12,0x34,0x56,0x78,0x90,0xab,0xcd,0xef, - 0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, - 0x11,0x21,0x31,0x41,0x51,0x61,0x71,0x81 - -}; - -/* use kB instead of mB for embedded benchmarking */ -#ifdef BENCH_EMBEDDED -static byte cipher[1024]; -#else -static byte cipher[1024*1024]; -#endif - - #ifndef NO_AES void bench_aes(int show)