Jack Grigg
a63e6e25d8
Restrict visibility of PLONK challenges to plonk module
2020-12-01 21:14:14 +00:00
Jack Grigg
7422efca72
s/permutation::Proof::commit/permutation::Argument::commit
...
Once we refactor the permutation argument implementation to be integrated
as Vec<permutation::Proof>, we can change this again to just map from the
Vec<permutation::Argument> inside ConstraintSystem.
2020-12-01 21:10:31 +00:00
Jack Grigg
66240800a3
Move permutation keygen into plonk::permutation::keygen
2020-12-01 21:10:31 +00:00
Jack Grigg
f63f3ff2af
Introduce typed challenge scalars
...
This also centralises the challenge generation logic in Challenge::get,
ensuring it is consistent across the codebase.
2020-12-01 21:09:03 +00:00
Jack Grigg
63e3bc1e15
Remove unnecessary Transcript::init_with_hashers constructor
2020-12-01 21:03:31 +00:00
Jack Grigg
4a3b830165
Extract permutation argument into a submodule
2020-12-01 21:03:31 +00:00
Jack Grigg
cdbc41148a
Migrate to ff traits
...
The `Field` trait in this crate is now `FieldExt: ff::PrimeField`.
2020-12-01 20:55:03 +00:00
therealyingtong
72471dc07e
Clippy fixes
2020-11-30 23:57:48 +08:00
therealyingtong
0b2ec8965f
Update documentation in polycommit verifier
2020-11-30 15:28:19 +08:00
therealyingtong
d168f5c21b
Parallelize and rename methods in msm.rs
2020-11-30 15:28:19 +08:00
Jack Grigg
a0a9538132
Use renamed broken_intra_doc_links lint
2020-11-27 14:40:37 +00:00
Jack Grigg
e5e6700e10
Pin most recent metrics alpha
2020-11-25 19:56:52 +00:00
Jack Grigg
875c223748
Simplify h_poly expression evaluation in Proof::create
2020-11-24 23:43:48 +00:00
Jack Grigg
61c9392475
Remove query allocations from Proof::create
...
multiopen::Proof::create takes `instances: IntoIterator`, so we can just
pass it an iterator directly.
2020-11-24 18:25:55 +00:00
Jack Grigg
6360da1f4e
Remove query allocations from Proof::verify
...
multiopen::Proof::verify takes `queries: IntoIterator`, so we can just
pass it an iterator directly.
2020-11-24 18:23:27 +00:00
Jack Grigg
7f29ab913d
Simplify h(x_3) computation in verifier using Horner's rule
...
Closes zcash/halo2#45
2020-11-24 18:18:45 +00:00
Jack Grigg
feba8e2fdf
Allocate permutation_modified_advice once in Proof::create
2020-11-24 18:18:45 +00:00
str4d
cc5f45231d
Merge pull request #42 from zcash/plonk-benches
...
PLONK benchmarks
2020-11-24 18:14:07 +00:00
Jack Grigg
9a4f27056c
Fix clippy lint in metrics model doctest
2020-11-24 17:56:33 +00:00
therealyingtong
3eb6712c6c
Add aux information to metrics
2020-11-24 09:39:34 +08:00
Jack Grigg
236b3a6692
Collect some verifier metrics
2020-11-23 12:47:51 +00:00
Jack Grigg
d4424db8d4
Collect some prover metrics
2020-11-23 12:47:51 +00:00
Jack Grigg
fb8f67dfe5
Add a simple metrics Recorder for counting things in models
2020-11-23 12:47:42 +00:00
therealyingtong
bffab9953e
Conditionally squeeze scalar hasher before interacting with base hasher
2020-11-16 21:28:37 +00:00
ying tong
15682bf16f
Make init_with_hashers() internal to transcript crate
...
Co-authored-by: Jack Grigg <jack@electriccoin.co>
2020-11-16 21:28:37 +00:00
ying tong
7822201c9c
Remove redundant point checks in commitment verifier
...
Co-authored-by: Jack Grigg <jack@electriccoin.co>
2020-11-16 21:28:37 +00:00
therealyingtong
2375507f4f
Update error handling
2020-11-16 21:26:46 +00:00
therealyingtong
43337dea1b
Make Transcript generic over curve points
...
Co-authored-by: Jack Grigg <jack@electriccoin.co>
2020-11-16 21:26:46 +00:00
Jack Grigg
71111e88b7
Type aliases for the tweedle groups
2020-11-12 21:45:56 +00:00
Jack Grigg
3407d13e4b
Move curves and fields into tweedle module
2020-11-12 21:36:59 +00:00
Jack Grigg
f4c15760f2
Use explicit trait paths in arithmetic macros
2020-11-12 19:38:27 +00:00
ebfull
5a2f474616
Merge pull request #56 from zcash/coset-docs
...
Add to documentation for coset evaluation domain
2020-11-11 08:56:03 -07:00
ebfull
5d1e1a29db
Merge pull request #51 from zcash/update-ci
...
Update Actions CI with improved workflow
2020-11-11 08:52:59 -07:00
ying tong
a856137619
Minor refactors
...
Co-authored-by: str4d <jack@electriccoin.co>
2020-11-11 13:56:34 +08:00
therealyingtong
28e07eab16
Add to documentation for coset evaluation domain
2020-11-10 13:44:52 +08:00
therealyingtong
766caf9214
Make getters for column index() and column_type()
2020-11-10 00:45:52 +08:00
therealyingtong
0519a522aa
Use TryFrom to convert Column<Any> to other column types
2020-11-10 00:39:08 +08:00
therealyingtong
22b6d5bd70
Cleanups in circuit.rs
2020-11-07 14:27:38 +08:00
therealyingtong
34c6cba537
Add generic query_any_index() and get_any_query_index methods
2020-11-06 12:39:51 +08:00
therealyingtong
075988ae4e
Introduce Column struct and ColumnType trait
2020-11-06 11:29:42 +08:00
therealyingtong
2034179d82
Rename wire -> column
2020-11-06 11:18:12 +08:00
Jack Grigg
10676657f4
Fix stable clippy lints
2020-10-30 01:29:05 +00:00
Jack Grigg
5a6a45c6a8
Fix deref breakage with nightly-2020-10-06
...
I think this is related to rust-lang/rust#77638
2020-10-30 01:21:09 +00:00
Sean Bowe
011132337f
Remove notes on multiopen module
2020-10-20 08:57:48 -06:00
therealyingtong
3761419ebc
Add documentation for multiopen.rs
2020-10-18 20:09:44 +08:00
therealyingtong
a30719c245
Minor changes to multiopen
...
Co-authored-by: ebfull <ewillbefull@gmail.com>
2020-10-18 20:09:40 +08:00
Sean Bowe
1e9f7f37c6
Minor improvements to multiopen.
2020-10-15 17:16:44 -06:00
Sean Bowe
9d572c181d
Remove unnecessary enumeration in multiopen prover.
2020-10-15 17:12:17 -06:00
Sean Bowe
685bf79613
Relocate x_5 challenge sampling location to simplify logic.
2020-10-15 17:11:06 -06:00
Sean Bowe
123cacc7cc
Remove additional unnecessary vector clone from multiopen prover.
2020-10-15 17:06:35 -06:00
Sean Bowe
55ef4ea1f7
Unify the construct_intermediate_sets function between multiopen prover and verifier.
2020-10-15 17:01:30 -06:00
Sean Bowe
d3f593e89c
Avoid unnecessary enumeration.
2020-10-15 14:18:02 -06:00
Sean Bowe
3955da435c
Avoid unnecessary vector cloning in multiopen.
2020-10-15 14:17:03 -06:00
Sean Bowe
588de0e024
Add test for lagrange interpolation.
2020-10-15 14:15:03 -06:00
Sean Bowe
63d7de3bc2
Perform inversions in lagrange_interpolate as part of a batch.
2020-10-15 14:08:13 -06:00
Sean Bowe
5c563eca12
Do not enumerate product inside of lagrange_interpolate.
2020-10-15 13:57:04 -06:00
therealyingtong
2f7b46ffa1
Remove use of parallelize() from multiopen::prover
2020-10-14 08:16:14 +08:00
therealyingtong
742c15bb51
Minor changes and documentation
2020-10-14 08:15:00 +08:00
therealyingtong
24b85dec67
Remove q_evals.len() = rotations.len() check
...
q_evals should now have the same length as point_sets, which is only constructed in the multiopen verifier.
2020-10-14 00:43:48 +08:00
therealyingtong
b62d113031
Refactor to use fold() in multiple places
2020-10-14 00:35:36 +08:00
therealyingtong
79cabb3d8d
Move random scaling of MSM into multiopen verifier
...
Co-authored-by: Sean Bowe <ewillbefull@gmail.com>
2020-10-14 00:35:36 +08:00
therealyingtong
088118cc5d
Refactor lagrange_interpolate() method
...
Co-authored-by: daira <daira@electriccoin.co>
Co-authored-by: str4d <jack@z.cash>
2020-10-14 00:35:36 +08:00
therealyingtong
1441193de1
Refactoring from initial code review
...
Co-authored-by: ebfull <ewillbefull@gmail.com>
2020-10-14 00:35:36 +08:00
ying tong
6f6378b2ea
More idiomatic implementation of Ord for Field
...
Co-authored-by: str4d <jack@z.cash>
2020-10-14 00:35:36 +08:00
therealyingtong
89fd6e4d44
Use map_err() when handling multiopen::Proof::create()
...
Co-authored-by: Daira Hopwood <daira@electriccoin.co>
2020-10-14 00:35:36 +08:00
therealyingtong
5181ca56f1
Bind &[pubinput] in plonk test_proving()
2020-10-14 00:35:36 +08:00
therealyingtong
97873fa6ea
Use VerifierQuery and construct_intermediate_sets() in verifier
2020-10-14 00:35:36 +08:00
therealyingtong
6cd74999ff
Use ProverQuery and construct_intermediate_sets() in prover
2020-10-14 00:35:25 +08:00
therealyingtong
9378d0cc70
Define construct_intermediate_sets() helper method for multiopen prover and verifier
2020-10-14 00:35:25 +08:00
therealyingtong
cbe4415870
Introduce Query and CommitmentData structs for multiopen
2020-10-14 00:35:25 +08:00
therealyingtong
1e21c08acd
Implement Ord and PartialOrd for Field
2020-10-14 00:35:25 +08:00
therealyingtong
07e2d390a9
Introduce Lagrange interpolation method in arithmetic.rs
2020-10-14 00:35:25 +08:00
therealyingtong
c3d0a172a7
Create multiopen abstraction
2020-10-14 00:35:25 +08:00
Sean Bowe
67b35954f4
Move MSM into submodule.
2020-10-13 08:16:20 -06:00
Sean Bowe
2ccddac674
Split proof/input length checks into separate method of verifier
2020-09-29 17:35:24 -06:00
Sean Bowe
9672bf9725
Minor improvements to check_hx()
2020-09-29 17:14:37 -06:00
Sean Bowe
7d8daa5d05
Refactor h_eval computation into separate, more functional code.
...
Co-authored-by: str4d <thestr4d@gmail.com>
2020-09-29 16:56:21 -06:00
Sean Bowe
e275d78c7d
Simplify permutations field of ConstraintSystem
...
Co-authored-by: therealyingtong <yingtong@electriccoin.co>
2020-09-29 08:51:00 -06:00
Sean Bowe
7a3caaad59
Fix comments
2020-09-29 08:28:00 -06:00
Sean Bowe
c97da352ee
Remove SRS and replace with ProvingKey/VerifyingKey abstractions
...
Co-authored-by: therealyingtong <yingtong@electriccoin.co>
2020-09-29 08:25:04 -06:00
Sean Bowe
4a37e05f49
cargo fmt
2020-09-25 10:21:54 -06:00
Sean Bowe
6d41693af5
Use Blind::default().
2020-09-25 10:21:15 -06:00
Sean Bowe
56b6d8bd03
Auxilary wires in PLONK are foux blinded just like fixed wires.
2020-09-25 10:21:15 -06:00
Sean Bowe
316a027784
Modify commitment opening argument so that G element can be foux blinded to align with wire blinding in PLONK.
2020-09-25 10:21:15 -06:00
Sean Bowe
3db368b40e
Move Guard and Accumulator implementations into verifier submodule.
2020-09-25 10:21:13 -06:00
Sean Bowe
2d1f69328f
Rename OpeningProof to just Proof.
2020-09-25 09:39:32 -06:00
Sean Bowe
a37c926a89
Address clippy lints
2020-09-20 13:09:03 -06:00
Sean Bowe
60aa2918c3
Remove get_g_scalars() from MSM.
2020-09-19 13:52:33 -06:00
Sean Bowe
6620817d81
Return errors from verifier instead of assuming points aren't at infinity in the proof.
2020-09-19 13:47:37 -06:00
Sean Bowe
73d494a72d
Various changes, including restoring permutation argument to advice wires only for now.
2020-09-19 13:31:56 -06:00
therealyingtong
e8839a7579
Refactor wire pattern matching when computing permutation product
2020-09-19 12:39:04 -06:00
therealyingtong
24fe3fae29
Remove aux_commitments computation from Prover; remove blinding factor when accumulator aux_evals
2020-09-19 12:39:04 -06:00
therealyingtong
c772801f8f
Pass aux_lagrange_polys to prover as a slice
2020-09-19 12:39:04 -06:00
therealyingtong
fd094fccd8
Add aux_commitments and aux_evals to test_proving() example
2020-09-19 12:39:04 -06:00
therealyingtong
9482202a98
Update PLONK test_proving() example
2020-09-19 12:39:04 -06:00
therealyingtong
0bdcbb6c67
Introduce Wire enum for use in permutations
2020-09-19 12:39:04 -06:00
therealyingtong
a257308ba2
Add aux wires to ConstraintSystem
2020-09-19 12:39:04 -06:00
therealyingtong
0caf1d2087
Provide aux_commitments to verifier and aux_lagrange_polys to prover
2020-09-19 12:39:04 -06:00
therealyingtong
76c49a4df3
Minor refactor
2020-09-19 23:44:00 +08:00
therealyingtong
33261ec1a0
Recover from OpeningProof::create() failure in PLONK prover
2020-09-19 23:19:30 +08:00