\hypertarget{blowfish_8h}{ \section{include/beecrypt/blowfish.h File Reference} \label{blowfish_8h}\index{include/beecrypt/blowfish.h@{include/beecrypt/blowfish.h}} } Blowfish block cipher. {\ttfamily \#include \char`\"{}beecrypt/beecrypt.h\char`\"{}}\par {\ttfamily \#include \char`\"{}beecrypt/blowfishopt.h\char`\"{}}\par Include dependency graph for blowfish.h: \nopagebreak \begin{figure}[H] \begin{center} \leavevmode \includegraphics[width=314pt]{blowfish_8h__incl} \end{center} \end{figure} \subsection*{Data Structures} \begin{DoxyCompactItemize} \item struct \hyperlink{structblowfishParam}{blowfishParam} \begin{DoxyCompactList}\small\item\em Holds all the parameters necessary for the Blowfish cipher. \item\end{DoxyCompactList}\end{DoxyCompactItemize} \subsection*{Defines} \begin{DoxyCompactItemize} \item \#define \hyperlink{blowfish_8h_a320de9881e6c7560cd5b13828c420d5a}{BLOWFISHROUNDS}~16 \item \#define \hyperlink{blowfish_8h_aa638e9cb3cbf0ad5b94a25fdb9eb64c6}{BLOWFISHPSIZE}~(BLOWFISHROUNDS+2) \end{DoxyCompactItemize} \subsection*{Functions} \begin{DoxyCompactItemize} \item int \hyperlink{blowfish_8h_acce3d0c95c67c98202e851063604819e}{blowfishSetup} (\hyperlink{structblowfishParam}{blowfishParam} $\ast$, const \hyperlink{api_8h_ab8ef12fab634c171394422d0ee8baf94}{byte} $\ast$, size\_\-t, \hyperlink{group__BC__m_gace10d4c0b0409d35c6a703d6445fc558}{cipherOperation}) \begin{DoxyCompactList}\small\item\em The function performs the cipher's key expansion. \item\end{DoxyCompactList}\item int \hyperlink{blowfish_8h_a56566a49f33043d7a443a7bbbcd7bd5f}{blowfishSetIV} (\hyperlink{structblowfishParam}{blowfishParam} $\ast$, const \hyperlink{api_8h_ab8ef12fab634c171394422d0ee8baf94}{byte} $\ast$iv) \begin{DoxyCompactList}\small\item\em This function sets the Initialization Vector. \item\end{DoxyCompactList}\item int \hyperlink{blowfish_8h_a8bd243fafbf7c52359f19ab04de13c42}{blowfishSetCTR} (\hyperlink{structblowfishParam}{blowfishParam} $\ast$, const \hyperlink{api_8h_ab8ef12fab634c171394422d0ee8baf94}{byte} $\ast$nivz, size\_\-t counter) \item int \hyperlink{blowfish_8h_a2b48ab4a1793739d266308d1033aee70}{blowfishEncrypt} (\hyperlink{structblowfishParam}{blowfishParam} $\ast$, uint32\_\-t $\ast$, const uint32\_\-t $\ast$) \begin{DoxyCompactList}\small\item\em This function performs the Blowfish encryption; it encrypts one block of 64 bits. \item\end{DoxyCompactList}\item int \hyperlink{blowfish_8h_a6339ebc5b30a93680c152076ddd5f033}{blowfishDecrypt} (\hyperlink{structblowfishParam}{blowfishParam} $\ast$, uint32\_\-t $\ast$, const uint32\_\-t $\ast$) \begin{DoxyCompactList}\small\item\em This function performs the Blowfish decryption; it Rderypts one block of 64 bits. \item\end{DoxyCompactList}\item uint32\_\-t $\ast$ \hyperlink{blowfish_8h_ae2137286429679c247215465d99342c5}{blowfishFeedback} (\hyperlink{structblowfishParam}{blowfishParam} $\ast$) \end{DoxyCompactItemize} \subsection*{Variables} \begin{DoxyCompactItemize} \item const \hyperlink{structblockCipher}{blockCipher} \hyperlink{blowfish_8h_a58839854cfc0f9bcafd4b79ffd8e9d91}{blowfish} \begin{DoxyCompactList}\small\item\em Holds the full API description of the Blowfish algorithm. \item\end{DoxyCompactList}\end{DoxyCompactItemize} \subsection{Detailed Description} Blowfish block cipher. For more information on this blockcipher, see: \char`\"{}Applied Cryptography\char`\"{}, second edition Bruce Schneier Wiley \& Sons Also see \href{http://www.counterpane.com/blowfish.html}{\tt http://www.counterpane.com/blowfish.html} \begin{DoxyAuthor}{Author} Bob Deblier $<$\href{mailto:bob.deblier@telenet.be}{\tt bob.deblier@telenet.be}$>$ \end{DoxyAuthor} \subsection{Define Documentation} \hypertarget{blowfish_8h_aa638e9cb3cbf0ad5b94a25fdb9eb64c6}{ \index{blowfish.h@{blowfish.h}!BLOWFISHPSIZE@{BLOWFISHPSIZE}} \index{BLOWFISHPSIZE@{BLOWFISHPSIZE}!blowfish.h@{blowfish.h}} \subsubsection[{BLOWFISHPSIZE}]{\setlength{\rightskip}{0pt plus 5cm}\#define BLOWFISHPSIZE~(BLOWFISHROUNDS+2)}} \label{blowfish_8h_aa638e9cb3cbf0ad5b94a25fdb9eb64c6} \hypertarget{blowfish_8h_a320de9881e6c7560cd5b13828c420d5a}{ \index{blowfish.h@{blowfish.h}!BLOWFISHROUNDS@{BLOWFISHROUNDS}} \index{BLOWFISHROUNDS@{BLOWFISHROUNDS}!blowfish.h@{blowfish.h}} \subsubsection[{BLOWFISHROUNDS}]{\setlength{\rightskip}{0pt plus 5cm}\#define BLOWFISHROUNDS~16}} \label{blowfish_8h_a320de9881e6c7560cd5b13828c420d5a} \subsection{Function Documentation} \hypertarget{blowfish_8h_a6339ebc5b30a93680c152076ddd5f033}{ \index{blowfish.h@{blowfish.h}!blowfishDecrypt@{blowfishDecrypt}} \index{blowfishDecrypt@{blowfishDecrypt}!blowfish.h@{blowfish.h}} \subsubsection[{blowfishDecrypt}]{\setlength{\rightskip}{0pt plus 5cm}blowfishDecrypt ( \begin{DoxyParamCaption} \item[{{\bf blowfishParam} $\ast$}]{bp, } \item[{uint32\_\-t $\ast$}]{dst, } \item[{const uint32\_\-t $\ast$}]{src} \end{DoxyParamCaption} )}} \label{blowfish_8h_a6339ebc5b30a93680c152076ddd5f033} This function performs the Blowfish decryption; it Rderypts one block of 64 bits. \begin{DoxyParams}{Parameters} {\em bp} & The cipher's parameter block. \\ \hline {\em dst} & The cleartext; should be aligned on 32-\/bit boundary. \\ \hline {\em src} & The ciphertext; should be aligned on 32-\/bit boundary. \\ \hline \end{DoxyParams} \begin{DoxyRetVals}{Return values} {\em 0} & on success. \\ \hline \end{DoxyRetVals} \hypertarget{blowfish_8h_a2b48ab4a1793739d266308d1033aee70}{ \index{blowfish.h@{blowfish.h}!blowfishEncrypt@{blowfishEncrypt}} \index{blowfishEncrypt@{blowfishEncrypt}!blowfish.h@{blowfish.h}} \subsubsection[{blowfishEncrypt}]{\setlength{\rightskip}{0pt plus 5cm}blowfishEncrypt ( \begin{DoxyParamCaption} \item[{{\bf blowfishParam} $\ast$}]{bp, } \item[{uint32\_\-t $\ast$}]{dst, } \item[{const uint32\_\-t $\ast$}]{src} \end{DoxyParamCaption} )}} \label{blowfish_8h_a2b48ab4a1793739d266308d1033aee70} This function performs the Blowfish encryption; it encrypts one block of 64 bits. \begin{DoxyParams}{Parameters} {\em bp} & The cipher's parameter block. \\ \hline {\em dst} & The ciphertext; should be aligned on 32-\/bit boundary. \\ \hline {\em src} & The cleartext; should be aligned on 32-\/bit boundary. \\ \hline \end{DoxyParams} \begin{DoxyRetVals}{Return values} {\em 0} & on success. \\ \hline \end{DoxyRetVals} \hypertarget{blowfish_8h_ae2137286429679c247215465d99342c5}{ \index{blowfish.h@{blowfish.h}!blowfishFeedback@{blowfishFeedback}} \index{blowfishFeedback@{blowfishFeedback}!blowfish.h@{blowfish.h}} \subsubsection[{blowfishFeedback}]{\setlength{\rightskip}{0pt plus 5cm}uint32\_\-t$\ast$ blowfishFeedback ( \begin{DoxyParamCaption} \item[{{\bf blowfishParam} $\ast$}]{} \end{DoxyParamCaption} )}} \label{blowfish_8h_ae2137286429679c247215465d99342c5} \hypertarget{blowfish_8h_a8bd243fafbf7c52359f19ab04de13c42}{ \index{blowfish.h@{blowfish.h}!blowfishSetCTR@{blowfishSetCTR}} \index{blowfishSetCTR@{blowfishSetCTR}!blowfish.h@{blowfish.h}} \subsubsection[{blowfishSetCTR}]{\setlength{\rightskip}{0pt plus 5cm}int blowfishSetCTR ( \begin{DoxyParamCaption} \item[{{\bf blowfishParam} $\ast$}]{, } \item[{const {\bf byte} $\ast$}]{nivz, } \item[{size\_\-t}]{counter} \end{DoxyParamCaption} )}} \label{blowfish_8h_a8bd243fafbf7c52359f19ab04de13c42} \hypertarget{blowfish_8h_a56566a49f33043d7a443a7bbbcd7bd5f}{ \index{blowfish.h@{blowfish.h}!blowfishSetIV@{blowfishSetIV}} \index{blowfishSetIV@{blowfishSetIV}!blowfish.h@{blowfish.h}} \subsubsection[{blowfishSetIV}]{\setlength{\rightskip}{0pt plus 5cm}int blowfishSetIV ( \begin{DoxyParamCaption} \item[{{\bf blowfishParam} $\ast$}]{bp, } \item[{const {\bf byte} $\ast$}]{iv} \end{DoxyParamCaption} )}} \label{blowfish_8h_a56566a49f33043d7a443a7bbbcd7bd5f} This function sets the Initialization Vector. \begin{DoxyNote}{Note} This function is only useful in block chaining or feedback modes. \end{DoxyNote} \begin{DoxyParams}{Parameters} {\em bp} & The cipher's parameter block. \\ \hline {\em iv} & The initialization vector; may be null. \\ \hline \end{DoxyParams} \begin{DoxyRetVals}{Return values} {\em 0} & on success. \\ \hline \end{DoxyRetVals} \hypertarget{blowfish_8h_acce3d0c95c67c98202e851063604819e}{ \index{blowfish.h@{blowfish.h}!blowfishSetup@{blowfishSetup}} \index{blowfishSetup@{blowfishSetup}!blowfish.h@{blowfish.h}} \subsubsection[{blowfishSetup}]{\setlength{\rightskip}{0pt plus 5cm}int blowfishSetup ( \begin{DoxyParamCaption} \item[{{\bf blowfishParam} $\ast$}]{bp, } \item[{const {\bf byte} $\ast$}]{key, } \item[{size\_\-t}]{keybits, } \item[{{\bf cipherOperation}}]{op} \end{DoxyParamCaption} )}} \label{blowfish_8h_acce3d0c95c67c98202e851063604819e} The function performs the cipher's key expansion. \begin{DoxyParams}{Parameters} {\em bp} & The cipher's parameter block. \\ \hline {\em key} & The key value. \\ \hline {\em keybits} & The number of bits in the key; legal values are: 32 to 448, in multiples of 8. \\ \hline {\em op} & ENCRYPT or DECRYPT. \\ \hline \end{DoxyParams} \begin{DoxyRetVals}{Return values} {\em 0} & on success. \\ \hline {\em -\/1} & on failure. \\ \hline \end{DoxyRetVals} \subsection{Variable Documentation} \hypertarget{blowfish_8h_a58839854cfc0f9bcafd4b79ffd8e9d91}{ \index{blowfish.h@{blowfish.h}!blowfish@{blowfish}} \index{blowfish@{blowfish}!blowfish.h@{blowfish.h}} \subsubsection[{blowfish}]{\setlength{\rightskip}{0pt plus 5cm}{\bf blowfish}}} \label{blowfish_8h_a58839854cfc0f9bcafd4b79ffd8e9d91} Holds the full API description of the Blowfish algorithm.