#include "quiche/quic/core/crypto/chacha20_poly1305_encrypter.h"
#include <memory>
#include <string>
#include "absl/base/macros.h"
#include "absl/strings/escaping.h"
#include "absl/strings/string_view.h"
#include "quiche/quic/core/crypto/chacha20_poly1305_decrypter.h"
#include "quiche/quic/core/quic_utils.h"
#include "quiche/quic/platform/api/quic_test.h"
#include "quiche/quic/test_tools/quic_test_utils.h"
#include "quiche/common/test_tools/quiche_test_utils.h"
namespace {
struct TestVector { … };
const TestVector test_vectors[] = …;
}
namespace quic {
namespace test {
QuicData* EncryptWithNonce(ChaCha20Poly1305Encrypter* encrypter,
absl::string_view nonce,
absl::string_view associated_data,
absl::string_view plaintext) { … }
class ChaCha20Poly1305EncrypterTest : public QuicTest { … };
TEST_F(ChaCha20Poly1305EncrypterTest, EncryptThenDecrypt) { … }
TEST_F(ChaCha20Poly1305EncrypterTest, Encrypt) { … }
TEST_F(ChaCha20Poly1305EncrypterTest, GetMaxPlaintextSize) { … }
TEST_F(ChaCha20Poly1305EncrypterTest, GetCiphertextSize) { … }
}
}