Derives the encryption key and IV from a passphrase and salt.
Declared in <wallet/crypter.h>
[[nodiscard]]
bool
SetKeyFromPassphrase(
SecureString const& key_data,
std::span<unsigned char const> salt,
unsigned int rounds,
unsigned int derivation_method);
true if the key was derived and set successfully.
The return value should not be discarded.
| Name | Description |
|---|---|
| key_data | The passphrase to derive the key from. |
| salt | The salt to mix into the derivation. |
| rounds | The number of derivation rounds to perform. |
| derivation_method | The derivation method to use (0 = SHA-512). |