From 45d56b156ecbc050841634225052992f81c41eae Mon Sep 17 00:00:00 2001 From: ayman Date: Sun, 21 Jul 2024 09:31:35 +0530 Subject: [PATCH] add subbytes template --- circuits/subbytes.circom | 6 ++++++ package.json | 2 +- tests/subbytes.test.ts | 36 ++---------------------------------- 3 files changed, 9 insertions(+), 35 deletions(-) create mode 100644 circuits/subbytes.circom diff --git a/circuits/subbytes.circom b/circuits/subbytes.circom new file mode 100644 index 0000000..1ed27d3 --- /dev/null +++ b/circuits/subbytes.circom @@ -0,0 +1,6 @@ +pragma circom 2.0.0; + +template SubBytes(n) { + signal input key[n]; + log(key); +} \ No newline at end of file diff --git a/package.json b/package.json index f47a92e..ad57586 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "description": "Circomkit examples", + "description": "AES", "scripts": { "start": "npx ts-node ./src/index.ts", "test": "npx mocha" diff --git a/tests/subbytes.test.ts b/tests/subbytes.test.ts index 4baaca9..47a3639 100644 --- a/tests/subbytes.test.ts +++ b/tests/subbytes.test.ts @@ -1,39 +1,6 @@ import { WitnessTester } from "circomkit"; import { circomkit } from "./common"; -const fixtures = [ - { - ideal: "abc.", - actual: "abcd", - expect: 1, //true - }, - { - ideal: "abcd", - actual: "abcd", - expect: 1, //true - }, - { - ideal: "a..d", - actual: "abcd", - expect: 1, //true - }, - { - ideal: "....", - actual: "abcd", - expect: 1, //true - }, - { - ideal: "abce", - actual: "abcd", - expect: 0, //false - }, - { - ideal: "...e", - actual: "abcd", - expect: 0, //false - }, -]; - describe("SubBytes", () => { const f = (str: string) => Array.from(Buffer.from(str, "utf-8")); const length = 128; @@ -50,7 +17,8 @@ describe("SubBytes", () => { }); it(async () => { - circuit.compute({ key: f("abcd") }, []); + // circuit.compute({ key: f("abcd") }, []); + await circuit.expectPass({ key: f("abcd") }); }); }); });