digestpp  0.01
Experimental C++11 header-only message digest library.
Classes | Typedefs
digestpp Namespace Reference

digestpp namespace More...

Classes

class  hasher
 Main class template implementing the public API for hashing. More...
 

Typedefs

typedef hasher< detail::blake_provider, mixin::blake_mixinblake
 BLAKE hash function (SHA-3 finalist) More...
 
typedef hasher< detail::blake2_provider< uint64_t, detail::blake2_type::hash >, mixin::blake2_mixinblake2b
 BLAKE2b hash function. More...
 
typedef hasher< detail::blake2_provider< uint32_t, detail::blake2_type::hash >, mixin::blake2_mixinblake2s
 BLAKE2s hash function. More...
 
typedef hasher< detail::blake2_provider< uint64_t, detail::blake2_type::x_hash >, mixin::blake2_mixinblake2xb
 BLAKE2xb hash function. More...
 
typedef hasher< detail::blake2_provider< uint32_t, detail::blake2_type::x_hash >, mixin::blake2_mixinblake2xs
 BLAKE2xs hash function. More...
 
typedef hasher< detail::blake2_provider< uint64_t, detail::blake2_type::xof >, mixin::blake2_mixinblake2xb_xof
 BLAKE2xb in XOF mode. More...
 
typedef hasher< detail::blake2_provider< uint32_t, detail::blake2_type::xof >, mixin::blake2_mixinblake2xs_xof
 BLAKE2xs in XOF mode. More...
 
typedef hasher< detail::groestl_provider > groestl
 Grøstl hash function. More...
 
typedef hasher< detail::jh_provider > jh
 JH hash function. More...
 
typedef hasher< detail::k12m14_provider< 128 >, mixin::k12m14_mixink12
 KangarooTwelve function. More...
 
typedef hasher< detail::k12m14_provider< 256 >, mixin::k12m14_mixinm14
 MarsupilamiFourteen function. More...
 
typedef hasher< detail::kmac_provider< 128, false >, mixin::kmac_mixinkmac128
 KMAC128 in hash mode. More...
 
typedef hasher< detail::kmac_provider< 256, false >, mixin::kmac_mixinkmac256
 KMAC256 in hash mode. More...
 
typedef hasher< detail::kmac_provider< 128, true >, mixin::kmac_mixinkmac128_xof
 KMAC128 in XOF mode (KMACXOF128) More...
 
typedef hasher< detail::kmac_provider< 256, true >, mixin::kmac_mixinkmac256_xof
 KMAC256 in XOF mode (KMACXOF256) More...
 
typedef hasher< detail::kupyna_provider > kupyna
 Kupyna hash function. More...
 
typedef hasher< detail::md5_provider > md5
 MD5 hash function. More...
 
typedef hasher< detail::sha1_provider > sha1
 SHA-1 hash function. More...
 
typedef hasher< detail::sha2_provider< uint64_t > > sha512
 SHA-512 hash function. More...
 
typedef hasher< detail::sha2_provider< uint64_t, 384 > > sha384
 SHA-384 hash function. More...
 
typedef hasher< detail::sha2_provider< uint32_t, 256 > > sha256
 SHA-256 hash function. More...
 
typedef hasher< detail::sha2_provider< uint32_t, 224 > > sha224
 SHA-224 hash function. More...
 
typedef hasher< detail::sha3_provider > sha3
 SHA-3 hash function. More...
 
typedef hasher< detail::shake_provider< 128, 24 > > shake128
 SHAKE128 function. More...
 
typedef hasher< detail::shake_provider< 256, 24 > > shake256
 SHAKE256 function. More...
 
typedef hasher< detail::shake_provider< 128, 24 >, mixin::cshake_mixincshake128
 Customizable cSHAKE128 function. More...
 
typedef hasher< detail::shake_provider< 256, 24 >, mixin::cshake_mixincshake256
 Customizable cSHAKE256 function. More...
 
typedef hasher< detail::skein_provider< 1024, false >, mixin::skein_mixinskein1024
 Skein1024 hash function. More...
 
typedef hasher< detail::skein_provider< 512, false >, mixin::skein_mixinskein512
 Skein512 hash function. More...
 
