-
Notifications
You must be signed in to change notification settings - Fork 116
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
Arrabbiata: new poseidon gadget #3053
Arrabbiata: new poseidon gadget #3053
Conversation
It seems that with nextest, it uses debug instead of release, even if it is compiled with release
1431888
to
65d7b28
Compare
65d7b28
to
46f2c8b
Compare
/// setup, with [crate::NUMBER_OF_COLUMNS] columns, we can compute 5 full | ||
/// The following gadgets implement the Poseidon hash instance described in | ||
/// the top-level documentation. In the current setup, with | ||
/// [crate::NUMBER_OF_COLUMNS] columns, we can compute 5 full | ||
/// rounds per row. | ||
Poseidon, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note: the old Poseidon gadget will be removed later.
By introducing incrementally the gadget PoseidonPermutation
, I hope it will ease the reviewer's work.
/// using "public inputs". | ||
/// | ||
/// We split the Poseidon gadget in 13 sub-gadgets, one for each set of 5 | ||
/// permutations and one for the absorbtion. The parameteris the starting |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in my mind the term permutation is usually used for the full poseidon, not a round
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, good point!
Changing it in a quick follow-up (to avoid breaking the PR train you already approved).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See #3066
/// using "public inputs". | ||
/// | ||
/// We split the Poseidon gadget in 13 sub-gadgets, one for each set of 5 | ||
/// permutations and one for the absorbtion. The parameteris the starting |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/// permutations and one for the absorbtion. The parameteris the starting | |
/// permutations and one for the absorbtion. The parameter is the starting |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oopsie.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See #3066
Gadget::EllipticCurveScaling => 2, | ||
Gadget::Poseidon => 3, | ||
Gadget::PoseidonSpongeAbsorb => 4, | ||
Gadget::PoseidonPermutation(starting_round) => 5 + starting_round / 5, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't like that we could have two different gadget with the same conversion to usize
I know it's not supposed to happens as Gadget::PoseidonPermutation(6) should not be created but it has the same int representation as Gadget::PoseidonPermutation(10)
In general, as previously commented I'd be happy if we can avoid a conversion to usize
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point!
What about enforcing starting_round
being a multiple of five and smaller than the number of full rounds?
I'll think about the conversion to usize. It is mostly to get an index and a count. There might be a more elegant solution.
Following #3050