\hypertarget{classBunny}{
\section{Bunny$<$ nb\_\-msg, nb\_\-key, nb\_\-sbox, nround $>$ Class Template Reference}
\label{classBunny}\index{Bunny@{Bunny}}
}


\hyperlink{classBunny}{Bunny} CLASS.  




{\ttfamily \#include $<$Bunny.h$>$}

\subsection*{Public Types}
\begin{DoxyCompactItemize}
\item 
\hypertarget{classBunny_aac96f8b3957c2d967d5915ee512971d5}{
typedef bitset$<$ nb\_\-msg $>$ \hyperlink{classBunny_aac96f8b3957c2d967d5915ee512971d5}{msgType}}
\label{classBunny_aac96f8b3957c2d967d5915ee512971d5}

\begin{DoxyCompactList}\small\item\em Is the type of a message string (e.g., bitset$<$128$>$, bitset$<$24$>$, etc..) \end{DoxyCompactList}\item 
\hypertarget{classBunny_a33ebb94ff67c39a4a14af347d1f5d619}{
typedef bitset$<$ nb\_\-key $>$ \hyperlink{classBunny_a33ebb94ff67c39a4a14af347d1f5d619}{keyType}}
\label{classBunny_a33ebb94ff67c39a4a14af347d1f5d619}

\begin{DoxyCompactList}\small\item\em Is the type of a key string (e.g., bitset$<$256$>$, bitset$<$128$>$, etc..) \end{DoxyCompactList}\item 
\hypertarget{classBunny_a4d3368c8140d7c906daa86717bfeb05f}{
typedef bitset$<$ nb\_\-sbox $>$ \hyperlink{classBunny_a4d3368c8140d7c906daa86717bfeb05f}{sboxType}}
\label{classBunny_a4d3368c8140d7c906daa86717bfeb05f}

\begin{DoxyCompactList}\small\item\em Is the type of a message string which is input into the sBox (e.g., bitset$<$8$>$, bitset$<$6$>$, etc..) \end{DoxyCompactList}\item 
\hypertarget{classBunny_a8e83ae2eddcaabb41e7c9a7a594a4f06}{
typedef bitset$<$ nb\_\-sbox $\ast$4 $>$ \hyperlink{classBunny_a8e83ae2eddcaabb41e7c9a7a594a4f06}{wordType}}
\label{classBunny_a8e83ae2eddcaabb41e7c9a7a594a4f06}

\begin{DoxyCompactList}\small\item\em Is the type of a word string, used in the keyschedule or in the mixing layer (e.g., bitset$<$128$\ast$4$>$, etc..) \end{DoxyCompactList}\item 
\hypertarget{classBunny_a493c28e9924920dc6422b6ec882b1f86}{
typedef vector$<$ \hyperlink{classBunny_a33ebb94ff67c39a4a14af347d1f5d619}{keyType} $>$ \hyperlink{classBunny_a493c28e9924920dc6422b6ec882b1f86}{roundkeyType}}
\label{classBunny_a493c28e9924920dc6422b6ec882b1f86}

\begin{DoxyCompactList}\small\item\em Is the type of the vector containing the round keys. \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\hyperlink{classBunny_a5a2d0cb7a8414bc45d73995508e603f7}{Bunny} ()
\item 
\hypertarget{classBunny_aa259c79e722b74d29b527c2b3465619c}{
void \hyperlink{classBunny_aa259c79e722b74d29b527c2b3465619c}{printParameter} ()}
\label{classBunny_aa259c79e722b74d29b527c2b3465619c}

\begin{DoxyCompactList}\small\item\em Print to the terminal the current parameters of the block cipher. \end{DoxyCompactList}\item 
virtual \hyperlink{classBunny_aac96f8b3957c2d967d5915ee512971d5}{msgType} \hyperlink{classBunny_a33e3e8dc14fe1ef814a4b611a67adf26}{encode} (\hyperlink{classBunny_aac96f8b3957c2d967d5915ee512971d5}{msgType} m, \hyperlink{classBunny_a33ebb94ff67c39a4a14af347d1f5d619}{keyType} k)
\begin{DoxyCompactList}\small\item\em Encoding function for \hyperlink{classBunny}{Bunny} block cipher. \end{DoxyCompactList}\item 
virtual \hyperlink{classBunny_aac96f8b3957c2d967d5915ee512971d5}{msgType} \hyperlink{classBunny_abd306e727a3e0892e745a6a3829155fa}{decode} (\hyperlink{classBunny_aac96f8b3957c2d967d5915ee512971d5}{msgType} m, \hyperlink{classBunny_a33ebb94ff67c39a4a14af347d1f5d619}{keyType} k)
\begin{DoxyCompactList}\small\item\em Decoding function for \hyperlink{classBunny}{Bunny} block cipher. \end{DoxyCompactList}\item 
\hypertarget{classBunny_afc2277213b245aeee0935b788842a1ec}{
virtual \hyperlink{classBunny_a4d3368c8140d7c906daa86717bfeb05f}{sboxType} {\bfseries sbox} (unsigned nbox, \hyperlink{classBunny_a4d3368c8140d7c906daa86717bfeb05f}{sboxType} x)=0}
\label{classBunny_afc2277213b245aeee0935b788842a1ec}

\item 
\hypertarget{classBunny_a350bc613725d061f3c119c8d8c42e4c9}{
virtual \hyperlink{classBunny_a4d3368c8140d7c906daa86717bfeb05f}{sboxType} {\bfseries sboxInverse} (unsigned nbox, \hyperlink{classBunny_a4d3368c8140d7c906daa86717bfeb05f}{sboxType} x)=0}
\label{classBunny_a350bc613725d061f3c119c8d8c42e4c9}

\item 
virtual \hyperlink{classBunny_aac96f8b3957c2d967d5915ee512971d5}{msgType} \hyperlink{classBunny_abc2a9871d81718662a458253e132d93b}{sBox} (\hyperlink{classBunny_aac96f8b3957c2d967d5915ee512971d5}{msgType} m)
\begin{DoxyCompactList}\small\item\em \hyperlink{classBunny}{Bunny} S-\/box STEP. \end{DoxyCompactList}\item 
\hypertarget{classBunny_a92b68be539b38468a04f520cbc2e21be}{
virtual \hyperlink{classBunny_aac96f8b3957c2d967d5915ee512971d5}{msgType} \hyperlink{classBunny_a92b68be539b38468a04f520cbc2e21be}{sBoxInverse} (\hyperlink{classBunny_aac96f8b3957c2d967d5915ee512971d5}{msgType} m)}
\label{classBunny_a92b68be539b38468a04f520cbc2e21be}

\begin{DoxyCompactList}\small\item\em \hyperlink{classBunny}{Bunny} S-\/box Inverse STEP. \end{DoxyCompactList}\item 
\hypertarget{classBunny_a2fb3970d35714db713aa72013567808e}{
virtual \hyperlink{classBunny_aac96f8b3957c2d967d5915ee512971d5}{msgType} {\bfseries mixingLayer} (\hyperlink{classBunny_aac96f8b3957c2d967d5915ee512971d5}{msgType} m)=0}
\label{classBunny_a2fb3970d35714db713aa72013567808e}

\item 
\hypertarget{classBunny_ac01b2c80a18dd059e617f5554ee11f8a}{
virtual \hyperlink{classBunny_aac96f8b3957c2d967d5915ee512971d5}{msgType} {\bfseries mixingLayerInverse} (\hyperlink{classBunny_aac96f8b3957c2d967d5915ee512971d5}{msgType} m)=0}
\label{classBunny_ac01b2c80a18dd059e617f5554ee11f8a}

\item 
virtual \hyperlink{classBunny_aac96f8b3957c2d967d5915ee512971d5}{msgType} \hyperlink{classBunny_a3fc8dfb570ba3256768b99150af59264}{addRoundKey} (\hyperlink{classBunny_aac96f8b3957c2d967d5915ee512971d5}{msgType} m, \hyperlink{classBunny_aac96f8b3957c2d967d5915ee512971d5}{msgType} k)
\begin{DoxyCompactList}\small\item\em Add round key STEP. \end{DoxyCompactList}\item 
virtual void \hyperlink{classBunny_abc78cfde7c2bbd74199bbc34e3044413}{keySchedule} (\hyperlink{classBunny_a33ebb94ff67c39a4a14af347d1f5d619}{keyType} k)
\begin{DoxyCompactList}\small\item\em Key-\/Schedule STEP -\/ Bunny's style. \end{DoxyCompactList}\item 
\hyperlink{classBunny_a4d3368c8140d7c906daa86717bfeb05f}{sboxType} \hyperlink{classBunny_a7dc534e415ee875d9d5091a662e13b90}{extractBlock} (unsigned nblk, \hyperlink{classBunny_aac96f8b3957c2d967d5915ee512971d5}{msgType} x)
\begin{DoxyCompactList}\small\item\em Extracts nb\_\-sbox from a msgType x, i.e. extracts the block number nblk (block 0 is the rightmost) from x. \end{DoxyCompactList}\item 
\hypertarget{classBunny_a396e7be4a98e9e625031469315f48273}{
\hyperlink{classBunny_a4d3368c8140d7c906daa86717bfeb05f}{sboxType} \hyperlink{classBunny_a396e7be4a98e9e625031469315f48273}{extractFromWordToSboxType} (unsigned pos, \hyperlink{classBunny_a8e83ae2eddcaabb41e7c9a7a594a4f06}{wordType} x)}
\label{classBunny_a396e7be4a98e9e625031469315f48273}

\begin{DoxyCompactList}\small\item\em Extracts from word of type wordType nb\_\-sbox bits and return them as an sboxType. \end{DoxyCompactList}\item 
\hyperlink{classBunny_aac96f8b3957c2d967d5915ee512971d5}{msgType} \hyperlink{classBunny_afce635bfa4a75e2f0981494a0e073364}{insertBlock} (\hyperlink{classBunny_aac96f8b3957c2d967d5915ee512971d5}{msgType} m, unsigned nblk, \hyperlink{classBunny_a4d3368c8140d7c906daa86717bfeb05f}{sboxType} x)
\begin{DoxyCompactList}\small\item\em Copies the bitset x in m in the block nblk of m (to copy a string fitting the sbox size into a message). \end{DoxyCompactList}\item 
\hyperlink{classBunny_a33ebb94ff67c39a4a14af347d1f5d619}{keyType} \hyperlink{classBunny_abb77bf3cace041548a2b205e8cc3961c}{copyIntoKey} (\hyperlink{classBunny_a33ebb94ff67c39a4a14af347d1f5d619}{keyType} m, unsigned pos, \hyperlink{classBunny_a8e83ae2eddcaabb41e7c9a7a594a4f06}{wordType} x)
\begin{DoxyCompactList}\small\item\em Copies the bitset x in m at position pos (to copy a word into a key). \end{DoxyCompactList}\item 
\hyperlink{classBunny_a8e83ae2eddcaabb41e7c9a7a594a4f06}{wordType} \hyperlink{classBunny_aacd554df6207326694cc144c4324fdca}{copyIntoWord} (\hyperlink{classBunny_a8e83ae2eddcaabb41e7c9a7a594a4f06}{wordType} m, unsigned pos, \hyperlink{classBunny_a4d3368c8140d7c906daa86717bfeb05f}{sboxType} x)
\begin{DoxyCompactList}\small\item\em Copies the bitset x in m at position pos (to copy a word into a message). \end{DoxyCompactList}\item 
\hyperlink{classBunny_a8e83ae2eddcaabb41e7c9a7a594a4f06}{wordType} \hyperlink{classBunny_a9c00e8fd176a164e0f4c759954e0c9be}{extractWord} (unsigned pos, \hyperlink{classBunny_a33ebb94ff67c39a4a14af347d1f5d619}{keyType} x)
\begin{DoxyCompactList}\small\item\em Extract a word of 32 bits from a keyType element. \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Public Attributes}
\begin{DoxyCompactItemize}
\item 
\hypertarget{classBunny_a01897ce985e40b39f41540060955ce02}{
\hyperlink{classBunny_a493c28e9924920dc6422b6ec882b1f86}{roundkeyType} \hyperlink{classBunny_a01897ce985e40b39f41540060955ce02}{rk}}
\label{classBunny_a01897ce985e40b39f41540060955ce02}

