-
Notifications
You must be signed in to change notification settings - Fork 93
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
Add the SNARK gadget traits #2
Conversation
(still adding comments) |
ready for more review |
src/snark/constraints.rs
Outdated
// the same routine as the new_input above | ||
|
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.
If it's the same routine, then can we reuse the implementation to avoid duplication and things going out of sync?
src/snark/constraints.rs
Outdated
// the same routine as the new_input above. | ||
|
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.
Same comment: can we share the impl between the two methods?
fn from_field_elements(src: &Vec<FpVar<CF>>) -> Result<Self, SynthesisError> { | ||
// the same routine as the new_input above. | ||
|
||
let cs = src.cs(); |
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.
You probably want to handle the case of constants separately from variables (in the former I guess you don't do any constraint generation?)
Co-authored-by: Pratyush Mishra <[email protected]>
Co-authored-by: Pratyush Mishra <[email protected]>
Will get back to this in one hour. |
Not an easy one. For those "the same routine as the new_input above", I read the code and agree there are some overlapping, but it seems hard to extract some common elements that make a lot of sense. So, I just expand the comments. I also changed the |
I think this is failing |
Thanks! |
All checks have passed now. |
Co-authored-by: Pratyush Mishra <[email protected]>
This PR adds the SNARK trait and the shared component Input Gadgets (will be used by Groth16 and GM17). And it fixes a few compilation errors.
The PR is not finished---there is an input gadget for nonnative fields, which is required for Marlin. We will wait for the dependency.