Subject: Re: [Cose] Issue: Encoding for a single recipient or structure

From: Paul Hoffman <[email-masked]>
Date: Wed, 6 May 2015 14:30:16 -0700

On Apr 30, 2015, at 3:59 PM, Jim Schaad <[email-masked]> wrote:
> Question: Flattened encoding -
> a)  Roll into parent map
> b)  Just be a map
> c)  Single element in array

If the top level is an array, clearly (c) is the right way to go. Otherwise, both (a) and (b) seem similar in code size and data size.

--Paul Hoffman

---

From: "Jim Schaad" <[email-masked]>
Date: Thu, 7 May 2015 13:31:47 -0700

Paul,

Based on your comment I am not sure if I was clear about what I was asking -
Please let me know either way.

1. Gives a result of {"unprotected":xxx, "cipher_text":xxx, "header":xxx,
"encryptd_key":xxx }
2.  Gives a result of {"unprotected"xxx", "cipher_text"xxx,
"recipients":{"header":xxx, "encrypted_key":xxx }}
3 Gives a result of {"unprotected":xxx", "cipher_text":xxx,
"recipients:[{"header":xxx, "encrypted_key":xxx}]}

Labels disappear if the top level is an array and not a map - but no other
significant changes.

Jim

> -----Original Message-----
> From: Paul Hoffman [mailto:[email-masked]]
> Sent: Wednesday, May 06, 2015 2:30 PM
> To: Jim Schaad
> Cc: [email-masked]
> Subject: Re: [Cose] Issue: Encoding for a single recipient or structure
> 
> If the top level is an array, clearly (c) is the right way to go.
Otherwise, both
> (a) and (b) seem similar in code size and data size.
> 
> --Paul Hoffman=

---

From: Paul Hoffman <[email-masked]>
Date: Thu, 7 May 2015 13:54:24 -0700

> Labels disappear if the top level is an array and not a map - but no other

Right, I completely misunderstood your shorthand. Given these, (c) seems better: it keeps the structure predictable, with a possible reduction of code for processing the structure (but not much, admittedly).

--Paul Hoffman

---

From: Derek Atkins <[email-masked]>
Date: Mon, 11 May 2015 11:20:40 -0400

Paul Hoffman <[email-masked]> writes:

> Right, I completely misunderstood your shorthand. Given these, (c)
> seems better: it keeps the structure predictable, with a possible
> reduction of code for processing the structure (but not much,
> admittedly).

+1 -- it should always be an array of recipients, even if it only has a
single element.

> --Paul Hoffman
> _______________________________________________
> Cose mailing list
> [email-masked]
> https://www.ietf.org/mailman/listinfo/cose

-derek

-- 
       Derek Atkins                 617-623-3745
       [email-masked]             www.ihtfp.com
       Computer and Internet Security Consultant

---

From: ⌘ Matt Miller <[email-masked]>
Date: Tue, 12 May 2015 10:53:50 -0600

On 5/11/15 9:20 AM, Derek Atkins wrote:
>>> Based on your comment I am not sure if I was clear about what I
>>> was asking - Please let me know either way.
>>> 
>>> 1. Gives a result of {"unprotected":xxx, "cipher_text":xxx,
>>> "header":xxx, "encryptd_key":xxx } 2.  Gives a result of
>>> {"unprotected"xxx", "cipher_text"xxx, 
>>> "recipients":{"header":xxx, "encrypted_key":xxx }} 3 Gives a
>>> result of {"unprotected":xxx", "cipher_text":xxx, 
>>> Labels disappear if the top level is an array and not a map -
>>> but no other significant changes.
>> 
>> Right, I completely misunderstood your shorthand. Given these,
>> (c) seems better: it keeps the structure predictable, with a
>> possible reduction of code for processing the structure (but not
>> much, admittedly).
> 
> +1 -- it should always be an array of recipients, even if it only
> has a single element.
> 

I have a light preference for (2), but am fine to sticking with (3).
This WG is arguably more at least as concerned with code size as with
on-the-wire size, and (2) would require (slightly?) more code than (3).

- -- 
- - m&m

Matt Miller < [email-masked] >
Cisco Systems, Inc.