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>
@@ -36,7 +35,6 @@ FUZZ_TARGET(crypto)
36
35
CSHA512 sha512;
37
36
SHA3_256 sha3;
38
37
CSipHasher sip_hasher{fuzzed_data_provider.ConsumeIntegral <uint64_t >(), fuzzed_data_provider.ConsumeIntegral <uint64_t >()};
39
- MuHash3072 muhash;
40
38
41
39
while (fuzzed_data_provider.ConsumeBool ()) {
42
40
CallOneOf (
@@ -63,12 +61,6 @@ FUZZ_TARGET(crypto)
63
61
(void )Hash (data);
64
62
(void )Hash160 (data);
65
63
(void )sha512.Size ();
66
-
67
- if (fuzzed_data_provider.ConsumeBool ()) {
68
- muhash *= MuHash3072 (data);
69
- } else {
70
- muhash /= MuHash3072 (data);
71
- }
72
64
},
73
65
[&] {
74
66
(void )hash160.Reset ();
@@ -78,7 +70,6 @@ FUZZ_TARGET(crypto)
78
70
(void )sha256.Reset ();
79
71
(void )sha3.Reset ();
80
72
(void )sha512.Reset ();
81
- muhash = MuHash3072 ();
82
73
},
83
74
[&] {
84
75
CallOneOf (
@@ -122,10 +113,6 @@ FUZZ_TARGET(crypto)
122
113
[&] {
123
114
data.resize (SHA3_256::OUTPUT_SIZE);
124
115
sha3.Finalize (data);
125
- },
126
- [&] {
127
- uint256 out;
128
- muhash.Finalize (out);
129
116
});
130
117
});
131
118
}
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