Skip to content

Commit

Permalink
fix or rm deprecated or broken tests
Browse files Browse the repository at this point in the history
  • Loading branch information
thor314 committed Sep 20, 2024
1 parent de26e4c commit ab44e71
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 78 deletions.
6 changes: 3 additions & 3 deletions circuits/aes-gcm/ghash.circom
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,9 @@ template GHASH(NUM_BLOCKS) {
// h.reverse();
// let mut h_polyval = polyval::mulx(&h);
// let result = GHash(Polyval::new_with_init_block(&h_polyval, init_block));
template TranslateHashkey() {
signal input in[128];
signal output out[128];
// template TranslateHashkey() {
// signal input in[128];
// signal output out[128];

// signal mid[128];

Expand Down
51 changes: 0 additions & 51 deletions circuits/test/gfmulint/gfmulint.test.ts

This file was deleted.

46 changes: 23 additions & 23 deletions circuits/test/hashes/ghash.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,29 +27,29 @@ describe("GHASH_HASH", () => {
});
});

describe("TranslateHashkey", () => {
let circuit: WitnessTester<["inp"], ["out"]>;

before(async () => {
circuit = await circomkit.WitnessTester(`ghash`, {
file: "aes-gcm/ghash",
template: "TranslateHashkey",
});
// console.log("#constraints:", await circuit.getConstraintCount());
});

// initial hashkey: [37, 98, 147, 71, 88, 146, 66, 118, 29, 49, 248, 38, 186, 75, 117, 123]
//25629347589242761D31F826BA4B757B
// reversed hashkey: [123, 117, 75, 186, 38, 248, 49, 29, 118, 66, 146, 88, 71, 147, 98, 37]
//7B754BBA26F8311D7642925847936225
// post-mul_x hashkey: [246, 234, 150, 116, 77, 240, 99, 58, 236, 132, 36, 177, 142, 38, 197, 74]
//F6EA96744DF0633AEC8424B18E26C54A
it("test TranslateHashkey", async () => {
const inp = hexToBitArray("25629347589242761d31f826ba4b757b");
const out = hexToBitArray("F6EA96744DF0633AEC8424B18E26C54A");
const _res = await circuit.expectPass({ inp: inp }, { out });
});
});
// describe("TranslateHashkey", () => {
// let circuit: WitnessTester<["inp"], ["out"]>;

// before(async () => {
// circuit = await circomkit.WitnessTester(`ghash`, {
// file: "aes-gcm/ghash",
// template: "TranslateHashkey",
// });
// // console.log("#constraints:", await circuit.getConstraintCount());
// });

// // initial hashkey: [37, 98, 147, 71, 88, 146, 66, 118, 29, 49, 248, 38, 186, 75, 117, 123]
// //25629347589242761D31F826BA4B757B
// // reversed hashkey: [123, 117, 75, 186, 38, 248, 49, 29, 118, 66, 146, 88, 71, 147, 98, 37]
// //7B754BBA26F8311D7642925847936225
// // post-mul_x hashkey: [246, 234, 150, 116, 77, 240, 99, 58, 236, 132, 36, 177, 142, 38, 197, 74]
// //F6EA96744DF0633AEC8424B18E26C54A
// it("test TranslateHashkey", async () => {
// const inp = hexToBitArray("25629347589242761d31f826ba4b757b");
// const out = hexToBitArray("F6EA96744DF0633AEC8424B18E26C54A");
// const _res = await circuit.expectPass({ inp: inp }, { out });
// });
// });



2 changes: 1 addition & 1 deletion circuits/test/helper_functions.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ describe("reverse_byte_array", () => {
before(async () => {
circuit = await circomkit.WitnessTester(`reverse_bytes`, {
file: "aes-gcm/helper_functions",
template: "ReverseByteArray",
template: "ReverseByteArray128",
});
});

Expand Down

0 comments on commit ab44e71

Please sign in to comment.