# AesGcm.fromPrf

Derives an AES-256-GCM key from a 32-byte WebAuthn PRF output.

The permanent derivation contract uses the PRF output as the HMAC-SHA256 key. Its message is the UTF-8 bytes of `ox.aesGcm.fromPrf.v1` followed by a 32-bit big-endian counter set to zero.

## Imports

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

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

## Examples

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

const key = await AesGcm.fromPrf(
  '0x000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f'
)
```

## Definition

```ts
function fromPrf(
  value: Hex.Hex | Bytes.Bytes,
): Promise<CryptoKey>
```

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

## Parameters

### value

* **Type:** `Hex.Hex | Bytes.Bytes`

A 32-byte WebAuthn PRF output.

## Return Type

A nonextractable AES-256-GCM key for encryption and decryption.

`Promise<CryptoKey>`
