Skip to content

Commit 479cc9c

Browse files
Tom St Denissjaeckel
authored andcommitted
added libtomcrypt-1.14
1 parent 1eed98f commit 479cc9c

64 files changed

Lines changed: 240 additions & 124 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Doxyfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ PROJECT_NAME = LibTomCrypt
2323
# This could be handy for archiving the generated documentation or
2424
# if some version control system is used.
2525

26-
PROJECT_NUMBER = 1.13
26+
PROJECT_NUMBER = 1.14
2727

2828
# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
2929
# base path where the generated documentation will be put.

TODO

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
- long term, start moving macros like CTR over to LTC_CTR to make LTC a bit more "drop-in-able".
2+
- F8 mode could use some LTC_FAST love
3+
24

changes

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,23 @@
1+
August 0x1E, 0x07D6
2+
v1.14 -- Renamed the chaining mode macros from XXX to LTC_XXX_MODE. Should help avoid polluting the macro name space.
3+
-- clean up of SHA-256
4+
-- Chris Colman pointed out that der_decode_sequence_* allows LTC_ASN1_SETOF to accept SEQUENCEs and vice versa.
5+
Decoder [non-flexi decoder that is] is more strict now and requires a match.
6+
-- Steffen Jaeckel pointed out a typo in the user manual (re: rsa_exptmod). Fixed. This disproves the notion that
7+
nobody reads it. :-)
8+
-- Made GCM a bit more portable w.r.t. handling the CTR IV (e.g. & with 255)
9+
-- Add LTC_VERBOSE if you really want to see what test is doing :-)
10+
-- Added SSE2 support to GCM [use GCM_TABLES_SSE2 to enable], shaves 2 cycles per byte on Opteron processors
11+
Shaved 4 cycles on a Prescott (Intel P4)
12+
Requires you align your gcm_state on a 16 byte boundary, see gcm_memory() for more info
13+
-- Added missing prototype for f8_test_mode()
14+
-- two fixes to CCM for corner cases [L+noncelen > 15] and fixing the CTR pad to encrypt the CBC-MAC tag
15+
-- Franz Glasner pointed out the ARGTYPE=4 is not actually valid. Fixed.
16+
-- Fixed bug in f8_start() if your key < saltkey unspecified behaviour occurs. :-(
17+
-- Documented F8 mode. Yeah, because you read the manual.
18+
-- Minor updates to the technotes.
19+
20+
121
June 17th, 2005
222
v1.13 -- Fixed to fortuna_start() to clean up state if an error occurs. Not really useful at this stage (sha256 can't fail) but useful
323
if I ever make fortuna pluggable
@@ -1464,6 +1484,6 @@ v0.02 -- Changed RC5 to only allow 12 to 24 rounds
14641484
v0.01 -- We will call this the first version.
14651485

14661486
/* $Source: /cvs/libtom/libtomcrypt/changes,v $ */
1467-
/* $Revision: 1.213 $ */
1468-
/* $Date: 2006/06/18 01:42:59 $ */
1487+
/* $Revision: 1.224 $ */
1488+
/* $Date: 2006/08/30 23:23:20 $ */
14691489

crypt.tex

Lines changed: 53 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
\def\gap{\vspace{0.5ex}}
4848
\makeindex
4949
\begin{document}
50-
\title{LibTomCrypt \\ Version 1.13}
50+
\title{LibTomCrypt \\ Version 1.14}
5151
\author{Tom St Denis \\
5252
\\
5353
tomstdenis@gmail.com \\
@@ -1007,6 +1007,55 @@ \subsection{LRW Mode}
10071007
int lrw_done(symmetric_LRW *lrw);
10081008
\end{verbatim}
10091009

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{}
10101059
\section{Encrypt and Authenticate Modes}
10111060
10121061
\subsection{EAX Mode}
@@ -2719,8 +2768,7 @@ \subsection{RSA Exponentiation}
27192768
\begin{verbatim}
27202769
int rsa_exptmod(const unsigned char *in, unsigned long inlen,
27212770
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);
27242772
\end{verbatim}
27252773
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
27262774
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}
52415289
\end{document}
52425290
52435291
% $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 $

demos/timing.c

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,6 @@ reg_algs();
1616
extern ltc_math_descriptor EXT_MATH_LIB;
1717
ltc_mp = EXT_MATH_LIB;
1818
#endif
19-
time_cipher();
20-
time_hash();
21-
time_encmacs();
22-
time_rsa();
23-
time_ecc();
24-
time_ecc();
25-
return 0;
2619
time_keysched();
2720
time_cipher();
2821
time_cipher2();

doc/crypt.pdf

3.96 KB
Binary file not shown.

makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# Modified by Clay Culver
55

66
# The version
7-
VERSION=1.13
7+
VERSION=1.14
88

99
# Compiler and Linker Names
1010
#CC=gcc
@@ -367,5 +367,5 @@ zipup: no_oops docs
367367

368368

369369
# $Source: /cvs/libtom/libtomcrypt/makefile,v $
370-
# $Revision: 1.126 $
371-
# $Date: 2006/06/16 23:52:08 $
370+
# $Revision: 1.127 $
371+
# $Date: 2006/06/29 01:59:34 $

makefile.shared

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# Tom St Denis
77

88
# The version
9-
VERSION=0:113
9+
VERSION=0:114
1010

1111
# Compiler and Linker Names
1212
CC=libtool --mode=compile --tag=CC gcc
@@ -265,5 +265,5 @@ timing: library testprof/$(LIBTEST) $(TIMINGS)
265265
gcc -o $(TIMING) $(TIMINGS) -ltomcrypt_prof -ltomcrypt $(EXTRALIBS)
266266

267267
# $Source: /cvs/libtom/libtomcrypt/makefile.shared,v $
268-
# $Revision: 1.58 $
269-
# $Date: 2006/06/16 23:52:08 $
268+
# $Revision: 1.59 $
269+
# $Date: 2006/06/29 01:59:34 $

notes/tech0005.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ You can disable whole classes of algorithms on the command line with the LTC_NO_
1212
The following build with GCC 3.4.4 on an AMD64 box gets you AES, CTR mode, SHA-256, HMAC, Yarrow, full RSA PKCS #1, PKCS #5 and ASN.1 DER in
1313
roughly 40KB of code (49KB on the ARMv4) (both excluding the math library).
1414

15-
CFLAGS="-DLTC_NO_CIPHERS -DLTC_NO_HASHES -DLTC_NO_PRNGS -DLTC_NO_MACS -DLTC_NO_MODES -DLTC_NO_PK -DRIJNDAEL -DCTR -DSHA256 \
15+
CFLAGS="-DLTC_NO_CIPHERS -DLTC_NO_HASHES -DLTC_NO_PRNGS -DLTC_NO_MACS -DLTC_NO_MODES -DLTC_NO_PK -DRIJNDAEL -DLTC_CTR_MODE -DSHA256 \
1616
-DHMAC -DYARROW -DMRSA -DMPI -DTFM_DESC -DARGTYPE=3 -Os -DLTC_SMALL_CODE -fomit-frame-pointer" make IGNORE_SPEED=1
1717

1818
Obviously this won't get you performance but if you need to pack a crypto lib in a device with limited means it's more than enough...

notes/tech0007.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
Tech Note #7
22
Quick building for testing with LTM
33

4-
EXTRALIBS=-ltommath CFLAGS="-g3 -DLTC_NO_ASM" make -j3 IGNORE_SPEED=1 test
4+
EXTRALIBS=-ltommath CFLAGS="-g3 -DLTC_NO_ASM -DUSE_LTM -DLTM_DESC" make -j3 IGNORE_SPEED=1 test
55

0 commit comments

Comments
 (0)