mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-29 23:45:51 +00:00
Refactor free functions into RandomNumbers
This commit is contained in:
@@ -105,7 +105,7 @@ std::vector<unsigned char> CKey::encryptECIES(CKey& otherKey, const std::vector<
|
||||
{
|
||||
|
||||
ECIES_ENC_IV_TYPE iv;
|
||||
getRand(static_cast<unsigned char *>(iv.begin()), ECIES_ENC_BLK_SIZE);
|
||||
RandomNumbers::getInstance ().fillBytes (iv.begin (), ECIES_ENC_BLK_SIZE);
|
||||
|
||||
ECIES_ENC_KEY_TYPE secret;
|
||||
ECIES_HMAC_KEY_TYPE hmacKey;
|
||||
@@ -268,7 +268,7 @@ bool checkECIES(void)
|
||||
std::vector<unsigned char> message(4096);
|
||||
int msglen = i%3000;
|
||||
|
||||
getRand(static_cast<unsigned char *>(&message.front()), msglen);
|
||||
RandomNumbers::getInstance ().fillBytes (&message.front(), msglen);
|
||||
message.resize(msglen);
|
||||
|
||||
// encrypt message with sender's private key and recipient's public key
|
||||
|
||||
@@ -803,7 +803,7 @@ void RippleAddress::setSeedRandom()
|
||||
// XXX Maybe we should call MakeNewKey
|
||||
uint128 key;
|
||||
|
||||
getRand(key.begin(), key.size());
|
||||
RandomNumbers::getInstance ().fillBytes (key.begin(), key.size());
|
||||
|
||||
RippleAddress::setSeed(key);
|
||||
}
|
||||
|
||||
@@ -57,6 +57,7 @@
|
||||
#include "crypto/ripple_CBigNum.h"
|
||||
#include "crypto/ripple_Base58.h" // VFALCO: TODO, Can be moved to .cpp if we clean up setAlphabet stuff
|
||||
#include "crypto/ripple_Base58Data.h"
|
||||
// #include "src/cpp/ripple/ProofOfWork.h"
|
||||
|
||||
#include "protocol/ripple_FieldNames.h"
|
||||
#include "protocol/ripple_RippleAddress.h"
|
||||
|
||||
Reference in New Issue
Block a user