Skip to content

Commit

Permalink
feat: add halo2_debug package (#346)
Browse files Browse the repository at this point in the history
  • Loading branch information
ed255 authored Jun 10, 2024
1 parent e86b7f7 commit edffc1e
Show file tree
Hide file tree
Showing 10 changed files with 510 additions and 16 deletions.
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ members = [
"halo2_frontend",
"halo2_middleware",
"halo2_backend",
"halo2_debug",
"p3_frontend",
]
resolver = "2"
10 changes: 8 additions & 2 deletions halo2_backend/src/plonk/circuit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@ pub enum VarBack {
Challenge(ChallengeMid),
}

impl std::fmt::Display for VarBack {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "{:?}", self)
}
}

impl Variable for VarBack {
fn degree(&self) -> usize {
match self {
Expand All @@ -40,8 +46,8 @@ impl Variable for VarBack {
}
}

fn write_identifier<W: std::io::Write>(&self, _writer: &mut W) -> std::io::Result<()> {
unimplemented!("unused method")
fn write_identifier<W: std::io::Write>(&self, writer: &mut W) -> std::io::Result<()> {
write!(writer, "{}", self)
}
}

Expand Down
27 changes: 27 additions & 0 deletions halo2_debug/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
[package]
name = "halo2_debug"
version = "0.3.0"
authors = [
"Privacy Scaling Explorations team",
]
edition = "2021"
rust-version = "1.66.0"
description = """
Halo2 Debug. This package contains utilities for debugging and testing within
the halo2 ecosystem.
"""
license = "MIT OR Apache-2.0"
repository = "https://github.com/privacy-scaling-explorations/halo2"
documentation = "https://privacy-scaling-explorations.github.io/halo2/"
categories = ["cryptography"]
keywords = ["halo", "proofs", "zkp", "zkSNARKs"]

[package.metadata.docs.rs]
all-features = true
rustdoc-args = ["--cfg", "docsrs", "--html-in-header", "katex-header.html"]

[dependencies]
ff = "0.13"
halo2curves = { version = "0.6.1", default-features = false }
num-bigint = "0.4.5"
halo2_middleware = { path = "../halo2_middleware" }
Loading

0 comments on commit edffc1e

Please sign in to comment.