Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions src/fiat_shamir.rs
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,12 @@ where
let response = self
.interactive_proof
.deserialize_response(&proof[commitment_size..])?;
let response_size = self.interactive_proof.serialize_response(&response).len();

// Proof size check
if proof.len() != commitment_size + response_size {
return Err(Error::VerificationFailure);
}

let mut hash_state = self.hash_state.clone();

Expand Down Expand Up @@ -270,6 +276,12 @@ where
let response = self
.interactive_proof
.deserialize_response(&proof[challenge_size..])?;
let response_size = self.interactive_proof.serialize_response(&response).len();

// Proof size check
if proof.len() != challenge_size + response_size {
return Err(Error::VerificationFailure);
}

// Compute the commitments
let commitment = self
Expand Down
Loading