lum_ccc_rust/docs/ccc_v2_benchmarks.rst

44 lines
2.5 KiB
ReStructuredText
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

==========================
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.