Hybrid KEM Combiners: X-Wing, TLS 1.3, and Why Ciphertext Binding Matters
See why naive secret concatenation fails IND-CCA2 when a component is malleable, and how X-Wing hashes X25519 + ML-KEM-768 inside a single Keccak block.
Prerequisite: Hybrid TLS
During the transition to post-quantum cryptography, most protocols deploy a hybrid KEM pairing classical X25519 with ML-KEM-768. The security promise sounds obvious: the final 32-byte shared secret should remain indistinguishable from random as long as at least one of the two component schemes remains unbroken. Yet a careless combiner function can silently lose chosen-ciphertext (IND-CCA2) security even when one component is completely intact.
Why fails IND-CCA2
Suppose a standalone hybrid KEM defines its ciphertext as and its shared secret as , omitting from the hash. Now test the hybrid promise under the exact scenario hybrids exist for — one primitive is broken:
- Suppose a future quantum attacker breaks X25519 (recovering the receiver's static scalar via Shor's algorithm), while ML-KEM-768 remains completely secure.
- The attacker intercepts target hybrid ciphertext , wants to learn its session key , and has access to a decapsulation oracle that refuses to decrypt itself (the standard IND-CCA2 game, modeling replay caches or session-ID checks).
- Because the attacker knows the X25519 secret key (or even simpler: if the classical scheme had a second representation of the same curve point, or the attacker picks a fresh ephemeral X25519 share ), Wait — changing changes . What if instead ML-KEM broke and the surviving component had malleable ciphertext representations (for instance, non-canonical field encodings or cofactor-8 curve points yielding the same for )? Then is a distinct ciphertext that decapsulates to the exact same !
Even worse, without public-key binding in multi-user protocols, an attacker who controls one component can re-wrap a victim's ciphertext share under a different identity (an unknown-key-share / misbinding attack). Binding ciphertext and public key into the combiner closes every ciphertext-malleability path immediately.
How TLS 1.3, X-Wing, and generic combiners solve binding
| Construction | Combiner formula | How ciphertext & key binding holds | Hashing cost |
|---|---|---|---|
| TLS 1.3 (X25519MLKEM768) | HKDF-Extract(salt, ss_MLKEM ‖ ss_X25519) | TLS handshake transcript hash binds full ClientHello & ServerHello shares | No standalone ct hash needed inside combiner |
| X-Wing (CFRG Draft) | SHA3-256(ss_M ‖ ss_X ‖ ct_X ‖ pk_X ‖ label) | ML-KEM binds (ct_M, pk_M) internally; combiner explicitly binds (ct_X, pk_X) | 134 B input fits in 1 Keccak-f[1600] block (136 B rate) |
| Generic Split-KEM (Giacon et al.) | H(ss_1 ‖ ss_2 ‖ ct_1 ‖ ct_2 ‖ pk_1 ‖ pk_2) | Explicitly hashes both ciphertexts and public keys unconditionally | Safe for any black-box KEMs, hashes ~2.4 kB extra |
Notice why TLS 1.3's X25519MLKEM768 gets away with simple concatenation inside HKDF-Extract: TLS 1.3 immediately feeds the entire unencrypted ClientHello and ServerHello (which contain both raw public shares and ciphertexts) into Derive-Secret(..., Hash(Transcript)) before producing handshake or application keys! If you copy TLS's concatenation into a custom WireGuard, messaging, or wallet encryption protocol without a full transcript hash, you lose that protection.
Inside X-Wing: 134 bytes, one Keccak permutation
For standalone hybrid encryption (HPKE, age, SSH, and application envelopes), X-Wing (draft-connolly-cfrg-xwing-kem) pairs ML-KEM-768 with X25519 using a surgical optimization. As shown in ML-KEM Implicit Rejection, FIPS 203 already hashes during encapsulation and hashes on rejection, making ML-KEM maliciously ciphertext-binding. Therefore, X-Wing only needs to append the 32-byte X25519 ephemeral share , the 32-byte X25519 recipient public key , and a 6-byte ASCII domain label \./ + /^\ (0x5c2e2f2f5e5c):
Count the input bytes: bytes. SHA3-256's sponge rate is bytes, leaving exactly 2 bytes for SHA-3's 0x06 ... 0x80 domain-and-pad suffix. The entire combiner executes in one single Keccak-f[1600] permutation while avoiding re-hashing 2,272 bytes of ML-KEM public key and ciphertext!
Verify X-Wing’s 1-block combiner layout in Python
import hashlib
XWING_LABEL = bytes.fromhex("5c2e2f2f5e5c") # ASCII: \.//^\ (6 bytes)
SHA3_256_RATE = 136 # (1600 - 512) // 8 bytes per sponge block
def xwing_combine(ss_mlkem: bytes, ss_x25519: bytes, ct_x25519: bytes, pk_x25519: bytes) -> bytes:
for part in (ss_mlkem, ss_x25519, ct_x25519, pk_x25519):
assert len(part) == 32
transcript = ss_mlkem + ss_x25519 + ct_x25519 + pk_x25519 + XWING_LABEL
assert len(transcript) == 134 and len(transcript) + 2 == SHA3_256_RATE
return hashlib.sha3_256(transcript).digest()
ss_m = bytes(range(32))
ss_x = bytes(range(32, 64))
ct_x = bytes(range(64, 96))
pk_x = bytes(range(96, 128))
k1 = xwing_combine(ss_m, ss_x, ct_x, pk_x)
# Mutating ct_x (even if a hypothetical curve bug left ss_x unchanged) changes the output key:
ct_x_malleated = bytes([ct_x[0] ^ 0x80]) + ct_x[1:]
k2 = xwing_combine(ss_m, ss_x, ct_x_malleated, pk_x)
assert k1 != k2
print("X-Wing label:", XWING_LABEL.decode("ascii"), "| combined secret:", k1.hex()[:24] + "...")Rule of thumb for protocol engineers: If you are using TLS 1.3 or HPKE with X-Wing, use the standard group verbatim. If you are designing a custom hybrid handshake (for a bridge, messaging ratchet, or encrypted mempool), either instantiate X-Wing directly or bind both ciphertexts, both public keys, and an explicit protocol context string into your KDF.