Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for SP math only case to ensure fast math and heap math are disabled #6590

Merged
merged 1 commit into from
Jul 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions wolfssl/wolfcrypt/settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -2033,17 +2033,22 @@ extern void uITRON4_free(void *p) ;
* Constant time: Always
* Enable: WOLFSSL_SP_MATH_ALL
*/
#undef USE_FAST_MATH
#undef USE_INTEGER_HEAP_MATH
#elif defined(WOLFSSL_SP_MATH)
/* 2) SP Math with restricted key sizes: wolfSSL proprietary math
* implementation (sp_*.c).
* Constant time: Always
* Enable: WOLFSSL_SP_MATH
*/
#undef USE_FAST_MATH
#undef USE_INTEGER_HEAP_MATH
#elif defined(USE_FAST_MATH)
/* 3) Tom's Fast Math: Stack based (tfm.c)
* Constant time: Only with TFM_TIMING_RESISTANT
* Enable: USE_FAST_MATH
*/
#undef USE_INTEGER_HEAP_MATH
#elif defined(USE_INTEGER_HEAP_MATH)
/* 4) Integer Heap Math: Heap based (integer.c)
* Constant time: Not supported
Expand Down
6 changes: 5 additions & 1 deletion wolfssl/wolfcrypt/sp.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,11 @@
#include <wolfssl/wolfcrypt/wolfmath.h>
#include <wolfssl/wolfcrypt/sp_int.h>

#include <wolfssl/wolfcrypt/ecc.h>
#if defined(HAVE_ECC) && defined(WOLFSSL_HAVE_SP_ECC)
#include <wolfssl/wolfcrypt/ecc.h>
#else
#undef WOLFSSL_HAVE_SP_ECC
#endif

#ifdef noinline
#define SP_NOINLINE noinline
Expand Down