Hello all,
Section 7.1 of Draft FIPS 204 and Section 9.4 of Draft FIPS 205 note that the message that is input to the signing function may be the hash of the content that is to be protected rather than the content itself. During the public comment period, NIST received comments noting that this could lead to an existential forgery, as an attacker could trick a verifier into believing that the hash of the content was the content itself. Comments received on the issue suggested a few ways to address this:
After some initial discussions, NIST is currently leaning towards specifying separate "pure" and "pre-hash" versions of the signature algorithms by adding in a mandatory domain separator, as was done in EdDSA, but placing the domain separator immediately before the message. So, if sign_sk(M) is slh_sign(M, sk) for SLH-DSA or ML-DSA.Sign(sk, M) for ML-DSA, then domain separation would be created by always signing M as sign_sk(domain separator || PH(M)), where PH() is either a hash function or the identity function.
One option for how this might work would be (using the syntax of
RFC 8032):
where C is a context string with a length between 0 and 255 octets.
As this construction simply changes the input M to the signing function, it could be applied to any signature scheme (FN-DSA, ML-DSA. SLH-DSA, selected on-ramp signature scheme) where it is determined that it may be useful to define both "pure" and "pre-hash" versions.
Any comments or suggestions that people may have on this proposed approach would be appreciated.
Thank you,
Hello David,
Question for you:
If a given signature scheme is determined to only support one of
the two modes (not sure if “pre-hash” would be allowed on its
own…), then is it expected that the interface would still expect
the corresponding formatting w/domain separation to ensure a
consistent interface for all signature schemes?
You mention using this format when defining both versions, but it
wasn’t clear to me if it is also used when there is only a single
version too. I suspect that is the case to ensure consistency but
just wanted to get a clear understanding. Please let me know.
Thanks!
Take care.
Jim
--
You received this message because you are subscribed to the Google Groups "pqc-forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pqc-forum+...@list.nist.gov.
To view this discussion on the web visit https://groups.google.com/a/list.nist.gov/d/msgid/pqc-forum/e8aad006-afbf-4c5b-9d49-75613f15387c%40nist.gov.
Actually, it’s better stated that the consistency wouldn’t be mandated.
If an implementation wanted to, it could implement this prepend on any of the listed signature schemes, and it would still be NIST approved (of course, interoperability is another issue…)
If we were to implement a composite scheme with pre-hash, such as RSA + Dilithium, we would quite plausibly implement this prepend for both signatures (and we might implement it externally to the RSA signer, while the Dilithium implementation might implement it internally)
To view this discussion on the web visit https://groups.google.com/a/list.nist.gov/d/msgid/pqc-forum/e3b878de-8ac0-4192-826e-0c6068ebda7a%40nist.gov.
--
Hi Bas,
see my comments inline.
[...]
However, this goes against the reason SLH-DSA hashes twice to begin with. It's to prevent SLH-DSA to require a hash that is resistant against collision style attacks. Signing H(M) instead of M negates that.
Of course, that is the stated intention behind the pre-hash variant. It becomes necessary where the protocol only supports hash-and-sign or where streaming the potentially huge message to the signature-generating device is not conceivable.
Note, by the way, that this all doesn't apply to ML-DSA: ML-DSA only hashes M once and thus allows streaming, because ML-DSA requires collision resistance from the hash for Fiat–Shamir to begin with.
Suppose we go forward with this, and we see deployment of SLH-DSA-Pure and SLH-DSA-Prehash. How do we explain to users what to choose? What happens if we find a collision attack on the hash? Do we expect users to know if they use pure or prehash SLH-DSA? If the proposal is actually CONFUSED-SLH-DSA (or similar), then all SLH-DSA verifiers have to upgrade to remove the prehash one. It's going to be very messy, a lot of work, and in the end we didn't gain anything substantial.
So, what are our other options?
We can change SLH-DSA to allow streaming messages. I'd say that is an unpalatable weakening of its security, as SLH-DSA is typically chosen by those that want to trade performance for conservative security. (Recall that ML-DSA does allow streaming!)
We can leave the stream signing issue to a higher layer. In many protocols, it's very common to sign a hash as the actual message. For problematic use cases, one could define SPHINS (note missing C) as SLH-DSA where H(M) is signed, accepting the reliance on collision resistance (hence the missing C). I actually think it should be possible to do better: retain collision resistance and have streaming signing. Any such scheme would need some time for review, so it's too late to include in SLH-DSA itself.
I don't see how is the proposal of a new scheme "SPHINS" is introducing less complexity than parametrizing SLH-DSA.
Surely, it is in principle possible to leave the disambiguation of the two variants to the protocol layer. But that requires protocol changes in protocols that don't already include meta information (namely the signature algorithm) in the message digest computation. This is the case for instance for CMS/X.509.
I lean to the latter.
If you mean by that modifying protocols so that they support the "full" SLH-DSA variant, I am with you. But that has to be done on a per protocol basis. What NIST is trying here with the parametrization is to provide a toolset to allow the disambiguation of the two variants without any protocol changes.
- Falko
To view this discussion on the web visit https://groups.google.com/a/list.nist.gov/d/msgid/pqc-forum/CAMjbhoVdcvPKx2izXvHTKZRKPCuCW1K3jrn4T8%3DfvjVX2GvGBw%40mail.gmail.com.
MTG AG
Dr. Falko Strenzke
Executive System Architect
Phone: +49
6151 8000 24
E-Mail: falko.s...@mtg.de
Web: mtg.de


