\hypertarget{sha1_8h}{\section{include/beecrypt/sha1.h File Reference} \label{sha1_8h}\index{include/beecrypt/sha1.\-h@{include/beecrypt/sha1.\-h}} } S\-H\-A-\/1 hash function, headers. {\ttfamily \#include \char`\"{}beecrypt/beecrypt.\-h\char`\"{}}\\* {\ttfamily \#include \char`\"{}beecrypt/sha1opt.\-h\char`\"{}}\\* Include dependency graph for sha1.\-h\-: \nopagebreak \begin{figure}[H] \begin{center} \leavevmode \includegraphics[width=350pt]{sha1_8h__incl} \end{center} \end{figure} This graph shows which files directly or indirectly include this file\-: \nopagebreak \begin{figure}[H] \begin{center} \leavevmode \includegraphics[width=350pt]{sha1_8h__dep__incl} \end{center} \end{figure} \subsection*{Data Structures} \begin{DoxyCompactItemize} \item struct \hyperlink{structsha1Param}{sha1\-Param} \begin{DoxyCompactList}\small\item\em Holds all the parameters necessary for the S\-H\-A-\/1 algorithm. \end{DoxyCompactList}\end{DoxyCompactItemize} \subsection*{Functions} \begin{DoxyCompactItemize} \item void \hyperlink{sha1_8h_ae6b978435e0ca6d11cf1c1b06e8f3cf3}{sha1\-Process} (\hyperlink{structsha1Param}{sha1\-Param} $\ast$sp) \begin{DoxyCompactList}\small\item\em This function performs the core of the S\-H\-A-\/1 hash algorithm; it processes a block of 64 bytes. \end{DoxyCompactList}\item int \hyperlink{sha1_8h_a8ada986f91101abe14e2c7dddf2e6b3e}{sha1\-Reset} (\hyperlink{structsha1Param}{sha1\-Param} $\ast$sp) \begin{DoxyCompactList}\small\item\em This function resets the parameter block so that it's ready for a new hash. \end{DoxyCompactList}\item int \hyperlink{sha1_8h_ac1c2099636681b34e4c84b540a69b1f4}{sha1\-Update} (\hyperlink{structsha1Param}{sha1\-Param} $\ast$sp, const \hyperlink{api_8h_ab8ef12fab634c171394422d0ee8baf94}{byte} $\ast$data, size\-\_\-t size) \begin{DoxyCompactList}\small\item\em This function should be used to pass successive blocks of data to be hashed. \end{DoxyCompactList}\item int \hyperlink{sha1_8h_a1576a65bc76a35292b33bdd6876131d8}{sha1\-Digest} (\hyperlink{structsha1Param}{sha1\-Param} $\ast$sp, \hyperlink{api_8h_ab8ef12fab634c171394422d0ee8baf94}{byte} $\ast$digest) \begin{DoxyCompactList}\small\item\em This function finishes the current hash computation and copies the digest value into {\itshape digest}. \end{DoxyCompactList}\end{DoxyCompactItemize} \subsection*{Variables} \begin{DoxyCompactItemize} \item const \hyperlink{structhashFunction}{hash\-Function} \hyperlink{sha1_8h_abd0cb74bfc712f826eb603be9f4f56c9}{sha1} \begin{DoxyCompactList}\small\item\em Holds the full A\-P\-I description of the S\-H\-A-\/1 algorithm. \end{DoxyCompactList}\end{DoxyCompactItemize} \subsection{Detailed Description} S\-H\-A-\/1 hash function, headers. \begin{DoxyAuthor}{Author} Bob Deblier \href{mailto:bob.deblier@telenet.be}{\tt bob.\-deblier@telenet.\-be} \end{DoxyAuthor} \subsection{Function Documentation} \hypertarget{sha1_8h_a1576a65bc76a35292b33bdd6876131d8}{\index{sha1.\-h@{sha1.\-h}!sha1\-Digest@{sha1\-Digest}} \index{sha1\-Digest@{sha1\-Digest}!sha1.h@{sha1.\-h}} \subsubsection[{sha1\-Digest}]{\setlength{\rightskip}{0pt plus 5cm}int sha1\-Digest ( \begin{DoxyParamCaption} \item[{{\bf sha1\-Param} $\ast$}]{sp, } \item[{{\bf byte} $\ast$}]{digest} \end{DoxyParamCaption} )}}\label{sha1_8h_a1576a65bc76a35292b33bdd6876131d8} This function finishes the current hash computation and copies the digest value into {\itshape digest}. \begin{DoxyParams}{Parameters} {\em sp} & The hash function's parameter block. \\ \hline {\em digest} & The place to store the 20-\/byte digest. \\ \hline \end{DoxyParams} \begin{DoxyRetVals}{Return values} {\em 0} & on success. \\ \hline \end{DoxyRetVals} \hypertarget{sha1_8h_ae6b978435e0ca6d11cf1c1b06e8f3cf3}{\index{sha1.\-h@{sha1.\-h}!sha1\-Process@{sha1\-Process}} \index{sha1\-Process@{sha1\-Process}!sha1.h@{sha1.\-h}} \subsubsection[{sha1\-Process}]{\setlength{\rightskip}{0pt plus 5cm}void sha1\-Process ( \begin{DoxyParamCaption} \item[{{\bf sha1\-Param} $\ast$}]{sp} \end{DoxyParamCaption} )}}\label{sha1_8h_ae6b978435e0ca6d11cf1c1b06e8f3cf3} This function performs the core of the S\-H\-A-\/1 hash algorithm; it processes a block of 64 bytes. \begin{DoxyParams}{Parameters} {\em sp} & The hash function's parameter block. \\ \hline \end{DoxyParams} \hypertarget{sha1_8h_a8ada986f91101abe14e2c7dddf2e6b3e}{\index{sha1.\-h@{sha1.\-h}!sha1\-Reset@{sha1\-Reset}} \index{sha1\-Reset@{sha1\-Reset}!sha1.h@{sha1.\-h}} \subsubsection[{sha1\-Reset}]{\setlength{\rightskip}{0pt plus 5cm}int sha1\-Reset ( \begin{DoxyParamCaption} \item[{{\bf sha1\-Param} $\ast$}]{sp} \end{DoxyParamCaption} )}}\label{sha1_8h_a8ada986f91101abe14e2c7dddf2e6b3e} This function resets the parameter block so that it's ready for a new hash. \begin{DoxyParams}{Parameters} {\em sp} & The hash function's parameter block. \\ \hline \end{DoxyParams} \begin{DoxyRetVals}{Return values} {\em 0} & on success. \\ \hline \end{DoxyRetVals} \hypertarget{sha1_8h_ac1c2099636681b34e4c84b540a69b1f4}{\index{sha1.\-h@{sha1.\-h}!sha1\-Update@{sha1\-Update}} \index{sha1\-Update@{sha1\-Update}!sha1.h@{sha1.\-h}} \subsubsection[{sha1\-Update}]{\setlength{\rightskip}{0pt plus 5cm}int sha1\-Update ( \begin{DoxyParamCaption} \item[{{\bf sha1\-Param} $\ast$}]{sp, } \item[{const {\bf byte} $\ast$}]{data, } \item[{size\-\_\-t}]{size} \end{DoxyParamCaption} )}}\label{sha1_8h_ac1c2099636681b34e4c84b540a69b1f4} This function should be used to pass successive blocks of data to be hashed. \begin{DoxyParams}{Parameters} {\em sp} & The hash function's parameter block. \\ \hline {\em data} & \\ \hline {\em size} & \\ \hline \end{DoxyParams} \begin{DoxyRetVals}{Return values} {\em 0} & on success. \\ \hline \end{DoxyRetVals} \subsection{Variable Documentation} \hypertarget{sha1_8h_abd0cb74bfc712f826eb603be9f4f56c9}{\index{sha1.\-h@{sha1.\-h}!sha1@{sha1}} \index{sha1@{sha1}!sha1.h@{sha1.\-h}} \subsubsection[{sha1}]{\setlength{\rightskip}{0pt plus 5cm}sha1}}\label{sha1_8h_abd0cb74bfc712f826eb603be9f4f56c9} Holds the full A\-P\-I description of the S\-H\-A-\/1 algorithm.