mirror of
https://github.com/darkrenaissance/darkfi.git
synced 2026-01-09 14:48:08 -05:00
DarkFi's VarInt struct is meant to be equivalent to the one used by BTC. Most of the source code is extremeley similar. This commit adds very basic tests to ensure equivalence between DarkFi's implementation and the one used by the BTC crate. The tests included here are quite basic. Future work can expand on the testing done on the deserialized values. This harness can also be used as as guide or template for future differential fuzzing.
Fuzz2 - honggfuzz
This directory contains files pertaining to fuzz testing with the honggfuzz fuzzer.
We're trying this tool out alongside libfuzzer (covered in darkfi/fuzz/).
Comparison to libfuzzer
- Does not halt execution on crashes (can discover multiple crashes in one fuzzing session)
- Fewer memory issues (tool less likely to crash, easier to configure)
- Better UI
Install
cargo install honggfuzz
Usage
# Build targets from Cargo.toml [[bin]] section
cargo hfuzz build
# Run
cargo hfuzz run zkbinary-decode
Further info: https://docs.rs/honggfuzz/latest/honggfuzz/#how-to-use-this-crate