MTG AG - Dolivostr. 11 - 64293 Darmstadt, Germany
Commercial register: HRB 8901
Register Court: Amtsgericht Darmstadt
Management Board: Jürgen Ruf (CEO), Tamer Kemeröz
Chairman of the Supervisory Board: Dr. Thomas Milde
This email may contain confidential and/or privileged
information.
If you are not the correct recipient or have received this
email in error,
please inform the sender immediately and delete this
email.Unauthorised copying or distribution of this email
is not permitted.
Data protection information: Privacy
policy
+1 on Bas’ arguments. The uses of a prehash PQ Sig will be very limited like with prehashEdDSA. In the end implementers will need to support both and never use the prehashPQSig.
Hi Falko,
> for CMS/X.509.
CMS and X.509 do not need prehash signatures or changes.
- RFC8410 did not use prehashEdDSA,
draft-ietf-lamps-dilithium-certificates does not need prehashDilithium either.
- For CMS, RFC 8419 defines a digest of the message by saying
[...] In most situations, the CMS SignedData includes signed attributes, including the message digest of the content. Since HashEdDSA offers no benefit when signed attributes are present, only PureEdDSA is used with the CMS.
Other than the HSM streaming PCKS#11 case, please state specific use-cases or protocols that will benefit from a prehash PQ Sig.
THALES GROUP LIMITED DISTRIBUTION to email recipients
One example of where pre-hash is common is use-case like qualified signature and seal creation in the EU linked to eIDAS. As mentioned below, an end-user or independent system outside the system hosting the signing key may locally hash the data to sign and then submit to a remote HSM for signature.
Security of the hash between creation and signature creation would be provided by other protocols and mechanisms.
I agree however that this kind of use case is in the minority of signatures produced but it does exist and is needed for practical reasons.
--
You received this message because you are subscribed to the Google Groups "pqc-forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
pqc-forum+...@list.nist.gov.
To view this discussion on the web visit https://groups.google.com/a/list.nist.gov/d/msgid/pqc-forum/2ddb4744d03c4e6d836cf5dd79c7de9b%40amazon.com.
The proposed construction and the discussion so far have focused primarily on the objective of separating “pure hash” and “pre-hash” signatures. While the construction appears sufficient for that purpose, there are a few additional aspects that may also be worth considering. These points build on Verisign’s comments [1] on the draft FIPS 205.
1. Randomized hashing / target collision resistance
The security of pre-hashing in the proposed construction relies on conventional collision resistance: an adversary who finds two messages M_1, M_2 such that H(M_1) = H(M_2), and gets the signer to sign one of them, also obtains a valid (forged) signature on the other. SLH-DSA, in contrast, includes a randomizer as an input to its message hashing operations. As a result, SLH-DSA’s security is based instead on a target collision resistance-like property. (Bas Westerbaan made a similar observation earlier in this thread.)
Conventional collision resistance has been a standard assumption of hash functions and signature schemes for a long time, including RSA and ECDSA in particular. SLH-DSA has arguably “raised the bar.” Indeed, by moving to a target-collision-resistance-like property, SLH-DSA has reduced the impact of future advances in collision attacks on the underlying hash function, as unlikely as such advances may be. For this reason, it would be useful to specify a pre-hashing mode that follows the same trend.
Note that including a randomizer in the context string C doesn’t itself achieve randomized pre-hashing. C is an input to the underlying signature scheme, but not necessarily the pre-hashing operation. Rather, the pre-hashing operation must be defined specifically to include a randomizer as an input, whether it is conveyed as part of C or elsewhere.
2. Multi-user security
Both ML-DSA and SLH-DSA include the signer’s public key (or its hash) as an input to their message hashing operations. Along similar lines to the first remark, it would be useful to specify a pre-hashing mode that includes the signer’s public key (or its hash) as an input as well. Doing so would again raise the bar, in this case to multi-user security, as an adversary would likely have to take into account the actual public keys of interest in an attack. In the current construction, a collision would potentially be usable against any public key, including future ones.
Including the public key or similar information in the context string C again won’t automatically achieve the security objective. The pre-hashing operation must be defined so that this additional information is a specific input.
3. Cryptographic separation from the underlying signature scheme
Finally, the security analysis of a pre-hashing construction may depend on how the hash function is used during pre-hashing relative to its use in the underlying signature scheme. SLH-DSA, while being based on a single hash function, takes great care to ensure that its various uses of that hash function involve distinct inputs. Prepending the input to the hash function with an identifier and a context string during pre-hashing, as is done in the proposed construction, ensures that the inputs for the pure and pre-hashing modes are distinct, but it wouldn't directly ensure separation from other uses of the hash function within SLH-DSA.
It would be useful to have a more formal analysis of the security properties of the pre-hashing construction, particularly if it is updated to include additional inputs such as suggested in the previous two remarks.
Best Regards,
Joe Harvey
[1] J. Harvey et al. Comments on FIPS 205 (Draft): Stateless Hash-Based
Signature Standard. Nov. 21, 2023.
From: 'COSTA Graham' via pqc-forum <pqc-...@list.nist.gov>
Reply-To: COSTA Graham <graham...@thalesgroup.com>
Date: Wednesday, January 17, 2024 at 10:11 AM
To: "Kampanakis, Panos" <kpa...@amazon.com>, Falko Strenzke <falko.s...@mtg.de>, Bas Westerbaan <b...@cloudflare.com>, "David A. Cooper" <david....@nist.gov>
Cc: pqc-forum <pqc-...@list.nist.gov>
Subject: [EXTERNAL] RE: [pqc-forum] Pure vs. pre-hash signing for ML-DSA and SLH-DSA
|
Caution: This email originated from outside the organization. Do not click links or open attachments unless you recognize the sender and know the content is safe. |
To view this discussion on the web visit
https://groups.google.com/a/list.nist.gov/d/msgid/pqc-forum/PR0P264MB37557858E2ECB39BE43F5ADA99722%40PR0P264MB3755.FRAP264.PROD.OUTLOOK.COM.
To view this discussion on the web visit https://groups.google.com/a/list.nist.gov/d/msgid/pqc-forum/C91D8CE1-E3B7-4134-8229-1FC8AEB43573%40verisign.com.
Hi David,
Thanks for the careful review and detailed responses to the comments I provided. After reviewing with the research team at Verisign, we would like to offer a few additional observations.
Our interest in having an optional specification for randomized pre-hashing comes from the perspective of overall resilience. If the collision resistance property of the hash function holds up over the long term, then it shouldn’t matter whether a randomizer is included in the pre-hashing step (assuming the hash output is full size, e.g., 256 bits). But if the collision resistance property doesn’t hold up for some reason, then the inclusion of the randomizer may well make the difference between an attack succeeding or failing. Applications could choose to include a randomizer in their own way as a precaution (e.g., as certification authorities have done by adding entropy to serial numbers), but it would be better if there were a more “standardized” way to do so.
Thanks,
Joe