comparison 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
comparison
equal deleted inserted replaced
10686:212946f774c0 10687:b256ce6b85b8
81 81
82 /** The append data function */ 82 /** The append data function */
83 void (*append)(GaimCipherContext *context, const guint8 *data, size_t len); 83 void (*append)(GaimCipherContext *context, const guint8 *data, size_t len);
84 84
85 /** The digest function */ 85 /** The digest function */
86 gboolean (*digest)(GaimCipherContext *context, size_t *len, guint8 digest[]); 86 gboolean (*digest)(GaimCipherContext *context, size_t in_len, guint8 digest[], size_t *out_len);
87 87
88 /** The encrypt function */ 88 /** The encrypt function */
89 int (*encrypt)(GaimCipherContext *context, const guint8 data[], size_t len, guint8 output[], size_t *outlen); 89 int (*encrypt)(GaimCipherContext *context, const guint8 data[], size_t len, guint8 output[], size_t *outlen);
90 90
91 /** The decrypt function */ 91 /** The decrypt function */
132 guint gaim_cipher_get_capabilities(GaimCipher *cipher); 132 guint gaim_cipher_get_capabilities(GaimCipher *cipher);
133 133
134 /** 134 /**
135 * Gets a digest from a cipher 135 * Gets a digest from a cipher
136 * 136 *
137 * @param name The cipher's name 137 * @param name The cipher's name
138 * @param data The data to hash 138 * @param data The data to hash
139 * @param data_len The length of the data 139 * @param data_len The length of the data
140 * @param digest The returned digest 140 * @param in_len The length of the buffer
141 * @param digest_len The returned digest's length 141 * @param digest The returned digest
142 */ 142 * @param out_len The length written
143 void gaim_cipher_digest_region(const gchar *name, const guint8 *data, size_t data_len, guint8 digest[], size_t *digest_len); 143 *
144 * @return @c TRUE if successful, @c FALSE otherwise
145 */
146 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);
144 147
145 /*@}*/ 148 /*@}*/
146 /******************************************************************************/ 149 /******************************************************************************/
147 /** @name GaimCiphers API */ 150 /** @name GaimCiphers API */
148 /******************************************************************************/ 151 /******************************************************************************/
288 291
289 /** 292 /**
290 * Digests a context 293 * Digests a context
291 * 294 *
292 * @param context The context to digest 295 * @param context The context to digest
293 * @param len The length of the returned value 296 * @param in_len The length of the buffer
294 * @param digest The return buffer for the digest 297 * @param digest The return buffer for the digest
295 */ 298 * @param out_len The length of the returned value
296 gboolean gaim_cipher_context_digest(GaimCipherContext *context, size_t *len, guint8 digest[]); 299 */
300 gboolean gaim_cipher_context_digest(GaimCipherContext *context, size_t in_len, guint8 digest[], size_t *out_len);
297 301
298 /** 302 /**
299 * Converts a guint8 digest into a hex string 303 * Converts a guint8 digest into a hex string
300 * 304 *
301 * @param context The context to get a digest from 305 * @param context The context to get a digest from
302 * @param len The length of the returned value 306 * @param in_len The length of the buffer
303 * @param digest_s The return buffer for the string digest 307 * @param digest_s The return buffer for the string digest
304 */ 308 * @param out_len The length of the returned value
305 gboolean gaim_cipher_context_digest_to_str(GaimCipherContext *context, size_t *len, gchar digest_s[]); 309 */
310 gboolean gaim_cipher_context_digest_to_str(GaimCipherContext *context, size_t in_len, gchar digest_s[], size_t *out_len);
306 311
307 /** 312 /**
308 * Encrypts data using the context 313 * Encrypts data using the context
309 * 314 *
310 * @param context The context 315 * @param context The context