diff --git a/crypto/dilithium/pqcrystals_dilithium_ref_common/poly.c b/crypto/dilithium/pqcrystals_dilithium_ref_common/poly.c index 9b7260959d..6ee27699f2 100644 --- a/crypto/dilithium/pqcrystals_dilithium_ref_common/poly.c +++ b/crypto/dilithium/pqcrystals_dilithium_ref_common/poly.c @@ -315,10 +315,6 @@ void poly_uniform(poly *a, ctr += rej_uniform(a->coeffs + ctr, N - ctr, buf, buflen); } /* FIPS 204. Section 3.6.3 Destruction of intermediate values. */ - OPENSSL_cleanse(&i, sizeof(i)); - OPENSSL_cleanse(&ctr, sizeof(ctr)); - OPENSSL_cleanse(&off, sizeof(off)); - OPENSSL_cleanse(&buflen, sizeof(buflen)); OPENSSL_cleanse(buf, sizeof(buf)); OPENSSL_cleanse(&state, sizeof(state)); } @@ -410,8 +406,6 @@ void poly_uniform_eta(ml_dsa_params *params, ctr += rej_eta(params, a->coeffs + ctr, N - ctr, buf, STREAM256_BLOCKBYTES); } /* FIPS 204. Section 3.6.3 Destruction of intermediate values. */ - OPENSSL_cleanse(&ctr, sizeof(ctr)); - OPENSSL_cleanse(&buflen, sizeof(buflen)); OPENSSL_cleanse(buf, sizeof(buf)); OPENSSL_cleanse(&state, sizeof(state)); } @@ -491,10 +485,6 @@ void poly_challenge(ml_dsa_params *params, poly *c, const uint8_t *seed) { signs >>= 1; } /* FIPS 204. Section 3.6.3 Destruction of intermediate values. */ - OPENSSL_cleanse(&i, sizeof(i)); - OPENSSL_cleanse(&b, sizeof(pos)); - OPENSSL_cleanse(&pos, sizeof(pos)); - OPENSSL_cleanse(&signs, sizeof(signs)); OPENSSL_cleanse(buf, sizeof(buf)); OPENSSL_cleanse(&state, sizeof(state)); } diff --git a/crypto/dilithium/pqcrystals_dilithium_ref_common/sign.c b/crypto/dilithium/pqcrystals_dilithium_ref_common/sign.c index ba848c0801..a8fbe8ed09 100644 --- a/crypto/dilithium/pqcrystals_dilithium_ref_common/sign.c +++ b/crypto/dilithium/pqcrystals_dilithium_ref_common/sign.c @@ -241,7 +241,6 @@ 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, sizeof(rho)); OPENSSL_cleanse(&tr, sizeof(tr)); @@ -346,8 +345,6 @@ int crypto_sign(ml_dsa_params *params, } ret = crypto_sign_signature(params, sm, smlen, sm + params->bytes, mlen, ctx, ctxlen, sk); *smlen += mlen; - /* FIPS 204. Section 3.6.3 Destruction of intermediate values. */ - OPENSSL_cleanse(&i, sizeof(i)); return ret; } @@ -447,7 +444,6 @@ int crypto_sign_verify_internal(ml_dsa_params *params, } } /* FIPS 204. Section 3.6.3 Destruction of intermediate values. */ - OPENSSL_cleanse(&i, sizeof(i)); OPENSSL_cleanse(buf, sizeof(buf)); OPENSSL_cleanse(rho, sizeof(rho)); OPENSSL_cleanse(mu, sizeof(mu));