digestpp  0.01
Experimental C++11 header-only message digest library.
Public Member Functions | List of all members
digestpp::mixin::blake2_mixin< T > Class Template Reference

Defines additional public functions for BLAKE2 family of algorithms. More...

#include <blake2_mixin.hpp>

Public Member Functions

hasher< T, mixin::blake2_mixin > & set_salt (const std::string &salt)
 Set salt from std::string. More...
 
template<typename C , typename std::enable_if< detail::is_byte< C >::value >::type * = nullptr>
hasher< T, mixin::blake2_mixin > & set_salt (const C *salt, size_t salt_len)
 Set salt from raw buffer. More...
 
hasher< T, mixin::blake2_mixin > & set_personalization (const std::string &personalization)
 Set personalization from std::string. More...
 
template<typename C , typename std::enable_if< detail::is_byte< C >::value >::type * = nullptr>
hasher< T, mixin::blake2_mixin > & set_personalization (const C *personalization, size_t personalization_len)
 Set personalization from raw buffer. More...
 
hasher< T, mixin::blake2_mixin > & set_key (const std::string &key)
 Set key from std::string. More...
 
template<typename C , typename std::enable_if< detail::is_byte< C >::value >::type * = nullptr>
hasher< T, mixin::blake2_mixin > & set_key (const C *key, size_t key_len)
 Set key from raw buffer. More...
 

Detailed Description

template<typename T>
class digestpp::mixin::blake2_mixin< T >

Defines additional public functions for BLAKE2 family of algorithms.

See also
hasher, blake2s, blake2b, blake2sx, blake2bx, blake2sx_xof, blake2bx_xof

Member Function Documentation

◆ set_key() [1/2]

template<typename T >
hasher<T, mixin::blake2_mixin>& digestpp::mixin::blake2_mixin< T >::set_key ( const std::string &  key)
inline

Set key from std::string.

Maximum key size is 32 bytes for BLAKE2s and 64 bytes for BLAKE2b.

Parameters
[in]keyString with key
Exceptions
std::runtime_errorif key size is not supported.
Returns
Reference to hasher

◆ set_key() [2/2]

template<typename T >
template<typename C , typename std::enable_if< detail::is_byte< C >::value >::type * = nullptr>
hasher<T, mixin::blake2_mixin>& digestpp::mixin::blake2_mixin< T >::set_key ( const C *  key,
size_t  key_len 
)
inline

Set key from raw buffer.

Maximum key size is 32 bytes for BLAKE2s and 64 bytes for BLAKE2b.

Parameters
[in]keyPointer to key bytes
[in]key_lenKey length (in bytes)
Exceptions
std::runtime_errorif key size is not supported.
Returns
Reference to hasher

◆ set_personalization() [1/2]

template<typename T >
hasher<T, mixin::blake2_mixin>& digestpp::mixin::blake2_mixin< T >::set_personalization ( const std::string &  personalization)
inline

Set personalization from std::string.

Supported personalization size is 8 bytes for BLAKE2s and 16 bytes for BLAKE2b.

Parameters
[in]personalizationString with personalization
Exceptions
std::runtime_errorif personalization size is not supported.
Returns
Reference to hasher

◆ set_personalization() [2/2]

template<typename T >
template<typename C , typename std::enable_if< detail::is_byte< C >::value >::type * = nullptr>
hasher<T, mixin::blake2_mixin>& digestpp::mixin::blake2_mixin< T >::set_personalization ( const C *  personalization,
size_t  personalization_len 
)
inline

Set personalization from raw buffer.

Supported personalization size is 8 bytes for BLAKE2s and 16 bytes for BLAKE2b.

Parameters
[in]personalizationPointer to personalization bytes
[in]personalization_lenPersonalization length (in bytes)
Exceptions
std::runtime_errorif personalization size is not supported.
Returns
Reference to hasher

◆ set_salt() [1/2]

template<typename T >
hasher<T, mixin::blake2_mixin>& digestpp::mixin::blake2_mixin< T >::set_salt ( const std::string &  salt)
inline

Set salt from std::string.

Supported salt size is 8 bytes for BLAKE2s and 16 bytes for BLAKE2b.

Parameters
[in]saltString with salt
Exceptions
std::runtime_errorif salt size is not supported.
Returns
Reference to hasher

◆ set_salt() [2/2]

template<typename T >
template<typename C , typename std::enable_if< detail::is_byte< C >::value >::type * = nullptr>
hasher<T, mixin::blake2_mixin>& digestpp::mixin::blake2_mixin< T >::set_salt ( const C *  salt,
size_t  salt_len 
)
inline

Set salt from raw buffer.

Supported salt size is 8 bytes for BLAKE2s and 16 bytes for BLAKE2b.

Parameters
[in]saltPointer to salt bytes
[in]salt_lenSalt length (in bytes)
Exceptions
std::runtime_errorif salt size is not supported.
Returns
Reference to hasher

The documentation for this class was generated from the following file: