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

Method SetKey

src/wallet/crypter.cpp:34–43  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 2

EncryptSecretFunction · 0.45
DecryptSecretFunction · 0.45

Calls 2

memcpyFunction · 0.85
sizeMethod · 0.45

Tested by

no test coverage detected