Four tiers, two algorithms, and one row that says no
The question a VP of engineering actually has is whether it runs on the part already in the schematic. Here is the answer by tier, with the arithmetic that makes it true and the gaps marked where they are.
| Tier | Typical RAM | LMS / HSS RFC 8554 |
ML-DSA-44 FIPS 204 |
Builds today |
|---|---|---|---|---|
| A — 8-bit and tinyATmega328P, small PIC, low-end MSP430 | ~2 KB32 KB flash | Design target56-byte key, SHA-256 only, signature streams from flash. An argument from the specification constants — nothing has been built or measured for this tier | Does not fit1312-byte key against 2048 bytes of total RAM | No AVR buildHonest gap, not a claim |
| B — Cortex-M0 / M0+STM32L0, SAMD21, nRF51 class | 8–32 KB32–256 KB flash | YesThe target the no-alloc constraint was written for | Does not fitThe key alone is a sixth of RAM, before any arithmetic | thumbv6m-none-eabi |
| C — Cortex-M4 / M7, RISC-V MCUSTM32F4, nRF52, ESP32 class | 64–512 KB256 KB–2 MB flash | YesStill the cheaper option on cycles and flash | 74,492 B of stackMeasured under emulation, per verification. That is more than the total RAM of a 64 KB part, so this is a per-part question and not a tier-wide yes | thumbv7em-none-eabihf |
| D — Application processor / kernelLinux gateway, x86-64, Cortex-A | MB and up | Yes | Yes — expected configWhere --features mldsa is the normal build |
x86_64-unknown-none |
- Measured / verified A command was run and this is what it printed.
- Spec constant Fixed by RFC 8554 or FIPS 204. Not our number to measure.
- Not measured Nobody has run it. No figure is published at all.
- Does not fit Ruled out by the algorithm’s own sizes, not by preference.
ML-DSA does not fit the bottom tier. That is why LMS exists
ML-DSA-44 has a 1312-byte public key and a 2420-byte signature. An ATmega328P has 2048 bytes of RAM in total. The public key alone is roughly two-thirds of the entire part — before the signature, before the verifier’s working state, before the C stack, before a single variable belonging to your application.
This is not a tuning problem waiting for a cleverer implementation. There is no arrangement of ML-DSA verification that fits that part, because the key does not fit, and verification cannot proceed without the key. Streaming the key from flash does not rescue it either: ML-DSA verification needs the key unpacked into NTT domain, which means the expanded form resident, not consumed in order.
The implementation makes it concrete rather than theoretical. fips204’s SerDes::try_from_bytes takes the public key by value as a [u8; 1312], so 1312 bytes land on the stack before any arithmetic happens at all. On a Cortex-M0+ with 8 KB that is a sixth of RAM spent on a function argument.
So LMS is not a weaker fallback for people who could not afford the real thing. It is the hash-based scheme that exists precisely for this constraint, and the reason NIST approved it separately in SP 800-208 rather than folding everything into the lattice schemes. LMS verification needs SHA-256 and nothing else: no NTT, no rejection sampling, no modular arithmetic, no constant-time table lookups. It holds a few hundred bytes of state, and it consumes the signature strictly in order, so a multi-megabyte image can be hashed a flash page at a time and never held in RAM.
--features mldsa is the expected configuration — that is what lets a kernel verify artifacts signed with the lattice scheme as well as the hash-based one. One verifier crate, one C ABI, the algorithm chosen by a feature flag rather than by a different codebase per tier.
Side by side
| LMS H5 / W8the small-device default | LMS H10 / W4 | ML-DSA-44 | |
|---|---|---|---|
| Public key | 56 B | 56 B | 1312 B |
| Public key, as HSS4-byte level count + LMS key | 60 B | 60 B | — |
| Signature | 1292 B | 2508 B | 2420 B |
| Primitives needed on device | SHA-256 | SHA-256 | NTT, rejection sampling, modular arithmetic |
| Signature consumable in orderi.e. streams from flash | Yes | Yes | No — key expanded and resident |
| One-time keys per tree | 32 | 1,024 | n/a — stateless |
| Signer must keep monotonic state | Yes | Yes | No |
| NIST approval | SP 800-208 | SP 800-208 | FIPS 204 |
| Covered by an official test vector | Yes — RFC 8554 TC1 | Yes — RFC 8554 TC2 | Round-trip tests onlyWe do not reimplement it; fips204 does the work |
Tree height is a release-count budget for the life of the product
An LMS tree of height h contains 2h one-time keys, and that is the total number of images that root will ever be able to sign. You pick it before the root goes into OTP, and you cannot raise it afterwards — which makes it the one parameter worth arguing about in a design review.
Count honestly: production releases, plus field-trial builds, plus per-customer variants, plus the ones you burn on a mistake, across a fifteen-year support window, with margin. Teams underestimate this because they count shipping releases and forget the rest.
| Configuration | Images it can sign | Signature size | LMS verifications on device | Official vector |
|---|---|---|---|---|
| LMS h=5, w=8 | 32 | 1292 B | 1 | Yes |
| LMS h=10, w=8 | 1,024 | 1452 B | 1 | Not this pairTC2 covers h=10, but at w=4. No published vector uses h=10 with w=8 |
| LMS h=15, w=8 | 32,768 | 1612 B | 1 | None published |
| LMS h=20, w=8 | 1,048,576 | 1772 B | 1 | None published |
| LMS h=25, w=8 | 33,554,432 | 1932 B | 1 | None published |
| HSS, 2 levels of h=5, w=8the shape of RFC 8554 Test Case 1 | 1,024 | 2644 B | 2 | Yes |
| HSS, 2 levels of h=10, w=8 | 1,048,576 | 2964 B | 2 | Shape not publishedBoth constituent trees are covered |
w = 1 and w = 2, are implemented but RFC 8554 publishes no test vector for them. They are therefore not covered by vector tests, only by the encoding and negative tests. The same is true of every combination the two published cases do not pin down: between them they fix h=5 with w=8 and h=10 with w=4, so a configuration such as h=10 with w=8 has its height and its width each exercised somewhere, and that pairing exercised nowhere. We will not generate our own vector and present it as coverage — a vector produced by the implementation it is testing proves that the code agrees with itself.
Why you might choose HSS over one tall tree
A single h=20 tree and two stacked h=10 trees both give you 220 signatures. The difference is on the signer, not the device: generating a single h=20 tree means computing a million leaves up front and keeping the tree available, whereas HSS lets the lower tree be generated on demand and discarded. If your signing service is an HSM with a modest working set, that matters.
The device pays for it: each extra HSS level is one more LMS verification and one more public key to parse, and about 1.4 KB more signature to read. For a part where boot time is in your product requirements, that is a trade to make deliberately. A one-level HSS key is the normal issuance for a small device.
The other dial: Winternitz w
w trades signature bytes against hash invocations, and it is a surprisingly wide range:
w = 8— 34 hash chains, 1124-byte LM-OTS signature. Smallest signature, most SHA-256 work.w = 4— 67 chains, 2180 bytes.w = 2— 133 chains, 4292 bytes.w = 1— 265 chains, 8516 bytes. Largest signature, least hashing.
On a part where the signature streams out of external flash and cycles are the scarce resource, moving from w = 8 towards w = 1 buys boot time with bytes. Which direction is right for your board depends on your flash read throughput against your clock — and that is a measurement nobody has made yet. We are not going to tell you which way to turn it from a laptop benchmark.
What you actually have to burn into the part
The authoritative value is a 32-byte root. The verifier exposes recompute_root for exactly this case: the public key travels with the image as untrusted data, the verifier recomputes the root from the signature, and the bootloader compares the result against the root held in OTP or mask ROM. Changing anything in the key — the identifier, the typecodes, the parameter set — changes the recomputed root, so the comparison catches it.
Thirty-two bytes of fuses, not 1312. You should still pin the parameter set you expect rather than accepting whatever the image declares, as defence in depth and to keep boot time predictable.
Next
The measured numbers page lists every figure that has been measured, every one that is a specification constant, and every one that is not measured at all. The flash cost, stack high-water and instructions per verification for the tier you are evaluating are in Table 2 there; the cycles, wall-clock time and energy for your part are in the not-measured table, blank, with the reason next to them.
If your part is in tier A or B and you want the bottom row to stop saying “no AVR build”, that is Phase 2 work and it starts with naming the part: alex@blockle.org.