digestpp 1.0
C++11 header-only message digest library
Loading...
Searching...
No Matches
BLAKE

BLAKE Algorithm More...

Typedefs

typedef hasher< detail::blake_provider<>, mixin::blake_mixindigestpp::blake
 BLAKE hash function (SHA-3 finalist)
 
template<size_t N>
using digestpp::static_size::blake = hasher<detail::blake_provider<N>, mixin::blake_mixin>
 BLAKE hash function (static-size version)
 

Detailed Description

BLAKE Algorithm

Typedef Documentation

◆ blake [1/2]

BLAKE hash function (SHA-3 finalist)

Original BLAKE algorithm, finalist in the NIST SHA-3 competition. Based on the ChaCha stream cipher and HAIFA construction. Designed by Jean-Philippe Aumasson, Luca Henzen, Willi Meier, and Raphael C.-W. Phan.

Type:
Cryptographic hash function.
Output size:
224 / 256 / 384 / 512 bits
Default size:
none (must be specified)
Exceptions
std::runtime_errorif the requested digest size is not supported

Optional parameters:

  • set_salt() - Salt for hash randomization
    • 16 bytes for BLAKE-224 and BLAKE-256
    • 32 bytes for BLAKE-384 and BLAKE-512
Optional parameters:
salt

See mixin::blake_mixin for the description of optional parameters.

Example:
// Output a 256-bit BLAKE digest of a string
hasher.absorb("The quick brown fox jumps over the lazy dog");
std::cout << hasher.hexdigest() << '\n';
Main class template implementing the public API for hashing.
Definition hasher.hpp:38
std::string hexdigest() const
Return hex digest of absorbed data.
Definition hasher.hpp:372
hasher & absorb(const T *data, size_t len)
Absorbs bytes from a C-style pointer to character buffer.
Definition hasher.hpp:86
Example output:
7576698ee9cad30173080678e5965916adbb11cb5245d386bf1ffda1cb26c9d7
See also
hasher, mixin::blake_mixin, digestpp::static_size::blake

◆ blake [2/2]

BLAKE hash function (static-size version)

Variant of BLAKE with output size specified as template parameter.

Type:
Cryptographic hash function.
Output size:
224 / 256 / 384 / 512 bits

Optional parameters:

  • set_salt() - Salt for hash randomization
    • 16 bytes for BLAKE-224 and BLAKE-256
    • 32 bytes for BLAKE-384 and BLAKE-512
Optional parameters:
salt

See mixin::blake_mixin for the description of optional parameters.

Example:
// Output a 256-bit BLAKE digest of a string
hasher.absorb("The quick brown fox jumps over the lazy dog");
std::cout << hasher.hexdigest() << '\n';
Example output:
7576698ee9cad30173080678e5965916adbb11cb5245d386bf1ffda1cb26c9d7
See also
hasher, mixin::blake_mixin, digestpp::blake