summaryrefslogtreecommitdiff
path: root/libs/libsodium/src/crypto_secretstream
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2024-06-21 14:29:17 +0300
committerGeorge Hazan <george.hazan@gmail.com>2024-06-21 14:29:17 +0300
commit46ea86584a9787c8b9dc3983cf23d9b5b93b5841 (patch)
treefbaf3793ae2170f7982f08a62c028a23cd9afedd /libs/libsodium/src/crypto_secretstream
parent82e75be329dd0f30c0281ef9c3c08488b89d109f (diff)
fixes #4477 (libsodium: update to 1.0.20)
Diffstat (limited to 'libs/libsodium/src/crypto_secretstream')
-rw-r--r--libs/libsodium/src/crypto_secretstream/xchacha20poly1305/secretstream_xchacha20poly1305.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libs/libsodium/src/crypto_secretstream/xchacha20poly1305/secretstream_xchacha20poly1305.c b/libs/libsodium/src/crypto_secretstream/xchacha20poly1305/secretstream_xchacha20poly1305.c
index 9c321ceced..e731689293 100644
--- a/libs/libsodium/src/crypto_secretstream/xchacha20poly1305/secretstream_xchacha20poly1305.c
+++ b/libs/libsodium/src/crypto_secretstream/xchacha20poly1305/secretstream_xchacha20poly1305.c
@@ -148,6 +148,7 @@ crypto_secretstream_xchacha20poly1305_push
crypto_onetimeauth_poly1305_update(&poly1305_state, c, mlen);
crypto_onetimeauth_poly1305_update
(&poly1305_state, _pad0, (0x10 - (sizeof block) + mlen) & 0xf);
+ /* should have been (0x10 - (sizeof block + mlen)) & 0xf to keep input blocks aligned */
STORE64_LE(slen, (uint64_t) adlen);
crypto_onetimeauth_poly1305_update(&poly1305_state, slen, sizeof slen);
@@ -224,6 +225,7 @@ crypto_secretstream_xchacha20poly1305_pull
crypto_onetimeauth_poly1305_update(&poly1305_state, c, mlen);
crypto_onetimeauth_poly1305_update
(&poly1305_state, _pad0, (0x10 - (sizeof block) + mlen) & 0xf);
+ /* should have been (0x10 - (sizeof block + mlen)) & 0xf to keep input blocks aligned */
STORE64_LE(slen, (uint64_t) adlen);
crypto_onetimeauth_poly1305_update(&poly1305_state, slen, sizeof slen);