Let the allocated memory visible for the memory sanitizer
Signed-off-by: Gabor Mezei <gabor.mezei@arm.com>
diff --git a/tests/suites/test_suite_bignum_core.function b/tests/suites/test_suite_bignum_core.function
index 021b7b3..612a7c6 100644
--- a/tests/suites/test_suite_bignum_core.function
+++ b/tests/suites/test_suite_bignum_core.function
@@ -371,6 +371,9 @@
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 @@
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 @@
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 @@
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 556cca0..4b90675 100644
--- a/tests/suites/test_suite_bignum_mod_raw.function
+++ b/tests/suites/test_suite_bignum_mod_raw.function
@@ -147,6 +147,9 @@
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 @@
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 <limbs )
@@ -220,6 +226,9 @@
mbedtls_mpi_mod_raw_cond_swap( X, Y, &m, 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 );
@@ -229,6 +238,9 @@
mbedtls_mpi_mod_raw_cond_swap( 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 < limbs )