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

Unified Diff: crypto/p224_spake.h

Issue 787803004: Update from https://crrev.com/307664 (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Rebase. Created 6 years 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 | « cc/trees/thread_proxy.cc ('k') | crypto/p224_spake.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: crypto/p224_spake.h
diff --git a/crypto/p224_spake.h b/crypto/p224_spake.h
index 61451a3a20cecfe54743226171ab2646029848ac..08769b76c247843e73fe2296793b157efecb2904 100644
--- a/crypto/p224_spake.h
+++ b/crypto/p224_spake.h
@@ -5,6 +5,7 @@
#ifndef CRYPTO_P224_SPAKE_H_
#define CRYPTO_P224_SPAKE_H_
+#include <base/gtest_prod_util.h>
#include <base/strings/string_piece.h>
#include <crypto/p224.h>
#include <crypto/sha2.h>
@@ -14,7 +15,7 @@ namespace crypto {
// P224EncryptedKeyExchange implements SPAKE2, a variant of Encrypted
// Key Exchange. It allows two parties that have a secret common
// password to establish a common secure key by exchanging messages
-// over unsecure channel without disclosing the password.
+// over an insecure channel without disclosing the password.
//
// The password can be low entropy as authenticating with an attacker only
// gives the attacker a one-shot password oracle. No other information about
@@ -85,6 +86,13 @@ class CRYPTO_EXPORT P224EncryptedKeyExchange {
kStateDone,
};
+ FRIEND_TEST_ALL_PREFIXES(MutualAuth, ExpectedValues);
+
+ void Init();
+
+ // Sets internal random scalar. Should be used by tests only.
+ void SetXForTesting(const std::string& x);
+
State state_;
const bool is_server_;
// next_message_ contains a value for GetMessage() to return.
@@ -104,7 +112,7 @@ class CRYPTO_EXPORT P224EncryptedKeyExchange {
// file).
uint8 x_[p224::kScalarBytes];
// pw_ is SHA256(P(password), P(session))[:28] where P() prepends a uint32,
- // big-endian length prefix (see paper refereneced in .cc file).
+ // big-endian length prefix (see paper referenced in .cc file).
uint8 pw_[p224::kScalarBytes];
// expected_authenticator_ is used to store the hash value expected from the
// other party.
« no previous file with comments | « cc/trees/thread_proxy.cc ('k') | crypto/p224_spake.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698