\begin{DoxyCompactList}\small\item\em Contains the round keys. \end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Detailed Description}
\subsubsection*{template$<$unsigned nb\_\-msg, unsigned nb\_\-key, unsigned nb\_\-sbox, unsigned nround$>$class Bunny$<$ nb\_\-msg, nb\_\-key, nb\_\-sbox, nround $>$}

\hyperlink{classBunny}{Bunny} CLASS. 

This class allows to instantiate a block cipher working on nb\_\-msg bits, with a master key of nb\_\-key bits, whose s-\/boxes take input of nb\_\-sbox bits, and with nround rounds. 

\subsection{Constructor \& Destructor Documentation}
\hypertarget{classBunny_a5a2d0cb7a8414bc45d73995508e603f7}{
\index{Bunny@{Bunny}!Bunny@{Bunny}}
\index{Bunny@{Bunny}!Bunny@{Bunny}}
\subsubsection[{Bunny}]{\setlength{\rightskip}{0pt plus 5cm}template$<$unsigned nb\_\-msg, unsigned nb\_\-key, unsigned nb\_\-sbox, unsigned nround$>$ {\bf Bunny}$<$ nb\_\-msg, nb\_\-key, nb\_\-sbox, nround $>$::{\bf Bunny} (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}inline\mbox{]}}}}
\label{classBunny_a5a2d0cb7a8414bc45d73995508e603f7}
Allocate the space needed to fill a vector containing all the round keys. 

