#include "quiche/quic/core/crypto/aead_base_encrypter.h"
#include <algorithm>
#include "absl/base/macros.h"
#include "absl/strings/string_view.h"
#include "openssl/crypto.h"
#include "openssl/err.h"
#include "openssl/evp.h"
#include "quiche/quic/core/quic_utils.h"
#include "quiche/quic/platform/api/quic_bug_tracker.h"
#include "quiche/quic/platform/api/quic_logging.h"
#include "quiche/common/quiche_crypto_logging.h"
namespace quic {
DLogOpenSslErrors;
namespace {
const EVP_AEAD* InitAndCall(const EVP_AEAD* (*aead_getter)()) { … }
}
AeadBaseEncrypter::AeadBaseEncrypter(const EVP_AEAD* (*aead_getter)(),
size_t key_size, size_t auth_tag_size,
size_t nonce_size,
bool use_ietf_nonce_construction)
: … { … }
AeadBaseEncrypter::~AeadBaseEncrypter() { … }
bool AeadBaseEncrypter::SetKey(absl::string_view key) { … }
bool AeadBaseEncrypter::SetNoncePrefix(absl::string_view nonce_prefix) { … }
bool AeadBaseEncrypter::SetIV(absl::string_view iv) { … }
bool AeadBaseEncrypter::Encrypt(absl::string_view nonce,
absl::string_view associated_data,
absl::string_view plaintext,
unsigned char* output) { … }
bool AeadBaseEncrypter::EncryptPacket(uint64_t packet_number,
absl::string_view associated_data,
absl::string_view plaintext, char* output,
size_t* output_length,
size_t max_output_length) { … }
size_t AeadBaseEncrypter::GetKeySize() const { … }
size_t AeadBaseEncrypter::GetNoncePrefixSize() const { … }
size_t AeadBaseEncrypter::GetIVSize() const { … }
size_t AeadBaseEncrypter::GetMaxPlaintextSize(size_t ciphertext_size) const { … }
size_t AeadBaseEncrypter::GetCiphertextSize(size_t plaintext_size) const { … }
absl::string_view AeadBaseEncrypter::GetKey() const { … }
absl::string_view AeadBaseEncrypter::GetNoncePrefix() const { … }
}