From 627e5b1f91749cdd1c59891eb4bdb49a000578f2 Mon Sep 17 00:00:00 2001 From: Gabor Mezei Date: Tue, 24 Jan 2023 18:13:24 +0100 Subject: [PATCH] Only enable fix_quasi_reduction when testing Avoid compiler error due to the fix_quasi_reduction function is static and has not been used. Signed-off-by: Gabor Mezei --- library/bignum_mod_raw.c | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/library/bignum_mod_raw.c b/library/bignum_mod_raw.c index 049cdb2fb..6ac9e72db 100644 --- a/library/bignum_mod_raw.c +++ b/library/bignum_mod_raw.c @@ -118,15 +118,7 @@ void mbedtls_mpi_mod_raw_sub(mbedtls_mpi_uint *X, (void) mbedtls_mpi_core_add_if(X, N->p, N->limbs, (unsigned) c); } -void mbedtls_mpi_mod_raw_mul(mbedtls_mpi_uint *X, - const mbedtls_mpi_uint *A, - const mbedtls_mpi_uint *B, - const mbedtls_mpi_mod_modulus *N, - mbedtls_mpi_uint *T) -{ - mbedtls_mpi_core_montmul(X, A, B, N->limbs, N->p, N->limbs, - N->rep.mont.mm, T); -} +#if defined(MBEDTLS_TEST_HOOKS) MBEDTLS_STATIC_TESTABLE void mbedtls_mpi_mod_raw_fix_quasi_reduction(mbedtls_mpi_uint *X, @@ -137,6 +129,18 @@ void mbedtls_mpi_mod_raw_fix_quasi_reduction(mbedtls_mpi_uint *X, (void) mbedtls_mpi_core_add_if(X, N->p, N->limbs, (unsigned) c); } +#endif /* MBEDTLS_TEST_HOOKS */ + +void mbedtls_mpi_mod_raw_mul(mbedtls_mpi_uint *X, + const mbedtls_mpi_uint *A, + const mbedtls_mpi_uint *B, + const mbedtls_mpi_mod_modulus *N, + mbedtls_mpi_uint *T) +{ + mbedtls_mpi_core_montmul(X, A, B, N->limbs, N->p, N->limbs, + N->rep.mont.mm, T); +} + /* END MERGE SLOT 2 */ /* BEGIN MERGE SLOT 3 */