typedef hasher< detail::skein_provider< 256, false >, mixin::skein_mixinskein256
 Skein256 hash function. More...
 
typedef hasher< detail::skein_provider< 1024, true >, mixin::skein_mixinskein1024_xof
 Skein1024 in XOF mode. More...
 
typedef hasher< detail::skein_provider< 512, true >, mixin::skein_mixinskein512_xof
 Skein512 in XOF mode. More...
 
typedef hasher< detail::skein_provider< 256, true >, mixin::skein_mixinskein256_xof
 Skein256 in XOF mode. More...
 
typedef hasher< detail::sm3_provider > sm3
 SM3 hash function. More...
 
typedef hasher< detail::streebog_provider > streebog
 Streebog hash function. More...
 
typedef hasher< detail::whirlpool_provider > whirlpool
 Whirlpool hash function. More...
 

Detailed Description

digestpp namespace

Typedef Documentation

◆ blake

typedef hasher<detail::blake_provider, mixin::blake_mixin> digestpp::blake

BLAKE hash function (SHA-3 finalist)

Provider type
hash
Supported output sizes
224 / 256 / 384 / 512 bits
Default output size
none
Exceptions
std::runtime_errorif the requested digest size is not supported
Optional parameters
salt

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

Example:
// Output a 256-bit BLAKE digest of a string
digestpp::blake hasher(256);
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

◆ blake2b

typedef hasher<detail::blake2_provider<uint64_t, detail::blake2_type::hash>, mixin::blake2_mixin> digestpp::blake2b

BLAKE2b hash function.

Provider type
hash
Supported output sizes
8 - 512 bits
Default output size
512 bits
Exceptions
std::runtime_errorif the requested digest size is not divisible by 8 (full bytes), or is not within the supported range
Optional parameters
salt, personalization, key

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

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

◆ blake2s

typedef hasher<detail::blake2_provider<uint32_t, detail::blake2_type::hash>, mixin::blake2_mixin> digestpp::blake2s

BLAKE2s hash function.

Provider type
hash
Supported output sizes
8 - 256 bits
Default output size
256 bits
Exceptions
std::runtime_errorif the requested digest size is not divisible by 8 (full bytes), or is not within the supported range
Optional parameters
salt, personalization, key

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

Example:
// Output a 256-bit BLAKE2s digest of a string
hasher.absorb("The quick brown fox jumps over the lazy dog");
std::cout << hasher.hexdigest() << '\n';
Example output:
606beeec743ccbeff6cbcdf5d5302aa855c256c29b88c8ed331ea1a6bf3c8812
See also
hasher, mixin::blake2_mixin

◆ blake2xb

typedef hasher<detail::blake2_provider<uint64_t, detail::blake2_type::x_hash>, mixin::blake2_mixin> digestpp::blake2xb

BLAKE2xb hash function.

Use this variant when the required hash size is known in advance. Otherwise, use blake2xb_xof

Provider type
hash
Supported output sizes
arbitrary
Default output size
512 bits
Exceptions
std::runtime_errorif the requested digest size is not divisible by 8 (full bytes)
Optional parameters
salt, personalization, key

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

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

◆ blake2xb_xof

typedef hasher<detail::blake2_provider<uint64_t, detail::blake2_type::xof>, mixin::blake2_mixin> digestpp::blake2xb_xof

BLAKE2xb in XOF mode.

Use this variant when the required hash size is not known in advance. Otherwise, use blake2xb

Function type
XOF
Optional parameters
salt, personalization, key

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

Example:
// Absorb a string and squeeze 32 bytes of output
hasher.absorb("The quick brown fox jumps over the lazy dog");
std::cout << hasher.hexsqueeze(32) << '\n';
Example output:
364e84ca4c103df292306c93ebba6f6633d5e9cc8a95e040498e9a012d5ca534
See also
hasher, mixin::blake2_mixin

◆ blake2xs

typedef hasher<detail::blake2_provider<uint32_t, detail::blake2_type::x_hash>, mixin::blake2_mixin> digestpp::blake2xs

BLAKE2xs hash function.

Use this variant when the required hash size is known in advance. Otherwise, use blake2xs_xof

