/src/cryptofuzz/include/cryptofuzz/module.h
Line | Count | Source (jump to first uncovered line) |
1 | | #pragma once |
2 | | |
3 | | #include <string> |
4 | | #include <cryptofuzz/components.h> |
5 | | #include <cryptofuzz/operations.h> |
6 | | #include <fuzzing/datasource/id.hpp> |
7 | | #include <optional> |
8 | | |
9 | | namespace cryptofuzz { |
10 | | |
11 | | class Module { |
12 | | public: |
13 | | const std::string name; |
14 | | const uint64_t ID; |
15 | | |
16 | | Module(const std::string name) : |
17 | | name(name), |
18 | | ID(fuzzing::datasource::ID( ("Cryptofuzz/Module/" + name).c_str())) |
19 | 8 | { } |
20 | | |
21 | 0 | virtual ~Module() { } |
22 | | |
23 | 0 | virtual std::optional<component::Digest> OpDigest(operation::Digest& op) { |
24 | 0 | (void)op; |
25 | 0 | return std::nullopt; |
26 | 0 | } |
27 | 0 | virtual std::optional<component::MAC> OpHMAC(operation::HMAC& op) { |
28 | 0 | (void)op; |
29 | 0 | return std::nullopt; |
30 | 0 | } |
31 | 758 | virtual std::optional<component::MAC> OpUMAC(operation::UMAC& op) { |
32 | 758 | (void)op; |
33 | 758 | return std::nullopt; |
34 | 758 | } |
35 | 0 | virtual std::optional<component::Ciphertext> OpSymmetricEncrypt(operation::SymmetricEncrypt& op) { |
36 | 0 | (void)op; |
37 | 0 | return std::nullopt; |
38 | 0 | } |
39 | 0 | virtual std::optional<component::Cleartext> OpSymmetricDecrypt(operation::SymmetricDecrypt& op) { |
40 | 0 | (void)op; |
41 | 0 | return std::nullopt; |
42 | 0 | } |
43 | 367 | virtual std::optional<component::Key> OpKDF_SCRYPT(operation::KDF_SCRYPT& op) { |
44 | 367 | (void)op; |
45 | 367 | return std::nullopt; |
46 | 367 | } |
47 | 0 | virtual std::optional<component::Key> OpKDF_HKDF(operation::KDF_HKDF& op) { |
48 | 0 | (void)op; |
49 | 0 | return std::nullopt; |
50 | 0 | } |
51 | 371 | virtual std::optional<component::Key> OpKDF_TLS1_PRF(operation::KDF_TLS1_PRF& op) { |
52 | 371 | (void)op; |
53 | 371 | return std::nullopt; |
54 | 371 | } |
55 | 624 | virtual std::optional<component::Key> OpKDF_PBKDF(operation::KDF_PBKDF& op) { |
56 | 624 | (void)op; |
57 | 624 | return std::nullopt; |
58 | 624 | } |
59 | 534 | virtual std::optional<component::Key> OpKDF_PBKDF1(operation::KDF_PBKDF1& op) { |
60 | 534 | (void)op; |
61 | 534 | return std::nullopt; |
62 | 534 | } |
63 | 0 | virtual std::optional<component::Key> OpKDF_PBKDF2(operation::KDF_PBKDF2& op) { |
64 | 0 | (void)op; |
65 | 0 | return std::nullopt; |
66 | 0 | } |
67 | 378 | virtual std::optional<component::Key> OpKDF_ARGON2(operation::KDF_ARGON2& op) { |
68 | 378 | (void)op; |
69 | 378 | return std::nullopt; |
70 | 378 | } |
71 | 630 | virtual std::optional<component::Key> OpKDF_SSH(operation::KDF_SSH& op) { |
72 | 630 | (void)op; |
73 | 630 | return std::nullopt; |
74 | 630 | } |
75 | 554 | virtual std::optional<component::Key> OpKDF_X963(operation::KDF_X963& op) { |
76 | 554 | (void)op; |
77 | 554 | return std::nullopt; |
78 | 554 | } |
79 | 96 | virtual std::optional<component::Key> OpKDF_BCRYPT(operation::KDF_BCRYPT& op) { |
80 | 96 | (void)op; |
81 | 96 | return std::nullopt; |
82 | 96 | } |
83 | 505 | virtual std::optional<component::Key> OpKDF_SP_800_108(operation::KDF_SP_800_108& op) { |
84 | 505 | (void)op; |
85 | 505 | return std::nullopt; |
86 | 505 | } |
87 | 0 | virtual std::optional<component::MAC> OpCMAC(operation::CMAC& op) { |
88 | 0 | (void)op; |
89 | 0 | return std::nullopt; |
90 | 0 | } |
91 | 0 | virtual std::optional<component::ECC_PublicKey> OpECC_PrivateToPublic(operation::ECC_PrivateToPublic& op) { |
92 | 0 | (void)op; |
93 | 0 | return std::nullopt; |
94 | 0 | } |
95 | 0 | virtual std::optional<bool> OpECC_ValidatePubkey(operation::ECC_ValidatePubkey& op) { |
96 | 0 | (void)op; |
97 | 0 | return std::nullopt; |
98 | 0 | } |
99 | 0 | virtual std::optional<component::ECC_KeyPair> OpECC_GenerateKeyPair(operation::ECC_GenerateKeyPair& op) { |
100 | 0 | (void)op; |
101 | 0 | return std::nullopt; |
102 | 0 | } |
103 | 200 | virtual std::optional<component::ECCSI_Signature> OpECCSI_Sign(operation::ECCSI_Sign& op) { |
104 | 200 | (void)op; |
105 | 200 | return std::nullopt; |
106 | 200 | } |
107 | 0 | virtual std::optional<component::ECDSA_Signature> OpECDSA_Sign(operation::ECDSA_Sign& op) { |
108 | 0 | (void)op; |
109 | 0 | return std::nullopt; |
110 | 0 | } |
111 | 213 | virtual std::optional<component::ECGDSA_Signature> OpECGDSA_Sign(operation::ECGDSA_Sign& op) { |
112 | 213 | (void)op; |
113 | 213 | return std::nullopt; |
114 | 213 | } |
115 | 174 | virtual std::optional<component::ECRDSA_Signature> OpECRDSA_Sign(operation::ECRDSA_Sign& op) { |
116 | 174 | (void)op; |
117 | 174 | return std::nullopt; |
118 | 174 | } |
119 | 207 | virtual std::optional<component::Schnorr_Signature> OpSchnorr_Sign(operation::Schnorr_Sign& op) { |
120 | 207 | (void)op; |
121 | 207 | return std::nullopt; |
122 | 207 | } |
123 | 162 | virtual std::optional<bool> OpECCSI_Verify(operation::ECCSI_Verify& op) { |
124 | 162 | (void)op; |
125 | 162 | return std::nullopt; |
126 | 162 | } |
127 | 0 | virtual std::optional<bool> OpECDSA_Verify(operation::ECDSA_Verify& op) { |
128 | 0 | (void)op; |
129 | 0 | return std::nullopt; |
130 | 0 | } |
131 | 248 | virtual std::optional<bool> OpECGDSA_Verify(operation::ECGDSA_Verify& op) { |
132 | 248 | (void)op; |
133 | 248 | return std::nullopt; |
134 | 248 | } |
135 | 140 | virtual std::optional<bool> OpECRDSA_Verify(operation::ECRDSA_Verify& op) { |
136 | 140 | (void)op; |
137 | 140 | return std::nullopt; |
138 | 140 | } |
139 | 156 | virtual std::optional<bool> OpSchnorr_Verify(operation::Schnorr_Verify& op) { |
140 | 156 | (void)op; |
141 | 156 | return std::nullopt; |
142 | 156 | } |
143 | 725 | virtual std::optional<component::ECC_PublicKey> OpECDSA_Recover(operation::ECDSA_Recover& op) { |
144 | 725 | (void)op; |
145 | 725 | return std::nullopt; |
146 | 725 | } |
147 | 361 | virtual std::optional<bool> OpDSA_Verify(operation::DSA_Verify& op) { |
148 | 361 | (void)op; |
149 | 361 | return std::nullopt; |
150 | 361 | } |
151 | 264 | virtual std::optional<component::DSA_Signature> OpDSA_Sign(operation::DSA_Sign& op) { |
152 | 264 | (void)op; |
153 | 264 | return std::nullopt; |
154 | 264 | } |
155 | 149 | virtual std::optional<component::DSA_Parameters> OpDSA_GenerateParameters(operation::DSA_GenerateParameters& op) { |
156 | 149 | (void)op; |
157 | 149 | return std::nullopt; |
158 | 149 | } |
159 | 150 | virtual std::optional<component::Bignum> OpDSA_PrivateToPublic(operation::DSA_PrivateToPublic& op) { |
160 | 150 | (void)op; |
161 | 150 | return std::nullopt; |
162 | 150 | } |
163 | 236 | virtual std::optional<component::DSA_KeyPair> OpDSA_GenerateKeyPair(operation::DSA_GenerateKeyPair& op) { |
164 | 236 | (void)op; |
165 | 236 | return std::nullopt; |
166 | 236 | } |
167 | 161 | virtual std::optional<component::Secret> OpECDH_Derive(operation::ECDH_Derive& op) { |
168 | 161 | (void)op; |
169 | 161 | return std::nullopt; |
170 | 161 | } |
171 | 204 | virtual std::optional<component::Ciphertext> OpECIES_Encrypt(operation::ECIES_Encrypt& op) { |
172 | 204 | (void)op; |
173 | 204 | return std::nullopt; |
174 | 204 | } |
175 | 185 | virtual std::optional<component::Cleartext> OpECIES_Decrypt(operation::ECIES_Decrypt& op) { |
176 | 185 | (void)op; |
177 | 185 | return std::nullopt; |
178 | 185 | } |
179 | 131 | virtual std::optional<component::ECC_Point> OpECC_Point_Add(operation::ECC_Point_Add& op) { |
180 | 131 | (void)op; |
181 | 131 | return std::nullopt; |
182 | 131 | } |
183 | 144 | virtual std::optional<component::ECC_Point> OpECC_Point_Sub(operation::ECC_Point_Sub& op) { |
184 | 144 | (void)op; |
185 | 144 | return std::nullopt; |
186 | 144 | } |
187 | 0 | virtual std::optional<component::ECC_Point> OpECC_Point_Mul(operation::ECC_Point_Mul& op) { |
188 | 0 | (void)op; |
189 | 0 | return std::nullopt; |
190 | 0 | } |
191 | 139 | virtual std::optional<component::ECC_Point> OpECC_Point_Neg(operation::ECC_Point_Neg& op) { |
192 | 139 | (void)op; |
193 | 139 | return std::nullopt; |
194 | 139 | } |
195 | 118 | virtual std::optional<component::ECC_Point> OpECC_Point_Dbl(operation::ECC_Point_Dbl& op) { |
196 | 118 | (void)op; |
197 | 118 | return std::nullopt; |
198 | 118 | } |
199 | 129 | virtual std::optional<bool> OpECC_Point_Cmp(operation::ECC_Point_Cmp& op) { |
200 | 129 | (void)op; |
201 | 129 | return std::nullopt; |
202 | 129 | } |
203 | 222 | virtual std::optional<component::DH_KeyPair> OpDH_GenerateKeyPair(operation::DH_GenerateKeyPair& op) { |
204 | 222 | (void)op; |
205 | 222 | return std::nullopt; |
206 | 222 | } |
207 | 306 | virtual std::optional<component::Bignum> OpDH_Derive(operation::DH_Derive& op) { |
208 | 306 | (void)op; |
209 | 306 | return std::nullopt; |
210 | 306 | } |
211 | 6.85k | virtual std::optional<component::Bignum> OpBignumCalc(operation::BignumCalc& op) { |
212 | 6.85k | (void)op; |
213 | 6.85k | return std::nullopt; |
214 | 6.85k | } |
215 | 208 | virtual std::optional<component::Fp2> OpBignumCalc_Fp2(operation::BignumCalc_Fp2& op) { |
216 | 208 | (void)op; |
217 | 208 | return std::nullopt; |
218 | 208 | } |
219 | 291 | virtual std::optional<component::Fp12> OpBignumCalc_Fp12(operation::BignumCalc_Fp12& op) { |
220 | 291 | (void)op; |
221 | 291 | return std::nullopt; |
222 | 291 | } |
223 | 2.18k | virtual bool SupportsModularBignumCalc(void) const { |
224 | 2.18k | return false; |
225 | 2.18k | } |
226 | 164 | virtual std::optional<component::BLS_PublicKey> OpBLS_PrivateToPublic(operation::BLS_PrivateToPublic& op) { |
227 | 164 | (void)op; |
228 | 164 | return std::nullopt; |
229 | 164 | } |
230 | 182 | virtual std::optional<component::G2> OpBLS_PrivateToPublic_G2(operation::BLS_PrivateToPublic_G2& op) { |
231 | 182 | (void)op; |
232 | 182 | return std::nullopt; |
233 | 182 | } |
234 | 187 | virtual std::optional<component::BLS_Signature> OpBLS_Sign(operation::BLS_Sign& op) { |
235 | 187 | (void)op; |
236 | 187 | return std::nullopt; |
237 | 187 | } |
238 | 175 | virtual std::optional<bool> OpBLS_Verify(operation::BLS_Verify& op) { |
239 | 175 | (void)op; |
240 | 175 | return std::nullopt; |
241 | 175 | } |
242 | 224 | virtual std::optional<component::BLS_BatchSignature> OpBLS_BatchSign(operation::BLS_BatchSign& op) { |
243 | 224 | (void)op; |
244 | 224 | return std::nullopt; |
245 | 224 | } |
246 | 200 | virtual std::optional<bool> OpBLS_BatchVerify(operation::BLS_BatchVerify& op) { |
247 | 200 | (void)op; |
248 | 200 | return std::nullopt; |
249 | 200 | } |
250 | 172 | virtual std::optional<component::G1> OpBLS_Aggregate_G1(operation::BLS_Aggregate_G1& op) { |
251 | 172 | (void)op; |
252 | 172 | return std::nullopt; |
253 | 172 | } |
254 | 178 | virtual std::optional<component::G2> OpBLS_Aggregate_G2(operation::BLS_Aggregate_G2& op) { |
255 | 178 | (void)op; |
256 | 178 | return std::nullopt; |
257 | 178 | } |
258 | 161 | virtual std::optional<component::Fp12> OpBLS_Pairing(operation::BLS_Pairing& op) { |
259 | 161 | (void)op; |
260 | 161 | return std::nullopt; |
261 | 161 | } |
262 | 160 | virtual std::optional<component::Fp12> OpBLS_MillerLoop(operation::BLS_MillerLoop& op) { |
263 | 160 | (void)op; |
264 | 160 | return std::nullopt; |
265 | 160 | } |
266 | 245 | virtual std::optional<component::Fp12> OpBLS_FinalExp(operation::BLS_FinalExp& op) { |
267 | 245 | (void)op; |
268 | 245 | return std::nullopt; |
269 | 245 | } |
270 | 170 | virtual std::optional<component::G1> OpBLS_HashToG1(operation::BLS_HashToG1& op) { |
271 | 170 | (void)op; |
272 | 170 | return std::nullopt; |
273 | 170 | } |
274 | 139 | virtual std::optional<component::G2> OpBLS_HashToG2(operation::BLS_HashToG2& op) { |
275 | 139 | (void)op; |
276 | 139 | return std::nullopt; |
277 | 139 | } |
278 | 164 | virtual std::optional<component::G1> OpBLS_MapToG1(operation::BLS_MapToG1& op) { |
279 | 164 | (void)op; |
280 | 164 | return std::nullopt; |
281 | 164 | } |
282 | 159 | virtual std::optional<component::G2> OpBLS_MapToG2(operation::BLS_MapToG2& op) { |
283 | 159 | (void)op; |
284 | 159 | return std::nullopt; |
285 | 159 | } |
286 | 161 | virtual std::optional<bool> OpBLS_IsG1OnCurve(operation::BLS_IsG1OnCurve& op) { |
287 | 161 | (void)op; |
288 | 161 | return std::nullopt; |
289 | 161 | } |
290 | 177 | virtual std::optional<bool> OpBLS_IsG2OnCurve(operation::BLS_IsG2OnCurve& op) { |
291 | 177 | (void)op; |
292 | 177 | return std::nullopt; |
293 | 177 | } |
294 | 158 | virtual std::optional<component::BLS_KeyPair> OpBLS_GenerateKeyPair(operation::BLS_GenerateKeyPair& op) { |
295 | 158 | (void)op; |
296 | 158 | return std::nullopt; |
297 | 158 | } |
298 | 160 | virtual std::optional<component::G1> OpBLS_Decompress_G1(operation::BLS_Decompress_G1& op) { |
299 | 160 | (void)op; |
300 | 160 | return std::nullopt; |
301 | 160 | } |
302 | 147 | virtual std::optional<component::Bignum> OpBLS_Compress_G1(operation::BLS_Compress_G1& op) { |
303 | 147 | (void)op; |
304 | 147 | return std::nullopt; |
305 | 147 | } |
306 | 156 | virtual std::optional<component::G2> OpBLS_Decompress_G2(operation::BLS_Decompress_G2& op) { |
307 | 156 | (void)op; |
308 | 156 | return std::nullopt; |
309 | 156 | } |
310 | 179 | virtual std::optional<component::G1> OpBLS_Compress_G2(operation::BLS_Compress_G2& op) { |
311 | 179 | (void)op; |
312 | 179 | return std::nullopt; |
313 | 179 | } |
314 | 171 | virtual std::optional<component::G1> OpBLS_G1_Add(operation::BLS_G1_Add& op) { |
315 | 171 | (void)op; |
316 | 171 | return std::nullopt; |
317 | 171 | } |
318 | 172 | virtual std::optional<component::G1> OpBLS_G1_Mul(operation::BLS_G1_Mul& op) { |
319 | 172 | (void)op; |
320 | 172 | return std::nullopt; |
321 | 172 | } |
322 | 204 | virtual std::optional<bool> OpBLS_G1_IsEq(operation::BLS_G1_IsEq& op) { |
323 | 204 | (void)op; |
324 | 204 | return std::nullopt; |
325 | 204 | } |
326 | 148 | virtual std::optional<component::G1> OpBLS_G1_Neg(operation::BLS_G1_Neg& op) { |
327 | 148 | (void)op; |
328 | 148 | return std::nullopt; |
329 | 148 | } |
330 | 179 | virtual std::optional<component::G2> OpBLS_G2_Add(operation::BLS_G2_Add& op) { |
331 | 179 | (void)op; |
332 | 179 | return std::nullopt; |
333 | 179 | } |
334 | 204 | virtual std::optional<component::G2> OpBLS_G2_Mul(operation::BLS_G2_Mul& op) { |
335 | 204 | (void)op; |
336 | 204 | return std::nullopt; |
337 | 204 | } |
338 | 191 | virtual std::optional<bool> OpBLS_G2_IsEq(operation::BLS_G2_IsEq& op) { |
339 | 191 | (void)op; |
340 | 191 | return std::nullopt; |
341 | 191 | } |
342 | 184 | virtual std::optional<component::G2> OpBLS_G2_Neg(operation::BLS_G2_Neg& op) { |
343 | 184 | (void)op; |
344 | 184 | return std::nullopt; |
345 | 184 | } |
346 | 240 | virtual std::optional<component::G1> OpBLS_G1_MultiExp(operation::BLS_G1_MultiExp& op) { |
347 | 240 | (void)op; |
348 | 240 | return std::nullopt; |
349 | 240 | } |
350 | 132 | virtual std::optional<Buffer> OpMisc(operation::Misc& op) { |
351 | 132 | (void)op; |
352 | 132 | return std::nullopt; |
353 | 132 | } |
354 | 170 | virtual std::optional<bool> OpSR25519_Verify(operation::SR25519_Verify& op) { |
355 | 170 | (void)op; |
356 | 170 | return std::nullopt; |
357 | 170 | } |
358 | | }; |
359 | | |
360 | | } /* namespace cryptofuzz */ |