Add rust-hpke X-Wing benchmarks (via v0.14.0-pre.2) and update README coverage - #8
Merged
Merged
Conversation
Bump rust-hpke dependency from hpke v0.13 to v0.14.0-pre.2 (git pin, rev 5c682cf2). The v0.14 API removes the explicit RNG argument from gen_keypair() and setup_sender(); update all call sites. Add rust-hpke to all previously-omitted X-Wing groups (kem/xwing and xwing_chacha20). All three libraries implement draft-connolly-cfrg-xwing-kem-06 via the same x-wing crate (timing is directly comparable).
Fixes rand_core SemVer mismatch by introducing RhChaCha20Rng reference wrapper, delegating trait methods, and migrating rust-hpke bench calls to use _with_rng variants.
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.
This PR makes two improvements to the comparative benchmark suite:
rust-hpke is added to all previously-omitted X-Wing benchmark groups by bumping the dev-dependency from hpke v0.13 to a v0.14 pre-release (git pin, rev =
5c682cf2). With v0.14, the basegen_keypair()andsetup_sender()methods no longer accept an explicit RNG argument, and the crate upgraded its bounds to rand_core 0.9. To maintain our deterministicChaCha20Rngentropy source across all comparative benchmarks, this PR introduces a zero-costRhChaCha20Rngreference wrapper and migrates all rust-hpke call sites to use the new_with_rng()variants. Notably, the wrapper natively delegatesnext_u32/next_u64calls to prevent severe performance regressions observed during X25519 rejection sampling (e.g. localkem/x25519/rust_hpke/generatebenchmarking — ~25.6 µs before vs. ~56.4 µs after). The six new rust-hpke rows coverkem/xwing(i.e.generate,derive_key_pair,encap_via_setup_sender,decap_via_setup_receiverfunctions) andxwing_chacha20(i.e.setup_sender,setup_receiverfunctions). Previously, those groups benched hpke-ng and hpke-rs but omitted rust-hpke, making the comparative benchmarks suite incomplete. Note that all three libraries implementdraft-connolly-cfrg-xwing-kem-06(i.e. draft no. 6) via the same x-wing crate (^0.1.0-rc.0) and share KEM_ID0x647a; thus, timing is directly comparable with no caveats.The README performance section is updated to reflect that rust-hpke benchmarks now cover X-Wing, and benchmark totals as well as X-Wing-specific deltas are replaced with
TBDpending a cleancargo benchrun. In addition, thegetrandomfeature flag is removed from thehpkedependency inCargo.toml. It is a default feature in rust-hpke and listing it explicitly is redundant.All new bench groups compile and run under: