/// Generate Groth16 parameters and SAVER keys.
Generate Groth16 parameters and SAVER keys.
Generate Groth16 parameters and SAVER keys .
pub fn generate_groth16_and_saver_parameters<E: Engine, C: Circuit<E::Fr>, R: RngCore>(
    circuit: C,
    no_message_blocks: u64,
    mut rng: &mut R,
) -> Result<(Parameters<E>, SaverKeys<E>), SynthesisError>
where
    E::G1: WnafGroup,
    E::G2: WnafGroup,
{
    // Do the same as groth16::generate_random_parameters(circuit, &mut rng)
    let g1 = E::G1::random(&mut rng);
    let g2 = E::G2::random(&mut rng);
    let alpha = E::Fr::random(&mut rng);
    let beta = E::Fr::random(&mut rng);
    let gamma = E::Fr::random(&mut rng);
    let delta = E::Fr::random(&mut rng);
    let tau = E::Fr::random(&mut rng);
    let params = generate_parameters::<E, C>(circuit, g1, g2, alpha, beta, gamma, delta, tau)?;
    let saver_keys = keygen(
        &params,
        g1.to_affine(),
        g2.to_affine(),
        gamma,
        no_message_blocks,
        rng,
    );
    Ok((params, saver_keys))
}
pub fn generate_groth16_and_saver_parameters < E : Engine , C : Circuit < E :: Fr > , R : RngCore > ( circuit : C , no_message_blocks : u64 , mut rng : & mut R , ) -> Result < ( Parameters < E > , SaverKeys < E > ) , SynthesisError > where E :: G1 : WnafGroup , E :: G2 : WnafGroup , { // Do the same as groth16::generate_random_parameters(circuit, &mut rng) let g1 = E :: G1 :: random ( & mut rng ) ; let g2 = E :: G2 :: random ( & mut rng ) ; let alpha = E :: Fr :: random ( & mut rng ) ; let beta = E :: Fr :: random ( & mut rng ) ; let gamma = E :: Fr :: random ( & mut rng ) ; let delta = E :: Fr :: random ( & mut rng ) ; let tau = E :: Fr :: random ( & mut rng ) ; let params = generate_parameters :: < E , C > ( circuit , g1 , g2 , alpha , beta , gamma , delta , tau ) ? ; let saver_keys = keygen ( & params , g1 . to_affine ( ) , g2 . to_affine ( ) , gamma , no_message_blocks , rng , ) ; Ok ( ( params , saver_keys ) ) }
Generate Groth16 parameters and SAVER keys.
Generate Groth16 parameters and SAVER keys .
circuit
C
no_message_blocks
u64
rng
&mut R