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

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

Issue 14816006: Land Recent QUIC changes (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Added missing NET_PRIVATE_EXPORT to QuicWallTime Created 7 years, 7 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
« no previous file with comments | « net/quic/crypto/curve25519_key_exchange.h ('k') | net/quic/crypto/curve25519_key_exchange_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/crypto/curve25519_key_exchange.cc
diff --git a/net/quic/crypto/curve25519_key_exchange.cc b/net/quic/crypto/curve25519_key_exchange.cc
index a4c20fa427302613abd2ed0236696cdcca4ef2b8..3b8880453a38c4e3ea690b40e00f600b9295355c 100644
--- a/net/quic/crypto/curve25519_key_exchange.cc
+++ b/net/quic/crypto/curve25519_key_exchange.cc
@@ -13,11 +13,9 @@ using std::string;
namespace net {
-Curve25519KeyExchange::Curve25519KeyExchange() {
-}
+Curve25519KeyExchange::Curve25519KeyExchange() {}
-Curve25519KeyExchange::~Curve25519KeyExchange() {
-}
+Curve25519KeyExchange::~Curve25519KeyExchange() {}
// static
Curve25519KeyExchange* Curve25519KeyExchange::New(
@@ -29,9 +27,8 @@ Curve25519KeyExchange* Curve25519KeyExchange::New(
COMPILE_ASSERT(
sizeof(ka->private_key_) == crypto::curve25519::kScalarBytes,
header_out_of_sync);
- COMPILE_ASSERT(
- sizeof(ka->public_key_) == crypto::curve25519::kBytes,
- header_out_of_sync);
+ COMPILE_ASSERT(sizeof(ka->public_key_) == crypto::curve25519::kBytes,
+ header_out_of_sync);
if (private_key.size() != crypto::curve25519::kScalarBytes) {
return NULL;
@@ -57,6 +54,11 @@ string Curve25519KeyExchange::NewPrivateKey(QuicRandom* rand) {
return string(reinterpret_cast<char*>(private_key), sizeof(private_key));
}
+KeyExchange* Curve25519KeyExchange::NewKeyPair(QuicRandom* rand) const {
+ const string private_value = NewPrivateKey(rand);
+ return Curve25519KeyExchange::New(private_value);
+}
+
bool Curve25519KeyExchange::CalculateSharedKey(
const StringPiece& peer_public_value,
string* out_result) const {
@@ -79,8 +81,6 @@ StringPiece Curve25519KeyExchange::public_value() const {
sizeof(public_key_));
}
-CryptoTag Curve25519KeyExchange::tag() const {
- return kC255;
-}
+QuicTag Curve25519KeyExchange::tag() const { return kC255; }
} // namespace net
« no previous file with comments | « net/quic/crypto/curve25519_key_exchange.h ('k') | net/quic/crypto/curve25519_key_exchange_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698