Re: [Cbor] Packed CBOR and dictionaries

Carsten Bormann <cabo@tzi.org> Fri, 28 August 2020 22:08 UTC

Return-Path: <cabo@tzi.org>
X-Original-To: cbor@ietfa.amsl.com
Delivered-To: cbor@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 59CF03A0D06; Fri, 28 Aug 2020 15:08:11 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.897
X-Spam-Level:
X-Spam-Status: No, score=-1.897 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id GKUDArzy4KCm; Fri, 28 Aug 2020 15:08:09 -0700 (PDT)
Received: from gabriel-vm-2.zfn.uni-bremen.de (gabriel-vm-2.zfn.uni-bremen.de [134.102.50.17]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id CC8E43A0CFC; Fri, 28 Aug 2020 15:08:08 -0700 (PDT)
Received: from [172.16.42.100] (p5089ae91.dip0.t-ipconnect.de [80.137.174.145]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by gabriel-vm-2.zfn.uni-bremen.de (Postfix) with ESMTPSA id 4BdYd30N5GzyXt; Sat, 29 Aug 2020 00:08:07 +0200 (CEST)
Content-Type: text/plain; charset="utf-8"
Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.1\))
From: Carsten Bormann <cabo@tzi.org>
In-Reply-To: <14972.1598651775@localhost>
Date: Sat, 29 Aug 2020 00:08:06 +0200
Cc: Jim Schaad <ietf@augustcellars.com>, draft-bormann-cbor-packed@ietf.org, cbor@ietf.org
X-Mao-Original-Outgoing-Id: 620345286.611809-d082ee31ee6fe722c13ceb32f890e9d0
Content-Transfer-Encoding: quoted-printable
Message-Id: <8624F30D-8575-41CF-A27B-237E54EB8CDC@tzi.org>
References: <008c01d67c47$aaf73be0$00e5b3a0$@augustcellars.com> <28732.1598638838@localhost> <80C336B5-2A10-44BF-B214-7CFA1B159923@tzi.org> <14972.1598651775@localhost>
To: Michael Richardson <mcr+ietf@sandelman.ca>
X-Mailer: Apple Mail (2.3608.120.23.2.1)
Archived-At: <https://mailarchive.ietf.org/arch/msg/cbor/MSD0VmAMeA-DohFSR4CkEwwYxOA>
Subject: Re: [Cbor] Packed CBOR and dictionaries
X-BeenThere: cbor@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: "Concise Binary Object Representation \(CBOR\)" <cbor.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/cbor>, <mailto:cbor-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/cbor/>
List-Post: <mailto:cbor@ietf.org>
List-Help: <mailto:cbor-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/cbor>, <mailto:cbor-request@ietf.org?subject=subscribe>
X-List-Received-Date: Fri, 28 Aug 2020 22:08:11 -0000

On 2020-08-28, at 23:56, Michael Richardson <mcr+ietf@sandelman.ca> wrote:
> 
> 
> Carsten Bormann <cabo@tzi.org> wrote:
>> OK, I think we need to answer a few questions first.
> 
>> Is there only ever one dictionary that is being referenced?
>> Or can you reference multiple?
> 
> I've read the thread and I think that there are three places to look.
> Please correct me I'm wrong.
> 
> 1) included in the packed CBOR.

Yes, but I’m not sure that this is a “dictionary” in the sense of being separate from the prefix and shared item tables.  Is that what you mean?

> 2) included in specifically referenced dictionary (yes, by hash)

A hash is not really a reference.  It is an identifier that can be used to check that you have referenced the right thing, so you can sign the whole item.  Like in RFC 6920, that identifier could be augmented with a reference.

A hash also is expensive, on the order of several dozen bytes, so see below.

> 3) included in an application specific dictionary defined at the RFC-level.
>   (what Klaus was doing with CoRAL, I think)

I would generalize this a bit.  There may be some context that explains where to get the dictionary for.  To be able to sign such a packed item, there would need to be an immutable relationship between a context hint in the packed item and a dictionary (possibly identified by the hash of that).  An IANA registry can be used to maintain such a relationship.

> I had previously thought that (3) was just a rather static, compiled-in
> version of (2), and only one or the other would be invoked.

I think we need to enable these dictionaries to evolve, so static, compiled-in may be true, but new versions of formats that employ packed items should be able to make use of new static, compiled-in dictionaries.  (The dictionary defined in RFC 3485 was never updated, but that is probably more about the deployment of SigComp.)

Grüße, Carsten