pub fn open_folding<'a, SF>(
        &self,
        polynomials: FoldedPolynomialTree<'a, E::Fr, SF>,
        points: &[E::Fr],
        etas: &[E::Fr],
        max_msm_buffer: usize,
    ) -> (Vec<Vec<E::Fr>>, EvaluationProof<E>)
    where
        SG: Iterable,
        SF: Iterable,
        E: PairingEngine,
        SG::Item: Borrow<E::G1Affine>,
        SF::Item: Borrow<E::Fr> + Copy,
    {
        let n = polynomials.depth();
        let mut pippenger = HashMapPippenger::<E::G1Affine>::new(max_msm_buffer);
        let mut folded_bases = Vec::new();
        let zeros = vanishing_polynomial(points);
        let mut remainders = vec![VecDeque::new(); n];

        for i in 1..n + 1 {
            let mut bases = self.powers_of_g.iter();
            let delta = self.powers_of_g.len() - ceil_div(polynomials.len(), 1 << i);
            bases.advance_by(delta).expect(LENGTH_MISMATCH_MSG);

            (0..points.len()).for_each(|_| {
                remainders[i - 1].push_back(E::Fr::zero());
            });

            folded_bases.push(bases);
        }

        for (i, coefficient) in polynomials.iter() {
            if i == 0 {
                continue;
            } // XXX. skip the 0th elements automatically

            let base = folded_bases[i - 1].next().unwrap();
            let coefficient = coefficient.borrow();
            let quotient_coefficient = remainders[i - 1].pop_front().unwrap();
            remainders[i - 1].push_back(*coefficient);
            (0..points.len()).for_each(|j| {
                remainders[i - 1][j] -= zeros.coeffs[zeros.degree() - j - 1] * quotient_coefficient;
            });

            let scalar = etas[i - 1] * quotient_coefficient;
            pippenger.add(base, scalar);
        }

        let evaluation_proof = pippenger.finalize().into_affine();
        let remainders = remainders
            .iter_mut()
            .map(|x| x.make_contiguous().to_vec())
            .collect::<Vec<_>>();

        (remainders, EvaluationProof(evaluation_proof))
    }
/// The commitment procedures for our tensor check protocol.
/// The algorithm takes advantage of the tree structure of folding polynomials in our protocol. Please refer to our paper for more details.
/// The function evaluates all the folding polynomials at a set of evaluation points `points` and produces a single batched evaluation proof.
/// `eta` is the random challenge for batching folding polynomials.
The commitment procedures for our tensor check protocol.
The algorithm takes advantage of the tree structure of folding polynomials in our protocol. Please refer to our paper for more details.
The function evaluates all the folding polynomials at a set of evaluation points `points` and produces a single batched evaluation proof.
`eta` is the random challenge for batching folding polynomials.
The commitment procedures for our tensor check protocol . The algorithm takes advantage of the tree structure of folding polynomials in our protocol . Please refer to our paper for more details . The function evaluates all the folding polynomials at a set of evaluation points ` points ` and produces a single batched evaluation proof . ` eta ` is the random challenge for batching folding polynomials .
pub fn open_folding<'a, SF>(
        &self,
        polynomials: FoldedPolynomialTree<'a, E::Fr, SF>,
        points: &[E::Fr],
        etas: &[E::Fr],
        max_msm_buffer: usize,
    ) -> (Vec<Vec<E::Fr>>, EvaluationProof<E>)
    where
        SG: Iterable,
        SF: Iterable,
        E: PairingEngine,
        SG::Item: Borrow<E::G1Affine>,
        SF::Item: Borrow<E::Fr> + Copy,
    {
        let n = polynomials.depth();
        let mut pippenger = HashMapPippenger::<E::G1Affine>::new(max_msm_buffer);
        let mut folded_bases = Vec::new();
        let zeros = vanishing_polynomial(points);
        let mut remainders = vec![VecDeque::new(); n];
        for i in 1..n + 1 {
            let mut bases = self.powers_of_g.iter();
            let delta = self.powers_of_g.len() - ceil_div(polynomials.len(), 1 << i);
            bases.advance_by(delta).expect(LENGTH_MISMATCH_MSG);
            (0..points.len()).for_each(|_| {
                remainders[i - 1].push_back(E::Fr::zero());
            });
            folded_bases.push(bases);
        }
        for (i, coefficient) in polynomials.iter() {
            if i == 0 {
                continue;
            } // XXX. skip the 0th elements automatically
            let base = folded_bases[i - 1].next().unwrap();
            let coefficient = coefficient.borrow();
            let quotient_coefficient = remainders[i - 1].pop_front().unwrap();
            remainders[i - 1].push_back(*coefficient);
            (0..points.len()).for_each(|j| {
                remainders[i - 1][j] -= zeros.coeffs[zeros.degree() - j - 1] * quotient_coefficient;
            });
            let scalar = etas[i - 1] * quotient_coefficient;
            pippenger.add(base, scalar);
        }
        let evaluation_proof = pippenger.finalize().into_affine();
        let remainders = remainders
            .iter_mut()
            .map(|x| x.make_contiguous().to_vec())
            .collect::<Vec<_>>();
        (remainders, EvaluationProof(evaluation_proof))
    }
