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.

20 lines
606 B

  1. const chai = require("chai");
  2. const fs = require("fs");
  3. const Circuit = require("../src/circuit.js");
  4. const BN128 = require("../src/BN128.js");
  5. const F1Field = require("../src/zqfield.js");
  6. const assert = chai.assert;
  7. describe("Calculate witness", () => {
  8. it("Should calculate the witness of a sum circuit", () => {
  9. const cirDef = JSON.parse(fs.readFileSync("../jaz/sum.json", "utf8"));
  10. const cir = new Circuit(cirDef);
  11. const witness = cir.calculateWitness({"a": "33", "b": "34"});
  12. assert.equal(witness[cir.getSignalIdx("main.out")].toString(), "67");
  13. });
  14. });