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

Upgrade halo2_proofs #87

Merged
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
3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@ members = [
"halo2wrong",
"ecc",
"ecdsa",
"transcript"
"transcript",
]
resolver = "2"
2 changes: 1 addition & 1 deletion halo2wrong/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ edition = "2021"
num-bigint = { version = "0.4", features = ["rand"] }
num-integer = "0.1"
num-traits = "0.2"
halo2 = { package = "halo2_proofs", git = "https://github.com/privacy-scaling-explorations/halo2", tag = "v2023_04_20" }
halo2 = { package = "halo2_proofs", git = "https://github.com/privacy-scaling-explorations/halo2", tag = "v0.3.0" }

[dev-dependencies]
rand = "0.8"
Expand Down
2 changes: 1 addition & 1 deletion halo2wrong/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ pub fn mock_prover_verify<F: FromUniformBytes<64> + Ord, C: Circuit<F>>(
let prover = MockProver::run(dimension.k(), circuit, instance)
.unwrap_or_else(|err| panic!("{:#?}", err));
assert_eq!(
prover.verify_at_rows_par(dimension.advice_range(), dimension.advice_range()),
prover.verify_at_rows(dimension.advice_range(), dimension.advice_range()),
Ok(())
)
}
Expand Down
4 changes: 2 additions & 2 deletions integer/src/chip.rs
Original file line number Diff line number Diff line change
Expand Up @@ -642,12 +642,12 @@ mod tests {
pub(crate) fn rand_in_remainder_range(
&self,
) -> Integer<W, N, NUMBER_OF_LIMBS, BIT_LEN_LIMB> {
let el = OsRng.gen_biguint(self.rns.max_remainder.bits() as u64);
let el = OsRng.gen_biguint(self.rns.max_remainder.bits());
Integer::from_big(el, Rc::clone(&self.rns))
}

pub(crate) fn rand_in_operand_range(&self) -> Integer<W, N, NUMBER_OF_LIMBS, BIT_LEN_LIMB> {
let el = OsRng.gen_biguint(self.rns.max_operand.bits() as u64);
let el = OsRng.gen_biguint(self.rns.max_operand.bits());
Integer::from_big(el, Rc::clone(&self.rns))
}

Expand Down
6 changes: 3 additions & 3 deletions integer/src/rns.rs
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ impl<W: PrimeField, N: PrimeField, const NUMBER_OF_LIMBS: usize, const BIT_LEN_L
/// when values when working with `big_uint`.
fn calculate_base_aux() -> [big_uint; NUMBER_OF_LIMBS] {
let two = N::from(2);
let r = &fe_to_big(two.pow(&[BIT_LEN_LIMB as u64, 0, 0, 0]));
let r = &fe_to_big(two.pow([BIT_LEN_LIMB as u64]));
let wrong_modulus = modulus::<W>();
let wrong_modulus: Vec<N> = decompose_big(wrong_modulus, NUMBER_OF_LIMBS, BIT_LEN_LIMB);

Expand Down Expand Up @@ -536,14 +536,14 @@ impl<W: PrimeField, N: PrimeField, const NUMBER_OF_LIMBS: usize, const BIT_LEN_L

// Right shifts field element by `u * BIT_LEN_LIMB` bits
let right_shifters = (0..NUMBER_OF_LIMBS)
.map(|i| two_inv.pow(&[(i * BIT_LEN_LIMB) as u64, 0, 0, 0]))
.map(|i| two_inv.pow([(i * BIT_LEN_LIMB) as u64]))
.collect::<Vec<N>>()
.try_into()
.unwrap();

// Left shifts field element by `u * BIT_LEN_LIMB` bits
let left_shifters = (0..NUMBER_OF_LIMBS)
.map(|i| two.pow(&[(i * BIT_LEN_LIMB) as u64, 0, 0, 0]))
.map(|i| two.pow([(i * BIT_LEN_LIMB) as u64]))
.collect::<Vec<N>>()
.try_into()
.unwrap();
Expand Down
2 changes: 1 addition & 1 deletion maingate/src/instructions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1000,7 +1000,7 @@ pub trait MainGateInstructions<F: PrimeField, const WIDTH: usize>: Chip<F> {

let terms = bits
.iter()
.zip(bases.into_iter())
.zip(bases)
.map(|(bit, base)| Term::Assigned(bit, base))
.collect::<Vec<_>>();
let result = self.compose(ctx, &terms, F::ZERO)?;
Expand Down
4 changes: 2 additions & 2 deletions maingate/src/range.rs
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ impl<F: PrimeField> RangeChip<F> {
None
} else {
let bases = (0..F::NUM_BITS as usize / bit_len)
.map(|i| F::from(2).pow(&[(bit_len * i) as u64, 0, 0, 0]))
.map(|i| F::from(2).pow([(bit_len * i) as u64]))
.collect();
Some((bit_len, bases))
}
Expand Down Expand Up @@ -520,7 +520,7 @@ mod tests {
let inputs = (2..20)
.map(|number_of_limbs| {
let bit_len = LIMB_BIT_LEN * number_of_limbs + OVERFLOW_BIT_LEN;
let value = Fp::from(2).pow(&[bit_len as u64, 0, 0, 0]) - Fp::one();
let value = Fp::from(2).pow([bit_len as u64]) - Fp::one();
Input {
value: Value::known(value),
limb_bit_len: LIMB_BIT_LEN,
Expand Down
2 changes: 1 addition & 1 deletion transcript/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ edition = "2021"

[dependencies]
ecc = { path = "../ecc", default-features = false }
poseidon = { git = "https://github.com/privacy-scaling-explorations/poseidon.git", tag = "v2023_04_20" }
poseidon = { git = "https://github.com/privacy-scaling-explorations/poseidon.git", tag = "v2024_01_31" }
subtle = { version = "2.3", default-features = false }

[dev-dependencies]
Expand Down
2 changes: 1 addition & 1 deletion transcript/src/transcript.rs
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ mod tests {
ctx,
&self.spec,
ecc_chip.clone(),
LimbRepresentation::default(),
LimbRepresentation,
)?;

for e in self.inputs.as_ref().transpose_vec(self.n) {
Expand Down
Loading