LMS

Also known as: Leighton–Micali Signature

On this page 7

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.

ComponentPurposeTypical size with SHA-256
Leaf index qIdentifies the one-time key used4 bytes
LM-OTS signatureSigns the message hash with one-time keyAbout 1.1 to 8.5 KB
Algorithm type fieldsDeclare LMS and LM-OTS parameter sets8 bytes
Authentication pathProves the leaf belongs to the tree32 bytes per tree level
Components of an LMS signature

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 wHash chains pSignature sizeRelative hashing cost
w = 1265About 8.5 KBLowest
w = 2133About 4.3 KBLow
w = 467About 2.5 KBModerate
w = 834About 1.5 KBHighest
Effect of the Winternitz parameter at tree height 10

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.

SchemeSecurity basisState requiredTypical role
LMS / HSSHash functions onlyYesFirmware and code signing
XMSSHash functions onlyYesFirmware and code signing
SLH-DSAHash functions onlyNoGeneral use with large signatures
ML-DSAModule latticesNoGeneral-purpose signing
FN-DSANTRU latticesNoCompact signatures, complex implementation
LMS and related signature schemes

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.

SituationRecommendationReason
Boot ROM verifying firmwareUse LMS or HSSSmall public key, conservative security
Signing release packages yearlyUse LMS with moderate heightSignature budget is easy to plan
TLS server certificatesPrefer ML-DSAHigh volume and replicated keys
Signer cloned across many serversAvoid LMSShared state risks key reuse
Deciding whether LMS fits

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.