Commit Graph

22 Commits

Author SHA1 Message Date
Thor 951abe619a
fix: clippy (#203)
* fix: clippy

* fmt

* fix: Final clippy complains & adjustments

---------

Co-authored-by: CPerezz <c.perezbaro@gmail.com>
2023-09-18 09:25:26 +02:00
Eduard S 0d56c57a07
Extend Circuit trait to take parameters in config (#168)
* Extend Circuit trait to take parameters in config

The Circuit trait is extended with the following:
```
pub trait Circuit<F: Field> {
    /// [...]
    type Params: Default;

    fn params(&self) -> Self::Params {
        Self::Params::default()
    }

    fn configure_with_params(meta: &mut ConstraintSystem<F>, params: &Self::Params) -> Self::Config {
        Self::configure(meta)
    }

    fn configure(meta: &mut ConstraintSystem<F>) -> Self::Config;
}
```

This allows runtime parametrization of the circuit configuration.  The extension to the Circuit trait has been designed to minimize the breaking change: existing circuits only need to define the associated `type Params`.

Unfortunately "Associated type defaults" are unstable in Rust, otherwise this would be a non-breaking change.  See https://github.com/rust-lang/rust/issues/29661

* Implement circuit params under feature flag

* Don't overwrite configure method

* Fix doc test
2023-04-20 21:20:09 +08:00
Carlos Pérez fcdd5b910d
change: Migrate workspace to pasta_curves-0.5 (#157)
* change: Migrate workspace to pasta_curves-0.5

This ports the majority of the workspace to the `pasta_curves-0.5.0`
leaving some tricky edge-cases that we need to handle carefully.

Resolves: #132

* fix: Complete latest trait bounds to compile halo2proofs

* change: Migrate examples & benches to pasta 0.5

* change: Migrate halo2_gadgets to pasta-0.5

* change: Update gadgets outdated code with latest upstream

* fix: Sha3 gadget circuit

* fix: doc tests

* chore: Update merged main

* fix: Apply review suggestions
2023-03-07 17:29:37 +01:00
Zhang Zhuo 31efabd369 Add name in `lookup::Argument` 2022-08-19 16:00:51 +08:00
kilic 51d523df60 Commitment scheme abstraction
Add SHPLONK and GWC varians of KZG
2022-08-19 16:00:51 +08:00
ChihChengLiang 25b47f23c8 add back diffs 2022-08-19 11:52:07 +08:00
ChihChengLiang 63b42c96cd Merge branch 'upstream' into purely-upstream 2022-08-19 11:47:43 +08:00
Jack Grigg dd94fb95a4 Rework `halo2_proofs::plonk::BatchVerifier`
`BatchVerifier` now manages the entire batch verification process.
Individual proofs are verified on a threadpool, and the resulting MSMs
are then batch-checked as before. The addition of parallelism here
couples with zcash/halo2#608 to make parallelism less fine-grained and
reduce the overhead of multi-threading.
2022-06-23 16:52:08 +00:00
Jack Grigg 47f25ad632 halo2_proofs: Replace `Option<V>` with `Value<V>` 2022-06-08 23:03:16 +00:00
Sean Bowe f46d77763e
Remove logic for reading and writing VerificationKey to/from buffers. 2022-03-16 14:19:33 -06:00
Sean Bowe 819bc3c2f5
Stop placing the selector_map (which is an internal API detail) in the pinned verification key. 2022-03-16 14:19:13 -06:00
Sean Bowe e10f4e1d0e
Add mechanism for generating a new proof in test. 2022-03-16 12:53:04 -06:00
Chih Cheng Liang 6f8a605821
Merge pull request #29 from lispc/debug/better_lookup_err3
dev: add name for lookup
2022-02-16 23:14:40 +08:00
kilic 8b616c33e0 Remove commented out code 2022-02-15 17:41:33 +03:00
Zhang Zhuo ca8cad0e62 format 2022-02-15 20:14:01 +08:00
Zhang Zhuo 2a49e2a2bb dev: add name for lookup 2022-02-15 14:52:35 +08:00
Zhang Zhuo e2a01d23db dev: add name for lookup 2022-02-15 11:57:57 +08:00
Sean Bowe 90bebdf29a
halo2_proofs: add hardcoded proof to plonk_api test for backwards compatibility testing 2022-02-14 08:48:03 -07:00
kilic bebee898fe Add lookup_any 2022-02-12 20:56:25 +03:00
kilic 0e9b075c3a Change multiopen commitment scheme to KZG 2022-02-12 20:56:25 +03: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