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

Function EncryptSecret

src/wallet/crypter.cpp:107–115  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

105}
106
107bool EncryptSecret(const CKeyingMaterial& vMasterKey, const CKeyingMaterial& vchPlaintext, const uint256& nIV,
108 vector<unsigned char>& vchCiphertext) {
109 CCrypter cKeyCrypter;
110 vector<unsigned char> chIV(WALLET_CRYPTO_KEY_SIZE);
111 memcpy(&chIV[0], &nIV, WALLET_CRYPTO_KEY_SIZE);
112 if (!cKeyCrypter.SetKey(vMasterKey, chIV))
113 return false;
114 return cKeyCrypter.Encrypt(*((const CKeyingMaterial*)&vchPlaintext), vchCiphertext);
115}
116
117bool DecryptSecret(const CKeyingMaterial& vMasterKey, const vector<unsigned char>& vchCiphertext, const uint256& nIV,
118 CKeyingMaterial& vchPlaintext) {

Callers 2

AddKeyCombiMethod · 0.85
EncryptKeysMethod · 0.85

Calls 3

memcpyFunction · 0.85
SetKeyMethod · 0.45
EncryptMethod · 0.45

Tested by

no test coverage detected