Skip to content

Add rust-hpke X-Wing benchmarks (via v0.14.0-pre.2) and update README coverage - #8

Merged
nadimkobeissi merged 4 commits into
symbolicsoft:mainfrom
danieldia-dev:xwing
May 29, 2026
Merged

Add rust-hpke X-Wing benchmarks (via v0.14.0-pre.2) and update README coverage#8
nadimkobeissi merged 4 commits into
symbolicsoft:mainfrom
danieldia-dev:xwing

Conversation

@danieldia-dev

@danieldia-dev danieldia-dev commented May 28, 2026

Copy link
Copy Markdown
Contributor

This PR makes two improvements to the comparative benchmark suite:

  1. 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 base gen_keypair() and setup_sender() methods no longer accept an explicit RNG argument, and the crate upgraded its bounds to rand_core 0.9. To maintain our deterministic ChaCha20Rng entropy source across all comparative benchmarks, this PR introduces a zero-cost RhChaCha20Rng reference wrapper and migrates all rust-hpke call sites to use the new _with_rng() variants. Notably, the wrapper natively delegates next_u32/next_u64 calls to prevent severe performance regressions observed during X25519 rejection sampling (e.g. local kem/x25519/rust_hpke/generate benchmarking — ~25.6 µs before vs. ~56.4 µs after). The six new rust-hpke rows cover kem/xwing (i.e. generate, derive_key_pair, encap_via_setup_sender, decap_via_setup_receiver functions) and xwing_chacha20 (i.e. setup_sender, setup_receiver functions). Previously, those groups benched hpke-ng and hpke-rs but omitted rust-hpke, making the comparative benchmarks suite incomplete. Note that all three libraries implement draft-connolly-cfrg-xwing-kem-06 (i.e. draft no. 6) via the same x-wing crate (^0.1.0-rc.0) and share KEM_ID 0x647a; thus, timing is directly comparable with no caveats.

  2. 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 TBD pending a clean cargo bench run. In addition, the getrandom feature flag is removed from the hpke dependency in Cargo.toml. It is a default feature in rust-hpke and listing it explicitly is redundant.

All new bench groups compile and run under:

cargo bench --features comparative --bench comparative -- "kem/xwing"
cargo bench --features comparative --bench comparative -- "xwing_chacha20"

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.
@nadimkobeissi
nadimkobeissi merged commit 779cbd7 into symbolicsoft:main May 29, 2026
5 checks passed
@danieldia-dev
danieldia-dev deleted the xwing branch May 29, 2026 14:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants