diff --git a/halo2_proofs/src/poly/query.rs b/halo2_proofs/src/poly/query.rs index 5034652de2..233dc84f23 100644 --- a/halo2_proofs/src/poly/query.rs +++ b/halo2_proofs/src/poly/query.rs @@ -27,6 +27,20 @@ pub struct ProverQuery<'com, C: CurveAffine> { pub blind: Blind, } +impl<'com, C> ProverQuery<'com, C> +where + C: CurveAffine, +{ + /// Create a new prover query based on a polynomial + pub fn new( + point: C::Scalar, + poly: &'com Polynomial, + blind: Blind, + ) -> Self { + ProverQuery { point, poly, blind } + } +} + #[doc(hidden)] #[derive(Copy, Clone)] pub struct PolynomialPointer<'com, C: CurveAffine> { @@ -89,6 +103,25 @@ pub struct VerifierQuery<'com, C: CurveAffine, M: MSM> { pub eval: C::Scalar, } +impl<'com, C, M> VerifierQuery<'com, C, M> +where + C: CurveAffine, + M: MSM, +{ + /// Create a new verifier query based on a commitment + pub fn new( + point: C::Scalar, + commitment: CommitmentReference<'com, C, M>, + eval: C::Scalar, + ) -> Self { + VerifierQuery { + point, + commitment, + eval, + } + } +} + impl<'com, C: CurveAffine, M: MSM> Clone for VerifierQuery<'com, C, M> { fn clone(&self) -> Self { Self {