### Install Dependencies and Target Source: https://github.com/rust-bitcoin/rust-miniscript/blob/master/embedded/README.md Installs necessary dependencies and the target architecture for embedded development. ```shell sudo ./scripts/install-deps rustup target add thumbv7m-none-eabi ``` -------------------------------- ### Setup Nix Shell for Fuzzing Source: https://github.com/rust-bitcoin/rust-miniscript/blob/master/fuzz/README.md Configure the Nix shell with specific versions of libraries required by honggfuzz and disable conflicting hardening flags. ```bash nix-shell -p libopcodes_2_38 -p libunwind # In the nix-shell run these NIX_HARDENING_ENABLE=''${NIX_HARDENING_ENABLE/fortify/} NIX_HARDENING_ENABLE=''${NIX_HARDENING_ENABLE/fortify3/} ``` -------------------------------- ### List All Fuzz Targets Source: https://github.com/rust-bitcoin/rust-miniscript/blob/master/fuzz/README.md Source the utility script and call `listTargetNames` to get a comprehensive list of all available fuzzing targets. ```bash source ./fuzz-util.sh listTargetNames ``` -------------------------------- ### Expected Output of Embedded Test Source: https://github.com/rust-bitcoin/rust-miniscript/blob/master/embedded/README.md Example output from a successful embedded test run, showing heap size, descriptor, and P2SH address. ```text heap size 1048576 descriptor sh(wsh(or_d(c:pk_k(020e0338c96a8870479f2396c373cc7696ba124e8635d41b0ea581112b67817261),c:pk_k(0250863ad64a87ae8a2fe83c1af1a8403cb53f53e486d8511dad8a04887e5b2352)))) p2sh address 3CJxbQBfWAe1ZkKiGQNEYrioV73ZwvBWns ``` -------------------------------- ### Run Basic Fuzz Tests Source: https://github.com/rust-bitcoin/rust-miniscript/blob/master/fuzz/README.md Execute the fuzzing harness to briefly test all targets. Ensure you are in the fuzzing directory. ```bash ./fuzz.sh ``` -------------------------------- ### Run All Fuzz Targets Sequentially Source: https://github.com/rust-bitcoin/rust-miniscript/blob/master/fuzz/README.md Execute the `cycle.sh` script to run each fuzz target for an hour. This script uses `chrt` to manage job priorities. ```bash ./cycle.sh ``` -------------------------------- ### Run a Specific Fuzz Target Source: https://github.com/rust-bitcoin/rust-miniscript/blob/master/fuzz/README.md After adding a new fuzz test and regenerating files, use this command to test your specific fuzz target. ```bash ./fuzz.sh ``` -------------------------------- ### Fuzz with Weak Cryptography Source: https://github.com/rust-bitcoin/rust-miniscript/blob/master/fuzz/README.md Compile and run fuzzing scripts with specific RUSTFLAGS to replace standard hashing and secp256k1 libraries with broken versions for faster fuzzing. Never use these flags for real code. ```bash RUSTFLAGS="--cfg=hashes_fuzz --cfg=secp256k1_fuzz" ``` -------------------------------- ### Run Embedded Test Source: https://github.com/rust-bitcoin/rust-miniscript/blob/master/embedded/README.md Executes the embedded test using cargo with the specified target. ```shell source ./scripts/env.sh && cargo run +nightly --target thumbv7m-none-eabi ``` -------------------------------- ### Run a Single Fuzz Test Indefinitely Source: https://github.com/rust-bitcoin/rust-miniscript/blob/master/fuzz/README.md Use `cargo hfuzz run` to execute a specific fuzz test target continuously until manually stopped. ```bash cargo hfuzz run ``` -------------------------------- ### Reproduce Crash with Hex Input Source: https://github.com/rust-bitcoin/rust-miniscript/blob/master/fuzz/README.md Add a `duplicate_crash` test function to your code, pasting the hex-encoded crash input into `extend_vec_from_hex`. Then run `cargo test`. ```rust #[cfg(test)] mod tests { use miniscript::bitcoin::hex::FromHex; #[test] fn duplicate_crash() { let v = Vec::from_hex("abcd").unwrap(); super::do_test(&v); } } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.