Skip to main content

Crate slh_dsa

Crate slh_dsa 

Source
Expand description

Pure Rust implementation of SLH-DSA (FIPS 205) / SPHINCS+.

A stateless hash-based digital signature scheme standardized as FIPS 205. Security relies only on the security of hash functions — the most conservative post-quantum assumption.

Supports all 12 FIPS 205 parameter sets (6 SHAKE + 6 SHA-2):

  • SLH-DSA-128s / SLH-DSA-128f (NIST Level 1)
  • SLH-DSA-192s / SLH-DSA-192f (NIST Level 3)
  • SLH-DSA-256s / SLH-DSA-256f (NIST Level 5)

§Quick Start

use slh_dsa::safe_api::SlhDsaKeyPair;
use slh_dsa::params::SLH_DSA_SHAKE_128F;

let kp = SlhDsaKeyPair::generate(SLH_DSA_SHAKE_128F).unwrap();
let sig = kp.sign(b"Hello, post-quantum!").unwrap();
assert!(slh_dsa::safe_api::SlhDsaSignature::verify(
    sig.to_bytes(), kp.public_key(), b"Hello, post-quantum!", SLH_DSA_SHAKE_128F,
));

Re-exports§

pub use params::SlhDsaMode;
pub use safe_api::SlhDsaError;
pub use safe_api::SlhDsaKeyPair;
pub use safe_api::SlhDsaSignature;
pub use sign::keygen_seed;
pub use sign::sign;
pub use sign::verify;

Modules§

address
ADRS (Address) structure for SLH-DSA.
fors
FORS (Forest of Random Subsets) few-time signature for SLH-DSA.
hash
Hash function abstraction layer for SLH-DSA.
merkle
Merkle tree operations for the SLH-DSA hypertree.
params
SLH-DSA parameter sets (FIPS 205).
prelude
Convenience re-exports for SLH-DSA.
safe_api
High-level safe Rust API for SLH-DSA (FIPS 205).
sign
SLH-DSA keygen, sign, and verify (FIPS 205).
thash
Tweakable hash function (T_l) for SLH-DSA.
wots
WOTS+ one-time signature scheme for SLH-DSA.