-
Notifications
You must be signed in to change notification settings - Fork 20
Support for (non-deterministic) definite-length CBOR objects #245
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
tahina-pro
merged 111 commits into
project-everest:master
from
tahina-pro:_taramana_cbor_nondet
Dec 10, 2025
Merged
Support for (non-deterministic) definite-length CBOR objects #245
tahina-pro
merged 111 commits into
project-everest:master
from
tahina-pro:_taramana_cbor_nondet
Dec 10, 2025
Conversation
This file contains hidden or 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 was referenced Dec 10, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
So far EverCBOR only supported the deterministic encoding of CBOR (IETF RFC 8979 Section 4.2.1.)
This PR introduces CBORNondet, a verified CBOR parsing and serialization library supporting definite-length non-deterministic encoding of CBOR. As a major contribution, CBORNondet checks for map key duplicates in the basic data model, using an amount of stack proportional to the nesting of maps in map entry keys. The user can specify such a bound when calling the CBORNondet parser.
This PR introduces a safe C API for CBORNondet, with as few preconditions as possible: liveness of pointers (but not necessarily the fact that they are not null), consistency of array lengths, and data invariant on values of CBOR object type, but nothing more. In particular, CBORNondet accessor functions no longer require a specific major type on the CBOR object being accessed: for instance,
cbor_nondet_map_iterator_startwill gracefully fail if applied to a non-map CBOR object.TODO:
src/cbor/pulse/nondet/ca maximum size function, anda separation logic predicate for the actual size.More hypothetical:
CBOR.Spec.Raw.Valid.fstiandCBOR.Spec.Raw.Nondet.fstare generic in the data model, but their implementationsCBOR.Pulse.Raw.Nondet.Compare.fstandCBOR.Spec.Raw.fstonly support the basic data model.