\hypertarget{classBunny24m24k}{
\section{Bunny24m24k$<$ nb\_\-sbox, nround $>$ Class Template Reference}
\label{classBunny24m24k}\index{Bunny24m24k@{Bunny24m24k}}
}


\hyperlink{classBunny24m24k}{Bunny24m24k} CLASS.  




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

Inheritance diagram for Bunny24m24k$<$ nb\_\-sbox, nround $>$:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[height=2.000000cm]{classBunny24m24k}
\end{center}
\end{figure}
\subsection*{Public Types}
\begin{DoxyCompactItemize}
\item 
\hypertarget{classBunny24m24k_ae1afc189af839d36c7d8eaf3e726456d}{
typedef \hyperlink{classBunny}{Bunny}$<$ 24, 24, nb\_\-sbox, nround $>$ {\bfseries BUNNY}}
\label{classBunny24m24k_ae1afc189af839d36c7d8eaf3e726456d}

\item 
\hypertarget{classBunny24m24k_afd071bfd74907ad82312a08518a7ccf8}{
typedef \hyperlink{classBunny_aac96f8b3957c2d967d5915ee512971d5}{BUNNY::msgType} \hyperlink{classBunny24m24k_afd071bfd74907ad82312a08518a7ccf8}{msgType}}
\label{classBunny24m24k_afd071bfd74907ad82312a08518a7ccf8}

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

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

\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{classBunny24m24k_a332bda89508546d1bcf8f406e1ba0eea}{
typedef \hyperlink{classBunny_a8e83ae2eddcaabb41e7c9a7a594a4f06}{BUNNY::wordType} \hyperlink{classBunny24m24k_a332bda89508546d1bcf8f406e1ba0eea}{wordType}}
\label{classBunny24m24k_a332bda89508546d1bcf8f406e1ba0eea}

\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{classBunny24m24k_a75814424c3056925c01012284a41c3bf}{
typedef \hyperlink{classBunny_a493c28e9924920dc6422b6ec882b1f86}{BUNNY::roundkeyType} \hyperlink{classBunny24m24k_a75814424c3056925c01012284a41c3bf}{roundkeyType}}
\label{classBunny24m24k_a75814424c3056925c01012284a41c3bf}

\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{classBunny24m24k_a3a2d629849f419652a7ad9dfcef29c7b}{Bunny24m24k} ()
\begin{DoxyCompactList}\small\item\em Constructor. \end{DoxyCompactList}\item 
virtual \hyperlink{classBunny24m24k_afd071bfd74907ad82312a08518a7ccf8}{msgType} \hyperlink{classBunny24m24k_accce755cf12f7773c9df0a13b84fceff}{encode} (\hyperlink{classBunny24m24k_afd071bfd74907ad82312a08518a7ccf8}{msgType} m, \hyperlink{classBunny24m24k_a47e685f681fa25dc880c2e4f65d7bc52}{keyType} k)
\item 
virtual \hyperlink{classBunny24m24k_afd071bfd74907ad82312a08518a7ccf8}{msgType} \hyperlink{classBunny24m24k_afc42636b52ad4c1352fb534d847c7e33}{decode} (\hyperlink{classBunny24m24k_afd071bfd74907ad82312a08518a7ccf8}{msgType} m, \hyperlink{classBunny24m24k_a47e685f681fa25dc880c2e4f65d7bc52}{keyType} k)
\item 
virtual \hyperlink{classBunny24m24k_a8bc73726ec4b47383285b412b3353932}{sboxType} \hyperlink{classBunny24m24k_aad5042ed6c1c99069d5c203dbda3b991}{sbox} (unsigned nbox, \hyperlink{classBunny24m24k_a8bc73726ec4b47383285b412b3353932}{sboxType} x)
\begin{DoxyCompactList}\small\item\em S-\/Boxes. \end{DoxyCompactList}\item 
\hypertarget{classBunny24m24k_ad4f68d90058a35b23081ff60563ae3fb}{
virtual \hyperlink{classBunny24m24k_a8bc73726ec4b47383285b412b3353932}{sboxType} \hyperlink{classBunny24m24k_ad4f68d90058a35b23081ff60563ae3fb}{sboxInverse} (unsigned nbox, \hyperlink{classBunny24m24k_a8bc73726ec4b47383285b412b3353932}{sboxType} x)}
\label{classBunny24m24k_ad4f68d90058a35b23081ff60563ae3fb}

