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.

31 lines
1.0 KiB

2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
  1. const chai = require("chai");
  2. const path = require("path");
  3. const wasm_tester = require("./../index").wasm;
  4. const c_tester = require("./../index").c;
  5. const F1Field = require("ffjavascript").F1Field;
  6. const Scalar = require("ffjavascript").Scalar;
  7. exports.p = Scalar.fromString("21888242871839275222246405745257275088548364400416034343698204186575808495617");
  8. const Fr = new F1Field(exports.p);
  9. const assert = chai.assert;
  10. describe("Simple test", function () {
  11. this.timeout(100000);
  12. it("Checking the compilation of a simple circuit generating wasm", async () => {
  13. const circuit = await wasm_tester(path.join(__dirname, "Multiplier2.circom"));
  14. const w = await circuit.calculateWitness({a: 2, b: 4});
  15. await circuit.checkConstraints(w);
  16. });
  17. it("Checking the compilation of a simple circuit generating C", async () => {
  18. const circuit = await c_tester(path.join(__dirname, "Multiplier2.circom"));
  19. const w = await circuit.calculateWitness({a: 2, b: 4});
  20. await circuit.checkConstraints(w);
  21. });
  22. });