AEADChaCha20Poly1305::Decrypt

Decrypt overloads

Synopses

Declared in <crypto/chacha20poly1305.h>

Decrypt a message with a specified 96-bit nonce and aad. Returns true if valid.

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

Decrypt a message with a specified 96-bit nonce and aad and split the result. Returns true if valid.

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

Return Value

true if the tag is valid and decryption succeeded, false otherwise.

Parameters

NameDescription
cipherThe ciphertext and authentication tag to decrypt and verify.
aadThe associated data to authenticate.
nonceThe 96-bit nonce.
plainOutput buffer receiving the recovered plaintext.
plain1Output buffer receiving the first part of the recovered plaintext.
plain2Output buffer receiving the second part of the recovered plaintext.