gobjectification: fc316d25: Rename PurpleSHA256Cipher to PurpleSHA25...

qulogic at pidgin.im qulogic at pidgin.im
Sun Jul 11 04:06:01 EDT 2010


----------------------------------------------------------------------
Revision: fc316d25eaff16642283ce1a8fc6069a902eb1db
Parent:   f4d7e788d24c94d725d95d65f21fe9e2c7afa78d
Author:   qulogic at pidgin.im
Date:     07/11/10 02:00:09
Branch:   im.pidgin.gobjectification
URL: http://d.pidgin.im/viewmtn/revision/info/fc316d25eaff16642283ce1a8fc6069a902eb1db

Changelog: 

Rename PurpleSHA256Cipher to PurpleSHA256Hash.

Changes against parent f4d7e788d24c94d725d95d65f21fe9e2c7afa78d

  renamed  libpurple/cipher/sha256cipher.c
       to  libpurple/cipher/sha256hash.c
  renamed  libpurple/cipher/sha256cipher.h
       to  libpurple/cipher/sha256hash.h
  patched  libpurple/Makefile.am
  patched  libpurple/Makefile.mingw
  patched  libpurple/cipher/sha256hash.c
  patched  libpurple/cipher/sha256hash.h
  patched  libpurple/protocols/oscar/clientlogin.c

-------------- next part --------------
============================================================
--- libpurple/Makefile.am	a51cb9b3428d49b050938dc1e13c20badf00e2ef
+++ libpurple/Makefile.am	86d6dbc82d762528cfa74512fe850a187528d712
@@ -55,7 +55,7 @@ purple_coresources = \
 	cipher/md5hash.c \
 	cipher/rc4cipher.c \
 	cipher/sha1hash.c \
-	cipher/sha256cipher.c \
+	cipher/sha256hash.c \
 	cmds.c \
 	connection.c \
 	conversation.c \
@@ -138,7 +138,7 @@ purple_coreheaders = \
 	cipher/md5hash.h \
 	cipher/rc4cipher.h \
 	cipher/sha1hash.h \
-	cipher/sha256cipher.h \
+	cipher/sha256hash.h \
 	circbuffer.h \
 	cmds.h \
 	connection.h \
============================================================
--- libpurple/Makefile.mingw	8ccc24001d4a97bbc7860da5590c913ee2d9808b
+++ libpurple/Makefile.mingw	a339dd8c466cc5e02083d2c4af4f7352c9541e78
@@ -45,7 +45,7 @@ C_SRC =	\
 			cipher/md5hash.c \
 			cipher/rc4cipher.c \
 			cipher/sha1hash.c \
-			cipher/sha256cipher.c \
+			cipher/sha256hash.c \
 			circbuffer.c \
 			cmds.c \
 			connection.c \
============================================================
--- libpurple/protocols/oscar/clientlogin.c	7469c58781a27875d5a4261ec6ea104136b1fa01
+++ libpurple/protocols/oscar/clientlogin.c	315d1213e590deb8b4295ce655147742caf87924
@@ -42,9 +42,7 @@
 #include "cipher/cipher.h"
 #include "core.h"
 #include "cipher/hmaccipher.h"
-#include "cipher/sha256cipher.h"
-#include "cipher/hmaccipher.h"
-#include "cipher/sha256cipher.h"
+#include "cipher/sha256hash.h"
 
 #define URL_CLIENT_LOGIN "https://api.screenname.aol.com/auth/clientLogin"
 #define URL_START_OSCAR_SESSION "https://api.oscar.aol.com/aim/startOSCARSession"
