mirror of
https://github.com/arnaucube/circom.git
synced 2026-02-06 18:56:40 +01:00
Dependencies updated and publish
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
const chai = require("chai");
|
||||
const path = require("path");
|
||||
const zkSnark = require("zksnark");
|
||||
|
||||
const compiler = require("../index.js");
|
||||
|
||||
@@ -8,7 +9,14 @@ const assert = chai.assert;
|
||||
describe("SHA256 test", () => {
|
||||
it("Should create a constant circuit", async () => {
|
||||
|
||||
const cir = await compiler(path.join(__dirname, "circuits", "constants_test.jaz"));
|
||||
assert.equal(cir.nVars, 2);
|
||||
const cirDef = await compiler(path.join(__dirname, "circuits", "constants_test.jaz"));
|
||||
assert.equal(cirDef.nVars, 2);
|
||||
|
||||
const circuit = new zkSnark.Circuit(cirDef);
|
||||
|
||||
const witness = circuit.calculateWitness({ "in": "0xd807aa98" });
|
||||
|
||||
assert(witness[0].equals(zkSnark.bigInt(1)));
|
||||
assert(witness[1].equals(zkSnark.bigInt("0xd807aa98")));
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user