Return-Path: <orie@transmute.industries>
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 B9952C14F5E5
	for <cfrg@ietfa.amsl.com>; Tue, 28 May 2024 07:19:58 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.075
X-Spam-Level: 
X-Spam-Status: No, score=-2.075 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,
	RCVD_IN_ZEN_BLOCKED_OPENDNS=0.001, SPF_HELO_NONE=0.001,
	SPF_PASS=-0.001, T_KAM_HTML_FONT_INVALID=0.01, T_REMOTE_IMAGE=0.01,
	URIBL_BLOCKED=0.001, 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=transmute.industries
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 ypq0TpbtDrPB for <cfrg@ietfa.amsl.com>;
	Tue, 28 May 2024 07:19:54 -0700 (PDT)
Received: from mail-pl1-x633.google.com (mail-pl1-x633.google.com
 [IPv6:2607:f8b0:4864:20::633])
	(using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)
	 key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest
 SHA256)
	(No client certificate requested)
	by ietfa.amsl.com (Postfix) with ESMTPS id 7FCCFC14F5F5
	for <cfrg@irtf.org>; Tue, 28 May 2024 07:19:54 -0700 (PDT)
Received: by mail-pl1-x633.google.com with SMTP id
 d9443c01a7336-1f082d92864so6679735ad.1
        for <cfrg@irtf.org>; Tue, 28 May 2024 07:19:54 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=transmute.industries; s=google; t=1716905994; x=1717510794;
 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=TqlyckG6Jo+Gw/YPlF1HcAMpYtQmPhz6RaJE/FiHECQ=;
        b=BM/X1fqlljiIFGLRwhOSw46ocMN2uuaawjOkikT5coVJLshZSBCf+rsEGnghpMsa1u
         lUi8blmIv9T8zuAFrLPiIRdtDZu55byMOdjpDNA2qO9RXQZeKEdSO0QW3W6IECqHAYrZ
         zWjLNkEEFDbfmk/HlWk4cAl8nAFBl97t7EMZb433RLBI2Cbk3o8CuGRipJBdbexp90gw
         3skGlqvdl9WBKrYssPOvtNR2PeKt97DdpGncId5vouVwb14fme14pXQ9yVi5VgONEkg1
         SVFkYe64H19w3e5mECHobMqA7OZOstdaQ5hgYGQqCdbCf28sNcM6KwiyUThR9JzPJCwK
         28qg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1716905994; x=1717510794;
        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=TqlyckG6Jo+Gw/YPlF1HcAMpYtQmPhz6RaJE/FiHECQ=;
        b=W1Mm+BfmFtCLjuVQN9feu3/DeVh0rtsHxsAVFNA/uRnDflbCUElfmw9GLe0cPLydXt
         K9YIDFGJoQy1SjUIN1OEgadGHFe4GVPQe92vjH07+Rq325iZQlPTZzVHy2DnlsV673ZH
         Ww+otjsKz9V2AardmGs1CHVBCOPiY1NIDrfgz1yK0DbHWRBu3YYYIUdYQmkIeOMvSMEP
         0BHAFty4SHyhFYy7GcC6lpxFkYwCiyfK78GCKjb+7HgrzTQdOv1MQsz3CeTCrN4KjSN0
         2l70guNONdQk9C2ToeY2Hw9h20pc5mjQ/F8YopbHOAtcKhV8bzNoR9bnaxQoE+a9/Q3Y
         SsZQ==
X-Gm-Message-State: AOJu0YzgcRXgTV+vVof7XPtCX0rWiyjw+A1KoEsxRSDExmNAEriI/aTb
	lRPPbJDi5H6u2Wp3/MAadtwdVCZvHT5tJoJQRhf0Pk3ahl4EtvuyzeHuj/hYwOH4wXveFNrsVmW
	Y7dr9GKhGi/5KhgPxsJU47H4xUIcb0xZ0wZotmg==
