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

Unified Diff: crypto/hkdf.h

Issue 423333002: Implement QUIC key extraction. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Pass a size_t constant as a size_t argument. Created 6 years, 5 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 | « no previous file | crypto/hkdf.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: crypto/hkdf.h
diff --git a/crypto/hkdf.h b/crypto/hkdf.h
index 1d7a87673a1d7be7c9d95b18e490e485f59d8957..e91bccf5b4f38c1f486c8423b28813d09de8662e 100644
--- a/crypto/hkdf.h
+++ b/crypto/hkdf.h
@@ -8,9 +8,7 @@
#include <vector>
#include "base/basictypes.h"
-#include "base/memory/scoped_ptr.h"
#include "base/strings/string_piece.h"
-#include "build/build_config.h"
#include "crypto/crypto_export.h"
namespace crypto {
@@ -20,7 +18,7 @@ namespace crypto {
// See https://tools.ietf.org/html/rfc5869 for details.
class CRYPTO_EXPORT HKDF {
public:
- // |secret|: The input shared secret (or, from RFC 5869, the IKM).
+ // |secret|: the input shared secret (or, from RFC 5869, the IKM).
// |salt|: an (optional) public salt / non-secret random value. While
// optional, callers are strongly recommended to provide a salt. There is no
// added security value in making this larger than the SHA-256 block size of
@@ -28,13 +26,18 @@ class CRYPTO_EXPORT HKDF {
// |info|: an (optional) label to distinguish different uses of HKDF. It is
// optional context and application specific information (can be a zero-length
// string).
- // |key_bytes_to_generate|: the number of bytes of key material to generate.
- // |iv_bytes_to_generate|: the number of bytes of IV to generate.
+ // |key_bytes_to_generate|: the number of bytes of key material to generate
+ // for both client and server.
+ // |iv_bytes_to_generate|: the number of bytes of IV to generate for both
+ // client and server.
+ // |subkey_secret_bytes_to_generate|: the number of bytes of subkey secret to
+ // generate, shared between client and server.
HKDF(const base::StringPiece& secret,
const base::StringPiece& salt,
const base::StringPiece& info,
size_t key_bytes_to_generate,
- size_t iv_bytes_to_generate);
+ size_t iv_bytes_to_generate,
+ size_t subkey_secret_bytes_to_generate);
wtc 2014/07/30 18:16:52 Adam: while porting this change to Chromium, I rea
~HKDF();
base::StringPiece client_write_key() const {
@@ -49,6 +52,9 @@ class CRYPTO_EXPORT HKDF {
base::StringPiece server_write_iv() const {
return server_write_iv_;
}
+ base::StringPiece subkey_secret() const {
+ return subkey_secret_;
+ }
private:
std::vector<uint8> output_;
@@ -57,6 +63,7 @@ class CRYPTO_EXPORT HKDF {
base::StringPiece server_write_key_;
base::StringPiece client_write_iv_;
base::StringPiece server_write_iv_;
+ base::StringPiece subkey_secret_;
};
} // namespace crypto
« 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