[CFRG] Re: [lamps] Re: Re: [EXTERNAL] Re: [hpke] Re: Re: Re: Re: Cross-testing update on LAMPS Composite and cfrg-concrete-hybrid-kems
Richard Barnes <rlb@ipv.sx> Wed, 29 October 2025 23:19 UTC
Return-Path: <rlb@ipv.sx>
X-Original-To: cfrg@mail2.ietf.org
Delivered-To: cfrg@mail2.ietf.org
Received: from localhost (localhost [127.0.0.1]) by mail2.ietf.org (Postfix) with ESMTP id 0BE207E8480A for <cfrg@mail2.ietf.org>; Wed, 29 Oct 2025 16:19:12 -0700 (PDT)
X-Virus-Scanned: amavisd-new at ietf.org
X-Spam-Flag: NO
X-Spam-Score: -1.396
X-Spam-Level:
X-Spam-Status: No, score=-1.396 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HTML_FONT_LOW_CONTRAST=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001, URI_NOVOWEL=0.5] autolearn=ham autolearn_force=no
Authentication-Results: mail2.ietf.org (amavisd-new); dkim=pass (2048-bit key) header.d=ipv-sx.20230601.gappssmtp.com
Received: from mail2.ietf.org ([166.84.6.31]) by localhost (mail2.ietf.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id LMPYNW8i8rQh for <cfrg@mail2.ietf.org>; Wed, 29 Oct 2025 16:19:10 -0700 (PDT)
Received: from mail-io1-xd33.google.com (mail-io1-xd33.google.com [IPv6:2607:f8b0:4864:20::d33]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (P-256) server-digest SHA256) (No client certificate requested) by mail2.ietf.org (Postfix) with ESMTPS id 8BB3F7E83ADF for <cfrg@irtf.org>; Wed, 29 Oct 2025 16:17:24 -0700 (PDT)
Received: by mail-io1-xd33.google.com with SMTP id ca18e2360f4ac-93e2c9821fcso42602339f.3 for <cfrg@irtf.org>; Wed, 29 Oct 2025 16:17:24 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipv-sx.20230601.gappssmtp.com; s=20230601; t=1761779844; x=1762384644; darn=irtf.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=KscN0CZ7PLDsuKsABSwvdDAP7wORD+N8RXiOdAwJcjc=; b=I0RvGeaFiUVySwecZct63LVE3YFLpJnpIcrgN3AGobPApwGVslrX9AnkdBmYD4dcRY 8sDjXkLN/NLoD5WhR9on7wMuuqgzk+Sq2kz6OPcDWhdMv3DbS83Wdfi/3zdTrrTTUDkF 7ayBVkxrtJKJy23KvRNHTbVdHPJ/ILdothagWroNy1upP7fWAdSuJRSERm5fuVB5sQQL RD/ikCDOc+9YP233Vl4G8nX77B9a3saa3yD7WJJtenhu1giX4/xMPMPNoVgoWBQl/nrV 1sNefjdy0RtGEHRRGOyyBjJGlx74QIzuwub2MVeWi/8yoz1wHZUg/oCi7dLtBuDCzj8U fUJQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1761779844; x=1762384644; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=KscN0CZ7PLDsuKsABSwvdDAP7wORD+N8RXiOdAwJcjc=; b=eulXX7zwWHiujPccCQynVuPB6PxR84+EI/yGXvJ+IUta6Bu7YsGJKTKH1AMNG5rGcU jWaDQFuD8Mn6H1S+kxPfy40UtzLclycbysyBLrPCdhM/u4Jp2ul4IPdDtSy41bYoNdkP XJTGB1bvk/bSiHQljRB4rbvKPWXWrLhobrRIJFGROKzzgUprmTkHrpeGki94/ZOlWGAj 1fj9TWo+vB9ckfL3k1Je56sVD1RjkU1C73xQtmqrG4Mng3YySFItIAIEa6E7Zp9cz+EJ b7Ptn5/GjQX/6uJ16N/hXKFPJ2q12Ijb/PORz7cXvUa9+JkwSDRHySYdlnvE/uZERdsd xE6Q==
X-Forwarded-Encrypted: i=1; AJvYcCXdOU0Trh3/5mlaBKsSI+zIEebU6pD2PIvHjtRc1BDZJrJfuScq1iA0MbbwkCjDQLS6wxI7@irtf.org
X-Gm-Message-State: AOJu0Yyt67X7EChUNfKHt7BvtgteeoJcdxZQMJPgpq18qo4Xne5AZL8x l+NfUY5devu9zGVwufPOhNNQbC/AWZfAVkDW901gGFX3e4WrAwolKq3QPJitIl8ce4SW5MxglDE bRhV8Le/f0LDA/rOM51VxTXUTKmgxK2ZeYeHJ2PsK9g==
X-Gm-Gg: ASbGncuPp8mrWJkNF6FKyoSuXVr6FUDVNXwEVQcHDnJPFpimjYG8xmXNF23WDvU6Brc /p1cxyAD3LgNGLXE3fh/s4LR90TxVz7W788IUQ5cKduiRoyk3V97b964HkTE0dm8TAkjASqwTha 6CQSp5wh0gVXHhNBt5ORVJLkGOn2x2EnceRmsERGcd9i9SgEkM6ZSZSFDAgL9eGTOxs3XHk4bPa cf0lkI3ViuP3nJpnmUFWePZ2wwbI8rPofTAgdZyQdjIIHixII+8ckKhEw==
X-Google-Smtp-Source: AGHT+IHuoW0rD05I1/L5O9N0moTurw9XQOcN4TWvL1/SWBE9ZNE9TsEro2/6P5yXuptnw5VmTZ7E3OdO3iacYMtdNC0=
X-Received: by 2002:a05:6e02:2149:b0:430:acb1:e785 with SMTP id e9e14a558f8ab-433014d0bb8mr19139615ab.6.1761779843589; Wed, 29 Oct 2025 16:17:23 -0700 (PDT)
MIME-Version: 1.0
References: <CAKZgXHoi88=hETRtacXgph0pscmU4VreGxOHTsEgbecLJT1opQ@mail.gmail.com> <CAJfyev290iHbckqaQJaX4pnySVwnp4_oSfbL1M8JQgji1MQsEg@mail.gmail.com> <CAKZgXHovWwAErpaUcW_KxW0Xx5-0TQT_=SWp9cCf6OZokxeeNQ@mail.gmail.com> <CAKZgXHo-BQzVARL-jxDDA+veXs1ytj-LmDLDWcviH5M8SpDEWg@mail.gmail.com> <CACsn0ckbY3hmLyEymFEEUMPmnP-zJuEZ23kUurZBtczT59O93w@mail.gmail.com> <CAKZgXHpPPQLZzdWnRA-J=WuMryMiKJD-e-ujQgaJWDiadXCYKw@mail.gmail.com> <6205989c-81f2-45e5-837b-ce6217b88b55@app.fastmail.com> <CAH7DV8C9wZZA5xdbjNuuQOSnp5VMEXPyL2K9QxjoUvuWF14AFg@mail.gmail.com> <51e5bc4a83c2b213716dfec19be26152d47d4254.camel@posteo.de> <CAH7DV8CG8mRU3wdmNB7KdEGV5Gmw3BZ=C2aN8kKDxq8d_oy7bw@mail.gmail.com> <CAKZgXHrt-ycivCWWgFn69VBJWpAC35q8tLu-f89ssqSqJtAKmw@mail.gmail.com> <LV9PR21MB4926C7CAFEDC9ACB142EE19E80FAA@LV9PR21MB4926.namprd21.prod.outlook.com> <CAKZgXHqOXN9j4XpM5xv6dk8n-97iKjtJLB4mzFZqwMNv2psb9Q@mail.gmail.com> <36c7122e-176d-4d77-a8d2-592a631892da@app.fastmail.com> <1a8c33a6-ee6e-4fa0-ac2b-63cb054817cc@cryptonext-security.com> <dbd0b661-423d-493f-aaed-9786292c3e7a@app.fastmail.com> <98835253-C91D-442E-96A1-A9D99757B4D1@redhoundsoftware.com> <8144d7d0-20e7-4e0a-91fd-41db62ceff38@app.fastmail.com> <A5AAE6C5-9ED8-4CCB-A32D-C0FE42F07BFC@redhoundsoftware.com> <CH0PR11MB57398DD637B26858B0310D979FFAA@CH0PR11MB5739.namprd11.prod.outlook.com> <CAEEbLAbw6G86uw+UA04ebmcFrtNs7mTS3oRp1A52-Eo8N5TQsQ@mail.gmail.com>
In-Reply-To: <CAEEbLAbw6G86uw+UA04ebmcFrtNs7mTS3oRp1A52-Eo8N5TQsQ@mail.gmail.com>
From: Richard Barnes <rlb@ipv.sx>
Date: Wed, 29 Oct 2025 13:17:12 -1000
X-Gm-Features: AWmQ_bkw5s_FNO1SsjvsJFNeuB2pAQOrnStvgObYwIx5iDXgkhQILVK1EZ_QCPo
Message-ID: <CAL02cgSMeQFKagi4PmEctLr4LhBxt8gc6XEjOXvtWK8---0v4w@mail.gmail.com>
To: Sophie Schmieg <sschmieg=40google.com@dmarc.ietf.org>
Content-Type: multipart/alternative; boundary="000000000000bff75c064254558a"
Message-ID-Hash: DSFFZBWETNOZITUIN4JWQEQXQ6HAAC4I
X-Message-ID-Hash: DSFFZBWETNOZITUIN4JWQEQXQ6HAAC4I
X-MailFrom: rlb@ipv.sx
X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-cfrg.irtf.org-0; header-match-cfrg.irtf.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header
CC: Mike Ounsworth <Mike.Ounsworth=40entrust.com@dmarc.ietf.org>, Daniel Van Geest <daniel.vangeest@cryptonext-security.com>, "Samuel Lee (ENS/Crypto)" <Samuel.Lee@microsoft.com>, CFRG <cfrg@irtf.org>, "hpke@ietf.org" <hpke@ietf.org>, LAMPS WG <spasm@ietf.org>
X-Mailman-Version: 3.3.9rc6
Precedence: list
Subject: [CFRG] Re: [lamps] Re: Re: [EXTERNAL] Re: [hpke] Re: Re: Re: Re: Cross-testing update on LAMPS Composite and cfrg-concrete-hybrid-kems
List-Id: Crypto Forum Research Group <cfrg.irtf.org>
Archived-At: <https://mailarchive.ietf.org/arch/msg/cfrg/b_5l32c6XyPrGYfkBrv1mTKxNCI>
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>
If folks care about what labels are used, I'm running a quick poll trying to bring the CFRG discussion to a close. Come chose your favorite color of bikeshed paint! https://app.sli.do/event/g9nesbb6yuYJPbwqKm6a5z passcode: hqeyst On Wed, Oct 29, 2025 at 12:08 PM Sophie Schmieg <sschmieg= 40google.com@dmarc.ietf.org> wrote: > My spicy hot take on the backslash is that anyone implementing > cryptographic code should probably know how to produce exact byte patterns > to appear in their language of choice, whether that is done via hex > encoding, via escape characters, base64, or via oring together a bunch of > left shifted 1s, I leave to the implementer, but exact control over bit > patterns is important for many cryptographic algorithms, whether that is > due to ASCII art or because certain polynomials happening to be irreducible > of GF(2). > > On Wed, Oct 29, 2025 at 1:32 PM Mike Ounsworth <Mike.Ounsworth= > 40entrust.com@dmarc.ietf.org> wrote: > >> Hi Filippo, what's NOT bikeshedding is that the community has been very >> clear that the HPKE and hybrid KEM documents need to be aligned and >> interoperate so that crypto libs only need to implement one primitive. That >> means choosing the same labels. I thought we had agreed to the HPKE style >> labels with the SHAKE256 removed. >> >> The LAMPS document went into WGLC on Oct 17 under that assumption. That >> AFTER THAT you went and changed to more stupid spaceships. >> >> That's not bikeshedding, that's intentionally breaking intorop with the >> LAMPS doc after it entered WGLC. >> >> --- >> Mike Ounsworth >> ------------------------------ >> *From:* Carl Wallace <carl@redhoundsoftware.com> >> *Sent:* Wednesday, October 29, 2025 2:59:03 PM >> *To:* Filippo Valsorda <filippo@ml.filippo.io>; Daniel Van Geest < >> daniel.vangeest@cryptonext-security.com>; Mike Ounsworth < >> ounsworth+ietf@gmail.com>; Samuel Lee (ENS/Crypto) < >> Samuel.Lee@microsoft.com> >> *Cc:* CFRG <cfrg@irtf.org>; hpke@ietf.org <hpke@ietf.org>; LAMPS WG < >> spasm@ietf.org> >> *Subject:* [lamps] Re: [CFRG] Re: [EXTERNAL] Re: [hpke] Re: Re: Re: Re: >> Cross-testing update on LAMPS Composite and cfrg-concrete-hybrid-kems >> >> Inline. . From: Filippo Valsorda <filippo@ ml. filippo. io> Date: >> Wednesday, October 29, 2025 at 3: 49 PM To: Carl Wallace <carl@ >> redhoundsoftware. com>, Daniel Van Geest <daniel. vangeest@ >> cryptonext-security. com>, Mike Ounsworth <ounsworth+ietf@ gmail. com>, >> >> Inline.. >> >> >> >> *From: *Filippo Valsorda <filippo@ml.filippo.io> >> *Date: *Wednesday, October 29, 2025 at 3:49 PM >> *To: *Carl Wallace <carl@redhoundsoftware.com>, Daniel Van Geest < >> daniel.vangeest@cryptonext-security.com>, Mike Ounsworth < >> ounsworth+ietf@gmail.com>, "Samuel Lee (ENS/Crypto)" < >> Samuel.Lee@microsoft.com> >> *Cc: *CFRG <cfrg@irtf.org>, "hpke@ietf.org" <hpke@ietf.org>, LAMPS WG < >> spasm@ietf.org> >> *Subject: *Re: [lamps] Re: [CFRG] Re: [EXTERNAL] Re: [hpke] Re: Re: Re: >> Re: Cross-testing update on LAMPS Composite and cfrg-concrete-hybrid-kems >> >> >> >> <snip> >> >> >> >> [CW] Some of these labels changed in an update published on October 20: >> https://author-tools.ietf.org/iddiff?url1=draft-irtf-cfrg-concrete-hybrid-kems-00&url2=draft-irtf-cfrg-concrete-hybrid-kems-01&difftype=--html >> <https://urldefense.com/v3/__https://author-tools.ietf.org/iddiff?url1=draft-irtf-cfrg-concrete-hybrid-kems-00&url2=draft-irtf-cfrg-concrete-hybrid-kems-01&difftype=--html__;!!FJ-Y8qCqXTj2!eFcmIFtPoVBOI1Xrw8NUJlvYnkOdBWEF_x21kJZ0hfPPeOMg0Bx5vpsXEOeqqV7OINWKvlRwLRpDIuBTkQ37KUDSKvai_P0$>. >> So that’s 9 days ago. It hardly seems earth shattering to revert those >> changes in an update when the publication window reopens. >> >> >> >> No, the ML-KEM-768 + X25519 one has been in use for months, e.g. in >> https://developer.apple.com/documentation/cryptokit/xwingmlkem768x25519 >> <https://urldefense.com/v3/__https://developer.apple.com/documentation/cryptokit/xwingmlkem768x25519__;!!FJ-Y8qCqXTj2!eFcmIFtPoVBOI1Xrw8NUJlvYnkOdBWEF_x21kJZ0hfPPeOMg0Bx5vpsXEOeqqV7OINWKvlRwLRpDIuBTkQ37KUDS8lP9zWY$> and >> I believe in Google's Tink. >> >> >> >> [CW] Hence my use of the words “some of the labels”. I understand that * >> *one** of the labels was defined earlier. That can be seen in the diff I >> provided a link to, along with indications that other labels just changed, >> including the one Dan references below. >> >> >> >> FWIW, I did use the provided hex as you suggest rather than deal with >> escaping the string but really don’t see why we’d torture ourselves like >> this. Recall there was pushback to using (more relevant) DER encoded OIDs >> as too cumbersome and those had exactly the same “just use the hex” >> property you cite above. >> >> >> >> 2025-10-29 18:06 GMT+01:00 Daniel Van Geest <daniel.vangees >> <https://urldefense.com/v3/__http://daniel.vangees__;!!FJ-Y8qCqXTj2!eFcmIFtPoVBOI1Xrw8NUJlvYnkOdBWEF_x21kJZ0hfPPeOMg0Bx5vpsXEOeqqV7OINWKvlRwLRpDIuBTkQ37KUDSayiSZN4$> >> t@cryptonext-security.com >> <https://urldefense.com/v3/__http://cryptonext-security.com__;!!FJ-Y8qCqXTj2!eFcmIFtPoVBOI1Xrw8NUJlvYnkOdBWEF_x21kJZ0hfPPeOMg0Bx5vpsXEOeqqV7OINWKvlRwLRpDIuBTkQ37KUDSBLS5GrE$> >> >: >> >> Is it bikeshedding the labels by pointing out that by using common escape >> characters (\) in the label you are virtually guaranteeing implementations >> make a difficult to detect interoperability mistake? >> >> In fact, they screwed it up themselves IN THEIR OWN DRAFT! >> >> - Label: ` | /-` (0x207C202F2D5C) >> >> no Thanks, >> Daniel >> >> >> >> On 2025-10-29 10:06 a.m., Filippo Valsorda wrote: >> >> Hi Mike, >> >> >> >> I have some good news: as of >> https://github.com/cfrg/draft-irtf-cfrg-concrete-hybrid-kems/pull/28 >> <https://urldefense.com/v3/__https://github.com/cfrg/draft-irtf-cfrg-concrete-hybrid-kems/pull/28__;!!FJ-Y8qCqXTj2!eFcmIFtPoVBOI1Xrw8NUJlvYnkOdBWEF_x21kJZ0hfPPeOMg0Bx5vpsXEOeqqV7OINWKvlRwLRpDIuBTkQ37KUDSKdQC3rc$> the >> CFRG labels don't include "SHAKE256" anymore! >> >> >> >> See also https://github.com/cfrg/draft-irtf-cfrg-hybrid-kems/issues/77 >> <https://urldefense.com/v3/__https://github.com/cfrg/draft-irtf-cfrg-hybrid-kems/issues/77__;!!FJ-Y8qCqXTj2!eFcmIFtPoVBOI1Xrw8NUJlvYnkOdBWEF_x21kJZ0hfPPeOMg0Bx5vpsXEOeqqV7OINWKvlRwLRpDIuBTkQ37KUDSgC24B2c$> for >> the discussion on whether different keygens should interoperate, which >> concluded we should allow it. >> >> >> >> As an implementer, please please please don't ship similarly shaped >> hybrids with the same components that don't interoperate. (Also, pretty >> please, let's not bikeshed the labels unless absolutely necessary, it's >> been 14 months since FIPS 203, I need a stable P-256 hybrid for age >> hardware keys.) >> >> >> >> Cheers, >> >> Filippo >> >> >> >> 2025-10-29 02:59 GMT+01:00 Mike Ounsworth <ounsworth+ietf@gmail.com>: >> >> Hi Samuel, I believe this question is still up for debate. The labels are >> different because the concrete CFRG draft uses a combined keygen and >> private key -- ie the stored private key is a single 32 byte seed that you >> have to use SHAKE256 to expand out into an ML-KEM seed and an ECDH seed [1] >> whereas the LAMPS Composite private key conveys the two component private >> keys separately. Currently, the CFRG draft includes "SHAKE256" in the label >> to force Encap() / Decap() incompatibility between things that use >> different KDFs for key expansion from stored private key (or in the case of >> composites, no KDF since no expansion is necessary). The core argument is >> that shared seed private keys have extra MAL-BIND security properties. >> >> >> >> This is an open point of discussion about whether this _should_ be >> represented in the label, or whether this is unrelated to Encap() / Decap() >> compatibility. If you have an opinion on this, now would be a good time to >> voice it. >> >> >> >> >> >> [1] sample code showing re-expanding a combined seed private key: >> https://github.com/lamps-wg/draft-composite-kem/blob/main/src/crossTestCRFGHybridKEM.py#L85 >> <https://urldefense.com/v3/__https://github.com/lamps-wg/draft-composite-kem/blob/main/src/crossTestCRFGHybridKEM.py*L85__;Iw!!FJ-Y8qCqXTj2!eFcmIFtPoVBOI1Xrw8NUJlvYnkOdBWEF_x21kJZ0hfPPeOMg0Bx5vpsXEOeqqV7OINWKvlRwLRpDIuBTkQ37KUDS7_gTo0U$> >> >> >> >> -Mike >> >> >> >> On Tue, Oct 28, 2025, 20:45 Samuel Lee (ENS/Crypto) < >> Samuel.Lee@microsoft.com> wrote: >> >> This is great news! >> >> >> >> For my own understanding, is the intent that the labels are going to >> aligned before both *cfrg-concrete-hybrid-kems* and LAMPS >> *draft-composite-kem* are adopted? >> >> i.e. if one was going to implement a hybrid-kem interface for >> MLKEM768-P256, it would be usable in both HPKE and CMS. >> >> >> >> Best, >> >> Sam >> >> >> ------------------------------ >> >> >> >> >> >> *From:* Mike Ounsworth <ounsworth+ietf@gmail.com> >> *Sent:* 27 October 2025 16:55 >> *To:* CFRG <cfrg@irtf.org>; hpke@ietf.org <hpke@ietf.org>; LAMPS WG < >> spasm@ietf.org> >> *Subject:* [EXTERNAL] [lamps] Re: [hpke] Re: [CFRG] Re: Re: Re: >> Cross-testing update on LAMPS Composite and cfrg-concrete-hybrid-kems >> >> >> >> ounsworth+ietf@gmail.com appears similar to someone who previously sent >> you email, but may not be that person. Learn why this could be a risk >> <https://urldefense.com/v3/__https://aka.ms/LearnAboutSenderIdentification__;!!FJ-Y8qCqXTj2!eFcmIFtPoVBOI1Xrw8NUJlvYnkOdBWEF_x21kJZ0hfPPeOMg0Bx5vpsXEOeqqV7OINWKvlRwLRpDIuBTkQ37KUDSdXCOYYw$> >> >> Hi CFRG, HPKE, and LAMPS, >> >> >> >> After a bit more back-and-forth with Richard about exactly what EC >> private key format he used in his test vectors, WE HAVE INTEROP ON >> MLKEM768+P256!!! >> >> >> >> The secret I was missing was that the ECDH private key in Richard's test >> vectors are the big-endian integer representation of an EC private key, and >> if I just threw that directly into a PKCS8, then it was a valid LAMPS >> Composite private key (plus some other fighting with the python >> cryptography library). That's fine, I'm happy to consider that "achieving >> interop". Richard has submitted a PR >> to draft-irtf-cfrg-concrete-hybrid-kems that would have helped me avoid >> this confusion in the first place. As a bonus, I learned something, thanks >> Richard for helping me through this. >> >> >> >> I'm happy to declare this thread complete: we have proved >> that draft-irtf-cfrg-concrete-hybrid-kems and >> draft-ietf-lamps-pq-composite-kem are cross-compatible up to the label and >> private key encoding, which was the goal. >> >> >> >> >> >> Details of the hacking that I had to do to convert an instance of the >> CFRG test vectors into an instance of the LAMPS test vectors can be found >> here: >> >> >> https://github.com/lamps-wg/draft-composite-kem/blob/main/src/crossTestCRFGHybridKEM.py#L92 >> <https://urldefense.com/v3/__https://github.com/lamps-wg/draft-composite-kem/blob/main/src/crossTestCRFGHybridKEM.py*L92__;Iw!!FJ-Y8qCqXTj2!eFcmIFtPoVBOI1Xrw8NUJlvYnkOdBWEF_x21kJZ0hfPPeOMg0Bx5vpsXEOeqqV7OINWKvlRwLRpDIuBTkQ37KUDSsCndGTE$> >> >> >> >> >> >> On Mon, 27 Oct 2025 at 08:13, Thad Thompson <thad.thompson@gmail.com> >> wrote: >> >> Hey Martin, >> >> > I have to admit, that in my HPKE implementation I did not even notice >> (or have enforced) that X25519 keys generated through other means cannot be >> used. >> >> Is this a MUST requirement? >> >> >> >> No, sorry for the confusion - I don't believe this is the case. As Watson >> pointed out above, key generation is handled pretty well in >> https://datatracker.ietf.org/doc/html/draft-irtf-cfrg-hybrid-kems#section-5.2 >> <https://urldefense.com/v3/__https://datatracker.ietf.org/doc/html/draft-irtf-cfrg-hybrid-kems*section-5.2__;Iw!!FJ-Y8qCqXTj2!eFcmIFtPoVBOI1Xrw8NUJlvYnkOdBWEF_x21kJZ0hfPPeOMg0Bx5vpsXEOeqqV7OINWKvlRwLRpDIuBTkQ37KUDSXcssxd4$> which >> describes the considerations for working without seeds. Also note that this >> isn't in the context of an HPKE spec, but just hybrid KEMs at this point. >> >> >> >> My earlier comment was aimed more generally toward the impression one >> gets from various places is that seed based key generation is a 'should' >> requirement, when it really isn't. For example, >> >> >> https://www.ietf.org/archive/id/draft-irtf-cfrg-concrete-hybrid-kems-01.html#section-3.1.1-7 >> <https://urldefense.com/v3/__https://www.ietf.org/archive/id/draft-irtf-cfrg-concrete-hybrid-kems-01.html*section-3.1.1-7__;Iw!!FJ-Y8qCqXTj2!eFcmIFtPoVBOI1Xrw8NUJlvYnkOdBWEF_x21kJZ0hfPPeOMg0Bx5vpsXEOeqqV7OINWKvlRwLRpDIuBTkQ37KUDSDXbzS_E$> >> specifies: >> >> >> >> > A hybrid KEM using these curves MUST specify the PRG that should be >> used. All of the hybrid KEMs in this document use SHAKE256 [FIPS202]. >> >> >> >> Which might make it appear that a PRG (and seed based key generation) is >> required for 'in-production' implementations of the KEM, instead of really >> being a requirement for interop testing. >> >> >> >> Cheers, >> >> -Thad >> >> >> >> >> >> >> >> On Mon, Oct 27, 2025 at 6:04 AM Martin Schanzenbach < >> mschanzenbach@posteo.de> wrote: >> >> Am Mittwoch, dem 22.10.2025 um 07:46 -0500 schrieb Thad Thompson: >> >> > Implementations can obviously always go off-spec for keygen. >> >> >> >> This seems like the heart of the issue. >> >> >> >> Let's say I get my PQ-HPKE library implemented and tested and it works >> fine with all the test vectors. But in prod we're only allowed to use EC >> private keys forged in the fires of Mount Doom. One does not simply tell >> their boss (and customers) "no problem, we'll just go off spec." >> >> >> >> It would go a long way if there were a section clearly explaining the >> security impact of using EC keys generated elsewhere, making it an >> 'in-spec' option. >> >> >> >> Best >> >> -Thad >> >> >> >> +1 >> >> >> >> I have to admit, that in my HPKE implementation I did not even notice (or >> have enforced) that X25519 keys generated through other means cannot be >> used. >> >> Is this a MUST requirement? Where is the reasoning in particlar for >> X25519 and X448? If it is a MUST, somewhere in the document should be an >> explanation on why it is done such that other KEMs can make an informed >> decision how to place limitations on their (private) keys in a similar >> fashion. >> >> >> >> BR >> >> >> >> >> >> >> >> On Tue, Oct 21, 2025 at 6:06 PM Filippo Valsorda <filippo@ml.filippo.io> >> wrote: >> >> >> >> Hi Mike, >> >> >> >> Since this thread is about hybrid KEMs and not HPKE DHKEM, I think you >> are confusing the DeriveKeyPair function of RFC 9180 with the CG framework >> DeriveKeyPair function of draft-irtf-cfrg-hybrid-kems-06, Section 5.5, >> which references the RandomScalar function >> of draft-irtf-cfrg-concrete-hybrid-kems-01, Section 3.1.1. (I also find it >> hard to navigate the split in documents.) >> >> >> >> I have reproduced them below for you. I am certain you can implement them >> with any major cryptography library. There is nothing HPKE-specific about >> them. SP 800-56A, Section 5.6.1.2, only specifies a random key generation >> algorithm (a pretty silly one, IMHO, with the needless "d = c + 1" instead >> of checking "c > 0"), so I am not sure what relevance it has here: there is >> no such thing as a standard library function for SP 800-56A, Section >> 5.6.1.2.{1,2} key *derivation*. If the argument is that no one should be >> allowed to derive ECDH keys from a KDF because NIST doesn't like that, I >> doubt many folks will find that argument persuasive. >> >> >> >> Implementations can obviously always go off-spec for keygen if they need >> to appease a regulator (or e.g. use hardware keys), though! They will still >> interoperate. >> >> >> >> Cheers, >> >> Filippo >> >> >> >> def DeriveKeyPair(seed): >> >> (ek_PQ, ek_T, dk_PQ, dk_T) = expandDecapsKeyG(seed) >> >> return (concat(ek_PQ, ek_T), seed) >> >> def expandDecapsKeyG(seed): >> >> seed_full = PRG(seed) >> >> (seed_PQ, seed_T) = split(KEM_PQ.Nseed, Group_T.Nseed, seed_full) >> >> >> >> (ek_PQ, dk_PQ) = KEM_PQ.DeriveKeyPair(seed_PQ) >> >> dk_T = Group_T.RandomScalar(seed_T) >> >> ek_T = Group_T.Exp(Group_T.g, dk_T) >> >> >> >> return (ek_PQ, ek_T, dk_PQ, dk_T) >> >> def RandomScalar(seed): >> >> state = XOF.Init(seed) >> >> sk = OS2IP(XOF.Read(state, Nscalar)) >> >> while sk == 0 || sk >= order: >> >> sk = OS2IP(XOF.Read(state, Nscalar)) >> >> return (sk, pk(sk)) >> >> (The XOF is SHAKE256, Nseed/Nscalar is 32 for P-256, and 48 for P-384.) >> >> >> >> 2025-10-22 00:31 GMT+02:00 Mike Ounsworth <ounsworth+ietf@gmail.com>: >> >> Hi Watson, >> >> >> >> SP 800-56A section 5.6.1 defines the FIPS-approved ways of deriving a >> ECDH key. You can't derive your keys as described in rfc9180 7.1.3 and >> claim that it is "ECDH" as defined in SP 800-56A, because it isn't. That's >> not a FIPS-allowed way to derive EC keys, and that's the whole story. >> >> >> >> On Tue, 21 Oct 2025 at 14:23, Watson Ladd <watsonbladd@gmail.com> wrote: >> >> On Tue, Oct 21, 2025 at 12:14 PM Mike Ounsworth >> >> <ounsworth+ietf@gmail.com> wrote: >> >> > >> >> > Follow-up: I see that DHKEM.DeriveKeyPair(ikm) is defined in RFC9180: >> >> > https://datatracker.ietf.org/doc/html/rfc9180#derive-key-pair >> <https://urldefense.com/v3/__https://datatracker.ietf.org/doc/html/rfc9180*derive-key-pair__;Iw!!FJ-Y8qCqXTj2!eFcmIFtPoVBOI1Xrw8NUJlvYnkOdBWEF_x21kJZ0hfPPeOMg0Bx5vpsXEOeqqV7OINWKvlRwLRpDIuBTkQ37KUDSLtKS3Ig$> >> >> > >> >> > That makes liberal use of HPKE's LabelledExtract(), which fully >> explains why this is not compatible with the python API. >> >> > >> >> > That means that a seed-based key derivation is defined for P-256, >> P-384, and P-521, but only within the confines of the DHKEM primitive >> within the HPKE protocol. It is still the case that a seed-based key >> derivation is not defined for ECDH in general. >> >> > >> >> > So, on that grounds, I object to draft-irtf-cfrg-concrete-hybrid-kems >> RECOMMENDING a seed-based priv on exactly the same grounds that anyone else >> would object to it RECOMMENDING an ASN.1 based encoding: this is a CFRG >> document that normatively depends on a building block that only exists in >> one single IETF protocol, and most importantly to me, does not exist in >> FIPS or current cryptographic libraries. >> >> >> >> I don't understand: HKDF (or the underlying hash function worst case) >> >> absolutely does exist in current cryptographic libraries. If the >> >> argument is that a private key generated one way won't work when moved >> >> to a different system, that's a slightly different matter. >> >> >> >> > >> >> > On Tue, 21 Oct 2025 at 13:34, Mike Ounsworth <ounsworth+ietf@gmail.com> >> wrote: >> >> >> >> >> >> Hi CFRG and HPKE, >> >> >> >> >> >> I just want to give an update on this. Richard and I did some more >> cross-testing this week, and we are at an impasse on the SEC-P curves, and >> it has to do with the seeds. The CFRG /HPKE draft stores the hybrid private >> keys as a seed, so you have to re-derive the P256 half from a seed. My >> problem is that ECDH is a thing that has been standardized for like 20 >> years in [SEC1] and [SP.800-56A], and those two documents do not specify or >> allow a seed-based EC keygen, and as a consequence, many crypto libraries >> don't support a seed-based EC keygen API. For example, I'm doing my >> reference implementation for Composites on top of the core python >> cryptography library, and I cannot implement the CRFG / HPKE draft that >> way. Python crypto has this: >> >> >> >> https://cryptography.io/en/latest/hazmat/primitives/asymmetric/ec/#cryptography.hazmat.primitives.asymmetric.ec.derive_private_key >> <https://urldefense.com/v3/__https://cryptography.io/en/latest/hazmat/primitives/asymmetric/ec/*cryptography.hazmat.primitives.asymmetric.ec.derive_private_key__;Iw!!FJ-Y8qCqXTj2!eFcmIFtPoVBOI1Xrw8NUJlvYnkOdBWEF_x21kJZ0hfPPeOMg0Bx5vpsXEOeqqV7OINWKvlRwLRpDIuBTkQ37KUDSFP4Myto$> >> >> >> but that appears to not derive the same keys as Richard's >> implementation. >> >> >> >> >> >> The issue is that EC.derive_priv_from_seed() is not a standardized >> function. You can probably infer from a careful read of [SEC1] or >> [SP.800-56A] what it needs to be, but it is not actually standardized or >> FIPS-allowed. It requires mucking around with EC point multiplication. The >> fact that it's not a standardized thing means that I will likely not be the >> last person to have interop problems with this. Maybe my issues are as >> simple as not using that python ec.derive_private_key() properly, maybe his >> scalar is 'big' rather than 'little' or something. If that's the case, I'd >> be happy -- but this is the kind of mess you get into when you use >> non-standardized APIs for existing 20 year-old primitives. >> >> >> >> >> >> So at this point, I think we have to declare non-compatibility between >> LAMPS and HPKE Hybrid KEMs. Since our X-Wings are compatible, we know that >> our QSF frameworks are identical, so in principle our P256's should work >> too, but we're been incapable of testing it because this off-spec seed >> stuff is getting in the way. >> >> >> >> >> >> On Thu, 16 Oct 2025 at 17:40, Tushar Patel <tjpatel.tl@gmail.com> >> wrote: >> >> >>> >> >> >>> Sorry, jumping in a running train and >> >> >>> many years ago while working through JSON bindings for the tests, I >> ran into a sign bit conversion error on big numbers and had to rewrite part >> of the library, the fixed code is with a previous employer, 64-bit and >> 128-bit in JSON libs are a mess or sign bit issues in general. >> >> >>> >> >> >>> Also, please make sure that you are parsing the compressed notations >> for ECC correctly, some libraries pack those incorrectly and also wrote my >> own ASN.1 parsers for some elements, you might be surprised where I hit >> these areas, can’t disclose, though both were from reputed organizations. >> >> >>> >> >> >>> Last, please make sure you have matching generators and incorporate >> the affine and infinity checks, these may translate to all sorts of weird >> issues that are impossible to debug through OSS macros in most cases. >> >> >>> >> >> >>> There is substandard ECC, ECDSA and ECDHE at many places in OSS libs >> and you may have to debug these. >> >> >>> >> >> >>> Personally, I think NIST should mandate pristine implementations as >> companies spend a lot more time fixing other implementations than their own. >> >> >>> >> >> >>> Hope it’s Useful, >> >> >>> Tushar >> >> >>> >> >> >>> On Thu, Oct 16, 2025 at 8:45 AM Mike Ounsworth < >> ounsworth+ietf@gmail.com> wrote: >> >> >>>> >> >> >>>> Thanks Filippo, >> >> >>>> >> >> >>>> Richard and I did some debugging last night. He gave me new test >> vectors that include that bug fix to the P256 / P384 constants. >> >> >>>> >> >> >>>> My current theory is that the code I quickly whipped up to do a P256 >> private key expansion from seed does not match Richard's. Since this is >> wholly out of scope for LAMPS Composite (we store the full P256 private >> key), I'm hoping that Richard can give me a dump of intermediate values >> that includes the expanded P256 / P384 private key so that we don't need to >> debug through the P256-from-seed stuff. Anyway, this is all good validation >> of both our test vectors. >> >> >>>> >> >> >>>> Anyway, making progress! >> >> >>>> >> >> >>>> On Thu, 16 Oct 2025 at 10:29, Filippo Valsorda < >> filippo@ml.filippo.io> wrote: >> >> >>>>> >> >> >>>>> 2025-10-16 03:55 GMT+02:00 Mike Ounsworth <ounsworth+ietf@gmail.com >> >: >> >> >>>>> >> >> >>>>> Results: we are cross-compatible on X-Wing, but not on P256 (and >> that's after hacking my script to use the CFRG label not the LAMPS label, >> so there's clearly some other bug at play, but I have no idea what, so of >> course I assume it's on the cfrg reference impl side 😋). >> >> >>>>> >> >> >>>>> >> >> >>>>> Could be >> https://github.com/cfrg/draft-irtf-cfrg-concrete-hybrid-kems/pull/21 >> <https://urldefense.com/v3/__https://github.com/cfrg/draft-irtf-cfrg-concrete-hybrid-kems/pull/21__;!!FJ-Y8qCqXTj2!eFcmIFtPoVBOI1Xrw8NUJlvYnkOdBWEF_x21kJZ0hfPPeOMg0Bx5vpsXEOeqqV7OINWKvlRwLRpDIuBTkQ37KUDSjLO7N4M$> >> . >> >> >>>> >> >> >>>> _______________________________________________ >> >> >>>> CFRG mailing list -- cfrg@irtf.org >> >> >>>> To unsubscribe send an email to cfrg-leave@irtf.org >> >> > >> >> > _______________________________________________ >> >> > Spasm mailing list -- spasm@ietf.org >> >> > To unsubscribe send an email to spasm-leave@ietf.org >> >> >> >> >> >> >> >> -- >> >> Astra mortemque praestare gradatim >> >> >> >> _______________________________________________ >> >> CFRG mailing list -- cfrg@irtf.org >> >> To unsubscribe send an email to cfrg-leave@irtf.org >> >> _______________________________________________ >> >> CFRG mailing list -- cfrg@irtf.org >> >> To unsubscribe send an email to cfrg-leave@irtf.org >> >> >> >> >> >> _______________________________________________ >> >> hpke mailing list -- hpke@ietf.org >> >> To unsubscribe send an email to hpke-leave@ietf.org >> >> _______________________________________________ >> >> CFRG mailing list -- cfrg@irtf.org >> >> To unsubscribe send an email to cfrg-leave@irtf.org >> >> >> >> >> >> >> >> _______________________________________________ >> >> CFRG mailing list -- cfrg@irtf.org >> >> To unsubscribe send an email to cfrg-leave@irtf.org >> >> >> >> _______________________________________________ Spasm mailing list -- >> spasm@ietf.org To unsubscribe send an email to spasm-leave@ietf.org >> >> >> *Any email and files/attachments transmitted with it 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.* >> >> _______________________________________________ >> Spasm mailing list -- spasm@ietf.org >> To unsubscribe send an email to spasm-leave@ietf.org >> > > > -- > > Sophie Schmieg | Information Security Engineer | ISE Crypto | > sschmieg@google.com > > _______________________________________________ > CFRG mailing list -- cfrg@irtf.org > To unsubscribe send an email to cfrg-leave@irtf.org >
- [CFRG] Cross-testing update on LAMPS Composite an… Mike Ounsworth
- [CFRG] Re: Cross-testing update on LAMPS Composit… Filippo Valsorda
- [CFRG] Re: Cross-testing update on LAMPS Composit… Mike Ounsworth
- [CFRG] Re: Cross-testing update on LAMPS Composit… Tushar Patel
- [CFRG] Re: Cross-testing update on LAMPS Composit… Mike Ounsworth
- [CFRG] Re: Cross-testing update on LAMPS Composit… Mike Ounsworth
- [CFRG] Re: [lamps] Re: Re: Cross-testing update o… Watson Ladd
- [CFRG] Re: [EXTERNAL] [lamps] Re: Re: Cross-testi… Mike Ounsworth
- [CFRG] Re: [EXTERNAL] [lamps] Re: Re: Cross-testi… Watson Ladd
- [CFRG] Re: [EXTERNAL] [lamps] Re: Re: Cross-testi… Tushar Patel
- [CFRG] Re: [EXTERNAL] [lamps] Re: Re: Cross-testi… Mike Ounsworth
- [CFRG] Re: [EXTERNAL] [lamps] Re: Re: Cross-testi… Tushar Patel
- [CFRG] Re: [EXTERNAL] [lamps] Re: Re: Cross-testi… Mike Ounsworth
- [CFRG] Re: [hpke] Re: [EXTERNAL] [lamps] Re: Re: … Sophie Schmieg
- [CFRG] Re: [hpke] Re: [EXTERNAL] [lamps] Re: Re: … Sophie Schmieg
- [CFRG] Re: [hpke] Re: [EXTERNAL] [lamps] Re: Re: … Watson Ladd
- [CFRG] Re: [hpke] Re: [EXTERNAL] [lamps] Re: Re: … Sophie Schmieg
- [CFRG] Re: [EXTERNAL] [lamps] Re: Re: Cross-testi… Watson Ladd
- [CFRG] Re: [lamps] Re: Re: Cross-testing update o… Mike Ounsworth
- [CFRG] Re: [lamps] Re: Re: Cross-testing update o… Filippo Valsorda
- [CFRG] Re: [lamps] Re: Re: Cross-testing update o… Thad Thompson
- [CFRG] Re: [lamps] Re: Re: Cross-testing update o… Martin Schanzenbach
- [CFRG] Re: [lamps] Re: Re: Cross-testing update o… Thad Thompson
- [CFRG] Re: [hpke] Re: Re: [lamps] Re: Re: Cross-t… Mike Ounsworth
- [CFRG] Re: [EXTERNAL] [lamps] Re: [hpke] Re: Re: … Samuel Lee (ENS/Crypto)
- [CFRG] Re: [EXTERNAL] [lamps] Re: [hpke] Re: Re: … Mike Ounsworth
- [CFRG] Re: [EXTERNAL] [lamps] Re: [hpke] Re: Re: … Filippo Valsorda
- [CFRG] Re: [lamps] Re: Re: [EXTERNAL] Re: [hpke] … Mike Ounsworth
- [CFRG] Re: [EXTERNAL] [lamps] Re: [hpke] Re: Re: … Daniel Van Geest
- [CFRG] Re: [EXTERNAL] [lamps] Re: [hpke] Re: Re: … Filippo Valsorda
- [CFRG] Re: [lamps] Re: Re: [EXTERNAL] Re: [hpke] … Carl Wallace
- [CFRG] Re: [lamps] Re: Re: [EXTERNAL] Re: [hpke] … Filippo Valsorda
- [CFRG] Re: [lamps] Re: Re: [EXTERNAL] Re: [hpke] … Carl Wallace
- [CFRG] Re: [lamps] Re: Re: [EXTERNAL] Re: [hpke] … Mike Ounsworth
- [CFRG] Re: [lamps] Re: Re: [EXTERNAL] Re: [hpke] … Sophie Schmieg
- [CFRG] Re: [lamps] Re: Re: [EXTERNAL] Re: [hpke] … Richard Barnes
- [CFRG] Re: [lamps] Re: Re: [EXTERNAL] Re: [hpke] … Richard Barnes
- [CFRG] Re: [lamps] Re: Re: [EXTERNAL] Re: [hpke] … Nick Sullivan
- [CFRG] Re: [lamps] Re: Re: [EXTERNAL] Re: [hpke] … Filippo Valsorda
- [CFRG] Re: [lamps] Re: Re: Re: Re: [EXTERNAL] Re:… Christopher Patton
- [CFRG] Re: [lamps] Re: Re: Re: Re: [EXTERNAL] Re:… Dennis Jackson
- [CFRG] Re: [lamps] Re: Re: [EXTERNAL] Re: [hpke] … Nick Sullivan
- [CFRG] Re: [lamps] Re: Re: Re: Re: [EXTERNAL] Re:… Dennis Jackson
- [CFRG] Re: [hpke] Re: [lamps] Re: Re: Re: Re: [EX… Dennis Jackson
- [CFRG] Re: [hpke] Re: [lamps] Re: Re: Re: Re: [EX… Nick Sullivan
- [CFRG] Re: [hpke] Re: [lamps] Re: Re: Re: Re: [EX… Deirdre Connolly
- [CFRG] Re: [hpke] Re: [lamps] Re: Re: Re: Re: [EX… Filippo Valsorda
- [CFRG] Re: [lamps] Re: Re: [EXTERNAL] Re: [hpke] … Richard Barnes
- [CFRG] Re: [lamps] Re: Re: Re: Re: [EXTERNAL] Re:… David Benjamin
- [CFRG] Re: [lamps] Re: Re: Re: Re: [EXTERNAL] Re:… Deirdre Connolly
- [CFRG] Re: [lamps] Re: Re: Re: Re: [EXTERNAL] Re:… Sophie Schmieg
- [CFRG] Re: [lamps] Re: Re: Re: Re: [EXTERNAL] Re:… Nick Sullivan
- [CFRG] Re: [hpke] [lamps] Re: Re: Re: Re: [EXTERN… Christopher Wood
- [CFRG] Re: [lamps] Re: [hpke] Re: Re: Re: Re: [EX… John Gray
- [CFRG] Re: [lamps] Re: Re: Re: Re: [EXTERNAL] Re:… Damien Miller
- [CFRG] Re: [lamps] Re: Re: Re: Re: [EXTERNAL] Re:… Nick Sullivan
- [CFRG] Re: [lamps] Re: Re: Re: Re: [EXTERNAL] Re:… Hale, Britta (CIV)
- [CFRG] Re: [lamps] Re: Re: Re: Re: [EXTERNAL] Re:… Nick Sullivan
- [CFRG] Re: [lamps] Re: Re: [EXTERNAL] Re: [hpke] … Natanael
- [CFRG] Re: [lamps] Re: Re: Re: Re: [EXTERNAL] Re:… Watson Ladd
- [CFRG] Re: [lamps] Cross-testing update on LAMPS … John Mattsson