diff --git a/crypto/keys/secp256k1/secp256k1.go b/crypto/keys/secp256k1/secp256k1.go index 0b0dd8b1667c..a6b93168eef3 100644 --- a/crypto/keys/secp256k1/secp256k1.go +++ b/crypto/keys/secp256k1/secp256k1.go @@ -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]) diff --git a/crypto/keys/secp256k1/secp256k1_nocgo.go b/crypto/keys/secp256k1/secp256k1_nocgo.go index 938536f24c20..cda0ca5cb410 100644 --- a/crypto/keys/secp256k1/secp256k1_nocgo.go +++ b/crypto/keys/secp256k1/secp256k1_nocgo.go @@ -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])