Provider type
hash
Supported output sizes
arbitrary
Default output size
256 bits
Exceptions
std::runtime_errorif the requested digest size is not divisible by 8 (full bytes)
Optional parameters
salt, personalization, key

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

Example:
// Output a 512-bit BLAKE2xs digest of a string
digestpp::blake2xs hasher(512);
hasher.absorb("The quick brown fox jumps over the lazy dog");
std::cout << hasher.hexdigest() << '\n';
Example output:
e709f8377d21507c166e5dd2279a1f58b290792d65dafcc5647b6e439a974227503c341341572725709b874e95f13a438677aa6f9648467fd341e0f3e5421840
See also
hasher, mixin::blake2_mixin

◆ blake2xs_xof

typedef hasher<detail::blake2_provider<uint32_t, detail::blake2_type::xof>, mixin::blake2_mixin> digestpp::blake2xs_xof

BLAKE2xs in XOF mode.

Use this variant when the required hash size is not known in advance. Otherwise, use blake2xs

Function type
XOF
Optional parameters
salt, personalization, key

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

Example:
// Absorb a string and squeeze 32 bytes of output
hasher.absorb("The quick brown fox jumps over the lazy dog");
std::cout << hasher.hexsqueeze(32) << '\n';
Example output:
0650cde4df888a06eada0f0fecb3c17594304b4a03fdd678182f27db1238b1747e33c34ae539fe2179a7594442b5cc9a7a0f398bb15ac3095a397de6a60061d6
See also
hasher, mixin::blake2_mixin

◆ cshake128

typedef hasher<detail::shake_provider<128, 24>, mixin::cshake_mixin> digestpp::cshake128

Customizable cSHAKE128 function.

Extendable output function similar to SHAKE128 but with possibility to use a customization string. When used without a customization string, the output is identical to shake128.

Function type
XOF
Optional parameters
function name, customization

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

Example:
// Absorb a string and squeeze 32 bytes of output
hasher.set_customization("My Custom SHAKE");
hasher.absorb("The quick brown fox jumps over the lazy dog");
std::cout << hasher.hexsqueeze(32) << '\n';
Example output:
5b831bfe752f7f05d81f18f0e83a92eb48b9e3d460c10022ecb4852aa8b1f9d4
See also
hasher, mixin::cshake_mixin

◆ cshake256

typedef hasher<detail::shake_provider<256, 24>, mixin::cshake_mixin> digestpp::cshake256

Customizable cSHAKE256 function.

Extendable output function similar to SHAKE256 but with possibility to use a customization string. When used without a customization string, the output is identical to shake256.

Function type
XOF
Optional parameters
function name, customization

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

Example:
// Absorb a string and squeeze 32 bytes of output
hasher.set_customization("My Custom SHAKE");
hasher.absorb("The quick brown fox jumps over the lazy dog");
std::cout << hasher.hexsqueeze(32) << '\n';
Example output:
bcebde2c2e18f6efd99ee9e0def1383e86595d72e49b4754f7f727a962c3cd3d
See also
hasher, mixin::cshake_mixin

◆ groestl

typedef hasher<detail::groestl_provider> digestpp::groestl

Grøstl hash function.

Provider type
hash
Supported output sizes
8 - 512 bits
Default output size
none
Exceptions
std::runtime_errorif the requested digest size is not divisible by 8 (full bytes), or is not within the supported range
Example:
// Output a 256-bit Grøstl digest of a string
digestpp::groestl hasher(256);
hasher.absorb("The quick brown fox jumps over the lazy dog");
std::cout << hasher.hexdigest() << '\n';
Example output:
8c7ad62eb26a21297bc39c2d7293b4bd4d3399fa8afab29e970471739e28b301
See also
hasher

◆ jh

typedef hasher<detail::jh_provider> digestpp::jh

JH hash function.

Provider type
hash
Supported output sizes
8 - 512 bits
Default output size
none
Exceptions
std::runtime_errorif the requested digest size is not divisible by 8 (full bytes), or is not within the supported range
Example:
// Output a 256-bit JH digest of a string
digestpp::jh hasher(256);
hasher.absorb("The quick brown fox jumps over the lazy dog");
std::cout << hasher.hexdigest() << '\n';
Example output:
6a049fed5fc6874acfdc4a08b568a4f8cbac27de933496f031015b38961608a0
See also
hasher

