SPB Git

Repository Public

BENCHMARKS.md 69.5 KB

# QYVORA benchmarks

Measurements of the QYVORA cryptographic engine (Swift, no external dependency; its only C is a forty-line shim that sets the processor's data-independent-timing flag, with three inline instructions) with the QyvoraBenchmarks library and its command-line front end qyvora-bench. The same library drives the benchmark screen of the iOS application, so that an iPhone runs exactly the suite described here.

Every number in this document was produced by the commands of section 2 on 2026-12-04 and is stored unmodified in docs/benchmarks/*.json. Nothing is extrapolated: what was not measured is marked as such.

# 1. Methodology

Suite. 84 benchmarks in 8 families (qyvora-bench --list):

Family Benchmarks
ML-KEM (FIPS 203) keygen, encaps, decaps for ML-KEM-512 / 768 / 1024
ML-DSA (FIPS 204) keygen, sign, verify for ML-DSA-44 / 65 / 87
SLH-DSA (FIPS 205) keygen, sign, verify for the 12 parameter sets
Hash functions SHA-256, SHA-512, SHA3-256, SHA3-512, SHAKE128, SHAKE256, Keccak-256, RIPEMD-160, BLAKE2b-512 on 1 MiB; Keccak-f[1600] permutations per second
Symmetric AES-256-GCM and ChaCha20-Poly1305 seal / open on 1 MiB (16 bytes of associated data); HMAC-SHA256 on 1 MiB and on 64 bytes; HKDF-SHA256
Key derivation PBKDF2-HMAC-SHA512 with 2048 iterations (the BIP-39 seed derivation); Argon2id at 19 MiB t=2 p=1 and 64 MiB t=3 p=4
NTT ML-KEM and ML-DSA forward and inverse transforms, time per transform
secp256k1 public key derivation, ECDSA sign / verify / recover, BIP-340 Schnorr sign / verify

Inputs. Deterministic: keys come from fixed seeds through the "internal" functions of the FIPS documents, messages and buffers from a fixed xorshift pattern, signatures use the deterministic variants. No benchmark draws from the system random generator, so two runs measure identical work. The signing benchmarks of ML-DSA and SLH-DSA sign a different message at each call (a counter in the first 8 bytes): ML-DSA signing time depends on the number of rejection-sampling rounds, hence on the message, so its samples spread by design and the mean is the representative figure for ML-DSA sign, not the median.

Runner. For each benchmark, in order:

  1. set-up outside the timed region (key generation, signature to verify, buffers); keys and signatures of a parameter set are computed once per process and shared by its benchmarks;
  2. one calibration call, which is also the warm-up (lazy tables, caches, allocator);
  3. for operations shorter than 0.2 ms, the operation is batched so that one sample lasts at least 0.2 ms: the clock is read twice per sample, not twice per operation, and a sample is the batch time divided by the batch size;
  4. the number of samples is the time budget divided by the estimated sample time, at least 5 (--full) or 3 (--quick) and at most 2000; a run never exceeds three budgets once the minimum is reached;
  5. benchmarks marked slow (SLH-DSA signatures, SLH-DSA "s" key generations, Argon2id) need only 3 samples (--full) or 1 (--quick), and when a single call already exceeds the budget the calibration call is kept as the first sample (reported as warmedUp: false). On the Macs measured here no operation reached the 1 s budget, so every figure below was taken after a warm-up.

Budgets: --quick ≈ 0.15 s per benchmark, --full ≈ 1 s. The clock is ContinuousClock (monotonic). Results go through a black-box sink (BlackBox.consume, never inlined, folds bytes of each result into an atomic accumulator) so that the optimizer cannot remove the measured work.

Statistics. Minimum, median, mean, 95th percentile (linear interpolation), sample standard deviation (n − 1), number of samples and of operations. Throughput figures are derived from the median: MB/s means 10^6 bytes per second on a 1 MiB (1 048 576 bytes) buffer.

Sizes. Public key, private key and signature / ciphertext sizes are read from the engine's parameter sets and printed next to the timings (section 4).

Memory. task_info(MACH_TASK_BASIC_INFO) is read before and after each benchmark. "Peak RSS Δ" is the increase of the process resident high-water mark during the benchmark, set-up included. It is approximate by nature: it covers the whole process, depends on what the allocator returned to the system, and reads 0 when an earlier benchmark already reached a higher peak (the suite order therefore matters; Argon2id shows +19 MiB then +64 MiB on the three machines because nothing before it needs as much).

CPU time. getrusage(RUSAGE_SELF) user + system time is read around the samples. "CPU / op" is that time divided by the number of operations, and "CPU load" its ratio to wall-clock time. This matters for SLH-DSA: the engine spreads key generation and signing over all cores (DispatchQueue.concurrentPerform), so the wall-clock time of an SLH-DSA signature is 5 to 25 times smaller than the CPU time it consumes, depending on the parameter set and on the number of cores (measured CPU load: 4.6× to 15.8× on the M5 Max, 6.4× to 25.2× on the M3 Ultra, 4.8× to 9.8× on the M4). Every other primitive is single-threaded (CPU load between 0.98× and 1.00×).

Energy. Not measured. Neither iOS nor macOS gives an application a per-process energy counter, so the reports contain no joule and no milliwatt. The honest proxies recorded instead are CPU time (above), the thermal state (ProcessInfo.thermalState) and low-power mode at the start and at the end of the run, the thermal state at the end of each benchmark, and the machine load average. On the three Macs the thermal state stayed nominal from start to end.

Environment. Each report carries the device model (hw.model, hw.machine on iOS), the CPU brand string, physical / logical / performance / efficiency core counts, memory, OS version, the build configuration of the library (#if DEBUG) and the engine version.

# 2. How to reproduce

sh
swift build -c release --product qyvora-bench
BIN=$(swift build -c release --show-bin-path)
$BIN/qyvora-bench --list                       # the 84 identifiers
$BIN/qyvora-bench --quick                      # 13 s on the M5 Max
$BIN/qyvora-bench --full --json bench.json --markdown bench.md   # 64 to 66 s on the three Macs
$BIN/qyvora-bench --full --filter ml-kem       # one family or one benchmark
$BIN/qyvora-bench --sizes                      # the table of section 4
swift test -c release --filter QyvoraBenchmarksTests             # statistics, filtering, cancellation, JSON, smoke run

A debug build prints a warning: unoptimized numbers are not representative and none is published here.

From the application (or any Swift code):

swift
import QyvoraBenchmarks

let runner = BenchmarkRunner(configuration: .quick)
for try await event in runner.events(BenchmarkCatalogue.all.filtered(by: "ML-KEM")) {
    switch event {
    case .progress(.finished(let result, let index, let total)): print(index + 1, total, result.displayName, result.headline)
    case .completed(let report): try report.jsonData().write(to: url)
    default: break
    }
}

# 3. Results

Common conditions: date 2026-12-04 (runs started between 20:15 and 20:17 UTC), --full mode (1 s per benchmark), release build (swift build -c release), engine 1.0.0, same source tree on the three machines, 84 benchmarks, 0 failure. The two cluster nodes ran at the same time as each other; the laptop ran afterwards.

Machine Model Cores Memory macOS Swift Load average (1 min) start → end Wall / CPU time of the run Raw results
Laptop, Apple M5 Max Mac17,6 18 (6 performance + 12 efficiency) 48 GiB 27.3.0 6.4.2 5.48 → 10.5 65.8 s / 306 s docs/benchmarks/Mac17-6-M5-Max.json
Mac Studio M3 Ultra (node M3U96a) Mac15,14 28 (20 performance + 8 efficiency) 96 GiB 26.6.0 6.3.3 2.17 → 5.71 64.2 s / 435 s docs/benchmarks/Mac15-14-M3-Ultra.json
Mac mini M4 (node m4ma) Mac16,10 10 (4 performance + 6 efficiency) 24 GiB 26.5.1 6.3.3 1.96 → 3.18 65.6 s / 237 s docs/benchmarks/Mac16-10-M4.json

None of the machines was idle (see the load averages; the end values include the benchmark's own SLH-DSA threads). The laptop was the busiest, with an iOS simulator and system services using several cores: its single-thread figures are probably pessimistic and should not be read as "an M5 Max is barely faster than an M4".

# 3.1 Side by side (headline figure, from the median)

# ML-KEM (FIPS 203)

Benchmark M5 Max M3 Ultra M4
ML-KEM-512 keygen 8.90 µs 15.6 µs 13.1 µs
ML-KEM-512 encaps 10.3 µs 11.9 µs 10.8 µs
ML-KEM-512 decaps 12.6 µs 14.9 µs 13.4 µs
ML-KEM-768 keygen 14.1 µs 16.2 µs 15.0 µs
ML-KEM-768 encaps 16.0 µs 18.8 µs 17.1 µs
ML-KEM-768 decaps 19.1 µs 22.5 µs 20.6 µs
ML-KEM-1024 keygen 21.9 µs 24.6 µs 22.7 µs
ML-KEM-1024 encaps 24.0 µs 27.8 µs 25.6 µs
ML-KEM-1024 decaps 27.9 µs 32.5 µs 29.7 µs

# ML-DSA (FIPS 204)

Benchmark M5 Max M3 Ultra M4 mean M5 Max mean M3 Ultra mean M4
ML-DSA-44 keygen 34.6 µs 40.1 µs 37.6 µs 34.8 µs 40.1 µs 36.6 µs
ML-DSA-44 sign 114 µs 126 µs 116 µs 124 µs 137 µs 126 µs
ML-DSA-44 verify 33.3 µs 37.7 µs 35.3 µs 33.5 µs 37.9 µs 34.8 µs
ML-DSA-65 keygen 60.4 µs 68.1 µs 63.5 µs 60.9 µs 68.2 µs 63.1 µs
ML-DSA-65 sign 173 µs 199 µs 176 µs 191 µs 219 µs 195 µs
ML-DSA-65 verify 54.0 µs 63.8 µs 57.8 µs 54.1 µs 63.8 µs 57.5 µs
ML-DSA-87 keygen 94.7 µs 109 µs 101 µs 94.8 µs 110 µs 100 µs
ML-DSA-87 sign 220 µs 230 µs 204 µs 242 µs 269 µs 242 µs
ML-DSA-87 verify 90.6 µs 104 µs 96.3 µs 90.6 µs 104 µs 96.1 µs

# SLH-DSA (FIPS 205)

Benchmark M5 Max M3 Ultra M4 CPU / op M5 Max CPU / op M3 Ultra CPU / op M4
SLH-DSA-SHA2-128s keygen 3.80 ms 2.92 ms 8.21 ms 58.3 ms 73.1 ms 80.6 ms
SLH-DSA-SHA2-128s sign 28.7 ms 22.9 ms 63.6 ms 442 ms 549 ms 618 ms
SLH-DSA-SHA2-128s verify 401 µs 429 µs 394 µs 409 µs 442 µs 396 µs
SLH-DSA-SHA2-128f keygen 195 µs 150 µs 226 µs 904 µs 1.07 ms 1.10 ms
SLH-DSA-SHA2-128f sign 2.86 ms 2.81 ms 4.21 ms 23.3 ms 29.1 ms 30.8 ms
SLH-DSA-SHA2-128f verify 1.09 ms 1.17 ms 1.07 ms 1.12 ms 1.18 ms 1.08 ms
SLH-DSA-SHA2-192s keygen 5.66 ms 4.33 ms 12.4 ms 87.9 ms 110 ms 122 ms
SLH-DSA-SHA2-192s sign 53.3 ms 43.2 ms 118 ms 799 ms 977 ms 1.11 s
SLH-DSA-SHA2-192s verify 641 µs 631 µs 583 µs 630 µs 636 µs 587 µs
SLH-DSA-SHA2-192f keygen 255 µs 210 µs 321 µs 1.34 ms 1.55 ms 1.65 ms
SLH-DSA-SHA2-192f sign 4.29 ms 3.88 ms 6.94 ms 38.3 ms 47.8 ms 51.7 ms
SLH-DSA-SHA2-192f verify 1.82 ms 1.78 ms 1.64 ms 1.76 ms 1.79 ms 1.65 ms
SLH-DSA-SHA2-256s keygen 3.76 ms 2.99 ms 8.39 ms 58.7 ms 74.8 ms 82.1 ms
SLH-DSA-SHA2-256s sign 51.5 ms 40.8 ms 109 ms 715 ms 879 ms 1.01 s
SLH-DSA-SHA2-256s verify 971 µs 957 µs 889 µs 940 µs 963 µs 896 µs
SLH-DSA-SHA2-256f keygen 429 µs 494 µs 646 µs 3.75 ms 4.23 ms 5.05 ms
SLH-DSA-SHA2-256f sign 6.71 ms 5.81 ms 13.0 ms 77.3 ms 96.6 ms 107 ms
SLH-DSA-SHA2-256f verify 1.80 ms 1.99 ms 1.83 ms 1.82 ms 1.99 ms 1.83 ms
SLH-DSA-SHAKE-128s keygen 3.72 ms 2.51 ms 6.93 ms 57.4 ms 63.4 ms 68.0 ms
SLH-DSA-SHAKE-128s sign 28.3 ms 19.6 ms 52.9 ms 436 ms 474 ms 517 ms
SLH-DSA-SHAKE-128s verify 339 µs 347 µs 348 µs 341 µs 348 µs 348 µs
SLH-DSA-SHAKE-128f keygen 182 µs 135 µs 206 µs 826 µs 965 µs 979 µs
SLH-DSA-SHAKE-128f sign 2.62 ms 2.25 ms 3.74 ms 22.4 ms 25.9 ms 26.2 ms
SLH-DSA-SHAKE-128f verify 988 µs 1.01 ms 1.01 ms 992 µs 1.04 ms 1.01 ms
SLH-DSA-SHAKE-192s keygen 5.29 ms 3.66 ms 10.2 ms 84.4 ms 93.3 ms 99.7 ms
SLH-DSA-SHAKE-192s sign 51.0 ms 34.6 ms 93.4 ms 761 ms 807 ms 891 ms
SLH-DSA-SHAKE-192s verify 502 µs 520 µs 522 µs 504 µs 522 µs 521 µs
SLH-DSA-SHAKE-192f keygen 241 µs 185 µs 272 µs 1.19 ms 1.36 ms 1.40 ms
SLH-DSA-SHAKE-192f sign 3.95 ms 3.32 ms 5.92 ms 35.7 ms 40.6 ms 42.0 ms
SLH-DSA-SHAKE-192f verify 1.49 ms 1.54 ms 1.54 ms 1.50 ms 1.54 ms 1.54 ms
SLH-DSA-SHAKE-256s keygen 3.61 ms 2.45 ms 6.80 ms 56.3 ms 61.4 ms 66.0 ms
SLH-DSA-SHAKE-256s sign 46.9 ms 32.6 ms 84.1 ms 666 ms 701 ms 778 ms
SLH-DSA-SHAKE-256s verify 718 µs 761 µs 748 µs 722 µs 765 µs 747 µs
SLH-DSA-SHAKE-256f keygen 384 µs 429 µs 581 µs 3.44 ms 3.65 ms 4.07 ms
SLH-DSA-SHAKE-256f sign 6.24 ms 4.91 ms 10.3 ms 71.7 ms 79.6 ms 84.3 ms
SLH-DSA-SHAKE-256f verify 1.50 ms 1.54 ms 1.55 ms 1.50 ms 1.55 ms 1.55 ms

# Hash functions

Benchmark M5 Max M3 Ultra M4
SHA-256 1 MiB 404 MB/s 378 MB/s 405 MB/s
SHA-512 1 MiB 609 MB/s 533 MB/s 609 MB/s
SHA3-256 1 MiB 832 MB/s 784 MB/s 789 MB/s
SHA3-512 1 MiB 447 MB/s 419 MB/s 428 MB/s
SHAKE128 1 MiB 1028 MB/s 956 MB/s 962 MB/s
SHAKE256 1 MiB 832 MB/s 785 MB/s 792 MB/s
Keccak-256 1 MiB 832 MB/s 785 MB/s 792 MB/s
RIPEMD-160 1 MiB 362 MB/s 328 MB/s 332 MB/s
BLAKE2b-512 1 MiB 1456 MB/s 1364 MB/s 1418 MB/s
Keccak-f[1600] permutation 6.42 M permutations/s 6.20 M permutations/s 6.17 M permutations/s

# Symmetric encryption and MAC

Benchmark M5 Max M3 Ultra M4
AES-256-GCM seal 1 MiB 10.5 MB/s 9.48 MB/s 10.7 MB/s
AES-256-GCM open 1 MiB 10.4 MB/s 9.48 MB/s 10.7 MB/s
ChaCha20-Poly1305 seal 1 MiB 614 MB/s 511 MB/s 602 MB/s
ChaCha20-Poly1305 open 1 MiB 610 MB/s 511 MB/s 602 MB/s
HMAC-SHA256 1 MiB 396 MB/s 382 MB/s 410 MB/s
HMAC-SHA256 64-byte message 1.34 µs 1.63 µs 1.51 µs
HKDF-SHA256 derive 32 bytes 2.50 µs 3.07 µs 2.83 µs

# Key derivation

Benchmark M5 Max M3 Ultra M4
PBKDF2-HMAC-SHA512 2048 iterations (BIP-39) 1.91 ms 2.74 ms 2.23 ms
Argon2id 19 MiB t=2 p=1 9.85 ms 9.41 ms 9.50 ms
Argon2id 64 MiB t=3 p=4 62.5 ms 56.2 ms 62.6 ms

# Number-theoretic transforms

Benchmark M5 Max M3 Ultra M4
ML-KEM NTT forward 235 ns/transform 274 ns/transform 246 ns/transform
ML-KEM NTT inverse 321 ns/transform 368 ns/transform 336 ns/transform
ML-DSA NTT forward 438 ns/transform 500 ns/transform 461 ns/transform
ML-DSA NTT inverse 525 ns/transform 641 ns/transform 554 ns/transform

# secp256k1

Benchmark M5 Max (re-measured) M3 Ultra (re-measured) M4 (first run †)
secp256k1 public key 255 µs 242 µs 127 µs †
secp256k1 ECDSA sign 978 µs 1.01 ms 148 µs †
secp256k1 ECDSA verify 434 µs 498 µs 379 µs †
secp256k1 ECDSA recover 489 µs 502 µs 345 µs †
secp256k1 Schnorr sign 924 µs 977 µs 864 µs †
secp256k1 Schnorr verify 439 µs 488 µs 391 µs †

The secp256k1 rows of the M5 Max and of the M3 Ultra were re-measured on 2026-12-05 (UTC) after the fix of QYV-AUD-002 and the changes that followed it; the first figures (124 to 153 µs for a public key or an ECDSA signature) described code that no longer exists. Three things changed the cost: (1) the carry chain of the 256-bit arithmetic is branch-free since QYV-AUD-002 (bit arithmetic instead of carries the optimiser turned into branches), which about doubles a scalar multiplication; (2) Secp256k1.sign now verifies every signature it produces against the public key recomputed from the private key before returning it, so an ECDSA signature costs one signature, one public-key derivation and one verification (QYV-CRY-004, QYV-APP-007); (3) the processor's data-independent-timing flag is set around these operations. Conditions of the re-measurement: qyvora-bench --full --filter secp256k1, release build, same source tree (the branch of the findings fixes); M3 Ultra (node M3U96a): Swift 6.3.3, load average 6.06 → 5.65; M5 Max (laptop): Swift 6.4.2, load average 20.1 → 20.4, thermal state "fair" — the laptop was busy with other builds and no quiet moment was available, so its figures are pessimistic and noisy (standard deviations up to 236 µs). Raw data: docs/benchmarks/secp256k1-after-QYV-AUD-002-Mac17-6-M5-Max.json and docs/benchmarks/secp256k1-after-QYV-AUD-002-Mac15-14-M3-Ultra.json.

† The M4 column (node m4ma) was not re-measured: it still shows the first run, before QYV-AUD-002, and is not comparable with the two other columns. The full JSON files of the first run (docs/benchmarks/Mac*.json) also keep the first secp256k1 figures.

Every other row of this document dates from the first run. A complete run on the M3 Ultra after the changes (2026-12-05, load average 2.81 → 4.29, not stored) gave a median ratio of 1.00 against the published figures over the 63 other benchmarks; the scopes of the data-independent-timing flag show on the shortest operations only (HMAC-SHA256 of 64 bytes 1.63 → 1.71 µs, HKDF-SHA256 3.07 → 3.25 µs).

Reading notes:

  • SLH-DSA key generation and signing are multi-threaded: the first three columns are wall-clock times and follow the number of cores, the last three are CPU time per operation and follow the speed of one core. Verification is single-threaded.
  • For ML-DSA sign, use the "mean" columns.
  • NTT figures include one 256-coefficient copy per transform (the transforms are in place).

# 3.2 Full tables per machine

Columns: wall-clock statistics per operation; "Result" is the headline figure; "Iterations" the number of measured operations; "CPU / op", "CPU load" and "Peak RSS Δ" as defined in section 1.

# Laptop, Apple M5 Max (Mac17,6)

Swift toolchain: Apple Swift 6.4.2 (swiftlang-6.4.2.1.9). Condition: development laptop, in use during the run (iOS simulator and system services using several cores). Raw data: docs/benchmarks/Mac17-6-M5-Max.json.

  • Machine: Mac17,6 (Apple M5 Max)
  • Cores: 18 physical, 18 logical (6 performance + 12 efficiency)
  • Memory: 48.0 GiB
  • System: macOS 27.3.0
  • Build: release, engine 1.0.0
  • Mode: full (1.00 s per benchmark)
  • Started: 2026-12-04T20:16:45Z; wall time 65.8 s, CPU time 306 s (user + system)
  • Thermal state: nominal; low-power mode: off at start, off at end
  • Machine load average (1 min, all processes): 5.48 at start, 10.5 at end
  • Energy: not measured (no per-process energy counter is available to applications); CPU time and thermal state are the proxies.

# ML-KEM (FIPS 203)

Benchmark Result Median Mean Min p95 Std dev Iterations CPU / op CPU load Peak RSS Δ (approx.) PK / SK / output (bytes)
ML-KEM-512 keygen 8.90 µs 8.90 µs 8.97 µs 8.14 µs 9.47 µs 499 ns 6000 8.97 µs 0.999× +320 KiB 800 / 1632 / 768
ML-KEM-512 encaps 10.3 µs 10.3 µs 10.3 µs 9.32 µs 10.7 µs 543 ns 38000 10.3 µs 0.998× +64.0 KiB 800 / 1632 / 768
ML-KEM-512 decaps 12.6 µs 12.6 µs 12.7 µs 11.6 µs 13.1 µs 432 ns 32000 12.7 µs 0.999× 0 B 800 / 1632 / 768
ML-KEM-768 keygen 14.1 µs 14.1 µs 14.1 µs 13.6 µs 14.5 µs 354 ns 30000 14.1 µs 0.999× +64.0 KiB 1184 / 2400 / 1088
ML-KEM-768 encaps 16.0 µs 16.0 µs 16.0 µs 15.4 µs 16.5 µs 290 ns 26000 16.0 µs 0.999× 0 B 1184 / 2400 / 1088
ML-KEM-768 decaps 19.1 µs 19.1 µs 19.4 µs 18.7 µs 19.8 µs 2.57 µs 22000 19.3 µs 0.995× 0 B 1184 / 2400 / 1088
ML-KEM-1024 keygen 21.9 µs 21.9 µs 23.7 µs 21.3 µs 29.9 µs 5.63 µs 20000 23.3 µs 0.984× +32.0 KiB 1568 / 3168 / 1568
ML-KEM-1024 encaps 24.0 µs 24.0 µs 24.1 µs 22.1 µs 24.9 µs 801 ns 18000 24.1 µs 0.999× 0 B 1568 / 3168 / 1568
ML-KEM-1024 decaps 27.9 µs 27.9 µs 27.9 µs 25.5 µs 29.0 µs 1.07 µs 16000 27.9 µs 0.999× 0 B 1568 / 3168 / 1568

# ML-DSA (FIPS 204)

Benchmark Result Median Mean Min p95 Std dev Iterations CPU / op CPU load Peak RSS Δ (approx.) PK / SK / output (bytes)
ML-DSA-44 keygen 34.6 µs 34.6 µs 34.8 µs 32.0 µs 35.5 µs 1.31 µs 4000 34.8 µs 0.999× +128 KiB 1312 / 2560 / 2420
ML-DSA-44 sign 114 µs 114 µs 124 µs 52.1 µs 212 µs 47.1 µs 6000 123 µs 0.993× +192 KiB 1312 / 2560 / 2420
ML-DSA-44 verify 33.3 µs 33.3 µs 33.5 µs 30.4 µs 35.2 µs 1.50 µs 14000 33.4 µs 0.997× +32.0 KiB 1312 / 2560 / 2420
ML-DSA-65 keygen 60.4 µs 60.4 µs 60.9 µs 55.2 µs 64.2 µs 5.12 µs 6000 60.8 µs 0.997× +32.0 KiB 1952 / 4032 / 3309
ML-DSA-65 sign 173 µs 173 µs 191 µs 75.0 µs 363 µs 87.3 µs 4000 191 µs 0.999× +32.0 KiB 1952 / 4032 / 3309
ML-DSA-65 verify 54.0 µs 54.0 µs 54.1 µs 50.1 µs 57.3 µs 1.77 µs 8000 54.1 µs 0.999× +16.0 KiB 1952 / 4032 / 3309
ML-DSA-87 keygen 94.7 µs 94.7 µs 94.8 µs 87.9 µs 99.1 µs 2.80 µs 4000 94.8 µs 0.999× +32.0 KiB 2592 / 4896 / 4627
ML-DSA-87 sign 220 µs 220 µs 242 µs 118 µs 423 µs 93.7 µs 4000 242 µs 0.999× +32.0 KiB 2592 / 4896 / 4627
ML-DSA-87 verify 90.6 µs 90.6 µs 90.6 µs 83.7 µs 95.9 µs 2.81 µs 6000 90.6 µs 0.999× 0 B 2592 / 4896 / 4627

# SLH-DSA (FIPS 205)

Benchmark Result Median Mean Min p95 Std dev Iterations CPU / op CPU load Peak RSS Δ (approx.) PK / SK / output (bytes)
SLH-DSA-SHA2-128s keygen 3.80 ms 3.80 ms 3.87 ms 3.40 ms 4.44 ms 411 µs 230 58.3 ms 15.1× +624 KiB 32 / 64 / 7856
SLH-DSA-SHA2-128s sign 28.7 ms 28.7 ms 28.8 ms 27.8 ms 29.8 ms 568 µs 35 442 ms 15.3× +1.14 MiB 32 / 64 / 7856
SLH-DSA-SHA2-128s verify 401 µs 401 µs 409 µs 369 µs 454 µs 23.4 µs 2000 409 µs 0.999× +16.0 KiB 32 / 64 / 7856
SLH-DSA-SHA2-128f keygen 195 µs 195 µs 192 µs 140 µs 215 µs 21.3 µs 4000 904 µs 4.71× +416 KiB 32 / 64 / 17088
SLH-DSA-SHA2-128f sign 2.86 ms 2.86 ms 3.11 ms 2.50 ms 5.38 ms 826 µs 371 23.3 ms 7.50× +576 KiB 32 / 64 / 17088
SLH-DSA-SHA2-128f verify 1.09 ms 1.09 ms 1.13 ms 1.01 ms 1.25 ms 69.0 µs 918 1.12 ms 0.999× 0 B 32 / 64 / 17088
SLH-DSA-SHA2-192s keygen 5.66 ms 5.66 ms 6.01 ms 5.06 ms 7.64 ms 830 µs 153 87.9 ms 14.6× +64.0 KiB 48 / 96 / 16224
SLH-DSA-SHA2-192s sign 53.3 ms 53.3 ms 56.2 ms 49.9 ms 69.3 ms 7.98 ms 17 799 ms 14.2× +6.80 MiB 48 / 96 / 16224
SLH-DSA-SHA2-192s verify 641 µs 641 µs 630 µs 531 µs 662 µs 31.5 µs 1545 630 µs 0.999× +16.0 KiB 48 / 96 / 16224
SLH-DSA-SHA2-192f keygen 255 µs 255 µs 254 µs 198 µs 309 µs 30.5 µs 2000 1.34 ms 5.27× +16.0 KiB 48 / 96 / 35664
SLH-DSA-SHA2-192f sign 4.29 ms 4.29 ms 4.34 ms 3.97 ms 4.77 ms 239 µs 241 38.3 ms 8.81× +304 KiB 48 / 96 / 35664
SLH-DSA-SHA2-192f verify 1.82 ms 1.82 ms 1.76 ms 1.53 ms 1.89 ms 116 µs 539 1.76 ms 0.999× 0 B 48 / 96 / 35664
SLH-DSA-SHA2-256s keygen 3.76 ms 3.76 ms 3.80 ms 3.47 ms 4.23 ms 229 µs 211 58.7 ms 15.5× +64.0 KiB 64 / 128 / 29792
SLH-DSA-SHA2-256s sign 51.5 ms 51.5 ms 51.5 ms 50.4 ms 52.6 ms 663 µs 19 715 ms 13.9× +10.8 MiB 64 / 128 / 29792
SLH-DSA-SHA2-256s verify 971 µs 971 µs 940 µs 819 µs 995 µs 50.9 µs 1018 940 µs 0.999× 0 B 64 / 128 / 29792
SLH-DSA-SHA2-256f keygen 429 µs 429 µs 479 µs 281 µs 900 µs 173 µs 2000 3.75 ms 7.83× +32.0 KiB 64 / 128 / 49856
SLH-DSA-SHA2-256f sign 6.71 ms 6.71 ms 6.73 ms 6.30 ms 7.15 ms 250 µs 148 77.3 ms 11.5× +496 KiB 64 / 128 / 49856
SLH-DSA-SHA2-256f verify 1.80 ms 1.80 ms 1.82 ms 1.73 ms 1.98 ms 60.5 µs 558 1.82 ms 0.998× 0 B 64 / 128 / 49856
SLH-DSA-SHAKE-128s keygen 3.72 ms 3.72 ms 3.81 ms 3.32 ms 4.55 ms 375 µs 226 57.4 ms 15.1× +16.0 KiB 32 / 64 / 7856
SLH-DSA-SHAKE-128s sign 28.3 ms 28.3 ms 28.5 ms 27.5 ms 29.8 ms 724 µs 35 436 ms 15.3× +400 KiB 32 / 64 / 7856
SLH-DSA-SHAKE-128s verify 339 µs 339 µs 341 µs 332 µs 355 µs 6.91 µs 2000 341 µs 0.999× 0 B 32 / 64 / 7856
SLH-DSA-SHAKE-128f keygen 182 µs 182 µs 178 µs 135 µs 199 µs 21.3 µs 4000 826 µs 4.65× 0 B 32 / 64 / 17088
SLH-DSA-SHAKE-128f sign 2.62 ms 2.62 ms 2.70 ms 2.35 ms 3.06 ms 224 µs 404 22.4 ms 8.28× +16.0 KiB 32 / 64 / 17088
SLH-DSA-SHAKE-128f verify 988 µs 988 µs 993 µs 972 µs 1.02 ms 32.0 µs 1009 992 µs 0.998× +32.0 KiB 32 / 64 / 17088
SLH-DSA-SHAKE-192s keygen 5.29 ms 5.29 ms 5.33 ms 4.85 ms 5.82 ms 277 µs 179 84.4 ms 15.8× 0 B 48 / 96 / 16224
SLH-DSA-SHAKE-192s sign 51.0 ms 51.0 ms 57.3 ms 47.7 ms 98.8 ms 18.1 ms 21 761 ms 13.3× +2.70 MiB 48 / 96 / 16224
SLH-DSA-SHAKE-192s verify 502 µs 502 µs 505 µs 494 µs 521 µs 8.50 µs 1661 504 µs 0.999× 0 B 48 / 96 / 16224
SLH-DSA-SHAKE-192f keygen 241 µs 241 µs 237 µs 188 µs 279 µs 26.0 µs 2000 1.19 ms 5.02× 0 B 48 / 96 / 35664
SLH-DSA-SHAKE-192f sign 3.95 ms 3.95 ms 4.06 ms 3.60 ms 4.73 ms 332 µs 243 35.7 ms 8.79× 0 B 48 / 96 / 35664
SLH-DSA-SHAKE-192f verify 1.49 ms 1.49 ms 1.50 ms 1.46 ms 1.57 ms 47.5 µs 676 1.50 ms 0.998× 0 B 48 / 96 / 35664
SLH-DSA-SHAKE-256s keygen 3.61 ms 3.61 ms 3.63 ms 3.28 ms 4.02 ms 209 µs 239 56.3 ms 15.5× 0 B 64 / 128 / 29792
SLH-DSA-SHAKE-256s sign 46.9 ms 46.9 ms 47.0 ms 45.5 ms 48.7 ms 918 µs 22 666 ms 14.2× +592 KiB 64 / 128 / 29792
SLH-DSA-SHAKE-256s verify 718 µs 718 µs 723 µs 706 µs 746 µs 13.1 µs 1226 722 µs 0.999× +16.0 KiB 64 / 128 / 29792
SLH-DSA-SHAKE-256f keygen 384 µs 384 µs 403 µs 272 µs 619 µs 85.9 µs 2000 3.44 ms 8.52× 0 B 64 / 128 / 49856
SLH-DSA-SHAKE-256f sign 6.24 ms 6.24 ms 6.24 ms 5.80 ms 6.58 ms 216 µs 150 71.7 ms 11.5× 0 B 64 / 128 / 49856
SLH-DSA-SHAKE-256f verify 1.50 ms 1.50 ms 1.50 ms 1.48 ms 1.55 ms 22.1 µs 633 1.50 ms 0.999× 0 B 64 / 128 / 49856

# Hash functions

Benchmark Result Median Mean Min p95 Std dev Iterations CPU / op CPU load Peak RSS Δ (approx.)
SHA-256 1 MiB 404 MB/s 2.59 ms 2.84 ms 2.50 ms 3.56 ms 398 µs 390 2.82 ms 0.993× 0 B
SHA-512 1 MiB 609 MB/s 1.72 ms 1.76 ms 1.68 ms 2.05 ms 103 µs 572 1.76 ms 0.999× 0 B
SHA3-256 1 MiB 832 MB/s 1.26 ms 1.27 ms 1.22 ms 1.31 ms 31.6 µs 821 1.27 ms 0.999× 0 B
SHA3-512 1 MiB 447 MB/s 2.35 ms 2.36 ms 2.31 ms 2.44 ms 59.9 µs 419 2.36 ms 0.998× +16.0 KiB
SHAKE128 1 MiB 1028 MB/s 1.02 ms 1.03 ms 1.00 ms 1.06 ms 14.9 µs 964 1.02 ms 0.999× 0 B
SHAKE256 1 MiB 832 MB/s 1.26 ms 1.27 ms 1.22 ms 1.30 ms 19.0 µs 785 1.26 ms 0.999× 0 B
Keccak-256 1 MiB 832 MB/s 1.26 ms 1.26 ms 1.23 ms 1.30 ms 17.8 µs 795 1.26 ms 0.999× 0 B
RIPEMD-160 1 MiB 362 MB/s 2.90 ms 2.92 ms 2.72 ms 3.06 ms 85.0 µs 340 2.92 ms 0.999× 0 B
BLAKE2b-512 1 MiB 1456 MB/s 720 µs 724 µs 716 µs 746 µs 9.99 µs 1304 724 µs 0.999× 0 B
Keccak-f[1600] permutation 6.42 M permutations/s 9.96 µs 10.0 µs 9.49 µs 10.5 µs 197 ns 42000 10.0 µs 0.999× 0 B

# Symmetric encryption and MAC

Benchmark Result Median Mean Min p95 Std dev Iterations CPU / op CPU load Peak RSS Δ (approx.)
AES-256-GCM seal 1 MiB 10.5 MB/s 100 ms 100 ms 99.6 ms 100 ms 304 µs 9 100 ms 0.999× 0 B
AES-256-GCM open 1 MiB 10.4 MB/s 101 ms 103 ms 99.9 ms 111 ms 4.64 ms 10 103 ms 0.994× 0 B
ChaCha20-Poly1305 seal 1 MiB 614 MB/s 1.71 ms 1.71 ms 1.66 ms 1.75 ms 19.8 µs 569 1.71 ms 0.999× 0 B
ChaCha20-Poly1305 open 1 MiB 610 MB/s 1.72 ms 1.73 ms 1.66 ms 1.77 ms 43.0 µs 582 1.72 ms 0.998× 0 B
HMAC-SHA256 1 MiB 396 MB/s 2.65 ms 2.84 ms 2.49 ms 3.27 ms 315 µs 392 2.83 ms 0.998× 0 B
HMAC-SHA256 64-byte message 1.34 µs 1.34 µs 1.40 µs 1.24 µs 1.56 µs 102 ns 284000 1.40 µs 0.999× 0 B
HKDF-SHA256 derive 32 bytes 2.50 µs 2.50 µs 2.55 µs 2.37 µs 2.84 µs 137 ns 162000 2.54 µs 0.999× 0 B

# Key derivation

Benchmark Result Median Mean Min p95 Std dev Iterations CPU / op CPU load Peak RSS Δ (approx.)
PBKDF2-HMAC-SHA512 2048 iterations (BIP-39) 1.91 ms 1.91 ms 1.92 ms 1.86 ms 2.00 ms 38.0 µs 521 1.92 ms 0.999× 0 B
Argon2id 19 MiB t=2 p=1 9.85 ms 9.85 ms 9.89 ms 9.43 ms 10.4 ms 315 µs 90 9.88 ms 0.999× +18.9 MiB
Argon2id 64 MiB t=3 p=4 62.5 ms 62.5 ms 62.5 ms 61.7 ms 63.1 ms 430 µs 15 62.4 ms 0.999× +64.0 MiB

# Number-theoretic transforms

Benchmark Result Median Mean Min p95 Std dev Iterations CPU / op CPU load Peak RSS Δ (approx.)
ML-KEM NTT forward 235 ns/transform 7.53 µs 7.92 µs 7.05 µs 9.85 µs 867 ns 56000 7.91 µs 0.999× 0 B
ML-KEM NTT inverse 321 ns/transform 10.3 µs 10.3 µs 10.1 µs 10.6 µs 192 ns 40000 10.3 µs 0.999× 0 B
ML-DSA NTT forward 438 ns/transform 14.0 µs 14.1 µs 13.8 µs 14.6 µs 326 ns 28000 14.1 µs 0.999× 0 B
ML-DSA NTT inverse 525 ns/transform 16.8 µs 16.9 µs 16.5 µs 17.5 µs 509 ns 26000 16.9 µs 0.999× 0 B

# secp256k1

Benchmark Result Median Mean Min p95 Std dev Iterations CPU / op CPU load Peak RSS Δ (approx.) PK / SK / output (bytes)
secp256k1 public key 255 µs 255 µs 273 µs 213 µs 336 µs 72.2 µs 2000 263 µs 0.962× +80.0 KiB 33 / 32 / 64
secp256k1 ECDSA sign 978 µs 978 µs 1.02 ms 885 µs 1.32 ms 157 µs 716 999 µs 0.976× +80.0 KiB 33 / 32 / 64
secp256k1 ECDSA verify 434 µs 434 µs 439 µs 427 µs 461 µs 21.5 µs 2000 437 µs 0.996× 0 B 33 / 32 / 64
secp256k1 ECDSA recover 489 µs 489 µs 536 µs 433 µs 699 µs 145 µs 2000 517 µs 0.963× 0 B 33 / 32 / 64
secp256k1 Schnorr sign 924 µs 924 µs 1.03 ms 838 µs 1.37 ms 236 µs 1083 990 µs 0.965× +32.0 KiB 32 / 32 / 64
secp256k1 Schnorr verify 439 µs 439 µs 472 µs 415 µs 638 µs 91.0 µs 2000 462 µs 0.978× 0 B 32 / 32 / 64

# Mac Studio M3 Ultra (Mac15,14), cluster node M3U96a

Swift toolchain: Apple Swift 6.3.3 (swiftlang-6.3.3.1.3). Condition: shared cluster node running other services. Raw data: docs/benchmarks/Mac15-14-M3-Ultra.json.

  • Machine: Mac15,14 (Apple M3 Ultra)
  • Cores: 28 physical, 28 logical (20 performance + 8 efficiency)
  • Memory: 96.0 GiB
  • System: macOS 26.6.0
  • Build: release, engine 1.0.0
  • Mode: full (1.00 s per benchmark)
  • Started: 2026-12-04T20:15:31Z; wall time 64.2 s, CPU time 435 s (user + system)
  • Thermal state: nominal; low-power mode: off at start, off at end
  • Machine load average (1 min, all processes): 2.17 at start, 5.71 at end
  • Energy: not measured (no per-process energy counter is available to applications); CPU time and thermal state are the proxies.

# ML-KEM (FIPS 203)

Benchmark Result Median Mean Min p95 Std dev Iterations CPU / op CPU load Peak RSS Δ (approx.) PK / SK / output (bytes)
ML-KEM-512 keygen 15.6 µs 15.6 µs 16.6 µs 10.7 µs 24.7 µs 4.72 µs 4000 16.7 µs 1.000× +288 KiB 800 / 1632 / 768
ML-KEM-512 encaps 11.9 µs 11.9 µs 12.0 µs 11.9 µs 12.3 µs 203 ns 32000 12.0 µs 1.00× +64.0 KiB 800 / 1632 / 768
ML-KEM-512 decaps 14.9 µs 14.9 µs 15.0 µs 14.8 µs 15.2 µs 133 ns 28000 15.0 µs 1.00× 0 B 800 / 1632 / 768
ML-KEM-768 keygen 16.2 µs 16.2 µs 16.2 µs 16.1 µs 16.3 µs 138 ns 26000 16.2 µs 1.000× +16.0 KiB 1184 / 2400 / 1088
ML-KEM-768 encaps 18.8 µs 18.8 µs 18.9 µs 18.7 µs 19.2 µs 357 ns 22000 18.9 µs 1.00× 0 B 1184 / 2400 / 1088
ML-KEM-768 decaps 22.5 µs 22.5 µs 22.5 µs 22.4 µs 22.7 µs 242 ns 16000 22.5 µs 1.00× +16.0 KiB 1184 / 2400 / 1088
ML-KEM-1024 keygen 24.6 µs 24.6 µs 24.7 µs 24.5 µs 24.8 µs 318 ns 16000 24.7 µs 1.00× +32.0 KiB 1568 / 3168 / 1568
ML-KEM-1024 encaps 27.8 µs 27.8 µs 27.9 µs 27.6 µs 28.2 µs 635 ns 16000 27.9 µs 1.00× 0 B 1568 / 3168 / 1568
ML-KEM-1024 decaps 32.5 µs 32.5 µs 32.9 µs 32.4 µs 34.6 µs 1.19 µs 14000 32.9 µs 1.00× 0 B 1568 / 3168 / 1568

# ML-DSA (FIPS 204)

Benchmark Result Median Mean Min p95 Std dev Iterations CPU / op CPU load Peak RSS Δ (approx.) PK / SK / output (bytes)
ML-DSA-44 keygen 40.1 µs 40.1 µs 40.1 µs 39.8 µs 40.2 µs 414 ns 4000 40.1 µs 1.00× +128 KiB 1312 / 2560 / 2420
ML-DSA-44 sign 126 µs 126 µs 137 µs 59.3 µs 233 µs 50.6 µs 6000 137 µs 1.00× +32.0 KiB 1312 / 2560 / 2420
ML-DSA-44 verify 37.7 µs 37.7 µs 37.9 µs 37.5 µs 38.1 µs 1.25 µs 6000 37.9 µs 1.00× +32.0 KiB 1312 / 2560 / 2420
ML-DSA-65 keygen 68.1 µs 68.1 µs 68.2 µs 67.8 µs 68.6 µs 595 ns 6000 68.2 µs 1.000× +16.0 KiB 1952 / 4032 / 3309
ML-DSA-65 sign 199 µs 199 µs 219 µs 91.3 µs 419 µs 99.7 µs 4000 219 µs 1.00× +48.0 KiB 1952 / 4032 / 3309
ML-DSA-65 verify 63.8 µs 63.8 µs 63.8 µs 63.4 µs 64.0 µs 262 ns 6000 63.8 µs 1.00× 0 B 1952 / 4032 / 3309
ML-DSA-87 keygen 109 µs 109 µs 110 µs 108 µs 111 µs 2.24 µs 4000 110 µs 1.00× +16.0 KiB 2592 / 4896 / 4627
ML-DSA-87 sign 230 µs 230 µs 269 µs 144 µs 560 µs 140 µs 2000 269 µs 1.00× +32.0 KiB 2592 / 4896 / 4627
ML-DSA-87 verify 104 µs 104 µs 104 µs 103 µs 104 µs 992 ns 4000 104 µs 1.00× 0 B 2592 / 4896 / 4627

# SLH-DSA (FIPS 205)

Benchmark Result Median Mean Min p95 Std dev Iterations CPU / op CPU load Peak RSS Δ (approx.) PK / SK / output (bytes)
SLH-DSA-SHA2-128s keygen 2.92 ms 2.92 ms 3.08 ms 2.80 ms 3.49 ms 307 µs 315 73.1 ms 23.8× +1.14 MiB 32 / 64 / 7856
SLH-DSA-SHA2-128s sign 22.9 ms 22.9 ms 23.0 ms 22.4 ms 23.7 ms 473 µs 42 549 ms 23.8× +1.20 MiB 32 / 64 / 7856
SLH-DSA-SHA2-128s verify 429 µs 429 µs 442 µs 428 µs 481 µs 22.4 µs 2000 442 µs 1.00× +16.0 KiB 32 / 64 / 7856
SLH-DSA-SHA2-128f keygen 150 µs 150 µs 166 µs 141 µs 242 µs 51.8 µs 2000 1.07 ms 6.45× +288 KiB 32 / 64 / 17088
SLH-DSA-SHA2-128f sign 2.81 ms 2.81 ms 2.85 ms 2.43 ms 3.23 ms 415 µs 309 29.1 ms 10.2× +976 KiB 32 / 64 / 17088
SLH-DSA-SHA2-128f verify 1.17 ms 1.17 ms 1.18 ms 1.17 ms 1.20 ms 31.5 µs 851 1.18 ms 1.00× +16.0 KiB 32 / 64 / 17088
SLH-DSA-SHA2-192s keygen 4.33 ms 4.33 ms 4.38 ms 4.19 ms 4.76 ms 166 µs 228 110 ms 25.2× +464 KiB 48 / 96 / 16224
SLH-DSA-SHA2-192s sign 43.2 ms 43.2 ms 43.5 ms 42.7 ms 45.0 ms 839 µs 23 977 ms 22.4× +6.17 MiB 48 / 96 / 16224
SLH-DSA-SHA2-192s verify 631 µs 631 µs 636 µs 618 µs 706 µs 21.3 µs 1529 636 µs 1.00× +16.0 KiB 48 / 96 / 16224
SLH-DSA-SHA2-192f keygen 210 µs 210 µs 236 µs 200 µs 347 µs 56.0 µs 2000 1.55 ms 6.57× 0 B 48 / 96 / 35664
SLH-DSA-SHA2-192f sign 3.88 ms 3.88 ms 3.95 ms 3.76 ms 4.22 ms 143 µs 244 47.8 ms 12.1× +400 KiB 48 / 96 / 35664
SLH-DSA-SHA2-192f verify 1.78 ms 1.78 ms 1.79 ms 1.76 ms 2.01 ms 63.6 µs 560 1.79 ms 1.000× 0 B 48 / 96 / 35664
SLH-DSA-SHA2-256s keygen 2.99 ms 2.99 ms 3.02 ms 2.83 ms 3.38 ms 139 µs 332 74.8 ms 24.8× +480 KiB 64 / 128 / 29792
SLH-DSA-SHA2-256s sign 40.8 ms 40.8 ms 40.9 ms 40.2 ms 41.5 ms 473 µs 24 879 ms 21.5× +5.05 MiB 64 / 128 / 29792
SLH-DSA-SHA2-256s verify 957 µs 957 µs 963 µs 942 µs 1.07 ms 34.5 µs 1039 963 µs 1.000× +16.0 KiB 64 / 128 / 29792
SLH-DSA-SHA2-256f keygen 494 µs 494 µs 471 µs 283 µs 605 µs 106 µs 1832 4.23 ms 8.96× +32.0 KiB 64 / 128 / 49856
SLH-DSA-SHA2-256f sign 5.81 ms 5.81 ms 5.84 ms 5.64 ms 6.14 ms 143 µs 170 96.6 ms 16.5× +768 KiB 64 / 128 / 49856
SLH-DSA-SHA2-256f verify 1.99 ms 1.99 ms 1.99 ms 1.93 ms 2.06 ms 45.6 µs 511 1.99 ms 1.00× 0 B 64 / 128 / 49856
SLH-DSA-SHAKE-128s keygen 2.51 ms 2.51 ms 2.56 ms 2.47 ms 3.03 ms 145 µs 379 63.4 ms 24.7× 0 B 32 / 64 / 7856
SLH-DSA-SHAKE-128s sign 19.6 ms 19.6 ms 19.8 ms 19.2 ms 20.5 ms 488 µs 51 474 ms 24.0× +16.0 KiB 32 / 64 / 7856
SLH-DSA-SHAKE-128s verify 347 µs 347 µs 348 µs 346 µs 350 µs 6.73 µs 2000 348 µs 1.00× 0 B 32 / 64 / 7856
SLH-DSA-SHAKE-128f keygen 135 µs 135 µs 147 µs 127 µs 218 µs 49.0 µs 2000 965 µs 6.56× 0 B 32 / 64 / 17088
SLH-DSA-SHAKE-128f sign 2.25 ms 2.25 ms 2.43 ms 2.12 ms 2.93 ms 356 µs 441 25.9 ms 10.7× +32.0 KiB 32 / 64 / 17088
SLH-DSA-SHAKE-128f verify 1.01 ms 1.01 ms 1.04 ms 1.01 ms 1.13 ms 45.1 µs 987 1.04 ms 1.000× +16.0 KiB 32 / 64 / 17088
SLH-DSA-SHAKE-192s keygen 3.66 ms 3.66 ms 3.81 ms 3.58 ms 4.16 ms 337 µs 266 93.3 ms 24.5× 0 B 48 / 96 / 16224
SLH-DSA-SHAKE-192s sign 34.6 ms 34.6 ms 35.6 ms 33.7 ms 37.6 ms 1.60 ms 29 807 ms 22.7× +16.0 KiB 48 / 96 / 16224
SLH-DSA-SHAKE-192s verify 520 µs 520 µs 521 µs 519 µs 529 µs 4.45 µs 1873 522 µs 1.00× 0 B 48 / 96 / 16224
SLH-DSA-SHAKE-192f keygen 185 µs 185 µs 202 µs 177 µs 307 µs 56.3 µs 2000 1.36 ms 6.74× 0 B 48 / 96 / 35664
SLH-DSA-SHAKE-192f sign 3.32 ms 3.32 ms 3.39 ms 3.24 ms 3.75 ms 165 µs 295 40.6 ms 12.0× +32.0 KiB 48 / 96 / 35664
SLH-DSA-SHAKE-192f verify 1.54 ms 1.54 ms 1.54 ms 1.53 ms 1.55 ms 9.14 µs 647 1.54 ms 1.00× +16.0 KiB 48 / 96 / 35664
SLH-DSA-SHAKE-256s keygen 2.45 ms 2.45 ms 2.47 ms 2.37 ms 2.59 ms 88.6 µs 392 61.4 ms 24.9× 0 B 64 / 128 / 29792
SLH-DSA-SHAKE-256s sign 32.6 ms 32.6 ms 32.6 ms 32.1 ms 32.9 ms 194 µs 30 701 ms 21.5× +144 KiB 64 / 128 / 29792
SLH-DSA-SHAKE-256s verify 761 µs 761 µs 765 µs 741 µs 830 µs 18.7 µs 1290 765 µs 1.00× 0 B 64 / 128 / 29792
SLH-DSA-SHAKE-256f keygen 429 µs 429 µs 431 µs 245 µs 669 µs 129 µs 2000 3.65 ms 8.45× 0 B 64 / 128 / 49856
SLH-DSA-SHAKE-256f sign 4.91 ms 4.91 ms 4.92 ms 4.79 ms 5.04 ms 85.2 µs 189 79.6 ms 16.2× 0 B 64 / 128 / 49856
SLH-DSA-SHAKE-256f verify 1.54 ms 1.54 ms 1.55 ms 1.54 ms 1.56 ms 20.3 µs 644 1.55 ms 1.00× 0 B 64 / 128 / 49856

# Hash functions

Benchmark Result Median Mean Min p95 Std dev Iterations CPU / op CPU load Peak RSS Δ (approx.)
SHA-256 1 MiB 378 MB/s 2.77 ms 2.78 ms 2.77 ms 2.79 ms 47.2 µs 360 2.78 ms 1.00× 0 B
SHA-512 1 MiB 533 MB/s 1.97 ms 1.97 ms 1.96 ms 1.98 ms 23.6 µs 507 1.97 ms 1.000× 0 B
SHA3-256 1 MiB 784 MB/s 1.34 ms 1.34 ms 1.33 ms 1.37 ms 26.7 µs 744 1.34 ms 1.00× 0 B
SHA3-512 1 MiB 419 MB/s 2.51 ms 2.52 ms 2.44 ms 2.74 ms 79.0 µs 399 2.52 ms 1.00× +16.0 KiB
SHAKE128 1 MiB 956 MB/s 1.10 ms 1.10 ms 1.09 ms 1.11 ms 13.6 µs 802 1.10 ms 1.00× 0 B
SHAKE256 1 MiB 785 MB/s 1.34 ms 1.34 ms 1.33 ms 1.35 ms 20.5 µs 748 1.34 ms 1.00× 0 B
Keccak-256 1 MiB 785 MB/s 1.34 ms 1.35 ms 1.33 ms 1.51 ms 50.4 µs 748 1.35 ms 1.00× 0 B
RIPEMD-160 1 MiB 328 MB/s 3.20 ms 3.21 ms 3.19 ms 3.22 ms 51.1 µs 312 3.21 ms 1.00× 0 B
BLAKE2b-512 1 MiB 1364 MB/s 769 µs 771 µs 767 µs 779 µs 11.2 µs 1275 771 µs 1.00× 0 B
Keccak-f[1600] permutation 6.20 M permutations/s 10.3 µs 10.4 µs 10.3 µs 10.4 µs 224 ns 40000 10.4 µs 1.00× 0 B

# Symmetric encryption and MAC

Benchmark Result Median Mean Min p95 Std dev Iterations CPU / op CPU load Peak RSS Δ (approx.)
AES-256-GCM seal 1 MiB 9.48 MB/s 111 ms 111 ms 111 ms 111 ms 163 µs 8 111 ms 1.00× 0 B
AES-256-GCM open 1 MiB 9.48 MB/s 111 ms 111 ms 111 ms 111 ms 303 µs 9 111 ms 1.00× 0 B
ChaCha20-Poly1305 seal 1 MiB 511 MB/s 2.05 ms 2.06 ms 2.04 ms 2.07 ms 41.2 µs 484 2.06 ms 1.00× 0 B
ChaCha20-Poly1305 open 1 MiB 511 MB/s 2.05 ms 2.05 ms 2.04 ms 2.07 ms 13.5 µs 486 2.05 ms 1.00× 0 B
HMAC-SHA256 1 MiB 382 MB/s 2.75 ms 2.75 ms 2.74 ms 2.76 ms 37.4 µs 362 2.75 ms 1.00× 0 B
HMAC-SHA256 64-byte message 1.63 µs 1.63 µs 1.64 µs 1.62 µs 1.66 µs 40.2 ns 242000 1.64 µs 1.00× 0 B
HKDF-SHA256 derive 32 bytes 3.07 µs 3.07 µs 3.08 µs 3.06 µs 3.09 µs 26.9 ns 130000 3.08 µs 1.00× 0 B

# Key derivation

Benchmark Result Median Mean Min p95 Std dev Iterations CPU / op CPU load Peak RSS Δ (approx.)
PBKDF2-HMAC-SHA512 2048 iterations (BIP-39) 2.74 ms 2.74 ms 2.75 ms 2.73 ms 2.77 ms 46.4 µs 391 2.75 ms 1.00× 0 B
Argon2id 19 MiB t=2 p=1 9.41 ms 9.41 ms 9.44 ms 9.40 ms 9.57 ms 67.4 µs 87 9.44 ms 1.00× +18.8 MiB
Argon2id 64 MiB t=3 p=4 56.2 ms 56.2 ms 56.7 ms 55.9 ms 59.1 ms 1.65 ms 16 56.7 ms 1.000× +64.0 MiB

# Number-theoretic transforms

Benchmark Result Median Mean Min p95 Std dev Iterations CPU / op CPU load Peak RSS Δ (approx.)
ML-KEM NTT forward 274 ns/transform 8.76 µs 8.79 µs 7.93 µs 9.69 µs 510 ns 46000 8.79 µs 1.000× 0 B
ML-KEM NTT inverse 368 ns/transform 11.8 µs 11.8 µs 11.7 µs 11.9 µs 287 ns 34000 11.8 µs 1.00× 0 B
ML-DSA NTT forward 500 ns/transform 16.0 µs 16.0 µs 16.0 µs 16.1 µs 166 ns 26000 16.0 µs 1.00× 0 B
ML-DSA NTT inverse 641 ns/transform 20.5 µs 20.6 µs 20.5 µs 20.7 µs 564 ns 16000 20.6 µs 1.00× 0 B

# secp256k1

Benchmark Result Median Mean Min p95 Std dev Iterations CPU / op CPU load Peak RSS Δ (approx.) PK / SK / output (bytes)
secp256k1 public key 242 µs 242 µs 264 µs 241 µs 404 µs 69.9 µs 1155 264 µs 1.000× +112 KiB 33 / 32 / 64
secp256k1 ECDSA sign 1.01 ms 1.01 ms 1.01 ms 1.01 ms 1.02 ms 4.50 µs 917 1.01 ms 1.000× +128 KiB 33 / 32 / 64
secp256k1 ECDSA verify 498 µs 498 µs 502 µs 497 µs 514 µs 12.1 µs 2000 502 µs 1.000× +16.0 KiB 33 / 32 / 64
secp256k1 ECDSA recover 502 µs 502 µs 503 µs 500 µs 511 µs 3.17 µs 1983 503 µs 1.00× 0 B 33 / 32 / 64
secp256k1 Schnorr sign 977 µs 977 µs 978 µs 974 µs 989 µs 4.47 µs 1001 978 µs 1.00× +16.0 KiB 32 / 32 / 64
secp256k1 Schnorr verify 488 µs 488 µs 489 µs 487 µs 496 µs 3.18 µs 2000 489 µs 1.00× 0 B 32 / 32 / 64

# Mac mini M4 (Mac16,10), cluster node m4ma

Swift toolchain: Apple Swift 6.3.3 (swiftlang-6.3.3.1.3). Condition: shared cluster node running other services. Raw data: docs/benchmarks/Mac16-10-M4.json.

  • Machine: Mac16,10 (Apple M4)
  • Cores: 10 physical, 10 logical (4 performance + 6 efficiency)
  • Memory: 24.0 GiB
  • System: macOS 26.5.1
  • Build: release, engine 1.0.0
  • Mode: full (1.00 s per benchmark)
  • Started: 2026-12-04T20:15:31Z; wall time 65.6 s, CPU time 237 s (user + system)
  • Thermal state: nominal; low-power mode: off at start, off at end
  • Machine load average (1 min, all processes): 1.96 at start, 3.18 at end
  • Energy: not measured (no per-process energy counter is available to applications); CPU time and thermal state are the proxies.

# ML-KEM (FIPS 203)

Benchmark Result Median Mean Min p95 Std dev Iterations CPU / op CPU load Peak RSS Δ (approx.) PK / SK / output (bytes)
ML-KEM-512 keygen 13.1 µs 13.1 µs 14.2 µs 10.0 µs 21.8 µs 3.90 µs 4000 14.2 µs 1.00× +272 KiB 800 / 1632 / 768
ML-KEM-512 encaps 10.8 µs 10.8 µs 10.8 µs 10.0 µs 11.2 µs 371 ns 34000 10.8 µs 1.000× +96.0 KiB 800 / 1632 / 768
ML-KEM-512 decaps 13.4 µs 13.4 µs 13.4 µs 12.6 µs 14.0 µs 436 ns 32000 13.4 µs 1.000× 0 B 800 / 1632 / 768
ML-KEM-768 keygen 15.0 µs 15.0 µs 14.9 µs 13.6 µs 15.3 µs 319 ns 30000 14.9 µs 1.000× +64.0 KiB 1184 / 2400 / 1088
ML-KEM-768 encaps 17.1 µs 17.1 µs 17.1 µs 15.9 µs 17.8 µs 548 ns 24000 17.1 µs 1.000× 0 B 1184 / 2400 / 1088
ML-KEM-768 decaps 20.6 µs 20.6 µs 20.5 µs 19.0 µs 21.2 µs 567 ns 22000 20.5 µs 1.000× 0 B 1184 / 2400 / 1088
ML-KEM-1024 keygen 22.7 µs 22.7 µs 22.6 µs 21.1 µs 23.5 µs 653 ns 20000 22.6 µs 1.000× +32.0 KiB 1568 / 3168 / 1568
ML-KEM-1024 encaps 25.6 µs 25.6 µs 25.5 µs 23.6 µs 26.2 µs 743 ns 16000 25.5 µs 1.000× 0 B 1568 / 3168 / 1568
ML-KEM-1024 decaps 29.7 µs 29.7 µs 29.6 µs 27.3 µs 30.6 µs 904 ns 14000 29.6 µs 1.000× 0 B 1568 / 3168 / 1568

# ML-DSA (FIPS 204)

Benchmark Result Median Mean Min p95 Std dev Iterations CPU / op CPU load Peak RSS Δ (approx.) PK / SK / output (bytes)
ML-DSA-44 keygen 37.6 µs 37.6 µs 36.6 µs 33.7 µs 38.5 µs 1.79 µs 4000 36.7 µs 1.000× +128 KiB 1312 / 2560 / 2420
ML-DSA-44 sign 116 µs 116 µs 126 µs 52.0 µs 217 µs 46.9 µs 6000 126 µs 1.000× +112 KiB 1312 / 2560 / 2420
ML-DSA-44 verify 35.3 µs 35.3 µs 34.8 µs 32.1 µs 36.0 µs 1.24 µs 8000 34.8 µs 1.000× +32.0 KiB 1312 / 2560 / 2420
ML-DSA-65 keygen 63.5 µs 63.5 µs 63.1 µs 58.4 µs 65.4 µs 2.01 µs 6000 63.1 µs 1.000× +16.0 KiB 1952 / 4032 / 3309
ML-DSA-65 sign 176 µs 176 µs 195 µs 78.0 µs 371 µs 89.2 µs 4000 195 µs 1.000× +32.0 KiB 1952 / 4032 / 3309
ML-DSA-65 verify 57.8 µs 57.8 µs 57.5 µs 52.8 µs 58.9 µs 1.37 µs 8000 57.5 µs 1.000× +16.0 KiB 1952 / 4032 / 3309
ML-DSA-87 keygen 101 µs 101 µs 100 µs 92.6 µs 104 µs 3.25 µs 4000 100 µs 1.000× +32.0 KiB 2592 / 4896 / 4627
ML-DSA-87 sign 204 µs 204 µs 242 µs 123 µs 504 µs 127 µs 2000 242 µs 1.000× +32.0 KiB 2592 / 4896 / 4627
ML-DSA-87 verify 96.3 µs 96.3 µs 96.1 µs 88.2 µs 98.6 µs 2.10 µs 6000 96.1 µs 1.000× 0 B 2592 / 4896 / 4627

# SLH-DSA (FIPS 205)

Benchmark Result Median Mean Min p95 Std dev Iterations CPU / op CPU load Peak RSS Δ (approx.) PK / SK / output (bytes)
SLH-DSA-SHA2-128s keygen 8.21 ms 8.21 ms 8.22 ms 8.18 ms 8.38 ms 50.7 µs 120 80.6 ms 9.80× +272 KiB 32 / 64 / 7856
SLH-DSA-SHA2-128s sign 63.6 ms 63.6 ms 63.5 ms 62.7 ms 64.2 ms 496 µs 15 618 ms 9.73× +544 KiB 32 / 64 / 7856
SLH-DSA-SHA2-128s verify 394 µs 394 µs 396 µs 372 µs 430 µs 15.4 µs 2000 396 µs 1.000× +16.0 KiB 32 / 64 / 7856
SLH-DSA-SHA2-128f keygen 226 µs 226 µs 227 µs 195 µs 239 µs 13.0 µs 2000 1.10 ms 4.83× +400 KiB 32 / 64 / 17088
SLH-DSA-SHA2-128f sign 4.21 ms 4.21 ms 4.22 ms 4.14 ms 4.30 ms 48.6 µs 238 30.8 ms 7.30× +160 KiB 32 / 64 / 17088
SLH-DSA-SHA2-128f verify 1.07 ms 1.07 ms 1.08 ms 1.02 ms 1.21 ms 38.8 µs 933 1.08 ms 1.000× 0 B 32 / 64 / 17088
SLH-DSA-SHA2-192s keygen 12.4 ms 12.4 ms 12.4 ms 12.3 ms 12.6 ms 118 µs 80 122 ms 9.81× +48.0 KiB 48 / 96 / 16224
SLH-DSA-SHA2-192s sign 118 ms 118 ms 118 ms 117 ms 119 ms 562 µs 8 1.11 s 9.44× +5.08 MiB 48 / 96 / 16224
SLH-DSA-SHA2-192s verify 583 µs 583 µs 587 µs 537 µs 657 µs 24.6 µs 1675 587 µs 1.000× +32.0 KiB 48 / 96 / 16224
SLH-DSA-SHA2-192f keygen 321 µs 321 µs 317 µs 277 µs 332 µs 12.1 µs 2000 1.65 ms 5.20× +16.0 KiB 48 / 96 / 35664
SLH-DSA-SHA2-192f sign 6.94 ms 6.94 ms 6.95 ms 6.87 ms 7.08 ms 57.1 µs 143 51.7 ms 7.45× +96.0 KiB 48 / 96 / 35664
SLH-DSA-SHA2-192f verify 1.64 ms 1.64 ms 1.65 ms 1.54 ms 1.86 ms 62.6 µs 611 1.65 ms 1.000× 0 B 48 / 96 / 35664
SLH-DSA-SHA2-256s keygen 8.39 ms 8.39 ms 8.41 ms 8.32 ms 8.58 ms 96.9 µs 119 82.1 ms 9.77× +16.0 KiB 64 / 128 / 29792
SLH-DSA-SHA2-256s sign 109 ms 109 ms 109 ms 108 ms 109 ms 485 µs 9 1.01 s 9.30× +10.0 MiB 64 / 128 / 29792
SLH-DSA-SHA2-256s verify 889 µs 889 µs 896 µs 822 µs 982 µs 31.4 µs 1094 896 µs 1.000× 0 B 64 / 128 / 29792
SLH-DSA-SHA2-256f keygen 646 µs 646 µs 647 µs 636 µs 656 µs 5.24 µs 1526 5.05 ms 7.80× +16.0 KiB 64 / 128 / 49856
SLH-DSA-SHA2-256f sign 13.0 ms 13.0 ms 13.3 ms 12.5 ms 14.7 ms 760 µs 78 107 ms 8.05× +352 KiB 64 / 128 / 49856
SLH-DSA-SHA2-256f verify 1.83 ms 1.83 ms 1.83 ms 1.69 ms 1.86 ms 47.5 µs 542 1.83 ms 1.000× 0 B 64 / 128 / 49856
SLH-DSA-SHAKE-128s keygen 6.93 ms 6.93 ms 6.94 ms 6.92 ms 7.01 ms 26.5 µs 143 68.0 ms 9.80× 0 B 32 / 64 / 7856
SLH-DSA-SHAKE-128s sign 52.9 ms 52.9 ms 52.9 ms 52.8 ms 53.0 ms 49.8 µs 18 517 ms 9.77× 0 B 32 / 64 / 7856
SLH-DSA-SHAKE-128s verify 348 µs 348 µs 348 µs 314 µs 353 µs 4.23 µs 2000 348 µs 1.000× 0 B 32 / 64 / 7856
SLH-DSA-SHAKE-128f keygen 206 µs 206 µs 205 µs 174 µs 212 µs 8.33 µs 2000 979 µs 4.78× 0 B 32 / 64 / 17088
SLH-DSA-SHAKE-128f sign 3.74 ms 3.74 ms 3.76 ms 3.66 ms 3.89 ms 76.6 µs 268 26.2 ms 6.96× +16.0 KiB 32 / 64 / 17088
SLH-DSA-SHAKE-128f verify 1.01 ms 1.01 ms 1.01 ms 924 µs 1.02 ms 10.8 µs 980 1.01 ms 1.000× +16.0 KiB 32 / 64 / 17088
SLH-DSA-SHAKE-192s keygen 10.2 ms 10.2 ms 10.2 ms 10.2 ms 10.3 ms 70.9 µs 97 99.7 ms 9.76× 0 B 48 / 96 / 16224
SLH-DSA-SHAKE-192s sign 93.4 ms 93.4 ms 93.6 ms 93.2 ms 94.8 ms 826 µs 10 891 ms 9.52× +16.0 KiB 48 / 96 / 16224
SLH-DSA-SHAKE-192s verify 522 µs 522 µs 521 µs 473 µs 527 µs 5.18 µs 1833 521 µs 1.000× 0 B 48 / 96 / 16224
SLH-DSA-SHAKE-192f keygen 272 µs 272 µs 270 µs 233 µs 277 µs 8.73 µs 2000 1.40 ms 5.19× 0 B 48 / 96 / 35664
SLH-DSA-SHAKE-192f sign 5.92 ms 5.92 ms 5.92 ms 5.85 ms 5.97 ms 33.0 µs 167 42.0 ms 7.08× +48.0 KiB 48 / 96 / 35664
SLH-DSA-SHAKE-192f verify 1.54 ms 1.54 ms 1.54 ms 1.40 ms 1.55 ms 12.8 µs 640 1.54 ms 1.000× 0 B 48 / 96 / 35664
SLH-DSA-SHAKE-256s keygen 6.80 ms 6.80 ms 6.80 ms 6.78 ms 6.81 ms 7.11 µs 147 66.0 ms 9.72× +16.0 KiB 64 / 128 / 29792
SLH-DSA-SHAKE-256s sign 84.1 ms 84.1 ms 84.2 ms 82.6 ms 85.4 ms 873 µs 11 778 ms 9.25× +32.0 KiB 64 / 128 / 29792
SLH-DSA-SHAKE-256s verify 748 µs 748 µs 747 µs 676 µs 754 µs 6.09 µs 1305 747 µs 1.000× 0 B 64 / 128 / 29792
SLH-DSA-SHAKE-256f keygen 581 µs 581 µs 586 µs 564 µs 644 µs 18.4 µs 1758 4.07 ms 6.94× +112 KiB 64 / 128 / 49856
SLH-DSA-SHAKE-256f sign 10.3 ms 10.3 ms 10.3 ms 10.2 ms 10.3 ms 34.0 µs 97 84.3 ms 8.21× 0 B 64 / 128 / 49856
SLH-DSA-SHAKE-256f verify 1.55 ms 1.55 ms 1.55 ms 1.41 ms 1.56 ms 13.4 µs 637 1.55 ms 1.000× 0 B 64 / 128 / 49856

# Hash functions

Benchmark Result Median Mean Min p95 Std dev Iterations CPU / op CPU load Peak RSS Δ (approx.)
SHA-256 1 MiB 405 MB/s 2.59 ms 2.58 ms 2.41 ms 2.62 ms 30.0 µs 384 2.58 ms 1.000× 0 B
SHA-512 1 MiB 609 MB/s 1.72 ms 1.73 ms 1.61 ms 1.81 ms 40.4 µs 583 1.73 ms 1.000× 0 B
SHA3-256 1 MiB 789 MB/s 1.33 ms 1.33 ms 1.21 ms 1.34 ms 11.5 µs 765 1.33 ms 1.000× 0 B
SHA3-512 1 MiB 428 MB/s 2.45 ms 2.45 ms 2.24 ms 2.47 ms 21.8 µs 406 2.45 ms 1.00× +16.0 KiB
SHAKE128 1 MiB 962 MB/s 1.09 ms 1.09 ms 995 µs 1.10 ms 10.4 µs 909 1.09 ms 1.000× 0 B
SHAKE256 1 MiB 792 MB/s 1.32 ms 1.32 ms 1.21 ms 1.34 ms 13.4 µs 747 1.32 ms 1.000× 0 B
Keccak-256 1 MiB 792 MB/s 1.32 ms 1.32 ms 1.20 ms 1.34 ms 13.1 µs 746 1.32 ms 1.000× 0 B
RIPEMD-160 1 MiB 332 MB/s 3.16 ms 3.15 ms 2.99 ms 3.17 ms 20.7 µs 315 3.15 ms 1.000× 0 B
BLAKE2b-512 1 MiB 1418 MB/s 740 µs 739 µs 675 µs 746 µs 6.26 µs 1325 739 µs 1.000× 0 B
Keccak-f[1600] permutation 6.17 M permutations/s 10.4 µs 10.3 µs 9.22 µs 10.5 µs 183 ns 40000 10.4 µs 1.000× 0 B

# Symmetric encryption and MAC

Benchmark Result Median Mean Min p95 Std dev Iterations CPU / op CPU load Peak RSS Δ (approx.)
AES-256-GCM seal 1 MiB 10.7 MB/s 97.9 ms 97.9 ms 97.8 ms 97.9 ms 59.9 µs 10 97.9 ms 1.000× 0 B
AES-256-GCM open 1 MiB 10.7 MB/s 97.8 ms 97.9 ms 97.8 ms 98.2 ms 161 µs 10 97.9 ms 1.000× 0 B
ChaCha20-Poly1305 seal 1 MiB 602 MB/s 1.74 ms 1.74 ms 1.63 ms 1.77 ms 20.1 µs 574 1.74 ms 1.000× 0 B
ChaCha20-Poly1305 open 1 MiB 602 MB/s 1.74 ms 1.74 ms 1.62 ms 1.77 ms 21.8 µs 577 1.74 ms 1.000× 0 B
HMAC-SHA256 1 MiB 410 MB/s 2.56 ms 2.55 ms 2.39 ms 2.59 ms 27.9 µs 384 2.55 ms 1.000× 0 B
HMAC-SHA256 64-byte message 1.51 µs 1.51 µs 1.54 µs 1.35 µs 1.74 µs 102 ns 262000 1.54 µs 1.000× 0 B
HKDF-SHA256 derive 32 bytes 2.83 µs 2.83 µs 2.87 µs 2.68 µs 3.22 µs 150 ns 142000 2.87 µs 1.00× 0 B

# Key derivation

Benchmark Result Median Mean Min p95 Std dev Iterations CPU / op CPU load Peak RSS Δ (approx.)
PBKDF2-HMAC-SHA512 2048 iterations (BIP-39) 2.23 ms 2.23 ms 2.26 ms 2.04 ms 2.38 ms 82.3 µs 442 2.26 ms 1.000× 0 B
Argon2id 19 MiB t=2 p=1 9.50 ms 9.50 ms 9.49 ms 9.06 ms 9.57 ms 85.0 µs 89 9.49 ms 1.000× +19.0 MiB
Argon2id 64 MiB t=3 p=4 62.6 ms 62.6 ms 62.7 ms 61.8 ms 63.3 ms 511 µs 15 62.7 ms 1.000× +64.0 MiB

# Number-theoretic transforms

Benchmark Result Median Mean Min p95 Std dev Iterations CPU / op CPU load Peak RSS Δ (approx.)
ML-KEM NTT forward 246 ns/transform 7.86 µs 7.85 µs 7.11 µs 8.00 µs 142 ns 58000 7.85 µs 1.000× 0 B
ML-KEM NTT inverse 336 ns/transform 10.7 µs 10.7 µs 9.82 µs 10.9 µs 228 ns 38000 10.7 µs 1.000× 0 B
ML-DSA NTT forward 461 ns/transform 14.8 µs 14.8 µs 13.4 µs 15.0 µs 167 ns 30000 14.8 µs 1.000× 0 B
ML-DSA NTT inverse 554 ns/transform 17.7 µs 17.6 µs 16.2 µs 18.1 µs 399 ns 24000 17.6 µs 1.000× 0 B

# secp256k1

Benchmark Result Median Mean Min p95 Std dev Iterations CPU / op CPU load Peak RSS Δ (approx.) PK / SK / output (bytes)
secp256k1 public key 127 µs 127 µs 127 µs 115 µs 136 µs 6.75 µs 2000 127 µs 1.000× +16.0 KiB 33 / 32 / 64
secp256k1 ECDSA sign 148 µs 148 µs 146 µs 135 µs 150 µs 5.01 µs 2000 146 µs 1.00× 0 B 33 / 32 / 64
secp256k1 ECDSA verify 379 µs 379 µs 381 µs 327 µs 431 µs 32.6 µs 1833 381 µs 1.000× 0 B 33 / 32 / 64
secp256k1 ECDSA recover 345 µs 345 µs 350 µs 326 µs 380 µs 19.4 µs 1896 350 µs 1.000× 0 B 33 / 32 / 64
secp256k1 Schnorr sign 864 µs 864 µs 872 µs 831 µs 929 µs 42.2 µs 937 872 µs 1.000× 0 B 32 / 32 / 64
secp256k1 Schnorr verify 391 µs 391 µs 403 µs 362 µs 446 µs 25.4 µs 2000 403 µs 1.000× 0 B 32 / 32 / 64

# 3.3 iPhone

Not yet measured. No figure exists for any iPhone at the date of this document. They will be added here from the in-app benchmark screen (same QyvoraBenchmarks suite, release build, device model, iOS version, thermal state and low-power mode recorded by the report) once it has been run on a device. Do not infer iPhone numbers from the Mac tables: core counts, sustained power and thermal behaviour differ.

# 4. Key, signature and ciphertext sizes

Bytes, from the engine's parameter sets (qyvora-bench --sizes).

Parameter set Standard Kind NIST category Public key Private key Ciphertext / signature Shared secret
ML-KEM-512 FIPS 203 KEM 1 800 1632 768 32
ML-KEM-768 FIPS 203 KEM 3 1184 2400 1088 32
ML-KEM-1024 FIPS 203 KEM 5 1568 3168 1568 32
ML-DSA-44 FIPS 204 signature 2 1312 2560 2420 –
ML-DSA-65 FIPS 204 signature 3 1952 4032 3309 –
ML-DSA-87 FIPS 204 signature 5 2592 4896 4627 –
SLH-DSA-SHA2-128s FIPS 205 signature 1 32 64 7856 –
SLH-DSA-SHA2-128f FIPS 205 signature 1 32 64 17088 –
SLH-DSA-SHA2-192s FIPS 205 signature 3 48 96 16224 –
SLH-DSA-SHA2-192f FIPS 205 signature 3 48 96 35664 –
SLH-DSA-SHA2-256s FIPS 205 signature 5 64 128 29792 –
SLH-DSA-SHA2-256f FIPS 205 signature 5 64 128 49856 –
SLH-DSA-SHAKE-128s FIPS 205 signature 1 32 64 7856 –
SLH-DSA-SHAKE-128f FIPS 205 signature 1 32 64 17088 –
SLH-DSA-SHAKE-192s FIPS 205 signature 3 48 96 16224 –
SLH-DSA-SHAKE-192f FIPS 205 signature 3 48 96 35664 –
SLH-DSA-SHAKE-256s FIPS 205 signature 5 64 128 29792 –
SLH-DSA-SHAKE-256f FIPS 205 signature 5 64 128 49856 –
secp256k1 ECDSA SEC 2 / RFC 6979 signature – 33 32 64 –
secp256k1 Schnorr BIP-340 signature – 32 32 64 –

# 5. Limits of the method

  • No energy counter. See section 1: CPU time and thermal state are proxies, not energy measurements.
  • Shared machines. The three Macs were running other work. Medians and minima resist that better than means; the standard deviation and p95 columns show how noisy each measurement was. Re-running on an idle machine will give slightly better numbers, never the opposite conclusion about a hot spot.
  • First-benchmark effect. On the two cluster nodes ML-KEM-512 keygen, the very first benchmark of the run, is slower than ML-KEM-512 encaps (15.6 µs against 11.9 µs on the M3 Ultra, 13.1 µs against 10.8 µs on the M4), although the laptop shows the expected order (8.90 µs against 10.3 µs). The single warm-up call is not enough to bring a core that was asleep to full speed; treat that one figure on the nodes with caution.
  • Wall clock against CPU time. SLH-DSA wall-clock figures depend on the number of free cores; on an iPhone, and on a loaded machine, expect them to move towards the CPU-time figures.
  • Swift arithmetic. Every algorithm is written in Swift (the only C of the engine sets the data-independent-timing flag and computes nothing), so it cannot reach the ARMv8 AES, PMULL, SHA-2 and SHA-3 instructions that CryptoKit and other native libraries use. Its hashes and AEADs are software implementations and are not comparable to hardware-accelerated ones; no comparison with another library was measured for this document.
  • One process, fixed order. The memory high-water mark depends on the order of the suite, and long runs heat the device: on a phone the last families may run in a higher thermal state than the first (the report records the state at the end of each benchmark).
  • Deterministic inputs. One key and one message pattern per parameter set; timing does not explore key-dependent variation, which constant-time code should not have anyway. This suite is a performance tool, not a constant-time test.
  • NTT micro-benchmarks measure the public in-place transforms on a fresh copy of a fixed input; they include the copy and say nothing about how many transforms a KEM or signature operation performs.

# 6. Hot spots and optimization notes

Observations come from the tables above; the suggested changes are not implemented and their gains are not measured. Orders of magnitude quoted for a suggestion come from the literature on comparable portable implementations and must be confirmed with this suite after any change. All suggestions keep the constant-time discipline of the engine.

  1. AES-256-GCM: about 10 MB/s, 60 times slower than ChaCha20-Poly1305 (≈ 610 MB/s) on the same machine. It is the one primitive whose cost a user can feel (1 MiB takes ≈ 100 ms). Two causes, both chosen for constant time: the S-box is computed algebraically (x^254 in GF(2^8): 4 bit-serial multiplications and 7 squarings per eight bytes, 14 rounds), and GHASH scans 128 precomputed multiples of H with masks for every 16-byte block. The split between the two was not measured.
    • Replace the algebraic S-box by a bitsliced Boolean circuit (Boyar–Peralta, 113 gates) on 8 blocks at a time held in SIMD8<UInt64> or eight UInt64 words (the "ct64" construction of BearSSL, or fixslicing). Counter mode supplies the 8 parallel blocks for free. Still no table, no secret-dependent branch.
    • Replace bit-by-bit GHASH by a carry-less multiplication built from integer multiplications with "holes" (BearSSL ghash_ctmul64), or by a 4-bit masked-table method with H^1..H^4 aggregated reduction. ARMv8 PMULL and AESE are not reachable from pure Swift: Swift SIMD types expose no polynomial multiply and no AES round.
    • Until then, prefer ChaCha20-Poly1305 for bulk data in the application and keep AES-256-GCM for small payloads (key wrapping), where 10 MB/s is irrelevant.
  2. secp256k1: 124 µs for a public key, 380 µs for a verification, 870 µs for a Schnorr signature. Scalar multiplication is a 256-step double-and-add-always (512 complete point operations) for every use.
    • Fixed-base multiplications (public key, ECDSA nonce, Schnorr nonce): precomputed comb or 4-bit window table of multiples of G, entries selected by a full masked scan; removes all 256 doublings and most additions.
    • Verification and recovery handle public data only: use variable-time Strauss–Shamir interleaving of u1·G + u2·Q with wNAF (one shared doubling chain instead of two), optionally the GLV endomorphism. Keep the constant-time path for anything touching a secret.
    • Schnorr signing recomputes the public key from the private key and then verifies its own signature (a deliberate fault countermeasure): it costs six ECDSA signatures. Let callers pass a cached key pair, and it benefits directly from a faster verification.
    • Field inversion and square root by exponentiation (montPow) can use fixed addition chains.
  3. SLH-DSA: fast on the wall clock only because it uses every core (128s signature: 29 ms wall, 440 ms of CPU on the M5 Max; 64 ms wall on the 10-core M4). On a phone with 2 performance cores expect far longer wall-clock times and a CPU-time bill in the range measured here, 0.4 to 1.1 s per "s" signature, or more on slower cores; this is the first benchmark to watch for thermal state. The SHA-2 path already caches the seeded midstate. Remaining lever in pure Swift: hash several WOTS+/FORS chains per call with 2-way (SIMD2<UInt64>, SHAKE) or 4-way (SIMD4<UInt32>, SHA-256) interleaved compression inside each thread.
  4. Keccak is at the scalar ceiling: 6.2 to 6.4 M permutations/s (≈ 156 ns each), SHAKE128 ≈ 1 GB/s. Absorption is already lane-wise, so sponge overhead is negligible and single-stream hashing will not improve without the ARMv8.2 SHA-3 instructions (unreachable from Swift). What can improve is everything that hashes independent streams: ML-KEM and ML-DSA matrix expansion and noise sampling, SLH-DSA SHAKE: a 2-way permutation on SIMD2<UInt64> (NEON 128-bit lanes).
  5. ML-KEM and ML-DSA are not limited by the NTT. A forward ML-KEM NTT takes ≈ 235 ns and a ML-DSA one ≈ 440 ns, while ML-KEM-768 encapsulation takes 16 µs and ML-DSA-65 verification 54 µs: a handful of transforms explains a small part of that. Before touching the arithmetic, profile; the likely levers are the 2-way Keccak above, caching the expanded matrix for repeated operations under one key (a "prepared key" API), and removing intermediate [UInt8] allocations in encode / decode. In the NTT itself, lazy reduction (dropping the Barrett reduction of the ML-KEM inverse layers where bounds allow; the inverse, which also carries the final scaling, is 37 % slower than the forward transform on the M5 Max) and explicit SIMD8<Int16> / SIMD4<Int32> butterflies for the layers with stride ≥ 8 are the classical gains.
  6. Short-input hashing pays for allocations. PBKDF2-HMAC-SHA512 costs ≈ 930 ns per iteration on the M5 Max although it already reuses the two HMAC midstates, i.e. two compressions per iteration; at the measured SHA-512 throughput (609 MB/s, ≈ 210 ns per 128-byte block) the compressions account for under half of it. HMAC-SHA256 of 64 bytes with a 32-byte key costs 1.3 µs for five compressions (≈ 0.8 µs at the measured SHA-256 throughput). The rest is [UInt8] traffic: message and digest arrays, the growable block buffer, copies of the hash state. A fixed-size in-place path (stack buffer, digest written into caller storage) would remove it and benefits BIP-39, BIP-32 and every HMAC-DRBG style loop.
  7. SHA-256 (≈ 400 MB/s) and RIPEMD-160 (≈ 360 MB/s) are scalar implementations at a normal speed for portable code. The ARMv8 SHA-2 instructions are out of reach; single-stream SHA-256 has no worthwhile SIMD form. Nothing to do beyond point 6.
  8. ChaCha20-Poly1305 (≈ 610 MB/s) can gain from a 4-block ChaCha20 on SIMD4<UInt32> (NEON) and from Poly1305 on three 44-bit limbs or two 64-bit limbs with multipliedFullWidth instead of five 26-bit limbs.
  9. Argon2id is single-threaded even with p = 4 (CPU load 1×; 62 ms at 64 MiB, t = 3). The lanes of a slice are independent by specification: computing them concurrently gives the same tag and up to p times less wall-clock time. Its +64 MiB resident peak is the parameter, not a defect.
Files main
Menu

Theme