File tree Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change 4
4
5
5
#include < crypto/hmac_sha256.h>
6
6
#include < crypto/hmac_sha512.h>
7
+ #include < crypto/muhash.h>
7
8
#include < crypto/ripemd160.h>
8
9
#include < crypto/sha1.h>
9
10
#include < crypto/sha256.h>
@@ -35,6 +36,7 @@ FUZZ_TARGET(crypto)
35
36
CSHA512 sha512;
36
37
SHA3_256 sha3;
37
38
CSipHasher sip_hasher{fuzzed_data_provider.ConsumeIntegral <uint64_t >(), fuzzed_data_provider.ConsumeIntegral <uint64_t >()};
39
+ MuHash3072 muhash;
38
40
39
41
while (fuzzed_data_provider.ConsumeBool ()) {
40
42
switch (fuzzed_data_provider.ConsumeIntegralInRange <int >(0 , 2 )) {
@@ -60,6 +62,12 @@ FUZZ_TARGET(crypto)
60
62
(void )Hash (data);
61
63
(void )Hash160 (data);
62
64
(void )sha512.Size ();
65
+
66
+ if (fuzzed_data_provider.ConsumeBool ()) {
67
+ muhash *= MuHash3072 (data);
68
+ } else {
69
+ muhash /= MuHash3072 (data);
70
+ }
63
71
break ;
64
72
}
65
73
case 1 : {
@@ -70,10 +78,11 @@ FUZZ_TARGET(crypto)
70
78
(void )sha256.Reset ();
71
79
(void )sha3.Reset ();
72
80
(void )sha512.Reset ();
81
+ muhash = MuHash3072 ();
73
82
break ;
74
83
}
75
84
case 2 : {
76
- switch (fuzzed_data_provider.ConsumeIntegralInRange <int >(0 , 9 )) {
85
+ switch (fuzzed_data_provider.ConsumeIntegralInRange <int >(0 , 10 )) {
77
86
case 0 : {
78
87
data.resize (CHash160::OUTPUT_SIZE);
79
88
hash160.Finalize (data);
@@ -124,6 +133,11 @@ FUZZ_TARGET(crypto)
124
133
sha3.Finalize (data);
125
134
break ;
126
135
}
136
+ case 10 : {
137
+ uint256 out;
138
+ muhash.Finalize (out);
139
+ break ;
140
+ }
127
141
}
128
142
break ;
129
143
}
You can’t perform that action at this time.
0 commit comments