Use count instead of bytes in ASSERT_ALLOC argument

Signed-off-by: Gabor Mezei <gabor.mezei@arm.com>
This commit is contained in:
Gabor Mezei 2022-10-14 16:18:10 +02:00
parent 44ba2f6db9
commit 8bcd7cca94
No known key found for this signature in database
GPG key ID: F072ACA227ACD71D

View file

@ -780,8 +780,8 @@ void mpi_core_cond_assign( data_t * input_X,
TEST_EQUAL( limbs_X, limbs_Y );
TEST_ASSERT( copy_limbs <= limbs );
ASSERT_ALLOC( X, len );
ASSERT_ALLOC( Y, len );
ASSERT_ALLOC( X, limbs );
ASSERT_ALLOC( Y, limbs );
TEST_ASSERT( mbedtls_mpi_core_read_be( X, limbs, input_X->x, input_X->len )
== 0 );
@ -844,19 +844,19 @@ void mpi_core_cond_swap( data_t * input_X,
TEST_EQUAL( limbs_X, limbs_Y );
TEST_ASSERT( copy_limbs <= limbs );
ASSERT_ALLOC( tmp_X, len );
ASSERT_ALLOC( tmp_Y, len );
ASSERT_ALLOC( tmp_X, limbs );
ASSERT_ALLOC( tmp_Y, limbs );
TEST_ASSERT( mbedtls_mpi_core_read_be( tmp_X, limbs,
input_X->x, input_X->len )
== 0 );
ASSERT_ALLOC( X, len );
ASSERT_ALLOC( X, limbs );
memcpy( X, tmp_X, len );
TEST_ASSERT( mbedtls_mpi_core_read_be( tmp_Y, limbs,
input_Y->x, input_Y->len )
== 0 );
ASSERT_ALLOC( Y, len );
ASSERT_ALLOC( Y, limbs );
memcpy( Y, tmp_Y, len );
/* condition is false */
@ -924,10 +924,10 @@ void mpi_mod_raw_cond_assign( data_t * input_X,
TEST_EQUAL( limbs_X, limbs_Y );
TEST_ASSERT( copy_limbs <= limbs );
ASSERT_ALLOC( X, len );
ASSERT_ALLOC( Y, len );
ASSERT_ALLOC( X, limbs );
ASSERT_ALLOC( Y, limbs );
ASSERT_ALLOC( buff_m, len );
ASSERT_ALLOC( buff_m, limbs );
mbedtls_mpi_mod_modulus_init( &m );
TEST_ASSERT( mbedtls_mpi_mod_modulus_setup(
&m, buff_m, copy_limbs,
@ -1003,10 +1003,10 @@ void mpi_mod_raw_cond_swap( data_t * input_X,
TEST_EQUAL( limbs_X, limbs_Y );
TEST_ASSERT( copy_limbs <= limbs );
ASSERT_ALLOC( tmp_X, len );
ASSERT_ALLOC( tmp_Y, len );
ASSERT_ALLOC( tmp_X, limbs );
ASSERT_ALLOC( tmp_Y, limbs );
ASSERT_ALLOC( buff_m, input_len );
ASSERT_ALLOC( buff_m, copy_limbs );
mbedtls_mpi_mod_modulus_init( &m );
TEST_ASSERT( mbedtls_mpi_mod_modulus_setup(
&m, buff_m, copy_limbs,
@ -1016,7 +1016,7 @@ void mpi_mod_raw_cond_swap( data_t * input_X,
TEST_ASSERT( mbedtls_mpi_core_read_be( tmp_X, limbs, input_X->x, input_X->len )
== 0 );
ASSERT_ALLOC( X, len );
ASSERT_ALLOC( X, limbs );
memcpy( X, tmp_X, len );
TEST_ASSERT( mbedtls_mpi_core_read_be( tmp_Y, limbs, input_Y->x, input_Y->len )