764 Commits

Author SHA1 Message Date
Nicholas Ward
40f5dc6a1f basic test action 2021-08-06 16:31:07 -07:00
wborgeaud
a255c320ac
Merge pull request #157 from mir-protocol/remove_reverse_limbs
Remove reversed limbs sum
2021-08-05 21:37:58 +02:00
Daniel Lubarov
7b20f342df
More eval_unfiltered_recursively tweaks (#156) 2021-08-05 08:03:49 -07:00
Daniel Lubarov
6aaebfcac9
Optimize BaseSumGate's eval_unfiltered_recursively (#155) 2021-08-05 08:03:37 -07:00
wborgeaud
fcc717e923 Remove useless mut 2021-08-05 16:06:48 +02:00
wborgeaud
df07909f1e Merge branch 'main' into remove_reverse_limbs 2021-08-05 16:04:16 +02:00
wborgeaud
693fd4f8d6 Minor 2021-08-05 13:51:26 +02:00
wborgeaud
83fe4d5cc0 Update comment 2021-08-05 13:48:37 +02:00
wborgeaud
5418026082 Remove reversed sum from BaseSumGate 2021-08-05 13:47:33 +02:00
Daniel Lubarov
58204e3703 unused 2021-08-04 18:14:16 -07:00
Nicholas Ward
4eb8153895
Merge pull request #154 from mir-protocol/random_access_gadget
added random access gadget
2021-08-04 14:31:08 -07:00
Nicholas Ward
c7093cd551 addressed comments 2021-08-04 14:19:06 -07:00
Daniel Lubarov
bf385c2760
Batch inversion in wires_permutation_partial_products (#152) 2021-08-04 11:30:08 -07:00
Nicholas Ward
32c8c366bf added random access gadget 2021-08-04 10:58:12 -07:00
Daniel Lubarov
079baff718
Optimize some exp methods to use ExponentiationGate (#151) 2021-08-04 09:55:29 -07:00
Daniel Lubarov
8b8e4d223d
Optimize witness generation a bit (#153)
Mainly storing pending generators in a Vec rather than a HashMap.  Requires an extra check to make sure we don't run one twice after adding it to the Vec twice.
2021-08-04 09:55:11 -07:00
Daniel Lubarov
79af87535a get_extension_targets 2021-08-04 09:54:34 -07:00
Daniel Lubarov
2d9891983f
Add a reduce_polys_base (#149)
* Add a reduce_polys_base

Reducing the polynomials in `open_plonk` was taking ~100ms on my machine. It was converting BF polynomials to the EF early on; by doing more work in the BF we can reduce it to ~20ms.

* PR feedback
2021-08-03 13:00:50 -07:00
Nicholas Ward
bb1c083e1e
Merge pull request #148 from mir-protocol/random_access_gate
Random access gate
2021-08-03 12:07:39 -07:00
Nicholas Ward
0ecaf40839 addressed comment 2021-08-03 12:07:02 -07:00
Nicholas Ward
d19ce67c2d renamed element_to_compare --> claimed_element 2021-08-03 09:24:55 -07:00
Nicholas Ward
ed49bbc7f2 cleanup 2021-08-03 09:03:14 -07:00
Nicholas Ward
fa5a5c5ebf cargo fmt 2021-08-03 08:59:25 -07:00
Nicholas Ward
51473b48d9 merge 2021-08-03 08:54:45 -07:00
Nicholas Ward
1db727d954 addressed comments 2021-08-03 08:53:20 -07:00
Daniel Lubarov
b1633dc48d
More par_iter (#150) 2021-08-03 07:39:36 -07:00
Nicholas Ward
acc59327e7 random access gate 2021-08-02 17:58:45 -07:00
Nicholas Ward
53f1acc566 random access gate 2021-08-02 17:01:51 -07:00
Daniel Lubarov
f150f7ec09
More timing code for FRI prover (#146) 2021-08-02 15:49:06 -07:00
Daniel Lubarov
9fb780d34e
Move evaluation of L_1(x) outside of loop (#147)
Just a minor optimization.
2021-08-02 15:27:48 -07:00
Daniel Lubarov
5c96e7b366 Trivial fixes from "cargo fix" 2021-08-02 10:58:03 -07:00
Daniel Lubarov
d6211b8ab8
Reuse a buffer of generated values (#142)
* Reuse a buffer of generated values

To avoid allocating `GeneratedValues` all the time. Saves ~60ms or so.

* PR feedback
2021-08-02 10:55:10 -07:00
wborgeaud
730962ceac
Merge pull request #145 from mir-protocol/test_eval_fns
Test `eval_unfiltered_*` functions
2021-08-02 19:50:27 +02:00
Daniel Lubarov
63e78826ae Imports 2021-08-02 10:41:02 -07:00
Daniel Lubarov
1229d90fae
Add a tree of scopes for proving times (#141)
* Add a tree of scopes for proving times

To replace the old `timed!` macro, which had no hierarchy.

It's similar to `ContextTree`, which tracks gate counts of circuit operations.

This gives a more organized output, with indentation levels based on scope depth, parent durations listed before child durations, etc.

* PR feedback
2021-08-02 10:38:09 -07:00
wborgeaud
08b018fc02
Merge pull request #144 from mir-protocol/optimize_small_exp_u64
Hardcode small exponents in `exp_u64_extension`
2021-08-02 19:12:07 +02:00
wborgeaud
f564498f0b
Merge pull request #143 from mir-protocol/exponentiation_nits
Small nits for the exponentiation gate
2021-08-02 19:10:53 +02:00
wborgeaud
2bbcf17699 Test eval_unfiltered_* functions 2021-08-02 14:17:42 +02:00
wborgeaud
df690f92bf Hardcode small exponents in exp_u64_extension 2021-08-02 13:31:12 +02:00
wborgeaud
fc9d64defe Small nits for the exponentiation gate 2021-08-02 13:12:50 +02:00
Daniel Lubarov
36a1386c6f
Small fix in arithmetic_extension_special_cases (#140)
This is detecting the case where we multiply something by 1 and add 0.  In that case we can just return the thing being multiplied by 1. We were using the wrong constant to detect this.

Reduces the cost of `compute_evaluation` from 8 to 6 gates.
2021-07-30 12:00:24 -07:00
Daniel Lubarov
94b85b0806
Small optimization -- use mul_add instead of mul + add (#137) 2021-07-30 09:03:23 -07:00
Daniel Lubarov
50b07f2ceb
Special cases for extension field arithmetic (#138)
We previously checked for special cases, like arithmetic on constant Targets, in `arithmetic`. We can handle those cases without actually adding an `ArithmeticGate`.

Now that `arithmetic` just calls `arithmetic_extension`, it makes more sense to check for special cases in the latter method, so it applies to both base and extension field arithmetic.

Reduces gate count from 16149 to 15689.
2021-07-30 09:03:11 -07:00
Daniel Lubarov
bb316fb146
Use batch inversion to compute the quoients for Z (#136)
Shaves about a second off the recursive proof time! Down to 2.45s on my laptop.
2021-07-30 09:02:56 -07:00
Daniel Lubarov
018fb005f8
Move stuff around (#135)
No functional changes here. The biggest change was moving certain files into new directories like `plonk` and `iop` (for things like `Challenger` that could be used in STARKs or other IOPs). I also split a few files, renames, etc, but again nothing functional, so I don't think a careful review is necessary (just a sanity check).
2021-07-29 22:00:29 -07:00
Nicholas Ward
c02d48036e
Merge pull request #134 from mir-protocol/exp_gate_config
Exponentiation gate calculates number of bit wires
2021-07-29 15:37:03 -07:00
Nicholas Ward
9eda81c293 minor changes 2021-07-29 15:31:04 -07:00
Nicholas Ward
8440a4cbdf fix 2021-07-29 15:15:40 -07:00
Nicholas Ward
cfda56e3d3 Merge branch 'main' into exp_gate_config 2021-07-29 14:19:24 -07:00
Nicholas Ward
a111fc3164 fixes 2021-07-29 14:18:18 -07:00