Encrypt a message with a specified aad.
Declared in <crypto/chacha20poly1305.h>
void
Encrypt(
std::span<std::byte const> plain,
std::span<std::byte const> aad,
std::span<std::byte> cipher) noexcept;
Requires cipher.size() = plain.size() + EXPANSION.
| Name | Description |
|---|---|
| plain | The plaintext to encrypt. |
| aad | The associated data to authenticate but not encrypt. |
| cipher | Output buffer receiving the ciphertext and authentication tag. |