[#BIP324Cipher-Decrypt]
= xref:BIP324Cipher.adoc[BIP324Cipher]::Decrypt
:relfileprefix: ../
:mrdocs:

Decrypt a packet&period; Only after Initialize()&period;

== Synopsis

Declared in `&lt;bip324&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
bool
Decrypt(
    std::span&lt;std::byte const&gt; input,
    std::span&lt;std::byte const&gt; aad,
    bool& ignore,
    std::span&lt;std::byte&gt; contents) noexcept;
----

== Description

It must hold that input&period;size() &plus; LENGTH&lowbar;LEN &equals;&equals; contents&period;size() &plus; EXPANSION&period; Contents&period;size() must equal the length returned by DecryptLength&period;

== Return Value

True if authentication and decryption succeeded&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *input*
| The encrypted packet body (excluding the length field)&period;
| *aad*
| Associated authenticated data covered by the tag but not encrypted&period;
| *ignore*
| Set to true if the decrypted packet has the ignore bit set&period;
| *contents*
| Output buffer receiving the decrypted contents&period;
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
