fn open<'a>(
        ck: &Self::CommitterKey,
        labeled_polynomials: impl IntoIterator<Item = &'a LabeledPolynomial<E::Fr, P>>,
        _commitments: impl IntoIterator<Item = &'a LabeledCommitment<Self::Commitment>>,
        point: &P::Point,
        opening_challenges: &mut ChallengeGenerator<E::Fr, S>,
        rands: impl IntoIterator<Item = &'a Self::Randomness>,
        _rng: Option<&mut dyn RngCore>,
    ) -> Result<Self::Proof, Self::Error>
    where
        P: 'a,
        Self::Randomness: 'a,
        Self::Commitment: 'a,
    {
        // Compute random linear combinations of committed polynomials and randomness
        let mut p = P::zero();
        let mut r = Randomness::empty();
        for (polynomial, rand) in labeled_polynomials.into_iter().zip(rands) {
            Self::check_degrees_and_bounds(ck.supported_degree, &polynomial)?;

            // compute challenge^j and challenge^{j+1}.
            let challenge_j = opening_challenges.try_next_challenge_of_size(CHALLENGE_SIZE);

            p += (challenge_j, polynomial.polynomial());
            r += (challenge_j, rand);
        }

        let open_time = start_timer!(|| format!("Opening polynomial of degree {}", p.degree()));
        let witness_time = start_timer!(|| "Computing witness polynomials");
        let witnesses = Self::divide_at_point(&p, point);
        let hiding_witnesses = if r.is_hiding() {
            Some(Self::divide_at_point(&r.blinding_polynomial, point))
        } else {
            None
        };
        end_timer!(witness_time);

        let witness_comm_time = start_timer!(|| "Computing commitment to witness polynomials");
        let mut w = witnesses
            .iter()
            .map(|w| {
                // Get the powers of `G` corresponding to the witness poly
                let powers_of_g = ark_std::cfg_iter!(w.terms())
                    .map(|(_, term)| *ck.powers_of_g.get(term).unwrap())
                    .collect::<Vec<_>>();
                // Convert coefficients to BigInt
                let witness_ints = Self::convert_to_bigints(&w);
                // Compute MSM
                VariableBase::msm(&powers_of_g, &witness_ints)
            })
            .collect::<Vec<_>>();
        end_timer!(witness_comm_time);

        // If the evaluation should be hiding, compute the MSM for `hiding_witnesses` and add
        // to the `w`. Additionally, compute the evaluation of `r` at `point`.
        let random_v = if let Some(hiding_witnesses) = hiding_witnesses {
            let witness_comm_time =
                start_timer!(|| "Computing commitment to hiding witness polynomials");
            ark_std::cfg_iter_mut!(w)
                .enumerate()
                .for_each(|(i, witness)| {
                    let hiding_witness = &hiding_witnesses[i];
                    // Get the powers of `\gamma G` corresponding to the terms of `hiding_witness`
                    let powers_of_gamma_g = hiding_witness
                        .terms()
                        .iter()
                        .map(|(_, term)| {
                            // Implicit Assumption: Each monomial in `hiding_witness` is univariate
                            let vars = term.vars();
                            match term.is_constant() {
                                true => ck.gamma_g,
                                false => ck.powers_of_gamma_g[vars[0]][term.degree() - 1],
                            }
                        })
                        .collect::<Vec<_>>();
                    // Convert coefficients to BigInt
                    let hiding_witness_ints = Self::convert_to_bigints(hiding_witness);
                    // Compute MSM and add result to witness
                    *witness += &VariableBase::msm(&powers_of_gamma_g, &hiding_witness_ints);
                });
            end_timer!(witness_comm_time);
            Some(r.blinding_polynomial.evaluate(point))
        } else {
            None
        };
        end_timer!(open_time);
        Ok(Proof {
            w: w.into_iter().map(|w| w.into_affine()).collect(),
            random_v,
        })
    }
