Handle if parameters are alised
Signed-off-by: Gabor Mezei <gabor.mezei@arm.com>
This commit is contained in:
parent
d71eb0c3ac
commit
e9c013c222
1 changed files with 6 additions and 0 deletions
|
@ -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 );
|
||||
|
||||
|
|
Loading…
Reference in a new issue