\doxysection{include/osmocom/gsm/kasumi.h File Reference}
\label{kasumi_8h}\index{include/osmocom/gsm/kasumi.h@{include/osmocom/gsm/kasumi.h}}


KASUMI header.  


{\ttfamily \#include $<$stdint.\+h$>$}\newline
\doxysubsection*{Functions}
\begin{DoxyCompactItemize}
\item 
uint64\+\_\+t \textbf{ \+\_\+kasumi} (uint64\+\_\+t P, const uint16\+\_\+t $\ast$KLi1, const uint16\+\_\+t $\ast$KLi2, const uint16\+\_\+t $\ast$KOi1, const uint16\+\_\+t $\ast$KOi2, const uint16\+\_\+t $\ast$KOi3, const uint16\+\_\+t $\ast$KIi1, const uint16\+\_\+t $\ast$KIi2, const uint16\+\_\+t $\ast$KIi3)
\begin{DoxyCompactList}\small\item\em Single iteration of KASUMI cipher. \end{DoxyCompactList}\item 
void \textbf{ \+\_\+kasumi\+\_\+kgcore} (uint8\+\_\+t CA, uint8\+\_\+t cb, uint32\+\_\+t cc, uint8\+\_\+t cd, const uint8\+\_\+t $\ast$ck, uint8\+\_\+t $\ast$co, uint16\+\_\+t cl)
\begin{DoxyCompactList}\small\item\em Implementation of the KGCORE algorithm (used by A5/3, A5/4, GEA3, GEA4 and ECSD) \end{DoxyCompactList}\item 
void \textbf{ \+\_\+kasumi\+\_\+key\+\_\+expand} (const uint8\+\_\+t $\ast$key, uint16\+\_\+t $\ast$KLi1, uint16\+\_\+t $\ast$KLi2, uint16\+\_\+t $\ast$KOi1, uint16\+\_\+t $\ast$KOi2, uint16\+\_\+t $\ast$KOi3, uint16\+\_\+t $\ast$KIi1, uint16\+\_\+t $\ast$KIi2, uint16\+\_\+t $\ast$KIi3)
\begin{DoxyCompactList}\small\item\em Expand key into set of subkeys -\/ see TS 135 202 for details. \end{DoxyCompactList}\end{DoxyCompactItemize}


\doxysubsection{Detailed Description}
KASUMI header. 

See kasumi.\+c for details The parameters are described in TS 135 202. 

\doxysubsection{Function Documentation}
\mbox{\label{kasumi_8h_a2906bf96a99f461b77b059e26ff99e51}} 
\index{kasumi.h@{kasumi.h}!\_kasumi@{\_kasumi}}
\index{\_kasumi@{\_kasumi}!kasumi.h@{kasumi.h}}
\doxysubsubsection{\_kasumi()}
{\footnotesize\ttfamily uint64\+\_\+t \+\_\+kasumi (\begin{DoxyParamCaption}\item[{uint64\+\_\+t}]{P,  }\item[{const uint16\+\_\+t $\ast$}]{KLi1,  }\item[{const uint16\+\_\+t $\ast$}]{KLi2,  }\item[{const uint16\+\_\+t $\ast$}]{KOi1,  }\item[{const uint16\+\_\+t $\ast$}]{KOi2,  }\item[{const uint16\+\_\+t $\ast$}]{KOi3,  }\item[{const uint16\+\_\+t $\ast$}]{KIi1,  }\item[{const uint16\+\_\+t $\ast$}]{KIi2,  }\item[{const uint16\+\_\+t $\ast$}]{KIi3 }\end{DoxyParamCaption})}



Single iteration of KASUMI cipher. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em P} & Block, 64 bits to be processed in this round \\
\hline
\mbox{\texttt{ in}}  & {\em KLi1} & Expanded subkeys \\
\hline
\mbox{\texttt{ in}}  & {\em KLi2} & Expanded subkeys \\
\hline
\mbox{\texttt{ in}}  & {\em KOi1} & Expanded subkeys \\
\hline
\mbox{\texttt{ in}}  & {\em KOi2} & Expanded subkeys \\
\hline
\mbox{\texttt{ in}}  & {\em KOi3} & Expanded subkeys \\
\hline
\mbox{\texttt{ in}}  & {\em KIi1} & Expanded subkeys \\
\hline
\mbox{\texttt{ in}}  & {\em KIi2} & Expanded subkeys \\
\hline
\mbox{\texttt{ in}}  & {\em KIi3} & Expanded subkeys \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
processed block of 64 bits 
\end{DoxyReturn}


