mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-10 22:18:54 +01:00
refactor: Allow std::span construction from CKey
This commit is contained in:
@@ -280,7 +280,7 @@ bool LegacyScriptPubKeyMan::Encrypt(const CKeyingMaterial& master_key, WalletBat
|
||||
{
|
||||
const CKey &key = mKey.second;
|
||||
CPubKey vchPubKey = key.GetPubKey();
|
||||
CKeyingMaterial vchSecret(key.begin(), key.end());
|
||||
CKeyingMaterial vchSecret{UCharCast(key.begin()), UCharCast(key.end())};
|
||||
std::vector<unsigned char> vchCryptedSecret;
|
||||
if (!EncryptSecret(master_key, vchSecret, vchPubKey.GetHash(), vchCryptedSecret)) {
|
||||
encrypted_batch = nullptr;
|
||||
@@ -810,7 +810,7 @@ bool LegacyScriptPubKeyMan::AddKeyPubKeyInner(const CKey& key, const CPubKey &pu
|
||||
}
|
||||
|
||||
std::vector<unsigned char> vchCryptedSecret;
|
||||
CKeyingMaterial vchSecret(key.begin(), key.end());
|
||||
CKeyingMaterial vchSecret{UCharCast(key.begin()), UCharCast(key.end())};
|
||||
if (!EncryptSecret(m_storage.GetEncryptionKey(), vchSecret, pubkey.GetHash(), vchCryptedSecret)) {
|
||||
return false;
|
||||
}
|
||||
@@ -2088,7 +2088,7 @@ bool DescriptorScriptPubKeyMan::Encrypt(const CKeyingMaterial& master_key, Walle
|
||||
{
|
||||
const CKey &key = key_in.second;
|
||||
CPubKey pubkey = key.GetPubKey();
|
||||
CKeyingMaterial secret(key.begin(), key.end());
|
||||
CKeyingMaterial secret{UCharCast(key.begin()), UCharCast(key.end())};
|
||||
std::vector<unsigned char> crypted_secret;
|
||||
if (!EncryptSecret(master_key, secret, pubkey.GetHash(), crypted_secret)) {
|
||||
return false;
|
||||
@@ -2261,7 +2261,7 @@ bool DescriptorScriptPubKeyMan::AddDescriptorKeyWithDB(WalletBatch& batch, const
|
||||
}
|
||||
|
||||
std::vector<unsigned char> crypted_secret;
|
||||
CKeyingMaterial secret(key.begin(), key.end());
|
||||
CKeyingMaterial secret{UCharCast(key.begin()), UCharCast(key.end())};
|
||||
if (!EncryptSecret(m_storage.GetEncryptionKey(), secret, pubkey.GetHash(), crypted_secret)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user