func Verify(msgHash [hashLen]byte, sig []byte, pubkey []byte) bool { success := C.secp256k1_ecdsa_verify(cBuf(msgHash[:]), cBuf(sig), C.int(len(sig)), cBuf(pubkey), C.int(len(pubkey))) // success can be also -1 and -2 to indicate invalid sig or invalid pubkey // for now we just ignore that return goBool(success) }
// Verify ECDSA signature func EC_Verify(pkey, sign, hash []byte) int { return int(C.secp256k1_ecdsa_verify((*C.uchar)(unsafe.Pointer(&hash[0])), C.int(32), (*C.uchar)(unsafe.Pointer(&sign[0])), C.int(len(sign)), (*C.uchar)(unsafe.Pointer(&pkey[0])), C.int(len(pkey)))) }