101 | @@ -102,7 +102,7 @@ bool CCrypter::Decrypt(const std::vector<unsigned char>& vchCiphertext, CKeyingM
102 | }
103 |
104 |
105 | -bool EncryptSecret(const CKeyingMaterial& vMasterKey, const CKeyingMaterial &vchPlaintext, const uint256& nIV, std::vector<unsigned char> &vchCiphertext)
106 | +static bool EncryptSecret(const CKeyingMaterial& vMasterKey, const CKeyingMaterial &vchPlaintext, const uint256& nIV, std::vector<unsigned char> &vchCiphertext)
Just for my personal knowledge, what is the benefit oft his static change?
It emphasises that these functions are "internal" to crypter.cpp.
It means the function is local to the compilation unit (the object file produced from this .cpp file), and can't be accessed from outside. That means that it doesn't have to be unique (there cannot be a collision with a function with the same name elsewhere), it can allow more optimizations (for example if all cases can be inlined, there doesn't need to be a full separate version of it), and it reduces link time (because the symbol doesn't need to be exported).
Thanks for that explanations guys :).