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>
diff --git a/library/bignum_core.c b/library/bignum_core.c
index 8374f3a..db6e231 100644
--- a/library/bignum_core.c
+++ b/library/bignum_core.c
@@ -856,10 +856,10 @@
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)
{
- volatile mbedtls_mpi_uint bits = 0;
+ mbedtls_mpi_uint bits = 0;
for (size_t i = 0; i < limbs; i++) {
bits |= A[i];