ddn.crypto.hash.blake

BLAKE2 and BLAKE3 Hash Implementations.

Types 5

BLAKE2b Core Implementation (Struct for low-level usage).

Fields
ulong[8] h
ulong[2] t
ulong[2] f
ubyte[128] buf
size_t buflen
size_t outlen
ulong[8] IV
ubyte[16][12] SIGMA
Methods
void init(size_t outlen, const(ubyte)[] key = null)
void update(const(ubyte)[] input)
void updateU32(uint val)
ubyte[] finish()
void incrementCounter(size_t inc)
void compress(bool last)
void G(ref ulong[16] v, int a, int b, int c, int d, ulong x, ulong y) static
ulong rotr64(ulong x, int n) static

BLAKE2b Digest Implementation (512-bit).

Methods
Hash update(const(ubyte)[] input)
ubyte[] finish()
void reset()
size_t blockSize() @property const
size_t size() @property const
Constructors
this(size_t digestSize = 64)
Fields
uint[8] h
uint[2] t
uint[2] f
ubyte[64] buf
size_t buflen
size_t outlen
uint[8] IV
Methods
void init(size_t outlen, const(ubyte)[] key = null)
void update(const(ubyte)[] input)
ubyte[] finish()
void incrementCounter(size_t inc)
void compress(bool last)
void G(ref uint[16] v, int a, int b, int c, int d, uint x, uint y) static
uint rotr32(uint x, int n) static

BLAKE2s Digest Implementation (256-bit).

Methods
Hash update(const(ubyte)[] input)
ubyte[] finish()
void reset()
size_t blockSize() @property const
size_t size() @property const
Constructors
this(size_t digestSize = 32)

BLAKE3 Implementation (32-bit words, 256-bit output default).

Uses the same compression function as BLAKE2s but with 7 rounds and fixed IV. Simplified for single-threaded reference (Chunk Loop).

Fields
uint FLAG_CHUNK_START
uint FLAG_CHUNK_END
uint FLAG_PARENT
uint FLAG_ROOT
Methods
size_t blockSize() @property const
size_t size() @property const
void reset()
Hash update(const(ubyte)[] input)
ubyte[] finish()
Constructors