logos-execution-zone/tools/crypto_primitives_bench
Artem Gureev c12a8759d6 feat!: key note encryption on the nullifier, drop the output index
BREAKING!

Before: The ciphertext key got generated via using the commmitment and
its index as the key.

After: The ciphertext key replaces the commitment dependence by a
nullifier dependence, still making the key unique by global state. The
nullifier is assumed to be the nullifier of the pre-state of the account.

Mitigation: Use the new decryption algorithm.
2026-07-15 16:28:09 +00:00
..
2026-07-02 20:43:34 +04:00

crypto_primitives_bench

Criterion-driven microbenchmarks for the cryptographic primitives client/wallet code uses on every transaction. No live sequencer or Bedrock needed.

Run

cargo bench -p crypto_primitives_bench --bench primitives

What you'll see

Criterion's per-operation report (point estimate, 95% CI, outlier counts) for:

  • keychain/new_os_random: full mnemonic → SSK → NSK/VSK + public-key derivation (HMAC-SHA512 PBKDF dominates).
  • keychain/new_mnemonic: same pipeline, mnemonic exposed.
  • shared_secret_key/sender_dh: secp256k1 ECDH per recipient (includes ephemeral key gen).
  • encryption/encrypt / decrypt: ChaCha20 over an Account note.

Per-bench JSON estimates are written under target/criterion/<group>/<bench>/. HTML reports at target/criterion/report/index.html.

Baseline comparison

# On main:
cargo bench -p crypto_primitives_bench --bench primitives -- --save-baseline main
# On your branch:
cargo bench -p crypto_primitives_bench --bench primitives -- --baseline main