pub fn open_folding < ' a , SF > ( & self , polynomials : FoldedPolynomialTree < ' a , E :: Fr , SF > , points : & [ E :: Fr ] , etas : & [ E :: Fr ] , max_msm_buffer : usize , ) -> ( Vec < Vec < E :: Fr > > , EvaluationProof < E > ) where SG : Iterable , SF : Iterable , E : PairingEngine , SG :: Item : Borrow < E :: G1Affine > , SF :: Item : Borrow < E :: Fr > + Copy , { let n = polynomials . depth ( ) ; let mut pippenger = HashMapPippenger :: < E :: G1Affine > :: new ( max_msm_buffer ) ; let mut folded_bases = Vec :: new ( ) ; let zeros = vanishing_polynomial ( points ) ; let mut remainders = vec ! [ VecDeque new ( ) n ] ; for i in 1 .. n + 1 { let mut bases = self . powers_of_g . iter ( ) ; let delta = self . powers_of_g . len ( ) - ceil_div ( polynomials . len ( ) , 1 << i ) ; bases . advance_by ( delta ) . expect ( LENGTH_MISMATCH_MSG ) ; ( 0 .. points . len ( ) ) . for_each ( | _ | { remainders [ i - 1 ] . push_back ( E :: Fr :: zero ( ) ) ; } ) ; folded_bases . push ( bases ) ; } for ( i , coefficient ) in polynomials . iter ( ) { if i == 0 { continue ; } // XXX. skip the 0th elements automatically let base = folded_bases [ i - 1 ] . next ( ) . unwrap ( ) ; let coefficient = coefficient . borrow ( ) ; let quotient_coefficient = remainders [ i - 1 ] . pop_front ( ) . unwrap ( ) ; remainders [ i - 1 ] . push_back ( * coefficient ) ; ( 0 .. points . len ( ) ) . for_each ( | j | { remainders [ i - 1 ] [ j ] -= zeros . coeffs [ zeros . degree ( ) - j - 1 ] * quotient_coefficient ; } ) ; let scalar = etas [ i - 1 ] * quotient_coefficient ; pippenger . add ( base , scalar ) ; } let evaluation_proof = pippenger . finalize ( ) . into_affine ( ) ; let remainders = remainders . iter_mut ( ) . map ( | x | x . make_contiguous ( ) . to_vec ( ) ) . collect :: < Vec < _ > > ( ) ; ( remainders , EvaluationProof ( evaluation_proof ) ) }
The commitment procedures for our tensor check protocol.
The commitment procedures for our tensor check protocol .
&self
polynomials
FoldedPolynomialTree<'a, E::Fr, SF>
points
&[E::Fr]
etas
&[E::Fr]
max_msm_buffer
usize