diff --git a/src/libsodium/crypto_box/curve25519xchacha20poly1305/box_curve25519xchacha20poly1305.c b/src/libsodium/crypto_box/curve25519xchacha20poly1305/box_curve25519xchacha20poly1305.c index aab38c04..1ccf8076 100644 --- a/src/libsodium/crypto_box/curve25519xchacha20poly1305/box_curve25519xchacha20poly1305.c +++ b/src/libsodium/crypto_box/curve25519xchacha20poly1305/box_curve25519xchacha20poly1305.c @@ -36,19 +36,18 @@ crypto_box_curve25519xchacha20poly1305_keypair(unsigned char *pk, return crypto_scalarmult_curve25519_base(pk, sk); } -static const unsigned char n[16] = { 0 }; - int crypto_box_curve25519xchacha20poly1305_beforenm(unsigned char * k, const unsigned char *pk, const unsigned char *sk) { + static const unsigned char zero[16] = { 0 }; unsigned char s[32]; if (crypto_scalarmult_curve25519(s, sk, pk) != 0) { return -1; } - return crypto_core_hchacha20(k, n, s, NULL); + return crypto_core_hchacha20(k, zero, s, NULL); } int diff --git a/src/libsodium/crypto_box/curve25519xsalsa20poly1305/box_curve25519xsalsa20poly1305.c b/src/libsodium/crypto_box/curve25519xsalsa20poly1305/box_curve25519xsalsa20poly1305.c index b506c6bf..eac9dce0 100644 --- a/src/libsodium/crypto_box/curve25519xsalsa20poly1305/box_curve25519xsalsa20poly1305.c +++ b/src/libsodium/crypto_box/curve25519xsalsa20poly1305/box_curve25519xsalsa20poly1305.c @@ -31,19 +31,18 @@ crypto_box_curve25519xsalsa20poly1305_keypair(unsigned char *pk, return crypto_scalarmult_curve25519_base(pk, sk); } -static const unsigned char n[16] = { 0 }; - int crypto_box_curve25519xsalsa20poly1305_beforenm(unsigned char * k, const unsigned char *pk, const unsigned char *sk) { + static const unsigned char zero[16] = { 0 }; unsigned char s[32]; if (crypto_scalarmult_curve25519(s, sk, pk) != 0) { return -1; } - return crypto_core_hsalsa20(k, n, s, NULL); + return crypto_core_hsalsa20(k, zero, s, NULL); } int