fn trim(
        pp: &Self::UniversalParams,
        supported_degree: usize,
        _supported_hiding_bound: usize,
        _enforced_degree_bounds: Option<&[usize]>,
    ) -> Result<(Self::CommitterKey, Self::VerifierKey), Self::Error> {
        let max_degree = pp.max_degree();
        if supported_degree > max_degree {
            return Err(Error::TrimmingDegreeTooLarge);
        }

        let ck_time = start_timer!(|| format!(
            "Constructing CommitterKey of size {} for unshifted polys",
            supported_degree
        ));
        // We want to support making up to supported_degree queries to committed
        // polynomials.
        let powers_of_g = pp
            .powers_of_g
            .iter()
            .filter(|(k, _)| k.degree() <= supported_degree)
            .map(|(k, v)| (k.clone(), v.clone()))
            .collect();
        let powers_of_gamma_g = pp
            .powers_of_gamma_g
            .iter()
            .map(|e| e[..=supported_degree].to_vec())
            .collect();
        end_timer!(ck_time);

        let ck = CommitterKey {
            powers_of_g,
            gamma_g: pp.gamma_g,
            powers_of_gamma_g,
            num_vars: pp.num_vars,
            supported_degree,
            max_degree,
        };

        let vk = VerifierKey {
            g: pp.powers_of_g[&P::Term::new(vec![])],
            gamma_g: pp.gamma_g,
            h: pp.h,
            beta_h: pp.beta_h.clone(),
            prepared_h: pp.prepared_h.clone(),
            prepared_beta_h: pp.prepared_beta_h.clone(),
            num_vars: pp.num_vars,
            supported_degree,
            max_degree,
        };
        Ok((ck, vk))
    }
/// Specializes the public parameters for polynomials up to the given `supported_degree`
///
/// TODO: Add the ability to trim the number of variables
/// TODO: Update for support_hiding_bound
Specializes the public parameters for polynomials up to the given `supported_degree`
TODO: Add the ability to trim the number of variables
TODO: Update for support_hiding_bound
Specializes the public parameters for polynomials up to the given ` supported_degree ` TODO : Add the ability to trim the number of variables TODO : Update for support_hiding_bound
fn trim(
        pp: &Self::UniversalParams,
        supported_degree: usize,
        _supported_hiding_bound: usize,
        _enforced_degree_bounds: Option<&[usize]>,
    ) -> Result<(Self::CommitterKey, Self::VerifierKey), Self::Error> {
        let max_degree = pp.max_degree();
        if supported_degree > max_degree {
            return Err(Error::TrimmingDegreeTooLarge);
        }
        let ck_time = start_timer!(|| format!(
            "Constructing CommitterKey of size {} for unshifted polys",
            supported_degree
        ));
        // We want to support making up to supported_degree queries to committed
        // polynomials.
        let powers_of_g = pp
            .powers_of_g
            .iter()
            .filter(|(k, _)| k.degree() <= supported_degree)
            .map(|(k, v)| (k.clone(), v.clone()))
            .collect();
        let powers_of_gamma_g = pp
            .powers_of_gamma_g
            .iter()
            .map(|e| e[..=supported_degree].to_vec())
            .collect();
        end_timer!(ck_time);
        let ck = CommitterKey {
            powers_of_g,
            gamma_g: pp.gamma_g,
            powers_of_gamma_g,
            num_vars: pp.num_vars,
            supported_degree,
            max_degree,
        };
        let vk = VerifierKey {
            g: pp.powers_of_g[&P::Term::new(vec![])],
            gamma_g: pp.gamma_g,
            h: pp.h,
            beta_h: pp.beta_h.clone(),
            prepared_h: pp.prepared_h.clone(),
            prepared_beta_h: pp.prepared_beta_h.clone(),
            num_vars: pp.num_vars,
            supported_degree,
            max_degree,
        };
        Ok((ck, vk))
    }
fn trim ( pp : & Self :: UniversalParams , supported_degree : usize , _supported_hiding_bound : usize , _enforced_degree_bounds : Option < & [ usize ] > , ) -> Result < ( Self :: CommitterKey , Self :: VerifierKey ) , Self :: Error > { let max_degree = pp . max_degree ( ) ; if supported_degree > max_degree { return Err ( Error :: TrimmingDegreeTooLarge ) ; } let ck_time = start_timer ! ( format ( " " supported_degree ) ) ; // We want to support making up to supported_degree queries to committed // polynomials. let powers_of_g = pp . powers_of_g . iter ( ) . filter ( | ( k , _ ) | k . degree ( ) <= supported_degree ) . map ( | ( k , v ) | ( k . clone ( ) , v . clone ( ) ) ) . collect ( ) ; let powers_of_gamma_g = pp . powers_of_gamma_g . iter ( ) . map ( | e | e [ .. = supported_degree ] . to_vec ( ) ) . collect ( ) ; end_timer ! ( ck_time ) ; let ck = CommitterKey { powers_of_g , gamma_g : pp . gamma_g , powers_of_gamma_g , num_vars : pp . num_vars , supported_degree , max_degree , } ; let vk = VerifierKey { g : pp . powers_of_g [ & P :: Term :: new ( vec ! [ ] ) ] , gamma_g : pp . gamma_g , h : pp . h , beta_h : pp . beta_h . clone ( ) , prepared_h : pp . prepared_h . clone ( ) , prepared_beta_h : pp . prepared_beta_h . clone ( ) , num_vars : pp . num_vars , supported_degree , max_degree , } ; Ok ( ( ck , vk ) ) }
Specializes the public parameters for polynomials up to the given `supported_degree`
TODO: Add the ability to trim the number of variables
TODO: Update for support_hiding_bound
Specializes the public parameters for polynomials up to the given ` supported_degree ` TODO : Add the ability to trim the number of variables TODO : Update for support_hiding_bound
pp
&Self::UniversalParams
supported_degree
usize
_supported_hiding_bound
usize
_enforced_degree_bounds
Option<&[usize]>