diff src/cipher.h @ 10687:b256ce6b85b8

[gaim-migrate @ 12235] grim says this is really fixed this time. committer: Tailor Script <tailor@pidgin.im>
author Etan Reisner <pidgin@unreliablesource.net>
date Sat, 12 Mar 2005 01:10:37 +0000
parents 72a5babfa8b4
children 8dca96cbcd64
line wrap: on
line diff
--- a/src/cipher.h	Fri Mar 11 22:45:41 2005 +0000
+++ b/src/cipher.h	Sat Mar 12 01:10:37 2005 +0000
@@ -83,7 +83,7 @@
 	void (*append)(GaimCipherContext *context, const guint8 *data, size_t len);
 
 	/** The digest function */
-	gboolean (*digest)(GaimCipherContext *context, size_t *len, guint8 digest[]);
+	gboolean (*digest)(GaimCipherContext *context, size_t in_len, guint8 digest[], size_t *out_len);
 
 	/** The encrypt function */
 	int (*encrypt)(GaimCipherContext *context, const guint8 data[], size_t len, guint8 output[], size_t *outlen);
@@ -134,13 +134,16 @@
 /**
  * Gets a digest from a cipher
  *
- * @param name       The cipher's name
- * @param data       The data to hash
- * @param data_len   The length of the data
- * @param digest     The returned digest
- * @param digest_len The returned digest's length
+ * @param name     The cipher's name
+ * @param data     The data to hash
+ * @param data_len The length of the data
+ * @param in_len   The length of the buffer
+ * @param digest   The returned digest
+ * @param out_len  The length written
+ *
+ * @return @c TRUE if successful, @c FALSE otherwise
  */
-void gaim_cipher_digest_region(const gchar *name, const guint8 *data, size_t data_len, guint8 digest[], size_t *digest_len); 
+gboolean gaim_cipher_digest_region(const gchar *name, const guint8 *data, size_t data_len, size_t in_len, guint8 digest[], size_t *out_len); 
 
 /*@}*/
 /******************************************************************************/
@@ -290,19 +293,21 @@
  * Digests a context
  *
  * @param context The context to digest
- * @param len     The length of the returned value
+ * @param in_len  The length of the buffer
  * @param digest  The return buffer for the digest
+ * @param out_len The length of the returned value
  */
-gboolean gaim_cipher_context_digest(GaimCipherContext *context, size_t *len, guint8 digest[]);
+gboolean gaim_cipher_context_digest(GaimCipherContext *context, size_t in_len, guint8 digest[], size_t *out_len);
 
 /**
  * Converts a guint8 digest into a hex string
  *
  * @param context  The context to get a digest from
- * @param len      The length of the returned value
+ * @param in_len   The length of the buffer
  * @param digest_s The return buffer for the string digest
+ * @param out_len  The length of the returned value
  */
-gboolean gaim_cipher_context_digest_to_str(GaimCipherContext *context, size_t *len, gchar digest_s[]);
+gboolean gaim_cipher_context_digest_to_str(GaimCipherContext *context, size_t in_len, gchar digest_s[], size_t *out_len);
 
 /**
  * Encrypts data using the context