Skip to content

Commit

Permalink
moar doc
Browse files Browse the repository at this point in the history
[skip ci]
  • Loading branch information
sjaeckel committed Sep 20, 2017
1 parent dd01232 commit fc65352
Showing 1 changed file with 45 additions and 4 deletions.
49 changes: 45 additions & 4 deletions doc/crypt.tex
Original file line number Diff line number Diff line change
Expand Up @@ -2546,19 +2546,29 @@ \subsection{Hash Registration}

\chapter{Checksum Functions}

\mysection{CRC32 -- Cyclic redundancy check}
\mysection{Preface}

XXX-TODO see \url{https://en.wikipedia.org/wiki/Cyclic_redundancy_check}
The API for all checksum functions operate in mode: \textit{init} -- \textit{update} -- \textit{update} -- ... -- \textit{finish}.

The \textit{finish} functions allow to output a partial result if necessary.

\mysection{CRC-32 -- Cyclic redundancy check}

A Cyclic Redundancy Check is an error-detecting code, where LibTomCrypt implements CRC-32 with the polynomial \textit{0x04C11DB7}.

For further information see \url{https://en.wikipedia.org/wiki/Cyclic_redundancy_check}

\begin{verbatim}
void crc32_init(crc32_state *ctx);
void crc32_update(crc32_state *ctx, const unsigned char *input, unsigned long length);
void crc32_finish(crc32_state *ctx, void *hash, unsigned long size);
\end{verbatim}

\mysection{Adler32}
\mysection{Adler-32}

Adler-32 is a checksum algorithm.

XXX-TODO see \url{https://en.wikipedia.org/wiki/Adler-32}
For further information see \url{https://en.wikipedia.org/wiki/Adler-32}.

\begin{verbatim}
void adler32_init(adler32_state *ctx);
Expand Down Expand Up @@ -5763,8 +5773,17 @@ \subsubsection{Sample Decoding}
can walk up and down the nodes without keeping pointers lying around.


\subsubsection{Shrink'ing a Flexi List}
While decoding the flexi decoder will recursively decode an ASN.1 \textit{constructed} type it will store the decoded list
as well as the plain data that was decoded.
To free up this additional data a shrink function is provided.

\index{der\_sequence\_shrink()}
\begin{verbatim}
void der_sequence_shrink(ltc_asn1_list *in);
\end{verbatim}

This will free all the plain constructed data, but keep the decoded list intact.

\subsubsection{Free'ing a Flexi List}
To free the list use the following function.
Expand Down Expand Up @@ -6084,6 +6103,28 @@ \subsection{URL--safe 'base64url' encoding}

This ensures that \textit{N} is set to a random MPI in the range $1 \le N < limit$.


\mysection{Helper functions}

\subsection{Zero'ing data}

XXX-TODO

\index{zeromem()}
\begin{verbatim}
void zeromem(volatile void *out, size_t outlen);
\end{verbatim}

\subsection{Constant-time memory compare}

XXX-TODO

\index{mem\_neq()}
\begin{verbatim}
int mem_neq(const void *a, const void *b, size_t len);
\end{verbatim}


\mysection{Dynamic Language Support}
\index{Dynamic Language Support}
Various LibTomCrypt functions require that their callers define a struct
Expand Down

0 comments on commit fc65352

Please sign in to comment.