Composite ML-KEM: ML-KEM-768/1024 paired with a traditional KEM (RSA-OAEP,
ECDH over the NIST prime curves, or X25519/X448). The Brainpool combinations
of the draft are not implemented (the enum slots are retained so the OIDs
parse, but key generation and encapsulation raise).
The KEM combiner derives the composite shared secret as
ss := SHA3-256(mlkemSS || tradSS || tradCT || tradPK || Label)
with a fixed per-algorithm Label. The traditional component is run as a KEM:
RSA-OAEP transports a freshly generated 32-byte secret (tradSS) as tradCT;
the Diffie-Hellman variants generate an ephemeral key pair, send the public
key as tradCT, and use the raw DH output as tradSS.
Serialization is plain concatenation (draft section 4): public key =
mlkemPK || tradPK, private key = 64-byte mlkemSeed || tradSK, ciphertext =
mlkemCT || tradCT. RSA components use DER RSAPublicKey/RSAPrivateKey, the
ECDH components use the uncompressed X9.62 point and an RFC 5915 ECPrivateKey
(with the [0] curve parameters, without the public key), and X25519/X448 use
the raw RFC 7748 little-endian encodings.
The pool (iDSICK, obtain via GetDSICK) delegates each component to the
corresponding registered pool: GetDSIML, GetDSIIF and GetDSIEC.inherits from tInterfacedObject
implements iCompositeMLKEMPublicKey
property Alg: tCompositeMLKEMAlg read GetAlg;
inherits from tInterfacedObject
implements iCompositeMLKEMPrivateKey
destructor Destroy; override;
property Alg: tCompositeMLKEMAlg read GetAlg;
inherits from TInterfacedObject
implements iDSICK
function OIDToAlg(const aOID: ObjectIdentifier; var aAlg: tCompositeMLKEMAlg) : Boolean;
function AlgToOID(aAlg: tCompositeMLKEMAlg): ObjectIdentifier;
function SSHIdentifierToAlg(const aIdentifier: string; var aAlg : tCompositeMLKEMAlg): Boolean;
function AlgToSSHIdentifier(aAlg: tCompositeMLKEMAlg): string;
procedure KEMKeyGen(aAlg: tCompositeMLKEMAlg; var aPublicKey : iCompositeMLKEMPublicKey; var aPrivateKey: iCompositeMLKEMPrivateKey);
function NewKEMPrivateKey(aAlg: tCompositeMLKEMAlg; const aSerialized: tBytes) : iCompositeMLKEMPrivateKey;
function NewKEMPublicKey(aAlg: tCompositeMLKEMAlg; const aSerialized: tBytes) : iCompositeMLKEMPublicKey;
procedure Encaps(const aPublicKey : iCompositeMLKEMPublicKey; var aSharedSecret: tBytes; var aCiphertext : tBytes);
function Decaps(const aPrivateKey : iCompositeMLKEMPrivateKey; const aCiphertext : tBytes; var aSharedSecret: tBytes) : Boolean;
inherits from Exception
(no public members)