\subsection{Member Function Documentation}
\hypertarget{classBunny_a3fc8dfb570ba3256768b99150af59264}{
\index{Bunny@{Bunny}!addRoundKey@{addRoundKey}}
\index{addRoundKey@{addRoundKey}!Bunny@{Bunny}}
\subsubsection[{addRoundKey}]{\setlength{\rightskip}{0pt plus 5cm}template$<$unsigned nb\_\-msg, unsigned nb\_\-key, unsigned nb\_\-sbox, unsigned nround$>$ {\bf Bunny}$<$ nb\_\-msg, nb\_\-key, nb\_\-sbox, nround $>$::{\bf msgType} {\bf Bunny}$<$ nb\_\-msg, nb\_\-key, nb\_\-sbox, nround $>$::addRoundKey (
\begin{DoxyParamCaption}
\item[{{\bf msgType}}]{m, }
\item[{{\bf msgType}}]{k}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}inline, virtual\mbox{]}}}}
\label{classBunny_a3fc8dfb570ba3256768b99150af59264}


Add round key STEP. 

Sum with a round key k, which must be the same length of the message m.


\begin{DoxyItemize}
\item INPUT: a message m of type msgType, and a round key k of type msgType (the type must be the same as the message, otherwise they can't be added together)
\end{DoxyItemize}


\begin{DoxyItemize}
\item OUTPUT: the exor of m and k 
\end{DoxyItemize}

Reimplemented in \hyperlink{classBunny24m24k_a1d260ac8ef967416603e579515b1c5ea}{Bunny24m24k$<$ nb\_\-sbox, nround $>$}.

\hypertarget{classBunny_abb77bf3cace041548a2b205e8cc3961c}{
\index{Bunny@{Bunny}!copyIntoKey@{copyIntoKey}}
\index{copyIntoKey@{copyIntoKey}!Bunny@{Bunny}}
\subsubsection[{copyIntoKey}]{\setlength{\rightskip}{0pt plus 5cm}template$<$unsigned nb\_\-msg, unsigned nb\_\-key, unsigned nb\_\-sbox, unsigned nround$>$ {\bf Bunny}$<$ nb\_\-msg, nb\_\-key, nb\_\-sbox, nround $>$::{\bf keyType} {\bf Bunny}$<$ nb\_\-msg, nb\_\-key, nb\_\-sbox, nround $>$::copyIntoKey (
\begin{DoxyParamCaption}
\item[{{\bf keyType}}]{m, }
\item[{unsigned}]{pos, }
\item[{{\bf wordType}}]{x}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}inline\mbox{]}}}}
\label{classBunny_abb77bf3cace041548a2b205e8cc3961c}


