arnaucube
arnaucube/nova-studyPublic Self-hosted repository
nova-study/src/r1cs.rs
src/r1cs.rsRaw
 1use crate::pedersen;
 2
 3use ark_ff::fields::PrimeField;
 4use core::ops::Add;
 5
 6// this file contains an abstraction of R1CS struct, to later be plugged from arkworks
 7// ConstraintSystem or something similar.
 8
 9pub struct R1CS<F: PrimeField> {
10    pub A: Vec<Vec<F>>,
11    pub B: Vec<Vec<F>>,
12    pub C: Vec<Vec<F>>,
13}
14
15pub struct RelaxedR1CS<F: PrimeField> {
16    pub ABC: R1CS<F>,
17    pub u: F,
18    pub E: F,
19}
20
21impl<F: PrimeField> R1CS<F> {
22    pub fn relax(self) -> RelaxedR1CS<F> {
23        RelaxedR1CS::<F> {
24            ABC: self,
25            u: F::one(),
26            E: F::zero(),
27        }
28    }
29}
30impl<F: PrimeField> RelaxedR1CS<F> {
31    pub fn fold(self, other: Self, r: F) -> Self {
32        unimplemented!();
33    }
34}