Commit Graph

49 Commits

Author SHA1 Message Date
Srinath Setty
dcea0be01f output h2 as AllocatedNum (#31)
* output h2 as AllocatedNum

* clippy
2022-04-15 16:59:41 -07:00
Srinath Setty
9a0f5604d6 make step_circuit mandatory; add support for longer hashes (#30) 2022-04-15 16:06:26 -07:00
Srinath Setty
866717a8f2 cleanup how points are allocated (#29) 2022-04-15 12:04:52 -07:00
Srinath Setty
9a44d06aec PrimeField --> ff::PrimeField (#28)
* PrimeField --> ff::PrimeField

* cargo fmt
2022-04-14 07:48:55 -07:00
Srinath Setty
c20da2f58c Cleanup (#27)
* VerificationCircuit --> NIFSVerifierCircuit, for clarity

* InnerCircuit --> StepCircuit

* Rename

* cleanup imports

* additional cleanup in the test

* small cleanup
2022-04-13 17:29:48 -07:00
Srinath Setty
cbc3fe81dc cleanup: merge ecc and ecc_circuit (#25) 2022-04-08 14:19:32 -07:00
Srinath Setty
bebcc94904 support for stable Rust 2022-04-08 13:34:48 -07:00
Srinath Setty
27839896a3 bump version number 2022-04-08 11:03:35 -07:00
porcuquine
648eb0bb6e Fix CS::one() bug in solver. (#24)
* Test and fix solver CS::one() bug.

* Remove unused linear-combination evaluations.

* rustfmt

* Clippy.

Co-authored-by: porcuquine <porcuquine@users.noreply.github.com>
2022-04-08 06:30:52 -07:00
Srinath Setty
e47b6148f4 Verifier circuit (#23)
* ECC scalar multiplication (first draft)

* fix clippy nits

* start implementing the ro gadget: 1st design Poseidon + truncate

* truncate to 128 bits

* implement add + double in constraints

* finish implementing constraints for ecc

* cargo fmt

* input of smul should be an array of bits

* cleanup ro a bit. Make the challenge returned be a vec of allocated bits

* switch to neptune 6.0

* start implementing high level circuit

* incomplete version of the verifier circuit with many TODOS

* optimize ecc ops. add i ==0 case to the circuit

* fix 0/1 constants at the circuit

* wrap CompressedGroupElement of Pallas and Vesta

* cargo fmt

* generate poseidon constants once instead of every time we call get_challenge

* Implement RO-based poseidon to use outside of circuit. Reorganize the repo

* add inner circuit to verification circuit

* start adding folding of the io. there is an error in the first call to  mult_mod

* add test to check that bellperson-nonnative is compatible with nova

* remove swap file

* add another test that fails

* add inputs to the circuits in tests

* rename q to m in circuit.rs. add more tests in test_bellperson_non_native. change a in test_mult_mod to expose error

* push test for equal_with_carried. fix the issue is src/r1cs.rs

* cargo fmt + update the verifier circuit: add folding of X and update all hashes with X

* make limb_width and n_limbs parameters

* make params part of h1

* allocate the field order as constant. add check that z0 == zi when i == 0

* fix error in test_poseidon_ro

* remove merge error

* small fixes

* small fixes to comments

* clippy lints

* small edits; rename tests

* move inputize before from_num

* _limbs --> _bn

* _limbs --> _bn

Co-authored-by: Ioanna <iontzialla@gmail.com>
2022-04-07 14:53:57 -07:00
Srinath Setty
6797e1e042 fix loop bound (#20) 2022-04-01 13:58:54 -07:00
porcuquine
2919fe4e78 Use bellperson v0.19.0. (#18)
Co-authored-by: porcuquine <porcuquine@users.noreply.github.com>
2022-03-22 12:24:45 -07:00
Srinath Setty
e55d4f680b remove test feature (we don't seem to use it) (#17) 2022-02-18 14:14:54 -08:00
porcuquine
853ab90f7c Use pasta_curves 0.3.0. (#15)
Co-authored-by: porcuquine <porcuquine@users.noreply.github.com>
2022-02-15 15:10:11 -08:00
Srinath Setty
5e5dd65abc Update version 2021-10-20 10:31:39 -07:00
Srinath Setty
2a877f9ad0 Update rust.yml 2021-10-20 10:26:28 -07:00
porcuquine
338fbff9ac Add missing doc comments. 2021-10-20 10:19:20 -07:00
porcuquine
c28c421ab9 Use released bellperson 0.18.0. 2021-10-20 10:19:20 -07:00
Srinath Setty
8027bcf056 cargo fmt 2021-10-20 10:19:20 -07:00
Srinath Setty
ff885c4d5d fix bellperson path; address minor clippy-suggested edit 2021-10-20 10:19:20 -07:00
porcuquine
efb73ef325 Rename Prover and ProvingAssignment. 2021-10-20 10:19:20 -07:00
porcuquine
3b668e7ac6 Add support for using bellperson to generate R1CS. 2021-10-20 10:19:20 -07:00
Srinath Setty
6e59ebccd3 add CI (#9) 2021-10-14 16:47:23 -07:00
Srinath Setty
4c711a99a5 bump the version number 2021-10-08 09:55:29 -07:00
porcuquine
3e80c5c8ba Derive more traits. (#7)
Co-authored-by: porcuquine <porcuquine@users.noreply.github.com>
2021-10-08 09:52:36 -07:00
porcuquine
cf5d708202 Add InputOutputMismatch error. 2021-10-06 10:10:37 -07:00
Srinath Setty
f87f9a0580 minor nits 2021-10-05 14:39:48 -07:00
Srinath Setty
5829da790d bump the version number for crates.io 2021-10-04 16:07:17 -07:00
Srinath Setty
61ef5fc0b1 This commit introduces the following changes:
* Separate types for Relaxed R1CS and R1CS instances and witnesses
* Allows creating default values for Relaxed R1CS types
* StepSNARK now folds a regular R1CS instance-witness into a running Relaxed R1CS instance-witness
* We additionally enforce input chaining checks: the incoming instance must have input that matches the output of the incremental computation thus far
2021-10-04 16:07:17 -07:00
porcuquine
de5b8d6598 Support Pasta curves. (#4)
* Support pasta curves directly.

* Upgrade rand.

* Simplify.

* Don't deny missing docs.

Co-authored-by: porcuquine <porcuquine@users.noreply.github.com>
2021-09-27 18:23:40 -07:00
Srinath Setty
bf08877544 fix keyword 2021-09-02 13:57:46 -07:00
Srinath Setty
c1fae7168d fix docs.rs link 2021-09-02 12:57:47 -07:00
Srinath Setty
25913f659a update package name; make modules public and add docs 2021-09-02 12:56:51 -07:00
Srinath Setty
7020d7a714 address clippy 2021-09-02 12:39:01 -07:00
Srinath Setty
45baf52f8d Update README.md acks 2021-09-01 10:25:18 -07:00
Srinath Setty
4b22ef2476 small cleanup 2021-09-01 10:19:56 -07:00
dignifiedquire
3ba8fd28aa refactor: bring back compressed snark
and cleanup some group op traits
2021-09-01 10:19:56 -07:00
Srinath Setty
732d937b09 generic traits for prime field elements and group elements 2021-09-01 10:19:56 -07:00
Srinath Setty
06b1c4d415 remove asserts 2021-07-27 16:30:08 -07:00
Srinath Setty
bb4079e4f0 small fix 2021-07-26 12:00:09 -07:00
Srinath Setty
6075165c54 add acks and references 2021-07-26 11:58:39 -07:00
Srinath Setty
d52be5cf4a small fixes 2021-07-23 15:03:51 -07:00
Srinath Setty
ba3a1e3922 initial commit 2021-07-23 14:15:07 -07:00
Microsoft Open Source
a3f1ded9d2 SUPPORT.md committed 2021-07-22 10:43:53 -07:00
Microsoft Open Source
fe260cdfeb SECURITY.md committed 2021-07-22 10:43:53 -07:00
Microsoft Open Source
96d7d259d0 README.md updated to template 2021-07-22 10:43:52 -07:00
Microsoft Open Source
8275225b4c LICENSE updated to template 2021-07-22 10:43:51 -07:00
Microsoft Open Source
52ae0b73df CODE_OF_CONDUCT.md committed 2021-07-22 10:43:51 -07:00
Srinath Setty
a33960c80e Initial commit 2021-07-22 10:39:33 -07:00