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

feat: add poseidon-halo2 crate #633

Closed
wants to merge 2 commits into from

Conversation

themighty1
Copy link
Member

This PR adds the functionality to compute Poseidon hashes for certain input rates needed in AuthDecode.

@themighty1 themighty1 requested a review from sinui0 October 10, 2024 13:52
Copy link

codecov bot commented Oct 10, 2024

Codecov Report

Attention: Patch coverage is 0% with 72 lines in your changes missing coverage. Please review.

Project coverage is 54.16%. Comparing base (1d66359) to head (68ba80d).
Report is 9 commits behind head on poseidon_circomlib.

Files with missing lines Patch % Lines
crates/components/poseidon-halo2/src/spec.rs 0.00% 62 Missing ⚠️
crates/components/poseidon-halo2/src/lib.rs 0.00% 10 Missing ⚠️
Additional details and impacted files
@@                  Coverage Diff                   @@
##           poseidon_circomlib     #633      +/-   ##
======================================================
- Coverage               54.35%   54.16%   -0.20%     
======================================================
  Files                     192      194       +2     
  Lines                   20473    20545      +72     
======================================================
  Hits                    11129    11129              
- Misses                   9344     9416      +72     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@yuroitaki yuroitaki self-requested a review October 23, 2024 04:30
Copy link
Member

@yuroitaki yuroitaki left a comment

Choose a reason for hiding this comment

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

Great stuff!

//!
//! where 1 means "prime field", 0 means "non-negative sbox", 254 is the bitsize
//! of the field, 16 is the Poseidon width (rate + 1), 8 is the number of full
//! rounds, 64 is the number of partial rounds.
Copy link
Member

Choose a reason for hiding this comment

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

can we also comment on what 0x30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f0000001 is? i believe thats the prime modulus of bn256?

Copy link
Member Author

Choose a reason for hiding this comment

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

in the upcoming poseidon-circomlib crate these params will be computed on the fly by scroll-tech's poseidon crate, so we will not have that comment anymore.

Copy link
Member

Choose a reason for hiding this comment

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

@themighty1 gotcha, will this PR be updated to use scroll-tech's implementation?

Copy link
Member Author

Choose a reason for hiding this comment

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

i'll just close the PR because the new one will be much simpler.

crates/components/poseidon-halo2/src/spec.rs Show resolved Hide resolved
crates/components/poseidon-halo2/src/spec.rs Show resolved Hide resolved
crates/components/poseidon-halo2/src/lib.rs Show resolved Hide resolved
Copy link
Member

@yuroitaki yuroitaki left a comment

Choose a reason for hiding this comment

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

Great stuff!

crates/components/poseidon-halo2/Cargo.toml Show resolved Hide resolved
crates/components/poseidon-halo2/Cargo.toml Show resolved Hide resolved
crates/components/poseidon-halo2/Cargo.toml Show resolved Hide resolved
@themighty1 themighty1 changed the base branch from dev to poseidon_circomlib November 19, 2024 12:02
@themighty1
Copy link
Member Author

Closing this in favor of #670

@themighty1 themighty1 closed this Dec 3, 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.

3 participants