Skip to content
Open
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
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,6 @@ Cargo.lock

/halo2_ecc/src/bn254/data/
/halo2_ecc/src/secp256k1/data/

*.csv
*.srs
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
members = [
"halo2-base",
"halo2-ecc",
"hashes/zkevm-keccak",
# "hashes/zkevm-keccak",
]

[profile.dev]
Expand Down
2 changes: 1 addition & 1 deletion halo2-base/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jemallocator = { version = "0.5", optional = true }
mimalloc = { version = "0.1", default-features = false, optional = true }

[features]
default = ["halo2-axiom", "display"]
default = ["halo2-pse", "display"]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

change to halo2-scroll

dev-graph = ["halo2_proofs?/dev-graph", "halo2_proofs_axiom?/dev-graph", "plotters"]
halo2-pse = ["halo2_proofs"]
halo2-axiom = ["halo2_proofs_axiom"]
Expand Down
4 changes: 2 additions & 2 deletions halo2-base/src/gates/flex_gate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -750,7 +750,7 @@ impl<F: ScalarField> GateInstructions<F> for FlexGateConfig<F> {
],
vec![(0, Some([F::zero(), F::one(), -F::one()])), (3, None)],
);
ctx.region.constrain_equal(assignments[2].cell(), assignments[5].cell());
ctx.region.constrain_equal(assignments[2].cell(), assignments[5].cell()).unwrap();
assignments.pop().unwrap()
}
}
Expand Down Expand Up @@ -815,7 +815,7 @@ impl<F: ScalarField> GateInstructions<F> for FlexGateConfig<F> {
self.pow_of_two[..range_bits].iter().map(|c| Constant(*c)),
&mut bit_cells,
);
ctx.region.constrain_equal(a.cell(), acc.cell());
ctx.region.constrain_equal(a.cell(), acc.cell()).unwrap();

for bit_cell in &bit_cells {
self.assign_region(
Expand Down
8 changes: 4 additions & 4 deletions halo2-base/src/gates/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,10 @@ pub trait GateInstructions<F: ScalarField> {
let assignments =
self.assign_region(ctx, inputs, gate_offsets.into_iter().map(|i| (i as isize, None)));
for (offset1, offset2) in equality_offsets.into_iter() {
ctx.region.constrain_equal(assignments[offset1].cell(), assignments[offset2].cell());
ctx.region.constrain_equal(assignments[offset1].cell(), assignments[offset2].cell()).unwrap();
}
for (assigned, eq_offset) in external_equality.into_iter() {
ctx.region.constrain_equal(assigned.cell(), assignments[eq_offset].cell());
ctx.region.constrain_equal(assigned.cell(), assignments[eq_offset].cell()).unwrap();
}
assignments
}
Expand Down Expand Up @@ -198,7 +198,7 @@ pub trait GateInstructions<F: ScalarField> {
let out_val = a.value().zip(b.value()).map(|(a, b)| (F::one() - a) * b);
let assignments =
self.assign_region(ctx, vec![Witness(out_val), a, b.clone(), b], vec![(0, None)]);
ctx.region.constrain_equal(assignments[2].cell(), assignments[3].cell());
ctx.region.constrain_equal(assignments[2].cell(), assignments[3].cell()).unwrap();
assignments.into_iter().next().unwrap()
}

Expand Down Expand Up @@ -227,7 +227,7 @@ pub trait GateInstructions<F: ScalarField> {

fn assert_equal(&self, ctx: &mut Context<'_, F>, a: QuantumCell<F>, b: QuantumCell<F>) {
if let (Existing(a), Existing(b)) = (&a, &b) {
ctx.region.constrain_equal(a.cell(), b.cell());
ctx.region.constrain_equal(a.cell(), b.cell()).unwrap();
} else {
self.assign_region_smart(
ctx,
Expand Down
2 changes: 1 addition & 1 deletion halo2-base/src/gates/range.rs
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ impl<F: ScalarField> RangeConfig<F> {
),
};
// the inner product above must equal `a`
ctx.region.constrain_equal(a.cell(), acc.cell());
ctx.region.constrain_equal(a.cell(), acc.cell()).unwrap();
};
assert_eq!(limbs_assigned.len(), k);

Expand Down
2 changes: 1 addition & 1 deletion halo2-ecc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ criterion = "0.4"
criterion-macro = "0.4"

[features]
default = ["jemallocator", "halo2-axiom", "display"]
default = ["jemallocator", "halo2-pse", "display"]
dev-graph = ["halo2-base/dev-graph"]
display = ["halo2-base/display"]
halo2-pse = ["halo2-base/halo2-pse"]
Expand Down