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