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

Side by Side Diff: crypto/secure_hash_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/rsa_private_key_unittest.cc ('k') | crypto/signature_creator.h » ('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) 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 #include "crypto/secure_hash.h" 5 #include "crypto/secure_hash.h"
6 6
7 #include <string>
8
7 #include "base/basictypes.h" 9 #include "base/basictypes.h"
8 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
9 #include "base/pickle.h" 11 #include "base/pickle.h"
10 #include "crypto/sha2.h" 12 #include "crypto/sha2.h"
11 #include "testing/gtest/include/gtest/gtest.h" 13 #include "testing/gtest/include/gtest/gtest.h"
12 14
13 TEST(SecureHashTest, TestUpdate) { 15 TEST(SecureHashTest, TestUpdate) {
14 // Example B.3 from FIPS 180-2: long message. 16 // Example B.3 from FIPS 180-2: long message.
15 std::string input3(500000, 'a'); // 'a' repeated half a million times 17 std::string input3(500000, 'a'); // 'a' repeated half a million times
16 int expected3[] = { 0xcd, 0xc7, 0x6e, 0x5c, 18 int expected3[] = { 0xcd, 0xc7, 0x6e, 0x5c,
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 66
65 PickleIterator data_iterator(pickle); 67 PickleIterator data_iterator(pickle);
66 EXPECT_TRUE(ctx2->Deserialize(&data_iterator)); 68 EXPECT_TRUE(ctx2->Deserialize(&data_iterator));
67 ctx2->Update(input4.data(), input4.size()); 69 ctx2->Update(input4.data(), input4.size());
68 ctx2->Update(input5.data(), input5.size()); 70 ctx2->Update(input5.data(), input5.size());
69 71
70 ctx2->Finish(output2, sizeof(output2)); 72 ctx2->Finish(output2, sizeof(output2));
71 73
72 EXPECT_EQ(0, memcmp(output1, output2, crypto::kSHA256Length)); 74 EXPECT_EQ(0, memcmp(output1, output2, crypto::kSHA256Length));
73 } 75 }
OLDNEW
« no previous file with comments | « crypto/rsa_private_key_unittest.cc ('k') | crypto/signature_creator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698