Skip to content

Commit 1e9a54b

Browse files
author
Daniel Kuehr
committed
Fix out of bounds when verifying malformed proofs
1 parent dec49a9 commit 1e9a54b

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

poly-commitment/src/commitment.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -738,6 +738,13 @@ impl<G: CommitmentCurve> SRS<G> {
738738
};
739739

740740
let s = b_poly_coefficients(&chal);
741+
742+
debug_assert!(s.len() <= scalars.len());
743+
744+
// TODO: implement a better solution at type/wire level, for now we just bail out...
745+
if s.len() > scalars.len() {
746+
return false;
747+
}
741748

742749
let neg_rand_base_i = -rand_base_i;
743750

0 commit comments

Comments
 (0)