You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

34 lines
720 B

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