commit | 98e1fe07966141045d8e5e1160eab068421f8e1d | [log] [tgz] |
---|---|---|
author | Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com> | Wed Nov 27 11:57:49 2019 +0100 |
committer | Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com> | Wed Nov 27 12:52:54 2019 +0100 |
tree | cd062848e3495e42b0b329c22ced8e0bc8231290 | |
parent | 9d6a535ba113ebf839f551c1bdaff7d3df50df68 [diff] [blame] |
Add flow control in uECC_vli_equal loop
diff --git a/tinycrypt/ecc.c b/tinycrypt/ecc.c index 261db77..d75c4d7 100644 --- a/tinycrypt/ecc.c +++ b/tinycrypt/ecc.c
@@ -278,11 +278,16 @@ { uECC_word_t diff = 0; - wordcount_t i; + volatile int i; for (i = NUM_ECC_WORDS - 1; i >= 0; --i) { diff |= (left[i] ^ right[i]); } + + /* i should be -1 now */ + mbedtls_platform_enforce_volatile_reads(); + diff |= i ^ -1; + return diff; }