Use std::array<char, 16> instead of uint128 for StatelessResetToken.
Using absl::uint128 does not make much sense since this is an opaque piece of
data with a fixed size of 16 octets (that happen to be the same as the size of
uint128), no numerical operations are performed on it. Keep absl::uint128
within QuicUtils::GenerateStatelessResetToken(), necessary for the hash
computations, but use the new alias StatelessResetToken elsewhere.
This is a follow-up to a drive-by comment at cl/366984087.
PiperOrigin-RevId: 367245431
Change-Id: Ie79796e22ed4b7c6862a55e0280e7943378d559a
diff --git a/quic/core/chlo_extractor.cc b/quic/core/chlo_extractor.cc
index 0cce9f9..48fe9a8 100644
--- a/quic/core/chlo_extractor.cc
+++ b/quic/core/chlo_extractor.cc
@@ -4,7 +4,6 @@
#include "quic/core/chlo_extractor.h"
-#include "absl/numeric/int128.h"
#include "absl/strings/match.h"
#include "absl/strings/string_view.h"
#include "quic/core/crypto/crypto_framer.h"
@@ -16,6 +15,7 @@
#include "quic/core/crypto/quic_encrypter.h"
#include "quic/core/frames/quic_ack_frequency_frame.h"
#include "quic/core/quic_framer.h"
+#include "quic/core/quic_types.h"
#include "quic/core/quic_utils.h"
#include "common/platform/api/quiche_text_utils.h"
@@ -82,7 +82,8 @@
bool OnHandshakeDoneFrame(const QuicHandshakeDoneFrame& frame) override;
bool OnAckFrequencyFrame(const QuicAckFrequencyFrame& farme) override;
void OnPacketComplete() override {}
- bool IsValidStatelessResetToken(absl::uint128 token) const override;
+ bool IsValidStatelessResetToken(
+ const StatelessResetToken& token) const override;
void OnAuthenticatedIetfStatelessResetPacket(
const QuicIetfStatelessResetPacket& /*packet*/) override {}
void OnKeyUpdate(KeyUpdateReason /*reason*/) override;
@@ -304,7 +305,7 @@
}
bool ChloFramerVisitor::IsValidStatelessResetToken(
- absl::uint128 /*token*/) const {
+ const StatelessResetToken& /*token*/) const {
return false;
}