Hinder unwanted optimisations

We want this function to be constant time. Make it less likely that the
compiler optimises it.

Signed-off-by: Janos Follath <janos.follath@arm.com>
This commit is contained in:
Janos Follath 2024-03-08 16:29:54 +00:00
parent bd0a683e78
commit 30f49f19cc

View File

@ -859,7 +859,7 @@ mbedtls_mpi_uint mbedtls_mpi_core_sub_int(mbedtls_mpi_uint *X,
mbedtls_ct_condition_t mbedtls_mpi_core_check_zero_ct(const mbedtls_mpi_uint *A,
size_t limbs)
{
mbedtls_mpi_uint bits = 0;
volatile mbedtls_mpi_uint bits = 0;
for (size_t i = 0; i < limbs; i++) {
bits |= A[i];