From e9fa7a74cd6fb62bbc241576f35abdd67f19507b Mon Sep 17 00:00:00 2001 From: Minos Galanakis Date: Wed, 18 Jan 2023 09:46:52 +0000 Subject: [PATCH] ecp_curves: Update pre-processor define guards for `ecp_mpi_load()`. This patch adjusts the logic, so that the method is included, when the following components are enabled: * MBEDTLS_ECP_DP_CURVE448_ENABLED * MBEDTLS_ECP_DP_CURVE25519_ENABLED * ECP_LOAD_GROUP Signed-off-by: Minos Galanakis --- library/ecp_curves.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/library/ecp_curves.c b/library/ecp_curves.c index 88c4c850a9..727283f73a 100644 --- a/library/ecp_curves.c +++ b/library/ecp_curves.c @@ -4502,7 +4502,9 @@ static const mbedtls_ecp_point brainpoolP512r1_T[32] = { #endif #endif /* MBEDTLS_ECP_DP_BP512R1_ENABLED */ -#if defined(ECP_LOAD_GROUP) + +#if defined(ECP_LOAD_GROUP) || defined(MBEDTLS_ECP_DP_CURVE25519_ENABLED) || \ + defined(MBEDTLS_ECP_DP_CURVE448_ENABLED) /* * Create an MPI from embedded constants * (assumes len is an exact multiple of sizeof mbedtls_mpi_uint) @@ -4513,7 +4515,9 @@ static inline void ecp_mpi_load(mbedtls_mpi *X, const mbedtls_mpi_uint *p, size_ X->n = len / sizeof(mbedtls_mpi_uint); X->p = (mbedtls_mpi_uint *) p; } +#endif +#if defined(ECP_LOAD_GROUP) /* * Set an MPI to static value 1 */