From ac0181d527ee6ce091b4e00cfb6b0415b3c68a93 Mon Sep 17 00:00:00 2001 From: John Safranek Date: Fri, 20 Jan 2017 15:14:12 -0800 Subject: [PATCH] In benchmark, change the calls to InitRNG to the explicit heap versions like all the other crypt calls so it works with static memory. Plays nice with FIPS mode if available. --- wolfcrypt/benchmark/benchmark.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/wolfcrypt/benchmark/benchmark.c b/wolfcrypt/benchmark/benchmark.c index 32e5e007c..72f54cceb 100644 --- a/wolfcrypt/benchmark/benchmark.c +++ b/wolfcrypt/benchmark/benchmark.c @@ -339,7 +339,13 @@ int benchmark_test(void *args) #if defined(HAVE_LOCAL_RNG) { - int rngRet = wc_InitRng(&rng); + int rngRet; + +#ifndef HAVE_FIPS + rngRet = wc_InitRng_ex(&rng, HEAP_HINT); +#else + rngRet = wc_InitRng(&rng); +#endif if (rngRet < 0) { printf("InitRNG failed\n"); return rngRet; @@ -538,7 +544,11 @@ void bench_rng(void) #endif #ifndef HAVE_LOCAL_RNG +#ifndef HAVE_FIPS + ret = wc_InitRng_ex(&rng, HEAP_HINT); +#else ret = wc_InitRng(&rng); +#endif if (ret < 0) { printf("InitRNG failed\n"); return;