diff --git a/IDE/MDK5-ARM/Projects/CryptBenchmark/RTE/wolfSSL/user_settings.h b/IDE/MDK5-ARM/Projects/CryptBenchmark/RTE/wolfSSL/user_settings.h index e8ba54756..b90bf7acd 100644 --- a/IDE/MDK5-ARM/Projects/CryptBenchmark/RTE/wolfSSL/user_settings.h +++ b/IDE/MDK5-ARM/Projects/CryptBenchmark/RTE/wolfSSL/user_settings.h @@ -18,7 +18,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ - + +#define WOLFSSL_MDK5_COMPLv5 #define NO_MAIN_DRIVER #define BENCH_EMBEDDED #define NO_DEV_RANDOM diff --git a/wolfcrypt/benchmark/benchmark.c b/wolfcrypt/benchmark/benchmark.c index a6cb58e72..b03ba7c9b 100644 --- a/wolfcrypt/benchmark/benchmark.c +++ b/wolfcrypt/benchmark/benchmark.c @@ -3989,15 +3989,32 @@ static void bench_rsa_helper(int doAsync, RsaKey rsaKey[BENCH_MAX_PENDING], #ifndef WOLFSSL_RSA_VERIFY_ONLY DECLARE_VAR_INIT(message, byte, len, messageStr, HEAP_HINT); #endif - - DECLARE_ARRAY_DYNAMIC(enc, byte, BENCH_MAX_PENDING, rsaKeySz, HEAP_HINT); + #if !defined(WOLFSSL_MDK5_COMPLv5) + /* MDK5 compiler regard this as a executable statement, and does not allow declarations after the line. */ + DECLARE_ARRAY_DYNAMIC_DEC(enc, byte, BENCH_MAX_PENDING, rsaKeySz, HEAP_HINT); + #else + byte* enc[BENCH_MAX_PENDING]; + int idxenc; + #endif #if !defined(WOLFSSL_RSA_VERIFY_INLINE) && \ !defined(WOLFSSL_RSA_PUBLIC_ONLY) - DECLARE_ARRAY_DYNAMIC(out, byte, BENCH_MAX_PENDING, rsaKeySz, HEAP_HINT); + #if !defined(WOLFSSL_MDK5_COMPLv5) + /* MDK5 compiler regard this as a executable statement, and does not allow declarations after the line. */ + DECLARE_ARRAY_DYNAMIC_DEC(out, byte, BENCH_MAX_PENDING, rsaKeySz, HEAP_HINT); + #else + int idxout; + byte* out[BENCH_MAX_PENDING]; + #endif #else byte* out[BENCH_MAX_PENDING]; #endif + DECLARE_ARRAY_DYNAMIC_EXE(enc, byte, BENCH_MAX_PENDING, rsaKeySz, HEAP_HINT); + #if !defined(WOLFSSL_RSA_VERIFY_INLINE) && \ + !defined(WOLFSSL_RSA_PUBLIC_ONLY) + DECLARE_ARRAY_DYNAMIC_EXE(out, byte, BENCH_MAX_PENDING, rsaKeySz, HEAP_HINT); + #endif + if (!rsa_sign_verify) { #ifndef WOLFSSL_RSA_VERIFY_ONLY /* begin public RSA */