From ad45c4d3862b1a64f66f96a52ccbc433bdf5720b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20P=C3=A9gouri=C3=A9-Gonnard?= Date: Tue, 6 Dec 2022 13:20:06 +0100 Subject: [PATCH] Document that ECP_RESTARTABLE depends on ECP_C MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is not new, it had always been the case, just not documented. Pointed out by depends.py pkalgs (again, now that restartable is part of full). Signed-off-by: Manuel Pégourié-Gonnard --- include/mbedtls/check_config.h | 5 +++++ include/mbedtls/mbedtls_config.h | 2 ++ tests/scripts/depends.py | 1 + 3 files changed, 8 insertions(+) diff --git a/include/mbedtls/check_config.h b/include/mbedtls/check_config.h index e2f8e62700..17010fe5a1 100644 --- a/include/mbedtls/check_config.h +++ b/include/mbedtls/check_config.h @@ -124,6 +124,11 @@ #error "MBEDTLS_ECP_RESTARTABLE defined, but it cannot coexist with an alternative ECP implementation" #endif +#if defined(MBEDTLS_ECP_RESTARTABLE) && \ + !defined(MBEDTLS_ECP_C) +#error "MBEDTLS_ECP_RESTARTABLE defined, but not all prerequisites" +#endif + #if defined(MBEDTLS_ECDSA_DETERMINISTIC) && !defined(MBEDTLS_HMAC_DRBG_C) #error "MBEDTLS_ECDSA_DETERMINISTIC defined, but not all prerequisites" #endif diff --git a/include/mbedtls/mbedtls_config.h b/include/mbedtls/mbedtls_config.h index 921a74918f..5d4033c170 100644 --- a/include/mbedtls/mbedtls_config.h +++ b/include/mbedtls/mbedtls_config.h @@ -723,6 +723,8 @@ * * \note This option only works for Short Weierstrass curves. * + * Requires: MBEDTLS_ECP_C + * * Uncomment this macro to enable restartable ECC computations. */ //#define MBEDTLS_ECP_RESTARTABLE diff --git a/tests/scripts/depends.py b/tests/scripts/depends.py index 0d6ec94c80..d09b732ca6 100755 --- a/tests/scripts/depends.py +++ b/tests/scripts/depends.py @@ -234,6 +234,7 @@ REVERSE_DEPENDENCIES = { 'MBEDTLS_ECP_C': ['MBEDTLS_ECDSA_C', 'MBEDTLS_ECDH_C', 'MBEDTLS_ECJPAKE_C', + 'MBEDTLS_ECP_RESTARTABLE', 'MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA_ENABLED', 'MBEDTLS_KEY_EXCHANGE_ECDH_RSA_ENABLED', 'MBEDTLS_KEY_EXCHANGE_ECDHE_PSK_ENABLED',