rippled
Public Types | Public Member Functions | Private Attributes | List of all members
ripple::hardened_hash< HashAlgorithm > Class Template Reference

Seed functor once per construction. More...

Inheritance diagram for ripple::hardened_hash< HashAlgorithm >:
Inheritance graph
[legend]
Collaboration diagram for ripple::hardened_hash< HashAlgorithm >:
Collaboration graph
[legend]

Public Types

using result_type = typename HashAlgorithm::result_type
 

Public Member Functions

 hardened_hash ()
 
template<class T >
result_type operator() (T const &t) const noexcept
 

Private Attributes

detail::seed_pair m_seeds
 

Detailed Description

template<class HashAlgorithm = beast::xxhasher>
class ripple::hardened_hash< HashAlgorithm >

Seed functor once per construction.

A std compatible hash adapter that resists adversarial inputs. For this to work, T must implement in its own namespace:

template <class Hasher>
void
hash_append (Hasher& h, T const& t) noexcept
{
// hash_append each base and member that should
// participate in forming the hash
hash_append (h, static_cast<T::base1 const&>(t));
hash_append (h, static_cast<T::base2 const&>(t));
// ...
hash_append (h, t.member1);
hash_append (h, t.member2);
// ...
}

Do not use any version of Murmur or CityHash for the Hasher template parameter (the hashing algorithm). For details see https://131002.net/siphash/#at

Definition at line 96 of file hardened_hash.h.

Member Typedef Documentation

◆ result_type

template<class HashAlgorithm = beast::xxhasher>
using ripple::hardened_hash< HashAlgorithm >::result_type = typename HashAlgorithm::result_type

Definition at line 102 of file hardened_hash.h.

Constructor & Destructor Documentation

◆ hardened_hash()

template<class HashAlgorithm = beast::xxhasher>
ripple::hardened_hash< HashAlgorithm >::hardened_hash ( )

Definition at line 104 of file hardened_hash.h.

Member Function Documentation

◆ operator()()

template<class HashAlgorithm = beast::xxhasher>
template<class T >
result_type ripple::hardened_hash< HashAlgorithm >::operator() ( T const &  t) const
noexcept

Definition at line 110 of file hardened_hash.h.

Member Data Documentation

◆ m_seeds

template<class HashAlgorithm = beast::xxhasher>
detail::seed_pair ripple::hardened_hash< HashAlgorithm >::m_seeds
private

Definition at line 99 of file hardened_hash.h.

beast::hash_append
std::enable_if_t< is_contiguously_hashable< T, Hasher >::value > hash_append(Hasher &h, T const &t) noexcept
Logically concatenate input data to a Hasher.
Definition: hash_append.h:236
ripple::hash_append
void hash_append(Hasher &h, ValidatorBlobInfo const &blobInfo)
Definition: ValidatorList.h:897