Skip to content

Commit

Permalink
add subbytes template
Browse files Browse the repository at this point in the history
  • Loading branch information
Nesopie committed Jul 21, 2024
1 parent 68783c6 commit 45d56b1
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 35 deletions.
6 changes: 6 additions & 0 deletions circuits/subbytes.circom
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
pragma circom 2.0.0;

template SubBytes(n) {
signal input key[n];
log(key);
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"description": "Circomkit examples",
"description": "AES",
"scripts": {
"start": "npx ts-node ./src/index.ts",
"test": "npx mocha"
Expand Down
36 changes: 2 additions & 34 deletions tests/subbytes.test.ts
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -50,7 +17,8 @@ describe("SubBytes", () => {
});

it(async () => {
circuit.compute({ key: f("abcd") }, []);
// circuit.compute({ key: f("abcd") }, []);
await circuit.expectPass({ key: f("abcd") });
});
});
});

0 comments on commit 45d56b1

Please sign in to comment.