\doxysection{src/gsm/tuak/tuak.c File Reference}
\label{tuak_8c}\index{src/gsm/tuak/tuak.c@{src/gsm/tuak/tuak.c}}
{\ttfamily \#include $<$stdint.\+h$>$}\newline
{\ttfamily \#include $<$string.\+h$>$}\newline
{\ttfamily \#include $<$errno.\+h$>$}\newline
{\ttfamily \#include $<$osmocom/core/utils.\+h$>$}\newline
{\ttfamily \#include \char`\"{}Keccak\+P-\/1600-\/3gpp.\+h\char`\"{}}\newline
\doxysubsection*{Macros}
\begin{DoxyCompactItemize}
\item 
\#define \textbf{ PUSH\+\_\+\+DATA}(buf,  idx,  input,  nbytes)
\end{DoxyCompactItemize}
\doxysubsection*{Functions}
\begin{DoxyCompactItemize}
\item 
void \textbf{ tuak\+\_\+set\+\_\+keccak\+\_\+iterations} (unsigned int i)
\item 
void \textbf{ memcpy\+\_\+reverse} (uint8\+\_\+t $\ast$dst, const uint8\+\_\+t $\ast$src, size\+\_\+t \textbf{ len})
\item 
static void \textbf{ tuak\+\_\+core} (uint8\+\_\+t buf[200], const uint8\+\_\+t $\ast$opc, uint8\+\_\+t instance, const uint8\+\_\+t $\ast$\+\_\+rand, const uint8\+\_\+t $\ast$amf, const uint8\+\_\+t $\ast$sqn, const uint8\+\_\+t $\ast$k, uint8\+\_\+t k\+\_\+len\+\_\+bytes, unsigned int keccac\+\_\+iterations)
\item 
int \textbf{ tuak\+\_\+f1} (const uint8\+\_\+t $\ast$opc, const uint8\+\_\+t $\ast$k, uint8\+\_\+t k\+\_\+len\+\_\+bytes, const uint8\+\_\+t $\ast$\+\_\+rand, const uint8\+\_\+t $\ast$sqn, const uint8\+\_\+t $\ast$amf, uint8\+\_\+t $\ast$mac\+\_\+a, uint8\+\_\+t mac\+\_\+a\+\_\+len\+\_\+bytes, unsigned int keccac\+\_\+iterations)
\begin{DoxyCompactList}\small\item\em tuak\+\_\+f1 -\/ TUAK f1 algorithm @opc\+: OPc = 256-\/bit value derived from OP and K @k\+: K = 128-\/bit or 256-\/bit subscriber key @\+\_\+rand\+: RAND = 128-\/bit random challenge @sqn\+: SQN = 48-\/bit sequence number @amf\+: AMF = 16-\/bit authentication management field @mac\+\_\+a\+: Buffer for MAC-\/A = 64/128/256-\/bit network authentication code Returns\+: 0 on success, -\/1 on failure \end{DoxyCompactList}\item 
int \textbf{ tuak\+\_\+f1star} (const uint8\+\_\+t $\ast$opc, const uint8\+\_\+t $\ast$k, uint8\+\_\+t k\+\_\+len\+\_\+bytes, const uint8\+\_\+t $\ast$\+\_\+rand, const uint8\+\_\+t $\ast$sqn, const uint8\+\_\+t $\ast$amf, uint8\+\_\+t $\ast$mac\+\_\+s, uint8\+\_\+t mac\+\_\+s\+\_\+len\+\_\+bytes, unsigned int keccac\+\_\+iterations)
\begin{DoxyCompactList}\small\item\em tuak\+\_\+f1star -\/ TUAK f1$\ast$ algorithm @opc\+: OPc = 256-\/bit value derived from OP and K @k\+: K = 128-\/bit or 256-\/bit subscriber key @\+\_\+rand\+: RAND = 128-\/bit random challenge @sqn\+: SQN = 48-\/bit sequence number @amf\+: AMF = 16-\/bit authentication management field @mac\+\_\+s\+: Buffer for MAC-\/S = 64/128/256-\/bit resync authentication code Returns\+: 0 on success, -\/1 on failure \end{DoxyCompactList}\item 
int \textbf{ tuak\+\_\+f2345} (const uint8\+\_\+t $\ast$opc, const uint8\+\_\+t $\ast$k, uint8\+\_\+t k\+\_\+len\+\_\+bytes, const uint8\+\_\+t $\ast$\+\_\+rand, uint8\+\_\+t $\ast$\textbf{ res}, uint8\+\_\+t res\+\_\+len\+\_\+bytes, uint8\+\_\+t $\ast$ck, uint8\+\_\+t ck\+\_\+len\+\_\+bytes, uint8\+\_\+t $\ast$ik, uint8\+\_\+t ik\+\_\+len\+\_\+bytes, uint8\+\_\+t $\ast$ak, unsigned int keccac\+\_\+iterations)
\begin{DoxyCompactList}\small\item\em tuak\+\_\+f2345 -\/ TUAK f2, f3, f4, f5, algorithms @opc\+: OPc = 256-\/bit value derived from OP and K @k\+: K = 128/256-\/bit subscriber key @\+\_\+rand\+: RAND = 128-\/bit random challenge @res\+: Buffer for RES = 32/64/128/256-\/bit signed response (f2), or NULL @ck\+: Buffer for CK = 128/256-\/bit confidentiality key (f3), or NULL @ik\+: Buffer for IK = 128/256-\/bit integrity key (f4), or NULL @ak\+: Buffer for AK = 48-\/bit anonymity key (f5), or NULL Returns\+: 0 on success, -\/1 on failure \end{DoxyCompactList}\item 
int \textbf{ tuak\+\_\+f5star} (const uint8\+\_\+t $\ast$opc, const uint8\+\_\+t $\ast$k, uint8\+\_\+t k\+\_\+len\+\_\+bytes, const uint8\+\_\+t $\ast$\+\_\+rand, uint8\+\_\+t $\ast$ak, unsigned int keccac\+\_\+iterations)
\begin{DoxyCompactList}\small\item\em tuak\+\_\+f5star -\/ TUAK f5$\ast$ algorithm @opc\+: OPc = 256-\/bit value derived from OP and K @k\+: K = 128/256-\/bit subscriber key @\+\_\+rand\+: RAND = 128-\/bit random challenge @ak\+: Buffer for AK = 48-\/bit anonymity key (f5) Returns\+: 0 on success, -\/1 on failure \end{DoxyCompactList}\item 
void \textbf{ tuak\+\_\+generate} (const uint8\+\_\+t $\ast$opc, const uint8\+\_\+t $\ast$amf, const uint8\+\_\+t $\ast$k, uint8\+\_\+t k\+\_\+len\+\_\+bytes, const uint8\+\_\+t $\ast$sqn, const uint8\+\_\+t $\ast$\+\_\+rand, uint8\+\_\+t $\ast$autn, uint8\+\_\+t $\ast$ik, uint8\+\_\+t $\ast$ck, uint8\+\_\+t $\ast$\textbf{ res}, size\+\_\+t $\ast$res\+\_\+len)
\begin{DoxyCompactList}\small\item\em tuak\+\_\+generate -\/ Generate AKA AUTN,IK,CK,RES @opc\+: OPc = 256-\/bit operator variant algorithm configuration field (encr.) @amf\+: AMF = 16-\/bit authentication management field @k\+: K = 128/256-\/bit subscriber key @sqn\+: SQN = 48-\/bit sequence number @\+\_\+rand\+: RAND = 128-\/bit random challenge @autn\+: Buffer for AUTN = 128-\/bit authentication token @ik\+: Buffer for IK = 128/256-\/bit integrity key (f4), or NULL @ck\+: Buffer for CK = 128/256-\/bit confidentiality key (f3), or NULL @res\+: Buffer for RES = 32/64/128-\/bit signed response (f2), or NULL @res\+\_\+len\+: Max length for res; set to used length or 0 on failure \end{DoxyCompactList}\item 
int \textbf{ tuak\+\_\+auts} (const uint8\+\_\+t $\ast$opc, const uint8\+\_\+t $\ast$k, uint8\+\_\+t k\+\_\+len\+\_\+bytes, const uint8\+\_\+t $\ast$\+\_\+rand, const uint8\+\_\+t $\ast$auts, uint8\+\_\+t $\ast$sqn)
\begin{DoxyCompactList}\small\item\em tuak\+\_\+auts -\/ Milenage AUTS validation @opc\+: OPc = 256-\/bit operator variant algorithm configuration field (encr.) @k\+: K = 128/256-\/bit subscriber key @\+\_\+rand\+: RAND = 128-\/bit random challenge @auts\+: AUTS = 112-\/bit authentication token from client @sqn\+: Buffer for SQN = 48-\/bit sequence number Returns\+: 0 = success (sqn filled), -\/1 on failure \end{DoxyCompactList}\item 
int \textbf{ tuak\+\_\+opc\+\_\+gen} (uint8\+\_\+t $\ast$opc, const uint8\+\_\+t $\ast$k, uint8\+\_\+t k\+\_\+len\+\_\+bytes, const uint8\+\_\+t $\ast$op)
\end{DoxyCompactItemize}
\doxysubsection*{Variables}
\begin{DoxyCompactItemize}
\item 
static unsigned int \textbf{ g\+\_\+keccak\+\_\+iterations} = 1
\item 
static const char \textbf{ algoname} [$\,$] = \char`\"{}TUAK1.\+0\char`\"{}
\item 
const uint8\+\_\+t \textbf{ zero16} [16] = \{ 0, \}
\end{DoxyCompactItemize}


\doxysubsection{Macro Definition Documentation}
\mbox{\label{tuak_8c_a0c092a9565e2d797708602d0732933fc}} 
\index{tuak.c@{tuak.c}!PUSH\_DATA@{PUSH\_DATA}}
\index{PUSH\_DATA@{PUSH\_DATA}!tuak.c@{tuak.c}}
\doxysubsubsection{PUSH\_DATA}
{\footnotesize\ttfamily \#define PUSH\+\_\+\+DATA(\begin{DoxyParamCaption}\item[{}]{buf,  }\item[{}]{idx,  }\item[{}]{input,  }\item[{}]{nbytes }\end{DoxyParamCaption})}

{\bfseries Value\+:}
\begin{DoxyCode}{0}
\DoxyCodeLine{        \textcolor{keywordflow}{for} (\textcolor{keywordtype}{int} i = nbytes-\/1; i >= 0; i-\/-\/) \{   \(\backslash\)}
\DoxyCodeLine{                buf[idx++] = input[i];          \(\backslash\)}
\DoxyCodeLine{        \}}

\end{DoxyCode}


\doxysubsection{Function Documentation}
\mbox{\label{tuak_8c_a91a40c818f7e8ad7e24338d7814efd3a}} 
\index{tuak.c@{tuak.c}!memcpy\_reverse@{memcpy\_reverse}}
\index{memcpy\_reverse@{memcpy\_reverse}!tuak.c@{tuak.c}}
\doxysubsubsection{memcpy\_reverse()}
{\footnotesize\ttfamily void memcpy\+\_\+reverse (\begin{DoxyParamCaption}\item[{uint8\+\_\+t $\ast$}]{dst,  }\item[{const uint8\+\_\+t $\ast$}]{src,  }\item[{size\+\_\+t}]{len }\end{DoxyParamCaption})}



References \textbf{ len}.



Referenced by \textbf{ tuak\+\_\+f1()}, \textbf{ tuak\+\_\+f1star()}, \textbf{ tuak\+\_\+f2345()}, \textbf{ tuak\+\_\+f5star()}, and \textbf{ tuak\+\_\+opc\+\_\+gen()}.

\mbox{\label{tuak_8c_a0e446ef4b03720862d856fefee045a96}} 
\index{tuak.c@{tuak.c}!tuak\_auts@{tuak\_auts}}
\index{tuak\_auts@{tuak\_auts}!tuak.c@{tuak.c}}
\doxysubsubsection{tuak\_auts()}
{\footnotesize\ttfamily int tuak\+\_\+auts (\begin{DoxyParamCaption}\item[{const uint8\+\_\+t $\ast$}]{opc,  }\item[{const uint8\+\_\+t $\ast$}]{k,  }\item[{uint8\+\_\+t}]{k\+\_\+len\+\_\+bytes,  }\item[{const uint8\+\_\+t $\ast$}]{\+\_\+rand,  }\item[{const uint8\+\_\+t $\ast$}]{auts,  }\item[{uint8\+\_\+t $\ast$}]{sqn }\end{DoxyParamCaption})}



tuak\+\_\+auts -\/ Milenage AUTS validation @opc\+: OPc = 256-\/bit operator variant algorithm configuration field (encr.) @k\+: K = 128/256-\/bit subscriber key @\+\_\+rand\+: RAND = 128-\/bit random challenge @auts\+: AUTS = 112-\/bit authentication token from client @sqn\+: Buffer for SQN = 48-\/bit sequence number Returns\+: 0 = success (sqn filled), -\/1 on failure 



References \textbf{ g\+\_\+keccak\+\_\+iterations}, \textbf{ tuak\+\_\+f1star()}, and \textbf{ tuak\+\_\+f5star()}.



Referenced by \textbf{ tuak\+\_\+gen\+\_\+vec\+\_\+auts()}.

\mbox{\label{tuak_8c_a50d60ff4874c24b90cf48e6e1d61c1b9}} 
\index{tuak.c@{tuak.c}!tuak\_core@{tuak\_core}}
\index{tuak\_core@{tuak\_core}!tuak.c@{tuak.c}}
\doxysubsubsection{tuak\_core()}
{\footnotesize\ttfamily static void tuak\+\_\+core (\begin{DoxyParamCaption}\item[{uint8\+\_\+t}]{buf[200],  }\item[{const uint8\+\_\+t $\ast$}]{opc,  }\item[{uint8\+\_\+t}]{instance,  }\item[{const uint8\+\_\+t $\ast$}]{\+\_\+rand,  }\item[{const uint8\+\_\+t $\ast$}]{amf,  }\item[{const uint8\+\_\+t $\ast$}]{sqn,  }\item[{const uint8\+\_\+t $\ast$}]{k,  }\item[{uint8\+\_\+t}]{k\+\_\+len\+\_\+bytes,  }\item[{unsigned int}]{keccac\+\_\+iterations }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [static]}}



References \textbf{ algoname}, \textbf{ Keccak\+\_\+f\+\_\+64()}, \textbf{ OSMO\+\_\+\+ASSERT}, and \textbf{ PUSH\+\_\+\+DATA}.



Referenced by \textbf{ tuak\+\_\+f1()}, \textbf{ tuak\+\_\+f1star()}, \textbf{ tuak\+\_\+f2345()}, \textbf{ tuak\+\_\+f5star()}, and \textbf{ tuak\+\_\+opc\+\_\+gen()}.

\mbox{\label{tuak_8c_a23c9672e0fa4005af9ac95a85f4c037b}} 
\index{tuak.c@{tuak.c}!tuak\_f1@{tuak\_f1}}
\index{tuak\_f1@{tuak\_f1}!tuak.c@{tuak.c}}
\doxysubsubsection{tuak\_f1()}
{\footnotesize\ttfamily int tuak\+\_\+f1 (\begin{DoxyParamCaption}\item[{const uint8\+\_\+t $\ast$}]{opc,  }\item[{const uint8\+\_\+t $\ast$}]{k,  }\item[{uint8\+\_\+t}]{k\+\_\+len\+\_\+bytes,  }\item[{const uint8\+\_\+t $\ast$}]{\+\_\+rand,  }\item[{const uint8\+\_\+t $\ast$}]{sqn,  }\item[{const uint8\+\_\+t $\ast$}]{amf,  }\item[{uint8\+\_\+t $\ast$}]{mac\+\_\+a,  }\item[{uint8\+\_\+t}]{mac\+\_\+a\+\_\+len\+\_\+bytes,  }\item[{unsigned int}]{keccac\+\_\+iterations }\end{DoxyParamCaption})}



tuak\+\_\+f1 -\/ TUAK f1 algorithm @opc\+: OPc = 256-\/bit value derived from OP and K @k\+: K = 128-\/bit or 256-\/bit subscriber key @\+\_\+rand\+: RAND = 128-\/bit random challenge @sqn\+: SQN = 48-\/bit sequence number @amf\+: AMF = 16-\/bit authentication management field @mac\+\_\+a\+: Buffer for MAC-\/A = 64/128/256-\/bit network authentication code Returns\+: 0 on success, -\/1 on failure 



References \textbf{ memcpy\+\_\+reverse()}, and \textbf{ tuak\+\_\+core()}.



Referenced by \textbf{ tuak\+\_\+generate()}.

\mbox{\label{tuak_8c_aedf582cc5bfb7417777568621ba104e1}} 
\index{tuak.c@{tuak.c}!tuak\_f1star@{tuak\_f1star}}
\index{tuak\_f1star@{tuak\_f1star}!tuak.c@{tuak.c}}
\doxysubsubsection{tuak\_f1star()}
{\footnotesize\ttfamily int tuak\+\_\+f1star (\begin{DoxyParamCaption}\item[{const uint8\+\_\+t $\ast$}]{opc,  }\item[{const uint8\+\_\+t $\ast$}]{k,  }\item[{uint8\+\_\+t}]{k\+\_\+len\+\_\+bytes,  }\item[{const uint8\+\_\+t $\ast$}]{\+\_\+rand,  }\item[{const uint8\+\_\+t $\ast$}]{sqn,  }\item[{const uint8\+\_\+t $\ast$}]{amf,  }\item[{uint8\+\_\+t $\ast$}]{mac\+\_\+s,  }\item[{uint8\+\_\+t}]{mac\+\_\+s\+\_\+len\+\_\+bytes,  }\item[{unsigned int}]{keccac\+\_\+iterations }\end{DoxyParamCaption})}



tuak\+\_\+f1star -\/ TUAK f1$\ast$ algorithm @opc\+: OPc = 256-\/bit value derived from OP and K @k\+: K = 128-\/bit or 256-\/bit subscriber key @\+\_\+rand\+: RAND = 128-\/bit random challenge @sqn\+: SQN = 48-\/bit sequence number @amf\+: AMF = 16-\/bit authentication management field @mac\+\_\+s\+: Buffer for MAC-\/S = 64/128/256-\/bit resync authentication code Returns\+: 0 on success, -\/1 on failure 



References \textbf{ memcpy\+\_\+reverse()}, and \textbf{ tuak\+\_\+core()}.



Referenced by \textbf{ tuak\+\_\+auts()}.

\mbox{\label{tuak_8c_a3170dfeb6f3f84fd501ed185a8a47590}} 
\index{tuak.c@{tuak.c}!tuak\_f2345@{tuak\_f2345}}
\index{tuak\_f2345@{tuak\_f2345}!tuak.c@{tuak.c}}
\doxysubsubsection{tuak\_f2345()}
{\footnotesize\ttfamily int tuak\+\_\+f2345 (\begin{DoxyParamCaption}\item[{const uint8\+\_\+t $\ast$}]{opc,  }\item[{const uint8\+\_\+t $\ast$}]{k,  }\item[{uint8\+\_\+t}]{k\+\_\+len\+\_\+bytes,  }\item[{const uint8\+\_\+t $\ast$}]{\+\_\+rand,  }\item[{uint8\+\_\+t $\ast$}]{res,  }\item[{uint8\+\_\+t}]{res\+\_\+len\+\_\+bytes,  }\item[{uint8\+\_\+t $\ast$}]{ck,  }\item[{uint8\+\_\+t}]{ck\+\_\+len\+\_\+bytes,  }\item[{uint8\+\_\+t $\ast$}]{ik,  }\item[{uint8\+\_\+t}]{ik\+\_\+len\+\_\+bytes,  }\item[{uint8\+\_\+t $\ast$}]{ak,  }\item[{unsigned int}]{keccac\+\_\+iterations }\end{DoxyParamCaption})}



tuak\+\_\+f2345 -\/ TUAK f2, f3, f4, f5, algorithms @opc\+: OPc = 256-\/bit value derived from OP and K @k\+: K = 128/256-\/bit subscriber key @\+\_\+rand\+: RAND = 128-\/bit random challenge @res\+: Buffer for RES = 32/64/128/256-\/bit signed response (f2), or NULL @ck\+: Buffer for CK = 128/256-\/bit confidentiality key (f3), or NULL @ik\+: Buffer for IK = 128/256-\/bit integrity key (f4), or NULL @ak\+: Buffer for AK = 48-\/bit anonymity key (f5), or NULL Returns\+: 0 on success, -\/1 on failure 



References \textbf{ memcpy\+\_\+reverse()}, \textbf{ res}, \textbf{ tuak\+\_\+core()}, and \textbf{ zero16}.



Referenced by \textbf{ tuak\+\_\+generate()}.

\mbox{\label{tuak_8c_a822d1de6798e1ec99e006a6c9dd4d3c6}} 
\index{tuak.c@{tuak.c}!tuak\_f5star@{tuak\_f5star}}
\index{tuak\_f5star@{tuak\_f5star}!tuak.c@{tuak.c}}
\doxysubsubsection{tuak\_f5star()}
{\footnotesize\ttfamily int tuak\+\_\+f5star (\begin{DoxyParamCaption}\item[{const uint8\+\_\+t $\ast$}]{opc,  }\item[{const uint8\+\_\+t $\ast$}]{k,  }\item[{uint8\+\_\+t}]{k\+\_\+len\+\_\+bytes,  }\item[{const uint8\+\_\+t $\ast$}]{\+\_\+rand,  }\item[{uint8\+\_\+t $\ast$}]{ak,  }\item[{unsigned int}]{keccac\+\_\+iterations }\end{DoxyParamCaption})}



tuak\+\_\+f5star -\/ TUAK f5$\ast$ algorithm @opc\+: OPc = 256-\/bit value derived from OP and K @k\+: K = 128/256-\/bit subscriber key @\+\_\+rand\+: RAND = 128-\/bit random challenge @ak\+: Buffer for AK = 48-\/bit anonymity key (f5) Returns\+: 0 on success, -\/1 on failure 



References \textbf{ memcpy\+\_\+reverse()}, \textbf{ tuak\+\_\+core()}, and \textbf{ zero16}.



Referenced by \textbf{ tuak\+\_\+auts()}.

\mbox{\label{tuak_8c_a2b86b5423511b76fbfe4ceec77bea90d}} 
\index{tuak.c@{tuak.c}!tuak\_generate@{tuak\_generate}}
\index{tuak\_generate@{tuak\_generate}!tuak.c@{tuak.c}}
\doxysubsubsection{tuak\_generate()}
{\footnotesize\ttfamily void tuak\+\_\+generate (\begin{DoxyParamCaption}\item[{const uint8\+\_\+t $\ast$}]{opc,  }\item[{const uint8\+\_\+t $\ast$}]{amf,  }\item[{const uint8\+\_\+t $\ast$}]{k,  }\item[{uint8\+\_\+t}]{k\+\_\+len\+\_\+bytes,  }\item[{const uint8\+\_\+t $\ast$}]{sqn,  }\item[{const uint8\+\_\+t $\ast$}]{\+\_\+rand,  }\item[{uint8\+\_\+t $\ast$}]{autn,  }\item[{uint8\+\_\+t $\ast$}]{ik,  }\item[{uint8\+\_\+t $\ast$}]{ck,  }\item[{uint8\+\_\+t $\ast$}]{res,  }\item[{size\+\_\+t $\ast$}]{res\+\_\+len }\end{DoxyParamCaption})}



tuak\+\_\+generate -\/ Generate AKA AUTN,IK,CK,RES @opc\+: OPc = 256-\/bit operator variant algorithm configuration field (encr.) @amf\+: AMF = 16-\/bit authentication management field @k\+: K = 128/256-\/bit subscriber key @sqn\+: SQN = 48-\/bit sequence number @\+\_\+rand\+: RAND = 128-\/bit random challenge @autn\+: Buffer for AUTN = 128-\/bit authentication token @ik\+: Buffer for IK = 128/256-\/bit integrity key (f4), or NULL @ck\+: Buffer for CK = 128/256-\/bit confidentiality key (f3), or NULL @res\+: Buffer for RES = 32/64/128-\/bit signed response (f2), or NULL @res\+\_\+len\+: Max length for res; set to used length or 0 on failure 



References \textbf{ g\+\_\+keccak\+\_\+iterations}, \textbf{ res}, \textbf{ tuak\+\_\+f1()}, and \textbf{ tuak\+\_\+f2345()}.



Referenced by \textbf{ tuak\+\_\+gen\+\_\+vec()}.

\mbox{\label{tuak_8c_aacbc8a48e15a41c0753553c363578cdc}} 
\index{tuak.c@{tuak.c}!tuak\_opc\_gen@{tuak\_opc\_gen}}
\index{tuak\_opc\_gen@{tuak\_opc\_gen}!tuak.c@{tuak.c}}
\doxysubsubsection{tuak\_opc\_gen()}
{\footnotesize\ttfamily int tuak\+\_\+opc\+\_\+gen (\begin{DoxyParamCaption}\item[{uint8\+\_\+t $\ast$}]{opc,  }\item[{const uint8\+\_\+t $\ast$}]{k,  }\item[{uint8\+\_\+t}]{k\+\_\+len\+\_\+bytes,  }\item[{const uint8\+\_\+t $\ast$}]{op }\end{DoxyParamCaption})}



References \textbf{ g\+\_\+keccak\+\_\+iterations}, \textbf{ memcpy\+\_\+reverse()}, \textbf{ tuak\+\_\+core()}, and \textbf{ zero16}.



Referenced by \textbf{ gen\+\_\+opc\+\_\+if\+\_\+needed()}.

\mbox{\label{tuak_8c_a9040005f2cdfb243f4c92ba4294373b5}} 
\index{tuak.c@{tuak.c}!tuak\_set\_keccak\_iterations@{tuak\_set\_keccak\_iterations}}
\index{tuak\_set\_keccak\_iterations@{tuak\_set\_keccak\_iterations}!tuak.c@{tuak.c}}
\doxysubsubsection{tuak\_set\_keccak\_iterations()}
{\footnotesize\ttfamily void tuak\+\_\+set\+\_\+keccak\+\_\+iterations (\begin{DoxyParamCaption}\item[{unsigned int}]{i }\end{DoxyParamCaption})}



References \textbf{ g\+\_\+keccak\+\_\+iterations}.



\doxysubsection{Variable Documentation}
\mbox{\label{tuak_8c_a748a876a1e4bdeda222d8909360433a3}} 
\index{tuak.c@{tuak.c}!algoname@{algoname}}
\index{algoname@{algoname}!tuak.c@{tuak.c}}
\doxysubsubsection{algoname}
{\footnotesize\ttfamily const char algoname[$\,$] = \char`\"{}TUAK1.\+0\char`\"{}\hspace{0.3cm}{\ttfamily [static]}}



Referenced by \textbf{ tuak\+\_\+core()}.

\mbox{\label{tuak_8c_a96de33d1e84d512d608ed1a2c48d9506}} 
\index{tuak.c@{tuak.c}!g\_keccak\_iterations@{g\_keccak\_iterations}}
\index{g\_keccak\_iterations@{g\_keccak\_iterations}!tuak.c@{tuak.c}}
\doxysubsubsection{g\_keccak\_iterations}
{\footnotesize\ttfamily unsigned int g\+\_\+keccak\+\_\+iterations = 1\hspace{0.3cm}{\ttfamily [static]}}



Referenced by \textbf{ tuak\+\_\+auts()}, \textbf{ tuak\+\_\+generate()}, \textbf{ tuak\+\_\+opc\+\_\+gen()}, and \textbf{ tuak\+\_\+set\+\_\+keccak\+\_\+iterations()}.

\mbox{\label{tuak_8c_a7622aa12fb2afa5a191581ac444c23af}} 
\index{tuak.c@{tuak.c}!zero16@{zero16}}
\index{zero16@{zero16}!tuak.c@{tuak.c}}
\doxysubsubsection{zero16}
{\footnotesize\ttfamily const uint8\+\_\+t zero16[16] = \{ 0, \}}



Referenced by \textbf{ tuak\+\_\+f2345()}, \textbf{ tuak\+\_\+f5star()}, and \textbf{ tuak\+\_\+opc\+\_\+gen()}.

