mirror of
https://github.com/arnaucube/snarkjs.git
synced 2026-02-27 21:46:47 +01:00
Use ruffini for calculatig lagrange polinomials
This commit is contained in:
@@ -141,5 +141,14 @@ describe("Polinomial field", () => {
|
||||
assert(PF.F.equals(v, points[i][1]));
|
||||
}
|
||||
});
|
||||
it("Should test ruffini", () => {
|
||||
const PF = new PolField(new ZqField(r));
|
||||
const a = [bigInt(1), bigInt(2), bigInt(3), bigInt(4), bigInt(5),bigInt(6), bigInt(7)];
|
||||
|
||||
const b = PF.mul(a, [bigInt(-7), bigInt(1)]);
|
||||
const c = PF.ruffini(b, bigInt(7));
|
||||
|
||||
assert(PF.equals(a, c));
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
@@ -2,11 +2,11 @@ const chai = require("chai");
|
||||
|
||||
const bigInt = require("../src/bigint.js");
|
||||
const ZqField = require("../src/zqfield.js");
|
||||
const RatZqField = require("../src/ratzqfield.js");
|
||||
const RatField = require("../src/ratfield.js");
|
||||
|
||||
const q = bigInt("21888242871839275222246405745257275088548364400416034343698204186575808495617");
|
||||
const Z = new ZqField(q);
|
||||
const R = new RatZqField(Z);
|
||||
const R = new RatField(Z);
|
||||
|
||||
const assert = chai.assert;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user