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.

25 lines
619 B

  1. const chai = require("chai");
  2. const path = require("path");
  3. const tester = require("circom").tester;
  4. const mimcjs = require("../src/mimc7.js");
  5. describe("MiMC Circuit test", function () {
  6. let circuit;
  7. this.timeout(100000);
  8. before( async () => {
  9. circuit = await tester(path.join(__dirname, "circuits", "mimc_test.circom"));
  10. });
  11. it("Should check constrain", async () => {
  12. const w = await circuit.calculateWitness({x_in: 1, k: 2});
  13. const res2 = mimcjs.hash(1,2,91);
  14. await circuit.assertOut(w, {out: res2});
  15. await circuit.checkConstraints(w);
  16. });
  17. });