Skip to content

Commit

Permalink
Nits -> MSRV because of div_ceil
Browse files Browse the repository at this point in the history
  • Loading branch information
iquerejeta committed Nov 22, 2024
1 parent f6cfa58 commit 6812146
Show file tree
Hide file tree
Showing 9 changed files with 30 additions and 32 deletions.
2 changes: 1 addition & 1 deletion halo2/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ authors = [
"Jack Grigg <[email protected]>",
]
edition = "2021"
rust-version = "1.56.1"
rust-version = "1.73.0"
description = "[BETA] Fast zero-knowledge proof-carrying data implementation with no trusted setup"
license = "MIT OR Apache-2.0"
repository = "https://github.com/privacy-scaling-explorations/halo2"
Expand Down
4 changes: 2 additions & 2 deletions halo2_backend/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ authors = [
"Privacy Scaling Explorations team",
]
edition = "2021"
rust-version = "1.66.0"
rust-version = "1.73.0"
description = """
Halo2 backend implementation. This package implements the halo2 proof system which includes setup (key generation), proving and verifying.
"""
Expand All @@ -31,7 +31,7 @@ group = "0.13"
halo2curves = { version = "0.7.0", default-features = false }
rand_core = { version = "0.6", default-features = false }
tracing = "0.1"
blake2b_simd = "1" # MSRV 1.66.0
blake2b_simd = "1"
sha3 = "0.9.1"
rand_chacha = "0.3"
serde = { version = "1", optional = true, features = ["derive"] }
Expand Down
7 changes: 2 additions & 5 deletions halo2_backend/src/poly/kzg/multiopen/gwc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,11 @@ mod prover;
mod verifier;

pub use prover::ProverGWC;
use std::collections::{BTreeMap, BTreeSet, HashMap, HashSet};
use std::collections::{BTreeMap, BTreeSet};
pub use verifier::VerifierGWC;

use crate::poly::kzg::commitment;
use crate::poly::{Coeff, Polynomial};
use crate::{poly::query::Query, transcript::ChallengeScalar};
use ff::Field;
use halo2curves::CurveAffine;

// ======================= ZCASH intermediate sets ======================== //

Expand Down Expand Up @@ -184,4 +181,4 @@ where
// }
//
// set_index_count
// }
// }
22 changes: 13 additions & 9 deletions halo2_backend/src/poly/kzg/multiopen/gwc/prover.rs
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
use super::{
construct_intermediate_sets_zcash,
ChallengeX1, ChallengeX2, ChallengeX3, ChallengeX4,
construct_intermediate_sets_zcash, ChallengeX1, ChallengeX2, ChallengeX3, ChallengeX4,
};
use crate::arithmetic::{eval_polynomial, kate_division, powers, truncate, truncated_powers};
use crate::helpers::SerdeCurveAffine;
use crate::poly::commitment::{MSM, ParamsProver};
use crate::poly::commitment::Prover;
use crate::poly::commitment::{ParamsProver, MSM};
use crate::poly::kzg::commitment::{KZGCommitmentScheme, ParamsKZG};
use crate::poly::query::ProverQuery;
use crate::poly::{Coeff, commitment::Blind, Polynomial};
use crate::poly::{commitment::Blind, Coeff, Polynomial};
use crate::transcript::{EncodedChallenge, TranscriptWrite};

use crate::poly::kzg::msm::{DualMSM, MSMKZG};
use crate::poly::kzg::strategy::GuardKZG;
use ff::Field;
use group::Curve;
use halo2_middleware::zal::traits::MsmAccel;
use halo2curves::pairing::{Engine, MultiMillerLoop};
Expand All @@ -19,9 +21,6 @@ use rand_core::RngCore;
use std::fmt::Debug;
use std::io;
use std::marker::PhantomData;
use ff::Field;
use crate::poly::kzg::msm::{DualMSM, MSMKZG};
use crate::poly::kzg::strategy::GuardKZG;

/// Concrete KZG prover with GWC variant
#[derive(Debug)]
Expand Down Expand Up @@ -110,7 +109,10 @@ where
.collect::<Vec<_>>();
Self::inner_product(&f_polys, powers(*x2))
};
let f_com = self.params.commit(engine, &f_poly, Blind::default()).to_affine();
let f_com = self
.params
.commit(engine, &f_poly, Blind::default())
.to_affine();
transcript.write_point(f_com)?;
let x3: ChallengeX3<_> = transcript.squeeze_challenge_scalar();
let x3 = truncate(*x3);
Expand All @@ -132,7 +134,9 @@ where
values: kate_division(&(&final_poly - v).values, x3),
_marker: PhantomData,
};
self.params.commit(engine, &pi_poly, Blind::default()).to_affine()
self.params
.commit(engine, &pi_poly, Blind::default())
.to_affine()
};

