From c495845e7af0c7c82af97e53b2eb759ab947a0f5 Mon Sep 17 00:00:00 2001 From: Xiaokang Qian Date: Wed, 19 Jul 2023 09:11:36 +0000 Subject: [PATCH] Align ECP_MPI_INIT with mbedtls_mpi struct order in ecp_new.c Signed-off-by: Xiaokang Qian --- library/ecp_new.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/library/ecp_new.c b/library/ecp_new.c index 028a33bfa..0635d5353 100644 --- a/library/ecp_new.c +++ b/library/ecp_new.c @@ -2932,9 +2932,9 @@ int mbedtls_ecp_muladd(mbedtls_ecp_group *grp, mbedtls_ecp_point *R, #if defined(MBEDTLS_ECP_MONTGOMERY_ENABLED) #if defined(MBEDTLS_ECP_DP_CURVE25519_ENABLED) -#define ECP_MPI_INIT(s, n, p) { s, (n), (mbedtls_mpi_uint *) (p) } +#define ECP_MPI_INIT(_p, _n) { .p = (mbedtls_mpi_uint *) (_p), .s = 1, .n = (_n) } #define ECP_MPI_INIT_ARRAY(x) \ - ECP_MPI_INIT(1, sizeof(x) / sizeof(mbedtls_mpi_uint), x) + ECP_MPI_INIT(x, sizeof(x) / sizeof(mbedtls_mpi_uint)) /* * Constants for the two points other than 0, 1, -1 (mod p) in * https://cr.yp.to/ecdh.html#validate