wallet::DecryptSecret

Decrypts a secret with the master key using the given IV.

Synopsis

Declared in <wallet/crypter.h>

[[nodiscard]]
bool
DecryptSecret(
    CKeyingMaterial const& master_key,
    std::span<unsigned char const> ciphertext,
    uint256 const& iv,
    CKeyingMaterial& plaintext);

Return Value

true if decryption succeeded.

NOTE

The return value should not be discarded.

Parameters

NameDescription
master_keyThe master key used as the decryption key.
ciphertextThe ciphertext to decrypt.
ivSource of the initialization vector.
plaintextReceives the recovered secret.