BIP324Cipher::Decrypt

Decrypt a packet. Only after Initialize().

Synopsis

Declared in <bip324.h>

bool
Decrypt(
    std::span<std::byte const> input,
    std::span<std::byte const> aad,
    bool& ignore,
    std::span<std::byte> contents) noexcept;

Description

It must hold that input.size() + LENGTH_LEN == contents.size() + EXPANSION. Contents.size() must equal the length returned by DecryptLength.

Return Value

True if authentication and decryption succeeded.

Parameters

NameDescription
inputThe encrypted packet body (excluding the length field).
aadAssociated authenticated data covered by the tag but not encrypted.
ignoreSet to true if the decrypted packet has the ignore bit set.
contentsOutput buffer receiving the decrypted contents.