689 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
wborgeaud
e87aa2c90b Renaming 2021-07-22 16:25:47 +02:00
wborgeaud
0541956942 Remove useless clone 2021-07-22 16:22:23 +02:00
wborgeaud
1d92191227 Make exp_complement_bits take an iterator to avoid cloning. 2021-07-22 16:18:13 +02:00
wborgeaud
ca3a2fcfc8 Clippy 2021-07-22 16:09:54 +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
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
wborgeaud
b68be57615 Simplify interpolation test 2021-07-22 13:33:57 +02:00
wborgeaud
b65e792ff3 - Remove useless rotation gadgets
- rotate.rs -> select.rs
- Added `select()` and `select_ext`
- Optimize to use just one gate
2021-07-22 11:58:29 +02:00
wborgeaud
1d5cd4430e
Merge pull request #118 from mir-protocol/avoid_rotating
Avoid rotating in `compute_evaluation`
2021-07-22 11:23:45 +02:00
wborgeaud
be2e870aee PR feedback 2021-07-22 06:50:07 +02:00
Daniel Lubarov
01461ce388 Update a TODO 2021-07-21 21:25:52 -07:00
Nicholas Ward
1322b8d0d2 fixes 2021-07-21 14:59:14 -07:00
Nicholas Ward
59efe6a8fe added test_arithmetic for extension fields 2021-07-21 14:39:39 -07:00
Nicholas Ward
292a28e6e3 fixed tests 2021-07-21 14:34:01 -07:00
Nicholas Ward
b17dabefeb more fixes 2021-07-21 14:27:30 -07:00
Nicholas Ward
3e00a5819f fix: endian-ness 2021-07-21 14:12:33 -07:00
Nicholas Ward
ff56486189 compiles 2021-07-21 13:28:11 -07:00
Nicholas Ward
164bb7f5ca fixes 2021-07-21 13:23:50 -07: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
db0121d74a Update comment 2021-07-21 20:38:23 +02: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
wborgeaud
6cc871d30c PR feedback 2021-07-21 19:23:26 +02:00
Nicholas Ward
c5bbe9d503 fixes 2021-07-21 09:56:00 -07:00
Nicholas Ward
5062029d3f fixes 2021-07-21 09:32:18 -07:00
wborgeaud
59494ff8d1 Merge branch 'main' into optimize_mul_many
# Conflicts:
#	src/gates/arithmetic.rs
2021-07-21 17:47:38 +02:00
wborgeaud
6e305f0a3e Change {add|mul}_many and cube 2021-07-21 17:41:22 +02:00
wborgeaud
d870a36dee {add|mul}_three_extension 2021-07-21 17:29:05 +02:00
Daniel Lubarov
80b696a3a2
Avoid a clone (#114) 2021-07-21 08:26:56 -07:00
Daniel Lubarov
7d8bac7169
Change FFT methods to accept references (#115) 2021-07-21 08:26:41 -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
wborgeaud
b59d497964 Modify ArithmeticExtensionGate to support 32 wires 2021-07-21 17:20:08 +02:00
wborgeaud
8642a10fde Start of optimization 2021-07-21 15:58:15 +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
48f5c9347f
route -> assert (#112)
Doesn't really matter except that failure messages might be different if the copy-generator runs first.
2021-07-20 13:04:34 -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
Daniel Lubarov
dff950c502
No Copy on ReducingFactor (#110)
It feels a little dangerous; would be easy to "fork" one accidentally. We already clone explicitly, this just enforces that in the future.
2021-07-20 09:27:35 -07:00
Daniel Lubarov
0a59c738ea
Add a context for each gate evaluation (#108)
To give logs like

    [2021-07-20T15:29:29Z DEBUG plonky2::context_tree] | 2373 gates to evaluate the vanishing polynomial at our challenge point, zeta.
    [2021-07-20T15:29:29Z DEBUG plonky2::context_tree] | | 1284 gates to evaluate gate constraints
    [2021-07-20T15:29:29Z DEBUG plonky2::context_tree] | | | 79 gates to evaluate ArithmeticExtensionGate constraints
    [2021-07-20T15:29:29Z DEBUG plonky2::context_tree] | | | 1073 gates to evaluate <R=101> GMiMCGate {...} constraints
    [2021-07-20T15:29:29Z DEBUG plonky2::context_tree] | | | 4 gates to evaluate NoopGate constraints
    [2021-07-20T15:29:29Z DEBUG plonky2::context_tree] | | | 4 gates to evaluate ConstantGate constraints
2021-07-20 09:27:18 -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