mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-21 19:45:53 +00:00
Cleanups.
This commit is contained in:
@@ -251,12 +251,7 @@ bool SHAMapTreeNode::updateHash()
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if(!empty)
|
if(!empty)
|
||||||
{
|
nh=Serializer::getSHA512Half(reinterpret_cast<unsigned char *>(mHashes), sizeof(mHashes));
|
||||||
uint256 j[2];
|
|
||||||
SHA512(reinterpret_cast<unsigned char *>(mHashes), sizeof(mHashes), (unsigned char *) j);
|
|
||||||
nh=j[0];
|
|
||||||
assert(!!nh);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else if(mType==ACCOUNT_STATE)
|
else if(mType==ACCOUNT_STATE)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -192,6 +192,13 @@ uint256 Serializer::getSHA512Half(const std::vector<unsigned char>& data, int si
|
|||||||
return j[0];
|
return j[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
uint256 Serializer::getSHA512Half(const unsigned char *data, int len)
|
||||||
|
{
|
||||||
|
uint256 j[2];
|
||||||
|
SHA512(data, len, (unsigned char *) j);
|
||||||
|
return j[0];
|
||||||
|
}
|
||||||
|
|
||||||
bool Serializer::checkSignature(int pubkeyOffset, int signatureOffset) const
|
bool Serializer::checkSignature(int pubkeyOffset, int signatureOffset) const
|
||||||
{
|
{
|
||||||
std::vector<unsigned char> pubkey, signature;
|
std::vector<unsigned char> pubkey, signature;
|
||||||
|
|||||||
@@ -47,6 +47,7 @@ class Serializer
|
|||||||
uint256 getSHA256(int size=-1) const;
|
uint256 getSHA256(int size=-1) const;
|
||||||
uint256 getSHA512Half(int size=-1) const;
|
uint256 getSHA512Half(int size=-1) const;
|
||||||
static uint256 getSHA512Half(const std::vector<unsigned char>& data, int size=-1);
|
static uint256 getSHA512Half(const std::vector<unsigned char>& data, int size=-1);
|
||||||
|
static uint256 getSHA512Half(const unsigned char *data, int len);
|
||||||
|
|
||||||
// totality functions
|
// totality functions
|
||||||
int getLength() const { return mData.size(); }
|
int getLength() const { return mData.size(); }
|
||||||
|
|||||||
Reference in New Issue
Block a user