Expand standalone bench suite to mirror comparative.rs and add rust-hpke memory footprint to README - #10
Merged
Conversation
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 benchmark infrastructure:
benches/bench.rsis rewritten to functionally serve as a standalone mirror of thehpke_ngmembers incomparative.rs. Group names and benchmark IDs now match exactly (e.g.kem/x25519/hpke_ng/generate,x25519_chacha20_seal_sweep/hpke_ng/64). The previousbench.rsused a flat monolithic structure (bench_kem,bench_setup,bench_seal_open,bench_export) with ad-hoc group names that did not align withcomparative.rs. The rewrite switchesOsRngto a seededChaCha20Rng(matching the entropy source incomparative.rs), splits into per-KEM and per-ciphersuite functions, and fills the following coverage gaps:p256derive_key_pairanddecap(previously missing);k256all four ops (previously absent entirely); PQ KEM groups (kem/xwing,kem/mlkem768,kem/mlkem1024) and their setup counterparts under#[cfg(feature = "pq")]; AES-128 seal and open sweeps;context_open(seal + open), matching the lockstep design incomparative.rs; export lengths expanded from[32, 64, 128]toEXPORT_LENGTHS = [16, 32, 64, 128, 256]; and aroundtrip_1kend-to-end benchmark.bench.rsalso addshpke_ng/auth_encapandhpke_ng/auth_decapinsidekem/x25519, which are not present incomparative.rs.criterion_group!/criterion_main!are split intoclassical_benchesandpq_bencheswith cfg gates so--features pqcontrols which targets compile. The new suite compiles and runs under:rust-hpkememory footprint data collected in the prior session. The memory table gains arust-hpkecolumn coveringContext<_, _, ChaCha20Poly1305>(96 bytes),ExportOnly(184 bytes),Aes128Gcm(912 bytes),Aes256Gcm(1,168 bytes), and minimal release binary (430 KB), with a note explaining theAeadCtxS/AeadCtxRtype equivalents, the KDF-dependent size growth, and why theExportOnlyrow is larger inrust-hpkethan inhpke-ng. Table column separators are also aligned throughout for readability.