Return-Path: <emil@yubico.com>
X-Original-To: cose@ietfa.amsl.com
Delivered-To: cose@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1])
	by ietfa.amsl.com (Postfix) with ESMTP id E86B4C14F70B
	for <cose@ietfa.amsl.com>; Thu,  3 Oct 2024 09:39:20 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.104
X-Spam-Level: 
X-Spam-Status: No, score=-2.104 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_DNSWL_BLOCKED=0.001, RCVD_IN_ZEN_BLOCKED_OPENDNS=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=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key)
	header.d=yubico.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 1zcP2OCg2kar for <cose@ietfa.amsl.com>;
	Thu,  3 Oct 2024 09:39:16 -0700 (PDT)
Received: from mail-wr1-x431.google.com (mail-wr1-x431.google.com
 [IPv6:2a00:1450:4864:20::431])
	(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 ietfa.amsl.com (Postfix) with ESMTPS id 9EAEAC14F6FF
	for <cose@ietf.org>; Thu,  3 Oct 2024 09:39:16 -0700 (PDT)
Received: by mail-wr1-x431.google.com with SMTP id
 ffacd0b85a97d-37ccebd7f0dso857401f8f.1
        for <cose@ietf.org>; Thu, 03 Oct 2024 09:39:16 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=yubico.com; s=google; t=1727973555; x=1728578355; darn=ietf.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=N7zS02Ix+dF4xDGsL9VNXjmQiDPBTgm3+rHclB5z6uo=;
        b=UDpuuvQkC15pIQm/dhEDZz1Ppek6gopUHdZ7CkOhMGegdVDWMqcMWzfAADniTjqeNI
         plGRzOvcK7dSjD4JUlIiFypmQja5DtMoEpRGhkZJ0RGG+sFxHa38sjGU76tO81TwEQV3
         85TwnY8BXeXCSpAvEh7Rr+J1P/NpGBYyXiam5qzVcWP/dNb3GZciwKN3LV1BjS+PngSZ
         SwQuIeXlSLgOMrZBiRt60dvV8v6iieLXspZllVGGkIIO6JU6YHcbs2qmdGgaPwS5WXCD
         +K9jombw/SsQfABuVsWCeOhVAYkoQH/+31tSYj4wNdFTEhKwBriweKvKBotQ+f8+aMHj
         iNUw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1727973555; x=1728578355;
        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=N7zS02Ix+dF4xDGsL9VNXjmQiDPBTgm3+rHclB5z6uo=;
        b=L8vhuW+G968x3E+3g3hC6fcoeR0Cfv82mNKj0RHtpOB+h2uEeXP31a+X9bxApkdMec
         cFidhmMNTVQxUlp5OFkMSq6qg/prCNlIO9Opc1L2HXBY5fzgceVwbP2x5dKZwhnmizLA
         snr9vw/McZwgkdMpmbv+N9rZyDZgm1OstCB9OcwtvxxoSvCzZ693P9RHcpV6VJ9CPW2b
         ssQ3tDZ3h25gJpxYzJLY7iPSr1Xsv/NtLPbfKJ4p2sEwBSGPpr9FtFxh3D+vSnp5IWTv
         Hzafz4IlU007sXWyr3pVSs2hbzYaJIMzjv6dF1rCGx1nq4bDnujdoDDpIJq2A79jM8dR
         4xEg==
X-Gm-Message-State: AOJu0Ywc2ySATa1qlyZ/Bx/5ngkJSCCvg3MVf/+4a5xATWTWPgrX75Mw
	FG/AYHakKFXnW0zgz2RVulHiwVf+T+8P1Ypk+pEh/4S7We62wkU1Pe0PQYY77qFsFgbs732Dj8+
	NR5FphtYA0q3dD2U8ftxpPs8OI9yFNAgytNRJTw==
X-Google-Smtp-Source: 
 AGHT+IHYrKUGClfda9nM45qxZf9fFfdoSduCwrlmtDUYZ9TY3W/dJhIfeU1Q37TGOS9F81kKPDfoP/Engj7lDZb4YPc=
X-Received: by 2002:a5d:5847:0:b0:374:babf:ac4f with SMTP id
 ffacd0b85a97d-37d0e6cb807mr17047f8f.12.1727973554416; Thu, 03 Oct 2024
 09:39:14 -0700 (PDT)
MIME-Version: 1.0
References: 
 <CANMnvkxiVppxz5Pm2dWaMVJTB229kTpw9f8Si-WmY0jkrBP=wg@mail.gmail.com>
 <SJ0PR02MB743976C3214FBB090F2D7D71B7682@SJ0PR02MB7439.namprd02.prod.outlook.com>
In-Reply-To: 
 <SJ0PR02MB743976C3214FBB090F2D7D71B7682@SJ0PR02MB7439.namprd02.prod.outlook.com>
From: Emil Lundberg <emil@yubico.com>
Date: Thu, 3 Oct 2024 18:38:57 +0200
Message-ID: 
 <CANMnvkyxaSzhv+BHBfBiW9oJ4KuOFaVS4Ef3PJnEOFv_iSUbfw@mail.gmail.com>
To: Michael Jones <michael_b_jones@hotmail.com>
Content-Type: multipart/alternative; boundary="000000000000e48ea2062395311b"
Message-ID-Hash: IG5KMUAPEIB4XS7CODAIHYFQWKPLT5EN
X-Message-ID-Hash: IG5KMUAPEIB4XS7CODAIHYFQWKPLT5EN
X-MailFrom: emil@yubico.com
X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency;
 loop; banned-address; member-moderation; header-match-cose.ietf.org-0;
 nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size;
 news-moderation; no-subject; digests; suspicious-header
CC: cose <cose@ietf.org>, "jose@ietf.org" <jose@ietf.org>,
 "mprorock@mesur.io" <mprorock@mesur.io>,
 Orie Steele <orie@transmute.industries>
X-Mailman-Version: 3.3.9rc5
Precedence: list
Subject: =?utf-8?q?=5BCOSE=5D_Re=3A_=5Bjose=5D_Algorithm_identifiers_for_pre-hashing_?=
	=?utf-8?q?in_two-party_signing=3F?=
List-Id: CBOR Object Signing and Encryption <cose.ietf.org>
Archived-At: 
 <https://mailarchive.ietf.org/arch/msg/cose/BjIO9qDNbuVinxAph7F-Z88GpFY>
List-Archive: <https://mailarchive.ietf.org/arch/browse/cose>
List-Help: <mailto:cose-request@ietf.org?subject=help>
List-Owner: <mailto:cose-owner@ietf.org>
List-Post: <mailto:cose@ietf.org>
List-Subscribe: <mailto:cose-join@ietf.org>
List-Unsubscribe: <mailto:cose-leave@ietf.org>

--000000000000e48ea2062395311b
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

Hi Mike and Orie, thank you for your replies (see Orie's reply on GitHub
<https://github.com/w3c/webauthn/pull/2078#issuecomment-2364535837>). I've
now had some time to digest them (pun intended) and consider how to proceed=
.

I agree that distinct algorithm identifiers seems like a suitable solution
for this. I mocked up an outline of the idea, including a few examples of
what this might look like for a couple of algorithms, which you can see
here for the time being:
https://yubico.github.io/arkg-rfc/cose-two-party-sign-algs/draft-bradleylun=
dberg-cfrg-arkg.html#name-temporary-cose-algorithms-f
(This address is temporary, we'll move the draft somewhere more appropriate
when the ideas are more mature)
The relevant section is "5.3. TEMPORARY: COSE algorithms for two-party
signing", but it also lightly ties into the preceding section "5.2. COSE
key reference types" for things like the *ctx* parameter in HashML-DSA.
Perhaps this better illustrates what we're trying to do.

As noted in the introduction section, this is subtly different from COSE
Hash Envelope (CHE), for example, if I understood CHE correctly. We
deliberately want to *avoid* domain-separating these signatures, and avoid
an additional protocol-level hash layer. The hope is to be able to generate
signatures that look the same as usual, and verify the same as usual, but
without having to send the entire original message to the cryptographic
hardware that holds the private key. These algorithm identifiers therefore
wouldn't appear on signature structures or keys, as those would still be
tagged with the existing identifier for the usual signature (verification)
algorithm.

This would enable our WebAuthn raw signing extension to output signatures
that can be fed into existing verifiers, without needing to adapt those
verifiers and cryptographic protocols to accomodate a protocol-level
prehash. This also enables structuring the extension such that the WebAuthn
Relying Party and authenticator (e.g., security key) can negotiate a
two-party signature algorithm without needing the WebAuthn client (browser)
to support it - the client just passes the data through.

Please have a look at the mockup link above. Does this (and the related
COSE_Key_Ref idea) seem like a reasonable approach?

Emil Lundberg

Staff Engineer | Yubico <http://www.yubico.com/>




Den ons 25 sep. 2024 kl 00:29 skrev Michael Jones <
michael_b_jones@hotmail.com>:

> Thanks for writing, Emil.  Here are my thoughts.
>
>
>
> I would not suggest trying to generically extend the JOSE and COSE signin=
g
> structures with additional parameters, such as creating a signing request
> data structure.  It would be much simpler and more aligned with how JOSE
> and COSE work to define new algorithm identifiers for the additional need=
ed
> functionality.  These should go into the existing registries for JOSE
> <https://www.iana.org/assignments/jose/jose.xhtml#web-signature-encryptio=
n-algorithms>
> and COSE
> <https://www.iana.org/assignments/cose/cose.xhtml#header-algorithm-parame=
ters>
> .
>
>
>
> As you probably already know, pre-hash algorithm identifiers for Ed25519
> and Ed448 are not currently registered for JOSE
> <https://www.iana.org/assignments/jose/jose.xhtml#web-signature-encryptio=
n-algorithms>
> or COSE
> <https://www.iana.org/assignments/cose/cose.xhtml#header-algorithm-parame=
ters>.
> I suggest creating them in a new specification.  I=E2=80=99d be glad to c=
ollaborate
> on writing that with you if you=E2=80=99d like.  Other needed pre-hash al=
gorithm
> identifiers could also be created in the new spec.
>
>
>
> Mike Prorock and Orie Steele, it=E2=80=99s relevant to know whether you i=
ntent to
> extend to register both pre-hash and non-pre-hash algorithm identifiers i=
n
> draft-ietf-cose-dilithium.  Your thoughts?
>
>
>
> Emil, I am glad that you are working on the signing extension for
> WebAuthn.  I certainly support that work.
>
>
>
>                                                                 Best
> wishes,
>
>                                                                 -- Mike
>
>
>
> *From:* Emil Lundberg <emil=3D40yubico.com@dmarc.ietf.org>
> *Sent:* Friday, September 20, 2024 9:51 AM
> *To:* cose <cose@ietf.org>; jose@ietf.org
> *Subject:* [jose] Algorithm identifiers for pre-hashing in two-party
> signing?
>
>
>
> Hi COSE and JOSE WGs,
>
> I'm currently working on an extension to WebAuthn
> <https://github.com/w3c/webauthn/pull/2078> [1] for signing arbitrary
> data. The current draft uses `COSEAlgorithmIdentifier`s to negotiate what
> signature algorithm to use, and the same `COSEAlgorithmIdentifier` is als=
o
> emitted in generated `COSE_Key`s to communicate the signature algorithm t=
o
> the signature verifier.
>
> However, for several reasons we want the caller of this signing API to
> pre-hash the data to be signed before passing it into the extension. The
> question then is: how should we communicate, _generically_, which steps o=
f
> the signing algorithm are performed in advance by the caller and which ar=
e
> performed by the WebAuthn authenticator?
>
> In some cases the division is fairly obvious. For example, ESP256
> <https://www.ietf.org/archive/id/draft-ietf-jose-fully-specified-algorith=
ms-05.html>
> [2] hashes the input only once, so it's obvious that the caller performs
> the hash and the WebAuthn authenticator interprets the input as a raw P-2=
56
> scalar. Ed25519ph <https://www.rfc-editor.org/rfc/rfc8032#section-5.1>
> [3] hashes the input once without the key and then hashes the digest agai=
n
> with the key, so clearly only the first hash can be performed by the call=
er
> (and Ed25519 is impossible to implement in this way).
>
> But for other algorithms it's less obvious - for example, for HashML-DSA
> <https://csrc.nist.gov/pubs/fips/204/final> [4], the caller could compute
> only PH_M and submit PH_M and the hash OID into the signing API, or the
> caller could compute M' and submit only M' into the signing API (I think
> the former is clearly preferable, but the point is that both options
> exist). Similarly for RSASSA-PSS
> <https://www.rfc-editor.org/rfc/rfc8017#section-9.1.1> [5], should the
> caller submit `mHash` or `EM`? This "division of labour" between the call=
er
> and the WebAuthn authenticator needs to be defined somehow.
>
> So, that is my question: how should we define and communicate this
> division of labour?
>
> - Is there some way we can do it generically, without defining any new
> algorithm identifiers?
> - Should we define new algorithm identifiers for "pre-hashing for
> two-party signing" in some existing registry?
> - Should we define a new registry of algorithm identifiers?
> - Should we define some new "signing request" data structure, which can
> describe whether and how data is pre-hashed (perhaps similar to COSE Hash
> Envelopes
> <https://cose-wg.github.io/draft-ietf-cose-hash-envelope/draft-ietf-cose-=
hash-envelope.html#name-hash-envelope-cddl>
> [6]?)?
> - Other options?
>
> Any insight and guidance on this would be much appreciated. Of course I'm
> also happy to elaborate on anything that is unclear. Thank you.
>
>
> [1]: https://github.com/w3c/webauthn/pull/2078
> [2]:
> https://www.ietf.org/archive/id/draft-ietf-jose-fully-specified-algorithm=
s-05.html
> [3]: https://www.rfc-editor.org/rfc/rfc8032#section-5.1
> [4]: https://csrc.nist.gov/pubs/fips/204/final
> [5]: https://www.rfc-editor.org/rfc/rfc8017#section-9.1.1
> [6]:
> https://cose-wg.github.io/draft-ietf-cose-hash-envelope/draft-ietf-cose-h=
ash-envelope.html#name-hash-envelope-cddl
>
>
> *Emil Lundberg*
>
> Staff Engineer | *Yubico* <http://www.yubico.com/>
>
>
>

--000000000000e48ea2062395311b
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div>Hi Mike and Orie, thank you for your replies (see Ori=
e&#39;s <a href=3D"https://github.com/w3c/webauthn/pull/2078#issuecomment-2=
364535837" target=3D"_blank">reply on GitHub</a>). I&#39;ve now had some ti=
me to digest them (pun intended) and consider how to proceed.</div><div><br=
></div><div>I agree that distinct algorithm identifiers seems like a suitab=
le solution for this. I mocked up an outline of the idea, including a few e=
xamples of what this might look like for a couple of algorithms, which you =
can see here for the time being:=C2=A0<a href=3D"https://yubico.github.io/a=
rkg-rfc/cose-two-party-sign-algs/draft-bradleylundberg-cfrg-arkg.html#name-=
temporary-cose-algorithms-f">https://yubico.github.io/arkg-rfc/cose-two-par=
ty-sign-algs/draft-bradleylundberg-cfrg-arkg.html#name-temporary-cose-algor=
ithms-f</a></div><div>(This address is temporary, we&#39;ll move the draft =
somewhere more appropriate when the ideas are more mature)</div><div>The re=
levant section is &quot;5.3. TEMPORARY: COSE algorithms for two-party signi=
ng&quot;, but it also lightly ties into the preceding section &quot;5.2. CO=
SE key reference types&quot; for things like the <i>ctx</i>=C2=A0parameter =
in HashML-DSA.</div><div>Perhaps this better illustrates what we&#39;re try=
ing to do.</div><div><br></div><div>As noted in the introduction section, t=
his is subtly different from COSE Hash Envelope (CHE), for example, if I un=
derstood CHE correctly. We deliberately want to <i>avoid</i>=C2=A0domain-se=
parating these signatures, and avoid an additional protocol-level hash laye=
r. The hope is to be able to generate signatures that look the same as usua=
l, and verify the same as usual, but without having to send the entire orig=
inal message to the cryptographic hardware that holds the private key. Thes=
e algorithm identifiers therefore wouldn&#39;t appear on signature structur=
es or keys, as those would still be tagged with the existing identifier for=
 the usual signature (verification) algorithm.</div><div><br></div><div>Thi=
s would enable our WebAuthn raw signing extension to output signatures that=
 can be fed into existing verifiers, without needing to adapt those verifie=
rs and cryptographic protocols to accomodate a protocol-level prehash. This=
 also enables structuring the extension such that the WebAuthn Relying Part=
y and authenticator (e.g., security key) can negotiate a two-party signatur=
e algorithm without needing the WebAuthn client (browser) to support it - t=
he client just passes the data through.</div><div><br></div><div>Please hav=
e a look at the mockup link above. Does this (and the related COSE_Key_Ref =
idea) seem like a reasonable approach?<br></div><br clear=3D"all"><div><div=
 dir=3D"ltr" class=3D"gmail_signature" data-smartmail=3D"gmail_signature"><=
div dir=3D"ltr"><div><div dir=3D"ltr"><span><p dir=3D"ltr" style=3D"line-he=
ight:1.38;margin-top:0pt;margin-bottom:0pt"><span style=3D"color:rgb(102,10=
2,102);font-family:Arial;font-size:9.5pt;font-weight:700;white-space:pre-wr=
ap;line-height:1.38">Emil Lundberg</span><br></p><p dir=3D"ltr" style=3D"li=
ne-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style=3D"font-size:9=
.5pt;font-family:Arial;color:rgb(102,102,102);vertical-align:baseline;white=
-space:pre-wrap">Staff Engineer | </span><a href=3D"http://www.yubico.com/"=
 style=3D"line-height:1.38;font-size:12.8px;text-decoration:none" target=3D=
"_blank"><span style=3D"font-size:9.5pt;font-family:Verdana;color:rgb(106,1=
68,79);font-weight:700;vertical-align:baseline;white-space:pre-wrap">Yubico=
</span></a><br></p><p dir=3D"ltr" style=3D"line-height:1.38;margin-top:0pt;=
margin-bottom:0pt"><br></p></span></div></div></div></div></div><br></div><=
br><div class=3D"gmail_quote"><div dir=3D"ltr" class=3D"gmail_attr">Den ons=
 25 sep. 2024 kl 00:29 skrev Michael Jones &lt;<a href=3D"mailto:michael_b_=
jones@hotmail.com" target=3D"_blank">michael_b_jones@hotmail.com</a>&gt;:<b=
r></div><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>





<div lang=3D"EN-US">
<div>
<p class=3D"MsoNormal"><span style=3D"font-size:11pt">Thanks for writing, E=
mil.=C2=A0 Here are my thoughts.<u></u><u></u></span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:11pt"><u></u>=C2=A0<u></u><=
/span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:11pt">I would not suggest t=
rying to generically extend the JOSE and COSE signing structures with addit=
ional parameters, such as creating a signing request data structure.=C2=A0 =
It would be much simpler and more aligned
 with how JOSE and COSE work to define new algorithm identifiers for the ad=
ditional needed functionality.=C2=A0 These should go into the existing regi=
stries for
<a href=3D"https://www.iana.org/assignments/jose/jose.xhtml#web-signature-e=
ncryption-algorithms" target=3D"_blank">
JOSE</a> and <a href=3D"https://www.iana.org/assignments/cose/cose.xhtml#he=
ader-algorithm-parameters" target=3D"_blank">
COSE</a>.<u></u><u></u></span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:11pt"><u></u>=C2=A0<u></u><=
/span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:11pt">As you probably alrea=
dy know, pre-hash algorithm identifiers for Ed25519 and Ed448 are not curre=
ntly registered for
<a href=3D"https://www.iana.org/assignments/jose/jose.xhtml#web-signature-e=
ncryption-algorithms" target=3D"_blank">
JOSE</a> or <a href=3D"https://www.iana.org/assignments/cose/cose.xhtml#hea=
der-algorithm-parameters" target=3D"_blank">
COSE</a>.=C2=A0 I suggest creating them in a new specification.=C2=A0 I=E2=
=80=99d be glad to collaborate on writing that with you if you=E2=80=99d li=
ke.=C2=A0 Other needed pre-hash algorithm identifiers could also be created=
 in the new spec.<u></u><u></u></span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:11pt"><u></u>=C2=A0<u></u><=
/span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:11pt">Mike Prorock and Orie=
 Steele, it=E2=80=99s relevant to know whether you intent to extend to regi=
ster both pre-hash and non-pre-hash algorithm identifiers in draft-ietf-cos=
e-dilithium.=C2=A0 Your thoughts?<u></u><u></u></span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:11pt"><u></u>=C2=A0<u></u><=
/span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:11pt">Emil, I am glad that =
you are working on the signing extension for WebAuthn.=C2=A0 I certainly su=
pport that work.<u></u><u></u></span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:11pt"><u></u>=C2=A0<u></u><=
/span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:11pt">=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Best wishes,<u></=
u><u></u></span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:11pt">=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 -- Mike<u></u><u>=
</u></span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:11pt"><u></u>=C2=A0<u></u><=
/span></p>
<div style=3D"border-right:none;border-bottom:none;border-left:none;border-=
top:1pt solid rgb(225,225,225);padding:3pt 0in 0in">
<p class=3D"MsoNormal"><b><span style=3D"font-size:11pt;font-family:Calibri=
,sans-serif">From:</span></b><span style=3D"font-size:11pt;font-family:Cali=
bri,sans-serif"> Emil Lundberg &lt;emil=3D<a href=3D"mailto:40yubico.com@dm=
arc.ietf.org" target=3D"_blank">40yubico.com@dmarc.ietf.org</a>&gt;
<br>
<b>Sent:</b> Friday, September 20, 2024 9:51 AM<br>
<b>To:</b> cose &lt;<a href=3D"mailto:cose@ietf.org" target=3D"_blank">cose=
@ietf.org</a>&gt;; <a href=3D"mailto:jose@ietf.org" target=3D"_blank">jose@=
ietf.org</a><br>
<b>Subject:</b> [jose] Algorithm identifiers for pre-hashing in two-party s=
igning?<u></u><u></u></span></p>
</div>
<p class=3D"MsoNormal"><u></u>=C2=A0<u></u></p>
<div>
<div>
<p class=3D"MsoNormal">Hi COSE and JOSE WGs,<br>
<br>
I&#39;m currently working on an extension to <a href=3D"https://github.com/=
w3c/webauthn/pull/2078" target=3D"_blank">
WebAuthn</a> [1] for signing arbitrary data. The current draft uses `COSEAl=
gorithmIdentifier`s to negotiate what signature algorithm to use, and the s=
ame `COSEAlgorithmIdentifier` is also emitted in generated `COSE_Key`s to c=
ommunicate the signature algorithm
 to the signature verifier.<br>
<br>
However, for several reasons we want the caller of this signing API to pre-=
hash the data to be signed before passing it into the extension. The questi=
on then is: how should we communicate, _generically_, which steps of the si=
gning algorithm are performed in
 advance by the caller and which are performed by the WebAuthn authenticato=
r?<br>
<br>
In some cases the division is fairly obvious. For example, <a href=3D"https=
://www.ietf.org/archive/id/draft-ietf-jose-fully-specified-algorithms-05.ht=
ml" target=3D"_blank">
ESP256</a> [2] hashes the input only once, so it&#39;s obvious that the cal=
ler performs the hash and the WebAuthn authenticator interprets the input a=
s a raw P-256 scalar.
<a href=3D"https://www.rfc-editor.org/rfc/rfc8032#section-5.1" target=3D"_b=
lank">Ed25519ph</a> [3] hashes the input once without the key and then hash=
es the digest again with the key, so clearly only the first hash can be per=
formed by the caller (and Ed25519 is impossible to implement
 in this way).<br>
<br>
But for other algorithms it&#39;s less obvious - for example, for <a href=
=3D"https://csrc.nist.gov/pubs/fips/204/final" target=3D"_blank">
HashML-DSA</a> [4], the caller could compute only PH_M and submit PH_M and =
the hash OID into the signing API, or the caller could compute M&#39; and s=
ubmit only M&#39; into the signing API (I think the former is clearly prefe=
rable, but the point is that both options
 exist). Similarly for <a href=3D"https://www.rfc-editor.org/rfc/rfc8017#se=
ction-9.1.1" target=3D"_blank">
RSASSA-PSS</a> [5], should the caller submit `mHash` or `EM`? This &quot;di=
vision of labour&quot; between the caller and the WebAuthn authenticator ne=
eds to be defined somehow.<br>
<br>
So, that is my question: how should we define and communicate this division=
 of labour?<br>
<br>
- Is there some way we can do it generically, without defining any new algo=
rithm identifiers?<br>
- Should we define new algorithm identifiers for &quot;pre-hashing for two-=
party signing&quot; in some existing registry?<br>
- Should we define a new registry of algorithm identifiers?<br>
- Should we define some new &quot;signing request&quot; data structure, whi=
ch can describe whether and how data is pre-hashed (perhaps similar to
<a href=3D"https://cose-wg.github.io/draft-ietf-cose-hash-envelope/draft-ie=
tf-cose-hash-envelope.html#name-hash-envelope-cddl" target=3D"_blank">
COSE Hash Envelopes</a> [6]?)?<br>
- Other options?<br>
<br>
Any insight and guidance on this would be much appreciated. Of course I&#39=
;m also happy to elaborate on anything that is unclear. Thank you.<br>
<br>
<br>
[1]: <a href=3D"https://github.com/w3c/webauthn/pull/2078" target=3D"_blank=
">https://github.com/w3c/webauthn/pull/2078</a><br>
[2]: <a href=3D"https://www.ietf.org/archive/id/draft-ietf-jose-fully-speci=
fied-algorithms-05.html" target=3D"_blank">
https://www.ietf.org/archive/id/draft-ietf-jose-fully-specified-algorithms-=
05.html</a><br>
[3]: <a href=3D"https://www.rfc-editor.org/rfc/rfc8032#section-5.1" target=
=3D"_blank">https://www.rfc-editor.org/rfc/rfc8032#section-5.1</a><br>
[4]: <a href=3D"https://csrc.nist.gov/pubs/fips/204/final" target=3D"_blank=
">https://csrc.nist.gov/pubs/fips/204/final</a><br>
[5]: <a href=3D"https://www.rfc-editor.org/rfc/rfc8017#section-9.1.1" targe=
t=3D"_blank">https://www.rfc-editor.org/rfc/rfc8017#section-9.1.1</a><br>
[6]: <a href=3D"https://cose-wg.github.io/draft-ietf-cose-hash-envelope/dra=
ft-ietf-cose-hash-envelope.html#name-hash-envelope-cddl" target=3D"_blank">
https://cose-wg.github.io/draft-ietf-cose-hash-envelope/draft-ietf-cose-has=
h-envelope.html#name-hash-envelope-cddl</a><u></u><u></u></p>
</div>
<p class=3D"MsoNormal"><br clear=3D"all">
<u></u><u></u></p>
<div>
<div>
<div>
<div>
<div>
<p style=3D"margin:0in"><b><span style=3D"font-size:9.5pt;font-family:Arial=
,sans-serif;color:rgb(102,102,102)">Emil Lundberg</span></b><u></u><u></u><=
/p>
<p style=3D"margin:0in"><span style=3D"font-size:9.5pt;font-family:Arial,sa=
ns-serif;color:rgb(102,102,102)">Staff Engineer |
</span><a href=3D"http://www.yubico.com/" target=3D"_blank"><b><span style=
=3D"font-size:9.5pt;font-family:Verdana,sans-serif;color:rgb(106,168,79);te=
xt-decoration:none">Yubico</span></b></a><u></u><u></u></p>
<p style=3D"margin:0in"><u></u>=C2=A0<u></u></p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>

</div></blockquote></div>

--000000000000e48ea2062395311b--

