Skip to content

Commit

Permalink
fix: added a check during groth16 prover for public inputs
Browse files Browse the repository at this point in the history
  • Loading branch information
0xThemis authored and dkales committed Nov 26, 2024
1 parent 340df33 commit 4e6a43b
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions co-circom/co-groth16/src/groth16.rs
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,14 @@ where
tracing::info!("Party {}: starting proof generation..", id);
let start = Instant::now();
let public_inputs = Arc::new(private_witness.public_inputs);
if public_inputs.len() != zkey.n_public + 1 {
eyre::bail!(
"amount of public inputs do not match with provided zkey! Expected {}, but got {}",
zkey.n_public + 1,
public_inputs.len()
)
}

let private_witness = Arc::new(private_witness.witness);
let h = self.witness_map_from_matrices(&zkey, &public_inputs, &private_witness)?;
let (r, s) = (self.driver.rand()?, self.driver.rand()?);
Expand Down

0 comments on commit 4e6a43b

Please sign in to comment.