Index: openssl/crypto/rc4/rc4_enc.c |
=================================================================== |
--- openssl/crypto/rc4/rc4_enc.c (revision 105093) |
+++ openssl/crypto/rc4/rc4_enc.c (working copy) |
@@ -67,12 +67,12 @@ |
* Date: Wed, 14 Sep 1994 06:35:31 GMT |
*/ |
-void RC4(RC4_KEY *key, unsigned long len, const unsigned char *indata, |
+void RC4(RC4_KEY *key, size_t len, const unsigned char *indata, |
unsigned char *outdata) |
{ |
register RC4_INT *d; |
register RC4_INT x,y,tx,ty; |
- int i; |
+ size_t i; |
x=key->x; |
y=key->y; |
@@ -120,8 +120,8 @@ |
(RC4_CHUNK)d[(tx+ty)&0xff]\ |
) |
- if ( ( ((unsigned long)indata & (sizeof(RC4_CHUNK)-1)) | |
- ((unsigned long)outdata & (sizeof(RC4_CHUNK)-1)) ) == 0 ) |
+ if ( ( ((size_t)indata & (sizeof(RC4_CHUNK)-1)) | |
+ ((size_t)outdata & (sizeof(RC4_CHUNK)-1)) ) == 0 ) |
{ |
RC4_CHUNK ichunk,otp; |
const union { long one; char little; } is_endian = {1}; |
@@ -157,7 +157,7 @@ |
if (!is_endian.little) |
{ /* BIG-ENDIAN CASE */ |
# define BESHFT(c) (((sizeof(RC4_CHUNK)-(c)-1)*8)&(sizeof(RC4_CHUNK)*8-1)) |
- for (;len&~(sizeof(RC4_CHUNK)-1);len-=sizeof(RC4_CHUNK)) |
+ for (;len&(0-sizeof(RC4_CHUNK));len-=sizeof(RC4_CHUNK)) |
{ |
ichunk = *(RC4_CHUNK *)indata; |
otp = RC4_STEP<<BESHFT(0); |
@@ -210,7 +210,7 @@ |
else |
{ /* LITTLE-ENDIAN CASE */ |
# define LESHFT(c) (((c)*8)&(sizeof(RC4_CHUNK)*8-1)) |
- for (;len&~(sizeof(RC4_CHUNK)-1);len-=sizeof(RC4_CHUNK)) |
+ for (;len&(0-sizeof(RC4_CHUNK));len-=sizeof(RC4_CHUNK)) |
{ |
ichunk = *(RC4_CHUNK *)indata; |
otp = RC4_STEP; |
@@ -276,7 +276,7 @@ |
#define RC4_LOOP(a,b,i) LOOP(a[i],b[i]) |
#endif |
- i=(int)(len>>3L); |
+ i=len>>3; |
if (i) |
{ |
for (;;) |
@@ -296,7 +296,7 @@ |
if (--i == 0) break; |
} |
} |
- i=(int)len&0x07; |
+ i=len&0x07; |
if (i) |
{ |
for (;;) |