transcript.write_point(pi)?;
Expand Down
17 changes: 7 additions & 10 deletions halo2_backend/src/poly/kzg/multiopen/gwc/verifier.rs
Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@
use ff::PrimeField;
use std::fmt::Debug;
use std::marker::PhantomData;
use ff::PrimeField;

use super::{
construct_intermediate_sets_zcash,
ChallengeX1, ChallengeX2, ChallengeX3, ChallengeX4,
construct_intermediate_sets_zcash, ChallengeX1, ChallengeX2, ChallengeX3, ChallengeX4,
};
use crate::arithmetic::{eval_polynomial, lagrange_interpolate, truncate, truncated_powers};
use crate::helpers::SerdeCurveAffine;
use crate::poly::commitment::Verifier;
use crate::poly::commitment::MSM;
use crate::poly::commitment::{Verifier};
use crate::poly::kzg::commitment::KZGCommitmentScheme;
use crate::poly::kzg::msm::{DualMSM, MSMKZG};
use crate::poly::kzg::strategy::GuardKZG;
use crate::poly::query::Query;
use crate::poly::query::{CommitmentReference, VerifierQuery};
use crate::poly::Error;
use crate::transcript::{EncodedChallenge, TranscriptRead};
Expand All @@ -29,7 +27,7 @@ pub struct VerifierGWC<E: Engine> {
_marker: PhantomData<E>,
}

fn msm_inner_product<E: Engine>(
fn msm_inner_product<E>(
msms: &[MSMKZG<E>],
scalars: impl Iterator<Item = E::Fr>,
) -> MSMKZG<E>
Expand Down Expand Up @@ -70,7 +68,6 @@ fn evals_inner_product<F: PrimeField + Clone>(
res
}


impl<'params, E> Verifier<'params, KZGCommitmentScheme<E>> for VerifierGWC<E>
where
E: MultiMillerLoop + Debug,
Expand Down Expand Up @@ -156,10 +153,10 @@ where
.fold(E::Fr::ZERO, |acc_eval, ((points, evals), proof_eval)| {
let r_poly = lagrange_interpolate(points, evals);
let r_eval = eval_polynomial(&r_poly, x3);
let eval = points.iter().fold(*proof_eval - &r_eval, |eval, point| {
eval * &(x3 - point).invert().unwrap()
let eval = points.iter().fold(*proof_eval - r_eval, |eval, point| {
eval * (x3 - point).invert().unwrap()
});
acc_eval * &(*x2) + &eval
acc_eval * *x2 + eval
});

let x4: ChallengeX4<_> = transcript.squeeze_challenge_scalar();
Expand Down
2 changes: 1 addition & 1 deletion halo2_debug/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ authors = [
"Privacy Scaling Explorations team",
]
edition = "2021"
rust-version = "1.66.0"
rust-version = "1.73.0"
description = """
Halo2 Debug. This package contains utilities for debugging and testing within
the halo2 ecosystem.
Expand Down
4 changes: 2 additions & 2 deletions halo2_frontend/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ authors = [
"Privacy Scaling Explorations team",
]
edition = "2021"
rust-version = "1.66.0"
rust-version = "1.73.0"
description = """
Halo2 frontend implementation. This package implements an API to write circuits, handles witness generation and contains the MockProver.
"""
Expand All @@ -30,7 +30,7 @@ ff = "0.13"
group = "0.13"
halo2curves = { version = "0.7.0", default-features = false }
tracing = "0.1"
blake2b_simd = "1" # MSRV 1.66.0
blake2b_simd = "1"
serde = { version = "1", optional = true, features = ["derive"] }
serde_derive = { version = "1", optional = true}
halo2_middleware = { path = "../halo2_middleware" }
Expand Down
2 changes: 1 addition & 1 deletion halo2_middleware/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ authors = [
"Privacy Scaling Explorations team",
]
edition = "2021"
rust-version = "1.66.0"
rust-version = "1.73.0"
description = """
Halo2 middleware. This package contains the types and traits required for the frontend-backend interaction.
"""
Expand Down
2 changes: 1 addition & 1 deletion halo2_proofs/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ authors = [
"Privacy Scaling Explorations team",
]
edition = "2021"
rust-version = "1.66.0"
rust-version = "1.73.0"
description = """
Fast PLONK-based zero-knowledge proving system with no trusted setup
"""
Expand Down

0 comments on commit 6812146

Please sign in to comment.