Copies the bitset x in m at position pos (to copy a word into a key). 


\begin{DoxyItemize}
\item INPUT: a key m of type keyType, the position pos where to start the copy, the part x of the message to be copied of type wordType.
\end{DoxyItemize}


\begin{DoxyItemize}
\item OUTPUT: the new copy of m. 
\end{DoxyItemize}\hypertarget{classBunny_aacd554df6207326694cc144c4324fdca}{
\index{Bunny@{Bunny}!copyIntoWord@{copyIntoWord}}
\index{copyIntoWord@{copyIntoWord}!Bunny@{Bunny}}
\subsubsection[{copyIntoWord}]{\setlength{\rightskip}{0pt plus 5cm}template$<$unsigned nb\_\-msg, unsigned nb\_\-key, unsigned nb\_\-sbox, unsigned nround$>$ {\bf Bunny}$<$ nb\_\-msg, nb\_\-key, nb\_\-sbox, nround $>$::{\bf wordType} {\bf Bunny}$<$ nb\_\-msg, nb\_\-key, nb\_\-sbox, nround $>$::copyIntoWord (
\begin{DoxyParamCaption}
\item[{{\bf wordType}}]{m, }
\item[{unsigned}]{pos, }
\item[{{\bf sboxType}}]{x}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}inline\mbox{]}}}}
\label{classBunny_aacd554df6207326694cc144c4324fdca}


