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.

41 lines
1.2 KiB

  1. # fri-commitment [![Test](https://github.com/arnaucube/fri-commitment/workflows/Test/badge.svg)](https://github.com/arnaucube/fri-commitment/actions?query=workflow%3ATest)
  2. FRI low degree testing & FRI polynomial commitment using [[VP19]](https://eprint.iacr.org/2019/1020)'s trick. Implementation using arkworks libraries.
  3. > *Note*: done in my free time to learn about FRI, do not use in production.
  4. Thanks to [Vincenzo Iovino](https://sites.google.com/site/vincenzoiovinoit/) for explainations on [FRI](https://eccc.weizmann.ac.il/report/2017/134/) & [[VP19]](https://eprint.iacr.org/2019/1020).
  5. ## Usage
  6. FRI-LDT:
  7. ```rust
  8. type LDT = FRI_LDT<Fr, DensePolynomial<Fr>, Keccak256Hash<Fr>>;
  9. let deg = 31;
  10. let p = DensePolynomial::<Fr>::rand(deg, &mut ark_std::test_rng());
  11. let proof = LDT::prove(&p);
  12. let v = LDT::verify(proof, deg);
  13. assert!(v);
  14. ```
  15. FRI-PCS:
  16. ```rust
  17. type PCS = FRI_PCS<Fr, DensePolynomial<Fr>, Keccak256Hash<Fr>>;
  18. let deg = 31;
  19. let mut rng = ark_std::test_rng();
  20. let p = DensePolynomial::<Fr>::rand(deg, &mut rng);
  21. let commitment = PCS::commit(&p);
  22. let r = Fr::rand(&mut rng);
  23. let (proof, claimed_y) = PCS::open(&p, r);
  24. let v = PCS::verify(commitment, proof, r, claimed_y);
  25. assert!(v);
  26. ```