From df07f0c2c71187e5ec91232d66de97fb8c5f5fa4 Mon Sep 17 00:00:00 2001 From: "Brandon H. Gomes" Date: Fri, 16 Dec 2022 15:40:15 -0500 Subject: [PATCH 1/3] wip: start halo2 plugin Signed-off-by: Brandon H. Gomes --- plugins/halo2/Cargo.toml | 37 +++++++++++++++++++++++++++++++++++++ plugins/halo2/README.md | 1 + plugins/halo2/src/lib.rs | 12 ++++++++++++ 3 files changed, 50 insertions(+) create mode 100644 plugins/halo2/Cargo.toml create mode 100644 plugins/halo2/README.md create mode 100644 plugins/halo2/src/lib.rs diff --git a/plugins/halo2/Cargo.toml b/plugins/halo2/Cargo.toml new file mode 100644 index 00000000..b3a2890f --- /dev/null +++ b/plugins/halo2/Cargo.toml @@ -0,0 +1,37 @@ +[package] +name = "openzl-plugin-halo2" +version = "0.0.0" +edition = "2021" +readme = "README.md" +license = "MIT OR Apache-2.0" +repository = "https://github.com/openzklib/openzl" +homepage = "https://openzl.org" +documentation = "https://docs.rs/openzl-plugin-halo2" +categories = [""] +keywords = [""] +description = "Open ZL Halo2 Plugin" + +[package.metadata.docs.rs] +# To build locally: +# RUSTDOCFLAGS="--cfg doc_cfg" cargo +nightly doc --all-features --open +all-features = true +rustdoc-args = ["--cfg", "doc_cfg"] + +[badges] +is-it-maintained-issue-resolution = { repository = "openzklib/openzl" } +is-it-maintained-open-issues = { repository = "openzklib/openzl" } +maintenance = { status = "actively-developed" } + +[features] +# Standard Library +std = [ + "openzl-crypto/std", + "openzl-util/std", +] + +[dependencies] +eclair = { path = "../../eclair", default-features = false } +halo2_gadgets = { git = "https://github.com/openzklib/halo2", default-features = false } +halo2_proofs = { git = "https://github.com/openzklib/halo2", default-features = false } +openzl-crypto = { path = "../../openzl-crypto", default-features = false } +openzl-util = { path = "../../openzl-util", default-features = false } diff --git a/plugins/halo2/README.md b/plugins/halo2/README.md new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/plugins/halo2/README.md @@ -0,0 +1 @@ + diff --git a/plugins/halo2/src/lib.rs b/plugins/halo2/src/lib.rs new file mode 100644 index 00000000..6981e2ac --- /dev/null +++ b/plugins/halo2/src/lib.rs @@ -0,0 +1,12 @@ +//! Halo2 OpenZL Plugin + +#![cfg_attr(not(any(feature = "std", test)), no_std)] +#![cfg_attr(doc_cfg, feature(doc_cfg))] +#![forbid(rustdoc::broken_intra_doc_links)] +#![forbid(missing_docs)] + +#[doc(inline)] +pub use halo2_gadgets as gadgets; + +#[doc(inline)] +pub use halo2_proofs as proofs; From 187e229dfb6e2307fbd605a6e510e75801e25046 Mon Sep 17 00:00:00 2001 From: "Brandon H. Gomes" Date: Fri, 16 Dec 2022 15:41:38 -0500 Subject: [PATCH 2/3] chore: add CHANGELOG entry Signed-off-by: Brandon H. Gomes --- CHANGELOG.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1a13e825..212f1fcb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,9 +5,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), ## [Unreleased] ### Added -- [\#3](https://github.com/openzklib/openzl/pull/3) Migrate some of OpenZL from the Manta-Network codebase -- [\#4](https://github.com/openzklib/openzl/pull/4) Add CI and Relevant Contribution Files +- [\#53](https://github.com/openzklib/openzl/pull/53) Add Initial Halo2 Plugin - [\#34](https://github.com/openzklib/openzl/pull/34) Migrate Poseidon from the Manta-Network codebase +- [\#4](https://github.com/openzklib/openzl/pull/4) Add CI and Relevant Contribution Files +- [\#3](https://github.com/openzklib/openzl/pull/3) Migrate some of OpenZL from the Manta-Network codebase ### Changed From 0baea859644a39df6895fa0d47957613596d96a8 Mon Sep 17 00:00:00 2001 From: "Brandon H. Gomes" Date: Sat, 18 Feb 2023 10:29:20 -0500 Subject: [PATCH 3/3] wip: commit save point Signed-off-by: Brandon H. Gomes --- plugins/halo2/src/compiler.rs | 22 ++++++++++++++++++++++ plugins/halo2/src/lib.rs | 4 ++++ 2 files changed, 26 insertions(+) create mode 100644 plugins/halo2/src/compiler.rs diff --git a/plugins/halo2/src/compiler.rs b/plugins/halo2/src/compiler.rs new file mode 100644 index 00000000..ee09b30c --- /dev/null +++ b/plugins/halo2/src/compiler.rs @@ -0,0 +1,22 @@ +//! Compiler + +use crate::proofs::{arithmetic::Field, plonk::ConstraintSystem}; + +/// Compiler +pub struct Compiler +where + F: Field, +{ + /// Constraint System + cs: ConstraintSystem, +} + +/* + +/// +pub struct FieldVar; + +/// +pub struct Bool; + +*/ diff --git a/plugins/halo2/src/lib.rs b/plugins/halo2/src/lib.rs index 6981e2ac..e88485bc 100644 --- a/plugins/halo2/src/lib.rs +++ b/plugins/halo2/src/lib.rs @@ -5,8 +5,12 @@ #![forbid(rustdoc::broken_intra_doc_links)] #![forbid(missing_docs)] +extern crate alloc; + #[doc(inline)] pub use halo2_gadgets as gadgets; #[doc(inline)] pub use halo2_proofs as proofs; + +pub mod compiler;