# X25519

WASM implementations of Ox's supported X25519 primitives.

## Examples

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

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

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

## Functions

| Name                | Description                         |
| ------------------- | ----------------------------------- |
| [`X25519.createKeyPair`](/wasm/crypto/X25519/createKeyPair) | Creates a new X25519 key pair consisting of a private key and its corresponding public key. |
| [`X25519.engine`](/wasm/crypto/X25519/engine) | Compiles WASM implementations of selected [`X25519`](/api/X25519) primitives, without installing them. |
| [`X25519.getPublicKey`](/wasm/crypto/X25519/getPublicKey) | Computes the X25519 public key from a provided private key. |
| [`X25519.getSharedSecret`](/wasm/crypto/X25519/getSharedSecret) | Computes a shared secret using X25519 elliptic curve Diffie-Hellman between a private key and a public key. |
| [`X25519.randomPrivateKey`](/wasm/crypto/X25519/randomPrivateKey) | Generates a random X25519 private key. |

## Errors

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