What changed, and why it matters
This commit only adds a new fuzz test for an existing data type (TapLeafHash). It does not change any production code, fix a bug, or alter behavior. There is no security issue here.
No action needed; this is a benign test-only addition.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The commit registers a new fuzz target for bitcoin::taproot_primitives::TapLeafHash in the existing encoding roundtrip and compare_consensus_encoding fuzz harnesses. It adds one generated fuzz target file, updates fuzz/Cargo.toml, and adds the type to two lists. No library code is modified.
Changed components
fuzz/Cargo.tomlfuzz/fuzz_targets/bitcoin/compare_consensus_encoding.rsfuzz/fuzz_targets/bitcoin/encoding_roundtrip/taproot_primitives_tap_leaf_hash.rsfuzz/generate-encoding-roundtrip.shInspect captured patch +21 / −0
diff --git a/fuzz/Cargo.toml b/fuzz/Cargo.toml
index a2e80638..29baf4bb 100644
--- a/fuzz/Cargo.toml
+++ b/fuzz/Cargo.toml
@@ -484,6 +484,13 @@ path = "fuzz_targets/bitcoin/encoding_roundtrip/tap_script_buf.rs"
test = false
doc = false
bench = false
+[[bin]]
+name = "bitcoin_encoding_roundtrip_taproot_primitives_tap_leaf_hash"
+path = "fuzz_targets/bitcoin/encoding_roundtrip/taproot_primitives_tap_leaf_hash.rs"
+test = false
+doc = false
+bench = false
+
[[bin]]
name = "bitcoin_encoding_roundtrip_transaction"
path = "fuzz_targets/bitcoin/encoding_roundtrip/transaction.rs"
diff --git a/fuzz/fuzz_targets/bitcoin/compare_consensus_encoding.rs b/fuzz/fuzz_targets/bitcoin/compare_consensus_encoding.rs
index e3e272a7..0d79a585 100644
--- a/fuzz/fuzz_targets/bitcoin/compare_consensus_encoding.rs
+++ b/fuzz/fuzz_targets/bitcoin/compare_consensus_encoding.rs
@@ -173,6 +173,7 @@ fn do_test(data: &[u8]) {
compare_encoding!(data, bitcoin::absolute::LockTime, bitcoin_0_32::absolute::LockTime);
compare_encoding!(data, bitcoin::block::Version, bitcoin_0_32::block::Version);
compare_encoding!(data, bitcoin::transaction::Version, bitcoin_0_32::transaction::Version);
+ compare_encoding!(data, bitcoin::taproot_primitives::TapLeafHash, bitcoin_0_32::TapLeafHash);
// P2P types
compare_encoding!(data, p2p::ServiceFlags, bitcoin_0_32::p2p::ServiceFlags);
diff --git a/fuzz/fuzz_targets/bitcoin/encoding_roundtrip/taproot_primitives_tap_leaf_hash.rs b/fuzz/fuzz_targets/bitcoin/encoding_roundtrip/taproot_primitives_tap_leaf_hash.rs
new file mode 100644
index 00000000..b32d4f13
--- /dev/null
+++ b/fuzz/fuzz_targets/bitcoin/encoding_roundtrip/taproot_primitives_tap_leaf_hash.rs
@@ -0,0 +1,12 @@
+#![cfg_attr(fuzzing, no_main)]
+#![cfg_attr(not(fuzzing), allow(unused))]
+
+use bitcoin_fuzz::check_roundtrip;
+use libfuzzer_sys::fuzz_target;
+
+#[cfg(not(fuzzing))]
+fn main() {}
+
+fuzz_target!(|data: &[u8]| {
+ check_roundtrip::<bitcoin::taproot_primitives::TapLeafHash>(data);
+});
diff --git a/fuzz/generate-encoding-roundtrip.sh b/fuzz/generate-encoding-roundtrip.sh
index 08a2632d..f3a3c98b 100755
--- a/fuzz/generate-encoding-roundtrip.sh
+++ b/fuzz/generate-encoding-roundtrip.sh
@@ -33,6 +33,7 @@ ROUNDTRIP_TYPES=(
"bitcoin::block::Header"
"bitcoin::block::Version"
"bitcoin::transaction::Version"
+ "bitcoin::taproot_primitives::TapLeafHash"
"p2p::Magic"
"p2p::ProtocolVersion"
"p2p::ServiceFlags"
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.