Topic: WolfSSL Test Vector Memory Usage
I am currently porting WolfMQTT and WolfSSL to an embedded platform using the Azure IOT hub example. I started getting everything working with the Windows based examples and am now getting the build working in embedded platform (NRF52840 - Cortex M4). (Everything work OK in the Windows version with a Cell Modem!)
I have wolfSSL building with the embedded tools and I am running the test routines. I am at the point where I can pass all the tests for my current settings (see below for settings). I noticed that I have to set aside lot quite a bit of heap and stack for the tests to pass. (90k of heap and 64k of stack). The stack/heap settings can be trimmed down a bit but there was some (slow) trial an error to just get the tests to pass.
Question 1:
Is it a good assumption that wolfSSL will need this amount of heap and stack at runtime? (MQTT with TLS to Azure). It is quite a bit of memory (I have 256k on my platform). My guess is that most memory usage is just for the mechanics of the tests.
I am considering moving to another CPU to get some external SDRAM to be safe but want to get a true feel for the resource usage.
Question 2:
The tests take about 10 minutes (64MHz cortex M4). Most of that is in the ECC test. Is this to be expected?
My settings:
#ifdef WOLFSSL_NRF5x
#define WOLFSSL_NRF51
#define WOLFSSL_USER_IO
#define DEBUG_WOLFSSL
#define SIZEOF_LONG 4
#define SIZEOF_LONG_LONG 8
#define NO_ASN_TIME
#define NO_DEV_RANDOM
#define NO_FILESYSTEM
#define NO_MAIN_DRIVER
#define NO_WRITEV
#define NO_FILESYSTEM
#define NO_SESSION_CACHE
#define NO_PSK
#define HAVE_ECC
#define HAVE_TLS_EXTENSIONS
#define HAVE_SECURE_RENEGOTIATION
#define HAVE_AESGCM
#define HAVE_SUPPORTED_CURVES
#define HAVE_TLS_EXTENSIONS
#define HAVE_EXTENDED_MASTER
#define USE_FAST_MATH
#define USE_WOLFSSL_MEMORY
#define TFM_TIMING_RESISTANT
#define SINGLE_THREADED
#define WOLFSSL_SHA384
#define WOLFSSL_SHA512
#define WOLFSSL_RIPEMD
#define WOLFSSL_SHA512
#define WOLFSSL_USER_IO
#define WOLFSSL_BASE64_ENCODE
#define ECC_SHAMIR
#define ECC_TIMING_RESISTANT
#define SINGLE_THREADED
#if !defined(USE_CERT_BUFFERS_2048) && !defined(USE_CERT_BUFFERS_4096)
#define USE_CERT_BUFFERS_2048
#endif
#define BENCH_EMBEDDED
#endif