Re: [lamps] [EXTERNAL] Re: [CFRG] [pqc-forum] RE: Whether to hash-then-sign with Dilithium and Falcon?

John Gray <John.Gray@entrust.com> Thu, 18 August 2022 15:03 UTC

Return-Path: <John.Gray@entrust.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 D3EC1C1522B6; Thu, 18 Aug 2022 08:03:53 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.005
X-Spam-Level:
X-Spam-Status: No, score=-2.005 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, 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_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01, URIBL_BLOCKED=0.001, URIBL_DBL_BLOCKED_OPENDNS=0.001, URIBL_ZEN_BLOCKED_OPENDNS=0.001] autolearn=unavailable autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=entrust.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 83ErqzVEZJeX; Thu, 18 Aug 2022 08:03:49 -0700 (PDT)
Received: from mx08-0015a003.pphosted.com (mx08-0015a003.pphosted.com [185.183.30.227]) (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 5F48DC152717; Thu, 18 Aug 2022 08:03:49 -0700 (PDT)
Received: from pps.filterd (m0242863.ppops.net [127.0.0.1]) by mx08-0015a003.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 27I3sPZS007294; Thu, 18 Aug 2022 10:03:37 -0500
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=entrust.com; h=from : to : cc : subject : date : message-id : references : in-reply-to : content-type : mime-version; s=mail1; bh=pvKrKeZLhtPgfHUhOlMUSCD5JrLHnfO0ZlDrhQC3RzE=; b=Cq9CVdsXNTiKLqoGU5vOoEsPEk4VDTqXcMag7xogq5zqTkuzgNzEHS0fxClQNMM3F/qn 3AdRgwvLVWLUS/KBj74EGW/quavKU+FLhX47Fz6JJIAYWcTFwibyLgBF/slcu/nHk2qY SvbugZa8imzC4zuIoj23rzZLmoRVLE8ujVYTHhgmFerReQAcMWn6WsUvTkYy3024yCWT 7+/q0TGYzUJrZZfqQrY/mPaQaUDZyxURMKjQmssIMstNmD1huhwfoVTV8GllTO7Us11h N1j8kW/JP1M+egWO9ItS1FW7FiiJUAvxrQ4afStSttAM4htaBPtXnCpvKWXWd66Ky7/n 6Q==
Received: from nam12-dm6-obe.outbound.protection.outlook.com (mail-dm6nam12lp2169.outbound.protection.outlook.com [104.47.59.169]) by mx08-0015a003.pphosted.com (PPS) with ESMTPS id 3hyv2h1c6s-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 18 Aug 2022 10:03:37 -0500
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LRAAkfTtsSrvEJNVQjJ026dIAsgJYCVUXsnPcBphZMLAusNyLP1LCwSc/4W1kaQzrAZZ+OfsvWMCK53Lc+VIDFLg9d0tnThbZ2EkSTHPWr6W/PRU6I9xZzeb5jIsJC6VEjdnJx6yKYhaQKNOAbLfygPj22H3DtEzorm/7Yde3sxtYgfiAMCwuvgpDzYHI9j3zBe5LDBUwlW9OKdQGJ3C+s+IZaE3O/JPvYaht6jdR+SoMD3oQZ/z4mQDFQwvPdAZxiBwbMfybJA0P8dgE76AowfWdzEasLAR+4/taPFQrFFtUvLDbnVUPDYURvR2XgYcQHG5ciCK8RH+7arqOzsJ5g==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=pvKrKeZLhtPgfHUhOlMUSCD5JrLHnfO0ZlDrhQC3RzE=; b=Rjq4T8U8XNTFiqc7eqkFbin3Jk8jf8Mki4KIzelIWcxKL61+lv37EepaG0wxJQVQCoYDmaJcjQGhua0PEYdNfWsVfx2rWg5bTngFNJMsm0+wJKjYC1n4p8aftkwl/DCOoeEWcGsroGqtHE1klHzvT7PHF0UeZb+lg/Sz+f+Mq6RyjkjF+02AczHVMSu2kIGaD/m1AK3MuVKItmJ+KDqgha89HlZkrOe1GEB4HygNJuOO6zrYwvgpGmOFpIsKZJFRdmrqvDdI6WSNfYIfEgvQ4Zu1lPZfsXaW40KPR775Yb0uh3aW2SSdNjW6Y818Rfvn8yO8D7SmQz0nYa/2bpwhZA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=entrust.com; dmarc=pass action=none header.from=entrust.com; dkim=pass header.d=entrust.com; arc=none
Received: from DM6PR11MB2585.namprd11.prod.outlook.com (2603:10b6:5:ce::22) by CH0PR11MB5409.namprd11.prod.outlook.com (2603:10b6:610:d0::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5546.16; Thu, 18 Aug 2022 15:03:34 +0000
Received: from DM6PR11MB2585.namprd11.prod.outlook.com ([fe80::319c:7fd8:98cb:48a0]) by DM6PR11MB2585.namprd11.prod.outlook.com ([fe80::319c:7fd8:98cb:48a0%7]) with mapi id 15.20.5546.016; Thu, 18 Aug 2022 15:03:33 +0000
From: John Gray <John.Gray@entrust.com>
To: Tadahiko Ito <tadahiko.ito.public@gmail.com>, "Massimo, Jake" <jakemas=40amazon.com@dmarc.ietf.org>
CC: "Scott Fluhrer (sfluhrer)" <sfluhrer@cisco.com>, Mike Ounsworth <Mike.Ounsworth@entrust.com>, LAMPS <spasm@ietf.org>, "cfrg@irtf.org" <cfrg@irtf.org>, pqc-forum <pqc-forum@list.nist.gov>, "Kampanakis, Panos" <kpanos@amazon.com>, "sean@ssn3rd.com" <sean@ssn3rd.com>, "bas@westerbaan.name" <bas@westerbaan.name>
Thread-Topic: [EXTERNAL] Re: [lamps] [CFRG] [pqc-forum] RE: Whether to hash-then-sign with Dilithium and Falcon?
Thread-Index: AdiyWmrrCCvkDLBiTn2DcOMWvaOQ/gABb6NQAAQ+JgAAE/kJgAASGGSw
Date: Thu, 18 Aug 2022 15:03:33 +0000
Message-ID: <DM6PR11MB2585E47B6D7D92EBC1E71A29EA6D9@DM6PR11MB2585.namprd11.prod.outlook.com>
References: <CH0PR11MB5739393F19DD5282E3D7EF549F6A9@CH0PR11MB5739.namprd11.prod.outlook.com> <CH0PR11MB5444B9D3A0CB6E447A2FA3E5C16A9@CH0PR11MB5444.namprd11.prod.outlook.com> <88358933-A540-4000-9C7D-D248F670122F@amazon.com> <CAFTXyYC=Zt0hhk5G2A6b6AOM6Aww7jL3CwUmcZfNpmsWW0cpGQ@mail.gmail.com>
In-Reply-To: <CAFTXyYC=Zt0hhk5G2A6b6AOM6Aww7jL3CwUmcZfNpmsWW0cpGQ@mail.gmail.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-ms-publictraffictype: Email
x-ms-office365-filtering-correlation-id: 352fa0d7-1074-40ea-d8ce-08da812ad1c4
x-ms-traffictypediagnostic: CH0PR11MB5409:EE_
x-ms-exchange-senderadcheck: 1
x-ms-exchange-antispam-relay: 0
x-microsoft-antispam: BCL:0;
x-microsoft-antispam-message-info: 3X9j6MKREoStQvSiRb5Py/U+msToq6W0URb7UTl4KbIWPKi8NiRVmLzp91GDD6rJUiNAgp33lXp95UQJKJ3WWbEMR3xh70Vj8sJrmN600XqFmK920AaRL1vRLx9sd30wf3r3sB7BrouTkS6dMXbdq8oxY8/aMQaOB+Iu9Ho8EHpEw68EWnhWDywWFY1si4i42y2BhjxpRDcjmMhOG0f/rLSl/PuKlgh+AKKgho0htDzcUkp1IaC4OjmnFcRbpV3I4KepGjZ3TvPrvgK1LLvyjNRbBzuJiDe9AUjl6RemkFBvmtGODyQxbsuLKWk1XTIfImii7OqKqDGlhOK3wdChoOxTibsJsxAWS6HCTpme5pFt5GefQMKQLyMCQUE1Tsca77V76JjPXMw9+qxQaF6slIIIDNWcrl02MFF9f3BNF+JxFPcCvcoglYviDxaY7w3jXz6xISlPc0vakQImWjDOAOkPzgadkHJ3m639g481Y0z/oQUm8vX8AqsoarYyPu9LA5+q6rS5c/+AVKOBKJdCwRO+HBqa/P3ZV52EREXqGhhTBC9fB4ctxLJY8+8jsQQji6Zh8hLmBjqFsYkpxpsCHyRlehn0RgxG1hjq7hVt6IhmSIryeriN182M2LLRmtbGU+/TN8pvaPzS29zXWzVNLhfua0l5fNfj3CaQleWEOhD/fT/afWeMiJUD7f7kNWjgUP5VgR/LY+LYgbMDgLnUcQ8CqWCPaKnzFV1CiPLBSQu4aJQRMBpMkwUtuptGAx7eyLTNIhnUGqJL8f+Vi2Bq/y/7AogqkZYngt+II8EHr08=
x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM6PR11MB2585.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230016)(366004)(396003)(39850400004)(346002)(136003)(376002)(2906002)(30864003)(478600001)(41300700001)(8676002)(66556008)(76116006)(4326008)(66446008)(66476007)(66946007)(64756008)(55016003)(966005)(6506007)(71200400001)(45080400002)(33656002)(86362001)(316002)(26005)(7696005)(9686003)(53546011)(110136005)(54906003)(166002)(38070700005)(38100700002)(186003)(83380400001)(52536014)(122000001)(5660300002)(8936002)(66574015); DIR:OUT; SFP:1102;
x-ms-exchange-antispam-messagedata-chunkcount: 1
x-ms-exchange-antispam-messagedata-0: kx6qAtgeHElDGgDKbP4LVjX7gWfMTcHf1w4i2WDaJL+9LVjPvMAVM91rVA3z874uAOAzCZ3fw6YBXu2v8jRRyVQRYRp09Q9ZyZQm41HWrTLfOdMpDdVv8gY9MBQMyFfhevLOBYAuw1C+i9M3DMAIW62U1QaSkSyicJmp8631bN2I1qtY6Kz8PcB8lrxOEK4g/68z3+LVX8oIj1r4ltUvfrzt3R3n9Le/bGWeogSIxHlJrboe79S8PnG0UleUqrxW6vPIhwCS+Yw+dCCaXjUx75xXm5fFyDMWMGsHbzHNgqANi4Zh24pqlhynSIIGYcaHzuRsrSAkNtM8y7olng1vZ/LQ3CYWc5ktLpTz6ejvF7QrE31+xdiBCfdbXcrPoECiV/vEJcpHjAB2IoF1z1l5aP6mv3cZmLRLPOtH0SAfEOSi13NUiR8Nu7Go31z+Zq4U2p5V0b1PucfFSZLn5lcyJcU4T/3WUCaw9MdRPQe4S2t6392BU6HaVQnYAQAb7sP1yMTkEdqktsycM76acEgUe/6Zhnt+WUuqH9lo32blOWj8N28swuaQ43mHYDW/l7bY7vt9rwOlSsndNznZgegVmHsI+VrXLYPzn5ommAQv1oRcTMlnRz1EQcJPZAhyzUg8cA1abqtkimPWkLffq1W1pfWvp49nfZRp3laBHW4sfyrS66zfSaWMOaTf9VwOCjaooarkAOPROhHWaNn9sGEekowDdXT5Xn4CCTgH2RzjAKIfIRU/K3wHgRvbAPMXYbxXDQyY5ADxeAbvzOqIvdvU2BEGgYHE+8+PDCHHrZ6wr0DjmAic3KLTapI0I+KzECF2cgVEOtMPF7FFvXDL0YNl73Lx6pfct9cBMlML/GCGZrNkobp/nImoJd+2gIH3LKtNCkxkoUUhDOA5mVuzTqXvsftVhTgSXr+LdMqzMzRlsXYvHNd+5kqZIYMWKT3BB7Rrzkv+EeFyaZOECvHfOUQSISO1jzrpLrgT8ZEP+j8IWsstzldjUP9sn99h75U9jb9G3rK43/FuApdrUGQFzbFf8rctlkGgLv0dtW1xmRVO0RV2m/3BMGazBNa8MMK/WWheq9To34gl7wdyjzeBbXxign/lUbO7q9DQHKdNe8lDrge+j3w4b7rJBDKL1AnRrIrSYEwJOZVYevZb/Z4rAnu6dUbVT+PVeian/2uf/pGDHIrpPWrGUCHeDU3uCnRStqd0GQm/dY39Z/uV7q3od3BXQN8keOpjalcDhGGesk+aUHtZj19xw6HKlOEtw6kV/l2ymtH9tlB7jycWrKZWQGpL7pZOsNDdYlB0XQTQIv1DK1KFmbgnaG1JaPdeXjb54jKmmkoR+YJiSR87UipTiQnPciFdagSxusdi1eNSpZJqoP5Brn4xz3iPwnSz9JNq+jQqiMUZ/1FyWmGWC+ceVmldxZAHki07CN9aoMQmUUuvMh4PrNSkbbjgAy4NC2XmCCJdyF0HHhatBGk//MB34dVr2mJ5TT5X7AqOoSNFVFX4Mp/5xFdv9LxYSapr3jxNn1CosjSvN/tlTMJtVSwlJLrJ9z/gAOtVSpHii+xOwkrbn03M6wZpKt6Z0Ssx6ysnyMc1
Content-Type: multipart/alternative; boundary="_000_DM6PR11MB2585E47B6D7D92EBC1E71A29EA6D9DM6PR11MB2585namp_"
MIME-Version: 1.0
X-OriginatorOrg: entrust.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-AuthSource: DM6PR11MB2585.namprd11.prod.outlook.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 352fa0d7-1074-40ea-d8ce-08da812ad1c4
X-MS-Exchange-CrossTenant-originalarrivaltime: 18 Aug 2022 15:03:33.3826 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: f46cf439-27ef-4acf-a800-15072bb7ddc1
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: gQAd3TFX58ZVzweXSQUFrn0Gav2p/S8m96HbCiY8nQtmqOuCk2V5SgaxEeVnT2x2UG5V0PmXTiVGS0WzyPf8Eg==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH0PR11MB5409
X-Proofpoint-GUID: qhhBCxFEdLtxplXV5wCI3r9hcrdrsb6x
X-Proofpoint-ORIG-GUID: qhhBCxFEdLtxplXV5wCI3r9hcrdrsb6x
X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.517,FMLib:17.11.122.1 definitions=2022-08-18_12,2022-08-18_01,2022-06-22_01
X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 clxscore=1011 spamscore=0 mlxlogscore=999 priorityscore=1501 suspectscore=0 bulkscore=0 adultscore=0 lowpriorityscore=0 malwarescore=0 phishscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2207270000 definitions=main-2208180055
Archived-At: <https://mailarchive.ietf.org/arch/msg/spasm/nGhYFBa2aqBCe2_Xm_Qdeirp46U>
X-Mailman-Approved-At: Thu, 18 Aug 2022 08:29:00 -0700
Subject: Re: [lamps] [EXTERNAL] Re: [CFRG] [pqc-forum] RE: Whether to hash-then-sign with Dilithium and Falcon?
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: Thu, 18 Aug 2022 15:03:53 -0000

Thanks Tadahiko,

I read through your paper, and it covers exactly the usability issues we have come across!   We were wondering if it is possible to perform the specific hashing external to the server (which could be an HSM as in your paper, or timestamp server, etc).   For example, for Dilithium the mu := CRH( tr || M) and for Falcon it would be  c <- HashToPoint(r || m, q, n).    Your paper answers that question, it can be done for Falcon, but  not Dilithium (without changing the signature output).   So part of our question is whether using a regular external Hash as we do today for RSA and ECDSA (and what you call a boundary type B) somehow reduces the security and we shouldn’t recommend it.   We are interested in this because we are looking at defining composite pairs or triples which combine existing signature algorithms like RSAWithSHA256 and ECDSAWithSHA256 with Falcon or Dilithium.    Having to change the operational paradigm for an HSM or something like a timestamping server would result in large amounts of data having to be piped across the internet for signatures (as you point out in your paper).

For our composite signature use case it brings up similar questions.   We can support a mode where external hashing is done once, and then individually signed by the components (this makes it much more efficient) both internally and externally for the HSM, timestamping, code signing use-cases.   However, in the case of Dilithium there would need to be two signature modes Sig = Dilithium (Message) and the other would be Sig = Dilithium ( HASH (Message)).   I don’t think that is necessarily a bad thing as long as it is standardized and secure.   Alternatively, we could support independent hashing for each component, but that gets strange if you are doing an external hash for ECDSA, but then need to send the whole data for Dilithium.   We would likely have to end up supporting sending the whole data if external hashing compromises security of the PQC composites, but then it is even more inefficient as each component would need to hash independently.    You also covers this in section 4.3 your paper:

“We can construct type B cryptographic boundaries by adding one more hash function before the execution of PQC’s signature generation algorithm… This approach would improve the efficiency of lattice based digital signature schemes deployed in HSM. It would have a greater impact on Dilithium, but also be applicable to Falcon and other digital signature schemes. Two modes of PQC algorithms utilizing this approach will be able to exist, namely, a PQC algorithm without an additional hash (i.e. original PQC algorithm) and a PQC algorithm with an additional hash. If there are two modes of a digital signature scheme, then the asymmetric operation for those two modes must not be identical. The reason is that, obtaining a signature from the mode with an additional hash function would help attackers who can attack another mode which is without the additional hash function.”

So for example,  Mode1 = Dilithium(Message) and Mode2 = Dilithium ( HASH (Message)) where Mode1 is the original algorithm that does its own internal hashing, and Mode2 does an additional hash externally before the original algorithms internal hash.   Then you are saying obtaining the signature from Mode2 would be able to attack Mode1?     I don’t quite understand that part.   If you could explain how such an attack works in a bit more detail it would be helpful.

I see you suggest mitigations by changing the Dilithium algorithm itself (section 4.3 of your paper).   Perhaps such mitigations could be considered by the standards bodies?   Otherwise switching from boundary type B (external hash then sign) to boundary type A (full message signing) will be another major hurdle for the industry, adding additional complication and with that possible bugs.


Thanks for sharing your paper with us Tadahiko and the valuable work you are doing!



John Gray




From: Spasm <spasm-bounces@ietf.org> On Behalf Of Tadahiko Ito
Sent: Thursday, August 18, 2022 1:12 AM
To: Massimo, Jake <jakemas=40amazon.com@dmarc.ietf.org>
Cc: Scott Fluhrer (sfluhrer) <sfluhrer@cisco.com>; Mike Ounsworth <Mike.Ounsworth@entrust.com>; LAMPS <spasm@ietf.org>; cfrg@irtf.org; pqc-forum <pqc-forum@list.nist.gov>; Kampanakis, Panos <kpanos@amazon.com>; sean@ssn3rd.com; bas@westerbaan.name
Subject: [EXTERNAL] Re: [lamps] [CFRG] [pqc-forum] RE: Whether to hash-then-sign with Dilithium and Falcon?

WARNING: This email originated outside of Entrust.
DO NOT CLICK links or attachments unless you trust the sender and know the content is safe.
________________________________
> It was my understanding that the signing procedure may need to be
> repeated several times to produce a signature, and thus pre-hashing
> would prevent the need to individually hash the input message with
> each attempt.

When we were trying to implement PQC in functional module of HSM for our use case, It was pain. I believe HSM vender will implement much better, but It may still have problem.
Hash then Sign was great that we can separate key management (and signing) function from data management (and hashing) function. It seems crypto module producer might need to implement scheduling function for data management function. I far those problems decrease efficiency, but we might need to care that.

>> (…) Assuming our understanding below is correct, a direct-sign algorithm
>> would require the entire thing to be streamed to a network HSM for signing
>> and to a TPM for verification.

Currently, I am doubting that we might not have that many protocols with direct-signing algorithm which would sign intolerable large data. For those protocol with direct-signing, I believe we can have several approaches.


1)    Sign to smaller compressed data (e.g. by using CMS) instead of raw data.
It was biggest feedback I got so far, when I told about those stuff on IETF last year.
For this option, Users may need to change data structure, but If we cannot find that much direct-signing use case, it might be reasonable. Direct-signing use case holders may need to take other option.
In addition, when I ask our engineer for our use case, he said that was long recognized issue, and it might be good chance to do so.

