Skip to content

Conversation

@dnkolegov-ar
Copy link
Collaborator

This PR adds fuzz targets for the cryptography crate.

@patrick-ogrady patrick-ogrady changed the title Cryptography fuzz targets [cryptography] Add fuzz targets Jun 18, 2025
@patrick-ogrady
Copy link
Contributor

Please add a line here for cryptography:

- name: Build codec
run: cargo +nightly fuzz build --fuzz-dir codec/fuzz

commonware-cryptography = { workspace = true }
arbitrary = { workspace = true, features = ["derive"] }
blst = { version = "0.3.13", features = ["no-threads"] }
ed25519-zebra = "4.0.3"
Copy link
Contributor

Choose a reason for hiding this comment

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

Was there a certain rationale for using ed25519-zebra instead of ed25519-consensus (what we use internally)?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It is just for diff testing. The production code still uses ed25519-consensus.

Copy link
Contributor

Choose a reason for hiding this comment

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

By that logic, I suppose we should spend some time looking for alternatives to blst and p256 in the future?

Copy link
Collaborator

Choose a reason for hiding this comment

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

The main reason I wanted to use zebra was because it has the same validation criteria as ed25519-consensus and follows the same Zcash serialization spec. I think it would be fruitful to test against other alternatives but like we discussed it is hard to find a good p256 alternative, and I think the only production grade library for BLS is blst.

@dnkolegov-ar
Copy link
Collaborator Author

Please add a line here for cryptography:

- name: Build codec
run: cargo +nightly fuzz build --fuzz-dir codec/fuzz

Fixed

@patrick-ogrady patrick-ogrady merged commit 06f5eb5 into main Jun 18, 2025
16 checks passed
@patrick-ogrady patrick-ogrady deleted the denis/cryptography-fuzz-tests branch June 18, 2025 21:27
@codecov
Copy link

codecov bot commented Jun 18, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 90.99%. Comparing base (98689a0) to head (46b5aef).
Report is 6 commits behind head on main.

@@            Coverage Diff             @@
##             main    #1124      +/-   ##
==========================================
+ Coverage   90.97%   90.99%   +0.01%     
==========================================
  Files         214      214              
  Lines       57426    57342      -84     
==========================================
- Hits        52245    52178      -67     
+ Misses       5181     5164      -17     

see 10 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 579520d...46b5aef. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

4 participants