From ec00b500b52a4a8cbe398a76efa20bcbdad6ffea Mon Sep 17 00:00:00 2001 From: Minos Galanakis Date: Tue, 23 May 2023 17:31:01 +0100 Subject: [PATCH] ecp_curves: Adjusted input checking for `ecp_mod_p255`. Signed-off-by: Minos Galanakis --- library/ecp_curves.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/library/ecp_curves.c b/library/ecp_curves.c index c9868f39d2..6192f6a645 100644 --- a/library/ecp_curves.c +++ b/library/ecp_curves.c @@ -5432,9 +5432,7 @@ MBEDTLS_STATIC_TESTABLE int mbedtls_ecp_mod_p255_raw(mbedtls_mpi_uint *X, size_t X_Limbs) { - if (X_Limbs > 2*P255_WIDTH) { - X_Limbs = 2*P255_WIDTH; - } else if (X_Limbs < P255_WIDTH) { + if (X_Limbs != 2 * P255_WIDTH) { return MBEDTLS_ERR_ECP_BAD_INPUT_DATA; }