mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Replace const Type& with Type const& for common types.
* std::string * RippleAccount * Account * Currency * uint256 * STAmount * Json::Value
This commit is contained in:
committed by
Vinnie Falco
parent
f5afe0587f
commit
648ccc7c17
@@ -24,7 +24,7 @@ namespace ripple {
|
||||
// Functions to add CKey support for deterministic EC keys
|
||||
|
||||
// <-- seed
|
||||
uint128 CKey::PassPhraseToKey (const std::string& passPhrase)
|
||||
uint128 CKey::PassPhraseToKey (std::string const& passPhrase)
|
||||
{
|
||||
Serializer s;
|
||||
|
||||
@@ -189,7 +189,7 @@ EC_KEY* CKey::GenerateRootPubKey (BIGNUM* pubGenerator)
|
||||
}
|
||||
|
||||
// --> public generator
|
||||
static BIGNUM* makeHash (const RippleAddress& pubGen, int seq, BIGNUM* order)
|
||||
static BIGNUM* makeHash (RippleAddress const& pubGen, int seq, BIGNUM* order)
|
||||
{
|
||||
int subSeq = 0;
|
||||
BIGNUM* ret = nullptr;
|
||||
@@ -212,7 +212,7 @@ static BIGNUM* makeHash (const RippleAddress& pubGen, int seq, BIGNUM* order)
|
||||
}
|
||||
|
||||
// --> public generator
|
||||
EC_KEY* CKey::GeneratePublicDeterministicKey (const RippleAddress& pubGen, int seq)
|
||||
EC_KEY* CKey::GeneratePublicDeterministicKey (RippleAddress const& pubGen, int seq)
|
||||
{
|
||||
// publicKey(n) = rootPublicKey EC_POINT_+ Hash(pubHash|seq)*point
|
||||
BIGNUM* generator = BN_bin2bn (
|
||||
@@ -285,14 +285,14 @@ EC_KEY* CKey::GeneratePublicDeterministicKey (const RippleAddress& pubGen, int s
|
||||
return success ? pkey : nullptr;
|
||||
}
|
||||
|
||||
EC_KEY* CKey::GeneratePrivateDeterministicKey (const RippleAddress& pubGen, uint256 const& u, int seq)
|
||||
EC_KEY* CKey::GeneratePrivateDeterministicKey (RippleAddress const& pubGen, uint256 const& u, int seq)
|
||||
{
|
||||
CBigNum bn (u);
|
||||
return GeneratePrivateDeterministicKey (pubGen, static_cast<BIGNUM*> (&bn), seq);
|
||||
}
|
||||
|
||||
// --> root private key
|
||||
EC_KEY* CKey::GeneratePrivateDeterministicKey (const RippleAddress& pubGen, const BIGNUM* rootPrivKey, int seq)
|
||||
EC_KEY* CKey::GeneratePrivateDeterministicKey (RippleAddress const& pubGen, const BIGNUM* rootPrivKey, int seq)
|
||||
{
|
||||
// privateKey(n) = (rootPrivateKey + Hash(pubHash|seq)) % order
|
||||
BN_CTX* ctx = BN_CTX_new ();
|
||||
|
||||
Reference in New Issue
Block a user