libpurple/cipher.h

Fri, 31 Jan 2014 19:42:12 +0530

author
Ankit Vani <a@nevitus.org>
date
Fri, 31 Jan 2014 19:42:12 +0530
branch
soc.2013.gobjectification.plugins
changeset 37039
7d964cdccbb5
parent 37035
e85ed7f4d6e3
child 37040
91119588bc3a
permissions
-rw-r--r--

Merged gtkdoc-conversion branch

10684
0325b164a7eb [gaim-migrate @ 12231]
Luke Schierer <lschiere@pidgin.im>
parents:
diff changeset
1 /**
35101
bed9fe4dd179 Fix header guard and file comment.
Mark Doliner <mark@kingant.net>
parents: 35094
diff changeset
2 * @file cipher.h Purple Cipher and Hash API
10684
0325b164a7eb [gaim-migrate @ 12231]
Luke Schierer <lschiere@pidgin.im>
parents:
diff changeset
3 * @ingroup core
20147
66f05a854eee applied changes from 8a731bbd0197fbcc91a705c2d8f528154216defa
Richard Laager <rlaager@pidgin.im>
parents: 19859
diff changeset
4 */
66f05a854eee applied changes from 8a731bbd0197fbcc91a705c2d8f528154216defa
Richard Laager <rlaager@pidgin.im>
parents: 19859
diff changeset
5
66f05a854eee applied changes from 8a731bbd0197fbcc91a705c2d8f528154216defa
Richard Laager <rlaager@pidgin.im>
parents: 19859
diff changeset
6 /* purple
10684
0325b164a7eb [gaim-migrate @ 12231]
Luke Schierer <lschiere@pidgin.im>
parents:
diff changeset
7 *
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
8 * Purple is the legal property of its developers, whose names are too numerous
10684
0325b164a7eb [gaim-migrate @ 12231]
Luke Schierer <lschiere@pidgin.im>
parents:
diff changeset
9 * to list here. Please refer to the COPYRIGHT file distributed with this
0325b164a7eb [gaim-migrate @ 12231]
Luke Schierer <lschiere@pidgin.im>
parents:
diff changeset
10 * source distribution.
0325b164a7eb [gaim-migrate @ 12231]
Luke Schierer <lschiere@pidgin.im>
parents:
diff changeset
11 *
0325b164a7eb [gaim-migrate @ 12231]
Luke Schierer <lschiere@pidgin.im>
parents:
diff changeset
12 * This program is free software; you can redistribute it and/or modify
0325b164a7eb [gaim-migrate @ 12231]
Luke Schierer <lschiere@pidgin.im>
parents:
diff changeset
13 * it under the terms of the GNU General Public License as published by
0325b164a7eb [gaim-migrate @ 12231]
Luke Schierer <lschiere@pidgin.im>
parents:
diff changeset
14 * the Free Software Foundation; either version 2 of the License, or
0325b164a7eb [gaim-migrate @ 12231]
Luke Schierer <lschiere@pidgin.im>
parents:
diff changeset
15 * (at your option) any later version.
0325b164a7eb [gaim-migrate @ 12231]
Luke Schierer <lschiere@pidgin.im>
parents:
diff changeset
16 *
0325b164a7eb [gaim-migrate @ 12231]
Luke Schierer <lschiere@pidgin.im>
parents:
diff changeset
17 * This program is distributed in the hope that it will be useful,
0325b164a7eb [gaim-migrate @ 12231]
Luke Schierer <lschiere@pidgin.im>
parents:
diff changeset
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
0325b164a7eb [gaim-migrate @ 12231]
Luke Schierer <lschiere@pidgin.im>
parents:
diff changeset
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
0325b164a7eb [gaim-migrate @ 12231]
Luke Schierer <lschiere@pidgin.im>
parents:
diff changeset
20 * GNU General Public License for more details.
0325b164a7eb [gaim-migrate @ 12231]
Luke Schierer <lschiere@pidgin.im>
parents:
diff changeset
21 *
0325b164a7eb [gaim-migrate @ 12231]
Luke Schierer <lschiere@pidgin.im>
parents:
diff changeset
22 * You should have received a copy of the GNU General Public License
0325b164a7eb [gaim-migrate @ 12231]
Luke Schierer <lschiere@pidgin.im>
parents:
diff changeset
23 * along with this program; if not, write to the Free Software
19859
71d37b57eff2 The FSF changed its address a while ago; our files were out of date.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 18412
diff changeset
24 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
10684
0325b164a7eb [gaim-migrate @ 12231]
Luke Schierer <lschiere@pidgin.im>
parents:
diff changeset
25 */
35101
bed9fe4dd179 Fix header guard and file comment.
Mark Doliner <mark@kingant.net>
parents: 35094
diff changeset
26 #ifndef PURPLE_CIPHER_H
bed9fe4dd179 Fix header guard and file comment.
Mark Doliner <mark@kingant.net>
parents: 35094
diff changeset
27 #define PURPLE_CIPHER_H
10684
0325b164a7eb [gaim-migrate @ 12231]
Luke Schierer <lschiere@pidgin.im>
parents:
diff changeset
28
0325b164a7eb [gaim-migrate @ 12231]
Luke Schierer <lschiere@pidgin.im>
parents:
diff changeset
29 #include <glib.h>
34536
38cc893bae51 GObjectify RC4 cipher as PurpleRC4Cipher
Ankit Vani <a@nevitus.org>
parents: 34535
diff changeset
30 #include <glib-object.h>
31428
f392265bbe2d included string.h in cipher.h since almost all of the ciphers use it.
Gary Kramlich <grim@reaperworld.com>
parents: 31421
diff changeset
31 #include <string.h>
10684
0325b164a7eb [gaim-migrate @ 12231]
Luke Schierer <lschiere@pidgin.im>
parents:
diff changeset
32
34533
74b179b1e8ef GObjectify the PurpleCipher structure
Ankit Vani <a@nevitus.org>
parents: 33915
diff changeset
33 #define PURPLE_TYPE_CIPHER (purple_cipher_get_type())
74b179b1e8ef GObjectify the PurpleCipher structure
Ankit Vani <a@nevitus.org>
parents: 33915
diff changeset
34 #define PURPLE_CIPHER(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), PURPLE_TYPE_CIPHER, PurpleCipher))
74b179b1e8ef GObjectify the PurpleCipher structure
Ankit Vani <a@nevitus.org>
parents: 33915
diff changeset
35 #define PURPLE_CIPHER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), PURPLE_TYPE_CIPHER, PurpleCipherClass))
74b179b1e8ef GObjectify the PurpleCipher structure
Ankit Vani <a@nevitus.org>
parents: 33915
diff changeset
36 #define PURPLE_IS_CIPHER(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), PURPLE_TYPE_CIPHER))
74b179b1e8ef GObjectify the PurpleCipher structure
Ankit Vani <a@nevitus.org>
parents: 33915
diff changeset
37 #define PURPLE_IS_CIPHER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), PURPLE_TYPE_CIPHER))
74b179b1e8ef GObjectify the PurpleCipher structure
Ankit Vani <a@nevitus.org>
parents: 33915
diff changeset
38 #define PURPLE_CIPHER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), PURPLE_TYPE_CIPHER, PurpleCipherClass))
74b179b1e8ef GObjectify the PurpleCipher structure
Ankit Vani <a@nevitus.org>
parents: 33915
diff changeset
39
74b179b1e8ef GObjectify the PurpleCipher structure
Ankit Vani <a@nevitus.org>
parents: 33915
diff changeset
40 typedef struct _PurpleCipher PurpleCipher;
74b179b1e8ef GObjectify the PurpleCipher structure
Ankit Vani <a@nevitus.org>
parents: 33915
diff changeset
41 typedef struct _PurpleCipherClass PurpleCipherClass;
74b179b1e8ef GObjectify the PurpleCipher structure
Ankit Vani <a@nevitus.org>
parents: 33915
diff changeset
42
35026
fde23518e1e5 Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents: 35024
diff changeset
43 #define PURPLE_TYPE_HASH (purple_hash_get_type())
fde23518e1e5 Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents: 35024
diff changeset
44 #define PURPLE_HASH(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), PURPLE_TYPE_HASH, PurpleHash))
fde23518e1e5 Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents: 35024
diff changeset
45 #define PURPLE_HASH_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), PURPLE_TYPE_HASH, PurpleHashClass))
fde23518e1e5 Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents: 35024
diff changeset
46 #define PURPLE_IS_HASH(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), PURPLE_TYPE_HASH))
fde23518e1e5 Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents: 35024
diff changeset
47 #define PURPLE_IS_HASH_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), PURPLE_TYPE_HASH))
fde23518e1e5 Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents: 35024
diff changeset
48 #define PURPLE_HASH_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), PURPLE_TYPE_HASH, PurpleHashClass))
fde23518e1e5 Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents: 35024
diff changeset
49
fde23518e1e5 Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents: 35024
diff changeset
50 typedef struct _PurpleHash PurpleHash;
fde23518e1e5 Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents: 35024
diff changeset
51 typedef struct _PurpleHashClass PurpleHashClass;
fde23518e1e5 Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents: 35024
diff changeset
52
22024
3fd5e4fff1be Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 20889
diff changeset
53 /**
34533
74b179b1e8ef GObjectify the PurpleCipher structure
Ankit Vani <a@nevitus.org>
parents: 33915
diff changeset
54 * PurpleCipherBatchMode:
74b179b1e8ef GObjectify the PurpleCipher structure
Ankit Vani <a@nevitus.org>
parents: 33915
diff changeset
55 * @PURPLE_CIPHER_BATCH_MODE_ECB: Electronic Codebook Mode
74b179b1e8ef GObjectify the PurpleCipher structure
Ankit Vani <a@nevitus.org>
parents: 33915
diff changeset
56 * @PURPLE_CIPHER_BATCH_MODE_CBC: Cipher Block Chaining Mode
74b179b1e8ef GObjectify the PurpleCipher structure
Ankit Vani <a@nevitus.org>
parents: 33915
diff changeset
57 *
22024
3fd5e4fff1be Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 20889
diff changeset
58 * Modes for batch encrypters
3fd5e4fff1be Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 20889
diff changeset
59 */
35094
47964e26263e Assorted whitespace fixes.
Mark Doliner <mark@kingant.net>
parents: 35033
diff changeset
60 typedef enum {
34971
569385eb1f89 Removed PurpleCipherBatchMode enum nicks
Ankit Vani <a@nevitus.org>
parents: 34965
diff changeset
61 PURPLE_CIPHER_BATCH_MODE_ECB,
569385eb1f89 Removed PurpleCipherBatchMode enum nicks
Ankit Vani <a@nevitus.org>
parents: 34965
diff changeset
62 PURPLE_CIPHER_BATCH_MODE_CBC
22024
3fd5e4fff1be Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 20889
diff changeset
63 } PurpleCipherBatchMode;
10684
0325b164a7eb [gaim-migrate @ 12231]
Luke Schierer <lschiere@pidgin.im>
parents:
diff changeset
64
0325b164a7eb [gaim-migrate @ 12231]
Luke Schierer <lschiere@pidgin.im>
parents:
diff changeset
65 /**
34533
74b179b1e8ef GObjectify the PurpleCipher structure
Ankit Vani <a@nevitus.org>
parents: 33915
diff changeset
66 * PurpleCipher:
74b179b1e8ef GObjectify the PurpleCipher structure
Ankit Vani <a@nevitus.org>
parents: 33915
diff changeset
67 *
74b179b1e8ef GObjectify the PurpleCipher structure
Ankit Vani <a@nevitus.org>
parents: 33915
diff changeset
68 * Purple Cipher is an opaque data structure and should not be used directly.
10684
0325b164a7eb [gaim-migrate @ 12231]
Luke Schierer <lschiere@pidgin.im>
parents:
diff changeset
69 */
34533
74b179b1e8ef GObjectify the PurpleCipher structure
Ankit Vani <a@nevitus.org>
parents: 33915
diff changeset
70 struct _PurpleCipher {
74b179b1e8ef GObjectify the PurpleCipher structure
Ankit Vani <a@nevitus.org>
parents: 33915
diff changeset
71 GObject gparent;
74b179b1e8ef GObjectify the PurpleCipher structure
Ankit Vani <a@nevitus.org>
parents: 33915
diff changeset
72 };
10684
0325b164a7eb [gaim-migrate @ 12231]
Luke Schierer <lschiere@pidgin.im>
parents:
diff changeset
73
0325b164a7eb [gaim-migrate @ 12231]
Luke Schierer <lschiere@pidgin.im>
parents:
diff changeset
74 /**
34533
74b179b1e8ef GObjectify the PurpleCipher structure
Ankit Vani <a@nevitus.org>
parents: 33915
diff changeset
75 * PurpleCipherClass:
74b179b1e8ef GObjectify the PurpleCipher structure
Ankit Vani <a@nevitus.org>
parents: 33915
diff changeset
76 *
74b179b1e8ef GObjectify the PurpleCipher structure
Ankit Vani <a@nevitus.org>
parents: 33915
diff changeset
77 * The base class for all #PurpleCipher's.
10684
0325b164a7eb [gaim-migrate @ 12231]
Luke Schierer <lschiere@pidgin.im>
parents:
diff changeset
78 */
34533
74b179b1e8ef GObjectify the PurpleCipher structure
Ankit Vani <a@nevitus.org>
parents: 33915
diff changeset
79 struct _PurpleCipherClass {
74b179b1e8ef GObjectify the PurpleCipher structure
Ankit Vani <a@nevitus.org>
parents: 33915
diff changeset
80 GObjectClass parent_class;
10684
0325b164a7eb [gaim-migrate @ 12231]
Luke Schierer <lschiere@pidgin.im>
parents:
diff changeset
81
0325b164a7eb [gaim-migrate @ 12231]
Luke Schierer <lschiere@pidgin.im>
parents:
diff changeset
82 /** The reset function */
34533
74b179b1e8ef GObjectify the PurpleCipher structure
Ankit Vani <a@nevitus.org>
parents: 33915
diff changeset
83 void (*reset)(PurpleCipher *cipher);
10684
0325b164a7eb [gaim-migrate @ 12231]
Luke Schierer <lschiere@pidgin.im>
parents:
diff changeset
84
34535
f8fd1c60c22a Merged PurpleCipher structure with the one in default branch
Ankit Vani <a@nevitus.org>
parents: 34533
diff changeset
85 /** The reset state function */
f8fd1c60c22a Merged PurpleCipher structure with the one in default branch
Ankit Vani <a@nevitus.org>
parents: 34533
diff changeset
86 void (*reset_state)(PurpleCipher *cipher);
f8fd1c60c22a Merged PurpleCipher structure with the one in default branch
Ankit Vani <a@nevitus.org>
parents: 34533
diff changeset
87
10684
0325b164a7eb [gaim-migrate @ 12231]
Luke Schierer <lschiere@pidgin.im>
parents:
diff changeset
88 /** The set initialization vector function */
34533
74b179b1e8ef GObjectify the PurpleCipher structure
Ankit Vani <a@nevitus.org>
parents: 33915
diff changeset
89 void (*set_iv)(PurpleCipher *cipher, guchar *iv, size_t len);
10684
0325b164a7eb [gaim-migrate @ 12231]
Luke Schierer <lschiere@pidgin.im>
parents:
diff changeset
90
0325b164a7eb [gaim-migrate @ 12231]
Luke Schierer <lschiere@pidgin.im>
parents:
diff changeset
91 /** The append data function */
34533
74b179b1e8ef GObjectify the PurpleCipher structure
Ankit Vani <a@nevitus.org>
parents: 33915
diff changeset
92 void (*append)(PurpleCipher *cipher, const guchar *data, size_t len);
10684
0325b164a7eb [gaim-migrate @ 12231]
Luke Schierer <lschiere@pidgin.im>
parents:
diff changeset
93
0325b164a7eb [gaim-migrate @ 12231]
Luke Schierer <lschiere@pidgin.im>
parents:
diff changeset
94 /** The digest function */
34535
f8fd1c60c22a Merged PurpleCipher structure with the one in default branch
Ankit Vani <a@nevitus.org>
parents: 34533
diff changeset
95 gboolean (*digest)(PurpleCipher *cipher, guchar digest[], size_t len);
f8fd1c60c22a Merged PurpleCipher structure with the one in default branch
Ankit Vani <a@nevitus.org>
parents: 34533
diff changeset
96
f8fd1c60c22a Merged PurpleCipher structure with the one in default branch
Ankit Vani <a@nevitus.org>
parents: 34533
diff changeset
97 /** The get digest size function */
f8fd1c60c22a Merged PurpleCipher structure with the one in default branch
Ankit Vani <a@nevitus.org>
parents: 34533
diff changeset
98 size_t (*get_digest_size)(PurpleCipher *cipher);
10684
0325b164a7eb [gaim-migrate @ 12231]
Luke Schierer <lschiere@pidgin.im>
parents:
diff changeset
99
0325b164a7eb [gaim-migrate @ 12231]
Luke Schierer <lschiere@pidgin.im>
parents:
diff changeset
100 /** The encrypt function */
34535
f8fd1c60c22a Merged PurpleCipher structure with the one in default branch
Ankit Vani <a@nevitus.org>
parents: 34533
diff changeset
101 ssize_t (*encrypt)(PurpleCipher *cipher, const guchar input[], size_t in_len, guchar output[], size_t out_size);
10684
0325b164a7eb [gaim-migrate @ 12231]
Luke Schierer <lschiere@pidgin.im>
parents:
diff changeset
102
0325b164a7eb [gaim-migrate @ 12231]
Luke Schierer <lschiere@pidgin.im>
parents:
diff changeset
103 /** The decrypt function */
34535
f8fd1c60c22a Merged PurpleCipher structure with the one in default branch
Ankit Vani <a@nevitus.org>
parents: 34533
diff changeset
104 ssize_t (*decrypt)(PurpleCipher *cipher, const guchar input[], size_t in_len, guchar output[], size_t out_size);
10684
0325b164a7eb [gaim-migrate @ 12231]
Luke Schierer <lschiere@pidgin.im>
parents:
diff changeset
105
0325b164a7eb [gaim-migrate @ 12231]
Luke Schierer <lschiere@pidgin.im>
parents:
diff changeset
106 /** The set salt function */
34535
f8fd1c60c22a Merged PurpleCipher structure with the one in default branch
Ankit Vani <a@nevitus.org>
parents: 34533
diff changeset
107 void (*set_salt)(PurpleCipher *cipher, const guchar *salt, size_t len);
10684
0325b164a7eb [gaim-migrate @ 12231]
Luke Schierer <lschiere@pidgin.im>
parents:
diff changeset
108
0325b164a7eb [gaim-migrate @ 12231]
Luke Schierer <lschiere@pidgin.im>
parents:
diff changeset
109 /** The set key function */
34535
f8fd1c60c22a Merged PurpleCipher structure with the one in default branch
Ankit Vani <a@nevitus.org>
parents: 34533
diff changeset
110 void (*set_key)(PurpleCipher *cipher, const guchar *key, size_t len);
16743
1ce5ffe12e2a Initial addition of padding for ui_ops and other class-like structs
Gary Kramlich <grim@reaperworld.com>
parents: 15884
diff changeset
111
33910
5749f2724b12 ciphers cleanup: get key size
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33909
diff changeset
112 /** The get key size function */
34533
74b179b1e8ef GObjectify the PurpleCipher structure
Ankit Vani <a@nevitus.org>
parents: 33915
diff changeset
113 size_t (*get_key_size)(PurpleCipher *cipher);
33910
5749f2724b12 ciphers cleanup: get key size
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33909
diff changeset
114
22024
3fd5e4fff1be Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 20889
diff changeset
115 /** The set batch mode function */
34533
74b179b1e8ef GObjectify the PurpleCipher structure
Ankit Vani <a@nevitus.org>
parents: 33915
diff changeset
116 void (*set_batch_mode)(PurpleCipher *cipher, PurpleCipherBatchMode mode);
22024
3fd5e4fff1be Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 20889
diff changeset
117
3fd5e4fff1be Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 20889
diff changeset
118 /** The get batch mode function */
34533
74b179b1e8ef GObjectify the PurpleCipher structure
Ankit Vani <a@nevitus.org>
parents: 33915
diff changeset
119 PurpleCipherBatchMode (*get_batch_mode)(PurpleCipher *cipher);
22024
3fd5e4fff1be Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 20889
diff changeset
120
22025
23756775175d HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 22024
diff changeset
121 /** The get block size function */
34533
74b179b1e8ef GObjectify the PurpleCipher structure
Ankit Vani <a@nevitus.org>
parents: 33915
diff changeset
122 size_t (*get_block_size)(PurpleCipher *cipher);
74b179b1e8ef GObjectify the PurpleCipher structure
Ankit Vani <a@nevitus.org>
parents: 33915
diff changeset
123
35024
eb3afb7643ce Added /*< private >*/ for padding members, clean them up and add missing ones
Ankit Vani <a@nevitus.org>
parents: 34971
diff changeset
124 /*< private >*/
33908
78b42fd69e02 ciphers cleanup: passing keys with length by default
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 32206
diff changeset
125 void (*_purple_reserved1)(void);
78b42fd69e02 ciphers cleanup: passing keys with length by default
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 32206
diff changeset
126 void (*_purple_reserved2)(void);
78b42fd69e02 ciphers cleanup: passing keys with length by default
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 32206
diff changeset
127 void (*_purple_reserved3)(void);
78b42fd69e02 ciphers cleanup: passing keys with length by default
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 32206
diff changeset
128 void (*_purple_reserved4)(void);
10684
0325b164a7eb [gaim-migrate @ 12231]
Luke Schierer <lschiere@pidgin.im>
parents:
diff changeset
129 };
0325b164a7eb [gaim-migrate @ 12231]
Luke Schierer <lschiere@pidgin.im>
parents:
diff changeset
130
35026
fde23518e1e5 Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents: 35024
diff changeset
131 /**
fde23518e1e5 Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents: 35024
diff changeset
132 * PurpleHash:
fde23518e1e5 Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents: 35024
diff changeset
133 *
fde23518e1e5 Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents: 35024
diff changeset
134 * Purple Hash is an opaque data structure and should not be used directly.
fde23518e1e5 Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents: 35024
diff changeset
135 */
fde23518e1e5 Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents: 35024
diff changeset
136 struct _PurpleHash {
fde23518e1e5 Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents: 35024
diff changeset
137 GObject gparent;
fde23518e1e5 Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents: 35024
diff changeset
138 };
fde23518e1e5 Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents: 35024
diff changeset
139
fde23518e1e5 Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents: 35024
diff changeset
140 /**
fde23518e1e5 Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents: 35024
diff changeset
141 * PurpleHashClass:
fde23518e1e5 Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents: 35024
diff changeset
142 *
fde23518e1e5 Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents: 35024
diff changeset
143 * The base class for all #PurpleHash's.
fde23518e1e5 Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents: 35024
diff changeset
144 */
fde23518e1e5 Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents: 35024
diff changeset
145 struct _PurpleHashClass {
fde23518e1e5 Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents: 35024
diff changeset
146 GObjectClass parent_class;
fde23518e1e5 Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents: 35024
diff changeset
147
fde23518e1e5 Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents: 35024
diff changeset
148 /** The reset function */
fde23518e1e5 Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents: 35024
diff changeset
149 void (*reset)(PurpleHash *hash);
fde23518e1e5 Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents: 35024
diff changeset
150
fde23518e1e5 Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents: 35024
diff changeset
151 /** The reset state function */
fde23518e1e5 Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents: 35024
diff changeset
152 void (*reset_state)(PurpleHash *hash);
fde23518e1e5 Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents: 35024
diff changeset
153
fde23518e1e5 Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents: 35024
diff changeset
154 /** The append data function */
fde23518e1e5 Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents: 35024
diff changeset
155 void (*append)(PurpleHash *hash, const guchar *data, size_t len);
fde23518e1e5 Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents: 35024
diff changeset
156
fde23518e1e5 Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents: 35024
diff changeset
157 /** The digest function */
fde23518e1e5 Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents: 35024
diff changeset
158 gboolean (*digest)(PurpleHash *hash, guchar digest[], size_t len);
fde23518e1e5 Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents: 35024
diff changeset
159
fde23518e1e5 Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents: 35024
diff changeset
160 /** The get digest size function */
fde23518e1e5 Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents: 35024
diff changeset
161 size_t (*get_digest_size)(PurpleHash *hash);
fde23518e1e5 Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents: 35024
diff changeset
162
fde23518e1e5 Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents: 35024
diff changeset
163 /** The get block size function */
fde23518e1e5 Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents: 35024
diff changeset
164 size_t (*get_block_size)(PurpleHash *hash);
fde23518e1e5 Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents: 35024
diff changeset
165
fde23518e1e5 Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents: 35024
diff changeset
166 /*< private >*/
fde23518e1e5 Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents: 35024
diff changeset
167 void (*_purple_reserved1)(void);
fde23518e1e5 Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents: 35024
diff changeset
168 void (*_purple_reserved2)(void);
fde23518e1e5 Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents: 35024
diff changeset
169 void (*_purple_reserved3)(void);
fde23518e1e5 Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents: 35024
diff changeset
170 void (*_purple_reserved4)(void);
fde23518e1e5 Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents: 35024
diff changeset
171 };
fde23518e1e5 Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents: 35024
diff changeset
172
31421
713fb035d563 Created a new branch to break the ciphers out to their own files. Also I've now exposed purple_g_checksum_* if we're on glib >= 2.16.0
Gary Kramlich <grim@reaperworld.com>
parents: 25888
diff changeset
173 G_BEGIN_DECLS
10684
0325b164a7eb [gaim-migrate @ 12231]
Luke Schierer <lschiere@pidgin.im>
parents:
diff changeset
174
34674
2e45aee0af19 Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents: 34597
diff changeset
175 /*****************************************************************************/
35033
390641bedb9f Fix spaces
Ankit Vani <a@nevitus.org>
parents: 35026
diff changeset
176 /** @name PurpleCipher API */
34674
2e45aee0af19 Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents: 34597
diff changeset
177 /*****************************************************************************/
2e45aee0af19 Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents: 34597
diff changeset
178 /*@{*/
2e45aee0af19 Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents: 34597
diff changeset
179
2e45aee0af19 Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents: 34597
diff changeset
180 /**
2e45aee0af19 Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents: 34597
diff changeset
181 * Returns the GType for the Cipher object.
2e45aee0af19 Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents: 34597
diff changeset
182 */
34533
74b179b1e8ef GObjectify the PurpleCipher structure
Ankit Vani <a@nevitus.org>
parents: 33915
diff changeset
183 GType purple_cipher_get_type(void);
10684
0325b164a7eb [gaim-migrate @ 12231]
Luke Schierer <lschiere@pidgin.im>
parents:
diff changeset
184
34674
2e45aee0af19 Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents: 34597
diff changeset
185 /**
2e45aee0af19 Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents: 34597
diff changeset
186 * Resets a cipher to it's default value
35393
00f876b129bc Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents: 35101
diff changeset
187 * Note: If you have set an IV you will have to set it after resetting
34674
2e45aee0af19 Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents: 34597
diff changeset
188 *
35393
00f876b129bc Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents: 35101
diff changeset
189 * @cipher: The cipher
34674
2e45aee0af19 Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents: 34597
diff changeset
190 */
34533
74b179b1e8ef GObjectify the PurpleCipher structure
Ankit Vani <a@nevitus.org>
parents: 33915
diff changeset
191 void purple_cipher_reset(PurpleCipher *cipher);
34674
2e45aee0af19 Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents: 34597
diff changeset
192
2e45aee0af19 Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents: 34597
diff changeset
193 /**
2e45aee0af19 Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents: 34597
diff changeset
194 * Resets a cipher state to it's default value, but doesn't touch stateless
2e45aee0af19 Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents: 34597
diff changeset
195 * configuration.
2e45aee0af19 Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents: 34597
diff changeset
196 *
2e45aee0af19 Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents: 34597
diff changeset
197 * That means, IV and digest will be wiped out, but keys, ops or salt
2e45aee0af19 Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents: 34597
diff changeset
198 * will remain untouched.
2e45aee0af19 Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents: 34597
diff changeset
199 *
35393
00f876b129bc Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents: 35101
diff changeset
200 * @cipher: The cipher
34674
2e45aee0af19 Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents: 34597
diff changeset
201 */
34535
f8fd1c60c22a Merged PurpleCipher structure with the one in default branch
Ankit Vani <a@nevitus.org>
parents: 34533
diff changeset
202 void purple_cipher_reset_state(PurpleCipher *cipher);
34674
2e45aee0af19 Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents: 34597
diff changeset
203
2e45aee0af19 Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents: 34597
diff changeset
204 /**
2e45aee0af19 Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents: 34597
diff changeset
205 * Sets the initialization vector for a cipher
35393
00f876b129bc Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents: 35101
diff changeset
206 * Note: This should only be called right after a cipher is created or reset
34674
2e45aee0af19 Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents: 34597
diff changeset
207 *
35393
00f876b129bc Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents: 35101
diff changeset
208 * @cipher: The cipher
00f876b129bc Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents: 35101
diff changeset
209 * @iv: The initialization vector to set
00f876b129bc Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents: 35101
diff changeset
210 * @len: The len of the IV
34674
2e45aee0af19 Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents: 34597
diff changeset
211 */
34533
74b179b1e8ef GObjectify the PurpleCipher structure
Ankit Vani <a@nevitus.org>
parents: 33915
diff changeset
212 void purple_cipher_set_iv(PurpleCipher *cipher, guchar *iv, size_t len);
10684
0325b164a7eb [gaim-migrate @ 12231]
Luke Schierer <lschiere@pidgin.im>
parents:
diff changeset
213
34674
2e45aee0af19 Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents: 34597
diff changeset
214 /**
2e45aee0af19 Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents: 34597
diff changeset
215 * Appends data to the cipher context
2e45aee0af19 Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents: 34597
diff changeset
216 *
35393
00f876b129bc Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents: 35101
diff changeset
217 * @cipher: The cipher
00f876b129bc Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents: 35101
diff changeset
218 * @data: The data to append
00f876b129bc Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents: 35101
diff changeset
219 * @len: The length of the data
34674
2e45aee0af19 Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents: 34597
diff changeset
220 */
34533
74b179b1e8ef GObjectify the PurpleCipher structure
Ankit Vani <a@nevitus.org>
parents: 33915
diff changeset
221 void purple_cipher_append(PurpleCipher *cipher, const guchar *data, size_t len);
34674
2e45aee0af19 Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents: 34597
diff changeset
222
2e45aee0af19 Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents: 34597
diff changeset
223 /**
2e45aee0af19 Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents: 34597
diff changeset
224 * Digests a cipher context
2e45aee0af19 Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents: 34597
diff changeset
225 *
35393
00f876b129bc Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents: 35101
diff changeset
226 * @cipher: The cipher
00f876b129bc Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents: 35101
diff changeset
227 * @digest: The return buffer for the digest
00f876b129bc Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents: 35101
diff changeset
228 * @len: The length of the buffer
34674
2e45aee0af19 Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents: 34597
diff changeset
229 */
34535
f8fd1c60c22a Merged PurpleCipher structure with the one in default branch
Ankit Vani <a@nevitus.org>
parents: 34533
diff changeset
230 gboolean purple_cipher_digest(PurpleCipher *cipher, guchar digest[], size_t len);
34674
2e45aee0af19 Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents: 34597
diff changeset
231
2e45aee0af19 Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents: 34597
diff changeset
232 /**
2e45aee0af19 Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents: 34597
diff changeset
233 * Converts a guchar digest into a hex string
2e45aee0af19 Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents: 34597
diff changeset
234 *
35393
00f876b129bc Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents: 35101
diff changeset
235 * @cipher: The cipher
00f876b129bc Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents: 35101
diff changeset
236 * @digest_s: The return buffer for the string digest
00f876b129bc Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents: 35101
diff changeset
237 * @len: The length of the buffer
34674
2e45aee0af19 Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents: 34597
diff changeset
238 */
34535
f8fd1c60c22a Merged PurpleCipher structure with the one in default branch
Ankit Vani <a@nevitus.org>
parents: 34533
diff changeset
239 gboolean purple_cipher_digest_to_str(PurpleCipher *cipher, gchar digest_s[], size_t len);
34674
2e45aee0af19 Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents: 34597
diff changeset
240
2e45aee0af19 Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents: 34597
diff changeset
241 /**
2e45aee0af19 Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents: 34597
diff changeset
242 * Gets the digest size of a cipher
2e45aee0af19 Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents: 34597
diff changeset
243 *
35393
00f876b129bc Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents: 35101
diff changeset
244 * @cipher: The cipher whose digest size to get
34674
2e45aee0af19 Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents: 34597
diff changeset
245 *
35393
00f876b129bc Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents: 35101
diff changeset
246 * Returns: The digest size of the cipher
34674
2e45aee0af19 Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents: 34597
diff changeset
247 */
34535
f8fd1c60c22a Merged PurpleCipher structure with the one in default branch
Ankit Vani <a@nevitus.org>
parents: 34533
diff changeset
248 size_t purple_cipher_get_digest_size(PurpleCipher *cipher);
10684
0325b164a7eb [gaim-migrate @ 12231]
Luke Schierer <lschiere@pidgin.im>
parents:
diff changeset
249
34674
2e45aee0af19 Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents: 34597
diff changeset
250 /**
2e45aee0af19 Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents: 34597
diff changeset
251 * Encrypts data using the cipher
2e45aee0af19 Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents: 34597
diff changeset
252 *
35393
00f876b129bc Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents: 35101
diff changeset
253 * @cipher: The cipher
00f876b129bc Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents: 35101
diff changeset
254 * @input: The data to encrypt
00f876b129bc Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents: 35101
diff changeset
255 * @in_len: The length of the data
00f876b129bc Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents: 35101
diff changeset
256 * @output: The output buffer
00f876b129bc Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents: 35101
diff changeset
257 * @out_size: The size of the output buffer
34674
2e45aee0af19 Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents: 34597
diff changeset
258 *
35393
00f876b129bc Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents: 35101
diff changeset
259 * Returns: A length of data that was outputed or -1, if failed
34674
2e45aee0af19 Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents: 34597
diff changeset
260 */
34535
f8fd1c60c22a Merged PurpleCipher structure with the one in default branch
Ankit Vani <a@nevitus.org>
parents: 34533
diff changeset
261 ssize_t purple_cipher_encrypt(PurpleCipher *cipher, const guchar input[], size_t in_len, guchar output[], size_t out_size);
34674
2e45aee0af19 Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents: 34597
diff changeset
262
2e45aee0af19 Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents: 34597
diff changeset
263 /**
2e45aee0af19 Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents: 34597
diff changeset
264 * Decrypts data using the cipher
2e45aee0af19 Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents: 34597
diff changeset
265 *
35393
00f876b129bc Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents: 35101
diff changeset
266 * @cipher: The cipher
00f876b129bc Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents: 35101
diff changeset
267 * @input: The data to encrypt
00f876b129bc Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents: 35101
diff changeset
268 * @in_len: The length of the returned value
00f876b129bc Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents: 35101
diff changeset
269 * @output: The output buffer
00f876b129bc Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents: 35101
diff changeset
270 * @out_size: The size of the output buffer
34674
2e45aee0af19 Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents: 34597
diff changeset
271 *
35393
00f876b129bc Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents: 35101
diff changeset
272 * Returns: A length of data that was outputed or -1, if failed
34674
2e45aee0af19 Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents: 34597
diff changeset
273 */
34535
f8fd1c60c22a Merged PurpleCipher structure with the one in default branch
Ankit Vani <a@nevitus.org>
parents: 34533
diff changeset
274 ssize_t purple_cipher_decrypt(PurpleCipher *cipher, const guchar input[], size_t in_len, guchar output[], size_t out_size);
10684
0325b164a7eb [gaim-migrate @ 12231]
Luke Schierer <lschiere@pidgin.im>
parents:
diff changeset
275
34674
2e45aee0af19 Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents: 34597
diff changeset
276 /**
2e45aee0af19 Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents: 34597
diff changeset
277 * Sets the salt on a cipher
2e45aee0af19 Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents: 34597
diff changeset
278 *
35393
00f876b129bc Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents: 35101
diff changeset
279 * @cipher: The cipher whose salt to set
00f876b129bc Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents: 35101
diff changeset
280 * @salt: The salt
00f876b129bc Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents: 35101
diff changeset
281 * @len: The length of the salt
34674
2e45aee0af19 Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents: 34597
diff changeset
282 */
34535
f8fd1c60c22a Merged PurpleCipher structure with the one in default branch
Ankit Vani <a@nevitus.org>
parents: 34533
diff changeset
283 void purple_cipher_set_salt(PurpleCipher *cipher, const guchar *salt, size_t len);
33910
5749f2724b12 ciphers cleanup: get key size
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33909
diff changeset
284
34674
2e45aee0af19 Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents: 34597
diff changeset
285 /**
2e45aee0af19 Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents: 34597
diff changeset
286 * Sets the key on a cipher
2e45aee0af19 Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents: 34597
diff changeset
287 *
35393
00f876b129bc Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents: 35101
diff changeset
288 * @cipher: The cipher whose key to set
00f876b129bc Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents: 35101
diff changeset
289 * @key: The key
00f876b129bc Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents: 35101
diff changeset
290 * @len: The size of the key
34674
2e45aee0af19 Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents: 34597
diff changeset
291 */
34535
f8fd1c60c22a Merged PurpleCipher structure with the one in default branch
Ankit Vani <a@nevitus.org>
parents: 34533
diff changeset
292 void purple_cipher_set_key(PurpleCipher *cipher, const guchar *key, size_t len);
34674
2e45aee0af19 Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents: 34597
diff changeset
293
2e45aee0af19 Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents: 34597
diff changeset
294 /**
2e45aee0af19 Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents: 34597
diff changeset
295 * Gets the size of the key if the cipher supports it
2e45aee0af19 Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents: 34597
diff changeset
296 *
35393
00f876b129bc Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents: 35101
diff changeset
297 * @cipher: The cipher whose key size to get
34674
2e45aee0af19 Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents: 34597
diff changeset
298 *
35393
00f876b129bc Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents: 35101
diff changeset
299 * Returns: The size of the key
34674
2e45aee0af19 Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents: 34597
diff changeset
300 */
34533
74b179b1e8ef GObjectify the PurpleCipher structure
Ankit Vani <a@nevitus.org>
parents: 33915
diff changeset
301 size_t purple_cipher_get_key_size(PurpleCipher *cipher);
10684
0325b164a7eb [gaim-migrate @ 12231]
Luke Schierer <lschiere@pidgin.im>
parents:
diff changeset
302
34674
2e45aee0af19 Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents: 34597
diff changeset
303 /**
2e45aee0af19 Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents: 34597
diff changeset
304 * Sets the batch mode of a cipher
2e45aee0af19 Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents: 34597
diff changeset
305 *
35393
00f876b129bc Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents: 35101
diff changeset
306 * @cipher: The cipher whose batch mode to set
00f876b129bc Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents: 35101
diff changeset
307 * @mode: The batch mode under which the cipher should operate
34674
2e45aee0af19 Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents: 34597
diff changeset
308 *
2e45aee0af19 Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents: 34597
diff changeset
309 */
34533
74b179b1e8ef GObjectify the PurpleCipher structure
Ankit Vani <a@nevitus.org>
parents: 33915
diff changeset
310 void purple_cipher_set_batch_mode(PurpleCipher *cipher, PurpleCipherBatchMode mode);
34674
2e45aee0af19 Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents: 34597
diff changeset
311
2e45aee0af19 Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents: 34597
diff changeset
312 /**
2e45aee0af19 Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents: 34597
diff changeset
313 * Gets the batch mode of a cipher
2e45aee0af19 Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents: 34597
diff changeset
314 *
35393
00f876b129bc Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents: 35101
diff changeset
315 * @cipher: The cipher whose batch mode to get
34674
2e45aee0af19 Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents: 34597
diff changeset
316 *
35393
00f876b129bc Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents: 35101
diff changeset
317 * Returns: The batch mode under which the cipher is operating
34674
2e45aee0af19 Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents: 34597
diff changeset
318 */
34533
74b179b1e8ef GObjectify the PurpleCipher structure
Ankit Vani <a@nevitus.org>
parents: 33915
diff changeset
319 PurpleCipherBatchMode purple_cipher_get_batch_mode(PurpleCipher *cipher);
12382
5ef67596b420 [gaim-migrate @ 14688]
Richard Laager <rlaager@pidgin.im>
parents: 12323
diff changeset
320
34674
2e45aee0af19 Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents: 34597
diff changeset
321 /**
2e45aee0af19 Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents: 34597
diff changeset
322 * Gets the block size of a cipher
2e45aee0af19 Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents: 34597
diff changeset
323 *
35393
00f876b129bc Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents: 35101
diff changeset
324 * @cipher: The cipher whose block size to get
34674
2e45aee0af19 Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents: 34597
diff changeset
325 *
35393
00f876b129bc Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents: 35101
diff changeset
326 * Returns: The block size of the cipher
34674
2e45aee0af19 Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents: 34597
diff changeset
327 */
34533
74b179b1e8ef GObjectify the PurpleCipher structure
Ankit Vani <a@nevitus.org>
parents: 33915
diff changeset
328 size_t purple_cipher_get_block_size(PurpleCipher *cipher);
31421
713fb035d563 Created a new branch to break the ciphers out to their own files. Also I've now exposed purple_g_checksum_* if we're on glib >= 2.16.0
Gary Kramlich <grim@reaperworld.com>
parents: 25888
diff changeset
329
34674
2e45aee0af19 Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents: 34597
diff changeset
330 /*@}*/
2e45aee0af19 Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents: 34597
diff changeset
331
35026
fde23518e1e5 Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents: 35024
diff changeset
332 /*****************************************************************************/
35033
390641bedb9f Fix spaces
Ankit Vani <a@nevitus.org>
parents: 35026
diff changeset
333 /** @name PurpleHash API */
35026
fde23518e1e5 Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents: 35024
diff changeset
334 /*****************************************************************************/
fde23518e1e5 Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents: 35024
diff changeset
335 /*@{*/
fde23518e1e5 Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents: 35024
diff changeset
336
fde23518e1e5 Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents: 35024
diff changeset
337 /**
fde23518e1e5 Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents: 35024
diff changeset
338 * Returns the GType for the Hash object.
fde23518e1e5 Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents: 35024
diff changeset
339 */
fde23518e1e5 Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents: 35024
diff changeset
340 GType purple_hash_get_type(void);
fde23518e1e5 Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents: 35024
diff changeset
341
fde23518e1e5 Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents: 35024
diff changeset
342 /**
fde23518e1e5 Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents: 35024
diff changeset
343 * Resets a hash to it's default value
35393
00f876b129bc Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents: 35101
diff changeset
344 * Note: If you have set an IV you will have to set it after resetting
35026
fde23518e1e5 Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents: 35024
diff changeset
345 *
35393
00f876b129bc Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents: 35101
diff changeset
346 * @hash: The hash
35026
fde23518e1e5 Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents: 35024
diff changeset
347 */
fde23518e1e5 Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents: 35024
diff changeset
348 void purple_hash_reset(PurpleHash *hash);
fde23518e1e5 Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents: 35024
diff changeset
349
fde23518e1e5 Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents: 35024
diff changeset
350 /**
fde23518e1e5 Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents: 35024
diff changeset
351 * Resets a hash state to it's default value, but doesn't touch stateless
fde23518e1e5 Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents: 35024
diff changeset
352 * configuration.
fde23518e1e5 Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents: 35024
diff changeset
353 *
fde23518e1e5 Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents: 35024
diff changeset
354 * That means, IV and digest will be wiped out, but keys, ops or salt
fde23518e1e5 Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents: 35024
diff changeset
355 * will remain untouched.
fde23518e1e5 Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents: 35024
diff changeset
356 *
35393
00f876b129bc Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents: 35101
diff changeset
357 * @hash: The hash
35026
fde23518e1e5 Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents: 35024
diff changeset
358 */
fde23518e1e5 Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents: 35024
diff changeset
359 void purple_hash_reset_state(PurpleHash *hash);
fde23518e1e5 Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents: 35024
diff changeset
360
fde23518e1e5 Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents: 35024
diff changeset
361 /**
fde23518e1e5 Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents: 35024
diff changeset
362 * Appends data to the hash context
fde23518e1e5 Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents: 35024
diff changeset
363 *
35393
00f876b129bc Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents: 35101
diff changeset
364 * @hash: The hash
00f876b129bc Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents: 35101
diff changeset
365 * @data: The data to append
00f876b129bc Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents: 35101
diff changeset
366 * @len: The length of the data
35026
fde23518e1e5 Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents: 35024
diff changeset
367 */
fde23518e1e5 Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents: 35024
diff changeset
368 void purple_hash_append(PurpleHash *hash, const guchar *data, size_t len);
fde23518e1e5 Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents: 35024
diff changeset
369
fde23518e1e5 Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents: 35024
diff changeset
370 /**
fde23518e1e5 Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents: 35024
diff changeset
371 * Digests a hash context
fde23518e1e5 Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents: 35024
diff changeset
372 *
35393
00f876b129bc Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents: 35101
diff changeset
373 * @hash: The hash
00f876b129bc Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents: 35101
diff changeset
374 * @digest: The return buffer for the digest
00f876b129bc Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents: 35101
diff changeset
375 * @len: The length of the buffer
35026
fde23518e1e5 Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents: 35024
diff changeset
376 */
fde23518e1e5 Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents: 35024
diff changeset
377 gboolean purple_hash_digest(PurpleHash *hash, guchar digest[], size_t len);
fde23518e1e5 Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents: 35024
diff changeset
378
fde23518e1e5 Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents: 35024
diff changeset
379 /**
fde23518e1e5 Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents: 35024
diff changeset
380 * Converts a guchar digest into a hex string
fde23518e1e5 Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents: 35024
diff changeset
381 *
35393
00f876b129bc Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents: 35101
diff changeset
382 * @hash: The hash
00f876b129bc Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents: 35101
diff changeset
383 * @digest_s: The return buffer for the string digest
00f876b129bc Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents: 35101
diff changeset
384 * @len: The length of the buffer
35026
fde23518e1e5 Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents: 35024
diff changeset
385 */
fde23518e1e5 Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents: 35024
diff changeset
386 gboolean purple_hash_digest_to_str(PurpleHash *hash, gchar digest_s[], size_t len);
fde23518e1e5 Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents: 35024
diff changeset
387
fde23518e1e5 Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents: 35024
diff changeset
388 /**
fde23518e1e5 Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents: 35024
diff changeset
389 * Gets the digest size of a hash
fde23518e1e5 Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents: 35024
diff changeset
390 *
35393
00f876b129bc Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents: 35101
diff changeset
391 * @hash: The hash whose digest size to get
35026
fde23518e1e5 Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents: 35024
diff changeset
392 *
35393
00f876b129bc Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents: 35101
diff changeset
393 * Returns: The digest size of the hash
35026
fde23518e1e5 Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents: 35024
diff changeset
394 */
fde23518e1e5 Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents: 35024
diff changeset
395 size_t purple_hash_get_digest_size(PurpleHash *hash);
fde23518e1e5 Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents: 35024
diff changeset
396
fde23518e1e5 Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents: 35024
diff changeset
397 /**
fde23518e1e5 Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents: 35024
diff changeset
398 * Gets the block size of a hash
fde23518e1e5 Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents: 35024
diff changeset
399 *
35393
00f876b129bc Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents: 35101
diff changeset
400 * @hash: The hash whose block size to get
35026
fde23518e1e5 Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents: 35024
diff changeset
401 *
35393
00f876b129bc Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents: 35101
diff changeset
402 * Returns: The block size of the hash
35026
fde23518e1e5 Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents: 35024
diff changeset
403 */
fde23518e1e5 Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents: 35024
diff changeset
404 size_t purple_hash_get_block_size(PurpleHash *hash);
fde23518e1e5 Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents: 35024
diff changeset
405
fde23518e1e5 Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents: 35024
diff changeset
406 /*@}*/
fde23518e1e5 Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents: 35024
diff changeset
407
31421
713fb035d563 Created a new branch to break the ciphers out to their own files. Also I've now exposed purple_g_checksum_* if we're on glib >= 2.16.0
Gary Kramlich <grim@reaperworld.com>
parents: 25888
diff changeset
408 G_END_DECLS
10684
0325b164a7eb [gaim-migrate @ 12231]
Luke Schierer <lschiere@pidgin.im>
parents:
diff changeset
409
35101
bed9fe4dd179 Fix header guard and file comment.
Mark Doliner <mark@kingant.net>
parents: 35094
diff changeset
410 #endif /* PURPLE_CIPHER_H */

mercurial