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.

32 lines
839 B

4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
  1. #ifndef ZQFIELD_H
  2. #define ZQFIELD_H
  3. #include "circom.h"
  4. class ZqField {
  5. mpz_t tmp;
  6. public:
  7. BigInt p;
  8. BigInt one;
  9. BigInt zero;
  10. ZqField(PBigInt ap);
  11. ~ZqField();
  12. void copyn(PBigInt a, PBigInt b, int n);
  13. void add(PBigInt r,PBigInt a, PBigInt b);
  14. void sub(PBigInt r,PBigInt a, PBigInt b);
  15. void mul(PBigInt r,PBigInt a, PBigInt b);
  16. void div(PBigInt r,PBigInt a, PBigInt b);
  17. void idiv(PBigInt r,PBigInt a, PBigInt b);
  18. void mod(PBigInt r,PBigInt a, PBigInt b);
  19. void lt(PBigInt r, PBigInt a, PBigInt b);
  20. void eq(PBigInt r, PBigInt a, PBigInt b);
  21. void gt(PBigInt r, PBigInt a, PBigInt b);
  22. void leq(PBigInt r, PBigInt a, PBigInt b);
  23. void geq(PBigInt r, PBigInt a, PBigInt b);
  24. void neq(PBigInt r, PBigInt a, PBigInt b);
  25. int isTrue(PBigInt a);
  26. };
  27. #endif // ZQFIELD_H