\doxysection{Cyclic Redundancy Check}
\label{group__crc}\index{Cyclic Redundancy Check@{Cyclic Redundancy Check}}
\doxysubsection*{Files}
\begin{DoxyCompactItemize}
\item 
file \textbf{ crc.\+h}
\begin{DoxyCompactList}\small\item\em Osmocom GMR-\/1 CRC header. \end{DoxyCompactList}\item 
file \textbf{ crc.\+c}
\begin{DoxyCompactList}\small\item\em Osmocom GMR-\/1 CRC implementation. \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsection*{Functions}
\begin{DoxyCompactItemize}
\item 
\mbox{\label{group__crc_ga58cd4fba87bbaf0f343bd33180eebe42}} 
uint16\+\_\+t \textbf{ osmo\+\_\+crc16} (uint16\+\_\+t crc, uint8\+\_\+t const $\ast$buffer, size\+\_\+t len)
\item 
\mbox{\label{group__crc_gaad60da91cb9972f08402e66fe456faa3}} 
uint16\+\_\+t \textbf{ osmo\+\_\+crc16\+\_\+ccitt} (uint16\+\_\+t crc, uint8\+\_\+t const $\ast$buffer, size\+\_\+t len)
\item 
\mbox{\label{group__crc_ga5f2be129743f4ef86a0dc8254e7ef2db}} 
uint16\+\_\+t \textbf{ osmo\+\_\+crc16gen\+\_\+compute\+\_\+bits} (const struct \textbf{ osmo\+\_\+crc16gen\+\_\+code} $\ast$code, const \textbf{ ubit\+\_\+t} $\ast$in, int len)
\item 
\mbox{\label{group__crc_ga9a00e7f03b13fafc300c472041232a13}} 
int \textbf{ osmo\+\_\+crc16gen\+\_\+check\+\_\+bits} (const struct \textbf{ osmo\+\_\+crc16gen\+\_\+code} $\ast$code, const \textbf{ ubit\+\_\+t} $\ast$in, int len, const \textbf{ ubit\+\_\+t} $\ast$crc\+\_\+bits)
\item 
\mbox{\label{group__crc_ga78c47159065aced37cb21d78dc5f7a66}} 
void \textbf{ osmo\+\_\+crc16gen\+\_\+set\+\_\+bits} (const struct \textbf{ osmo\+\_\+crc16gen\+\_\+code} $\ast$code, const \textbf{ ubit\+\_\+t} $\ast$in, int len, \textbf{ ubit\+\_\+t} $\ast$crc\+\_\+bits)
\item 
\mbox{\label{group__crc_ga38fd8d69d0e56e7ac9c424d9c1201da3}} 
uint32\+\_\+t \textbf{ osmo\+\_\+crc32gen\+\_\+compute\+\_\+bits} (const struct \textbf{ osmo\+\_\+crc32gen\+\_\+code} $\ast$code, const \textbf{ ubit\+\_\+t} $\ast$in, int len)
\item 
\mbox{\label{group__crc_gacd9e567dca7fe9704c4a3091fb73f731}} 
int \textbf{ osmo\+\_\+crc32gen\+\_\+check\+\_\+bits} (const struct \textbf{ osmo\+\_\+crc32gen\+\_\+code} $\ast$code, const \textbf{ ubit\+\_\+t} $\ast$in, int len, const \textbf{ ubit\+\_\+t} $\ast$crc\+\_\+bits)
\item 
\mbox{\label{group__crc_gafd51fe33e5139ac2ac74b235864bc5f6}} 
void \textbf{ osmo\+\_\+crc32gen\+\_\+set\+\_\+bits} (const struct \textbf{ osmo\+\_\+crc32gen\+\_\+code} $\ast$code, const \textbf{ ubit\+\_\+t} $\ast$in, int len, \textbf{ ubit\+\_\+t} $\ast$crc\+\_\+bits)
\item 
\mbox{\label{group__crc_gaea21afc395bb6817b77ff5bd7a66e1b6}} 
uint64\+\_\+t \textbf{ osmo\+\_\+crc64gen\+\_\+compute\+\_\+bits} (const struct \textbf{ osmo\+\_\+crc64gen\+\_\+code} $\ast$code, const \textbf{ ubit\+\_\+t} $\ast$in, int len)
\item 
\mbox{\label{group__crc_gae8e3f4375b32508b040ce49e948b06d5}} 
int \textbf{ osmo\+\_\+crc64gen\+\_\+check\+\_\+bits} (const struct \textbf{ osmo\+\_\+crc64gen\+\_\+code} $\ast$code, const \textbf{ ubit\+\_\+t} $\ast$in, int len, const \textbf{ ubit\+\_\+t} $\ast$crc\+\_\+bits)
\item 
\mbox{\label{group__crc_gaa78449595b3ce3ff202d3f898a85f995}} 
void \textbf{ osmo\+\_\+crc64gen\+\_\+set\+\_\+bits} (const struct \textbf{ osmo\+\_\+crc64gen\+\_\+code} $\ast$code, const \textbf{ ubit\+\_\+t} $\ast$in, int len, \textbf{ ubit\+\_\+t} $\ast$crc\+\_\+bits)
\item 
\mbox{\label{group__crc_ga1549c35fe5c50ec456a7bcbe65573e62}} 
uint8\+\_\+t \textbf{ osmo\+\_\+crc8gen\+\_\+compute\+\_\+bits} (const struct \textbf{ osmo\+\_\+crc8gen\+\_\+code} $\ast$code, const \textbf{ ubit\+\_\+t} $\ast$in, int len)
\item 
\mbox{\label{group__crc_ga66f9c6afefc4dfe9baacdaf75ac1d95a}} 
int \textbf{ osmo\+\_\+crc8gen\+\_\+check\+\_\+bits} (const struct \textbf{ osmo\+\_\+crc8gen\+\_\+code} $\ast$code, const \textbf{ ubit\+\_\+t} $\ast$in, int len, const \textbf{ ubit\+\_\+t} $\ast$crc\+\_\+bits)
\item 
\mbox{\label{group__crc_gac88fe09d8beb2a70f1ec43f87920ee73}} 
void \textbf{ osmo\+\_\+crc8gen\+\_\+set\+\_\+bits} (const struct \textbf{ osmo\+\_\+crc8gen\+\_\+code} $\ast$code, const \textbf{ ubit\+\_\+t} $\ast$in, int len, \textbf{ ubit\+\_\+t} $\ast$crc\+\_\+bits)
\end{DoxyCompactItemize}
\doxysubsection*{Variables}
\begin{DoxyCompactItemize}
\item 
\mbox{\label{group__crc_ga539c9a3a9def4b974c3957a9d843fc03}} 
uint16\+\_\+t const \textbf{ osmo\+\_\+crc16\+\_\+table} [256]
\item 
\mbox{\label{group__crc_gabc80ae8a51f5ed975c980dee63129818}} 
uint16\+\_\+t const \textbf{ osmo\+\_\+crc16\+\_\+ccitt\+\_\+table} [256]
\item 
\mbox{\label{group__crc_ga539c9a3a9def4b974c3957a9d843fc03}} 
uint16\+\_\+t const \textbf{ osmo\+\_\+crc16\+\_\+table} [256]
\item 
\mbox{\label{group__crc_gabc80ae8a51f5ed975c980dee63129818}} 
uint16\+\_\+t const \textbf{ osmo\+\_\+crc16\+\_\+ccitt\+\_\+table} [256]
\item 
\mbox{\label{group__crc_ga475488b3214308419d2d8ced50df5257}} 
const struct \textbf{ osmo\+\_\+crc8gen\+\_\+code} {\bfseries gmr1\+\_\+crc8}
\begin{DoxyCompactList}\small\item\em GMR-\/1 CRC8 g8(\+D) = D8 + D7 + D4 + D3 + D + 1. \end{DoxyCompactList}\item 
\mbox{\label{group__crc_ga39976cbbb95bf2ee17510e23e66e9662}} 
const struct \textbf{ osmo\+\_\+crc16gen\+\_\+code} {\bfseries gmr1\+\_\+crc12}
\begin{DoxyCompactList}\small\item\em GMR-\/1 CRC12 g12(\+D) = D12 + D11 + D3 + D2 + D + 1. \end{DoxyCompactList}\item 
\mbox{\label{group__crc_ga4c203dc885ad2c23dbc5e26457d2b52e}} 
const struct \textbf{ osmo\+\_\+crc16gen\+\_\+code} {\bfseries gmr1\+\_\+crc16}
\begin{DoxyCompactList}\small\item\em GMR-\/1 CRC16 g16(\+D) = D16 + D12 + D5 + 1. \end{DoxyCompactList}\item 
const struct \textbf{ osmo\+\_\+crc8gen\+\_\+code} \textbf{ gmr1\+\_\+crc8}
\begin{DoxyCompactList}\small\item\em GMR-\/1 CRC8 g8(\+D) = D8 + D7 + D4 + D3 + D + 1. \end{DoxyCompactList}\item 
const struct \textbf{ osmo\+\_\+crc16gen\+\_\+code} \textbf{ gmr1\+\_\+crc12}
\begin{DoxyCompactList}\small\item\em GMR-\/1 CRC12 g12(\+D) = D12 + D11 + D3 + D2 + D + 1. \end{DoxyCompactList}\item 
const struct \textbf{ osmo\+\_\+crc16gen\+\_\+code} \textbf{ gmr1\+\_\+crc16}
\begin{DoxyCompactList}\small\item\em GMR-\/1 CRC16 g16(\+D) = D16 + D12 + D5 + 1. \end{DoxyCompactList}\end{DoxyCompactItemize}


