Skip to content

Commit

Permalink
remove logs
Browse files Browse the repository at this point in the history
  • Loading branch information
lonerapier committed Feb 4, 2025
1 parent c6c4e0f commit 69ebdd7
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 31 deletions.
12 changes: 6 additions & 6 deletions circuits/chacha20/authentication.circom
Original file line number Diff line number Diff line change
Expand Up @@ -161,11 +161,11 @@ template PlaintextAuthentication(DATA_BYTES, PUBLIC_IO_LENGTH) {
}
signal part_ciphertext_digest <== DataHasherWithSeed(DATA_BYTES)(step_in[10],bigEndianCiphertext);

log("part_ciphertext_digest: ", part_ciphertext_digest);
// log("part_ciphertext_digest: ", part_ciphertext_digest);

signal plaintext_digest <== PolynomialDigestWithCounter(DATA_BYTES)(zeroed_plaintext, ciphertext_digest, step_in[1]);

log("plaintext_digest: ", plaintext_digest);
// log("plaintext_digest: ", plaintext_digest);

step_out[0] <== step_in[0] + step_in[10] - part_ciphertext_digest + plaintext_digest;
step_out[1] <== ciphertext_digest_pow[DATA_BYTES];
Expand All @@ -183,8 +183,8 @@ template PlaintextAuthentication(DATA_BYTES, PUBLIC_IO_LENGTH) {
}
}

for (var i = 0; i < PUBLIC_IO_LENGTH ; i++) {
log("step_out[",i,"]", step_out[i]);
}
log("xxxxxx Authentication Done xxxxxx");
// for (var i = 0; i < PUBLIC_IO_LENGTH ; i++) {
// log("step_out[",i,"]", step_out[i]);
// }
// log("xxxxxx Authentication Done xxxxxx");
}
36 changes: 18 additions & 18 deletions circuits/http/verification.circom
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@ template HTTPVerification(DATA_BYTES, MAX_NUMBER_OF_HEADERS, PUBLIC_IO_LENGTH) {

// assertions:
// - check step_in[3] = machine state hash digest
for (var i = 0 ; i < 7 ; i++) {
log("machine_state[",i,"] = ", machine_state[i]);
}
// for (var i = 0 ; i < 7 ; i++) {
// log("machine_state[",i,"] = ", machine_state[i]);
// }
signal machine_state_digest <== PolynomialDigest(7)(machine_state, ciphertext_digest);
log("machine_state_digest: ", machine_state_digest);
// log("machine_state_digest: ", machine_state_digest);
step_in[3] === machine_state_digest;
// - check step_in[4] = start line hash digest + all header hash digests
// TODO: I don't like this `MAX_NUMBER_OF_HEADERS + 1` now. It should just be `NUMBER_OF_STATEMENTS_TO_LOCK` or something
Expand Down Expand Up @@ -120,7 +120,7 @@ template HTTPVerification(DATA_BYTES, MAX_NUMBER_OF_HEADERS, PUBLIC_IO_LENGTH) {
signal initial_pow_accumulation <== step_in[6] * ciphertext_digest;
signal pow_accumulation <== initial_pow_accumulation + body_ctr_is_zero * State[0].parsing_body; // pow_accumulation = 0 if we are not in the body

log("pow_accumulation: ", pow_accumulation);
// log("pow_accumulation: ", pow_accumulation);
signal body_monomials_pow_accumulation[DATA_BYTES]; // power of monomials for the body
signal body_monomials[DATA_BYTES]; // power of monomials for the body
signal body_ctr[DATA_BYTES]; // body counter
Expand Down Expand Up @@ -166,17 +166,17 @@ template HTTPVerification(DATA_BYTES, MAX_NUMBER_OF_HEADERS, PUBLIC_IO_LENGTH) {
step_out[i] <== step_in[i];
}

log("next_parsing_start: ", State[DATA_BYTES - 1].next_parsing_start);
log("next_parsing_header: ", State[DATA_BYTES - 1].next_parsing_header);
log("next_parsing_field_name: ", State[DATA_BYTES - 1].next_parsing_field_name);
log("next_parsing_field_value: ", State[DATA_BYTES - 1].next_parsing_field_value);
log("next_parsing_body: ", State[DATA_BYTES - 1].next_parsing_body);
log("next_line_status: ", State[DATA_BYTES - 1].next_line_status);
log("line_digest: ", line_digest[DATA_BYTES]);
log("body_digest: ", body_digest[DATA_BYTES - 1]);

for (var i = 0 ; i < PUBLIC_IO_LENGTH ; i++) {
log("step_out[",i,"] = ", step_out[i]);
}
log("xxxxx HTTP Verification Done xxxxx");
// log("next_parsing_start: ", State[DATA_BYTES - 1].next_parsing_start);
// log("next_parsing_header: ", State[DATA_BYTES - 1].next_parsing_header);
// log("next_parsing_field_name: ", State[DATA_BYTES - 1].next_parsing_field_name);
// log("next_parsing_field_value: ", State[DATA_BYTES - 1].next_parsing_field_value);
// log("next_parsing_body: ", State[DATA_BYTES - 1].next_parsing_body);
// log("next_line_status: ", State[DATA_BYTES - 1].next_line_status);
// log("line_digest: ", line_digest[DATA_BYTES]);
// log("body_digest: ", body_digest[DATA_BYTES - 1]);

// for (var i = 0 ; i < PUBLIC_IO_LENGTH ; i++) {
// log("step_out[",i,"] = ", step_out[i]);
// }
// log("xxxxx HTTP Verification Done xxxxx");
}
14 changes: 7 additions & 7 deletions circuits/json/extraction.circom
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,9 @@ template JSONExtraction(DATA_BYTES, MAX_STACK_HEIGHT, PUBLIC_IO_LENGTH) {
new_state[MAX_STACK_HEIGHT*4 + 2] <== State[DATA_BYTES - 1].next_parsing_number;
signal new_state_digest <== PolynomialDigest(MAX_STACK_HEIGHT * 4 + 3)(new_state, ciphertext_digest);

for (var i = 0 ; i < MAX_STACK_HEIGHT * 4 + 3 ; i++) {
log("new_state[", i, "] = ", new_state[i]);
}
// for (var i = 0 ; i < MAX_STACK_HEIGHT * 4 + 3 ; i++) {
// log("new_state[", i, "] = ", new_state[i]);
// }

// Verify we have now processed all the data properly
// TODO: This data is now the HTTP body, consider renaming
Expand Down Expand Up @@ -159,8 +159,8 @@ template JSONExtraction(DATA_BYTES, MAX_STACK_HEIGHT, PUBLIC_IO_LENGTH) {
step_out[i] <== step_in[i];
}

for (var i = 0 ; i < PUBLIC_IO_LENGTH ; i++) {
log("step_out[", i, "] = ", step_out[i]);
}
log("xxxxxx JSON Extraction Done xxxxxx");
// for (var i = 0 ; i < PUBLIC_IO_LENGTH ; i++) {
// log("step_out[", i, "] = ", step_out[i]);
// }
// log("xxxxxx JSON Extraction Done xxxxxx");
}

0 comments on commit 69ebdd7

Please sign in to comment.