-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdriver.cpp
More file actions
726 lines (711 loc) · 33.2 KB
/
driver.cpp
File metadata and controls
726 lines (711 loc) · 33.2 KB
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
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
#include "driver.h"
#include <fuzzing/datasource/id.hpp>
#include "tests.h"
#include "executor.h"
#include <cryptofuzz/util.h>
#include <set>
#include <algorithm>
#include <unistd.h>
#include "mutatorpool.h"
namespace cryptofuzz {
void Driver::LoadModule(std::shared_ptr<Module> module) {
modules[module->ID] = module;
}
void Driver::Run(const uint8_t* data, const size_t size) const {
using fuzzing::datasource::ID;
/* Calculate the number of inputs */
mt1.lock();
FILE* fp = fopen("runningCount.txt", "a");
fprintf(fp, "1");
fclose(fp);
mt1.unlock();
static ExecutorDigest executorDigest(CF_OPERATION("Digest"), modules, options);
static ExecutorHMAC executorHMAC(CF_OPERATION("HMAC"), modules, options);
static ExecutorCMAC executorCMAC(CF_OPERATION("CMAC"), modules, options);
static ExecutorSymmetricEncrypt executorSymmetricEncrypt(CF_OPERATION("SymmetricEncrypt"), modules, options);
static ExecutorSymmetricDecrypt executorSymmetricDecrypt(CF_OPERATION("SymmetricDecrypt"), modules, options);
static ExecutorKDF_SCRYPT executorKDF_SCRYPT(CF_OPERATION("KDF_SCRYPT"), modules, options);
static ExecutorKDF_HKDF executorKDF_HKDF(CF_OPERATION("KDF_HKDF"), modules, options);
static ExecutorKDF_TLS1_PRF executorKDF_TLS1_PRF(CF_OPERATION("KDF_TLS1_PRF"), modules, options);
static ExecutorKDF_PBKDF executorKDF_PBKDF(CF_OPERATION("KDF_PBKDF"), modules, options);
static ExecutorKDF_PBKDF1 executorKDF_PBKDF1(CF_OPERATION("KDF_PBKDF1"), modules, options);
static ExecutorKDF_PBKDF2 executorKDF_PBKDF2(CF_OPERATION("KDF_PBKDF2"), modules, options);
static ExecutorKDF_ARGON2 executorKDF_ARGON2(CF_OPERATION("KDF_ARGON2"), modules, options);
static ExecutorKDF_SSH executorKDF_SSH(ID("Cryptofuzz/Operation/KDF_SSH"), modules, options);
static ExecutorKDF_X963 executorKDF_X963(CF_OPERATION("KDF_X963"), modules, options);
static ExecutorKDF_BCRYPT executorKDF_BCRYPT(CF_OPERATION("KDF_BCRYPT"), modules, options);
static ExecutorKDF_SP_800_108 executorKDF_SP_800_108(CF_OPERATION("KDF_SP_800_108"), modules, options);
static ExecutorECC_PrivateToPublic executorECC_PrivateToPublic(CF_OPERATION("ECC_PrivateToPublic"), modules, options);
static ExecutorECC_ValidatePubkey executorECC_ValidatePubkey(CF_OPERATION("ECC_ValidatePubkey"), modules, options);
static ExecutorECC_GenerateKeyPair executorECC_GenerateKeyPair(CF_OPERATION("ECC_GenerateKeyPair"), modules, options);
static ExecutorECDSA_Sign executorECDSA_Sign(CF_OPERATION("ECDSA_Sign"), modules, options);
static ExecutorECGDSA_Sign executorECGDSA_Sign(CF_OPERATION("ECGDSA_Sign"), modules, options);
static ExecutorECRDSA_Sign executorECRDSA_Sign(CF_OPERATION("ECRDSA_Sign"), modules, options);
static ExecutorSchnorr_Sign executorSchnorr_Sign(CF_OPERATION("Schnorr_Sign"), modules, options);
static ExecutorECDSA_Verify executorECDSA_Verify(CF_OPERATION("ECDSA_Verify"), modules, options);
static ExecutorECGDSA_Verify executorECGDSA_Verify(CF_OPERATION("ECGDSA_Verify"), modules, options);
static ExecutorECRDSA_Verify executorECRDSA_Verify(CF_OPERATION("ECRDSA_Verify"), modules, options);
static ExecutorSchnorr_Verify executorSchnorr_Verify(CF_OPERATION("Schnorr_Verify"), modules, options);
static ExecutorECDSA_Recover executorECDSA_Recover(CF_OPERATION("ECDSA_Recover"), modules, options);
static ExecutorECDH_Derive executorECDH_Derive(CF_OPERATION("ECDH_Derive"), modules, options);
static ExecutorECIES_Encrypt executorECIES_Encrypt(CF_OPERATION("ECIES_Encrypt"), modules, options);
static ExecutorECIES_Decrypt executorECIES_Decrypt(CF_OPERATION("ECIES_Decrypt"), modules, options);
static ExecutorECC_Point_Add executorECC_Point_Add(CF_OPERATION("ECC_Point_Add"), modules, options);
static ExecutorECC_Point_Mul executorECC_Point_Mul(CF_OPERATION("ECC_Point_Mul"), modules, options);
static ExecutorDH_GenerateKeyPair executorDH_GenerateKeyPair(CF_OPERATION("DH_GenerateKeyPair"), modules, options);
static ExecutorDH_Derive executorDH_Derive(CF_OPERATION("DH_Derive"), modules, options);
static ExecutorBignumCalc executorBignumCalc(CF_OPERATION("BignumCalc"), modules, options);
static ExecutorBignumCalc_Mod_BLS12_381_R executorBignumCalc_mod_bls12_381_r(CF_OPERATION("BignumCalc_Mod_BLS12_381_R"), modules, options);
static ExecutorBignumCalc_Mod_BLS12_381_P executorBignumCalc_mod_bls12_381_p(CF_OPERATION("BignumCalc_Mod_BLS12_381_P"), modules, options);
static ExecutorBignumCalc_Mod_2Exp256 executorBignumCalc_mod_2exp256(CF_OPERATION("BignumCalc_Mod_2Exp256"), modules, options);
static ExecutorBignumCalc_Mod_SECP256K1 executorBignumCalc_mod_secp256k1(CF_OPERATION("BignumCalc_Mod_SECP256K1"), modules, options);
static ExecutorBLS_PrivateToPublic executorBLS_PrivateToPublic(CF_OPERATION("BLS_PrivateToPublic"), modules, options);
static ExecutorBLS_PrivateToPublic_G2 executorBLS_PrivateToPublic_G2(CF_OPERATION("BLS_PrivateToPublic_G2"), modules, options);
static ExecutorBLS_Sign executorBLS_Sign(CF_OPERATION("BLS_Sign"), modules, options);
static ExecutorBLS_Verify executorBLS_Verify(CF_OPERATION("BLS_Verify"), modules, options);
static ExecutorBLS_Aggregate_G1 executorBLS_Aggregate_G1(CF_OPERATION("BLS_Aggregate_G1"), modules, options);
static ExecutorBLS_Aggregate_G2 executorBLS_Aggregate_G2(CF_OPERATION("BLS_Aggregate_G2"), modules, options);
static ExecutorBLS_Pairing executorBLS_Pairing(CF_OPERATION("BLS_Pairing"), modules, options);
static ExecutorBLS_HashToG1 executorBLS_HashToG1(CF_OPERATION("BLS_HashToG1"), modules, options);
static ExecutorBLS_HashToG2 executorBLS_HashToG2(CF_OPERATION("BLS_HashToG2"), modules, options);
static ExecutorBLS_IsG1OnCurve executorBLS_IsG1OnCurve(CF_OPERATION("BLS_IsG1OnCurve"), modules, options);
static ExecutorBLS_IsG2OnCurve executorBLS_IsG2OnCurve(CF_OPERATION("BLS_IsG2OnCurve"), modules, options);
static ExecutorBLS_GenerateKeyPair executorBLS_GenerateKeyPair(CF_OPERATION("BLS_GenerateKeyPair"), modules, options);
static ExecutorBLS_Decompress_G1 executorBLS_Decompress_G1(CF_OPERATION("BLS_Decompress_G1"), modules, options);
static ExecutorBLS_Compress_G1 executorBLS_Compress_G1(CF_OPERATION("BLS_Compress_G1"), modules, options);
static ExecutorBLS_Decompress_G2 executorBLS_Decompress_G2(CF_OPERATION("BLS_Decompress_G2"), modules, options);
static ExecutorBLS_Compress_G2 executorBLS_Compress_G2(CF_OPERATION("BLS_Compress_G2"), modules, options);
static ExecutorBLS_G1_Add executorBLS_G1_Add(CF_OPERATION("BLS_G1_Add"), modules, options);
static ExecutorBLS_G1_Mul executorBLS_G1_Mul(CF_OPERATION("BLS_G1_Mul"), modules, options);
static ExecutorBLS_G1_IsEq executorBLS_G1_IsEq(CF_OPERATION("BLS_G1_IsEq"), modules, options);
static ExecutorBLS_G1_Neg executorBLS_G1_Neg(CF_OPERATION("BLS_G1_Neg"), modules, options);
static ExecutorBLS_G2_Add executorBLS_G2_Add(CF_OPERATION("BLS_G2_Add"), modules, options);
static ExecutorBLS_G2_Mul executorBLS_G2_Mul(CF_OPERATION("BLS_G2_Mul"), modules, options);
static ExecutorBLS_G2_IsEq executorBLS_G2_IsEq(CF_OPERATION("BLS_G2_IsEq"), modules, options);
static ExecutorBLS_G2_Neg executorBLS_G2_Neg(CF_OPERATION("BLS_G2_Neg"), modules, options);
static ExecutorMisc executorMisc(CF_OPERATION("Misc"), modules, options);
static ExecutorSR25519_Verify executorSR25519_Verify(CF_OPERATION("SR25519_Verify"), modules, options);
try {
Datasource ds(data, size);
auto operation = ds.Get<uint64_t>();
// auto operation = CF_OPERATION("HMAC");
/* Reset operation id */
// switch ( origin_op % 66 ) {
// case 0:
// operation = CF_OPERATION("Digest");
// break;
// case 1:
// operation = CF_OPERATION("HMAC");
// break;
// case 2:
// operation = CF_OPERATION("CMAC");
// break;
// case 3:
// operation = CF_OPERATION("SymmetricEncrypt");
// break;
// case 4:
// operation = CF_OPERATION("SymmetricDecrypt");
// break;
// case 5:
// operation = CF_OPERATION("KDF_SCRYPT");
// break;
// case 6:
// operation = CF_OPERATION("KDF_HKDF");
// break;
// case 7:
// operation = CF_OPERATION("KDF_TLS1_PRF");
// break;
// case 8:
// operation = CF_OPERATION("KDF_PBKDF");
// break;
// case 9:
// operation = CF_OPERATION("KDF_PBKDF1");
// break;
// case 10:
// operation = CF_OPERATION("KDF_PBKDF2");
// break;
// case 11:
// operation = CF_OPERATION("KDF_ARGON2");
// break;
// case 12:
// operation = CF_OPERATION("KDF_SSH");
// break;
// case 13:
// operation = CF_OPERATION("KDF_X963");
// break;
// case 14:
// operation = CF_OPERATION("KDF_BCRYPT");
// break;
// case 15:
// operation = CF_OPERATION("KDF_SP_800_108");
// break;
// case 16:
// operation = CF_OPERATION("ECC_PrivateToPublic");
// break;
// case 17:
// operation = CF_OPERATION("ECC_ValidatePubkey");
// break;
// case 18:
// operation = CF_OPERATION("ECC_GenerateKeyPair");
// break;
// case 19:
// operation = CF_OPERATION("ECDSA_Sign");
// break;
// case 20:
// operation = CF_OPERATION("ECGDSA_Sign");
// break;
// case 21:
// operation = CF_OPERATION("ECRDSA_Sign");
// break;
// case 22:
// operation = CF_OPERATION("Schnorr_Sign");
// break;
// case 23:
// operation = CF_OPERATION("ECDSA_Verify");
// break;
// case 24:
// operation = CF_OPERATION("ECGDSA_Verify");
// break;
// case 25:
// operation = CF_OPERATION("ECRDSA_Verify");
// break;
// case 26:
// operation = CF_OPERATION("Schnorr_Verify");
// break;
// case 27:
// operation = CF_OPERATION("ECDSA_Recover");
// break;
// case 28:
// operation = CF_OPERATION("ECDH_Derive");
// break;
// case 29:
// operation = CF_OPERATION("ECIES_Encrypt");
// break;
// case 30:
// operation = CF_OPERATION("ECIES_Decrypt");
// break;
// case 31:
// operation = CF_OPERATION("ECC_Point_Add");
// break;
// case 32:
// operation = CF_OPERATION("ECC_Point_Mul");
// break;
// case 33:
// operation = CF_OPERATION("DH_GenerateKeyPair");
// break;
// case 34:
// operation = CF_OPERATION("DH_Derive");
// break;
// case 35:
// operation = CF_OPERATION("BignumCalc");
// break;
// case 36:
// operation = CF_OPERATION("BignumCalc_Mod_BLS12_381_R");
// break;
// case 37:
// operation = CF_OPERATION("BignumCalc_Mod_BLS12_381_P");
// break;
// case 38:
// operation = CF_OPERATION("BignumCalc_Mod_2Exp256");
// break;
// case 39:
// operation = CF_OPERATION("BignumCalc_Mod_SECP256K1");
// break;
// case 40:
// operation = CF_OPERATION("BLS_PrivateToPublic");
// break;
// case 41:
// operation = CF_OPERATION("BLS_PrivateToPublic_G2");
// break;
// case 42:
// operation = CF_OPERATION("BLS_Sign");
// break;
// case 43:
// operation = CF_OPERATION("BLS_Verify");
// break;
// case 44:
// operation = CF_OPERATION("BLS_Aggregate_G1");
// break;
// case 45:
// operation = CF_OPERATION("BLS_Aggregate_G2");
// break;
// case 46:
// operation = CF_OPERATION("BLS_Pairing");
// break;
// case 47:
// operation = CF_OPERATION("BLS_HashToG1");
// break;
// case 48:
// operation = CF_OPERATION("BLS_HashToG2");
// break;
// case 49:
// operation = CF_OPERATION("BLS_IsG1OnCurve");
// break;
// case 50:
// operation = CF_OPERATION("BLS_IsG2OnCurve");
// break;
// case 51:
// operation = CF_OPERATION("BLS_GenerateKeyPair");
// break;
// case 52:
// operation = CF_OPERATION("BLS_Decompress_G1");
// break;
// case 53:
// operation = CF_OPERATION("BLS_Compress_G1");
// break;
// case 54:
// operation = CF_OPERATION("BLS_Decompress_G2");
// break;
// case 55:
// operation = CF_OPERATION("BLS_Compress_G2");
// break;
// case 56:
// operation = CF_OPERATION("BLS_G1_Add");
// break;
// case 57:
// operation = CF_OPERATION("BLS_G1_Mul");
// break;
// case 58:
// operation = CF_OPERATION("BLS_G1_IsEq");
// break;
// case 59:
// operation = CF_OPERATION("BLS_G1_Neg");
// break;
// case 60:
// operation = CF_OPERATION("BLS_G2_Add");
// break;
// case 61:
// operation = CF_OPERATION("BLS_G2_Mul");
// break;
// case 62:
// operation = CF_OPERATION("BLS_G2_IsEq");
// break;
// case 63:
// operation = CF_OPERATION("BLS_G2_Neg");
// break;
// case 64:
// operation = CF_OPERATION("Misc");
// break;
// case 65:
// operation = CF_OPERATION("SR25519_Verify");
// break;
// }
/* end of operation reset */
if ( !options.operations.Have(operation) ) {
printf("------------None exists operation---------------\n");
return;
}
const auto payload = ds.GetData(0, 1);
switch ( operation ) {
case CF_OPERATION("Digest"):
executorDigest.Run(ds, payload.data(), payload.size());
break;
case CF_OPERATION("HMAC"):
executorHMAC.Run(ds, payload.data(), payload.size());
break;
case CF_OPERATION("CMAC"):
executorCMAC.Run(ds, payload.data(), payload.size());
break;
case CF_OPERATION("SymmetricEncrypt"):
executorSymmetricEncrypt.Run(ds, payload.data(), payload.size());
break;
case CF_OPERATION("SymmetricDecrypt"):
executorSymmetricDecrypt.Run(ds, payload.data(), payload.size());
break;
case CF_OPERATION("KDF_SCRYPT"):
executorKDF_SCRYPT.Run(ds, payload.data(), payload.size());
break;
case CF_OPERATION("KDF_HKDF"):
executorKDF_HKDF.Run(ds, payload.data(), payload.size());
break;
case CF_OPERATION("KDF_TLS1_PRF"):
executorKDF_TLS1_PRF.Run(ds, payload.data(), payload.size());
break;
case CF_OPERATION("KDF_PBKDF"):
executorKDF_PBKDF.Run(ds, payload.data(), payload.size());
break;
case CF_OPERATION("KDF_PBKDF1"):
executorKDF_PBKDF1.Run(ds, payload.data(), payload.size());
break;
case CF_OPERATION("KDF_PBKDF2"):
executorKDF_PBKDF2.Run(ds, payload.data(), payload.size());
break;
case CF_OPERATION("KDF_ARGON2"):
executorKDF_ARGON2.Run(ds, payload.data(), payload.size());
break;
case CF_OPERATION("KDF_SSH"):
executorKDF_SSH.Run(ds, payload.data(), payload.size());
break;
case CF_OPERATION("KDF_X963"):
executorKDF_X963.Run(ds, payload.data(), payload.size());
break;
case CF_OPERATION("KDF_BCRYPT"):
executorKDF_BCRYPT.Run(ds, payload.data(), payload.size());
break;
case CF_OPERATION("KDF_SP_800_108"):
executorKDF_SP_800_108.Run(ds, payload.data(), payload.size());
break;
case CF_OPERATION("ECC_PrivateToPublic"):
executorECC_PrivateToPublic.Run(ds, payload.data(), payload.size());
break;
case CF_OPERATION("ECC_ValidatePubkey"):
executorECC_ValidatePubkey.Run(ds, payload.data(), payload.size());
break;
case CF_OPERATION("ECC_GenerateKeyPair"):
executorECC_GenerateKeyPair.Run(ds, payload.data(), payload.size());
break;
case CF_OPERATION("ECDSA_Sign"):
executorECDSA_Sign.Run(ds, payload.data(), payload.size());
break;
case CF_OPERATION("ECGDSA_Sign"):
executorECGDSA_Sign.Run(ds, payload.data(), payload.size());
break;
case CF_OPERATION("ECRDSA_Sign"):
executorECRDSA_Sign.Run(ds, payload.data(), payload.size());
break;
case CF_OPERATION("Schnorr_Sign"):
executorSchnorr_Sign.Run(ds, payload.data(), payload.size());
break;
case CF_OPERATION("ECDSA_Verify"):
executorECDSA_Verify.Run(ds, payload.data(), payload.size());
break;
case CF_OPERATION("ECGDSA_Verify"):
executorECGDSA_Verify.Run(ds, payload.data(), payload.size());
break;
case CF_OPERATION("ECRDSA_Verify"):
executorECRDSA_Verify.Run(ds, payload.data(), payload.size());
break;
case CF_OPERATION("Schnorr_Verify"):
executorSchnorr_Verify.Run(ds, payload.data(), payload.size());
break;
case CF_OPERATION("ECDSA_Recover"):
executorECDSA_Recover.Run(ds, payload.data(), payload.size());
break;
case CF_OPERATION("ECDH_Derive"):
executorECDH_Derive.Run(ds, payload.data(), payload.size());
break;
case CF_OPERATION("ECIES_Encrypt"):
executorECIES_Encrypt.Run(ds, payload.data(), payload.size());
break;
case CF_OPERATION("ECIES_Decrypt"):
executorECIES_Decrypt.Run(ds, payload.data(), payload.size());
break;
case CF_OPERATION("ECC_Point_Add"):
executorECC_Point_Add.Run(ds, payload.data(), payload.size());
break;
case CF_OPERATION("ECC_Point_Mul"):
executorECC_Point_Mul.Run(ds, payload.data(), payload.size());
break;
case CF_OPERATION("DH_GenerateKeyPair"):
executorDH_GenerateKeyPair.Run(ds, payload.data(), payload.size());
break;
case CF_OPERATION("DH_Derive"):
executorDH_Derive.Run(ds, payload.data(), payload.size());
break;
case CF_OPERATION("BignumCalc"):
executorBignumCalc.Run(ds, payload.data(), payload.size());
break;
case CF_OPERATION("BignumCalc_Mod_BLS12_381_R"):
executorBignumCalc_mod_bls12_381_r.Run(ds, payload.data(), payload.size());
break;
case CF_OPERATION("BignumCalc_Mod_BLS12_381_P"):
executorBignumCalc_mod_bls12_381_p.Run(ds, payload.data(), payload.size());
break;
case CF_OPERATION("BignumCalc_Mod_2Exp256"):
executorBignumCalc_mod_2exp256.Run(ds, payload.data(), payload.size());
break;
case CF_OPERATION("BignumCalc_Mod_SECP256K1"):
executorBignumCalc_mod_secp256k1.Run(ds, payload.data(), payload.size());
break;
case CF_OPERATION("BLS_PrivateToPublic"):
executorBLS_PrivateToPublic.Run(ds, payload.data(), payload.size());
break;
case CF_OPERATION("BLS_PrivateToPublic_G2"):
executorBLS_PrivateToPublic_G2.Run(ds, payload.data(), payload.size());
break;
case CF_OPERATION("BLS_Sign"):
executorBLS_Sign.Run(ds, payload.data(), payload.size());
break;
case CF_OPERATION("BLS_Verify"):
executorBLS_Verify.Run(ds, payload.data(), payload.size());
break;
case CF_OPERATION("BLS_Aggregate_G1"):
executorBLS_Aggregate_G1.Run(ds, payload.data(), payload.size());
break;
case CF_OPERATION("BLS_Aggregate_G2"):
executorBLS_Aggregate_G2.Run(ds, payload.data(), payload.size());
break;
case CF_OPERATION("BLS_Pairing"):
executorBLS_Pairing.Run(ds, payload.data(), payload.size());
break;
case CF_OPERATION("BLS_HashToG1"):
executorBLS_HashToG1.Run(ds, payload.data(), payload.size());
break;
case CF_OPERATION("BLS_HashToG2"):
executorBLS_HashToG2.Run(ds, payload.data(), payload.size());
break;
case CF_OPERATION("BLS_IsG1OnCurve"):
executorBLS_IsG1OnCurve.Run(ds, payload.data(), payload.size());
break;
case CF_OPERATION("BLS_IsG2OnCurve"):
executorBLS_IsG2OnCurve.Run(ds, payload.data(), payload.size());
break;
case CF_OPERATION("BLS_GenerateKeyPair"):
executorBLS_GenerateKeyPair.Run(ds, payload.data(), payload.size());
break;
case CF_OPERATION("BLS_Decompress_G1"):
executorBLS_Decompress_G1.Run(ds, payload.data(), payload.size());
break;
case CF_OPERATION("BLS_Compress_G1"):
executorBLS_Compress_G1.Run(ds, payload.data(), payload.size());
break;
case CF_OPERATION("BLS_Decompress_G2"):
executorBLS_Decompress_G2.Run(ds, payload.data(), payload.size());
break;
case CF_OPERATION("BLS_Compress_G2"):
executorBLS_Compress_G2.Run(ds, payload.data(), payload.size());
break;
case CF_OPERATION("BLS_G1_Add"):
executorBLS_G1_Add.Run(ds, payload.data(), payload.size());
break;
case CF_OPERATION("BLS_G1_Mul"):
executorBLS_G1_Mul.Run(ds, payload.data(), payload.size());
break;
case CF_OPERATION("BLS_G1_IsEq"):
executorBLS_G1_IsEq.Run(ds, payload.data(), payload.size());
break;
case CF_OPERATION("BLS_G1_Neg"):
executorBLS_G1_Neg.Run(ds, payload.data(), payload.size());
break;
case CF_OPERATION("BLS_G2_Add"):
executorBLS_G2_Add.Run(ds, payload.data(), payload.size());
break;
case CF_OPERATION("BLS_G2_Mul"):
executorBLS_G2_Mul.Run(ds, payload.data(), payload.size());
break;
case CF_OPERATION("BLS_G2_IsEq"):
executorBLS_G2_IsEq.Run(ds, payload.data(), payload.size());
break;
case CF_OPERATION("BLS_G2_Neg"):
executorBLS_G2_Neg.Run(ds, payload.data(), payload.size());
break;
case CF_OPERATION("Misc"):
executorMisc.Run(ds, payload.data(), payload.size());
break;
case CF_OPERATION("SR25519_Verify"):
executorSR25519_Verify.Run(ds, payload.data(), payload.size());
break;
default:{
/*reset op id*/
switch ( operation % 66 ) {
case 0:
operation = CF_OPERATION("Digest");
break;
case 1:
operation = CF_OPERATION("HMAC");
break;
case 2:
operation = CF_OPERATION("CMAC");
break;
case 3:
operation = CF_OPERATION("SymmetricEncrypt");
break;
case 4:
operation = CF_OPERATION("SymmetricDecrypt");
break;
case 5:
operation = CF_OPERATION("KDF_SCRYPT");
break;
case 6:
operation = CF_OPERATION("KDF_HKDF");
break;
case 7:
operation = CF_OPERATION("KDF_TLS1_PRF");
break;
case 8:
operation = CF_OPERATION("KDF_PBKDF");
break;
case 9:
operation = CF_OPERATION("KDF_PBKDF1");
break;
case 10:
operation = CF_OPERATION("KDF_PBKDF2");
break;
case 11:
operation = CF_OPERATION("KDF_ARGON2");
break;
case 12:
operation = CF_OPERATION("KDF_SSH");
break;
case 13:
operation = CF_OPERATION("KDF_X963");
break;
case 14:
operation = CF_OPERATION("KDF_BCRYPT");
break;
case 15:
operation = CF_OPERATION("KDF_SP_800_108");
break;
case 16:
operation = CF_OPERATION("ECC_PrivateToPublic");
break;
case 17:
operation = CF_OPERATION("ECC_ValidatePubkey");
break;
case 18:
operation = CF_OPERATION("ECC_GenerateKeyPair");
break;
case 19:
operation = CF_OPERATION("ECDSA_Sign");
break;
case 20:
operation = CF_OPERATION("ECGDSA_Sign");
break;
case 21:
operation = CF_OPERATION("ECRDSA_Sign");
break;
case 22:
operation = CF_OPERATION("Schnorr_Sign");
break;
case 23:
operation = CF_OPERATION("ECDSA_Verify");
break;
case 24:
operation = CF_OPERATION("ECGDSA_Verify");
break;
case 25:
operation = CF_OPERATION("ECRDSA_Verify");
break;
case 26:
operation = CF_OPERATION("Schnorr_Verify");
break;
case 27:
operation = CF_OPERATION("ECDSA_Recover");
break;
case 28:
operation = CF_OPERATION("ECDH_Derive");
break;
case 29:
operation = CF_OPERATION("ECIES_Encrypt");
break;
case 30:
operation = CF_OPERATION("ECIES_Decrypt");
break;
case 31:
operation = CF_OPERATION("ECC_Point_Add");
break;
case 32:
operation = CF_OPERATION("ECC_Point_Mul");
break;
case 33:
operation = CF_OPERATION("DH_GenerateKeyPair");
break;
case 34:
operation = CF_OPERATION("DH_Derive");
break;
case 35:
operation = CF_OPERATION("BignumCalc");
break;
case 36:
operation = CF_OPERATION("BignumCalc_Mod_BLS12_381_R");
break;
case 37:
operation = CF_OPERATION("BignumCalc_Mod_BLS12_381_P");
break;
case 38:
operation = CF_OPERATION("BignumCalc_Mod_2Exp256");
break;
case 39:
operation = CF_OPERATION("BignumCalc_Mod_SECP256K1");
break;
case 40:
operation = CF_OPERATION("BLS_PrivateToPublic");
break;
case 41:
operation = CF_OPERATION("BLS_PrivateToPublic_G2");
break;
case 42:
operation = CF_OPERATION("BLS_Sign");
break;
case 43:
operation = CF_OPERATION("BLS_Verify");
break;
case 44:
operation = CF_OPERATION("BLS_Aggregate_G1");
break;
case 45:
operation = CF_OPERATION("BLS_Aggregate_G2");
break;
case 46:
operation = CF_OPERATION("BLS_Pairing");
break;
case 47:
operation = CF_OPERATION("BLS_HashToG1");
break;
case 48:
operation = CF_OPERATION("BLS_HashToG2");
break;
case 49:
operation = CF_OPERATION("BLS_IsG1OnCurve");
break;
case 50:
operation = CF_OPERATION("BLS_IsG2OnCurve");
break;
case 51:
operation = CF_OPERATION("BLS_GenerateKeyPair");
break;
case 52:
operation = CF_OPERATION("BLS_Decompress_G1");
break;
case 53:
operation = CF_OPERATION("BLS_Compress_G1");
break;
case 54:
operation = CF_OPERATION("BLS_Decompress_G2");
break;
case 55:
operation = CF_OPERATION("BLS_Compress_G2");
break;
case 56:
operation = CF_OPERATION("BLS_G1_Add");
break;
case 57:
operation = CF_OPERATION("BLS_G1_Mul");
break;
case 58:
operation = CF_OPERATION("BLS_G1_IsEq");
break;
case 59:
operation = CF_OPERATION("BLS_G1_Neg");
break;
case 60:
operation = CF_OPERATION("BLS_G2_Add");
break;
case 61:
operation = CF_OPERATION("BLS_G2_Mul");
break;
case 62:
operation = CF_OPERATION("BLS_G2_IsEq");
break;
case 63:
operation = CF_OPERATION("BLS_G2_Neg");
break;
case 64:
operation = CF_OPERATION("Misc");
break;
case 65:
operation = CF_OPERATION("SR25519_Verify");
break;
}
}break;
}
} catch ( Datasource::OutOfData ) {
}
};
Driver::Driver(const Options options) :
options(options)
{ }
const Options* Driver::GetOptionsPtr(void) const {
return &options;
}
} /* namespace cryptofuzz */