-
Notifications
You must be signed in to change notification settings - Fork 188
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: remove a duplicate
R1CSShape
in the RelaxedR1CSSNARK
's chose…
…n `ProverKey` (#66) (#237) * fix: remove a duplicate `R1CSShape` in the `RelaxedR1CSSNARK`'s chosen `ProverKey` As explained by @zaverucha in microsoft/Spartan2#2 (with edits for precision): The `R1CSShape` object was being stored in both: - the `ProverKey` of the `spartan::direct::DirectSNARK`, which generically employs any instance of `RelaxedR1CSSNARKTrait`, - the `ProverKey` of each of the two `RelaxedR1CSSNARKTrait` implementations in `spartan::{snark, ppsnark}::RelaxedR1CSSNARK`, - the `PublicParams` that are passed to the `crate::CompressedSNARK<G1, G2, C1, C2, S1, S2>`, which generically employs any instance of `RelaxedR1CSSNARKTrait`. IOW, `RelaxedR1CSSNARKTrait` is always accessed through generic structs (`DirectSNARK`, `CompressedSNARK`) which already have a copy of the relevant R1CSSHape. Westore it once in the top level object (RelaxedR1CSSNARKTrait) and pass it to the Spartan implementation. This saves memory and makes serialization of the ProverKey about twice as fast. Both are significant when there are a large number of constraints. * refactor: rename check_regular_shape into is_regular_shape
- Loading branch information
1 parent
e79498b
commit e32c64d
Showing
6 changed files
with
36 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters