From 753cfb4e235bbb03b04dea91670b9d30d8cafa89 Mon Sep 17 00:00:00 2001 From: Patrick Longa Date: Fri, 10 Jun 2022 17:52:21 -0700 Subject: [PATCH] Update Valgrind's constant-time test --- src/sidh.c | 2 +- src/sike.c | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/sidh.c b/src/sidh.c index f6a4137..acd5d68 100644 --- a/src/sidh.c +++ b/src/sidh.c @@ -322,7 +322,7 @@ int EphemeralSecretAgreement_B_extended(const unsigned char* PrivateKeyB, const // Alice's PublicKeyA consists of 3 elements in GF(p^2) encoded by removing leading 0 bytes. // Output: a shared secret SharedSecretB that consists of one element in GF(p^2) encoded by removing leading 0 bytes. point_proj_t R, pts[MAX_INT_POINTS_BOB]; - f2elm_t coeff[3], PKB[3] = {0}, jinv; + f2elm_t coeff[3], PKB[3], jinv; f2elm_t A24plus = {0}, A24minus = {0}, A = {0}; unsigned int i, row, m, index = 0, pts_index[MAX_INT_POINTS_BOB], npts = 0, ii = 0; digit_t SecretKeyB[NWORDS_ORDER] = {0}; diff --git a/src/sike.c b/src/sike.c index 89eb4e8..6dfe074 100644 --- a/src/sike.c +++ b/src/sike.c @@ -93,6 +93,7 @@ int crypto_kem_dec(unsigned char *ss, const unsigned char *ct, const unsigned ch int8_t selector = -1; #ifdef DO_VALGRIND_CHECK VALGRIND_MAKE_MEM_UNDEFINED(sk, MSG_BYTES + SECRETKEY_B_BYTES); + VALGRIND_MAKE_MEM_DEFINED(ct, CRYPTO_CIPHERTEXTBYTES); #endif // Decrypt