Skip to content

Commit

Permalink
fix: verify HTTP machine state at end
Browse files Browse the repository at this point in the history
  • Loading branch information
Autoparallel committed Dec 5, 2024
1 parent e7668de commit 0de92bb
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions circuits/http/verification.circom
Original file line number Diff line number Diff line change
Expand Up @@ -78,4 +78,12 @@ template HTTPVerification(DATA_BYTES, MAX_NUMBER_OF_HEADERS) {
body_hash_equal_check === 1;

step_out[0] <== inner_body_hash;

// Verify machine ends in a valid state
State[DATA_BYTES - 1].next_parsing_start === 0;
State[DATA_BYTES - 1].next_parsing_header === 0;
State[DATA_BYTES - 1].next_parsing_field_name === 0;
State[DATA_BYTES - 1].next_parsing_field_value === 0;
State[DATA_BYTES - 1].next_parsing_body === 1;
State[DATA_BYTES - 1].next_line_status === 0;
}

0 comments on commit 0de92bb

Please sign in to comment.