Keyboard shortcuts

Press ← or → to navigate between chapters

Press ? to show this help

Press Esc to hide this help

How does X-Wing combine two key establishment schemes?

The recipient shares one public key and the sender sends back one ciphertext. X-Wing keeps that interface while pairing established elliptic-curve key agreement with lattice-based key establishment designed to resist quantum attacks. The goal is to protect the shared secret with two different computations so that it can remain secure if the security assumptions for one component fail. X-Wing draft-11

AliceSender BobRecipient
  1. Bob — Generate and keep a private seed.
  2. Bob — Derive both key pairs from the seed using SHAKE256. For X25519, b is the private scalar and bG is the public key.
  3. From Bob to Alice — Send the public key (1,216 bytes)
    ML-KEM-768 key || X25519 public key bG
  4. Alice — Split the received public key into its two components.
  5. Alice — Encapsulate with Bob’s ML-KEM-768 key to produce a ciphertext and shared value M.
  6. Alice — Generate an ephemeral X25519 key pair with private scalar a and public key aG.
  7. Alice — Compute shared value X with X25519(a, bG).
  8. Alice — Derive the shared secret with SHA3-256(M || X || aG || bG || XWingLabel). XWingLabel is a fixed public byte string.
  9. From Alice to Bob — Send the X-Wing ciphertext (1,120 bytes)
    ML-KEM ciphertext || ephemeral public key aG
  10. Bob — Expand the private seed again to recover both key pairs.
  11. Bob — Split the ciphertext into the ML-KEM ciphertext and aG.
  12. Bob — Decapsulate with the ML-KEM-768 private key. The output M′ is the fallback on implicit rejection.
  13. Bob — Compute shared value X with X25519(b, aG).
  14. Bob — Decapsulation returns only SHA3-256(M′ || X || aG || bG || XWingLabel). The ML-KEM comparison result stays private.
  15. With an unaltered ciphertext and the corresponding key, Alice and Bob obtain the same 32-byte shared secret.

What does each party send?

ML-KEM-768X25519
What the recipient publishesEncapsulation keyRecipient’s elliptic-curve public key
What the sender sends backML-KEM ciphertextEphemeral elliptic-curve public key
What the recipient computesOutput M′ by decapsulating with the private keyShared value X from the recipient’s private scalar and the sender’s public key

The first 1,088 bytes and the last 32 bytes of the 1,120-byte X-Wing ciphertext serve different purposes. The recipient decapsulates the first part with ML-KEM and passes its output M′ to the combiner, including the fallback if ML-KEM implicitly rejects. The second part encodes the public key used as input to the scalar multiplication below. How ML-KEM works

Why do both sides compute the same X25519 value?

Start with a fixed point G on the curve. Repeatedly adding that point to itself is called scalar multiplication. If the recipient’s private scalar is b, the public key is bG. If the sender’s ephemeral private scalar is a, the ephemeral public key is aG. The sender computes a(bG) and the recipient computes b(aG). Both routes reach the same point, and both parties derive the same X from its coordinate. The secrecy of this component relies on the difficulty of recovering a private scalar from the corresponding public point. X25519 uses the u-coordinate on Curve25519 for this calculation. RFC 7748 §6.1

What determines the final 32 bytes?

Both parties compute SHA3-256(ML-KEM output || X || ephemeral public key || recipient's curve public key || XWingLabel). The || operator concatenates the byte strings in order from left to right. The hash binds both component outputs to the selected curve public keys and to X-Wing through its dedicated label. The shared secret returned by XWing.encaps and XWing.decaps is the output of this hash. The input order and label follow draft-11. X-Wing API example · Combiner specification