From dafaa7e90387df5c2e880750012cc57ac1726bcf Mon Sep 17 00:00:00 2001 From: Jake Massimo Date: Thu, 5 Dec 2024 09:51:55 -0800 Subject: [PATCH] dont attempt to cleanse pointers --- .../dilithium/pqcrystals_dilithium_ref_common/sign.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/crypto/dilithium/pqcrystals_dilithium_ref_common/sign.c b/crypto/dilithium/pqcrystals_dilithium_ref_common/sign.c index e9839bf520..ae678234a1 100644 --- a/crypto/dilithium/pqcrystals_dilithium_ref_common/sign.c +++ b/crypto/dilithium/pqcrystals_dilithium_ref_common/sign.c @@ -73,9 +73,6 @@ int crypto_sign_keypair_internal(ml_dsa_params *params, /* FIPS 204. Section 3.6.3 Destruction of intermediate values. */ OPENSSL_cleanse(seedbuf, sizeof(seedbuf)); OPENSSL_cleanse(tr, sizeof(tr)); - OPENSSL_cleanse(&rho, SEEDBYTES); - OPENSSL_cleanse(&rhoprime, CRHBYTES); - OPENSSL_cleanse(&key, SEEDBYTES); OPENSSL_cleanse(mat, sizeof(mat)); OPENSSL_cleanse(&s1, sizeof(s1)); OPENSSL_cleanse(&s1hat, sizeof(s1hat)); @@ -105,6 +102,7 @@ int crypto_sign_keypair(ml_dsa_params *params, uint8_t *pk, uint8_t *sk) { return -1; } crypto_sign_keypair_internal(params, pk, sk, seed); + OPENSSL_cleanse(seed, sizeof(seed)); return 0; } @@ -240,13 +238,7 @@ int crypto_sign_signature_internal(ml_dsa_params *params, *siglen = params->bytes; /* FIPS 204. Section 3.6.3 Destruction of intermediate values. */ - OPENSSL_cleanse(&n, sizeof(n)); OPENSSL_cleanse(seedbuf, sizeof(seedbuf)); - OPENSSL_cleanse(rho, SEEDBYTES); - OPENSSL_cleanse(tr, TRBYTES); - OPENSSL_cleanse(key, SEEDBYTES); - OPENSSL_cleanse(mu, CRHBYTES); - OPENSSL_cleanse(rhoprime, CRHBYTES); OPENSSL_cleanse(&nonce, sizeof(nonce)); OPENSSL_cleanse(mat, sizeof(mat)); OPENSSL_cleanse(&s1, sizeof(s1));