\doxysection{src/gsm/milenage/aes-\/internal.c File Reference}
\label{aes-internal_8c}\index{src/gsm/milenage/aes-\/internal.c@{src/gsm/milenage/aes-\/internal.c}}


AES (Rijndael) cipher.  


{\ttfamily \#include \char`\"{}includes.\+h\char`\"{}}\newline
{\ttfamily \#include \char`\"{}common.\+h\char`\"{}}\newline
{\ttfamily \#include \char`\"{}crypto.\+h\char`\"{}}\newline
{\ttfamily \#include \char`\"{}aes\+\_\+i.\+h\char`\"{}}\newline
\doxysubsection*{Functions}
\begin{DoxyCompactItemize}
\item 
void \textbf{ rijndael\+Key\+Setup\+Enc} (\textbf{ u32} rk[$\,$], const \textbf{ u8} cipher\+Key[$\,$])
\begin{DoxyCompactList}\small\item\em Expand the cipher key into the encryption key schedule. \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsection*{Variables}
\begin{DoxyCompactItemize}
\item 
const \textbf{ u32} \textbf{ Te0} [256]
\item 
const \textbf{ u32} \textbf{ Td0} [256]
\item 
const \textbf{ u8} \textbf{ Td4s} [256]
\item 
const \textbf{ u8} \textbf{ rcons} [$\,$]
\end{DoxyCompactItemize}


\doxysubsection{Detailed Description}
AES (Rijndael) cipher. 

Modifications to public domain implementation\+:
\begin{DoxyItemize}
\item support only 128-\/bit keys
\item cleanup
\item use C pre-\/processor to make it easier to change S table access
\item added option (AES\+\_\+\+SMALL\+\_\+\+TABLES) for reducing code size by about 8 kB at cost of reduced throughput (quite small difference on Pentium 4, 10-\/25\% when using -\/O1 or -\/O2 optimization) 
\end{DoxyItemize}

\doxysubsection{Function Documentation}
\mbox{\label{aes-internal_8c_a10668a1ca14115a010de1b8d2736ce93}} 
\index{aes-\/internal.c@{aes-\/internal.c}!rijndaelKeySetupEnc@{rijndaelKeySetupEnc}}
\index{rijndaelKeySetupEnc@{rijndaelKeySetupEnc}!aes-\/internal.c@{aes-\/internal.c}}
\doxysubsubsection{rijndaelKeySetupEnc()}
{\footnotesize\ttfamily void rijndael\+Key\+Setup\+Enc (\begin{DoxyParamCaption}\item[{\textbf{ u32}}]{rk[$\,$],  }\item[{const \textbf{ u8}}]{cipher\+Key[$\,$] }\end{DoxyParamCaption})}



Expand the cipher key into the encryption key schedule. 

\begin{DoxyReturn}{Returns}
the number of rounds for the given cipher key size. 
\end{DoxyReturn}


References \textbf{ GETU32}, \textbf{ RCON}, \textbf{ TE414}, \textbf{ TE421}, \textbf{ TE432}, and \textbf{ TE443}.



Referenced by \textbf{ aes\+\_\+encrypt\+\_\+init()}.



\doxysubsection{Variable Documentation}
\mbox{\label{aes-internal_8c_a8bbc604a49fdb22798abccc1e261b9d9}} 
\index{aes-\/internal.c@{aes-\/internal.c}!rcons@{rcons}}
\index{rcons@{rcons}!aes-\/internal.c@{aes-\/internal.c}}
\doxysubsubsection{rcons}
{\footnotesize\ttfamily const \textbf{ u8} rcons[$\,$]}

{\bfseries Initial value\+:}
\begin{DoxyCode}{0}
\DoxyCodeLine{= \{}
\DoxyCodeLine{        0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1B, 0x36}
\DoxyCodeLine{        }
\DoxyCodeLine{\}}

\end{DoxyCode}
\mbox{\label{aes-internal_8c_a617bd984c9eb22d503cc618506643ae7}} 
\index{aes-\/internal.c@{aes-\/internal.c}!Td0@{Td0}}
\index{Td0@{Td0}!aes-\/internal.c@{aes-\/internal.c}}
\doxysubsubsection{Td0}
{\footnotesize\ttfamily const \textbf{ u32} Td0[256]}

\mbox{\label{aes-internal_8c_a506d1ef74e2736ea77ac61b37e8a87d1}} 
\index{aes-\/internal.c@{aes-\/internal.c}!Td4s@{Td4s}}
\index{Td4s@{Td4s}!aes-\/internal.c@{aes-\/internal.c}}
\doxysubsubsection{Td4s}
{\footnotesize\ttfamily const \textbf{ u8} Td4s[256]}

\mbox{\label{aes-internal_8c_a256ba7f8b00895413e42ba5039ed27c5}} 
\index{aes-\/internal.c@{aes-\/internal.c}!Te0@{Te0}}
\index{Te0@{Te0}!aes-\/internal.c@{aes-\/internal.c}}
\doxysubsubsection{Te0}
{\footnotesize\ttfamily const \textbf{ u32} Te0[256]}

