Closed gakonst closed 3 years ago
Actually another suggestion: maybe we can parameterize the Groth16 struct itself by a new generic type parameter bounded by the R1CSToQap
trait, and set the default to the old version? Do you think that would be cleaner?
Addressed your comments!
Actually another suggestion: maybe we can parameterize the Groth16 struct itself by a new generic type parameter bounded by the
R1CSToQap
trait, and set the default to the old version? Do you think that would be cleaner?
I think we should be considering a larger refactor (which I've started here) so as to allow the prover to cache intermediate steps, which should also help with having a cleaner abstraction around the QAP type
Also, for the documentation, should we add the details of the reduction as described in libsnark: https://github.com/scipr-lab/libsnark/blob/2af440246fa2c3d0b1b0a425fb6abd8cc8b9c54d/libsnark/reductions/r1cs_to_qap/r1cs_to_qap.tcc
I updated the API names slightly @gakonst, but this is good to merge otherwise. Any comments?
Description
As discussed, it is potentially useful to allow customizing the R1CS to QAP conversion, for cases such as Circom's where they skip some of the FFTs.
Implementation
This PR abstracts the R1CS to QAP to a trait and exposes methods for providing implementors of the trait. It maintains backwards compat.