◆ k12

typedef hasher<detail::k12m14_provider<128>, mixin::k12m14_mixin> digestpp::k12

KangarooTwelve function.

Extendable output function similar to SHAKE128 but with reduced number of round.

Function type
XOF
Optional parameters
customization

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

Example:
// Absorb a string and squeeze 32 bytes of output
hasher.absorb("The quick brown fox jumps over the lazy dog");
std::cout << hasher.hexsqueeze(32) << '\n';
Example output:
b4f249b4f77c58df170aa4d1723db1127d82f1d98d25ddda561ada459cd11a48
See also
hasher, mixin::k12m14_mixin

◆ kmac128

typedef hasher<detail::kmac_provider<128, false>, mixin::kmac_mixin> digestpp::kmac128

KMAC128 in hash mode.

Use this variant when the required hash size is known in advance. Otherwise, use kmac128_xof. While primary usage of KMAC is message authentication, it can also be used without a key as a regular hash function.

Provider type
hash
Supported output sizes
arbitrary
Default output size
none
Exceptions
std::runtime_errorif the requested digest size is not divisible by 8 (full bytes)
Optional parameters
customization, key

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

Example:
// Set key and output a 256-bit KMAC128 of a string
digestpp::kmac128 hasher(256);
hasher.set_key(R"(@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_)");
hasher.absorb("The quick brown fox jumps over the lazy dog");
std::cout << hasher.hexdigest() << '\n';
Example output:
bbd4ebf20aacc8e4dfd2cc91f2b6cbf33e2a45d805996b48a17b8d3e42b4b010
See also
hasher, kmac128_xof, mixin::kmac_mixin

◆ kmac128_xof

typedef hasher<detail::kmac_provider<128, true>, mixin::kmac_mixin> digestpp::kmac128_xof

KMAC128 in XOF mode (KMACXOF128)

Use this variant when the required hash size is not known in advance. Otherwise, use kmac128. This hasher can also be used without a key, but there are no advantages over cshake128 in this case.

Function type
XOF
Optional parameters
customization, key

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

Example:
// Set key, absorb a string and squeeze 32 bytes of output
hasher.set_key(R"(@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_)");
hasher.absorb("The quick brown fox jumps over the lazy dog");
std::cout << hasher.hexsqueeze(32) << '\n';
Example output:
a5dd2e2c92e4fe5d203ab7cc4e05df888b021390ba08a00dcb39a94ed07bd364
See also
hasher, kmac128, mixin::kmac_mixin

◆ kmac256

typedef hasher<detail::kmac_provider<256, false>, mixin::kmac_mixin> digestpp::kmac256

KMAC256 in hash mode.

Use this variant when the required hash size is known in advance. Otherwise, use kmac256_xof. While primary usage of KMAC is message authentication, it can also be used without a key as a regular hash function.

Provider type
hash
Supported output sizes
arbitrary
Default output size
none
Exceptions
std::runtime_errorif the requested digest size is not divisible by 8 (full bytes)
Optional parameters
customization, key

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

Example:
// Set key and output a 256-bit KMAC256 of a string
digestpp::kmac256 hasher(256);
hasher.set_key(R("@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_"));
hasher.absorb("The quick brown fox jumps over the lazy dog");
std::cout << hasher.hexdigest() << '\n';
Example output:
bbe7d65fe0e7574254a13e0f3f79482275b96887287fc8b620a92ed5e5de3bce
See also
hasher, kmac256_xof, mixin::kmac_mixin

◆ kmac256_xof

typedef hasher<detail::kmac_provider<256, true>, mixin::kmac_mixin> digestpp::kmac256_xof

KMAC256 in XOF mode (KMACXOF256)

Use this variant when the required hash size is not known in advance. Otherwise, use kmac256. This hasher can also be used without a key, but there are no advantages over cshake256 in this case.

Function type
XOF
Optional parameters
customization, key

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

Example:
// Set key, absorb a string and squeeze 32 bytes of output
hasher.set_key(R"(@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_)");
hasher.absorb("The quick brown fox jumps over the lazy dog");
std::cout << hasher.hexsqueeze(32) << '\n';
Example output:
81ce507692e27fb404e4a765c3be3450ce5c090a61b8311f93eb4e35604877ad
See also
hasher, kmac256, mixin::kmac_mixin

◆ kupyna

typedef hasher<detail::kupyna_provider> digestpp::kupyna

Kupyna hash function.

Provider type
hash
Supported output sizes
256 / 512 bits
Default output size
none
Exceptions
std::runtime_errorif the requested digest size is not supported
Example:
// Output a 256-bit Kupyna digest of a string
digestpp::kupyna hasher(256);
hasher.absorb("The quick brown fox jumps over the lazy dog");
std::cout << hasher.hexdigest() << '\n';
Example output:
996899f2d7422ceaf552475036b2dc120607eff538abf2b8dff471a98a4740c6
See also
hasher

◆ m14

typedef hasher<detail::k12m14_provider<256>, mixin::k12m14_mixin> digestpp::m14

MarsupilamiFourteen function.

Extendable output function similar to KangarooTwelve, but providing 256-bit security.

Function type
XOF
Optional parameters
customization

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

Example:
// Absorb a string and squeeze 32 bytes of output
hasher.absorb("The quick brown fox jumps over the lazy dog");
std::cout << hasher.hexsqueeze(32) << '\n';
Example output:
3611bcaa666347770dbffd4562f137c5adfe2e09f3c4268ef7c7d7c0e6c5d59c
See also
hasher, mixin::k12m14_mixin

◆ md5

typedef hasher<detail::md5_provider> digestpp::md5

MD5 hash function.

Note that MD5 hash function is considered insecure and is not recommended for new applications.

Provider type
hash
Supported output sizes
128 bits
Default output size
128 bits
Example:
// Output an MD5 digest of a string
hasher.absorb("The quick brown fox jumps over the lazy dog");
std::cout << hasher.hexdigest() << '\n';
Example output:
9e107d9d372bb6826bd81d3542a419d6
See also
hasher

◆ sha1

typedef hasher<detail::sha1_provider> digestpp::sha1

SHA-1 hash function.

Note that SHA-1 hash function is considered insecure and is not recommended for new applications.

Provider type
hash
Supported output sizes
160 bits
Default output size
160 bits
Example:
// Output a SHA1 digest of a string
hasher.absorb("The quick brown fox jumps over the lazy dog");
std::cout << hasher.hexdigest() << '\n';
Example output:
2fd4e1c67a2d28fced849ee1bb76e7391b93eb12
See also
hasher

◆ sha224

typedef hasher<detail::sha2_provider<uint32_t, 224> > digestpp::sha224

SHA-224 hash function.

Provider type
hash
Supported output sizes
224 bits
Default output size
224 bits
Example:
// Output a SHA-224 digest of a string
hasher.absorb("The quick brown fox jumps over the lazy dog");
std::cout << hasher.hexdigest() << '\n';
Example output:
730e109bd7a8a32b1cb9d9a09aa2325d2430587ddbc0c38bad911525
See also
hasher

◆ sha256

typedef hasher<detail::sha2_provider<uint32_t, 256> > digestpp::sha256

SHA-256 hash function.

Note that this function is slower than SHA-512/256 on 64-bit systems.

Provider type
hash
Supported output sizes
256 bits
Default output size
256 bits
Example:
// Output a SHA-256 digest of a string
hasher.absorb("The quick brown fox jumps over the lazy dog");
std::cout << hasher.hexdigest() << '\n';
Example output:
d7a8fbb307d7809469ca9abcb0082e4f8d5651e46d3cdb762d02d0bf37c9e592
See also
hasher

◆ sha3

typedef hasher<detail::sha3_provider> digestpp::sha3

SHA-3 hash function.

Provider type
hash
Supported output sizes
224 / 256 / 384 / 512 bits
Default output size
none
Exceptions
std::runtime_errorif the requested digest size is not supported
Example:
// Output a 256-bit SHA-3 digest of a string
digestpp::sha3 hasher(256);
hasher.absorb("The quick brown fox jumps over the lazy dog");
std::cout << hasher.hexdigest() << '\n';
Example output:
69070dda01975c8c120c3aada1b282394e7f032fa9cf32f4cb2259a0897dfc04
See also
hasher

