38 Commits

Author SHA1 Message Date
wborgeaud
2bbcf17699 Test eval_unfiltered_* functions 2021-08-02 14:17:42 +02: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
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
40055dc45d basic tests 2021-07-23 15:11:42 -07: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
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
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
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
Nicholas Ward
c708d7e428 eval_unfiltered_recursively 2021-07-14 17:17:45 -07:00
Nicholas Ward
16ae68795a cleanup 2021-07-14 16:55:27 -07:00
Nicholas Ward
9f2f987f20 minor fixes 2021-07-14 15:57:35 -07:00
Nicholas Ward
27c93f8f4b addressed comments 2021-07-14 15:47:59 -07:00
Nicholas Ward
0a32e0fdeb cargo fmt 2021-07-13 16:54:04 -07:00
Nicholas Ward
f4c7756f56 removed test debugging 2021-07-13 16:51:45 -07:00
Nicholas Ward
3a2ba05b27 last fix! 2021-07-13 16:50:50 -07:00
Nicholas Ward
c6a33d0eff more fixes 2021-07-13 16:49:22 -07:00
Nicholas Ward
ca944d5892 fixes; and in-progress test debugging 2021-07-13 16:48:24 -07:00
Nicholas Ward
f0ae72ba74 constraints in base field (fixes low degree test) 2021-07-13 16:15:56 -07:00
Nicholas Ward
1ecc234644 fix 2021-07-13 16:02:55 -07:00
Nicholas Ward
e0c767f3c1 added intermediate wires to generator; and test (does not pass) 2021-07-13 16:01:29 -07:00
Nicholas Ward
57a39a1730 basic tests, and fixes 2021-07-12 16:55:41 -07:00
Nicholas Ward
82206fdc3e num_wires 2021-07-12 16:46:53 -07:00
Nicholas Ward
1b83b4dd4b cargo fmt 2021-07-12 16:45:59 -07:00
Nicholas Ward
4bac34646c generator 2021-07-12 16:38:05 -07:00
Nicholas Ward
185117ed43 params 2021-07-12 15:39:35 -07:00
Nicholas Ward
cbffb854cc cargo fmt 2021-07-12 15:31:26 -07:00
Nicholas Ward
6090f6d6ce changed insert_here to a wire, and fixes 2021-07-12 15:31:12 -07:00
Nicholas Ward
66e4f7c3cf added output constraint 2021-07-12 12:14:14 -07:00
Nicholas Ward
bec189b598 fixes 2021-07-09 16:31:19 -07:00
Nicholas Ward
751e61647f cleanup and progress 2021-07-08 17:05:04 -07:00
Nicholas Ward
662d62d8b4 progress on eval_unfiltered 2021-07-08 15:20:26 -07:00
Nicholas Ward
fbcfbf2d23 insertion gate progress 2021-07-07 14:32:27 -07:00
Nicholas Ward
2bee1c6721 current progress 2021-07-06 10:28:39 -07:00
Nicholas Ward
bdb6cfe927 skeleton 2021-07-01 13:11:34 -07:00