<!--
{
  "availability" : [
    "iOS: 14.0.0 -",
    "iPadOS: 14.0.0 -",
    "macCatalyst: 14.0.0 -",
    "macOS: 11.0.0 -",
    "tvOS: 14.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 7.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CryptoKit",
  "identifier" : "/documentation/CryptoKit/HKDF/expand(pseudoRandomKey:info:outputByteCount:)",
  "metadataVersion" : "0.1.0",
  "role" : "Type Method",
  "symbol" : {
    "kind" : "Type Method",
    "modules" : [
      "Apple CryptoKit"
    ],
    "preciseIdentifier" : "s:9CryptoKit4HKDFV6expand15pseudoRandomKey4info15outputByteCountAA09SymmetricG0Vqd___qd_0_SgSit10Foundation15ContiguousBytesRd__AK12DataProtocolRd_0_r0_lFZ"
  },
  "title" : "expand(pseudoRandomKey:info:outputByteCount:)"
}
-->

# expand(pseudoRandomKey:info:outputByteCount:)

Expands cryptographically strong key material into a derived symmetric
key.

```
static func expand<PRK, Info>(pseudoRandomKey prk: PRK, info: Info?, outputByteCount: Int) -> SymmetricKey where PRK : ContiguousBytes, Info : DataProtocol
```

## Parameters

`prk`

A pseudorandom, cryptographically strong key generated from the
`extract(inputKeyMaterial:salt:)` function.

`info`

The shared information to use for key derivation.

`outputByteCount`

The length in bytes of the resulting symmetric key.

## Return Value

The derived symmetric key.

## Discussion

Generate cryptographically strong key material to use with this function
by calling `extract(inputKeyMaterial:salt:)`.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)