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

Skein Algorithms More...

Typedefs

typedef hasher< detail::skein_provider< 1024, false >, mixin::skein_mixindigestpp::skein1024
 Skein1024 hash function.
 
typedef hasher< detail::skein_provider< 512, false >, mixin::skein_mixindigestpp::skein512
 Skein512 hash function.
 
typedef hasher< detail::skein_provider< 256, false >, mixin::skein_mixindigestpp::skein256
 Skein256 hash function.
 
typedef hasher< detail::skein_provider< 1024, true >, mixin::skein_mixindigestpp::skein1024_xof
 Skein1024 in XOF mode.
 
typedef hasher< detail::skein_provider< 512, true >, mixin::skein_mixindigestpp::skein512_xof
 Skein512 in XOF mode.
 
typedef hasher< detail::skein_provider< 256, true >, mixin::skein_mixindigestpp::skein256_xof
 Skein256 in XOF mode.
 
template<size_t N>
using digestpp::static_size::skein1024 = hasher<detail::skein_provider<1024, false, N>, mixin::skein_mixin>
 Skein1024 hash function (static-size version)
 
template<size_t N>
using digestpp::static_size::skein512 = hasher<detail::skein_provider<512, false, N>, mixin::skein_mixin>
 Skein512 hash function (static-size version)
 
template<size_t N>
using digestpp::static_size::skein256 = hasher<detail::skein_provider<256, false, N>, mixin::skein_mixin>
 Skein256 hash function (static-size version)
 

Detailed Description

Skein Algorithms

Typedef Documentation

◆ skein1024 [1/2]

Skein1024 hash function.

SHA-3 finalist based on the Threefish tweakable block cipher. Designed by Bruce Schneier, Niels Ferguson, Stefan Lucks, Doug Whiting, Mihir Bellare, Tadayoshi Kohno, Jon Callas, and Jesse Walker.

High-security variant of Skein using a 1024-bit internal state. Provides the highest security margin in the Skein family.

Skein1024 produces outputs that are independent from Skein256 and Skein512 even for the same output length. For example: skein512(256)skein1024(256)

Skein1024 is designed for applications requiring very high security levels or very long hash outputs (up to 1024 bits and beyond).

Use this variant when the required hash size is known in advance. For unknown output size (streaming output), use skein1024_xof.

Type:
Cryptographic hash function.
Output size:
arbitrary (any number of bits divisible by 8)
Default size:
1024 bits
Exceptions
std::runtime_errorif the requested digest size is not divisible by 8 (full bytes)

Optional parameters:

  • set_key() - Key of any length for MAC/PRF mode
  • set_personalization() - Personalization string for domain separation
  • set_nonce() - Nonce for randomization
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
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:
054922d4393e36af62143986221555bee407671f6e57631bd7273e215a714833
See also
hasher, mixin::skein_mixin, skein1024_xof, digestpp::static_size::skein1024

◆ skein1024 [2/2]

Skein1024 hash function (static-size version)

Variant of Skein1024 with output size specified as template parameter.

Type:
Cryptographic hash function.
Output size:
arbitrary (any number of bits divisible by 8)

Optional parameters:

  • set_key() - Key of any length for MAC/PRF mode
  • set_personalization() - Personalization string for domain separation
  • set_nonce() - Nonce for randomization
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
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, digestpp::skein1024

◆ skein1024_xof

Skein1024 in XOF mode.

Extendable Output Function (XOF) mode of Skein1024. Highest security variant with 1024-bit internal state.

In XOF mode, you can call squeeze() multiple times to generate arbitrary amounts of output. For fixed-length output known in advance, use skein1024.

Type:
Extendable output function (XOF).

Optional parameters:

  • set_key() - Key of any length for MAC/PRF mode
  • set_personalization() - Personalization string for domain separation
  • set_nonce() - Nonce for randomization
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';
std::string hexsqueeze(size_t len)
Squeeze bytes and return them as a hex string.
Definition hasher.hpp:296
Example output:
20cd7366b0a3713037fdbf8c635ea190943261455689792a327d93a9fd74dedf
See also
hasher, mixin::skein_mixin, skein1024

