Skip to main content

Params

Trait Params 

Source
pub trait Params: Clone + Default {
Show 15 associated constants and 0 method const N: usize; const H: usize; const D: usize; const H_PRIME: usize; const A: usize; const K: usize; const M: usize; const NAME: &'static str; const LG_W: usize = 4; const W: usize = 16; const LEN1: usize = _; const LEN2: usize = 3; const LEN: usize = _; const PK_LEN: usize = _; const SK_LEN: usize = _;
}
Expand description

Trait defining all compile-time parameters for an SLH-DSA instance.

Implementors of this trait represent a specific FIPS 205 parameter set (e.g., SLH-DSA-SHAKE-128f). The constants fully determine key sizes, signature sizes, tree structures, and hash output lengths.

See FIPS 205, Table 2 for the complete list of parameter values.

Required Associated Constants§

Source

const N: usize

Security parameter n: hash output length in bytes.

This is the fundamental security parameter. All hash outputs, secret values, and tree nodes are n bytes long.

Source

const H: usize

Total hypertree height: h = d * h'.

Determines the total number of FORS key pairs the scheme can use: 2^h.

Source

const D: usize

Number of layers d in the hypertree.

The hypertree consists of d stacked XMSS trees, each of height h'.

Source

const H_PRIME: usize

Height h' of each individual XMSS tree within the hypertree.

Each XMSS tree authenticates 2^h' keys in the layer below it.

Source

const A: usize

Height a of each FORS tree (each tree has 2^a leaves).

Source

const K: usize

Number k of FORS trees used per signature.

Source

const M: usize

Message digest length m in bytes, output by H_msg.

The digest is split into FORS indices, a tree index, and a leaf index.

Source

const NAME: &'static str

Human-readable name of this parameter set (e.g., "SLH-DSA-SHAKE-128f").

Provided Associated Constants§

Source

const LG_W: usize = 4

Winternitz parameter lg(w), always 4 for SHAKE-based parameter sets.

Source

const W: usize = 16

Winternitz parameter w = 2^lg_w = 16.

Controls the time/size trade-off in WOTS+ chains: each chain has w - 1 steps.

Source

const LEN1: usize = _

WOTS+ parameter len1 = ceil(8*n / lg_w) = 2*n (since lg_w = 4).

Number of base-w digits needed to represent an n-byte message.

Source

const LEN2: usize = 3

WOTS+ parameter len2 = 3 for all SHAKE-based parameter sets.

Number of base-w digits in the checksum.

Source

const LEN: usize = _

WOTS+ parameter len = len1 + len2: total number of hash chains.

Source

const PK_LEN: usize = _

Public key size in bytes: 2*n (PK.seed || PK.root).

Source

const SK_LEN: usize = _

Secret key size in bytes: 4*n (SK.seed || SK.prf || PK.seed || PK.root).

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl Params for Shake128f

Source§

const N: usize = 16

Source§

const H: usize = 66

Source§

const D: usize = 22

Source§

const H_PRIME: usize = 3

Source§

const A: usize = 6

Source§

const K: usize = 33

Source§

const M: usize = 34

Source§

const NAME: &'static str = "SLH-DSA-SHAKE-128f"

Source§

impl Params for Shake128s

Source§

const N: usize = 16

Source§

const H: usize = 63

Source§

const D: usize = 7

Source§

const H_PRIME: usize = 9

Source§

const A: usize = 12

Source§

const K: usize = 14

Source§

const M: usize = 30

Source§

const NAME: &'static str = "SLH-DSA-SHAKE-128s"

Source§

impl Params for Shake192f

Source§

const N: usize = 24

Source§

const H: usize = 66

Source§

const D: usize = 22

Source§

const H_PRIME: usize = 3

Source§

const A: usize = 8

Source§

const K: usize = 33

Source§

const M: usize = 42

Source§

const NAME: &'static str = "SLH-DSA-SHAKE-192f"

Source§

impl Params for Shake192s

Source§

const N: usize = 24

Source§

const H: usize = 63

Source§

const D: usize = 7

Source§

const H_PRIME: usize = 9

Source§

const A: usize = 14

Source§

const K: usize = 17

Source§

const M: usize = 39

Source§

const NAME: &'static str = "SLH-DSA-SHAKE-192s"

Source§

impl Params for Shake256f

Source§

const N: usize = 32

Source§

const H: usize = 68

Source§

const D: usize = 17

Source§

const H_PRIME: usize = 4

Source§

const A: usize = 9

Source§

const K: usize = 35

Source§

const M: usize = 49

Source§

const NAME: &'static str = "SLH-DSA-SHAKE-256f"

Source§

impl Params for Shake256s

Source§

const N: usize = 32

Source§

const H: usize = 64

Source§

const D: usize = 8

Source§

const H_PRIME: usize = 8

Source§

const A: usize = 14

Source§

const K: usize = 22

Source§

const M: usize = 47

Source§

const NAME: &'static str = "SLH-DSA-SHAKE-256s"