Subject: [COSE] Digests (hashes) in COSE?

From: Carsten Bormann <[email-masked]>
Date: Mon, 26 Feb 2018 18:01:21 +0100

I think that has come up before, but today in the SUIT WG Interim we briefly discussed a structure where it would be useful to contain multiple unkeyed digests (hashes) in one signed claim (*).  In COSE, we have a registry for keyed MAC schemes, but not for hashes.  We also don’t have a COSE_Digest structure (which would be quite simple, I believe) either (**).

To avoid everyone defining their own way of describing hashes, should we be setting this up for COSE?
We would have to be fast to be relevant for SUIT.

Grüße, Carsten

(*) https://tools.ietf.org/html/draft-moran-suit-manifest-01#section-4
(**) maybe a bit like CMS digestedData, but simpler of course

---

From: Jim Schaad <[email-masked]>
Date: Tue, 27 Feb 2018 16:48:13 -0800

I need to re-publish my document with hash algorithms, however I am not sure what needs to be placed in this structure in some ways.

Is there something beyond

MAC = [
    Digest : bstr,
    Algorithm: alg_id
]

If you start trying to carry the content you end up with problems because it is just as often pointed to.  Not sure that putting the pointer in the digest computation would make sense as this value often chances as well.

Are you thinking of something specific that should be part of this?

I am not sure just how strong the demand is for parametrized hash algorithms is.  I have used a couple in my lifetime, but always as cases to see what would happen and have never used one in the wild.

Jim

> -----Original Message-----
> From: COSE [mailto:[email-masked]] On Behalf Of Carsten Bormann
> Sent: Monday, February 26, 2018 9:01 AM
> To: [email-masked]
> Subject: [COSE] Digests (hashes) in COSE?
> 
> I think that has come up before, but today in the SUIT WG Interim we briefly
> discussed a structure where it would be useful to contain multiple unkeyed
> digests (hashes) in one signed claim (*).  In COSE, we have a registry for
> keyed MAC schemes, but not for hashes.  We also don’t have a COSE_Digest
> structure (which would be quite simple, I believe) either (**).
> 
> _______________________________________________
> COSE mailing list
> [email-masked]
> https://www.ietf.org/mailman/listinfo/cose

---

From: Laurence Lundblade <[email-masked]>
Date: Wed, 28 Feb 2018 04:55:21 +0000

I have used an alg id for a plain hash in a CBOR/COSE implementation.  Without going into details it was a special-purpose singing scheme. I ended up using an id in the for-private-use space. 

My use aside, it seems helpful and useful to have SHA-256, 384... and friends in the COSE IANA registry. 

LL

________________________________________
From: COSE <[email-masked]> on behalf of Jim Schaad <[email-masked]>
Sent: Tuesday, February 27, 2018 4:48 PM
To: 'Carsten Bormann'; [email-masked]
Subject: Re: [COSE] Digests (hashes) in COSE?

MAC = [
    Digest : bstr,
    Algorithm: alg_id
]

Jim

---

From: Carsten Bormann <[email-masked]>
Date: Wed, 28 Feb 2018 07:10:12 +0100

In the specific case, there would be multiple hashes all under the same algorithm id, so the data structure would be pretty trivial...  Maybe we just need the iana considerations for registering hash functions plus some text how to truncate. 

Sent from mobile

> On 28. Feb 2018, at 01:48, Jim Schaad <[email-masked]> wrote:
>

---

From: Jim Schaad <[email-masked]>
Date: Tue, 27 Feb 2018 22:28:36 -0800

For the draft that I originally wrote, the truncated length is part of the algorithm identifier just like it is with the MAC algorithms.  I will get it republished and make sure that it is ready to go.  I can probably get an AD to pick it up in London.

Jim

From: Carsten Bormann [mailto:[email-masked]] 
Sent: Tuesday, February 27, 2018 10:10 PM
To: Jim Schaad <[email-masked]>
Cc: [email-masked]
Subject: Re: [COSE] Digests (hashes) in COSE?

Sent from mobile

On 28. Feb 2018, at 01:48, Jim Schaad <[email-masked] <mailto:[email-masked]> > wrote:

MAC = [
   Digest : bstr,
   Algorithm: alg_id
]

Jim

-----Original Message-----

To: [email-masked] <mailto:[email-masked]> 

To avoid everyone defining their own way of describing hashes, should we

be setting this up for COSE?

Grüße, Carsten

COSE mailing list

[email-masked] <mailto:[email-masked]>

---

From: Carsten Bormann <[email-masked]>
Date: Wed, 28 Feb 2018 09:23:53 +0100

Right. Consistency with Mac is probably King here, but there is no need to indicate truncation in the algorithm identifier, as the byte string itself already indicates truncation---if there is a consistent way to do this for an algorithm id. 

Sent from mobile

> On 28. Feb 2018, at 07:28, Jim Schaad <[email-masked]> wrote:
>

---

From: Jim Schaad <[email-masked]>
Date: Wed, 28 Feb 2018 15:47:51 -0800

I have defined the following:

Sha256

Sha256 truncated to 64-bits

Are there other algorithms which people believe need to be defined?  

Jim

From: Carsten Bormann [mailto:[email-masked]] 
Sent: Wednesday, February 28, 2018 12:24 AM
To: Jim Schaad <[email-masked]>
Cc: [email-masked]
Subject: Re: [COSE] Digests (hashes) in COSE?

Sent from mobile

On 28. Feb 2018, at 07:28, Jim Schaad <[email-masked] <mailto:[email-masked]> > wrote:

Jim

From: Carsten Bormann [mailto:[email-masked]] 
Sent: Tuesday, February 27, 2018 10:10 PM
To: Jim Schaad <[email-masked] <mailto:[email-masked]> >
Cc: [email-masked] <mailto:[email-masked]> 
Subject: Re: [COSE] Digests (hashes) in COSE?

Sent from mobile

MAC = [
   Digest : bstr,
   Algorithm: alg_id
]

Jim

-----Original Message-----

Grüße, Carsten

COSE mailing list