File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change 44
55#include < chainparams.h>
66#include < chainparamsbase.h>
7+ #include < key.h>
78#include < net.h>
89#include < net_permissions.h>
910#include < netaddress.h>
1718#include < test/util/setup_common.h>
1819#include < util/asmap.h>
1920
21+ #include < cstddef>
2022#include < cstdint>
2123#include < optional>
2224#include < string>
@@ -77,3 +79,22 @@ FUZZ_TARGET_INIT(net, initialize_net)
7779 (void )node.HasPermission (net_permission_flags);
7880 (void )node.ConnectedThroughNetwork ();
7981}
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