The benchmark harness, the measurements, and this document were produced by an AI agent (Claude) at the direction of GitHub user kdmukai. The results have not been independently reviewed.
Pi Zero 2 W and Pi Zero: each board's SDK compiler defaults (sdk-pi02w,
sdk-armv6) at every level: -fstack-protector-strong, PIE, full RELRO, dynamic
linking, except that the Pi Zero 2 W's level 2 links OpenSSL's libcrypto statically.
ESP32: ESP-IDF's defaults, which also suit MicroPython firmware (it cannot use the
compiler stack protector):
FreeRTOS task-stack canary check
the ESP32-P4 hardware stack guard
ESP32-S3 memory protection
assertions on
no compiler stack protector
task watchdog off, because the benchmark task runs for minutes without yielding
RP2350: the Pico SDK's Release defaults, with no compiler stack protector, as on the
ESP32 boards:
FreeRTOS's stack overflow check (method 2)
the port's per-task stack limit register
a hardware watchdog fed from the tick interrupt, with a fault handler that records the
fault across the reboot (the counterpart of ESP-IDF's interrupt watchdog and panic
handler)
Every level runs Blockstream's scheme code (jade-hbs @ f5c90a5e), with the two build-time
edits described under Implementations and inputs, and the same keys and inputs. Levels
differ only in how SHA-256 is computed, build settings, and memory placement. On the Pi
Zero 2 W, the ESP32 boards, and the RP2350, every level is also run with Blockstream's
dual-core code paths ("two cores"), which Jade's release builds leave compiled out [9][10]; XMSS has no dual-core path and runs on one core in both builds on the ESP32 boards
and the RP2350, and only in the one-core build on the Pi Zero 2 W.
Level 1, portable C: SHA-256 in plain C for every scheme. Pi Zero 2 W and Pi Zero:
gcc 13.3 -O2 from each board's SDK, which compiles for that board's CPU. ESP32: ESP-IDF
performance optimization (-O2); with two cores, both compute in plain C. RP2350: Pico
SDK 2.3.1 with GCC 14.2.1 at -O2, as on the other boards (the SDK's Release default is
-O3), code run from flash; with two cores, both compute in plain C.
Level 2, platform acceleration: documented platform facilities. Pi Zero 2 W: OpenSSL
3.4.1 through its public API, the SDK's libcrypto linked statically; libcrypto selects
its NEON SHA-256 code at run time, as the CPU has no SHA-256 instructions. Pi Zero:
system OpenSSL 3.4.1 through its public API. ESP32: the SHA unit through ESP-IDF's
driver functions; with two cores, the second core computes in plain C while the first
holds the SHA unit. RP2350: the SHA-256 accelerator through the SDK's hardware_sha256
driver functions [19], code run from flash, -O2; with two cores, the second core
computes in plain C while the first holds the accelerator.
Level 3, tuned: Pi Zero 2 W: OpenSSL 3.4.1's NEON SHA-256 block function, called
directly, with a big-endian single-block copy for SLH-DSA, a native-word-order SHA-256
API for SHRINCS and XMSS, -O3, and LTO, chosen over the Pi Zero's integer code in
screening runs (short timing runs that compare builds and are not reported in the
tables; docs/knowledge/pi-zero-2w-a53-builds-and-sha256-paths.md). Pi Zero: a modified
copy of OpenSSL 3.4.1's ARM assembly, the same native-word-order API, -O3, and LTO.
ESP32: register-level SHA unit access that rewrites only the message words that changed
(this relies on the unit keeping its message registers, verified on both chips but not
documented by Espressif), hot code in IRAM, larger caches, and -O3. RP2350:
register-level accelerator access, the hash-based and SHA-256 code in SRAM, -O3, and the
ESP32 boards' SHA-256 context code; with two cores, the second core hashes with the Pi
Zero's level-3 assembly, assembled as Thumb-2. Chosen in screening runs of the
accelerator paths (docs/knowledge/rp2350-sha256-accelerator-no-resume.md) and of code
placement.
Calibration: Blockstream's unmodified Jade firmware on our ESP32-S3 board, timed on
the host over USB, as Blockstream measured.
Lattice schemes: ML-DSA and FN-DSA run at levels 1 and 3 with those levels' compiler
settings (level 3: Pi Zero 2 W and Pi Zero -O3 and LTO; ESP32 -O3 and the larger caches,
with the lattice code left in flash rather than IRAM; RP2350 -O3, with the lattice code
left in flash), on one core: neither implementation has a dual-core path. Both hash with
SHAKE, which neither the ESP32 SHA units nor the RP2350's accelerator computes, and on
the Pi Zero 2 W and Pi Zero no OpenSSL-backed SHAKE path was built, so a level-2 build
would run the level-1 lattice code; level 2 is not run for them.
Hash-based schemes: Blockstream's code in the Jade fork (github.com/DmitriiKJ/Jade,
branch hash_based_signatures, commit f5c90a5e), in every round. The builds copy its
scheme sources and make two edits (harness/linux/Makefile,
harness/esp-idf/main/CMakeLists.txt, harness/pico/CMakeLists.txt): they rename
slhdsa-c's sha2_256_compress() to sha2_256_compress_soft(), so that each level
supplies its own SHA-256 block function, and in two-core builds they delete the line
#define CONFIG_FREERTOS_UNICORE 1 at the top of slh_dsa.c and wots_c.c, which
otherwise compiles out Blockstream's dual-core code paths. Jade's release keeps that
line and signs on one core.
ML-DSA: mldsa-native v2.0.0 (PQ Code Package, commit
834a90d5e846ffa1e1611bd24e160bb2e9b86d35; Apache-2.0 OR ISC OR MIT), unmodified,
portable C backend. Two configurations: the default and MLD_CONFIG_REDUCE_RAM
("reduced RAM"), which recomputes data instead of keeping it and gives byte-identical
outputs.
FN-DSA: c-fn-dsa by Thomas Pornin (commit 1b858880dcac091b5e5f84f0e4d8617c35ba1392;
Unlicense, a public-domain dedication), unmodified. It uses native floating point only
on x86 with SSE2, 64-bit ARM with NEON, and 64-bit RISC-V with the D extension; none of
the five boards is one of these (the Pi Zero 2 W's Cortex-A53 runs in 32-bit mode), so
every FN-DSA row, the Pi Zero 2 W's and Pi Zero's included, runs the library's integer
emulation of floating point.
Inputs: run x uses the 32-byte input x (big-endian) as message or key-generation
seed, as in the first round. Lattice signing uses the key pair generated from input 0,
with an empty context string.
Clocks: the Pi boards read CLOCK_MONOTONIC for wall time and
CLOCK_PROCESS_CPUTIME_ID for the process's CPU time; the ESP32 boards read
esp_timer_get_time(); the RP2350 reads time_us_64() (through a stand-in for
ESP-IDF's esp_timer.h). All three count microseconds or finer
(harness/common/common.c).
Inside the timed call: the scheme's library call, plus, for hash-based key
generation, the SHA-512 seed derivation that precedes it. Copying keys and inputs,
restoring keys, and verifying new signatures happen outside it.
Wall time: every table reports wall time. The Pi boards also record CPU time, which
shows when other processes took time from a run; the microcontrollers record wall time
only.
Pauses in Jade's grinding: Jade's WOTS+C grinding loops call vTaskDelay(1): on one
core once at the start and once every 100,000 counter values, and in the two-core code
once every 100,000 counter values on the second core. On the ESP32 boards and the RP2350
each call waits for the next FreeRTOS tick (100 Hz), between 0 and 10 ms, and that wait
is inside the timed call; on the Pi boards the call does nothing
(harness/linux/shim/freertos/task.h). An estimate, not a measurement: SHRINCS-L
stateful signing at swn=140 needs 6,218,398 attempts on average, so about 63 pauses per
message on one core, about 0.3 to 0.6 s, which is 0.5 to 2.0% of the microcontrollers'
level-3 one-core figures (ESP32-P4 fastest, RP2350 slowest). Stateless signing grinds
WOTS+C at two layers, so it pauses about twice as often, a smaller share of its much
longer time; SHRINCS-B's grinding at swn=2040 needs too few attempts to pause more than
once.
The measurements were made in four rounds. The tables name a round only where they compare
rounds or come from the first.
First round: the hash-based schemes on the Pi Zero, the ESP32-P4, and the ESP32-S3
at every level, plus the builds for the cost of safeguards (Tables 21a and 21b) and
Jade's own firmware on our ESP32-S3 board (Table 22).
Second round: the hash-based schemes again on the same three boards, with builds
that also carry the lattice schemes and embedded verification vectors [41]. These
boards' hash-based signing, key generation, and memory figures come from it.
Third round: verification at every level and the lattice schemes at levels 1 and 3
on the same three boards, with the second round's builds printing times to 1 µs instead
of 0.1 ms. At 0.1 ms, operations under about 3 ms carry one or two significant figures,
and averaging does not remove the rounding for deterministic operations
(docs/knowledge/benchmark-timing-resolution-and-untimed-work.md); the second round's
ESP32 level-1 lattice runs also covered inputs 0 to 9 only (n=10), and the third round
runs n=100 over inputs 0 to 99. These boards' verification and lattice figures come from
it. For operations of 3 ms or more, its means agree with the second round's within 0.52%
on the ESP32-P4 and within 0.30% on the ESP32-S3, apart from level-1 FN-DSA-512
verification (1.22%), where rounding each third-round run to 0.1 ms reproduces the
second round's mean. On the Pi Zero, wall-time means differ between the rounds by up to
5.48% (31 of 49 within 1%), while CPU-time means differ by at most 1.56% (48 of 49
within 1%): the difference is time taken by other processes during some runs.
Fourth round: the Pi Zero 2 W and the RP2350, every operation, printing times to 1
µs.
SHRINCS-L stateful signing at swn=140: messages 0 to 9 need 1,923,081 WOTS+C attempts on
average against the expectation of 6,218,398, so a plain mean over them is not an
estimate of the expected signing time. On the Pi Zero 2 W and Pi Zero the fit uses the
swn=140 job alone; on the ESP32 boards and the RP2350 it pools the swn=96 and swn=140
runs of one job set.
Correctness, first round: every one-core output matches the Pi Zero level 2 output byte
for byte (Pi Zero: four other first-round runs, 4,436 rows; ESP32: 32 job sets, 904
one-core rows). Two-core outputs match too, except SHRINCS signatures, which can differ
in bytes because the first valid counter found wins. Correctness of that path rests on
the two-core self-test, which signs and verifies with a consistent key and passed in all
16 two-core SHRINCS job sets.
Correctness, second to fourth rounds: scripts/check_r2.py against the host reference
outputs over every second-round job used here (234 Pi Zero jobs and 78 complete ESP32
job sets), 85 third-round jobs and job sets, the 273 fourth-round Pi Zero 2 W jobs, and
the 39 fourth-round RP2350 job sets used: 58,919 of 58,919 rows pass. Every output
equals the host's byte for byte except 153 two-core SHRINCS signatures in 44 job groups,
where Blockstream's dual-core grinding returned a different counter. 91 of them
(self-tests and stateless signing) verified; the other 62 are SHRINCS-B stateful
signatures made with the fixed key and SHRINCS-L signatures at swn=96, which cannot be
verified (independent verification, below).
Independent verification (host only, with scripts/slh_dsa_openssl_verify.py,
scripts/fips205_sha2_check.py, scripts/shrincs_cpp_verify.py,
scripts/xmss_fixed_key_check.c, and scripts/check_mldsa_openssl.py):
SLH-DSA-SHA2-128s: OpenSSL 3.5.7, in FIPS 205 pure mode with an empty context and
deterministic signing, produces byte-identical keys and signatures for inputs 0 to 99
and verifies its signatures; every first-round SLH-DSA row (1,109 signing, 957 key
generation, including screening runs) equals OpenSSL's output, and the second round's
host reference outputs for SLH-DSA-SHA2-128s (100 signatures and 100 keys) equal
OpenSSL's, which every board's second-round output and the Pi Zero 2 W's and RP2350's
fourth-round outputs equal.
SPHINCS+ 2^40 (parameters OpenSSL cannot load): a FIPS 205 verifier written from the
standard and cross-checked against OpenSSL on SLH-DSA-SHA2-128s, verifies the
signature of message 0 and reproduces every key generation output; signatures of
messages 1 to 99 were not checked independently.
SHRINCS: shrincs-cpp (BlockstreamResearch, commit 7643d953; a second implementation
from the same group, not independent authorship) fully verifies the self-test
signatures and every SHRINCS-L signature at swn=140 (messages 0 to 99); signatures
made with the fixed SHRINCS-B key pass every check short of the final root comparison;
signatures at swn=96 cannot verify, because both verifiers check the fixed target sum
140.
XMSS 2^10: no independent verifier exists for Jade's variant (WOTS+C in place of
WOTS+, a new OID).
ML-DSA: OpenSSL 3.5.7 derives the same public keys and byte-identical deterministic
signatures for all 300 messages checked (3 parameter sets, messages 0 to 99) and
verifies them.
FN-DSA: no independent check; c-fn-dsa's own self-tests pass on the host, with native
floating point and with the emulation the boards use.
In the second round, SHRINCS-L stateful signing at swn=140 checks each signature with
Jade's verifier (its verified column reads 1, against -1 in the first round); its output
bytes are unchanged.
Pi Zero level 1, swn=140 (first round): run 19 lost 5.0 s of wall time to other
processes (wall time minus CPU time). Excluding it moves the expected value by 0.2%, so
all runs are kept.
The FreeRTOS end-of-stack watchpoint: the checks that stay on cover most of what it
detects: the ESP32-P4's hardware stack guard panics as soon as the stack pointer leaves
the running task's stack, and FreeRTOS checks a canary at each context switch. The
watchpoint adds detection of a store into the last 32 bytes of the stack while the stack
pointer is still in bounds (docs/knowledge/esp32-p4-stack-watchpoint-cost.md).