Commit Graph

95 Commits

Author SHA1 Message Date
Srinath Setty
704d48b528 update to the latest pasta-msm crate (#89) 2022-07-13 17:00:16 -07:00
Srinath Setty
e373f4633d edits to address clippy with the latest Rust (#90) 2022-07-13 14:46:13 -07:00
Srinath Setty
a04566bb81 MinRoot example improvements (#88)
* support multiple iterations of MinRoot per Nova step

* small edits to println

* fix declaration
2022-07-11 13:00:42 -07:00
Srinath Setty
ff40d17cc4 Nova-based VDF using MinRoot as an example (#86)
* add the MinRoot VDF example

* optimize a bit

* optimization and cleanup

* clippy

* add examples to CI

* use inbuilt pow_vartime
2022-07-07 18:30:43 -07:00
Srinath Setty
63f08c0e4a Support non-determinism with a minimal API (#85)
* support non-determinism with small changes to the interface

* update benches to use the new API

* add an example that exercises non-deterministic advice at each step of recursion

* tiny rename

* Address clippy; update version
2022-07-07 12:17:56 -07:00
Srinath Setty
6667d2f8b5 Abstract the RO used in the circuit with traits (#84)
* cleanup RO usage inside the circuit: use traits

* Add a note

* rename types for clarity
2022-07-05 16:24:12 -07:00
Srinath Setty
0863a732ff Add asserts for constraint count (#83)
* Add asserts for constraint count

* switch to Standard strength
2022-07-05 14:50:17 -07:00
Srinath Setty
c29030b2d7 Release Candidate (#82)
* update version and README

* move tests to bellperson adapter and remove tests folder; make bellperson adapter private
2022-07-01 16:03:19 -07:00
Srinath Setty
0ff2e57bfa Spartan variant with an IPA-based polynomial commitment scheme for compressing IVC proofs (#80)
* cleanup code

* compiles

* additional plumbing

* add padding

* Add missing file

* integrate

* add a separate test

* cleanup

* cleanup

* add checks for outer sum-check

* sum-checks pass

* sum-checks pass

* sum-checks pass

* Add polycommit checks to the end

* switch to pasta_msm

* clippy

* remove int_log

* switch to pasta_curves

* clippy

* clippy

* add a special case for bases.len() = 1

* use naive MSM to avoid SIGFE error for smaller MSMs

* add rayon parallelism to naive MSM

* update comment since we already implement it

* address clippy

* cleanup map and reduce code

* add parallelism to final SNARK creation and verification

* add par

* add par

* add par

* add par

* store padded shapes in the parameters

* Address clippy

* pass padded shape in params

* pass padded shape in params

* cargo fmt

* add par

* add par

* Add par

* cleanup with a reorg

* factor out spartan-based snark into a separate module

* create traits for RelaxedR1CSSNARK

* make CompressedSNARK parameterized by a SNARK satisfying our new trait

* fix benches

* cleanup code

* remove unused

* move code to Spartan-based SNARK

* make unused function private

* rename IPA types for clarity

* cleanup

* return error types; rename r_j to r_i

* fix duplicate code
2022-07-01 15:53:00 -07:00
iontzialla
81b12232fe Add benches (#79)
* add benches

* fix error

* put snark in a black_box when benchmarking verification time

* fix error in benches
2022-06-14 12:32:44 -07:00
iontzialla
bf35556b90 Complete addition: handle addition of equal numbers and addition of negation (#78)
* make addition complete. test addition corner cases. optimizations

* optimization and comment

* fix errors

* all tests pass
2022-06-09 11:22:15 -07:00
Srinath Setty
a7da105677 IVC proof compression APIs and implementation (#77)
We currently implement a constant-factor compression, but in the future we will provide an exponential reduction in proof sizes
2022-05-27 01:05:01 -07:00
Srinath Setty
8308c29f94 use pasta_msm crate for MSM (#75)
* use pasta_msm crate for MSM

* add repr-c to pasta_curves

* add +stable

* update pasta-msm version
2022-05-26 17:27:19 +05:30
Srinath Setty
0154358469 Verifier's checks (#73)
* begin adding verification checks

* add verifier checks

* remove unnecessary dead_code
2022-05-18 15:42:02 +05:30
Srinath Setty
b080bac949 Update README.md (#72) 2022-05-18 09:03:24 +05:30
Srinath Setty
4970826f0f small cleanup (#71) 2022-05-18 08:23:07 +05:30
Samuel Burnham
25cd5ec279 Fix Wasm support (#64)
* Fix dependencies

* Replace rug with num-bigint
2022-05-17 18:51:48 +05:30
Srinath Setty
dbe8837991 Update README.md (#70)
* Update README.md

* Update README.md
2022-05-17 18:51:31 +05:30
Srinath Setty
188a7c5640 Add a non-trivial step circuit (#66) 2022-05-17 06:08:42 -07:00
Srinath Setty
1fd4eee2b6 Recursion implementation (#65)
* recursion attempt

* address clippy

* initialize the running instance and witness of the primary correctly

* add asserts for debugging

* fix a bug in AllocatedPoint

* add debug statements

* fix an issue with how we inputize hashes; remove debug statements

* rename

* cleanup

* speedup tests

* require step_circuit implementors to provide a way to execute step computation
2022-05-17 05:59:29 -07:00
Srinath Setty
4311ad1c1b cleanup trivial (#63) 2022-05-15 06:59:10 -07:00
Srinath Setty
07b3c4289b Recursion APIs (#62)
* recursion APIs (WIP)

* PublicParams struct and associated new

* fix build

* draft of APIs

* start with tests

* add a test case for the base case of recursion
2022-05-15 12:05:18 +05:30
Srinath Setty
e8a6e45b3c move StepSNARK to nifs.rs in prep for recursion APIs (#61)
* move StepSNARK to nifs.rs in prep for recursion APIs

* clippy
2022-05-14 18:59:42 -07:00
iontzialla
9f7c12dbc5 Base case for second circuit (#60)
* output the incoming instance as the running instance in one of the circuits

* Make some verifier circuit inputs optional (for base case)
2022-05-14 07:56:57 -07:00
Srinath Setty
3193d67bce delegate sampling of generators to trait implementors (#59) 2022-05-14 12:16:22 +05:30
Srinath Setty
36d4be2145 take ro_constants as a parameter (#58) 2022-05-14 10:50:10 +05:30
Srinath Setty
6ac9c7706d precompute R1CSShape's digest (#57) 2022-05-13 07:53:21 -07:00
Srinath Setty
fab07689eb remove unneeded tracking and checks (#55)
* remove unneeded tracking and checks

* remove unused error type
2022-05-13 14:50:42 +05:30
Srinath Setty
562fa71027 move from rug to num-bigint (#53) 2022-05-13 01:50:37 -07:00
Srinath Setty
677fe23673 Switch RO to use the one in the Group trait (#54)
* switch to RO in the Group trait

* simplify compression

* absorb IO as bignum for relaxedR1CS
2022-05-13 01:49:34 -07:00
Srinath Setty
82b7fabd9d absorb running instance separately (for clarity) (#52) 2022-05-12 23:18:53 -07:00
Srinath Setty
706d688a13 add hash(params, U, z0, zi, i) when generating a challenge (#51)
* add hash(params, U, z0, zi, i) when generating a challenge

* address clippy
2022-05-12 22:34:12 -07:00
Srinath Setty
ccc6dc3a04 Truncate digest bits (#50)
* apply a hash function before adding to transcript

* truncate shape_digest into 250 bits

* add missing file

* fix clippy

* cargo fmt
2022-05-12 22:08:43 -07:00
Srinath Setty
0d53db18e3 implement transcript methods for various types (#49)
* implement transcript methods for various types

* address clippy

* add shape to transcript
2022-05-11 23:58:43 -07:00
Srinath Setty
485eb3fac6 fix build (#48)
* fix build

* switch to stable
2022-05-10 23:27:27 -07:00
Srinath Setty
f11a8f19d1 trait updates to support using Poseidon as RO (#43) 2022-05-10 22:36:24 -07:00
Arthur Greef
9a466d1467 Change alloc_num_equals arguments to references (#45) 2022-04-30 04:14:38 +05:30
Srinath Setty
bcbdec2982 Accelerated MSM prep (#41)
* remove send + sync

* introduce a new associative type to capture any form of preprocessing on group elements

* update pasta_curves version

* simplify trait requirements

* fix clippy
2022-04-25 21:09:47 -07:00
Srinath Setty
3445d7da61 remove unused constants (#40) 2022-04-25 18:40:09 -07:00
Srinath Setty
751b3434ec make gadgets public, expose coords, cleanup (#39)
* make gadgets public, expose coords, cleanup

* fix clippy
2022-04-25 16:11:56 -07:00
Srinath Setty
fd0b0b787b remove unused where (#38) 2022-04-25 15:58:30 -07:00
Samuel Burnham
fbc855d1d6 Wasm support (#34)
* Bump commit.

* Add wasm support

* Add nix build

* Update bellperson

* Update bellperson

* Remove Nix

* Remove .envrc

* Always use bellperson

* Use updated bellperson-nonnative

* Update bellperson-nonnative

Co-authored-by: porcuquine <porcuquine@users.noreply.github.com>
Co-authored-by: Anders Christiansen Sørby <anders@sorby.xyz>
2022-04-25 15:58:16 -07:00
iontzialla
4656a7179d Refactor circuit code (#37)
* update crate versions

* refactor

* small tweaks

* run cargo fmt

* fix comments

* remove unused code

* address clippy

Co-authored-by: Srinath Setty <srinath@microsoft.com>
2022-04-25 14:54:53 -07:00
Srinath Setty
72920fb62b update crate versions (#36)
This PR updates the crate versions of neptune, bellperson, and bellperson-nonnative to the latest.
2022-04-25 12:45:20 -07:00
Srinath Setty
beb6dace82 add tinyr1cs example using bellperson (#33)
* add tinyr1cs example using bellperson

* clippy
2022-04-21 14:41:05 -07:00
Srinath Setty
c2106e8109 Base case cleanup (#32)
* small cleanup

* small cleanup
2022-04-21 13:20:08 -07:00
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