From 412d5cb0c088df83af112b78360342215bcb415f Mon Sep 17 00:00:00 2001 From: Frank Denis Date: Thu, 10 Apr 2014 23:36:28 -0700 Subject: [PATCH] Stored values that are never read are very likely to get optimized out. --- src/libsodium/crypto_hash/sha256/cp/hash_sha256.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/libsodium/crypto_hash/sha256/cp/hash_sha256.c b/src/libsodium/crypto_hash/sha256/cp/hash_sha256.c index 9446f8dc..2c4ab4cf 100644 --- a/src/libsodium/crypto_hash/sha256/cp/hash_sha256.c +++ b/src/libsodium/crypto_hash/sha256/cp/hash_sha256.c @@ -189,7 +189,8 @@ SHA256_Transform(uint32_t *state, const unsigned char block[64]) sodium_memzero((void *) W, 256); sodium_memzero((void *) S, 32); - t0 = t1 = 0; + sodium_memzero((void *) &t0, sizeof t0); + sodium_memzero((void *) &t1, sizeof t1); } static unsigned char PAD[64] = {