QianHeng乾珩 PQC Docs Hub量子文档 ✦ Ask AI✦ 问问文档 ⚐ Scan⚐ 扫一扫

SLH-DSA (FIPS 205)

SLH-DSA is the NIST-standardized stateless hash-based signature scheme derived from SPHINCS+. It relies on nothing but the security of its underlying hash function, giving it the most conservative security assumptions of any standardized PQC signature — at the cost of large signatures.

How it works

SLH-DSA is built entirely from hash functions (either the SHA-2 or the SHAKE/SHA-3 family) — no lattices, no number theory. Its security relies primarily on well-studied properties of the underlying hash functions, together with correct parameterization and implementation — making it a conservative, non-lattice alternative to lattice-based signatures. Its security reduces to standard security properties of the hash function; against quantum attacks the main consideration is the security-strength reduction from Grover search, which is why the parameters are sized for the corresponding security levels.

Internally it composes several hash-based building blocks: a few-time signature (FORS) signs a message digest, a one-time signature (WOTS+) authenticates intermediate keys, and a hypertree of Merkle trees binds everything to a single public key. Crucially, SLH-DSA is stateless: each signature picks its FORS instance pseudorandomly, so unlike XMSS/LMS the signer need not track any per-signature state. This eliminates the catastrophic key-reuse failure mode of stateful schemes.

Parameter sets

There are 12 parameter sets: hash family {SHA2, SHAKE} x security {128, 192, 256} x speed variant {s, f}. The s ("small") variant gives shorter signatures but slower signing; the f ("fast") variant signs faster but produces larger signatures. Public keys are tiny.

Parameter set (example)Security levelPublic keySignature (approx.)
SLH-DSA-128sCategory 1327856
SLH-DSA-128fCategory 13217088
SLH-DSA-192sCategory 34816224
SLH-DSA-256sCategory 56429792
SLH-DSA-256fCategory 56449856

Public keys are 32, 48, or 64 bytes for the 128/192/256-bit security levels respectively.

Strengths & tradeoffs

  • Most conservative security. Depends only on hash-function security — the best-understood primitive in cryptography. No new structured-lattice or coding assumptions.
  • Stateless. No fragile per-signature state to manage, unlike XMSS/LMS. Tiny public keys.
  • Tradeoff: signatures are very large (8-50 KB) and signing is comparatively slow. This makes it impractical for high-volume signing or bandwidth-constrained protocols, but ideal as a long-term root of trust.

When to use it

Reach for SLH-DSA when you want maximum confidence and signature size is not a bottleneck: root certificates, firmware/secure-boot anchors, and infrequently-issued long-lived signatures. It is an excellent hedge against a future cryptanalytic break of lattice schemes. The s variants produce smaller signatures but sign more slowly; the f variants sign faster but produce larger signatures. If transmission/storage cost matters more, prefer s; if signing latency matters more, prefer f.

Code example

Note
liboqs mechanism name strings change between versions: some builds expose this scheme as SLH-DSA-SHA2-128s, others as SLH_DSA_PURE_SHA2_128S or the legacy SPHINCS+-SHA2-128s-simple. Before running, confirm the exact name with oqs.get_enabled_sig_mechanisms().
import oqs

alg = "SLH-DSA-SHA2-128s"
message = b"root CA cross-signature"

with oqs.Signature(alg) as signer:
    public_key = signer.generate_keypair()  # public key ~32 bytes
    signature = signer.sign(message)         # signature ~7856 bytes
    print("pk bytes:", len(public_key), "sig bytes:", len(signature))

with oqs.Signature(alg) as verifier:
    print("valid:", verifier.verify(message, signature, public_key))
Warning
SLH-DSA signatures can exceed 40 KB. Before adopting it in a protocol, confirm that message-size limits, certificate-size assumptions, and buffer allocations can accommodate signatures an order of magnitude larger than ECDSA. For high-throughput signing, consider ML-DSA instead.

Standards & references

Related

SLH-DSA FIPS 205

SLH-DSA 是 NIST 标准化的无状态哈希签名方案,源自 SPHINCS+。它的安全性仅依赖底层哈希函数,是所有标准化后量子签名中假设最保守的一种——代价是签名体积庞大。

工作原理

SLH-DSA 完全由哈希函数(SHA-2 或 SHAKE/SHA-3 族)构建——不涉及格、不涉及数论。其安全性主要依赖于底层哈希函数已被充分研究的性质,并取决于正确的参数选择与实现——这使它成为相对格签名而言更为保守的、非格类替代方案。其安全性可归约到哈希函数的标准安全性质;面对量子攻击时主要考虑 Grover 搜索带来的安全强度折减,因此参数已按相应安全等级设计。

其内部组合了若干哈希构件:少次签名 FORS 对消息摘要签名,一次性签名 WOTS+ 认证中间密钥,再由由多棵 Merkle 树组成的超树(hypertree)将一切绑定到单一公钥。关键在于 SLH-DSA 是无状态的:每次签名伪随机地选取 FORS 实例,因此与 XMSS/LMS 不同,签名者无需跟踪任何逐签名状态,从而消除了有状态方案中密钥复用的灾难性失效模式。

参数集

共 12 组参数:哈希族 {SHA2, SHAKE} x 安全强度 {128, 192, 256} x 速度变体 {s, f}。s(small)变体签名更短但签名更慢;f(fast)变体签名更快但签名更大。公钥极小。

参数集(示例)安全等级公钥签名(约)
SLH-DSA-128s等级 1327856
SLH-DSA-128f等级 13217088
SLH-DSA-192s等级 34816224
SLH-DSA-256s等级 56429792
SLH-DSA-256f等级 56449856

128/192/256 位安全等级对应的公钥分别为 32、48、64 字节。

优势与取舍

  • 假设最保守。仅依赖哈希函数安全性——密码学中理解最透彻的原语。无需新的结构化格或编码假设。
  • 无状态。不像 XMSS/LMS 那样需要管理脆弱的逐签名状态。公钥极小。
  • 取舍:签名极大(8-50 KB),签名速度相对慢。这使其不适合高频签名或带宽受限协议,却非常适合作为长期信任根。

适用场景

当你追求最高信心且签名尺寸不构成瓶颈时选用 SLH-DSA:根证书、固件/安全启动信任锚、以及签发稀少的长寿命签名。它能有效对冲格方案未来被攻破的风险。s 变体签名更小但签名更慢;f 变体签名更快但签名更大。若传输/存储成本更重要,优先 s;若签名延迟更重要,优先 f

代码示例

注意
liboqs 的算法名称字符串在不同版本间会变化:部分构建用 SLH-DSA-SHA2-128s,另一些用 SLH_DSA_PURE_SHA2_128S 或遗留的 SPHINCS+-SHA2-128s-simple。运行前请用 oqs.get_enabled_sig_mechanisms() 确认环境中确切的算法名称。
import oqs

alg = "SLH-DSA-SHA2-128s"
message = b"root CA cross-signature"

with oqs.Signature(alg) as signer:
    public_key = signer.generate_keypair()  # 公钥约 32 字节
    signature = signer.sign(message)         # 签名约 7856 字节
    print("公钥字节:", len(public_key), "签名字节:", len(signature))

with oqs.Signature(alg) as verifier:
    print("有效:", verifier.verify(message, signature, public_key))
警告
SLH-DSA 签名可超过 40 KB。在协议中采用前,请确认消息大小上限、证书尺寸假设与缓冲区分配能容纳比 ECDSA 大一个数量级的签名。对于高吞吐签名场景,请改用 ML-DSA。

标准与参考

相关页面

⚑ Report an error⚑ 纠错与校正