9 Commits

Author SHA1 Message Date
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
Nicholas Ward
702a098054 cargo fmt 2021-07-01 10:36:31 -07:00
Daniel Lubarov
95a875e28d
Allow virtual targets to be routed (#84)
As in plonky1. The semantics of virtual targets in plonky1 were rather weird, but I think it's somewhat better here, since we already separate `generate_copy` and `assert_equal` methods. Users now make more of an explicit choice -- they can use a `VirtualTarget` for the witness generation only using `generate_copy`, or they can involve it in copy constraints.
2021-07-01 08:12:12 -07:00
wborgeaud
cfa3d3a660 Added comments 2021-06-22 15:34:50 +02:00
wborgeaud
9adf5bb43f Use ExtensionAlgebra + new CircuitBuilder::mul_extension 2021-06-09 10:51:50 +02:00
wborgeaud
1bae3a02f6 Batch open for PLONK 2021-05-07 11:30:03 +02:00
Daniel Lubarov
ca7f20bf45 FriConsistencyGate 2021-03-18 12:44:45 -07:00
Daniel Lubarov
9fdff8ea08 Gate infra 2021-02-26 13:18:41 -08:00
Daniel Lubarov
13cc76316c Initial commit 2021-02-17 14:36:32 -08:00