verify method
Verifies an Ethereum signature against a message digest.
Parameters:
digest
: The message digest.signature
: The signature bytes.hashMessage
: Whether to hash the message before verification (default is true).
Returns:
- True if the signature is valid, false otherwise.
Implementation
bool verify(List<int> digest, List<int> signature,
{bool hashMessage = true}) {
final sigBytes = signature.sublist(0, ETHSignerConst.ethSignatureLength);
final hashDigest =
hashMessage ? QuickCrypto.keccack256Hash(digest) : digest;
return _verifyEcdsa(hashDigest, sigBytes);
}