Index: net/quic/core/crypto/chacha20_poly1305_encrypter_test.cc |
diff --git a/net/quic/core/crypto/chacha20_poly1305_encrypter_test.cc b/net/quic/core/crypto/chacha20_poly1305_encrypter_test.cc |
index 97528430ee33858689991bf6c8659a8b4603a649..f7c847a3bba4e3b97b9328b9cfb6286895c38883 100644 |
--- a/net/quic/core/crypto/chacha20_poly1305_encrypter_test.cc |
+++ b/net/quic/core/crypto/chacha20_poly1305_encrypter_test.cc |
@@ -11,7 +11,6 @@ |
#include "net/quic/platform/api/quic_text_utils.h" |
#include "net/quic/test_tools/quic_test_utils.h" |
-using base::StringPiece; |
using std::string; |
namespace { |
@@ -70,9 +69,9 @@ namespace test { |
// EncryptWithNonce wraps the |Encrypt| method of |encrypter| to allow passing |
// in an nonce and also to allocate the buffer needed for the ciphertext. |
QuicData* EncryptWithNonce(ChaCha20Poly1305Encrypter* encrypter, |
- StringPiece nonce, |
- StringPiece associated_data, |
- StringPiece plaintext) { |
+ QuicStringPiece nonce, |
+ QuicStringPiece associated_data, |
+ QuicStringPiece plaintext) { |
size_t ciphertext_size = encrypter->GetCiphertextSize(plaintext.length()); |
std::unique_ptr<char[]> ciphertext(new char[ciphertext_size]); |
@@ -102,7 +101,7 @@ TEST(ChaCha20Poly1305EncrypterTest, EncryptThenDecrypt) { |
ASSERT_TRUE(encrypter.EncryptPacket(QuicVersionMax(), packet_number, |
associated_data, plaintext, encrypted, |
&len, arraysize(encrypted))); |
- StringPiece ciphertext(encrypted, len); |
+ QuicStringPiece ciphertext(encrypted, len); |
char decrypted[1024]; |
ASSERT_TRUE(decrypter.DecryptPacket(QuicVersionMax(), packet_number, |
associated_data, ciphertext, decrypted, |
@@ -125,7 +124,8 @@ TEST(ChaCha20Poly1305EncrypterTest, Encrypt) { |
&encrypter, fixed + iv, |
// This deliberately tests that the encrypter can handle an AAD that |
// is set to nullptr, as opposed to a zero-length, non-nullptr pointer. |
- StringPiece(aad.length() ? aad.data() : nullptr, aad.length()), pt)); |
+ QuicStringPiece(aad.length() ? aad.data() : nullptr, aad.length()), |
+ pt)); |
ASSERT_TRUE(encrypted.get()); |
EXPECT_EQ(12u, ct.size() - pt.size()); |
EXPECT_EQ(12u, encrypted->length() - pt.size()); |