@@ -92,10 +90,11 @@ static gchar *hmac_sha256(const char *ke
  */
 static gchar *hmac_sha256(const char *key, const char *message)
 {
-	PurpleCipher *hmac, *sha256;
+	PurpleCipher *hmac;
+	PurpleHash *sha256;
 	guchar digest[32];
 
-	sha256 = purple_sha256_cipher_new();
+	sha256 = purple_sha256_hash_new();
 	hmac = purple_hmac_cipher_new(sha256);
 	g_object_unref(G_OBJECT(sha256));
 	
============================================================
--- libpurple/cipher/sha256cipher.c	bb490f2ee92fcbf994da72376a79d667d89ede82
+++ libpurple/cipher/sha256hash.c	ff353108a9e91ce1bdb74c6d17a860396e23a366
@@ -1,6 +1,7 @@
 /*
  */
-#include "sha256cipher.h"
+#include "sha256hash.h"
+#include "hmaccipher.h"
 
 #include <string.h>
 
@@ -9,12 +10,16 @@
 #define SHA256_BLOCK_WORDS		16
 #define SHA256_HASH_WORDS		4
 
+#if !GLIB_CHECK_VERSION(2,16,0)
+#define PURPLE_SHA256_HASH_GET_PRIVATE(obj) \
+	(G_TYPE_INSTANCE_GET_PRIVATE((obj), PURPLE_TYPE_SHA256_HASH, PurpleSHA256HashPrivate))
+#endif
 
 /******************************************************************************
  * Structs
  *****************************************************************************/
 #if !GLIB_CHECK_VERSION(2,16,0)
-struct _PurpleSHA256CipherPriv {
+typedef struct {
 	guint32 H[8];
 	guint32 W[64];
 
@@ -22,7 +27,7 @@ struct _PurpleSHA256CipherPriv {
 
 	guint32 sizeHi;
 	guint32 sizeLo;
-};
+} PurpleSHA256HashPrivate;
 #endif
 /******************************************************************************
  * Enums
@@ -43,7 +48,7 @@ static GObjectClass *parent_class = NULL
 #define SHA256_ROTR(X,n) ((((X) >> (n)) | ((X) << (32-(n)))) & 0xFFFFFFFF)
 
 /******************************************************************************
- * Cipher Stuff
+ * Hash Stuff
  *****************************************************************************/
 
 #if !GLIB_CHECK_VERSION(2,16,0)
@@ -70,33 +75,33 @@ static void
 };
 
 static void
-purple_sha256_cipher_hash_block(PurpleSHA256Cipher *sha256_cipher)
+purple_sha256_hash_hash_block(PurpleSHA256HashPrivate *priv)
 {
 	gint i;
 	guint32 A, B, C, D, E, F, G, H, T1, T2;
 
 	for(i = 16; i < 64; i++) {
-		sha256_cipher->priv->W[i] =
-			  (SHA256_ROTR(sha256_cipher->priv->W[i-2], 17) ^ SHA256_ROTR(sha256_cipher->priv->W[i-2],  19) ^ (sha256_cipher->priv->W[i-2] >> 10))
-			+ sha256_cipher->priv->W[i-7]
-			+ (SHA256_ROTR(sha256_cipher->priv->W[i-15], 7) ^ SHA256_ROTR(sha256_cipher->priv->W[i-15], 18) ^ (sha256_cipher->priv->W[i-15] >> 3))
-			+ sha256_cipher->priv->W[i-16];
+		priv->W[i] =
+			  (SHA256_ROTR(priv->W[i-2], 17) ^ SHA256_ROTR(priv->W[i-2],  19) ^ (priv->W[i-2] >> 10))
+			+ priv->W[i-7]
+			+ (SHA256_ROTR(priv->W[i-15], 7) ^ SHA256_ROTR(priv->W[i-15], 18) ^ (priv->W[i-15] >> 3))
+			+ priv->W[i-16];
 	}
 
-	A = sha256_cipher->priv->H[0];
-	B = sha256_cipher->priv->H[1];
-	C = sha256_cipher->priv->H[2];
-	D = sha256_cipher->priv->H[3];
-	E = sha256_cipher->priv->H[4];
-	F = sha256_cipher->priv->H[5];
-	G = sha256_cipher->priv->H[6];
-	H = sha256_cipher->priv->H[7];
+	A = priv->H[0];
+	B = priv->H[1];
+	C = priv->H[2];
+	D = priv->H[3];
+	E = priv->H[4];
+	F = priv->H[5];
+	G = priv->H[6];
+	H = priv->H[7];
 
 	for(i = 0; i < 64; i++) {
         T1 = H
 			+ (SHA256_ROTR(E, 6) ^ SHA256_ROTR(E, 11) ^ SHA256_ROTR(E, 25))
 			+ ((E & F) ^ ((~E) & G))
-			+ sha256_K[i] + sha256_cipher->priv->W[i];
+			+ sha256_K[i] + priv->W[i];
         T2 = (SHA256_ROTR(A, 2) ^ SHA256_ROTR(A, 13) ^ SHA256_ROTR(A, 22))
 			+ ((A & B) ^ (A & C) ^ (B & C));
 		H = G;
@@ -109,90 +114,90 @@ purple_sha256_cipher_hash_block(PurpleSH
 		A = T1 + T2;
 	}
 
-	sha256_cipher->priv->H[0] += A;
-	sha256_cipher->priv->H[1] += B;
-	sha256_cipher->priv->H[2] += C;
-	sha256_cipher->priv->H[3] += D;
-	sha256_cipher->priv->H[4] += E;
-	sha256_cipher->priv->H[5] += F;
-	sha256_cipher->priv->H[6] += G;
-	sha256_cipher->priv->H[7] += H;
+	priv->H[0] += A;
+	priv->H[1] += B;
+	priv->H[2] += C;
+	priv->H[3] += D;
+	priv->H[4] += E;
+	priv->H[5] += F;
+	priv->H[6] += G;
+	priv->H[7] += H;
 }
 
 static void
-purple_sha256_cipher_reset(PurpleCipher *cipher)
+purple_sha256_hash_reset(PurpleHash *hash)
 {
-	PurpleSHA256Cipher *sha256_cipher = PURPLE_SHA256_CIPHER(cipher);
+	PurpleSHA256HashPrivate *priv = PURPLE_SHA256_HASH_GET_PRIVATE(hash);
 
-	sha256_cipher->priv->lenW = 0;
-	sha256_cipher->priv->sizeHi = 0;
-	sha256_cipher->priv->sizeLo = 0;
+	priv->lenW = 0;
+	priv->sizeHi = 0;
+	priv->sizeLo = 0;
 
-	sha256_cipher->priv->H[0] = 0x6a09e667;
-	sha256_cipher->priv->H[1] = 0xbb67ae85;
-	sha256_cipher->priv->H[2] = 0x3c6ef372;
-	sha256_cipher->priv->H[3] = 0xa54ff53a;
-	sha256_cipher->priv->H[4] = 0x510e527f;
-	sha256_cipher->priv->H[5] = 0x9b05688c;
-	sha256_cipher->priv->H[6] = 0x1f83d9ab;
-	sha256_cipher->priv->H[7] = 0x5be0cd19;
+	priv->H[0] = 0x6a09e667;
+	priv->H[1] = 0xbb67ae85;
+	priv->H[2] = 0x3c6ef372;
+	priv->H[3] = 0xa54ff53a;
+	priv->H[4] = 0x510e527f;
+	priv->H[5] = 0x9b05688c;
+	priv->H[6] = 0x1f83d9ab;
+	priv->H[7] = 0x5be0cd19;
 
-	memset(sha256_cipher->priv->W, 0, sizeof(sha256_cipher->priv->W));
+	memset(priv->W, 0, sizeof(priv->W));
 }
 
 static void
-purple_sha256_cipher_append(PurpleCipher *cipher, const guchar *data,
+purple_sha256_hash_append(PurpleHash *hash, const guchar *data,
                             size_t len)
 {
-	PurpleSHA256Cipher *sha256_cipher = PURPLE_SHA256_CIPHER(cipher);
+	PurpleSHA256HashPrivate *priv = PURPLE_SHA256_HASH_GET_PRIVATE(hash);
 	gint i;
 
 	for(i = 0; i < len; i++) {
-		sha256_cipher->priv->W[sha256_cipher->priv->lenW / 4] <<= 8;
-		sha256_cipher->priv->W[sha256_cipher->priv->lenW / 4] |= data[i];
+		priv->W[priv->lenW / 4] <<= 8;
+		priv->W[priv->lenW / 4] |= data[i];
 
-		if((++sha256_cipher->priv->lenW) % 64 == 0) {
-			purple_sha256_cipher_hash_block(sha256_cipher);
-			sha256_cipher->priv->lenW = 0;
+		if((++priv->lenW) % 64 == 0) {
+			purple_sha256_hash_hash_block(priv);
+			priv->lenW = 0;
 		}
 
-		sha256_cipher->priv->sizeLo += 8;
-		sha256_cipher->priv->sizeHi += (sha256_cipher->priv->sizeLo < 8);
+		priv->sizeLo += 8;
+		priv->sizeHi += (priv->sizeLo < 8);
 	}
 }
 
 static gboolean
-purple_sha256_cipher_digest(PurpleCipher *cipher, size_t in_len,
+purple_sha256_hash_digest(PurpleHash *hash, size_t in_len,
                             guchar digest[32], size_t *out_len)
 {
-	PurpleSHA256Cipher *sha256_cipher = PURPLE_SHA256_CIPHER(cipher);
+	PurpleSHA256HashPrivate *priv = PURPLE_SHA256_HASH_GET_PRIVATE(hash);
 	guchar pad0x80 = 0x80, pad0x00 = 0x00;
 	guchar padlen[8];
 	gint i;
 
 	g_return_val_if_fail(in_len >= 32, FALSE);
 
-	padlen[0] = (guchar)((sha256_cipher->priv->sizeHi >> 24) & 255);
-	padlen[1] = (guchar)((sha256_cipher->priv->sizeHi >> 16) & 255);
-	padlen[2] = (guchar)((sha256_cipher->priv->sizeHi >> 8) & 255);
-	padlen[3] = (guchar)((sha256_cipher->priv->sizeHi >> 0) & 255);
-	padlen[4] = (guchar)((sha256_cipher->priv->sizeLo >> 24) & 255);
-	padlen[5] = (guchar)((sha256_cipher->priv->sizeLo >> 16) & 255);
-	padlen[6] = (guchar)((sha256_cipher->priv->sizeLo >> 8) & 255);
-	padlen[7] = (guchar)((sha256_cipher->priv->sizeLo >> 0) & 255);
+	padlen[0] = (guchar)((priv->sizeHi >> 24) & 255);
+	padlen[1] = (guchar)((priv->sizeHi >> 16) & 255);
+	padlen[2] = (guchar)((priv->sizeHi >> 8) & 255);
+	padlen[3] = (guchar)((priv->sizeHi >> 0) & 255);
+	padlen[4] = (guchar)((priv->sizeLo >> 24) & 255);
+	padlen[5] = (guchar)((priv->sizeLo >> 16) & 255);
+	padlen[6] = (guchar)((priv->sizeLo >> 8) & 255);
+	padlen[7] = (guchar)((priv->sizeLo >> 0) & 255);
 
 	/* pad with a 1, then zeroes, then length */
-	purple_sha256_cipher_append(cipher, &pad0x80, 1);
-	while(sha256_cipher->priv->lenW != 56)
-		purple_sha256_cipher_append(cipher, &pad0x00, 1);
-	purple_sha256_cipher_append(cipher, padlen, 8);
+	purple_sha256_hash_append(hash, &pad0x80, 1);
+	while(priv->lenW != 56)
+		purple_sha256_hash_append(hash, &pad0x00, 1);
+	purple_sha256_hash_append(hash, padlen, 8);
 
 	for(i = 0; i < 32; i++) {
-		digest[i] = (guchar)(sha256_cipher->priv->H[i / 4] >> 24);
-		sha256_cipher->priv->H[i / 4] <<= 8;
+		digest[i] = (guchar)(priv->H[i / 4] >> 24);
+		priv->H[i / 4] <<= 8;
 	}
 
-	purple_sha256_cipher_reset(cipher);
+	purple_sha256_hash_reset(hash);
 
 	if(out_len)
 		*out_len = 32;
@@ -201,104 +206,108 @@ purple_sha256_cipher_digest(PurpleCipher
 }
 #endif /* !GLIB_CHECK_VERSION */
 
-static size_t
-purple_sha256_cipher_get_block_size(PurpleCipher *cipher)
-{
-	return SHA256_HMAC_BLOCK_SIZE;
-}
-
 /******************************************************************************
  * Object Stuff
  *****************************************************************************/
 #if !GLIB_CHECK_VERSION(2,16,0)
 static void
-purple_sha256_cipher_finalize(GObject *obj)
+purple_sha256_hash_finalize(GObject *obj)
 {
-	PurpleCipher *cipher = PURPLE_CIPHER(obj);
-	PurpleSHA256Cipher *sha256_cipher = PURPLE_SHA256_CIPHER(obj);
+	PurpleHash *hash = PURPLE_HASH(obj);
+	PurpleSHA256HashPrivate *priv = PURPLE_SHA256_HASH_GET_PRIVATE(obj);
 
-	/* reset the cipher so we don't leave any data around... */
-	purple_sha256_cipher_reset(cipher);
+	/* reset the hash so we don't leave any data around... */
+	purple_sha256_hash_reset(hash);
 
-	g_free(sha256_cipher->priv);
+	g_free(priv);
 }
 #endif /* !GLIB_CHECK_VERSION(2,16,0) */
 
 static void
-purple_sha256_cipher_class_init(PurpleSHA256CipherClass *klass) {
+purple_sha256_hash_class_init(PurpleSHA256HashClass *klass) {
 #if !GLIB_CHECK_VERSION(2,16,0)
 	GObjectClass *obj_class = G_OBJECT_CLASS(klass);
+	PurpleHashClass *hash_class = PURPLE_HASH_CLASS(klass);
 #endif
-	PurpleCipherClass *cipher_class = PURPLE_CIPHER_CLASS(klass);
 
 	parent_class = g_type_class_peek_parent(klass);
 
 #if !GLIB_CHECK_VERSION(2,16,0)
-	obj_class->finalize = purple_sha256_cipher_finalize;
+	g_type_class_add_private(klass, sizeof(PurpleSHA256HashPrivate));
 
-	cipher_class->reset = purple_sha256_cipher_reset;
-	cipher_class->append = purple_sha256_cipher_append;
-	cipher_class->digest = purple_sha256_cipher_digest;
+	obj_class->finalize = purple_sha256_hash_finalize;
+
+	hash_class->reset = purple_sha256_hash_reset;
+	hash_class->append = purple_sha256_hash_append;
+	hash_class->digest = purple_sha256_hash_digest;
 #endif
-	cipher_class->get_block_size = purple_sha256_cipher_get_block_size;
 }
 
-static void
-purple_sha256_cipher_init(PurpleCipher *cipher) {
-#if !GLIB_CHECK_VERSION(2,16,0)
-	PurpleSHA256Cipher *sha256_cipher = PURPLE_SHA256_CIPHER(cipher);
+/******************************************************************************
+ * HMACFunction Stuff
+ *****************************************************************************/
+static size_t
+purple_sha256_hash_get_block_size(const PurpleHMACFunction *function) {
+	return SHA256_HMAC_BLOCK_SIZE;
+}
 
-	sha256_cipher->priv = g_new0(PurpleSHA256CipherPriv, 1);
-
-	purple_sha256_cipher_reset(cipher);
-#endif
+static void
+purple_sha256_hash_hmac_function_init(PurpleHMACFunctionIface *iface) {
+	iface->get_block_size = purple_sha256_hash_get_block_size;
 }
 
 /******************************************************************************
  * API
  *****************************************************************************/
 GType
-purple_sha256_cipher_get_gtype(void) {
+purple_sha256_hash_get_gtype(void) {
 	static GType type = 0;
 
 	if(type == 0) {
 		static const GTypeInfo info = {
-			sizeof(PurpleSHA256CipherClass),
+			sizeof(PurpleSHA256HashClass),
 			NULL,
 			NULL,
-			(GClassInitFunc)purple_sha256_cipher_class_init,
+			(GClassInitFunc)purple_sha256_hash_class_init,
 			NULL,
 			NULL,
-			sizeof(PurpleSHA256Cipher),
+			sizeof(PurpleSHA256Hash),
 			0,
-			(GInstanceInitFunc)purple_sha256_cipher_init,
 			NULL,
+			NULL,
 		};
+		static const GInterfaceInfo hmac_info = {
+			(GInterfaceInitFunc)purple_sha256_hash_hmac_function_init,
+			NULL,
+			NULL
+		};
 
 		GType parent = G_TYPE_INVALID;
 
 #if GLIB_CHECK_VERSION(2,16,0)
 		parent = PURPLE_TYPE_G_HASH;
 #else
-		parent = PURPLE_TYPE_CIPHER;
+		parent = PURPLE_TYPE_HASH;
 #endif
 
 		type = g_type_register_static(parent,
-									  "PurpleSHA256Cipher",
+									  "PurpleSHA256Hash",
 									  &info, 0);
+
+		g_type_add_interface_static(type, PURPLE_TYPE_HMAC_FUNCTION, &hmac_info);
 	}
 
 	return type;
 }
 
-PurpleCipher *
-purple_sha256_cipher_new(void) {
+PurpleHash *
+purple_sha256_hash_new(void) {
 #if GLIB_CHECK_VERSION(2,16,0)
-	return g_object_new(PURPLE_TYPE_SHA256_CIPHER,
+	return g_object_new(PURPLE_TYPE_SHA256_HASH,
 			"checksum_type", G_CHECKSUM_SHA256,
 			NULL);
 #else
-	return g_object_new(PURPLE_TYPE_SHA256_CIPHER, NULL);
+	return g_object_new(PURPLE_TYPE_SHA256_HASH, NULL);
 #endif
 }
 
============================================================
--- libpurple/cipher/sha256cipher.h	5a7e1ee62fd0252e04e656ed40f46b68a320e1d6
+++ libpurple/cipher/sha256hash.h	9477bf230ae4a42edf08cd0e9a097cc62e8bd512
@@ -1,5 +1,5 @@
 /**
- * @file sha256cipher.h Purple Cipher API
+ * @file sha256hash.h Purple Hash API
  * @ingroup core
  *
  * purple
@@ -22,31 +22,31 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
-#ifndef PURPLE_SHA256_CIPHER_H
-#define PURPLE_SHA256_CIPHER_H
+#ifndef PURPLE_SHA256_HASH_H
+#define PURPLE_SHA256_HASH_H
 
-#include <cipher/cipher.h>
+#include <cipher/hash.h>
 #include <cipher/ghash.h>
 
-#define PURPLE_TYPE_SHA256_CIPHER				(purple_sha256_cipher_get_gtype())
-#define PURPLE_SHA256_CIPHER(obj)				(G_TYPE_CHECK_INSTANCE_CAST((obj), PURPLE_TYPE_SHA256_CIPHER, PurpleSHA256Cipher))
-#define PURPLE_SHA256_CIPHER_CLASS(klass)		(G_TYPE_CHECK_CLASS_CAST((klass), PURPLE_TYPE_SHA256_CIPHER, PurpleSHA256CipherClass))
-#define PURPLE_IS_SHA256_CIPHER(obj)			(G_TYPE_CHECK_INSTANCE_TYPE((obj), PURPLE_TYPE_SHA256_CIPHER))
-#define PURPLE_IS_SHA256_CIPHER_CLASS(klass)	(G_TYPE_CHECK_CLASS_TYPE((obj), PURPLE_TYPE_SHA256_CIPHER))
-#define PURPLE_SHA256_CIPHER_GET_CLASS(obj)	(G_TYPE_INSTANCE_GET_CLASS((obj), PURPLE_TYPE_SHA256_CIPHER, PurpleSHA256CipherClass))
+#define PURPLE_TYPE_SHA256_HASH				(purple_sha256_hash_get_gtype())
+#define PURPLE_SHA256_HASH(obj)				(G_TYPE_CHECK_INSTANCE_CAST((obj), PURPLE_TYPE_SHA256_HASH, PurpleSHA256Hash))
+#define PURPLE_SHA256_HASH_CLASS(klass)		(G_TYPE_CHECK_CLASS_CAST((klass), PURPLE_TYPE_SHA256_HASH, PurpleSHA256HashClass))
+#define PURPLE_IS_SHA256_HASH(obj)			(G_TYPE_CHECK_INSTANCE_TYPE((obj), PURPLE_TYPE_SHA256_HASH))
+#define PURPLE_IS_SHA256_HASH_CLASS(klass)	(G_TYPE_CHECK_CLASS_TYPE((obj), PURPLE_TYPE_SHA256_HASH))
+#define PURPLE_SHA256_HASH_GET_CLASS(obj)	(G_TYPE_INSTANCE_GET_CLASS((obj), PURPLE_TYPE_SHA256_HASH, PurpleSHA256HashClass))
 
-typedef struct _PurpleSHA256Cipher				PurpleSHA256Cipher;
-typedef struct _PurpleSHA256CipherPriv			PurpleSHA256CipherPriv;
-typedef struct _PurpleSHA256CipherClass		PurpleSHA256CipherClass;
+typedef struct _PurpleSHA256Hash				PurpleSHA256Hash;
+typedef struct _PurpleSHA256HashPriv			PurpleSHA256HashPriv;
+typedef struct _PurpleSHA256HashClass		PurpleSHA256HashClass;
 
-struct _PurpleSHA256Cipher {
+struct _PurpleSHA256Hash {
 #if GLIB_CHECK_VERSION(2,16,0)
 	PurpleGHash parent;
 #else
-	PurpleCipher parent;
+	PurpleHash parent;
 #endif
 
-	PurpleSHA256CipherPriv *priv;
+	PurpleSHA256HashPriv *priv;
 
 	void (*_purple_reserved1)(void);
 	void (*_purple_reserved2)(void);
@@ -54,11 +54,11 @@ struct _PurpleSHA256Cipher {
 	void (*_purple_reserved4)(void);
 };
 
-struct _PurpleSHA256CipherClass {
+struct _PurpleSHA256HashClass {
 #if GLIB_CHECK_VERSION(2,16,0)
 	PurpleGHashClass parent;
 #else
-	PurpleCipherClass parent;
+	PurpleHashClass parent;
 #endif
 
 	void (*_purple_reserved1)(void);
@@ -69,10 +69,10 @@ G_BEGIN_DECLS
 
 G_BEGIN_DECLS
 
-GType purple_sha256_cipher_get_gtype(void);
+GType purple_sha256_hash_get_gtype(void);
 
-PurpleCipher *purple_sha256_cipher_new(void);
+PurpleHash *purple_sha256_hash_new(void);
 
 G_END_DECLS
 
-#endif /* PURPLE_SHA256_CIPHER_H */
+#endif /* PURPLE_SHA256_HASH_H */


More information about the Commits mailing list