summaryrefslogtreecommitdiff
path: root/libs/libsodium/src/crypto_hash
diff options
context:
space:
mode:
Diffstat (limited to 'libs/libsodium/src/crypto_hash')
-rw-r--r--libs/libsodium/src/crypto_hash/sha256/cp/hash_sha256_cp.c2
-rw-r--r--libs/libsodium/src/crypto_hash/sha512/cp/hash_sha512_cp.c2
2 files changed, 4 insertions, 0 deletions
diff --git a/libs/libsodium/src/crypto_hash/sha256/cp/hash_sha256_cp.c b/libs/libsodium/src/crypto_hash/sha256/cp/hash_sha256_cp.c
index 3b1acda992..ee1d4ceb27 100644
--- a/libs/libsodium/src/crypto_hash/sha256/cp/hash_sha256_cp.c
+++ b/libs/libsodium/src/crypto_hash/sha256/cp/hash_sha256_cp.c
@@ -156,6 +156,7 @@ SHA256_Pad(crypto_hash_sha256_state *state, uint32_t tmp32[64 + 8])
unsigned int r;
unsigned int i;
+ ACQUIRE_FENCE;
r = (unsigned int) ((state->count >> 3) & 0x3f);
if (r < 56) {
for (i = 0; i < 56 - r; i++) {
@@ -197,6 +198,7 @@ crypto_hash_sha256_update(crypto_hash_sha256_state *state,
if (inlen <= 0U) {
return 0;
}
+ ACQUIRE_FENCE;
r = (unsigned long long) ((state->count >> 3) & 0x3f);
state->count += ((uint64_t) inlen) << 3;
diff --git a/libs/libsodium/src/crypto_hash/sha512/cp/hash_sha512_cp.c b/libs/libsodium/src/crypto_hash/sha512/cp/hash_sha512_cp.c
index 4f342afdb6..8207a440ba 100644
--- a/libs/libsodium/src/crypto_hash/sha512/cp/hash_sha512_cp.c
+++ b/libs/libsodium/src/crypto_hash/sha512/cp/hash_sha512_cp.c
@@ -175,6 +175,7 @@ SHA512_Pad(crypto_hash_sha512_state *state, uint64_t tmp64[80 + 8])
unsigned int r;
unsigned int i;
+ ACQUIRE_FENCE;
r = (unsigned int) ((state->count[1] >> 3) & 0x7f);
if (r < 112) {
for (i = 0; i < 112 - r; i++) {
@@ -218,6 +219,7 @@ crypto_hash_sha512_update(crypto_hash_sha512_state *state,
if (inlen <= 0U) {
return 0;
}
+ ACQUIRE_FENCE;
r = (unsigned long long) ((state->count[1] >> 3) & 0x7f);
bitlen[1] = ((uint64_t) inlen) << 3;