Re: [Cbor] Announcement: draft-mcnally-deterministic-cbor-03

Carsten Bormann <cabo@tzi.org> Mon, 07 August 2023 16:12 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 C6C65C151540 for <cbor@ietfa.amsl.com>; Mon, 7 Aug 2023 09:12:26 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.906
X-Spam-Level:
X-Spam-Status: No, score=-1.906 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RCVD_IN_ZEN_BLOCKED_OPENDNS=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01, URIBL_BLOCKED=0.001, URIBL_DBL_BLOCKED_OPENDNS=0.001, URIBL_ZEN_BLOCKED_OPENDNS=0.001] autolearn=ham autolearn_force=no
Received: from mail.ietf.org ([50.223.129.194]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id vD7iOcCzc9-G for <cbor@ietfa.amsl.com>; Mon, 7 Aug 2023 09:12:23 -0700 (PDT)
Received: from smtp.zfn.uni-bremen.de (smtp.zfn.uni-bremen.de [134.102.50.21]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id DE8A1C15152C for <cbor@ietf.org>; Mon, 7 Aug 2023 09:12:22 -0700 (PDT)
Received: from [192.168.217.124] (p548dc15c.dip0.t-ipconnect.de [84.141.193.92]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.zfn.uni-bremen.de (Postfix) with ESMTPSA id 4RKLtr1L5nzDCfG; Mon, 7 Aug 2023 18:12:20 +0200 (CEST)
Content-Type: text/plain; charset="utf-8"
Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.7\))
From: Carsten Bormann <cabo@tzi.org>
In-Reply-To: <D1E26143-3328-4A28-80CA-2D7E040FE25B@cursive.net>
Date: Mon, 07 Aug 2023 18:12:19 +0200
Cc: Wolf McNally <wolf@wolfmcnally.com>, cbor@ietf.org
X-Mao-Original-Outgoing-Id: 713117539.819597-326b8e608be20b727db58066fdac0a0b
Content-Transfer-Encoding: quoted-printable
Message-Id: <D447189D-D994-4845-BA8E-752AABC9274B@tzi.org>
References: <169130970676.57946.2391787665439799751@ietfa.amsl.com> <E0D91ECB-F88B-4A38-A4BC-9CBCD488E475@wolfmcnally.com> <4CF6297F-5873-4245-939B-D2665F000B10@cursive.net> <D1E26143-3328-4A28-80CA-2D7E040FE25B@cursive.net>
To: Joe Hildebrand <hildjj@cursive.net>
X-Mailer: Apple Mail (2.3608.120.23.2.7)
Archived-At: <https://mailarchive.ietf.org/arch/msg/cbor/uOxgv8auS2VVnIr-mbiT6Ks886c>
Subject: Re: [Cbor] Announcement: draft-mcnally-deterministic-cbor-03
X-BeenThere: cbor@ietf.org
X-Mailman-Version: 2.1.39
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: Mon, 07 Aug 2023 16:12:26 -0000

On 2023-08-07, at 18:00, Joe Hildebrand <hildjj@cursive.net> wrote:
> 
> One more thing, there may need to be another note that says that the integer descriptors for complex types (array, map, tag, byte string, utf8 string) MUST follow the rules for mt 0/1.  It's implied strongly and probably difficult to implement any other way, but 
> might be worth mentioning.

Hi Joe,

descriptor is not a word we use in RFC 8949.
We have something that is used with all of these, which is by definition an unsigned integer: The argument [1].

The argument can represent any integral number between 0 and 2**64-1.

The argument is directly used as the mt0 value (the mt1 value is -argument-1, or, in C integer arithmetic, ~argument).  For mt2 and mt3, the argument gives the length of the string in bytes.  For mt4, the number of elements in the array.  mt5, number of pairs in the map.  mt6, the tag number.  mt7 is a bit more complicated.

So, by definition, the argument already behaves like an mt0, because mt0 is defined by the argument...

Grüße, Carsten

[1]: https://www.rfc-editor.org/rfc/rfc8949.html#name-specification-of-the-cbor-e