mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-04-03 10:20:36 +00:00
Remove unused parameter
Signed-off-by: Gabor Mezei <gabor.mezei@arm.com>
This commit is contained in:
parent
53e455db7b
commit
cfc0eb8d22
@ -178,15 +178,14 @@ void mbedtls_mpi_core_cond_assign( mbedtls_mpi_uint *X,
|
|||||||
}
|
}
|
||||||
|
|
||||||
void mbedtls_mpi_core_cond_swap( mbedtls_mpi_uint *X,
|
void mbedtls_mpi_core_cond_swap( mbedtls_mpi_uint *X,
|
||||||
size_t X_limbs,
|
|
||||||
mbedtls_mpi_uint *Y,
|
mbedtls_mpi_uint *Y,
|
||||||
size_t Y_limbs,
|
size_t limbs,
|
||||||
unsigned char swap )
|
unsigned char swap )
|
||||||
{
|
{
|
||||||
/* all-bits 1 if swap is 1, all-bits 0 if swap is 0 */
|
/* 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 );
|
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];
|
mbedtls_mpi_uint tmp = X[i];
|
||||||
X[i] = ( X[i] & ~limb_mask ) | ( Y[i] & limb_mask );
|
X[i] = ( X[i] & ~limb_mask ) | ( Y[i] & limb_mask );
|
||||||
|
@ -123,9 +123,8 @@ void mbedtls_mpi_core_cond_assign( mbedtls_mpi_uint *X,
|
|||||||
* values different to either of the original ones.
|
* values different to either of the original ones.
|
||||||
*/
|
*/
|
||||||
void mbedtls_mpi_core_cond_swap( mbedtls_mpi_uint *X,
|
void mbedtls_mpi_core_cond_swap( mbedtls_mpi_uint *X,
|
||||||
size_t X_limbs,
|
|
||||||
mbedtls_mpi_uint *Y,
|
mbedtls_mpi_uint *Y,
|
||||||
size_t Y_limbs,
|
size_t limbs,
|
||||||
unsigned char swap );
|
unsigned char swap );
|
||||||
|
|
||||||
/** Import X from unsigned binary data, little-endian.
|
/** Import X from unsigned binary data, little-endian.
|
||||||
|
@ -55,8 +55,7 @@ void mbedtls_mpi_mod_raw_cond_swap( mbedtls_mpi_uint *X,
|
|||||||
const mbedtls_mpi_mod_modulus *m,
|
const mbedtls_mpi_mod_modulus *m,
|
||||||
unsigned char swap )
|
unsigned char swap )
|
||||||
{
|
{
|
||||||
mbedtls_mpi_core_cond_swap( X, m->limbs,
|
mbedtls_mpi_core_cond_swap( X, Y, m->limbs, swap );
|
||||||
Y, m->limbs, swap );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int mbedtls_mpi_mod_raw_read( mbedtls_mpi_uint *X,
|
int mbedtls_mpi_mod_raw_read( mbedtls_mpi_uint *X,
|
||||||
|
@ -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 );
|
X->s = mbedtls_ct_cond_select_sign( swap, Y->s, X->s );
|
||||||
Y->s = mbedtls_ct_cond_select_sign( swap, s, Y->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:
|
cleanup:
|
||||||
return( ret );
|
return( ret );
|
||||||
|
@ -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( X, len_X * sizeof( mbedtls_mpi_uint ) );
|
||||||
TEST_CF_SECRET( Y, len_Y * 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( X, len_X * sizeof( mbedtls_mpi_uint ) );
|
||||||
TEST_CF_PUBLIC( Y, len_Y * sizeof( mbedtls_mpi_uint ) );
|
TEST_CF_PUBLIC( Y, len_Y * sizeof( mbedtls_mpi_uint ) );
|
||||||
|
Loading…
x
Reference in New Issue
Block a user