mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-02-22 00:40:41 +00:00
Fix use of volatile
We need the pointer, A, to be volatile, to ensure the reads happen. bits does not need to be volatile. Signed-off-by: Janos Follath <janos.follath@arm.com>
This commit is contained in:
parent
b888bc0be6
commit
d6df0a5dac
@ -856,10 +856,10 @@ mbedtls_mpi_uint mbedtls_mpi_core_sub_int(mbedtls_mpi_uint *X,
|
|||||||
return c;
|
return c;
|
||||||
}
|
}
|
||||||
|
|
||||||
mbedtls_ct_condition_t mbedtls_mpi_core_check_zero_ct(const mbedtls_mpi_uint *A,
|
mbedtls_ct_condition_t mbedtls_mpi_core_check_zero_ct(volatile const mbedtls_mpi_uint *A,
|
||||||
size_t limbs)
|
size_t limbs)
|
||||||
{
|
{
|
||||||
volatile mbedtls_mpi_uint bits = 0;
|
mbedtls_mpi_uint bits = 0;
|
||||||
|
|
||||||
for (size_t i = 0; i < limbs; i++) {
|
for (size_t i = 0; i < limbs; i++) {
|
||||||
bits |= A[i];
|
bits |= A[i];
|
||||||
|
@ -665,7 +665,7 @@ mbedtls_mpi_uint mbedtls_mpi_core_sub_int(mbedtls_mpi_uint *X,
|
|||||||
* \return MBEDTLS_CT_FALSE if `A == 0`
|
* \return MBEDTLS_CT_FALSE if `A == 0`
|
||||||
* MBEDTLS_CT_TRUE if `A != 0`.
|
* MBEDTLS_CT_TRUE if `A != 0`.
|
||||||
*/
|
*/
|
||||||
mbedtls_ct_condition_t mbedtls_mpi_core_check_zero_ct(const mbedtls_mpi_uint *A,
|
mbedtls_ct_condition_t mbedtls_mpi_core_check_zero_ct(volatile const mbedtls_mpi_uint *A,
|
||||||
size_t limbs);
|
size_t limbs);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user