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

Jeremy O'Donoghue <jodonogh@qti.qualcomm.com> Wed, 10 May 2023 09:44 UTC

Return-Path: <jodonogh@qti.qualcomm.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 22603C151710 for <cbor@ietfa.amsl.com>; Wed, 10 May 2023 02:44:25 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.696
X-Spam-Level:
X-Spam-Status: No, score=-2.696 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_ZEN_BLOCKED_OPENDNS=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_DBL_BLOCKED_OPENDNS=0.001, URIBL_ZEN_BLOCKED_OPENDNS=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=qualcomm.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 YJCMEBI8ozbU for <cbor@ietfa.amsl.com>; Wed, 10 May 2023 02:44:21 -0700 (PDT)
Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 8A32BC1516FF for <cbor@ietf.org>; Wed, 10 May 2023 02:44:21 -0700 (PDT)
Received: from pps.filterd (m0279862.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 34A9D9hs002830; Wed, 10 May 2023 09:44:20 GMT
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h=from : to : cc : subject : date : message-id : references : in-reply-to : content-type : mime-version; s=qcppdkim1; bh=ff45YGAKl29MQY45xzHR2BZFlZqZMCUrFpcG2q7Ehyk=; b=M+3jC4Icf+GNCkQiWSZcBeprAyK/nqw/ZbxPfzDKWcss7e2aBiOwsLf3j+8S4A4YgCYV L5Y0KHKclIO1KaFtQyPK3VFWRW+cqc2PNu3tFKYZqIUv76RU30G48rremqzFJ+52qkke 9vqbP6IRby3uWhBUQoG2FSZXV0OizEJoViK9tgf86EtlIEg93EFvhKZlQo2kCsqJAVVY JBUHmaywo6qA5YWuuWvNs/zWFQqEDtUMaiVb33pxoYqFwG7coWCJutxzbbKc/k7b3ov7 eX1UHNW+SIbagJYQK2K9n5mSq9FkYJb8sbe9odUzyo5DxXXXsR8fioMTkHciM4R1Ou7W jg==
Received: from nam12-dm6-obe.outbound.protection.outlook.com (mail-dm6nam12lp2174.outbound.protection.outlook.com [104.47.59.174]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3qg1g10sfr-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 10 May 2023 09:44:19 +0000
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DuFYTmuP05rxJZyLSJCAqg2I+LiCavGn/92vloiBqrCjjfqHszdfeVHZAzGuLGO4g46zzvGRp4HiGFWkL2Ia7FMXWjMorFrO/TKLwZ7RGxTpQ3A+DFEWEHuPDc87I0BlH0OLOpzSOJhiDR2/qnd8gnB5gMOsgT1pb3kvWY9//JhCLhrWZDlTVvgsNJBr+O4xAfe3I7lrBPz1A/lCtFw88ANkiP7QECZuS4mUglvLwmcFIqyLr22pm+9DlR24ccsVTuo8b4MvFApDQrnQ21CyV0t5pOIFGJfE8tOZH31vNOWYiFVF5+DcbCgrWolJKOcbD1lTlB/F3kC9puWHFBwCuA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=ff45YGAKl29MQY45xzHR2BZFlZqZMCUrFpcG2q7Ehyk=; b=XpIaigak8NNpIF37Ma0uGhaSQGsVxCWOxC7CnrYIN4T43iP96VSGC7pxiKyJe/r+PvnZe9XKuzqZ/rxUaw123WyM9Cyvj1n7Asx+rRxOKTpIpOwE4IQTcx1M14VffxZ3gSG/7zQiXy0vBj1jC0Fh35FbMyw7YngDubwEpeXVYcFSXO8yrDzGT17QHYQTRz2ZLJG2kmzbmpGSTnkAZ2ZhJR7BVlVHCDTrjkFj31C3OGRdxpPsZzTwnLTa1xR1wPdrg2q2wrEf3EQ+go75+SS8aSMyEZAbyAWjCxIhF05OZ9GENerEXlhlc86cDWCFmlCT+5NBpI/Wz9QVj6qwIioinQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=qti.qualcomm.com; dmarc=pass action=none header.from=qti.qualcomm.com; dkim=pass header.d=qti.qualcomm.com; arc=none
Received: from PH0PR02MB7256.namprd02.prod.outlook.com (2603:10b6:510:1a::23) by PH0PR02MB7686.namprd02.prod.outlook.com (2603:10b6:510:4c::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6363.33; Wed, 10 May 2023 09:44:16 +0000
Received: from PH0PR02MB7256.namprd02.prod.outlook.com ([fe80::e7b8:42d7:7452:fd72]) by PH0PR02MB7256.namprd02.prod.outlook.com ([fe80::e7b8:42d7:7452:fd72%7]) with mapi id 15.20.6363.033; Wed, 10 May 2023 09:44:16 +0000
From: Jeremy O'Donoghue <jodonogh@qti.qualcomm.com>
To: Carsten Bormann <cabo@tzi.org>, Wolf McNally <wolf@wolfmcnally.com>
CC: Christopher Allen <christophera@lifewithalacrity.com>, "cbor@ietf.org" <cbor@ietf.org>, "Shannon.Appelcline@gmail.com" <Shannon.Appelcline@gmail.com>
Thread-Topic: [Cbor] Updated Drafts for dCBOR I-D and Gordian Envelope Structured Data Format I-D & IANA Tag Registration
Thread-Index: AQHZgdRNPhkjcjZYvECmUMDuSpwNF69Q1YOAgAAjdICAAGcOAIAB4mY5
Date: Wed, 10 May 2023 09:44:16 +0000
Message-ID: <PH0PR02MB7256A94640C7C02C75C3795FF2779@PH0PR02MB7256.namprd02.prod.outlook.com>
References: <CAAse2dEFB_FVP6_KkNANSYPW+yX4-M9pN3YkUq5=FTgLZnyWGw@mail.gmail.com> <4EBE3640-5F7F-46B8-961A-D1872A6A0CA4@tzi.org> <463016EF-0DAB-45D4-AB30-53FB2B76F52B@wolfmcnally.com> <DD0E7621-EE3A-496E-9D2C-1CD00E2D92F9@tzi.org>
In-Reply-To: <DD0E7621-EE3A-496E-9D2C-1CD00E2D92F9@tzi.org>
Accept-Language: en-GB, en-US
Content-Language: en-GB
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-ms-publictraffictype: Email
x-ms-traffictypediagnostic: PH0PR02MB7256:EE_|PH0PR02MB7686:EE_
x-ms-office365-filtering-correlation-id: b9face29-d01b-4fb6-1f53-08db513b1ed8
x-ms-exchange-senderadcheck: 1
x-ms-exchange-antispam-relay: 0
x-microsoft-antispam: BCL:0;
x-microsoft-antispam-message-info: Eet6nA3z/6rJq4l0vvO1CK8RxKPFHI/YMpkoo5a6S4w4ONF7vaILGremxlz0PIMf+mV5RAgT+f2fmbWtE/zRe4c+IvChjf1YPHA3X+q69ceSblCOeHkUsuNfHyzgh5Z4ucf/NNX89vAquohPGwqXkoDzwisAZYF96f3MpQBjGcDk+oJGX6qAe5LA5d1+hNDfi3MxtSeOJ6cotg+8SxcCDACqnSA8pBnOLeFWHhD/CUZLZdH9UrhOqKYdkkm21Cfc2OptBHKTuKk4ovHF3iQviHEXF7Uw7wTnLrpW/PrA6HrCOVhR0VTbl6EF1fffjQiM+o3xYGfwf43BQtU5bOm+wjX3UZs4W/PT9lUVSNB14kLSW9DWrYHjXiMBMKUYiYnNyICFktWS1xe6frN8vWDjTmYnFvK/lJ0PUvITX/Qwns46X+far7gs/Qtw7j9HTqMcxcQTAiLM8UX6PaZ1L5KIyAIEUxVxAF4DaPYvpIonWzzBaFB7Q/t658m+rwFl4KsFUJbaajTOwzwNGMx84Qhy7beFfCw0JpErY0VwkN9Bm6B7qrWzlrflJrBtYI0xsDT9TGx1fU2ayuCpvqqxnkHifkzWl3ID8hqmVtwTQqZR3eE=
x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PH0PR02MB7256.namprd02.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230028)(4636009)(346002)(376002)(366004)(136003)(39860400002)(396003)(451199021)(2906002)(26005)(6506007)(53546011)(9686003)(186003)(55016003)(38070700005)(166002)(71200400001)(66556008)(41300700001)(64756008)(66946007)(316002)(66476007)(8676002)(8936002)(4326008)(7696005)(966005)(110136005)(54906003)(33656002)(478600001)(86362001)(66446008)(91956017)(76116006)(83380400001)(38100700002)(5660300002)(52536014)(122000001); DIR:OUT; SFP:1102;
x-ms-exchange-antispam-messagedata-chunkcount: 1
x-ms-exchange-antispam-messagedata-0: MlMdFnBN0sIWJaVwm4iV1oo6PGNJoi+wpYZopJ9SD+X3Irxn0I0hz6L32nFrcYFvuR2bVsU+rQMqi2mRY4/sPPca7wUyw5v3s1dXC3lHBrF6hha/qDkQZWoDjgip7Fr+MY0gLJpuGtm6bb7NMr1qaytLr0UQ62O007KITpQobYfTj7fZbsGCnZUB0Inli4kICWTTZ2bFWZmu907SbOvA0xi38asDUWEBt9bw6EarE6AlFzFGwLjfGrTzi00IqtIdDvsyL+hF8xqxiMI85yLBuFVY0z3fTwNmllosc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6FtqpbE9UzTolb9w5gdTh4O08scTPI6XdPgTmEPhGQ1BP/6XMTV080YG725wtC2WBxyZuITSxtal8ApeVd4JX9C7sURbUG1qOgFUWf01NSyGtW5IozCddPR/Q1usKymlG9U+3uAetvqRcRXnnv9ifsGJeLcM95kXUUr4YNAGydgTsGU6mDDIrJxIheAwo9awFjnhgNe9Iig7NTxD1Q53ofIWossoNWR+KM00KCxZ2/nTXlOjybLdJkvzXir8FYtNIWpdXMh1klZxd7Ok3HIrZ+2QcetVI=
Content-Type: multipart/alternative; boundary="_000_PH0PR02MB7256A94640C7C02C75C3795FF2779PH0PR02MB7256namp_"
MIME-Version: 1.0
X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: w+yTS1dJ2o3SfzdkZf8dkr6spzqayUZXrdPslMNmPCzVRNRg8bEz0oeJtvQE3w2kFxPWoLGS98KSEcPWXRd8f1VXi0nlyKcXJ1a9kbrnK+hdDMZd78xO7XVqBNSwfBrworgK9V6Au0WoMd0GgjZ967VaCXnEb2UnZE5I8Vg/+1hoOnt4mwXpRN2REyHDEkBqtyq/cCnD/nlHSXR8HE5Nt4cruXRVLSF8e9d3tyv0JAbm62Jwca9sAaBz0LCgX+7VIWXIleU3AphWUXhMNZX9DOgADduj5aS7njpe1b+BAm4dW0a4zmRNXXccS2rU1R/ScMniif2NcQMZmI5TenfLQAXuvsVacrfFTiGBJfBMW+HzRnFCzIUjtJL7UX6WmE8WY5g0l4WpEItKye+eoZZwq4J44coj4ssWd57mnGUatIpgOoKGH7TCZOpf1ZkAJQCIPZ1jQ1xDcuQ5YucBSayFssKOvU4SiRF3SMX12YA3FWx8P1iDqWrjPGVDd116D7r+ZryQt+sCFNU0QDdGx7fl0kF1ElJFb883mBlJ5LLzy9YEYWmrC3Xmz0lxqvp1BRlALg/8PyQz6fTafV0afRqpFt/LJByiXCwijJi9ou8WpJk1Rw2eTMWIUsCEKEmNAyqtnbcM7xUsZ7QympjPobe6xESmJ7TmOoaZLHgl60c7CjH6vLRH4x/XZbrDvQFioH2Gj+lMXsKyjFkTeeN4V/RpW+qjf4HFQYob1Kx0r68Wo+QjLCLPvaodlTJOuTIX+AfQ50mmhvr7WofofLhwGcfvVZkI8xy/ipmbTbbcOqVYfljh/ST6jDrDkrIq+V9p4kvmyX326PBfZYNeCDaBxRfragsWxXtQMCqe4Vte567tByzm9MsqEc2iaMTxTO1qXhJuUSYHPj1lFBBRNL9b6Oesvw==
X-OriginatorOrg: qti.qualcomm.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-AuthSource: PH0PR02MB7256.namprd02.prod.outlook.com
X-MS-Exchange-CrossTenant-Network-Message-Id: b9face29-d01b-4fb6-1f53-08db513b1ed8
X-MS-Exchange-CrossTenant-originalarrivaltime: 10 May 2023 09:44:16.5316 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 98e9ba89-e1a1-4e38-9007-8bdabc25de1d
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: SIyA2yXAXL0gcEsthv2Gqpnuw6GF5hnZY3qP8h7ivJAfhvUCNwbNJsk6ROkCOV01WOF0X/PBbwf9DF842Ya5y0bUzpsUEbH3RlWyllXxAt8=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR02MB7686
X-Proofpoint-GUID: Wlc1ea_qP12tl1D6QhVSEg8UowifsRqi
X-Proofpoint-ORIG-GUID: Wlc1ea_qP12tl1D6QhVSEg8UowifsRqi
X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.942,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-05-10_04,2023-05-05_01,2023-02-09_01
X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 mlxlogscore=999 clxscore=1011 spamscore=0 bulkscore=0 phishscore=0 adultscore=0 suspectscore=0 mlxscore=0 malwarescore=0 priorityscore=1501 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2304280000 definitions=main-2305100075
Archived-At: <https://mailarchive.ietf.org/arch/msg/cbor/1CQvLGqkvpkBvj2uYxnrZvLN96k>
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: Wed, 10 May 2023 09:44:25 -0000

To give a very practical use-case, Rust has a native i128 type, for which the most “natural” encoding of Carsten’s example would be as a CBOR negative integer. Haskell uses “unlimited” length integers as (perhaps more usefully) does Python.

I would prefer to see DCBOR require encoding of integer types on the smallest/most natural CBOR type. Only when outside the range of the CBOR positive and negative integer ranges should bigint be used. We don’t have to constrain everything else because of the limitations of the C and C++ builtin integer types.

Best regards
Jeremy

On 09/05/2023, 12:51, "CBOR" <cbor-bounces@ietf.org> wrote:

WARNING: This email originated from outside of Qualcomm. Please be wary of any links or attachments, and do not enable macros.

On 9. May 2023, at 00:42, Wolf McNally <wolf@wolfmcnally.com> wrote:
>
>> 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.
>

How is

"c3 48 89 ab cd ef 01 23 45 67"

a better encoding of -9920249030613615976 than

"3b 89 ab cd ef 01 23 45 67”

?

I think what you are trying to say is the obvious fact that int64 does not include -2**64 to -2**63-1.
The is nothing wrong with encoding values in this range with major type 3, these are just outside the range of int64.
Same with int64, 2**63 to 2**64-1 and major type 1, by the way (these do fit in a uint64, though).

Similar considerations apply to int32, if your applications need that type; there will be some CBOR major type 0 and major type 1 values that your application cannot process where int32 is required.

There is no incompatibility between CBOR and “standard representations”, it just so happens that the boundaries between int8, int16, int32, int64 are not one-to-one with the boundaries between the various lengths of integers that CBOR can express.
So if int64 happens to be your largest native signed integer, you need big integer support (or a third choice in addition to uint64 and int64) for handing around -2**64 to -2**63-1.
This does not mean you cannot (or should not) encode these non-int64 integers as “3b 80…” to “3b ff…”.

Grüße, Carsten

_______________________________________________
CBOR mailing list
CBOR@ietf.org
https://www.ietf.org/mailman/listinfo/cbor