diff options
author | Paul Bakker <p.j.bakker@polarssl.org> | 2011-04-24 08:57:21 +0000 |
---|---|---|
committer | Paul Bakker <p.j.bakker@polarssl.org> | 2011-04-24 08:57:21 +0000 |
commit | 23986e5d5d501ae93bed161752708ba18fb9e016 (patch) | |
tree | c6e3d8251151695fcd38167c21af5e5290f915b3 /include/polarssl/md2.h | |
parent | 1be81a4e5feca5b46aa886b55a0096f2dfb33c1b (diff) | |
download | mbedtls-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 'include/polarssl/md2.h')
-rw-r--r-- | include/polarssl/md2.h | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/include/polarssl/md2.h b/include/polarssl/md2.h index bcda2e3..9a497f1 100644 --- a/include/polarssl/md2.h +++ b/include/polarssl/md2.h @@ -27,6 +27,8 @@ #ifndef POLARSSL_MD2_H #define POLARSSL_MD2_H +#include <string.h> + /** * \brief MD2 context structure */ @@ -38,7 +40,7 @@ typedef struct unsigned char ipad[64]; /*!< HMAC: inner padding */ unsigned char opad[64]; /*!< HMAC: outer padding */ - int left; /*!< amount of data in buffer */ + size_t left; /*!< amount of data in buffer */ } md2_context; @@ -60,7 +62,7 @@ void md2_starts( md2_context *ctx ); * \param input buffer holding the data * \param ilen length of the input data */ -void md2_update( md2_context *ctx, const unsigned char *input, int ilen ); +void md2_update( md2_context *ctx, const unsigned char *input, size_t ilen ); /** * \brief MD2 final digest @@ -77,7 +79,7 @@ void md2_finish( md2_context *ctx, unsigned char output[16] ); * \param ilen length of the input data * \param output MD2 checksum result */ -void md2( const unsigned char *input, int ilen, unsigned char output[16] ); +void md2( const unsigned char *input, size_t ilen, unsigned char output[16] ); /** * \brief Output = MD2( file contents ) @@ -97,7 +99,7 @@ int md2_file( const char *path, unsigned char output[16] ); * \param key HMAC secret key * \param keylen length of the HMAC key */ -void md2_hmac_starts( md2_context *ctx, const unsigned char *key, int keylen ); +void md2_hmac_starts( md2_context *ctx, const unsigned char *key, size_t keylen ); /** * \brief MD2 HMAC process buffer @@ -106,7 +108,7 @@ void md2_hmac_starts( md2_context *ctx, const unsigned char *key, int keylen ); * \param input buffer holding the data * \param ilen length of the input data */ -void md2_hmac_update( md2_context *ctx, const unsigned char *input, int ilen ); +void md2_hmac_update( md2_context *ctx, const unsigned char *input, size_t ilen ); /** * \brief MD2 HMAC final digest @@ -132,8 +134,8 @@ void md2_hmac_reset( md2_context *ctx ); * \param ilen length of the input data * \param output HMAC-MD2 result */ -void md2_hmac( const unsigned char *key, int keylen, - const unsigned char *input, int ilen, +void md2_hmac( const unsigned char *key, size_t keylen, + const unsigned char *input, size_t ilen, unsigned char output[16] ); /** |