LMS, the Leighton–Micali Signature scheme, is a stateful hash-based digital signature that combines many one-time signature keys under a single public key using a Merkle tree. In quantum security it is valued because its strength rests only on the security of a hash function such as SHA-256, which quantum computers weaken only modestly, so LMS is considered resistant to attacks by a cryptographically relevant quantum computer.
LMS is specified in RFC 8554 and approved by NIST in SP 800-208, together with its multi-level form called HSS. It is a mature choice for code signing, firmware updates and secure boot, but its stateful design demands careful key management that general-purpose signatures do not require.
How LMS builds signatures from hash functions
LMS works in two layers. The lower layer is the LM-OTS one-time signature, a Winternitz-style scheme in which the signer reveals intermediate values of hash chains whose positions encode the message digest. Each LM-OTS private key may sign exactly one message, because a second signature would reveal enough chain values to let an attacker forge new ones.
The upper layer is a Merkle tree of height h whose 2^h leaves are hashes of LM-OTS public keys. The root of the tree is the LMS public key. A signature contains the leaf index q, the LM-OTS signature and the authentication path of h sibling hashes, which lets the verifier recompute the root and compare it with the stored public key.
The table below lists the components that appear in every LMS signature.
| Component | Purpose | Typical size with SHA-256 |
|---|---|---|
| Leaf index q | Identifies the one-time key used | 4 bytes |
| LM-OTS signature | Signs the message hash with one-time key | About 1.1 to 8.5 KB |
| Algorithm type fields | Declare LMS and LM-OTS parameter sets | 8 bytes |
| Authentication path | Proves the leaf belongs to the tree | 32 bytes per tree level |
Parameter sets and the size trade-off
LMS parameters are chosen along two axes: the tree height h, which sets how many signatures one key can produce, and the Winternitz parameter w, which trades signature size against computation. Larger w shortens the signature but requires longer hash chains and therefore more hashing during signing and verification.
The following table shows how w affects an LMS signature with SHA-256 and a tree of height 10.
| Winternitz w | Hash chains p | Signature size | Relative hashing cost |
|---|---|---|---|
| w = 1 | 265 | About 8.5 KB | Lowest |
| w = 2 | 133 | About 4.3 KB | Low |
| w = 4 | 67 | About 2.5 KB | Moderate |
| w = 8 | 34 | About 1.5 KB | Highest |
Tree height determines capacity and key generation time. Standard heights are 5, 10, 15, 20 and 25, giving from 32 to about 33 million signatures. Key generation must compute every leaf, so a single tree of height 25 is slow to create; the HSS hierarchical construction solves this by stacking smaller trees, where a top tree signs the roots of lower trees.
The public key is only 56 bytes, and verification is fast, which suits constrained devices that check signatures far more often than they produce them.
LMS compared with other post-quantum signatures
LMS is one of several quantum-resistant signature options, and its niche is defined by minimal security assumptions combined with the burden of state. The comparison below places it next to the closest alternatives in post-quantum cryptography.
| Scheme | Security basis | State required | Typical role |
|---|---|---|---|
| LMS / HSS | Hash functions only | Yes | Firmware and code signing |
| XMSS | Hash functions only | Yes | Firmware and code signing |
| SLH-DSA | Hash functions only | No | General use with large signatures |
| ML-DSA | Module lattices | No | General-purpose signing |
| FN-DSA | NTRU lattices | No | Compact signatures, complex implementation |
Compared with XMSS, LMS has a simpler structure and somewhat faster operations, while XMSS offers a tighter security proof. SLH-DSA removes the state entirely but produces signatures of about 8 to 50 KB. Lattice schemes are stateless and efficient but depend on newer mathematical assumptions than hash functions.
Where LMS is used and how to deploy it
LMS fits systems where one well-protected signer issues a limited number of signatures that many devices verify. The NSA CNSA 2.0 suite names LMS and XMSS for software and firmware signing, and vendors of hardware security modules and secure boot ROMs already support it.
The decision table below summarizes common deployment situations.
| Situation | Recommendation | Reason |
|---|---|---|
| Boot ROM verifying firmware | Use LMS or HSS | Small public key, conservative security |
| Signing release packages yearly | Use LMS with moderate height | Signature budget is easy to plan |
| TLS server certificates | Prefer ML-DSA | High volume and replicated keys |
| Signer cloned across many servers | Avoid LMS | Shared state risks key reuse |
NIST SP 800-208 requires that key generation and signing occur inside a hardware cryptographic module, precisely to keep the state consistent. Exporting private keys for backup is restricted, so operators typically split the signature space across several devices instead of copying one key.
State management risks and common mistakes
The defining risk of LMS is one-time key reuse. If the signer ever signs two different messages with the same leaf index, an attacker can combine the revealed hash chain values to forge signatures, and the whole key must be considered compromised.
- Restoring from backup: a restored key may reuse indexes already consumed after the backup was taken.
- Virtual machine snapshots: cloning a running signer duplicates its state.
- Writing state late: the updated counter must be stored before the signature is released.
- Running out of leaves: a tree that is too small forces an unplanned key rollover.
- Treating LMS as general purpose: high-volume online signing is better served by stateless schemes.
In simple terms
LMS is a way to sign software so that even a future quantum computer cannot fake the signature. It relies only on hash functions, which are well understood and hard to break.
Think of a book of single-use stamps. Each stamp can mark only one document. A short master code proves that every stamp came from the same book. If someone uses the same stamp twice, forgers can copy it. So the owner must always remember which stamp comes next.
A practical example
A manufacturer of industrial controllers expects its devices to stay in the field for more than 15 years, well into the period when quantum attacks on RSA and ECDSA may become practical. Its engineers burn a 56-byte LMS public key into each controller’s boot ROM and configure the bootloader to verify every firmware image against it.
The signing key lives inside a hardware security module and uses an HSS structure with two levels of height 10, providing about one million signatures, far more than the few hundred releases planned. The module records each used index before releasing a signature, and a second module holds a separate portion of the signature space for disaster recovery. As a result, firmware updates remain trustworthy against quantum adversaries without any change to the deployed hardware.