Skip to content

Commit

Permalink
Limit the accessibilities of VerifierQuery and ProverQuery's fields
Browse files Browse the repository at this point in the history
  • Loading branch information
chiro-hiro committed Nov 23, 2023
1 parent bb57084 commit 7d80351
Showing 1 changed file with 7 additions and 17 deletions.
24 changes: 7 additions & 17 deletions halo2_proofs/src/poly/query.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ pub trait Query<F>: Sized + Clone + Send + Sync {
#[derive(Debug, Clone)]
pub struct ProverQuery<'com, C: CurveAffine> {
/// Point at which polynomial is queried
pub point: C::Scalar,
pub(crate) point: C::Scalar,
/// Coefficients of polynomial
pub poly: &'com Polynomial<C::Scalar, Coeff>,
pub(crate) poly: &'com Polynomial<C::Scalar, Coeff>,
/// Blinding factor of polynomial
pub blind: Blind<C::Scalar>,
pub(crate) blind: Blind<C::Scalar>,
}

impl<'com, C> ProverQuery<'com, C>
Expand Down Expand Up @@ -93,14 +93,14 @@ impl<'com, C: CurveAffine, M: MSM<C>> VerifierQuery<'com, C, M> {
}

/// A polynomial query at a point
#[derive(Debug)]
#[derive(Debug, Clone)]
pub struct VerifierQuery<'com, C: CurveAffine, M: MSM<C>> {
/// Point at which polynomial is queried
pub point: C::Scalar,
pub(crate) point: C::Scalar,
/// Commitment to polynomial
pub commitment: CommitmentReference<'com, C, M>,
pub(crate) commitment: CommitmentReference<'com, C, M>,
/// Evaluation of polynomial at query point
pub eval: C::Scalar,
pub(crate) eval: C::Scalar,
}

impl<'com, C, M> VerifierQuery<'com, C, M>
Expand All @@ -122,16 +122,6 @@ where
}
}

impl<'com, C: CurveAffine, M: MSM<C>> Clone for VerifierQuery<'com, C, M> {
fn clone(&self) -> Self {
Self {
point: self.point,
commitment: self.commitment,
eval: self.eval,
}
}
}

#[allow(clippy::upper_case_acronyms)]
#[derive(Clone, Debug)]
pub enum CommitmentReference<'r, C: CurveAffine, M: MSM<C>> {
Expand Down

0 comments on commit 7d80351

Please sign in to comment.