Skip to content

Commit

Permalink
bounds check when comparing polynomials
Browse files Browse the repository at this point in the history
  • Loading branch information
CluEleSsUK committed Feb 14, 2024
1 parent 96c6a27 commit 5924c77
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions share/poly.go
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,11 @@ func (p *PubPoly) Equal(q *PubPoly) bool {
return false
}
b := 1

if len(p.commits) < p.Threshold() || len(q.commits) < p.Threshold() {
return false
}

for i := 0; i < p.Threshold(); i++ {
pb, _ := p.commits[i].MarshalBinary()
qb, _ := q.commits[i].MarshalBinary()
Expand Down

0 comments on commit 5924c77

Please sign in to comment.