Let's in mind what we are discussing here (for a NIST curve):

Variant 1 (HPKE-style): Concatenation of x and y

Variant 2 (COSE-style): Putting x and y into separate fields

If the group believes that the concatenation of x||y (like HPKE does) is better 
than separating them into distinct fields (as COSE does today) then we should 
deprecate the current COSE public key encoding. If the HPKE-style encoding is 
so much better then why wouldn't you use it elsewhere as well?

I just don't want to **two** ways to encode x and y values in COSE. Is this 
really too much to ask for?

Ciao
Hannes

-----Original Message-----
From: COSE <[email protected]> On Behalf Of Ilari Liusvaara
Sent: Thursday, September 29, 2022 1:30 PM
To: Richard Barnes <[email protected]>
Cc: [email protected]
Subject: Re: [COSE] COSE_Key for HPKE encapsulated key

On Wed, Sep 28, 2022 at 01:59:18PM -0400, Richard Barnes wrote:
>
> It was brought to my attention that this working group is considering
> representing the "enc" output of HPKE as a COSE_Key as opposed to an
> opaque byte string [1].
>
> Representing the "enc" output as anything other than opaque bytes is a
> mistake.  It would require the COSE implementation to parse the "enc"
> output, causing a bunch of unnecessary work and inviting error.  (If you
> want to represent it as opaque bytes plus some metadata, sure.  But   But
> don't parse it.)

Unfortunately, there is a perverse incentive involved: For NIST curves, one can 
save a few dozen bytes by re-encoding the value, as HPKE does not support 
compressed nor compact points for NIST curves.

Regarding adding support for compact points, what it would take to add the 
stuff from draft-harkins-cfrg-dnhpke-02, section 4.1 to the IANA registry (I 
think the ball has been dropped somewhere with that)?


> I'm not sure which of the chairs' options that maps to, but both the
> COSE_Key and Ilari's OKP proposal look incorrect to me, because they
> both imply that the value is a key.  I think Daisuke Ajitomi's
> proposal is closer to correct. In any case, I hope this helps clear things up.

There is really a lot of confusion between long-term public keys and 
encapsulated keys (the "enc" output). The OKP proposal was about long- term 
public keys (but turns out it is flawed for different reasons).

The nasty hacks I did of encoding "enc" into COSE_Key used key type 
"Symmetric", which is the smallest boilerplate to stuff some byte string into 
COSE_Key, as "ephemeral key" field takes COSE_Key.

The latest proposal I made (non-injectively) stuffs "enc" into the beginning of 
the ciphertext (along with the AEAD ID). This avoids allocating new header 
parameters and makes COSE-HPKE look like some- thing existing (direct 
encryption / key wrap) rather than a totally new kind of of thing.



-Ilari

_______________________________________________
COSE mailing list
[email protected]
https://www.ietf.org/mailman/listinfo/cose
IMPORTANT NOTICE: The contents of this email and any attachments are 
confidential and may also be privileged. If you are not the intended recipient, 
please notify the sender immediately and do not disclose the contents to any 
other person, use it for any purpose, or store or copy the information in any 
medium. Thank you.

_______________________________________________
COSE mailing list
[email protected]
https://www.ietf.org/mailman/listinfo/cose

Reply via email to