Add benchmark tests to QUIC-LB library
PiperOrigin-RevId: 441515040
diff --git a/quiche/quic/load_balancer/load_balancer_config.cc b/quiche/quic/load_balancer/load_balancer_config.cc
index 5dc12fe..b0c161f 100644
--- a/quiche/quic/load_balancer/load_balancer_config.cc
+++ b/quiche/quic/load_balancer/load_balancer_config.cc
@@ -139,23 +139,23 @@
bool LoadBalancerConfig::EncryptionPass(uint8_t *target,
const uint8_t index) const {
- uint8_t plaintext[kLoadBalancerBlockSize], ciphertext[kLoadBalancerBlockSize];
+ uint8_t buf[kLoadBalancerBlockSize];
if (!key_.has_value() || target == nullptr) {
return false;
}
if (index % 2) { // Odd indices go from left to right
- TakePlaintextFromLeft(plaintext, target, plaintext_len(), index);
+ TakePlaintextFromLeft(buf, target, plaintext_len(), index);
} else {
- TakePlaintextFromRight(plaintext, target, plaintext_len(), index);
+ TakePlaintextFromRight(buf, target, plaintext_len(), index);
}
- if (!BlockEncrypt(plaintext, ciphertext)) {
+ if (!BlockEncrypt(buf, buf)) {
return false;
}
// XOR bits over the correct half.
if (index % 2) {
- CiphertextXorWithRight(target, ciphertext, plaintext_len());
+ CiphertextXorWithRight(target, buf, plaintext_len());
} else {
- CiphertextXorWithLeft(target, ciphertext, plaintext_len());
+ CiphertextXorWithLeft(target, buf, plaintext_len());
}
return true;
}