pub fn commit_folding<SF>(
        &self,
        polynomials: &FoldedPolynomialTree<E::Fr, SF>,
        max_msm_buffer: usize,
    ) -> Vec<Commitment<E>>
    where
        SF: Iterable,
        SF::Item: Borrow<E::Fr>,
    {
        let n = polynomials.depth();
        let mut pippengers: Vec<ChunkedPippenger<E::G1Affine>> = Vec::new();
        let mut folded_bases = Vec::new();
        for i in 1..n + 1 {
            let pippenger = ChunkedPippenger::with_size(max_msm_buffer / n);
            let bases_init = self.powers_of_g.iter();

            let delta = self.powers_of_g.len() - ceil_div(polynomials.len(), 1 << i);
            // TODO: change `skip` to `advance_by` once rust-lang/rust#7774 is fixed.
            // See <https://github.com/rust-lang/rust/issues/77404>
            let bases = bases_init.skip(delta);
            folded_bases.push(bases);
            pippengers.push(pippenger);
        }

        for (i, coefficient) in polynomials.iter() {
            let base = folded_bases[i - 1].next().unwrap();
            pippengers[i - 1].add(base.borrow(), coefficient.into_bigint());
        }

        pippengers
            .into_iter()
            .map(|p| Commitment(p.finalize().into_affine()))
            .collect::<Vec<_>>()
    }
/// 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 takes as input a committer key and the tree structure of all the folding polynomials, and produces the desired commitment for each polynomial.
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 takes as input a committer key and the tree structure of all the folding polynomials, and produces the desired commitment for each polynomial.
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 takes as input a committer key and the tree structure of all the folding polynomials and produces the desired commitment for each polynomial .
pub fn commit_folding<SF>(
        &self,
        polynomials: &FoldedPolynomialTree<E::Fr, SF>,
        max_msm_buffer: usize,
    ) -> Vec<Commitment<E>>
    where
        SF: Iterable,
        SF::Item: Borrow<E::Fr>,
    {
        let n = polynomials.depth();
        let mut pippengers: Vec<ChunkedPippenger<E::G1Affine>> = Vec::new();
        let mut folded_bases = Vec::new();
        for i in 1..n + 1 {
            let pippenger = ChunkedPippenger::with_size(max_msm_buffer / n);
            let bases_init = self.powers_of_g.iter();
            let delta = self.powers_of_g.len() - ceil_div(polynomials.len(), 1 << i);
            // TODO: change `skip` to `advance_by` once rust-lang/rust#7774 is fixed.
            // See <https://github.com/rust-lang/rust/issues/77404>
            let bases = bases_init.skip(delta);
            folded_bases.push(bases);
            pippengers.push(pippenger);
        }
        for (i, coefficient) in polynomials.iter() {
            let base = folded_bases[i - 1].next().unwrap();
            pippengers[i - 1].add(base.borrow(), coefficient.into_bigint());
        }
        pippengers
            .into_iter()
            .map(|p| Commitment(p.finalize().into_affine()))
            .collect::<Vec<_>>()
    }
pub fn commit_folding < SF > ( & self , polynomials : & FoldedPolynomialTree < E :: Fr , SF > , max_msm_buffer : usize , ) -> Vec < Commitment < E > > where SF : Iterable , SF :: Item : Borrow < E :: Fr > , { let n = polynomials . depth ( ) ; let mut pippengers : Vec < ChunkedPippenger < E :: G1Affine > > = Vec :: new ( ) ; let mut folded_bases = Vec :: new ( ) ; for i in 1 .. n + 1 { let pippenger = ChunkedPippenger :: with_size ( max_msm_buffer / n ) ; let bases_init = self . powers_of_g . iter ( ) ; let delta = self . powers_of_g . len ( ) - ceil_div ( polynomials . len ( ) , 1 << i ) ; // TODO: change `skip` to `advance_by` once rust-lang/rust#7774 is fixed. // See <https://github.com/rust-lang/rust/issues/77404> let bases = bases_init . skip ( delta ) ; folded_bases . push ( bases ) ; pippengers . push ( pippenger ) ; } for ( i , coefficient ) in polynomials . iter ( ) { let base = folded_bases [ i - 1 ] . next ( ) . unwrap ( ) ; pippengers [ i - 1 ] . add ( base . borrow ( ) , coefficient . into_bigint ( ) ) ; } pippengers . into_iter ( ) . map ( | p | Commitment ( p . finalize ( ) . into_affine ( ) ) ) . collect :: < Vec < _ > > ( ) }
The commitment procedures for our tensor check protocol.
The commitment procedures for our tensor check protocol .
&self
polynomials
&FoldedPolynomialTree<E::Fr, SF>
max_msm_buffer
usize