X-Google-Smtp-Source: 
 AGHT+IFwcF2qeAhcE1pTeX1Pmr7rv9IUsey6BHsW2yrnh3xroISHT4FSkizrQRv5JyToWkRAtAKdl4dB3yikZQhDrIM=
X-Received: by 2002:a17:902:f687:b0:1f3:5346:35f4 with SMTP id
 d9443c01a7336-1f44873dd4dmr130657225ad.35.1716905993617; Tue, 28 May 2024
 07:19:53 -0700 (PDT)
MIME-Version: 1.0
References: 
 <CAN8C-_LqcWy=d=6KkVCwfOs28nZugzbTjHYPNOAchs5E_EWHiw@mail.gmail.com>
 <CAMjbhoVE+44ZnOB4s3Vk3MF26w7gWaodU0AmP9YO6utXZX5_1g@mail.gmail.com>
In-Reply-To: 
 <CAMjbhoVE+44ZnOB4s3Vk3MF26w7gWaodU0AmP9YO6utXZX5_1g@mail.gmail.com>
From: Orie Steele <orie@transmute.industries>
Date: Tue, 28 May 2024 09:19:41 -0500
Message-ID: 
 <CAN8C-_KGXmBJqYvu2RW6U5TAvVEp_3z+XkMCjeAwPcKNFO1saA@mail.gmail.com>
To: Bas Westerbaan <bas@cloudflare.com>
Content-Type: multipart/alternative; boundary="000000000000dcde5c0619845304"
Message-ID-Hash: BUBXJEDUG6KLXTQMSSJTL6KQ2HEYQBE6
X-Message-ID-Hash: BUBXJEDUG6KLXTQMSSJTL6KQ2HEYQBE6
X-MailFrom: orie@transmute.industries
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>,
 Deirdre Connolly <deirdre.connolly@sandboxquantum.com>
X-Mailman-Version: 3.3.9rc4
Precedence: list
Subject: =?utf-8?q?=5BCFRG=5D_Re=3A_PQ_HPKE_in_JOSE_and_COSE_with_ML-KEM-768=2C_HKDF-?=
	=?utf-8?q?SHA256=2C_AES128GCM?=
List-Id: Crypto Forum Research Group <cfrg.irtf.org>
Archived-At: 
 <https://mailarchive.ietf.org/arch/msg/cfrg/-9zvWbPLupa-YIrCZvPGr2kHPaI>
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>

--000000000000dcde5c0619845304
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

If I'm reading the pqc-forum correctly, the domain separation applies to
KeyGen only (which is before HPKE).

Meaning that the parts of test vectors after KeyGen would remain unchanged?

Or are you suggesting there will be HPKE ML-KEM domain separation from
regular ML-KEM?

I'm mostly interested in what parts of HPKE ML-KEM will change, assuming
ML-KEM is a black box that will eventually become immutable.

Ideally, I'd be able to confirm compatibility, prior to the keygen domain
separation being added to FIPS 203 and FIPS 204.

Also, I'm prototyping with TypeScript because that's what's easiest for me
to generate examples for drafts.

I agree with all the normal cautions about doing crypto in javascript.

Regards,

OS

On Tue, May 28, 2024 at 7:31=E2=80=AFAM Bas Westerbaan <bas@cloudflare.com>=
 wrote:

