Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[feat] Trait for Circuit with Default Inputs #223

Merged
merged 3 commits into from
Nov 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions halo2-base/src/utils/halo2.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
use halo2_proofs_axiom::plonk::Circuit;

use crate::ff::Field;
use crate::halo2_proofs::{
circuit::{AssignedCell, Cell, Region, Value},
Expand Down Expand Up @@ -113,3 +115,9 @@ pub fn constrain_virtual_equals_external<F: Field + Ord>(
let acell = copy_manager.assigned_advices.get(&ctx_cell).expect("cell not assigned");
region.constrain_equal(*acell, external_cell);
}

/// Circuit with default values.
pub trait CircuitWithDefault<F: Field>: Circuit<F> {
/// Return Circuit with default inputs for the given params. Return struct could be used for pkey generation.
fn default(params: Self::Params) -> Self;
}
2 changes: 0 additions & 2 deletions halo2-base/src/virtual_region/tests/lookups/memory.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
use std::any::TypeId;

use crate::{
halo2_proofs::{
arithmetic::Field,
Expand Down
Loading