20 #include <ripple/basics/hardened_hash.h>
21 #include <ripple/beast/unit_test.h>
22 #include <boost/functional/hash.hpp>
44 template <
class Hasher>
64 template <
class Hasher>
98 template <std::
size_t Bits,
class UInt = std::u
int64_t>
104 "UInt must be an unsigned integral type");
107 Bits % (8 *
sizeof(UInt)) == 0,
108 "Bits must be a multiple of 8*sizeof(UInt)");
111 Bits >= (8 *
sizeof(UInt)),
112 "Bits must be at least 8*sizeof(UInt)");
147 template <
class Hasher>
167 #ifndef __INTELLISENSE__
168 static_assert(
sha256_t::bits == 256,
"sha256_t must have 256 bits");
189 template <
template <
class T>
class U>
195 check<U<signed char>>();
196 check<U<unsigned char>>();
202 check<U<unsigned short>>();
204 check<U<unsigned int>>();
206 check<U<long long>>();
207 check<U<unsigned long>>();
208 check<U<unsigned long long>>();
211 check<U<long double>>();
214 template <
template <
class T>
class C>
219 C<detail::test_user_type_member<std::string>> c;
225 C<detail::test_user_type_free<std::string>> c;
234 testcase(
"user types");
235 check_user_type<detail::test_user_type_member>();
236 check_user_type<detail::test_user_type_free>();
242 testcase(
"containers");
243 check_container<detail::test_hardened_unordered_set>();
244 check_container<detail::test_hardened_unordered_map>();
245 check_container<detail::test_hardened_unordered_multiset>();
246 check_container<detail::test_hardened_unordered_multimap>();
BEAST_DEFINE_TESTSUITE(AccountTxPaging, app, ripple)
static const std::size_t bytes
friend void hash_append(Hasher &h, unsigned_integer const &a) noexcept
friend std::ostream & operator<<(std::ostream &s, unsigned_integer const &v)
void const * data() const noexcept
static const std::size_t size
Seed functor once per construction.
test_user_type_free(T const &t_=T())
std::array< UInt, size > m_vec
static const std::size_t bits
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
friend void hash_append(Hasher &h, test_user_type_free const &a) noexcept
static unsigned_integer from_number(Int v)
test_user_type_member(T const &t_=T())
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.
friend void hash_append(Hasher &h, test_user_type_member const &a) noexcept