verifySecp256k1Blob function
Implementation
bool verifySecp256k1Blob(
Uint8List blob,
Uint8List signature,
Secp256k1PublicKey publicKey,
) {
final digest = SHA256Digest();
final signer = ECDSASigner(digest, HMac(digest, 64));
final sig = ECSignature(
signature.sublist(0, 32).toBn(endian: Endian.big),
signature.sublist(32).toBn(endian: Endian.big),
);
final kpub = secp256k1Params.curve.decodePoint(publicKey.toRaw())!;
final pub = ECPublicKey(kpub, secp256k1Params);
signer.init(false, p_api.PublicKeyParameter(pub));
return signer.verifySignature(blob, sig);
}