Fixes required to make SP Math default

fasthugemath means turn on fastmath
Use sp_int_digit and not sp_digit in sp_int.c.
test.c needs to use large static buffer when SP Math used like fastmath.
When building static memroy, SP math all without WOLFSSL_SP_NO_MALLOC is
a valid configuration.
Fix freeing of bigint in sp_int.c.
Cast x to a signed value to negate and then back to unsigned. (For
Windows builds.)
Remove warning about empty file on Windows about integer.obj.
Allow RSA verify only and RSA public only to be used with other public
key algorithms.
If building for FIPS, then older versions of RSA and ECC require SP Math
to support negative numbers.
Get old FIPS files building with SP int.
Disallow --enable-sp-math and --enable-sp-math-all.
When just --enable-sp-math on configuration line then disable SP Math
all.
This commit is contained in:
Sean Parkinson
2022-01-19 10:20:21 +10:00
parent 6d2a41b9fd
commit ee12c12e98
7 changed files with 204 additions and 99 deletions

View File

@@ -34,6 +34,12 @@
/* in case user set USE_FAST_MATH there */
#include <wolfssl/wolfcrypt/settings.h>
#ifndef NO_BIG_INT
#if !defined(USE_FAST_MATH) && defined(USE_INTEGER_HEAP_MATH)
#ifndef WOLFSSL_SP_MATH
#ifdef NO_INLINE
#include <wolfssl/wolfcrypt/misc.h>
#else
@@ -41,12 +47,6 @@
#include <wolfcrypt/src/misc.c>
#endif
#ifndef NO_BIG_INT
#if !defined(USE_FAST_MATH) && defined(USE_INTEGER_HEAP_MATH)
#ifndef WOLFSSL_SP_MATH
#include <wolfssl/wolfcrypt/integer.h>
#if defined(FREESCALE_LTC_TFM)