-
Notifications
You must be signed in to change notification settings - Fork 619
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
Small HPKE trait tweaks #1737
Merged
Merged
Small HPKE trait tweaks #1737
Conversation
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
djc
approved these changes
Jan 9, 2024
Benchmark resultsInstruction countsSignificant differencesClick to expand
Other differencesClick to expand
Wall-timeSignificant differencesThere are no significant wall-time differences Other differencesClick to expand
Additional informationCheckout details:
|
* Move the public key/secret key arguments to be last, since they are "long lived". * Rename `pk_r` -> `pub_key` and `sk_r` to `secret_key`. Reference RFC 9180's terse names.
Encrypted Client Hello support requires that clients maintain the HPKE sealer context between sending an initial client hello, and processing a hello retry request, such that the subsequent client hello can re-use the HPKE state. This commit updates the HPKE trait to add `setup_sealer` and `setup_opener` fns in addition to the "one-shot" APIs. New `HpkeSealer` and `HpkeOpener` traits are used to represent the stateful sender/receiver contexts in a backend neutral way. The existing hpke-rs provider example is updated to implement the new required traits and fns.
This type holds simple numeric identifiers and can be cheaply copied.
In practice we need `'static` here to be able to easily hold `Box<dyn HpkeSender>` and friends. Our existing provider implementation already matches this lifetime bound.
ctz
approved these changes
Jan 9, 2024
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #1737 +/- ##
==========================================
- Coverage 96.16% 96.15% -0.01%
==========================================
Files 80 80
Lines 17337 17338 +1
==========================================
Hits 16672 16672
- Misses 665 666 +1 ☔ View full report in Codecov by Sentry. |
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.
Pulling out more work from #1718 that can land ahead of the ECH-specific work.