\begin{DoxyCompactList}\small\item\em Inverse of the S-\/Boxes. \end{DoxyCompactList}\item 
virtual \hyperlink{classBunny24m24k_afd071bfd74907ad82312a08518a7ccf8}{msgType} \hyperlink{classBunny24m24k_ada19492873bf0a0309b96377971d0ea5}{mixingLayer} (\hyperlink{classBunny24m24k_afd071bfd74907ad82312a08518a7ccf8}{msgType} m)
\item 
virtual \hyperlink{classBunny24m24k_afd071bfd74907ad82312a08518a7ccf8}{msgType} \hyperlink{classBunny24m24k_a2f6ab90e0c8be0d35d038751c1f11e09}{mixingLayerInverse} (\hyperlink{classBunny24m24k_afd071bfd74907ad82312a08518a7ccf8}{msgType} m)
\item 
virtual \hyperlink{classBunny24m24k_afd071bfd74907ad82312a08518a7ccf8}{msgType} \hyperlink{classBunny24m24k_a1d260ac8ef967416603e579515b1c5ea}{addRoundKey} (\hyperlink{classBunny24m24k_afd071bfd74907ad82312a08518a7ccf8}{msgType} m, \hyperlink{classBunny24m24k_afd071bfd74907ad82312a08518a7ccf8}{msgType} k)
\item 
virtual void \hyperlink{classBunny24m24k_af11de46df5179d16e738faaf6e204429}{keySchedule} (\hyperlink{classBunny24m24k_a47e685f681fa25dc880c2e4f65d7bc52}{keyType} k)
\end{DoxyCompactItemize}
\subsection*{Public Attributes}
\begin{DoxyCompactItemize}
\item 
\hypertarget{classBunny24m24k_a5d624beabf12ec447623650adcb3b1d7}{
\hyperlink{classBunny24m24k_a75814424c3056925c01012284a41c3bf}{roundkeyType} \hyperlink{classBunny24m24k_a5d624beabf12ec447623650adcb3b1d7}{rk}}
\label{classBunny24m24k_a5d624beabf12ec447623650adcb3b1d7}

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


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

\hyperlink{classBunny24m24k}{Bunny24m24k} CLASS. 

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

\subsection{Constructor \& Destructor Documentation}
\hypertarget{classBunny24m24k_a3a2d629849f419652a7ad9dfcef29c7b}{
\index{Bunny24m24k@{Bunny24m24k}!Bunny24m24k@{Bunny24m24k}}
\index{Bunny24m24k@{Bunny24m24k}!Bunny24m24k@{Bunny24m24k}}
\subsubsection[{Bunny24m24k}]{\setlength{\rightskip}{0pt plus 5cm}template$<$unsigned nb\_\-sbox, unsigned nround$>$ {\bf Bunny24m24k}$<$ nb\_\-sbox, nround $>$::{\bf Bunny24m24k} (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}inline\mbox{]}}}}
\label{classBunny24m24k_a3a2d629849f419652a7ad9dfcef29c7b}


Constructor. 

Allocate the space needed to fill a vector containing all the round keys. 

