| 126 | } |
| 127 | |
| 128 | bool DecryptKey(const CKeyingMaterial& vMasterKey, const std::vector<unsigned char>& vchCryptedSecret, const CPubKey& vchPubKey, CKey& key) |
| 129 | { |
| 130 | CKeyingMaterial vchSecret; |
| 131 | if(!DecryptSecret(vMasterKey, vchCryptedSecret, vchPubKey.GetHash(), vchSecret)) |
| 132 | return false; |
| 133 | |
| 134 | if (vchSecret.size() != 32) |
| 135 | return false; |
| 136 | |
| 137 | key.Set(vchSecret.begin(), vchSecret.end(), vchPubKey.IsCompressed()); |
| 138 | return key.VerifyPubKey(vchPubKey); |
| 139 | } |
| 140 | } // namespace wallet |
no test coverage detected