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

Method SetKey

src/wallet/crypter.cpp:63–74  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

61}
62
63bool CCrypter::SetKey(const CKeyingMaterial& new_key, const std::span<const unsigned char> new_iv)
64{
65 if (new_key.size() != WALLET_CRYPTO_KEY_SIZE || new_iv.size() != WALLET_CRYPTO_IV_SIZE) {
66 return false;
67 }
68
69 memcpy(vchKey.data(), new_key.data(), new_key.size());
70 memcpy(vchIV.data(), new_iv.data(), new_iv.size());
71
72 fKeySet = true;
73 return true;
74}
75
76bool CCrypter::Encrypt(const CKeyingMaterial& vchPlaintext, std::vector<unsigned char> &vchCiphertext) const
77{

Callers 6

RandomSeedMethod · 0.45
EncryptSecretFunction · 0.45
DecryptSecretFunction · 0.45
TestFSChaCha20Method · 0.45
FUZZ_TARGETFunction · 0.45
FUZZ_TARGETFunction · 0.45

Calls 2

sizeMethod · 0.45
dataMethod · 0.45

Tested by 3

TestFSChaCha20Method · 0.36
FUZZ_TARGETFunction · 0.36
FUZZ_TARGETFunction · 0.36