From 243b812146a757e03667c5f6124bfe852149b995 Mon Sep 17 00:00:00 2001 From: Jonas Schneider-Bensch Date: Tue, 1 Oct 2024 11:40:14 +0200 Subject: [PATCH] Add reference to regular/pre-hash domain separation in FIPS 204 --- libcrux-ml-dsa/src/ml_dsa_generic.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/libcrux-ml-dsa/src/ml_dsa_generic.rs b/libcrux-ml-dsa/src/ml_dsa_generic.rs index 727a8062..2924dd79 100644 --- a/libcrux-ml-dsa/src/ml_dsa_generic.rs +++ b/libcrux-ml-dsa/src/ml_dsa_generic.rs @@ -638,6 +638,12 @@ pub(crate) fn verify_pre_hashed< /// string within the buffer. /// If a pre_hash option is provided the domain separated context /// string is extended by the pre-hash OID. +/// +/// Refer to line 10 of Algorithm 2 (and line 5 of Algorithm 3, resp.) in [FIPS +/// 204](https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.204.pdf#section.5) +/// for details on the domain separation for regular ML-DSA. Line +/// 23 of Algorithm 4 (and line 18 of Algorithm 5,resp.) describe domain separation for the HashMl-DSA +/// variant. fn domain_separate_context( context: &[u8], pre_hash_oid: Option<&PreHashOID>,