rust-bitcoin / rust-secp256k1

Rust language bindings for Bitcoin secp256k1 library.
Creative Commons Zero v1.0 Universal
347 stars 265 forks source link

PublicKey does not roundtrip in fuzzing mode #486

Open apoelstra opened 2 years ago

apoelstra commented 2 years ago

Surprised this wasn't found much earlier.

This line https://github.com/rust-bitcoin/rust-secp256k1/blob/master/secp256k1-sys/src/lib.rs#L881 mangles public keys when they're being parsed in fuzzing mode. Then they serialize inconsistently which is breaking round-trip fuzztests in Liquid.

jhfrontz commented 2 years ago

This seems to be getting triggered much more frequently in the past week or so.

apoelstra commented 2 years ago

rust-miniscript's parse_descriptor_secret fuzztest fails because of this

tcharding commented 1 year ago

Is the link in the PR description to the correct line of code? I can't see how that code effects the pubkey? Is the munging something to do with test_cleanup_pk?

apoelstra commented 1 year ago

No, the link is outdated. I should not have linked to master but rather whatever specific commit master was at hwen I opened this issue..