77 const char *(*get_name)(void);
78 const char *(*get_desc)(void);
207 void mwKeyExpand(
int *ekey,
const guchar *key, gsize keylen);
217 void mwEncrypt(
const guchar *key, gsize keylen, guchar *iv,
228 void mwDecrypt(
const guchar *key, gsize keylen, guchar *iv,
286 struct mwMpi *private_key);
struct mwSession * mwCipher_getSession(struct mwCipher *cipher)
void mwCipherInstance_accepted(struct mwCipherInstance *ci, struct mwEncryptItem *item)
Indicates an offered cipher has been accepted.
struct mwCipherInstance * mwCipher_newInstance(struct mwCipher *cipher, struct mwChannel *channel)
const char * mwCipher_getDesc(struct mwCipher *cipher)
const char * mwCipher_getName(struct mwCipher *cipher)
void mwIV_init(guchar *iv)
Setup an Initialization Vector.
void(* clear_instance)(struct mwCipherInstance *ci)
clean up a cipher instance before being free'd
Definition: mw_cipher.h:98
struct mwSession * session
service this cipher is providing for
Definition: mw_cipher.h:74
struct mwCipher * mwCipher_new_RC2_128(struct mwSession *s)
void mwEncryptExpanded(const int *ekey, guchar *iv, struct mwOpaque *in, struct mwOpaque *out)
Encrypt data using an already-expanded key.
int(* mwCipherProcessor)(struct mwCipherInstance *ci, struct mwOpaque *data)
Process (encrypt or decrypt, depending) the given data.
Definition: mw_cipher.h:62
void mwCipherInstance_free(struct mwCipherInstance *ci)
destroy a cipher instance
void mwMpi_randDHKeypair(struct mwMpi *private_key, struct mwMpi *public_key)
sets private to a randomly generated value, and calculates public using the Sametime Prime and Base ...
An instance of a cipher.
Definition: mw_cipher.h:105
void mwCipher_free(struct mwCipher *cipher)
destroy a cipher
struct mwEncryptItem * mwCipherInstance_offer(struct mwCipherInstance *ci)
Offer a cipher.
void mwMpi_free(struct mwMpi *i)
destroy an mpi value
void mwMpi_setDHPrime(struct mwMpi *i)
set a big integer to the Sametime Prime value
Represents a Sametime client session.
void mwMpi_export(struct mwMpi *i, struct mwOpaque *o)
Export a value into an opaque.
A cipher.
Definition: mw_cipher.h:70
mwCipherType
Common cipher types.
Definition: mw_cipher.h:41
Common data types and functions for handling those types.
void(* offered)(struct mwCipherInstance *ci, struct mwEncryptItem *item)
Definition: mw_cipher.h:84
void mwMpi_calculateDHShared(struct mwMpi *shared_key, struct mwMpi *remote_key, struct mwMpi *private_key)
sets the shared key value based on the remote and private keys, using the Sametime Prime and Base ...
void mwEncrypt(const guchar *key, gsize keylen, guchar *iv, struct mwOpaque *in, struct mwOpaque *out)
Encrypt data using an expanded form of the given key.
struct mwChannel * mwCipherInstance_getChannel(struct mwCipherInstance *ci)
reference the channel a cipher instance is attached to
void(* accepted)(struct mwCipherInstance *ci, struct mwEncryptItem *item)
Definition: mw_cipher.h:86
struct mwMpi * mwMpi_new(void)
prepare a new mpi value
Represents a channel to a service.
Definition: mw_channel.h:95
void mwKeyExpand(int *ekey, const guchar *key, gsize keylen)
Expand a variable-length key into a 128-byte key (represented as an an array of 64 ints) ...
struct mwCipher * cipher
the parent cipher.
Definition: mw_cipher.h:109
mwCipherInstantiator new_instance
Generate a new Cipher Instance for use on a channel.
Definition: mw_cipher.h:82
int mwCipherInstance_decrypt(struct mwCipherInstance *ci, struct mwOpaque *data)
decrypt data
guint16 type
Definition: mw_cipher.h:76
mwCipherProcessor decrypt
Definition: mw_cipher.h:90
struct mwCipherInstance *(* mwCipherInstantiator)(struct mwCipher *cipher, struct mwChannel *chan)
Obtain an instance of a given cipher, which can be used for the processing of a single channel...
Definition: mw_cipher.h:54
void mwMpi_setDHBase(struct mwMpi *i)
set a big integer to the Sametime Base value
A length of binary data, not null-terminated.
Definition: mw_common.h:79
void mwDecryptExpanded(const int *ekey, guchar *iv, struct mwOpaque *in, struct mwOpaque *out)
Decrypt data using an already expanded key.
mwCipherProcessor encrypt
Definition: mw_cipher.h:89
void mwKeyRandom(guchar *key, gsize keylen)
generate some pseudo-random bytes
struct mwCipher * mwCipherInstance_getCipher(struct mwCipherInstance *ci)
reference the parent cipher of an instance
void(* clear)(struct mwCipher *c)
prepare this cipher for being free'd
Definition: mw_cipher.h:94
struct mwEncryptItem * mwCipherInstance_accept(struct mwCipherInstance *ci)
Accept a cipher offered to our channel.
Definition: mw_cipher.h:43
void mwDecrypt(const guchar *key, gsize keylen, guchar *iv, struct mwOpaque *in, struct mwOpaque *out)
Decrypt data using an expanded form of the given key.
encryption blocks
Definition: mw_common.h:220
guint16 mwCipher_getType(struct mwCipher *cipher)
void mwMpi_import(struct mwMpi *i, struct mwOpaque *o)
Import a value from an opaque.
Definition: mw_cipher.h:42
struct mwCipher * mwCipher_new_RC2_40(struct mwSession *s)
struct mwChannel * channel
the channel this instances processes
Definition: mw_cipher.h:113
void mwCipherInstance_offered(struct mwCipherInstance *ci, struct mwEncryptItem *item)
Indicates a cipher has been offered to our channel.
guchar * data
data, normally with no NULL termination
Definition: mw_common.h:81
int mwCipherInstance_encrypt(struct mwCipherInstance *ci, struct mwOpaque *data)
encrypt data