82 Commits

Author SHA1 Message Date
Daniel Lubarov
7d8bac7169
Change FFT methods to accept references (#115) 2021-07-21 08:26:41 -07:00
Daniel Lubarov
8438d23937
Tree of scopes (#106)
* Tree of scopes

This is an extension of the context concept.

Earlier I was planning to store a simple stack of contexts, but I ended up storing the whole history, in a tree structure. This gives us more control over the output, i.e. we can print the gate count of a parent scope before those of its child scopes, which seems more user-friendly.

Sample gate count output:

    [2021-07-19T18:09:24Z INFO  plonky2::circuit_builder] 27829 gates to root
    [2021-07-19T18:09:24Z INFO  plonky2::circuit_builder] | 2373 gates to evaluate the vanishing polynomial at our challenge point, zeta.
    [2021-07-19T18:09:24Z INFO  plonky2::circuit_builder] | | 1284 gates to evaluate gate constraints
    [2021-07-19T18:09:24Z INFO  plonky2::circuit_builder] | 25312 gates to verify FRI proof
    [2021-07-19T18:09:24Z INFO  plonky2::circuit_builder] | | 650 gates to verify 0'th FRI query
    [2021-07-19T18:09:24Z INFO  plonky2::circuit_builder] | | | 96 gates to check FRI initial proof
    [2021-07-19T18:09:24Z INFO  plonky2::circuit_builder] | | | 65 gates to compute x from its index
    [2021-07-19T18:09:24Z INFO  plonky2::circuit_builder] | | | 233 gates to combine initial oracles
    ...

Sample copy constraint failure:

    Error: Copy constraint 'root > verify FRI proof > verify 0'th FRI query > check FRI initial proof > verify 0'th initial Merkle proof > check Merkle root: 0-th hash element' between wire 12 of gate #2550 [...] and wire 0 of gate #0 [...] is not satisfied. Got values of 6861386743364621393 and 0 respectively.

* No min

* info -> debug

* Move to its own file
2021-07-19 12:22:18 -07:00
wborgeaud
52cc7c79f5 Remove openings at the Frobenius of zeta 2021-07-19 16:45:38 +02:00
Daniel Lubarov
d11bcd1928
Optional zk (#101)
* Make ZK optional

* Remove rate from FriConfig

Seems redundant, and we've had some tests break due to the two fields not matching.

* zero_knowledge: false in bench
2021-07-18 23:24:33 -07:00
wborgeaud
b7d51db979 Fix merge problems 2021-07-19 07:11:40 +02:00
wborgeaud
461f24a57e Merge branch 'main' into more_recursive_verifier
# Conflicts:
#	src/polynomial/commitment.rs
#	src/proof.rs
2021-07-19 07:08:06 +02:00
Daniel Lubarov
77ce69dc15
Proof serialization (#93)
Using `serde_cbor` for now. It's probably far from optimal, as we have many `Vec`s which I assume it will prefix with their lengths, but it's a nice and easy method for now.
2021-07-15 07:35:12 -07:00
Daniel Lubarov
83a1430038
Fix some warnings (#94) 2021-07-15 07:34:46 -07:00
wborgeaud
2e12ee8e82 Minor 2021-07-15 10:13:13 +02:00
wborgeaud
0ba5916346 Minor 2021-07-15 09:11:54 +02:00
wborgeaud
becd0c969e Merge branch 'main' into more_recursive_verifier
# Conflicts:
#	src/gadgets/insert.rs
#	src/plonk_common.rs
#	src/verifier.rs
2021-07-15 09:01:36 +02:00
Daniel Lubarov
c678c55452 Imports 2021-07-14 21:43:55 -07:00
wborgeaud
c3d53392c4 Problem in permutation argument 2021-07-14 08:14:00 +02:00
wborgeaud
ad24f5d4d1 Almost working recursive verifier 2021-07-12 14:25:28 +02:00
wborgeaud
b50a9809db Start recursive verifier test 2021-07-08 17:16:26 +02:00
wborgeaud
805ebb1b0d Working verifier 2021-07-08 15:13:29 +02:00
wborgeaud
b86e60a397 Open the partial products polynomials only at zeta 2021-07-01 18:24:49 +02:00
wborgeaud
cc3c278a92 Some renaming 2021-07-01 17:34:00 +02:00
wborgeaud
59410447bf Add lengths to CommonData 2021-07-01 15:41:01 +02:00
wborgeaud
bae3777bcd Use max filtered degree found with the tree method in CircuitBuilder::build 2021-06-29 14:00:34 +02:00
Daniel Lubarov
7734aed62c
Performance tweaks (#77) 2021-06-28 08:56:36 -07:00
wborgeaud
c2b2ef921a PR feedback 2021-06-28 09:47:47 +02:00
wborgeaud
625377b4c0 Merge constant and sigma polynomials 2021-06-25 11:24:26 +02:00
wborgeaud
727919b14f Comment and test for coset_ifft 2021-06-25 10:20:20 +02:00
wborgeaud
35f73a505f Clippy 2021-06-24 15:49:36 +02:00
wborgeaud
31f4eee367 Fix bug with shifted x 2021-06-24 14:11:47 +02:00
wborgeaud
f215dffa9d Compute quotient directly 2021-06-24 11:45:16 +02:00
wborgeaud
ef7561fc84 Merge branch 'main' into permutation_argument
# Conflicts:
#	src/circuit_builder.rs
#	src/circuit_data.rs
#	src/polynomial/commitment.rs
#	src/prover.rs
#	src/witness.rs
2021-06-24 10:51:18 +02:00
wborgeaud
492b04843e Optimize some polynomial operations to avoid cloning. 2021-06-23 11:41:32 +02:00
wborgeaud
01053ab96a Fix bug 2021-06-23 11:30:57 +02:00
wborgeaud
9db7dce738 scale -> reduce 2021-06-17 22:06:53 +02:00
wborgeaud
92e0f60c23 Clippy 2021-06-17 21:57:31 +02:00
wborgeaud
fe9cd3f76b Working commitments and verifier 2021-06-17 21:34:04 +02:00
wborgeaud
ad5c18b499 Comments and Clippy 2021-06-17 16:23:15 +02:00
wborgeaud
a71909ba15 Implement compute_z and rewrite of compute_vanishing_polys 2021-06-17 15:49:21 +02:00
wborgeaud
bfd5f06384 Hardcode Plonk polynomials indices and blinding flags. 2021-06-17 11:54:31 +02:00
wborgeaud
b44a01c975 Merge main 2021-06-15 09:20:00 +02:00
wborgeaud
19b47b5251 Clippy 2021-06-14 10:33:38 +02:00
wborgeaud
20741cfb4a Implement out-of-circuit repeated_frobenius using hardcoded constants 2021-06-11 13:45:51 +02:00
Daniel Lubarov
f929f94626
Have rustfmt group imports (#60)
* Have rustfmt group imports

See `rustfmt.toml`; the rest is automated changes.

* fmt
2021-06-10 14:10:35 -07:00
Daniel Lubarov
60f3773a23
Try to simplify open_plonk and fri_combine_initial a bit more (#59)
* Try to simplify open_plonk and fri_combine_initial a bit more

- Use `alpha.powers()` in `open_plonk` instead of the more "manual" approach
- No more "manually" reducing with `alpha_powers`; now using helper methods for that.
- Renaming & other small tweaks

* Remove type hint

* Feedback
2021-06-09 16:17:56 -07:00
wborgeaud
7f63276623 Merge branch 'main' into recursive_verifier 2021-06-09 10:04:45 +02:00
Daniel Lubarov
72c2e19bc5
Bit of verifier work (#54)
* Bit of verifier work

* Minor

* next_plonk_zs now available after William's changes
2021-06-08 21:23:52 -07:00
wborgeaud
897ec3b053 Target version of proof structs 2021-06-04 10:47:46 +02:00
wborgeaud
9eb35c3c82 Remove D=1 case 2021-06-01 22:00:46 +02:00
wborgeaud
482b40065d Merge with main 2021-06-01 11:26:23 +02:00
wborgeaud
b465bcd8be Clippy + comments 2021-06-01 11:17:54 +02:00
wborgeaud
2794cb9a95 Open wires at single point if D=1 2021-06-01 11:03:04 +02:00
wborgeaud
e09a6179fb Remove useless field 2021-05-31 18:21:42 +02:00
wborgeaud
d882283761 Working with blindings 2021-05-31 18:19:44 +02:00