Skip to content

feat: Add support for HPKE#377

Open
poljar wants to merge 15 commits into
mainfrom
poljar/hpke-pr
Open

feat: Add support for HPKE#377
poljar wants to merge 15 commits into
mainfrom
poljar/hpke-pr

Conversation

@poljar

@poljar poljar commented Jul 8, 2026

Copy link
Copy Markdown
Collaborator

This replaces #289.

Cleans up the history a bit and rebases on top of main now that #206 is merged, otherwise it's the same as #289.

I left the branch for #289 alive as the Rust SDK PR uses the git revisions and I didn't want to break the build as I

@poljar
poljar requested a review from dkasak as a code owner July 8, 2026 10:29
@poljar poljar mentioned this pull request Jul 8, 2026
@codspeed-hq

codspeed-hq Bot commented Jul 8, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 6 untouched benchmarks


Comparing poljar/hpke-pr (fd6770f) with main (6b38b2c)

Open in CodSpeed

@codecov-commenter

codecov-commenter commented Jul 8, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 98.56631% with 8 lines in your changes missing coverage. Please review.
✅ Project coverage is 91.69%. Comparing base (6b38b2c) to head (fd6770f).
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
src/hpke/messages.rs 95.94% 0 Missing and 3 partials ⚠️
src/hpke/sender.rs 96.62% 0 Missing and 3 partials ⚠️
src/hpke/mod.rs 99.45% 1 Missing ⚠️
src/hpke/recipient.rs 99.11% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #377      +/-   ##
==========================================
+ Coverage   90.93%   91.69%   +0.75%     
==========================================
  Files          34       40       +6     
  Lines        4955     5501     +546     
  Branches     4955     5501     +546     
==========================================
+ Hits         4506     5044     +538     
- Misses        286      287       +1     
- Partials      163      170       +7     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

@poljar
poljar force-pushed the poljar/hpke-pr branch 4 times, most recently from 587d6aa to 947dfe5 Compare July 10, 2026 14:13

@dkasak dkasak left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Almost there. I fixed a bunch of things myself (pair reviewing with poljar) and requested a single change. Once that's done, we're good to approve.

Comment thread src/hpke/recipient.rs Outdated
let their_public_key = *encapsulated_key;
let our_public_key = Curve25519PublicKey::from(&secret_key);

let secret_key = convert_secret_key(&secret_key);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since the secret key is never exposed, couldn't we use hpke::PrivateKey instead and only do the conversion for the public key?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did so in 7f436c0.

@poljar
poljar requested a review from dkasak July 17, 2026 16:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants