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
//!
//! Defines the [`SecurityLevel`] trait and the marker structs [`Level1`],
//! [`Level3`], [`Level5`] for NIST security levels I, III, V. Downstream
//! crates are generic over `L: SecurityLevel` and the compiler
//! monomorphizes one specialized copy per level from a single source.
//!
//! All three levels ([`Level1`], [`Level3`], [`Level5`]) have full
//! `SecurityLevel` implementations.
use ArraySize;
/// Marker trait for SQIsign security levels (NIST I, III, V).
///
/// Associated types encode array/buffer sizes via `hybrid-array` typenum.
/// Associated constants encode scalar parameters used in arithmetic and
/// loop bounds.
///
/// # Design rules
///
/// - Only INDEPENDENT, per-level parameters belong here.
/// - Derived sizes are computed in downstream crate impl blocks.
/// - Do not add trait bounds beyond `Default + Clone + Debug + 'static`.
/// NIST Security Level I (128-bit post-quantum security).
///
/// Prime: `p = 5 * 2^248 - 1`, encoded in 32 bytes.
;
/// NIST Security Level III (192-bit post-quantum security).
///
/// Prime: `p = 65 * 2^376 - 1`, encoded in 48 bytes.
;
/// NIST Security Level V (256-bit post-quantum security).
///
/// Prime: `p = 27 * 2^500 - 1`, encoded in 64 bytes.
;