2)    Use pre-hash
Users do not need to change data structure, but we may meet interoperability challenge.

3)    Separate PQC into key management function and data management function,
I tried, but I believe It was not good choice. <https://eprint.iacr.org/2020/990.pdf<https://urldefense.com/v3/__https:/eprint.iacr.org/2020/990.pdf__;!!FJ-Y8qCqXTj2!dfr57dO6T_EyraXf4njCpckiogK-s2TOWWgvTT-2Eyw9R2mHDc4zeC42LyxdLY-_V9U98BBz_Xqd2XROZRiYaqxc0I0t97ACDg$>>  (I am sorry that we have not updates that document.)

4)    Ask NIST to make hash-and-sign PQC

If they make one, it would be easy. (well.. I believe we should not assume that)

Regards Tadahiko

2022年8月18日(木) 4:41 Massimo, Jake <jakemas=40amazon.com@dmarc.ietf.org<mailto:40amazon.com@dmarc.ietf.org>>:
Thanks Mike, Scott.

I've added to the github repo so we can track discussions on this topic https://github.com/jakemas/draft-massimo-pq-pkix-00/issues/23<https://urldefense.com/v3/__https:/github.com/jakemas/draft-massimo-pq-pkix-00/issues/23__;!!FJ-Y8qCqXTj2!dfr57dO6T_EyraXf4njCpckiogK-s2TOWWgvTT-2Eyw9R2mHDc4zeC42LyxdLY-_V9U98BBz_Xqd2XROZRiYaqxc0I24eQAyKQ$>

    >> So it seems like the Dilithium designers explicitly want the hash to differ
    >> across repeated attempts.
    >>

    > Hmmm, I don't see that in Dilithium; are they referring to the internal ExpandMask function?  That isn't applied to the input message.
    >In any case, it's easy to derive SHAKE( M || 1 ), SHAKE( M || 2 ), ... without multiple passes through M; you compute the partial SHAKE state after process M, and then apply that partial state to 1, 2, ...

