OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_P224_SPAKE_H_ | 5 #ifndef CRYPTO_P224_SPAKE_H_ |
6 #define CRYPTO_P224_SPAKE_H_ | 6 #define CRYPTO_P224_SPAKE_H_ |
7 | 7 |
8 #include <crypto/p224.h> | |
9 #include <crypto/sha2.h> | |
10 #include <stdint.h> | 8 #include <stdint.h> |
11 | 9 |
| 10 #include <string> |
| 11 |
12 #include "base/gtest_prod_util.h" | 12 #include "base/gtest_prod_util.h" |
13 #include "base/strings/string_piece.h" | 13 #include "base/strings/string_piece.h" |
| 14 #include "crypto/p224.h" |
| 15 #include "crypto/sha2.h" |
14 | 16 |
15 namespace crypto { | 17 namespace crypto { |
16 | 18 |
17 // P224EncryptedKeyExchange implements SPAKE2, a variant of Encrypted | 19 // P224EncryptedKeyExchange implements SPAKE2, a variant of Encrypted |
18 // Key Exchange. It allows two parties that have a secret common | 20 // Key Exchange. It allows two parties that have a secret common |
19 // password to establish a common secure key by exchanging messages | 21 // password to establish a common secure key by exchanging messages |
20 // over an insecure channel without disclosing the password. | 22 // over an insecure channel without disclosing the password. |
21 // | 23 // |
22 // The password can be low entropy as authenticating with an attacker only | 24 // The password can be low entropy as authenticating with an attacker only |
23 // gives the attacker a one-shot password oracle. No other information about | 25 // gives the attacker a one-shot password oracle. No other information about |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 // expected_authenticator_ is used to store the hash value expected from the | 120 // expected_authenticator_ is used to store the hash value expected from the |
119 // other party. | 121 // other party. |
120 uint8_t expected_authenticator_[kSHA256Length]; | 122 uint8_t expected_authenticator_[kSHA256Length]; |
121 | 123 |
122 std::string key_; | 124 std::string key_; |
123 }; | 125 }; |
124 | 126 |
125 } // namespace crypto | 127 } // namespace crypto |
126 | 128 |
127 #endif // CRYPTO_P224_SPAKE_H_ | 129 #endif // CRYPTO_P224_SPAKE_H_ |
OLD | NEW |