Värn-60
A cipher can be broken not only by its mathematics but by its timing. If an implementation takes a few nanoseconds longer on some secret inputs than on others, that difference is a leak, and an attacker who can measure it can pull the secret out one step at a time. VÄRN-60 — codename Anu — is the instrument that listens for that difference in the new post-quantum algorithms, and measures it against the clock of the processor itself.
VÄRN-60 crafts many ciphertexts — valid ones and deliberately malformed ones — feeds them to a key-decapsulation routine, and times each one with the Apple Silicon hardware performance counters. It then asks, with a Welch t-test and Cohen's d, whether the malformed inputs are handled in a measurably different time. It covers all three NIST standards: ML-KEM (FIPS 203), ML-DSA (FIPS 204) and SLH-DSA (FIPS 205).
To my knowledge, it is the first scanner to bring these four things together in one tool: all three NIST post-quantum standards, a targeted Fujisaki–Okamoto oracle, both static and dynamic checking, and hardware counters on Apple Silicon. It was developed independently. General constant-time checkers came before it — ctgrind (2010), dudect (2016), TIMECOP in SUPERCOP — and VÄRN-60 does not replace them; it specialises where they are general.
The Measurement
The plate below is a real run: ML-KEM-768 on an Apple M4 Pro, 1000 timings for each of 15 ciphertext classes. Each ridge is the distribution of decapsulation times for one class. If the implementation leaked, the malformed classes would ride ahead of or behind the valid one. They do not — the ridges sit on the same line. Drag to turn the plate.
What the Numbers Say
| Ciphertext class vs. valid | Δ mean (ns) | Cohen's d | p |
|---|---|---|---|
| all-zero | +18.7 | 0.014 | 0.75 |
| all-ones | +1.4 | 0.001 | 0.98 |
| bit-flip (worst of 8) | +23.6 | 0.018 | 0.69 |
| random (worst of 4) | +22.0 | 0.017 | 0.71 |
Every class: d below 0.02, p near 1. No class is distinguishable from the valid one. Timer resolution 41 ns; baseline mean ≈ 7930 ns. This is the free demo scan (ML-KEM-768 only); the full audit across all three standards runs under licence.
A Measurement Artifact, Corrected
An earlier version measured each class in its own block, one after another. On a laptop that warms up and changes clock frequency as it runs, the later blocks drift, and the drift can masquerade as a leak — it once showed a difference of Cohen's d around 0.7, which looked alarming and was not real. The measurement now interleaves the classes: every round times each class once, in rotating order, so warm-up and thermal drift fall on all of them equally. With that fix the apparent leak disappears, as the plate shows.
On ML-DSA
VÄRN-60 also sees that ML-DSA signing takes a variable amount of time from one signature to the next. This is not a leak. The algorithm uses rejection sampling: it draws candidate signatures and discards the ones that fall outside a bound, so the number of tries — and therefore the time — varies by design. The variation is not tied to the secret key. Reporting it as a vulnerability would be a mistake; it is expected behaviour.
What It Does Not Claim
A clean result on five reference libraries is evidence, not proof: another platform, another compiler, or a different workload could still leak, and only the demo configuration is shown here. VÄRN-60 measures timing through one channel; it says nothing about power, electromagnetic or cache-based attacks. And it is a scanner, not an attack — it finds and reports, so that implementations can be hardened before anyone else goes looking.