for loops

This commit is contained in:
Jordi Baylina
2019-11-28 15:10:59 +01:00
parent 66291a0efe
commit 93330f065b
24 changed files with 1385 additions and 81 deletions

17
src/zqfield.js Normal file
View File

@@ -0,0 +1,17 @@
const bigInt = require("big-integer");
module.exports = class ZqField {
constructor(p) {
this.p = p;
}
add(a, b) {
return a.add(b).mod(this.p);
}
lt(a, b) {
return a.lt(b) ? bigInt(1) : bigInt(0);
}
};