verify method

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

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

@override
bool verify(List<int> message, List<int> signature,
    {bool hashMessage = true}) {
  final sigBytes = signature.sublist(0, ETHSignerConst.ethSignatureLength);
  final hashDigest =
      hashMessage ? QuickCrypto.blake2b256Hash(message) : message;
  return _verifyEcdsa(hashDigest, sigBytes);
}