> Some replies inline.
>
> I based my HPKE KEM implementation on ML-KEM-768 in
>> https://github.com/paulmillr/noble-post-quantum
>>
>
> A word of caution that this implementation is not constant time. (It's
> very difficult in javascript anyway, but a warning is in place.)
>
>
>> This meant I needed to address both the HPKE and COSE / JOSE related
>> context issues myself.
>> It was not obvious to me exactly how to do this.
>> Especially since there is no registry entries for ML-KEM in:
>> https://www.iana.org/assignments/hpke/hpke.xhtml
>> The answer appears to be in this draft:
>> https://datatracker.ietf.org/doc/html/draft-connolly-cfrg-hpke-mlkem-00#=
name-encap-and-decap
>> I've done my best to follow the draft, in my experimental implementation=
.
>>
>> Are there implementations of HPKE out there using kem id 0x0070?
>>
>> Are we waiting on some final confirmation from NIST to add 0x0070 to
>> https://www.iana.org/assignments/hpke/hpke.xhtml ?
>> I can understand not wanting to burn a code point.
>>
>
> ML-KEM is not final yet. What people call ML-KEM now is typically the
> "ipd", the initial public draft. HPKE KEMs test vectors typically include
> deterministic key generation, and it seems likely [1]  that that will
> change for the final version of ML-KEM.
>
> Best,
>
>  Bas
>
> [1]
> https://groups.google.com/a/list.nist.gov/g/pqc-forum/c/5CT4NC_6zRI/m/KyF=
x0sapAgAJ
>


--=20


ORIE STEELE
Chief Technology Officer
www.transmute.industries

<https://transmute.industries>

--000000000000dcde5c0619845304
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">If I&#39;m reading the pqc-forum correctly, the domain sep=
aration=C2=A0applies to KeyGen only (which is before HPKE).<br><br>Meaning =
that the parts of test vectors after KeyGen=C2=A0would remain unchanged?<br=
><br>Or are you suggesting there will be HPKE ML-KEM domain separation=C2=
=A0from regular ML-KEM?<br><br>I&#39;m mostly interested in what parts of H=
PKE ML-KEM will change, assuming ML-KEM is a black box that will eventually=
 become immutable.<br><br>Ideally, I&#39;d be able to confirm compatibility=
, prior to the keygen domain separation=C2=A0being added to FIPS 203 and FI=
PS 204.<br><br>Also, I&#39;m prototyping with=C2=A0TypeScript because that&=
#39;s what&#39;s easiest for me to generate examples=C2=A0for drafts.<div><=
br>I agree with all the normal cautions about doing crypto in javascript.<b=
r><br>Regards,<br><br>OS</div></div><br><div class=3D"gmail_quote"><div dir=
=3D"ltr" class=3D"gmail_attr">On Tue, May 28, 2024 at 7:31=E2=80=AFAM Bas W=
esterbaan &lt;<a href=3D"mailto:bas@cloudflare.com">bas@cloudflare.com</a>&=
gt; wrote:<br></div><blockquote class=3D"gmail_quote" style=3D"margin:0px 0=
px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div =
dir=3D"ltr"><div dir=3D"ltr">Some replies inline.</div><br><div class=3D"gm=
ail_quote"><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.=
8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir=3D"lt=
r"><span class=3D"gmail_signature_prefix">I based my HPKE KEM implementatio=
n on ML-KEM-768 in=C2=A0<a href=3D"https://github.com/paulmillr/noble-post-=
quantum" target=3D"_blank">https://github.com/paulmillr/noble-post-quantum<=
/a>=C2=A0<br></span></div></blockquote><div><br></div><div>A word of cautio=
n that this implementation is not constant time. (It&#39;s very difficult i=
n javascript anyway, but a warning is in place.)</div><div>=C2=A0</div><blo=
ckquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left=
:1px solid rgb(204,204,204);padding-left:1ex"><div dir=3D"ltr"><span class=
=3D"gmail_signature_prefix">This meant I needed to address both the HPKE an=
d COSE / JOSE related context issues myself.<br>It was not obvious to me ex=
actly how to do this.<br>Especially since there is no registry entries for =
ML-KEM in:=C2=A0<a href=3D"https://www.iana.org/assignments/hpke/hpke.xhtml=
" target=3D"_blank">https://www.iana.org/assignments/hpke/hpke.xhtml</a><br=
>The answer appears to be in this draft:=C2=A0<a href=3D"https://datatracke=
r.ietf.org/doc/html/draft-connolly-cfrg-hpke-mlkem-00#name-encap-and-decap"=
 target=3D"_blank">https://datatracker.ietf.org/doc/html/draft-connolly-cfr=
