Therefore, this implementation buffers the entire input provided via update calls until finish is called. This may consume significant memory for very large inputs.
ddn.crypto.hash.argon2
Argon2 Password Hashing Scheme (RFC 9106).
Types 3
Argon2 Variant.
Argon2 Digest Wrapper implementing Hash interface.
This class adapts the Argon2 PHS to the generic Hash interface. The input data fed via update is treated as the password. Salt and other parameters must be provided at construction.
Note
private Argon2Type _typeprivate int _versionprivate uint _tprivate ubyte[] _saltprivate ubyte[] _secretprivate ubyte[] _adprivate uint _tagLengthprivate Appender!(ubyte[]) _bufferubyte[] finish()void reset()void wipe() nothrow @nogc @trustedZeroizes all secret inputs retained by this digest (the password buffer, salt, secret, and associated data).this(Argon2Type type, uint t, uint m, uint p, const(ubyte)[] salt, uint tagLength = 32,
const(ubyte)[] secret = null, const(ubyte)[] ad = null, int version_ = 0x13)Data-independent address generator for Argon2i and Argon2id (RFC 9106 Section 3.4.1.2).
For each segment it produces a stream of pseudo-random 64-bit words: counter values i = 1, 2, ... each yield the 1024-byte block G(ZERO, G(ZERO, Z || LE64(i) || ZERO(968))), where Z is LE64(r) || LE64(l) || LE64(sl) || LE64(m') || LE64(t) || LE64(y); the 128 words of each block are consumed in order, one word per reference-block computation, with J1/J2 taken from the low/high 32 bits of the word.
private ulong[128] inputprivate ulong[128] addrBlockprivate uint coveredulong word(uint indexInSegment)Returns the pseudo-random word for the given index within the segment, regenerating the address block whenever a new 128-word block is needed (indices are requested in increasing order).this(uint pass, uint lane, uint slice, uint mPrime, uint t,
Argon2Type type)Params: pass = Current pass number r. lane = Current lane number l. slice = Current slice number sl. mPrime = Total number of memory blocks m'. t = Total number of passes. type = The Argon2 type y.Functions 8
ubyte[] argon2(Argon2Type type, int version_, uint t, uint m, uint p,
const(ubyte)[] pwd, const(ubyte)[] salt,
const(ubyte)[] secret, const(ubyte)[] ad, uint tagLength)Argon2 Core Function.ubyte[] blake2bLong(const(ubyte)[] input, uint outLen)Computes the variable-length hash function H' of RFC 9106 Section 3.3. For `outLen` <= 64, the result is `BLAKE2b-outLen(LE32(outLen) || input)`. For larger outputs, let `r = ceil(outLen/32) - 2`; ...uint computeReference(ulong j1, ulong j2, uint pass, uint slice, uint index, uint segmentLength, uint laneLength, uint l, uint refLane)