From be8000d5f74d9f8ef10c5448407729829062e75c Mon Sep 17 00:00:00 2001 From: David Garske Date: Wed, 27 Dec 2023 10:25:46 -0800 Subject: [PATCH] Add useful information about single precision math and document options for enabling additional curves/key sizes. --- IDE/STM32Cube/default_conf.ftl | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/IDE/STM32Cube/default_conf.ftl b/IDE/STM32Cube/default_conf.ftl index d08b9dba9..63c4abc1a 100644 --- a/IDE/STM32Cube/default_conf.ftl +++ b/IDE/STM32Cube/default_conf.ftl @@ -213,14 +213,17 @@ extern ${variable.value} ${variable.name}; /* ------------------------------------------------------------------------- */ /* Math Configuration */ /* ------------------------------------------------------------------------- */ -/* 1=Fast (stack) - * 2=Normal (heap) - * 3=Single Precision C (only common curves/key sizes) - * 4=Single Precision ASM Cortex-M3+ - * 5=Single Precision ASM Cortex-M0 (Generic Thumb) - * 6=Single Precision C all small - * 7=Single Precision C all big +/* 1=Fast (stack) (tfm.c) + * 2=Normal (heap) (integer.c) + * 3-5=Single Precision: only common curves/key sizes: + * (ECC 256/384/521 and RSA/DH 2048/3072/4096) + * 3=Single Precision C (sp_c32.c) + * 4=Single Precision ASM Cortex-M3+ (sp_cortexm.c) + * 5=Single Precision ASM Cortex-M0 (sp_armthumb.c) + * 6=Wolf multi-precision C small (sp_int.c) + * 7=Wolf multi-precision C big (sp_int.c) */ + #if defined(WOLF_CONF_MATH) && WOLF_CONF_MATH == 1 /* fast (stack) math - tfm.c */ #define USE_FAST_MATH @@ -246,19 +249,26 @@ extern ${variable.value} ${variable.name}; #endif #if defined(WOLF_CONF_RSA) && WOLF_CONF_RSA == 1 #define WOLFSSL_HAVE_SP_RSA + //#define WOLFSSL_SP_NO_2048 + //#define WOLFSSL_SP_NO_3072 + //#define WOLFSSL_SP_4096 #endif #if defined(WOLF_CONF_DH) && WOLF_CONF_DH == 1 #define WOLFSSL_HAVE_SP_DH #endif #if defined(WOLF_CONF_ECC) && WOLF_CONF_ECC == 1 #define WOLFSSL_HAVE_SP_ECC + //#define WOLFSSL_SP_NO_256 + //#define WOLFSSL_SP_384 + //#define WOLFSSL_SP_521 #endif #if WOLF_CONF_MATH == 6 || WOLF_CONF_MATH == 7 #define WOLFSSL_SP_MATH_ALL /* use sp_int.c multi precision math */ + //#define WOLFSSL_SP_ARM_THUMB /* enable ARM Thumb ASM speedups */ #else #define WOLFSSL_SP_MATH /* disable non-standard curves / key sizes */ #endif - #define SP_WORD_SIZE 32 + #define SP_WORD_SIZE 32 /* force 32-bit mode */ /* Enable to put all math on stack (no heap) */ //#define WOLFSSL_SP_NO_MALLOC