Add sha512Half and SHA512HashHasher:

These routines replace existing code to compute SHA512-Half hashes.
The new code accumulates serialized data into a hashing context
instead of allocating a buffer, for improved performance.
This commit is contained in:
Vinnie Falco
2015-05-27 09:27:35 -07:00
parent 06823349f9
commit c25184cc88
25 changed files with 357 additions and 323 deletions

View File

@@ -20,6 +20,8 @@
#ifndef RIPPLE_PROTOCOL_HASHPREFIX_H_INCLUDED
#define RIPPLE_PROTOCOL_HASHPREFIX_H_INCLUDED
#include <beast/hash/hash_append.h>
#include <beast/utility/noexcept.h>
#include <cstdint>
namespace ripple {
@@ -97,6 +99,15 @@ public:
static HashPrefix const manifest;
};
template <class Hasher>
void
hash_append (Hasher& h, HashPrefix const& hp) noexcept
{
using beast::hash_append;
hash_append(h,
static_cast<std::uint32_t>(hp));
}
} // ripple
#endif