# MlDsa44

WASM implementations of Ox's supported ML-DSA-44 primitives, backed by
[mldsa-native](https://github.com/pq-code-package/mldsa-native).

This provider is opt-in because its embedded artifact is larger than the
modules installed by [`Engine.install`](/api/Engine/install).

## Examples

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

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

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

## Functions

| Name                | Description                         |
| ------------------- | ----------------------------------- |
| [`MlDsa44.createKeyPair`](/wasm/postquantum/MlDsa44/createKeyPair) | Creates a new ML-DSA-44 key pair consisting of a private key and its corresponding public key. |
| [`MlDsa44.engine`](/wasm/postquantum/MlDsa44/engine) | Compiles WASM implementations of selected [`MlDsa44`](/api/MlDsa44) primitives, without installing them. |
| [`MlDsa44.fromPrf`](/wasm/postquantum/MlDsa44/fromPrf) | Derives an ML-DSA-44 private key from a 32-byte WebAuthn PRF output. |
| [`MlDsa44.getPublicKey`](/wasm/postquantum/MlDsa44/getPublicKey) | Computes the ML-DSA-44 public key from a provided private key. |
| [`MlDsa44.randomPrivateKey`](/wasm/postquantum/MlDsa44/randomPrivateKey) | Generates a random ML-DSA-44 private key (32-byte seed). |
| [`MlDsa44.sign`](/wasm/postquantum/MlDsa44/sign) | Signs the payload with the provided private key and returns an ML-DSA-44 signature (2,420 bytes). |
| [`MlDsa44.verify`](/wasm/postquantum/MlDsa44/verify) | Verifies a payload was signed by the provided public key. |

## Errors

| Name                | Description                         |
| ------------------- | ----------------------------------- |
| [`MlDsa44.InvalidContextSizeError`](/wasm/postquantum/MlDsa44/errors#mldsa44invalidcontextsizeerror) | Thrown when a context string exceeds the 255-byte FIPS 204 limit. |
| [`MlDsa44.InvalidInputError`](/wasm/postquantum/MlDsa44/errors#mldsa44invalidinputerror) | Thrown when mldsa-native rejects an input or fails to produce a signature. |
| [`MlDsa44.InvalidPrfSizeError`](/wasm/postquantum/MlDsa44/errors#mldsa44invalidprfsizeerror) | Thrown when a WebAuthn PRF output is not 32 bytes. |
| [`MlDsa44.MemoryError`](/wasm/postquantum/MlDsa44/errors#mldsa44memoryerror) | Thrown when a WASM module cannot grow its memory to the required size. |
