66 Commits

Author SHA1 Message Date
wborgeaud
1e5a503a14
Merge pull request #127 from mir-protocol/reducing_gate
Add `ReducingGate` to compute reductions by `alpha` of base field elements
2021-07-25 18:14:40 +02:00
wborgeaud
c16d93ab33 scaling.rs -> reducing.rs 2021-07-23 17:31:00 +02:00
wborgeaud
ca540a8475 Working fri_combine_initial 2021-07-23 17:29:31 +02:00
wborgeaud
19140e39b2 Update comment 2021-07-23 15:01:45 +02:00
wborgeaud
f325586beb Replace exp_from_complement_bits with simpler method 2021-07-23 14:58:41 +02:00
wborgeaud
6f8053cc37 Forgot to exponentiate from bits in computation of subgroup_x. Saves 80 gates. 2021-07-23 08:53:00 +02:00
wborgeaud
9a1c289f8e Merge branch 'main' into remove_acc_in_gmimc
# Conflicts:
#	src/gadgets/arithmetic.rs
2021-07-23 08:16:23 +02:00
Nicholas Ward
3612b9f05e Merge branch 'main' into order_bigint 2021-07-22 13:28:48 -07:00
wborgeaud
e87aa2c90b Renaming 2021-07-22 16:25:47 +02:00
wborgeaud
1d92191227 Make exp_complement_bits take an iterator to avoid cloning. 2021-07-22 16:18:13 +02:00
wborgeaud
c729a3c235 Remove all non-bits indices in the FRI verifier 2021-07-22 16:07:07 +02:00
wborgeaud
22fcc3bc06 Pass bits around 2021-07-22 15:10:55 +02:00
wborgeaud
be2e870aee PR feedback 2021-07-22 06:50:07 +02:00
Nicholas Ward
7f92a33964 cargo fmt 2021-07-21 13:05:40 -07:00
Nicholas Ward
1dd850b0e5 fixes 2021-07-21 13:05:32 -07:00
wborgeaud
6fff9363c6 Use mul_many 2021-07-21 20:06:29 +02:00
wborgeaud
a54a4e5830 Merge branch 'main' into avoid_rotating 2021-07-21 20:02:22 +02:00
wborgeaud
7c1c082a39 Comments 2021-07-21 19:53:32 +02:00
Nicholas Ward
906a0c00f4 Merge branch 'main' into order_bigint 2021-07-20 15:42:51 -07:00
Nicholas Ward
b103c0774f progress 2021-07-20 15:42:27 -07:00
Daniel Lubarov
ac1872a8c8
FRI tweaks (#111)
- Call `exp_power_of_2` instead of manual squaring
- Replace `evaluations[i]` with `evals`
2021-07-20 12:49:02 -07:00
wborgeaud
925c0bcb5c Replace rotation with exp in compute_evaluation 2021-07-20 15:25:03 +02:00
wborgeaud
0d233505d7 Merge branch 'main' into precomputed_reduced_evals
# Conflicts:
#	src/fri/recursive_verifier.rs
2021-07-20 11:08:53 +02:00
wborgeaud
fbeedd47d3 Minor 2021-07-20 11:02:22 +02:00
wborgeaud
38f4cca3f5 Target version 2021-07-20 10:57:20 +02: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
8868378fda
Merge pull request #103 from mir-protocol/remove_frobenius_opening
Remove openings at the Frobenius of zeta
2021-07-19 16:57:19 +02:00
wborgeaud
52cc7c79f5 Remove openings at the Frobenius of zeta 2021-07-19 16:45:38 +02:00
wborgeaud
9baea1ae26 Trim final poly and check FRI arity 2021-07-19 16:24:21 +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
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
2e12ee8e82 Minor 2021-07-15 10:13:13 +02:00
wborgeaud
7dec6efc6c Rewrite Markable to avoid Arcs 2021-07-15 09:52:42 +02:00
wborgeaud
92c4bba2a3 Fix bug in GMiMC 2021-07-14 21:16:04 +02:00
wborgeaud
7793b5a956 Identify problem in GMiMc 2021-07-14 20:54:30 +02:00
wborgeaud
5c2c01b1ab Circuit compiles 2021-07-13 15:20:14 +02:00
wborgeaud
ad24f5d4d1 Almost working recursive verifier 2021-07-12 14:25:28 +02:00
wborgeaud
cc3c278a92 Some renaming 2021-07-01 17:34:00 +02:00
wborgeaud
625377b4c0 Merge constant and sigma polynomials 2021-06-25 11:24:26 +02:00
wborgeaud
bfd5f06384 Hardcode Plonk polynomials indices and blinding flags. 2021-06-17 11:54:31 +02:00
wborgeaud
930e117185 Minor 2021-06-17 11:35:10 +02:00
wborgeaud
5bebc746f6 PR feedback 2021-06-17 11:31:14 +02:00
wborgeaud
eaba5238a6 Change PoW to checking leading zeros 2021-06-17 09:49:41 +02:00
wborgeaud
8d999ab299 Rewrite insert gadget. 2021-06-16 10:43:18 +02:00
wborgeaud
4437012d2a Add num_bits to exp. 2021-06-16 08:56:58 +02:00
wborgeaud
8200bdcedc Add num_bits in split_low_high. 2021-06-16 08:40:28 +02:00
wborgeaud
cfa5807556 Add insert gadget to insert inferred leaf in FRI query rounds 2021-06-14 15:15:22 +02:00
wborgeaud
670e48380a Finish recursive verifier 2021-06-14 13:26:22 +02:00
wborgeaud
5200d70cf0 Add interpolation gadgets 2021-06-11 16:22:29 +02:00