Skip to main content

SLH-DSA (SPHINCS+)

Stateless hash-based signatures standardized in FIPS 205. Security rests on the hash function — conservative assumptions, large signatures, slow signing.

This package ships the three SHA2 s (small-signature) sets via @noble/post-quantum (pure JS — works in Node and browsers, no WASM / COOP-COEP).

LoaderVariantCOSE (provisional)PKSKSignature
loadSlhDsa128()SLH-DSA-SHA2-128s0x122032 B64 B7,856 B
loadSlhDsa192()SLH-DSA-SHA2-192s0x122148 B96 B16,224 B
loadSlhDsa256()SLH-DSA-SHA2-256s0x122264 B128 B29,792 B
note

COSE code points above are provisional for testbed/interop. Cryptosuite names follow W3C VC data-integrity patterns (slhdsa128-rdfc-2024, etc.).

warning

Unsuitable for the CTAP2 1024-byte WebAuthn buffer. Prefer where hash-only security matters and bandwidth is not tight (firmware, archival VCs).

import { loadSlhDsa128 } from "quantum-resistant-rustykey";

async function demo() {
const slh = await loadSlhDsa128(); // or loadSlhDsa192 / loadSlhDsa256
const kp = slh.keypair();
const publicKey = await kp.get("public_key");
const privateKey = await kp.get("private_key");

const message = new TextEncoder().encode("Authored by RustyKey (SLH-DSA)");
const signature = await slh.sign(message, privateKey);
const isValid = await slh.verify(signature, message, publicKey);
console.log("SLH-DSA-SHA2-128s valid?", isValid);
}

demo().catch(console.error);