I think we are referring to different parts of the signing process here. For reference, my security consideration was referring to page 4 of the Dilithium spec that states:
"Our full scheme in Fig. 4 also makes use of basic optimizations such as pre-hashing the message M so as to not rehash it with every signing attempt." and Figure 4 itself.

It was my understanding that the signing procedure may need to be repeated several times to produce a signature, and thus pre-hashing would prevent the need to individually hash the input message with each attempt. I believe the desired differing of the hash you mentioned is within the internals of the signing procedure and not on the input message itself.

   >> Third, I can imagine that some applications (like TLS) will want to use non-pre-hashed versions of Dilithium and Falcon, but other applications (like code-signing) would prefer pre-hashed versions. These are not interoperable with each other. Is NIST planning to produce algorithm definitions, OIDs, Codepoints, etc, for both versions?

   >Expanding on the code-signing example: the messages to be signed can be very large; consider a several GB firmware image. Assuming our understanding below is correct, a direct-sign algorithm would require the entire thing to be streamed to a network HSM for signing and to a TPM for verification. Conversely code-signing environments often include counter-signatures from Time Stamping Authorities which protect against future discovery of collision attacks against the hash function -- as an example, Windows still accepts RSA-SHA1 signatures produced before SHA1 was deprecated. I can imagine that the code-signing community will decide that the performance gains of hash-then-sign outweigh the security loss.

 >So, will NIST standardize both direct-sign and some variant of hash-then-sign for PQC signature primitives?

