Merged
Conversation
e102880 to
ed52c10
Compare
a427565 to
b6a7e7e
Compare
akshaymankar
requested changes
Jan 8, 2026
Comment on lines
109
to
124
| -- = Format Specification | ||
| -- | ||
| -- The input is expected to be a serialized CBOR Map adhering to the rules defined in __RFC 8949__. | ||
| -- | ||
| -- The structure of the map is expected to be as follows: | ||
| -- | ||
| -- * **Root Object**: CBOR Map (Major Type 5). | ||
| -- * **Key 0** (@Unsigned Int@): Protocol Version or Algorithm Identifier. | ||
| -- * **Key 1** (@Unsigned Int@): **The Prekey ID** (Target of extraction). | ||
| -- * **Key 2** (@Map@): The raw Public Key material (often a nested COSE-like structure). | ||
| -- | ||
| -- = References | ||
| -- | ||
| -- * <https://www.rfc-editor.org/rfc/rfc8949.html RFC 8949>: Concise Binary Object Representation (CBOR) | ||
| -- * <https://www.rfc-editor.org/rfc/rfc9052.html RFC 9052>: CBOR Object Signing and Encryption (COSE) - /Contextual/ | ||
| -- |
Member
There was a problem hiding this comment.
Instead of this comment, can we please write a type and parse things into it? Then the comment could just be a link to the spec.
This would also make the code much simpler because we're now parsing into a generic CBOR term.
Comment on lines
125
to
133
| -- == Errors | ||
| -- | ||
| -- This function returns a 'Left String' in the following cases: | ||
| -- | ||
| -- 1. The input is not valid base64 data. | ||
| -- 2. The input is not valid CBOR data. | ||
| -- 3. The root object is not a Map. | ||
| -- 4. The key @1@ is missing from the Map. | ||
| -- 5. The value associated with key @1@ is not an integer. |
Member
There was a problem hiding this comment.
This is gonna go stale as soon as someone touches it. If we really want this, we should create an error type. Otherwise, I'm also ok with just deleting this part.
b6a7e7e to
f00fc9f
Compare
f6fd80a to
38aabc0
Compare
Comment on lines
110
to
130
| -- | Represents the EDHOC Prekey Bundle payload. | ||
| -- | ||
| -- Structure based on X3DH Key Agreement Protocol patterns: | ||
| -- | ||
| -- * **Root Object**: CBOR Map (Major Type 5). | ||
| -- * **Key 0** (@Unsigned Int@): Protocol Version or Algorithm Identifier. | ||
| -- Indicates the version of the handshake or algorithm suite being used (e.g., Curve25519 + AES-GCM). | ||
| -- * **Key 1** (@Unsigned Int@): **The Prekey ID** (Target of extraction). | ||
| -- The specific ID of the key being retrieved. | ||
| -- * **Key 2** (@Map@): **Identity Public Key**. | ||
| -- The long-term X25519 public key of the recipient (e.g., Map {0: Bytes(32)}). | ||
| -- * **Key 3** (@Map@): **Signed Prekey Public Key**. | ||
| -- A medium-term key (e.g., Map {0: {0: Bytes(32)}}). | ||
| -- * **Key 4** (@Null@): **One-Time Prekey**. | ||
| -- This field is Null if the server is out of one-time keys for this user. | ||
| -- | ||
| -- = References | ||
| -- | ||
| -- * <https://www.rfc-editor.org/rfc/rfc8949.html RFC 8949>: Concise Binary Object Representation (CBOR) | ||
| -- * <https://www.rfc-editor.org/rfc/rfc7748.html RFC 7748>: Elliptic Curves for Security (X25519) | ||
| -- * <https://www.rfc-editor.org/rfc/rfc9052.html RFC 9052>: CBOR Object Signing and Encryption (COSE) |
Member
There was a problem hiding this comment.
I'm not sure why we're using COSE here. The Prekey decoder in the rust proteus library only has 3 things: https://github.com/wireapp/proteus/blob/b92dbc2d0c77105cae3911a7388acba05450a06d/src/internal/keys.rs#L204-L222
ebd49b0 to
cfe7667
Compare
akshaymankar
approved these changes
Jan 21, 2026
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
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.
https://wearezeta.atlassian.net/browse/WPB-19575
Checklist
changelog.d