\doxysection{include/osmocom/crypt/auth.h File Reference}
\label{auth_8h}\index{include/osmocom/crypt/auth.h@{include/osmocom/crypt/auth.h}}
{\ttfamily \#include $<$stdint.\+h$>$}\newline
{\ttfamily \#include $<$osmocom/core/linuxlist.\+h$>$}\newline
{\ttfamily \#include $<$osmocom/core/utils.\+h$>$}\newline
\doxysubsection*{Data Structures}
\begin{DoxyCompactItemize}
\item 
struct \textbf{ osmo\+\_\+sub\+\_\+auth\+\_\+data2}
\begin{DoxyCompactList}\small\item\em permanent (secret) subscriber auth data \end{DoxyCompactList}\item 
struct \textbf{ osmo\+\_\+sub\+\_\+auth\+\_\+data}
\item 
struct \textbf{ osmo\+\_\+auth\+\_\+vector}
\item 
struct \textbf{ osmo\+\_\+auth\+\_\+impl}
\end{DoxyCompactItemize}
\doxysubsection*{Macros}
\begin{DoxyCompactItemize}
\item 
\#define \textbf{ OSMO\+\_\+\+A5\+\_\+\+MAX\+\_\+\+KEY\+\_\+\+LEN\+\_\+\+BYTES}~(128/8)
\item 
\#define \textbf{ OSMO\+\_\+\+MILENAGE\+\_\+\+IND\+\_\+\+BITLEN\+\_\+\+MAX}~28
\item 
\#define \textbf{ OSMO\+\_\+\+AUTH\+\_\+\+ALG\+\_\+\+XOR}~\textbf{ OSMO\+\_\+\+AUTH\+\_\+\+ALG\+\_\+\+XOR\+\_\+3G}
\end{DoxyCompactItemize}
\doxysubsection*{Enumerations}
\begin{DoxyCompactItemize}
\item 
enum \textbf{ osmo\+\_\+sub\+\_\+auth\+\_\+type} \{ \newline
\textbf{ OSMO\+\_\+\+AUTH\+\_\+\+TYPE\+\_\+\+NONE} = 0x00
, \newline
\textbf{ OSMO\+\_\+\+AUTH\+\_\+\+TYPE\+\_\+\+GSM} = 0x01
, \newline
\textbf{ OSMO\+\_\+\+AUTH\+\_\+\+TYPE\+\_\+\+UMTS} = 0x02
 \}
\begin{DoxyCompactList}\small\item\em Authentication Type (GSM/\+UMTS) \end{DoxyCompactList}\item 
enum \textbf{ osmo\+\_\+auth\+\_\+algo} \{ \newline
\textbf{ OSMO\+\_\+\+AUTH\+\_\+\+ALG\+\_\+\+NONE}
, \newline
\textbf{ OSMO\+\_\+\+AUTH\+\_\+\+ALG\+\_\+\+COMP128v1}
, \newline
\textbf{ OSMO\+\_\+\+AUTH\+\_\+\+ALG\+\_\+\+COMP128v2}
, \newline
\textbf{ OSMO\+\_\+\+AUTH\+\_\+\+ALG\+\_\+\+COMP128v3}
, \newline
\textbf{ OSMO\+\_\+\+AUTH\+\_\+\+ALG\+\_\+\+XOR\+\_\+3G}
, \newline
\textbf{ OSMO\+\_\+\+AUTH\+\_\+\+ALG\+\_\+\+MILENAGE}
, \newline
\textbf{ OSMO\+\_\+\+AUTH\+\_\+\+ALG\+\_\+\+XOR\+\_\+2G}
, \newline
\textbf{ OSMO\+\_\+\+AUTH\+\_\+\+ALG\+\_\+\+TUAK}
, \newline
\textbf{ \+\_\+\+OSMO\+\_\+\+AUTH\+\_\+\+ALG\+\_\+\+NUM}
 \}
\begin{DoxyCompactList}\small\item\em Authentication Algorithm. \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsection*{Functions}
\begin{DoxyCompactItemize}
\item 
static const char $\ast$ \textbf{ osmo\+\_\+sub\+\_\+auth\+\_\+type\+\_\+name} (enum \textbf{ osmo\+\_\+sub\+\_\+auth\+\_\+type} val)
\item 
int \textbf{ osmo\+\_\+auth\+\_\+gen\+\_\+vec} (struct \textbf{ osmo\+\_\+auth\+\_\+vector} $\ast$vec, struct \textbf{ osmo\+\_\+sub\+\_\+auth\+\_\+data} $\ast$aud, const uint8\+\_\+t $\ast$\+\_\+rand)
\begin{DoxyCompactList}\small\item\em Generate authentication vector. \end{DoxyCompactList}\item 
int \textbf{ osmo\+\_\+auth\+\_\+gen\+\_\+vec2} (struct \textbf{ osmo\+\_\+auth\+\_\+vector} $\ast$vec, struct \textbf{ osmo\+\_\+sub\+\_\+auth\+\_\+data2} $\ast$aud, const uint8\+\_\+t $\ast$\+\_\+rand)
\begin{DoxyCompactList}\small\item\em Generate authentication vector. \end{DoxyCompactList}\item 
int \textbf{ osmo\+\_\+auth\+\_\+gen\+\_\+vec\+\_\+auts} (struct \textbf{ osmo\+\_\+auth\+\_\+vector} $\ast$vec, struct \textbf{ osmo\+\_\+sub\+\_\+auth\+\_\+data} $\ast$aud, const uint8\+\_\+t $\ast$auts, const uint8\+\_\+t $\ast$rand\+\_\+auts, const uint8\+\_\+t $\ast$\+\_\+rand)
\begin{DoxyCompactList}\small\item\em Generate authentication vector and re-\/sync sequence. \end{DoxyCompactList}\item 
int \textbf{ osmo\+\_\+auth\+\_\+gen\+\_\+vec\+\_\+auts2} (struct \textbf{ osmo\+\_\+auth\+\_\+vector} $\ast$vec, struct \textbf{ osmo\+\_\+sub\+\_\+auth\+\_\+data2} $\ast$aud, const uint8\+\_\+t $\ast$auts, const uint8\+\_\+t $\ast$rand\+\_\+auts, const uint8\+\_\+t $\ast$\+\_\+rand)
\begin{DoxyCompactList}\small\item\em Generate authentication vector and re-\/sync sequence. \end{DoxyCompactList}\item 
int \textbf{ osmo\+\_\+auth\+\_\+register} (struct \textbf{ osmo\+\_\+auth\+\_\+impl} $\ast$impl)
\begin{DoxyCompactList}\small\item\em Register an authentication algorithm implementation with the core. \end{DoxyCompactList}\item 
int \textbf{ osmo\+\_\+auth\+\_\+load} (const char $\ast$path)
\begin{DoxyCompactList}\small\item\em Load all available authentication plugins from the given path. \end{DoxyCompactList}\item 
int \textbf{ osmo\+\_\+auth\+\_\+supported} (enum \textbf{ osmo\+\_\+auth\+\_\+algo} algo)
\begin{DoxyCompactList}\small\item\em Determine if a given authentication algorithm is supported. \end{DoxyCompactList}\item 
void \textbf{ osmo\+\_\+c4} (uint8\+\_\+t $\ast$ck, const uint8\+\_\+t $\ast$kc)
\item 
const char $\ast$ \textbf{ osmo\+\_\+auth\+\_\+alg\+\_\+name} (enum \textbf{ osmo\+\_\+auth\+\_\+algo} alg)
\begin{DoxyCompactList}\small\item\em Get human-\/readable name of authentication algorithm. \end{DoxyCompactList}\item 
enum \textbf{ osmo\+\_\+auth\+\_\+algo} \textbf{ osmo\+\_\+auth\+\_\+alg\+\_\+parse} (const char $\ast$\textbf{ name})
\begin{DoxyCompactList}\small\item\em Parse human-\/readable name of authentication algorithm. \end{DoxyCompactList}\item 
void \textbf{ osmo\+\_\+auth\+\_\+c3} (uint8\+\_\+t kc[$\,$], const uint8\+\_\+t ck[$\,$], const uint8\+\_\+t ik[$\,$])
\item 
void \textbf{ osmo\+\_\+auth\+\_\+c2} (uint8\+\_\+t \textbf{ sres}[4], const uint8\+\_\+t $\ast$\textbf{ res}, size\+\_\+t res\+\_\+len, uint8\+\_\+t sres\+\_\+deriv\+\_\+func)
\begin{DoxyCompactList}\small\item\em Derive GSM SRES from UMTS [X]RES (auth function c2 from 3GPP TS 33.\+103 Section 6.\+8.\+1.\+2. \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsection*{Variables}
\begin{DoxyCompactItemize}
\item 
const struct \textbf{ value\+\_\+string} \textbf{ osmo\+\_\+sub\+\_\+auth\+\_\+type\+\_\+names} [$\,$]
\end{DoxyCompactItemize}
