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
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
use ;
/// Hash algorithm enumeration for cryptographic operations.
///
/// 用于密码操作的哈希算法枚举。
///
/// ## Overview | 概述
///
/// This enum represents the supported hash algorithms used in various cryptographic
/// constructions such as HMAC, digital signatures, and key derivation functions.
///
/// 此枚举表示在各种密码构造中使用的支持的哈希算法,
/// 如 HMAC、数字签名和密钥派生函数。
///
/// ## Security Properties | 安全属性
///
/// All included hash functions are cryptographically secure and provide:
/// - **Collision resistance**: Computationally infeasible to find two inputs with same hash
/// - **Preimage resistance**: Given a hash, infeasible to find the original input
/// - **Second preimage resistance**: Given an input, infeasible to find another with same hash
///
/// 所有包含的哈希函数都是密码学安全的,并提供:
/// - **抗碰撞性**: 计算上不可行找到具有相同哈希的两个输入
/// - **原像抗性**: 给定哈希值,不可行找到原始输入
/// - **第二原像抗性**: 给定输入,不可行找到另一个具有相同哈希的输入
///
/// ## Algorithm Details | 算法详情
///
/// | Algorithm | Output Size | Security Level | Performance | Use Cases |
/// |-----------|-------------|----------------|-------------|-----------|
/// | SHA-256 | 256 bits | 128-bit | High | General purpose, Bitcoin |
/// | SHA-384 | 384 bits | 192-bit | Medium | High security applications |
/// | SHA-512 | 512 bits | 256-bit | Medium | Maximum security, long-term |
///
/// ## Usage Guidelines | 使用指南
///
/// - **SHA-256**: Recommended for most applications, widely supported
/// - **SHA-384**: Use when 192-bit security level is required
/// - **SHA-512**: Use for maximum security or when working with 64-bit architectures
///
/// - **SHA-256**: 推荐用于大多数应用,广泛支持
/// - **SHA-384**: 需要 192 位安全级别时使用
/// - **SHA-512**: 用于最大安全性或在 64 位架构上工作时使用
/// Builder for constructing hash algorithm instances.
///
/// 用于构建哈希算法实例的构建器。
///
/// ## Usage Pattern | 使用模式
///
/// The builder provides a fluent interface for algorithm selection:
///
/// 构建器为算法选择提供流畅的接口:
///
/// ```rust
/// use seal_crypto_wrapper::algorithms::hash::HashAlgorithm;
///
/// // General purpose
/// let sha256 = HashAlgorithm::build().sha256();
///
/// // High security
/// let sha384 = HashAlgorithm::build().sha384();
///
/// // Maximum security
/// let sha512 = HashAlgorithm::build().sha512();
/// ```
;
use crateHashAlgorithmWrapper;