]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
Use size_t instead of int for input variables that represent sizes.
authorNikos Mavrogiannopoulos <nmav@gnutls.org>
Wed, 14 Apr 2010 15:29:19 +0000 (17:29 +0200)
committerNikos Mavrogiannopoulos <nmav@gnutls.org>
Wed, 14 Apr 2010 15:29:19 +0000 (17:29 +0200)
lib/crypto-api.c
lib/includes/gnutls/crypto.h

index 453b8c1170b8dfe4fa97efa7a614fe76bbc0fccc..bf06fc47873ec08d4ef377232f546ff6674c73d8 100644 (file)
@@ -74,8 +74,7 @@ gnutls_cipher_init (gnutls_cipher_hd_t * handle,
  *
  * Since: 2.10.0
  **/
-int
-gnutls_cipher_encrypt (gnutls_cipher_hd_t handle, void *text, int textlen)
+int gnutls_cipher_encrypt (gnutls_cipher_hd_t handle, void *text, size_t textlen)
 {
   return _gnutls_cipher_encrypt ((cipher_hd_st *) handle, text, textlen);
 }
@@ -95,7 +94,7 @@ gnutls_cipher_encrypt (gnutls_cipher_hd_t handle, void *text, int textlen)
  **/
 int
 gnutls_cipher_decrypt (gnutls_cipher_hd_t handle, void *ciphertext,
-                      int ciphertextlen)
+                      size_t ciphertextlen)
 {
   return _gnutls_cipher_decrypt ((cipher_hd_st *) handle, ciphertext,
                                 ciphertextlen);
@@ -138,7 +137,7 @@ gnutls_cipher_deinit (gnutls_cipher_hd_t handle)
 int
 gnutls_hmac_init (gnutls_hmac_hd_t * dig,
                  gnutls_digest_algorithm_t algorithm,
-                 const void *key, int keylen)
+                 const void *key, size_t keylen)
 {
   *dig = gnutls_malloc (sizeof (digest_hd_st));
   if (*dig == NULL)
@@ -235,7 +234,7 @@ gnutls_hmac_get_len (gnutls_mac_algorithm_t algorithm)
  **/
 int
 gnutls_hmac_fast (gnutls_mac_algorithm_t algorithm,
-                 const void *key, int keylen,
+                 const void *key, size_t keylen,
                  const void *text, size_t textlen, void *digest)
 {
   return _gnutls_hmac_fast (algorithm, key, keylen, text, textlen, digest);
index 7e0b65d42702fee76aa53b4ce91a8627858b437b..4caa3222dc2cf8d61c9da8b92e7e9991f7ebaaed 100644 (file)
@@ -32,9 +32,9 @@ int gnutls_cipher_init (gnutls_cipher_hd_t * handle,
                        const gnutls_datum_t * key,
                        const gnutls_datum_t * iv);
 int gnutls_cipher_encrypt (const gnutls_cipher_hd_t handle,
-                          void *text, int textlen);
+                          void *text, size_t textlen);
 int gnutls_cipher_decrypt (const gnutls_cipher_hd_t handle,
-                          void *ciphertext, int ciphertextlen);
+                          void *ciphertext, size_t ciphertextlen);
 void gnutls_cipher_deinit (gnutls_cipher_hd_t handle);
 int gnutls_cipher_get_block_size (gnutls_cipher_algorithm_t algorithm);
 
@@ -44,13 +44,13 @@ typedef struct hmac_hd_st *gnutls_hmac_hd_t;
 
 int gnutls_hmac_init (gnutls_hmac_hd_t * dig,
                      gnutls_digest_algorithm_t algorithm, const void *key,
-                     int keylen);
+                     size_t keylen);
 int gnutls_hmac (gnutls_hmac_hd_t handle, const void *text, size_t textlen);
 void gnutls_hmac_output (gnutls_hmac_hd_t handle, void *digest);
 void gnutls_hmac_deinit (gnutls_hmac_hd_t handle, void *digest);
 int gnutls_hmac_get_len (gnutls_mac_algorithm_t algorithm);
 int gnutls_hmac_fast (gnutls_mac_algorithm_t algorithm, const void *key,
-                     int keylen, const void *text, size_t textlen,
+                     size_t keylen, const void *text, size_t textlen,
                      void *digest);
 
 int gnutls_hash_init (gnutls_hash_hd_t * dig,