Keyboard shortcuts

Press ← or → to navigate between chapters

Press ? to show this help

Press Esc to hide this help

Combine two key establishment schemes with X-Wing

X-Wing is a hybrid KEM that combines ML-KEM-768 with the X25519 elliptic-curve key agreement function. The sender uses the recipient’s combined public key to produce an ML-KEM ciphertext and an ephemeral X25519 public key. Both parties use the combiner defined in the specification to derive the same 32-byte secret from the two shared values and the relevant public keys.

How it works · X-Wing key combination

QuantAegis implements revision 11 of the Internet-Draft. The public key is 1,216 bytes, the private key is 32 bytes, and the ciphertext is 1,120 bytes. When checking interoperability, confirm that the other implementation targets the same revision.

from quantaegis import XWing

ek, dk = XWing.keygen()
ct, shared = XWing.encaps(ek)
assert XWing.decaps(dk, ct) == shared

To encrypt application data, use Envelope.generate_keypair("x-wing") in the encryption tutorial’s key generation step. The SDK’s hybrid_required policy restricts KEMs to X-Wing. Encryption example · Rust API · X-Wing draft-11