func (s *SignerSecp256k1) Verify(pubKey PublicKey, signature Signature, msg []byte) bool {
	hash := Sha256(msg)
	signature = s.DealRecoverID(signature)
	sigs := signature.Bytes
	sig := &btcec.Signature{R: new(big.Int).SetBytes(sigs[:32]), S: new(big.Int).SetBytes(sigs[32:])}
	key, err := btcec.ParsePubKey(pubKey.Bytes, btcec.S256())
	if err != nil {
		fmt.Println(err)
		return false
	}
	if sig.S.Cmp(secp256k1halfN) > 0 {
		fmt.Println("sec")
		return false
	}
	return sig.Verify(hash, key)
}
VerifySignature checks that the given public key created signature over hash.
The public key should be in compressed (33 bytes) or uncompressed (65 bytes) format.
The signature should have the 64 byte [R || S] format.
package crypto
import (
	"crypto/ecdsa"
	"crypto/rand"
	"fmt"
	"github.com/annchain/OG/common"
	"github.com/annchain/OG/common/crypto/ecies"
	"github.com/btcsuite/btcd/btcec"
	"math/big"
)
type SignerSecp256k1 struct {
}
func (s *SignerSecp256k1) GetCryptoType() CryptoType {
	return CryptoTypeSecp256k1
}
func (s *SignerSecp256k1) Sign(privKey PrivateKey, msg []byte) Signature {
	prv, _ := ToECDSA(privKey.Bytes)
	hash := Sha256(msg)
	if len(hash) != 32 {
		panic(fmt.Errorf("hash is required to be exactly 32 bytes (%d)", len(hash)))
	}
	if prv.Curve != btcec.S256() {
		panic(fmt.Errorf("private key curve is not secp256k1"))
	}
	sig, err := btcec.SignCompact(btcec.S256(), (*btcec.PrivateKey)(prv), hash, false)
	if err != nil {
		panic(err)
	}
	v := sig[0] - 27
	copy(sig, sig[1:])
	sig[64] = v
	return SignatureFromBytes(s.GetCryptoType(), sig)
}