\doxysection{mw\+\_\+cipher.\+h File Reference}
\hypertarget{mw__cipher_8h}{}\label{mw__cipher_8h}\index{mw\_cipher.h@{mw\_cipher.h}}
{\ttfamily \#include $<$glib.\+h$>$}\newline
{\ttfamily \#include "{}mw\+\_\+common.\+h"{}}\newline
\doxysubsubsection*{Data Structures}
\begin{DoxyCompactItemize}
\item 
struct \mbox{\hyperlink{structmwCipher}{mw\+Cipher}}
\begin{DoxyCompactList}\small\item\em A cipher. \end{DoxyCompactList}\item 
struct \mbox{\hyperlink{structmwCipherInstance}{mw\+Cipher\+Instance}}
\begin{DoxyCompactList}\small\item\em An instance of a cipher. \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsubsection*{Typedefs}
\begin{DoxyCompactItemize}
\item 
typedef struct \mbox{\hyperlink{structmwCipherInstance}{mw\+Cipher\+Instance}} \texorpdfstring{$\ast$}{*}(\texorpdfstring{$\ast$}{*} \mbox{\hyperlink{mw__cipher_8h_aca656cce8d283fccb930a28473add823}{mw\+Cipher\+Instantiator}}) (struct \mbox{\hyperlink{structmwCipher}{mw\+Cipher}} \texorpdfstring{$\ast$}{*}cipher, struct \mbox{\hyperlink{structmwChannel}{mw\+Channel}} \texorpdfstring{$\ast$}{*}chan)
\begin{DoxyCompactList}\small\item\em Obtain an instance of a given cipher, which can be used for the processing of a single channel. \end{DoxyCompactList}\item 
typedef int(\texorpdfstring{$\ast$}{*} \mbox{\hyperlink{mw__cipher_8h_a708cff122947ff2cc0bf69a4f2acc3a5}{mw\+Cipher\+Processor}}) (struct \mbox{\hyperlink{structmwCipherInstance}{mw\+Cipher\+Instance}} \texorpdfstring{$\ast$}{*}ci, struct \mbox{\hyperlink{structmwOpaque}{mw\+Opaque}} \texorpdfstring{$\ast$}{*}data)
\begin{DoxyCompactList}\small\item\em Process (encrypt or decrypt, depending) the given data. \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsubsection*{Enumerations}
\begin{DoxyCompactItemize}
\item 
enum \mbox{\hyperlink{mw__cipher_8h_a3d1e1cc055146237e1b8e638c5005a70}{mw\+Cipher\+Type}} \{ \newline
\mbox{\hyperlink{mw__cipher_8h_a3d1e1cc055146237e1b8e638c5005a70ab67b342eb4ad1f28624235e7d2b1509b}{mw\+Cipher\+\_\+\+RC2\+\_\+40}} = 0x0000
, \newline
\mbox{\hyperlink{mw__cipher_8h_a3d1e1cc055146237e1b8e638c5005a70ab9732b499466e669cf5f8de3e09770f8}{mw\+Cipher\+\_\+\+RC2\+\_\+128}} = 0x0001
 \}
\begin{DoxyCompactList}\small\item\em Common cipher types. \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsubsection*{Functions}
\begin{DoxyCompactItemize}
\item 
void \mbox{\hyperlink{mw__cipher_8h_a4d6a169e214b8e6b60e6fb2e7c5c51bd}{mw\+Cipher\+\_\+free}} (struct \mbox{\hyperlink{structmwCipher}{mw\+Cipher}} \texorpdfstring{$\ast$}{*}cipher)
\begin{DoxyCompactList}\small\item\em destroy a cipher \end{DoxyCompactList}\item 
const char \texorpdfstring{$\ast$}{*} \mbox{\hyperlink{mw__cipher_8h_a5e33bb53130d64d68f9444d731541d71}{mw\+Cipher\+\_\+get\+Desc}} (struct \mbox{\hyperlink{structmwCipher}{mw\+Cipher}} \texorpdfstring{$\ast$}{*}cipher)
\item 
const char \texorpdfstring{$\ast$}{*} \mbox{\hyperlink{mw__cipher_8h_a136e3e79747b130236a36659dea0477d}{mw\+Cipher\+\_\+get\+Name}} (struct \mbox{\hyperlink{structmwCipher}{mw\+Cipher}} \texorpdfstring{$\ast$}{*}cipher)
\item 
struct \mbox{\hyperlink{structmwSession}{mw\+Session}} \texorpdfstring{$\ast$}{*} \mbox{\hyperlink{mw__cipher_8h_ac06492ad8144aecfc0b70b97f29e4a13}{mw\+Cipher\+\_\+get\+Session}} (struct \mbox{\hyperlink{structmwCipher}{mw\+Cipher}} \texorpdfstring{$\ast$}{*}cipher)
\item 
guint16 \mbox{\hyperlink{mw__cipher_8h_a9c78471afd459b09ddf5e544d9a07f56}{mw\+Cipher\+\_\+get\+Type}} (struct \mbox{\hyperlink{structmwCipher}{mw\+Cipher}} \texorpdfstring{$\ast$}{*}cipher)
\item 
struct \mbox{\hyperlink{structmwCipher}{mw\+Cipher}} \texorpdfstring{$\ast$}{*} \mbox{\hyperlink{mw__cipher_8h_a9be6b70917384e9fd2f6c647f2a6d3f0}{mw\+Cipher\+\_\+new\+\_\+\+RC2\+\_\+128}} (struct \mbox{\hyperlink{structmwSession}{mw\+Session}} \texorpdfstring{$\ast$}{*}s)
\item 
struct \mbox{\hyperlink{structmwCipher}{mw\+Cipher}} \texorpdfstring{$\ast$}{*} \mbox{\hyperlink{mw__cipher_8h_a406ccc817f1f532667f1d9d6a4a54158}{mw\+Cipher\+\_\+new\+\_\+\+RC2\+\_\+40}} (struct \mbox{\hyperlink{structmwSession}{mw\+Session}} \texorpdfstring{$\ast$}{*}s)
\item 
struct \mbox{\hyperlink{structmwCipherInstance}{mw\+Cipher\+Instance}} \texorpdfstring{$\ast$}{*} \mbox{\hyperlink{mw__cipher_8h_ad9e4927b43ac9aa0a8d9209d4fbfcf1b}{mw\+Cipher\+\_\+new\+Instance}} (struct \mbox{\hyperlink{structmwCipher}{mw\+Cipher}} \texorpdfstring{$\ast$}{*}cipher, struct \mbox{\hyperlink{structmwChannel}{mw\+Channel}} \texorpdfstring{$\ast$}{*}channel)
\item 
struct \mbox{\hyperlink{structmwEncryptItem}{mw\+Encrypt\+Item}} \texorpdfstring{$\ast$}{*} \mbox{\hyperlink{mw__cipher_8h_a03c39a5307320a606c23753bcb992975}{mw\+Cipher\+Instance\+\_\+accept}} (struct \mbox{\hyperlink{structmwCipherInstance}{mw\+Cipher\+Instance}} \texorpdfstring{$\ast$}{*}ci)
\begin{DoxyCompactList}\small\item\em Accept a cipher offered to our channel. \end{DoxyCompactList}\item 
void \mbox{\hyperlink{mw__cipher_8h_a12cef66d5336ee880cdd812c2dbe7ff3}{mw\+Cipher\+Instance\+\_\+accepted}} (struct \mbox{\hyperlink{structmwCipherInstance}{mw\+Cipher\+Instance}} \texorpdfstring{$\ast$}{*}ci, struct \mbox{\hyperlink{structmwEncryptItem}{mw\+Encrypt\+Item}} \texorpdfstring{$\ast$}{*}item)
\begin{DoxyCompactList}\small\item\em Indicates an offered cipher has been accepted. \end{DoxyCompactList}\item 
int \mbox{\hyperlink{mw__cipher_8h_a20e64408792db9e2845f8a7865eefe65}{mw\+Cipher\+Instance\+\_\+decrypt}} (struct \mbox{\hyperlink{structmwCipherInstance}{mw\+Cipher\+Instance}} \texorpdfstring{$\ast$}{*}ci, struct \mbox{\hyperlink{structmwOpaque}{mw\+Opaque}} \texorpdfstring{$\ast$}{*}data)
\begin{DoxyCompactList}\small\item\em decrypt data \end{DoxyCompactList}\item 
int \mbox{\hyperlink{mw__cipher_8h_afbdb09cd3991970596b9e7ad1865a4b5}{mw\+Cipher\+Instance\+\_\+encrypt}} (struct \mbox{\hyperlink{structmwCipherInstance}{mw\+Cipher\+Instance}} \texorpdfstring{$\ast$}{*}ci, struct \mbox{\hyperlink{structmwOpaque}{mw\+Opaque}} \texorpdfstring{$\ast$}{*}data)
\begin{DoxyCompactList}\small\item\em encrypt data \end{DoxyCompactList}\item 
void \mbox{\hyperlink{mw__cipher_8h_a302cdec8d916252920962bc7aefe39a4}{mw\+Cipher\+Instance\+\_\+free}} (struct \mbox{\hyperlink{structmwCipherInstance}{mw\+Cipher\+Instance}} \texorpdfstring{$\ast$}{*}ci)
\begin{DoxyCompactList}\small\item\em destroy a cipher instance \end{DoxyCompactList}\item 
struct \mbox{\hyperlink{structmwChannel}{mw\+Channel}} \texorpdfstring{$\ast$}{*} \mbox{\hyperlink{mw__cipher_8h_ab074a956b85e8c030a66a327e9574bab}{mw\+Cipher\+Instance\+\_\+get\+Channel}} (struct \mbox{\hyperlink{structmwCipherInstance}{mw\+Cipher\+Instance}} \texorpdfstring{$\ast$}{*}ci)
\begin{DoxyCompactList}\small\item\em reference the channel a cipher instance is attached to \end{DoxyCompactList}\item 
struct \mbox{\hyperlink{structmwCipher}{mw\+Cipher}} \texorpdfstring{$\ast$}{*} \mbox{\hyperlink{mw__cipher_8h_ad5aef8759ae50d07a59993c7abc9ba68}{mw\+Cipher\+Instance\+\_\+get\+Cipher}} (struct \mbox{\hyperlink{structmwCipherInstance}{mw\+Cipher\+Instance}} \texorpdfstring{$\ast$}{*}ci)
\begin{DoxyCompactList}\small\item\em reference the parent cipher of an instance \end{DoxyCompactList}\item 
struct \mbox{\hyperlink{structmwEncryptItem}{mw\+Encrypt\+Item}} \texorpdfstring{$\ast$}{*} \mbox{\hyperlink{mw__cipher_8h_a48ed4f6ad91a1b9c8d9e87c383057f3d}{mw\+Cipher\+Instance\+\_\+offer}} (struct \mbox{\hyperlink{structmwCipherInstance}{mw\+Cipher\+Instance}} \texorpdfstring{$\ast$}{*}ci)
\begin{DoxyCompactList}\small\item\em Offer a cipher. \end{DoxyCompactList}\item 
void \mbox{\hyperlink{mw__cipher_8h_aca54b3578379f8f7e8a3497643d9ff52}{mw\+Cipher\+Instance\+\_\+offered}} (struct \mbox{\hyperlink{structmwCipherInstance}{mw\+Cipher\+Instance}} \texorpdfstring{$\ast$}{*}ci, struct \mbox{\hyperlink{structmwEncryptItem}{mw\+Encrypt\+Item}} \texorpdfstring{$\ast$}{*}item)
\begin{DoxyCompactList}\small\item\em Indicates a cipher has been offered to our channel. \end{DoxyCompactList}\item 
void \mbox{\hyperlink{mw__cipher_8h_a1ea4d9e89089fcde39ff462a5404e704}{mw\+Decrypt}} (const guchar \texorpdfstring{$\ast$}{*}key, gsize keylen, guchar \texorpdfstring{$\ast$}{*}iv, struct \mbox{\hyperlink{structmwOpaque}{mw\+Opaque}} \texorpdfstring{$\ast$}{*}in, struct \mbox{\hyperlink{structmwOpaque}{mw\+Opaque}} \texorpdfstring{$\ast$}{*}out)
\begin{DoxyCompactList}\small\item\em Decrypt data using an expanded form of the given key. \end{DoxyCompactList}\item 
void \mbox{\hyperlink{mw__cipher_8h_acb001137b268c78457e75185fdbbd9c9}{mw\+Decrypt\+Expanded}} (const int \texorpdfstring{$\ast$}{*}ekey, guchar \texorpdfstring{$\ast$}{*}iv, struct \mbox{\hyperlink{structmwOpaque}{mw\+Opaque}} \texorpdfstring{$\ast$}{*}in, struct \mbox{\hyperlink{structmwOpaque}{mw\+Opaque}} \texorpdfstring{$\ast$}{*}out)
\begin{DoxyCompactList}\small\item\em Decrypt data using an already expanded key. \end{DoxyCompactList}\item 
void \mbox{\hyperlink{mw__cipher_8h_a4ff69a2373683cbecb91039dd1a46fa1}{mw\+Encrypt}} (const guchar \texorpdfstring{$\ast$}{*}key, gsize keylen, guchar \texorpdfstring{$\ast$}{*}iv, struct \mbox{\hyperlink{structmwOpaque}{mw\+Opaque}} \texorpdfstring{$\ast$}{*}in, struct \mbox{\hyperlink{structmwOpaque}{mw\+Opaque}} \texorpdfstring{$\ast$}{*}out)
\begin{DoxyCompactList}\small\item\em Encrypt data using an expanded form of the given key. \end{DoxyCompactList}\item 
void \mbox{\hyperlink{mw__cipher_8h_a934b08511236b5e8cf80c22acc937f51}{mw\+Encrypt\+Expanded}} (const int \texorpdfstring{$\ast$}{*}ekey, guchar \texorpdfstring{$\ast$}{*}iv, struct \mbox{\hyperlink{structmwOpaque}{mw\+Opaque}} \texorpdfstring{$\ast$}{*}in, struct \mbox{\hyperlink{structmwOpaque}{mw\+Opaque}} \texorpdfstring{$\ast$}{*}out)
\begin{DoxyCompactList}\small\item\em Encrypt data using an already-\/expanded key. \end{DoxyCompactList}\item 
void \mbox{\hyperlink{mw__cipher_8h_a4164e217eb715d505ee0bb1d75d983f1}{mw\+IV\+\_\+init}} (guchar \texorpdfstring{$\ast$}{*}iv)
\begin{DoxyCompactList}\small\item\em Setup an Initialization Vector. \end{DoxyCompactList}\item 
void \mbox{\hyperlink{mw__cipher_8h_a1fb65f55e064360183cee4bbe2a93c19}{mw\+Key\+Expand}} (int \texorpdfstring{$\ast$}{*}ekey, const guchar \texorpdfstring{$\ast$}{*}key, gsize keylen)
\begin{DoxyCompactList}\small\item\em Expand a variable-\/length key into a 128-\/byte key (represented as an an array of 64 ints) \end{DoxyCompactList}\item 
void \mbox{\hyperlink{mw__cipher_8h_a4606773752ee1a6ff4a44c217a39e348}{mw\+Key\+Random}} (guchar \texorpdfstring{$\ast$}{*}key, gsize keylen)
\begin{DoxyCompactList}\small\item\em generate some pseudo-\/random bytes \end{DoxyCompactList}\item 
void \mbox{\hyperlink{mw__cipher_8h_a796525794edf3887ab94eefb748bcf91}{mw\+Mpi\+\_\+calculate\+DHShared}} (struct \mbox{\hyperlink{structmwMpi}{mw\+Mpi}} \texorpdfstring{$\ast$}{*}shared\+\_\+key, struct \mbox{\hyperlink{structmwMpi}{mw\+Mpi}} \texorpdfstring{$\ast$}{*}remote\+\_\+key, struct \mbox{\hyperlink{structmwMpi}{mw\+Mpi}} \texorpdfstring{$\ast$}{*}private\+\_\+key)
\begin{DoxyCompactList}\small\item\em sets the shared key value based on the remote and private keys, using the Sametime Prime and Base \end{DoxyCompactList}\item 
void \mbox{\hyperlink{mw__cipher_8h_a389f3d2f174e66810a92ee93d5035967}{mw\+Mpi\+\_\+export}} (struct \mbox{\hyperlink{structmwMpi}{mw\+Mpi}} \texorpdfstring{$\ast$}{*}i, struct \mbox{\hyperlink{structmwOpaque}{mw\+Opaque}} \texorpdfstring{$\ast$}{*}o)
\begin{DoxyCompactList}\small\item\em Export a value into an opaque. \end{DoxyCompactList}\item 
void \mbox{\hyperlink{mw__cipher_8h_a674f737698d67c52dce06f54151909ef}{mw\+Mpi\+\_\+free}} (struct \mbox{\hyperlink{structmwMpi}{mw\+Mpi}} \texorpdfstring{$\ast$}{*}i)
\begin{DoxyCompactList}\small\item\em destroy an mpi value \end{DoxyCompactList}\item 
void \mbox{\hyperlink{mw__cipher_8h_a4dcaf6196943a70f723c828cab35f0c1}{mw\+Mpi\+\_\+import}} (struct \mbox{\hyperlink{structmwMpi}{mw\+Mpi}} \texorpdfstring{$\ast$}{*}i, struct \mbox{\hyperlink{structmwOpaque}{mw\+Opaque}} \texorpdfstring{$\ast$}{*}o)
\begin{DoxyCompactList}\small\item\em Import a value from an opaque. \end{DoxyCompactList}\item 
struct \mbox{\hyperlink{structmwMpi}{mw\+Mpi}} \texorpdfstring{$\ast$}{*} \mbox{\hyperlink{mw__cipher_8h_ae5a02a3caf66b1f036e362d53887b0dc}{mw\+Mpi\+\_\+new}} (void)
\begin{DoxyCompactList}\small\item\em prepare a new mpi value \end{DoxyCompactList}\item 
void \mbox{\hyperlink{mw__cipher_8h_a95e8808f20ea58c66014a052375c5fe4}{mw\+Mpi\+\_\+rand\+DHKeypair}} (struct \mbox{\hyperlink{structmwMpi}{mw\+Mpi}} \texorpdfstring{$\ast$}{*}private\+\_\+key, struct \mbox{\hyperlink{structmwMpi}{mw\+Mpi}} \texorpdfstring{$\ast$}{*}public\+\_\+key)
\begin{DoxyCompactList}\small\item\em sets private to a randomly generated value, and calculates public using the Sametime Prime and Base \end{DoxyCompactList}\item 
void \mbox{\hyperlink{mw__cipher_8h_add1ffe92fc1c256fa767a34d58433dd1}{mw\+Mpi\+\_\+set\+DHBase}} (struct \mbox{\hyperlink{structmwMpi}{mw\+Mpi}} \texorpdfstring{$\ast$}{*}i)
\begin{DoxyCompactList}\small\item\em set a big integer to the Sametime Base value \end{DoxyCompactList}\item 
void \mbox{\hyperlink{mw__cipher_8h_a892796c968b68d71e67b678a87504d20}{mw\+Mpi\+\_\+set\+DHPrime}} (struct \mbox{\hyperlink{structmwMpi}{mw\+Mpi}} \texorpdfstring{$\ast$}{*}i)
\begin{DoxyCompactList}\small\item\em set a big integer to the Sametime Prime value \end{DoxyCompactList}\end{DoxyCompactItemize}


\doxysubsection{Typedef Documentation}
\Hypertarget{mw__cipher_8h_aca656cce8d283fccb930a28473add823}\label{mw__cipher_8h_aca656cce8d283fccb930a28473add823} 
\index{mw\_cipher.h@{mw\_cipher.h}!mwCipherInstantiator@{mwCipherInstantiator}}
\index{mwCipherInstantiator@{mwCipherInstantiator}!mw\_cipher.h@{mw\_cipher.h}}
\doxysubsubsection{\texorpdfstring{mwCipherInstantiator}{mwCipherInstantiator}}
{\footnotesize\ttfamily typedef struct \mbox{\hyperlink{structmwCipherInstance}{mw\+Cipher\+Instance}} \texorpdfstring{$\ast$}{*}(\texorpdfstring{$\ast$}{*} mw\+Cipher\+Instantiator) (struct \mbox{\hyperlink{structmwCipher}{mw\+Cipher}} \texorpdfstring{$\ast$}{*}cipher, struct \mbox{\hyperlink{structmwChannel}{mw\+Channel}} \texorpdfstring{$\ast$}{*}chan)}



Obtain an instance of a given cipher, which can be used for the processing of a single channel. 

\Hypertarget{mw__cipher_8h_a708cff122947ff2cc0bf69a4f2acc3a5}\label{mw__cipher_8h_a708cff122947ff2cc0bf69a4f2acc3a5} 
\index{mw\_cipher.h@{mw\_cipher.h}!mwCipherProcessor@{mwCipherProcessor}}
\index{mwCipherProcessor@{mwCipherProcessor}!mw\_cipher.h@{mw\_cipher.h}}
\doxysubsubsection{\texorpdfstring{mwCipherProcessor}{mwCipherProcessor}}
{\footnotesize\ttfamily typedef int(\texorpdfstring{$\ast$}{*} mw\+Cipher\+Processor) (struct \mbox{\hyperlink{structmwCipherInstance}{mw\+Cipher\+Instance}} \texorpdfstring{$\ast$}{*}ci, struct \mbox{\hyperlink{structmwOpaque}{mw\+Opaque}} \texorpdfstring{$\ast$}{*}data)}



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 

\doxysubsection{Enumeration Type Documentation}
\Hypertarget{mw__cipher_8h_a3d1e1cc055146237e1b8e638c5005a70}\label{mw__cipher_8h_a3d1e1cc055146237e1b8e638c5005a70} 
\index{mw\_cipher.h@{mw\_cipher.h}!mwCipherType@{mwCipherType}}
\index{mwCipherType@{mwCipherType}!mw\_cipher.h@{mw\_cipher.h}}
\doxysubsubsection{\texorpdfstring{mwCipherType}{mwCipherType}}
{\footnotesize\ttfamily enum \mbox{\hyperlink{mw__cipher_8h_a3d1e1cc055146237e1b8e638c5005a70}{mw\+Cipher\+Type}}}



Common cipher types. 

\begin{DoxyEnumFields}{Enumerator}
\raisebox{\heightof{T}}[0pt][0pt]{\index{mwCipher\_RC2\_40@{mwCipher\_RC2\_40}!mw\_cipher.h@{mw\_cipher.h}}\index{mw\_cipher.h@{mw\_cipher.h}!mwCipher\_RC2\_40@{mwCipher\_RC2\_40}}}\Hypertarget{mw__cipher_8h_a3d1e1cc055146237e1b8e638c5005a70ab67b342eb4ad1f28624235e7d2b1509b}\label{mw__cipher_8h_a3d1e1cc055146237e1b8e638c5005a70ab67b342eb4ad1f28624235e7d2b1509b} 
mw\+Cipher\+\_\+\+RC2\+\_\+40&\\
\hline

\raisebox{\heightof{T}}[0pt][0pt]{\index{mwCipher\_RC2\_128@{mwCipher\_RC2\_128}!mw\_cipher.h@{mw\_cipher.h}}\index{mw\_cipher.h@{mw\_cipher.h}!mwCipher\_RC2\_128@{mwCipher\_RC2\_128}}}\Hypertarget{mw__cipher_8h_a3d1e1cc055146237e1b8e638c5005a70ab9732b499466e669cf5f8de3e09770f8}\label{mw__cipher_8h_a3d1e1cc055146237e1b8e638c5005a70ab9732b499466e669cf5f8de3e09770f8} 
mw\+Cipher\+\_\+\+RC2\+\_\+128&\\
\hline

\end{DoxyEnumFields}


\doxysubsection{Function Documentation}
\Hypertarget{mw__cipher_8h_a4d6a169e214b8e6b60e6fb2e7c5c51bd}\label{mw__cipher_8h_a4d6a169e214b8e6b60e6fb2e7c5c51bd} 
\index{mw\_cipher.h@{mw\_cipher.h}!mwCipher\_free@{mwCipher\_free}}
\index{mwCipher\_free@{mwCipher\_free}!mw\_cipher.h@{mw\_cipher.h}}
\doxysubsubsection{\texorpdfstring{mwCipher\_free()}{mwCipher\_free()}}
{\footnotesize\ttfamily void mw\+Cipher\+\_\+free (\begin{DoxyParamCaption}\item[{struct \mbox{\hyperlink{structmwCipher}{mw\+Cipher}} \texorpdfstring{$\ast$}{*}}]{cipher }\end{DoxyParamCaption})}



destroy a cipher 

\Hypertarget{mw__cipher_8h_a5e33bb53130d64d68f9444d731541d71}\label{mw__cipher_8h_a5e33bb53130d64d68f9444d731541d71} 
\index{mw\_cipher.h@{mw\_cipher.h}!mwCipher\_getDesc@{mwCipher\_getDesc}}
\index{mwCipher\_getDesc@{mwCipher\_getDesc}!mw\_cipher.h@{mw\_cipher.h}}
\doxysubsubsection{\texorpdfstring{mwCipher\_getDesc()}{mwCipher\_getDesc()}}
{\footnotesize\ttfamily const char \texorpdfstring{$\ast$}{*} mw\+Cipher\+\_\+get\+Desc (\begin{DoxyParamCaption}\item[{struct \mbox{\hyperlink{structmwCipher}{mw\+Cipher}} \texorpdfstring{$\ast$}{*}}]{cipher }\end{DoxyParamCaption})}

\Hypertarget{mw__cipher_8h_a136e3e79747b130236a36659dea0477d}\label{mw__cipher_8h_a136e3e79747b130236a36659dea0477d} 
\index{mw\_cipher.h@{mw\_cipher.h}!mwCipher\_getName@{mwCipher\_getName}}
\index{mwCipher\_getName@{mwCipher\_getName}!mw\_cipher.h@{mw\_cipher.h}}
\doxysubsubsection{\texorpdfstring{mwCipher\_getName()}{mwCipher\_getName()}}
{\footnotesize\ttfamily const char \texorpdfstring{$\ast$}{*} mw\+Cipher\+\_\+get\+Name (\begin{DoxyParamCaption}\item[{struct \mbox{\hyperlink{structmwCipher}{mw\+Cipher}} \texorpdfstring{$\ast$}{*}}]{cipher }\end{DoxyParamCaption})}

\Hypertarget{mw__cipher_8h_ac06492ad8144aecfc0b70b97f29e4a13}\label{mw__cipher_8h_ac06492ad8144aecfc0b70b97f29e4a13} 
\index{mw\_cipher.h@{mw\_cipher.h}!mwCipher\_getSession@{mwCipher\_getSession}}
\index{mwCipher\_getSession@{mwCipher\_getSession}!mw\_cipher.h@{mw\_cipher.h}}
\doxysubsubsection{\texorpdfstring{mwCipher\_getSession()}{mwCipher\_getSession()}}
{\footnotesize\ttfamily struct \mbox{\hyperlink{structmwSession}{mw\+Session}} \texorpdfstring{$\ast$}{*} mw\+Cipher\+\_\+get\+Session (\begin{DoxyParamCaption}\item[{struct \mbox{\hyperlink{structmwCipher}{mw\+Cipher}} \texorpdfstring{$\ast$}{*}}]{cipher }\end{DoxyParamCaption})}

\Hypertarget{mw__cipher_8h_a9c78471afd459b09ddf5e544d9a07f56}\label{mw__cipher_8h_a9c78471afd459b09ddf5e544d9a07f56} 
\index{mw\_cipher.h@{mw\_cipher.h}!mwCipher\_getType@{mwCipher\_getType}}
\index{mwCipher\_getType@{mwCipher\_getType}!mw\_cipher.h@{mw\_cipher.h}}
\doxysubsubsection{\texorpdfstring{mwCipher\_getType()}{mwCipher\_getType()}}
{\footnotesize\ttfamily guint16 mw\+Cipher\+\_\+get\+Type (\begin{DoxyParamCaption}\item[{struct \mbox{\hyperlink{structmwCipher}{mw\+Cipher}} \texorpdfstring{$\ast$}{*}}]{cipher }\end{DoxyParamCaption})}

\Hypertarget{mw__cipher_8h_a9be6b70917384e9fd2f6c647f2a6d3f0}\label{mw__cipher_8h_a9be6b70917384e9fd2f6c647f2a6d3f0} 
\index{mw\_cipher.h@{mw\_cipher.h}!mwCipher\_new\_RC2\_128@{mwCipher\_new\_RC2\_128}}
\index{mwCipher\_new\_RC2\_128@{mwCipher\_new\_RC2\_128}!mw\_cipher.h@{mw\_cipher.h}}
\doxysubsubsection{\texorpdfstring{mwCipher\_new\_RC2\_128()}{mwCipher\_new\_RC2\_128()}}
{\footnotesize\ttfamily struct \mbox{\hyperlink{structmwCipher}{mw\+Cipher}} \texorpdfstring{$\ast$}{*} mw\+Cipher\+\_\+new\+\_\+\+RC2\+\_\+128 (\begin{DoxyParamCaption}\item[{struct \mbox{\hyperlink{structmwSession}{mw\+Session}} \texorpdfstring{$\ast$}{*}}]{s }\end{DoxyParamCaption})}

\Hypertarget{mw__cipher_8h_a406ccc817f1f532667f1d9d6a4a54158}\label{mw__cipher_8h_a406ccc817f1f532667f1d9d6a4a54158} 
\index{mw\_cipher.h@{mw\_cipher.h}!mwCipher\_new\_RC2\_40@{mwCipher\_new\_RC2\_40}}
\index{mwCipher\_new\_RC2\_40@{mwCipher\_new\_RC2\_40}!mw\_cipher.h@{mw\_cipher.h}}
\doxysubsubsection{\texorpdfstring{mwCipher\_new\_RC2\_40()}{mwCipher\_new\_RC2\_40()}}
{\footnotesize\ttfamily struct \mbox{\hyperlink{structmwCipher}{mw\+Cipher}} \texorpdfstring{$\ast$}{*} mw\+Cipher\+\_\+new\+\_\+\+RC2\+\_\+40 (\begin{DoxyParamCaption}\item[{struct \mbox{\hyperlink{structmwSession}{mw\+Session}} \texorpdfstring{$\ast$}{*}}]{s }\end{DoxyParamCaption})}

\Hypertarget{mw__cipher_8h_ad9e4927b43ac9aa0a8d9209d4fbfcf1b}\label{mw__cipher_8h_ad9e4927b43ac9aa0a8d9209d4fbfcf1b} 
\index{mw\_cipher.h@{mw\_cipher.h}!mwCipher\_newInstance@{mwCipher\_newInstance}}
\index{mwCipher\_newInstance@{mwCipher\_newInstance}!mw\_cipher.h@{mw\_cipher.h}}
\doxysubsubsection{\texorpdfstring{mwCipher\_newInstance()}{mwCipher\_newInstance()}}
{\footnotesize\ttfamily struct \mbox{\hyperlink{structmwCipherInstance}{mw\+Cipher\+Instance}} \texorpdfstring{$\ast$}{*} mw\+Cipher\+\_\+new\+Instance (\begin{DoxyParamCaption}\item[{struct \mbox{\hyperlink{structmwCipher}{mw\+Cipher}} \texorpdfstring{$\ast$}{*}}]{cipher,  }\item[{struct \mbox{\hyperlink{structmwChannel}{mw\+Channel}} \texorpdfstring{$\ast$}{*}}]{channel }\end{DoxyParamCaption})}

\Hypertarget{mw__cipher_8h_a03c39a5307320a606c23753bcb992975}\label{mw__cipher_8h_a03c39a5307320a606c23753bcb992975} 
\index{mw\_cipher.h@{mw\_cipher.h}!mwCipherInstance\_accept@{mwCipherInstance\_accept}}
\index{mwCipherInstance\_accept@{mwCipherInstance\_accept}!mw\_cipher.h@{mw\_cipher.h}}
\doxysubsubsection{\texorpdfstring{mwCipherInstance\_accept()}{mwCipherInstance\_accept()}}
{\footnotesize\ttfamily struct \mbox{\hyperlink{structmwEncryptItem}{mw\+Encrypt\+Item}} \texorpdfstring{$\ast$}{*} mw\+Cipher\+Instance\+\_\+accept (\begin{DoxyParamCaption}\item[{struct \mbox{\hyperlink{structmwCipherInstance}{mw\+Cipher\+Instance}} \texorpdfstring{$\ast$}{*}}]{ci }\end{DoxyParamCaption})}



Accept a cipher offered to our channel. 

\Hypertarget{mw__cipher_8h_a12cef66d5336ee880cdd812c2dbe7ff3}\label{mw__cipher_8h_a12cef66d5336ee880cdd812c2dbe7ff3} 
\index{mw\_cipher.h@{mw\_cipher.h}!mwCipherInstance\_accepted@{mwCipherInstance\_accepted}}
\index{mwCipherInstance\_accepted@{mwCipherInstance\_accepted}!mw\_cipher.h@{mw\_cipher.h}}
\doxysubsubsection{\texorpdfstring{mwCipherInstance\_accepted()}{mwCipherInstance\_accepted()}}
{\footnotesize\ttfamily void mw\+Cipher\+Instance\+\_\+accepted (\begin{DoxyParamCaption}\item[{struct \mbox{\hyperlink{structmwCipherInstance}{mw\+Cipher\+Instance}} \texorpdfstring{$\ast$}{*}}]{ci,  }\item[{struct \mbox{\hyperlink{structmwEncryptItem}{mw\+Encrypt\+Item}} \texorpdfstring{$\ast$}{*}}]{item }\end{DoxyParamCaption})}



Indicates an offered cipher has been accepted. 

\Hypertarget{mw__cipher_8h_a20e64408792db9e2845f8a7865eefe65}\label{mw__cipher_8h_a20e64408792db9e2845f8a7865eefe65} 
\index{mw\_cipher.h@{mw\_cipher.h}!mwCipherInstance\_decrypt@{mwCipherInstance\_decrypt}}
\index{mwCipherInstance\_decrypt@{mwCipherInstance\_decrypt}!mw\_cipher.h@{mw\_cipher.h}}
\doxysubsubsection{\texorpdfstring{mwCipherInstance\_decrypt()}{mwCipherInstance\_decrypt()}}
{\footnotesize\ttfamily int mw\+Cipher\+Instance\+\_\+decrypt (\begin{DoxyParamCaption}\item[{struct \mbox{\hyperlink{structmwCipherInstance}{mw\+Cipher\+Instance}} \texorpdfstring{$\ast$}{*}}]{ci,  }\item[{struct \mbox{\hyperlink{structmwOpaque}{mw\+Opaque}} \texorpdfstring{$\ast$}{*}}]{data }\end{DoxyParamCaption})}



decrypt data 

\Hypertarget{mw__cipher_8h_afbdb09cd3991970596b9e7ad1865a4b5}\label{mw__cipher_8h_afbdb09cd3991970596b9e7ad1865a4b5} 
\index{mw\_cipher.h@{mw\_cipher.h}!mwCipherInstance\_encrypt@{mwCipherInstance\_encrypt}}
\index{mwCipherInstance\_encrypt@{mwCipherInstance\_encrypt}!mw\_cipher.h@{mw\_cipher.h}}
\doxysubsubsection{\texorpdfstring{mwCipherInstance\_encrypt()}{mwCipherInstance\_encrypt()}}
{\footnotesize\ttfamily int mw\+Cipher\+Instance\+\_\+encrypt (\begin{DoxyParamCaption}\item[{struct \mbox{\hyperlink{structmwCipherInstance}{mw\+Cipher\+Instance}} \texorpdfstring{$\ast$}{*}}]{ci,  }\item[{struct \mbox{\hyperlink{structmwOpaque}{mw\+Opaque}} \texorpdfstring{$\ast$}{*}}]{data }\end{DoxyParamCaption})}



encrypt data 

\Hypertarget{mw__cipher_8h_a302cdec8d916252920962bc7aefe39a4}\label{mw__cipher_8h_a302cdec8d916252920962bc7aefe39a4} 
\index{mw\_cipher.h@{mw\_cipher.h}!mwCipherInstance\_free@{mwCipherInstance\_free}}
\index{mwCipherInstance\_free@{mwCipherInstance\_free}!mw\_cipher.h@{mw\_cipher.h}}
\doxysubsubsection{\texorpdfstring{mwCipherInstance\_free()}{mwCipherInstance\_free()}}
{\footnotesize\ttfamily void mw\+Cipher\+Instance\+\_\+free (\begin{DoxyParamCaption}\item[{struct \mbox{\hyperlink{structmwCipherInstance}{mw\+Cipher\+Instance}} \texorpdfstring{$\ast$}{*}}]{ci }\end{DoxyParamCaption})}



destroy a cipher instance 

\Hypertarget{mw__cipher_8h_ab074a956b85e8c030a66a327e9574bab}\label{mw__cipher_8h_ab074a956b85e8c030a66a327e9574bab} 
\index{mw\_cipher.h@{mw\_cipher.h}!mwCipherInstance\_getChannel@{mwCipherInstance\_getChannel}}
\index{mwCipherInstance\_getChannel@{mwCipherInstance\_getChannel}!mw\_cipher.h@{mw\_cipher.h}}
\doxysubsubsection{\texorpdfstring{mwCipherInstance\_getChannel()}{mwCipherInstance\_getChannel()}}
{\footnotesize\ttfamily struct \mbox{\hyperlink{structmwChannel}{mw\+Channel}} \texorpdfstring{$\ast$}{*} mw\+Cipher\+Instance\+\_\+get\+Channel (\begin{DoxyParamCaption}\item[{struct \mbox{\hyperlink{structmwCipherInstance}{mw\+Cipher\+Instance}} \texorpdfstring{$\ast$}{*}}]{ci }\end{DoxyParamCaption})}



reference the channel a cipher instance is attached to 

\Hypertarget{mw__cipher_8h_ad5aef8759ae50d07a59993c7abc9ba68}\label{mw__cipher_8h_ad5aef8759ae50d07a59993c7abc9ba68} 
\index{mw\_cipher.h@{mw\_cipher.h}!mwCipherInstance\_getCipher@{mwCipherInstance\_getCipher}}
\index{mwCipherInstance\_getCipher@{mwCipherInstance\_getCipher}!mw\_cipher.h@{mw\_cipher.h}}
\doxysubsubsection{\texorpdfstring{mwCipherInstance\_getCipher()}{mwCipherInstance\_getCipher()}}
{\footnotesize\ttfamily struct \mbox{\hyperlink{structmwCipher}{mw\+Cipher}} \texorpdfstring{$\ast$}{*} mw\+Cipher\+Instance\+\_\+get\+Cipher (\begin{DoxyParamCaption}\item[{struct \mbox{\hyperlink{structmwCipherInstance}{mw\+Cipher\+Instance}} \texorpdfstring{$\ast$}{*}}]{ci }\end{DoxyParamCaption})}



reference the parent cipher of an instance 

\Hypertarget{mw__cipher_8h_a48ed4f6ad91a1b9c8d9e87c383057f3d}\label{mw__cipher_8h_a48ed4f6ad91a1b9c8d9e87c383057f3d} 
\index{mw\_cipher.h@{mw\_cipher.h}!mwCipherInstance\_offer@{mwCipherInstance\_offer}}
\index{mwCipherInstance\_offer@{mwCipherInstance\_offer}!mw\_cipher.h@{mw\_cipher.h}}
\doxysubsubsection{\texorpdfstring{mwCipherInstance\_offer()}{mwCipherInstance\_offer()}}
{\footnotesize\ttfamily struct \mbox{\hyperlink{structmwEncryptItem}{mw\+Encrypt\+Item}} \texorpdfstring{$\ast$}{*} mw\+Cipher\+Instance\+\_\+offer (\begin{DoxyParamCaption}\item[{struct \mbox{\hyperlink{structmwCipherInstance}{mw\+Cipher\+Instance}} \texorpdfstring{$\ast$}{*}}]{ci }\end{DoxyParamCaption})}



Offer a cipher. 

\Hypertarget{mw__cipher_8h_aca54b3578379f8f7e8a3497643d9ff52}\label{mw__cipher_8h_aca54b3578379f8f7e8a3497643d9ff52} 
\index{mw\_cipher.h@{mw\_cipher.h}!mwCipherInstance\_offered@{mwCipherInstance\_offered}}
\index{mwCipherInstance\_offered@{mwCipherInstance\_offered}!mw\_cipher.h@{mw\_cipher.h}}
\doxysubsubsection{\texorpdfstring{mwCipherInstance\_offered()}{mwCipherInstance\_offered()}}
{\footnotesize\ttfamily void mw\+Cipher\+Instance\+\_\+offered (\begin{DoxyParamCaption}\item[{struct \mbox{\hyperlink{structmwCipherInstance}{mw\+Cipher\+Instance}} \texorpdfstring{$\ast$}{*}}]{ci,  }\item[{struct \mbox{\hyperlink{structmwEncryptItem}{mw\+Encrypt\+Item}} \texorpdfstring{$\ast$}{*}}]{item }\end{DoxyParamCaption})}



Indicates a cipher has been offered to our channel. 

\Hypertarget{mw__cipher_8h_a1ea4d9e89089fcde39ff462a5404e704}\label{mw__cipher_8h_a1ea4d9e89089fcde39ff462a5404e704} 
\index{mw\_cipher.h@{mw\_cipher.h}!mwDecrypt@{mwDecrypt}}
\index{mwDecrypt@{mwDecrypt}!mw\_cipher.h@{mw\_cipher.h}}
\doxysubsubsection{\texorpdfstring{mwDecrypt()}{mwDecrypt()}}
{\footnotesize\ttfamily void mw\+Decrypt (\begin{DoxyParamCaption}\item[{const guchar \texorpdfstring{$\ast$}{*}}]{key,  }\item[{gsize}]{keylen,  }\item[{guchar \texorpdfstring{$\ast$}{*}}]{iv,  }\item[{struct \mbox{\hyperlink{structmwOpaque}{mw\+Opaque}} \texorpdfstring{$\ast$}{*}}]{in,  }\item[{struct \mbox{\hyperlink{structmwOpaque}{mw\+Opaque}} \texorpdfstring{$\ast$}{*}}]{out }\end{DoxyParamCaption})}



Decrypt data using an expanded form of the given key. 

\Hypertarget{mw__cipher_8h_acb001137b268c78457e75185fdbbd9c9}\label{mw__cipher_8h_acb001137b268c78457e75185fdbbd9c9} 
\index{mw\_cipher.h@{mw\_cipher.h}!mwDecryptExpanded@{mwDecryptExpanded}}
\index{mwDecryptExpanded@{mwDecryptExpanded}!mw\_cipher.h@{mw\_cipher.h}}
\doxysubsubsection{\texorpdfstring{mwDecryptExpanded()}{mwDecryptExpanded()}}
{\footnotesize\ttfamily void mw\+Decrypt\+Expanded (\begin{DoxyParamCaption}\item[{const int \texorpdfstring{$\ast$}{*}}]{ekey,  }\item[{guchar \texorpdfstring{$\ast$}{*}}]{iv,  }\item[{struct \mbox{\hyperlink{structmwOpaque}{mw\+Opaque}} \texorpdfstring{$\ast$}{*}}]{in,  }\item[{struct \mbox{\hyperlink{structmwOpaque}{mw\+Opaque}} \texorpdfstring{$\ast$}{*}}]{out }\end{DoxyParamCaption})}



Decrypt data using an already expanded key. 

\Hypertarget{mw__cipher_8h_a4ff69a2373683cbecb91039dd1a46fa1}\label{mw__cipher_8h_a4ff69a2373683cbecb91039dd1a46fa1} 
\index{mw\_cipher.h@{mw\_cipher.h}!mwEncrypt@{mwEncrypt}}
\index{mwEncrypt@{mwEncrypt}!mw\_cipher.h@{mw\_cipher.h}}
\doxysubsubsection{\texorpdfstring{mwEncrypt()}{mwEncrypt()}}
{\footnotesize\ttfamily void mw\+Encrypt (\begin{DoxyParamCaption}\item[{const guchar \texorpdfstring{$\ast$}{*}}]{key,  }\item[{gsize}]{keylen,  }\item[{guchar \texorpdfstring{$\ast$}{*}}]{iv,  }\item[{struct \mbox{\hyperlink{structmwOpaque}{mw\+Opaque}} \texorpdfstring{$\ast$}{*}}]{in,  }\item[{struct \mbox{\hyperlink{structmwOpaque}{mw\+Opaque}} \texorpdfstring{$\ast$}{*}}]{out }\end{DoxyParamCaption})}



Encrypt data using an expanded form of the given key. 

\Hypertarget{mw__cipher_8h_a934b08511236b5e8cf80c22acc937f51}\label{mw__cipher_8h_a934b08511236b5e8cf80c22acc937f51} 
\index{mw\_cipher.h@{mw\_cipher.h}!mwEncryptExpanded@{mwEncryptExpanded}}
\index{mwEncryptExpanded@{mwEncryptExpanded}!mw\_cipher.h@{mw\_cipher.h}}
\doxysubsubsection{\texorpdfstring{mwEncryptExpanded()}{mwEncryptExpanded()}}
{\footnotesize\ttfamily void mw\+Encrypt\+Expanded (\begin{DoxyParamCaption}\item[{const int \texorpdfstring{$\ast$}{*}}]{ekey,  }\item[{guchar \texorpdfstring{$\ast$}{*}}]{iv,  }\item[{struct \mbox{\hyperlink{structmwOpaque}{mw\+Opaque}} \texorpdfstring{$\ast$}{*}}]{in,  }\item[{struct \mbox{\hyperlink{structmwOpaque}{mw\+Opaque}} \texorpdfstring{$\ast$}{*}}]{out }\end{DoxyParamCaption})}



Encrypt data using an already-\/expanded key. 

\Hypertarget{mw__cipher_8h_a4164e217eb715d505ee0bb1d75d983f1}\label{mw__cipher_8h_a4164e217eb715d505ee0bb1d75d983f1} 
\index{mw\_cipher.h@{mw\_cipher.h}!mwIV\_init@{mwIV\_init}}
\index{mwIV\_init@{mwIV\_init}!mw\_cipher.h@{mw\_cipher.h}}
\doxysubsubsection{\texorpdfstring{mwIV\_init()}{mwIV\_init()}}
{\footnotesize\ttfamily void mw\+IV\+\_\+init (\begin{DoxyParamCaption}\item[{guchar \texorpdfstring{$\ast$}{*}}]{iv }\end{DoxyParamCaption})}



Setup an Initialization Vector. 

IV must be at least 8 bytes \Hypertarget{mw__cipher_8h_a1fb65f55e064360183cee4bbe2a93c19}\label{mw__cipher_8h_a1fb65f55e064360183cee4bbe2a93c19} 
\index{mw\_cipher.h@{mw\_cipher.h}!mwKeyExpand@{mwKeyExpand}}
\index{mwKeyExpand@{mwKeyExpand}!mw\_cipher.h@{mw\_cipher.h}}
\doxysubsubsection{\texorpdfstring{mwKeyExpand()}{mwKeyExpand()}}
{\footnotesize\ttfamily void mw\+Key\+Expand (\begin{DoxyParamCaption}\item[{int \texorpdfstring{$\ast$}{*}}]{ekey,  }\item[{const guchar \texorpdfstring{$\ast$}{*}}]{key,  }\item[{gsize}]{keylen }\end{DoxyParamCaption})}



Expand a variable-\/length key into a 128-\/byte key (represented as an an array of 64 ints) 

\Hypertarget{mw__cipher_8h_a4606773752ee1a6ff4a44c217a39e348}\label{mw__cipher_8h_a4606773752ee1a6ff4a44c217a39e348} 
\index{mw\_cipher.h@{mw\_cipher.h}!mwKeyRandom@{mwKeyRandom}}
\index{mwKeyRandom@{mwKeyRandom}!mw\_cipher.h@{mw\_cipher.h}}
\doxysubsubsection{\texorpdfstring{mwKeyRandom()}{mwKeyRandom()}}
{\footnotesize\ttfamily void mw\+Key\+Random (\begin{DoxyParamCaption}\item[{guchar \texorpdfstring{$\ast$}{*}}]{key,  }\item[{gsize}]{keylen }\end{DoxyParamCaption})}



generate some pseudo-\/random bytes 

\hypertarget{mw__cipher_8h_General}{}\doxysubsection{\texorpdfstring{Cipher Functions}{Cipher Functions}}\label{mw__cipher_8h_General}
These functions are reused where encryption is necessary outside of a channel (eg. session authentication)
\begin{DoxyParams}{Parameters}
{\em keylen} & count of bytes to write into key \\
\hline
{\em key} & buffer to write keys into \\
\hline
\end{DoxyParams}
\Hypertarget{mw__cipher_8h_a796525794edf3887ab94eefb748bcf91}\label{mw__cipher_8h_a796525794edf3887ab94eefb748bcf91} 
\index{mw\_cipher.h@{mw\_cipher.h}!mwMpi\_calculateDHShared@{mwMpi\_calculateDHShared}}
\index{mwMpi\_calculateDHShared@{mwMpi\_calculateDHShared}!mw\_cipher.h@{mw\_cipher.h}}
\doxysubsubsection{\texorpdfstring{mwMpi\_calculateDHShared()}{mwMpi\_calculateDHShared()}}
{\footnotesize\ttfamily void mw\+Mpi\+\_\+calculate\+DHShared (\begin{DoxyParamCaption}\item[{struct \mbox{\hyperlink{structmwMpi}{mw\+Mpi}} \texorpdfstring{$\ast$}{*}}]{shared\+\_\+key,  }\item[{struct \mbox{\hyperlink{structmwMpi}{mw\+Mpi}} \texorpdfstring{$\ast$}{*}}]{remote\+\_\+key,  }\item[{struct \mbox{\hyperlink{structmwMpi}{mw\+Mpi}} \texorpdfstring{$\ast$}{*}}]{private\+\_\+key }\end{DoxyParamCaption})}



sets the shared key value based on the remote and private keys, using the Sametime Prime and Base 

\Hypertarget{mw__cipher_8h_a389f3d2f174e66810a92ee93d5035967}\label{mw__cipher_8h_a389f3d2f174e66810a92ee93d5035967} 
\index{mw\_cipher.h@{mw\_cipher.h}!mwMpi\_export@{mwMpi\_export}}
\index{mwMpi\_export@{mwMpi\_export}!mw\_cipher.h@{mw\_cipher.h}}
\doxysubsubsection{\texorpdfstring{mwMpi\_export()}{mwMpi\_export()}}
{\footnotesize\ttfamily void mw\+Mpi\+\_\+export (\begin{DoxyParamCaption}\item[{struct \mbox{\hyperlink{structmwMpi}{mw\+Mpi}} \texorpdfstring{$\ast$}{*}}]{i,  }\item[{struct \mbox{\hyperlink{structmwOpaque}{mw\+Opaque}} \texorpdfstring{$\ast$}{*}}]{o }\end{DoxyParamCaption})}



Export a value into an opaque. 

\Hypertarget{mw__cipher_8h_a674f737698d67c52dce06f54151909ef}\label{mw__cipher_8h_a674f737698d67c52dce06f54151909ef} 
\index{mw\_cipher.h@{mw\_cipher.h}!mwMpi\_free@{mwMpi\_free}}
\index{mwMpi\_free@{mwMpi\_free}!mw\_cipher.h@{mw\_cipher.h}}
\doxysubsubsection{\texorpdfstring{mwMpi\_free()}{mwMpi\_free()}}
{\footnotesize\ttfamily void mw\+Mpi\+\_\+free (\begin{DoxyParamCaption}\item[{struct \mbox{\hyperlink{structmwMpi}{mw\+Mpi}} \texorpdfstring{$\ast$}{*}}]{i }\end{DoxyParamCaption})}



destroy an mpi value 

\Hypertarget{mw__cipher_8h_a4dcaf6196943a70f723c828cab35f0c1}\label{mw__cipher_8h_a4dcaf6196943a70f723c828cab35f0c1} 
\index{mw\_cipher.h@{mw\_cipher.h}!mwMpi\_import@{mwMpi\_import}}
\index{mwMpi\_import@{mwMpi\_import}!mw\_cipher.h@{mw\_cipher.h}}
\doxysubsubsection{\texorpdfstring{mwMpi\_import()}{mwMpi\_import()}}
{\footnotesize\ttfamily void mw\+Mpi\+\_\+import (\begin{DoxyParamCaption}\item[{struct \mbox{\hyperlink{structmwMpi}{mw\+Mpi}} \texorpdfstring{$\ast$}{*}}]{i,  }\item[{struct \mbox{\hyperlink{structmwOpaque}{mw\+Opaque}} \texorpdfstring{$\ast$}{*}}]{o }\end{DoxyParamCaption})}



Import a value from an opaque. 

\Hypertarget{mw__cipher_8h_ae5a02a3caf66b1f036e362d53887b0dc}\label{mw__cipher_8h_ae5a02a3caf66b1f036e362d53887b0dc} 
\index{mw\_cipher.h@{mw\_cipher.h}!mwMpi\_new@{mwMpi\_new}}
\index{mwMpi\_new@{mwMpi\_new}!mw\_cipher.h@{mw\_cipher.h}}
\doxysubsubsection{\texorpdfstring{mwMpi\_new()}{mwMpi\_new()}}
{\footnotesize\ttfamily struct \mbox{\hyperlink{structmwMpi}{mw\+Mpi}} \texorpdfstring{$\ast$}{*} mw\+Mpi\+\_\+new (\begin{DoxyParamCaption}\item[{void}]{ }\end{DoxyParamCaption})}



prepare a new mpi value 

\Hypertarget{mw__cipher_8h_a95e8808f20ea58c66014a052375c5fe4}\label{mw__cipher_8h_a95e8808f20ea58c66014a052375c5fe4} 
\index{mw\_cipher.h@{mw\_cipher.h}!mwMpi\_randDHKeypair@{mwMpi\_randDHKeypair}}
\index{mwMpi\_randDHKeypair@{mwMpi\_randDHKeypair}!mw\_cipher.h@{mw\_cipher.h}}
\doxysubsubsection{\texorpdfstring{mwMpi\_randDHKeypair()}{mwMpi\_randDHKeypair()}}
{\footnotesize\ttfamily void mw\+Mpi\+\_\+rand\+DHKeypair (\begin{DoxyParamCaption}\item[{struct \mbox{\hyperlink{structmwMpi}{mw\+Mpi}} \texorpdfstring{$\ast$}{*}}]{private\+\_\+key,  }\item[{struct \mbox{\hyperlink{structmwMpi}{mw\+Mpi}} \texorpdfstring{$\ast$}{*}}]{public\+\_\+key }\end{DoxyParamCaption})}



sets private to a randomly generated value, and calculates public using the Sametime Prime and Base 

\Hypertarget{mw__cipher_8h_add1ffe92fc1c256fa767a34d58433dd1}\label{mw__cipher_8h_add1ffe92fc1c256fa767a34d58433dd1} 
\index{mw\_cipher.h@{mw\_cipher.h}!mwMpi\_setDHBase@{mwMpi\_setDHBase}}
\index{mwMpi\_setDHBase@{mwMpi\_setDHBase}!mw\_cipher.h@{mw\_cipher.h}}
\doxysubsubsection{\texorpdfstring{mwMpi\_setDHBase()}{mwMpi\_setDHBase()}}
{\footnotesize\ttfamily void mw\+Mpi\+\_\+set\+DHBase (\begin{DoxyParamCaption}\item[{struct \mbox{\hyperlink{structmwMpi}{mw\+Mpi}} \texorpdfstring{$\ast$}{*}}]{i }\end{DoxyParamCaption})}



set a big integer to the Sametime Base value 

\Hypertarget{mw__cipher_8h_a892796c968b68d71e67b678a87504d20}\label{mw__cipher_8h_a892796c968b68d71e67b678a87504d20} 
\index{mw\_cipher.h@{mw\_cipher.h}!mwMpi\_setDHPrime@{mwMpi\_setDHPrime}}
\index{mwMpi\_setDHPrime@{mwMpi\_setDHPrime}!mw\_cipher.h@{mw\_cipher.h}}
\doxysubsubsection{\texorpdfstring{mwMpi\_setDHPrime()}{mwMpi\_setDHPrime()}}
{\footnotesize\ttfamily void mw\+Mpi\+\_\+set\+DHPrime (\begin{DoxyParamCaption}\item[{struct \mbox{\hyperlink{structmwMpi}{mw\+Mpi}} \texorpdfstring{$\ast$}{*}}]{i }\end{DoxyParamCaption})}



set a big integer to the Sametime Prime value 

