#include <glib.h>
#include "mw_common.h"
Go to the source code of this file.
Data Structures | |
struct | mwCipher |
A cipher. More... | |
struct | mwCipherInstance |
An instance of a cipher. More... | |
Typedefs | |
typedef 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. | |
typedef int(* | mwCipherProcessor )(struct mwCipherInstance *ci, struct mwOpaque *data) |
Process (encrypt or decrypt, depending) the given data. | |
Enumerations | |
enum | mwCipherType { mwCipher_RC2_40 = 0x0000, mwCipher_RC2_128 = 0x0001 } |
Common cipher types. More... | |
Functions | |
void | mwCipher_free (struct mwCipher *cipher) |
destroy a cipher | |
const char * | mwCipher_getDesc (struct mwCipher *cipher) |
const char * | mwCipher_getName (struct mwCipher *cipher) |
mwSession * | mwCipher_getSession (struct mwCipher *cipher) |
guint16 | mwCipher_getType (struct mwCipher *cipher) |
mwCipher * | mwCipher_new_RC2_128 (struct mwSession *s) |
mwCipher * | mwCipher_new_RC2_40 (struct mwSession *s) |
mwCipherInstance * | mwCipher_newInstance (struct mwCipher *cipher, struct mwChannel *channel) |
mwEncryptItem * | mwCipherInstance_accept (struct mwCipherInstance *ci) |
Accept a cipher offered to our channel. | |
void | mwCipherInstance_accepted (struct mwCipherInstance *ci, struct mwEncryptItem *item) |
Indicates an offered cipher has been accepted. | |
int | mwCipherInstance_decrypt (struct mwCipherInstance *ci, struct mwOpaque *data) |
decrypt data | |
int | mwCipherInstance_encrypt (struct mwCipherInstance *ci, struct mwOpaque *data) |
encrypt data | |
void | mwCipherInstance_free (struct mwCipherInstance *ci) |
destroy a cipher instance | |
mwChannel * | mwCipherInstance_getChannel (struct mwCipherInstance *ci) |
reference the channel a cipher instance is attached to | |
mwCipher * | mwCipherInstance_getCipher (struct mwCipherInstance *ci) |
reference the parent cipher of an instance | |
mwEncryptItem * | mwCipherInstance_offer (struct mwCipherInstance *ci) |
Offer a cipher. | |
void | mwCipherInstance_offered (struct mwCipherInstance *ci, struct mwEncryptItem *item) |
Indicates a cipher has been offered to our channel. |
|
Obtain an instance of a given cipher, which can be used for the processing of a single channel.
|
|
Process (encrypt or decrypt, depending) the given data. The passed buffer may be freed in processing and be replaced with a freshly allocated buffer. The post-processed buffer must in turn be freed after use |
|
Common cipher types.
|
|
destroy a cipher
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Accept a cipher offered to our channel.
|
|
Indicates an offered cipher has been accepted.
|
|
decrypt data
|
|
encrypt data
|
|
destroy a cipher instance
|
|
reference the channel a cipher instance is attached to
|
|
reference the parent cipher of an instance
|
|
Offer a cipher.
|
|
Indicates a cipher has been offered to our channel.
|
|
Decrypt data using an expanded form of the given key.
|
|
Decrypt data using an already expanded key.
|
|
Encrypt data using an expanded form of the given key.
|
|
Encrypt data using an already-expanded key.
|
|
Setup an Initialization Vector. IV must be at least 8 bytes |
|
Expand a variable-length key into a 128-byte key (represented as an an array of 64 ints).
|
|
generate some pseudo-random bytes
|
|
sets the shared key value based on the remote and private keys, using the Sametime Prime and Base
|
|
Export a value into an opaque.
|
|
destroy an mpi value
|
|
Import a value from an opaque.
|
|
prepare a new mpi value
|
|
sets private to a randomly generated value, and calculates public using the Sametime Prime and Base
|
|
set a big integer to the Sametime Base value
|
|
set a big integer to the Sametime Prime value
|