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

@@ -25,6 +25,8 @@
#include <ripple/overlay/ClusterNodeStatus.h>
#include <ripple/app/misc/UniqueNodeList.h>
#include <ripple/basics/Log.h>
#include <ripple/basics/SHA512Half.h>
#include <ripple/basics/Slice.h>
#include <ripple/basics/StringUtilities.h>
#include <ripple/basics/Time.h>
#include <ripple/core/Config.h>
@@ -1596,8 +1598,10 @@ bool UniqueNodeListImp::responseFetch (std::string const& strDomain, const boost
assert (bFound);
(void) bFound;
uint256 iSha256 = getSHA512Half (strSiteFile);
bool bChangedB = sdCurrent.iSha256 != iSha256;
uint256 iSha256 =
sha512Half(make_Slice(strSiteFile));
bool bChangedB =
sdCurrent.iSha256 != iSha256;
sdCurrent.strDomain = strDomain;
// XXX If the node public key is changing, delete old public key information?