49 Commits

Author SHA1 Message Date
wborgeaud
9a1c289f8e Merge branch 'main' into remove_acc_in_gmimc
# Conflicts:
#	src/gadgets/arithmetic.rs
2021-07-23 08:16:23 +02:00
wborgeaud
ca3a2fcfc8 Clippy 2021-07-22 16:09:54 +02:00
wborgeaud
15a64017dc We need only 126 wires now 2021-07-22 14:42:42 +02:00
wborgeaud
467485c3f0 Remove accumulator wires in GMiMCGate 2021-07-22 14:33:02 +02:00
wborgeaud
3a24e8f4c1 Manually implement eval_unfiltered_base for all gates 2021-07-22 14:00:55 +02: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
35c8643681 Tiny cleanup 2021-07-18 23:31:21 -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
097413479e PR feedback 2021-07-18 10:35:42 +02:00
wborgeaud
fe05da6720 Clipp 2021-07-15 10:39:57 +02:00
wborgeaud
139430c549 Fixed GMiMC 2021-07-13 09:15:16 +02:00
wborgeaud
fc0f8a78ce First try 2021-07-02 14:13:57 +02:00
wborgeaud
3bc27c65ef Rollback to previous semantics 2021-06-23 13:46:19 +02:00
wborgeaud
ea6a724560 Enforce copy constraints in partial witness generation. 2021-06-14 17:02:52 +02:00
Daniel Lubarov
cb7f8c8b8c
Draw challenge points from the extension field (#51)
* Draw challenge points from the extension field

* Now building

* Misc

* Default eval_unfiltered_base

* fmt

* A few field settings

* Add to Sage

* Display tweak

* eval_filtered_base

* Quartic in bench

* Missing methods

* Fix tests

* PR feedback
2021-05-30 13:25:53 -07:00
Daniel Lubarov
741dc4c94c Tweaks to bench_ldes 2021-05-22 09:38:07 -07:00
Daniel Lubarov
a4be58557e Fix GMiMCGate 2021-05-20 05:35:16 -07:00
Daniel Lubarov
747974558f Add test_low_degree for other gates 2021-05-20 05:27:56 -07:00
Daniel Lubarov
aabfbe82cd Fix GMiMCEvalGate 2021-04-28 13:50:40 -07:00
Daniel Lubarov
d3ac365667 Recursive evaluation of GMiMCGate
If we did it all with `ArithmeticGate`s, the main loop (with ~101 iterations of cubing and a couple adds) would be fairly expensive, so this uses a (much smaller) custom gate called `GMiMCEvalGate` which does all the computations for one iteration of that loop.
2021-04-27 13:16:24 -07:00
Daniel Lubarov
b18f152c43 Remove access to "next" wire & constant values
As discussed, it seems like the batch opening argument will be a significant cost, and we can reduce that cost by not including shifted openings (except for `Z`s which need them).
2021-04-23 13:54:35 -07:00
wborgeaud
6b3aa02b01 Merge master 2021-04-21 22:36:06 +02:00
wborgeaud
6b407e45ef Progress on FRI 2021-04-21 22:31:45 +02:00
Daniel Lubarov
70f4f2aab8 Minimal num_wires 2021-04-16 21:40:51 -07:00
Daniel Lubarov
62dccedda4 Fix id() to include (generic) R param 2021-04-16 09:01:54 -07:00
wborgeaud
7ff4150679 Merge with merkle_proofs_2 2021-04-12 10:38:07 +02:00
Daniel Lubarov
a14ddc3b03 Fix constraint count 2021-04-10 14:54:46 -07:00
Daniel Lubarov
04f74446fa Misc fixes to get tests green again 2021-04-09 11:40:51 -07:00
Daniel Lubarov
959aaccae6 Merkle proofs 2021-04-08 09:38:57 -07:00
Daniel Lubarov
9b158103d2 Rename 2021-04-02 20:34:27 -07:00
Daniel Lubarov
4086b2b447 Arithmetic & permutation gadgets 2021-04-02 15:29:21 -07:00
Daniel Lubarov
aea4eeaaae Minor 2021-04-02 14:00:26 -07:00
Daniel Lubarov
3c262a8c49 Fix some warnings 2021-03-30 20:16:20 -07:00
Daniel Lubarov
f42120482a No more polynomial programming abstraction
It was too expensive.
2021-03-28 19:52:01 -07:00
Daniel Lubarov
75b9340000 Tweak APIs 2021-03-21 11:29:47 -07:00
Daniel Lubarov
ca7f20bf45 FriConsistencyGate 2021-03-18 12:44:45 -07:00
Daniel Lubarov
ea33c5567f GMiMC, witness generation 2021-03-01 13:40:05 -08:00
Daniel Lubarov
ec0632bf16 Degree-3 GMiMC gate 2021-03-01 12:35:02 -08:00
Daniel Lubarov
45da024aef Minor 2021-02-28 21:43:10 -08:00
Daniel Lubarov
58425eb548 Misc 2021-02-27 21:42:12 -08:00
Daniel Lubarov
5d6da4f94a Degree shrinker 2021-02-26 23:30:22 -08:00
Daniel Lubarov
9fdff8ea08 Gate infra 2021-02-26 13:18:41 -08:00
Daniel Lubarov
33bd3edd11 Minor 2021-02-24 22:48:13 -08:00
Daniel Lubarov
2571e86ea5 Tweaks 2021-02-24 18:04:00 -08:00
Daniel Lubarov
05e98ed3e6 Minor 2021-02-24 13:15:21 -08:00
Daniel Lubarov
801563369b Mostly finish GMiMC gate 2021-02-24 13:07:22 -08:00
Daniel Lubarov
3ba9ef8ab7 Const generics in GMiMC 2021-02-24 12:25:13 -08:00
Daniel Lubarov
13cc76316c Initial commit 2021-02-17 14:36:32 -08:00