104 Commits

Author SHA1 Message Date
Daniel Lubarov
6bd197e9cf
Observe public inputs (#119)
* Observe public inputs

* Observe the hash instead
2021-07-22 10:27:10 -07:00
Daniel Lubarov
01461ce388 Update a TODO 2021-07-21 21:25:52 -07:00
Daniel Lubarov
eb18c7ea33
Faster witness generation (#116)
Saves ~300ms in the test. The main change is to have generators return fixed-size `Vec`s instead of `HashMap`s, which have more overhead.
2021-07-21 08:26:34 -07:00
Daniel Lubarov
b8ce1d1967
Public inputs (#113)
With this approach, we don't need `Target::PublicInput`; any routable `Target` can be marked as a public input via `register_public_input`.  The circuit itself hashes these targets, and routes the hash output to the first four wires of a `PublicInputGate`, which is placed at an arbitrary location in the circuit.

All gates have direct access to the purported hash of public inputs. We could think of them as accessing `PI_hash_i(x)` (as in Plonk), but these are now (four) constant functions, so they effectively have direct access to the hash itself.

`PublicInputGate` checks that its first four wires match this purported public input hash. The other gates ignore the hash.

Resolves #64.
2021-07-21 08:26:19 -07: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
Daniel Lubarov
0a5d46bfa9
Have prove return Result (#100)
* Have `prove` return `Result`

To address that TODO.

* PR feedback
2021-07-18 23:14:48 -07: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
83a1430038
Fix some warnings (#94) 2021-07-15 07:34:46 -07:00
wborgeaud
4bc06deed8 zs_root -> zs_partial_products_root 2021-07-15 10:59:53 +02:00
wborgeaud
fe05da6720 Clipp 2021-07-15 10:39:57 +02:00
wborgeaud
7d41785ac6 Comments 2021-07-15 10:24:11 +02:00
wborgeaud
2e12ee8e82 Minor 2021-07-15 10:13:13 +02:00
wborgeaud
7793b5a956 Identify problem in GMiMc 2021-07-14 20:54:30 +02:00
wborgeaud
dcdbb6be33 Check copy constraints in PartialWitness 2021-07-14 18:44:58 +02:00
wborgeaud
c3d53392c4 Problem in permutation argument 2021-07-14 08:14:00 +02:00
wborgeaud
5c2c01b1ab Circuit compiles 2021-07-13 15:20:14 +02:00
wborgeaud
139430c549 Fixed GMiMC 2021-07-13 09:15:16 +02:00
wborgeaud
ad24f5d4d1 Almost working recursive verifier 2021-07-12 14:25:28 +02:00
wborgeaud
805ebb1b0d Working verifier 2021-07-08 15:13:29 +02:00
wborgeaud
274ec48f5e Update comments 2021-07-06 11:19:58 +02:00
wborgeaud
50cafca705 Partial products of quotient 2021-07-06 10:51:32 +02:00
wborgeaud
b5b2ef9f3e Clippy 2021-07-02 11:01:20 +02:00
wborgeaud
1915ef9b27 Minor improvements 2021-07-02 10:58:59 +02:00
wborgeaud
90bdb5796c Fix product bug 2021-07-02 09:55:28 +02:00
wborgeaud
cc3c278a92 Some renaming 2021-07-01 17:34:00 +02:00
wborgeaud
20e6d6540f Add comments 2021-07-01 17:28:30 +02:00
wborgeaud
59410447bf Add lengths to CommonData 2021-07-01 15:41:01 +02:00
wborgeaud
c83382aaaa Working partial products 2021-07-01 15:20:16 +02:00
wborgeaud
f7c4a463fc Progress 2021-06-30 18:54:28 +02:00
wborgeaud
b8e764bb90 Allow for degree^2 < num_routed_wires 2021-06-30 16:48:41 +02:00
wborgeaud
a0298a61f4 Added partial products 2021-06-30 15:05:40 +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
810d1869a1 Minor improvements 2021-06-25 11:49:29 +02:00
wborgeaud
625377b4c0 Merge constant and sigma polynomials 2021-06-25 11:24:26 +02:00
wborgeaud
2e9d3f768e Better error message when quotient hasn't correct degree 2021-06-25 09:56:15 +02:00
wborgeaud
19e7cb3942 into_iter -> into_par_iter 2021-06-24 22:32:52 +02:00
wborgeaud
35f73a505f Clippy 2021-06-24 15:49:36 +02:00
wborgeaud
b0550979a6 Optimize evaluation of Z_H on coset. 2021-06-24 15:42:29 +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
4ee70e449b Fix type errors and move copy constraints check to Witness 2021-06-24 11:00:47 +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
6c864ca522 Merge branch 'main' into fix_target_partition
# Conflicts:
#	src/witness.rs
2021-06-23 14:17:02 +02:00
wborgeaud
bc90909fa3 Add check of copy constraints after witness generation 2021-06-23 14:16:05 +02:00
wborgeaud
3bc27c65ef Rollback to previous semantics 2021-06-23 13:46:19 +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
1b99f8272f Merge branch 'main' into permutation_argument 2021-06-17 14:00:44 +02:00
wborgeaud
bfd5f06384 Hardcode Plonk polynomials indices and blinding flags. 2021-06-17 11:54:31 +02:00