inherits from iCompoundMode
Marker interface (no members of its own) so consumers can recognise the ChaCha20-Poly1305 compound mode without mistaking it for GCM.
(no public members)
inherits from tCipherMAC
implements iCompoundMode, iChaCha20Poly1305Parameters
iCompoundMode is listed explicitly (in addition to the marker descendant) so that `instance as iCompoundMode` succeeds: in Delphi, implementing a derived interface does NOT register the ancestor's GUID for QueryInterface.
constructor CreateClone(aCipher: tCipher); override;
class function BlockSize: Integer; override;
class function Mode: tCipherMode; override;
class function Algorithm: tCipherAlg; override;
class function AlgorithmName: string; override;
class function IVLength: Integer; override;
class function MaxKeySize: Integer; override;
class function MinKeySize: Integer; override;
function Decrypt(var aBuf; var aCount: Integer): Boolean; override;
function DecryptToBuf(const aSrc; aSrcCount: Integer; var aDst; var aDstCount: Integer) : Boolean; override;
function Encrypt(var aBuf; var aCount: Integer): Boolean; override;
function EncryptToBuf(const aSrc; aSrcCount: Integer; var aDst; var aDstCount: Integer) : Boolean; override;
function EncryptToNil(const aBuf; aCount: Integer): Boolean; override;
procedure GetFinalBuf(var aMac; aCount: Integer); override;
procedure GetVectorBuf(var aIV; aCount: Integer); override;
procedure SetUp(const aKey; aCount: Integer); override;
function SetVectorBuf(const aIV; aCount: Integer): Boolean; override;
class procedure Test;
property Mac;
inherits from tChaCha20Poly1305
implements iSSHParameters, iSetPadding
chacha20-poly1305@openssh.com (OpenSSH PROTOCOL.chacha20poly1305). A 512-bit key = K_2 (first 32 bytes, payload + Poly1305) || K_1 (second 32 bytes, the length field). Per packet the nonce is the SSH sequence number (8-byte BE); the 4-byte packet_length is ChaCha20(K_1) encrypted, the payload is ChaCha20(K_2, counter>=1) encrypted, and a raw Poly1305 (key = ChaCha20(K_2, counter 0)[0..31]) authenticates enc_length || enc_payload. Self-framing stream cipher: implements iSSHParameters directly (no block padding) and iSetPadding as a no-op so the transport's padding casts are harmless.
class function MaxKeySize: Integer; override;
class function MinKeySize: Integer; override;
class function IVLength: Integer; override;
class function Mode: tCipherMode; override;
procedure SetUp(const aKey; aCount: Integer); override;
function EncryptStr(const aBuf: OctetString): OctetString; override;
function DecryptToBuf(const aSrc; aSrcCount: Integer; var aDst; var aDstCount: Integer): Boolean; override;
function InternalVerifyFinalBuf(const aSrc; aSrcCount: Integer; var aDst; var aDstCount: Integer): Boolean; override;
function GetMessageCounter: Int64;
procedure SetMessageCounter(Value: Int64);
function GetMACLength: Integer;
procedure SetMACLength(Value: Integer);
function GetMessageLength: Int64;
procedure SetMessageLength(Value: Int64);
function GetHashAlgorithm: tHashAlgorithm;
procedure SetHashAlgorithm(Value: tHashAlgorithm);
function GetHashClass: tHashClass;
procedure SetHashClass(Value: tHashClass);
function GetHMACKey: iSecretKey;
procedure SetHMACKey(const Value: iSecretKey);
function GetPRNG: iRawRandom;
procedure SetPRNG(const Value: iRawRandom);
function GetRemainingCipherTextInputLength: Integer;
procedure Initialize;
procedure RemovePadding(aPadding: tBlockPadding);
procedure SetPadding(aPadding: tBlockPadding);
function GetPaddingMode: tBlockPaddingMode;
procedure SetPaddingMode(const Value: tBlockPaddingMode);