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 H(ss1∥ss2)H(\mathsf{ss}_1 \parallel \mathsf{ss}_2) fails IND-CCA2

Suppose a standalone hybrid KEM defines its ciphertext as c=(c1,c2)c = (c_1, c_2) and its shared secret as K=H(ss1∥ss2)K = H(\mathsf{ss}_1 \parallel \mathsf{ss}_2), omitting c1,c2c_1, c_2 from the hash. Now test the hybrid promise under the exact scenario hybrids exist for — one primitive is broken:

  1. Suppose a future quantum attacker breaks X25519 (recovering the receiver's static scalar xx via Shor's algorithm), while ML-KEM-768 remains completely secure.
  2. The attacker intercepts target hybrid ciphertext c∗=(cM∗,cX∗)c^* = (c_M^*, c_X^*), wants to learn its session key K∗K^*, and has access to a decapsulation oracle that refuses to decrypt c∗c^* itself (the standard IND-CCA2 game, modeling replay caches or session-ID checks).
  3. Because the attacker knows the X25519 secret key xx (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 cX′=gr′≠cX∗c_X' = g^{r'} \neq c_X^*), Wait — changing cX∗→cX′c_X^* \to c_X' changes ssX\mathsf{ss}_X. 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 ssX\mathsf{ss}_X for cX′≠cX∗c_X' \neq c_X^*)? Then (cM∗,cX′)≠c∗(c_M^*, c_X') \neq c^* is a distinct ciphertext that decapsulates to the exact same K∗=H(ssM∗∥ssX∗)K^* = H(\mathsf{ss}_M^* \parallel \mathsf{ss}_X^*)!

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

ConstructionCombiner formulaHow ciphertext & key binding holdsHashing cost
TLS 1.3 (X25519MLKEM768)HKDF-Extract(salt, ss_MLKEM ‖ ss_X25519)TLS handshake transcript hash binds full ClientHello & ServerHello sharesNo 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 unconditionallySafe 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 H(ekM)H(\mathsf{ek}_M) during encapsulation and hashes cMc_M on rejection, making ML-KEM maliciously ciphertext-binding. Therefore, X-Wing only needs to append the 32-byte X25519 ephemeral share ctX\mathsf{ct}_X, the 32-byte X25519 recipient public key pkX\mathsf{pk}_X, and a 6-byte ASCII domain label \./ + /^\ (0x5c2e2f2f5e5c):

ss=SHA3-256⁡ ⁣(ssM⏟32 B∥ssX⏟32 B∥ctX⏟32 B∥pkX⏟32 B∥0x5c2e2f2f5e5c⏟6 B)\mathsf{ss} = \operatorname{SHA3-256}\!\left(\underbrace{\mathsf{ss}_M}_{32\text{ B}} \parallel \underbrace{\mathsf{ss}_X}_{32\text{ B}} \parallel \underbrace{\mathsf{ct}_X}_{32\text{ B}} \parallel \underbrace{\mathsf{pk}_X}_{32\text{ B}} \parallel \underbrace{\texttt{0x5c2e2f2f5e5c}}_{6\text{ B}}\right)

Count the input bytes: 32+32+32+32+6=13432 + 32 + 32 + 32 + 6 = 134 bytes. SHA3-256's sponge rate is 1600/8−2×32=1361600 / 8 - 2 \times 32 = 136 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.