Skip to content

Commit 3f27466

Browse files
feat(mbedtls): support ecp fixed-point multiplication configurable
1 parent 31d87a0 commit 3f27466

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

components/mbedtls/Kconfig

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -982,6 +982,16 @@ menu "mbedTLS"
982982

983983
Disabling this option saves some code size.
984984

985+
config MBEDTLS_ECP_FIXED_POINT_OPTIM
986+
bool "Enable fixed-point multiplication optimisations"
987+
depends on MBEDTLS_ECP_C
988+
default y
989+
help
990+
This configuration option enables optimizations to speedup (about 3 ~ 4 times) the ECP
991+
fixed point multiplication using pre-computed tables in the flash memory.
992+
Disabling this configuration option saves flash footprint (about 29KB if all Elliptic Curve selected)
993+
in the application binary.
994+
985995
# end of Elliptic Curve options
986996

987997
config MBEDTLS_POLY1305_C

components/mbedtls/port/include/mbedtls/esp_config.h

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -488,6 +488,19 @@
488488
#undef MBEDTLS_ECP_NIST_OPTIM
489489
#endif
490490

491+
/**
492+
* \def MBEDTLS_ECP_FIXED_POINT_OPTIM
493+
*
494+
* Enable speed up fixed-point multiplication.
495+
*
496+
* Comment this macro to disable FIXED POINT curves optimisation.
497+
*/
498+
#ifdef CONFIG_MBEDTLS_ECP_FIXED_POINT_OPTIM
499+
#define MBEDTLS_ECP_FIXED_POINT_OPTIM 1
500+
#else
501+
#define MBEDTLS_ECP_FIXED_POINT_OPTIM 0
502+
#endif
503+
491504
/**
492505
* \def MBEDTLS_ECDSA_DETERMINISTIC
493506
*

0 commit comments

Comments
 (0)