# verify_signature · Rell standard library · Chromia Docs (concept)

> pure function verify_ signature(data_ hash: byte_array , pubkey: byte_array , signature: byte_array ): boolean Verify a signature against a message and pub

Source: https://docs.chromia.com/pages/rell-stdlib/-rell-system-library/root/verify_signature/

FUNCTION

# verify\_signature

```signature
pure function verify_signature(data_hash: byte_array, pubkey: byte_array, signature: byte_array): boolean
```

Verify a signature against a message and public key.

More precisely, verify that `signature` was obtained with a procedure equivalent to
`get_signature(data_hash, privkey)`, where `privkey` and `pubkey` form a keypair.

Accepts valid public keys of size `33` or `65` bytes. Note that not all byte arrays of acceptable
length constitute valid public keys.

**Parameters**

* **data\_hash** — the original (unsigned) 32-byte array
* **pubkey** — the public key (33, 64 or 65 bytes)
* **signature** — the 64-byte signature to verify

**Returns**

`true` if the signature is valid, indicating that the message was indeed signed by the
private key belonging to the keypair of the given public key; `false` otherwise

**Throws**

* `exception` — when: - `data_hash` does not have length `32` - `signature` does not have length `64` - `pubkey` does not have length `33` or `65` - `pubkey` is not a valid public key

Since 0.10.6

**Alias of** [crypto.verify\_signature](https://docs.chromia.com/pages/rell-stdlib/-rell-system-library/crypto/verify_signature/)

[View this page on docs.chromia.com](https://docs.chromia.com/pages/rell-stdlib/-rell%20-system%20-library/%5Broot%5D/verify_signature.html)Generated API reference, mirrored from the live docs