I do agree that there may be optimizations that users may wish to make dependent on the context, i.e., hash-then-sign vs direct-sign. It's for this reason I tried to give an overview of the security of each option in the draft, but ultimately leave that up to the user. It is a good point regarding NISTs perspective on what should be explicitly standardized here.

    >> This provides strong security against pre-computed
    >> collision attacks since an attacker has no a-priori knowledge of `r` and
    >> provides per-key hash-domain separation of the message to be signed.

    >Rather, it limits the usability of any found collision to a specific public key; however it does nothing to frustrate a collision attack against a specific public key.

Right, more details on the advantages of message binding on the PQC-forum from C. Peikert's https://groups.google.com/a/list.nist.gov/g/pqc-forum/c/eAaiJO1qzkA/m/K66R_ftNBwAJ<https://urldefense.com/v3/__https:/groups.google.com/a/list.nist.gov/g/pqc-forum/c/eAaiJO1qzkA/m/K66R_ftNBwAJ__;!!FJ-Y8qCqXTj2!dfr57dO6T_EyraXf4njCpckiogK-s2TOWWgvTT-2Eyw9R2mHDc4zeC42LyxdLY-_V9U98BBz_Xqd2XROZRiYaqxc0I3Ss-WnXA$>. It was this discussion I was trying to encompass in the draft.

