# MlDsa44.sign

Signs the payload with the provided private key and returns an ML-DSA-44 signature (2,420 bytes).

Signing is deterministic by default. Set `extraEntropy` to `true` (or to 32 bytes of entropy) for the hedged variant of FIPS 204, which protects against fault attacks and randomness-reuse pitfalls at the cost of reproducibility.

## Imports

:::code-group
```ts [Named]
import { MlDsa44 } from 'ox'
```

```ts [Entrypoint]
import * as MlDsa44 from 'ox/MlDsa44'
```
:::

## Examples

```ts twoslash
import { MlDsa44 } from 'ox'

const signature = MlDsa44.sign({
  // [!code focus]
  payload: '0xdeadbeef', // [!code focus]
  privateKey: '0x...' // [!code focus]
}) // [!code focus]
```

## Definition

```ts
function sign<as>(
  options: sign.Options<as>,
): sign.ReturnType<as>
```

**Source:** [src/core/MlDsa44.ts](https://github.com/wevm/ox/blob/main/src/core/MlDsa44.ts#L248)

## Parameters

### options

* **Type:** `sign.Options<as>`

The signing options.

#### options.as

* **Type:** `"Bytes" | "Hex" | as`
* **Optional**

Format of the returned signature.

#### options.context

* **Type:** `0x${string} | Uint8Array`
* **Optional**

Context string for domain separation, at most 255 bytes.

#### options.extraEntropy

* **Type:** `boolean | 0x${string} | Uint8Array`
* **Optional**

Extra entropy to add to the signing process. Setting to `true` enables
hedged signing with 32 fresh random bytes; 32 bytes may be supplied
directly instead.

#### options.payload

* **Type:** `0x${string} | Uint8Array`

Payload to sign.

#### options.privateKey

* **Type:** `0x${string} | Uint8Array`

ML-DSA-44 private key (32-byte seed).

## Return Type

The ML-DSA-44 signature.

`sign.ReturnType<as>`
