~ubuntu-branches/ubuntu/breezy/unrar-nonfree/breezy

« back to all changes in this revision

Viewing changes to sha1.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Chris Anderson
  • Date: 2004-12-01 02:22:56 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20041201022256-c3pj5nufp88tdyw6
Tags: 3.4.3-1
* New upstream release 
* Applied Ulf Harnhammar's patch to solve overflows when $HOME was too
  large (closes: #280263).

Show diffs side-by-side

added added

removed removed

Lines of Context:
163
163
        memcpy(&context->buffer[j], data, (i = 64-j));
164
164
        SHA1Transform(context->state, context->buffer);
165
165
        for ( ; i + 63 < len; i += 64) {
 
166
#ifdef ALLOW_NOT_ALIGNED_INT
166
167
            SHA1Transform(context->state, &data[i]);
 
168
#else
 
169
            unsigned char buffer[64];
 
170
            memcpy(buffer,data+i,sizeof(buffer));
 
171
            SHA1Transform(context->state, buffer);
 
172
            memcpy(data+i,buffer,sizeof(buffer));
 
173
#endif
167
174
#ifdef BIG_ENDIAN
168
175
            unsigned char *d=data+i;
169
176
            for (int k=0;k<64;k+=4)