~ubuntu-branches/ubuntu/lucid/curl/lucid-201101212007

« back to all changes in this revision

Viewing changes to lib/md5.c

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose
  • Date: 2008-02-08 11:20:41 UTC
  • mto: (3.1.1 lenny) (1.2.1 upstream)
  • mto: This revision was merged to the branch mainline in revision 26.
  • Revision ID: james.westby@ubuntu.com-20080208112041-hed7sb5r6ghmjf8v
Tags: upstream-7.18.0
ImportĀ upstreamĀ versionĀ 7.18.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/***************************************************************************
2
 
 *                                  _   _ ____  _     
3
 
 *  Project                     ___| | | |  _ \| |    
4
 
 *                             / __| | | | |_) | |    
5
 
 *                            | (__| |_| |  _ <| |___ 
 
2
 *                                  _   _ ____  _
 
3
 *  Project                     ___| | | |  _ \| |
 
4
 *                             / __| | | | |_) | |
 
5
 *                            | (__| |_| |  _ <| |___
6
6
 *                             \___|\___/|_| \_\_____|
7
7
 *
8
 
 * Copyright (C) 1998 - 2005, Daniel Stenberg, <daniel@haxx.se>, et al.
 
8
 * Copyright (C) 1998 - 2007, Daniel Stenberg, <daniel@haxx.se>, et al.
9
9
 *
10
10
 * This software is licensed as described in the file COPYING, which
11
11
 * you should have received as part of this distribution. The terms
12
12
 * are also available at http://curl.haxx.se/docs/copyright.html.
13
 
 * 
 
13
 *
14
14
 * You may opt to use, copy, modify, merge, publish, distribute and/or sell
15
15
 * copies of the Software, and permit persons to whom the Software is
16
16
 * furnished to do so, under the terms of the COPYING file.
18
18
 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
19
19
 * KIND, either express or implied.
20
20
 *
21
 
 * $Id: md5.c,v 1.11 2005/05/02 14:33:07 bagder Exp $
 
21
 * $Id: md5.c,v 1.12 2007-11-07 09:21:35 bagder Exp $
22
22
 ***************************************************************************/
23
23
 
24
24
#include "setup.h"
161
161
  bufindex = (unsigned int)((context->count[0] >> 3) & 0x3F);
162
162
 
163
163
  /* Update number of bits */
164
 
  if ((context->count[0] += ((UINT4)inputLen << 3))
 
164
  if((context->count[0] += ((UINT4)inputLen << 3))
165
165
      < ((UINT4)inputLen << 3))
166
166
    context->count[1]++;
167
167
  context->count[1] += ((UINT4)inputLen >> 29);
168
 
  
 
168
 
169
169
  partLen = 64 - bufindex;
170
170
 
171
171
  /* Transform as many times as possible. */
172
 
  if (inputLen >= partLen) {
 
172
  if(inputLen >= partLen) {
173
173
    memcpy((void *)&context->buffer[bufindex], (void *)input, partLen);
174
174
    MD5Transform(context->state, context->buffer);
175
 
    
 
175
 
176
176
    for (i = partLen; i + 63 < inputLen; i += 64)
177
177
      MD5Transform(context->state, &input[i]);
178
 
    
 
178
 
179
179
    bufindex = 0;
180
180
  }
181
181
  else