Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(79)

Unified Diff: net/quic/core/crypto/curve25519_key_exchange.cc

Issue 2740453006: Add QuicStringPiece which is actually StringPiece. (Closed)
Patch Set: fix compile error and rebase Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: net/quic/core/crypto/curve25519_key_exchange.cc
diff --git a/net/quic/core/crypto/curve25519_key_exchange.cc b/net/quic/core/crypto/curve25519_key_exchange.cc
index 99e62cbfe196e24308ecb758311edbdd3addcb1a..7a8dbcec5833b62db7d4d91a897d530f5ffffddd 100644
--- a/net/quic/core/crypto/curve25519_key_exchange.cc
+++ b/net/quic/core/crypto/curve25519_key_exchange.cc
@@ -9,7 +9,6 @@
#include "net/quic/core/crypto/quic_random.h"
#include "third_party/boringssl/src/include/openssl/curve25519.h"
-using base::StringPiece;
using std::string;
namespace net {
@@ -19,7 +18,7 @@ Curve25519KeyExchange::Curve25519KeyExchange() {}
Curve25519KeyExchange::~Curve25519KeyExchange() {}
// static
-Curve25519KeyExchange* Curve25519KeyExchange::New(StringPiece private_key) {
+Curve25519KeyExchange* Curve25519KeyExchange::New(QuicStringPiece private_key) {
Curve25519KeyExchange* ka;
// We don't want to #include the BoringSSL headers in the public header file,
// so we use literals for the sizes of private_key_ and public_key_. Here we
@@ -52,8 +51,9 @@ KeyExchange* Curve25519KeyExchange::NewKeyPair(QuicRandom* rand) const {
return Curve25519KeyExchange::New(private_value);
}
-bool Curve25519KeyExchange::CalculateSharedKey(StringPiece peer_public_value,
- string* out_result) const {
+bool Curve25519KeyExchange::CalculateSharedKey(
+ QuicStringPiece peer_public_value,
+ string* out_result) const {
if (peer_public_value.size() != X25519_PUBLIC_VALUE_LEN) {
return false;
}
@@ -68,9 +68,9 @@ bool Curve25519KeyExchange::CalculateSharedKey(StringPiece peer_public_value,
return true;
}
-StringPiece Curve25519KeyExchange::public_value() const {
- return StringPiece(reinterpret_cast<const char*>(public_key_),
- sizeof(public_key_));
+QuicStringPiece Curve25519KeyExchange::public_value() const {
+ return QuicStringPiece(reinterpret_cast<const char*>(public_key_),
+ sizeof(public_key_));
}
QuicTag Curve25519KeyExchange::tag() const {
« no previous file with comments | « net/quic/core/crypto/curve25519_key_exchange.h ('k') | net/quic/core/crypto/curve25519_key_exchange_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698