LMS-SHA-256-H5-W4
Leighton-Micali stateful hash-based signatures, standardised in RFC 8554 and SP 800-208
Source found and wired, correctness not fully proven. Root API only. Reach it with NextSSL(root=True) in Python or the nextssl_root_* functions in C.
About LMS-SHA-256-H5-W4
LMS-SHA-256-H5-W4 is one of 2 LMS variants in the NextSSL registry, a digital signature scheme. It uses a 60-byte public key, a 32–512-byte secret key, a 256–65,536-byte signature and a 32-byte seed. Its registry entry cites RFC 8554 and NIST SP 800-208. It is designed to resist attacks by large quantum computers. NextSSL lists it in the unverified tier and exposes it through the root API only (NextSSL(root=True) in Python, nextssl_root_* in C).
Overview
LMS is a stateful hash-based signature scheme in which each key can sign a fixed number of messages. Its security depends only on the hash function, and it is approved by NIST for post-quantum firmware and software signing.
An LMS key is a Merkle tree whose leaves are LM-OTS one-time signature keys, built from Winternitz-style hash chains. The public key is the tree root. Each signature uses the next unused leaf: it contains the one-time signature of the message and the authentication path from that leaf to the root. Because a one-time key must never sign two different messages, the signer must keep and reliably update a counter of used leaves.
This statefulness is the main operational hazard. Restoring a key from backup, cloning a virtual machine or running two signers in parallel can cause leaf reuse, which allows forgeries. NIST SP 800-208 therefore restricts LMS to settings where state can be managed carefully, typically in hardware security modules. Generating a key requires computing every leaf, so tall trees take longer to create.
Two parameter sets are present, both with SHA-256 and Winternitz parameter w = 4: lms-sha256-h5-w4, with a tree of height 5 (32 signatures), and lms-sha256-h10-w4, with height 10 (1024 signatures). Signatures for these sets are roughly 2.3 to 2.5 KB, and the public key is only 56 bytes. Larger tree heights, such as 15, 20 or 25, are defined in the standards for higher signature budgets.
History
1979–2020Lamport one-time signatures and Merkle trees introduced
Leighton and Micali patent the LMS hash-based scheme
LMS and HSS specified in RFC 8554
Approved in NIST SP 800-208
How it works
- KeyGen derives 2^h one-time keys from a seed and builds a Merkle tree over their public values.
- Sign uses the next unused leaf to sign the message with LM-OTS and appends the authentication path.
- The signer must persist the incremented leaf index before releasing the signature.
- Verify recomputes the one-time public key, then the path to the root, and compares with the public key.
Security notes
Reusing a leaf index breaks security, so state handling must be robust against crashes, backups and concurrency. The number of signatures per key is fixed in advance; for stateless use, SLH-DSA is the alternative.
Typical uses
Sizes
| Field | Bytes | Meaning |
|---|---|---|
| pk | 60 | Public key |
| sk | 32 – 512 | Secret key |
| sig | 256 – 65,536 | Signature |
| seed | 32 | Seed |
Use it
from nextssl_demo import NextSSL
root = NextSSL(root=True) # tier 'unverified' is reachable from the root API only
pk, state = root.call("stateful_keygen", "lms-sha256-h5-w4", None, outs=2)
sig, state = root.call("stateful_sign", "lms-sha256-h5-w4", None, state, b"message", outs=2) # state advances
nextssl_root_stateful_keygen("lms-sha256-h5-w4", NULL, pk, state);
nextssl_root_stateful_sign("lms-sha256-h5-w4", NULL, state, msg, sig, new_state);
// statefulsign is a root-only kind: use the C ABI (nextssl_root_*)
// or the Statefulsign trait in nextssl-core/src/traits.rs
Calls follow the NextSSL C ABI and its language bindings. Buffer sizes are validated against the sizes above.
Other LMS variants
1Similar names
Looking for something else?More digital signatures
All 503Frequently asked questions
What is LMS-SHA-256-H5-W4?
LMS-SHA-256-H5-W4 is a signature in the LMS family. LMS is a stateful hash-based signature scheme in which each key can sign a fixed number of messages.
What are the LMS-SHA-256-H5-W4 sizes?
In NextSSL, LMS-SHA-256-H5-W4 uses: public key 60 bytes, signature 256 to 65,536 bytes.
Is LMS-SHA-256-H5-W4 post-quantum?
Yes. LMS-SHA-256-H5-W4 is a post-quantum signature: it is designed to resist attacks by large quantum computers. Its tier in NextSSL is unverified.
Who designed LMS-SHA-256-H5-W4 and when?
LMS-SHA-256-H5-W4 belongs to the LMS family, first published in 1979 by Tom Leighton, Silvio Micali; specified by David McGrew, Michael Curcio, Scott Fluhrer. Its origin: IETF RFC 8554 and NIST SP 800-208.
Which standards define LMS-SHA-256-H5-W4?
LMS-SHA-256-H5-W4 is referenced by RFC 8554, NIST SP 800-208.
Is LMS-SHA-256-H5-W4 safe to use?
LMS-SHA-256-H5-W4 is in the unverified tier. Source found and wired, correctness not fully proven. Root API only. It is only reachable through the root API (NextSSL(root=True) in Python, nextssl_root_* in C).
What other LMS variants are there?
NextSSL also registers lms-sha256-h10-w4 in the LMS family.