mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2025-01-03 00:27:38 +00:00
Bring Eth2FastAggregateVerify Inline With the Spec (#9742)
* fix * tie it closer to the spec
This commit is contained in:
parent
9aa50352b6
commit
b128d446f2
@ -118,7 +118,11 @@ func (s *Signature) FastAggregateVerify(pubKeys []common.PublicKey, msg [32]byte
|
||||
if len(pubKeys) == 0 {
|
||||
return false
|
||||
}
|
||||
return s.innerFastAggregateVerify(pubKeys, msg)
|
||||
rawKeys := make([]*blstPublicKey, len(pubKeys))
|
||||
for i := 0; i < len(pubKeys); i++ {
|
||||
rawKeys[i] = pubKeys[i].(*PublicKey).p
|
||||
}
|
||||
return s.s.FastAggregateVerify(true, rawKeys, msg[:], dst)
|
||||
}
|
||||
|
||||
// Eth2FastAggregateVerify implements a wrapper on top of bls's FastAggregateVerify. It accepts G2_POINT_AT_INFINITY signature
|
||||
@ -139,15 +143,7 @@ func (s *Signature) Eth2FastAggregateVerify(pubKeys []common.PublicKey, msg [32]
|
||||
if len(pubKeys) == 0 && bytes.Equal(s.Marshal(), common.InfiniteSignature[:]) {
|
||||
return true
|
||||
}
|
||||
return s.innerFastAggregateVerify(pubKeys, msg)
|
||||
}
|
||||
|
||||
func (s *Signature) innerFastAggregateVerify(pubKeys []common.PublicKey, msg [32]byte) bool {
|
||||
rawKeys := make([]*blstPublicKey, len(pubKeys))
|
||||
for i := 0; i < len(pubKeys); i++ {
|
||||
rawKeys[i] = pubKeys[i].(*PublicKey).p
|
||||
}
|
||||
return s.s.FastAggregateVerify(true, rawKeys, msg[:], dst)
|
||||
return s.FastAggregateVerify(pubKeys, msg)
|
||||
}
|
||||
|
||||
// NewAggregateSignature creates a blank aggregate signature.
|
||||
|
Loading…
Reference in New Issue
Block a user