libpurple/cipher.h

changeset 22025
23756775175d
parent 22024
3fd5e4fff1be
child 25888
d0fdd378a635
equal deleted inserted replaced
22024:3fd5e4fff1be 22025:23756775175d
63 PURPLE_CIPHER_CAPS_GET_SALT_SIZE = 1 << 12, /**< Get salt size flag */ 63 PURPLE_CIPHER_CAPS_GET_SALT_SIZE = 1 << 12, /**< Get salt size flag */
64 PURPLE_CIPHER_CAPS_SET_KEY = 1 << 13, /**< Set key flag */ 64 PURPLE_CIPHER_CAPS_SET_KEY = 1 << 13, /**< Set key flag */
65 PURPLE_CIPHER_CAPS_GET_KEY_SIZE = 1 << 14, /**< Get key size flag */ 65 PURPLE_CIPHER_CAPS_GET_KEY_SIZE = 1 << 14, /**< Get key size flag */
66 PURPLE_CIPHER_CAPS_SET_BATCH_MODE = 1 << 15, /**< Set batch mode flag */ 66 PURPLE_CIPHER_CAPS_SET_BATCH_MODE = 1 << 15, /**< Set batch mode flag */
67 PURPLE_CIPHER_CAPS_GET_BATCH_MODE = 1 << 16, /**< Get batch mode flag */ 67 PURPLE_CIPHER_CAPS_GET_BATCH_MODE = 1 << 16, /**< Get batch mode flag */
68 PURPLE_CIPHER_CAPS_UNKNOWN = 1 << 17 /**< Unknown */ 68 PURPLE_CIPHER_CAPS_GET_BLOCK_SIZE = 1 << 17, /**< The get block size flag */
69 PURPLE_CIPHER_CAPS_SET_KEY_WITH_LEN = 1 << 18, /**< The set key with length flag */
70 PURPLE_CIPHER_CAPS_UNKNOWN = 1 << 19 /**< Unknown */
69 } PurpleCipherCaps; 71 } PurpleCipherCaps;
70 72
71 /** 73 /**
72 * The operations of a cipher. Every cipher must implement one of these. 74 * The operations of a cipher. Every cipher must implement one of these.
73 */ 75 */
118 void (*set_batch_mode)(PurpleCipherContext *context, PurpleCipherBatchMode mode); 120 void (*set_batch_mode)(PurpleCipherContext *context, PurpleCipherBatchMode mode);
119 121
120 /** The get batch mode function */ 122 /** The get batch mode function */
121 PurpleCipherBatchMode (*get_batch_mode)(PurpleCipherContext *context); 123 PurpleCipherBatchMode (*get_batch_mode)(PurpleCipherContext *context);
122 124
123 void (*_purple_reserved1)(void); 125 /** The get block size function */
124 void (*_purple_reserved2)(void); 126 size_t (*get_block_size)(PurpleCipherContext *context);
127
128 /** The set key with length function */
129 void (*set_key_with_len)(PurpleCipherContext *context, const guchar *key, size_t len);
125 }; 130 };
126 131
127 #ifdef __cplusplus 132 #ifdef __cplusplus
128 extern "C" { 133 extern "C" {
129 #endif /* __cplusplus */ 134 #endif /* __cplusplus */
404 * @param context The context whose batch mode to get 409 * @param context The context whose batch mode to get
405 * 410 *
406 * @return The batch mode under which the cipher is operating 411 * @return The batch mode under which the cipher is operating
407 */ 412 */
408 PurpleCipherBatchMode purple_cipher_context_get_batch_mode(PurpleCipherContext *context); 413 PurpleCipherBatchMode purple_cipher_context_get_batch_mode(PurpleCipherContext *context);
414
415 /**
416 * Gets the block size of a context
417 *
418 * @param context The context whose block size to get
419 *
420 * @return The block size of the context
421 */
422 size_t purple_cipher_context_get_block_size(PurpleCipherContext *context);
423
424 /**
425 * Sets the key with a given length on a context
426 *
427 * @param context The context whose key to set
428 * @param key The key
429 * @param len The length of the key
430 *
431 */
432 void purple_cipher_context_set_key_with_len(PurpleCipherContext *context, const guchar *key, size_t len);
409 433
410 /** 434 /**
411 * Sets the cipher data for a context 435 * Sets the cipher data for a context
412 * 436 *
413 * @param context The context whose cipher data to set 437 * @param context The context whose cipher data to set

mercurial