#include "crypto/aead.h"
#include <stddef.h>
#include <stdint.h>
#include <string>
#include "base/containers/span.h"
#include "base/numerics/checked_math.h"
#include "third_party/boringssl/src/include/openssl/aes.h"
#include "third_party/boringssl/src/include/openssl/evp.h"
namespace crypto {
Aead::Aead(AeadAlgorithm algorithm) { … }
Aead::~Aead() = default;
void Aead::Init(base::span<const uint8_t> key) { … }
void Aead::Init(const std::string* key) { … }
std::vector<uint8_t> Aead::Seal(
base::span<const uint8_t> plaintext,
base::span<const uint8_t> nonce,
base::span<const uint8_t> additional_data) const { … }
bool Aead::Seal(std::string_view plaintext,
std::string_view nonce,
std::string_view additional_data,
std::string* ciphertext) const { … }
std::optional<std::vector<uint8_t>> Aead::Open(
base::span<const uint8_t> ciphertext,
base::span<const uint8_t> nonce,
base::span<const uint8_t> additional_data) const { … }
bool Aead::Open(std::string_view ciphertext,
std::string_view nonce,
std::string_view additional_data,
std::string* plaintext) const { … }
size_t Aead::KeyLength() const { … }
size_t Aead::NonceLength() const { … }
std::optional<size_t> Aead::Seal(base::span<const uint8_t> plaintext,
base::span<const uint8_t> nonce,
base::span<const uint8_t> additional_data,
base::span<uint8_t> out) const { … }
std::optional<size_t> Aead::Open(base::span<const uint8_t> plaintext,
base::span<const uint8_t> nonce,
base::span<const uint8_t> additional_data,
base::span<uint8_t> out) const { … }
}