Fix pointers in CONSTTIME_DECLASSIFY.
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 <davidben@google.com>
Commit-Queue: David Benjamin <davidben@google.com>
diff --git a/crypto/dilithium/dilithium.c b/crypto/dilithium/dilithium.c
index 584fb16..4f209bf 100644
--- a/crypto/dilithium/dilithium.c
+++ b/crypto/dilithium/dilithium.c
@@ -1196,7 +1196,7 @@
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);