mirror of https://github.com/zcash/halo2.git
Merge pull request #109 from zcash/halo2-bump
Migrate to latest version of halo2
This commit is contained in:
commit
e21f133862
|
@ -37,7 +37,7 @@ plotters = { version = "0.3.0", optional = true }
|
||||||
|
|
||||||
[dependencies.halo2]
|
[dependencies.halo2]
|
||||||
git = "https://github.com/zcash/halo2.git"
|
git = "https://github.com/zcash/halo2.git"
|
||||||
rev = "32cdcfa66fbc4ca3103115518d374f4cfe6c3b7a"
|
rev = "d8e4f24df44da94ab5cacbc531517e2b63fe45ee"
|
||||||
|
|
||||||
[dependencies.reddsa]
|
[dependencies.reddsa]
|
||||||
git = "https://github.com/str4d/redjubjub.git"
|
git = "https://github.com/str4d/redjubjub.git"
|
||||||
|
|
|
@ -109,7 +109,7 @@ impl<F: FieldExt> Pow5T3Chip<F> {
|
||||||
let rc_1 = meta.query_fixed(rc_a[1], Rotation::cur());
|
let rc_1 = meta.query_fixed(rc_a[1], Rotation::cur());
|
||||||
let rc_2 = meta.query_fixed(rc_a[2], Rotation::cur());
|
let rc_2 = meta.query_fixed(rc_a[2], Rotation::cur());
|
||||||
|
|
||||||
let s_full = meta.query_selector(s_full, Rotation::cur());
|
let s_full = meta.query_selector(s_full);
|
||||||
|
|
||||||
let full_round = |next_idx: usize| {
|
let full_round = |next_idx: usize| {
|
||||||
s_full.clone()
|
s_full.clone()
|
||||||
|
@ -138,7 +138,7 @@ impl<F: FieldExt> Pow5T3Chip<F> {
|
||||||
let rc_b1 = meta.query_fixed(rc_b[1], Rotation::cur());
|
let rc_b1 = meta.query_fixed(rc_b[1], Rotation::cur());
|
||||||
let rc_b2 = meta.query_fixed(rc_b[2], Rotation::cur());
|
let rc_b2 = meta.query_fixed(rc_b[2], Rotation::cur());
|
||||||
|
|
||||||
let s_partial = meta.query_selector(s_partial, Rotation::cur());
|
let s_partial = meta.query_selector(s_partial);
|
||||||
|
|
||||||
let partial_round_linear = |idx: usize, rc_b: Expression<F>| {
|
let partial_round_linear = |idx: usize, rc_b: Expression<F>| {
|
||||||
s_partial.clone()
|
s_partial.clone()
|
||||||
|
@ -177,7 +177,7 @@ impl<F: FieldExt> Pow5T3Chip<F> {
|
||||||
let output_state_1 = meta.query_advice(state[1], Rotation::next());
|
let output_state_1 = meta.query_advice(state[1], Rotation::next());
|
||||||
let output_state_2 = meta.query_advice(state[2], Rotation::next());
|
let output_state_2 = meta.query_advice(state[2], Rotation::next());
|
||||||
|
|
||||||
let s_pad_and_add = meta.query_selector(s_pad_and_add, Rotation::cur());
|
let s_pad_and_add = meta.query_selector(s_pad_and_add);
|
||||||
|
|
||||||
let pad_and_add = |initial_state, input, output_state| {
|
let pad_and_add = |initial_state, input, output_state| {
|
||||||
// We pad the input by storing the required padding in fixed columns and
|
// We pad the input by storing the required padding in fixed columns and
|
||||||
|
|
|
@ -155,7 +155,7 @@ impl<F: FieldExt> CondSwapChip<F> {
|
||||||
// TODO: optimise shape of gate for Merkle path validation
|
// TODO: optimise shape of gate for Merkle path validation
|
||||||
|
|
||||||
meta.create_gate("a' = b ⋅ swap + a ⋅ (1-swap)", |meta| {
|
meta.create_gate("a' = b ⋅ swap + a ⋅ (1-swap)", |meta| {
|
||||||
let q_swap = meta.query_selector(q_swap, Rotation::cur());
|
let q_swap = meta.query_selector(q_swap);
|
||||||
|
|
||||||
let a = meta.query_advice(config.a, Rotation::cur());
|
let a = meta.query_advice(config.a, Rotation::cur());
|
||||||
let b = meta.query_advice(config.b, Rotation::cur());
|
let b = meta.query_advice(config.b, Rotation::cur());
|
||||||
|
@ -180,8 +180,7 @@ impl<F: FieldExt> CondSwapChip<F> {
|
||||||
let bool_check = swap.clone() * (one - swap);
|
let bool_check = swap.clone() * (one - swap);
|
||||||
|
|
||||||
array::IntoIter::new([a_check, b_check, bool_check])
|
array::IntoIter::new([a_check, b_check, bool_check])
|
||||||
.map(|poly| q_swap.clone() * poly)
|
.map(move |poly| q_swap.clone() * poly)
|
||||||
.collect()
|
|
||||||
});
|
});
|
||||||
|
|
||||||
config
|
config
|
||||||
|
|
|
@ -108,7 +108,7 @@ impl<F: FieldExt> EnableFlagChip<F> {
|
||||||
};
|
};
|
||||||
|
|
||||||
meta.create_gate("Enable flag", |meta| {
|
meta.create_gate("Enable flag", |meta| {
|
||||||
let q_enable = meta.query_selector(config.q_enable, Rotation::cur());
|
let q_enable = meta.query_selector(config.q_enable);
|
||||||
let value = meta.query_advice(config.value, Rotation::cur());
|
let value = meta.query_advice(config.value, Rotation::cur());
|
||||||
let enable_flag = meta.query_advice(config.enable_flag, Rotation::cur());
|
let enable_flag = meta.query_advice(config.enable_flag, Rotation::cur());
|
||||||
|
|
||||||
|
@ -218,9 +218,11 @@ mod tests {
|
||||||
let prover = MockProver::<Base>::run(1, &circuit, vec![]).unwrap();
|
let prover = MockProver::<Base>::run(1, &circuit, vec![]).unwrap();
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
prover.verify(),
|
prover.verify(),
|
||||||
Err(vec![VerifyFailure::Gate {
|
Err(vec![VerifyFailure::Constraint {
|
||||||
gate_index: 0,
|
gate_index: 0,
|
||||||
gate_name: "Enable flag",
|
gate_name: "Enable flag",
|
||||||
|
constraint_index: 0,
|
||||||
|
constraint_name: "",
|
||||||
row: 1,
|
row: 1,
|
||||||
}])
|
}])
|
||||||
);
|
);
|
||||||
|
|
Loading…
Reference in New Issue