package secp256r1 import ( "crypto/ecdsa" "math/big" ) // Verifies the given signature (r, s) for the given hash and public key (x, y). func Verify(hash []byte, r, s, x, y *big.Int) bool { // Create the public key format publicKey := newPublicKey(x, y) // Check if they are invalid public key coordinates if publicKey == nil { return false } // Verify the signature with the public key, // then return true if it's valid, false otherwise return ecdsa.Verify(publicKey, hash, r, s) }