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

Unified Diff: base/sha1_unittest.cc

Issue 7972024: Update SHA1_LENGTH -> kSHA1Length to match previous change to SHA256_LENGTH. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/sha1.h ('k') | base/sha1_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/sha1_unittest.cc
===================================================================
--- base/sha1_unittest.cc (revision 102606)
+++ base/sha1_unittest.cc (working copy)
@@ -20,7 +20,7 @@
0x9c, 0xd0, 0xd8, 0x9d };
std::string output = base::SHA1HashString(input);
- for (size_t i = 0; i < base::SHA1_LENGTH; i++)
+ for (size_t i = 0; i < base::kSHA1Length; i++)
EXPECT_EQ(expected[i], output[i] & 0xFF);
}
@@ -36,7 +36,7 @@
0xe5, 0x46, 0x70, 0xf1 };
std::string output = base::SHA1HashString(input);
- for (size_t i = 0; i < base::SHA1_LENGTH; i++)
+ for (size_t i = 0; i < base::kSHA1Length; i++)
EXPECT_EQ(expected[i], output[i] & 0xFF);
}
@@ -51,14 +51,14 @@
0x65, 0x34, 0x01, 0x6f };
std::string output = base::SHA1HashString(input);
- for (size_t i = 0; i < base::SHA1_LENGTH; i++)
+ for (size_t i = 0; i < base::kSHA1Length; i++)
EXPECT_EQ(expected[i], output[i] & 0xFF);
}
TEST(SHA1Test, Test1Bytes) {
// Example A.1 from FIPS 180-2: one-block message.
std::string input = "abc";
- unsigned char output[base::SHA1_LENGTH];
+ unsigned char output[base::kSHA1Length];
unsigned char expected[] = { 0xa9, 0x99, 0x3e, 0x36,
0x47, 0x06, 0x81, 0x6a,
@@ -68,7 +68,7 @@
base::SHA1HashBytes(reinterpret_cast<const unsigned char*>(input.c_str()),
input.length(), output);
- for (size_t i = 0; i < base::SHA1_LENGTH; i++)
+ for (size_t i = 0; i < base::kSHA1Length; i++)
EXPECT_EQ(expected[i], output[i]);
}
@@ -76,7 +76,7 @@
// Example A.2 from FIPS 180-2: multi-block message.
std::string input =
"abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq";
- unsigned char output[base::SHA1_LENGTH];
+ unsigned char output[base::kSHA1Length];
unsigned char expected[] = { 0x84, 0x98, 0x3e, 0x44,
0x1c, 0x3b, 0xd2, 0x6e,
@@ -86,14 +86,14 @@
base::SHA1HashBytes(reinterpret_cast<const unsigned char*>(input.c_str()),
input.length(), output);
- for (size_t i = 0; i < base::SHA1_LENGTH; i++)
+ for (size_t i = 0; i < base::kSHA1Length; i++)
EXPECT_EQ(expected[i], output[i]);
}
TEST(SHA1Test, Test3Bytes) {
// Example A.3 from FIPS 180-2: long message.
std::string input(1000000, 'a');
- unsigned char output[base::SHA1_LENGTH];
+ unsigned char output[base::kSHA1Length];
unsigned char expected[] = { 0x34, 0xaa, 0x97, 0x3c,
0xd4, 0xc4, 0xda, 0xa4,
@@ -103,6 +103,6 @@
base::SHA1HashBytes(reinterpret_cast<const unsigned char*>(input.c_str()),
input.length(), output);
- for (size_t i = 0; i < base::SHA1_LENGTH; i++)
+ for (size_t i = 0; i < base::kSHA1Length; i++)
EXPECT_EQ(expected[i], output[i]);
}
« no previous file with comments | « base/sha1.h ('k') | base/sha1_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698