Commit Graph

13 Commits

Author SHA1 Message Date
str4d 46ba444169
Merge pull request #480 from zcash/477-mockprover-pretty-failures
Add `MockProver::assert_satisfied` with pretty-printed failures
2022-04-20 12:53:16 +02:00
therealyingtong a11cb9796e halo2_proofs 0.1.0-beta.4 2022-04-06 12:24:28 +08:00
Sean Bowe 4163b8765a
Reduce depth of AST by special casing the application of Horner's rule.
The existing code will fold together a very deep AST that applies Horner's
rule to each gate in a proof -- which could include multiple circuits and
so for some applications will quickly grow such that when we recursively
descend later during evaluation the stack will easily overflow.

This change special cases the application of Horner's rule to a
"DistributePowers" AST node to keep the tree depth from exploding in size.
2022-04-02 13:13:46 -06:00
Jack Grigg 0946bdb455 dev: Enable `VerifyFailure::Permutation` to point to region offsets 2022-03-30 01:39:50 +00:00
Jack Grigg 8acd4abfb3 halo2_proofs 0.1.0-beta.3 2022-03-22 19:59:10 +00:00
Jack Grigg e39c8e94d2 Update changelogs 2022-03-22 19:55:53 +00:00
Jack Grigg 369ff521d3 dev: Store gate offset in `VerifyFailure::CellNotAssigned` 2022-02-16 13:57:53 +00:00
Jack Grigg 5cdc029bb4 dev: Add `MockProver::assert_satisfied`
This is equivalent to `assert_eq!(mock_prover.verify(), Ok(()))`, but
pretty-prints the verification failures instead of debug-printing them.
In its initial state, it just prints the `Display` impl.
2022-02-16 13:56:17 +00:00
Jack Grigg f642727e51 halo2_proofs 0.1.0-beta.2 2022-02-14 21:58:20 +00:00
Jack Grigg e0cc7b39d3 Update changelogs 2022-02-14 21:29:42 +00:00
Sean Bowe f2daf91315
halo2_proofs: change IPA check equation to match the book
The verifier's check in the inner product argument used to assume that the
G'_0 value had an additional (trivial) blinding factor term, which makes
it slightly easier to reason that it never is the point at infinity.
However, we never sample challenges that are zeroes (both for security
and completeness reasons) so this element would never be the point at
infinity anyway. Thus, we can simplify the check with the added benefit of
matching the book's description of the protocol.
2022-02-14 09:37:57 -07:00
Jack Grigg 4d336f2707 halo2_proofs: Improve `plonk::verify_proof` API
Previously `plonk::verify_proof` took an `MSM` as an argument, to enable
batch verification. However, this also required that it take a source of
randomness in order to enforce separation of proofs within a batch. This
made single-proof verification unnecessarily non-deterministic.

We now have a `VerificationStrategy` trait encapsulating the necessary
details, and separate `SingleVerifier` and `BatchVerifier` structs for
the specific variants. Proof verifiers no longer need to create and
manage the `MSM` themselves, and single-proof verifiers no longer need
to supply a source of randomness.

Co-authored-by: Sean Bowe <sean@electriccoin.co>
2022-01-27 00:20:56 +00:00
Jack Grigg 3c6558f049 Move `halo2` code into `halo2_proofs` crate 2022-01-20 18:50:43 +00:00