/src/cryptofuzz-disable-fastmath/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 | 22 | { } |
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 | 64 | virtual std::optional<component::MAC> OpUMAC(operation::UMAC& op) { |
32 | 64 | (void)op; |
33 | 64 | return std::nullopt; |
34 | 64 | } |
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 | 154 | virtual std::optional<component::Key> OpKDF_SCRYPT(operation::KDF_SCRYPT& op) { |
44 | 154 | (void)op; |
45 | 154 | return std::nullopt; |
46 | 154 | } |
47 | 190 | virtual std::optional<component::Key> OpKDF_HKDF(operation::KDF_HKDF& op) { |
48 | 190 | (void)op; |
49 | 190 | return std::nullopt; |
50 | 190 | } |
51 | 175 | virtual std::optional<component::Key> OpKDF_TLS1_PRF(operation::KDF_TLS1_PRF& op) { |
52 | 175 | (void)op; |
53 | 175 | return std::nullopt; |
54 | 175 | } |
55 | 161 | virtual std::optional<component::Key> OpKDF_PBKDF(operation::KDF_PBKDF& op) { |
56 | 161 | (void)op; |
57 | 161 | return std::nullopt; |
58 | 161 | } |
59 | 220 | virtual std::optional<component::Key> OpKDF_PBKDF1(operation::KDF_PBKDF1& op) { |
60 | 220 | (void)op; |
61 | 220 | return std::nullopt; |
62 | 220 | } |
63 | 95 | virtual std::optional<component::Key> OpKDF_PBKDF2(operation::KDF_PBKDF2& op) { |
64 | 95 | (void)op; |
65 | 95 | return std::nullopt; |
66 | 95 | } |
67 | 40 | virtual std::optional<component::Key> OpKDF_ARGON2(operation::KDF_ARGON2& op) { |
68 | 40 | (void)op; |
69 | 40 | return std::nullopt; |
70 | 40 | } |
71 | 112 | virtual std::optional<component::Key> OpKDF_SSH(operation::KDF_SSH& op) { |
72 | 112 | (void)op; |
73 | 112 | return std::nullopt; |
74 | 112 | } |
75 | 209 | virtual std::optional<component::Key> OpKDF_X963(operation::KDF_X963& op) { |
76 | 209 | (void)op; |
77 | 209 | return std::nullopt; |
78 | 209 | } |
79 | 7 | virtual std::optional<component::Key> OpKDF_BCRYPT(operation::KDF_BCRYPT& op) { |
80 | 7 | (void)op; |
81 | 7 | return std::nullopt; |
82 | 7 | } |
83 | 169 | virtual std::optional<component::Key> OpKDF_SP_800_108(operation::KDF_SP_800_108& op) { |
84 | 169 | (void)op; |
85 | 169 | return std::nullopt; |
86 | 169 | } |
87 | 97 | virtual std::optional<component::MAC> OpCMAC(operation::CMAC& op) { |
88 | 97 | (void)op; |
89 | 97 | return std::nullopt; |
90 | 97 | } |
91 | 77 | virtual std::optional<component::ECC_PublicKey> OpECC_PrivateToPublic(operation::ECC_PrivateToPublic& op) { |
92 | 77 | (void)op; |
93 | 77 | return std::nullopt; |
94 | 77 | } |
95 | 46 | virtual std::optional<bool> OpECC_ValidatePubkey(operation::ECC_ValidatePubkey& op) { |
96 | 46 | (void)op; |
97 | 46 | return std::nullopt; |
98 | 46 | } |
99 | 43 | virtual std::optional<component::ECC_KeyPair> OpECC_GenerateKeyPair(operation::ECC_GenerateKeyPair& op) { |
100 | 43 | (void)op; |
101 | 43 | return std::nullopt; |
102 | 43 | } |
103 | 62 | virtual std::optional<component::ECDSA_Signature> OpECDSA_Sign(operation::ECDSA_Sign& op) { |
104 | 62 | (void)op; |
105 | 62 | return std::nullopt; |
106 | 62 | } |
107 | 40 | virtual std::optional<component::ECGDSA_Signature> OpECGDSA_Sign(operation::ECGDSA_Sign& op) { |
108 | 40 | (void)op; |
109 | 40 | return std::nullopt; |
110 | 40 | } |
111 | 59 | virtual std::optional<component::ECRDSA_Signature> OpECRDSA_Sign(operation::ECRDSA_Sign& op) { |
112 | 59 | (void)op; |
113 | 59 | return std::nullopt; |
114 | 59 | } |
115 | 48 | virtual std::optional<component::Schnorr_Signature> OpSchnorr_Sign(operation::Schnorr_Sign& op) { |
116 | 48 | (void)op; |
117 | 48 | return std::nullopt; |
118 | 48 | } |
119 | 54 | virtual std::optional<bool> OpECDSA_Verify(operation::ECDSA_Verify& op) { |
120 | 54 | (void)op; |
121 | 54 | return std::nullopt; |
122 | 54 | } |
123 | 44 | virtual std::optional<bool> OpECGDSA_Verify(operation::ECGDSA_Verify& op) { |
124 | 44 | (void)op; |
125 | 44 | return std::nullopt; |
126 | 44 | } |
127 | 37 | virtual std::optional<bool> OpECRDSA_Verify(operation::ECRDSA_Verify& op) { |
128 | 37 | (void)op; |
129 | 37 | return std::nullopt; |
130 | 37 | } |
131 | 31 | virtual std::optional<bool> OpSchnorr_Verify(operation::Schnorr_Verify& op) { |
132 | 31 | (void)op; |
133 | 31 | return std::nullopt; |
134 | 31 | } |
135 | 47 | virtual std::optional<component::ECC_PublicKey> OpECDSA_Recover(operation::ECDSA_Recover& op) { |
136 | 47 | (void)op; |
137 | 47 | return std::nullopt; |
138 | 47 | } |
139 | 543 | virtual std::optional<component::Secret> OpECDH_Derive(operation::ECDH_Derive& op) { |
140 | 543 | (void)op; |
141 | 543 | return std::nullopt; |
142 | 543 | } |
143 | 858 | virtual std::optional<component::Ciphertext> OpECIES_Encrypt(operation::ECIES_Encrypt& op) { |
144 | 858 | (void)op; |
145 | 858 | return std::nullopt; |
146 | 858 | } |
147 | 723 | virtual std::optional<component::Cleartext> OpECIES_Decrypt(operation::ECIES_Decrypt& op) { |
148 | 723 | (void)op; |
149 | 723 | return std::nullopt; |
150 | 723 | } |
151 | 57 | virtual std::optional<component::ECC_Point> OpECC_Point_Add(operation::ECC_Point_Add& op) { |
152 | 57 | (void)op; |
153 | 57 | return std::nullopt; |
154 | 57 | } |
155 | 37 | virtual std::optional<component::ECC_Point> OpECC_Point_Mul(operation::ECC_Point_Mul& op) { |
156 | 37 | (void)op; |
157 | 37 | return std::nullopt; |
158 | 37 | } |
159 | 31 | virtual std::optional<component::ECC_Point> OpECC_Point_Neg(operation::ECC_Point_Neg& op) { |
160 | 31 | (void)op; |
161 | 31 | return std::nullopt; |
162 | 31 | } |
163 | 49 | virtual std::optional<component::ECC_Point> OpECC_Point_Dbl(operation::ECC_Point_Dbl& op) { |
164 | 49 | (void)op; |
165 | 49 | return std::nullopt; |
166 | 49 | } |
167 | 5.00k | virtual std::optional<component::DH_KeyPair> OpDH_GenerateKeyPair(operation::DH_GenerateKeyPair& op) { |
168 | 5.00k | (void)op; |
169 | 5.00k | return std::nullopt; |
170 | 5.00k | } |
171 | 84 | virtual std::optional<component::Bignum> OpDH_Derive(operation::DH_Derive& op) { |
172 | 84 | (void)op; |
173 | 84 | return std::nullopt; |
174 | 84 | } |
175 | 0 | virtual std::optional<component::Bignum> OpBignumCalc(operation::BignumCalc& op) { |
176 | 0 | (void)op; |
177 | 0 | return std::nullopt; |
178 | 0 | } |
179 | 65 | virtual std::optional<component::Fp2> OpBignumCalc_Fp2(operation::BignumCalc_Fp2& op) { |
180 | 65 | (void)op; |
181 | 65 | return std::nullopt; |
182 | 65 | } |
183 | 128 | virtual std::optional<component::Fp12> OpBignumCalc_Fp12(operation::BignumCalc_Fp12& op) { |
184 | 128 | (void)op; |
185 | 128 | return std::nullopt; |
186 | 128 | } |
187 | 85 | virtual bool SupportsModularBignumCalc(void) const { |
188 | 85 | return false; |
189 | 85 | } |
190 | 75 | virtual std::optional<component::BLS_PublicKey> OpBLS_PrivateToPublic(operation::BLS_PrivateToPublic& op) { |
191 | 75 | (void)op; |
192 | 75 | return std::nullopt; |
193 | 75 | } |
194 | 54 | virtual std::optional<component::G2> OpBLS_PrivateToPublic_G2(operation::BLS_PrivateToPublic_G2& op) { |
195 | 54 | (void)op; |
196 | 54 | return std::nullopt; |
197 | 54 | } |
198 | 61 | virtual std::optional<component::BLS_Signature> OpBLS_Sign(operation::BLS_Sign& op) { |
199 | 61 | (void)op; |
200 | 61 | return std::nullopt; |
201 | 61 | } |
202 | 40 | virtual std::optional<bool> OpBLS_Verify(operation::BLS_Verify& op) { |
203 | 40 | (void)op; |
204 | 40 | return std::nullopt; |
205 | 40 | } |
206 | 48 | virtual std::optional<component::BLS_BatchSignature> OpBLS_BatchSign(operation::BLS_BatchSign& op) { |
207 | 48 | (void)op; |
208 | 48 | return std::nullopt; |
209 | 48 | } |
210 | 16 | virtual std::optional<bool> OpBLS_BatchVerify(operation::BLS_BatchVerify& op) { |
211 | 16 | (void)op; |
212 | 16 | return std::nullopt; |
213 | 16 | } |
214 | 40 | virtual std::optional<component::G1> OpBLS_Aggregate_G1(operation::BLS_Aggregate_G1& op) { |
215 | 40 | (void)op; |
216 | 40 | return std::nullopt; |
217 | 40 | } |
218 | 50 | virtual std::optional<component::G2> OpBLS_Aggregate_G2(operation::BLS_Aggregate_G2& op) { |
219 | 50 | (void)op; |
220 | 50 | return std::nullopt; |
221 | 50 | } |
222 | 43 | virtual std::optional<component::Fp12> OpBLS_Pairing(operation::BLS_Pairing& op) { |
223 | 43 | (void)op; |
224 | 43 | return std::nullopt; |
225 | 43 | } |
226 | 47 | virtual std::optional<component::Fp12> OpBLS_MillerLoop(operation::BLS_MillerLoop& op) { |
227 | 47 | (void)op; |
228 | 47 | return std::nullopt; |
229 | 47 | } |
230 | 47 | virtual std::optional<component::Fp12> OpBLS_FinalExp(operation::BLS_FinalExp& op) { |
231 | 47 | (void)op; |
232 | 47 | return std::nullopt; |
233 | 47 | } |
234 | 52 | virtual std::optional<component::G1> OpBLS_HashToG1(operation::BLS_HashToG1& op) { |
235 | 52 | (void)op; |
236 | 52 | return std::nullopt; |
237 | 52 | } |
238 | 55 | virtual std::optional<component::G2> OpBLS_HashToG2(operation::BLS_HashToG2& op) { |
239 | 55 | (void)op; |
240 | 55 | return std::nullopt; |
241 | 55 | } |
242 | 43 | virtual std::optional<component::G1> OpBLS_MapToG1(operation::BLS_MapToG1& op) { |
243 | 43 | (void)op; |
244 | 43 | return std::nullopt; |
245 | 43 | } |
246 | 30 | virtual std::optional<component::G2> OpBLS_MapToG2(operation::BLS_MapToG2& op) { |
247 | 30 | (void)op; |
248 | 30 | return std::nullopt; |
249 | 30 | } |
250 | 60 | virtual std::optional<bool> OpBLS_IsG1OnCurve(operation::BLS_IsG1OnCurve& op) { |
251 | 60 | (void)op; |
252 | 60 | return std::nullopt; |
253 | 60 | } |
254 | 67 | virtual std::optional<bool> OpBLS_IsG2OnCurve(operation::BLS_IsG2OnCurve& op) { |
255 | 67 | (void)op; |
256 | 67 | return std::nullopt; |
257 | 67 | } |
258 | 26 | virtual std::optional<component::BLS_KeyPair> OpBLS_GenerateKeyPair(operation::BLS_GenerateKeyPair& op) { |
259 | 26 | (void)op; |
260 | 26 | return std::nullopt; |
261 | 26 | } |
262 | 34 | virtual std::optional<component::G1> OpBLS_Decompress_G1(operation::BLS_Decompress_G1& op) { |
263 | 34 | (void)op; |
264 | 34 | return std::nullopt; |
265 | 34 | } |
266 | 38 | virtual std::optional<component::Bignum> OpBLS_Compress_G1(operation::BLS_Compress_G1& op) { |
267 | 38 | (void)op; |
268 | 38 | return std::nullopt; |
269 | 38 | } |
270 | 41 | virtual std::optional<component::G2> OpBLS_Decompress_G2(operation::BLS_Decompress_G2& op) { |
271 | 41 | (void)op; |
272 | 41 | return std::nullopt; |
273 | 41 | } |
274 | 32 | virtual std::optional<component::G1> OpBLS_Compress_G2(operation::BLS_Compress_G2& op) { |
275 | 32 | (void)op; |
276 | 32 | return std::nullopt; |
277 | 32 | } |
278 | 64 | virtual std::optional<component::G1> OpBLS_G1_Add(operation::BLS_G1_Add& op) { |
279 | 64 | (void)op; |
280 | 64 | return std::nullopt; |
281 | 64 | } |
282 | 76 | virtual std::optional<component::G1> OpBLS_G1_Mul(operation::BLS_G1_Mul& op) { |
283 | 76 | (void)op; |
284 | 76 | return std::nullopt; |
285 | 76 | } |
286 | 81 | virtual std::optional<bool> OpBLS_G1_IsEq(operation::BLS_G1_IsEq& op) { |
287 | 81 | (void)op; |
288 | 81 | return std::nullopt; |
289 | 81 | } |
290 | 56 | virtual std::optional<component::G1> OpBLS_G1_Neg(operation::BLS_G1_Neg& op) { |
291 | 56 | (void)op; |
292 | 56 | return std::nullopt; |
293 | 56 | } |
294 | 85 | virtual std::optional<component::G2> OpBLS_G2_Add(operation::BLS_G2_Add& op) { |
295 | 85 | (void)op; |
296 | 85 | return std::nullopt; |
297 | 85 | } |
298 | 56 | virtual std::optional<component::G2> OpBLS_G2_Mul(operation::BLS_G2_Mul& op) { |
299 | 56 | (void)op; |
300 | 56 | return std::nullopt; |
301 | 56 | } |
302 | 71 | virtual std::optional<bool> OpBLS_G2_IsEq(operation::BLS_G2_IsEq& op) { |
303 | 71 | (void)op; |
304 | 71 | return std::nullopt; |
305 | 71 | } |
306 | 67 | virtual std::optional<component::G2> OpBLS_G2_Neg(operation::BLS_G2_Neg& op) { |
307 | 67 | (void)op; |
308 | 67 | return std::nullopt; |
309 | 67 | } |
310 | 44 | virtual std::optional<Buffer> OpMisc(operation::Misc& op) { |
311 | 44 | (void)op; |
312 | 44 | return std::nullopt; |
313 | 44 | } |
314 | 57 | virtual std::optional<bool> OpSR25519_Verify(operation::SR25519_Verify& op) { |
315 | 57 | (void)op; |
316 | 57 | return std::nullopt; |
317 | 57 | } |
318 | | }; |
319 | | |
320 | | } /* namespace cryptofuzz */ |