diff --git a/src/libsodium/crypto_core/ed25519/core_ed25519.c b/src/libsodium/crypto_core/ed25519/core_ed25519.c index 3169ff35..15c004b9 100644 --- a/src/libsodium/crypto_core/ed25519/core_ed25519.c +++ b/src/libsodium/crypto_core/ed25519/core_ed25519.c @@ -137,9 +137,11 @@ void crypto_core_ed25519_scalar_add(unsigned char *z, const unsigned char *x, const unsigned char *y) { - unsigned char x_[crypto_core_ed25519_NONREDUCEDSCALARBYTES] = { 0U }; - unsigned char y_[crypto_core_ed25519_NONREDUCEDSCALARBYTES] = { 0U }; + unsigned char x_[crypto_core_ed25519_NONREDUCEDSCALARBYTES]; + unsigned char y_[crypto_core_ed25519_NONREDUCEDSCALARBYTES]; + memset(x_, 0, sizeof x_); + memset(y_, 0, sizeof y_); memcpy(x_, x, crypto_core_ed25519_SCALARBYTES); memcpy(y_, y, crypto_core_ed25519_SCALARBYTES); sodium_add(x_, y_, crypto_core_ed25519_SCALARBYTES);