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.

17 lines
255 B

4 years ago
  1. const bigInt = require("big-integer");
  2. module.exports = class ZqField {
  3. constructor(p) {
  4. this.p = p;
  5. }
  6. add(a, b) {
  7. return a.add(b).mod(this.p);
  8. }
  9. lt(a, b) {
  10. return a.lt(b) ? bigInt(1) : bigInt(0);
  11. }
  12. };