<!--
{
  "availability" : [
    "iOS: 17.0.0 -",
    "iPadOS: 17.0.0 -",
    "macCatalyst: 17.0.0 -",
    "macOS: 14.0.0 -",
    "tvOS: 17.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 10.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CryptoKit",
  "identifier" : "/documentation/CryptoKit/HPKE/KEM",
  "metadataVersion" : "0.1.0",
  "role" : "Enumeration",
  "symbol" : {
    "kind" : "Enumeration",
    "modules" : [
      "Apple CryptoKit",
      "CryptoKit"
    ],
    "preciseIdentifier" : "s:9CryptoKit4HPKEO3KEMO"
  },
  "title" : "HPKE.KEM"
}
-->

# HPKE.KEM

The key encapsulation mechanisms to use in HPKE.

```
enum KEM
```

## Overview

The module-lattice key encapsulation mechanism (ML-KEM) is designed to offer increased security in situations
where an adversary uses a quantum computer.

## Topics

### Post-quantum key encapsulation mechanisms

### Elliptic curve key encapsulation mechanisms

[`case Curve25519_HKDF_SHA256`](/documentation/CryptoKit/HPKE/KEM/Curve25519_HKDF_SHA256)

A key encapsulation mechanism using X25519 elliptic curve key agreement
and SHA-2 hashing with a 256-bit digest.

[`case P256_HKDF_SHA256`](/documentation/CryptoKit/HPKE/KEM/P256_HKDF_SHA256)

A key encapsulation mechanism using NIST P-256 elliptic curve key agreement
and SHA-2 hashing with a 256-bit digest.

[`case P384_HKDF_SHA384`](/documentation/CryptoKit/HPKE/KEM/P384_HKDF_SHA384)

A key encapsulation mechanism using NIST P-384 elliptic curve key agreement
and SHA-2 hashing with a 384-bit digest.

[`case P521_HKDF_SHA512`](/documentation/CryptoKit/HPKE/KEM/P521_HKDF_SHA512)

A key encapsulation mechanism using NIST P-521 elliptic curve key agreement
and SHA-2 hashing with a 512-bit digest.

### Enumeration Cases

[`case XWingMLKEM768X25519`](/documentation/CryptoKit/HPKE/KEM/XWingMLKEM768X25519)

A key encapsulation mechanism using the X-Wing (ML-KEM-768 with X25519) key encapsulation mechanism
and SHA-2 hashing with a 256-bit digest.

## Relationships

### Conforms To

[`Equatable`](/documentation/Swift/Equatable)

[`Hashable`](/documentation/Swift/Hashable)

[`CaseIterable`](/documentation/Swift/CaseIterable)

[`Sendable`](/documentation/Swift/Sendable)

[`SendableMetatype`](/documentation/Swift/SendableMetatype)

---

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)