MCPcopy Create free account
hub / github.com/LUX-Core/lux / SetKey

Method SetKey

src/crypter.cpp:38–48  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

36}
37
38bool CCrypter::SetKey(const CKeyingMaterial& chNewKey, const std::vector<unsigned char>& chNewIV)
39{
40 if (chNewKey.size() != WALLET_CRYPTO_KEY_SIZE || chNewIV.size() != WALLET_CRYPTO_KEY_SIZE)
41 return false;
42
43 memcpy(&chKey[0], &chNewKey[0], sizeof chKey);
44 memcpy(&chIV[0], &chNewIV[0], sizeof chIV);
45
46 fKeySet = true;
47 return true;
48}
49
50bool CCrypter::Encrypt(const CKeyingMaterial& vchPlaintext, std::vector<unsigned char>& vchCiphertext)
51{

Callers 2

EncryptSecretFunction · 0.45
DecryptSecretFunction · 0.45

Calls 2

memcpyFunction · 0.85
sizeMethod · 0.45

Tested by

no test coverage detected