pub fn new(max_degree: usize, max_eval_points: usize, rng: &mut impl RngCore) -> Self {
        // Compute the consecutive powers of an element.
        let tau = E::Fr::rand(rng);
        let powers_of_tau = powers(tau, max_degree + 1);

        let g = E::G1Projective::rand(rng);
        let window_size = FixedBase::get_mul_window_size(max_degree + 1);
        let scalar_bits = E::Fr::MODULUS_BIT_SIZE as usize;
        let g_table = FixedBase::get_window_table(scalar_bits, window_size, g);
        let powers_of_g_proj = FixedBase::msm(scalar_bits, window_size, &g_table, &powers_of_tau);
        let powers_of_g = E::G1Projective::batch_normalization_into_affine(&powers_of_g_proj);

        let g2 = E::G2Projective::rand(rng).into_affine();
        let powers_of_g2 = powers_of_tau
            .iter()
            .take(max_eval_points + 1)
            .map(|t| g2.mul(t.into_bigint()).into_affine())
            .collect::<Vec<_>>();

        CommitterKey {
            powers_of_g,
            powers_of_g2,
        }
    }
/// The setup algorithm for the commitment scheme.
///
/// Given a degree bound `max_degree`,
/// an evaluation point bound `max_eval_points`,
/// and a cryptographically-secure random number generator `rng`,
/// construct the committer key.
The setup algorithm for the commitment scheme.
The setup algorithm for the commitment scheme .
pub fn new(max_degree: usize, max_eval_points: usize, rng: &mut impl RngCore) -> Self {
        // Compute the consecutive powers of an element.
        let tau = E::Fr::rand(rng);
        let powers_of_tau = powers(tau, max_degree + 1);
        let g = E::G1Projective::rand(rng);
        let window_size = FixedBase::get_mul_window_size(max_degree + 1);
        let scalar_bits = E::Fr::MODULUS_BIT_SIZE as usize;
        let g_table = FixedBase::get_window_table(scalar_bits, window_size, g);
        let powers_of_g_proj = FixedBase::msm(scalar_bits, window_size, &g_table, &powers_of_tau);
        let powers_of_g = E::G1Projective::batch_normalization_into_affine(&powers_of_g_proj);
        let g2 = E::G2Projective::rand(rng).into_affine();
        let powers_of_g2 = powers_of_tau
            .iter()
            .take(max_eval_points + 1)
            .map(|t| g2.mul(t.into_bigint()).into_affine())
            .collect::<Vec<_>>();
        CommitterKey {
            powers_of_g,
            powers_of_g2,
        }
    }
pub fn new ( max_degree : usize , max_eval_points : usize , rng : & mut impl RngCore ) -> Self { // Compute the consecutive powers of an element. let tau = E :: Fr :: rand ( rng ) ; let powers_of_tau = powers ( tau , max_degree + 1 ) ; let g = E :: G1Projective :: rand ( rng ) ; let window_size = FixedBase :: get_mul_window_size ( max_degree + 1 ) ; let scalar_bits = E :: Fr :: MODULUS_BIT_SIZE as usize ; let g_table = FixedBase :: get_window_table ( scalar_bits , window_size , g ) ; let powers_of_g_proj = FixedBase :: msm ( scalar_bits , window_size , & g_table , & powers_of_tau ) ; let powers_of_g = E :: G1Projective :: batch_normalization_into_affine ( & powers_of_g_proj ) ; let g2 = E :: G2Projective :: rand ( rng ) . into_affine ( ) ; let powers_of_g2 = powers_of_tau . iter ( ) . take ( max_eval_points + 1 ) . map ( | t | g2 . mul ( t . into_bigint ( ) ) . into_affine ( ) ) . collect :: < Vec < _ > > ( ) ; CommitterKey { powers_of_g , powers_of_g2 , } }
The setup algorithm for the commitment scheme.
The setup algorithm for the commitment scheme .
max_degree
usize
max_eval_points
usize
rng
&mut impl RngCore