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

Side by Side Diff: webrtc/base/md5.cc

Issue 1349213003: Remove overridden basictypes.h. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc/trunk/webrtc.git@master
Patch Set: Added missing include for Win. Created 5 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 unified diff | Download patch
« no previous file with comments | « webrtc/base/basictypes_unittest.cc ('k') | webrtc/base/sha1.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 /* 1 /*
2 * This code implements the MD5 message-digest algorithm. 2 * This code implements the MD5 message-digest algorithm.
3 * The algorithm is due to Ron Rivest. This code was 3 * The algorithm is due to Ron Rivest. This code was
4 * written by Colin Plumb in 1993, no copyright is claimed. 4 * written by Colin Plumb in 1993, no copyright is claimed.
5 * This code is in the public domain; do with it what you wish. 5 * This code is in the public domain; do with it what you wish.
6 * 6 *
7 * Equivalent code is available from RSA Data Security, Inc. 7 * Equivalent code is available from RSA Data Security, Inc.
8 * This code has been tested against that, and is equivalent, 8 * This code has been tested against that, and is equivalent,
9 * except that you don't need to include two pages of legalese 9 * except that you don't need to include two pages of legalese
10 * with every copy. 10 * with every copy.
11 * 11 *
12 * To compute the message digest of a chunk of bytes, declare an 12 * To compute the message digest of a chunk of bytes, declare an
13 * MD5Context structure, pass it to MD5Init, call MD5Update as 13 * MD5Context structure, pass it to MD5Init, call MD5Update as
14 * needed on buffers full of bytes, and then call MD5Final, which 14 * needed on buffers full of bytes, and then call MD5Final, which
15 * will fill a supplied 16-byte array with the digest. 15 * will fill a supplied 16-byte array with the digest.
16 */ 16 */
17 17
18 // Changes from original C code: 18 // Changes from original C code:
19 // Ported to C++, type casting, Google code style. 19 // Ported to C++, type casting, Google code style.
20 20
21 #include "webrtc/base/md5.h" 21 #include "webrtc/base/md5.h"
22 22
23 // TODO: Avoid memcmpy - hash directly from memory. 23 // TODO: Avoid memcmpy - hash directly from memory.
24 #include <string.h> // for memcpy(). 24 #include <string.h> // for memcpy().
25 25
26 #include "webrtc/base/byteorder.h" // for ARCH_CPU_LITTLE_ENDIAN. 26 #include "webrtc/base/byteorder.h" // for RTC_ARCH_CPU_LITTLE_ENDIAN.
27 27
28 namespace rtc { 28 namespace rtc {
29 29
30 #ifdef ARCH_CPU_LITTLE_ENDIAN 30 #ifdef RTC_ARCH_CPU_LITTLE_ENDIAN
31 #define ByteReverse(buf, len) // Nothing. 31 #define ByteReverse(buf, len) // Nothing.
32 #else // ARCH_CPU_BIG_ENDIAN 32 #else // RTC_ARCH_CPU_BIG_ENDIAN
33 static void ByteReverse(uint32* buf, int len) { 33 static void ByteReverse(uint32* buf, int len) {
34 for (int i = 0; i < len; ++i) { 34 for (int i = 0; i < len; ++i) {
35 buf[i] = rtc::GetLE32(&buf[i]); 35 buf[i] = rtc::GetLE32(&buf[i]);
36 } 36 }
37 } 37 }
38 #endif 38 #endif
39 39
40 // Start MD5 accumulation. Set bit count to 0 and buffer to mysterious 40 // Start MD5 accumulation. Set bit count to 0 and buffer to mysterious
41 // initialization constants. 41 // initialization constants.
42 void MD5Init(MD5Context* ctx) { 42 void MD5Init(MD5Context* ctx) {
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after
213 MD5STEP(F4, d, a, b, c, in[11] + 0xbd3af235, 10); 213 MD5STEP(F4, d, a, b, c, in[11] + 0xbd3af235, 10);
214 MD5STEP(F4, c, d, a, b, in[ 2] + 0x2ad7d2bb, 15); 214 MD5STEP(F4, c, d, a, b, in[ 2] + 0x2ad7d2bb, 15);
215 MD5STEP(F4, b, c, d, a, in[ 9] + 0xeb86d391, 21); 215 MD5STEP(F4, b, c, d, a, in[ 9] + 0xeb86d391, 21);
216 buf[0] += a; 216 buf[0] += a;
217 buf[1] += b; 217 buf[1] += b;
218 buf[2] += c; 218 buf[2] += c;
219 buf[3] += d; 219 buf[3] += d;
220 } 220 }
221 221
222 } // namespace rtc 222 } // namespace rtc
OLDNEW
« no previous file with comments | « webrtc/base/basictypes_unittest.cc ('k') | webrtc/base/sha1.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698