aboutsummaryrefslogtreecommitdiff
path: root/library/arc4.c
diff options
context:
space:
mode:
authorPaul Bakker <p.j.bakker@polarssl.org>2011-04-24 08:57:21 +0000
committerPaul Bakker <p.j.bakker@polarssl.org>2011-04-24 08:57:21 +0000
commit23986e5d5d501ae93bed161752708ba18fb9e016 (patch)
treec6e3d8251151695fcd38167c21af5e5290f915b3 /library/arc4.c
parent1be81a4e5feca5b46aa886b55a0096f2dfb33c1b (diff)
downloadmbedtls-23986e5d5d501ae93bed161752708ba18fb9e016.zip
mbedtls-23986e5d5d501ae93bed161752708ba18fb9e016.tar.gz
mbedtls-23986e5d5d501ae93bed161752708ba18fb9e016.tar.bz2
- Major type rewrite of int to size_t for most variables and arguments used for buffer lengths and loops
Diffstat (limited to 'library/arc4.c')
-rw-r--r--library/arc4.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/library/arc4.c b/library/arc4.c
index c7725be..07665ad 100644
--- a/library/arc4.c
+++ b/library/arc4.c
@@ -37,9 +37,10 @@
/*
* ARC4 key schedule
*/
-void arc4_setup( arc4_context *ctx, const unsigned char *key, int keylen )
+void arc4_setup( arc4_context *ctx, const unsigned char *key, unsigned int keylen )
{
- int i, j, k, a;
+ int i, j, a;
+ unsigned int k;
unsigned char *m;
ctx->x = 0;
@@ -65,10 +66,11 @@ void arc4_setup( arc4_context *ctx, const unsigned char *key, int keylen )
/*
* ARC4 cipher function
*/
-int arc4_crypt( arc4_context *ctx, int length, const unsigned char *input,
+int arc4_crypt( arc4_context *ctx, size_t length, const unsigned char *input,
unsigned char *output )
{
- int i, x, y, a, b;
+ int x, y, a, b;
+ size_t i;
unsigned char *m;
x = ctx->x;