\subsection{Member Function Documentation}
\hypertarget{classBunny24m24k_a1d260ac8ef967416603e579515b1c5ea}{
\index{Bunny24m24k@{Bunny24m24k}!addRoundKey@{addRoundKey}}
\index{addRoundKey@{addRoundKey}!Bunny24m24k@{Bunny24m24k}}
\subsubsection[{addRoundKey}]{\setlength{\rightskip}{0pt plus 5cm}template$<$unsigned nb\_\-sbox, unsigned nround$>$ {\bf Bunny24m24k}$<$ nb\_\-sbox, nround $>$::{\bf msgType} {\bf Bunny24m24k}$<$ 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{classBunny24m24k_a1d260ac8ef967416603e579515b1c5ea}
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 from \hyperlink{classBunny_a3fc8dfb570ba3256768b99150af59264}{Bunny$<$ 24, 24, nb\_\-sbox, nround $>$}.

\hypertarget{classBunny24m24k_afc42636b52ad4c1352fb534d847c7e33}{
\index{Bunny24m24k@{Bunny24m24k}!decode@{decode}}
\index{decode@{decode}!Bunny24m24k@{Bunny24m24k}}
\subsubsection[{decode}]{\setlength{\rightskip}{0pt plus 5cm}template$<$unsigned nb\_\-sbox, unsigned nround$>$ {\bf Bunny24m24k}$<$ nb\_\-sbox, nround $>$::{\bf msgType} {\bf Bunny24m24k}$<$ 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{classBunny24m24k_afc42636b52ad4c1352fb534d847c7e33}
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 from \hyperlink{classBunny_abd306e727a3e0892e745a6a3829155fa}{Bunny$<$ 24, 24, nb\_\-sbox, nround $>$}.

\hypertarget{classBunny24m24k_accce755cf12f7773c9df0a13b84fceff}{
\index{Bunny24m24k@{Bunny24m24k}!encode@{encode}}
\index{encode@{encode}!Bunny24m24k@{Bunny24m24k}}
\subsubsection[{encode}]{\setlength{\rightskip}{0pt plus 5cm}template$<$unsigned nb\_\-sbox, unsigned nround$>$ {\bf Bunny24m24k}$<$ nb\_\-sbox, nround $>$::{\bf msgType} {\bf Bunny24m24k}$<$ 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{classBunny24m24k_accce755cf12f7773c9df0a13b84fceff}
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 from \hyperlink{classBunny_a33e3e8dc14fe1ef814a4b611a67adf26}{Bunny$<$ 24, 24, nb\_\-sbox, nround $>$}.

\hypertarget{classBunny24m24k_af11de46df5179d16e738faaf6e204429}{
\index{Bunny24m24k@{Bunny24m24k}!keySchedule@{keySchedule}}
\index{keySchedule@{keySchedule}!Bunny24m24k@{Bunny24m24k}}
\subsubsection[{keySchedule}]{\setlength{\rightskip}{0pt plus 5cm}template$<$unsigned nb\_\-sbox, unsigned nround$>$ void {\bf Bunny24m24k}$<$ nb\_\-sbox, nround $>$::keySchedule (
\begin{DoxyParamCaption}
\item[{{\bf keyType}}]{k}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}inline, virtual\mbox{]}}}}
\label{classBunny24m24k_af11de46df5179d16e738faaf6e204429}
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 from \hyperlink{classBunny_abc78cfde7c2bbd74199bbc34e3044413}{Bunny$<$ 24, 24, nb\_\-sbox, nround $>$}.

\hypertarget{classBunny24m24k_ada19492873bf0a0309b96377971d0ea5}{
\index{Bunny24m24k@{Bunny24m24k}!mixingLayer@{mixingLayer}}
\index{mixingLayer@{mixingLayer}!Bunny24m24k@{Bunny24m24k}}
\subsubsection[{mixingLayer}]{\setlength{\rightskip}{0pt plus 5cm}template$<$unsigned nb\_\-sbox, unsigned nround$>$ {\bf Bunny24m24k}$<$ nb\_\-sbox, nround $>$::{\bf msgType} {\bf Bunny24m24k}$<$ nb\_\-sbox, nround $>$::mixingLayer (
\begin{DoxyParamCaption}
\item[{{\bf msgType}}]{m}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}inline, virtual\mbox{]}}}}
\label{classBunny24m24k_ada19492873bf0a0309b96377971d0ea5}
Mixing-\/Layer STEP.

It is always a linear function, which in the case of \hyperlink{classBunny}{Bunny} block cipher it is implemented as a multiplication by a 24x24 matrix.


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


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

Implements \hyperlink{classBunny}{Bunny$<$ 24, 24, nb\_\-sbox, nround $>$}.

\hypertarget{classBunny24m24k_a2f6ab90e0c8be0d35d038751c1f11e09}{
\index{Bunny24m24k@{Bunny24m24k}!mixingLayerInverse@{mixingLayerInverse}}
\index{mixingLayerInverse@{mixingLayerInverse}!Bunny24m24k@{Bunny24m24k}}
\subsubsection[{mixingLayerInverse}]{\setlength{\rightskip}{0pt plus 5cm}template$<$unsigned nb\_\-sbox, unsigned nround$>$ {\bf Bunny24m24k}$<$ nb\_\-sbox, nround $>$::{\bf msgType} {\bf Bunny24m24k}$<$ nb\_\-sbox, nround $>$::mixingLayerInverse (
\begin{DoxyParamCaption}
\item[{{\bf msgType}}]{m}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}inline, virtual\mbox{]}}}}
\label{classBunny24m24k_a2f6ab90e0c8be0d35d038751c1f11e09}
Mixing-\/Layer Inverse STEP. 

