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

Side by Side Diff: net/quic/crypto/p256_key_exchange.h

Issue 1787453002: Switch "const StringPiece&" to just "StringPiece" in QUIC code. No functional change. Not flag prot… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@116566297
Patch Set: Remove const StringPiece& from _nss crypto files. Created 4 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 unified diff | Download patch
« no previous file with comments | « net/quic/crypto/null_decrypter.cc ('k') | net/quic/crypto/p256_key_exchange_nss.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef NET_QUIC_CRYPTO_P256_KEY_EXCHANGE_H_ 5 #ifndef NET_QUIC_CRYPTO_P256_KEY_EXCHANGE_H_
6 #define NET_QUIC_CRYPTO_P256_KEY_EXCHANGE_H_ 6 #define NET_QUIC_CRYPTO_P256_KEY_EXCHANGE_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <string> 10 #include <string>
(...skipping 24 matching lines...) Expand all
35 // |private_key| is invalid, nullptr is returned. 35 // |private_key| is invalid, nullptr is returned.
36 static P256KeyExchange* New(base::StringPiece private_key); 36 static P256KeyExchange* New(base::StringPiece private_key);
37 37
38 // |NewPrivateKey| returns a private key, suitable for passing to |New|. 38 // |NewPrivateKey| returns a private key, suitable for passing to |New|.
39 // If |NewPrivateKey| can't generate a private key, it returns an empty 39 // If |NewPrivateKey| can't generate a private key, it returns an empty
40 // string. 40 // string.
41 static std::string NewPrivateKey(); 41 static std::string NewPrivateKey();
42 42
43 // KeyExchange interface. 43 // KeyExchange interface.
44 KeyExchange* NewKeyPair(QuicRandom* rand) const override; 44 KeyExchange* NewKeyPair(QuicRandom* rand) const override;
45 bool CalculateSharedKey(const base::StringPiece& peer_public_value, 45 bool CalculateSharedKey(base::StringPiece peer_public_value,
46 std::string* shared_key) const override; 46 std::string* shared_key) const override;
47 base::StringPiece public_value() const override; 47 base::StringPiece public_value() const override;
48 QuicTag tag() const override; 48 QuicTag tag() const override;
49 49
50 private: 50 private:
51 enum { 51 enum {
52 // A P-256 field element consists of 32 bytes. 52 // A P-256 field element consists of 32 bytes.
53 kP256FieldBytes = 32, 53 kP256FieldBytes = 32,
54 // A P-256 point in uncompressed form consists of 0x04 (to denote 54 // A P-256 point in uncompressed form consists of 0x04 (to denote
55 // that the point is uncompressed) followed by two, 32-byte field 55 // that the point is uncompressed) followed by two, 32-byte field
(...skipping 17 matching lines...) Expand all
73 scoped_ptr<crypto::ECPrivateKey> key_pair_; 73 scoped_ptr<crypto::ECPrivateKey> key_pair_;
74 #endif 74 #endif
75 // The public key stored as an uncompressed P-256 point. 75 // The public key stored as an uncompressed P-256 point.
76 uint8_t public_key_[kUncompressedP256PointBytes]; 76 uint8_t public_key_[kUncompressedP256PointBytes];
77 77
78 DISALLOW_COPY_AND_ASSIGN(P256KeyExchange); 78 DISALLOW_COPY_AND_ASSIGN(P256KeyExchange);
79 }; 79 };
80 80
81 } // namespace net 81 } // namespace net
82 #endif // NET_QUIC_CRYPTO_P256_KEY_EXCHANGE_H_ 82 #endif // NET_QUIC_CRYPTO_P256_KEY_EXCHANGE_H_
OLDNEW
« no previous file with comments | « net/quic/crypto/null_decrypter.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