X-Wing
Hybrid KEM combining ML-KEM-768 and X25519.
from oxcrypto.kem.x_wing import X_WING
private_key = X_WING.X_WING.generate()
ciphertext, shared_secret = private_key.public_key().encapsulate()
assert private_key.decapsulate(ciphertext) == shared_secret| Variant | Private key | Public key | Ciphertext | Shared secret |
|---|---|---|---|---|
X_WING | 32 bytes | 1216 bytes | 1120 bytes | 32 bytes |
Private keys serialize as the 32-byte seed. Decapsulation raises ValueError
when the X25519 share is non-contributory (the X25519 output is all zeros);
this uses the upstream DecapsulationKeyRejectNonContrib type.
Warning
Experimental. X-Wing is specified by draft-connolly-cfrg-xwing-kem, an Internet-Draft that may still change.
- Crate: RustCrypto
x-wing0.1.1, stable release, no published audit. Builds with Rust 1.88. - Vectors: draft-connolly-cfrg-xwing-kem Appendix C, as shipped in the crate's
tests/test-vectors.json.
Zeroization
Retained state: the 32-byte seed and the expanded ML-KEM-768 decapsulation key
and X25519 secret. With the zeroize feature, x-wing wipes the seed and the
inner ML-KEM key on drop, and x25519-dalek wipes the X25519 secret.
Short-lived copies not wiped by the upstream crate: the SHAKE256 seed
expansion output and the X25519 shared value and combiner input during
decapsulation. oxcrypto enables shake/zeroize, so the SHAKE sponge state is
wiped on drop.