Coverage Report

Created: 2023-02-22 06:39

/src/cryptofuzz/entry.cpp
Line
Count
Source
1
#include <cstddef>
2
#include <cstdint>
3
#include <memory>
4
#include <set>
5
#include <vector>
6
#include <string>
7
#include <cryptofuzz/options.h>
8
#include <fuzzing/datasource/id.hpp>
9
#include "repository_tbl.h"
10
#include "driver.h"
11
#include "numbers.h"
12
#include "mutatorpool.h"
13
14
#if defined(CRYPTOFUZZ_LIBTOMMATH) && defined(CRYPTOFUZZ_NSS)
15
#error "libtommath and NSS cannot be used together due to symbol collisions"
16
#endif
17
18
#if defined(CRYPTOFUZZ_TREZOR_FIRMWARE) && defined(CRYPTOFUZZ_RELIC)
19
#error "trezor-firmware and relic cannot be used together due to symbol collisions"
20
#endif
21
22
#if !defined(CRYPTOFUZZ_NO_OPENSSL)
23
  #include <modules/openssl/module.h>
24
  #ifdef SHA1
25
    #undef SHA1
26
  #endif
27
  #ifdef SHA224
28
    #undef SHA224
29
  #endif
30
  #ifdef SHA256
31
    #undef SHA256
32
  #endif
33
  #ifdef SHA384
34
    #undef SHA384
35
  #endif
36
  #ifdef SHA512
37
    #undef SHA512
38
  #endif
39
#endif
40
41
#if defined(CRYPTOFUZZ_BITCOIN)
42
  #include <modules/bitcoin/module.h>
43
#endif
44
45
#if defined(CRYPTOFUZZ_REFERENCE)
46
  #include <modules/reference/module.h>
47
#endif
48
49
#if defined(CRYPTOFUZZ_CPPCRYPTO)
50
  #include <modules/cppcrypto/module.h>
51
#endif
52
53
#if defined(CRYPTOFUZZ_MBEDTLS)
54
  #include <modules/mbedtls/module.h>
55
#endif
56
57
#if defined(CRYPTOFUZZ_BOOST)
58
  #include <modules/boost/module.h>
59
#endif
60
61
#if defined(CRYPTOFUZZ_MONERO)
62
  #include <modules/monero/module.h>
63
#endif
64
65
#if defined(CRYPTOFUZZ_VERACRYPT)
66
  #include <modules/veracrypt/module.h>
67
#endif
68
69
#if defined(CRYPTOFUZZ_LIBSODIUM)
70
  #include <modules/libsodium/module.h>
71
#endif
72
73
#if defined(CRYPTOFUZZ_LIBTOMCRYPT)
74
  #include <modules/libtomcrypt/module.h>
75
#endif
76
77
#if defined(CRYPTOFUZZ_CRYPTOPP)
78
  #include <modules/cryptopp/module.h>
79
#endif
80
81
#if defined(CRYPTOFUZZ_LIBGCRYPT)
82
  #include <modules/libgcrypt/module.h>
83
#endif
84
85
#if defined(CRYPTOFUZZ_EVERCRYPT)
86
  #include <modules/evercrypt/module.h>
87
#endif
88
89
#if defined(CRYPTOFUZZ_GOLANG)
90
  #include <modules/golang/module.h>
91
#endif
92
93
#if defined(CRYPTOFUZZ_RING)
94
  #include <modules/ring/module.h>
95
#endif
96
97
#if defined(CRYPTOFUZZ_NSS)
98
  #include <modules/nss/module.h>
99
#endif
100
101
#if defined(CRYPTOFUZZ_BOTAN)
102
  #include <modules/botan/module.h>
103
#endif
104
105
#if defined(CRYPTOFUZZ_NETTLE)
106
  #include <modules/nettle/module.h>
107
#endif
108
109
#if defined(CRYPTOFUZZ_WOLFCRYPT)
110
  #include <modules/wolfcrypt/module.h>
111
#endif
112
113
#if defined(CRYPTOFUZZ_LIBGMP)
114
  #include <modules/libgmp/module.h>
115
#endif
116
117
#if defined(CRYPTOFUZZ_BN_JS)
118
  #include <modules/bn.js/module.h>
119
#endif
120
121
#if defined(CRYPTOFUZZ_CRYPTO_JS)
122
  #include <modules/crypto-js/module.h>
123
#endif
124
125
#if defined(CRYPTOFUZZ_BIGNUMBER_JS)
126
  #include <modules/bignumber.js/module.h>
127
#endif
128
129
#if defined(CRYPTOFUZZ_MPDECIMAL)
130
  #include <modules/mpdecimal/module.h>
131
#endif
132
133
#if defined(CRYPTOFUZZ_LINUX)
134
  #include <modules/linux/module.h>
135
#endif
136
137
#if defined(CRYPTOFUZZ_SYMCRYPT)
138
  #include <modules/symcrypt/module.h>
139
#endif
140
141
#if defined(CRYPTOFUZZ_LIBTOMMATH)
142
  #include <modules/libtommath/module.h>
143
#endif
144
145
#if defined(CRYPTOFUZZ_SJCL)
146
  #include <modules/sjcl/module.h>
147
#endif
148
149
#if defined(CRYPTOFUZZ_WOLFCRYPT_OPENSSL)
150
  #include <modules/wolfcrypt-openssl/module.h>
