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

Side by Side Diff: crypto/p224_spake_unittest.cc

Issue 407713002: clean up code at crypto folder. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: revert code around 84line at p224.cc 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 unified diff | Download patch
« no previous file with comments | « crypto/p224.cc ('k') | crypto/rsa_private_key_unittest.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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 #include <string>
5 #include <crypto/p224_spake.h> 6 #include <crypto/p224_spake.h>
6 7
7 #include "base/logging.h" 8 #include "base/logging.h"
8 #include "testing/gtest/include/gtest/gtest.h" 9 #include "testing/gtest/include/gtest/gtest.h"
9 10
10 namespace crypto { 11 namespace crypto {
11 12
12 namespace { 13 namespace {
13 14
14 bool RunExchange(P224EncryptedKeyExchange* client, 15 bool RunExchange(P224EncryptedKeyExchange* client,
15 P224EncryptedKeyExchange* server) { 16 P224EncryptedKeyExchange* server) {
16
17 for (;;) { 17 for (;;) {
18 std::string client_message, server_message; 18 std::string client_message, server_message;
19 client_message = client->GetMessage(); 19 client_message = client->GetMessage();
20 server_message = server->GetMessage(); 20 server_message = server->GetMessage();
21 21
22 P224EncryptedKeyExchange::Result client_result, server_result; 22 P224EncryptedKeyExchange::Result client_result, server_result;
23 client_result = client->ProcessMessage(server_message); 23 client_result = client->ProcessMessage(server_message);
24 server_result = server->ProcessMessage(client_message); 24 server_result = server->ProcessMessage(client_message);
25 25
26 // Check that we never hit the case where only one succeeds. 26 // Check that we never hit the case where only one succeeds.
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 121
122 ASSERT_EQ(P224EncryptedKeyExchange::kResultPending, 122 ASSERT_EQ(P224EncryptedKeyExchange::kResultPending,
123 client_result); 123 client_result);
124 ASSERT_EQ(P224EncryptedKeyExchange::kResultPending, 124 ASSERT_EQ(P224EncryptedKeyExchange::kResultPending,
125 server_result); 125 server_result);
126 } 126 }
127 } 127 }
128 } 128 }
129 129
130 } // namespace crypto 130 } // namespace crypto
OLDNEW
« no previous file with comments | « crypto/p224.cc ('k') | crypto/rsa_private_key_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698