pub fn verify_multi_points(
        &self,
        commitments: &[Commitment<E>],
        eval_points: &[E::Fr],
        evaluations: &[Vec<E::Fr>],
        proof: &EvaluationProof<E>,
        open_chal: &E::Fr,
    ) -> VerificationResult {
        // Computing the vanishing polynomial over eval_points
        let zeros = vanishing_polynomial(eval_points);
        let zeros_repr = zeros.iter().map(|x| x.into_bigint()).collect::<Vec<_>>();
        let zeros = VariableBase::msm(&self.powers_of_g2, &zeros_repr);

        // Computing the inverse for the interpolation
        let mut sca_inverse = Vec::new();
        for (j, x_j) in eval_points.iter().enumerate() {
            let mut sca = E::Fr::one();
            for (k, x_k) in eval_points.iter().enumerate() {
                if j == k {
                    continue;
                }
                sca *= *x_j - x_k;
            }
            sca = sca.inverse().unwrap();
            sca_inverse.push(sca);
        }

        // Computing the lagrange polynomial for the interpolation
        let mut lang = Vec::new();
        for (j, _x_j) in eval_points.iter().enumerate() {
            let mut l_poly = DensePolynomial::from_coefficients_vec(vec![E::Fr::one()]);
            for (k, x_k) in eval_points.iter().enumerate() {
                if j == k {
                    continue;
                }
                let tmp_poly = DensePolynomial::from_coefficients_vec(vec![-(*x_k), E::Fr::one()]);
                l_poly = l_poly.mul(&tmp_poly);
            }
            lang.push(l_poly);
        }

        // Computing the commitment for the interpolated polynomials
        let etas = powers(*open_chal, evaluations.len());
        let interpolated_polynomials = evaluations
            .iter()
            .map(|e| interpolate_poly::<E>(eval_points, e, &sca_inverse, &lang).coeffs)
            .collect::<Vec<_>>();
        let i_poly = linear_combination(&interpolated_polynomials[..], &etas).unwrap();

        let i_comm = msm::<E>(&self.powers_of_g, &i_poly);

        // Gathering commitments
        let comm_vec = commitments.iter().map(|x| x.0).collect::<Vec<_>>();
        let etas_repr = etas.iter().map(|e| e.into_bigint()).collect::<Vec<_>>();
        let f_comm = VariableBase::msm(&comm_vec, &etas_repr);

        let g2 = self.powers_of_g2[0];

        if E::pairing(f_comm - i_comm.into_projective(), g2) == E::pairing(proof.0, zeros) {
            Ok(())
        } else {
            Err(VerificationError)
        }
    }
/// The verification procedure for the EvaluationProof with a set of polynomials evaluated at a set of evaluation points.
/// All the polynomials are evaluated at the set of points ``eval_points`` and are committed as ``commitments``.
/// ``evaluations`` contains evaluations of each polynomial at each point in ``eval_points``.
/// ``evaluations`` follows the same polynomial order as ``commitments`` and the same evaluation point order as ``eval_points``.
/// The evaluation proof can be obtained either in a space-efficient or a time-efficient flavour.
/// ``open_chal`` is a random challenge for batching evaluation proofs across different polynomials.
The verification procedure for the EvaluationProof with a set of polynomials evaluated at a set of evaluation points.
The verification procedure for the EvaluationProof with a set of polynomials evaluated at a set of evaluation points .
pub fn verify_multi_points(
        &self,
        commitments: &[Commitment<E>],
        eval_points: &[E::Fr],
        evaluations: &[Vec<E::Fr>],
        proof: &EvaluationProof<E>,
        open_chal: &E::Fr,
    ) -> VerificationResult {
        // Computing the vanishing polynomial over eval_points
        let zeros = vanishing_polynomial(eval_points);
        let zeros_repr = zeros.iter().map(|x| x.into_bigint()).collect::<Vec<_>>();
        let zeros = VariableBase::msm(&self.powers_of_g2, &zeros_repr);
        // Computing the inverse for the interpolation
        let mut sca_inverse = Vec::new();
        for (j, x_j) in eval_points.iter().enumerate() {
            let mut sca = E::Fr::one();
            for (k, x_k) in eval_points.iter().enumerate() {
                if j == k {
                    continue;
                }
                sca *= *x_j - x_k;
            }
            sca = sca.inverse().unwrap();
            sca_inverse.push(sca);
        }
        // Computing the lagrange polynomial for the interpolation
        let mut lang = Vec::new();
        for (j, _x_j) in eval_points.iter().enumerate() {
            let mut l_poly = DensePolynomial::from_coefficients_vec(vec![E::Fr::one()]);
            for (k, x_k) in eval_points.iter().enumerate() {
                if j == k {
                    continue;
                }
                let tmp_poly = DensePolynomial::from_coefficients_vec(vec![-(*x_k), E::Fr::one()]);
                l_poly = l_poly.mul(&tmp_poly);
            }
            lang.push(l_poly);
        }
        // Computing the commitment for the interpolated polynomials
        let etas = powers(*open_chal, evaluations.len());
        let interpolated_polynomials = evaluations
            .iter()
            .map(|e| interpolate_poly::<E>(eval_points, e, &sca_inverse, &lang).coeffs)
            .collect::<Vec<_>>();
        let i_poly = linear_combination(&interpolated_polynomials[..], &etas).unwrap();
        let i_comm = msm::<E>(&self.powers_of_g, &i_poly);
        // Gathering commitments
        let comm_vec = commitments.iter().map(|x| x.0).collect::<Vec<_>>();
        let etas_repr = etas.iter().map(|e| e.into_bigint()).collect::<Vec<_>>();
        let f_comm = VariableBase::msm(&comm_vec, &etas_repr);
        let g2 = self.powers_of_g2[0];
        if E::pairing(f_comm - i_comm.into_projective(), g2) == E::pairing(proof.0, zeros) {
            Ok(())
        } else {
            Err(VerificationError)
        }
    }
