vendor/libsodium/src/libsodium/crypto_scalarmult/curve25519/scalarmult_curve25519.c in rbnacl-libsodium-1.0.13 vs vendor/libsodium/src/libsodium/crypto_scalarmult/curve25519/scalarmult_curve25519.c in rbnacl-libsodium-1.0.15
- old
+ new
@@ -18,14 +18,14 @@
int
crypto_scalarmult_curve25519(unsigned char *q, const unsigned char *n,
const unsigned char *p)
{
- size_t i;
- unsigned char d = 0;
+ size_t i;
+ volatile unsigned char d = 0;
if (implementation->mult(q, n, p) != 0) {
- return -1;
+ return -1; /* LCOV_EXCL_LINE */
}
for (i = 0; i < crypto_scalarmult_curve25519_BYTES; i++) {
d |= q[i];
}
return -(1 & ((d - 1) >> 8));