From 7d8035113d5bd24cef482aeb7874b5994dd742a0 Mon Sep 17 00:00:00 2001 From: Chiro Hiro Date: Thu, 23 Nov 2023 16:41:55 +0700 Subject: [PATCH] Limit the accessibilities of `VerifierQuery` and `ProverQuery`'s fields --- halo2_proofs/src/poly/query.rs | 24 +++++++----------------- 1 file changed, 7 insertions(+), 17 deletions(-) diff --git a/halo2_proofs/src/poly/query.rs b/halo2_proofs/src/poly/query.rs index 233dc84f23..79f02934ff 100644 --- a/halo2_proofs/src/poly/query.rs +++ b/halo2_proofs/src/poly/query.rs @@ -20,11 +20,11 @@ pub trait Query: 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, + pub(crate) poly: &'com Polynomial, /// Blinding factor of polynomial - pub blind: Blind, + pub(crate) blind: Blind, } impl<'com, C> ProverQuery<'com, C> @@ -93,14 +93,14 @@ impl<'com, C: CurveAffine, M: MSM> VerifierQuery<'com, C, M> { } /// A polynomial query at a point -#[derive(Debug)] +#[derive(Debug, Clone)] pub struct VerifierQuery<'com, C: CurveAffine, M: MSM> { /// 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> @@ -122,16 +122,6 @@ where } } -impl<'com, C: CurveAffine, M: MSM> 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> {