Skip to content

Commit

Permalink
pre-allocate memory for AggregateVerify (#6285)
Browse files Browse the repository at this point in the history
* pre-allocate memory for AggregateVerify
  • Loading branch information
prestonvanloon committed Jun 16, 2020
1 parent 213be4c commit 4740f7e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions shared/bls/bls.go
Original file line number Diff line number Diff line change
Expand Up @@ -202,8 +202,8 @@ func (s *Signature) AggregateVerify(pubKeys []*PublicKey, msgs [][32]byte) bool
if size != len(msgs) {
return false
}
msgSlices := []byte{}
var rawKeys []bls12.PublicKey
msgSlices := make([]byte, 0, 32*len(msgs))
rawKeys := make([]bls12.PublicKey, 0, len(pubKeys))
for i := 0; i < size; i++ {
msgSlices = append(msgSlices, msgs[i][:]...)
rawKeys = append(rawKeys, *pubKeys[i].p)
Expand Down

0 comments on commit 4740f7e

Please sign in to comment.