22 Commits

Author SHA1 Message Date
Brandon H. Gomes
6fd0da216a
fix: remove unstable features from plonky2
Signed-off-by: Brandon H. Gomes <bhgomes@pm.me>
2022-11-02 17:50:31 -07:00
Daniel Lubarov
e73d01a037
packed_field -> packed (#584)
* `packed_field` -> `packed`

For cleaner imports; "field" is usually clear from context

* fix
2022-06-27 15:07:52 -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
7676f907bf Missed some 2022-05-17 11:15:53 +02:00
wborgeaud
b606d99e07 Use *_circuit suffix for gadgets 2022-05-17 11:04:35 +02:00
Daniel Lubarov
4fc6fdadd3
Stop suppressing unused/dead warnings globally (#527)
Most of them were trivial to address; for the remaining warnings I suppressed just the relevant line and added TODOs.
2022-03-31 22:53:47 -07:00
Daniel Lubarov
7d6c0a448d
Halo2 style lookup arguments in System Zero (#513)
* Halo2 style lookup arguments in System Zero

It's a really nice and simple protocol, particularly for the verifier since the constraints are trivial (aside from the underlying batched permutation checks, which we already support). See the [Halo2 book](https://zcash.github.io/halo2/design/proving-system/lookup.html) and this [talk](https://www.youtube.com/watch?v=YlTt12s7vGE&t=5237s) by @daira.

Previously we generated the whole trace in row-wise form, but it's much more efficient to generate these "permuted" columns column-wise. So I changed our STARK framework to accept the trace in column-wise form. STARK impls now have the flexibility to do some generation row-wise and some column-wise (without extra costs; there's a single transpose as before).

* sorting

* fixes

* PR feedback

* into_iter

* timing
2022-03-16 17:37:34 -07:00
Daniel Lubarov
bedd2aa711
Rename arithmetic unit to ALU (#496) 2022-02-19 17:32:11 -08:00
Daniel Lubarov
72d13d0ded
Prover code for permutation argument (#485)
* Batch multiple perm args into one Z and compute Z columnwise

It's slightly complex because we batch `constraint_degree - 1` permutation arguments into a single `Z` polynomial. This is a slight generalization of the [technique](https://zcash.github.io/halo2/design/proving-system/lookup.html) described in the Halo2 book.

Without this batching, we would simply have `num_challenges` random challenges (betas and gammas). With this batching, however, we need to use different randomness for each permutation argument within the same batch. Hence we end up generating `batch_size * num_challenges` challenges for all permutation arguments.

* Feedback + updates for recursion code
2022-02-16 01:33:59 -08:00
wborgeaud
42d6532120 PR feedback 2022-02-15 08:35:57 +01:00
Daniel Lubarov
8d699edf21
Move some methods outside impl System (#484)
I didn't really have a good reason for putting there; seems more idiomatic to make them global since they don't need `self`/`Self`.
2022-02-14 13:47:33 -08:00
Daniel Lubarov
645d45f227
Column definitions for addition, range checks & lookups (#477)
* Column definitions for addition, range checks & lookups

I implemented addition (unsigned for now) as an example of how the arithmetic unit can interact with the 16-bit range check unit.

Range checks and lookups aren't implemented yet.

* Missing constraints

* Tweaks to get tests passing

* Reorg registers into files

* Minor
2022-02-10 12:05:04 -08:00
Jakub Nabaglo
83a572717e
Implement Poseidon in system_zero/permutation_unit (#459)
* Implement Poseidon in system_zero/permutation_unit

* Minor cleanup

* Daniel PR comments

* Update dependencies
2022-02-04 16:50:57 -08:00
wborgeaud
1c30a5a84e Typo 2022-02-04 17:16:18 +01:00
wborgeaud
1011c302ac Add test for system zero 2022-02-04 16:02:45 +01:00
wborgeaud
d99cabded9 Working 2022-02-04 15:56:59 +01:00
wborgeaud
1e04f4f5a4 Comments 2022-02-01 17:34:03 +01:00
wborgeaud
92ea4b65d1 Constraint check working 2022-01-31 18:00:07 +01:00
wborgeaud
e78630ae81 PR feedback 2022-01-28 05:02:31 +01:00
wborgeaud
1770e83c63 Clippy 2022-01-27 13:02:36 +01:00
Daniel Lubarov
c0ac79e2e1
Beginning of STARK implementation (#413)
* Beginning of STARK implementation

* PR feedback

* minor

* Suppress warnings for now
2022-01-26 00:09:29 -08:00