Remove unused code
Signed-off-by: Gabor Mezei <gabor.mezei@arm.com>
This commit is contained in:
parent
b2763ef507
commit
027d696434
1 changed files with 32 additions and 96 deletions
|
@ -769,31 +769,17 @@ void mpi_core_cond_assign( data_t * input_X,
|
|||
int cond )
|
||||
{
|
||||
#define MAX_LEN 64
|
||||
mbedtls_mpi_uint buff_X[MAX_LEN];
|
||||
mbedtls_mpi_uint buff_Y[MAX_LEN];
|
||||
mbedtls_mpi_uint *X = buff_X;
|
||||
mbedtls_mpi_uint *Y = buff_Y;
|
||||
mbedtls_mpi_uint X[MAX_LEN];
|
||||
mbedtls_mpi_uint Y[MAX_LEN];
|
||||
size_t len_X = CHARS_TO_LIMBS( input_X->len );
|
||||
size_t len_Y = CHARS_TO_LIMBS( input_Y->len );
|
||||
|
||||
TEST_ASSERT( len_X <= MAX_LEN );
|
||||
TEST_ASSERT( len_Y <= MAX_LEN );
|
||||
|
||||
if( len_X == 0 )
|
||||
{
|
||||
X = NULL;
|
||||
len_X = len_Y;
|
||||
}
|
||||
else
|
||||
TEST_ASSERT( mbedtls_mpi_core_read_be( X, len_X, input_X->x, input_X->len )
|
||||
== 0 );
|
||||
|
||||
if( len_Y == 0 )
|
||||
{
|
||||
Y = NULL;
|
||||
len_Y = len_X;
|
||||
}
|
||||
else
|
||||
TEST_ASSERT( mbedtls_mpi_core_read_be( Y, len_Y, input_Y->x, input_Y->len )
|
||||
== 0 );
|
||||
|
||||
|
@ -828,41 +814,23 @@ void mpi_core_cond_swap( data_t * input_X,
|
|||
#define MAX_LEN 64
|
||||
mbedtls_mpi_uint tmp_X[MAX_LEN];
|
||||
mbedtls_mpi_uint tmp_Y[MAX_LEN];
|
||||
mbedtls_mpi_uint buff_X[MAX_LEN];
|
||||
mbedtls_mpi_uint buff_Y[MAX_LEN];
|
||||
mbedtls_mpi_uint *X = buff_X;
|
||||
mbedtls_mpi_uint *Y = buff_Y;
|
||||
mbedtls_mpi_uint X[MAX_LEN];
|
||||
mbedtls_mpi_uint Y[MAX_LEN];
|
||||
size_t len_X = CHARS_TO_LIMBS( input_X->len );
|
||||
size_t len_Y = CHARS_TO_LIMBS( input_Y->len );
|
||||
|
||||
TEST_ASSERT( len_X <= MAX_LEN );
|
||||
TEST_ASSERT( len_Y <= MAX_LEN );
|
||||
|
||||
if( len_X == 0 )
|
||||
{
|
||||
X = NULL;
|
||||
len_X = len_Y;
|
||||
}
|
||||
else
|
||||
{
|
||||
TEST_ASSERT( mbedtls_mpi_core_read_be( tmp_X, len_X,
|
||||
input_X->x, input_X->len )
|
||||
== 0 );
|
||||
memcpy( X, tmp_X, len_X * sizeof( mbedtls_mpi_uint ) );
|
||||
}
|
||||
|
||||
if( len_Y == 0 )
|
||||
{
|
||||
Y = NULL;
|
||||
len_Y = len_X;
|
||||
}
|
||||
else
|
||||
{
|
||||
TEST_ASSERT( mbedtls_mpi_core_read_be( tmp_Y, len_Y,
|
||||
input_Y->x, input_Y->len )
|
||||
== 0 );
|
||||
memcpy( Y, tmp_Y, len_Y * sizeof( mbedtls_mpi_uint ) );
|
||||
}
|
||||
|
||||
TEST_CF_SECRET( X, len_X * sizeof( mbedtls_mpi_uint ) );
|
||||
TEST_CF_SECRET( Y, len_Y * sizeof( mbedtls_mpi_uint ) );
|
||||
|
@ -901,11 +869,9 @@ void mpi_mod_raw_cond_assign( data_t * input_X,
|
|||
int cond )
|
||||
{
|
||||
#define MAX_LEN 64
|
||||
mbedtls_mpi_uint buff_X[MAX_LEN];
|
||||
mbedtls_mpi_uint buff_Y[MAX_LEN];
|
||||
mbedtls_mpi_uint X[MAX_LEN];
|
||||
mbedtls_mpi_uint Y[MAX_LEN];
|
||||
mbedtls_mpi_uint buff_m[MAX_LEN];
|
||||
mbedtls_mpi_uint *X = buff_X;
|
||||
mbedtls_mpi_uint *Y = buff_Y;
|
||||
mbedtls_mpi_mod_modulus m;
|
||||
size_t len_X = CHARS_TO_LIMBS( input_X->len );
|
||||
size_t len_Y = CHARS_TO_LIMBS( input_Y->len );
|
||||
|
@ -922,22 +888,10 @@ void mpi_mod_raw_cond_assign( data_t * input_X,
|
|||
MBEDTLS_MPI_MOD_REP_MONTGOMERY )
|
||||
== 0 );
|
||||
|
||||
if( len_X == 0 )
|
||||
{
|
||||
X = NULL;
|
||||
len_X = len_Y;
|
||||
}
|
||||
else
|
||||
TEST_ASSERT( mbedtls_mpi_core_read_be( X, len_X,
|
||||
input_X->x, input_X->len )
|
||||
== 0 );
|
||||
|
||||
if( len_Y == 0 )
|
||||
{
|
||||
Y = NULL;
|
||||
len_Y = len_X;
|
||||
}
|
||||
else
|
||||
TEST_ASSERT( mbedtls_mpi_core_read_be( Y, len_Y,
|
||||
input_Y->x, input_Y->len )
|
||||
== 0 );
|
||||
|
@ -972,11 +926,9 @@ void mpi_mod_raw_cond_swap( data_t * input_X,
|
|||
#define MAX_LEN 64
|
||||
mbedtls_mpi_uint tmp_X[MAX_LEN];
|
||||
mbedtls_mpi_uint tmp_Y[MAX_LEN];
|
||||
mbedtls_mpi_uint buff_X[MAX_LEN];
|
||||
mbedtls_mpi_uint buff_Y[MAX_LEN];
|
||||
mbedtls_mpi_uint X[MAX_LEN];
|
||||
mbedtls_mpi_uint Y[MAX_LEN];
|
||||
mbedtls_mpi_uint buff_m[MAX_LEN];
|
||||
mbedtls_mpi_uint *X = buff_X;
|
||||
mbedtls_mpi_uint *Y = buff_Y;
|
||||
mbedtls_mpi_mod_modulus m;
|
||||
size_t len_X = CHARS_TO_LIMBS( input_X->len );
|
||||
size_t len_Y = CHARS_TO_LIMBS( input_Y->len );
|
||||
|
@ -993,29 +945,13 @@ void mpi_mod_raw_cond_swap( data_t * input_X,
|
|||
MBEDTLS_MPI_MOD_REP_MONTGOMERY )
|
||||
== 0 );
|
||||
|
||||
if( len_X == 0 )
|
||||
{
|
||||
X = NULL;
|
||||
len_X = len_Y;
|
||||
}
|
||||
else
|
||||
{
|
||||
TEST_ASSERT( mbedtls_mpi_core_read_be( tmp_X, len_X, input_X->x, input_X->len )
|
||||
== 0 );
|
||||
memcpy( X, tmp_X, len_X * sizeof( mbedtls_mpi_uint ) );
|
||||
}
|
||||
|
||||
if( len_Y == 0 )
|
||||
{
|
||||
Y = NULL;
|
||||
len_Y = len_X;
|
||||
}
|
||||
else
|
||||
{
|
||||
TEST_ASSERT( mbedtls_mpi_core_read_be( tmp_Y, len_Y, input_Y->x, input_Y->len )
|
||||
== 0 );
|
||||
memcpy( Y, tmp_Y, len_Y * sizeof( mbedtls_mpi_uint ) );
|
||||
}
|
||||
|
||||
TEST_CF_SECRET( X, len_X * sizeof( mbedtls_mpi_uint ) );
|
||||
TEST_CF_SECRET( Y, len_Y * sizeof( mbedtls_mpi_uint ) );
|
||||
|
|
Loading…
Reference in a new issue