libpurple/cipher.h

Sat, 29 Jun 2013 19:00:03 +0530

author
Ankit Vani <a@nevitus.org>
date
Sat, 29 Jun 2013 19:00:03 +0530
branch
soc.2013.gobjectification
changeset 34674
2e45aee0af19
parent 34597
4c0ae73d3745
child 34691
3acdd397a9c1
permissions
-rw-r--r--

Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()

10684
0325b164a7eb [gaim-migrate @ 12231]
Luke Schierer <lschiere@pidgin.im>
parents:
diff changeset
1 /**
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
2 * @file cipher.h Purple Cipher API
10684
0325b164a7eb [gaim-migrate @ 12231]
Luke Schierer <lschiere@pidgin.im>
parents:
diff changeset
3 * @ingroup core
20889
3d0ef192f98c All the links to libpurple signal pages were in the comment containing the
Will Thompson <resiak@pidgin.im>
parents: 20147
diff changeset
4 * @see @ref cipher-signals
20147
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
66f05a854eee applied changes from 8a731bbd0197fbcc91a705c2d8f528154216defa
Richard Laager <rlaager@pidgin.im>
parents: 19859
diff changeset
7 /* purple
10684
0325b164a7eb [gaim-migrate @ 12231]
Luke Schierer <lschiere@pidgin.im>
parents:
diff changeset
8 *
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
9 * 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
10 * to list here. Please refer to the COPYRIGHT file distributed with this
0325b164a7eb [gaim-migrate @ 12231]
Luke Schierer <lschiere@pidgin.im>
parents:
diff changeset
11 * source distribution.
0325b164a7eb [gaim-migrate @ 12231]
Luke Schierer <lschiere@pidgin.im>
parents:
diff changeset
12 *
0325b164a7eb [gaim-migrate @ 12231]
Luke Schierer <lschiere@pidgin.im>
parents:
diff changeset
13 * This program is free software; you can redistribute it and/or modify
0325b164a7eb [gaim-migrate @ 12231]
Luke Schierer <lschiere@pidgin.im>
parents:
diff changeset
14 * 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
15 * the Free Software Foundation; either version 2 of the License, or
0325b164a7eb [gaim-migrate @ 12231]
Luke Schierer <lschiere@pidgin.im>
parents:
diff changeset
16 * (at your option) any later version.
0325b164a7eb [gaim-migrate @ 12231]
Luke Schierer <lschiere@pidgin.im>
parents:
diff changeset
17 *
0325b164a7eb [gaim-migrate @ 12231]
Luke Schierer <lschiere@pidgin.im>
parents:
diff changeset
18 * This program is distributed in the hope that it will be useful,
0325b164a7eb [gaim-migrate @ 12231]
Luke Schierer <lschiere@pidgin.im>
parents:
diff changeset
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
0325b164a7eb [gaim-migrate @ 12231]
Luke Schierer <lschiere@pidgin.im>
parents:
diff changeset
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
0325b164a7eb [gaim-migrate @ 12231]
Luke Schierer <lschiere@pidgin.im>
parents:
diff changeset
21 * GNU General Public License for more details.
0325b164a7eb [gaim-migrate @ 12231]
Luke Schierer <lschiere@pidgin.im>
parents:
diff changeset
22 *
0325b164a7eb [gaim-migrate @ 12231]
Luke Schierer <lschiere@pidgin.im>
parents:
diff changeset
23 * You should have received a copy of the GNU General Public License
0325b164a7eb [gaim-migrate @ 12231]
Luke Schierer <lschiere@pidgin.im>
parents:
diff changeset
24 * 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
25 * 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
26 */
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
27 #ifndef PURPLE_CIPHER_H
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
28 #define PURPLE_CIPHER_H
10684
0325b164a7eb [gaim-migrate @ 12231]
Luke Schierer <lschiere@pidgin.im>
parents:
diff changeset
29
0325b164a7eb [gaim-migrate @ 12231]
Luke Schierer <lschiere@pidgin.im>
parents:
diff changeset
30 #include <glib.h>
34536
38cc893bae51 GObjectify RC4 cipher as PurpleRC4Cipher
Ankit Vani <a@nevitus.org>
parents: 34535
diff changeset
31 #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
32 #include <string.h>
10684
0325b164a7eb [gaim-migrate @ 12231]
Luke Schierer <lschiere@pidgin.im>
parents:
diff changeset
33
34536
38cc893bae51 GObjectify RC4 cipher as PurpleRC4Cipher
Ankit Vani <a@nevitus.org>
parents: 34535
diff changeset
34 #include "internal.h"
10684
0325b164a7eb [gaim-migrate @ 12231]
Luke Schierer <lschiere@pidgin.im>
parents:
diff changeset
35
34533
74b179b1e8ef GObjectify the PurpleCipher structure
Ankit Vani <a@nevitus.org>
parents: 33915
diff changeset
36 #define PURPLE_TYPE_CIPHER (purple_cipher_get_type())
74b179b1e8ef GObjectify the PurpleCipher structure
Ankit Vani <a@nevitus.org>
parents: 33915
diff changeset
37 #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
38 #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
39 #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
40 #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
41 #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
42
74b179b1e8ef GObjectify the PurpleCipher structure
Ankit Vani <a@nevitus.org>
parents: 33915
diff changeset
43 typedef struct _PurpleCipher PurpleCipher;
74b179b1e8ef GObjectify the PurpleCipher structure
Ankit Vani <a@nevitus.org>
parents: 33915
diff changeset
44 typedef struct _PurpleCipherClass PurpleCipherClass;
74b179b1e8ef GObjectify the PurpleCipher structure
Ankit Vani <a@nevitus.org>
parents: 33915
diff changeset
45
22024
3fd5e4fff1be Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 20889
diff changeset
46 /**
34533
74b179b1e8ef GObjectify the PurpleCipher structure
Ankit Vani <a@nevitus.org>
parents: 33915
diff changeset
47 * PurpleCipherBatchMode:
74b179b1e8ef GObjectify the PurpleCipher structure
Ankit Vani <a@nevitus.org>
parents: 33915
diff changeset
48 * @PURPLE_CIPHER_BATCH_MODE_ECB: Electronic Codebook Mode
74b179b1e8ef GObjectify the PurpleCipher structure
Ankit Vani <a@nevitus.org>
parents: 33915
diff changeset
49 * @PURPLE_CIPHER_BATCH_MODE_CBC: Cipher Block Chaining Mode
74b179b1e8ef GObjectify the PurpleCipher structure
Ankit Vani <a@nevitus.org>
parents: 33915
diff changeset
50 *
22024
3fd5e4fff1be Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 20889
diff changeset
51 * 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
52 */
34533
74b179b1e8ef GObjectify the PurpleCipher structure
Ankit Vani <a@nevitus.org>
parents: 33915
diff changeset
53 typedef enum {
74b179b1e8ef GObjectify the PurpleCipher structure
Ankit Vani <a@nevitus.org>
parents: 33915
diff changeset
54 PURPLE_CIPHER_BATCH_MODE_ECB, /*< nick=ECB Batch Mode >*/
74b179b1e8ef GObjectify the PurpleCipher structure
Ankit Vani <a@nevitus.org>
parents: 33915
diff changeset
55 PURPLE_CIPHER_BATCH_MODE_CBC /*< nick=CBC Batch Mode >*/
22024
3fd5e4fff1be Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 20889
diff changeset
56 } PurpleCipherBatchMode;
10684
0325b164a7eb [gaim-migrate @ 12231]
Luke Schierer <lschiere@pidgin.im>
parents:
diff changeset
57
0325b164a7eb [gaim-migrate @ 12231]
Luke Schierer <lschiere@pidgin.im>
parents:
diff changeset
58 /**
34533
74b179b1e8ef GObjectify the PurpleCipher structure
Ankit Vani <a@nevitus.org>
parents: 33915
diff changeset
59 * PurpleCipher:
74b179b1e8ef GObjectify the PurpleCipher structure
Ankit Vani <a@nevitus.org>
parents: 33915
diff changeset
60 *
74b179b1e8ef GObjectify the PurpleCipher structure
Ankit Vani <a@nevitus.org>
parents: 33915
diff changeset
61 * 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
62 */
34533
74b179b1e8ef GObjectify the PurpleCipher structure
Ankit Vani <a@nevitus.org>
parents: 33915
diff changeset
63 struct _PurpleCipher {
74b179b1e8ef GObjectify the PurpleCipher structure
Ankit Vani <a@nevitus.org>
parents: 33915
diff changeset
64 /*< private >*/
74b179b1e8ef GObjectify the PurpleCipher structure
Ankit Vani <a@nevitus.org>
parents: 33915
diff changeset
65 GObject gparent;
74b179b1e8ef GObjectify the PurpleCipher structure
Ankit Vani <a@nevitus.org>
parents: 33915
diff changeset
66
74b179b1e8ef GObjectify the PurpleCipher structure
Ankit Vani <a@nevitus.org>
parents: 33915
diff changeset
67 void (*_purple_reserved1)(void);
74b179b1e8ef GObjectify the PurpleCipher structure
Ankit Vani <a@nevitus.org>
parents: 33915
diff changeset
68 void (*_purple_reserved2)(void);
74b179b1e8ef GObjectify the PurpleCipher structure
Ankit Vani <a@nevitus.org>
parents: 33915
diff changeset
69 void (*_purple_reserved3)(void);
74b179b1e8ef GObjectify the PurpleCipher structure
Ankit Vani <a@nevitus.org>
parents: 33915
diff changeset
70 void (*_purple_reserved4)(void);
74b179b1e8ef GObjectify the PurpleCipher structure
Ankit Vani <a@nevitus.org>
parents: 33915
diff changeset
71 };
10684
0325b164a7eb [gaim-migrate @ 12231]
Luke Schierer <lschiere@pidgin.im>
parents:
diff changeset
72
0325b164a7eb [gaim-migrate @ 12231]
Luke Schierer <lschiere@pidgin.im>
parents:
diff changeset
73 /**
34533
74b179b1e8ef GObjectify the PurpleCipher structure
Ankit Vani <a@nevitus.org>
parents: 33915
diff changeset
74 * PurpleCipherClass:
74b179b1e8ef GObjectify the PurpleCipher structure
Ankit Vani <a@nevitus.org>
parents: 33915
diff changeset
75 *
74b179b1e8ef GObjectify the PurpleCipher structure
Ankit Vani <a@nevitus.org>
parents: 33915
diff changeset
76 * The base class for all #PurpleCipher's.
10684
0325b164a7eb [gaim-migrate @ 12231]
Luke Schierer <lschiere@pidgin.im>
parents:
diff changeset
77 */
34533
74b179b1e8ef GObjectify the PurpleCipher structure
Ankit Vani <a@nevitus.org>
parents: 33915
diff changeset
78 struct _PurpleCipherClass {
74b179b1e8ef GObjectify the PurpleCipher structure
Ankit Vani <a@nevitus.org>
parents: 33915
diff changeset
79 /*< private >*/
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
74b179b1e8ef GObjectify the PurpleCipher structure
Ankit Vani <a@nevitus.org>
parents: 33915
diff changeset
124 /** The get cipher name function */
74b179b1e8ef GObjectify the PurpleCipher structure
Ankit Vani <a@nevitus.org>
parents: 33915
diff changeset
125 const gchar* (*get_name)(PurpleCipher *cipher);
22025
23756775175d HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 22024
diff changeset
126
33908
78b42fd69e02 ciphers cleanup: passing keys with length by default
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 32206
diff changeset
127 void (*_purple_reserved1)(void);
78b42fd69e02 ciphers cleanup: passing keys with length by default
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 32206
diff changeset
128 void (*_purple_reserved2)(void);
78b42fd69e02 ciphers cleanup: passing keys with length by default
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 32206
diff changeset
129 void (*_purple_reserved3)(void);
78b42fd69e02 ciphers cleanup: passing keys with length by default
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 32206
diff changeset
130 void (*_purple_reserved4)(void);
10684
0325b164a7eb [gaim-migrate @ 12231]
Luke Schierer <lschiere@pidgin.im>
parents:
diff changeset
131 };
0325b164a7eb [gaim-migrate @ 12231]
Luke Schierer <lschiere@pidgin.im>
parents:
diff changeset
132
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
133 G_BEGIN_DECLS
10684
0325b164a7eb [gaim-migrate @ 12231]
Luke Schierer <lschiere@pidgin.im>
parents:
diff changeset
134
34674
2e45aee0af19 Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents: 34597
diff changeset
135 /*****************************************************************************/
2e45aee0af19 Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents: 34597
diff changeset
136 /** @name PurpleCipher API */
2e45aee0af19 Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents: 34597
diff changeset
137 /*****************************************************************************/
2e45aee0af19 Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents: 34597
diff changeset
138 /*@{*/
2e45aee0af19 Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents: 34597
diff changeset
139
2e45aee0af19 Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents: 34597
diff changeset
140 /**
2e45aee0af19 Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents: 34597
diff changeset
141 * 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
142 */
34533
74b179b1e8ef GObjectify the PurpleCipher structure
Ankit Vani <a@nevitus.org>
parents: 33915
diff changeset
143 GType purple_cipher_get_type(void);
10684
0325b164a7eb [gaim-migrate @ 12231]
Luke Schierer <lschiere@pidgin.im>
parents:
diff changeset
144
34674
2e45aee0af19 Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents: 34597
diff changeset
145 /**
2e45aee0af19 Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents: 34597
diff changeset
146 * Gets a cipher's name
2e45aee0af19 Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents: 34597
diff changeset
147 *
2e45aee0af19 Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents: 34597
diff changeset
148 * @param cipher The cipher
2e45aee0af19 Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents: 34597
diff changeset
149 *
2e45aee0af19 Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents: 34597
diff changeset
150 * @return The cipher's name
2e45aee0af19 Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents: 34597
diff changeset
151 */
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
152 const gchar *purple_cipher_get_name(PurpleCipher *cipher);
10684
0325b164a7eb [gaim-migrate @ 12231]
Luke Schierer <lschiere@pidgin.im>
parents:
diff changeset
153
34674
2e45aee0af19 Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents: 34597
diff changeset
154 /**
2e45aee0af19 Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents: 34597
diff changeset
155 * Resets a cipher to it's default value
2e45aee0af19 Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents: 34597
diff changeset
156 * @note If you have set an IV you will have to set it after resetting
2e45aee0af19 Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents: 34597
diff changeset
157 *
2e45aee0af19 Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents: 34597
diff changeset
158 * @param cipher The cipher
2e45aee0af19 Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents: 34597
diff changeset
159 */
34533
74b179b1e8ef GObjectify the PurpleCipher structure
Ankit Vani <a@nevitus.org>
parents: 33915
diff changeset
160 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
161
2e45aee0af19 Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents: 34597
diff changeset
162 /**
2e45aee0af19 Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents: 34597
diff changeset
163 * 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
164 * configuration.
2e45aee0af19 Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents: 34597
diff changeset
165 *
2e45aee0af19 Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents: 34597
diff changeset
166 * 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
167 * will remain untouched.
2e45aee0af19 Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents: 34597
diff changeset
168 *
2e45aee0af19 Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents: 34597
diff changeset
169 * @param cipher The cipher
2e45aee0af19 Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents: 34597
diff changeset
170 */
34535
f8fd1c60c22a Merged PurpleCipher structure with the one in default branch
Ankit Vani <a@nevitus.org>
parents: 34533
diff changeset
171 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
172
2e45aee0af19 Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents: 34597
diff changeset
173 /**
2e45aee0af19 Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents: 34597
diff changeset
174 * Sets the initialization vector for a cipher
2e45aee0af19 Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents: 34597
diff changeset
175 * @note This should only be called right after a cipher is created or reset
2e45aee0af19 Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents: 34597
diff changeset
176 *
2e45aee0af19 Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents: 34597
diff changeset
177 * @param cipher The cipher
2e45aee0af19 Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents: 34597
diff changeset
178 * @param iv The initialization vector to set
2e45aee0af19 Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents: 34597
diff changeset
179 * @param len The len of the IV
2e45aee0af19 Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents: 34597
diff changeset
180 */
34533
74b179b1e8ef GObjectify the PurpleCipher structure
Ankit Vani <a@nevitus.org>
parents: 33915
diff changeset
181 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
182
34674
2e45aee0af19 Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents: 34597
diff changeset
183 /**
2e45aee0af19 Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents: 34597
diff changeset
184 * 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
185 *
2e45aee0af19 Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents: 34597
diff changeset
186 * @param cipher The cipher
2e45aee0af19 Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents: 34597
diff changeset
187 * @param data The data to append
2e45aee0af19 Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents: 34597
diff changeset
188 * @param len The length of the data
2e45aee0af19 Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents: 34597
diff changeset
189 */
34533
74b179b1e8ef GObjectify the PurpleCipher structure
Ankit Vani <a@nevitus.org>
parents: 33915
diff changeset
190 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
191
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 * Digests a cipher context
2e45aee0af19 Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents: 34597
diff changeset
194 *
2e45aee0af19 Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents: 34597
diff changeset
195 * @param cipher The cipher
2e45aee0af19 Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents: 34597
diff changeset
196 * @param digest The return buffer for the digest
2e45aee0af19 Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents: 34597
diff changeset
197 * @param len The length of the buffer
2e45aee0af19 Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents: 34597
diff changeset
198 */
34535
f8fd1c60c22a Merged PurpleCipher structure with the one in default branch
Ankit Vani <a@nevitus.org>
parents: 34533
diff changeset
199 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
200
2e45aee0af19 Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents: 34597
diff changeset
201 /**
2e45aee0af19 Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents: 34597
diff changeset
202 * 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
203 *
2e45aee0af19 Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents: 34597
diff changeset
204 * @param cipher The cipher
2e45aee0af19 Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents: 34597
diff changeset
205 * @param digest_s The return buffer for the string digest
2e45aee0af19 Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents: 34597
diff changeset
206 * @param len The length of the buffer
2e45aee0af19 Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents: 34597
diff changeset
207 */
34535
f8fd1c60c22a Merged PurpleCipher structure with the one in default branch
Ankit Vani <a@nevitus.org>
parents: 34533
diff changeset
208 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
209
2e45aee0af19 Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents: 34597
diff changeset
210 /**
2e45aee0af19 Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents: 34597
diff changeset
211 * 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
212 *
2e45aee0af19 Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents: 34597
diff changeset
213 * @param cipher The cipher whose digest size to get
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 * @return The digest size of the cipher
2e45aee0af19 Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents: 34597
diff changeset
216 */
34535
f8fd1c60c22a Merged PurpleCipher structure with the one in default branch
Ankit Vani <a@nevitus.org>
parents: 34533
diff changeset
217 size_t purple_cipher_get_digest_size(PurpleCipher *cipher);
10684
0325b164a7eb [gaim-migrate @ 12231]
Luke Schierer <lschiere@pidgin.im>
parents:
diff changeset
218
34674
2e45aee0af19 Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents: 34597
diff changeset
219 /**
2e45aee0af19 Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents: 34597
diff changeset
220 * 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
221 *
2e45aee0af19 Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents: 34597
diff changeset
222 * @param cipher The cipher
2e45aee0af19 Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents: 34597
diff changeset
223 * @param input The data to encrypt
2e45aee0af19 Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents: 34597
diff changeset
224 * @param in_len The length of the data
2e45aee0af19 Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents: 34597
diff changeset
225 * @param output The output buffer
2e45aee0af19 Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents: 34597
diff changeset
226 * @param out_size The size of the output buffer
2e45aee0af19 Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents: 34597
diff changeset
227 *
2e45aee0af19 Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents: 34597
diff changeset
228 * @return A length of data that was outputed or -1, if failed
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 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
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 * 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
234 *
2e45aee0af19 Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents: 34597
diff changeset
235 * @param cipher The cipher
2e45aee0af19 Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents: 34597
diff changeset
236 * @param input The data to encrypt
2e45aee0af19 Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents: 34597
diff changeset
237 * @param in_len The length of the returned value
2e45aee0af19 Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents: 34597
diff changeset
238 * @param output The output buffer
2e45aee0af19 Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents: 34597
diff changeset
239 * @param out_size The size of the output buffer
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 * @return A length of data that was outputed or -1, if failed
2e45aee0af19 Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents: 34597
diff changeset
242 */
34535
f8fd1c60c22a Merged PurpleCipher structure with the one in default branch
Ankit Vani <a@nevitus.org>
parents: 34533
diff changeset
243 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
244
34674
2e45aee0af19 Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents: 34597
diff changeset
245 /**
2e45aee0af19 Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents: 34597
diff changeset
246 * 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
247 *
2e45aee0af19 Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents: 34597
diff changeset
248 * @param cipher The cipher whose salt to set
2e45aee0af19 Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents: 34597
diff changeset
249 * @param salt The salt
2e45aee0af19 Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents: 34597
diff changeset
250 * @param len The length of the salt
2e45aee0af19 Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents: 34597
diff changeset
251 */
34535
f8fd1c60c22a Merged PurpleCipher structure with the one in default branch
Ankit Vani <a@nevitus.org>
parents: 34533
diff changeset
252 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
253
34674
2e45aee0af19 Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents: 34597
diff changeset
254 /**
2e45aee0af19 Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents: 34597
diff changeset
255 * 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
256 *
2e45aee0af19 Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents: 34597
diff changeset
257 * @param cipher The cipher whose key to set
2e45aee0af19 Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents: 34597
diff changeset
258 * @param key The key
2e45aee0af19 Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents: 34597
diff changeset
259 * @param len The size of the key
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 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
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 * 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
265 *
2e45aee0af19 Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents: 34597
diff changeset
266 * @param cipher The cipher whose key size to get
2e45aee0af19 Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents: 34597
diff changeset
267 *
2e45aee0af19 Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents: 34597
diff changeset
268 * @return The size of the key
2e45aee0af19 Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents: 34597
diff changeset
269 */
34533
74b179b1e8ef GObjectify the PurpleCipher structure
Ankit Vani <a@nevitus.org>
parents: 33915
diff changeset
270 size_t purple_cipher_get_key_size(PurpleCipher *cipher);
10684
0325b164a7eb [gaim-migrate @ 12231]
Luke Schierer <lschiere@pidgin.im>
parents:
diff changeset
271
34674
2e45aee0af19 Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents: 34597
diff changeset
272 /**
2e45aee0af19 Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents: 34597
diff changeset
273 * 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
274 *
2e45aee0af19 Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents: 34597
diff changeset
275 * @param cipher The cipher whose batch mode to set
2e45aee0af19 Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents: 34597
diff changeset
276 * @param mode The batch mode under which the cipher should operate
2e45aee0af19 Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents: 34597
diff changeset
277 *
2e45aee0af19 Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents: 34597
diff changeset
278 */
34533
74b179b1e8ef GObjectify the PurpleCipher structure
Ankit Vani <a@nevitus.org>
parents: 33915
diff changeset
279 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
280
2e45aee0af19 Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents: 34597
diff changeset
281 /**
2e45aee0af19 Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents: 34597
diff changeset
282 * 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
283 *
2e45aee0af19 Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents: 34597
diff changeset
284 * @param cipher The cipher whose batch mode to get
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 * @return The batch mode under which the cipher is operating
2e45aee0af19 Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents: 34597
diff changeset
287 */
34533
74b179b1e8ef GObjectify the PurpleCipher structure
Ankit Vani <a@nevitus.org>
parents: 33915
diff changeset
288 PurpleCipherBatchMode purple_cipher_get_batch_mode(PurpleCipher *cipher);
12382
5ef67596b420 [gaim-migrate @ 14688]
Richard Laager <rlaager@pidgin.im>
parents: 12323
diff changeset
289
34674
2e45aee0af19 Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents: 34597
diff changeset
290 /**
2e45aee0af19 Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents: 34597
diff changeset
291 * 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
292 *
2e45aee0af19 Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents: 34597
diff changeset
293 * @param cipher The cipher whose block size to get
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 * @return The block size of the cipher
2e45aee0af19 Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents: 34597
diff changeset
296 */
34533
74b179b1e8ef GObjectify the PurpleCipher structure
Ankit Vani <a@nevitus.org>
parents: 33915
diff changeset
297 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
298
34674
2e45aee0af19 Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents: 34597
diff changeset
299 /*@}*/
2e45aee0af19 Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents: 34597
diff changeset
300
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
301 G_END_DECLS
10684
0325b164a7eb [gaim-migrate @ 12231]
Luke Schierer <lschiere@pidgin.im>
parents:
diff changeset
302
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
303 #endif /* PURPLE_CIPHER_H */

mercurial