mirror of
https://github.com/arnaucube/circom.git
synced 2026-02-06 18:56:40 +01:00
Readme, License Fixes and another test added
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
include "../../circuits/sha256/constants.jaz"
|
||||
include "../../circuits/sha256/constants.circom"
|
||||
|
||||
template A() {
|
||||
signal input in;
|
||||
@@ -1,5 +1,5 @@
|
||||
include "bitify.jaz"
|
||||
include "binsum.jaz"
|
||||
include "../../circuits/sha256/bitify.circom"
|
||||
include "../../circuits/sha256/binsum.circom"
|
||||
|
||||
template A() {
|
||||
signal private input a;
|
||||
4
test/input_sum_test.json
Normal file
4
test/input_sum_test.json
Normal file
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"a": "111",
|
||||
"b": "222"
|
||||
}
|
||||
@@ -9,7 +9,7 @@ const assert = chai.assert;
|
||||
describe("SHA256 test", () => {
|
||||
it("Should create a constant circuit", async () => {
|
||||
|
||||
const cirDef = await compiler(path.join(__dirname, "circuits", "constants_test.jaz"));
|
||||
const cirDef = await compiler(path.join(__dirname, "circuits", "constants_test.circom"));
|
||||
assert.equal(cirDef.nVars, 2);
|
||||
|
||||
const circuit = new zkSnark.Circuit(cirDef);
|
||||
@@ -19,4 +19,18 @@ describe("SHA256 test", () => {
|
||||
assert(witness[0].equals(zkSnark.bigInt(1)));
|
||||
assert(witness[1].equals(zkSnark.bigInt("0xd807aa98")));
|
||||
});
|
||||
it("Should create a sum circuit", async () => {
|
||||
|
||||
const cirDef = await compiler(path.join(__dirname, "circuits", "sum_test.circom"));
|
||||
assert.equal(cirDef.nVars, 101);
|
||||
|
||||
const circuit = new zkSnark.Circuit(cirDef);
|
||||
|
||||
const witness = circuit.calculateWitness({ "a": "111", "b": "222" });
|
||||
|
||||
assert(witness[0].equals(zkSnark.bigInt(1)));
|
||||
assert(witness[1].equals(zkSnark.bigInt("333")));
|
||||
});
|
||||
|
||||
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user