[CFRG] Re: ML-KEM for HPKE: just use seeds

John Mattsson <john.mattsson@ericsson.com> Wed, 06 November 2024 10:24 UTC

Return-Path: <john.mattsson@ericsson.com>
X-Original-To: cfrg@ietfa.amsl.com
Delivered-To: cfrg@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 64F4FC180B42 for <cfrg@ietfa.amsl.com>; Wed, 6 Nov 2024 02:24:51 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.254
X-Spam-Level:
X-Spam-Status: No, score=-2.254 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.148, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_BLOCKED=0.001, RCVD_IN_ZEN_BLOCKED_OPENDNS=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01, URIBL_DBL_BLOCKED_OPENDNS=0.001, URIBL_ZEN_BLOCKED_OPENDNS=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=ericsson.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 j5kZWF9rcKAc for <cfrg@ietfa.amsl.com>; Wed, 6 Nov 2024 02:24:47 -0800 (PST)
Received: from EUR03-VI1-obe.outbound.protection.outlook.com (mail-vi1eur03on20612.outbound.protection.outlook.com [IPv6:2a01:111:f403:260c::612]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature ECDSA (P-256) server-digest SHA256) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id EDEAAC1CAF43 for <cfrg@irtf.org>; Wed, 6 Nov 2024 02:24:46 -0800 (PST)
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=X0USVIiHOv7m43763fdkYTInrnT0xdd5CGd4a2T0R3eYqYbS1244j3qsp8dkEeXkQLbJSLxPorreFbj1FILowLhOawIvYHJb3GhqFBWmuxkPqHYxUlqSCJYr8iLEzzed43eyABFGfdQmJ0zbUpfj6c0vH2olOXjkUylJ24AlOB3V7qhMOieqfW3X+8MMTksTCrtXwkwXIa+pXSiUr7kkBzmO7kHn6Fi5vYcKJtptdkWp9ndulFY2sPXJZuemtJQJzQ4LF0fYEwEYhXePqZT0iNQ9dbSwkf1bcYrBOx/JMtzfGaO/CH32RHvkALgf3NZkyo55eKZgWUqINaFKsD2JLQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=q5s9LJ8rVCjTntqxbHSQV8d/7Ryf3/LagoeuBcBgyAY=; b=ADHQNzowXfDWDwjsaMHUb+aSQYPptZxmF1ZNYtbbTUJptkT2fd9k1iy0Bo7n0KtBvpHCTbWwEvWeUBUZdCxNysAr1xBKYZ54iIt0d8+AXXpHWErLwcJrCLPAIzRZ/3yL+ggnHHupMgcXgln3PvAf+5I2UcN9rltjNtzZy9z5F3xrI3a0mIMj9M6D8dYGUtVMucpEikchCfGUB6kgL0uqCaBZj5hUFK647dZu2+3SIs0JIhOcezqojmF388vPv7W0qk32ryy0qXVq7hFld1G0nDZQOojHmkP++no2GJG0aZQs2tSCkY5tdzmI9IYX8THY0SGDIZhpiWpKJ2AF0RloTw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=ericsson.com; dmarc=pass action=none header.from=ericsson.com; dkim=pass header.d=ericsson.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ericsson.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=q5s9LJ8rVCjTntqxbHSQV8d/7Ryf3/LagoeuBcBgyAY=; b=pz+2e/sH3nAYkNaLzpg/ZL/Bi4nbIaKd1LKIJE8b6t0aW3IYPwJcwOzvPTloaPnRg9Vcs8VbGlYbyXeZ0U+wKKwTQrVpyhXx1Ez9oSXMPdsrQbA/jzzC001mO2U2rYmvsE4fEkfYBcOEvSsyKA13LNzgZqajWvABCbL4cRgO7YoUwnbc6hrSwK/FPqXJrESml2Cz4aGjMUCloarqNqzM2WIwmUGsgG9fOqucIUsj3/oCgwMMTVigMXw/WJG3O143dTXMhu3CH7j3kDShLV9WevluARD5JVVOGIGXnae+mRwCb5XiTBIfq4RhZ2DKDsqt/VUpUYWxJtB2094jMdc1qg==
Received: from GVXPR07MB9678.eurprd07.prod.outlook.com (2603:10a6:150:114::10) by PAXPR07MB8421.eurprd07.prod.outlook.com (2603:10a6:102:2bc::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8114.29; Wed, 6 Nov 2024 10:24:42 +0000
Received: from GVXPR07MB9678.eurprd07.prod.outlook.com ([fe80::bcf3:3f45:888e:a4b8]) by GVXPR07MB9678.eurprd07.prod.outlook.com ([fe80::bcf3:3f45:888e:a4b8%5]) with mapi id 15.20.8114.028; Wed, 6 Nov 2024 10:24:42 +0000
From: John Mattsson <john.mattsson@ericsson.com>
To: Deirdre Connolly <durumcrustulum@gmail.com>
Thread-Topic: [CFRG] Re: ML-KEM for HPKE: just use seeds
Thread-Index: AQHbHIi49EZJ4etSz0KSHWNgM9h05rKC4O6AgAH0h4CAAek9AIAjcQGAgAABYn4=
Date: Wed, 06 Nov 2024 10:24:42 +0000
Message-ID: <GVXPR07MB9678F13DDB17E6A66D4B6CDD89532@GVXPR07MB9678.eurprd07.prod.outlook.com>
References: <CAFR824xpwetkdZZL29TZoa2pEE6Ke537eNuritKbBJZ0wiCKYQ@mail.gmail.com> <CAKoiRuaocTHe0YJr=cdF57v0mcFOYi8K39jr_s0tqOX9OG4xXA@mail.gmail.com> <CAKoiRuZRH4QkMi8DXc-PrBZYsVcbXiqgzR+ZX6q9GTZB9ymBJA@mail.gmail.com> <CAFR824wfQRw0sYPn9se0gHzCQd=7U1RFn0wFs3rNyJ-yrnsqNg@mail.gmail.com> <CAFR824yYRsDu3sn5kVCS1SmdSPmEeHbskNSbky7G6kJKO==t-g@mail.gmail.com> <CAFR824zWzz8u7GiDuKubGNmJznAifqoNPu2+yhVkmfHDrxSs8w@mail.gmail.com>
In-Reply-To: <CAFR824zWzz8u7GiDuKubGNmJznAifqoNPu2+yhVkmfHDrxSs8w@mail.gmail.com>
Accept-Language: en-US
Content-Language: en-GB
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-ms-reactions: allow
authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=ericsson.com;
x-ms-publictraffictype: Email
x-ms-traffictypediagnostic: GVXPR07MB9678:EE_|PAXPR07MB8421:EE_
x-ms-office365-filtering-correlation-id: 65eadd3a-06ed-4a17-35cd-08dcfe4d3a55
x-ms-exchange-senderadcheck: 1
x-ms-exchange-antispam-relay: 0
x-microsoft-antispam: BCL:0;ARA:13230040|366016|376014|1800799024|8096899003|38070700018;
x-microsoft-antispam-message-info: MLTPVTbZolFZ2GCSBLzCQKwBQS6F5uOtP9YMQUQAj3O1+gC+zAYC3SLy+jTHC23nnJxgizYQDmyXrCucMI0Meg9FLxvLMd6OFjhcJHL7gxXOywq7h1kJ9EvNTQ6iPAhRv9xCOtrtdmBu21fNUB7dATzPoWXzywvg8iWl3EZ06arU+LePkYqY2POrsTnd2AAfHcmtvx184wdEwk2LDXVffmq1oiz3k7vHhRth/s0tlzNnKIzgQXdVeYYGATKcbr0wD6QAF5l5HbrNWpV/ZZcvKMVfmYkgElbZHV4Geplh9Xg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JTwpUjpBj5P2a6u4q4ITnt
x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:GVXPR07MB9678.eurprd07.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(366016)(376014)(1800799024)(8096899003)(38070700018);DIR:OUT;SFP:1101;
x-ms-exchange-antispam-messagedata-chunkcount: 1
x-ms-exchange-antispam-messagedata-0: LqqJHj+5L3/1e1D843R58bujHCoz/zAQzltFEXMVYi9CwF4uT+6bZYfqW/wiAQCs/ThJ8K/4YkhwNLGls0YieteGDo9T/LyUx26YhXGbIMBpfAapgrEDq2hShSPCirYlI1uTRFT1vLtNyewI2CXn/DhMRCRyV2RiZA6L2J2QZl9S0jrVgh+uwABfcEX70C/gxvRsbpMtSmOr38fNqrlPMdyJfIEh17sbcr4PmT6ytUG3pZKjGerRFRoSUjC2aLOb2hr3UNsjZBm+PRe9tYeBJsJ/CRv3tLOke8fUE5+IRunCybgupKqq6xptcCHPNjsoLm3LqREy7xnI5WGJLtSUkrEeqZ/nPW4uOEnYhC/7CyNNMUEyAm1YiyoQ+F2cAbYCp/BF94l7Dqp3xtH9bQTVJWRbFC63dJy9+F6YjVpLGwWkZO3atUTpjdCeXGDoTJWn4iUYE9YzzVerZSL132Tyreh+7+/QlbO6Tv6DYgarmDlaZwA0jW7zTJWH8h8RfO7/QnFtHMlNNq2fBU6WszIKsiNdMZDpWNsN3uCgH046IqElaujtElFpwY+7RBSwAvQHhRBeQzVbSnhB+OMf5dkKHgE0BiX+iwKM7QlyC+lOIGxbbXMxBZt4IXWpkK/1n1VW16lRZ170kTVr5s2cCivXRxXX4YomvdSY5uvnJg/ok2DILgUwd4kTXTx3gFqxSrAaPHj1TCWnynl/61GkSOZXfYL0qLMbKWuB7tB6HIc5n88ppjBe3YkLiVnx3SLwBSG+9vJUTsmfW1G9nNhu9AMxnQX+maVuRnNCPt1WghDn7wGPwJfjaF+bKcQ/f0wnrqmhMUHpYUyUwP0XXZIHoJ++5scvsznI0LzTtgcetO7t2CqRy6nDbCeKbZ4wzlbzb2Jo//e4JNkmYeTkXpeNGDUQpNUihIxTrT9AHRff2IHkjOa60vzLOOv6vTHpYL/TR/hX7DfgfuG7aNwgAbzvw6a/y6yrabcbg/I81/V23x4nuimCTX1EN3rqNNF/6ZVmKC1RZtc2u3IApsTQVnCpyVKBx09UPUHsdXISlRmHYNRO9wytP7e9WLf4P7ICnKuVHaIywB6BYHwiWUWp+xxr36g3XPWPQrmF0t9ibXdlHZXMiR8g8HsgIP8yluZvlXLeUYaN+oj4WhWzh5KHk8l4CuRJDBDsQYuLnozcnUR9OtGaxZTW2PrbT45sGzeJSGuYNhYxW+osX8K+YDc6IKoWlYxjP5CEyXQLeljltnVIBO+tCtkrStCwqk19w8OmW0qwnV0434tY6UzrTuP0wtF5K2FB23f+HyUZ++3t9eNFmBZ/l3TXHSqkW6txC1HNYuL3b/RYPDs7loSCIPXQL+c026HOUbNCSUw6T6QcdcoBkkUNG8gb/QSrlaH6RBIC7L9bqMgteIoN0ECUMj8pI78xn/yRYG835JNrUHkgWuB1PKnMbfmu5lM3zP0Pe6Vaz+aVV3GlSgV2DgPJqnBIOvhXruOAml4naEgp0VkzHcghKjmQpvUffQPvS5KJajMVi9ZH3BOL1YsyBLg0rQPastVRzGpST6XOrw3GPlXu1ITxgm3Ui5P8BJ7SfgvzM+PMAYHFCeSNRgH0VWKpEbDug3Gb7ts8RT6mcF4nOBYsfa7acxHb5Y4=
Content-Type: multipart/alternative; boundary="_000_GVXPR07MB9678F13DDB17E6A66D4B6CDD89532GVXPR07MB9678eurp_"
MIME-Version: 1.0
X-OriginatorOrg: ericsson.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-AuthSource: GVXPR07MB9678.eurprd07.prod.outlook.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 65eadd3a-06ed-4a17-35cd-08dcfe4d3a55
X-MS-Exchange-CrossTenant-originalarrivaltime: 06 Nov 2024 10:24:42.3994 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 92e84ceb-fbfd-47ab-be52-080c6b87953f
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: HObFLADK2GekQAj7RmrY3ZLrQlZ3tob7ZxAyepwyMdFZ5TpipyR4qAC/+9iA4PKSWTCg0mTLzKcVDNxyi7aFUdMTwstv8GrzYA+qBRCONIE=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR07MB8421
Message-ID-Hash: YCWRBBO6PV6ZSNO3POBKO32RP6GGBI3B
X-Message-ID-Hash: YCWRBBO6PV6ZSNO3POBKO32RP6GGBI3B
X-MailFrom: john.mattsson@ericsson.com
X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-cfrg.irtf.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header
CC: CFRG <cfrg@irtf.org>
X-Mailman-Version: 3.3.9rc6
Precedence: list
Subject: [CFRG] Re: ML-KEM for HPKE: just use seeds
List-Id: Crypto Forum Research Group <cfrg.irtf.org>
Archived-At: <https://mailarchive.ietf.org/arch/msg/cfrg/zf9IbHd5WeI34lANc4Pjd4HPF1c>
List-Archive: <https://mailarchive.ietf.org/arch/browse/cfrg>
List-Help: <mailto:cfrg-request@irtf.org?subject=help>
List-Owner: <mailto:cfrg-owner@irtf.org>
List-Post: <mailto:cfrg@irtf.org>
List-Subscribe: <mailto:cfrg-join@irtf.org>
List-Unsubscribe: <mailto:cfrg-leave@irtf.org>

>And the only thing this really requires beyond FIPS 203 is that the 64-byte decapsulation key format is a MUST, which >is in alignment with other ML-KEM work in IETF right now (such as lamps-kyber-certificates)

Seems good to me. Good that the 64-byte decapsulation key format is a MUST. But I am not sure the following should be a MUST.

   “that is by freshly sourcing 32 random bytes for d and then freshly
   sourcing another 32 random bytes for z from a FIPS-approved RBG.”

I think the correct way to do this is to derive everything from a 32 byte seed as discussed here.
https://groups.google.com/a/list.nist.gov/g/pqc-forum/c/2EWXvBaE-Yw/m/bMyO7B-fAwAJ

Would it be possible to discuss and allow this?

Cheers,
John

From: Deirdre Connolly <durumcrustulum@gmail.com>
Date: Wednesday, 6 November 2024 at 11:16
To:
Cc: CFRG <cfrg@irtf.org>
Subject: [CFRG] Re: ML-KEM for HPKE: just use seeds
As per the meeting today, just re-surfacing this for the group:

https://datatracker.ietf.org/doc/draft-connolly-cfrg-hpke-mlkem/04/

and if there's good vibes, I'll go request the codepoints:

0x40 - ML-KEM-512
0x41 - ML-KEM-768
0x42 - ML-KEM-1024

And the only thing this really requires beyond FIPS 203 is that the 64-byte decapsulation key format is a MUST, which is in alignment with other ML-KEM work in IETF right now (such as lamps-kyber-certificates)

On Mon, Oct 14, 2024 at 9:58 PM Deirdre Connolly <durumcrustulum@gmail.com<mailto:durumcrustulum@gmail.com>> wrote:
With help from Rohan, we have pushed version -03, which removes the confusing language about KDFs and AEADs and chooses different codepoints in the HPKE KEMs Registry (now 0x0040, 0x0041, and 0x0042):

https://datatracker.ietf.org/doc/draft-connolly-cfrg-hpke-mlkem/03/

There are some todo's to complete on making the explicit mapping between FIPS 203 and RFC 9180 functions concrete and some references that should be done by the 121 deadline.

On Sun, Oct 13, 2024 at 11:47 AM Deirdre Connolly <durumcrustulum@gmail.com<mailto:durumcrustulum@gmail.com>> wrote:
Yes you are correct - I was thinking I was registering a whole 'HPKE' ciphersuite which is incorrect, this is just for the KEM, which is fully described by FIPS 203 and doesn't need the extra KDF and AEAD definitions, I'll be removing that text.

On Sat, Oct 12, 2024, 5:56 AM Rohan Mahy <rohan.mahy@gmail.com<mailto:rohan.mahy@gmail.com>> wrote:
Apologies for my hasty response on too little sleep.

After skimming FIPS203 again, it looks like the hash function is fully specified, so just deleting the paragraph about KDFs and AEAD seems best to me.

And NSecret is indeed always 32. It might be worth a note so readers less familiar with ML-KEM don't think it is a typo.

Thanks,
-rohan

On Sat, Oct 12, 2024, 02:23 Rohan Mahy <rohan.mahy@gmail.com<mailto:rohan.mahy@gmail.com>> wrote:
Hi Dierdre,
Thanks very much for getting this out. My main technical concern is this paragraph, which does not provide a clear mapping of ML-KEM size to its KDF, and muddles cipher suite definition with KEM definition:

We use HKDF-SHA256 and HKDF-SHA512 as the HPKE KDFs and AES-128-GCM and AES-256-GCM as the AEADs for ML-KEM-512, ML-KEM-768, and ML-KEM-1024.

Please define the specific KDF to use clearly in text or in a table. (I think we can leave AEAD out of this.) I heard much talk of using ML-KEM-768 for the 128-bit and 192-bit security levels. Should we have 3 or 4 definitions for HPKE KEM?
ML-KEM-512 (SHA256) for ??
ML-KEM-768 (SHA256) for 128?
ML-KEM-768 (SHA384) for 192
ML-KEM-1024 (SHA512) for 256

Regarding the IANA registration section, it requests 0x0512, 0x0768, and 0x1024. Please don't. 0x0040, 0x0041, etc would be much better. Is NSecret really only 32 for all three KEMs? I would have guessed these increased to 48 and 64.

I'll propose an editorial PR soon, but these are my only substantive issues.
Thanks,
-rohan