mbedtls_mpi_core_cond_assign() function
Perform a safe conditional copy of an MPI which doesn't reveal whether assignment was done or not.
Arguments
X
The address of the destination MPI. This must be initialized. Must have enough limbs to store the full value of \p A.
A
The address of the source MPI. This must be initialized.
limbs
The number of limbs of \p A.
assign
The condition deciding whether to perform the assignment or not. Callers will need to use the constant time interface (e.g. `mbedtls_ct_bool()`) to construct this argument.
Notes
This function avoids leaking any information about whether the assignment was done or not.
![]()
mbedtls_mpi_core_cond_assign(X->p, Y->p, Y->n, do_assign);
mbedtls_mpi_core_cond_assign() is called by 2 functions and calls 1 function:
![]()
mbedtls_mpi_core_cond_assign()
mbedtls_mpi_core_cond_assign():
![]()
mbedtls_mpi_core_cond_assign()