crypto: simplify check

This commit is contained in:
Felix Lange 2017-12-20 10:18:57 +01:00
parent df04f9e470
commit b6be57f421

View file

@ -87,7 +87,8 @@ func VerifySignature(pubkey, hash, signature []byte) bool {
if err != nil {
return false
}
if !ValidateSignatureValues(0, sig.R, sig.S, true) {
// Reject malleable signatures. libsecp256k1 does this check but btcec doesn't.
if s.Cmp(secp256k1_halfN) > 0 {
return false
}
return sig.Verify(hash, key)