<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> <title>meanwhile: mw_cipher.h File Reference</title> <link href="doxygen.css" rel="stylesheet" type="text/css"> <link href="tabs.css" rel="stylesheet" type="text/css"> </head><body> <!-- Generated by Doxygen 1.5.4 --> <div class="tabs"> <ul> <li><a href="index.html"><span>Main Page</span></a></li> <li><a href="classes.html"><span>Data Structures</span></a></li> <li class="current"><a href="files.html"><span>Files</span></a></li> <li><a href="pages.html"><span>Related Pages</span></a></li> </ul> </div> <h1>mw_cipher.h File Reference</h1> <p> <code>#include <glib.h></code><br> <code>#include "<a class="el" href="mw__common_8h-source.html">mw_common.h</a>"</code><br> <p> <a href="mw__cipher_8h-source.html">Go to the source code of this file.</a><table border="0" cellpadding="0" cellspacing="0"> <tr><td></td></tr> <tr><td colspan="2"><br><h2>Data Structures</h2></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">struct </td><td class="memItemRight" valign="bottom"><a class="el" href="structmwCipher.html">mwCipher</a></td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">A cipher. <a href="structmwCipher.html#_details">More...</a><br></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">struct </td><td class="memItemRight" valign="bottom"><a class="el" href="structmwCipherInstance.html">mwCipherInstance</a></td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">An instance of a cipher. <a href="structmwCipherInstance.html#_details">More...</a><br></td></tr> <tr><td colspan="2"><br><h2>Typedefs</h2></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">typedef struct <a class="el" href="structmwCipherInstance.html">mwCipherInstance</a> *(* </td><td class="memItemRight" valign="bottom"><a class="el" href="mw__cipher_8h.html#866fc29431a5cd1c3c49e9b1e8b09800">mwCipherInstantiator</a> )(struct <a class="el" href="structmwCipher.html">mwCipher</a> *cipher, struct <a class="el" href="structmwChannel.html">mwChannel</a> *chan)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Obtain an instance of a given cipher, which can be used for the processing of a single channel. <a href="#866fc29431a5cd1c3c49e9b1e8b09800"></a><br></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">typedef int(* </td><td class="memItemRight" valign="bottom"><a class="el" href="mw__cipher_8h.html#130909e22689a8b83c70572af9850bef">mwCipherProcessor</a> )(struct <a class="el" href="structmwCipherInstance.html">mwCipherInstance</a> *ci, struct <a class="el" href="structmwOpaque.html">mwOpaque</a> *data)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Process (encrypt or decrypt, depending) the given data. <a href="#130909e22689a8b83c70572af9850bef"></a><br></td></tr> <tr><td colspan="2"><br><h2>Enumerations</h2></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">enum </td><td class="memItemRight" valign="bottom"><a class="el" href="mw__cipher_8h.html#3d1e1cc055146237e1b8e638c5005a70">mwCipherType</a> { <br> <a class="el" href="mw__cipher_8h.html#3d1e1cc055146237e1b8e638c5005a70b67b342eb4ad1f28624235e7d2b1509b">mwCipher_RC2_40</a> = 0x0000, <br> <a class="el" href="mw__cipher_8h.html#3d1e1cc055146237e1b8e638c5005a70b9732b499466e669cf5f8de3e09770f8">mwCipher_RC2_128</a> = 0x0001 <br> }</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Common cipher types. <a href="mw__cipher_8h.html#3d1e1cc055146237e1b8e638c5005a70">More...</a><br></td></tr> <tr><td colspan="2"><br><h2>Functions</h2></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="mw__cipher_8h.html#4d6a169e214b8e6b60e6fb2e7c5c51bd">mwCipher_free</a> (struct <a class="el" href="structmwCipher.html">mwCipher</a> *cipher)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">destroy a cipher <a href="#4d6a169e214b8e6b60e6fb2e7c5c51bd"></a><br></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">const char * </td><td class="memItemRight" valign="bottom"><a class="el" href="mw__cipher_8h.html#2fe3c59366be8e33dea3ea8089f17309">mwCipher_getDesc</a> (struct <a class="el" href="structmwCipher.html">mwCipher</a> *cipher)</td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">const char * </td><td class="memItemRight" valign="bottom"><a class="el" href="mw__cipher_8h.html#57a44521a627c04f67fd26b6112c232e">mwCipher_getName</a> (struct <a class="el" href="structmwCipher.html">mwCipher</a> *cipher)</td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">struct <a class="el" href="structmwSession.html">mwSession</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="mw__cipher_8h.html#ca7df61aefa4a1eda2776c9d11d66c04">mwCipher_getSession</a> (struct <a class="el" href="structmwCipher.html">mwCipher</a> *cipher)</td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">guint16 </td><td class="memItemRight" valign="bottom"><a class="el" href="mw__cipher_8h.html#9c78471afd459b09ddf5e544d9a07f56">mwCipher_getType</a> (struct <a class="el" href="structmwCipher.html">mwCipher</a> *cipher)</td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">struct <a class="el" href="structmwCipher.html">mwCipher</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="mw__cipher_8h.html#8994381485d3dd43b72933a6043c74cd">mwCipher_new_RC2_128</a> (struct <a class="el" href="structmwSession.html">mwSession</a> *s)</td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">struct <a class="el" href="structmwCipher.html">mwCipher</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="mw__cipher_8h.html#42e8c2c577767f23154b2c1f09fd15e0">mwCipher_new_RC2_40</a> (struct <a class="el" href="structmwSession.html">mwSession</a> *s)</td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">struct <a class="el" href="structmwCipherInstance.html">mwCipherInstance</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="mw__cipher_8h.html#0d03f56fb313094c1129a4e8086cfce3">mwCipher_newInstance</a> (struct <a class="el" href="structmwCipher.html">mwCipher</a> *cipher, struct <a class="el" href="structmwChannel.html">mwChannel</a> *channel)</td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">struct <a class="el" href="structmwEncryptItem.html">mwEncryptItem</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="mw__cipher_8h.html#68d12ba00aadc58033d326d3393c9a58">mwCipherInstance_accept</a> (struct <a class="el" href="structmwCipherInstance.html">mwCipherInstance</a> *ci)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Accept a cipher offered to our channel. <a href="#68d12ba00aadc58033d326d3393c9a58"></a><br></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="mw__cipher_8h.html#12cef66d5336ee880cdd812c2dbe7ff3">mwCipherInstance_accepted</a> (struct <a class="el" href="structmwCipherInstance.html">mwCipherInstance</a> *ci, struct <a class="el" href="structmwEncryptItem.html">mwEncryptItem</a> *item)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Indicates an offered cipher has been accepted. <a href="#12cef66d5336ee880cdd812c2dbe7ff3"></a><br></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="mw__cipher_8h.html#20e64408792db9e2845f8a7865eefe65">mwCipherInstance_decrypt</a> (struct <a class="el" href="structmwCipherInstance.html">mwCipherInstance</a> *ci, struct <a class="el" href="structmwOpaque.html">mwOpaque</a> *data)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">decrypt data <a href="#20e64408792db9e2845f8a7865eefe65"></a><br></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="mw__cipher_8h.html#fbdb09cd3991970596b9e7ad1865a4b5">mwCipherInstance_encrypt</a> (struct <a class="el" href="structmwCipherInstance.html">mwCipherInstance</a> *ci, struct <a class="el" href="structmwOpaque.html">mwOpaque</a> *data)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">encrypt data <a href="#fbdb09cd3991970596b9e7ad1865a4b5"></a><br></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="mw__cipher_8h.html#302cdec8d916252920962bc7aefe39a4">mwCipherInstance_free</a> (struct <a class="el" href="structmwCipherInstance.html">mwCipherInstance</a> *ci)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">destroy a cipher instance <a href="#302cdec8d916252920962bc7aefe39a4"></a><br></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">struct <a class="el" href="structmwChannel.html">mwChannel</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="mw__cipher_8h.html#d1a85931da52a2d26072f92e046e5027">mwCipherInstance_getChannel</a> (struct <a class="el" href="structmwCipherInstance.html">mwCipherInstance</a> *ci)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">reference the channel a cipher instance is attached to <a href="#d1a85931da52a2d26072f92e046e5027"></a><br></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">struct <a class="el" href="structmwCipher.html">mwCipher</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="mw__cipher_8h.html#014d426ae329bf07cc3c49d46d7482b4">mwCipherInstance_getCipher</a> (struct <a class="el" href="structmwCipherInstance.html">mwCipherInstance</a> *ci)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">reference the parent cipher of an instance <a href="#014d426ae329bf07cc3c49d46d7482b4"></a><br></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">struct <a class="el" href="structmwEncryptItem.html">mwEncryptItem</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="mw__cipher_8h.html#c9b0176eb3578c5e0b5d1aefb75921c1">mwCipherInstance_offer</a> (struct <a class="el" href="structmwCipherInstance.html">mwCipherInstance</a> *ci)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Offer a cipher. <a href="#c9b0176eb3578c5e0b5d1aefb75921c1"></a><br></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="mw__cipher_8h.html#ca54b3578379f8f7e8a3497643d9ff52">mwCipherInstance_offered</a> (struct <a class="el" href="structmwCipherInstance.html">mwCipherInstance</a> *ci, struct <a class="el" href="structmwEncryptItem.html">mwEncryptItem</a> *item)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Indicates a cipher has been offered to our channel. <a href="#ca54b3578379f8f7e8a3497643d9ff52"></a><br></td></tr> <tr><td colspan="2"><div class="groupHeader"></div></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="mw__cipher_8h.html#1ea4d9e89089fcde39ff462a5404e704">mwDecrypt</a> (const guchar *key, gsize keylen, guchar *iv, struct <a class="el" href="structmwOpaque.html">mwOpaque</a> *in, struct <a class="el" href="structmwOpaque.html">mwOpaque</a> *out)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Decrypt data using an expanded form of the given key. <a href="#1ea4d9e89089fcde39ff462a5404e704"></a><br></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="mw__cipher_8h.html#cb001137b268c78457e75185fdbbd9c9">mwDecryptExpanded</a> (const int *ekey, guchar *iv, struct <a class="el" href="structmwOpaque.html">mwOpaque</a> *in, struct <a class="el" href="structmwOpaque.html">mwOpaque</a> *out)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Decrypt data using an already expanded key. <a href="#cb001137b268c78457e75185fdbbd9c9"></a><br></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="mw__cipher_8h.html#4ff69a2373683cbecb91039dd1a46fa1">mwEncrypt</a> (const guchar *key, gsize keylen, guchar *iv, struct <a class="el" href="structmwOpaque.html">mwOpaque</a> *in, struct <a class="el" href="structmwOpaque.html">mwOpaque</a> *out)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Encrypt data using an expanded form of the given key. <a href="#4ff69a2373683cbecb91039dd1a46fa1"></a><br></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="mw__cipher_8h.html#934b08511236b5e8cf80c22acc937f51">mwEncryptExpanded</a> (const int *ekey, guchar *iv, struct <a class="el" href="structmwOpaque.html">mwOpaque</a> *in, struct <a class="el" href="structmwOpaque.html">mwOpaque</a> *out)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Encrypt data using an already-expanded key. <a href="#934b08511236b5e8cf80c22acc937f51"></a><br></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="mw__cipher_8h.html#4164e217eb715d505ee0bb1d75d983f1">mwIV_init</a> (guchar *iv)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Setup an Initialization Vector. <a href="#4164e217eb715d505ee0bb1d75d983f1"></a><br></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="mw__cipher_8h.html#1fb65f55e064360183cee4bbe2a93c19">mwKeyExpand</a> (int *ekey, const guchar *key, gsize keylen)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Expand a variable-length key into a 128-byte key (represented as an an array of 64 ints). <a href="#1fb65f55e064360183cee4bbe2a93c19"></a><br></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="mw__cipher_8h.html#4606773752ee1a6ff4a44c217a39e348">mwKeyRandom</a> (guchar *key, gsize keylen)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">generate some pseudo-random bytes <a href="#4606773752ee1a6ff4a44c217a39e348"></a><br></td></tr> <tr><td colspan="2"><div class="groupHeader"></div></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="mw__cipher_8h.html#796525794edf3887ab94eefb748bcf91">mwMpi_calculateDHShared</a> (struct <a class="el" href="structmwMpi.html">mwMpi</a> *shared_key, struct <a class="el" href="structmwMpi.html">mwMpi</a> *remote_key, struct <a class="el" href="structmwMpi.html">mwMpi</a> *private_key)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">sets the shared key value based on the remote and private keys, using the Sametime Prime and Base <a href="#796525794edf3887ab94eefb748bcf91"></a><br></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="mw__cipher_8h.html#389f3d2f174e66810a92ee93d5035967">mwMpi_export</a> (struct <a class="el" href="structmwMpi.html">mwMpi</a> *i, struct <a class="el" href="structmwOpaque.html">mwOpaque</a> *o)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Export a value into an opaque. <a href="#389f3d2f174e66810a92ee93d5035967"></a><br></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="mw__cipher_8h.html#674f737698d67c52dce06f54151909ef">mwMpi_free</a> (struct <a class="el" href="structmwMpi.html">mwMpi</a> *i)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">destroy an mpi value <a href="#674f737698d67c52dce06f54151909ef"></a><br></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="mw__cipher_8h.html#4dcaf6196943a70f723c828cab35f0c1">mwMpi_import</a> (struct <a class="el" href="structmwMpi.html">mwMpi</a> *i, struct <a class="el" href="structmwOpaque.html">mwOpaque</a> *o)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Import a value from an opaque. <a href="#4dcaf6196943a70f723c828cab35f0c1"></a><br></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">struct <a class="el" href="structmwMpi.html">mwMpi</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="mw__cipher_8h.html#b473b17d569e7566081cad121f75f23e">mwMpi_new</a> ()</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">prepare a new mpi value <a href="#b473b17d569e7566081cad121f75f23e"></a><br></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="mw__cipher_8h.html#95e8808f20ea58c66014a052375c5fe4">mwMpi_randDHKeypair</a> (struct <a class="el" href="structmwMpi.html">mwMpi</a> *private_key, struct <a class="el" href="structmwMpi.html">mwMpi</a> *public_key)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">sets private to a randomly generated value, and calculates public using the Sametime Prime and Base <a href="#95e8808f20ea58c66014a052375c5fe4"></a><br></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="mw__cipher_8h.html#dd1ffe92fc1c256fa767a34d58433dd1">mwMpi_setDHBase</a> (struct <a class="el" href="structmwMpi.html">mwMpi</a> *i)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">set a big integer to the Sametime Base value <a href="#dd1ffe92fc1c256fa767a34d58433dd1"></a><br></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="mw__cipher_8h.html#892796c968b68d71e67b678a87504d20">mwMpi_setDHPrime</a> (struct <a class="el" href="structmwMpi.html">mwMpi</a> *i)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">set a big integer to the Sametime Prime value <a href="#892796c968b68d71e67b678a87504d20"></a><br></td></tr> </table> <hr><h2>Typedef Documentation</h2> <a class="anchor" name="866fc29431a5cd1c3c49e9b1e8b09800"></a><!-- doxytag: member="mw_cipher.h::mwCipherInstantiator" ref="866fc29431a5cd1c3c49e9b1e8b09800" args=")(struct mwCipher *cipher, struct mwChannel *chan)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">typedef struct <a class="el" href="structmwCipherInstance.html">mwCipherInstance</a>*(* <a class="el" href="mw__cipher_8h.html#866fc29431a5cd1c3c49e9b1e8b09800">mwCipherInstantiator</a>)(struct <a class="el" href="structmwCipher.html">mwCipher</a> *cipher, struct <a class="el" href="structmwChannel.html">mwChannel</a> *chan) </td> </tr> </table> </div> <div class="memdoc"> <p> Obtain an instance of a given cipher, which can be used for the processing of a single channel. <p> </div> </div><p> <a class="anchor" name="130909e22689a8b83c70572af9850bef"></a><!-- doxytag: member="mw_cipher.h::mwCipherProcessor" ref="130909e22689a8b83c70572af9850bef" args=")(struct mwCipherInstance *ci, struct mwOpaque *data)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">typedef int(* <a class="el" href="mw__cipher_8h.html#130909e22689a8b83c70572af9850bef">mwCipherProcessor</a>)(struct <a class="el" href="structmwCipherInstance.html">mwCipherInstance</a> *ci, struct <a class="el" href="structmwOpaque.html">mwOpaque</a> *data) </td> </tr> </table> </div> <div class="memdoc"> <p> Process (encrypt or decrypt, depending) the given data. <p> 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 </div> </div><p> <hr><h2>Enumeration Type Documentation</h2> <a class="anchor" name="3d1e1cc055146237e1b8e638c5005a70"></a><!-- doxytag: member="mw_cipher.h::mwCipherType" ref="3d1e1cc055146237e1b8e638c5005a70" args="" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">enum <a class="el" href="mw__cipher_8h.html#3d1e1cc055146237e1b8e638c5005a70">mwCipherType</a> </td> </tr> </table> </div> <div class="memdoc"> <p> Common cipher types. <p> <dl compact><dt><b>Enumerator: </b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"><em><a class="anchor" name="3d1e1cc055146237e1b8e638c5005a70b67b342eb4ad1f28624235e7d2b1509b"></a><!-- doxytag: member="mwCipher_RC2_40" ref="3d1e1cc055146237e1b8e638c5005a70b67b342eb4ad1f28624235e7d2b1509b" args="" -->mwCipher_RC2_40</em> </td><td> </td></tr> <tr><td valign="top"><em><a class="anchor" name="3d1e1cc055146237e1b8e638c5005a70b9732b499466e669cf5f8de3e09770f8"></a><!-- doxytag: member="mwCipher_RC2_128" ref="3d1e1cc055146237e1b8e638c5005a70b9732b499466e669cf5f8de3e09770f8" args="" -->mwCipher_RC2_128</em> </td><td> </td></tr> </table> </dl> </div> </div><p> <hr><h2>Function Documentation</h2> <a class="anchor" name="4d6a169e214b8e6b60e6fb2e7c5c51bd"></a><!-- doxytag: member="mw_cipher.h::mwCipher_free" ref="4d6a169e214b8e6b60e6fb2e7c5c51bd" args="(struct mwCipher *cipher)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void mwCipher_free </td> <td>(</td> <td class="paramtype">struct <a class="el" href="structmwCipher.html">mwCipher</a> * </td> <td class="paramname"> <em>cipher</em> </td> <td> ) </td> <td width="100%"></td> </tr> </table> </div> <div class="memdoc"> <p> destroy a cipher <p> </div> </div><p> <a class="anchor" name="2fe3c59366be8e33dea3ea8089f17309"></a><!-- doxytag: member="mw_cipher.h::mwCipher_getDesc" ref="2fe3c59366be8e33dea3ea8089f17309" args="(struct mwCipher *cipher)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">const char* mwCipher_getDesc </td> <td>(</td> <td class="paramtype">struct <a class="el" href="structmwCipher.html">mwCipher</a> * </td> <td class="paramname"> <em>cipher</em> </td> <td> ) </td> <td width="100%"></td> </tr> </table> </div> <div class="memdoc"> <p> </div> </div><p> <a class="anchor" name="57a44521a627c04f67fd26b6112c232e"></a><!-- doxytag: member="mw_cipher.h::mwCipher_getName" ref="57a44521a627c04f67fd26b6112c232e" args="(struct mwCipher *cipher)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">const char* mwCipher_getName </td> <td>(</td> <td class="paramtype">struct <a class="el" href="structmwCipher.html">mwCipher</a> * </td> <td class="paramname"> <em>cipher</em> </td> <td> ) </td> <td width="100%"></td> </tr> </table> </div> <div class="memdoc"> <p> </div> </div><p> <a class="anchor" name="ca7df61aefa4a1eda2776c9d11d66c04"></a><!-- doxytag: member="mw_cipher.h::mwCipher_getSession" ref="ca7df61aefa4a1eda2776c9d11d66c04" args="(struct mwCipher *cipher)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">struct <a class="el" href="structmwSession.html">mwSession</a>* mwCipher_getSession </td> <td>(</td> <td class="paramtype">struct <a class="el" href="structmwCipher.html">mwCipher</a> * </td> <td class="paramname"> <em>cipher</em> </td> <td> ) </td> <td width="100%"><code> [read]</code></td> </tr> </table> </div> <div class="memdoc"> <p> </div> </div><p> <a class="anchor" name="9c78471afd459b09ddf5e544d9a07f56"></a><!-- doxytag: member="mw_cipher.h::mwCipher_getType" ref="9c78471afd459b09ddf5e544d9a07f56" args="(struct mwCipher *cipher)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">guint16 mwCipher_getType </td> <td>(</td> <td class="paramtype">struct <a class="el" href="structmwCipher.html">mwCipher</a> * </td> <td class="paramname"> <em>cipher</em> </td> <td> ) </td> <td width="100%"></td> </tr> </table> </div> <div class="memdoc"> <p> </div> </div><p> <a class="anchor" name="8994381485d3dd43b72933a6043c74cd"></a><!-- doxytag: member="mw_cipher.h::mwCipher_new_RC2_128" ref="8994381485d3dd43b72933a6043c74cd" args="(struct mwSession *s)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">struct <a class="el" href="structmwCipher.html">mwCipher</a>* mwCipher_new_RC2_128 </td> <td>(</td> <td class="paramtype">struct <a class="el" href="structmwSession.html">mwSession</a> * </td> <td class="paramname"> <em>s</em> </td> <td> ) </td> <td width="100%"><code> [read]</code></td> </tr> </table> </div> <div class="memdoc"> <p> </div> </div><p> <a class="anchor" name="42e8c2c577767f23154b2c1f09fd15e0"></a><!-- doxytag: member="mw_cipher.h::mwCipher_new_RC2_40" ref="42e8c2c577767f23154b2c1f09fd15e0" args="(struct mwSession *s)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">struct <a class="el" href="structmwCipher.html">mwCipher</a>* mwCipher_new_RC2_40 </td> <td>(</td> <td class="paramtype">struct <a class="el" href="structmwSession.html">mwSession</a> * </td> <td class="paramname"> <em>s</em> </td> <td> ) </td> <td width="100%"><code> [read]</code></td> </tr> </table> </div> <div class="memdoc"> <p> </div> </div><p> <a class="anchor" name="0d03f56fb313094c1129a4e8086cfce3"></a><!-- doxytag: member="mw_cipher.h::mwCipher_newInstance" ref="0d03f56fb313094c1129a4e8086cfce3" args="(struct mwCipher *cipher, struct mwChannel *channel)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">struct <a class="el" href="structmwCipherInstance.html">mwCipherInstance</a>* mwCipher_newInstance </td> <td>(</td> <td class="paramtype">struct <a class="el" href="structmwCipher.html">mwCipher</a> * </td> <td class="paramname"> <em>cipher</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">struct <a class="el" href="structmwChannel.html">mwChannel</a> * </td> <td class="paramname"> <em>channel</em></td><td> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td><td width="100%"><code> [read]</code></td> </tr> </table> </div> <div class="memdoc"> <p> </div> </div><p> <a class="anchor" name="68d12ba00aadc58033d326d3393c9a58"></a><!-- doxytag: member="mw_cipher.h::mwCipherInstance_accept" ref="68d12ba00aadc58033d326d3393c9a58" args="(struct mwCipherInstance *ci)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">struct <a class="el" href="structmwEncryptItem.html">mwEncryptItem</a>* mwCipherInstance_accept </td> <td>(</td> <td class="paramtype">struct <a class="el" href="structmwCipherInstance.html">mwCipherInstance</a> * </td> <td class="paramname"> <em>ci</em> </td> <td> ) </td> <td width="100%"><code> [read]</code></td> </tr> </table> </div> <div class="memdoc"> <p> Accept a cipher offered to our channel. <p> </div> </div><p> <a class="anchor" name="12cef66d5336ee880cdd812c2dbe7ff3"></a><!-- doxytag: member="mw_cipher.h::mwCipherInstance_accepted" ref="12cef66d5336ee880cdd812c2dbe7ff3" args="(struct mwCipherInstance *ci, struct mwEncryptItem *item)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void mwCipherInstance_accepted </td> <td>(</td> <td class="paramtype">struct <a class="el" href="structmwCipherInstance.html">mwCipherInstance</a> * </td> <td class="paramname"> <em>ci</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">struct <a class="el" href="structmwEncryptItem.html">mwEncryptItem</a> * </td> <td class="paramname"> <em>item</em></td><td> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td><td width="100%"></td> </tr> </table> </div> <div class="memdoc"> <p> Indicates an offered cipher has been accepted. <p> </div> </div><p> <a class="anchor" name="20e64408792db9e2845f8a7865eefe65"></a><!-- doxytag: member="mw_cipher.h::mwCipherInstance_decrypt" ref="20e64408792db9e2845f8a7865eefe65" args="(struct mwCipherInstance *ci, struct mwOpaque *data)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">int mwCipherInstance_decrypt </td> <td>(</td> <td class="paramtype">struct <a class="el" href="structmwCipherInstance.html">mwCipherInstance</a> * </td> <td class="paramname"> <em>ci</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">struct <a class="el" href="structmwOpaque.html">mwOpaque</a> * </td> <td class="paramname"> <em>data</em></td><td> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td><td width="100%"></td> </tr> </table> </div> <div class="memdoc"> <p> decrypt data <p> </div> </div><p> <a class="anchor" name="fbdb09cd3991970596b9e7ad1865a4b5"></a><!-- doxytag: member="mw_cipher.h::mwCipherInstance_encrypt" ref="fbdb09cd3991970596b9e7ad1865a4b5" args="(struct mwCipherInstance *ci, struct mwOpaque *data)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">int mwCipherInstance_encrypt </td> <td>(</td> <td class="paramtype">struct <a class="el" href="structmwCipherInstance.html">mwCipherInstance</a> * </td> <td class="paramname"> <em>ci</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">struct <a class="el" href="structmwOpaque.html">mwOpaque</a> * </td> <td class="paramname"> <em>data</em></td><td> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td><td width="100%"></td> </tr> </table> </div> <div class="memdoc"> <p> encrypt data <p> </div> </div><p> <a class="anchor" name="302cdec8d916252920962bc7aefe39a4"></a><!-- doxytag: member="mw_cipher.h::mwCipherInstance_free" ref="302cdec8d916252920962bc7aefe39a4" args="(struct mwCipherInstance *ci)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void mwCipherInstance_free </td> <td>(</td> <td class="paramtype">struct <a class="el" href="structmwCipherInstance.html">mwCipherInstance</a> * </td> <td class="paramname"> <em>ci</em> </td> <td> ) </td> <td width="100%"></td> </tr> </table> </div> <div class="memdoc"> <p> destroy a cipher instance <p> </div> </div><p> <a class="anchor" name="d1a85931da52a2d26072f92e046e5027"></a><!-- doxytag: member="mw_cipher.h::mwCipherInstance_getChannel" ref="d1a85931da52a2d26072f92e046e5027" args="(struct mwCipherInstance *ci)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">struct <a class="el" href="structmwChannel.html">mwChannel</a>* mwCipherInstance_getChannel </td> <td>(</td> <td class="paramtype">struct <a class="el" href="structmwCipherInstance.html">mwCipherInstance</a> * </td> <td class="paramname"> <em>ci</em> </td> <td> ) </td> <td width="100%"><code> [read]</code></td> </tr> </table> </div> <div class="memdoc"> <p> reference the channel a cipher instance is attached to <p> </div> </div><p> <a class="anchor" name="014d426ae329bf07cc3c49d46d7482b4"></a><!-- doxytag: member="mw_cipher.h::mwCipherInstance_getCipher" ref="014d426ae329bf07cc3c49d46d7482b4" args="(struct mwCipherInstance *ci)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">struct <a class="el" href="structmwCipher.html">mwCipher</a>* mwCipherInstance_getCipher </td> <td>(</td> <td class="paramtype">struct <a class="el" href="structmwCipherInstance.html">mwCipherInstance</a> * </td> <td class="paramname"> <em>ci</em> </td> <td> ) </td> <td width="100%"><code> [read]</code></td> </tr> </table> </div> <div class="memdoc"> <p> reference the parent cipher of an instance <p> </div> </div><p> <a class="anchor" name="c9b0176eb3578c5e0b5d1aefb75921c1"></a><!-- doxytag: member="mw_cipher.h::mwCipherInstance_offer" ref="c9b0176eb3578c5e0b5d1aefb75921c1" args="(struct mwCipherInstance *ci)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">struct <a class="el" href="structmwEncryptItem.html">mwEncryptItem</a>* mwCipherInstance_offer </td> <td>(</td> <td class="paramtype">struct <a class="el" href="structmwCipherInstance.html">mwCipherInstance</a> * </td> <td class="paramname"> <em>ci</em> </td> <td> ) </td> <td width="100%"><code> [read]</code></td> </tr> </table> </div> <div class="memdoc"> <p> Offer a cipher. <p> </div> </div><p> <a class="anchor" name="ca54b3578379f8f7e8a3497643d9ff52"></a><!-- doxytag: member="mw_cipher.h::mwCipherInstance_offered" ref="ca54b3578379f8f7e8a3497643d9ff52" args="(struct mwCipherInstance *ci, struct mwEncryptItem *item)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void mwCipherInstance_offered </td> <td>(</td> <td class="paramtype">struct <a class="el" href="structmwCipherInstance.html">mwCipherInstance</a> * </td> <td class="paramname"> <em>ci</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">struct <a class="el" href="structmwEncryptItem.html">mwEncryptItem</a> * </td> <td class="paramname"> <em>item</em></td><td> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td><td width="100%"></td> </tr> </table> </div> <div class="memdoc"> <p> Indicates a cipher has been offered to our channel. <p> </div> </div><p> <a class="anchor" name="1ea4d9e89089fcde39ff462a5404e704"></a><!-- doxytag: member="mw_cipher.h::mwDecrypt" ref="1ea4d9e89089fcde39ff462a5404e704" args="(const guchar *key, gsize keylen, guchar *iv, struct mwOpaque *in, struct mwOpaque *out)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void mwDecrypt </td> <td>(</td> <td class="paramtype">const guchar * </td> <td class="paramname"> <em>key</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">gsize </td> <td class="paramname"> <em>keylen</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">guchar * </td> <td class="paramname"> <em>iv</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">struct <a class="el" href="structmwOpaque.html">mwOpaque</a> * </td> <td class="paramname"> <em>in</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">struct <a class="el" href="structmwOpaque.html">mwOpaque</a> * </td> <td class="paramname"> <em>out</em></td><td> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td><td width="100%"></td> </tr> </table> </div> <div class="memdoc"> <p> Decrypt data using an expanded form of the given key. <p> </div> </div><p> <a class="anchor" name="cb001137b268c78457e75185fdbbd9c9"></a><!-- doxytag: member="mw_cipher.h::mwDecryptExpanded" ref="cb001137b268c78457e75185fdbbd9c9" args="(const int *ekey, guchar *iv, struct mwOpaque *in, struct mwOpaque *out)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void mwDecryptExpanded </td> <td>(</td> <td class="paramtype">const int * </td> <td class="paramname"> <em>ekey</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">guchar * </td> <td class="paramname"> <em>iv</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">struct <a class="el" href="structmwOpaque.html">mwOpaque</a> * </td> <td class="paramname"> <em>in</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">struct <a class="el" href="structmwOpaque.html">mwOpaque</a> * </td> <td class="paramname"> <em>out</em></td><td> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td><td width="100%"></td> </tr> </table> </div> <div class="memdoc"> <p> Decrypt data using an already expanded key. <p> </div> </div><p> <a class="anchor" name="4ff69a2373683cbecb91039dd1a46fa1"></a><!-- doxytag: member="mw_cipher.h::mwEncrypt" ref="4ff69a2373683cbecb91039dd1a46fa1" args="(const guchar *key, gsize keylen, guchar *iv, struct mwOpaque *in, struct mwOpaque *out)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void mwEncrypt </td> <td>(</td> <td class="paramtype">const guchar * </td> <td class="paramname"> <em>key</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">gsize </td> <td class="paramname"> <em>keylen</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">guchar * </td> <td class="paramname"> <em>iv</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">struct <a class="el" href="structmwOpaque.html">mwOpaque</a> * </td> <td class="paramname"> <em>in</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">struct <a class="el" href="structmwOpaque.html">mwOpaque</a> * </td> <td class="paramname"> <em>out</em></td><td> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td><td width="100%"></td> </tr> </table> </div> <div class="memdoc"> <p> Encrypt data using an expanded form of the given key. <p> </div> </div><p> <a class="anchor" name="934b08511236b5e8cf80c22acc937f51"></a><!-- doxytag: member="mw_cipher.h::mwEncryptExpanded" ref="934b08511236b5e8cf80c22acc937f51" args="(const int *ekey, guchar *iv, struct mwOpaque *in, struct mwOpaque *out)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void mwEncryptExpanded </td> <td>(</td> <td class="paramtype">const int * </td> <td class="paramname"> <em>ekey</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">guchar * </td> <td class="paramname"> <em>iv</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">struct <a class="el" href="structmwOpaque.html">mwOpaque</a> * </td> <td class="paramname"> <em>in</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">struct <a class="el" href="structmwOpaque.html">mwOpaque</a> * </td> <td class="paramname"> <em>out</em></td><td> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td><td width="100%"></td> </tr> </table> </div> <div class="memdoc"> <p> Encrypt data using an already-expanded key. <p> </div> </div><p> <a class="anchor" name="4164e217eb715d505ee0bb1d75d983f1"></a><!-- doxytag: member="mw_cipher.h::mwIV_init" ref="4164e217eb715d505ee0bb1d75d983f1" args="(guchar *iv)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void mwIV_init </td> <td>(</td> <td class="paramtype">guchar * </td> <td class="paramname"> <em>iv</em> </td> <td> ) </td> <td width="100%"></td> </tr> </table> </div> <div class="memdoc"> <p> Setup an Initialization Vector. <p> IV must be at least 8 bytes </div> </div><p> <a class="anchor" name="1fb65f55e064360183cee4bbe2a93c19"></a><!-- doxytag: member="mw_cipher.h::mwKeyExpand" ref="1fb65f55e064360183cee4bbe2a93c19" args="(int *ekey, const guchar *key, gsize keylen)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void mwKeyExpand </td> <td>(</td> <td class="paramtype">int * </td> <td class="paramname"> <em>ekey</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const guchar * </td> <td class="paramname"> <em>key</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">gsize </td> <td class="paramname"> <em>keylen</em></td><td> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td><td width="100%"></td> </tr> </table> </div> <div class="memdoc"> <p> Expand a variable-length key into a 128-byte key (represented as an an array of 64 ints). <p> </div> </div><p> <a class="anchor" name="4606773752ee1a6ff4a44c217a39e348"></a><!-- doxytag: member="mw_cipher.h::mwKeyRandom" ref="4606773752ee1a6ff4a44c217a39e348" args="(guchar *key, gsize keylen)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void mwKeyRandom </td> <td>(</td> <td class="paramtype">guchar * </td> <td class="paramname"> <em>key</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">gsize </td> <td class="paramname"> <em>keylen</em></td><td> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td><td width="100%"></td> </tr> </table> </div> <div class="memdoc"> <p> generate some pseudo-random bytes <p> <h2><a class="anchor" name="General"> Cipher Functions</a></h2> These functions are reused where encryption is necessary outside of a channel (eg. session authentication)<dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>keylen</em> </td><td>count of bytes to write into key </td></tr> <tr><td valign="top"></td><td valign="top"><em>key</em> </td><td>buffer to write keys into </td></tr> </table> </dl> </div> </div><p> <a class="anchor" name="796525794edf3887ab94eefb748bcf91"></a><!-- doxytag: member="mw_cipher.h::mwMpi_calculateDHShared" ref="796525794edf3887ab94eefb748bcf91" args="(struct mwMpi *shared_key, struct mwMpi *remote_key, struct mwMpi *private_key)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void mwMpi_calculateDHShared </td> <td>(</td> <td class="paramtype">struct <a class="el" href="structmwMpi.html">mwMpi</a> * </td> <td class="paramname"> <em>shared_key</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">struct <a class="el" href="structmwMpi.html">mwMpi</a> * </td> <td class="paramname"> <em>remote_key</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">struct <a class="el" href="structmwMpi.html">mwMpi</a> * </td> <td class="paramname"> <em>private_key</em></td><td> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td><td width="100%"></td> </tr> </table> </div> <div class="memdoc"> <p> sets the shared key value based on the remote and private keys, using the Sametime Prime and Base <p> </div> </div><p> <a class="anchor" name="389f3d2f174e66810a92ee93d5035967"></a><!-- doxytag: member="mw_cipher.h::mwMpi_export" ref="389f3d2f174e66810a92ee93d5035967" args="(struct mwMpi *i, struct mwOpaque *o)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void mwMpi_export </td> <td>(</td> <td class="paramtype">struct <a class="el" href="structmwMpi.html">mwMpi</a> * </td> <td class="paramname"> <em>i</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">struct <a class="el" href="structmwOpaque.html">mwOpaque</a> * </td> <td class="paramname"> <em>o</em></td><td> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td><td width="100%"></td> </tr> </table> </div> <div class="memdoc"> <p> Export a value into an opaque. <p> </div> </div><p> <a class="anchor" name="674f737698d67c52dce06f54151909ef"></a><!-- doxytag: member="mw_cipher.h::mwMpi_free" ref="674f737698d67c52dce06f54151909ef" args="(struct mwMpi *i)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void mwMpi_free </td> <td>(</td> <td class="paramtype">struct <a class="el" href="structmwMpi.html">mwMpi</a> * </td> <td class="paramname"> <em>i</em> </td> <td> ) </td> <td width="100%"></td> </tr> </table> </div> <div class="memdoc"> <p> destroy an mpi value <p> </div> </div><p> <a class="anchor" name="4dcaf6196943a70f723c828cab35f0c1"></a><!-- doxytag: member="mw_cipher.h::mwMpi_import" ref="4dcaf6196943a70f723c828cab35f0c1" args="(struct mwMpi *i, struct mwOpaque *o)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void mwMpi_import </td> <td>(</td> <td class="paramtype">struct <a class="el" href="structmwMpi.html">mwMpi</a> * </td> <td class="paramname"> <em>i</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">struct <a class="el" href="structmwOpaque.html">mwOpaque</a> * </td> <td class="paramname"> <em>o</em></td><td> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td><td width="100%"></td> </tr> </table> </div> <div class="memdoc"> <p> Import a value from an opaque. <p> </div> </div><p> <a class="anchor" name="b473b17d569e7566081cad121f75f23e"></a><!-- doxytag: member="mw_cipher.h::mwMpi_new" ref="b473b17d569e7566081cad121f75f23e" args="()" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">struct <a class="el" href="structmwMpi.html">mwMpi</a>* mwMpi_new </td> <td>(</td> <td class="paramname"> </td> <td> ) </td> <td width="100%"><code> [read]</code></td> </tr> </table> </div> <div class="memdoc"> <p> prepare a new mpi value <p> </div> </div><p> <a class="anchor" name="95e8808f20ea58c66014a052375c5fe4"></a><!-- doxytag: member="mw_cipher.h::mwMpi_randDHKeypair" ref="95e8808f20ea58c66014a052375c5fe4" args="(struct mwMpi *private_key, struct mwMpi *public_key)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void mwMpi_randDHKeypair </td> <td>(</td> <td class="paramtype">struct <a class="el" href="structmwMpi.html">mwMpi</a> * </td> <td class="paramname"> <em>private_key</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">struct <a class="el" href="structmwMpi.html">mwMpi</a> * </td> <td class="paramname"> <em>public_key</em></td><td> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td><td width="100%"></td> </tr> </table> </div> <div class="memdoc"> <p> sets private to a randomly generated value, and calculates public using the Sametime Prime and Base <p> </div> </div><p> <a class="anchor" name="dd1ffe92fc1c256fa767a34d58433dd1"></a><!-- doxytag: member="mw_cipher.h::mwMpi_setDHBase" ref="dd1ffe92fc1c256fa767a34d58433dd1" args="(struct mwMpi *i)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void mwMpi_setDHBase </td> <td>(</td> <td class="paramtype">struct <a class="el" href="structmwMpi.html">mwMpi</a> * </td> <td class="paramname"> <em>i</em> </td> <td> ) </td> <td width="100%"></td> </tr> </table> </div> <div class="memdoc"> <p> set a big integer to the Sametime Base value <p> </div> </div><p> <a class="anchor" name="892796c968b68d71e67b678a87504d20"></a><!-- doxytag: member="mw_cipher.h::mwMpi_setDHPrime" ref="892796c968b68d71e67b678a87504d20" args="(struct mwMpi *i)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void mwMpi_setDHPrime </td> <td>(</td> <td class="paramtype">struct <a class="el" href="structmwMpi.html">mwMpi</a> * </td> <td class="paramname"> <em>i</em> </td> <td> ) </td> <td width="100%"></td> </tr> </table> </div> <div class="memdoc"> <p> set a big integer to the Sametime Prime value <p> </div> </div><p> <hr size="1"><address style="text-align: right;"><small>Generated on Wed Dec 19 09:10:34 2007 for meanwhile by <a href="http://www.doxygen.org/index.html"> <img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.4 </small></address> </body> </html>