From 59cbd1be27f7aef2bad1f6b16333a67df7461e16 Mon Sep 17 00:00:00 2001 From: Janos Follath Date: Fri, 28 Oct 2022 18:13:43 +0100 Subject: [PATCH] Make mbedtls_mpi_core_ct_uint_table_lookup static Now that we have a function that calls mbedtls_mpi_core_ct_uint_table_lookup(), the compiler won't complain if we make it static. Signed-off-by: Janos Follath --- library/bignum_core.c | 1 + library/bignum_core.h | 2 ++ tests/suites/test_suite_bignum_core.function | 2 +- 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/library/bignum_core.c b/library/bignum_core.c index 3b660d0056..2337ae5214 100644 --- a/library/bignum_core.c +++ b/library/bignum_core.c @@ -540,6 +540,7 @@ cleanup: return( ret ); } +MBEDTLS_STATIC_TESTABLE void mbedtls_mpi_core_ct_uint_table_lookup( mbedtls_mpi_uint *dest, const mbedtls_mpi_uint *table, size_t limbs, diff --git a/library/bignum_core.h b/library/bignum_core.h index 82da142163..ede8161256 100644 --- a/library/bignum_core.h +++ b/library/bignum_core.h @@ -452,6 +452,7 @@ void mbedtls_mpi_core_montmul( mbedtls_mpi_uint *X, int mbedtls_mpi_core_get_mont_r2_unsafe( mbedtls_mpi *X, const mbedtls_mpi *N ); +#if defined(MBEDTLS_TEST_HOOKS) /** * Copy an MPI from a table without leaking the index. * @@ -469,6 +470,7 @@ void mbedtls_mpi_core_ct_uint_table_lookup( mbedtls_mpi_uint *dest, size_t limbs, size_t count, size_t index ); +#endif /* MBEDTLS_TEST_HOOKS */ /** * \brief Fill an integer with a number of random bytes. diff --git a/tests/suites/test_suite_bignum_core.function b/tests/suites/test_suite_bignum_core.function index 612a7c6bd4..46689468ba 100644 --- a/tests/suites/test_suite_bignum_core.function +++ b/tests/suites/test_suite_bignum_core.function @@ -935,7 +935,7 @@ exit: } /* END_CASE */ -/* BEGIN_CASE */ +/* BEGIN_CASE depends_on:MBEDTLS_TEST_HOOKS */ void mpi_core_ct_uint_table_lookup( int bitlen, int window_size ) { size_t limbs = BITS_TO_LIMBS( bitlen );