151
#endif
152
153
#if defined(CRYPTOFUZZ_MONOCYPHER)
154
  #include <modules/monocypher/module.h>
155
#endif
156
157
#if defined(CRYPTOFUZZ_SECP256K1)
158
  #include <modules/secp256k1/module.h>
159
#endif
160
161
#if defined(CRYPTOFUZZ_RUST_LIBSECP256K1)
162
  #include <modules/rust-libsecp256k1/module.h>
163
#endif
164
165
#if defined(CRYPTOFUZZ_TREZOR_FIRMWARE)
166
  #include <modules/trezor/module.h>
167
#endif
168
169
#if defined(CRYPTOFUZZ_ELLIPTIC)
170
  #include <modules/elliptic/module.h>
171
#endif
172
173
#if defined(CRYPTOFUZZ_DECRED)
174
  #include <modules/decred/module.h>
175
#endif
176
177
#if defined(CRYPTOFUZZ_BEARSSL)
178
  #include <modules/bearssl/module.h>
179
#endif
180
181
#if defined(CRYPTOFUZZ_MICRO_ECC)
182
  #include <modules/micro-ecc/module.h>
183
#endif
184
185
#if defined(CRYPTOFUZZ_CIFRA)
186
  #include <modules/cifra/module.h>
187
#endif
188
189
#if defined(CRYPTOFUZZ_RELIC)
190
  #include <modules/relic/module.h>
191
#endif
192
193
#if defined(CRYPTOFUZZ_LIBECC)
194
  #include <modules/libecc/module.h>
195
#endif
196
197
#if defined(CRYPTOFUZZ_CHIA_BLS)
198
  #include <modules/chia_bls/module.h>
199
#endif
200
201
#if defined(CRYPTOFUZZ_K256)
202
  #include <modules/k256/module.h>
203
#endif
204
205
#if defined(CRYPTOFUZZ_SCHNORRKEL)
206
  #include <modules/schnorrkel/module.h>
207
#endif
208
209
#if defined(CRYPTOFUZZ_NOBLE_SECP256K1)
210
  #include <modules/noble-secp256k1/module.h>
211
#endif
212
213
#if defined(CRYPTOFUZZ_BLST)
214
  #include <modules/blst/module.h>
215
#endif
216
217
#if defined(CRYPTOFUZZ_MCL)
218
  #include <modules/mcl/module.h>
219
#endif
220
221
#if defined(CRYPTOFUZZ_PY_ECC)
222
  #include <modules/py_ecc/module.h>
223
#endif
224
225
#if defined(CRYPTOFUZZ_KILIC_BLS12_381)
226
  #include <modules/kilic-bls12-381/module.h>
227
#endif
228
229
#if defined(CRYPTOFUZZ_NOBLE_ED25519)
230
  #include <modules/noble-ed25519/module.h>
231
#endif
232
233
#if defined(CRYPTOFUZZ_NOBLE_BLS12_381)
234
  #include <modules/noble-bls12-381/module.h>
235
#endif
236
237
#if defined(CRYPTOFUZZ_SCHNORR_FUN)
238
  #include <modules/schnorr_fun/module.h>
239
#endif
240
241
#if defined(CRYPTOFUZZ_QUICKJS)
242
  #include <modules/quickjs/module.h>
243
#endif
244
245
#if defined(CRYPTOFUZZ_UINT128_T)
246
  #include <modules/uint128_t/module.h>
247
#endif
248
249
#if defined(CRYPTOFUZZ_LIBFF)
250
  #include <modules/libff/module.h>
251
#endif
252
253
#if defined(CRYPTOFUZZ_GNARK_BN254)
254
  #include <modules/gnark-bn254/module.h>
255
#endif
256
257
#if defined(CRYPTOFUZZ_GOOGLE_BN256)
258
  #include <modules/google-bn256/module.h>
259
#endif
260
261
#if defined(CRYPTOFUZZ_CLOUDFLARE_BN256)
262
  #include <modules/cloudflare-bn256/module.h>
263
#endif
264
265
#if defined(CRYPTOFUZZ_NOBLE_HASHES)
266
  #include <modules/noble-hashes/module.h>
267
#endif
268
269
#if defined(CRYPTOFUZZ_SKALE_SOLIDITY)
270
  #include <modules/skalesolidity/module.h>
271
#endif
272
273
#if defined(CRYPTOFUZZ_GOOGLE_INTEGERS)
274
  #include <modules/google-integers/module.h>
275
#endif
276
277
#if defined(CRYPTOFUZZ_NIMCRYPTO)
278
  #include <modules/nimcrypto/module.h>
279
#endif
280
281
#if defined(CRYPTOFUZZ_RUSTCRYPTO)
282
  #include <modules/rustcrypto/module.h>
283
#endif
284
285
#if defined(CRYPTOFUZZ_NUM_BIGINT)
286
  #include <modules/num-bigint/module.h>
287
#endif
288
289
#if defined(CRYPTOFUZZ_INTX)
290
  #include <modules/intx/module.h>
291
#endif
292
293
#if defined(CRYPTOFUZZ_DECRED_UINT256)
294
  #include <modules/decred-uint256/module.h>
295
#endif
296
297
#if defined(CRYPTOFUZZ_LIBDIVIDE)
298
  #include <modules/libdivide/module.h>