pub fn verify_multi_points ( & self , commitments : & [ Commitment < E > ] , eval_points : & [ E :: Fr ] , evaluations : & [ Vec < E :: Fr > ] , proof : & EvaluationProof < E > , open_chal : & E :: Fr , ) -> VerificationResult { // Computing the vanishing polynomial over eval_points let zeros = vanishing_polynomial ( eval_points ) ; let zeros_repr = zeros . iter ( ) . map ( | x | x . into_bigint ( ) ) . collect :: < Vec < _ > > ( ) ; let zeros = VariableBase :: msm ( & self . powers_of_g2 , & zeros_repr ) ; // Computing the inverse for the interpolation let mut sca_inverse = Vec :: new ( ) ; for ( j , x_j ) in eval_points . iter ( ) . enumerate ( ) { let mut sca = E :: Fr :: one ( ) ; for ( k , x_k ) in eval_points . iter ( ) . enumerate ( ) { if j == k { continue ; } sca *= * x_j - x_k ; } sca = sca . inverse ( ) . unwrap ( ) ; sca_inverse . push ( sca ) ; } // Computing the lagrange polynomial for the interpolation let mut lang = Vec :: new ( ) ; for ( j , _x_j ) in eval_points . iter ( ) . enumerate ( ) { let mut l_poly = DensePolynomial :: from_coefficients_vec ( vec ! [ E Fr one ( ) ] ) ; for ( k , x_k ) in eval_points . iter ( ) . enumerate ( ) { if j == k { continue ; } let tmp_poly = DensePolynomial :: from_coefficients_vec ( vec ! [ ( x_k ) E Fr one ( ) ] ) ; l_poly = l_poly . mul ( & tmp_poly ) ; } lang . push ( l_poly ) ; } // Computing the commitment for the interpolated polynomials let etas = powers ( * open_chal , evaluations . len ( ) ) ; let interpolated_polynomials = evaluations . iter ( ) . map ( | e | interpolate_poly :: < E > ( eval_points , e , & sca_inverse , & lang ) . coeffs ) . collect :: < Vec < _ > > ( ) ; let i_poly = linear_combination ( & interpolated_polynomials [ .. ] , & etas ) . unwrap ( ) ; let i_comm = msm :: < E > ( & self . powers_of_g , & i_poly ) ; // Gathering commitments let comm_vec = commitments . iter ( ) . map ( | x | x . 0 ) . collect :: < Vec < _ > > ( ) ; let etas_repr = etas . iter ( ) . map ( | e | e . into_bigint ( ) ) . collect :: < Vec < _ > > ( ) ; let f_comm = VariableBase :: msm ( & comm_vec , & etas_repr ) ; let g2 = self . powers_of_g2 [ 0 ] ; if E :: pairing ( f_comm - i_comm . into_projective ( ) , g2 ) == E :: pairing ( proof . 0 , zeros ) { Ok ( ( ) ) } else { Err ( VerificationError ) } }
The verification procedure for the EvaluationProof with a set of polynomials evaluated at a set of evaluation points.
The verification procedure for the EvaluationProof with a set of polynomials evaluated at a set of evaluation points .
&self
commitments
&[Commitment<E>]
eval_points
&[E::Fr]
evaluations
&[Vec<E::Fr>]
proof
&EvaluationProof<E>
open_chal
&E::Fr