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

Unified Diff: net/quic/crypto/p256_key_exchange.h

Issue 992733002: Remove //net (except for Android test stuff) and sdch (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 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
« no previous file with comments | « net/quic/crypto/null_encrypter_test.cc ('k') | net/quic/crypto/p256_key_exchange_nss.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/crypto/p256_key_exchange.h
diff --git a/net/quic/crypto/p256_key_exchange.h b/net/quic/crypto/p256_key_exchange.h
deleted file mode 100644
index 9e22a335df817d6bbbc4c10020e96cb066ebd464..0000000000000000000000000000000000000000
--- a/net/quic/crypto/p256_key_exchange.h
+++ /dev/null
@@ -1,79 +0,0 @@
-// Copyright (c) 2013 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef NET_QUIC_CRYPTO_P256_KEY_EXCHANGE_H_
-#define NET_QUIC_CRYPTO_P256_KEY_EXCHANGE_H_
-
-#include <string>
-
-#include "base/memory/scoped_ptr.h"
-#include "base/strings/string_piece.h"
-#include "net/base/net_export.h"
-#include "net/quic/crypto/key_exchange.h"
-
-#if defined(USE_OPENSSL)
-#include "crypto/openssl_util.h"
-#include "crypto/scoped_openssl_types.h"
-#else
-#include "crypto/ec_private_key.h"
-#include "crypto/scoped_nss_types.h"
-#endif
-
-namespace net {
-
-// P256KeyExchange implements a KeyExchange using elliptic-curve
-// Diffie-Hellman on NIST P-256.
-class NET_EXPORT_PRIVATE P256KeyExchange : public KeyExchange {
- public:
- ~P256KeyExchange() override;
-
- // New creates a new key exchange object from a private key. If
- // |private_key| is invalid, nullptr is returned.
- static P256KeyExchange* New(base::StringPiece private_key);
-
- // |NewPrivateKey| returns a private key, suitable for passing to |New|.
- // If |NewPrivateKey| can't generate a private key, it returns an empty
- // string.
- static std::string NewPrivateKey();
-
- // KeyExchange interface.
- KeyExchange* NewKeyPair(QuicRandom* rand) const override;
- bool CalculateSharedKey(const base::StringPiece& peer_public_value,
- std::string* shared_key) const override;
- base::StringPiece public_value() const override;
- QuicTag tag() const override;
-
- private:
- enum {
- // A P-256 field element consists of 32 bytes.
- kP256FieldBytes = 32,
- // A P-256 point in uncompressed form consists of 0x04 (to denote
- // that the point is uncompressed) followed by two, 32-byte field
- // elements.
- kUncompressedP256PointBytes = 1 + 2 * kP256FieldBytes,
- // The first byte in an uncompressed P-256 point.
- kUncompressedECPointForm = 0x04,
- };
-
-#if defined(USE_OPENSSL)
- // P256KeyExchange takes ownership of |private_key|, and expects
- // |public_key| consists of |kUncompressedP256PointBytes| bytes.
- P256KeyExchange(EC_KEY* private_key, const uint8* public_key);
-
- crypto::ScopedEC_KEY private_key_;
-#else
- // P256KeyExchange takes ownership of |key_pair|, and expects
- // |public_key| consists of |kUncompressedP256PointBytes| bytes.
- P256KeyExchange(crypto::ECPrivateKey* key_pair, const uint8* public_key);
-
- scoped_ptr<crypto::ECPrivateKey> key_pair_;
-#endif
- // The public key stored as an uncompressed P-256 point.
- uint8 public_key_[kUncompressedP256PointBytes];
-
- DISALLOW_COPY_AND_ASSIGN(P256KeyExchange);
-};
-
-} // namespace net
-#endif // NET_QUIC_CRYPTO_P256_KEY_EXCHANGE_H_
« no previous file with comments | « net/quic/crypto/null_encrypter_test.cc ('k') | net/quic/crypto/p256_key_exchange_nss.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698