is_zero(): volatilize the accumulator

This commit is contained in:
Frank Denis 2017-07-16 01:07:38 +02:00
parent 3d400363b6
commit 1f826df2d4

View File

@ -184,8 +184,8 @@ sodium_compare(const unsigned char *b1_, const unsigned char *b2_, size_t len)
int int
sodium_is_zero(const unsigned char *n, const size_t nlen) sodium_is_zero(const unsigned char *n, const size_t nlen)
{ {
size_t i; size_t i;
unsigned char d = 0U; volatile unsigned char d = 0U;
for (i = 0U; i < nlen; i++) { for (i = 0U; i < nlen; i++) {
d |= n[i]; d |= n[i];