| 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);
|
| ~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
|
|
|