Re: [lamps] [UNVERIFIED SENDER] RE: How do we plan to solve the hash-then-sign paradigm in Dilithium, Falcon and Sphincs+?

"Kampanakis, Panos" <kpanos@amazon.com> Mon, 12 December 2022 21:14 UTC

Return-Path: <prvs=3388c6030=kpanos@amazon.com>
X-Original-To: spasm@ietfa.amsl.com
Delivered-To: spasm@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 20947C14CE28 for <spasm@ietfa.amsl.com>; Mon, 12 Dec 2022 13:14:12 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -14.495
X-Spam-Level:
X-Spam-Status: No, score=-14.495 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, HTML_MESSAGE=0.001, HTTPS_HTTP_MISMATCH=0.1, RCVD_IN_DNSWL_HI=-5, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_ZEN_BLOCKED_OPENDNS=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_DBL_BLOCKED_OPENDNS=0.001, URIBL_ZEN_BLOCKED_OPENDNS=0.001, USER_IN_DEF_SPF_WL=-7.5] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=amazon.com
Received: from mail.ietf.org ([50.223.129.194]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id XzQspf_kYSFg for <spasm@ietfa.amsl.com>; Mon, 12 Dec 2022 13:14:08 -0800 (PST)
Received: from smtp-fw-2101.amazon.com (smtp-fw-2101.amazon.com [72.21.196.25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 42E8BC14CE23 for <spasm@ietf.org>; Mon, 12 Dec 2022 13:12:38 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1670879559; x=1702415559; h=from:to:date:message-id:references:in-reply-to: mime-version:subject; bh=MIxj6GhyzbWaCdRTYufNH8PMWexkCw+FWnS8hqctxU8=; b=XymRTgSyonATdrhsRAzHk4FypX5VtJHh31/irmafn7dyXeTRkzYeOHUY IKidQW2m9Lq2+wWayh3952G5JkVhaNtZ1PZlduMyYWlJQjl467teOI7HC I8j+uCcO7NLA57VO8NeS5SKMgw3BokFv5JIKDeFL8swWLpR2zfMYrVUtK 4=;
X-IronPort-AV: E=Sophos;i="5.96,239,1665446400"; d="scan'208,217";a="272687865"
Thread-Topic: [UNVERIFIED SENDER] RE: [lamps] How do we plan to solve the hash-then-sign paradigm in Dilithium, Falcon and Sphincs+?
Received: from iad12-co-svc-p1-lb1-vlan3.amazon.com (HELO email-inbound-relay-iad-1a-m6i4x-54a853e6.us-east-1.amazon.com) ([10.43.8.6]) by smtp-border-fw-2101.iad2.amazon.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Dec 2022 21:12:36 +0000
Received: from EX13MTAUWB001.ant.amazon.com (iad12-ws-svc-p26-lb9-vlan3.iad.amazon.com [10.40.163.38]) by email-inbound-relay-iad-1a-m6i4x-54a853e6.us-east-1.amazon.com (Postfix) with ESMTPS id 88A56428B7; Mon, 12 Dec 2022 21:12:35 +0000 (UTC)
Received: from EX19D001ANA002.ant.amazon.com (10.37.240.136) by EX13MTAUWB001.ant.amazon.com (10.43.161.249) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Mon, 12 Dec 2022 21:12:34 +0000
Received: from EX19D001ANA001.ant.amazon.com (10.37.240.156) by EX19D001ANA002.ant.amazon.com (10.37.240.136) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA) id 15.2.1118.20; Mon, 12 Dec 2022 21:12:33 +0000
Received: from EX19D001ANA001.ant.amazon.com ([fe80::4f78:75cd:3117:8055]) by EX19D001ANA001.ant.amazon.com ([fe80::4f78:75cd:3117:8055%5]) with mapi id 15.02.1118.020; Mon, 12 Dec 2022 21:12:33 +0000
From: "Kampanakis, Panos" <kpanos@amazon.com>
To: John Gray <John.Gray=40entrust.com@dmarc.ietf.org>, "spasm@ietf.org" <spasm@ietf.org>
Thread-Index: AQHZDmhqBd80SEP6Z0eTipRzItqNp65qtNgA
Date: Mon, 12 Dec 2022 21:12:33 +0000
Message-ID: <4d0aed52857a4e009db0f10b978522fd@amazon.com>
References: <DM6PR11MB2585810643D7CC4DB76F55A1EAE29@DM6PR11MB2585.namprd11.prod.outlook.com> <373950f4f7d44c03ac6bece0e8a53ba1@amazon.com> <DM6PR11MB2585CF94E666240C8B62B031EAE29@DM6PR11MB2585.namprd11.prod.outlook.com>
In-Reply-To: <DM6PR11MB2585CF94E666240C8B62B031EAE29@DM6PR11MB2585.namprd11.prod.outlook.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-originating-ip: [10.37.240.200]
Content-Type: multipart/alternative; boundary="_000_4d0aed52857a4e009db0f10b978522fdamazoncom_"
MIME-Version: 1.0
Archived-At: <https://mailarchive.ietf.org/arch/msg/spasm/D5JQS5Nzy2ehjAxeqwhvgcOn9M0>
Subject: Re: [lamps] [UNVERIFIED SENDER] RE: How do we plan to solve the hash-then-sign paradigm in Dilithium, Falcon and Sphincs+?
X-BeenThere: spasm@ietf.org
X-Mailman-Version: 2.1.39
Precedence: list
List-Id: "This is a venue for discussion of doing Some Pkix And SMime \(spasm\) work." <spasm.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/spasm>, <mailto:spasm-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/spasm/>
List-Post: <mailto:spasm@ietf.org>
List-Help: <mailto:spasm-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/spasm>, <mailto:spasm-request@ietf.org?subject=subscribe>
X-List-Received-Date: Mon, 12 Dec 2022 21:14:12 -0000

> The easiest solution seems to define a prehash version of the PQ algorithms, but if that is not preferred, we are open to other solutions.

I am saying this is not necessary imo because it will not get used like PrehashEdDSA did not. TLS, IKE, SSH, X.509, CMS all use PureEdDSA. Also I am not sure OCSP or CRLs have an issue here because the message to be signed/verified is available as a whole to both the signer and the verifier.

PKCS#11 includes an incremental API. The CKM_ECDSA_SHA256 mechanism is used with the incremental API which allows the signer/verifier to take the message piece by piece. So PKCS##11 could define a mechanism like CKM_FALCON_SHA3-512 which prehashes the message and it could have CKM_PUREFALCON mechanism which does not. Or it could do the same thing with one mechanism CKM_FALCON which based on the input parameter can prehash or not. This is what PKCS#11 has today for EdDSA. It is the CKM_EDDSA mechanism which takes optional CK_EDDSA_PARAMS. So, LAMPS does not need to specify anything in this case. PKCS#11 can take care of it like they did with EdDSA.


From: John Gray <John.Gray=40entrust.com@dmarc.ietf.org>
Sent: Monday, December 12, 2022 3:29 PM
To: Kampanakis, Panos <kpanos@amazon.com>; spasm@ietf.org
Subject: [EXTERNAL] [UNVERIFIED SENDER] RE: [lamps] How do we plan to solve the hash-then-sign paradigm in Dilithium, Falcon and Sphincs+?


CAUTION: This email originated from outside of the organization. Do not click links or open attachments unless you can confirm the sender and know the content is safe.


Thanks for the reply Panos,

I am a bit confused by your reply.  On one hand you say we need to use pre-hashing for use-cases like the PKCS#11 big message (and also the use-cases I mention in my previous email).  EdDSA had a similar issue and defined a HashEdDSA to handle that case.  You suggest we should follow that case, which sound great, and I agree.   However, then you say lamps should only specify and use the pure versions of signatures.  Are you suggesting hash versions of the PQ algorithms be defined somewhere else, or do you mean we just digest when needed for the handful of use-cases that need it and not worry about defining hash versions of the algorithms?   PKCS#11 as an API could require pre-hashing, but what if PKCS#11 is not being used?

Perhaps an information best practices document for these types of use-cases needs to be written?  We don't want to cause interop issues.  For example, if a CRL is signed using a digest of the CRL verses the full message using a PQ signature, you have two different signature outputs.  How would an end-entity verifier know which method was used?  Try one and if it fails, try the other?  That doesn't seem good.   Another approach would be to update 5280 to say CRL signing should be over a digest of the data to be signed.  Then at least there would be no ambiguity.  I am not saying that should be done either, I would just like there to be no ambiguity for the verifier.

The easiest solution seems to define a prehash version of the PQ algorithms, but if that is not preferred, we are open to other solutions.


Cheers,

John Gray
Entrust

From: Kampanakis, Panos <kpanos=40amazon.com@dmarc.ietf.org<mailto:kpanos=40amazon.com@dmarc.ietf.org>>
Sent: Monday, December 12, 2022 3:01 PM
To: John Gray <John.Gray@entrust.com<mailto:John.Gray@entrust.com>>; spasm@ietf.org<mailto:spasm@ietf.org>
Subject: [EXTERNAL] RE: [lamps] How do we plan to solve the hash-then-sign paradigm in Dilithium, Falcon and Sphincs+?

WARNING: This email originated outside of Entrust.
DO NOT CLICK links or attachments unless you trust the sender and know the content is safe.
________________________________
Hi John,

As discussed before, this existed with EdDSA which ended up standardizing Pure and Prehash versions. In the end, only Prehash ended up getting used almost everywhere. So, I would suggest to follow the same logic as with PureEdDSA https://www.rfc-editor.org/rfc/rfc8410<https://urldefense.com/v3/__https:/www.rfc-editor.org/rfc/rfc8410__;!!FJ-Y8qCqXTj2!ZOQNbCxQcFausvZgqh55FDqgCowunlVQ0LFH2ud86mrhI8aNOdinzUxjQG9ihRE13qfLnu0_G8mocpHh6qiqHmSv72u2pnGE$>


   [...] EdDSA has

   defined two modes: the PureEdDSA mode without prehashing and the

   HashEdDSA mode with prehashing.  The convention used for identifying

   the algorithm/curve combinations is to use "Ed25519" and "Ed448" for

   the PureEdDSA mode.  This document does not provide the conventions

   needed for the prehash versions of the signature algorithm.

The only case where it breaks (that I am aware of) is in PKCS#11 with big messages (incremental API) with Falcon and SPHINCS+ (not Dilithium). In these cases the PKCS#11 spec will need to digest before signing which is something they already specified for EdDSA (and the incremental API).

So, I don't think LAMPS should specify any Prehash versions.  Imo, LAMPS should specify and use only the Pure versions of the PQ signatures in X.509, CRLs, CMS etc.






From: Spasm <spasm-bounces@ietf.org<mailto:spasm-bounces@ietf.org>> On Behalf Of John Gray
Sent: Monday, December 12, 2022 12:23 PM
To: spasm@ietf.org<mailto:spasm@ietf.org>
Subject: [EXTERNAL] [lamps] How do we plan to solve the hash-then-sign paradigm in Dilithium, Falcon and Sphincs+?


CAUTION: This email originated from outside of the organization. Do not click links or open attachments unless you can confirm the sender and know the content is safe.



We are working on making transition plans from existing signatures to the PQ candidates, and are wondering how lamps / X509 plans to address the pre-hashing of data before signatures (also known as hash-then-sign).   The Dilithium, Falcon and Sphincs+ drafts do not have a signature mode where the toBeSigned message is first hashed, and then signed.   Many PKI systems today actually rely on being able to hash (aka 1-way compress) a message that will be sent over a network to an HSM device for signing.    Some use cases:



Signing CRL (especially large combined CRL's):

The CA's that sign CRL's today would typically send a hash (32-bytes for SHA-256 for example) to an HSM for signing.    The network bandwidth required is therefore reduced from x Megabytes to 32-bytes.   With Dilithium, Sphincs+ or Falcon the entire message will have to be sent (unless a pre-hash mode of Signature operation is added to Dilithium, Sphincs+ or Falcon).



OCSP signing:

OCSP response are small, but instead of signing thousands to millions of 32-byte hashes,  it might be 1000 or more bytes each, which again magnifies the network requirement by many times.   With larger signatures due to PQ algorithms, this will be magnified even more.



CSR Signing:

A local USB token device or HSM would need to sign the full CSR.



Other use-cases?



We know many protocols like CMS include pre-hashing in the protocol, so that resolves the issue because the digest is taken as part of the protocol.  However, for all the cases which are not part of a protocol this will be another hurdle to hinder the transition to Post Quantum for many existing applications in production today.



Is there anyone working to solve this issue?   The simplest solution would seem to be to have signatures defined for Dilithium, Falcon and Sphincs+ (and any future PQ selections) which pre-hash.   I know there has already been discussions on this mailing list in this regard.   I know there was much discussion on why it shouldn't be done because it reduces the security to the collision resistance of the chosen hash function, or for other reasons, but that doesn't provide a solution.   If we accept the reduction of the message to the size of a hash for protocols like CMS, and non-protocol use-cases today (RSA and EC), why is it not acceptable to pre-hash for these use-cases with Dilithium, Falcon and Sphincs+?    There must be a practical solution otherwise it will likely delay adoption of these new algorithms in many environments which could be an even greater security risk.

Suggestions?


John Gray
Entrust

Any email and files/attachments transmitted with it are confidential and are intended solely for the use of the individual or entity to whom they are addressed. If this message has been sent to you in error, you must not copy, distribute or disclose of the information it contains. Please notify Entrust immediately and delete the message from your system.