Cheers,
Jake

------


On 17/08/2022, 10:51, "'Scott Fluhrer (sfluhrer)' via pqc-forum" <pqc-forum@list.nist.gov<mailto:pqc-forum@list.nist.gov>> wrote:

    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.



    > -----Original Message-----
    > From: 'Mike Ounsworth' via pqc-forum <pqc-forum@list.nist.gov<mailto:pqc-forum@list.nist.gov>>
    > Sent: Wednesday, August 17, 2022 1:27 PM
    > To: 'LAMPS' <spasm@ietf.org<mailto:spasm@ietf.org>>; cfrg@irtf.org<mailto:cfrg@irtf.org>; pqc-forum <pqc-
    > forum@list.nist.gov<mailto:forum@list.nist.gov>>; jakemas@amazon.com<mailto:jakemas@amazon.com>; kpanos@amazon.com<mailto:kpanos@amazon.com>;
    > sean@ssn3rd.com<mailto:sean@ssn3rd.com>; bas@westerbaan.name<mailto:bas@westerbaan.name>
    > Subject: [pqc-forum] Whether to hash-then-sign with Dilithium and Falcon?
    >
    > Hi Jake, Panos, Sean, Bas,
    >
    >
    > We notice that your IETF draft-massimo-lamps-pq-sig-certificates-00 has the
    > following security consideration:
    >
    > > Within the hash-then-sign paradigm, hash functions are used as a
    > > domain restrictor over the message to be signed. By pre-hashing, the
    > > onus of resistance to existential forgeries becomes heavily reliant on
    > > the collision-resistance of the hash function in use. As well as this security
    > goal, the hash-then-sign paradigm also has the ability to improve
    > performance by reducing the size of signed messages. As a corollary, hashing
    > remains mandatory even for short messages and assigns a further
    > computational requirement onto the verifier. This makes the performance of
    > hash-then-sign schemes more consistent, but not necessarily more efficient.
    > > Dilithium diverges from the hash-then-sign paradigm by hashing the
    > message during the signing procedure (at the point in which the challenge
    > polynomial).
    > > However, due to the fact that Dilithium signatures may require the
    > > signing procedure to be repeated several times for a signature to be
    > produced, Dilithium implementations can make use of pre-hashing the
    > message to prevent rehashing with each attempt.
    >
    >
    > First, quoting from the Dilithium NIST Round 3 submission documents:
    >
    > > Since our signing procedure may need to be repeated several times
    > > until a signature is produced, we also append a counter in order to
    > > make the SHAKE-256 output differ with each signing attempt of the same
    > message.
    >
    > So it seems like the Dilithium designers explicitly want the hash to differ
    > across repeated attempts.
    >

    Hmmm, I don't see that in Dilithium; are they referring to the internal ExpandMask function?  That isn't applied to the input message.

    In any case, it's easy to derive SHAKE( M || 1 ), SHAKE( M || 2 ), ... without multiple passes through M; you compute the partial SHAKE state after process M, and then apply that partial state to 1, 2, ...

    >
    >
    > Second, we had a similar discussion within the context of composite
    > signatures when figuring out how to combine Dilithium and Falcon with
    > ECDSA and RSA. We came out with a different conclusion; that hash-then-
    > sign reduces the security properties of Dilithium and Falcon down to the
    > collision resistance of the hash function used to pre-hash.
    >
    > We would like community opinion on this.
    >
    >
    > Here's the Security Consideration text that we're working on:
    >
    >
    >
    >
    > In the hash-then-sign paradigm, the message to be signed is hashed
    > externally to the signature primitive, and then the hash value is signed.
    >
    > The hash-then-sign paradigm is required, for example, with RSA signatures in
    > order to sign messages larger than the RSA modulus. Hash-then-sign also
    > gives performance and bandwidth benefits, for example, when the signature
    > is performed by a networked cryptographic appliance since you only need to
    > send a small hash value rather than streaming the entire message.
    >
    > With Dilithium and Falcon signatures it is not recommended to pre-hash for
    > the following reasons:
    >
    >
    > The Dilithium construction includes
    >
    > ~~~
    > Sign(sk,M):
    > 10: mu \in {0, 1}^384 := CRH(tr || M)
    > ~~~
    >
    > where `CRH` is any collision-resistant hash function and `tr` is a component
    > of the secret key.

    A hash of the public key, actually; see line 7 of the key generation process (which explicitly computes it from the components of the public key) - Dilithium stores it in the private key so the signer doesn't need to recompute it every time.

    > This provides strong security against pre-computed
    > collision attacks since an attacker has no a-priori knowledge of `r` and
    > provides per-key hash-domain separation of the message to be signed.

    Rather, it limits the usability of any found collision to a specific public key; however it does nothing to frustrate a collision attack against a specific public key.

    Now, it does probably add a constant factor to any attack that searches for a simultaneous collision between the hash that RSA/ECDSA uses (without the prepend) and the hash that Dilithium uses (with the known prepend) - I would hesitate to give a value to that constant factor, but it is likely not large.

    >
    >
    > The Falcon construction includes
    >
    > ~~~
    > Sign (m, sk, beta^2):
    > 1: r <- {0, 1}^320 uniformly
    > 2: c <- HashToPoint(r || m, q, n)
    > ~~~
    >
    > where `HashToPoint` is a SHAKE-256-based construct. This provides strong
    > security against pre-computed collision attacks since an attacker has no a-
    > priori knowledge of `r` and provides per-signature hash-domain separation
    > of the message to be signed.
    >
    > If the message to be signed is pre-hashed, for example `m0 = SHA256(m)`
    > and then m0 provided to Dilithium or Falcon to sign, then you have re-
    > introduced the collision problem since two messages m1 and m2 where
    > SHA256(m1) == SHA256(m2) hash value will result a single Falcon or Dilithium
    > signature value which is simultaneously valid for both m1 and m2. This
    > removes the extra collision resistance built in to the Dilithium and Falcon
    > primitives and reduces it to the collision resistance strength of the underlying
    > hash function. For this reason it is in general not recommended to pre-hash
    > when using Dilithium or Falcon except in cases where the implementor is
    > comfortable with this reduction in security.
    >
    > Therefore, for the purpose of interoperability of composite signatures,
    > implementations MUST NOT pre-hash messages for Dilithium and Falcon. If
    > pre-hashed versions of these signatures are desired, then separate signature
    > algorithms will need to be defined.
    >
    >

    --
    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+unsubscribe@list.nist.gov<mailto:pqc-forum%2Bunsubscribe@list.nist.gov>.
    To view this discussion on the web visit https://groups.google.com/a/list.nist.gov/d/msgid/pqc-forum/CH0PR11MB5444B9D3A0CB6E447A2FA3E5C16A9%40CH0PR11MB5444.namprd11.prod.outlook.com<https://urldefense.com/v3/__https:/groups.google.com/a/list.nist.gov/d/msgid/pqc-forum/CH0PR11MB5444B9D3A0CB6E447A2FA3E5C16A9*40CH0PR11MB5444.namprd11.prod.outlook.com__;JQ!!FJ-Y8qCqXTj2!dfr57dO6T_EyraXf4njCpckiogK-s2TOWWgvTT-2Eyw9R2mHDc4zeC42LyxdLY-_V9U98BBz_Xqd2XROZRiYaqxc0I11e9Ce6Q$>.

_______________________________________________
CFRG mailing list
CFRG@irtf.org<mailto:CFRG@irtf.org>
https://www.irtf.org/mailman/listinfo/cfrg<https://urldefense.com/v3/__https:/www.irtf.org/mailman/listinfo/cfrg__;!!FJ-Y8qCqXTj2!dfr57dO6T_EyraXf4njCpckiogK-s2TOWWgvTT-2Eyw9R2mHDc4zeC42LyxdLY-_V9U98BBz_Xqd2XROZRiYaqxc0I1sWJs08w$>
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.