MCPcopy Create free account
hub / github.com/bitcoin/bitcoin / DecryptSecret

Function DecryptSecret

src/wallet/crypter.cpp:121–130  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

119}
120
121bool DecryptSecret(const CKeyingMaterial& master_key, const std::span<const unsigned char> ciphertext, const uint256& iv, CKeyingMaterial& plaintext)
122{
123 CCrypter key_crypter;
124 static_assert(WALLET_CRYPTO_IV_SIZE <= std::remove_reference_t<decltype(iv)>::size());
125 const std::span iv_prefix{iv.data(), WALLET_CRYPTO_IV_SIZE};
126 if (!key_crypter.SetKey(master_key, iv_prefix)) {
127 return false;
128 }
129 return key_crypter.Decrypt(ciphertext, plaintext);
130}
131
132bool DecryptKey(const CKeyingMaterial& master_key, const std::span<const unsigned char> crypted_secret, const CPubKey& pub_key, CKey& key)
133{

Callers 1

DecryptKeyFunction · 0.85

Calls 4

sizeFunction · 0.85
dataMethod · 0.45
SetKeyMethod · 0.45
DecryptMethod · 0.45

Tested by

no test coverage detected