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

[Rust]: Add cargo fuzz tests #3126

Merged
merged 9 commits into from
May 3, 2023
Merged

[Rust]: Add cargo fuzz tests #3126

merged 9 commits into from
May 3, 2023

Conversation

satoshiotomakan
Copy link
Collaborator

Description

Add cargo fuzz tests in order to check if tw_keypair, tw_encoding and tw_hash don't crash on arbitrary inputs.

Fixes:

  1. starknet-crypto - starknet_crypto::ecdsa::verify panics xJonathanLEI/starknet-rs#365
  2. tw_hash::blake2_b*

How to test

Fuzzing tests may take too long to find critical bugs, so there is no need to run cargo fuzz on CI.
To make sure if all fuzz targets are compilable, run tools/rust-fuzz dry.

@satoshiotomakan satoshiotomakan self-assigned this Apr 28, 2023
@satoshiotomakan satoshiotomakan marked this pull request as ready for review April 28, 2023 14:55
@satoshiotomakan satoshiotomakan linked an issue Apr 28, 2023 that may be closed by this pull request
Copy link
Contributor

@lamafab lamafab left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, the fuzzing primarily focuses on catching panics, however. Would be nice if (eventually) we tested two implementations side by side.

@Milerius Milerius requested a review from lamafab May 2, 2023 10:29
@Milerius Milerius merged commit 9cfbaf3 into dev May 3, 2023
@Milerius Milerius deleted the s/rust-fuzzing branch May 3, 2023 15:39
SuperGNUS pushed a commit to GeniusVentures/wallet-core that referenced this pull request May 11, 2023
satoshiotomakan added a commit that referenced this pull request Jul 17, 2023
satoshiotomakan added a commit that referenced this pull request Jul 17, 2023
satoshiotomakan added a commit that referenced this pull request Oct 6, 2023
EduMenges pushed a commit to GeniusVentures/wallet-core that referenced this pull request Jun 17, 2024
EduMenges pushed a commit to GeniusVentures/wallet-core that referenced this pull request Jun 18, 2024
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.

[Rust]: Add fuzzing tests
3 participants