mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-04-02 08:59:08 +02:00
[fuzz] Improve fuzzing stability for ellswift_roundtrip harness
`CPubKey::VerifyPubKey` uses rng internally which leads to instability in the fuzz test. We fix this by avoiding `VerifyPubKey` in the test and verifying the decoded public key with a fuzzer chosen message instead.
This commit is contained in:
parent
9e1306fc88
commit
154fcce55c
@ -322,7 +322,10 @@ FUZZ_TARGET(ellswift_roundtrip, .init = initialize_key)
|
||||
auto encoded_ellswift = key.EllSwiftCreate(ent32);
|
||||
auto decoded_pubkey = encoded_ellswift.Decode();
|
||||
|
||||
assert(key.VerifyPubKey(decoded_pubkey));
|
||||
uint256 hash{ConsumeUInt256(fdp)};
|
||||
std::vector<unsigned char> sig;
|
||||
key.Sign(hash, sig);
|
||||
assert(decoded_pubkey.Verify(hash, sig));
|
||||
}
|
||||
|
||||
FUZZ_TARGET(bip324_ecdh, .init = initialize_key)
|
||||
|
Loading…
x
Reference in New Issue
Block a user