AEADChaCha20Poly1305::Encrypt

Encrypt overloads

Synopses

Declared in <crypto/chacha20poly1305.h>

Encrypt a message with a specified 96-bit nonce and aad.

void
Encrypt(
    std::span<std::byte const> plain,
    std::span<std::byte const> aad,
    Nonce96 nonce,
    std::span<std::byte> cipher) noexcept;
» more...

Encrypt a message (given split into plain1 + plain2) with a specified 96-bit nonce and aad.

void
Encrypt(
    std::span<std::byte const> plain1,
    std::span<std::byte const> plain2,
    std::span<std::byte const> aad,
    Nonce96 nonce,
    std::span<std::byte> cipher) noexcept;
» more...

Parameters

NameDescription
plainThe plaintext to encrypt.
aadThe associated data to authenticate but not encrypt.
nonceThe 96-bit nonce.
cipherOutput buffer receiving the ciphertext and authentication tag.
plain1The first part of the plaintext to encrypt.
plain2The second part of the plaintext to encrypt.