Class XWingAlgorithm


public final class XWingAlgorithm extends AbstractCryptoAlgorithm
Concrete CryptoAlgorithm for the X-Wing hybrid post-quantum key encapsulation mechanism.

Overview

X-Wing combines X25519 (classical Diffie–Hellman over Curve25519) and ML-KEM-768 (post-quantum lattice-based KEM) into a single hybrid KEM per draft-connolly-cfrg-xwing-kem. It provides security if either component is secure, offering a smooth migration path to post-quantum cryptography.

Implementation

Because BouncyCastle 1.86 has no JCA provider binding for X-Wing, this implementation uses the low-level BC API (pqc.crypto.xwing.*) directly. Key pairs are generated by XWingKeyPairGenerator and wrapped in package-private XWingPublicKey / XWingPrivateKey holders for use within the ZeroEcho context model.

Capabilities

Key generation

X-Wing has no selectable parameters. Use XWingKeyGenSpec.DEFAULT as the key generation spec. The private key is stored as its 32-byte seed; the public key is stored as its raw encoding.

Thread-safety

XWingAlgorithm instances are immutable and safe to share. Created KemContext objects are not thread-safe.

Since:
1.0
  • Constructor Details

    • XWingAlgorithm

      public XWingAlgorithm()
      Creates and wires the X-Wing algorithm with all its capabilities and the key-pair generator.
  • Method Details

    • parameterSets

      public List<ParameterSetDescriptor<? extends AlgorithmKeySpec>> parameterSets()
      Description copied from class: CryptoAlgorithm
      Returns the discoverable parameter sets (or parameterized templates) supported by this algorithm.

      Callers (UIs, provisioning tools, policy engines) use this list to present users with valid, named key-generation options without prior knowledge of the concrete algorithm. Each entry is either a pre-built ParameterSetDescriptor.Concrete (ready spec) or a ParameterSetDescriptor.Template (user-supplied arguments produce the spec).

      The default implementation returns an empty list. Algorithms with finite, enumerable parameter sets should override this method. Overrides must return immutable lists in stable order, with unique nonblank descriptor identifiers. Registry loading validates a snapshot; external providers remain responsible for maintaining the contract on subsequent calls. Implementations may use ParameterSetDescriptor.snapshot(List) to validate and copy their list.

      Overrides:
      parameterSets in class CryptoAlgorithm
      Returns:
      immutable list of parameter set descriptors; never null