From ebcd78561c95c97fc9876a24a55727e89368c169 Mon Sep 17 00:00:00 2001 From: Dave Rodgman Date: Wed, 9 Aug 2023 18:56:42 +0100 Subject: [PATCH] Remove redundant code in mbedtls_mpi_cmp_abs Signed-off-by: Dave Rodgman --- library/bignum.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/library/bignum.c b/library/bignum.c index bf16ec1cf..d53a484cb 100644 --- a/library/bignum.c +++ b/library/bignum.c @@ -817,9 +817,8 @@ int mbedtls_mpi_cmp_abs(const mbedtls_mpi *X, const mbedtls_mpi *Y) } } - if (i == 0 && j == 0) { - return 0; - } + /* If i == j == 0, i.e. abs(X) == abs(Y), + * we end up returning 0 at the end of the function. */ if (i > j) { return 1;