ddn.crypto.hash.argon2

Argon2 Password Hashing Scheme (RFC 9106).

Types 2

Argon2 Variant.

Argon2d = 0
Argon2i = 1
Argon2id = 2

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

Argon2 requires the length of the password to be known at the start of the hashing process.

Therefore, this implementation buffers the entire input provided via update calls until finish is called. This may consume significant memory for very large inputs.

Fields
private Argon2Type _type
private int _version
private uint _t
private ubyte[] _salt
private ubyte[] _secret
private ubyte[] _ad
private uint _tagLength
private Appender!(ubyte[]) _buffer
Methods
Hash update(const(ubyte)[] input)
ubyte[] finish()
void reset()
size_t blockSize() @property const
size_t size() @property const
Constructors
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)

Functions 9

fnubyte[] 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.
private fnvoid fillBlockWithHash(ulong[] block, const(ubyte)[] input, size_t outLen)
private fnubyte[] blake2bLong(const(ubyte)[] input, uint outLen)
private fnuint computeReference(ulong j1, ulong j2, uint pass, uint slice, uint index, uint segmentLength, uint laneLength, uint l, uint p)
private fnuint computeReferenceArgon2i(uint pass, uint l, uint slice, uint idx, uint m_prime, uint t, Argon2Type type, uint laneLength, uint segmentLength)
private fnvoid permute(ref ulong[128] v)
private fnvoid compressBlockXor(ulong[] prev, ulong[] refB, ulong[] curr)
private fnvoid compressBlock(ulong[] prev, ulong[] refB, ulong[] curr)
private fnvoid G_argon(ref ulong[128] v, int a, int b, int c, int d)