-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[CBOR] Implement Conformance Levels (#35246)
* implement writing sorted keys in maps * rename NoConformance to NonStrict * add tests for strict mode map writes * extract common conformance level logic to helper class * implement reader map conformance levels * add missing struct labels * NonStrict -> Lax * implement CborWriter indefinite length conformance levels * implement CborWriter tag conformance levels * remove preserve float representation check * implement CborReader integer encoding conformance * implement CborReader indefinte-length conformance * implement CborReader tag conformance level validation * factor frame struct out of checkpoint struct * use HashSet for reader key uniqueness * Update src/libraries/System.Security.Cryptography.Encoding/tests/Cbor/CborReader.Integer.cs Co-Authored-By: Jeremy Barton <jbarton@microsoft.com> * address tuple label naming consistency * address PR feedback * address tuple label style * implement appropriate rollback semantics for key conformance validation * rename CborWriter.ToArray() => CborWriter.GetEncoding(); add a span encoding method * implement patching for indefinite-length items * minor CborReader string refactoring * add support for indefinite byte string literals in reader helpers * Implement CborReader.SkipToParent(); * add a validateConformance parameter to Skip* methods * implement CborWriter encodeIndefiniteLengths parameter * make ReadStartMap() and ReadStartArray() return int * strip IndefiniteLength suffix from write methods * replace SortedList use with HashSet * pool key encoding range HashSets * implement writing and reading multiple root-level values * I am disappoint * Update src/libraries/System.Security.Cryptography.Encoding/tests/Cbor/CborConformanceLevel.cs Co-authored-by: Jeremy Barton <jbarton@microsoft.com> * Update src/libraries/System.Security.Cryptography.Encoding/tests/Cbor/CborReader.Array.cs Co-authored-by: Jeremy Barton <jbarton@microsoft.com> * Update src/libraries/System.Security.Cryptography.Encoding/tests/Cbor/CborReader.Tag.cs Co-authored-by: Jeremy Barton <jbarton@microsoft.com> * Update src/libraries/System.Security.Cryptography.Encoding/tests/Cbor/CborReader.cs Co-authored-by: Jeremy Barton <jbarton@microsoft.com> * Update src/libraries/System.Security.Cryptography.Encoding/tests/Cbor/CborWriter.Map.cs Co-authored-by: Jeremy Barton <jbarton@microsoft.com> * address PR feedback * clean up code and add comments; remove unneeded synchronization * rework CborWriter map sorting implementation * store current major type in a field Co-authored-by: Jeremy Barton <jbarton@microsoft.com>
- Loading branch information
Showing
32 changed files
with
2,533 additions
and
420 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.