diff options
author | Andy Polyakov <appro@openssl.org> | 2008-10-31 19:30:11 +0000 |
---|---|---|
committer | Andy Polyakov <appro@openssl.org> | 2008-10-31 19:30:11 +0000 |
commit | f768be81d804d0467be4ad7163216c8381872b94 (patch) | |
tree | bcedfdc8d80fbf521deefa7f95d4aaef8f18f86c /crypto/rc4 | |
parent | 91173829db3f10a5237ea28ed9e1c0c1f69cb05b (diff) |
size_t-fy AES, Camellia and RC4.
Diffstat (limited to 'crypto/rc4')
-rw-r--r-- | crypto/rc4/rc4.h | 4 | ||||
-rw-r--r-- | crypto/rc4/rc4_enc.c | 12 |
2 files changed, 9 insertions, 7 deletions
diff --git a/crypto/rc4/rc4.h b/crypto/rc4/rc4.h index 7aec04fe93..29d1acccf5 100644 --- a/crypto/rc4/rc4.h +++ b/crypto/rc4/rc4.h @@ -64,6 +64,8 @@ #error RC4 is disabled. #endif +#include <stddef.h> + #ifdef __cplusplus extern "C" { #endif @@ -77,7 +79,7 @@ typedef struct rc4_key_st const char *RC4_options(void); void RC4_set_key(RC4_KEY *key, int len, const unsigned char *data); -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); #ifdef __cplusplus diff --git a/crypto/rc4/rc4_enc.c b/crypto/rc4/rc4_enc.c index d5f18a3a70..37ef43c16c 100644 --- a/crypto/rc4/rc4_enc.c +++ b/crypto/rc4/rc4_enc.c @@ -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 @@ void RC4(RC4_KEY *key, unsigned long len, const unsigned char *indata, (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}; @@ -276,7 +276,7 @@ void RC4(RC4_KEY *key, unsigned long len, const unsigned char *indata, #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 @@ void RC4(RC4_KEY *key, unsigned long len, const unsigned char *indata, if (--i == 0) break; } } - i=(int)len&0x07; + i=len&0x07; if (i) { for (;;) |