|
47 | 47 | \def\gap{\vspace{0.5ex}} |
48 | 48 | \makeindex |
49 | 49 | \begin{document} |
50 | | -\title{LibTomCrypt \\ Version 1.13} |
| 50 | +\title{LibTomCrypt \\ Version 1.14} |
51 | 51 | \author{Tom St Denis \\ |
52 | 52 | \\ |
53 | 53 | tomstdenis@gmail.com \\ |
@@ -1007,6 +1007,55 @@ \subsection{LRW Mode} |
1007 | 1007 | int lrw_done(symmetric_LRW *lrw); |
1008 | 1008 | \end{verbatim} |
1009 | 1009 |
|
| 1010 | +\subsection{F8 Mode} |
| 1011 | +\index{F8 Mode} |
| 1012 | +The F8 Chaining mode (see RFC 3711 for instance) is yet another chaining mode for block ciphers. It behaves much like CTR mode in that it XORs a keystream |
| 1013 | +against the plaintext to encrypt. F8 mode comes with the additional twist that the counter value is secret, encrypted by a \textit{salt key}. We |
| 1014 | +initialize F8 mode with the fuollowing function call: |
| 1015 | + |
| 1016 | +\index{f8\_start()} |
| 1017 | +\begin{verbatim} |
| 1018 | +int f8_start( int cipher, const unsigned char *IV, |
| 1019 | + const unsigned char *key, int keylen, |
| 1020 | + const unsigned char *salt_key, int skeylen, |
| 1021 | + int num_rounds, symmetric_F8 *f8); |
| 1022 | +\end{verbatim} |
| 1023 | +This will start the F8 mode state using ``key'' as the secret key, ``IV'' as the counter. It uses the ``salt\_key`` as IV encryption key (``m'' in the RFC 3711). |
| 1024 | +The salt\_key can be shorter than the secret key but it should not be longer. |
| 1025 | +
|
| 1026 | +To encrypt or decrypt data we use the following two functions: |
| 1027 | +
|
| 1028 | +\index{f8\_encrypt()} \index{f8\_decrypt()} |
| 1029 | +\begin{verbatim} |
| 1030 | +int f8_encrypt(const unsigned char *pt, unsigned char *ct, |
| 1031 | + unsigned long len, symmetric_F8 *f8); |
| 1032 | +
|
| 1033 | +int f8_decrypt(const unsigned char *ct, unsigned char *pt, |
| 1034 | + unsigned long len, symmetric_F8 *f8); |
| 1035 | +\end{verbatim} |
| 1036 | +These will encrypt or decrypt a variable length array of bytes using the F8 mode state specified. The length is specified in bytes and does not have to be a multiple |
| 1037 | +of the ciphers block size. |
| 1038 | +
|
| 1039 | +To change or retrieve the current counter IV value use the following functions: |
| 1040 | +
|
| 1041 | +\index{f8\_getiv()} |
| 1042 | +\index{f8\_setiv()} |
| 1043 | +\begin{verbatim} |
| 1044 | +int f8_getiv(unsigned char *IV, unsigned long *len, symmetric_F8 *f8); |
| 1045 | +int f8_setiv(const unsigned char *IV, unsigned long len, symmetric_F8 *f8); |
| 1046 | +\end{verbatim} |
| 1047 | +These work with the current IV value only and not the encrypted IV value specifed during the call to f8\_start(). The purpose of these two functions is to be |
| 1048 | +able to seek within a current session only. If you want to change the session IV you will have to call f8\_done() and then start a new state with |
| 1049 | +f8\_start(). |
| 1050 | +
|
| 1051 | +To terminate an F8 state call the following function: |
| 1052 | +
|
| 1053 | +\index{f8\_done()} |
| 1054 | +\begin{verbatim} |
| 1055 | +int f8_done(symmetric_F8 *f8); |
| 1056 | +\end{verbatim} |
| 1057 | +
|
| 1058 | +\vbox{} |
1010 | 1059 | \section{Encrypt and Authenticate Modes} |
1011 | 1060 |
|
1012 | 1061 | \subsection{EAX Mode} |
@@ -2719,8 +2768,7 @@ \subsection{RSA Exponentiation} |
2719 | 2768 | \begin{verbatim} |
2720 | 2769 | int rsa_exptmod(const unsigned char *in, unsigned long inlen, |
2721 | 2770 | unsigned char *out, unsigned long *outlen, |
2722 | | - int which, prng_state *prng, int prng_idx, |
2723 | | - rsa_key *key); |
| 2771 | + int which, rsa_key *key); |
2724 | 2772 | \end{verbatim} |
2725 | 2773 | This loads the bignum from ``in'' as a big endian word in the format PKCS specifies, raises it to either ``e'' or ``d'' and stores the result |
2726 | 2774 | in ``out'' and the size of the result in ``outlen''. ``which'' is set to {\bf PK\_PUBLIC} to use ``e'' |
@@ -5241,5 +5289,5 @@ \subsection{RSA Functions} |
5241 | 5289 | \end{document} |
5242 | 5290 |
|
5243 | 5291 | % $Source: /cvs/libtom/libtomcrypt/crypt.tex,v $ |
5244 | | -% $Revision: 1.74 $ |
5245 | | -% $Date: 2006/06/18 01:35:41 $ |
| 5292 | +% $Revision: 1.77 $ |
| 5293 | +% $Date: 2006/08/30 23:23:20 $ |
0 commit comments