Commit Graph

13 Commits

Author SHA1 Message Date
arnaucube
186766c348 Fit Nova+CycleFold into FoldingScheme trait & Add examples/ for folding SHA256 circuit (#64)
* Update FoldingSchemes trait, fit Nova+CycleFold

- update lib.rs's `FoldingScheme` trait interface
- fit Nova+CycleFold into the `FoldingScheme` trait
- refactor `src/nova/*`

* Add `examples` dir, with Nova's `FoldingScheme` example

* polishing

* expose poseidon_test_config outside tests
2024-02-02 16:24:18 +00:00
arnaucube
f85a056b61 Adapt Nova usage of commitment to the generic trait (#63) 2024-01-30 10:16:53 +00:00
arnaucube
47e47cc2af Add CommitmentProver trait, and add KZG prover to it (#62)
* Add KZG commitment scheme adapted to vector commitment

Add KZG commitment scheme adapted to vector commitment
Also move the `src/pedersen.rs` into `src/commitment/pedersen.rs` where
it will coexist with `kzg.rs` and the trait defined in
`src/commitment/mod.rs`.

* Adapt Pedersen into the new CommitmentProver trait

* add CommitmentProver (Pedersen&KZG) homomorphic property test

* polishing

* Use divide_with_q_and_r, rename skip_first_zero_coeffs

Co-authored-by: han0110 <tinghan0110@gmail.com>

---------

Co-authored-by: han0110 <tinghan0110@gmail.com>
2024-01-25 13:45:01 +00:00
arnaucube
498198057b Nova+CycleFold Decider circuit (for onchain use case) (#49)
* Add Pedersen commitments gadget

* Add Nova+CycleFold Decider circuit (for onchain approach)

"onchain"==Ethereum's EVM

* merge src/decider into src/folding/nova/decider

* PR review updates
2024-01-10 10:36:22 +00:00
arnaucube
b4f42e7023 Implement CycleFold in Nova's IVC (#45)
* Implement CycleFold in Nova's IVC

(CycleFold: https://eprint.iacr.org/2023/1192)

* CycleFoldChallengeGadget: add points coordinates as bytes

* Apply PR review suggestions
2023-12-18 08:42:46 +00:00
arnaucube
905ba44d8d Feature/nova ivc (#36)
* Implement Nova IVC's new & prove_step methods

Implement Nova IVC's new & prove_step methods (without CycleFold part yet)

* transcript.absorb_point err handling, and update C.xy() usage

* add transcript usage to IVC prove, add NovaTranscript trait extending Transcript trait, refactor NIFS.P to allow absorbing in transcript inbetween

* Implement Nova's IVC.V method (without CycleFold part yet)

* clippy lints

* move challenge r computation in-circuit

* reuse computed points with coordinates over CF (non-native) to save constraints in AugmentedFCircuit

(constraint count went down ~6k)

* rm 128 bit constant

* add params to Errors

* Updates from review suggestions. Additionally refactored nova/nifs fold, and rm transcript from nova/IVC.

- Updates from PR suggestions
- Additionally updated:
  - in nova/nifs.rs: reuse folded_committed_instance for verify_folded_instance, computationally is the same, but reusing the same code so avoiding duplication and having an error on one of the two versions.
  - in nova/ivc.rs: remove transcript from IVC (not needed, it uses the RO)
2023-11-24 10:15:14 +00:00
arnaucube
6d919d7a5b Feature/f circuit multiple in outs (#35)
* extend FCircuit to work with multiple ins & outs

* refactor FCircuit trait to work with io for multiple frontends support
2023-11-06 15:31:54 +00:00
arnaucube
8edea23c2f Add Pedersen::{commit,open,verify} MSM error handling (#34) 2023-10-31 07:02:44 +00:00
arnaucube
597ac27288 implement Nova's AugmentedFCircuit (#33)
* impl AugmentedFCircuit non-base case

* add multiple iterations to AugmentedFCircuit test

* implement base case on AugmentedFCircuit and test

* Update cmE of E=0-vec to work as zero point

Update cmE of E=0-vec to work as zero point instead of as cm(0-vec)

* patch r1cs-std dep to a cherry-picked version with the zero-scalar-mult fix

* refactor FCircuit to make it more suitable inside the AugmentedFCircuit
2023-10-30 08:02:19 +00:00
arnaucube
422db752f9 impl hash committed instance gadget (#17) (#31)
together with the native impl compatible with the gadget one
2023-10-12 09:04:45 +00:00
arnaucube
8256c27609 Port/hypernova multifolding (#10)
* Port HyperNova's multifolding from https://github.com/privacy-scaling-explorations/multifolding-poc adapting and refactoring some of its methods and structs.

Note: adapted mle.rs methods from dense to sparse repr.

Co-authored-by: George Kadianakis <desnacked@riseup.net>

* HyperNova: move CCS struct outside of LCCCS & CCCS

HyperNova nimfs: move CCS structure outside of LCCCS & CCCS, to avoid
carrying around the whole CCS and duplicating data when is not needed.

Also add feature flags for the folding schemes.

---------

Co-authored-by: George Kadianakis <desnacked@riseup.net>
2023-09-11 07:31:23 +00:00
arnaucube
d9887af535 Implement Nova's NIFS.Verify circuits (with CycleFold) (#11)
* Implement Nova's NIFS.Verify circuits (with CycleFold)

- Add circuit for NIFS.Verify on the main curve to check the folded `u`
  & `x`
- Add circuit for NIFS.Verify on the CycleFold's auxiliary curve to
  check the folded `cm(E)` & `cm(W)`
- Add transcript.get_challenge_nbits
- Add tests for utils::vec.rs

* replace bls12-377 & bw6-761 by pallas & vesta curves (only affects tests)

We will use pallas & vesta curves (for tests only, the non-tests code
uses generics) for the logic that does not require pairings, and while
Grumpkin is not available
(https://github.com/privacy-scaling-explorations/folding-schemes/issues/12).

* update links to papers to markdown style
2023-09-05 15:17:59 +00:00
arnaucube
15e2886e61 Implement Nova's NIFS.P & NIFS.V (#7) 2023-08-23 13:07:33 +00:00