299
#endif
300
301
#if defined(CRYPTOFUZZ_RUST_UINT)
302
  #include <modules/rust-uint/module.h>
303
#endif
304
305
#if defined(CRYPTOFUZZ_BC)
306
  #include <modules/bc/module.h>
307
#endif
308
309
#if defined(CRYPTOFUZZ_JAVA)
310
  #include <modules/java/module.h>
311
#endif
312
313
#if defined(CRYPTOFUZZ_SOLIDITY_MATH)
314
  #include <modules/soliditymath/module.h>
315
#endif
316
317
#if defined(CRYPTOFUZZ_V8)
318
  #include <modules/v8/module.h>
319
#endif
320
321
#if defined(CRYPTOFUZZ_CIRCL)
322
  #include <modules/circl/module.h>
323
#endif
324
325
#if defined(CRYPTOFUZZ_SPL_MATH)
326
  #include <modules/spl_math/module.h>
327
#endif
328
329
#if defined(CRYPTOFUZZ_ZIG)
330
  #include <modules/zig/module.h>
331
#endif
332
333
#if defined(CRYPTOFUZZ_PRYSMATICLABS_HASHTREE)
334
  #include <modules/prysmaticlabs-hashtree/module.h>
335
#endif
336
337
#if defined(CRYPTOFUZZ_STARKWARE)
338
  #include <modules/starkware/module.h>
339
#endif
340
341
#if defined(CRYPTOFUZZ_PORNIN_BINGCD)
342
  #include <modules/pornin-bingcd/module.h>
343
#endif
344
345
#if defined(CRYPTOFUZZ_STINT)
346
  #include <modules/stint/module.h>
347
#endif
348
349
#if defined(CRYPTOFUZZ_KRYPTOLOGY)
350
  #include <modules/kryptology/module.h>
351
#endif
352
353
#if defined(CRYPTOFUZZ_NIM_BIGINTS)
354
  #include <modules/nim-bigints/module.h>
355
#endif
356
357
#if defined(CRYPTOFUZZ_HOLIMAN_UINT256)
358
  #include <modules/holiman-uint256/module.h>
359
#endif
360
361
#if defined(CRYPTOFUZZ_CPU)
362
  #include <modules/cpu/module.h>
363
#endif
364
365
#if defined(CRYPTOFUZZ_GETH)
366
  #include <modules/geth/module.h>
367
#endif
368
369
#if defined(CRYPTOFUZZ_JSBN)
370
  #include <modules/jsbn/module.h>
371
#endif
372
373
#if defined(CRYPTOFUZZ_WIDE_INTEGER)
374
  #include <modules/wide-integer/module.h>
375
#endif
376
377
#if defined(CRYPTOFUZZ_TINY_KECCAK)
378
  #include <modules/tiny-keccak/module.h>
379
#endif
380
381
#if defined(CRYPTOFUZZ_ARKWORKS_ALGEBRA)
382
  #include <modules/arkworks-algebra/module.h>
383
#endif
384
385
#if defined(CRYPTOFUZZ_FF)
386
  #include <modules/ff/module.h>
387
#endif
388
389
#if defined(CRYPTOFUZZ_ALEO)
390
  #include <modules/aleo/module.h>
391
#endif
392
393
#if defined(CRYPTOFUZZ_SHAMATAR)
394
  #include <modules/shamatar/module.h>
395
#endif
396
397
#if defined(CRYPTOFUZZ_MICROSOFT_CALCULATOR)
398
  #include <modules/microsoft-calculator/module.h>
