From ee52a07e39c87df8d0c48ee9c9cce3da67f7278f Mon Sep 17 00:00:00 2001 From: yash1io Date: Sun, 8 Sep 2024 14:38:46 +0530 Subject: [PATCH] added circuits and tests --- .mocharc.json | 2 +- README.md | 12 +++++++++++- circuits.json | 4 ++-- circuits/add.circom | 10 ---------- tests/add.test.ts | 20 -------------------- 5 files changed, 14 insertions(+), 34 deletions(-) delete mode 100644 circuits/add.circom delete mode 100644 tests/add.test.ts diff --git a/.mocharc.json b/.mocharc.json index 6382cd6..a62e245 100644 --- a/.mocharc.json +++ b/.mocharc.json @@ -2,6 +2,6 @@ "extension": ["ts"], "require": "ts-node/register", "spec": "tests/**/*.test.ts", - "timeout": 100000, + "timeout": 10000000000, "exit": true } diff --git a/README.md b/README.md index bc8ff40..d65e7e2 100644 --- a/README.md +++ b/README.md @@ -1 +1,11 @@ -Circomkit template +# Sha256-var-circom + +This is borrowed from +1. [snark-jwt-verify](https://github.com/TheFrozenFire/snark-jwt-verify/tree/master) +2. [sha256-var-circom](https://github.com/noway/sha256-var-circom) +And maintained here for more ease. + +Changes made: +1. Removed references to `snark-jwt-verify` for circomlib and using official release of circomlib +2. Converted tests to support circomkit +3. Updated circom version \ No newline at end of file diff --git a/circuits.json b/circuits.json index 622ce3c..f29c64a 100644 --- a/circuits.json +++ b/circuits.json @@ -1,6 +1,6 @@ { "add": { - "file": "add", - "template": "Add" + "file": "sha256Var", + "template": "sha256Var" } } diff --git a/circuits/add.circom b/circuits/add.circom deleted file mode 100644 index 5933ecf..0000000 --- a/circuits/add.circom +++ /dev/null @@ -1,10 +0,0 @@ -pragma circom 2.1.5; - -template Add() { - signal input a; - signal input b; - signal output out; - - out <== a + b; -} - diff --git a/tests/add.test.ts b/tests/add.test.ts deleted file mode 100644 index 0e7cc01..0000000 --- a/tests/add.test.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { WitnessTester } from "circomkit"; -import { circomkit } from "./common"; - -describe("Add", () => { - let circuit: WitnessTester<["a", "b"], ["out"]>; - - describe("Add", () => { - before(async () => { - circuit = await circomkit.WitnessTester(`Add`, { - file: "add", - template: "Add", - }); - console.log("#constraints:", await circuit.getConstraintCount()); - }); - - it("should add two numbers", async () => { - await circuit.expectPass({ a: 1, b: 2 }, { out: 3 }); - }); - }); -});