Handle if parameters are alised

Signed-off-by: Gabor Mezei <gabor.mezei@arm.com>
This commit is contained in:
Gabor Mezei 2022-10-10 14:26:57 +02:00
parent d71eb0c3ac
commit e9c013c222
No known key found for this signature in database
GPG key ID: F072ACA227ACD71D

View file

@ -167,6 +167,9 @@ void mbedtls_mpi_core_cond_assign( mbedtls_mpi_uint *X,
size_t limbs,
unsigned char assign )
{
if( X == A )
return;
mbedtls_ct_mpi_uint_cond_assign( limbs, X, A, assign );
}
@ -175,6 +178,9 @@ void mbedtls_mpi_core_cond_swap( mbedtls_mpi_uint *X,
size_t limbs,
unsigned char swap )
{
if( X == Y )
return;
/* 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 );