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

Reply via email to