16 Commits

Author SHA1 Message Date
Daniel Lubarov
92974aa105 A few more cyclic recursion changes
In preparation for adding the zkEVM aggregation circuit. Mainly,

- Adds a `WitnessWrite` trait, a sub-trait of `Witness`, and move the write methods to it. `GeneratedValues` impls `WitnessWrite`, which lets generators like `DummyProofGenerator` access all our write methods like `set_proof_with_pis_target`. Also removes some duplication.

- Remove `set_cyclic_recursion_data_target` - now that dummy proof data is automatically populated, all that remains is populating `condition` and the cyclic proof + VK. I think it's easy enough for callers to do this; the steps are the same as with `conditionally_verify_proof`. This way there's no cyclic-recursion-specific API to learn about.

- Split `cyclic_recursion` into two variants, one which checks the current circuit or a dummy, and a more general one which checks the current circuit or some other circuit. We can use the latter to build a more efficient aggregation circuit, where we check another aggregation proof or an EVM proof, with no dummy proofs involved.
2022-12-11 22:43:26 -08:00
Brandon H. Gomes
9e33310ee7
feat: add no-std support for insertion gate
Signed-off-by: Brandon H. Gomes <bhgomes@pm.me>
2022-11-04 16:26:22 -07:00
Brandon H. Gomes
fc3f63398d
wip: start moving starky to no-std
Signed-off-by: Brandon H. Gomes <bhgomes@pm.me>
2022-11-03 12:17:03 -07:00
Brandon H. Gomes
38e467f1c0
chore: fix serde-cbor and run cargo-sort
Signed-off-by: Brandon H. Gomes <bhgomes@pm.me>
2022-11-03 11:41:12 -07:00
Brandon H. Gomes
e2cdd5a954
feat: upgrade Sampling APIs
Signed-off-by: Brandon H. Gomes <bhgomes@pm.me>
2022-11-03 08:26:03 -07:00
wborgeaud
b97ec3bda1 New clippy lint 2022-10-25 10:50:40 +02:00
Daniel Lubarov
faa75178a2 MIT + Apache2 licenses 2022-08-15 07:43:00 -07:00
Daniel Lubarov
3346d3f902
field_types -> types (#583)
* `field_types` -> `types`

Here too, I think "field" is usually clear from context, e.g. in `use plonky2::field::types::Field;`.

* fixes

* fmt
2022-06-27 12:24:09 -07:00
Daniel Lubarov
410e03349c
extension_field -> extension (#581)
It seems redundant in most contexts, e.g. `use plonky2::field::extension_field::Extendable;`. One could import `extension_field`, but it's not that common in Rust, and `field::extension` is now about as short.
2022-06-27 07:18:21 -07:00
wborgeaud
917af4267f
Merge pull request #544 from mir-protocol/standard_gadget_suffix
Standardize gadget suffix to `*_circuit`
2022-05-17 20:52:52 +02:00
wborgeaud
28d90d0e9e s/gate_index/row/ 2022-05-17 19:32:51 +02:00
wborgeaud
a31de48d88 More changes 2022-05-17 11:47:00 +02:00
wborgeaud
4cd37ca8d4 Rename fields of Wire 2022-05-17 11:31:45 +02:00
wborgeaud
b606d99e07 Use *_circuit suffix for gadgets 2022-05-17 11:04:35 +02:00
Nicholas Ward
6e9318c068 u32 range check gate 2022-01-31 10:31:35 -08:00
Daniel Lubarov
c126641c5d
Split into crates (#406)
* Split into crates

I kept other changes to a minimum, so 95% of this is just moving things. One complication that came up is that since `PrimeField` is now outside the plonky2 crate, these two impls now conflict:
```
impl<F: PrimeField> From<HashOut<F>> for Vec<u8> { ... }
impl<F: PrimeField> From<HashOut<F>> for Vec<F> { ... }
```
with this note:
```
note: upstream crates may add a new impl of trait `plonky2_field::field_types::PrimeField` for type `u8` in future versions
```
I worked around this by adding a `GenericHashOut` trait with methods like `to_bytes()` instead of overloading `From`/`Into`. Personally I prefer the explicitness anyway.

* Move out permutation network stuff also

* Fix imports

* Fix import

* Also move out insertion

* Comment

* fmt

* PR feedback
2021-12-28 11:51:13 -08:00