verifyPersonalMessage method

bool verifyPersonalMessage(
  1. List<int> message,
  2. List<int> signature, {
  3. bool hashMessage = true,
  4. int? payloadLength,
})

Verifies an Ethereum signature of a personal message against the message digest.

Parameters:

  • message: The personal message.
  • signature: The signature bytes.
  • hashMessage: Whether to hash the message before verification (default is true).
  • payloadLength: An optional payload length to include in the message prefix.

Returns:

  • True if the signature is valid, false otherwise.

Implementation

bool verifyPersonalMessage(List<int> message, List<int> signature,
    {bool hashMessage = true, int? payloadLength}) {
  List<int> messagaeHash = _hashMessage(message,
      hashMessage: hashMessage, payloadLength: payloadLength);
  return _verifyEcdsa(
      messagaeHash, signature.sublist(0, ETHSignerConst.ethSignatureLength));
}