mirror of
https://github.com/espressif/esp-idf.git
synced 2025-09-01 22:38:30 +00:00
mbedtls: fix hardware MPI (bignum) related regression
In commit de22f3a4e5
, combination of
hardware and software MPI (bignum) related approach was used to
work around chip (e.g. ESP32-C3) limitation of max 3072 bits support.
This was done using linker "--wrap" flag but since the relevant API is
being used in same translation (compilation unit), hardware mode was not
getting used in some cases (e.g., RSA key generation).
This commit modified internal mbedTLS API and makes software+hardware
combination deterministic.
This commit is contained in:
@@ -153,15 +153,22 @@
|
||||
#undef MBEDTLS_MD5_ALT
|
||||
#endif
|
||||
|
||||
/* The following MPI (bignum) functions have ESP32 hardware support.
|
||||
For exponential mod, both software and hardware implementation
|
||||
will be compiled. If CONFIG_MBEDTLS_HARDWARE_MPI is enabled, mod APIs
|
||||
will be wrapped to use hardware implementation.
|
||||
*/
|
||||
#undef MBEDTLS_MPI_EXP_MOD_ALT
|
||||
/* The following MPI (bignum) functions have hardware support.
|
||||
* Uncommenting these macros will use the hardware-accelerated
|
||||
* implementations.
|
||||
*/
|
||||
#ifdef CONFIG_MBEDTLS_HARDWARE_MPI
|
||||
#ifdef CONFIG_MBEDTLS_LARGE_KEY_SOFTWARE_MPI
|
||||
/* Prefer hardware and fallback to software */
|
||||
#define MBEDTLS_MPI_EXP_MOD_ALT_FALLBACK
|
||||
#else
|
||||
/* Hardware only mode */
|
||||
#define MBEDTLS_MPI_EXP_MOD_ALT
|
||||
#endif
|
||||
#define MBEDTLS_MPI_MUL_MPI_ALT
|
||||
#else
|
||||
#undef MBEDTLS_MPI_EXP_MOD_ALT_FALLBACK
|
||||
#undef MBEDTLS_MPI_EXP_MOD_ALT
|
||||
#undef MBEDTLS_MPI_MUL_MPI_ALT
|
||||
#endif
|
||||
|
||||
|
Reference in New Issue
Block a user