verify method

bool verify(
  1. List<int> digest,
  2. List<int> signature, {
  3. bool hashMessage = true,
})

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);
}