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

Decrypt a message with a specified aad&period; Returns true if valid&period;

== Synopsis

Declared in `&lt;crypto&sol;chacha20poly1305&period;h&gt;`

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

== Description

Requires cipher&period;size() &equals; plain&period;size() &plus; EXPANSION&period;

== Return Value

true if the tag is valid and decryption succeeded, false otherwise&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *cipher*
| The ciphertext and authentication tag to decrypt and verify&period;
| *aad*
| The associated data to authenticate&period;
| *plain*
| Output buffer receiving the recovered plaintext&period;
|===


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