/// On input a polynomial `p` and a point `point`, outputs a proof for the same.
On input a polynomial `p` and a point `point`, outputs a proof for the same.
On input a polynomial ` p ` and a point ` point ` outputs a proof for the same .
fn open<'a>(
        ck: &Self::CommitterKey,
        labeled_polynomials: impl IntoIterator<Item = &'a LabeledPolynomial<E::Fr, P>>,
        _commitments: impl IntoIterator<Item = &'a LabeledCommitment<Self::Commitment>>,
        point: &P::Point,
        opening_challenges: &mut ChallengeGenerator<E::Fr, S>,
        rands: impl IntoIterator<Item = &'a Self::Randomness>,
        _rng: Option<&mut dyn RngCore>,
    ) -> Result<Self::Proof, Self::Error>
    where
        P: 'a,
        Self::Randomness: 'a,
        Self::Commitment: 'a,
    {
        // Compute random linear combinations of committed polynomials and randomness
        let mut p = P::zero();
        let mut r = Randomness::empty();
        for (polynomial, rand) in labeled_polynomials.into_iter().zip(rands) {
            Self::check_degrees_and_bounds(ck.supported_degree, &polynomial)?;
            // compute challenge^j and challenge^{j+1}.
            let challenge_j = opening_challenges.try_next_challenge_of_size(CHALLENGE_SIZE);
            p += (challenge_j, polynomial.polynomial());
            r += (challenge_j, rand);
        }
        let open_time = start_timer!(|| format!("Opening polynomial of degree {}", p.degree()));
        let witness_time = start_timer!(|| "Computing witness polynomials");
        let witnesses = Self::divide_at_point(&p, point);
        let hiding_witnesses = if r.is_hiding() {
            Some(Self::divide_at_point(&r.blinding_polynomial, point))
        } else {
            None
        };
        end_timer!(witness_time);
        let witness_comm_time = start_timer!(|| "Computing commitment to witness polynomials");
        let mut w = witnesses
            .iter()
            .map(|w| {
                // Get the powers of `G` corresponding to the witness poly
                let powers_of_g = ark_std::cfg_iter!(w.terms())
                    .map(|(_, term)| *ck.powers_of_g.get(term).unwrap())
                    .collect::<Vec<_>>();
                // Convert coefficients to BigInt
                let witness_ints = Self::convert_to_bigints(&w);
                // Compute MSM
                VariableBase::msm(&powers_of_g, &witness_ints)
            })
            .collect::<Vec<_>>();
        end_timer!(witness_comm_time);
        // If the evaluation should be hiding, compute the MSM for `hiding_witnesses` and add
        // to the `w`. Additionally, compute the evaluation of `r` at `point`.
        let random_v = if let Some(hiding_witnesses) = hiding_witnesses {
            let witness_comm_time =
                start_timer!(|| "Computing commitment to hiding witness polynomials");
            ark_std::cfg_iter_mut!(w)
                .enumerate()
                .for_each(|(i, witness)| {
                    let hiding_witness = &hiding_witnesses[i];
                    // Get the powers of `\gamma G` corresponding to the terms of `hiding_witness`
                    let powers_of_gamma_g = hiding_witness
                        .terms()
                        .iter()
                        .map(|(_, term)| {
                            // Implicit Assumption: Each monomial in `hiding_witness` is univariate
                            let vars = term.vars();
                            match term.is_constant() {
                                true => ck.gamma_g,
                                false => ck.powers_of_gamma_g[vars[0]][term.degree() - 1],
                            }
                        })
                        .collect::<Vec<_>>();
                    // Convert coefficients to BigInt
                    let hiding_witness_ints = Self::convert_to_bigints(hiding_witness);
                    // Compute MSM and add result to witness
                    *witness += &VariableBase::msm(&powers_of_gamma_g, &hiding_witness_ints);
                });
            end_timer!(witness_comm_time);
            Some(r.blinding_polynomial.evaluate(point))
        } else {
            None
        };
        end_timer!(open_time);
        Ok(Proof {
            w: w.into_iter().map(|w| w.into_affine()).collect(),
            random_v,
        })
    }
