|
digestpp 1.0
C++11 header-only message digest library
|
KMAC Algorithms More...
Typedefs | |
| typedef hasher< detail::kmac_provider< 128, false >, mixin::kmac_mixin > | digestpp::kmac128 |
| KMAC128 in hash mode. | |
| typedef hasher< detail::kmac_provider< 256, false >, mixin::kmac_mixin > | digestpp::kmac256 |
| KMAC256 in hash mode. | |
| typedef hasher< detail::kmac_provider< 128, true >, mixin::kmac_mixin > | digestpp::kmac128_xof |
| KMAC128 in XOF mode (KMACXOF128) | |
| typedef hasher< detail::kmac_provider< 256, true >, mixin::kmac_mixin > | digestpp::kmac256_xof |
| KMAC256 in XOF mode (KMACXOF256) | |
| template<size_t N> | |
| using | digestpp::static_size::kmac128 = hasher<detail::kmac_provider<128, false, N>, mixin::kmac_mixin> |
| KMAC128 in hash mode (static-size version) | |
| template<size_t N> | |
| using | digestpp::static_size::kmac256 = hasher<detail::kmac_provider<256, false, N>, mixin::kmac_mixin> |
| KMAC256 in hash mode (static-size version) | |
KMAC Algorithms
| typedef hasher<detail::kmac_provider<128, false>, mixin::kmac_mixin> digestpp::kmac128 |
KMAC128 in hash mode.
Keccak Message Authentication Code with 128-bit security. Specified in NIST SP 800-185.
KMAC is a PRF and keyed hash function based on Keccak, designed to provide variable-length output with improved security properties.
Use this variant when the required hash size is known in advance. For unknown output size (streaming output), use kmac128_xof
While primary usage of KMAC is message authentication with a key (MAC/PRF), it can also be used without a key as a regular hash function.
When used without a key as a regular hash function, KMAC has an important advantage over SHAKE128: different output lengths produce independent digests (shorter output is NOT a prefix of longer output). For example: kmac128(256) ≠ prefix(kmac128(512)). This property can be important for security in protocols where variable-length hashes are used in different contexts.
| std::runtime_error | if the requested digest size is not divisible by 8 (full bytes) |
Optional parameters:
set_key() - Secret key (any length) for MAC/PRF functionalityset_customization() - Domain separation stringSee mixin::kmac_mixin for the description of optional parameters.
| using digestpp::static_size::kmac128 = hasher<detail::kmac_provider<128, false, N>, mixin::kmac_mixin> |
KMAC128 in hash mode (static-size version)
Variant of KMAC128 with output size specified as template parameter.
While primary usage of KMAC is message authentication, it can also be used without a key as a regular hash function with the advantage that different output lengths produce independent digests.
Optional parameters:
set_key() - Secret key (any length) for MAC/PRF functionalityset_customization() - Domain separation stringSee mixin::kmac_mixin for the description of optional parameters.
| typedef hasher<detail::kmac_provider<128, true>, mixin::kmac_mixin> digestpp::kmac128_xof |
KMAC128 in XOF mode (KMACXOF128)
Specified in NIST SP 800-185.
Extendable Output Function mode of KMAC128. Use when the required output length is not known in advance or when streaming output is needed.
For fixed-length output known in advance, use kmac128 (provides independent outputs for different lengths)
In XOF mode without a key, there are no advantages over cshake128, as squeezed outputs share the same prefix property (longer output = shorter output + more bytes).
Primary usage: MAC/PRF with variable or unknown output length
Optional parameters:
set_key() - Secret key (any length) for MAC/PRF functionalityset_customization() - Domain separation stringSee mixin::kmac_mixin for the description of optional parameters.
| typedef hasher<detail::kmac_provider<256, false>, mixin::kmac_mixin> digestpp::kmac256 |
KMAC256 in hash mode.
Keccak Message Authentication Code with 256-bit security. Specified in NIST SP 800-185.
KMAC is a PRF and keyed hash function based on Keccak, designed to provide variable-length output with improved security properties.
Use this variant when the required hash size is known in advance. For unknown output size (streaming output), use kmac256_xof
While primary usage of KMAC is message authentication with a key (MAC/PRF), it can also be used without a key as a regular hash function.
When used without a key as a regular hash function, KMAC has an important advantage over SHAKE256: different output lengths produce independent digests (shorter output is NOT a prefix of longer output). For example: kmac256(256) ≠ prefix(kmac256(512)). This property can be important for security in protocols where variable-length hashes are used in different contexts.
| std::runtime_error | if the requested digest size is not divisible by 8 (full bytes) |
Optional parameters:
set_key() - Secret key (any length) for MAC/PRF functionalityset_customization() - Domain separation stringSee mixin::kmac_mixin for the description of optional parameters.
| using digestpp::static_size::kmac256 = hasher<detail::kmac_provider<256, false, N>, mixin::kmac_mixin> |
KMAC256 in hash mode (static-size version)
Variant of KMAC256 with output size specified as template parameter.
While primary usage of KMAC is message authentication, it can also be used without a key as a regular hash function with the advantage that different output lengths produce independent digests.
| std::runtime_error | if the requested digest size is not divisible by 8 (full bytes) |
Optional parameters:
set_key() - Secret key (any length) for MAC/PRF functionalityset_customization() - Domain separation stringSee mixin::kmac_mixin for the description of optional parameters.
| typedef hasher<detail::kmac_provider<256, true>, mixin::kmac_mixin> digestpp::kmac256_xof |
KMAC256 in XOF mode (KMACXOF256)
Specified in NIST SP 800-185.
Extendable Output Function mode of KMAC256. Higher security variant with 256-bit security level. Use when the required output length is not known in advance or when streaming output is needed.
For fixed-length output known in advance, use kmac256 (provides independent outputs for different lengths)
In XOF mode without a key, there are no advantages over cshake256, as squeezed outputs share the same prefix property (longer output = shorter output + more bytes).
Primary usage: MAC/PRF with variable or unknown output length
Optional parameters:
set_key() - Secret key (any length) for MAC/PRF functionalityset_customization() - Domain separation stringSee mixin::kmac_mixin for the description of optional parameters.