Copies the bitset x in m at position pos (to copy a word into a message). 


\begin{DoxyItemize}
\item INPUT: a message m of type msgType, the position pos where to start the copy, the part x of the message to be copied of type wordType.
\end{DoxyItemize}


\begin{DoxyItemize}
\item OUTPUT: the new copy of m. 
\end{DoxyItemize}\hypertarget{classBunny_abd306e727a3e0892e745a6a3829155fa}{
\index{Bunny@{Bunny}!decode@{decode}}
\index{decode@{decode}!Bunny@{Bunny}}
\subsubsection[{decode}]{\setlength{\rightskip}{0pt plus 5cm}template$<$unsigned nb\_\-msg, unsigned nb\_\-key, unsigned nb\_\-sbox, unsigned nround$>$ {\bf Bunny}$<$ nb\_\-msg, nb\_\-key, nb\_\-sbox, nround $>$::{\bf msgType} {\bf Bunny}$<$ nb\_\-msg, nb\_\-key, nb\_\-sbox, nround $>$::decode (
\begin{DoxyParamCaption}
\item[{{\bf msgType}}]{m, }
\item[{{\bf keyType}}]{k}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}inline, virtual\mbox{]}}}}
\label{classBunny_abd306e727a3e0892e745a6a3829155fa}


Decoding function for \hyperlink{classBunny}{Bunny} block cipher. 


\begin{DoxyItemize}
\item INPUT: a message m of type msgType (a bitset of dimension N) and a key k of type keyType (a bitset of dimension M).
\end{DoxyItemize}


\begin{DoxyItemize}
\item OUTPUT: an (decrypted) message c of the same type as m. 
\end{DoxyItemize}

Reimplemented in \hyperlink{classBunny24m24k_afc42636b52ad4c1352fb534d847c7e33}{Bunny24m24k$<$ nb\_\-sbox, nround $>$}, and \hyperlink{classBunnyAES_a0ffab46d67342fd171c480f50aa4b551}{BunnyAES$<$ nb\_\-key, nround $>$}.

\hypertarget{classBunny_a33e3e8dc14fe1ef814a4b611a67adf26}{
\index{Bunny@{Bunny}!encode@{encode}}
\index{encode@{encode}!Bunny@{Bunny}}
\subsubsection[{encode}]{\setlength{\rightskip}{0pt plus 5cm}template$<$unsigned nb\_\-msg, unsigned nb\_\-key, unsigned nb\_\-sbox, unsigned nround$>$ {\bf Bunny}$<$ nb\_\-msg, nb\_\-key, nb\_\-sbox, nround $>$::{\bf msgType} {\bf Bunny}$<$ nb\_\-msg, nb\_\-key, nb\_\-sbox, nround $>$::encode (
\begin{DoxyParamCaption}
\item[{{\bf msgType}}]{m, }
\item[{{\bf keyType}}]{k}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}inline, virtual\mbox{]}}}}
\label{classBunny_a33e3e8dc14fe1ef814a4b611a67adf26}


