Skip to content

Commit

Permalink
feat: implement crate halo2_alt with fflonk backend
Browse files Browse the repository at this point in the history
  • Loading branch information
han0110 committed Jan 25, 2024
1 parent 73408a1 commit 3450f19
Show file tree
Hide file tree
Showing 16 changed files with 3,118 additions and 2 deletions.
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
[workspace]
members = [
"halo2",
"halo2_alt",
"halo2_proofs",
]
16 changes: 16 additions & 0 deletions halo2_alt/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[package]
name = "halo2_alt"
version = "0.1.0"
edition = "2021"

[dependencies]
halo2_proofs = { path = "../halo2_proofs" }
rand_core = { version = "0.6", default-features = false }
rayon = "1.8"
blake2b_simd = "1"

[dev-dependencies]
rand_chacha = "0.3"

[features]
sanity-checks = []
23 changes: 23 additions & 0 deletions halo2_alt/src/backend.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
use crate::protocol::Protocol;
use halo2_proofs::plonk::Error;
use rand_core::RngCore;
use std::fmt::Debug;

pub mod fflonk;

pub trait Circuit<F>: Debug {
type WitnessBuf: Debug + Default;

fn protocol(&self) -> Protocol<F>;

fn preprocess(&self) -> Result<Vec<Vec<F>>, Error>;

fn witness(
&self,
phase: usize,
values: &[&[F]],
challenges: &[F],
buf: &mut Self::WitnessBuf,
rng: impl RngCore,
) -> Result<Vec<Vec<F>>, Error>;
}
Loading

0 comments on commit 3450f19

Please sign in to comment.