File tree Expand file tree Collapse file tree 2 files changed +10
-13
lines changed Expand file tree Collapse file tree 2 files changed +10
-13
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>
8
7
#include < crypto/ripemd160.h>
9
8
#include < crypto/sha1.h>
10
9
#include < crypto/sha256.h>
@@ -40,7 +39,6 @@ FUZZ_TARGET(crypto)
40
39
CSHA512 sha512;
41
40
SHA3_256 sha3;
42
41
CSipHasher sip_hasher{fuzzed_data_provider.ConsumeIntegral <uint64_t >(), fuzzed_data_provider.ConsumeIntegral <uint64_t >()};
43
- MuHash3072 muhash;
44
42
45
43
while (--limit_max_ops >= 0 && fuzzed_data_provider.ConsumeBool ()) {
46
44
CallOneOf (
@@ -67,12 +65,6 @@ FUZZ_TARGET(crypto)
67
65
(void )Hash160 (data);
68
66
(void )Hash160 (data.begin (), data.end ());
69
67
(void )sha512.Size ();
70
-
71
- if (fuzzed_data_provider.ConsumeBool ()) {
72
- muhash *= MuHash3072 (data);
73
- } else {
74
- muhash /= MuHash3072 (data);
75
- }
76
68
},
77
69
[&] {
78
70
(void )hash160.Reset ();
@@ -82,7 +74,6 @@ FUZZ_TARGET(crypto)
82
74
(void )sha256.Reset ();
83
75
(void )sha3.Reset ();
84
76
(void )sha512.Reset ();
85
- muhash = MuHash3072 ();
86
77
},
87
78
[&] {
88
79
CallOneOf (
@@ -126,10 +117,6 @@ FUZZ_TARGET(crypto)
126
117
[&] {
127
118
data.resize (SHA3_256::OUTPUT_SIZE);
128
119
sha3.Finalize (data);
129
- },
130
- [&] {
131
- uint256 out;
132
- muhash.Finalize (out);
133
120
});
134
121
});
135
122
}
Original file line number Diff line number Diff line change @@ -41,6 +41,11 @@ FUZZ_TARGET(muhash)
41
41
muhash.Finalize (out2);
42
42
43
43
assert (out == out2);
44
+ MuHash3072 muhash3;
45
+ muhash3 *= muhash;
46
+ uint256 out3;
47
+ muhash3.Finalize (out3);
48
+ assert (out == out3);
44
49
45
50
// Test that removing all added elements brings the object back to it's initial state
46
51
muhash /= muhash;
@@ -50,4 +55,9 @@ FUZZ_TARGET(muhash)
50
55
muhash2.Finalize (out2);
51
56
52
57
assert (out == out2);
58
+
59
+ muhash3.Remove (data);
60
+ muhash3.Remove (data2);
61
+ muhash3.Finalize (out3);
62
+ assert (out == out3);
53
63
}
You can’t perform that action at this time.
0 commit comments