-
Notifications
You must be signed in to change notification settings - Fork 0
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
Refactor NIFSTrait & port Mova impl to it #1
Refactor NIFSTrait & port Mova impl to it #1
Conversation
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.
Overall the Mova code looks fine. Left some tidying-up comments and some questions for clarification about the pp_hash
_cs_prover_params: &CS::ProverParams, // not used in Mova since we don't commit to T | ||
r1cs: &R1CS<C::ScalarField>, | ||
transcript: &mut T, | ||
pp_hash: C::ScalarField, |
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.
Why do we need the pp_hash?
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.
This is used for challenges that come from transcript/hashing, the pp_hash itself is a hash of several public values of the parameters (such as the circuit r1cs, the commitment schemes params, the poseidon config, etc) so that the challenges are dependent on the specific setup (and the same challenge is not generated between 2 different curves instantiations for example). In Nova & Mova papers I think that they appear denoted as pp
(for 'public parameters').
transcript.absorb(&mleT_evaluated); | ||
|
||
let alpha_scalar = C::ScalarField::from_le_bytes_mod_order(b"alpha"); | ||
transcript.absorb(&alpha_scalar); |
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.
We dont actually need the alpha_scalar. I removed it in my latest commit
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.
oh right, thanks, removed
/// returns the folded committed instance | ||
fn verify( | ||
transcript: &mut T, | ||
pp_hash: C::ScalarField, |
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.
ditto
transcript.absorb(&proof.mleT); | ||
|
||
let alpha_scalar = C::ScalarField::from_le_bytes_mod_order(b"alpha"); | ||
transcript.absorb(&alpha_scalar); |
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.
ditto
* refactor NIFSTrait interface to fit Nova variants (Nova,Mova,Ova) Refactor NIFSTrait interface to fit Nova variants (Nova,Mova,Ova). The relevant change is instead of passing the challenge as input, now it passes the transcript and computes the challenges internally (Nova & Ova still compute a single challenge, but Mova computes multiple while absorbing at different steps). * port Mova impl to the NIFSTrait * remove unnecessary wrappers in the nova/zk.rs * remove Nova NIFS methods that are no longer needed after the refactor * put together the different NIFS implementations (Nova, Mova, Ova) so that they can interchanged at usage. The idea is that Nova and its variants (Ova & Mova) share most of the logic for the circuits & IVC & Deciders, so with the abstracted NIFS interface we will be able to reuse most of the already existing Nova code for having the Mova & Ova circuits, IVC, and Decider.
8e57b85
to
54e6b60
Compare
Most of the changes in this PR are to code prior to the Mova implementation, just that the NIFS abstraction that we had before was abstracted for Nova & Ova but not for the Mova needs. With this PR the abstraction is more generic and future-proof, and it allows to interchange the NIFS of Nova, Mova, Ova without friction.
refactor NIFSTrait interface to fit Nova variants (Nova,Mova,Ova)
Refactor NIFSTrait interface to fit Nova variants (Nova,Mova,Ova). The relevant change is instead of passing the challenge as input, now it passes the transcript and computes the challenges internally (Nova & Ova still compute a single challenge, but Mova computes multiple while absorbing at different steps).
port Mova impl to the NIFSTrait
remove unnecessary wrappers in the nova/zk.rs
remove Nova NIFS methods that are no longer needed after the refactor
put together the different NIFS implementations (Nova, Mova, Ova) so that they can interchanged at usage.
The idea is that Nova and its variants (Ova & Mova) share most of the logic for the circuits & IVC & Deciders, so with the abstracted NIFS interface we will be able to reuse most of the already existing Nova code for having the Mova & Ova circuits, IVC, and Decider.
Doing this PR here so that it can be merged into the branch
NiDimi:introducing_mova
, and then it updates the PR privacy-scaling-explorations#161