bootutil: allow RSA encryption keys without DP/DQ/QP
Allow runtime generation of CRT params when not available in the
embedded private key. Also remove parsing/calculation of CRT
parameters when CRT was disabled in the config (mbedTLS does not
use those in this case).
Signed-off-by: Fabio Utzig <utzig@apache.org>
diff --git a/boot/zephyr/os.c b/boot/zephyr/os.c
index 2d9faae..eaa60b4 100644
--- a/boot/zephyr/os.c
+++ b/boot/zephyr/os.c
@@ -40,7 +40,11 @@
#if (CONFIG_BOOT_SIGNATURE_TYPE_RSA_LEN == 2048) && !defined(CONFIG_BOOT_ENCRYPT_RSA)
#define CRYPTO_HEAP_SIZE 6144
#else
-#define CRYPTO_HEAP_SIZE 10240
+# if !defined(MBEDTLS_RSA_NO_CRT)
+# define CRYPTO_HEAP_SIZE 10240
+# else
+# define CRYPTO_HEAP_SIZE 16384
+# endif
#endif
static unsigned char mempool[CRYPTO_HEAP_SIZE];