digestpp 1.0
C++11 header-only message digest library
Loading...
Searching...
No Matches
echo_mixin.hpp
Go to the documentation of this file.
1/*
2This code is written by kerukuro and released into public domain.
3*/
4
5#ifndef DIGESTPP_MIXINS_ECHO_HPP
6#define DIGESTPP_MIXINS_ECHO_HPP
7
8namespace digestpp
9{
10
11namespace mixin
12{
13
18template<typename T>
20{
21public:
22
32 inline hasher<T, mixin::echo_mixin>& set_salt(const std::string& salt)
33 {
34 return set_salt(salt.c_str(), salt.size());
35 }
36
47 template<typename C, typename std::enable_if<detail::is_byte<C>::value>::type* = nullptr>
48 inline hasher<T, mixin::echo_mixin>& set_salt(const C* salt, size_t salt_len)
49 {
50 auto& echo = static_cast<hasher<T, mixin::echo_mixin>&>(*this);
51 echo.provider.set_salt(reinterpret_cast<const unsigned char*>(salt), salt_len);
52 echo.provider.init();
53 return echo;
54 }
55};
56
57} // namespace mixin
58
59} // namespace digestpp
60
61#endif
62
Main class template implementing the public API for hashing.
Definition hasher.hpp:38
Defines additional public functions for ECHO algorithm.
Definition echo_mixin.hpp:20
hasher< T, mixin::echo_mixin > & set_salt(const C *salt, size_t salt_len)
Set salt from raw buffer.
Definition echo_mixin.hpp:48
hasher< T, mixin::echo_mixin > & set_salt(const std::string &salt)
Set salt from std::string.
Definition echo_mixin.hpp:32
hasher< detail::echo_provider<>, mixin::echo_mixin > echo
Echo hash function.
Definition echo.hpp:62
digestpp namespace
Definition ascon.hpp:14