◆ sha384

typedef hasher<detail::sha2_provider<uint64_t, 384> > digestpp::sha384

SHA-384 hash function.

Provider type
hash
Supported output sizes
384 bits
Default output size
384 bits
Example:
// Output a SHA-384 digest of a string
hasher.absorb("The quick brown fox jumps over the lazy dog");
std::cout << hasher.hexdigest() << '\n';
Example output:
ca737f1014a48f4c0b6dd43cb177b0afd9e5169367544c494011e3317dbf9a509cb1e5dc1e85a941bbee3d7f2afbc9b1
See also
hasher

◆ sha512

typedef hasher<detail::sha2_provider<uint64_t> > digestpp::sha512

SHA-512 hash function.

Provider type
hash
Supported output sizes
8 - 512 bits
Default output size
512 bits
Exceptions
std::runtime_errorif the requested digest size is not divisible by 8 (full bytes), or is not within the supported range
Example:
// Output a SHA-512/256 digest of a string
digestpp::sha512 hasher(256);
hasher.absorb("The quick brown fox jumps over the lazy dog");
std::cout << hasher.hexdigest() << '\n';
Example output:
dd9d67b371519c339ed8dbd25af90e976a1eeefd4ad3d889005e532fc5bef04d
See also
hasher

◆ shake128

typedef hasher<detail::shake_provider<128, 24> > digestpp::shake128

SHAKE128 function.

Function type
XOF
Example:
// Absorb a string and squeeze 32 bytes of output
hasher.absorb("The quick brown fox jumps over the lazy dog");
std::cout << hasher.hexsqueeze(32) << '\n';
Example output:
f4202e3c5852f9182a0430fd8144f0a74b95e7417ecae17db0f8cfeed0e3e66e
See also
hasher, cshake128

◆ shake256

typedef hasher<detail::shake_provider<256, 24> > digestpp::shake256

SHAKE256 function.

Function type
XOF
Example:
// Absorb a string and squeeze 32 bytes of output
hasher.absorb("The quick brown fox jumps over the lazy dog");
std::cout << hasher.hexsqueeze(32) << '\n';
Example output:
2f671343d9b2e1604dc9dcf0753e5fe15c7c64a0d283cbbf722d411a0e36f6ca
See also
hasher, cshake256

◆ skein1024

typedef hasher<detail::skein_provider<1024, false>, mixin::skein_mixin> digestpp::skein1024

Skein1024 hash function.

Use this variant when the required hash size is known in advance. Otherwise, use skein1024_xof

Provider type
hash
Supported output sizes
arbitrary
Default output size
1024 bits
Exceptions
std::runtime_errorif the requested digest size is not divisible by 8 (full bytes)
Optional parameters
personalization, nonce, key

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

Example:
// Output a 256-bit Skein1024 digest of a string
digestpp::skein1024 hasher(256);
hasher.absorb("The quick brown fox jumps over the lazy dog");
std::cout << hasher.hexdigest() << '\n';
Example output:
054922d4393e36af62143986221555bee407671f6e57631bd7273e215a714833
See also
hasher, mixin::skein_mixin, skein1024_xof

◆ skein1024_xof

typedef hasher<detail::skein_provider<1024, true>, mixin::skein_mixin> digestpp::skein1024_xof

Skein1024 in XOF mode.

Use this variant when the required hash size is not known in advance. Otherwise, use skein1024

Function type
XOF
Optional parameters
personalization, nonce, key

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

Example:
// Absorb a string and squeeze 32 bytes of output
hasher.absorb("The quick brown fox jumps over the lazy dog");
std::cout << hasher.hexsqueeze(32) << '\n';
Example output:
20cd7366b0a3713037fdbf8c635ea190943261455689792a327d93a9fd74dedf
See also
hasher, mixin::skein_mixin, skein1024

◆ skein256

typedef hasher<detail::skein_provider<256, false>, mixin::skein_mixin> digestpp::skein256

Skein256 hash function.

Use this variant when the required hash size is known in advance. Otherwise, use skein256_xof

