Commit Graph

6 Commits

Author SHA1 Message Date
Pierre
46e538775b A circuit for computing c, from section 5, step 5 of "A multi-folding scheme for CCS" (#61)
* feat: start hypernova nimfs verifier

* refactor: change where nimfs verifier lives

* feat: `EqEvalGadget` for computing `eq(x, y)`

* refactor: rename to `utils.rs`

* feat: implement a `VecFpVar` struct, representing a vector of `FpVar`s

* refactor: extract a `sum_muls_gamma_pows_eq_sigma` function to make circuit tests easier

* feat: implement a `SumMulsGammaPowEqSigmaGadget` to compute the first term of the sum of section 5, step 5

* refactor: update gadget name and method name to match `sum_muls_gamma_pows_eq_sigma`

* fix: update method call

* refactor: remove usage of `GammaVar`

Co-authored-by: arnaucube <root@arnaucube.com>

* refactor: move hypernova circuit related types and methods into `src/folding/hypernova/circuits.rs`

* refactor: remove all of `GammaVar` wrapper

* chore: update type to `&[F]`

* refactor: update from `new_constant` to `new_witness`

* fix: actual file deletion

* refactor: remove `VecFpVar` struct

* chore: update comment doc

* refactor: extract a `sum_ci_mul_prod_thetaj` function for testing

* feat: `test_sum_ci_mul_prod_thetaj_gadget` passing

* refactor: update docs and add a helper `get_prepared_thetas` function

* refactor: clearer arg name

* fix: clippy typing

* chore: correct latex comments

* refactor: remove unncessary `get_prepared_thetas` fn

* feat: test passing for rough first pass on `ComputeCFromSigmasAndThetasGadget`

* chore: add additional doc comments

* chore: add `#[allow(clippy::too_many_arguments)]`

* refactor: make gadget generic over a curve group

* chore: clippy fixes

* chore: correct latex in doc comment

* refactor: refactor `sum_muls_gamma_pows_eq_sigma` and `sum_ci_mul_prod_thetaj` in `ComputeCFromSigmasAndThetasGadget`

---------

Co-authored-by: arnaucube <root@arnaucube.com>
2024-01-15 16:18:51 +00:00
Pierre
05f49918ac Feature/sumcheck circuit (#47)
* feat: init sumcheck.rs

* chore: rename

* feat: update lib and add trait for transcript with vec storing challenges

* bugfix: mut self ref of transcript

* feat: tentative sum-check using poseidon

* refactor: remove extension trait and use initial trait

* refactor: stop using extension trait, use initial Transcript trait

* feat: generic over CurveGroup sum-check verifier and algorithm

* feat: implement generic sum-check veriy

* bugfix: cargo clippy --fix

* chore: cargo fmt

* feat: (unstable) sum-check implementation

* feat: start benches

* chore: run clippy

* chore: run cargo fmt

* feat: add sum-check tests + benches

* chore: clippy + fmt

* chore: remove unstable sumcheck

* chore: delete duplicated sum-check code

* chore: remove deleted sum-check code from lib.rs imports

* feat: remove non generic traits, implement sum-check with generic trait and add test

* chore: remove non-generic struct

* chore: remove non generic verifier

* feat: make nifms generic over transcript and update to use poseidon transcript

* chore: cargo fmt

* chore: remove tmp benches

* chore: update cargo.toml

* refactor: remove Generic suffix

* feat: prover state generic over CurveGroup

* chore: disable clippy type complexity warning

* refactor: remove Transcript type and espresso transcript dependency

* refactor: SumCheckProver generic over CurveGroup

* feat: init sumcheck.rs

* chore: rename

* feat: update lib and add trait for transcript with vec storing challenges

* bugfix: mut self ref of transcript

* feat: tentative sum-check using poseidon

* refactor: stop using extension trait, use initial Transcript trait

* feat: generic over CurveGroup sum-check verifier and algorithm

* feat: implement generic sum-check veriy

* bugfix: cargo clippy --fix

* chore: cargo fmt

* feat: (unstable) sum-check implementation

* feat: start benches

* chore: run clippy

* chore: run cargo fmt

* feat: add sum-check tests + benches

* chore: clippy + fmt

* chore: remove unstable sumcheck

* chore: delete duplicated sum-check code

* chore: remove deleted sum-check code from lib.rs imports

* feat: remove non generic traits, implement sum-check with generic trait and add test

* chore: remove non-generic struct

* chore: remove non generic verifier

* feat: make nifms generic over transcript and update to use poseidon transcript

* chore: cargo fmt

* chore: remove tmp benches

* chore: update cargo.toml

* refactor: remove Generic suffix

* feat: prover state generic over CurveGroup

* chore: disable clippy type complexity warning

* refactor: remove Transcript type and espresso transcript dependency

* refactor: SumCheckProver generic over CurveGroup

* feat: adds `compute_lagrange_poly`, returning a `DensePolynomial` to extract coeffs from

* chore: add assert on interpolated poly degree vs initial poly degree

* refactor: use `compute_lagrange_poly` in `SumCheckVerifier` instead of `interpolate_uni_poly`

* refactor: have `TranscriptVar` be generic over `CurveGroup` for consistency

* refactor: change back to being generic over field

* feat: start to use `PoseidonTranscriptVar` struct

* chore: add line to eof for `Cargo.toml`

* chore: naming consistency with espresso/sum_check folder

* bugfix: add error handling on sum-check prove and verify

* chore: clippy fix

* chore: add line at eof

* feat: switch to using coeffs instead of evals in sum-check

* bugfix: tmp remove sanity check in nimfs

* refactor: update sanity check

* refactor: update verifier evaluation form + add comment

* chore: run clippy

* fix: correct merge artifacts

* feat: verify circuit passing

* refactor: change naming to use the `Gadget` suffix, update `verify_sumcheck` to not have `&self` as first argument, update test

* feat: testing on polynomials with various number of variables

* refactor: update method name

* fix: avoid rust-analyzer from complaining

* fix: fix clippy complains

* chore: cargo clippy

* chore: udpate arg name for `SumCheckVerifierGadget`

* refactor: remove unnecessary cloning in sumcheck circuit

* refactor: impl `get_poly_vars_from_sumcheck_proof` for `IOPProof`

* chore: group imports

* refactor: update `P(0) + P(1)` and name it `eval`

* chore: clippy + fmt

* refactor: move `compute_lagrange_poly` to `utils`

* fix: wrong import

* chore: cargo fmt

* refactor: absorb num vars and max degree within sumcheck circuit

* refactor: update name to `compute_lagrange_interpolated_poly` and add comment

* feat: create `IOPProofVar`, which implements the `AllocVar` trait

* fix: clippy allow `type_complexity` on return type of `SumCheckVerifierGadget`

* refactor: use `VPAuxInfo` instead of virtual type, remove `_` prefix in params name

* feat: add tests on computed & returned values from `verify`

* refactor: use `new_witness` instead of `new_variable`

Co-authored-by: arnaucube <root@arnaucube.com>

* chore: clippy

* fix: remove `unwrap()` within `verify()`

Co-authored-by: arnaucube <root@arnaucube.com>

* chore: add comment on `unwrap()`

* refactor: move `compute_lagrange_interpolated_poly` tests to `lagrange_poly.rs`

---------

Co-authored-by: arnaucube <root@arnaucube.com>
2024-01-04 11:15:28 +00:00
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
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
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
9ae046c4fc Implement CycleFold's EC RLC check circuit (#9) 2023-08-29 06:49:48 +00:00