diff --git a/Cargo.lock b/Cargo.lock index 1c49d7e7..cfb08176 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1934,6 +1934,18 @@ dependencies = [ "hybrid-array", ] +[[package]] +name = "crypto_primitives_bench" +version = "0.1.0" +dependencies = [ + "anyhow", + "key_protocol", + "nssa_core", + "rand 0.8.5", + "serde", + "serde_json", +] + [[package]] name = "ctr" version = "0.9.2" diff --git a/Cargo.toml b/Cargo.toml index f41a41df..aa8eaba4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -38,7 +38,7 @@ members = [ "examples/program_deployment/methods/guest", "testnet_initial_state", "indexer/ffi", - "tools/wallet_crypto_bench", + "tools/crypto_primitives_bench", ] [workspace.dependencies] diff --git a/docs/benchmarks/README.md b/docs/benchmarks/README.md index 65a57c80..9289d2bf 100644 --- a/docs/benchmarks/README.md +++ b/docs/benchmarks/README.md @@ -5,6 +5,6 @@ Bench tools live under `tools/` with READMEs for how to run each one. This direc | Bench | Doc | |---|---| | cycle_bench | [cycle_bench.md](cycle_bench.md) | -| wallet_crypto_bench | [wallet_crypto_bench.md](wallet_crypto_bench.md) | +| crypto_primitives_bench | [crypto_primitives_bench.md](crypto_primitives_bench.md) | All numbers are from a single M2 Pro dev box unless noted otherwise. diff --git a/docs/benchmarks/wallet_crypto_bench.md b/docs/benchmarks/crypto_primitives_bench.md similarity index 77% rename from docs/benchmarks/wallet_crypto_bench.md rename to docs/benchmarks/crypto_primitives_bench.md index a786f875..f25650af 100644 --- a/docs/benchmarks/wallet_crypto_bench.md +++ b/docs/benchmarks/crypto_primitives_bench.md @@ -1,6 +1,6 @@ -# wallet_crypto_bench +# crypto_primitives_bench -Wallet-side cryptographic primitives. Measures the per-call cost of key derivation, sender-side DH for note encryption, and Account note symmetric encrypt/decrypt. Standalone host binary, no live stack required. +Cryptographic primitives used by client/wallet code. Measures the per-call cost of key derivation, sender-side DH for note encryption, and Account note symmetric encrypt/decrypt. Standalone host binary, no live stack required. ## Machine @@ -33,10 +33,10 @@ Wallet-side cryptographic primitives. Measures the per-call cost of key derivati ## Reproduce ```sh -cargo run --release -p wallet_crypto_bench +cargo run --release -p crypto_primitives_bench ``` -JSON output: `target/wallet_crypto_bench.json`. +JSON output: `target/crypto_primitives_bench.json`. ## Caveats diff --git a/tools/wallet_crypto_bench/Cargo.toml b/tools/crypto_primitives_bench/Cargo.toml similarity index 90% rename from tools/wallet_crypto_bench/Cargo.toml rename to tools/crypto_primitives_bench/Cargo.toml index aa0e51b1..e6d1240c 100644 --- a/tools/wallet_crypto_bench/Cargo.toml +++ b/tools/crypto_primitives_bench/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "wallet_crypto_bench" +name = "crypto_primitives_bench" version = "0.1.0" edition = "2024" license = { workspace = true } diff --git a/tools/wallet_crypto_bench/README.md b/tools/crypto_primitives_bench/README.md similarity index 63% rename from tools/wallet_crypto_bench/README.md rename to tools/crypto_primitives_bench/README.md index 84a67bf1..f45174c4 100644 --- a/tools/wallet_crypto_bench/README.md +++ b/tools/crypto_primitives_bench/README.md @@ -1,11 +1,11 @@ -# wallet_crypto_bench +# crypto_primitives_bench -Wallet-side cryptographic microbenchmarks. Single host binary, no live sequencer or Bedrock needed. +Cryptographic primitive microbenchmarks used by client/wallet code. Single host binary, no live sequencer or Bedrock needed. ## Run ```sh -cargo run --release -p wallet_crypto_bench +cargo run --release -p crypto_primitives_bench ``` ## What you'll see @@ -17,4 +17,4 @@ Per-operation `best_us`, `mean_us`, and `stdev_us` over 100 iterations (plus 2 w - `SharedSecretKey::new (sender DH)` — secp256k1 ECDH per recipient. - `EncryptionScheme::encrypt` / `decrypt` — ChaCha20 over an Account note. -JSON output is written to `target/wallet_crypto_bench.json`. +JSON output is written to `target/crypto_primitives_bench.json`. diff --git a/tools/wallet_crypto_bench/src/main.rs b/tools/crypto_primitives_bench/src/main.rs similarity index 99% rename from tools/wallet_crypto_bench/src/main.rs rename to tools/crypto_primitives_bench/src/main.rs index df52aacf..ea727654 100644 --- a/tools/wallet_crypto_bench/src/main.rs +++ b/tools/crypto_primitives_bench/src/main.rs @@ -169,7 +169,7 @@ fn write_json(results: &[OpResult]) -> Result<()> { .canonicalize()?; let out_path = workspace_root .join("target") - .join("wallet_crypto_bench.json"); + .join("crypto_primitives_bench.json"); if let Some(parent) = out_path.parent() { std::fs::create_dir_all(parent)?; }