This is an automated email from the ASF dual-hosted git repository.

utzig pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-core.git


The following commit(s) were added to refs/heads/master by this push:
     new 352e598  crypto: mbedtls: optional montgomery curve support
     new 4f394bd  Merge pull request #2567 from utzig/optional-montgomery-curves
352e598 is described below

commit 352e598191331fcdd5efbd4871b205c62d864a3c
Author: Fabio Utzig <ut...@apache.org>
AuthorDate: Wed Apr 14 10:30:46 2021 -0300

    crypto: mbedtls: optional montgomery curve support
    
    Add a new syscfg to enable/disable Curve448 support. Both Curve25519 and
    Curve448 are montgomery form elliptic curves, and bring in a lot of
    supporting code. Curve25519 was already disabled by default, but there
    was no option to disable Curve448, so the montgomery support code was
    built whenever MbedTLS based EC code was being used. Leaving this option
    disabled reduces MbedTLS' size by about 2KB (for EC users).
    
    Signed-off-by: Fabio Utzig <ut...@apache.org>
---
 crypto/mbedtls/include/mbedtls/config_mynewt.h | 3 +++
 crypto/mbedtls/selftest/syscfg.yml             | 1 +
 crypto/mbedtls/syscfg.yml                      | 2 ++
 3 files changed, 6 insertions(+)

diff --git a/crypto/mbedtls/include/mbedtls/config_mynewt.h 
b/crypto/mbedtls/include/mbedtls/config_mynewt.h
index b61c314..82858d2 100644
--- a/crypto/mbedtls/include/mbedtls/config_mynewt.h
+++ b/crypto/mbedtls/include/mbedtls/config_mynewt.h
@@ -214,6 +214,9 @@ extern "C" {
 #if MYNEWT_VAL(MBEDTLS_ECP_DP_CURVE25519) == 0
 #undef MBEDTLS_ECP_DP_CURVE25519_ENABLED
 #endif
+#if MYNEWT_VAL(MBEDTLS_ECP_DP_CURVE448) == 0
+#undef MBEDTLS_ECP_DP_CURVE448_ENABLED
+#endif
 
 #if MYNEWT_VAL(MBEDTLS_ECJPAKE_C) == 0
 #undef MBEDTLS_ECJPAKE_C
diff --git a/crypto/mbedtls/selftest/syscfg.yml 
b/crypto/mbedtls/selftest/syscfg.yml
index bf78d87..748e17e 100644
--- a/crypto/mbedtls/selftest/syscfg.yml
+++ b/crypto/mbedtls/selftest/syscfg.yml
@@ -29,6 +29,7 @@ syscfg.vals:
   MBEDTLS_ECP_DP_BP384R1: 1
   MBEDTLS_ECP_DP_BP512R1: 1
   MBEDTLS_ECP_DP_CURVE25519: 1
+  MBEDTLS_ECP_DP_CURVE448: 1
   MBEDTLS_ECJPAKE_C: 1
 
   # Ciphers
diff --git a/crypto/mbedtls/syscfg.yml b/crypto/mbedtls/syscfg.yml
index 31d5917..485144f 100644
--- a/crypto/mbedtls/syscfg.yml
+++ b/crypto/mbedtls/syscfg.yml
@@ -48,6 +48,8 @@ syscfg.defs:
     value: 0
   MBEDTLS_ECP_DP_CURVE25519:
     value: 0
+  MBEDTLS_ECP_DP_CURVE448:
+    value: 0
   MBEDTLS_ECJPAKE_C:
     value: 0
 

Reply via email to