1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
//! SLH-DSA parameter sets (FIPS 205, Section 11).
//!
//! This module defines the [`Params`] trait and the six SHAKE-based parameter set structs.
//! All SHAKE-based parameter sets use Winternitz parameter `w = 16` (`lg_w = 4`).
//!
//! Each parameter set is identified by its security level (128, 192, or 256 bits) and
//! a size/speed trade-off suffix: "s" (small signatures) or "f" (fast signing/verification).
/// 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.
/// Compute the total SLH-DSA signature length in bytes for parameter set `P`.
///
/// The signature layout is `R || SIG_FORS || SIG_HT`, with total size:
/// `n + k*(1+a)*n + (h + d*len)*n`.
///
/// This is a runtime function rather than a `const` due to Rust const-generics limitations.
// ====== SHAKE-128s ======
/// SLH-DSA-SHAKE-128s parameter set (NIST security level 1, small signatures).
///
/// Provides 128-bit security with relatively compact signatures (~7856 bytes) but
/// slower signing and verification compared to [`Shake128f`].
;
// ====== SHAKE-128f ======
/// SLH-DSA-SHAKE-128f parameter set (NIST security level 1, fast operations).
///
/// Provides 128-bit security with faster signing and verification but larger
/// signatures (~17088 bytes) compared to [`Shake128s`].
;
// ====== SHAKE-192s ======
/// SLH-DSA-SHAKE-192s parameter set (NIST security level 3, small signatures).
///
/// Provides 192-bit security with compact signatures but slower operations
/// compared to [`Shake192f`].
;
// ====== SHAKE-192f ======
/// SLH-DSA-SHAKE-192f parameter set (NIST security level 3, fast operations).
///
/// Provides 192-bit security with faster signing and verification but larger
/// signatures compared to [`Shake192s`].
;
// ====== SHAKE-256s ======
/// SLH-DSA-SHAKE-256s parameter set (NIST security level 5, small signatures).
///
/// Provides 256-bit security with compact signatures but slower operations
/// compared to [`Shake256f`].
;
// ====== SHAKE-256f ======
/// SLH-DSA-SHAKE-256f parameter set (NIST security level 5, fast operations).
///
/// Provides 256-bit security with faster signing and verification but larger
/// signatures compared to [`Shake256s`].
;