Skip to content

Commit

Permalink
chg: comment on SigSize check deletion according to changes in comet
Browse files Browse the repository at this point in the history
  • Loading branch information
marcello33 committed Sep 17, 2024
1 parent 0a5eacb commit f54ebb5
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
10 changes: 7 additions & 3 deletions crypto/keys/secp256k1/secp256k1.go
Original file line number Diff line number Diff line change
Expand Up @@ -295,9 +295,13 @@ func (pubKey *PubKeyOld) Equals(other cryptotypes.PubKey) bool {
}

func (pubKey *PubKeyOld) VerifySignature(msg []byte, sigStr []byte) bool {
if len(sigStr) != SigSize {
return false
}
// HV2: this check is removed because the sigSize validation is performed in ethCrypto.VerifySignature

/*
if len(sigStr) != SigSize {
return false
}
*/

hash := ethCrypto.Keccak256(msg)
return ethCrypto.VerifySignature(pubKey.Key, hash, sigStr[:64])
Expand Down
10 changes: 7 additions & 3 deletions crypto/keys/secp256k1/secp256k1_nocgo.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,13 @@ func (privKey *PrivKey) Sign(msg []byte) ([]byte, error) {
// VerifySignature verifies a signature of the form R || S || V.
// It rejects signatures which are not in lower-S form.
func (pubKey *PubKey) VerifySignature(msg []byte, sigStr []byte) bool {
//if len(sigStr) != SigSize {
// return false
//}
// HV2: this check is removed because the sigSize validation is performed in ethCrypto.VerifySignature

/*
if len(sigStr) != SigSize {
return false
}
*/

hash := ethCrypto.Keccak256(msg)
return ethCrypto.VerifySignature(pubKey.Key, hash, sigStr[:64])
Expand Down

0 comments on commit f54ebb5

Please sign in to comment.