Commit graph

98 commits

Author SHA1 Message Date
therealyingtong
48bfea9782 Replace DummyHash with BLAKE2b 2021-02-02 00:53:53 +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
b9737ada93 Add serialization support for polycommit Params. 2021-01-24 08:05:58 +08:00
str4d
963a91464a
Merge pull request #120 from daira/sqrt_ratio
Add sqrt_ratio implementation.
2021-01-24 07:58:14 +13: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
Sean Bowe
e4dac4f621
clippy: remove unnecessarily explicit lifetimes and return types 2021-01-14 08:53:19 -07:00
Jack Grigg
ec8c925587
doc: Fix broken intra-doc link 2021-01-14 08:46:25 -07:00
Jack Grigg
95314d0f69
clippy: Add type definitions for complex types 2021-01-14 08:46:23 -07:00
Jack Grigg
75915f67ed
clippy: Small cleanups 2021-01-14 08:43:25 -07:00
Jack Grigg
6dd7595438
clippy: Remove useless actions
- Dropping a reference does nothing.
- Dropping a Copy type drops a copy.
- No need to clone the last usage of a variable.
2021-01-14 08:43:25 -07:00
Daira Hopwood
c5e48fdd06 Address @ebfull's review comments.
Co-authored-by: Sean Bowe <sean@electriccoin.co>
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2021-01-14 02:34:43 +00:00
Sean Bowe
ec2d8db8cb
Multiopen prover never needed evals to be specified.
The Lagrange interpolation we were doing was pointless. kate_division sheds the constant
term off each time it is invoked because the quotient polynomial isn't affected by it.
This means we were modifying coefficients that end up getting discarded anyway; the
quotient polynomial coefficients are already determined exactly by the leading coefficients
and the fact that a root exists at each of the points.
2021-01-13 17:22:32 -07:00
Sean Bowe
1f510016d8
Simplifications to some logic.
Co-authored-by: Jack Grigg <jack@electriccoin.co>
2021-01-13 15:51:48 -07:00
Sean Bowe
cc6b0bb7f2
Rename blind to \xi for consistency. 2021-01-13 15:24:44 -07:00
Sean Bowe
98c1d80c90
Avoid square challenges and forking in inner product argument
This modifies the scheme to be almost identical to the construction
outlined in Appenix A.2 of "Proof-Carrying Data from Accumulation
Schemes" (https://eprint.iacr.org/2020/499). The only remaining
difference is that we do not compute [v] U but instead subtract
[v] G_0 from the commitment before opening.
2021-01-12 07:40:20 -07:00
Sean Bowe
c8dedf2ec3
Fix challenge multiplications as per #119. 2021-01-06 10:47:06 -07:00
Sean Bowe
c5e0364962
Remove the Read/Write type parameters from Transcript{Read,Write}. 2021-01-06 10:45:11 -07:00
Sean Bowe
dff5a3a692
Generate the URS using a homebrew mixture of blake2b and try-and-increment. 2021-01-06 10:45:11 -07:00
Sean Bowe
a2999accb5
Rename DummyHash{Reader,Writer} to DummyHash{Read,Write}. 2021-01-06 10:45:11 -07:00
Sean Bowe
7ffd28a1b5
Remove unnecessary separate msm from commitment::verify_proof. 2021-01-06 10:45:11 -07:00
Sean Bowe
06552eec44
Update the PLONK implementation to adapt to the new transcript API. 2021-01-06 10:45:11 -07:00
Sean Bowe
5be7d9525d
Update multiopen APIs to reflect changes made to Transcript APIs 2021-01-06 10:45:10 -07:00
Sean Bowe
d30c6b62e4
Modification of the polynomial commitment scheme to compensate for Transcript API changes. 2021-01-06 10:40:26 -07:00
Jack Grigg
f49e1e6177 Fix breakage of trait resolution in Rust 1.49.0
Previously, `ChallengeScalar` could use the operator traits defined on
the `F: Field` type it wrapped, due to its `impl Deref<Target = F>`.
This was technically ambiguous, and Rust 1.49.0 makes that ambiguity an
error.

We could fix this by adding operator impls with `ChallengeScalar` on the
RHS, but that would conflict with zcash/halo2#111. Instead we manually
dereference every challenge scalar when used in an arithmetic operation.
2021-01-06 00:48:29 +00:00
Sean Bowe
65ed1d8568
Check h_evals/h_commitments lengths in vanishing argument verifier. 2020-12-22 08:59:06 -07:00
Jack Grigg
8389389d37 model: metrics 0.13.0-alpha.13 2020-12-22 12:27:36 +00:00
Sean Bowe
6c0e6f7348
cargo fmt 2020-12-03 13:59:17 -07:00
Sean Bowe
95e41fcfcf
Rename curves to Pallas/Vesta (Pasta). 2020-12-03 13:47:47 -07:00
Jack Grigg
4d4c79be58 Move Challenge and ChallengeScalar into the transcript module 2020-12-01 22:40:54 +00:00
Jack Grigg
2e6ca274a4 Fix challenge types in poly::multiopen and poly::commitment
The argument to the poly::commitment prover and verifier was mistakenly
represented as a challenge, when in fact the commitments may be opened at
any scalar (which just happens to be a challenge within poly::multiopen).

The poly::commitment APIs are now public again.
2020-12-01 22:34:18 +00:00
Jack Grigg
f0723dbbcc multiopen: Rename [x_4, x_5] challenges to [x_1, x_2]
Also added types for these challenges, even though it's not technically
necessary yet because we don't pass these around anywhere.
2020-12-01 21:42:32 +00:00
Jack Grigg
eb7ce442f9 Rename ChallengeX6 to ChallengeZ 2020-12-01 21:40:16 +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
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
str4d
cc5f45231d
Merge pull request #42 from zcash/plonk-benches
PLONK benchmarks
2020-11-24 18:14:07 +00: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
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
3407d13e4b Move curves and fields into tweedle module 2020-11-12 21:36:59 +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
therealyingtong
28e07eab16 Add to documentation for coset evaluation domain 2020-11-10 13:44:52 +08: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