BLAKE2b per RFC 7693.
Provides:
- tBlake2b: an incremental, optionally keyed BLAKE2b state with arbitrary
digest length 1..64 bytes.
- tBlake2b512Hash: BLAKE2b-512 as a framework tHash (registered under
haBlake2b512 / id_blake2b512), so BLAKE2b can be selected wherever a
tHashClass / tHashAlgorithm is expected. The tHash wrapper is the plain
unkeyed 64-byte-digest hash; RFC 7693 native keyed (MAC) mode remains
available through tBlake2b / Blake2b() below.
- Blake2b(): one-shot convenience function (unkeyed or keyed).
- Blake2bLong(): the Argon2 "H'" variable-length hash construction
(RFC 9106 section 3.2, the H' function used to expand block output).
The core compression function F is shared by Argon2's G permutation, but
Argon2 implements its own block mixing (see StreamSec.DSI.Argon2); the
Blake2bRound primitive is exported here so Argon2 can reuse the same
round permutation over its 1 KiB blocks.
No secret-dependent branching: the round function and compression are
straight-line. The one-shot/keyed paths copy and wipe the key block.inherits from Exception
(no public members)
procedure Init(aOutLen: Integer; const aKey: tBytes);
procedure Update(const aData; aLen: Integer); overload;
procedure Update(const aData: tBytes); overload;
function Final: tBytes;
inherits from tHash
BLAKE2b-512 as a tHash, parallel to the SHAKE fixed-output classes in stSHA3. Wraps the tBlake2b record in unkeyed sequential mode with the full 64-byte digest. The generic keyed-hash machinery of tHash (Key/KeyedHashMethod) and the HMAC routines in stSecUtils pad to BLAKE2b's 128-byte block (tHash.Rate), which is HMAC over BLAKE2b as RFC 2104 defines it. That is not RFC 7693's own keyed BLAKE2b: for that MAC use tBlake2b.Init/Blake2b() with a key.
class function Algorithm: tHashAlgorithm; override;
class function DigestSize: Integer; override;
procedure HashData(const aData; aCount: Int64); override;
procedure GetContext(Context: Pointer); override;
procedure SetUpContext(Context: Pointer); override;
class procedure SelfTest;