From 6bc8dac222d266b6e714024a76d61b74ae92c34c Mon Sep 17 00:00:00 2001 From: Andrew Hopkins Date: Fri, 26 Apr 2024 11:36:50 -0700 Subject: [PATCH] Update x25519_test.cc array initialization to avoid a GCC 13 warning bug https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114826 --- crypto/curve25519/x25519_test.cc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/crypto/curve25519/x25519_test.cc b/crypto/curve25519/x25519_test.cc index 495741d027..99753ef87d 100644 --- a/crypto/curve25519/x25519_test.cc +++ b/crypto/curve25519/x25519_test.cc @@ -157,7 +157,9 @@ TEST(X25519Test, SmallOrder) { TEST(X25519Test, Iterated) { // Taken from https://tools.ietf.org/html/rfc7748#section-5.2. - uint8_t scalar[32] = {9}, point[32] = {9}, out[32]; + uint8_t scalar[32] = {}, point[32] = {}, out[32]; + scalar[0] = 9; + point[0] = 9; for (unsigned i = 0; i < 1000; i++) { EXPECT_TRUE(ctwrapX25519(out, scalar, point)); @@ -176,7 +178,9 @@ TEST(X25519Test, Iterated) { TEST(X25519Test, DISABLED_IteratedLarge) { // Taken from https://tools.ietf.org/html/rfc7748#section-5.2. - uint8_t scalar[32] = {9}, point[32] = {9}, out[32]; + uint8_t scalar[32] = {}, point[32] = {}, out[32]; + scalar[0] = 9; + point[0] = 9; for (unsigned i = 0; i < 1000000; i++) { EXPECT_TRUE(ctwrapX25519(out, scalar, point));