\doxysubsection{Detailed Description}


\doxysubsection{Variable Documentation}
\mbox{\label{group__crc_ga39976cbbb95bf2ee17510e23e66e9662}} 
\index{Cyclic Redundancy Check@{Cyclic Redundancy Check}!gmr1\_crc12@{gmr1\_crc12}}
\index{gmr1\_crc12@{gmr1\_crc12}!Cyclic Redundancy Check@{Cyclic Redundancy Check}}
\doxysubsubsection{gmr1\_crc12}
{\footnotesize\ttfamily const struct \textbf{ osmo\+\_\+crc16gen\+\_\+code} gmr1\+\_\+crc12}

{\bfseries Initial value\+:}
\begin{DoxyCode}{0}
\DoxyCodeLine{= \{}
\DoxyCodeLine{        .bits = 12,}
\DoxyCodeLine{        .poly = 0x80f,}
\DoxyCodeLine{        .init = 0x0000,}
\DoxyCodeLine{        .remainder = 0x0000,}
\DoxyCodeLine{\}}

\end{DoxyCode}


GMR-\/1 CRC12 g12(\+D) = D12 + D11 + D3 + D2 + D + 1. 



Referenced by \textbf{ gmr1\+\_\+rach\+\_\+encode()}.

\mbox{\label{group__crc_ga4c203dc885ad2c23dbc5e26457d2b52e}} 
\index{Cyclic Redundancy Check@{Cyclic Redundancy Check}!gmr1\_crc16@{gmr1\_crc16}}
\index{gmr1\_crc16@{gmr1\_crc16}!Cyclic Redundancy Check@{Cyclic Redundancy Check}}
\doxysubsubsection{gmr1\_crc16}
{\footnotesize\ttfamily const struct \textbf{ osmo\+\_\+crc16gen\+\_\+code} gmr1\+\_\+crc16}

