Re: [Cbor] Updated Drafts for dCBOR I-D and Gordian Envelope Structured Data Format I-D & IANA Tag Registration

Wolf McNally <wolf@wolfmcnally.com> Mon, 08 May 2023 22:42 UTC

Return-Path: <wolf@wolfmcnally.com>
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 DC8B8C169509 for <cbor@ietfa.amsl.com>; Mon, 8 May 2023 15:42:21 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.896
X-Spam-Level:
X-Spam-Status: No, score=-1.896 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_BLOCKED=0.001, RCVD_IN_ZEN_BLOCKED_OPENDNS=0.001, SPF_HELO_NONE=0.001, SPF_NONE=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=wolfmcnally-com.20221208.gappssmtp.com
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 9NOTAf6Ka1l9 for <cbor@ietfa.amsl.com>; Mon, 8 May 2023 15:42:17 -0700 (PDT)
Received: from mail-pf1-x433.google.com (mail-pf1-x433.google.com [IPv6:2607:f8b0:4864:20::433]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 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 8A1CDC151982 for <cbor@ietf.org>; Mon, 8 May 2023 15:42:17 -0700 (PDT)
Received: by mail-pf1-x433.google.com with SMTP id d2e1a72fcca58-64115e652eeso38146069b3a.0 for <cbor@ietf.org>; Mon, 08 May 2023 15:42:17 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wolfmcnally-com.20221208.gappssmtp.com; s=20221208; t=1683585737; x=1686177737; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=Q68gwaawCgX9kODZ/xp3IsrwGpK2RJrs0eIEf/b8dfY=; b=NQ0r6YzZHi3sJD0VY8wEz4je4ZLFLjiLOYy83KAmOmysJcuHfY5XHh5uY7WO5PXtej IquG60aPWCeqtTjICFUT/ElkyzieDxfaOhbMskluwXpO1QHI+GQRo1OAUzgXo7X5g1xh AunU6wzTmRGyf2fK/1L5NtoxOKQR1OJzj43BHhHj6rTGUtIuu1hH5c75YWvrJz+Sorrw 8NJsLta9uhuBO0IsDsLWEiY5gYZQtI2ZE0C/91lljZ3b/sLvVzRUdkTi29NlcGTmJvWp vOlNZ2v94cN/RBxWNyQBMD8F33zpF4QxMp73H3ghh4bxUjBjS2QHljO6Rd+abFyIU3eR JJyg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683585737; x=1686177737; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Q68gwaawCgX9kODZ/xp3IsrwGpK2RJrs0eIEf/b8dfY=; b=e1FW3+UMchILiYlTOceG4g6hZS6bBQTpBUFGocGckxL3PUeeCuzJYKtFoNi6CqHXMg t9SFkgGpVQY6CbCaQrbP1ruDgW5XQWgpVhQB+zZRD35Cr2axLu8S4Cx8FqHpVistI4RJ YYY+qZ5jza9B/9wt7eKRwdl+uAxMlVcmg/TsRcpTiY8lhGpqaNTXXQ7ouwVGHr3Abw6G /gwKc9R8H4HCkETyWjO6Ud4308R+081zS/RvukBFlFc+8Vnt+wXxpLmYahhuEACpanGH 7ZDq3+k4Itjui8V9S1Xza46J+PCa1DWnNyKANLUyrl6QzyVHG3OuPHiztJZBNwrCYQkE +qQw==
X-Gm-Message-State: AC+VfDxF6a3uNfkNMSE1g8te16QIxexCj51fiB+5ht5yMmPp8XPkIByu mu9aiJlDSIVsjSfSZWeYAZjgwg==
X-Google-Smtp-Source: ACHHUZ5MEXj3rYYcV5Bm0ZYB4sJuiAJthRNVYG2Nq4TGqAkaZgAvzcdBgBCakeAQIVLaOh8YuIMkYQ==
X-Received: by 2002:a17:90b:4a84:b0:24d:dcbb:6307 with SMTP id lp4-20020a17090b4a8400b0024ddcbb6307mr13948901pjb.6.1683585736868; Mon, 08 May 2023 15:42:16 -0700 (PDT)
Received: from smtpclient.apple (ip70-180-193-108.lv.lv.cox.net. [70.180.193.108]) by smtp.gmail.com with ESMTPSA id z1-20020a17090a8b8100b00247a2498075sm18345926pjn.48.2023.05.08.15.42.15 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 08 May 2023 15:42:16 -0700 (PDT)
Content-Type: text/plain; charset="utf-8"
Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.500.231\))
From: Wolf McNally <wolf@wolfmcnally.com>
In-Reply-To: <4EBE3640-5F7F-46B8-961A-D1872A6A0CA4@tzi.org>
Date: Mon, 08 May 2023 15:42:05 -0700
Cc: Christopher Allen <christophera@lifewithalacrity.com>, cbor@ietf.org, Shannon.Appelcline@gmail.com
Content-Transfer-Encoding: quoted-printable
Message-Id: <463016EF-0DAB-45D4-AB30-53FB2B76F52B@wolfmcnally.com>
References: <CAAse2dEFB_FVP6_KkNANSYPW+yX4-M9pN3YkUq5=FTgLZnyWGw@mail.gmail.com> <4EBE3640-5F7F-46B8-961A-D1872A6A0CA4@tzi.org>
To: Carsten Bormann <cabo@tzi.org>
X-Mailer: Apple Mail (2.3731.500.231)
Archived-At: <https://mailarchive.ietf.org/arch/msg/cbor/DEIP1JiQwvIO_-VYmVFoqRpjZpw>
Subject: Re: [Cbor] Updated Drafts for dCBOR I-D and Gordian Envelope Structured Data Format I-D & IANA Tag Registration
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, 08 May 2023 22:42:21 -0000

Carsten:

Thank you for pointing this out. Here is my current edit:

> ## 65-bit negative integers disallowed
> 
> The largest negative integer that can be represented in 64-bit two's complement (STANDARD_NEGATIVE_INT_MAX) is -2^63 (0x8000000000000000).
> 
> However, CBOR can encode negative integers as low as CBOR_NEGATIVE_INT_MAX, which is -2^64 (two's complement: 0x10000000000000000, CBOR: 0x3BFFFFFFFFFFFFFFFF). Negative integers in the range [CBOR_NEGATIVE_INT_MAX ... STANDARD_NEGATIVE_INT_MAX - 1] would require 65 bits, and are thus not representable in machine-sized integers.
> 
> Because of this incompatibility between the CBOR and standard representations, dCBOR disallows encoding negative integer values in the range [CBOR_NEGATIVE_INT_MAX ... STANDARD_NEGATIVE_INT_MAX - 1]: conformant encoders MUST never encode these values and conformant decoders MUST reject these values as invalid.
> 
> Implementations that support BIGNUM are able to encode and decode these values as BIGNUM.

~ Wolf

> On May 8, 2023, at 1:35 PM, Carsten Bormann <cabo@tzi.org> wrote:
> 
> On 2023-05-08, at 19:40, Christopher Allen <christophera@lifewithalacrity.com> wrote:
>> 
>> * Based on feedback from Anders Rundgren, the requirement that CBOR_NEGATIVE_INT_MAX be disallowed has been added.
> 
> I don’t understand Section 3.5.
> This appears to be confused: the whole range from -(2**64) to
> -(2**63)-1 fits in an nint (major type 1) but cannot be represented 
> in an int64 and will need to use a larger integer size 
> (or bignum support) of the platform.
> 
> Grüße, Carsten
>