> For the complete documentation index, see [llms.txt](https://docs.turbine.exchange/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.turbine.exchange/reference/contracts/solidity-documentation/univ4-hook/libraries/library.signatureverification.md).

# SignatureVerification

[Git Source](https://github.com/propeller-heads/turbine/blob/90514973167f1eb25cb9eb7756354fb3de34824d/src/univ4-hook/libraries/SignatureVerification.sol)

Library for verifying signatures using ECDSA and ERC-1271

Copied from <https://github.com/Uniswap/permit2/blob/cc56ad0f3439c502c246fc5cfcc3db92bb8b7219/src/libraries/SignatureVerification.sol>

## State Variables

### UPPER\_BIT\_MASK

```solidity
bytes32 constant UPPER_BIT_MASK = (0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff)
```

## Functions

### verify

```solidity
function verify(bytes calldata signature, bytes32 hash, address claimedSigner) internal view;
```

## Errors

### InvalidSignatureLength

Thrown when the passed in signature is not a valid length

```solidity
error InvalidSignatureLength();
```

### InvalidSignature

Thrown when the recovered signer is equal to the zero address

```solidity
error InvalidSignature();
```

### InvalidSigner

Thrown when the recovered signer does not equal the claimedSigner

```solidity
error InvalidSigner();
```

### InvalidContractSignature

Thrown when the recovered contract signature is incorrect

```solidity
error InvalidContractSignature();
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.turbine.exchange/reference/contracts/solidity-documentation/univ4-hook/libraries/library.signatureverification.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