{\bfseries Initial value\+:}
\begin{DoxyCode}{0}
\DoxyCodeLine{= \{}
\DoxyCodeLine{        .bits = 16,}
\DoxyCodeLine{        .poly = 0x1021,}
\DoxyCodeLine{        .init = 0x0000,}
\DoxyCodeLine{        .remainder = 0x0000,}
\DoxyCodeLine{\}}

\end{DoxyCode}


GMR-\/1 CRC16 g16(\+D) = D16 + D12 + D5 + 1. 



Referenced by \textbf{ gmr1\+\_\+bcch\+\_\+encode()}, \textbf{ gmr1\+\_\+ccch\+\_\+encode()}, \textbf{ gmr1\+\_\+facch3\+\_\+encode()}, \textbf{ gmr1\+\_\+facch9\+\_\+encode()}, and \textbf{ gmr1\+\_\+xch\+\_\+dc12\+\_\+encode()}.

\mbox{\label{group__crc_ga475488b3214308419d2d8ced50df5257}} 
\index{Cyclic Redundancy Check@{Cyclic Redundancy Check}!gmr1\_crc8@{gmr1\_crc8}}
\index{gmr1\_crc8@{gmr1\_crc8}!Cyclic Redundancy Check@{Cyclic Redundancy Check}}
\doxysubsubsection{gmr1\_crc8}
{\footnotesize\ttfamily const struct \textbf{ osmo\+\_\+crc8gen\+\_\+code} gmr1\+\_\+crc8}

{\bfseries Initial value\+:}
\begin{DoxyCode}{0}
\DoxyCodeLine{= \{}
\DoxyCodeLine{        .bits = 8,}
\DoxyCodeLine{        .poly = 0x9b,}
\DoxyCodeLine{        .init = 0x00,}
\DoxyCodeLine{        .remainder = 0x00,}
\DoxyCodeLine{\}}

\end{DoxyCode}


GMR-\/1 CRC8 g8(\+D) = D8 + D7 + D4 + D3 + D + 1. 



Referenced by \textbf{ gmr1\+\_\+rach\+\_\+encode()}.