References \textbf{ kasumi\+\_\+\+FL()}, \textbf{ kasumi\+\_\+\+FO()}, \textbf{ L}, and \textbf{ R}.



Referenced by \textbf{ \+\_\+kasumi\+\_\+kgcore()}.

\mbox{\label{kasumi_8h_a079092d857712a160578b4a31deb1fb0}} 
\index{kasumi.h@{kasumi.h}!\_kasumi\_key\_expand@{\_kasumi\_key\_expand}}
\index{\_kasumi\_key\_expand@{\_kasumi\_key\_expand}!kasumi.h@{kasumi.h}}
\doxysubsubsection{\_kasumi\_key\_expand()}
{\footnotesize\ttfamily void \+\_\+kasumi\+\_\+key\+\_\+expand (\begin{DoxyParamCaption}\item[{const uint8\+\_\+t $\ast$}]{key,  }\item[{uint16\+\_\+t $\ast$}]{KLi1,  }\item[{uint16\+\_\+t $\ast$}]{KLi2,  }\item[{uint16\+\_\+t $\ast$}]{KOi1,  }\item[{uint16\+\_\+t $\ast$}]{KOi2,  }\item[{uint16\+\_\+t $\ast$}]{KOi3,  }\item[{uint16\+\_\+t $\ast$}]{KIi1,  }\item[{uint16\+\_\+t $\ast$}]{KIi2,  }\item[{uint16\+\_\+t $\ast$}]{KIi3 }\end{DoxyParamCaption})}



Expand key into set of subkeys -\/ see TS 135 202 for details. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em key} & (128 bits) as array of bytes \\
\hline
\mbox{\texttt{ out}}  & {\em KLi1} & Expanded subkeys \\
\hline
\mbox{\texttt{ out}}  & {\em KLi2} & Expanded subkeys \\
\hline
\mbox{\texttt{ out}}  & {\em KOi1} & Expanded subkeys \\
\hline
\mbox{\texttt{ out}}  & {\em KOi2} & Expanded subkeys \\
\hline
\mbox{\texttt{ out}}  & {\em KOi3} & Expanded subkeys \\
\hline
\mbox{\texttt{ out}}  & {\em KIi1} & Expanded subkeys \\
\hline
\mbox{\texttt{ out}}  & {\em KIi2} & Expanded subkeys \\
\hline
\mbox{\texttt{ out}}  & {\em KIi3} & Expanded subkeys \\
\hline
\end{DoxyParams}


References \textbf{ osmo\+\_\+rol16()}.



Referenced by \textbf{ \+\_\+kasumi\+\_\+kgcore()}.

\mbox{\label{kasumi_8h_a998653393498a3aa3f4f8f624468741f}} 
\index{kasumi.h@{kasumi.h}!\_kasumi\_kgcore@{\_kasumi\_kgcore}}
\index{\_kasumi\_kgcore@{\_kasumi\_kgcore}!kasumi.h@{kasumi.h}}
\doxysubsubsection{\_kasumi\_kgcore()}
{\footnotesize\ttfamily void \+\_\+kasumi\+\_\+kgcore (\begin{DoxyParamCaption}\item[{uint8\+\_\+t}]{CA,  }\item[{uint8\+\_\+t}]{cb,  }\item[{uint32\+\_\+t}]{cc,  }\item[{uint8\+\_\+t}]{cd,  }\item[{const uint8\+\_\+t $\ast$}]{ck,  }\item[{uint8\+\_\+t $\ast$}]{co,  }\item[{uint16\+\_\+t}]{cl }\end{DoxyParamCaption})}



Implementation of the KGCORE algorithm (used by A5/3, A5/4, GEA3, GEA4 and ECSD) 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em CA} & \\
\hline
\mbox{\texttt{ in}}  & {\em cb} & \\
\hline
\mbox{\texttt{ in}}  & {\em cc} & \\
\hline
\mbox{\texttt{ in}}  & {\em cd} & \\
\hline
\mbox{\texttt{ in}}  & {\em ck} & 8-\/bytes long key \\
\hline
\mbox{\texttt{ out}}  & {\em co} & cl-\/dependent \\
\hline
\mbox{\texttt{ in}}  & {\em cl} & \\
\hline
\end{DoxyParams}


References \textbf{ \+\_\+kasumi()}, and \textbf{ \+\_\+kasumi\+\_\+key\+\_\+expand()}.



Referenced by \textbf{ \+\_\+a5\+\_\+4()}, and \textbf{ gea4()}.

