# Ed25519

WASM implementations of Ox's supported Ed25519 primitives.

## Examples

```ts twoslash
// @noErrors
import { Engine } from 'ox'
import { Ed25519 } from 'ox/wasm'

await Engine.install({ Ed25519: Ed25519.engine() })

Ed25519.getPublicKey({ privateKey: '0x...' })
```

## Functions

| Name                | Description                         |
| ------------------- | ----------------------------------- |
| [`Ed25519.createKeyPair`](/wasm/crypto/Ed25519/createKeyPair) | Creates a new Ed25519 key pair consisting of a private key and its corresponding public key. |
| [`Ed25519.engine`](/wasm/crypto/Ed25519/engine) | Compiles WASM implementations of selected [`Ed25519`](/api/Ed25519) primitives, without installing them. |
| [`Ed25519.getPublicKey`](/wasm/crypto/Ed25519/getPublicKey) | Computes the Ed25519 public key from a provided private key. |
| [`Ed25519.randomPrivateKey`](/wasm/crypto/Ed25519/randomPrivateKey) | Generates a random Ed25519 private key. |
| [`Ed25519.sign`](/wasm/crypto/Ed25519/sign) | Signs the payload with the provided private key and returns an Ed25519 signature. |
| [`Ed25519.toX25519PrivateKey`](/wasm/crypto/Ed25519/toX25519PrivateKey) | Converts an Ed25519 private key to an X25519 private key. |
| [`Ed25519.toX25519PublicKey`](/wasm/crypto/Ed25519/toX25519PublicKey) | Converts an Ed25519 public key to an X25519 public key. |
| [`Ed25519.verify`](/wasm/crypto/Ed25519/verify) | Verifies a payload was signed by the provided public key. |

## Errors

| Name                | Description                         |
| ------------------- | ----------------------------------- |
| [`Ed25519.MemoryError`](/wasm/crypto/Ed25519/errors#ed25519memoryerror) | Thrown when a WASM module cannot grow its memory to the required size. |
