- Major type rewrite of int to size_t for most variables and arguments used for buffer lengths and loops
diff --git a/library/camellia.c b/library/camellia.c
index 6624d17..d725c19 100644
--- a/library/camellia.c
+++ b/library/camellia.c
@@ -35,8 +35,6 @@
#include "polarssl/camellia.h"
-#include <string.h>
-
/*
* 32-bit integer manipulation macros (big endian)
*/
@@ -309,9 +307,10 @@
/*
* Camellia key schedule (encryption)
*/
-int camellia_setkey_enc( camellia_context *ctx, const unsigned char *key, int keysize )
+int camellia_setkey_enc( camellia_context *ctx, const unsigned char *key, unsigned int keysize )
{
- int i, idx;
+ int idx;
+ size_t i;
uint32_t *RK;
unsigned char t[64];
uint32_t SIGMA[6][2];
@@ -412,9 +411,10 @@
/*
* Camellia key schedule (decryption)
*/
-int camellia_setkey_dec( camellia_context *ctx, const unsigned char *key, int keysize )
+int camellia_setkey_dec( camellia_context *ctx, const unsigned char *key, unsigned int keysize )
{
- int i, idx;
+ int idx;
+ size_t i;
camellia_context cty;
uint32_t *RK;
uint32_t *SK;
@@ -526,7 +526,7 @@
*/
int camellia_crypt_cbc( camellia_context *ctx,
int mode,
- int length,
+ size_t length,
unsigned char iv[16],
const unsigned char *input,
unsigned char *output )
@@ -579,7 +579,7 @@
*/
int camellia_crypt_cfb128( camellia_context *ctx,
int mode,
- int length,
+ size_t length,
int *iv_off,
unsigned char iv[16],
const unsigned char *input,