Skip to content

Commit

Permalink
Fix out of bounds when verifying malformed proofs
Browse files Browse the repository at this point in the history
  • Loading branch information
dkuehr committed Feb 24, 2025
1 parent dec49a9 commit 1e9a54b
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions poly-commitment/src/commitment.rs
Original file line number Diff line number Diff line change
Expand Up @@ -738,6 +738,13 @@ impl<G: CommitmentCurve> SRS<G> {
};

let s = b_poly_coefficients(&chal);

debug_assert!(s.len() <= scalars.len());

// TODO: implement a better solution at type/wire level, for now we just bail out...
if s.len() > scalars.len() {
return false;
}

let neg_rand_base_i = -rand_base_i;

Expand Down

0 comments on commit 1e9a54b

Please sign in to comment.