g-hpke-mlkem-00#name-encap-and-decap</a><br>I&#39;ve done my best to follow=
 the draft, in my experimental implementation.=C2=A0</span><div><span class=
=3D"gmail_signature_prefix"><br>Are there implementations of HPKE out there=
 using kem id 0x0070?<br><br>Are we waiting on some final confirmation from=
 NIST to add 0x0070 to=C2=A0<a href=3D"https://www.iana.org/assignments/hpk=
e/hpke.xhtml" target=3D"_blank">https://www.iana.org/assignments/hpke/hpke.=
xhtml</a>=C2=A0? <br>I can understand not wanting to burn a code point.</sp=
an></div></div></blockquote><div><br></div><div>ML-KEM is not final yet. Wh=
at people call ML-KEM now is typically the &quot;ipd&quot;, the initial pub=
lic draft. HPKE KEMs test vectors typically include deterministic key gener=
ation, and it seems likely [1]=C2=A0 that that will change for the final ve=
rsion of ML-KEM.</div><div><br></div><div>Best,</div><div><br></div><div>=
=C2=A0Bas</div><div><br></div><div>[1]=C2=A0<a href=3D"https://groups.googl=
e.com/a/list.nist.gov/g/pqc-forum/c/5CT4NC_6zRI/m/KyFx0sapAgAJ" target=3D"_=
blank">https://groups.google.com/a/list.nist.gov/g/pqc-forum/c/5CT4NC_6zRI/=
m/KyFx0sapAgAJ</a></div></div></div>
</blockquote></div><br clear=3D"all"><div><br></div><span class=3D"gmail_si=
gnature_prefix">-- </span><br><div dir=3D"ltr" class=3D"gmail_signature"><d=
iv dir=3D"ltr"><div dir=3D"ltr"><div dir=3D"ltr"><div dir=3D"ltr"><div dir=
=3D"ltr"><span><p dir=3D"ltr" style=3D"line-height:1.38;margin-top:0pt;marg=
in-bottom:0pt"><br></p><p dir=3D"ltr" style=3D"line-height:1.38;margin-top:=
0pt;margin-bottom:0pt;padding:10pt 0pt"><span style=3D"font-size:10pt;font-=
family:Arial;color:rgb(32,18,77);background-color:transparent;font-weight:7=
00;vertical-align:baseline;white-space:pre-wrap">ORIE STEELE</span><span st=
yle=3D"font-size:10pt;font-family:Arial;color:rgb(32,18,77);background-colo=
r:transparent;font-weight:700;vertical-align:baseline;white-space:pre-wrap"=
><br></span><span style=3D"font-size:10pt;font-family:Arial;color:rgb(32,18=
,77);background-color:transparent;vertical-align:baseline;white-space:pre-w=
rap">Chief Technology Officer</span><span style=3D"font-size:10pt;font-fami=
ly:Arial;color:rgb(32,18,77);background-color:transparent;vertical-align:ba=
seline;white-space:pre-wrap"><br></span><span style=3D"font-size:8pt;font-f=
amily:Arial;color:rgb(32,18,77);background-color:transparent;vertical-align=
:baseline;white-space:pre-wrap">www.transmute.industries</span></p><p dir=
=3D"ltr" style=3D"line-height:1.38;margin-top:0pt;margin-bottom:0pt;padding=
:0pt 0pt 10pt"><a href=3D"https://transmute.industries" target=3D"_blank"><=
img width=3D"96" height=3D"22" src=3D"https://ci3.googleusercontent.com/mai=
l-sig/AIorK4xqtkj5psM1dDeDes_mjSsF3ylbEa5EMEQmnz3602cucAIhjLaHod-eVJq0E28Bw=
rivrNSBMBc"></a><br></p></span></div></div></div></div></div></div>

--000000000000dcde5c0619845304--

