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

Side by Side Diff: crypto/hkdf.h

Issue 12330157: CRYPTO - Resolved comments from wtc. Used scoped_ptr<char[]> and (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 7 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | crypto/hkdf.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 CRYPTO_HKDF_H_ 5 #ifndef CRYPTO_HKDF_H_
6 #define CRYPTO_HKDF_H_ 6 #define CRYPTO_HKDF_H_
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 17 matching lines...) Expand all
28 // |info|: an (optional) label to distinguish different uses of HKDF. It is 28 // |info|: an (optional) label to distinguish different uses of HKDF. It is
29 // optional context and application specific information (can be a zero-length 29 // optional context and application specific information (can be a zero-length
30 // string). 30 // string).
31 // |key_bytes_to_generate|: the number of bytes of key material to generate. 31 // |key_bytes_to_generate|: the number of bytes of key material to generate.
32 // |iv_bytes_to_generate|: the number of bytes of IV to generate. 32 // |iv_bytes_to_generate|: the number of bytes of IV to generate.
33 HKDF(const base::StringPiece& secret, 33 HKDF(const base::StringPiece& secret,
34 const base::StringPiece& salt, 34 const base::StringPiece& salt,
35 const base::StringPiece& info, 35 const base::StringPiece& info,
36 size_t key_bytes_to_generate, 36 size_t key_bytes_to_generate,
37 size_t iv_bytes_to_generate); 37 size_t iv_bytes_to_generate);
38 virtual ~HKDF(); 38 ~HKDF();
39 39
40 base::StringPiece client_write_key() const { 40 base::StringPiece client_write_key() const {
41 return client_write_key_; 41 return client_write_key_;
42 } 42 }
43 base::StringPiece client_write_iv() const { 43 base::StringPiece client_write_iv() const {
44 return client_write_iv_; 44 return client_write_iv_;
45 } 45 }
46 base::StringPiece server_write_key() const { 46 base::StringPiece server_write_key() const {
47 return server_write_key_; 47 return server_write_key_;
48 } 48 }
49 base::StringPiece server_write_iv() const { 49 base::StringPiece server_write_iv() const {
50 return server_write_iv_; 50 return server_write_iv_;
51 } 51 }
52 52
53 private: 53 private:
54 std::vector<uint8> output_; 54 std::vector<uint8> output_;
55 55
56 base::StringPiece client_write_key_; 56 base::StringPiece client_write_key_;
57 base::StringPiece server_write_key_; 57 base::StringPiece server_write_key_;
58 base::StringPiece client_write_iv_; 58 base::StringPiece client_write_iv_;
59 base::StringPiece server_write_iv_; 59 base::StringPiece server_write_iv_;
60 }; 60 };
61 61
62 } // namespace crypto 62 } // namespace crypto
63 63
64 #endif // CRYPTO_HKDF_H_ 64 #endif // CRYPTO_HKDF_H_
OLDNEW
« no previous file with comments | « no previous file | crypto/hkdf.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698