Contents · Forum Home · StreamSec Tools 4.1.5.363 documentation

StreamSec.DSI.CompositeKEM

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.

Classes, interfaces and records

classtCompositeMLKEMPublicKey

inherits from tInterfacedObject

implements iCompositeMLKEMPublicKey

property Alg: tCompositeMLKEMAlg read GetAlg;

classtCompositeMLKEMPrivateKey

inherits from tInterfacedObject

implements iCompositeMLKEMPrivateKey

destructor Destroy; override; property Alg: tCompositeMLKEMAlg read GetAlg;

classtDSICK

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;

classeCompositeKemError

inherits from Exception

(no public members)

Types (enumerations, sets, aliases)

enumtCompositeKemTradKind

  tCompositeKemTradKind = (cktRSAOAEP,    // RSA-OAEP key transport promoted to a KEM
                           cktECDH,       // ECDH over a NIST prime (Weierstrass) curve
                           cktXDH);        // X25519 / X448 (Montgomery) key agreement