Decrypt a message with a specified aad. Returns true if valid.
Declared in <crypto/chacha20poly1305.h>
bool
Decrypt(
std::span<std::byte const> cipher,
std::span<std::byte const> aad,
std::span<std::byte> plain) noexcept;
Requires cipher.size() = plain.size() + EXPANSION.
true if the tag is valid and decryption succeeded, false otherwise.
| Name | Description |
|---|---|
| cipher | The ciphertext and authentication tag to decrypt and verify. |
| aad | The associated data to authenticate. |
| plain | Output buffer receiving the recovered plaintext. |