◆ skein256 [1/2]

Skein256 hash function.

SHA-3 finalist based on the Threefish tweakable block cipher. Designed by Bruce Schneier, Niels Ferguson, Stefan Lucks, Doug Whiting, Mihir Bellare, Tadayoshi Kohno, Jon Callas, and Jesse Walker.

Compact variant of Skein using a 256-bit internal state. Suitable for resource-constrained environments or when smaller state is preferred.

Skein256 produces outputs that are independent from Skein512 and Skein1024 even for the same output length. For example: skein256(256)skein512(256)

Use this variant when the required hash size is known in advance. For unknown output size (streaming output), use skein256_xof.

Type:
Cryptographic hash function.
Output size:
arbitrary (any number of bits divisible by 8)
Default size:
256 bits
Exceptions
std::runtime_errorif the requested digest size is not divisible by 8 (full bytes)

Optional parameters:

  • set_key() - Key of any length for MAC/PRF mode
  • set_personalization() - Personalization string for domain separation
  • set_nonce() - Nonce for randomization
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
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, digestpp::static_size::skein256

◆ skein256 [2/2]

Skein256 hash function (static-size version)

Variant of Skein256 with output size specified as template parameter.

Type:
Cryptographic hash function.
Output size:
arbitrary (any number of bits divisible by 8)

Optional parameters:

  • set_key() - Key of any length for MAC/PRF mode
  • set_personalization() - Personalization string for domain separation
  • set_nonce() - Nonce for randomization
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
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, digestpp::skein256

◆ skein256_xof

Skein256 in XOF mode.

Extendable Output Function (XOF) mode of Skein256. Compact variant with 256-bit internal state.

In XOF mode, you can call squeeze() multiple times to generate arbitrary amounts of output. For fixed-length output known in advance, use skein256.

Type:
Extendable output function (XOF).

Optional parameters:

  • set_key() - Key of any length for MAC/PRF mode
  • set_personalization() - Personalization string for domain separation
  • set_nonce() - Nonce for randomization
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 [1/2]

Skein512 hash function.

SHA-3 finalist based on the Threefish tweakable block cipher. Designed by Bruce Schneier, Niels Ferguson, Stefan Lucks, Doug Whiting, Mihir Bellare, Tadayoshi Kohno, Jon Callas, and Jesse Walker.

Skein512 uses a 512-bit internal state and is the recommended variant for general-purpose use.

Skein512 produces outputs that are independent from Skein256 and Skein1024 even for the same output length. For example: skein256(256)skein512(256)

Use this variant when the required hash size is known in advance. For unknown output size (streaming output), use skein512_xof

Type:
Cryptographic hash function.
Output size:
arbitrary (any number of bits divisible by 8)
Default size:
512 bits
Exceptions
std::runtime_errorif the requested digest size is not divisible by 8 (full bytes)

Optional parameters:

  • set_key() - Key of any length for MAC/PRF mode
  • set_personalization() - Personalization string for domain separation
  • set_nonce() - Nonce for randomization
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
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, digestpp::static_size::skein512

◆ skein512 [2/2]

Skein512 hash function (static-size version)

Variant of Skein512 with output size specified as template parameter.

Type:
Cryptographic hash function.
Output size:
arbitrary (any number of bits divisible by 8)

Optional parameters:

  • set_key() - Key of any length for MAC/PRF mode
  • set_personalization() - Personalization string for domain separation
  • set_nonce() - Nonce for randomization
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
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, digestpp::skein512

◆ skein512_xof

Skein512 in XOF mode.

Extendable Output Function (XOF) mode of Skein512. Use when the required output length is not known in advance or when streaming output is needed.

In XOF mode, you can call squeeze() multiple times to generate arbitrary amounts of output. For fixed-length output known in advance, use skein512.

Type:
Extendable output function (XOF).

Optional parameters:

  • set_key() - Key of any length for MAC/PRF mode
  • set_personalization() - Personalization string for domain separation
  • set_nonce() - Nonce for randomization
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