MCPcopy Create free account
hub / github.com/ElementsProject/elements / FUZZ_TARGET_INIT

Function FUZZ_TARGET_INIT

src/test/fuzz/key_io.cpp:21–39  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

19}
20
21FUZZ_TARGET_INIT(key_io, initialize_key_io)
22{
23 const std::string random_string(buffer.begin(), buffer.end());
24
25 const CKey key = DecodeSecret(random_string);
26 if (key.IsValid()) {
27 assert(key == DecodeSecret(EncodeSecret(key)));
28 }
29
30 const CExtKey ext_key = DecodeExtKey(random_string);
31 if (ext_key.key.size() == 32) {
32 assert(ext_key == DecodeExtKey(EncodeExtKey(ext_key)));
33 }
34
35 const CExtPubKey ext_pub_key = DecodeExtPubKey(random_string);
36 if (ext_pub_key.pubkey.size() == CPubKey::COMPRESSED_SIZE) {
37 assert(ext_pub_key == DecodeExtPubKey(EncodeExtPubKey(ext_pub_key)));
38 }
39}

Callers

nothing calls this directly

Calls 10

DecodeSecretFunction · 0.85
EncodeSecretFunction · 0.85
DecodeExtKeyFunction · 0.85
EncodeExtKeyFunction · 0.85
DecodeExtPubKeyFunction · 0.85
EncodeExtPubKeyFunction · 0.85
beginMethod · 0.45
endMethod · 0.45
IsValidMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected