Skip to content

Commit

Permalink
fix sha256 circuit test
Browse files Browse the repository at this point in the history
  • Loading branch information
RajeshRk18 committed Dec 9, 2023
1 parent d5f9e6f commit 6342504
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions circuits/circom/test/sha256Circuit.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,10 @@ describe("SHA256 Circuit", () => {
hexToBigInt(hashMPk.y.toString()),
);

const public_key_compressed = Array.from(Point.fromPrivateKey(testSecretKey).toRawBytes(true));

const sha_preimage_points: Point[] = [
Point.BASE,
Point.fromPrivateKey(testSecretKey),
hashMPkPoint,
nullifier,
rPoint,
Expand Down Expand Up @@ -65,7 +66,10 @@ describe("SHA256 Circuit", () => {
const p = path.join(__dirname, "./circuits/12_point_sha_256_test.circom");
const circuit = await wasm_tester(p, { json: true, sym: true });

const w = await circuit.calculateWitness({ coordinates }, true);
const w = await circuit.calculateWitness(
{ pk_compressed: public_key_compressed, coordinates, preimage_bit_length: v1_sha256_preimage_bit_length },
true,
);
await circuit.checkConstraints(w);
await circuit.assertOut(w, { out: v1_binary_c });
});
Expand Down

0 comments on commit 6342504

Please sign in to comment.