Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(8)

Side by Side Diff: Modules/sha1module.c

Issue 10639: reindent.py converts newlines to platform default
Patch Set: Created 8 years, 8 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Modules/selectmodule.c ('k') | Modules/signalmodule.c » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* SHA1 module */ 1 /* SHA1 module */
2 2
3 /* This module provides an interface to the SHA1 algorithm */ 3 /* This module provides an interface to the SHA1 algorithm */
4 4
5 /* See below for information about the original code this module was 5 /* See below for information about the original code this module was
6 based upon. Additional work performed by: 6 based upon. Additional work performed by:
7 7
8 Andrew Kuchling (amk@amk.ca) 8 Andrew Kuchling (amk@amk.ca)
9 Greg Stein (gstein@lyra.org) 9 Greg Stein (gstein@lyra.org)
10 Trevor Perrin (trevp@trevp.net) 10 Trevor Perrin (trevp@trevp.net)
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after
211 assert(in != NULL); 211 assert(in != NULL);
212 assert(sha1->curlen <= sizeof(sha1->buf)); 212 assert(sha1->curlen <= sizeof(sha1->buf));
213 213
214 while (inlen > 0) { 214 while (inlen > 0) {
215 if (sha1->curlen == 0 && inlen >= SHA1_BLOCKSIZE) { 215 if (sha1->curlen == 0 && inlen >= SHA1_BLOCKSIZE) {
216 sha1_compress(sha1, (unsigned char *)in); 216 sha1_compress(sha1, (unsigned char *)in);
217 sha1->length += SHA1_BLOCKSIZE * 8; 217 sha1->length += SHA1_BLOCKSIZE * 8;
218 in += SHA1_BLOCKSIZE; 218 in += SHA1_BLOCKSIZE;
219 inlen -= SHA1_BLOCKSIZE; 219 inlen -= SHA1_BLOCKSIZE;
220 } else { 220 } else {
221 n = MIN(inlen, (Py_ssize_t)(SHA1_BLOCKSIZE - sha1->curlen)); 221 n = MIN(inlen, (SHA1_BLOCKSIZE - sha1->curlen));
222 memcpy(sha1->buf + sha1->curlen, in, (size_t)n); 222 memcpy(sha1->buf + sha1->curlen, in, (size_t)n);
223 sha1->curlen += n; 223 sha1->curlen += n;
224 in += n; 224 in += n;
225 inlen -= n; 225 inlen -= n;
226 if (sha1->curlen == SHA1_BLOCKSIZE) { 226 if (sha1->curlen == SHA1_BLOCKSIZE) {
227 sha1_compress(sha1, sha1->buf); 227 sha1_compress(sha1, sha1->buf);
228 sha1->length += 8*SHA1_BLOCKSIZE; 228 sha1->length += 8*SHA1_BLOCKSIZE;
229 sha1->curlen = 0; 229 sha1->curlen = 0;
230 } 230 }
231 } 231 }
(...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after
551 }; 551 };
552 552
553 PyMODINIT_FUNC 553 PyMODINIT_FUNC
554 PyInit__sha1(void) 554 PyInit__sha1(void)
555 { 555 {
556 Py_TYPE(&SHA1type) = &PyType_Type; 556 Py_TYPE(&SHA1type) = &PyType_Type;
557 if (PyType_Ready(&SHA1type) < 0) 557 if (PyType_Ready(&SHA1type) < 0)
558 return NULL; 558 return NULL;
559 return PyModule_Create(&_sha1module); 559 return PyModule_Create(&_sha1module);
560 } 560 }
OLDNEW
« no previous file with comments | « Modules/selectmodule.c ('k') | Modules/signalmodule.c » ('j') | no next file with comments »

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+