Remove unused parameter

Signed-off-by: Gabor Mezei <gabor.mezei@arm.com>
This commit is contained in:
Gabor Mezei 2022-09-15 20:15:34 +02:00
parent 53e455db7b
commit cfc0eb8d22
No known key found for this signature in database
GPG Key ID: F072ACA227ACD71D
5 changed files with 6 additions and 9 deletions

View File

@ -178,15 +178,14 @@ void mbedtls_mpi_core_cond_assign( mbedtls_mpi_uint *X,
}
void mbedtls_mpi_core_cond_swap( mbedtls_mpi_uint *X,
size_t X_limbs,
mbedtls_mpi_uint *Y,
size_t Y_limbs,
size_t limbs,
unsigned char swap )
{
/* all-bits 1 if swap is 1, all-bits 0 if swap is 0 */
mbedtls_mpi_uint limb_mask = mbedtls_ct_mpi_uint_mask( swap );
for( size_t i = 0; i < X_limbs; i++ )
for( size_t i = 0; i < limbs; i++ )
{
mbedtls_mpi_uint tmp = X[i];
X[i] = ( X[i] & ~limb_mask ) | ( Y[i] & limb_mask );

View File

@ -123,9 +123,8 @@ void mbedtls_mpi_core_cond_assign( mbedtls_mpi_uint *X,
* values different to either of the original ones.
*/
void mbedtls_mpi_core_cond_swap( mbedtls_mpi_uint *X,
size_t X_limbs,
mbedtls_mpi_uint *Y,
size_t Y_limbs,
size_t limbs,
unsigned char swap );
/** Import X from unsigned binary data, little-endian.

View File

@ -55,8 +55,7 @@ void mbedtls_mpi_mod_raw_cond_swap( mbedtls_mpi_uint *X,
const mbedtls_mpi_mod_modulus *m,
unsigned char swap )
{
mbedtls_mpi_core_cond_swap( X, m->limbs,
Y, m->limbs, swap );
mbedtls_mpi_core_cond_swap( X, Y, m->limbs, swap );
}
int mbedtls_mpi_mod_raw_read( mbedtls_mpi_uint *X,

View File

@ -716,7 +716,7 @@ int mbedtls_mpi_safe_cond_swap( mbedtls_mpi *X,
X->s = mbedtls_ct_cond_select_sign( swap, Y->s, X->s );
Y->s = mbedtls_ct_cond_select_sign( swap, s, Y->s );
mbedtls_mpi_core_cond_swap( X->p, X->n, Y->p, Y->n, swap );
mbedtls_mpi_core_cond_swap( X->p, Y->p, X->n, swap );
cleanup:
return( ret );

View File

@ -866,7 +866,7 @@ void mpi_core_cond_swap( data_t * input_X,
TEST_CF_SECRET( X, len_X * sizeof( mbedtls_mpi_uint ) );
TEST_CF_SECRET( Y, len_Y * sizeof( mbedtls_mpi_uint ) );
mbedtls_mpi_core_cond_swap( X, len_X, Y, len_Y, cond );
mbedtls_mpi_core_cond_swap( X, Y, len_X, cond );
TEST_CF_PUBLIC( X, len_X * sizeof( mbedtls_mpi_uint ) );
TEST_CF_PUBLIC( Y, len_Y * sizeof( mbedtls_mpi_uint ) );