fn open < ' a > ( ck : & Self :: CommitterKey , labeled_polynomials : impl IntoIterator < Item = & ' a LabeledPolynomial < E :: Fr , P > > , _commitments : impl IntoIterator < Item = & ' a LabeledCommitment < Self :: Commitment > > , point : & P :: Point , opening_challenges : & mut ChallengeGenerator < E :: Fr , S > , rands : impl IntoIterator < Item = & ' a Self :: Randomness > , _rng : Option < & mut dyn RngCore > , ) -> Result < Self :: Proof , Self :: Error > where P : ' a , Self :: Randomness : ' a , Self :: Commitment : ' a , { // Compute random linear combinations of committed polynomials and randomness let mut p = P :: zero ( ) ; let mut r = Randomness :: empty ( ) ; for ( polynomial , rand ) in labeled_polynomials . into_iter ( ) . zip ( rands ) { Self :: check_degrees_and_bounds ( ck . supported_degree , & polynomial ) ? ; // compute challenge^j and challenge^{j+1}. let challenge_j = opening_challenges . try_next_challenge_of_size ( CHALLENGE_SIZE ) ; p += ( challenge_j , polynomial . polynomial ( ) ) ; r += ( challenge_j , rand ) ; } let open_time = start_timer ! ( format ( " " p degree ( ) ) ) ; let witness_time = start_timer ! ( " " ) ; let witnesses = Self :: divide_at_point ( & p , point ) ; let hiding_witnesses = if r . is_hiding ( ) { Some ( Self :: divide_at_point ( & r . blinding_polynomial , point ) ) } else { None } ; end_timer ! ( witness_time ) ; let witness_comm_time = start_timer ! ( " " ) ; let mut w = witnesses . iter ( ) . map ( | w | { // Get the powers of `G` corresponding to the witness poly let powers_of_g = ark_std :: cfg_iter ! ( w terms ( ) ) . map ( | ( _ , term ) | * ck . powers_of_g . get ( term ) . unwrap ( ) ) . collect :: < Vec < _ > > ( ) ; // Convert coefficients to BigInt let witness_ints = Self :: convert_to_bigints ( & w ) ; // Compute MSM VariableBase :: msm ( & powers_of_g , & witness_ints ) } ) . collect :: < Vec < _ > > ( ) ; end_timer ! ( witness_comm_time ) ; // If the evaluation should be hiding, compute the MSM for `hiding_witnesses` and add // to the `w`. Additionally, compute the evaluation of `r` at `point`. let random_v = if let Some ( hiding_witnesses ) = hiding_witnesses { let witness_comm_time = start_timer ! ( " " ) ; ark_std :: cfg_iter_mut ! ( w ) . enumerate ( ) . for_each ( | ( i , witness ) | { let hiding_witness = & hiding_witnesses [ i ] ; // Get the powers of `\gamma G` corresponding to the terms of `hiding_witness` let powers_of_gamma_g = hiding_witness . terms ( ) . iter ( ) . map ( | ( _ , term ) | { // Implicit Assumption: Each monomial in `hiding_witness` is univariate let vars = term . vars ( ) ; match term . is_constant ( ) { true => ck . gamma_g , false => ck . powers_of_gamma_g [ vars [ 0 ] ] [ term . degree ( ) - 1 ] , } } ) . collect :: < Vec < _ > > ( ) ; // Convert coefficients to BigInt let hiding_witness_ints = Self :: convert_to_bigints ( hiding_witness ) ; // Compute MSM and add result to witness * witness += & VariableBase :: msm ( & powers_of_gamma_g , & hiding_witness_ints ) ; } ) ; end_timer ! ( witness_comm_time ) ; Some ( r . blinding_polynomial . evaluate ( point ) ) } else { None } ; end_timer ! ( open_time ) ; Ok ( Proof { w : w . into_iter ( ) . map ( | w | w . into_affine ( ) ) . collect ( ) , random_v , } ) }
On input a polynomial `p` and a point `point`, outputs a proof for the same.
On input a polynomial ` p ` and a point ` point ` outputs a proof for the same .
ck
&Self::CommitterKey
labeled_polynomials
impl IntoIterator<Item = &'a LabeledPolynomial<E::Fr, P>>
_commitments
impl IntoIterator<Item = &'a LabeledCommitment<Self::Commitment>>
point
&P::Point
opening_challenges
&mut ChallengeGenerator<E::Fr, S>
rands
impl IntoIterator<Item = &'a Self::Randomness>
_rng
Option<&mut dyn RngCore>