File tree 1 file changed +21
-0
lines changed
1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change 4
4
5
5
#include < chainparams.h>
6
6
#include < chainparamsbase.h>
7
+ #include < key.h>
7
8
#include < net.h>
8
9
#include < net_permissions.h>
9
10
#include < netaddress.h>
17
18
#include < test/util/setup_common.h>
18
19
#include < util/asmap.h>
19
20
21
+ #include < cstddef>
20
22
#include < cstdint>
21
23
#include < optional>
22
24
#include < string>
@@ -77,3 +79,22 @@ FUZZ_TARGET_INIT(net, initialize_net)
77
79
(void )node.HasPermission (net_permission_flags);
78
80
(void )node.ConnectedThroughNetwork ();
79
81
}
82
+
83
+ void initialize_chainparams ()
84
+ {
85
+ SelectParams (CBaseChainParams::REGTEST);
86
+ }
87
+
88
+ FUZZ_TARGET_INIT (bip324_session_derivation, initialize_chainparams)
89
+ {
90
+ FuzzedDataProvider fuzzed_data_provider{buffer.data (), buffer.size ()};
91
+
92
+ ECDHSecret ecdh_secret;
93
+ auto ecdh_secret_bytes = fuzzed_data_provider.ConsumeBytes <std::byte>(ECDH_SECRET_SIZE);
94
+ ecdh_secret_bytes.resize (ECDH_SECRET_SIZE);
95
+
96
+ memcpy (ecdh_secret.data (), ecdh_secret_bytes.data (), ECDH_SECRET_SIZE);
97
+
98
+ BIP324Session session;
99
+ DeriveBIP324Session (std::move (ecdh_secret), session);
100
+ }
You can’t perform that action at this time.
0 commit comments