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

Name

Description

input

The encrypted packet body (excluding the length field).

aad

Associated authenticated data covered by the tag but not encrypted.

ignore

Set to true if the decrypted packet has the ignore bit set.

contents

Output buffer receiving the decrypted contents.

Created with MrDocs