Subject: Re: [COSE] [Cbor] Packed CBOR review

From: Carsten Bormann <[email-masked]>
Date: Thu, 17 Jun 2021 16:11:05 +0200

On 2021-06-17, at 15:55, Brendan Moran <[email-masked]> wrote:
> 
> It would be nice if this had some CDDL so that I could reference it in other specifications.

That raises the overall question how IANA registries could be made available in CDDL.

This particular case is probably the most difficult one, as the "COSE Algorithms” registry combines various kinds of algorithms into one registry, so essentially one would like to make an SQL query over that :-)

SELECT Value 
  FROM IANA.cose#algorithms 
  WHERE recommended=“yes” and capabilities=“[]”

(Hmm, I don’t understand how the capabilities, are mapped in the current registry — the SHA-256 entry there says “[kty]” but draft-ietf-cose-hash-algs-09 says "[]”.  Is capabilities even a good way to select an algorithm?)

Grüße, Carsten

---

From: Ilari Liusvaara <[email-masked]>
Date: Sat, 19 Jun 2021 18:23:19 +0300

On Thu, Jun 17, 2021 at 04:11:05PM +0200, Carsten Bormann wrote:

> (Hmm, I don’t understand how the capabilities, are mapped in the
> current registry — the SHA-256 entry there says “[kty]” but
> draft-ietf-cose-hash-algs-09 says "[]”.  Is capabilities even a good
> way to select an algorithm?)

What I think is the most sensible guess I have about that that "kty"
means is that the associated key has the kty field (since kty does
not look to be defined for anything except key structure, and alg
can go into various other structures as well.

However, there are two problems with this interpretation:

1) The hash algorithms like SHA-256 do not have associated keys, since
hashes are not keyed. So kty does not make sense with hashes.

2) There are algorithms like ES256/ES384/ES512 and EdDSA that have
associated keys that also need the crv field to make sense, since
there are multiple possible subtypes (P256/P384/P521 and
Ed25519/Ed448).

What I would think would make most sense about crossreferences in
algorithm table would be key types that algorithm can go with (E.g.,
ES256 can go with type 2, EdDSA can go with type 1).

Then scanning key types table, I spot another issue: The entry for
HSS-LMS mentions capability "hash algorithm". As far as I can tell,
there is no COSE structure where that hash algorithm goes. The only
key-type specific entry is the public key. It seems like the hash
function to use is specified by the public key (and the current spec
is limited to SHA-256).

-Ilari