inherits from eDSIError
Raised by RegisterDSIArith when handed an object that implements none of the recognised provider interfaces, and by the MustGetDSIxx accessors when the unit that implements the requested provider was never linked into the application. The message names the missing provider and the unit that supplies it, because the fix is always to add that unit to a uses clause.
(no public members)
inherits from eDSIError
Invalid sntrup761 key encoding, missing key, or primitive operation error. A correctly sized invalid ciphertext uses implicit rejection instead.
(no public members)
function StorePrivateKey(const aPassword : iSecretKey; const aKey : iUnknown; const aAlgorithm : ObjectIdentifier; const aFriendlyName, aProviderName : UnicodeString; const aLocalKeyID : OctetString; aCompatibility: Boolean = False) : Boolean;
function StoreCertificate(const aPassword : iSecretKey; const aCert : iUnknown; const aFriendlyName: UnicodeString; const aLocalKeyID : OctetString) : Boolean;
function StoreCRL(const aPassword : iSecretKey; const aCRL : iUnknown) : Boolean;
function CopyTo(const aDest : iKeyAndCertStore; const aSrcPwd: iSecretKey; const aDstPwd: iSecretKey) : Boolean;
inherits from iKey
iMPPK is the common base of the PKIX layer's polymorphic key wrapper: a single interface that presents an RSA/DSA/EC/ML-DSA key (of any concrete kind) to the certificate, CMS and TLS code without those callers knowing which algorithm is underneath. tMPPublicKey (StreamSec.DSI.PkixCert) and tAbstractMPPrivateKey (in this unit) implement it. The same wrapper type is used on both peers of a protocol; nothing here is client- or server-specific.
function GetData: iUnknown;
procedure SetData(const Value: iUnknown);
function GetPKI: OctetString;
function GetPKI2: OctetString;
function GetSignatureDigestAlg: tHashAlgorithm;
function GetSignatureLength: Integer;
procedure SetSignatureDigestAlg(const Value: tHashAlgorithm);
property PublicKeyIdentifier: OctetString read GetPKI;
property PublicKeyIdentifier2: OctetString read GetPKI2;
property SignatureDigestAlg: tHashAlgorithm read GetSignatureDigestAlg write SetSignatureDigestAlg;
property SignatureLength: Integer read GetSignatureLength;
property Data: iUnknown read GetData write SetData;
inherits from iMPPK
function EncryptKeyTransport(const aKey : tBytes; aKeyOffset, aKeyLen : Integer; var aEMsg : tBytes; aMsgOffset, aMsgLen : Integer) : Boolean; overload;
function EncryptKeyTransport(const aKey : tBytes; aKeyOffset, aKeyLen : Integer; var aEMsg : tBytes) : Boolean; overload;
function VerBuf(const aMsg : tBytes; aMsgOffset, aMsgLen : Integer; const aSign : tBytes; aSignOffset, aSignLen : Integer) : Boolean;
function VerDig(const aDigest : tBytes; aDigestOffset, aDigestLen : Integer; const aSign : tBytes; aSignOffset, aSignLen : Integer) : Boolean;
function GetData: iUnknown;
procedure SetData(const Value: iUnknown);
function GetSignatureDigestAlg: tHashAlgorithm;
procedure SetSignatureDigestAlg(const Value: tHashAlgorithm);
function VerBuf(const aMsg : tBytes; aMsgOffset, aMsgLen : Integer; const aSign : tBytes; aSignOffset, aSignLen : Integer) : Boolean;
function VerDig(const aDigest : tBytes; aDigestOffset, aDigestLen : Integer; const aSign : tBytes; aSignOffset, aSignLen : Integer) : Boolean;
property SignatureDigestAlg: tHashAlgorithm read GetSignatureDigestAlg write SetSignatureDigestAlg;
property Data: iUnknown read GetData write SetData;
function GetData: iUnknown;
procedure SetData(const Value: iUnknown);
function GetSignatureDigestAlg: tHashAlgorithm;
procedure SetSignatureDigestAlg(const Value: tHashAlgorithm);
property SignatureDigestAlg: tHashAlgorithm read GetSignatureDigestAlg write SetSignatureDigestAlg;
property Data: iUnknown read GetData write SetData;
inherits from iSignKey
function GetDEREncode: Boolean;
procedure SetDEREncode(Value: Boolean);
property DEREncode: Boolean read GetDEREncode write SetDEREncode;
inherits from iSignPublicKey
function GetDEREncode: Boolean;
procedure SetDEREncode(Value: Boolean);
property DEREncode: Boolean read GetDEREncode write SetDEREncode;
inherits from iSignPublicKey
function GetMGFHashAlg: tHashAlgorithm;
function GetSaltLen: Cardinal;
function GetSignEncoding: tSignEncoding;
procedure SetMGFHashAlg(Value: tHashAlgorithm);
procedure SetSaltLen(Value: Cardinal);
procedure SetSignEncoding(Value: tSignEncoding);
function GetEncryptEncoding: tEncryptEncoding;
procedure SetEncryptEncoding(Value: tEncryptEncoding);
property MGFHashAlg: tHashAlgorithm read GetMGFHashAlg write SetMGFHashAlg;
property SaltLen: Cardinal read GetSaltLen write SetSaltLen;
property SignEncoding: tSignEncoding read GetSignEncoding write SetSignEncoding;
property EncryptEncoding: tEncryptEncoding read GetEncryptEncoding write SetEncryptEncoding;
inherits from iSignKey
function GetMGFHashAlg: tHashAlgorithm;
procedure SetMGFHashAlg(Value: tHashAlgorithm);
function GetSaltLen: Cardinal;
procedure SetSaltLen(Value: Cardinal);
function GetSignEncoding: tSignEncoding;
procedure SetSignEncoding(Value: tSignEncoding);
function GetEncryptEncoding: tEncryptEncoding;
procedure SetEncryptEncoding(Value: tEncryptEncoding);
property MGFHashAlg: tHashAlgorithm read GetMGFHashAlg write SetMGFHashAlg;
property SaltLen: Cardinal read GetSaltLen write SetSaltLen;
property SignEncoding: tSignEncoding read GetSignEncoding write SetSignEncoding;
property EncryptEncoding: tEncryptEncoding read GetEncryptEncoding write SetEncryptEncoding;
function GetData: iUnknown;
procedure SetData(const Value: iUnknown);
function GetSignatureDigestAlg: tHashAlgorithm;
procedure SetSignatureDigestAlg(const Value: tHashAlgorithm);
function SignBuf(const aMsg : tBytes; aMOffset: Integer; aMLen : Integer; var aSign : tBytes; aSOffset: Integer; aSLen : Integer) : Integer; overload;
function SignDig(const aDigest : tBytes; aDOffset: Integer; aDLen : Integer; var aSign : tBytes; aSOffset: Integer; aSLen : Integer; aHashAlg: tHashAlgorithm = haDefault) : Integer; overload;
function SignBuf(const aMsg : tBytes; aMOffset: Integer; aMLen : Integer; var aSign : tBytes) : Integer; overload;
function SignDig(const aDigest : tBytes; aDOffset: Integer; aDLen : Integer; var aSign : tBytes; aHashAlg: tHashAlgorithm = haDefault) : Integer; overload;
function Validate(const aPublicKey: iUnknown): Boolean;
procedure SetAttributes(const aPublicKey: iUnknown);
property SignatureDigestAlg: tHashAlgorithm read GetSignatureDigestAlg write SetSignatureDigestAlg;
property Data: iUnknown read GetData write SetData;
inherits from iSignPrivateKey
function GetDEREncode: Boolean;
procedure SetDEREncode(Value: Boolean);
property DEREncode: Boolean read GetDEREncode write SetDEREncode;
inherits from iSignPrivateKey
function GetMGFHashAlg: tHashAlgorithm;
function GetSaltLen: Cardinal;
function GetSignEncoding: tSignEncoding;
procedure SetMGFHashAlg(Value: tHashAlgorithm);
procedure SetSaltLen(Value: Cardinal);
procedure SetSignEncoding(Value: tSignEncoding);
property MGFHashAlg: tHashAlgorithm read GetMGFHashAlg write SetMGFHashAlg;
property SaltLen: Cardinal read GetSaltLen write SetSaltLen;
property SignEncoding: tSignEncoding read GetSignEncoding write SetSignEncoding;
function AlgorithmIdentifier: ObjectIdentifier;
function PublicKeyIdentifier: OctetString;
inherits from iGroup
iDiscreteLogField describes the public DOMAIN PARAMETERS shared by every party in a discrete-log scheme: the finite-field DSA/DH parameters (implemented by tFFSystemParams) OR an elliptic curve for ECDSA/ECDH/EdDSA (implemented by tCustomECurve and its Montgomery/Edwards subclasses). Applications rarely build one by hand; you obtain it from a named curve/group registry or from a decoded key (iDLKey.Params), then hand it to iDSIDLArith to make keys, sign, verify, or do key agreement. The same parameter object is used identically on both the client and server side of a protocol -- both peers must agree on it.
function GetGroupOrder: iDSInteger;
function GetCoFactor: iDSInteger;
function GetGenerator: iGroupElement;
procedure SetGroupOrder(const Value: iDSInteger);
procedure SetCoFactor(const Value: iDSInteger);
procedure SetGenerator(const Value: iGroupElement);
procedure Assign(const aSrc: iDiscreteLogField);
function Compare(const aParams: iDiscreteLogField): Boolean;
function Validate: Boolean;
function ScalarFixBitLength: Integer;
function FieldElementToBytes(const aElement: iGroupElement) : tBytes; overload;
function FieldElementToBytes(const aElement : iGroupElement; const aDst : tBytes; aDstOffset: Integer; var aDstCount : Integer) : Boolean; overload;
function BytesToFieldElement(const aSrc : tBytes) : iGroupElement; overload;
function BytesToFieldElement(const aSrc : tBytes; aSrcOffset, aSrcCount : Integer) : iGroupElement; overload;
function IsNonTrivialFieldElement(const aElement: iGroupElement) : Boolean;
function IsGroupElement(const aElement: iGroupElement) : Boolean;
property GroupOrder: iDSInteger read GetGroupOrder write SetGroupOrder;
property CoFactor: iDSInteger read GetCoFactor write SetCoFactor;
property Generator: iGroupElement read GetGenerator write SetGenerator;
Finite-field domain parameters shared by DSA/DH providers, group tables and key-format implementations. Obtain them from iDLKey.Params.
function GetP: iDSInteger;
function GetQ: iDSInteger;
function GetG: iDSInteger;
function GetJ: iDSInteger;
function GetDomainParameterSeed: iDSInteger;
procedure SetP(const Value: iDSInteger);
procedure SetQ(const Value: iDSInteger);
procedure SetG(const Value: iDSInteger);
procedure SetJ(const Value: iDSInteger);
procedure SetDomainParameterSeed(const Value: iDSInteger);
procedure Assign(const aSrc: iFFSystemParams);
function Clone: iFFSystemParams;
function Compare(const aParams: iFFSystemParams): Boolean;
procedure Generate(aBitSize: Cardinal; aQBitSize: Cardinal);
function Validate: Boolean;
property P: iDSInteger read GetP write SetP;
property Q: iDSInteger read GetQ write SetQ;
property G: iDSInteger read GetG write SetG;
property J: iDSInteger read GetJ write SetJ;
property DomainParameterSeed: iDSInteger read GetDomainParameterSeed write SetDomainParameterSeed;
(no public members)
iDLKey is the common base of a discrete-log key pair (iDLPublicKey / iDLPrivateKey): the pieces shared by both halves -- the domain parameters the key lives in, the arithmetic engine that operates on it, and which signature scheme it is used with. Applications usually obtain a concrete key from a curve registry, a decoded certificate/key, or iDSIDLArith.NewPrivateKey/NewPublicKey rather than implementing this interface themselves. The same key type is used on both peers of a protocol; nothing here is client- or server-specific.
function GetParams: iDiscreteLogField;
function GetPool: iDSIDLArith;
function GetSignScheme: tDLSignatureScheme;
procedure SetSignScheme(const Value: tDLSignatureScheme);
property Pool: iDSIDLArith read GetPool;
property SignScheme: tDLSignatureScheme read GetSignScheme write SetSignScheme;
property Params: iDiscreteLogField read GetParams;
inherits from iDLKey
iDLPublicKey is the public half of a discrete-log key pair: it is essentially the public group element W (the point/value the peer publishes) plus the shared iDLKey context. An application holds one to verify signatures from, or send encrypted/agreed keys to, a remote party -- e.g. the public key taken from a peer's certificate. It is symmetric across client and server.
function GetW: iGroupElement;
procedure SetW(const Value: iGroupElement);
function Validate: Boolean;
property W: iGroupElement read GetW write SetW;
Adapter for a discrete-log private key held OUTSIDE this process -- on a PKCS#11 token or an HSM -- reached through iDLPrivateKey.ExternalKey. The counterpart of tExternalIFPrivateKey on the RSA side, and the same contract: every method here is a do-nothing base that a subclass overrides to call its backing store.
Only the SIGNATURE PRIMITIVE is delegated, not the whole signing operation. A device returns the (r,s) pair; the DER or P1363 encoding around it, and the digest truncation in front of it, stay in the library where they already work. That is deliberately narrower than the RSA side, where padding schemes differ enough per device to be worth delegating.
function GetIdentifier: string; virtual;
function GetOrderSize: Integer; virtual;
function SignDigest(const aDigest : tBytes; aOffset, aCount : Integer; aHashAlgorithm: tHashAlgorithm; out aSigR : iDSInteger; out aSigS : iDSInteger): Boolean; virtual;
function Validate(const aPubl: iDLPublicKey): Boolean; virtual;
function GetPublicKey: iGroupElement; virtual;
constructor Create; virtual;
function ImportKey(const aPKIdentifier; aPKILen: Integer): Boolean; virtual;
property Identifier: string read GetIdentifier;
inherits from iDLKey
iDLPrivateKey is the secret half of a discrete-log key pair: the private scalar S plus the shared iDLKey context. An application holds one to sign with, or to complete key agreement / decrypt with, its own identity. It is the local side of a protocol only; you never transmit it. Generate one with NewKeys (or via iDSIDLArith.NewPrivateKey), then derive the matching public key with PublicKey.
function GetExtKey: tExternalDLPrivateKey;
procedure SetExtKey(const aValue: tExternalDLPrivateKey);
function GetS: iDSInteger;
procedure SetS(const Value: iDSInteger);
function NewKeys(const aParams: iDiscreteLogField): iGroupElement; overload;
function PublicKey: iGroupElement; overload;
procedure PublicKey(var aPubl: iDLPublicKey); overload;
function Validate(const aPubl: iDLPublicKey): Boolean;
property S: iDSInteger read GetS write SetS;
property ExternalKey: tExternalDLPrivateKey read GetExtKey write SetExtKey;
inherits from iDLPrivateKey
EdDSA (RFC 8032) keys are seed based and form a key class of their own: these keys can ONLY be used with the dlssaEdDSA scheme, and the dlssaEdDSA scheme ONLY accepts these keys (enforced in StreamSec.DSI.DiscreteLog).
function GetSeed: tBytes;
procedure SetSeed(const aValue: tBytes);
property Seed: tBytes read GetSeed write SetSeed;
inherits from iDLPublicKey
(no public members)
function GetAlgorithmID: iSecretKey;
function GetCounter: UInt32;
function GetIdA: iSecretKey;
function GetIdB: iSecretKey;
function GetMacTag: iSecretKey;
function GetMacTagLen: Integer;
function GetTA: iGroupElement;
function GetTB: iGroupElement;
function GetYA: iGroupElement;
function GetYB: iGroupElement;
procedure SetAlgorithmID(const Value: iSecretKey);
procedure SetCounter(const Value: UInt32);
procedure SetIdA(const Value: iSecretKey);
procedure SetIdB(const Value: iSecretKey);
procedure SetMacTag(const Value: iSecretKey);
procedure SetMacTagLen(const Value: Integer);
procedure SetTA(const Value: iGroupElement);
procedure SetTB(const Value: iGroupElement);
procedure SetYA(const Value: iGroupElement);
procedure SetYB(const Value: iGroupElement);
property AlgorithmID: iSecretKey read GetAlgorithmID write SetAlgorithmID;
property Counter: UInt32 read GetCounter write SetCounter;
property IdA: iSecretKey read GetIdA write SetIdA;
property IdB: iSecretKey read GetIdB write SetIdB;
property YA: iGroupElement read GetYA write SetYA;
property YB: iGroupElement read GetYB write SetYB;
property TA: iGroupElement read GetTA write SetTA;
property TB: iGroupElement read GetTB write SetTB;
property MacTag: iSecretKey read GetMacTag write SetMacTag;
property MacTagLen: Integer read GetMacTagLen write SetMacTagLen;
inherits from iMPPK
iMPPrivateKey is the private half of the polymorphic key wrapper (see iMPPK): it adds the private-key operations -- signing, and the decrypt side of RSA key transport and DL/EC key agreement -- behind an algorithm-agnostic face for the certificate, CMS and TLS code. It is the local side of a protocol only and is never transmitted; the concrete implementations are tMPPrivateKeyIF (RSA), tMPPrivateKeyDL (DSA/EC) and tMPPrivateKeyGeneric in this unit.
function Clone: iMPPrivateKey;
function DecryptKeyAgreement(aPublKey: iDLPublicKey; var aSecret : tBytes; aSOffset: Integer; aSLen : Integer) : Boolean; overload;
function DecryptKeyTransport(const aEMsg : tBytes; aEOffset: Integer; aELen : Integer; const aKey : tBytes; aKOffset: Integer; aKLen : Integer) : Boolean;
function GetTLS: Boolean;
procedure SetTLS(const Value: Boolean);
function SignBuf(const aMsg : tBytes; aMOffset: Integer; aMLen : Integer; var aSign : tBytes; aSOffset: Integer; aSLen : Integer) : Integer;
function SignDig(const aDigest : tBytes; aDOffset: Integer; aDLen : Integer; var aSign : tBytes; aSOffset: Integer; aSLen : Integer; aHashAlg: tHashAlgorithm = haDefault) : Integer;
property TLS: Boolean read GetTLS write SetTLS;
inherits from iMPPrivateKey
function GetMGFHashAlgorithm: tHashAlgorithm;
function GetSaltLen: Cardinal;
function GetSignEncoding: tSignEncoding;
function GetEncryptEncoding: tEncryptEncoding;
procedure SetMGFHashAlgorithm(Value: tHashAlgorithm);
procedure SetSaltLen(Value: Cardinal);
procedure SetSignEncoding(Value: tSignEncoding);
procedure SetEncryptEncoding(Value: tEncryptEncoding);
property MGFHashAlgorithm: tHashAlgorithm read GetMGFHashAlgorithm write SetMGFHashAlgorithm;
property SaltLen: Cardinal read GetSaltLen write SetSaltLen;
property SignEncoding: tSignEncoding read GetSignEncoding write SetSignEncoding;
property EncryptEncoding: tEncryptEncoding read GetEncryptEncoding write SetEncryptEncoding;
inherits from iMPPrivateKey
function GetSystemParams: iDiscreteLogField;
function GetCoFactor: Boolean;
function GetDEREncodeSignature: Boolean;
function GetKAHashAlg: tHashAlgorithm;
function GetKDF: tKeyDerivation;
function GetP: iSecretKey;
procedure SetCoFactor(const Value: Boolean);
procedure SetDEREncodeSignature(const Value: Boolean);
procedure SetKAHashAlg(const Value: tHashAlgorithm);
procedure SetKDF(const Value: tKeyDerivation);
procedure SetP(const Value: iSecretKey);
function DLPublicKey(var aPublKey: iDLPublicKey): Boolean;
property SystemParams: iDiscreteLogField read GetSystemParams;
property CoFactor: Boolean read GetCoFactor write SetCoFactor;
property DEREncodeSignature: Boolean read GetDEREncodeSignature write SetDEREncodeSignature;
property KAHashAlg: tHashAlgorithm read GetKAHashAlg write SetKAHashAlg;
property KDF: tKeyDerivation read GetKDF write SetKDF;
property P: iSecretKey read GetP write SetP;
Escape hatch for tMPPrivateKeyDL's iDLPrivateKey wrapping. This unit cannot see iECPrivateKey/iFFPrivateKey (StreamSec.DSI.ECC.pas / .FFC.pas build on top of this unit, so importing them here would be circular), so it cannot expose those interfaces directly. A caller that needs the concrete EC/FF key (e.g. the legacy TLS <= 1.2 ServerKeyExchange signing path, which does see those units) unwraps in a loop via GetInnerDLKey while the result supports iMPDLKeyUnwrap, then QueryInterfaces the final, non-wrapped key for the concrete sub-interface it needs.
function GetInnerDLKey: iDLPrivateKey;
function GetHashAlgorithm: tHashAlgorithm;
function GetKDFParameter: iSecretKey;
function GetKeyDerivation: tKeyDerivation;
function GetSecretKeyLen: Integer;
function GetAlgorithmID: ObjectIdentifier;
procedure SetHashAlgorithm(const Value: tHashAlgorithm);
procedure SetKeyDerivation(const Value: TKeyDerivation);
procedure SetSecretKeyLen(const Value: Integer);
procedure SetKDFParameter(const Value: iSecretKey);
procedure SetAlgorithmID(const Value: ObjectIdentifier);
property HashAlgorithm: tHashAlgorithm read GetHashAlgorithm write SetHashAlgorithm;
property KeyDerivation: tKeyDerivation read GetKeyDerivation write SetKeyDerivation;
property KDFParameter: iSecretKey read GetKDFParameter write SetKDFParameter;
property SecretKeyLen: Integer read GetSecretKeyLen write SetSecretKeyLen;
property AlgorithmID: ObjectIdentifier read GetAlgorithmID write SetAlgorithmID;
inherits from tObjectMapping
implements iKeyExchange
constructor Create;
iDSIDLArith is the arithmetic engine for discrete-log cryptography -- the object behind iDLKey.Pool. It is the low-level primitive layer (implemented by tDSIDLArith and its subclasses tDSIEC for elliptic curves, tDSIFF for finite-field DSA/DH, tDSIED for Edwards/EdDSA in StreamSec.DSI.DiscreteLog) that actually performs key generation, ECDSA/DSA/NR/EdDSA sign & verify, DH/MQV key agreement, the DL/ECIES integrated encryption scheme, and the IEEE-1363/X9.42 key-derivation functions. Applications normally reach these operations through higher-level key/certificate components and rarely call this interface directly; you touch it when you need raw primitive access (e.g. custom key agreement or an IES round-trip). The same engine object is used identically on both peers of a protocol -- which methods a given side calls (sign vs verify, encrypt vs decrypt) is what differs, not the object.
function NewPrivateKey(const aParams : iDiscreteLogField): iDLPrivateKey;
function NewPublicKey(const aParams : iDiscreteLogField): iDLPublicKey;
function FieldElementToBytes(const aElement: iGroupElement; const aParams : iDiscreteLogField) : tBytes; overload;
function FieldElementToBytes(const aElement : iGroupElement; const aParams : iDiscreteLogField; const aDst : tBytes; aDstOffset: Integer; var aDstCount : Integer) : Boolean; overload;
function BytesToFieldElement(const aSrc : tBytes; const aParams: iDiscreteLogField) : iGroupElement; overload;
function BytesToFieldElement(const aSrc : tBytes; aSrcOffset, aSrcCount : Integer; const aParams : iDiscreteLogField) : iGroupElement; overload;
function KeyAgreementScheme_DH1(const aPriv : iDLPrivateKey; const aWPr : iGroupElement; const aP : iSecretKey; aCoFactor : Boolean; aHashAlgorithm: tHashAlgorithm; aKeyDerivation: tKeyDerivation; akLen : Integer; var aK : iSecretKey; const aMacTag1 : iX9_42MacTagParams = nil; const aMacTag2 : iX9_42MacTagParams = nil) : Boolean;
function KeyAgreementScheme_DH2(const aPriv0 : iDLPrivateKey; const aPriv1 : iDLPrivateKey; const aWPr : iGroupElement; const aVPr : iGroupElement; const aP : iSecretKey; aCoFactor0, aCoFactor1 : Boolean; aHashAlgorithm: tHashAlgorithm; aKeyDerivation: tKeyDerivation; akLen : Integer; var aK : iSecretKey;
function KeyAgreementScheme_MQV(const aPriv0 : iDLPrivateKey; const aPriv1 : iDSInteger; const aPubl1 : iGroupElement; const aWPr : iGroupElement; const aVPr : iGroupElement; const aP : iSecretKey; aCoFactor : Boolean; aHashAlgorithm: tHashAlgorithm; aKeyDerivation: TKeyDerivation; akLen : Integer; var aK : iSecretKey;
function EncodingMethodForSignatureWithAppendix1(const aDigest : tBytes; aOffset, aCount : Integer; aHashAlgorithm: tHashAlgorithm; aFBitSize : Cardinal) : iDSInteger;
function DecodingMethodForSignatureWithAppendix1(const aF : iDSInteger; const aDigest : tBytes; aOffset, aCount : Integer; aHashAlgorithm: tHashAlgorithm; aFBitSize : Cardinal) : Boolean;
function SignatureLength(aKey: iDLKey): Integer;
function SSASignatureGeneration(aKey : iDLPrivateKey; const aDigest : tBytes; aOffset, aCount : Integer; aHashAlgorithm: tHashAlgorithm; aNullMsg : Boolean; aDEREncode : Boolean; const aSign : tBytes; aSignOffset, aSignCount : Integer) : Integer; overload;
function SSASignatureGeneration(aKey : iDLPrivateKey; aDigest : pByteArray; aCount : Integer; aHashAlgorithm: tHashAlgorithm; aNullMsg : Boolean; aDEREncode : Boolean; aSign : pByteArray; aSignCount : Integer) : Integer; overload;
function SSASignatureGeneration(aKey : iDLPrivateKey; const aDigest : tBytes; aHashAlgorithm: tHashAlgorithm; aNullMsg : Boolean; aDEREncode : Boolean; var aSign : tBytes) : Integer; overload;
function SSASignatureGeneration(aKey : iDLPrivateKey; aDigest : iSecretKey; aHashAlgorithm: tHashAlgorithm; aNullMsg : Boolean; aDEREncode : Boolean; var aSign : iSecretKey) : Integer; overload;
function SSASignatureGeneration(aKey : iDLPrivateKey; const aMsg : tBytes; aOffset, aCount : Integer; aHashAlgorithm: tHashAlgorithm; aDEREncode : Boolean; const aSign : tBytes; aSignOffset, aSignCount : Integer) : Integer; overload;
function SSASignatureGeneration(aKey : iDLPrivateKey; aMsg : pByteArray; aCount : Integer; aHashAlgorithm: tHashAlgorithm; aDEREncode : Boolean; aSign : pByteArray; aSignCount : Integer) : Integer; overload;
function SSASignatureGeneration(aKey : iDLPrivateKey; const aMsg : tBytes; aHashAlgorithm: tHashAlgorithm; aDEREncode : Boolean; var aSign : tBytes) : Integer; overload;
function SSASignatureVerification(aKey : iDLPublicKey; const aDigest : tBytes; aDOffset, aDCount : Integer; const aSign : tBytes; aSOffset, aSCount : Integer; aDEREncode : Boolean; aHashAlgorithm: tHashAlgorithm; aNullMsg : Boolean) : Boolean; overload;
function SSASignatureVerification(aKey : iDLPublicKey; const aDigest : tBytes; const aSign : tBytes; aDEREncode : Boolean; aHashAlgorithm: tHashAlgorithm; aNullMsg : Boolean) : Boolean; overload;
function SSASignatureVerification(aKey : iDLPublicKey; aDigest : iSecretKey; aSign : iSecretKey; aDEREncode : Boolean; aHashAlgorithm: tHashAlgorithm; aNullMsg : Boolean) : Boolean; overload;
function SSASignatureVerification(aKey : iDLPublicKey; const aMsg : tBytes; aMOffset, aMCount : Integer; const aSign: tBytes; aSOffset, aSCount : Integer; aDEREncode : Boolean; aHashAlgorithm: tHashAlgorithm) : Boolean; overload;
function SSASignatureVerification(aKey : iDLPublicKey; const aMsg : tBytes; const aSign : tBytes; aDEREncode : Boolean; aHashAlgorithm: tHashAlgorithm) : Boolean; overload;
procedure IntegratedEncryption(aKey : iDLPublicKey; const aMsg : tBytes; aMsgOffset, aMsgCount : Integer; const aP1 : tBytes; aP1Offset, aP1Len : Integer; const aP2 : tBytes; aP2Offset, aP2Len : Integer; aHashAlgorithm: tHashAlgorithm;
procedure IntegratedEncryption(aKey : iDLPublicKey; const aMsg : tBytes; aMsgOffset, aMsgCount : Integer; const aP1 : tBytes; aP1Offset, aP1Len : Integer; const aP2 : tBytes; aP2Offset, aP2Len : Integer; aHashAlgorithm: tHashAlgorithm;
function IntegratedDecryption(aKey : iDLPrivateKey; aEphemeralKey : iGroupElement; const aCipherText : tBytes; aCTOffset, aCTCount : Integer; const aMAC : tBytes; aMACOffset, aMACCount : Integer; const aP1 : tBytes; aP1Offset, aP1Len : Integer;
function IntegratedDecryption(aKey : iDLPrivateKey; aEphemeralKey : iGroupElement; const aCipherText : tBytes; aCTOffset, aCTCount : Integer; const aMAC : tBytes; aMACOffset, aMACCount : Integer; const aP1 : tBytes; aP1Offset, aP1Len : Integer;
procedure NewKeys(const aParams: iDiscreteLogField; var aPriv : iDSInteger; var aPubl : iGroupElement); overload;
procedure NewKeys(const aParams: iDiscreteLogField; var aPriv : iDLPrivateKey; var aPubl : iGroupElement); overload;
procedure KDF1(const aZ : tBytes; azOffset, azLen : Integer; const aP : tBytes; apOffset, apLen : Integer; aHashAlgorithm: tHashAlgorithm; const aK : tBytes; akOffset, akLen : Integer); overload;
function KDF1(aZ : iSecretKey; aP : iSecretKey; aHashAlgorithm: tHashAlgorithm; akLen : Integer) : iSecretKey; overload;
procedure KDF2(const aZ : tBytes; azOffset, azLen : Integer; const aP : tBytes; apOffset, apLen : Integer; aHashAlgorithm: tHashAlgorithm; const aK : tBytes; akOffset, akLen : Integer); overload;
function KDF2(const aZ : tBytes; azOffset, azLen : Integer; const aP : tBytes; apOffset, apLen : Integer; aHashAlgorithm: tHashAlgorithm; akLen : Integer) : iSecretKey; overload;
function KDF2(aZ : iSecretKey; aP : iSecretKey; aHashAlgorithm: tHashAlgorithm; akLen : Integer) : iSecretKey; overload;
procedure KDFX9_42ASN1BER(const aZ : tBytes; azOffset, azLen : Integer; const aP : tBytes; apOffset, apLen : Integer; aHashAlgorithm: tHashAlgorithm; const aK : tBytes; akOffset, akLen : Integer); overload;
function KDFX9_42ASN1BER(aZ : iSecretKey; aP : iSecretKey; aHashAlgorithm: tHashAlgorithm; akLen : Integer) : iSecretKey; overload;
procedure KDFX9_42Concatenation(const aZ : tBytes; azOffset, azLen : Integer; const aP : tBytes; apOffset, apLen : Integer; aHashAlgorithm: tHashAlgorithm; const aK : tBytes; akOffset, akLen : Integer); overload;
function KDFX9_42Concatenation(aZ : iSecretKey; aP : iSecretKey; aHashAlgorithm: tHashAlgorithm; akLen : Integer) : iSecretKey; overload;
(no public members)
function Compare(const aSource: iECurve): Boolean;
procedure Assign(const aSource: iDiscreteLogField);
function GetA: iDSInteger;
function GetB: iDSInteger;
function GetQ: iDSInteger;
function GetR: iDSInteger;
function GetK: iDSInteger;
function GetG: iECPoint;
function GetCurveOID: ObjectIdentifier;
procedure ModProc(var aA: iDSInteger; const aM: iDSInteger);
function MulModProc(const aX, aY, aM: iDSInteger): iDSInteger;
function NewPoint: iECPoint;
function NewPointInf: iECPoint;
procedure SetA(const Value: iDSInteger);
procedure SetB(const Value: iDSInteger);
procedure SetQ(const Value: iDSInteger);
procedure SetR(const Value: iDSInteger);
procedure SetK(const Value: iDSInteger);
property A: iDSInteger read GetA write SetA;
property B: iDSInteger read GetB write SetB;
property Q: iDSInteger read GetQ write SetQ;
property R: iDSInteger read GetR write SetR;
property K: iDSInteger read GetK write SetK;
property G: iECPoint read GetG;
property CurveOID: ObjectIdentifier read GetCurveOID;
inherits from iGroupElement
function GetCurve: iECurve;
function GetFE2OSFormat: tECP2OSFormat;
function GetX: iDSInteger;
function GetY: iDSInteger;
function GetZ: iDSInteger;
procedure SetCurve(ACurve: iECurve);
procedure SetFE2OSFormat(const Value: tECP2OSFormat);
procedure SetX(const Value: iDSInteger);
procedure SetY(const Value: iDSInteger);
procedure SetZ(const Value: iDSInteger);
procedure Assign(ASource: IECPoint);
property Curve: iECurve read GetCurve;
property X: iDSInteger read GetX write SetX;
property Y: iDSInteger read GetY write SetY;
property Z: iDSInteger read GetZ write SetZ;
property FE2OSFormat: tECP2OSFormat read GetFE2OSFormat write SetFE2OSFormat;
inherits from iDSIDLArith
function OIDToCurve(const aOID : ObjectIdentifier; var aCurve: iECurve) : Boolean;
inherits from iDSIDLArith
procedure NewKeys(aBitSize : Cardinal; aQBitSize : Cardinal; var aPriv : iDLPrivateKey; var aPubl : iDLPublicKey; aTerminate: tGetTerminate = nil); overload;
inherits from iDSIDLArith
The EdDSA (RFC 8032) pool: creates the seed-based EdDSA keys and carries the EdDSA signature/verification scheme implementation (tDSIEdDSA in StreamSec.DSI.EdDSA). Obtain it via GetDSIED.
function OIDToCurve(const aOID : ObjectIdentifier; var aCurve: iECurve) : Boolean;
(no public members)
iIFKey is the common base of an integer-factorization (RSA/Rabin-Williams) key pair -- the pieces shared by both halves (iIFPublicKey / iIFPrivateKey): the scheme selector plus the public modulus N and public exponent E. Applications usually obtain a concrete key from a decoded certificate/key or from iDSIIF.NewKeys rather than implementing this interface themselves. The same key type is used on both peers of a protocol; nothing here is client- or server-specific.
function GetScheme: tIFScheme;
function GetN: iDSInteger;
function GetE: iDSInteger;
procedure SetScheme(Value: tIFScheme);
procedure SetN(const Value: iDSInteger);
procedure SetE(const Value: iDSInteger);
property Scheme: tIFScheme read GetScheme write SetScheme;
property N: iDSInteger read GetN write SetN;
property E: iDSInteger read GetE write SetE;
(no public members)
inherits from iIFKey
The public half of an integer-factorization (RSA/Rabin-Williams) key pair. Adds only the public-key primitive and a cross-check to iIFKey (Scheme, N, E). Applications normally obtain one from a decoded certificate/key or from iDSIIF.NewKeys rather than implementing it; the same key type is used on both peers of a protocol -- nothing here is client- or server-specific.
function IFEP_RSA(const aF: iDSInteger; aLocal: Boolean = False): iDSInteger;
function Validate(const aPriv: iIFPrivateKey): Boolean;
Abstract adapter for an RSA/Rabin-Williams private key whose secret material lives outside the process (an OS or hardware key store) rather than in an iIFPrivateKey's D/P/Q. When iIFPrivateKey.ReprType is 3 the private-key operations are delegated to an instance of this class held in iIFPrivateKey.ExternalKey. Every method here is a do-nothing base implementation (returns False, -1 or an empty string); a concrete subclass overrides them to call the backing store. The shipped concrete subclass is TCAPIIFPrivateKey (Windows CryptoAPI) in StreamSec.DSI.CAPIExtKey; an application selects it per key ring via TsmPrivateKeyRingComponent.ExternalIFPrivateKeyClass. The same class serves any protocol role; nothing here is client- or server-specific.
function GetIdentifier: string; virtual;
function GetKeySize: Integer; virtual;
function IFPrivateKeyOperation(aI: iDSInteger; var aJ: iDSInteger) : Boolean; virtual;
function SignMsg(const aMsg : tBytes; aOffset, aCount : Integer; aHashAlgorithm : tHashAlgorithm; aMGFHashAlgorithm: tHashAlgorithm; aSaltLen : Cardinal; aEncoding : tSignEncoding; var aSign : tBytes; var aSignCount : Integer) : Boolean; virtual;
function SignDigest(const aDigest : tBytes; aOffset, aCount : Integer; aHashAlgorithm : tHashAlgorithm; aMGFHashAlgorithm: tHashAlgorithm; aSaltLen : Cardinal; aEncoding : tSignEncoding; aNullMsg : Boolean; var aSign : tBytes; var aSignCount : Integer) : Boolean; virtual;
function IFESDecryption(const aEMsg : tBytes; aEOffset, aECount : Integer; const aP : tBytes; aPOffset, aPCount : Integer; aHashAlgorithm : tHashAlgorithm; aMGFHashAlgorithm: tHashAlgorithm; aEncryptEncoding : tEncryptEncoding; var aMsg : tBytes; var aSuccess : Boolean)
function Validate(aPubl: iIFPublicKey): Boolean; virtual;
constructor Create; virtual;
function ImportKey(const aPKIdentifier; aPKILen: Integer): Boolean; virtual;
property Identifier: string read GetIdentifier;
inherits from iIFKey
The private half of an integer-factorization (RSA/Rabin-Williams) key pair. Extends iIFKey (Scheme, N, E) with the secret components and the private-key operation. The key can be held in three representations selected by ReprType: 0 = plain (uses the private exponent D and modulus N directly); 1 or 2 = CRT (uses the primes P, Q and the CRT quantities D1, D2, C for a faster operation); 3 = external (the operation is delegated to an ExternalKey, e.g. a Windows CAPI or other hardware/OS key store, and D/P/Q are not present in process memory). Applications normally obtain an instance from a decoded PKCS#8/PKCS#1 key or from iDSIIF.NewKeys/IFRSAKeys rather than implementing the interface. The same key type is used regardless of protocol role; nothing here is client- or server-specific.
function GetReprType: Byte;
function GetD: iDSInteger;
function GetP: iDSInteger;
function GetQ: iDSInteger;
function GetD1: iDSInteger;
function GetD2: iDSInteger;
function GetC: iDSInteger;
function GetExtKey: tExternalIFPrivateKey;
procedure SetReprType(const aValue: Byte);
procedure SetD(const aValue: iDSInteger);
procedure SetP(const aValue: iDSInteger);
procedure SetQ(const aValue: iDSInteger);
procedure SetD1(const aValue: iDSInteger);
procedure SetD2(const aValue: iDSInteger);
procedure SetC(const aValue: iDSInteger);
procedure SetExtKey(const aValue: tExternalIFPrivateKey);
procedure IFRSAKeys(aBitSize : UInt32; aReprType : Byte; aKind : tIFKeyGenerationKind; var aPubl : iIFPublicKey; aTerminate : tGetTerminate = nil);
procedure IFRSAPublicKey(var aPubl : iIFPublicKey; aCompatibility: Boolean);
procedure IFRWKeys(aBitSize : Cardinal; aReprType : Byte; aStrongPrimes: Boolean; var aPubl : iIFPublicKey);
function IFPrivateKeyOperation(const aI: iDSInteger; aLocal: Boolean = False): iDSInteger;
function Validate(const aPubl: iIFPublicKey): Boolean;
property ReprType: Byte read GetReprType write SetReprType;
property D: iDSInteger read GetD write SetD;
property P: iDSInteger read GetP write SetP;
property Q: iDSInteger read GetQ write SetQ;
property D1: iDSInteger read GetD1 write SetD1;
property D2: iDSInteger read GetD2 write SetD2;
property C: iDSInteger read GetC write SetC;
property ExternalKey: tExternalIFPrivateKey read GetExtKey write SetExtKey;
function GetAllowTrailerField: tTrailerFields;
function GetUseTrailerField: tTrailerFields;
procedure SetAllowTrailerField(Value: tTrailerFields);
procedure SetUseTrailerField(Value: tTrailerFields);
property AllowTrailerField: tTrailerFields read GetAllowTrailerField write SetAllowTrailerField;
property UseTrailerField: tTrailerFields read GetUseTrailerField write SetUseTrailerField;
function NewPrivateKey: iIFPrivateKey;
function NewPrivateKeyFrom(const aSource: iIFPrivateKey): iIFPrivateKey;
function NewPublicKey: iIFPublicKey;
function NewPublicKeyFrom(const aSource: iIFPublicKey): iIFPublicKey;
function GetEncodingRangeEME1(aKeyBits : Cardinal; aHashAlgorithm: tHashAlgorithm; var aMaxBytes : Integer) : Boolean;
function GetEncodingRangeEME_PKCS1_v1_5(aKeyBits : Cardinal; var aMaxBytes: Integer) : Boolean;
procedure RSAKeys(aBitSize : UInt32; aReprType : Byte; aKind : tIFKeyGenerationKind; var aPriv : iIFPrivateKey; var aPubl : iIFPublicKey; aTerminate: tGetTerminate = nil);
procedure RSAPublicKey(const aPriv : iIFPrivateKey; var aPubl : iIFPublicKey; aCompatibility: Boolean = False);
procedure RWKeys(aBitSize : UInt32; aReprType : Byte; aStrongPrimes: Boolean; var aPriv : iIFPrivateKey; var aPubl : iIFPublicKey);
function ValidatePrivateKey(const aPriv: iIFPrivateKey; const aPubl: iIFPublicKey) : Boolean;
function SSASignatureGeneration(const aKey : iIFPrivateKey; const aDigest : tBytes; aOffset, aCount : Integer; aHashAlgorithm : tHashAlgorithm; aMGFHashAlgorithm: tHashAlgorithm; aSaltLen : Cardinal; aEncoding : tSignEncoding; aNullMsg : Boolean; var aSign : tBytes) : Integer; overload;
function SSASignatureGeneration(const aKey : iIFPrivateKey; const aDigest : tBytes; aHashAlgorithm : tHashAlgorithm; aMGFHashAlgorithm: tHashAlgorithm; aSaltLen : Cardinal; aEncoding : tSignEncoding; aNullMsg : Boolean; var aSign : tBytes) : Integer; overload;
function SSASignatureGeneration(const aKey : iIFPrivateKey; const aMsg : tBytes; aOffset, aCount : Integer; aHashAlgorithm : tHashAlgorithm; aMGFHashAlgorithm: tHashAlgorithm; aSaltLen : Cardinal; aEncoding : tSignEncoding; var aSign : tBytes) : Integer; overload;
function SSASignatureGeneration(const aKey : iIFPrivateKey; const aMsg : tBytes; aHashAlgorithm : tHashAlgorithm; aMGFHashAlgorithm: tHashAlgorithm; aSaltLen : Cardinal; aEncoding : tSignEncoding; var aSign : tBytes) : Integer; overload;
function SSASignatureVerification(const aKey : iIFPublicKey; const aDigest : tBytes; aDOffset, aDCount : Integer; const aSign : tBytes; aSOffset, aSCount : Integer; aHashAlgorithm : tHashAlgorithm; aMGFHashAlgorithm: tHashAlgorithm; aSaltLen : Cardinal; aEncoding : tSignEncoding;
function SSASignatureVerification(const aKey : iIFPublicKey; const aDigest : tBytes; const aSign : tBytes; aHashAlgorithm : tHashAlgorithm; aMGFHashAlgorithm: tHashAlgorithm; aSaltLen : Cardinal; aEncoding : tSignEncoding; aNullMsg : Boolean) : Boolean; overload;
function SSASignatureVerification(const aKey : iIFPublicKey; const aMsg : tBytes; aMOffset, aMCount : Integer; const aSign : tBytes; aSOffset, aSCount : Integer; aHashAlgorithm : tHashAlgorithm; aMGFHashAlgorithm: tHashAlgorithm; aSaltLen : Cardinal; aEncoding : tSignEncoding)
function SSASignatureVerification(const aKey : iIFPublicKey; const aMsg : tBytes; const aSign : tBytes; aHashAlgorithm : tHashAlgorithm; aMGFHashAlgorithm: tHashAlgorithm; aSaltLen : Cardinal; aEncoding : tSignEncoding) : Boolean; overload;
procedure Encryption(const aKey : iIFPublicKey; const aMsg : tBytes; aMOffset, aMCount : Integer; const aP : tBytes; aPOffset, aPCount : Integer; aHashAlgorithm : tHashAlgorithm; aMGFHashAlgorithm: tHashAlgorithm; aEncryptEncoding : tEncryptEncoding; var aEMsg : tBytes); overload;
procedure Encryption(const aKey : iIFPublicKey; const aMsg : tBytes; aOffset, aCount : Integer; aHashAlgorithm : tHashAlgorithm; aEncryptEncoding: tEncryptEncoding; var aEMsg : tBytes); overload;
function Decryption(const aKey : iIFPrivateKey; const aEMsg : tBytes; aEOffset, aECount : Integer; const aP : tBytes; aPOffset, aPCount : Integer; aHashAlgorithm : tHashAlgorithm; aMGFHashAlgorithm: tHashAlgorithm; aEncryptEncoding : tEncryptEncoding; var aMsg : tBytes)
function Decryption(const aKey : iIFPrivateKey; const aEMsg : tBytes; aOffset, aCount : Integer; aHashAlgorithm : tHashAlgorithm; aEncryptEncoding: tEncryptEncoding; var aMsg : tBytes) : Boolean; overload;
function Decryption(const aKey : iIFPrivateKey; const aEMsg : tBytes; aOffset, aCount : Integer; aHashAlgorithm : tHashAlgorithm; aEncryptEncoding: tEncryptEncoding; var aMsg : iSecretKey) : Boolean; overload;
function SignatureAlgEMSA3(aHA: tHashAlgorithm): ObjectIdentifier;
function ExtractHashAlgEMSA3(const aOID: ObjectIdentifier; var aHA : tHashAlgorithm) : Boolean;
RSA decryption that takes what RFC 8017 defines and nothing more. The long iDSIIF.Decryption also decrypts an RSAES-OAEP ciphertext whose OAEP hash and MGF1 hash differ and whose seed is masked with MGF1 over the OAEP hash: what releases up to and including 4.1.4.361 encrypted with two different hashes, which no other implementation decrypts. DecryptionRFC8017 refuses such a ciphertext, as OpenSSL does; it is otherwise the same call, with the same arguments and result. CMS key transport (tMPPrivateKeyIF. DecryptKeyTransport) decrypts through it, the message naming both hashes. The pool tDSIIF implements it: ask GetDSIIF for it with Supports.
function DecryptionRFC8017(const aKey : iIFPrivateKey; const aEMsg : tBytes; aEOffset, aECount : Integer; const aP : tBytes; aPOffset, aPCount : Integer; aHashAlgorithm : tHashAlgorithm; aMGFHashAlgorithm: tHashAlgorithm; aEncryptEncoding : tEncryptEncoding; var aMsg : tBytes)
Streamlined NTRU Prime sntrup761 keys. The same interfaces apply in every protocol role; the SSH-specific hybrid framing belongs to the SSH layer. Encodings are the raw primitive encodings, with no invented ASN.1 wrapper or PKIX OID. Each export returns an independent copy owned by the caller.
function GetEncodedKey: tBytes;
function GetEncodedPublicKey: tBytes;
inherits from iSNTRUPKey
(no public members)
inherits from iSNTRUPKey
function PublicKey: iSNTRUPPublicKey;
The sntrup761 provider, implemented by StreamSec.DSI.Sntrup761. Obtain the registered pool with GetDSISNTRUP / MustGetDSISNTRUP. There is only one supported parameter set, so no algorithm selector is needed here.
function NewKEMPrivateKey(const aKey: tBytes): iSNTRUPPrivateKey;
function NewKEMPublicKey(const aKey: tBytes): iSNTRUPPublicKey;
procedure KEMKeyGen(var aPublicKey: iSNTRUPPublicKey; var aPrivateKey: iSNTRUPPrivateKey);
procedure Encaps(const aPublicKey: iSNTRUPPublicKey; var aSharedSecret, aCiphertext: tBytes);
function Decaps(const aPrivateKey: iSNTRUPPrivateKey; const aCiphertext: tBytes; var aSharedSecret: tBytes): Boolean;
function GetPRNG: iRawRandom;
procedure SetPRNG(const Value: iRawRandom);
property PRNG: iRawRandom read GetPRNG write SetPRNG;
The common base of a FIPS 203 ML-KEM (Kyber) key pair, shared by both iMLKEMPublicKey and iMLKEMPrivateKey. Exposes the encapsulation-key material and the key size. Applications obtain a concrete key from a decoded certificate/PKCS#8 or from the ML-KEM pool (iDSIMK / GetDSIML) rather than implementing this interface; the same key type is used regardless of protocol role.
function GetPublicKey: tBytes;
function GetRho: tBytes;
function GetKeySize: tMLKEMSize;
function GetEncodedKey: tBytes;
function GetEncodedPublicKey: tBytes;
inherits from iMLKEMKey
(no public members)
inherits from iMLKEMKey
The private (decapsulation) half of a FIPS 203 ML-KEM key pair. Adds the decapsulation-key components to iMLKEMKey: the K-PKE decryption key, the hash of the encapsulation key, and the implicit-rejection value z. Applications obtain one from a decoded PKCS#8 or from the ML-KEM pool and pass it to KEMDecaps; the same key type is used on both peers.
function GetPrivateKey: tBytes;
function GetPublicKeyHash: tBytes;
function GetImplicitRejectionValue: tBytes;
function GetSeed: iSecretKey;
function GetUseVerboseFormat: Boolean;
function GetKeyCount: Integer;
function GetKeys(aIndex: Integer): iUnknown;
function AddKey(const aKey: iUnknown): Integer;
function AddKeyIntf(const aKey: iUnknown; const aIID: TGUID): Integer;
procedure Delete(aIndex: Integer);
property KeyCount: Integer read GetKeyCount;
property Keys[aIndex: Integer]: iUnknown read GetKeys;
The common base of a FIPS 204 ML-DSA (Dilithium) key pair, shared by both iMLDSAPublicKey and iMLDSAPrivateKey. Exposes the parameter set and the encoded key. Applications obtain a concrete key from a decoded certificate/PKCS#8 or from the ML-DSA pool (GetDSIML) rather than implementing this interface; the same key type is used regardless of protocol role.
function GetKeySize: tMLDSASize;
function GetEncodedKey: tBytes;
(no public members)
inherits from iMLDSAKey
The verification (public) half of a FIPS 204 ML-DSA key pair. Adds only a cross-check against the private key; verification itself is done through the ML-DSA pool. Applications obtain one from a decoded certificate/ SubjectPublicKeyInfo or from iMLDSAPrivateKey.
function Validate(const aPrivateKey: iMLDSAPrivateKey): Boolean;
inherits from iMLDSAKey
The signing (private) half of a FIPS 204 ML-DSA key pair. Adds the encoded public half, the expansion seed, and consistency checks to iMLDSAKey. Applications obtain one from a decoded PKCS#8 or from the ML-DSA pool and pass it to DSASign; the same key type is used on both peers.
function GetEncodedPublicKey: tBytes;
function GetSeed: iSecretKey;
function Validate(const aPublicKey: iMLDSAPublicKey): Boolean;
function CheckConsistency: Boolean;
function GetUseVerboseFormat: Boolean;
A verification (public) key for one Composite ML-DSA algorithm. An app obtains one from iDSICS.NewSigPublicKey (importing a peer's key), from iCompositeMLDSAPrivateKey.PublicKey, or after parsing an X.509 certificate / SubjectPublicKeyInfo, and passes it to iDSICS.SigVerify.
function GetAlg: tCompositeMLDSAAlg;
function GetEncodedKey: tBytes;
property Alg: tCompositeMLDSAAlg read GetAlg;
A signing (private) key for one Composite ML-DSA algorithm. An app obtains one from iDSICS.SigKeyGen (fresh key pair) or iDSICS.NewSigPrivateKey (importing a stored PKCS#8 key), and passes it to iDSICS.SigSign.
function GetAlg: tCompositeMLDSAAlg;
function GetEncodedKey: tBytes;
function GetEncodedPublicKey: tBytes;
function PublicKey: iCompositeMLDSAPublicKey;
property Alg: tCompositeMLDSAAlg read GetAlg;
The Composite ML-DSA pool (tDSICS in StreamSec.DSI.CompositeSig).
function OIDToAlg(const aOID: ObjectIdentifier; var aAlg: tCompositeMLDSAAlg) : Boolean;
function AlgToOID(aAlg: tCompositeMLDSAAlg): ObjectIdentifier;
procedure SigKeyGen(aAlg: tCompositeMLDSAAlg; var aPublicKey : iCompositeMLDSAPublicKey; var aPrivateKey: iCompositeMLDSAPrivateKey);
function NewSigPrivateKey(aAlg: tCompositeMLDSAAlg; const aSerialized: tBytes) : iCompositeMLDSAPrivateKey;
function NewSigPublicKey(aAlg: tCompositeMLDSAAlg; const aSerialized: tBytes) : iCompositeMLDSAPublicKey;
function SigSign(const aPrivateKey: iCompositeMLDSAPrivateKey; const aMsg : tBytes; const aCtx : tBytes {$IFDEF D16UP}= nil{$ENDIF}) : tBytes;
function SigVerify(const aPublicKey: iCompositeMLDSAPublicKey; const aMsg : tBytes; const aCtx : tBytes; const aSignature: tBytes) : Boolean;
An encapsulation (public) key for one Composite ML-KEM algorithm. An app obtains one from iDSICK.NewKEMPublicKey (importing a recipient's key), from iCompositeMLKEMPrivateKey.PublicKey, or after parsing a certificate / SubjectPublicKeyInfo, and passes it to iDSICK.Encaps to wrap a shared secret for that recipient.
function GetAlg: tCompositeMLKEMAlg;
function GetEncodedKey: tBytes;
property Alg: tCompositeMLKEMAlg read GetAlg;
A decapsulation (private) key for one Composite ML-KEM algorithm. An app obtains one from iDSICK.KEMKeyGen (fresh key pair) or iDSICK.NewKEMPrivateKey (importing a stored PKCS#8 key), and passes it to iDSICK.Decaps to recover the shared secret from a received composite ciphertext.
function GetAlg: tCompositeMLKEMAlg;
function GetEncodedKey: tBytes;
function GetEncodedPublicKey: tBytes;
function PublicKey: iCompositeMLKEMPublicKey;
property Alg: tCompositeMLKEMAlg read GetAlg;
The Composite ML-KEM pool (tDSICK in StreamSec.DSI.CompositeKEM).
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;
(no public members)
iSLHDSAKey is the common base of an SLH-DSA (FIPS 205) key pair, shared by the public (iSLHDSAPublicKey) and private (iSLHDSAPrivateKey) halves: it exposes which of the twelve parameter sets the key uses and the FIPS 205 byte encoding. Concrete classes live in StreamSec.DSI.SLHDSA; the same key type is used on both peers.
function GetAlg: tSLHDSAAlg;
function GetEncodedKey: tBytes;
property Alg: tSLHDSAAlg read GetAlg;
inherits from iSLHDSAKey
The public (verification) half of an SLH-DSA key pair. Adds Alg and the FIPS 205 encoding from iSLHDSAKey; obtain one from iDSISLH.NewSigPublicKey / SigKeyGen or from a decoded SubjectPublicKeyInfo, then verify signatures with it.
function Validate(const aPrivateKey: iSLHDSAPrivateKey): Boolean;
inherits from iSLHDSAKey
The private (signing) half of an SLH-DSA key pair. Adds the encoded public half, public-key derivation and pair validation to iSLHDSAKey. Obtain one from iDSISLH.NewSigPrivateKey / SigKeyGen or from a decoded PKCS#8, then sign with iDSISLH.SigSign.
function GetEncodedPublicKey: tBytes;
function PublicKey: iSLHDSAPublicKey;
function Validate(const aPublicKey: iSLHDSAPublicKey): Boolean;
The SLH-DSA pool (tDSISLH in StreamSec.DSI.SLHDSA).
function OIDToAlg(const aOID: ObjectIdentifier; var aAlg: tSLHDSAAlg) : Boolean;
function AlgToOID(aAlg: tSLHDSAAlg): ObjectIdentifier;
procedure SigKeyGen(aAlg: tSLHDSAAlg; var aPublicKey : iSLHDSAPublicKey; var aPrivateKey: iSLHDSAPrivateKey);
function NewSigPrivateKey(aAlg: tSLHDSAAlg; const aSerialized: tBytes) : iSLHDSAPrivateKey;
function NewSigPublicKey(aAlg: tSLHDSAAlg; const aSerialized: tBytes) : iSLHDSAPublicKey;
function SigSign(const aPrivateKey: iSLHDSAPrivateKey; const aMsg : tBytes; const aCtx : tBytes {$IFDEF D16UP}= nil{$ENDIF}; aDeterministic: Boolean = False) : tBytes;
function SigVerify(const aPublicKey: iSLHDSAPublicKey; const aMsg : tBytes; const aCtx : tBytes; const aSignature: tBytes) : Boolean;
function NewKEMPrivateKey(aKeySize: tMLKEMSize; const aKey : tBytes; const aSeed : iSecretKey = nil) : iMLKEMPrivateKey;
function NewKEMPrivateKeyFromSeed(aKeySize: tMLKEMSize; const aSeed : iSecretKey) : iMLKEMPrivateKey;
function NewKEMPublicKey(aKeySize: tMLKEMSize; const aKey : tBytes) : iMLKEMPublicKey;
function NewDSAPrivateKey(aKeySize: tMLDSASize; const aKey : tBytes; const aPublKey: tBytes; const aSeed : iSecretKey = nil) : iMLDSAPrivateKey;
function NewDSAPrivateKeyFromSeed(aKeySize: tMLDSASize; const aSeed : iSecretKey) : iMLDSAPrivateKey;
function NewDSAPublicKey(aKeySize: tMLDSASize; const aKey : tBytes) : iMLDSAPublicKey;
procedure KEMKeyGen(aKeySize : tMLKEMSize; var aPublicKey : iMLKEMPublicKey; var aPrivateKey: iMLKEMPrivateKey; aSaveSeed : Boolean = False);
procedure KEMEncaps(const aPublicKey: iMLKEMPublicKey; var aK : tBytes; var aC : tBytes);
procedure KEMDecaps(const aPrivateKey: iMLKEMPrivateKey; const aC: tBytes; var aK: tBytes);
procedure DSAKeyGen(aKeySize : tMLDSASize; var aPublicKey : iMLDSAPublicKey; var aPrivateKey: iMLDSAPrivateKey; aSaveSeed : Boolean = False);
function DSASign(const aPrivateKey: iMLDSAPrivateKey; const aMsg : tBytes; const aCtx : tBytes) : tBytes;
function DSAVerify(const aPublicKey: iMLDSAPublicKey; const aMsg : tBytes; const aCtx : tBytes; const aSignature: tBytes) : Boolean;
function HashDSASign(const aPrivateKey: iMLDSAPrivateKey; const aMsg : tBytes; const aCtx : tBytes; const aHashAlg : tHashAlgorithm) : tBytes;
function HashDSASignDigest(const aPrivateKey: iMLDSAPrivateKey; const aDigest : tBytes; const aCtx : tBytes; const aHashAlg : tHashAlgorithm) : tBytes;
function HashDSAVerify(const aPublicKey: iMLDSAPublicKey; const aMsg : tBytes; const aCtx : tBytes; const aHashAlg : tHashAlgorithm; const aSignature: tBytes) : Boolean;
function HashDSAVerifyDigest(const aPublicKey: iMLDSAPublicKey; const aDigest : tBytes; const aCtx : tBytes; const aHashAlg : tHashAlgorithm; const aSignature: tBytes) : Boolean;
procedure SetUseVerboseFormat(Value: Boolean);
function GetUseVerboseFormat: Boolean;
property UseVerboseFormat: Boolean read GetUseVerboseFormat write SetUseVerboseFormat;
inherits from TInterfacedObject
implements iMPPK, iMPPrivateKey
constructor Create(const aPublicKey: iMPPublicKey);
tMPIFPrivateKeyIF is a wrapper for iIFPrivateKey. tMPIFPrivateKeyIF implements the iMPPrivateKey interface. The methods and properties of this class defaults to use the properties of the *public* key that is passed to the constructor. Furthermore, the parameters that are used for RSA signing/verification and encryption/decryption are specific to the tMPIFPrivateKeyIF instance and are NOT reflected by the properties of the wrapped iIPPrivateKey instance. This makes makes it thread safe to use instances of this class even if the wrapped iIFPrivateKey is shared by multiple threads.
constructor Create(const aKey : iIFPrivateKey; const aPublicKey: iMPPublicKey);
constructor Create(const aKey : iDLPrivateKey; const aPublicKey: iMPPublicKey);
inherits from tAbstractMPPrivateKey
constructor Create(const aKey : iUnknown; const aPublicKey: iMPPublicKey);
inherits from tOptionallyRefCountedObject
(no public members)
X.509 KeyUsage (RFC 5280 sec. 4.2.1.3). The enum order IS the on-the-wire bit order of the KeyUsage BIT STRING: DigitalSignature is bit 0 (the most significant bit of the first content octet), through DecipherOnly at bit 8. DO NOT reorder or insert members - the ordinal doubles as the DER bit position, and the certificate KeyUsage extension, the PKCS#8 / PKCS#12 key-usage attributes and the TLS / CryptoAPI key-selection code all rely on that correspondence. Declared here (rather than in stPkixExtension, its historical home) so that key-format units such as StreamSec.DSI.Pkcs8 can express a key's permitted usages without importing the full PKIX certificate-extension / GeneralName machinery. stPkixExtension re-exports tKeyUsageEnum / tKeyUsage as aliases, so existing consumers that reference them through that unit are unaffected.
dlssaDSAFixedTime: same wire format as dlssaDSA (ECDSA/DSA), but signed via the fixed-time path (RFC 6979 deterministic nonce + constant-time group operation + Fermat inverse). Added LAST so existing ordinals (serialized as 0..3) are stable.
dlssaEdDSA: EdDSA (RFC 8032) over Ed25519/Ed448. EdDSA signs the MESSAGE (no pre-hash), so it is handled exclusively by the message overloads of SSASignatureGeneration/SSASignatureVerification, and exclusively with the seed-based EdDSA keys (iEdDSAPrivateKey/iEdDSAPublicKey; concrete classes in StreamSec.DSI.EdDSA). The legacy 2-bit kind mask in the deprecated StreamSec.DSI.FFC.PrivateKeyStrSecStorage unit does not constrain this value.
Composite ML-DSA (draft-ietf-lamps-pq-composite-sigs-19): ML-DSA paired with a traditional signature algorithm. The Brainpool combinations are not implemented. The concrete classes live in StreamSec.DSI.CompositeSig; obtain the pool via GetDSICS.
Composite ML-KEM (draft-ietf-lamps-pq-composite-kem-14): ML-KEM-768/1024 paired with a traditional KEM (RSA-OAEP, ECDH over the NIST curves, or X25519/X448). The Brainpool combinations are not implemented (the enum slots are retained so the OIDs parse, but key generation and encapsulation raise). The concrete classes live in StreamSec.DSI.CompositeKEM; obtain the pool via GetDSICK.
SLH-DSA (FIPS 205): stateless hash-based signatures. Twelve parameter sets over two hash families (SHA2 / SHAKE), three security categories (128/192/ 256) and a small (s) / fast (f) trade-off. Pure SLH-DSA only (the HashSLH-DSA pre-hash variants are not implemented). The concrete classes live in StreamSec.DSI.SLHDSA; obtain the pool via GetDSISLH.