From be4d6b62ab6ab9dd94150469a4593d0ede049652 Mon Sep 17 00:00:00 2001 From: Xiaokang Qian Date: Thu, 15 Jun 2023 07:10:48 +0000 Subject: [PATCH] Fix use of sizeof without brackets in ecp_curves.c Signed-off-by: Xiaokang Qian --- library/ecp_curves.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/library/ecp_curves.c b/library/ecp_curves.c index 2595119d5..408ace638 100644 --- a/library/ecp_curves.c +++ b/library/ecp_curves.c @@ -4507,8 +4507,7 @@ static const mbedtls_ecp_point brainpoolP512r1_T[32] = { #if defined(ECP_LOAD_GROUP) /* * Create an MPI from embedded constants - * (assumes len is an exact multiple of sizeof(mbedtls_mpi_uint) and - * len < 1048576) + * (assumes len is an exact multiple of sizeof(mbedtls_mpi_uint)) */ static inline void ecp_mpi_load(mbedtls_mpi *X, const mbedtls_mpi_uint *p, size_t len) { @@ -5358,7 +5357,7 @@ static inline int ecp_mod_koblitz(mbedtls_mpi *N, mbedtls_mpi_uint *Rp, size_t p if (M.n > p_limbs + adjust) { M.n = p_limbs + adjust; } - memset(Mp, 0, sizeof Mp); + memset(Mp, 0, sizeof(Mp)); memcpy(Mp, N->p + p_limbs - adjust, M.n * sizeof(mbedtls_mpi_uint)); if (shift != 0) { MBEDTLS_MPI_CHK(mbedtls_mpi_shift_r(&M, shift)); @@ -5384,7 +5383,7 @@ static inline int ecp_mod_koblitz(mbedtls_mpi *N, mbedtls_mpi_uint *Rp, size_t p if (M.n > p_limbs + adjust) { M.n = p_limbs + adjust; } - memset(Mp, 0, sizeof Mp); + memset(Mp, 0, sizeof(Mp)); memcpy(Mp, N->p + p_limbs - adjust, M.n * sizeof(mbedtls_mpi_uint)); if (shift != 0) { MBEDTLS_MPI_CHK(mbedtls_mpi_shift_r(&M, shift));