From f80b12a24ff2552668a520bbc24d6d6e5fd594f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Meusel?= Date: Thu, 15 Aug 2024 18:00:49 +0200 Subject: [PATCH] WIP --- .../dilithium/dilithium_common/dilithium_polynomial.h | 7 ++----- .../dilithium/dilithium_modern/ml_dsa_ipd/ml_dsa_ipd.h | 3 ++- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/lib/pubkey/dilithium/dilithium_common/dilithium_polynomial.h b/src/lib/pubkey/dilithium/dilithium_common/dilithium_polynomial.h index 398e7ca34ad..e20c9bcaff7 100644 --- a/src/lib/pubkey/dilithium/dilithium_common/dilithium_polynomial.h +++ b/src/lib/pubkey/dilithium/dilithium_common/dilithium_polynomial.h @@ -23,9 +23,6 @@ class DilithiumPolyTraits final : public CRYSTALS::Trait_Base; - /** - * NIST FIPS 204 IPD, Algorithm 37 (Montgomery_Reduce) - */ static constexpr T montgomery_reduce_coefficient(T2 a) { const T2 t = static_cast(static_cast(static_cast(a)) * Q_inverse); return (a - static_cast(t) * Q) >> (sizeof(T) * 8); @@ -40,7 +37,7 @@ class DilithiumPolyTraits final : public CRYSTALS::Trait_Base truncate_commitment_hash( StrongSpan seed) const override { - // TODO: ML-DSA does not truncate the commitment hash + // TODO: ML-DSA does not truncate the commitment hash, so we could + // simply "return seed" here; return StrongSpan( seed.get().first(DilithiumConstants::COMMITMENT_HASH_C1_BYTES)); };