diff --git a/docs/ccc_v2_benchmarks.rst b/docs/ccc_v2_benchmarks.rst new file mode 100644 index 0000000..7d65c06 --- /dev/null +++ b/docs/ccc_v2_benchmarks.rst @@ -0,0 +1,43 @@ +========================== +CCC v2 cascade benchmarks +========================== + +:Date: 2026-11-16 +:Machine: Apple M3 Max, macOS, one thread, release build, Rust 1.93.1 +:Command: ``cargo run --release -p ccc-cascade --example bench_cascade`` + +Layers alternate between wolfSSL (open-source 5.7.2) and RustCrypto: AES-256-GCM, XChaCha20-Poly1305, +ChaCha20-Poly1305, AES-256-GCM-SIV, XChaCha20-Poly1305, Ascon-AEAD128, repeated. Every layer of every round derives +its own key and nonce with HKDF-SHA-512. Overhead is one 16-byte tag per layer per round. + ++--------+--------+---------+---------+---------+------------+ +| Layers | Rounds | Message | Seal µs | Open µs | Overhead B | ++========+========+=========+=========+=========+============+ +| 3 | 1 | 1 KiB | 18 | 18 | 48 | ++--------+--------+---------+---------+---------+------------+ +| 3 | 1 | 4 KiB | 50 | 48 | 48 | ++--------+--------+---------+---------+---------+------------+ +| 3 | 16 | 1 KiB | 341 | 331 | 768 | ++--------+--------+---------+---------+---------+------------+ +| 3 | 16 | 4 KiB | 801 | 792 | 768 | ++--------+--------+---------+---------+---------+------------+ +| 9 | 1 | 1 KiB | 48 | 48 | 144 | ++--------+--------+---------+---------+---------+------------+ +| 9 | 1 | 4 KiB | 122 | 121 | 144 | ++--------+--------+---------+---------+---------+------------+ +| 9 | 16 | 1 KiB | 1,178 | 1,186 | 2,304 | ++--------+--------+---------+---------+---------+------------+ +| 9 | 16 | 4 KiB | 2,333 | 2,290 | 2,304 | ++--------+--------+---------+---------+---------+------------+ +| 48 | 1 | 1 KiB | 283 | 277 | 768 | ++--------+--------+---------+---------+---------+------------+ +| 48 | 1 | 4 KiB | 634 | 642 | 768 | ++--------+--------+---------+---------+---------+------------+ +| 48 | 16 | 1 KiB | 15,177 | 15,106 | 12,288 | ++--------+--------+---------+---------+---------+------------+ +| 48 | 16 | 4 KiB | 20,682 | 21,222 | 12,288 | ++--------+--------+---------+---------+---------+------------+ + +Reading: the Ultra profile (3 layers, 16 rounds, 4 KiB bucket) costs under 1 ms per message here; phones are expected +to be 2–4x slower. Key derivation dominates small messages (one HKDF per layer per round), which is why 16 rounds of +3 layers cost about as much as one round of 48. A 48-layer, 16-round suite adds 12 KiB per message and about 20 ms.