Encoding function for \hyperlink{classBunny}{Bunny} block cipher. 


\begin{DoxyItemize}
\item INPUT: a message m of type msgType (a bitset of dimension N) and a key k of type keyType (a bitset of dimension M).
\end{DoxyItemize}


\begin{DoxyItemize}
\item OUTPUT: an (encrypted) message c of the same type as m. 
\end{DoxyItemize}

Reimplemented in \hyperlink{classBunny24m24k_accce755cf12f7773c9df0a13b84fceff}{Bunny24m24k$<$ nb\_\-sbox, nround $>$}, and \hyperlink{classBunnyAES_a08021ecb7d36a7cfe4551ef49979e5e8}{BunnyAES$<$ nb\_\-key, nround $>$}.

\hypertarget{classBunny_a7dc534e415ee875d9d5091a662e13b90}{
\index{Bunny@{Bunny}!extractBlock@{extractBlock}}
\index{extractBlock@{extractBlock}!Bunny@{Bunny}}
\subsubsection[{extractBlock}]{\setlength{\rightskip}{0pt plus 5cm}template$<$unsigned nb\_\-msg, unsigned nb\_\-key, unsigned nb\_\-sbox, unsigned nround$>$ {\bf Bunny}$<$ nb\_\-msg, nb\_\-key, nb\_\-sbox, nround $>$::{\bf sboxType} {\bf Bunny}$<$ nb\_\-msg, nb\_\-key, nb\_\-sbox, nround $>$::extractBlock (
\begin{DoxyParamCaption}
\item[{unsigned}]{nblk, }
\item[{{\bf msgType}}]{x}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}inline\mbox{]}}}}
\label{classBunny_a7dc534e415ee875d9d5091a662e13b90}


Extracts nb\_\-sbox from a msgType x, i.e. extracts the block number nblk (block 0 is the rightmost) from x. 

Extracts nb\_\-sbox bits in position \mbox{[}nblk$\ast$nb\_\-sbox..nblk$\ast$nb\_\-sbox + nb\_\-sbox-\/1\mbox{]} from a string of type msgType and insert them in a string of type sboxType.

Exits from program if the position pos is negative or greater then the size of msgType minus the size of sboxType. \hypertarget{classBunny_a9c00e8fd176a164e0f4c759954e0c9be}{
\index{Bunny@{Bunny}!extractWord@{extractWord}}
\index{extractWord@{extractWord}!Bunny@{Bunny}}
\subsubsection[{extractWord}]{\setlength{\rightskip}{0pt plus 5cm}template$<$unsigned nb\_\-msg, unsigned nb\_\-key, unsigned nb\_\-sbox, unsigned nround$>$ {\bf Bunny}$<$ nb\_\-msg, nb\_\-key, nb\_\-sbox, nround $>$::{\bf wordType} {\bf Bunny}$<$ nb\_\-msg, nb\_\-key, nb\_\-sbox, nround $>$::extractWord (
\begin{DoxyParamCaption}
\item[{unsigned}]{pos, }
\item[{{\bf keyType}}]{x}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}inline\mbox{]}}}}
\label{classBunny_a9c00e8fd176a164e0f4c759954e0c9be}


Extract a word of 32 bits from a keyType element. 


\begin{DoxyItemize}
\item INPUT: a key x, and the position pos which indicates where the extraction has to be made.
\end{DoxyItemize}


\begin{DoxyItemize}
\item OUTPUT: a string y of 32 bits. 
\end{DoxyItemize}\hypertarget{classBunny_afce635bfa4a75e2f0981494a0e073364}{
\index{Bunny@{Bunny}!insertBlock@{insertBlock}}
\index{insertBlock@{insertBlock}!Bunny@{Bunny}}
\subsubsection[{insertBlock}]{\setlength{\rightskip}{0pt plus 5cm}template$<$unsigned nb\_\-msg, unsigned nb\_\-key, unsigned nb\_\-sbox, unsigned nround$>$ {\bf Bunny}$<$ nb\_\-msg, nb\_\-key, nb\_\-sbox, nround $>$::{\bf msgType} {\bf Bunny}$<$ nb\_\-msg, nb\_\-key, nb\_\-sbox, nround $>$::insertBlock (
\begin{DoxyParamCaption}
\item[{{\bf msgType}}]{m, }
\item[{unsigned}]{nblk, }
\item[{{\bf sboxType}}]{x}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}inline\mbox{]}}}}
\label{classBunny_afce635bfa4a75e2f0981494a0e073364}


