Argon2 per RFC 9106. Implements Argon2id (default), Argon2i and Argon2d. Argon2id uses Argon2i-style (password-independent, data-independent) reference-block addressing for the first half of the first pass over the memory, and Argon2d-style (data-dependent) addressing for the rest. Memory layout: m' = 4*p*floor(m/(4*p)) 1 KiB blocks, arranged as p lanes, each split into 4 vertical slices. The compression function G mixes two 1 KiB blocks using the BLAKE2b round permutation (StreamSec.DSI.Blake2) applied first row-wise then column-wise over the 8x16 matrix of 64-bit words, with the final XOR-into-output (RFC 9106 section 3.4). Multi-lane (p>1) is supported and computed sequentially lane-by-lane within each slice (functionally identical to the parallel definition; no threads). The BLAKE2b core is constant-time (straight-line). The data-dependent addressing in the Argon2d/Argon2id passes is, by design of the algorithm, memory-access-pattern dependent on the password -- that is inherent to Argon2d and not a deviation.
inherits from Exception
(no public members)
inherits from iPBKDF
Argon2 as a framework KDF. Extends iPBKDF the same way iPBKDF extends iKDF: the RFC 9106 inputs that do not fit the DeriveKey(aPassword, aSalt, aIter, aDKLen) signature become properties. The inherited Iter property is the pass count t, so the inherited iPBKDF.DeriveKey overloads work unchanged with Parallelism/MemoryKiB/Secret/AssociatedData/Argon2Type taken from the properties.
function GetArgon2Type: tArgon2Type;
function GetAssociatedData: iSecretKey;
function GetMemoryKiB: Integer;
function GetParallelism: Integer;
function GetSecret: iSecretKey;
procedure SetArgon2Type(const Value: tArgon2Type);
procedure SetAssociatedData(const Value: iSecretKey);
procedure SetMemoryKiB(const Value: Integer);
procedure SetParallelism(const Value: Integer);
procedure SetSecret(const Value: iSecretKey);
function DeriveKey(const aPassword, aSalt, aSecret, aAD: tBytes; aParallelism, aMemoryKiB, aIterations, aTagLen: Integer; aType: tArgon2Type = a2dArgon2id): tBytes; overload;
procedure DeriveKey(aPassword, aSalt, aSecret, aAD: iSecretKey; aParallelism, aMemoryKiB, aIterations, aTagLen: Integer; aType: tArgon2Type = a2dArgon2id); overload;
property Argon2Type: tArgon2Type read GetArgon2Type write SetArgon2Type;
property AssociatedData: iSecretKey read GetAssociatedData write SetAssociatedData;
property MemoryKiB: Integer read GetMemoryKiB write SetMemoryKiB;
property Parallelism: Integer read GetParallelism write SetParallelism;
property Secret: iSecretKey read GetSecret write SetSecret;
inherits from tPBKDF
implements iArgon2
constructor Create(aAlgorithm: ObjectIdentifier);
procedure DeriveKey(aPassword, aSalt: iSecretKey; aIter, aDKLen: Integer); overload; override;
function DeriveKey(const aPassword, aSalt, aSecret, aAD: tBytes; aParallelism, aMemoryKiB, aIterations, aTagLen: Integer; aType: tArgon2Type = a2dArgon2id): tBytes; overload;
procedure DeriveKey(aPassword, aSalt, aSecret, aAD: iSecretKey; aParallelism, aMemoryKiB, aIterations, aTagLen: Integer; aType: tArgon2Type = a2dArgon2id); overload;
property Argon2Type: tArgon2Type read GetArgon2Type write SetArgon2Type;
property AssociatedData: iSecretKey read GetAssociatedData write SetAssociatedData;
property MemoryKiB: Integer read GetMemoryKiB write SetMemoryKiB;
property Parallelism: Integer read GetParallelism write SetParallelism;
property Secret: iSecretKey read GetSecret write SetSecret;