verify static method
verify a message by signature and account ID
Implementation
static bool verify(String msg, String accountId, String signature) {
var pubHex = lyraDecAccountId(accountId);
var curve = ECCurve_secp256r1();
var q = curve.curve.decodePoint(hex.decode(pubHex));
var eccDomain = ECDomainParameters('secp256r1');
var pubParams = PublicKeyParameter(ECPublicKey(q, eccDomain));
var sig = ECDSASigner(SHA256Digest());
sig.init(false, pubParams);
// decode P1393
var lst = Base58Decode(signature);
var half = lst.length ~/ 2;
var r = BigInt.parse('+' + hex.encode(lst.sublist(0, half)), radix: 16);
var s = BigInt.parse('+' + hex.encode(lst.sublist(half, lst.length)),
radix: 16);
//print("r: " + r.toString());
//print("s: " + s.toString());
var ecsigntr = ECSignature(r, s);
return sig.verifySignature(Uint8List.fromList(utf8.encode(msg)), ecsigntr);
}