198 Commits

Author SHA1 Message Date
Daniel Lubarov
1e9845afcf nits 2021-07-27 12:47:15 -07:00
Nicholas Ward
b66ad6c96a added debug assert 2021-07-27 12:34:47 -07:00
Nicholas Ward
34d59305a1 Merge branch 'main' into exp_gate 2021-07-27 12:29:24 -07:00
Nicholas Ward
7e5e4fc682 updated num_constraints 2021-07-27 12:18:09 -07:00
Nicholas Ward
59bfc52f9c removed extraneous constraint 2021-07-27 11:55:25 -07:00
Nicholas Ward
695e5bc98c fix? 2021-07-27 11:04:16 -07:00
Nicholas Ward
0b8f5860f5 removed if statement 2021-07-27 10:46:10 -07:00
Nicholas Ward
af62688bd7 fixes 2021-07-27 10:19:46 -07:00
Daniel Lubarov
3fc02c76bc
Couple fixes to ReducingGate (#128) 2021-07-25 09:34:51 -07:00
wborgeaud
deea1c979b PR feedback 2021-07-25 18:12:26 +02:00
Nicholas Ward
d7a9274fef updated for add_gate changes 2021-07-23 20:06:00 -07:00
Nicholas Ward
da9017bcbc Merge branch 'main' into exp_gate 2021-07-23 20:01:58 -07:00
Nicholas Ward
b06d7bc8f5 cargo fmt 2021-07-23 15:56:25 -07:00
Nicholas Ward
0c4a1bc5af fixes 2021-07-23 15:56:14 -07:00
Nicholas Ward
8e2f33bd42 fix 2021-07-23 15:52:37 -07:00
Nicholas Ward
64d8a44320 cargo fmt 2021-07-23 15:47:03 -07:00
Nicholas Ward
1c8015b93d finished tests (don't pass yet) 2021-07-23 15:46:52 -07:00
Nicholas Ward
9932517e86 cargo fmt 2021-07-23 15:11:53 -07:00
Nicholas Ward
40055dc45d basic tests 2021-07-23 15:11:42 -07:00
Nicholas Ward
6d22ad6ee0 initial version of exponentiation gate 2021-07-23 15:08:54 -07:00
wborgeaud
d509f03b1b Implement eval_unfiltered_base 2021-07-23 18:32:59 +02:00
wborgeaud
8f18089aac Implement eval_unfiltered_recursively for ReducingGate 2021-07-23 18:06:14 +02:00
wborgeaud
2ea35bd9e4 Comments 2021-07-23 17:38:24 +02:00
wborgeaud
5a16d7c555 Change number of coeffs supported in ReducingGate depending on config 2021-07-23 17:35:23 +02:00
wborgeaud
0526a9e149 Working ReducingGate 2021-07-23 17:16:53 +02:00
Daniel Lubarov
bcf524bed0
Have add_gate take a generic type instead of GateRef (#125)
* Have add_gate take a generic type instead of GateRef

There are a couple advantages
- Users writing their own gates won't need to know about the `GateRef` wrapper; it's more of an internal thing now.
- Easier access to gate methods requiring `self` -- for example, `split_le_base` can just call `gate_type.limbs()` now.

* Update comment

* Always insert
2021-07-22 23:48:03 -07:00
wborgeaud
a70e97befc Fix merge issues 2021-07-23 08:21:55 +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
wborgeaud
d8b8161cb9
Merge pull request #122 from mir-protocol/eval_unfilterd_base
Manually implement `eval_unfiltered_base` for all gates
2021-07-23 08:12:01 +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
wborgeaud
b68be57615 Simplify interpolation test 2021-07-22 13:33:57 +02:00
wborgeaud
59494ff8d1 Merge branch 'main' into optimize_mul_many
# Conflicts:
#	src/gates/arithmetic.rs
2021-07-21 17:47:38 +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
wborgeaud
b59d497964 Modify ArithmeticExtensionGate to support 32 wires 2021-07-21 17:20:08 +02:00
Daniel Lubarov
a9e5f1e4e2
More routed wires for recursion (#104)
* More routed wires for recursion

For the insertion gate, which (with a FRI arity of 4) uses 1 wire for the insertion index, D for the elemnet to insert, 3D for the original list, and 4D for the output list.

* import
2021-07-19 08:52:10 -07:00
Nicholas Ward
4dc6a603a1
Merge pull request #90 from mir-protocol/insertion_gate
Insertion gate
2021-07-19 07:59:55 -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
461f24a57e Merge branch 'main' into more_recursive_verifier
# Conflicts:
#	src/polynomial/commitment.rs
#	src/proof.rs
2021-07-19 07:08:06 +02:00
wborgeaud
097413479e PR feedback 2021-07-18 10:35:42 +02:00
Nicholas Ward
d8af0a9334 Merge main 2021-07-15 15:06:38 -07:00
Daniel Lubarov
83a1430038
Fix some warnings (#94) 2021-07-15 07:34:46 -07:00
wborgeaud
fe05da6720 Clipp 2021-07-15 10:39:57 +02:00
wborgeaud
2e12ee8e82 Minor 2021-07-15 10:13:13 +02:00
Nicholas Ward
ea07db14ac fixed in recursive version too 2021-07-14 17:38:39 -07:00
Nicholas Ward
220c9bc87a fixed bug oops 2021-07-14 17:38:24 -07:00