pub fn open(
        ck: &CommitterKey<E>,
        polynomial: &impl MultilinearExtension<E::Fr>,
        point: &[E::Fr],
    ) -> Proof<E> {
        assert_eq!(polynomial.num_vars(), ck.nv, "Invalid size of polynomial");
        let nv = polynomial.num_vars();
        let mut r: Vec<Vec<E::Fr>> = (0..nv + 1).map(|_| Vec::new()).collect();
        let mut q: Vec<Vec<E::Fr>> = (0..nv + 1).map(|_| Vec::new()).collect();

        r[nv] = polynomial.to_evaluations();

        let mut proofs = Vec::new();
        for i in 0..nv {
            let k = nv - i;
            let point_at_k = point[i];
            q[k] = (0..(1 << (k - 1))).map(|_| E::Fr::zero()).collect();
            r[k - 1] = (0..(1 << (k - 1))).map(|_| E::Fr::zero()).collect();
            for b in 0..(1 << (k - 1)) {
                q[k][b] = r[k][(b << 1) + 1] - &r[k][b << 1];
                r[k - 1][b] = r[k][b << 1] * &(E::Fr::one() - &point_at_k)
                    + &(r[k][(b << 1) + 1] * &point_at_k);
            }
            let scalars: Vec<_> = (0..(1 << k))
                .map(|x| q[k][x >> 1].into_bigint()) // fine
                .collect();

            let pi_h = VariableBase::msm(&ck.powers_of_h[i], &scalars).into_affine(); // no need to move outside and partition
            proofs.push(pi_h);
        }

        Proof { proofs }
    }
/// 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 .
pub fn open(
        ck: &CommitterKey<E>,
        polynomial: &impl MultilinearExtension<E::Fr>,
        point: &[E::Fr],
    ) -> Proof<E> {
        assert_eq!(polynomial.num_vars(), ck.nv, "Invalid size of polynomial");
        let nv = polynomial.num_vars();
        let mut r: Vec<Vec<E::Fr>> = (0..nv + 1).map(|_| Vec::new()).collect();
        let mut q: Vec<Vec<E::Fr>> = (0..nv + 1).map(|_| Vec::new()).collect();
        r[nv] = polynomial.to_evaluations();
        let mut proofs = Vec::new();
        for i in 0..nv {
            let k = nv - i;
            let point_at_k = point[i];
            q[k] = (0..(1 << (k - 1))).map(|_| E::Fr::zero()).collect();
            r[k - 1] = (0..(1 << (k - 1))).map(|_| E::Fr::zero()).collect();
            for b in 0..(1 << (k - 1)) {
                q[k][b] = r[k][(b << 1) + 1] - &r[k][b << 1];
                r[k - 1][b] = r[k][b << 1] * &(E::Fr::one() - &point_at_k)
                    + &(r[k][(b << 1) + 1] * &point_at_k);
            }
            let scalars: Vec<_> = (0..(1 << k))
                .map(|x| q[k][x >> 1].into_bigint()) // fine
                .collect();
            let pi_h = VariableBase::msm(&ck.powers_of_h[i], &scalars).into_affine(); // no need to move outside and partition
            proofs.push(pi_h);
        }
        Proof { proofs }
    }
pub fn open ( ck : & CommitterKey < E > , polynomial : & impl MultilinearExtension < E :: Fr > , point : & [ E :: Fr ] , ) -> Proof < E > { assert_eq ! ( polynomial num_vars ( ) ck nv " " ) ; let nv = polynomial . num_vars ( ) ; let mut r : Vec < Vec < E :: Fr > > = ( 0 .. nv + 1 ) . map ( | _ | Vec :: new ( ) ) . collect ( ) ; let mut q : Vec < Vec < E :: Fr > > = ( 0 .. nv + 1 ) . map ( | _ | Vec :: new ( ) ) . collect ( ) ; r [ nv ] = polynomial . to_evaluations ( ) ; let mut proofs = Vec :: new ( ) ; for i in 0 .. nv { let k = nv - i ; let point_at_k = point [ i ] ; q [ k ] = ( 0 .. ( 1 << ( k - 1 ) ) ) . map ( | _ | E :: Fr :: zero ( ) ) . collect ( ) ; r [ k - 1 ] = ( 0 .. ( 1 << ( k - 1 ) ) ) . map ( | _ | E :: Fr :: zero ( ) ) . collect ( ) ; for b in 0 .. ( 1 << ( k - 1 ) ) { q [ k ] [ b ] = r [ k ] [ ( b << 1 ) + 1 ] - & r [ k ] [ b << 1 ] ; r [ k - 1 ] [ b ] = r [ k ] [ b << 1 ] * & ( E :: Fr :: one ( ) - & point_at_k ) + & ( r [ k ] [ ( b << 1 ) + 1 ] * & point_at_k ) ; } let scalars : Vec < _ > = ( 0 .. ( 1 << k ) ) . map ( | x | q [ k ] [ x >> 1 ] . into_bigint ( ) ) // fine . collect ( ) ; let pi_h = VariableBase :: msm ( & ck . powers_of_h [ i ] , & scalars ) . into_affine ( ) ; // no need to move outside and partition proofs . push ( pi_h ) ; } Proof { proofs } }
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
&CommitterKey<E>
polynomial
&impl MultilinearExtension<E::Fr>
point
&[E::Fr]