Mon, 16 Sep 2013 22:53:40 +0530
Refactored finch grouping plugin to use the new plugin API
| 10684 | 1 | /** |
| 15884 | 2 | * @file cipher.h Purple Cipher API |
| 10684 | 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 | 8 | * |
| 15884 | 9 | * Purple is the legal property of its developers, whose names are too numerous |
| 10684 | 10 | * to list here. Please refer to the COPYRIGHT file distributed with this |
| 11 | * source distribution. | |
| 12 | * | |
| 13 | * This program is free software; you can redistribute it and/or modify | |
| 14 | * it under the terms of the GNU General Public License as published by | |
| 15 | * the Free Software Foundation; either version 2 of the License, or | |
| 16 | * (at your option) any later version. | |
| 17 | * | |
| 18 | * This program is distributed in the hope that it will be useful, | |
| 19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 21 | * GNU General Public License for more details. | |
| 22 | * | |
| 23 | * You should have received a copy of the GNU General Public License | |
| 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 | 26 | */ |
| 15884 | 27 | #ifndef PURPLE_CIPHER_H |
| 28 | #define PURPLE_CIPHER_H | |
| 10684 | 29 | |
| 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 | 33 | |
|
34536
38cc893bae51
GObjectify RC4 cipher as PurpleRC4Cipher
Ankit Vani <a@nevitus.org>
parents:
34535
diff
changeset
|
34 | #include "internal.h" |
| 10684 | 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 | 57 | |
| 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 | 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 | }; |
| 10684 | 67 | |
| 68 | /** | |
|
34533
74b179b1e8ef
GObjectify the PurpleCipher structure
Ankit Vani <a@nevitus.org>
parents:
33915
diff
changeset
|
69 | * PurpleCipherClass: |
|
74b179b1e8ef
GObjectify the PurpleCipher structure
Ankit Vani <a@nevitus.org>
parents:
33915
diff
changeset
|
70 | * |
|
74b179b1e8ef
GObjectify the PurpleCipher structure
Ankit Vani <a@nevitus.org>
parents:
33915
diff
changeset
|
71 | * The base class for all #PurpleCipher's. |
| 10684 | 72 | */ |
|
34533
74b179b1e8ef
GObjectify the PurpleCipher structure
Ankit Vani <a@nevitus.org>
parents:
33915
diff
changeset
|
73 | struct _PurpleCipherClass { |
|
74b179b1e8ef
GObjectify the PurpleCipher structure
Ankit Vani <a@nevitus.org>
parents:
33915
diff
changeset
|
74 | /*< private >*/ |
|
74b179b1e8ef
GObjectify the PurpleCipher structure
Ankit Vani <a@nevitus.org>
parents:
33915
diff
changeset
|
75 | GObjectClass parent_class; |
| 10684 | 76 | |
| 77 | /** The reset function */ | |
|
34533
74b179b1e8ef
GObjectify the PurpleCipher structure
Ankit Vani <a@nevitus.org>
parents:
33915
diff
changeset
|
78 | void (*reset)(PurpleCipher *cipher); |
| 10684 | 79 | |
|
34535
f8fd1c60c22a
Merged PurpleCipher structure with the one in default branch
Ankit Vani <a@nevitus.org>
parents:
34533
diff
changeset
|
80 | /** The reset state function */ |
|
f8fd1c60c22a
Merged PurpleCipher structure with the one in default branch
Ankit Vani <a@nevitus.org>
parents:
34533
diff
changeset
|
81 | void (*reset_state)(PurpleCipher *cipher); |
|
f8fd1c60c22a
Merged PurpleCipher structure with the one in default branch
Ankit Vani <a@nevitus.org>
parents:
34533
diff
changeset
|
82 | |
| 10684 | 83 | /** The set initialization vector function */ |
|
34533
74b179b1e8ef
GObjectify the PurpleCipher structure
Ankit Vani <a@nevitus.org>
parents:
33915
diff
changeset
|
84 | void (*set_iv)(PurpleCipher *cipher, guchar *iv, size_t len); |
| 10684 | 85 | |
| 86 | /** The append data function */ | |
|
34533
74b179b1e8ef
GObjectify the PurpleCipher structure
Ankit Vani <a@nevitus.org>
parents:
33915
diff
changeset
|
87 | void (*append)(PurpleCipher *cipher, const guchar *data, size_t len); |
| 10684 | 88 | |
| 89 | /** The digest function */ | |
|
34535
f8fd1c60c22a
Merged PurpleCipher structure with the one in default branch
Ankit Vani <a@nevitus.org>
parents:
34533
diff
changeset
|
90 | 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
|
91 | |
|
f8fd1c60c22a
Merged PurpleCipher structure with the one in default branch
Ankit Vani <a@nevitus.org>
parents:
34533
diff
changeset
|
92 | /** The get digest size function */ |
|
f8fd1c60c22a
Merged PurpleCipher structure with the one in default branch
Ankit Vani <a@nevitus.org>
parents:
34533
diff
changeset
|
93 | size_t (*get_digest_size)(PurpleCipher *cipher); |
| 10684 | 94 | |
| 95 | /** The encrypt function */ | |
|
34535
f8fd1c60c22a
Merged PurpleCipher structure with the one in default branch
Ankit Vani <a@nevitus.org>
parents:
34533
diff
changeset
|
96 | ssize_t (*encrypt)(PurpleCipher *cipher, const guchar input[], size_t in_len, guchar output[], size_t out_size); |
| 10684 | 97 | |
| 98 | /** The decrypt function */ | |
|
34535
f8fd1c60c22a
Merged PurpleCipher structure with the one in default branch
Ankit Vani <a@nevitus.org>
parents:
34533
diff
changeset
|
99 | ssize_t (*decrypt)(PurpleCipher *cipher, const guchar input[], size_t in_len, guchar output[], size_t out_size); |
| 10684 | 100 | |
| 101 | /** The set salt function */ | |
|
34535
f8fd1c60c22a
Merged PurpleCipher structure with the one in default branch
Ankit Vani <a@nevitus.org>
parents:
34533
diff
changeset
|
102 | void (*set_salt)(PurpleCipher *cipher, const guchar *salt, size_t len); |
| 10684 | 103 | |
| 104 | /** The set key function */ | |
|
34535
f8fd1c60c22a
Merged PurpleCipher structure with the one in default branch
Ankit Vani <a@nevitus.org>
parents:
34533
diff
changeset
|
105 | 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
|
106 | |
|
33910
5749f2724b12
ciphers cleanup: get key size
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33909
diff
changeset
|
107 | /** The get key size function */ |
|
34533
74b179b1e8ef
GObjectify the PurpleCipher structure
Ankit Vani <a@nevitus.org>
parents:
33915
diff
changeset
|
108 | size_t (*get_key_size)(PurpleCipher *cipher); |
|
33910
5749f2724b12
ciphers cleanup: get key size
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33909
diff
changeset
|
109 | |
|
22024
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20889
diff
changeset
|
110 | /** The set batch mode function */ |
|
34533
74b179b1e8ef
GObjectify the PurpleCipher structure
Ankit Vani <a@nevitus.org>
parents:
33915
diff
changeset
|
111 | 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
|
112 | |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20889
diff
changeset
|
113 | /** The get batch mode function */ |
|
34533
74b179b1e8ef
GObjectify the PurpleCipher structure
Ankit Vani <a@nevitus.org>
parents:
33915
diff
changeset
|
114 | 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
|
115 | |
|
22025
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
116 | /** The get block size function */ |
|
34533
74b179b1e8ef
GObjectify the PurpleCipher structure
Ankit Vani <a@nevitus.org>
parents:
33915
diff
changeset
|
117 | size_t (*get_block_size)(PurpleCipher *cipher); |
|
74b179b1e8ef
GObjectify the PurpleCipher structure
Ankit Vani <a@nevitus.org>
parents:
33915
diff
changeset
|
118 | |
|
74b179b1e8ef
GObjectify the PurpleCipher structure
Ankit Vani <a@nevitus.org>
parents:
33915
diff
changeset
|
119 | /** The get cipher name function */ |
|
74b179b1e8ef
GObjectify the PurpleCipher structure
Ankit Vani <a@nevitus.org>
parents:
33915
diff
changeset
|
120 | 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
|
121 | |
|
33908
78b42fd69e02
ciphers cleanup: passing keys with length by default
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32206
diff
changeset
|
122 | void (*_purple_reserved1)(void); |
|
78b42fd69e02
ciphers cleanup: passing keys with length by default
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32206
diff
changeset
|
123 | void (*_purple_reserved2)(void); |
|
78b42fd69e02
ciphers cleanup: passing keys with length by default
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32206
diff
changeset
|
124 | void (*_purple_reserved3)(void); |
|
78b42fd69e02
ciphers cleanup: passing keys with length by default
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32206
diff
changeset
|
125 | void (*_purple_reserved4)(void); |
| 10684 | 126 | }; |
| 127 | ||
|
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
|
128 | G_BEGIN_DECLS |
| 10684 | 129 | |
|
34674
2e45aee0af19
Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents:
34597
diff
changeset
|
130 | /*****************************************************************************/ |
|
2e45aee0af19
Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents:
34597
diff
changeset
|
131 | /** @name PurpleCipher API */ |
|
2e45aee0af19
Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents:
34597
diff
changeset
|
132 | /*****************************************************************************/ |
|
2e45aee0af19
Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents:
34597
diff
changeset
|
133 | /*@{*/ |
|
2e45aee0af19
Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents:
34597
diff
changeset
|
134 | |
|
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 | * 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
|
137 | */ |
|
34533
74b179b1e8ef
GObjectify the PurpleCipher structure
Ankit Vani <a@nevitus.org>
parents:
33915
diff
changeset
|
138 | GType purple_cipher_get_type(void); |
| 10684 | 139 | |
|
34674
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 | * 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
|
142 | * |
|
2e45aee0af19
Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents:
34597
diff
changeset
|
143 | * @param cipher The cipher |
|
2e45aee0af19
Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents:
34597
diff
changeset
|
144 | * |
|
2e45aee0af19
Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents:
34597
diff
changeset
|
145 | * @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
|
146 | */ |
| 15884 | 147 | const gchar *purple_cipher_get_name(PurpleCipher *cipher); |
| 10684 | 148 | |
|
34674
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 | * 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
|
151 | * @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
|
152 | * |
|
2e45aee0af19
Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents:
34597
diff
changeset
|
153 | * @param cipher The cipher |
|
2e45aee0af19
Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents:
34597
diff
changeset
|
154 | */ |
|
34533
74b179b1e8ef
GObjectify the PurpleCipher structure
Ankit Vani <a@nevitus.org>
parents:
33915
diff
changeset
|
155 | 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
|
156 | |
|
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 | * 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
|
159 | * configuration. |
|
2e45aee0af19
Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents:
34597
diff
changeset
|
160 | * |
|
2e45aee0af19
Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents:
34597
diff
changeset
|
161 | * 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
|
162 | * will remain untouched. |
|
2e45aee0af19
Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents:
34597
diff
changeset
|
163 | * |
|
2e45aee0af19
Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents:
34597
diff
changeset
|
164 | * @param cipher The cipher |
|
2e45aee0af19
Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents:
34597
diff
changeset
|
165 | */ |
|
34535
f8fd1c60c22a
Merged PurpleCipher structure with the one in default branch
Ankit Vani <a@nevitus.org>
parents:
34533
diff
changeset
|
166 | 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
|
167 | |
|
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 | * 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
|
170 | * @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
|
171 | * |
|
2e45aee0af19
Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents:
34597
diff
changeset
|
172 | * @param cipher The cipher |
|
2e45aee0af19
Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents:
34597
diff
changeset
|
173 | * @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
|
174 | * @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
|
175 | */ |
|
34533
74b179b1e8ef
GObjectify the PurpleCipher structure
Ankit Vani <a@nevitus.org>
parents:
33915
diff
changeset
|
176 | void purple_cipher_set_iv(PurpleCipher *cipher, guchar *iv, size_t len); |
| 10684 | 177 | |
|
34674
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 | * 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
|
180 | * |
|
2e45aee0af19
Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents:
34597
diff
changeset
|
181 | * @param cipher The cipher |
|
2e45aee0af19
Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents:
34597
diff
changeset
|
182 | * @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
|
183 | * @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
|
184 | */ |
|
34533
74b179b1e8ef
GObjectify the PurpleCipher structure
Ankit Vani <a@nevitus.org>
parents:
33915
diff
changeset
|
185 | 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
|
186 | |
|
2e45aee0af19
Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents:
34597
diff
changeset
|
187 | /** |
|
2e45aee0af19
Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents:
34597
diff
changeset
|
188 | * Digests a cipher context |
|
2e45aee0af19
Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents:
34597
diff
changeset
|
189 | * |
|
2e45aee0af19
Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents:
34597
diff
changeset
|
190 | * @param cipher The cipher |
|
2e45aee0af19
Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents:
34597
diff
changeset
|
191 | * @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
|
192 | * @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
|
193 | */ |
|
34535
f8fd1c60c22a
Merged PurpleCipher structure with the one in default branch
Ankit Vani <a@nevitus.org>
parents:
34533
diff
changeset
|
194 | 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
|
195 | |
|
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 | * 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
|
198 | * |
|
2e45aee0af19
Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents:
34597
diff
changeset
|
199 | * @param cipher The cipher |
|
2e45aee0af19
Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents:
34597
diff
changeset
|
200 | * @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
|
201 | * @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
|
202 | */ |
|
34535
f8fd1c60c22a
Merged PurpleCipher structure with the one in default branch
Ankit Vani <a@nevitus.org>
parents:
34533
diff
changeset
|
203 | 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
|
204 | |
|
2e45aee0af19
Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents:
34597
diff
changeset
|
205 | /** |
|
2e45aee0af19
Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents:
34597
diff
changeset
|
206 | * 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
|
207 | * |
|
2e45aee0af19
Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents:
34597
diff
changeset
|
208 | * @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
|
209 | * |
|
2e45aee0af19
Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents:
34597
diff
changeset
|
210 | * @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
|
211 | */ |
|
34535
f8fd1c60c22a
Merged PurpleCipher structure with the one in default branch
Ankit Vani <a@nevitus.org>
parents:
34533
diff
changeset
|
212 | size_t purple_cipher_get_digest_size(PurpleCipher *cipher); |
| 10684 | 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 | * 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
|
216 | * |
|
2e45aee0af19
Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents:
34597
diff
changeset
|
217 | * @param cipher The cipher |
|
2e45aee0af19
Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents:
34597
diff
changeset
|
218 | * @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
|
219 | * @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
|
220 | * @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
|
221 | * @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
|
222 | * |
|
2e45aee0af19
Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents:
34597
diff
changeset
|
223 | * @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
|
224 | */ |
|
34535
f8fd1c60c22a
Merged PurpleCipher structure with the one in default branch
Ankit Vani <a@nevitus.org>
parents:
34533
diff
changeset
|
225 | 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
|
226 | |
|
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 | * 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
|
229 | * |
|
2e45aee0af19
Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents:
34597
diff
changeset
|
230 | * @param cipher The cipher |
|
2e45aee0af19
Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents:
34597
diff
changeset
|
231 | * @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
|
232 | * @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
|
233 | * @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
|
234 | * @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
|
235 | * |
|
2e45aee0af19
Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents:
34597
diff
changeset
|
236 | * @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
|
237 | */ |
|
34535
f8fd1c60c22a
Merged PurpleCipher structure with the one in default branch
Ankit Vani <a@nevitus.org>
parents:
34533
diff
changeset
|
238 | ssize_t purple_cipher_decrypt(PurpleCipher *cipher, const guchar input[], size_t in_len, guchar output[], size_t out_size); |
| 10684 | 239 | |
|
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 | * 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
|
242 | * |
|
2e45aee0af19
Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents:
34597
diff
changeset
|
243 | * @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
|
244 | * @param salt The salt |
|
2e45aee0af19
Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents:
34597
diff
changeset
|
245 | * @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
|
246 | */ |
|
34535
f8fd1c60c22a
Merged PurpleCipher structure with the one in default branch
Ankit Vani <a@nevitus.org>
parents:
34533
diff
changeset
|
247 | 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
|
248 | |
|
34674
2e45aee0af19
Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents:
34597
diff
changeset
|
249 | /** |
|
2e45aee0af19
Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents:
34597
diff
changeset
|
250 | * 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
|
251 | * |
|
2e45aee0af19
Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents:
34597
diff
changeset
|
252 | * @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
|
253 | * @param key The key |
|
2e45aee0af19
Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents:
34597
diff
changeset
|
254 | * @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
|
255 | */ |
|
34535
f8fd1c60c22a
Merged PurpleCipher structure with the one in default branch
Ankit Vani <a@nevitus.org>
parents:
34533
diff
changeset
|
256 | 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
|
257 | |
|
2e45aee0af19
Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents:
34597
diff
changeset
|
258 | /** |
|
2e45aee0af19
Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents:
34597
diff
changeset
|
259 | * 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
|
260 | * |
|
2e45aee0af19
Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents:
34597
diff
changeset
|
261 | * @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
|
262 | * |
|
2e45aee0af19
Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents:
34597
diff
changeset
|
263 | * @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
|
264 | */ |
|
34533
74b179b1e8ef
GObjectify the PurpleCipher structure
Ankit Vani <a@nevitus.org>
parents:
33915
diff
changeset
|
265 | size_t purple_cipher_get_key_size(PurpleCipher *cipher); |
| 10684 | 266 | |
|
34674
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 | * 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
|
269 | * |
|
2e45aee0af19
Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents:
34597
diff
changeset
|
270 | * @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
|
271 | * @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
|
272 | * |
|
2e45aee0af19
Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents:
34597
diff
changeset
|
273 | */ |
|
34533
74b179b1e8ef
GObjectify the PurpleCipher structure
Ankit Vani <a@nevitus.org>
parents:
33915
diff
changeset
|
274 | 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
|
275 | |
|
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 | * 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
|
278 | * |
|
2e45aee0af19
Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents:
34597
diff
changeset
|
279 | * @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
|
280 | * |
|
2e45aee0af19
Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents:
34597
diff
changeset
|
281 | * @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
|
282 | */ |
|
34533
74b179b1e8ef
GObjectify the PurpleCipher structure
Ankit Vani <a@nevitus.org>
parents:
33915
diff
changeset
|
283 | PurpleCipherBatchMode purple_cipher_get_batch_mode(PurpleCipher *cipher); |
|
12382
5ef67596b420
[gaim-migrate @ 14688]
Richard Laager <rlaager@pidgin.im>
parents:
12323
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 | * 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
|
287 | * |
|
2e45aee0af19
Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents:
34597
diff
changeset
|
288 | * @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
|
289 | * |
|
2e45aee0af19
Documented functions of PurpleCipher, PurpleHash and purple_account_get_type()
Ankit Vani <a@nevitus.org>
parents:
34597
diff
changeset
|
290 | * @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
|
291 | */ |
|
34533
74b179b1e8ef
GObjectify the PurpleCipher structure
Ankit Vani <a@nevitus.org>
parents:
33915
diff
changeset
|
292 | 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
|
293 | |
|
34674
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 | |
|
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
|
296 | G_END_DECLS |
| 10684 | 297 | |
| 15884 | 298 | #endif /* PURPLE_CIPHER_H */ |