/// Creates the Groth16 proof for the `circuit` and adapts it to work with SAVER. Also creates
/// encryption of `message` using the `saver_public_key`.
Creates the Groth16 proof for the `circuit` and adapts it to work with SAVER. Also creates
encryption of `message` using the `saver_public_key`.
Creates the Groth16 proof for the ` circuit ` and adapts it to work with SAVER . Also creates encryption of ` message ` using the ` saver_public_key ` .
pub fn create_groth16_proof_and_saver_encryption<E: Engine, C: Circuit<E::Fr>, R: RngCore>(
    circuit: C,
    message: Vec<E::Fr>,
    params: &Parameters<E>,
    saver_public_key: &SaverPublicKey<E>,
    mut rng: &mut R,
) -> Result<(Proof<E>, SaverCiphertext<E>), SynthesisError> {
    let r = E::Fr::random(&mut rng);
    create_random_proof(circuit, params, &mut rng).map(|mut proof| {
        proof.c = (proof.c.to_curve() + (saver_public_key.p2 * r).to_affine()).to_affine();
        (proof, encrypt(message, params, saver_public_key, r))
    })
}
pub fn create_groth16_proof_and_saver_encryption < E : Engine , C : Circuit < E :: Fr > , R : RngCore > ( circuit : C , message : Vec < E :: Fr > , params : & Parameters < E > , saver_public_key : & SaverPublicKey < E > , mut rng : & mut R , ) -> Result < ( Proof < E > , SaverCiphertext < E > ) , SynthesisError > { let r = E :: Fr :: random ( & mut rng ) ; create_random_proof ( circuit , params , & mut rng ) . map ( | mut proof | { proof . c = ( proof . c . to_curve ( ) + ( saver_public_key . p2 * r ) . to_affine ( ) ) . to_affine ( ) ; ( proof , encrypt ( message , params , saver_public_key , r ) ) } ) }
Creates the Groth16 proof for the `circuit` and adapts it to work with SAVER.
Creates the Groth16 proof for the ` circuit ` and adapts it to work with SAVER .
circuit
C
message
Vec<E::Fr>
params
&Parameters<E>
saver_public_key
&SaverPublicKey<E>
rng
&mut R