From 1b531ff7e53affbdd6ebbde73ee4a5c765a1cf91 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20P=C3=A9gouri=C3=A9-Gonnard?= Date: Tue, 14 Apr 2026 12:58:37 +0200 Subject: [PATCH] ecp: make mpi_one const again MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit That way, it can be stored in read-only memory. Signed-off-by: Manuel Pégourié-Gonnard --- library/ecp_curves.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/library/ecp_curves.c b/library/ecp_curves.c index 6b19096705..34f87df167 100644 --- a/library/ecp_curves.c +++ b/library/ecp_curves.c @@ -47,7 +47,7 @@ defined(MBEDTLS_ECP_DP_SECP256K1_ENABLED) /* For these curves, we build the group parameters dynamically. */ #define ECP_LOAD_GROUP -static mbedtls_mpi_uint mpi_one[] = { 1 }; +static const mbedtls_mpi_uint mpi_one[] = { 1 }; #endif /* @@ -4509,9 +4509,7 @@ static inline void ecp_mpi_load(mbedtls_mpi *X, const mbedtls_mpi_uint *p, size_ */ static inline void ecp_mpi_set1(mbedtls_mpi *X) { - X->s = 1; - X->n = 1; - X->p = mpi_one; + ecp_mpi_load(X, mpi_one, sizeof(mbedtls_mpi_uint)); } /*