[][src]Function sr25519::verify

pub fn verify(
    signature: Sig,
    message: Message,
    pubkey: PubKey
) -> PyResult<bool>

Verifies that a signature on a given message was generated by private key corresponding to the specified public key.

Arguments

  • signature - The 64-byte sr25519 signature.
  • message - The binary message on which to verify the signature.
  • pubkey - The sr25519 public key, as an array of 32 bytes, to use.

Returns

True if the signature is valid, false otherwise.

Raises

  • ValueError - If either the signature or public key are structurally invalid.