Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fuzz: implement Arbitrary trait for fuzzed types #74

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

unseddd
Copy link

@unseddd unseddd commented Oct 23, 2020

Implementing the Arbitrary trait allows libFuzzer to work faster, and simplifies fuzz driver code.

Implementations are conditionally compiled, so non-fuzz builds aren't affected.

Commitment and RangeProof implement Arbitrary for use in main grin repo.

Implementing the Arbitrary trait allows libFuzzer to work faster, and
simplifies fuzz driver code.

Implementations are conditionally compiled, so non-fuzz builds aren't
affected.

Commitment and RangeProof implement Arbitrary for use in main grin repo.
@antiochp
Copy link
Member

@unseddd
Copy link
Author

unseddd commented Oct 24, 2020

https://docs.rs/arbitrary/0.4.7/arbitrary/trait.Arbitrary.html#impl-Arbitrary-for-(B%2C%20C%2C%20D%2C%20E%2C%20F%2C%20G%2C%20H%2C%20I%2C%20J%2C%20K%2C%20L%2C%20M%2C%20N%2C%20O%2C%20P%2C%20Q%2C%20R%2C%20S%2C%20T%2C%20U%2C%20V%2C%20W%2C%20X%2C%20Y%2C%20Z%2C%20A)

😭

That is intense... 😅

I'm new to the Arbitrary trait, too. Ran across it when refactoring fuzzer code. Apparently, structure-aware fuzzing is the way to go. Not sure why they do trait impls over so many generic types, maybe usability for derive macro? First time seeing something like that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants