-
Notifications
You must be signed in to change notification settings - Fork 18
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
Support CoseKey field ordering #85
Conversation
fb85c29
to
3163b30
Compare
src/common/mod.rs
Outdated
Lexicographic, | ||
/// Order values by encoded length, then by lexicographic ordering of encoded form, as per RFC | ||
/// 7049 section 3.9 (Canonical CBOR). | ||
LengthLexicographic, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LengthFirstLexicographic ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
src/key/tests.rs
Outdated
struct TestCase { | ||
key_data: &'static str, // hex | ||
canonical_key: CoseKey, | ||
deterministic_key: CoseKey, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does "deterministic" mean here? How does it relate to "canonical"?
Maybe "old_canonical", "new_canonical"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
RFC 7049 talks about "canonical CBOR", RFC 8949 talks about "deterministic encoding".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, but RFC 7049 is obsoleted by RFC 8949, so both are deterministic now. (And it says "The terms are essentially interchangeable".)
We don't use the term deterministic elsewhere in the code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Deterministic" isn't mentioned elsewhere in the code because CBOR/COSE spec tried quite hard to avoid it being necessary – they just missed that COSE_Key
is likely to end up being signed-over in chains.
Moved to use rfcNNNN_
prefixes.
No description provided.