BLAKE2 hash functions
Implementing "Blake2b" and "Blake2s" as described in RFC7693
Note that, at present, this only supports full message hashing and no OPTIONAL features of BLAKE2.
Summary
Functions
@spec hash2b(binary(), pos_integer(), binary()) :: binary() | :error
Blake2b hashing
Note that the output_size is in bytes, not bits
- 64 => Blake2b-512 (default)
- 48 => Blake2b-384
- 32 => Blake2b-256
Per the specification, any output_size between 1 and 64 bytes is supported.
@spec hash2s(binary(), pos_integer(), binary()) :: binary() | :error
Blake2s hashing
Note that the output_size is in bytes, not bits
- 32 => Blake2s-256 (default)
- 24 => Blake2b-192
- 16 => Blake2b-128
Per the specification, any output_size between 1 and 32 bytes is supported.