# Proof 04 — Dual-Assumption IND-CCA2 Proof for `X25519 + ML-KEM-768` `crypto/kem` combines [NIST FIPS 203 `ML-KEM-768`](https://csrc.nist.gov/pubs/fips/203/final) over $R_q = \mathbb{Z}_{3329}[X]/(X^{256}+1)$ with [RFC 7748 `X25519`](https://www.rfc-editor.org/info/rfc7748/) via the X-Wing-style combiner: $$K = H(\text{DST} \parallel K_{\text{ml}} \parallel K_{\text{x}} \parallel CT_{\text{x}} \parallel PK_{\text{x}})$$ where $H = \text{SHA3-256}$ ([NIST FIPS 202](https://csrc.nist.gov/pubs/fips/202/final)) and $\text{DST} = \text{"xu-hybrid-kem-x25519-mlkem768-v1"}$. ## 1. Why Ciphertext Context Binding Matters In a naive XOR combiner $K = K_{\text{ml}} \oplus K_{\text{x}}$, if `ML-KEM-768` were broken while `X25519` remained secure, an active CCA2 adversary could mutate $CT_{\text{ml}} \to CT'_{\text{ml}}$ on a challenge ciphertext $(CT^*_{\text{ml}}, CT^*_{\text{x}})$, query the decapsulation oracle on $(CT'_{\text{ml}}, CT^*_{\text{x}})$, recover $K'_{\text{ml}} \oplus K^*_{\text{x}}$, compute $K'_{\text{ml}}$ using its break of ML-KEM, and extract $K^*_{\text{x}}$! By hashing $CT_{\text{x}} \parallel PK_{\text{x}}$ directly inside $H$, and relying on FIPS 203's built-in Fujisaki-Okamoto implicit rejection (which already binds $H(EK_{\text{ml}})$ and $CT_{\text{ml}}$ into $K_{\text{ml}}$), any mutation to either half produces a domain-distinct hash input. ## 2. Theorem 4.1 (Hybrid IND-CCA2 Security) **Statement**: Modeling $H = \text{SHA3-256}$ as a random oracle, the hybrid KEM $\Pi_{\text{hyb}}$ is IND-CCA2 secure if **either**: 1. `ML-KEM-768` is IND-CCA2 secure (under Module-LWE / Module-SIS against quantum adversaries), **or** 2. `X25519` satisfies the Gap-CDH assumption ($H$ acts as the strong DH oracle) **and** `ML-KEM-768` retains Ciphertext Second-Preimage Resistance (C2PRI) so distinct ciphertexts $CT_{\text{ml}} \ne CT^*_{\text{ml}}$ do not share identical shared secrets except with negligible decryption-failure / FO hash collision probability $\delta_{\text{ML-KEM-768}} \approx 2^{-164}$. Specifically, for any adversary $\mathcal{A}$ making $q_D$ decapsulation queries and $q_H$ random oracle queries: $$\text{Adv}^{\text{ind-cca2}}_{\Pi_{\text{hyb}}}(\mathcal{A}) \le \min\left( \text{Adv}^{\text{ind-cca2}}_{\text{ML-KEM-768}}(\mathcal{B}_1) + \frac{q_H + q_D}{2^{256}},\; \text{Adv}^{\text{gap-cdh}}_{\text{X25519}}(\mathcal{B}_2) + q_D \cdot \delta_{\text{ML-KEM-768}} + \frac{q_H}{2^{256}} \right).$$ ## 3. Proof of Both Branches ### Branch A: `ML-KEM-768` Holds (Classical `X25519` Broken by CRQC) Reduction $\mathcal{B}_1$ receives challenge $(EK_{\text{ml}}, CT^*_{\text{ml}}, K^*_{\text{ml}, b})$, generates its own `X25519` keypair $(sk_{\text{x}}, PK_{\text{x}})$ and challenge $(CT^*_{\text{x}}, K^*_{\text{x}})$, and forwards $(EK_{\text{ml}} \parallel PK_{\text{x}}, CT^*_{\text{ml}} \parallel CT^*_{\text{x}})$ with challenge key $K^*_0 = H(\text{DST} \parallel K^*_{\text{ml}, b} \parallel K^*_{\text{x}} \parallel CT^*_{\text{x}} \parallel PK_{\text{x}})$ (when $b=0$, real; when $b=1$, $K^*_{\text{ml},1}$ is uniform and independent of $CT^*_{\text{ml}}$, so $K^*_0$ is uniform unless $\mathcal{A}$ queries $K^*_{\text{ml},1}$ to $H$). For any decapsulation query $(CT_{\text{ml}}, CT_{\text{x}}) \ne (CT^*_{\text{ml}}, CT^*_{\text{x}})$: - If $CT_{\text{ml}} \ne CT^*_{\text{ml}}$, $\mathcal{B}_1$ queries the `ML-KEM-768` decapsulation oracle on $CT_{\text{ml}}$, computes $K_{\text{x}} = \text{X25519}(sk_{\text{x}}, CT_{\text{x}})$ using its own $sk_{\text{x}}$, and returns $H(\dots)$. - If $CT_{\text{ml}} = CT^*_{\text{ml}}$, then necessarily $CT_{\text{x}} \ne CT^*_{\text{x}}$! Because $CT_{\text{x}}$ is hashed explicitly inside $H(\text{DST} \parallel \dots \parallel CT_{\text{x}} \parallel PK_{\text{x}})$, $\mathcal{B}_1$ maintains a consistent random oracle table keyed on $(CT_{\text{ml}}, K_{\text{x}}, CT_{\text{x}}, PK_{\text{x}})$ without ever needing $K^*_{\text{ml}, 0}$, returning a fresh consistent output unrelated to the challenge key (up to `SHA3-256` random-oracle collision probability $(q_H + q_D)/2^{256}$). ### Branch B: `X25519` Gap-CDH + `ML-KEM-768` C2PRI Hold (`ML-KEM-768` IND-CCA2 Broken) Reduction $\mathcal{B}_2$ embeds Gap-CDH challenge $(U = [a]G, V = [b]G)$ as $PK_{\text{x}} = U$ and $CT^*_{\text{x}} = V$, while generating its own honest `ML-KEM-768` keypair $(dk_{\text{ml}}, EK_{\text{ml}})$. Using the Gap-DH decision oracle $\text{DDH}(U, CT_{\text{x}}, Z)$ across $\mathcal{A}$'s random oracle queries $(\dots, K_{\text{x}}, CT_{\text{x}}, U)$, $\mathcal{B}_2$ consistently answers all decapsulation queries $(CT_{\text{ml}}, CT_{\text{x}})$: if $CT_{\text{x}} = CT^*_{\text{x}}$, then $CT_{\text{ml}} \ne CT^*_{\text{ml}}$, and FIPS 203 deterministic re-encryption / implicit rejection guarantees $K_{\text{ml}} \ne K^*_{\text{ml}}$ under ML-KEM-768 C2PRI (up to $\delta_{\text{ML-KEM-768}} \approx 2^{-164}$ per query). Any random-oracle query on $K^*_{\text{x}} = \text{CDH}(U, V)$ solves Gap-CDH directly. $\square$