diff --git a/circuits/aes-gcm/nivc/aes-gctr-nivc.circom b/circuits/aes-gcm/nivc/aes-gctr-nivc.circom index 04160c4..869bb79 100644 --- a/circuits/aes-gcm/nivc/aes-gctr-nivc.circom +++ b/circuits/aes-gcm/nivc/aes-gctr-nivc.circom @@ -38,7 +38,7 @@ template AESGCTRFOLD(DATA_BYTES, MAX_STACK_HEIGHT) { last_counter_num.in[i] <== last_counter_bits.out[31 - i]; } - counter <== last_counter_num.out - 1; + counter <== last_counter_num.out; // TODO (Colin): We can't call this `WriteToIndex` array this many times, it is too expensive. // write new plain text block. @@ -85,13 +85,4 @@ template AESGCTRFOLD(DATA_BYTES, MAX_STACK_HEIGHT) { step_out[i] <== aes.counter[i - (2 * DATA_BYTES)]; } } - - // get counter - // signal counterAccumulator[TOTAL_BYTES_ACROSS_NIVC]; - // component writeCounter = WriteToIndex(TOTAL_BYTES_ACROSS_NIVC, 4); - // writeCounter.array_to_write_to <== cipherTextAccumulator; - // writeCounter.array_to_write_at_index <== aes.counter; - // writeCounter.index <== DATA_BYTES*2; - // writeCounter.out ==> step_out; - } diff --git a/circuits/test/full/full.test.ts b/circuits/test/full/full.test.ts index fcef800..b04995a 100644 --- a/circuits/test/full/full.test.ts +++ b/circuits/test/full/full.test.ts @@ -64,7 +64,7 @@ describe("NIVC_FULL", async () => { template: "AESGCTRFOLD", params: [DATA_BYTES, MAX_STACK_HEIGHT], }); - // console.log("#constraints (AES-GCTR):", await aesCircuit.getConstraintCount()); // TODO (Colin): This is at 1.3M constraints... + console.log("#constraints (AES-GCTR):", await aesCircuit.getConstraintCount()); httpParseAndLockStartLineCircuit = await circomkit.WitnessTester(`ParseAndLockStartLine`, { file: "http/nivc/parse_and_lock_start_line", template: "ParseAndLockStartLine", @@ -103,7 +103,8 @@ describe("NIVC_FULL", async () => { // Run the 0th chunk of plaintext const init_nivc_input = Array(TOTAL_BYTES_ACROSS_NIVC).fill(0); // Blank array to write chunks to and pass through NIVC chain - let pt = http_response_plaintext.slice(16, 16 + 16); + let pt = http_response_plaintext.slice(0, 16); + console.log("pt", pt); aes_gcm = await aesCircuit.compute({ key: Array(16).fill(0), iv: Array(12).fill(0), plainText: pt, aad: Array(16).fill(0), step_in: init_nivc_input }, ["step_out"]); for (let i = 1; i < (DATA_BYTES / 16); i++) { // off by one here