Move StrictTaggingDecrypter to quic_test_utils.h
PiperOrigin-RevId: 336171458
Change-Id: Ifbe5d2a13225d6cea37f164386e87da6e428326e
diff --git a/quic/core/quic_connection_test.cc b/quic/core/quic_connection_test.cc
index 3c37fa7..f480f88 100644
--- a/quic/core/quic_connection_test.cc
+++ b/quic/core/quic_connection_test.cc
@@ -108,23 +108,6 @@
}
}
-// StringTaggingDecrypter ensures that the final kTagSize bytes of the message
-// match the expected value.
-class StrictTaggingDecrypter : public TaggingDecrypter {
- public:
- explicit StrictTaggingDecrypter(uint8_t tag) : tag_(tag) {}
- ~StrictTaggingDecrypter() override {}
-
- // TaggingQuicDecrypter
- uint8_t GetTag(absl::string_view /*ciphertext*/) override { return tag_; }
-
- // Use a distinct value starting with 0xFFFFFF, which is never used by TLS.
- uint32_t cipher_id() const override { return 0xFFFFFFF1; }
-
- private:
- const uint8_t tag_;
-};
-
class TestConnectionHelper : public QuicConnectionHelperInterface {
public:
TestConnectionHelper(MockClock* clock, MockRandom* random_generator)
diff --git a/quic/test_tools/quic_test_utils.h b/quic/test_tools/quic_test_utils.h
index efb60c5..294b7db 100644
--- a/quic/test_tools/quic_test_utils.h
+++ b/quic/test_tools/quic_test_utils.h
@@ -1865,6 +1865,23 @@
bool CheckTag(absl::string_view ciphertext, uint8_t tag);
};
+// StringTaggingDecrypter ensures that the final kTagSize bytes of the message
+// match the expected value.
+class StrictTaggingDecrypter : public TaggingDecrypter {
+ public:
+ explicit StrictTaggingDecrypter(uint8_t tag) : tag_(tag) {}
+ ~StrictTaggingDecrypter() override {}
+
+ // TaggingQuicDecrypter
+ uint8_t GetTag(absl::string_view /*ciphertext*/) override { return tag_; }
+
+ // Use a distinct value starting with 0xFFFFFF, which is never used by TLS.
+ uint32_t cipher_id() const override { return 0xFFFFFFF1; }
+
+ private:
+ const uint8_t tag_;
+};
+
class TestPacketWriter : public QuicPacketWriter {
struct PacketBuffer {
QUIC_CACHELINE_ALIGNED char buffer[1500];