6 Commits

Author SHA1 Message Date
Hamish Ivey-Law
76c86c55b3
System Zero binary bitwise operations (#529)
* First draft of bitwise AND.

* Refactor everything; add support for other binary bitops.

* Documentation; fix integration into rest of ALU.

* Allow `cargo fmt` to make code harder to read.

* Refactor following Jakub's suggestions.

* Fix variable name.

* Minor documentation.

* Basic tests.

* Address Daniel's PR comments.

* Remove the 'BIT' prefix from the BIT{AND,IOR,XOR,ANDNOT} names.

* cargo fmt/clippy

* Simplify bit test.
2022-04-08 14:54:33 +10: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
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
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