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

Side by Side Diff: libyasm/md5.c

Issue 9533001: yasm: Merge a clang warning fix. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/deps/third_party/yasm/patched-yasm/
Patch Set: Created 8 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | 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.
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 156
157 /* Append length in bits and transform */ 157 /* Append length in bits and transform */
158 putu32(ctx->bits[0], ctx->in + 56); 158 putu32(ctx->bits[0], ctx->in + 56);
159 putu32(ctx->bits[1], ctx->in + 60); 159 putu32(ctx->bits[1], ctx->in + 60);
160 160
161 yasm_md5_transform (ctx->buf, ctx->in); 161 yasm_md5_transform (ctx->buf, ctx->in);
162 putu32(ctx->buf[0], digest); 162 putu32(ctx->buf[0], digest);
163 putu32(ctx->buf[1], digest + 4); 163 putu32(ctx->buf[1], digest + 4);
164 putu32(ctx->buf[2], digest + 8); 164 putu32(ctx->buf[2], digest + 8);
165 putu32(ctx->buf[3], digest + 12); 165 putu32(ctx->buf[3], digest + 12);
166 memset(ctx, 0, sizeof(ctx)); /* In case it's sensitive */ 166 memset(ctx, 0, sizeof(*ctx)); /* In case it's sensitive */
167 } 167 }
168 168
169 #ifndef ASM_MD5 169 #ifndef ASM_MD5
170 170
171 /* The four core functions - F1 is optimized somewhat */ 171 /* The four core functions - F1 is optimized somewhat */
172 172
173 /* #define F1(x, y, z) (x & y | ~x & z) */ 173 /* #define F1(x, y, z) (x & y | ~x & z) */
174 #define F1(x, y, z) (z ^ (x & (y ^ z))) 174 #define F1(x, y, z) (z ^ (x & (y ^ z)))
175 #define F2(x, y, z) F1(z, x, y) 175 #define F2(x, y, z) F1(z, x, y)
176 #define F3(x, y, z) (x ^ y ^ z) 176 #define F3(x, y, z) (x ^ y ^ z)
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
301 yasm_md5_final (checksum, &context); 301 yasm_md5_final (checksum, &context);
302 for (i = 0; i < 16; i++) 302 for (i = 0; i < 16; i++)
303 { 303 {
304 printf ("%02x", (unsigned int) checksum[i]); 304 printf ("%02x", (unsigned int) checksum[i]);
305 } 305 }
306 printf ("\n"); 306 printf ("\n");
307 } 307 }
308 return 0; 308 return 0;
309 } 309 }
310 #endif /* TEST */ 310 #endif /* TEST */
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698