Implements \hyperlink{classBunny}{Bunny$<$ 24, 24, nb\_\-sbox, nround $>$}.

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


S-\/Boxes. 

S-\/box 1.

$ x^{62} $ over $ F_2^6 $ where $ F $ is the field $ {0,1} $ -\/-\/$>$ Equivalent to Inversion.

This sbox is 4-\/differential and weakly APN.

EX:

000000 -\/$>$ 000000

000010 -\/$>$ 101101 ...

bitset$<$6$>$ s1\_\-table\mbox{[}2\mbox{]} = \{

000000,000001,101101,110110,111011,010010,011011,011110,110000,001010,001001,110001,100000,111110,001111,001110,

011000,110011,000101,111010,101001,111000,110101,100011,010000,110010,011111,000110,101010,100110,000111,011010,

001100,111111,110100,010111,101111,111101,011101,101011,111001,010100,011100,100111,110111,000010,111100,100100,

001000,001011,011001,010001,100010,010110,000011,101100,010101,101000,010011,000100,101110,100101,001101,100001 \};

-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/

S-\/box 2.

$ x^5 $ over $ F_2^6 $ where $ F $ is the field $ {0,1} $ .

This sbox is 4-\/differential, but NO weakly APN.

EX: 000000 -\/$>$ 000000

000010 -\/$>$ 100000 ...

bitset$<$6$>$ s2\_\-table\mbox{[}64\mbox{]} = \{

000000,000001,100000,110011,110001,000011,111111,011111,100100,000100,111011,001001,111110,101101,001111,001110,

000111,000101,110110,100110,001000,111001,010111,110100,011110,111101,010000,100001,111010,101010,011010,011000,

001101,101011,010110,100010,101001,111100,011100,011011,110111,110000,010011,000110,111000,001100,110010,010100,

101111,001010,100101,010010,110101,100011,010001,010101,101000,101100,011101,001011,011001,101110,000010,100111\};

-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/

S-\/box 3.

$ x^17 $ over $ F_2^6 $ where $ F $ is the field $ {0,1} $ .

This sbox is 4-\/differential, but NO weakly APN.

EX:

000000 -\/$>$ 000000

000010 -\/$>$ 100110 ...

-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/

S-\/box 4.

$ x^62 + e^2 $ over $ F_2^6 $ where $ F $ is the field $ {0,1} $ .

This sbox is 4-\/differential, and weakly APN.

EX:

000000 -\/$>$ 000000

000010 -\/$>$ ... 

Implements \hyperlink{classBunny}{Bunny$<$ 24, 24, nb\_\-sbox, nround $>$}.



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