From 9cac8a6b38c1cbd45c77aee108411d588da006fe Mon Sep 17 00:00:00 2001 From: Thomas Holenstein Date: Wed, 12 Jun 2024 12:58:43 +0200 Subject: [PATCH] Fix pointers in CONSTTIME_DECLASSIFY. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Tested by compiling with valgrind. Before: $ cmake -GNinja -B build -D CONSTANT_TIME_VALIDATION=1 $ ninja -C build [...] /home/tholenst/boringssl/boringssl/crypto/dilithium/dilithium.c:1199:25: error: ‘pub’ undeclared (first use in this function) 1199 | CONSTTIME_DECLASSIFY(&pub.t1, sizeof(pub.t1)); After: $ ninja -C build ninja: Entering directory `build' [440/440] Linking CXX executable ssl/test/handshaker Change-Id: I26481d69e9d033b0c23b7486970991b673132d20 Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/69267 Reviewed-by: David Benjamin Commit-Queue: David Benjamin --- crypto/dilithium/dilithium.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crypto/dilithium/dilithium.c b/crypto/dilithium/dilithium.c index 584fb1640..4f209bf76 100644 --- a/crypto/dilithium/dilithium.c +++ b/crypto/dilithium/dilithium.c @@ -1196,7 +1196,7 @@ int DILITHIUM_generate_key_external_entropy( vectork_power2_round(&values->pub.t1, &priv->t0, &values->t); // t1 is public. - CONSTTIME_DECLASSIFY(&pub.t1, sizeof(pub.t1)); + CONSTTIME_DECLASSIFY(&values->pub.t1, sizeof(values->pub.t1)); CBB cbb; CBB_init_fixed(&cbb, out_encoded_public_key, DILITHIUM_PUBLIC_KEY_BYTES);