[Cbor] Re: Serialization checking and big numbers (was Re: Working Group Last Call on Serialization draft)
Laurence Lundblade <lgl@island-resort.com> Thu, 17 September 2026 19:27 UTC
Received: from sender4-pp-f112.zoho.com (sender4-pp-f112.zoho.com [136.143.188.112]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by mx.ietf.org (Postfix) with ESMTPS id 0EB5342 for <cbor@ietf.org>; Thu, 17 Sep 2026 19:27:43 +0000 (UTC)
Authentication-Results: mx.ietf.org; dkim=none ("invalid DKIM record") header.d=island-resort.com header.s=island header.b=LKGPTzFC; arc=pass ("zohomail.com:s=zohoarc:i=1"); dmarc=none; spf=pass (mx.ietf.org: domain of lgl@island-resort.com designates 136.143.188.112 as permitted sender) smtp.mailfrom=lgl@island-resort.com
ARC-Seal: i=1; a=rsa-sha256; t=1789673253; cv=none; d=zohomail.com; s=zohoarc; b=m+Eu0XzKRd5nwkMm+F1ISeFkxYwRKGSuj4lWAOj9CgekT19wr25l5PFsPtLabhzBpOudHZBkzjJkw3eWU8TMscAGlP5EKke1TXpO8eyH2rmDNIEtk4PTnfiT2OkEinWHH3bdGLjHYf1GDfSJhN7tHb2S/gNNaofmZ1Q00DVidQE=
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1789673253; h=Content-Type:Cc:Cc:Date:Date:From:From:In-Reply-To:MIME-Version:Message-ID:Subject:Subject:To:To:Message-Id:Reply-To; bh=yu/Ap4u230dzu8WTdWe30eromgC7IPB7CTlZPPmuAeQ=; b=DQ6x9/xNQljKEx4kYmTYumXpFYtH6W5BlX0DqMNrKsQB3t6yaGMIugPP4i06SL+oQjZRSO0BOWVGxyfh3HeZ826io1apA5oIt3jwF8c/Fbw9DNg0KUKR3F911Jhz8ZKQGvwmc9WT14Z48hk6LWuMdtb6rL0Uxmn7ikXB09B6T1c=
ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=island-resort.com; spf=pass smtp.mailfrom=lgl@island-resort.com; dmarc=pass header.from=<lgl@island-resort.com>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1789673253; s=island; d=island-resort.com; i=lgl@island-resort.com; h=From:From:Message-Id:Message-Id:Content-Type:Mime-Version:Subject:Subject:Date:Date:In-Reply-To:Cc:Cc:To:To:Reply-To; bh=yu/Ap4u230dzu8WTdWe30eromgC7IPB7CTlZPPmuAeQ=; b=LKGPTzFC6r6GQs6ASkGGkRgdUZ49+ML8QvqHJwRppJS8UhPQ7Scwd7H3/Fo7qYZ9 BIrRGmsA0u34yxMnJOxQ9tXkXf5VIjoIUWUFcuZLBLuIvPBhFY9Dx3iLfUTzRMeURXq R2sgpShXBGZwLyZnbAfLEWU6o4Qtqshgy7ejcrCY=
Received: by smtp.zohomail.com with SMTPS id 1789673251851142.01874333463638; Thu, 17 Sep 2026 12:27:31 -0700 (PDT)
From: Laurence Lundblade <lgl@island-resort.com>
Message-Id: <6BE46F8B-EF4E-4652-9860-AC14ADB2054D@island-resort.com>
Content-Type: multipart/alternative; boundary="Apple-Mail=_6FBBBAC6-BC48-4D69-BBC0-2915CE48E918"
Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3826.500.181.1.5\))
Date: Thu, 17 Sep 2026 12:27:19 -0700
In-Reply-To: <6B0E8D75-EC3D-48BC-8E2E-E2AF4C99BA9D@island-resort.com>
To: Joe Hildebrand <hildjj@cursive.net>, Anders Rundgren <anders.rundgren.net@gmail.com>
References: <CALaySJJa=QjUM5B6d8boiFb8qyRwf6LO32WVVWBGuCWtSmEFCQ@mail.gmail.com> <876653A4-6425-45E1-A77A-F0A6A1315BDD@cursive.net> <6B0E8D75-EC3D-48BC-8E2E-E2AF4C99BA9D@island-resort.com>
X-Mailer: Apple Mail (2.3826.500.181.1.5)
X-ZohoMailClient: External
X-Spamd-Bar: /
Message-ID-Hash: 7L6JMWT62LW5IPJDNAFYWCNSGPCEYNEB
X-Message-ID-Hash: 7L6JMWT62LW5IPJDNAFYWCNSGPCEYNEB
X-MailFrom: lgl@island-resort.com
X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; header-match-cbor.ietf.org-0; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header
CC: Barry Leiba <barryleiba@gmail.com>, CBOR Working Group <cbor@ietf.org>
X-Mailman-Version: 3.3.10
Precedence: list
Subject: [Cbor] Re: Serialization checking and big numbers (was Re: Working Group Last Call on Serialization draft)
List-Id: "Concise Binary Object Representation (CBOR)" <cbor.ietf.org>
Archived-At: <https://mailarchive.ietf.org/arch/msg/cbor/cRqslsydKZq8CHGuM-CI8vW_4OY>
List-Archive: <https://mailarchive.ietf.org/arch/browse/cbor>
List-Help: <mailto:cbor-request@ietf.org?subject=help>
List-Owner: <mailto:cbor-owner@ietf.org>
List-Post: <mailto:cbor@ietf.org>
List-Subscribe: <mailto:cbor-join@ietf.org>
List-Unsubscribe: <mailto:cbor-leave@ietf.org>
Because of Ander’s comment on the other thread, I’ve concluded that preferred-plus checking decoders must disallow leading zeros even though it conflicts with 8949. I’ve added this text to the serialization checking appendix: G.2. Big Number Leading Zero Exception Section 3.4.3 of [RFC8949] requires that decoders supporting tags 2 and 3 be able to decode bignums that have leading zeros, even though preferred serialization never produces them. This conflicts with the goal of a decoder that checks for preferred or deterministic serialization: such a decoder needs to reject a bignum with leading zeros as non-conformant. This document recommends that decoders performing serialization checking reject bignums containing leading zeros, notwithstanding the MUST in Section 3.4.3 of [RFC8949]. Serialization checking is optional. When a protocol selects it — for example, because it depends on deterministic encoding — decoders are expected to perform the check, including rejecting non-preferred bignum encodings such as those with leading zeros. Note that serialization-checking decoders always reject the empty byte string, because it represents the value zero, which is encoded as major type 0. ----- I’ve also improved the decode requirement for bignums in [this PR]. LL [this PR]: https://github.com/cbor-wg/draft-ietf-cbor-serialization/pull/93 > On Sep 16, 2026, at 11:06 AM, Laurence Lundblade <lgl@island-resort.com> wrote: > > >> On Aug 18, 2026, at 12:05 PM, Joe Hildebrand <hildjj@cursive.net> wrote: >> >> s4.2: "Leading zeros MUST be ignored" for bignums. I don't understand this. Shouldn't they error? This goes to my overall point about what this draft means for decoders. > > [Section 3.4.3 of RFC 8949] unequivocally says: > > Decoders that understand these tags MUST be able to decode bignums that do have leading zeroes. > > Preferred-plus, as the base for deterministic has to say: > > Leading zeros MUST NOT be encoded. > > What should a serialization checking decoder do for preferred-plus? Not do full checking of big numbers or violate 3.4.3? > > LL > > > [Section 3.4.3 of RFC 8949]: https://www.rfc-editor.org/rfc/rfc8949.html#name-bignums
- [Cbor] Working Group Last Call on Serialization d… Barry Leiba
- [Cbor] Re: Working Group Last Call on Serializati… Anders Rundgren
- [Cbor] Re: Working Group Last Call on Serializati… Laurence Lundblade
- [Cbor] Re: Working Group Last Call on Serializati… Brian Sipos
- [Cbor] Re: Working Group Last Call on Serializati… Rohan Mahy
- [Cbor] Re: Working Group Last Call on Serializati… Brian Sipos
- [Cbor] Re: Working Group Last Call on Serializati… Laurence Lundblade
- [Cbor] What is the data model used in draft-ietf-… Christian Amsüss
- [Cbor] [off-list] What is the data model used in … Christian Amsüss
- [Cbor] Re: Working Group Last Call on Serializati… Vadim Goncharov
- [Cbor] Re: Working Group Last Call on Serializati… Carsten Bormann
- [Cbor] Re: Working Group Last Call on Serializati… Vadim Goncharov
- [Cbor] Re: [Ext] Working Group Last Call on Seria… Paul Hoffman
- [Cbor] Re: [Ext] Working Group Last Call on Seria… Laurence Lundblade
- [Cbor] Re: Working Group Last Call on Serializati… Joe Hildebrand
- [Cbor] Re: Working Group Last Call on Serializati… Laurence Lundblade
- [Cbor] Re: Working Group Last Call on Serializati… Anders Rundgren
- [Cbor] Re: Working Group Last Call on Serializati… Laurence Lundblade
- [Cbor] Re: Working Group Last Call on Serializati… Carsten Bormann
- [Cbor] Re: Working Group Last Call on Serializati… Vadim Goncharov
- [Cbor] Re: Working Group Last Call on Serializati… Laurence Lundblade
- [Cbor] Re: Working Group Last Call on Serializati… Vadim Goncharov
- [Cbor] Re: Working Group Last Call on Serializati… Joe Hildebrand
- [Cbor] Re: Working Group Last Call on Serializati… Joe Hildebrand
- [Cbor] List of all serialization variation (was R… Laurence Lundblade
- [Cbor] Re: List of all serialization variation (w… Joe Hildebrand
- [Cbor] Re: List of all serialization variation (w… Laurence Lundblade
- [Cbor] Re: List of all serialization variation (w… Laurence Lundblade
- [Cbor] Serialization checking and big numbers (wa… Laurence Lundblade
- [Cbor] Re: Serialization checking and big numbers… Laurence Lundblade
- [Cbor] Re: Working Group Last Call on Serializati… Laurence Lundblade
- [Cbor] Re: Working Group Last Call on Serializati… Martine Sophie Lenders
- [Cbor] Promote Appdendix A (was Re: Working Group… Laurence Lundblade
- [Cbor] Re: Working Group Last Call on Serializati… Mikolai Gütschow
- [Cbor] Re: Working Group Last Call on Serializati… Anders Rundgren
- [Cbor] Tag rule -> update to 8949 (was Re: Workin… Laurence Lundblade
- [Cbor] Re: Working Group Last Call on Serializati… Laurence Lundblade
- [Cbor] Re: Working Group Last Call on Serializati… Carsten Bormann
- [Cbor] Re: Working Group Last Call on Serializati… Laurence Lundblade
- [Cbor] Re: Working Group Last Call on Serializati… Laurence Lundblade