Skip to content

Commit 666c527

Browse files
authored
Merge pull request #45 from cbor-wg/close-43
Close #43, replace and close #44 (Input for Interim on 2025-10-15)
2 parents 2ff17fb + 3111f06 commit 666c527

File tree

1 file changed

+14
-5
lines changed

1 file changed

+14
-5
lines changed

draft-ietf-cbor-cde.md

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -665,13 +665,22 @@ This is only a validity requirement as enforcing this requires the
665665
encoder to be aware of all map keys at the same time, which may be
666666
particularly difficult to implement for streaming encoders.
667667
The `lexicographic-map-sorting` encoding constraint does require such
668-
awareness already as a prerequisite to sorting the entries by map key;
669-
the check therefore becomes trivial, as multiple entries with the same
670-
map key would be consecutive.
671-
Given this opportunity, the encoding constraint therefore is
668+
awareness already as a prerequisite to sorting the entries by map key.
669+
In combination with the other CDE encoding constraints
670+
`preferred-serialization` and `definite-length-only`, the check
671+
therefore becomes trivial: multiple entries with the same
672+
map key would have the same (deterministic) map key serialization and
673+
would therefore be consecutive when sorted.
674+
Given this opportunity, the `lexicographic-map-sorting` encoding constraint
675+
therefore is
672676
deliberately phrased to require consecutive entries to have strictly
673-
increasing map keys; this prevents encoding multiple entries that have
677+
increasing map keys; with the other CDE encoding constraints, this prevents
678+
encoding multiple entries that have
674679
the same key.
680+
Note that {{Section 5.6.1 of RFC8949@-cbor}} lists one specific case
681+
"(specifically, -0.0 is equal to 0.0)" where two different keys are
682+
considered equivalent for the purpose of duplicate map keys; this
683+
needs to be checked with extra code for a full validity checker.
675684

676685

677686
# CDDL support

0 commit comments

Comments
 (0)