mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-02-23 12:39:54 +00:00
Use mbedtls_ct_condition_t in mpi_core_check_zero
Signed-off-by: Janos Follath <janos.follath@arm.com>
This commit is contained in:
parent
424c2655b9
commit
aec1a868fe
@ -856,8 +856,8 @@ mbedtls_mpi_uint mbedtls_mpi_core_sub_int(mbedtls_mpi_uint *X,
|
|||||||
return c;
|
return c;
|
||||||
}
|
}
|
||||||
|
|
||||||
mbedtls_mpi_uint mbedtls_mpi_core_check_zero_ct(const mbedtls_mpi_uint *A,
|
mbedtls_ct_condition_t mbedtls_mpi_core_check_zero_ct(const mbedtls_mpi_uint *A,
|
||||||
size_t limbs)
|
size_t limbs)
|
||||||
{
|
{
|
||||||
mbedtls_mpi_uint bits = 0;
|
mbedtls_mpi_uint bits = 0;
|
||||||
|
|
||||||
@ -865,7 +865,7 @@ mbedtls_mpi_uint mbedtls_mpi_core_check_zero_ct(const mbedtls_mpi_uint *A,
|
|||||||
bits |= A[i];
|
bits |= A[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
return bits;
|
return mbedtls_ct_bool(bits);
|
||||||
}
|
}
|
||||||
|
|
||||||
void mbedtls_mpi_core_to_mont_rep(mbedtls_mpi_uint *X,
|
void mbedtls_mpi_core_to_mont_rep(mbedtls_mpi_uint *X,
|
||||||
|
@ -662,11 +662,11 @@ mbedtls_mpi_uint mbedtls_mpi_core_sub_int(mbedtls_mpi_uint *X,
|
|||||||
* \param[in] A The MPI to test.
|
* \param[in] A The MPI to test.
|
||||||
* \param limbs Number of limbs in \p A.
|
* \param limbs Number of limbs in \p A.
|
||||||
*
|
*
|
||||||
* \return 0 if `A == 0`
|
* \return MBEDTLS_CT_FALSE if `A == 0`
|
||||||
* non-0 (may be any value) if `A != 0`.
|
* MBEDTLS_CT_TRUE if `A != 0`.
|
||||||
*/
|
*/
|
||||||
mbedtls_mpi_uint mbedtls_mpi_core_check_zero_ct(const mbedtls_mpi_uint *A,
|
mbedtls_ct_condition_t mbedtls_mpi_core_check_zero_ct(const mbedtls_mpi_uint *A,
|
||||||
size_t limbs);
|
size_t limbs);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Returns the number of limbs of working memory required for
|
* \brief Returns the number of limbs of working memory required for
|
||||||
|
Loading…
x
Reference in New Issue
Block a user