Copies the bitset x in m in the block nblk of m (to copy a string fitting the sbox size into a message). 


\begin{DoxyItemize}
\item INPUT: a message m of type msgType, the position pos where to start the copy, the part x of the message to be copied of type sboxType.
\end{DoxyItemize}


\begin{DoxyItemize}
\item OUTPUT: the new copy of m. 
\end{DoxyItemize}\hypertarget{classBunny_abc78cfde7c2bbd74199bbc34e3044413}{
\index{Bunny@{Bunny}!keySchedule@{keySchedule}}
\index{keySchedule@{keySchedule}!Bunny@{Bunny}}
\subsubsection[{keySchedule}]{\setlength{\rightskip}{0pt plus 5cm}template$<$unsigned nb\_\-msg, unsigned nb\_\-key, unsigned nb\_\-sbox, unsigned nround$>$ void {\bf Bunny}$<$ nb\_\-msg, nb\_\-key, nb\_\-sbox, nround $>$::keySchedule (
\begin{DoxyParamCaption}
\item[{{\bf keyType}}]{k}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}inline, virtual\mbox{]}}}}
\label{classBunny_abc78cfde7c2bbd74199bbc34e3044413}


Key-\/Schedule STEP -\/ Bunny's style. 


\begin{DoxyItemize}
\item INPUT: a master key k of type keyType.
\end{DoxyItemize}


\begin{DoxyItemize}
\item OUTPUT: return a pointer to a vector of msgType (this elements are the round key, which must be the same length/type as the message). 
\end{DoxyItemize}

Reimplemented in \hyperlink{classBunny24m24k_af11de46df5179d16e738faaf6e204429}{Bunny24m24k$<$ nb\_\-sbox, nround $>$}, and \hyperlink{classBunnyAES_aa77172b1b2e3201a18d5f555cb9a3201}{BunnyAES$<$ nb\_\-key, nround $>$}.

\hypertarget{classBunny_abc2a9871d81718662a458253e132d93b}{
\index{Bunny@{Bunny}!sBox@{sBox}}
\index{sBox@{sBox}!Bunny@{Bunny}}
\subsubsection[{sBox}]{\setlength{\rightskip}{0pt plus 5cm}template$<$unsigned nb\_\-msg, unsigned nb\_\-key, unsigned nb\_\-sbox, unsigned nround$>$ {\bf Bunny}$<$ nb\_\-msg, nb\_\-key, nb\_\-sbox, nround $>$::{\bf msgType} {\bf Bunny}$<$ nb\_\-msg, nb\_\-key, nb\_\-sbox, nround $>$::sBox (
\begin{DoxyParamCaption}
\item[{{\bf msgType}}]{m}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}inline, virtual\mbox{]}}}}
\label{classBunny_abc2a9871d81718662a458253e132d93b}


\hyperlink{classBunny}{Bunny} S-\/box STEP. 

This function receives a message and applies the sboxes as many times as needed (using four different sbox tables):

m = (m\_\-1, m\_\-2, ..., m\_\-3) ===$>$ (sbox\_\-1(m\_\-1), sbox\_\-2(m\_\-2), ..., sbox\_\-r(m\_\-r))


\begin{DoxyItemize}
\item INPUT: a message m of type msgType.
\end{DoxyItemize}


\begin{DoxyItemize}
\item OUTPUT: the message m elaborated by the sbox. 
\end{DoxyItemize}

Reimplemented in \hyperlink{classBunnyAES_a6446341df28410a45e85f8522e691b8f}{BunnyAES$<$ nb\_\-key, nround $>$}.



The documentation for this class was generated from the following files:\begin{DoxyCompactItemize}
\item 
Headers/Bunny.h\item 
Headers/Bunny.hxx\end{DoxyCompactItemize}
