kem
The key encapsulation mechanism (KEM) for encapsulating the symmetric key.
- iOS
- 13+
- macOS
- 10.15+
- tvOS
- 13+
- watchOS
- 6+
let kem: HPKE.KEM
The key encapsulation mechanism (KEM) for encapsulating the symmetric key.
let kem: HPKE.KEM
import Crypto
A cryptography library for Swift.
struct Ciphersuite
Cipher suites to use in hybrid public key encryption.
enum HPKE
A container for hybrid public key encryption (HPKE) operations.
enum KEM
The key encapsulation mechanisms to use in HPKE.
init(kem: HPKE.KEM, kdf: HPKE.KDF, aead: HPKE.AEAD)
Creates an HPKE cipher suite.
static let Curve25519_SHA256_ChachaPoly: HPKE.Ciphersuite
A cipher suite for HPKE that uses X25519 elliptic curve key agreement, SHA-2 key derivation with a 256-bit digest, and the ChaCha20 stream cipher with the Poly1305 message authentication code.
static let P256_SHA256_AES_GCM_256: HPKE.Ciphersuite
A cipher suite for HPKE that uses NIST P-256 elliptic curve key agreement, SHA-2 key derivation with a 256-bit digest, and the Advanced Encryption Standard cipher in Galois/Counter Mode with a key length of 256 bits.
static let P384_SHA384_AES_GCM_256: HPKE.Ciphersuite
A cipher suite that you use for HPKE using NIST P-384 elliptic curve key agreement, SHA-2 key derivation with a 384-bit digest, and the Advanced Encryption Standard cipher in Galois/Counter Mode with a key length of 256 bits.
static let P521_SHA512_AES_GCM_256: HPKE.Ciphersuite
A cipher suite for HPKE that uses NIST P-521 elliptic curve key agreement, SHA-2 key derivation with a 512-bit digest, and the Advanced Encryption Standard cipher in Galois/Counter Mode with a key length of 256 bits.
let aead: HPKE.AEAD
The authenticated encryption with additional data (AEAD) algorithm for encrypting and decrypting messages.
let kdf: HPKE.KDF
The key derivation function (KDF) for deriving the symmetric key.