arnaucube
arnaucube/mat-vec-prod-expPublic Self-hosted repository
mat-vec-prod-exp/src/cyclefold_circuit.rs
src/cyclefold_circuit.rsRaw
 1
 2
 3    fn init(pp: &Self::ProverParam, F: FC, z_0: Vec<C1::ScalarField>) -> Result<Self, Error> {
 4        // prepare the circuit to obtain its R1CS
 5        let cs = ConstraintSystem::<C1::ScalarField>::new_ref();
 6        let cs2 = ConstraintSystem::<C1::BaseField>::new_ref();
 7
 8        let augmented_F_circuit =
 9            AugmentedFCircuit::<C1, C2, GC2, FC>::empty(&pp.poseidon_config, F);
10        let cf_circuit = CycleFoldCircuit::<C1, GC1>::empty();
11
12        augmented_F_circuit.generate_constraints(cs.clone())?;
13        cs.finalize();
14        let cs = cs.into_inner().ok_or(Error::NoInnerConstraintSystem)?;
15        let r1cs = extract_r1cs::<C1::ScalarField>(&cs);
16
17        cf_circuit.generate_constraints(cs2.clone())?;
18        cs2.finalize();
19        let cs2 = cs2.into_inner().ok_or(Error::NoInnerConstraintSystem)?;
20        let cf_r1cs = extract_r1cs::<C1::BaseField>(&cs2);
21    }
22