Use count instead of bytes in ASSERT_ALLOC argument
@@ -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 )