Provider type
hash
Supported output sizes
arbitrary
Default output size
256 bits
Exceptions
std::runtime_errorif the requested digest size is not divisible by 8 (full bytes)
Optional parameters
personalization, nonce, key

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

Example:
// Output a 512-bit Skein256 digest of a string
digestpp::skein256 hasher(512);
hasher.absorb("The quick brown fox jumps over the lazy dog");
std::cout << hasher.hexdigest() << '\n';
Example output:
f8138e72cdd9e11cf09e4be198c234acb0d21a9f75f936e989cf532f1fa9f4fb21d255811f0f1592fb3617d04704add875ae7bd16ddbbeaed4eca6eb9675d2c6
See also
hasher, mixin::skein_mixin, skein256_xof

◆ skein256_xof

typedef hasher<detail::skein_provider<256, true>, mixin::skein_mixin> digestpp::skein256_xof

Skein256 in XOF mode.

Use this variant when the required hash size is not known in advance. Otherwise, use skein256

Function type
XOF
Optional parameters
personalization, nonce, key

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

Example:
// Absorb a string and squeeze 32 bytes of output
hasher.absorb("The quick brown fox jumps over the lazy dog");
std::cout << hasher.hexsqueeze(32) << '\n';
Example output:
217021fbabe331c5753024fe4c17a005a698b037859ca8f4f0fb9112dce5605c
See also
hasher, mixin::skein_mixin, skein256

◆ skein512

typedef hasher<detail::skein_provider<512, false>, mixin::skein_mixin> digestpp::skein512

Skein512 hash function.

Use this variant when the required hash size is known in advance. Otherwise, use skein512_xof

Provider type
hash
Supported output sizes
arbitrary
Default output size
512 bits
Exceptions
std::runtime_errorif the requested digest size is not divisible by 8 (full bytes)
Optional parameters
personalization, nonce, key

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

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

◆ skein512_xof

typedef hasher<detail::skein_provider<512, true>, mixin::skein_mixin> digestpp::skein512_xof

Skein512 in XOF mode.

Use this variant when the required hash size is not known in advance. Otherwise, use skein512

Function type
XOF
Optional parameters
personalization, nonce, key

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

Example:
// Absorb a string and squeeze 32 bytes of output
hasher.absorb("The quick brown fox jumps over the lazy dog");
std::cout << hasher.hexsqueeze(32) << '\n';
Example output:
cd7447a48e387ca4461e75ede8424566f7ed816a80bfac5bed291ac107f96170
See also
hasher, mixin::skein_mixin, skein512

◆ sm3

typedef hasher<detail::sm3_provider> digestpp::sm3

SM3 hash function.

Provider type
hash
Supported output sizes
256 bits
Default output size
256 bits
Example:
// Output a SM3 digest of a string
hasher.absorb("The quick brown fox jumps over the lazy dog");
std::cout << hasher.hexdigest() << '\n';
Example output:
5fdfe814b8573ca021983970fc79b2218c9570369b4859684e2e4c3fc76cb8ea
See also
hasher

◆ streebog

typedef hasher<detail::streebog_provider> digestpp::streebog

Streebog hash function.

Provider type
hash
Supported output sizes
256 / 512 bits
Default output size
none
Exceptions
std::runtime_errorif the requested digest size is not supported
Example:
// Output a 256-bit Streebog digest of a string
digestpp::streebog hasher(256);
hasher.absorb("The quick brown fox jumps over the lazy dog");
std::cout << hasher.hexdigest() << '\n';
Example output:
3e7dea7f2384b6c5a3d0e24aaa29c05e89ddd762145030ec22c71a6db8b2c1f4
See also
hasher

◆ whirlpool

typedef hasher<detail::whirlpool_provider> digestpp::whirlpool

Whirlpool hash function.

Provider type
hash
Supported output sizes
512 bits
Default output size
512 bits
Example:
// Output a Whirlpool digest of a string
hasher.absorb("The quick brown fox jumps over the lazy dog");
std::cout << hasher.hexdigest() << '\n';
Example output:
b97de512e91e3828b40d2b0fdce9ceb3c4a71f9bea8d88e75c4fa854df36725fd2b52eb6544edcacd6f8beddfea403cb55ae31f03ad62a5ef54e42ee82c3fb35
See also
hasher