diff --git a/tests/suites/test_suite_bignum_core.function b/tests/suites/test_suite_bignum_core.function index 021b7b31c..612a7c6bd 100644 --- a/tests/suites/test_suite_bignum_core.function +++ b/tests/suites/test_suite_bignum_core.function @@ -371,6 +371,9 @@ void mpi_core_cond_assign( char * input_X, mbedtls_mpi_core_cond_assign( X, Y, copy_limbs, 0 ); + TEST_CF_PUBLIC( X, bytes ); + TEST_CF_PUBLIC( Y, bytes ); + TEST_ASSERT( memcmp( X, Y, bytes ) != 0 ); /* condition is true */ @@ -379,10 +382,16 @@ void mpi_core_cond_assign( char * input_X, mbedtls_mpi_core_cond_assign( X, Y, copy_limbs, 1 ); + TEST_CF_PUBLIC( X, bytes ); + TEST_CF_PUBLIC( Y, bytes ); + /* Check if the given length is copied even it is smaller than the length of the given MPIs. */ if( copy_limbs < limbs ) { + TEST_CF_PUBLIC( X, bytes ); + TEST_CF_PUBLIC( Y, bytes ); + ASSERT_COMPARE( X, copy_bytes, Y, copy_bytes ); TEST_ASSERT( memcmp( X, Y, bytes ) != 0 ); } @@ -430,6 +439,9 @@ void mpi_core_cond_swap( char * input_X, mbedtls_mpi_core_cond_swap( X, Y, copy_limbs, 0 ); + TEST_CF_PUBLIC( X, bytes ); + TEST_CF_PUBLIC( Y, bytes ); + ASSERT_COMPARE( X, bytes, tmp_X, bytes ); ASSERT_COMPARE( Y, bytes, tmp_Y, bytes ); @@ -439,6 +451,9 @@ void mpi_core_cond_swap( char * input_X, mbedtls_mpi_core_cond_swap( X, Y, copy_limbs, 1 ); + TEST_CF_PUBLIC( X, bytes ); + TEST_CF_PUBLIC( Y, bytes ); + /* Check if the given length is copied even it is smaller than the length of the given MPIs. */ if( copy_limbs < limbs ) diff --git a/tests/suites/test_suite_bignum_mod_raw.function b/tests/suites/test_suite_bignum_mod_raw.function index 556cca07f..4b906751f 100644 --- a/tests/suites/test_suite_bignum_mod_raw.function +++ b/tests/suites/test_suite_bignum_mod_raw.function @@ -147,6 +147,9 @@ void mpi_mod_raw_cond_assign( char * input_X, mbedtls_mpi_mod_raw_cond_assign( X, Y, &m, 0 ); + TEST_CF_PUBLIC( X, bytes ); + TEST_CF_PUBLIC( Y, bytes ); + TEST_ASSERT( memcmp( X, Y, bytes ) != 0 ); /* condition is true */ @@ -155,6 +158,9 @@ void mpi_mod_raw_cond_assign( char * input_X, mbedtls_mpi_mod_raw_cond_assign( X, Y, &m, 1 ); + TEST_CF_PUBLIC( X, bytes ); + TEST_CF_PUBLIC( Y, bytes ); + /* Check if the given length is copied even it is smaller than the length of the given MPIs. */ if( copy_limbs