399
#endif
400
401
std::shared_ptr<cryptofuzz::Driver> driver = nullptr;
402
403
const cryptofuzz::Options* cryptofuzz_options = nullptr;
404
405
2
static void setOptions(int argc, char** argv) {
406
2
    std::vector<std::string> extraArguments;
407
408
2
    const std::string cmdline(
409
2
#include "extra_options.h"
410
2
    );
411
2
    boost::split(extraArguments, cmdline, boost::is_any_of(" "));
412
413
2
    const cryptofuzz::Options options(argc, argv, extraArguments);
414
415
2
    driver = std::make_shared<cryptofuzz::Driver>(options);
416
2
    cryptofuzz_options = driver->GetOptionsPtr();
417
2
}
418
419
2
static void addNumbers(void) {
420
2
    std::set<std::string> curveNumbers;
421
422
230
    for (size_t i = 0; i < (sizeof(ECC_CurveLUT) / sizeof(ECC_CurveLUT[0])); i++) {
423
228
        if ( ECC_CurveLUT[i].prime ) curveNumbers.insert(*ECC_CurveLUT[i].prime);
424
228
        if ( ECC_CurveLUT[i].a ) curveNumbers.insert(*ECC_CurveLUT[i].a);
425
228
        if ( ECC_CurveLUT[i].b ) curveNumbers.insert(*ECC_CurveLUT[i].b);
426
228
        if ( ECC_CurveLUT[i].x ) curveNumbers.insert(*ECC_CurveLUT[i].x);
427
228
        if ( ECC_CurveLUT[i].y ) curveNumbers.insert(*ECC_CurveLUT[i].y);
428
228
        if ( ECC_CurveLUT[i].order_min_1 ) curveNumbers.insert(*ECC_CurveLUT[i].order_min_1);
429
228
        if ( ECC_CurveLUT[i].order ) curveNumbers.insert(*ECC_CurveLUT[i].order);
430
228
        if ( ECC_CurveLUT[i].cube_root_of_unity ) curveNumbers.insert(*ECC_CurveLUT[i].cube_root_of_unity);
431
228
    }
432
433
742
    for (const auto& s : curveNumbers) {
434
742
        cryptofuzz::numbers.push_back(s);
435
742
    }
436
2
}
437
438
2
static void addDHParameters(void) {
439
#if 0
440
    Pool_DSA_PQG.Set(
441
            {.p = "1",
442
            .q = "2",
443
            .g = "3"});
444
#endif
445
2
    Pool_DSA_PQG.Set(
446
2
            {.p = "150231251465501053065289730830479539031267100291054217656119618775188714462742252299995155757488154161365770046117427638242442140226792437461696203428042747814919633220489019161055283800701437723694062141157721435870605677289344980419875189236552985653350450140879697446183075783979747578514684880689288047799",
447
2
            .q = "1294481460557625951125096174768278956450379329019",
448
2
            .g = "123176323926370145306905001771640082099315258804911565991781248774641279332286091530406470110108628420952674474326303976152638457646984169382680970876359186878615754700522570368203249170942652654272930135088255007459054551060675803532305465059607033300717516344741377807058295415130769662943475898885953255340"});
449
2
    Pool_DSA_PQG.Set(
450
2
            {.p = "106509719202367738942907301715621764539176496646576730633405674043673327856034496732123285709035111374434625191651676418221653833534278937120432644397709949603105722781668399360019469472968954460534436252768055503483520304713097271043340825087067201677304620852378413654560436979990703753937487367926506348269",
451
2
            .q = "1118288236462792761843833248187413414208173350127",
452
2
            .g = "72435671226965183258018862642795284302154495588562538482929411018310293659579761499337602974793436767341017333127333555852102593771624671345177391442816067820254123593555250556535136260966363205479876316378634773122750273117965996152020834617159357433557924693138598393331986343698108999770366446752278926383"});
453
2
    Pool_DSA_PQG.Set(
454
2
            {.p = "138004309818347094291132867053619499223956524961247192036762792751710974956820647583519309378416103935248269857717426029960774699149947213109440086871278734506662709841063082677937025903550210186986005638869595390211739861476658649538254442080037424128091536935132784096865076724077340725421734957662003955733",
455
2
            .q = "1182250927352833565111471235946595886633807053753",
456
2
            .g = "50981117407618898907676270875500924244946234557748656321451486290931484477672699528123700670310821778249759666738775273571334004072876741139654244496478237072456811279416350268794526824840182161332334555442145925212778889513472053306551473115435240639581353186943034554008455203164569371804149410594860147535"});
457
2
    Pool_DSA_PQG.Set(
458
2
            {.p = "109946688229802800321045008502525855019018343635199811459637834412277718704275426696546931048200193867073853699694661301100987130977969037055869145785556128499893546459160327648034486774397840709962126663410720743324891206859744100608443126416778329748285936795477961285242132107013514469104031276590639145529",
459
2
            .q = "1097017798574652758688027153013343959247758036379",
460
2
            .g = "90853802403425362444834708006843703424758064889418913931212173026894777531419682953836039048180446572898657640543499059154888760571238291120015914403667178235563530884249409802138323217540531374295893371508604222324367014390024227163670654837119886355437741902577247163114711575830541075372536310906966739501"});
461
2
    Pool_DSA_PQG.Set(
462
2
            {.p = "124209509072024958275166637845461843473168024436234587545357618943183152164739154230608140142817940602971118647920318657635219309456829210930848667888289103140463427808821865872498412912378809701133733363511757593195923487399372820407763609428150569455525396831100333605708326427075191467209382555105711963299",
463
2
            .q = "1156817815916336365281547542987775955291851935871",
464
2
            .g = "43439798865518148079170184647168882910799658250950112656992473391369195267567114318131636772383729066568167011041675228166469202932063704475384188208092171311430491566372323746821632363680716780126497417783638448391870877258448510742322506027897962466869528155419123258766935809190262469523993336422700725318"});
465
2
    Pool_DSA_PQG.Set(
466
2
            {.p = "126331233628980840165184565942245385096513091144740711497864308287507943295406615416955002027235910171772121228535928494648768972393171048104219309808822924104348781037865255204637472392028547550836119757782109037132097469719594436136398329796267499263632942017207769135383159876183961765810415630873971115233",
467
2
            .q = "1203327632657956941015344776779451299508739578129",
468
2
            .g = "97452668285819865055659311415043913678401634848512133077315151404416203000244082651639944515890002752552299640827969897097594332745578954618134141809516813588353374434067098749478884011839257971032639225273289142277635977389715811787650901754149760120488823365859750048315630946360036462942314143557183124982"});
469
2
    Pool_DSA_PQG.Set(
470
2
            {.p = "139250883301823483908883928083839064003745916441650255007772870154941172395087178752876101091005767662213271334443940570474680019084601422955747232370282598419697274421195681275556947624938410397537906338955131228297990585299263933664717169274974367925488384465967202651868677400555284280096337099191959071787",
471
2
            .q = "1325100766121833447183259101226453517842221286507",
472
2
            .g = "58646846595225538779696035374886298089421912241195003782810584053398797793591727045576166116215795078184706343867027617123952824238923027973165246674943121228498251801328224621075003565013070726915672626019475087221545030092892828436386114258346864840836351933570664379118571919793182205573116727058719375661"});
473
2
    Pool_DSA_PQG.Set(
474
2
            {.p = "144701324401598336550884152343368172277609864124511490596617105828057159991373774941016821760687266369338519486490004072145971111466542758853015017509128499051606282143736677640332301617479652949405201725583682831439755381248675286661684002938741047451713467379330091941738855468955951557713143970579349864457",
475
2
            .q = "1439434426242082501974975807657668984105633014787",
476
2
            .g = "113600692930456433400748782777975166451962648651602592974909826945350314246206069661699011991844511030599644698164383474978927329888470480371116765437437655015511396253863826561268272020107619231686538845226921909438712847791416806266736495398219697258274310643814113505622803337678429494610934192497815903365"});
477
2
    Pool_DSA_PQG.Set(
478
2
            {.p = "135341197697226724892903083596165054694790625986023071616356886245846043038405567011291087532200081879605164155216745486229649520257309932549000914144450824446643782112243492160717188886767122817207763789165868343163481202614492491575215866530116235028761963662218876392260598504340050277595263388586602546747",
479
2
            .q = "1169054189952016903829256751948870806314450386513",
480
2
            .g = "30572099485446824777611559392355316740353774202040161762373834574766256266332511696873593659519522274210266790041815776129917472702566335252550578138435000898308011273223392155586550839178056561166656269827651537030610266906854193629082719056305327623289093720593961976531902349641250618073959820008293423729"});
481
2
    Pool_DSA_PQG.Set(
482
2
            {.p = "127351864753493277268739385478165721559729466727175877720818107624823856755558221219347691856288532870918552584721097877527832510124917679520208660409823797024889655990544958921667883652156168599993183854739635683709671125815430824244885672208722762544165061369990843770047348269058869140280321943549216357991",
483
2
            .q = "1156961398255600519725597002666342085415806424529",
484
2
            .g = "106257931303095074533103986366433211062343163442228036675016417802383259373755687507866521855899403669620543075167608985212468902139533924762542871308909385486893394211775148650040778024210387468981928471252790681933685353324695021902141191542978389064246508147865484230435458524929665990269930783999629249441"});
485
2
    Pool_DSA_PQG.Set(
486
2
            {.p = "131039458455155250090174200145321228172977476476885551980435528702610913389079590939737522784805216856991866456707299626829238352232572218199747475524103264307799994317996352504194705753236329996801042545987006513074758983109144174154780904219653269610458162384667077307435251147347179290650561637905921672683",
487
2
            .q = "1170715624353437458381293805110022939445185488259",
488
2
            .g = "126742934784779681813194779376736668434375433467445616299439666618831396063812870504003367398372147678231830460960085383230032539099660760734275638091575317361409298198873148524067936524126541952740212599133188511748079844136886266936035053990867071777029697349092865480561238401432352105670316197944641993372"});
489
2
    Pool_DSA_PQG.Set(
490
2
            {.p = "113501887847313654923482478343337570064130386651110593957519724786021990228602191373446721521338119059972385547173111082437621139282278796862795599570090388898648541512966469137375762705045818898892127936907280478802811793893711980582500291057764626146803929832480402191770765381629264026303953585630138960173",
491
2
            .q = "1210118463151965859368281774842614821435692691527",
492
2
            .g = "7368690161464245595369357421049794571202878323927473530430901957824912081535284584536397796919942606122666864397318876947854645101607578840959967924770322750454906727500380020624862129397409509250521115423635650551518713996861995296315890736439522758915319733553857973686465993050136329199277364851750662840"});
493
2
}
494
495
2
extern "C" int LLVMFuzzerInitialize(int *argc, char ***argv) {
496
2
    setOptions(*argc, *argv);
497
2
    addNumbers();
498
2
    addDHParameters();
499
500
#if !defined(CRYPTOFUZZ_NO_OPENSSL)
501
    driver->LoadModule( std::make_shared<cryptofuzz::module::OpenSSL>() );
502
#endif
503
504
#if defined(CRYPTOFUZZ_BITCOIN)
505
    driver->LoadModule( std::make_shared<cryptofuzz::module::Bitcoin>() );
506
#endif
507
508
#if defined(CRYPTOFUZZ_REFERENCE)
509
    driver->LoadModule( std::make_shared<cryptofuzz::module::Reference>() );
510
#endif
511
512
#if defined(CRYPTOFUZZ_CPPCRYPTO)
513
    driver->LoadModule( std::make_shared<cryptofuzz::module::CPPCrypto>() );
514
#endif
515
516
#if defined(CRYPTOFUZZ_MBEDTLS)
517
    driver->LoadModule( std::make_shared<cryptofuzz::module::mbedTLS>() );
518
#endif
519
520
#if defined(CRYPTOFUZZ_BOOST)
521
    driver->LoadModule( std::make_shared<cryptofuzz::module::Boost>() );
522
#endif
523
524
#if defined(CRYPTOFUZZ_MONERO)
525
    driver->LoadModule( std::make_shared<cryptofuzz::module::Monero>() );
526
#endif
527
528
#if defined(CRYPTOFUZZ_VERACRYPT)
529
    driver->LoadModule( std::make_shared<cryptofuzz::module::Veracrypt>() );
530
#endif
531
532
#if defined(CRYPTOFUZZ_LIBSODIUM)
533
    driver->LoadModule( std::make_shared<cryptofuzz::module::libsodium>() );
534
#endif
535
536
#if defined(CRYPTOFUZZ_LIBTOMCRYPT)
537
    driver->LoadModule( std::make_shared<cryptofuzz::module::libtomcrypt>() );
538
#endif
539
540
#if defined(CRYPTOFUZZ_CRYPTOPP)
541
    driver->LoadModule( std::make_shared<cryptofuzz::module::CryptoPP>() );
542
#endif
543
544
#if defined(CRYPTOFUZZ_LIBGCRYPT)
545
    driver->LoadModule( std::make_shared<cryptofuzz::module::libgcrypt>() );
546
#endif
547
548
#if defined(CRYPTOFUZZ_EVERCRYPT)
549
    driver->LoadModule( std::make_shared<cryptofuzz::module::EverCrypt>() );
550
#endif
551
552
#if defined(CRYPTOFUZZ_GOLANG)
553
    driver->LoadModule( std::make_shared<cryptofuzz::module::Golang>() );
554
#endif
555
556
#if defined(CRYPTOFUZZ_RING)
557
    driver->LoadModule( std::make_shared<cryptofuzz::module::Ring>() );
558
#endif
559
560
#if defined(CRYPTOFUZZ_NSS)
561
    driver->LoadModule( std::make_shared<cryptofuzz::module::NSS>() );
562
#endif
563
564
2
#if defined(CRYPTOFUZZ_BOTAN)
565
2
    driver->LoadModule( std::make_shared<cryptofuzz::module::Botan>() );
566
2
#endif
567
568
#if defined(CRYPTOFUZZ_NETTLE)
569
    driver->LoadModule( std::make_shared<cryptofuzz::module::Nettle>() );
570
#endif
571
572
2
#if defined(CRYPTOFUZZ_WOLFCRYPT)
573
2
    driver->LoadModule( std::make_shared<cryptofuzz::module::wolfCrypt>() );
574
2
#endif
575
576
2
#if defined(CRYPTOFUZZ_LIBGMP)
577
2
    driver->LoadModule( std::make_shared<cryptofuzz::module::libgmp>() );
578
2
#endif
579
580
#if defined(CRYPTOFUZZ_BN_JS)
581
    driver->LoadModule( std::make_shared<cryptofuzz::module::bn_js>() );
582
#endif
583
584
#if defined(CRYPTOFUZZ_CRYPTO_JS)
585
    driver->LoadModule( std::make_shared<cryptofuzz::module::crypto_js>() );
586
#endif
587
588
#if defined(CRYPTOFUZZ_BIGNUMBER_JS)
589
    driver->LoadModule( std::make_shared<cryptofuzz::module::bignumber_js>() );
590
#endif
591
592
#if defined(CRYPTOFUZZ_MPDECIMAL)
593
    driver->LoadModule( std::make_shared<cryptofuzz::module::mpdecimal>() );
594
#endif
595
596
#if defined(CRYPTOFUZZ_LINUX)
597
    driver->LoadModule( std::make_shared<cryptofuzz::module::Linux>() );
598
#endif
599
600
#if defined(CRYPTOFUZZ_SYMCRYPT)
601
    driver->LoadModule( std::make_shared<cryptofuzz::module::SymCrypt>() );
602
#endif
603
604
#if defined(CRYPTOFUZZ_LIBTOMMATH)
605
    driver->LoadModule( std::make_shared<cryptofuzz::module::libtommath>() );
606
#endif
607
608
#if defined(CRYPTOFUZZ_SJCL)
609
    driver->LoadModule( std::make_shared<cryptofuzz::module::sjcl>() );
610
#endif
611
612
#if defined(CRYPTOFUZZ_WOLFCRYPT_OPENSSL)
613
    driver->LoadModule( std::make_shared<cryptofuzz::module::wolfCrypt_OpenSSL>() );
614
#endif
615
616
#if defined(CRYPTOFUZZ_MONOCYPHER)
617
    driver->LoadModule( std::make_shared<cryptofuzz::module::Monocypher>() );
618
#endif
619
620
#if defined(CRYPTOFUZZ_SECP256K1)
621
    driver->LoadModule( std::make_shared<cryptofuzz::module::secp256k1>() );
622
#endif
623
624
#if defined(CRYPTOFUZZ_RUST_LIBSECP256K1)
625
    driver->LoadModule( std::make_shared<cryptofuzz::module::rust_libsecp256k1>() );
626
#endif
627
628
#if defined(CRYPTOFUZZ_TREZOR_FIRMWARE)
629
    driver->LoadModule( std::make_shared<cryptofuzz::module::trezor_firmware>() );
630
#endif
631
632
#if defined(CRYPTOFUZZ_ELLIPTIC)
633
    driver->LoadModule( std::make_shared<cryptofuzz::module::elliptic>() );
634
#endif
635
636
#if defined(CRYPTOFUZZ_DECRED)
637
    driver->LoadModule( std::make_shared<cryptofuzz::module::Decred>() );
638
#endif
639
640
#if defined(CRYPTOFUZZ_BEARSSL)
641
    driver->LoadModule( std::make_shared<cryptofuzz::module::BearSSL>() );
642
#endif
643
644
#if defined(CRYPTOFUZZ_MICRO_ECC)
645
    driver->LoadModule( std::make_shared<cryptofuzz::module::micro_ecc>() );
646
#endif
647
648
#if defined(CRYPTOFUZZ_CIFRA)
649
    driver->LoadModule( std::make_shared<cryptofuzz::module::cifra>() );
650
#endif
651
652
#if defined(CRYPTOFUZZ_RELIC)
653
    driver->LoadModule( std::make_shared<cryptofuzz::module::relic>() );
654
#endif
655
656
2
#if defined(CRYPTOFUZZ_LIBECC)
657
2
    driver->LoadModule( std::make_shared<cryptofuzz::module::libecc>() );
658
2
#endif
659
660
#if defined(CRYPTOFUZZ_CHIA_BLS)
661
    driver->LoadModule( std::make_shared<cryptofuzz::module::chia_bls>() );
662
#endif
663
664
#if defined(CRYPTOFUZZ_K256)
665
    driver->LoadModule( std::make_shared<cryptofuzz::module::k256>() );
666
#endif
667
668
#if defined(CRYPTOFUZZ_SCHNORRKEL)
669
    driver->LoadModule( std::make_shared<cryptofuzz::module::schnorrkel>() );
670
#endif
671
672
#if defined(CRYPTOFUZZ_NOBLE_SECP256K1)
673
    driver->LoadModule( std::make_shared<cryptofuzz::module::noble_secp256k1>() );
674
#endif
675
676
#if defined(CRYPTOFUZZ_BLST)
677
    driver->LoadModule( std::make_shared<cryptofuzz::module::blst>() );
678
#endif
679
680
#if defined(CRYPTOFUZZ_MCL)
681
    driver->LoadModule( std::make_shared<cryptofuzz::module::mcl>() );
682
#endif
683
684
#if defined(CRYPTOFUZZ_PY_ECC)
685
    driver->LoadModule( std::make_shared<cryptofuzz::module::py_ecc>() );
686
#endif
687
688
#if defined(CRYPTOFUZZ_KILIC_BLS12_381)
689
    driver->LoadModule( std::make_shared<cryptofuzz::module::kilic_bls12_381>() );
690
#endif
691
692
#if defined(CRYPTOFUZZ_NOBLE_ED25519)
693
    driver->LoadModule( std::make_shared<cryptofuzz::module::noble_ed25519>() );
694
#endif
695
696
#if defined(CRYPTOFUZZ_NOBLE_BLS12_381)
697
    driver->LoadModule( std::make_shared<cryptofuzz::module::noble_bls12_381>() );
698
#endif
699
700
#if defined(CRYPTOFUZZ_SCHNORR_FUN)
701
    driver->LoadModule( std::make_shared<cryptofuzz::module::schnorr_fun>() );
702
#endif
703
704
#if defined(CRYPTOFUZZ_QUICKJS)
705
    driver->LoadModule( std::make_shared<cryptofuzz::module::quickjs>() );
706
#endif
707
708
#if defined(CRYPTOFUZZ_UINT128_T)
709
    driver->LoadModule( std::make_shared<cryptofuzz::module::uint128_t>() );
710
#endif
711
712
#if defined(CRYPTOFUZZ_LIBFF)
713
    driver->LoadModule( std::make_shared<cryptofuzz::module::_libff>() );
714
#endif
715
716
#if defined(CRYPTOFUZZ_GNARK_BN254)
717
    driver->LoadModule( std::make_shared<cryptofuzz::module::Gnark_bn254>() );
718
#endif
719
720
#if defined(CRYPTOFUZZ_GOOGLE_BN256)
721
    driver->LoadModule( std::make_shared<cryptofuzz::module::Google_bn256>() );
722
#endif
723
724
#if defined(CRYPTOFUZZ_CLOUDFLARE_BN256)
725
    driver->LoadModule( std::make_shared<cryptofuzz::module::Cloudflare_bn256>() );
726
#endif
727
728
#if defined(CRYPTOFUZZ_NOBLE_HASHES)
729
    driver->LoadModule( std::make_shared<cryptofuzz::module::noble_hashes>() );
730
#endif
731
732
#if defined(CRYPTOFUZZ_SKALE_SOLIDITY)
733
    driver->LoadModule( std::make_shared<cryptofuzz::module::SkaleSolidity>() );
734
#endif
735
736
#if defined(CRYPTOFUZZ_GOOGLE_INTEGERS)
737
    driver->LoadModule( std::make_shared<cryptofuzz::module::Google_Integers>() );
738
#endif
739
740
#if defined(CRYPTOFUZZ_NIMCRYPTO)
741
    driver->LoadModule( std::make_shared<cryptofuzz::module::nimcrypto>() );
742
#endif
743
744
#if defined(CRYPTOFUZZ_RUSTCRYPTO)
745
    driver->LoadModule( std::make_shared<cryptofuzz::module::rustcrypto>() );
746
#endif
747
748
#if defined(CRYPTOFUZZ_NUM_BIGINT)
749
    driver->LoadModule( std::make_shared<cryptofuzz::module::num_bigint>() );
750
#endif
751
752
#if defined(CRYPTOFUZZ_INTX)
753
    driver->LoadModule( std::make_shared<cryptofuzz::module::intx>() );
754
#endif
755
756
#if defined(CRYPTOFUZZ_DECRED_UINT256)
757
    driver->LoadModule( std::make_shared<cryptofuzz::module::decred_uint256>() );
758
#endif
759
760
#if defined(CRYPTOFUZZ_LIBDIVIDE)
761
    driver->LoadModule( std::make_shared<cryptofuzz::module::libdivide>() );
762
#endif
763
764
#if defined(CRYPTOFUZZ_RUST_UINT)
765
    driver->LoadModule( std::make_shared<cryptofuzz::module::rust_uint>() );
766
#endif
767
768
#if defined(CRYPTOFUZZ_BC)
769
    driver->LoadModule( std::make_shared<cryptofuzz::module::bc>() );
770
#endif
771
772
#if defined(CRYPTOFUZZ_JAVA)
773
    driver->LoadModule( std::make_shared<cryptofuzz::module::Java>() );
774
#endif
775
776
#if defined(CRYPTOFUZZ_SOLIDITY_MATH)
777
    driver->LoadModule( std::make_shared<cryptofuzz::module::SolidityMath>() );
778
#endif
779
780
#if defined(CRYPTOFUZZ_V8)
781
    driver->LoadModule( std::make_shared<cryptofuzz::module::V8>() );
782
#endif
783
784
#if defined(CRYPTOFUZZ_CIRCL)
785
    driver->LoadModule( std::make_shared<cryptofuzz::module::circl>() );
786
#endif
787
788
#if defined(CRYPTOFUZZ_SPL_MATH)
789
    driver->LoadModule( std::make_shared<cryptofuzz::module::spl_math>() );
790
#endif
791
792
#if defined(CRYPTOFUZZ_ZIG)
793
    driver->LoadModule( std::make_shared<cryptofuzz::module::Zig>() );
794
#endif
795
796
#if defined(CRYPTOFUZZ_PRYSMATICLABS_HASHTREE)
797
    driver->LoadModule( std::make_shared<cryptofuzz::module::prysmaticlabs_hashtree>() );
798
#endif
799
800
#if defined(CRYPTOFUZZ_STARKWARE)
801
    driver->LoadModule( std::make_shared<cryptofuzz::module::Starkware>() );
802
#endif
803
804
#if defined(CRYPTOFUZZ_PORNIN_BINGCD)
805
    driver->LoadModule( std::make_shared<cryptofuzz::module::Pornin_BinGCD>() );
806
#endif
807
808
#if defined(CRYPTOFUZZ_STINT)
809
    driver->LoadModule( std::make_shared<cryptofuzz::module::stint>() );
810
#endif
811
812
#if defined(CRYPTOFUZZ_KRYPTOLOGY)
813
    driver->LoadModule( std::make_shared<cryptofuzz::module::Kryptology>() );
814
#endif
815
816
#if defined(CRYPTOFUZZ_NIM_BIGINTS)
817
    driver->LoadModule( std::make_shared<cryptofuzz::module::nim_bigints>() );
818
#endif
819
820
#if defined(CRYPTOFUZZ_HOLIMAN_UINT256)
821
    driver->LoadModule( std::make_shared<cryptofuzz::module::holiman_uint256>() );
822
#endif
823
824
#if defined(CRYPTOFUZZ_CPU)
825
    driver->LoadModule( std::make_shared<cryptofuzz::module::CPU>() );
826
#endif
827
828
#if defined(CRYPTOFUZZ_GETH)
829
    driver->LoadModule( std::make_shared<cryptofuzz::module::Geth>() );
830
#endif
831
832
#if defined(CRYPTOFUZZ_JSBN)
833
    driver->LoadModule( std::make_shared<cryptofuzz::module::jsbn>() );
834
#endif
835
836
#if defined(CRYPTOFUZZ_WIDE_INTEGER)
837
    driver->LoadModule( std::make_shared<cryptofuzz::module::wide_integer>() );
838
#endif
839
840
#if defined(CRYPTOFUZZ_TINY_KECCAK)
841
    driver->LoadModule( std::make_shared<cryptofuzz::module::tiny_keccak>() );
842
#endif
843
844
#if defined(CRYPTOFUZZ_ARKWORKS_ALGEBRA)
845
    driver->LoadModule( std::make_shared<cryptofuzz::module::arkworks_algebra>() );
846
#endif
847
848
#if defined(CRYPTOFUZZ_FF)
849
    driver->LoadModule( std::make_shared<cryptofuzz::module::ff>() );
850
#endif
851
852
#if defined(CRYPTOFUZZ_ALEO)
853
    driver->LoadModule( std::make_shared<cryptofuzz::module::Aleo>() );
854
#endif
855
856
#if defined(CRYPTOFUZZ_SHAMATAR)
857
    driver->LoadModule( std::make_shared<cryptofuzz::module::Shamatar>() );
858
#endif
859
860
#if defined(CRYPTOFUZZ_MICROSOFT_CALCULATOR)
861
    driver->LoadModule( std::make_shared<cryptofuzz::module::MicrosoftCalculator>() );
862
#endif
863
864
    /* TODO check if options.forceModule (if set) refers to a module that is
865
     * actually loaded, warn otherwise.
866
     */
867
2
    return 0;
868
2
}
869
870
8.29k
extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
871
8.29k
    driver->Run(data, size);
872
873
8.29k
    return 0;
874
8.29k
}