therealyingtong
570f90e4ee
SHA-256 chip that uses a 2^16 lookup table
...
Co-authored-by: Jack Grigg <jack@electriccoin.co>
2021-02-25 20:01:44 +00:00
Jack Grigg
bd17c726ac
Add a Selector type
...
This currently just wraps a `Column<Fixed>`, but enables us to start
writing circuits that can later have their selector usage optimised.
2021-02-25 15:28:29 +00:00
therealyingtong
4ae21a905d
Update tests
2021-02-24 00:21:12 +08:00
therealyingtong
5a341b0f8f
Modify Assignment::copy() to take Column<Any> instead of usize
2021-02-24 00:18:22 +08:00
therealyingtong
d82a0c85b1
Modify Assignment::copy() to take Permutation instead of usize
2021-02-24 00:17:29 +08:00
therealyingtong
340fb2b6df
Move Permutation struct from crate::circuit -> plonk::circuit
2021-02-24 00:17:29 +08:00
Jack Grigg
b4ed5295fe
Migrate to group traits
...
The `Curve` trait is now `CurveExt: group::prime::PrimeCurve`, and
`CurveAffine` is now `CurveAffine: group::prime::PrimeCurveAffine`.
There is no `CurveAffine` trait in `group`, and it's a widely-used
trait in this crate, so we don't rename it to `CurveAffineExt`.
2021-02-22 20:20:23 +00:00
Jack Grigg
7037d55320
Rename Curve and CurveAffine properties to match group traits
2021-02-22 20:05:08 +00:00
Daira Hopwood
4d61ad8ff5
Need a borrow here.
...
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2021-02-18 23:50:19 +00:00
Sean Bowe
81af4e43d1
Update pinned verification key to account for circuit changes
2021-02-18 15:48:20 -07:00
therealyingtong
d29246b49b
Rename const_* -> constant_*
2021-02-18 15:41:36 -07:00
therealyingtong
4bf46fc349
Add Expression::Const variant
2021-02-18 15:41:36 -07:00
therealyingtong
6a7f869f66
Clippy fixes
2021-02-18 15:41:36 -07:00
therealyingtong
df2d818891
Account for Rotations of LagrangeCoeff values
2021-02-18 15:41:36 -07:00
therealyingtong
8e56b415fb
Rename column -> expression for lookups
2021-02-18 15:41:36 -07:00
therealyingtong
2f2de13887
Calculate required degree of lookup
2021-02-18 15:41:36 -07:00
therealyingtong
aca6de61f8
Evaluate Expressions and all variants
...
Co-authored-by: Jack Grigg <jack@electriccoin.co>
2021-02-18 15:41:36 -07:00
therealyingtong
d8534e1c50
Pass Expressions to meta.lookup()
2021-02-18 15:41:35 -07:00
Sean Bowe
8060a12ea4
Fix minor nit (match ergonomics)
2021-02-17 15:39:46 -07:00
Sean Bowe
87536cea10
Use newtypes to simplify Debug implementations for pinning verification keys.
2021-02-17 15:20:19 -07:00
ebfull
bc9d05e67b
Apply suggestions from code review
...
Co-authored-by: str4d <jack@electriccoin.co>
2021-02-17 15:19:34 -07:00
Sean Bowe
dfa7d96fa9
Refactor verification key hashing logic to use Display impls.
2021-02-17 15:19:34 -07:00
therealyingtong
f35e190455
Hash in field modulus, curve parameters
2021-02-17 15:19:34 -07:00
therealyingtong
52c028b4da
Disambiguate naming of hash() -> hash_into()
2021-02-17 15:19:34 -07:00
therealyingtong
e7d6f67564
Rename aux -> instance after rebasing
2021-02-17 15:19:34 -07:00
therealyingtong
b204ff74a8
Do not return hash results from component hash() methods
2021-02-17 15:19:34 -07:00
therealyingtong
4aa4b4463a
Hash domain and cs into transcript
2021-02-17 15:19:34 -07:00
therealyingtong
437782e902
Hash fixed_commitments and permutations into transcript
2021-02-17 15:19:33 -07:00
therealyingtong
a19dc68dee
Use Column<Any> in Permutation::Argument
2021-02-17 21:32:17 +08:00
Daira Hopwood
760d69bd2c
Rename "auxiliary column" to "instance column" in the book and in code. fixes #181
...
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2021-02-14 21:09:49 +00:00
Sean Bowe
4b960a7c0c
cargo fmt
2021-02-14 09:28:51 -07:00
Jack Grigg
821bca0abe
Reduce FieldExt bound to Field for Neg and Sub impls on Expression<F>
2021-02-12 16:52:42 +00:00
Jack Grigg
db0477a606
impl<F: FieldExt> {Neg, Sub} for Expression<F>
2021-02-01 21:42:57 +00:00
Jack Grigg
0a378c3d0f
Require Circuit::Config implement Clone instead of Copy
2021-02-01 19:05:19 +00:00
Jack Grigg
82da677add
Add name field to ConstraintSystem::create_gate
...
The name has type `&'static str`, as gates apply to every row and thus
do not require any runtime information to name.
2021-02-01 18:38:13 +00:00
Jack Grigg
bf771a7446
Add namespacing and gadget name collection to Layouter
2021-02-01 18:38:04 +00:00
Jack Grigg
60061f64fd
Add name field to Layouter::assign_region
2021-02-01 18:34:24 +00:00
Jack Grigg
4c3adf59d5
Add annotations to Region::{assign_advice, assign_fixed}
...
This enables circuits to annotate individual cells with variable names
or similar protocol-specific metadata.
2021-02-01 18:33:25 +00:00
therealyingtong
ea14d99a83
Renaming and cleanups from code review
...
Co-authored-by: Sean Bowe <ewillbefull@gmail.com>
2021-02-02 00:05:55 +08:00
therealyingtong
a00d7c2fa6
Cleanups from code review
...
Co-authored-by: Kris Nuttycombe <kris.nuttycombe@gmail.com>
Co-authored-by: Sean Bowe <ewillbefull@gmail.com>
2021-01-31 11:48:32 +08:00
therealyingtong
def65609b1
Refactor PLONK verifier
2021-01-31 11:45:40 +08:00
therealyingtong
02b5b8442b
Refactor PLONK prover
2021-01-31 11:45:40 +08:00
ebfull
5f89227cdd
Merge pull request #135 from zcash/serialize-params
...
Serialize params
2021-01-30 11:43:55 -07:00
therealyingtong
faf5da15c9
Track column usage in RegionShape.
...
Co-authored-by: Jack Grigg <jack@electriccoin.co>
2021-01-28 10:55:02 +08:00
therealyingtong
ffdd739f85
Only write k in Params; calculate n when reading
...
Co-authored-by: Jack Grigg <jack@electriccoin.co>
Co-authored-by: Daira Hopwood <daira@jacaranda.org>
2021-01-24 08:07:30 +08:00
therealyingtong
e0f9fe1dcf
Clippy fixes + address review comments
...
Co-authored-by: Jack Grigg <jack@electriccoin.co>
2021-01-24 08:07:30 +08:00
therealyingtong
58479fbcc3
Refactor keygen to generate pk from vk.
2021-01-24 08:07:30 +08:00
Sean Bowe
ba591c3b39
Add serialization support for PLONK verifying keys.
2021-01-24 08:05:58 +08:00
Sean Bowe
d9d20bfe36
Break out domain creation logic into separate method.
2021-01-24 08:04:13 +08:00
Kris Nuttycombe
74b2aa715f
Require Rotation instead of i32 for relative rows in circuits.
...
Co-authored-by: str4d <thestr4d@gmail.com>
2021-01-14 11:57:32 -07:00