Skip to content

Commit 65c1317

Browse files
Tom St Denissjaeckel
authored andcommitted
added libtomcrypt-1.02
1 parent 6ac9952 commit 65c1317

14 files changed

Lines changed: 38 additions & 34 deletions

File tree

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.00rc1
26+
PROJECT_NUMBER = 1.02
2727

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

changes

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
April 19th, 2005
2+
v1.02
3+
-- Added LTC_TEST support to gcm_test()
4+
-- "pt/ct" can now be NULL in gcm_process() if you are processing zero bytes
5+
-- Optimized GCM by removing the "double copy" handling of the plaintext/aad
6+
-- Richard Outerbridge pointed out that x86_prof won't build on MACOS and that the manual
7+
erroneously refers to "mycrypt" all over the place. Fixed.
8+
19
April 17th, 2005
210
v1.01
311
** Secure Science Corporation has supported this release cycle by sponsoring the development time taken. Their
@@ -54,7 +62,7 @@ v1.01
5462
-- Added "stest" build to intel CC to test static linked from within the dir (so you don't have to install to test)
5563
-- Moved testing/benchmark into testprof directory and build it as part of the build. Now you can link against libtomcrypt_prof.a to get
5664
testing info (hint: hardware developers ;-) )
57-
-- Added CCM to tv_gen
65+
-- Added CCM to tv_gen
5866
-- Added demos to MSVC makefile
5967
-- Removed -funroll-all-loops from GCC makefile and replaced with -funroll-loops which is a bit more sane (P4 ain't got much cache for the IDATA)
6068
-- Fixed GCM prior to release and re-enabled it. It has not been optimized but it does conform when compiled with optimizations.

crypt.tex

Lines changed: 8 additions & 8 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.01}
50+
\title{LibTomCrypt \\ Version 1.02}
5151
\author{Tom St Denis \\
5252
\\
5353
tomstdenis@gmail.com \\
@@ -167,7 +167,7 @@ \section{Patent Disclosure}
167167

168168
The author (Tom St Denis) is not a patent lawyer so this section is not to be treated as legal advice. To the best
169169
of the authors knowledge the only patent related issues within the library are the RC5 and RC6 symmetric block ciphers.
170-
They can be removed from a build by simply commenting out the two appropriate lines in ``mycrypt\_custom.h''. The rest
170+
They can be removed from a build by simply commenting out the two appropriate lines in ``tomcrypt\_custom.h''. The rest
171171
of the ciphers and hashes are patent free or under patents that have since expired.
172172

173173
The RC2 and RC4 symmetric ciphers are not under patents but are under trademark regulations. This means you can use
@@ -593,7 +593,7 @@ \subsection{Notes}
593593

594594
\item
595595
Note that ``Twofish'' has additional configuration options that take place at build time. These options are found in
596-
the file ``mycrypt\_cfg.h''. The first option is ``TWOFISH\_SMALL'' which when defined will force the Twofish code
596+
the file ``tomcrypt\_cfg.h''. The first option is ``TWOFISH\_SMALL'' which when defined will force the Twofish code
597597
to not pre-compute the Twofish ``$g(X)$'' function as a set of four $8 \times 32$ s-boxes. This means that a scheduled
598598
key will require less ram but the resulting cipher will be slower. The second option is ``TWOFISH\_TABLES'' which when
599599
defined will force the Twofish code to use pre-computed tables for the two s-boxes $q_0, q_1$ as well as the multiplication
@@ -3728,8 +3728,8 @@ \section{Building a Shared Library}
37283728
and install them into /usr/lib (and the headers into /usr/include). To link your application you should use the
37293729
libtool program in ``--mode=link''.
37303730
3731-
\section{mycrypt\_cfg.h}
3732-
The file ``mycrypt\_cfg.h'' is what lets you control various high level macros which control the behaviour
3731+
\section{tomcrypt\_cfg.h}
3732+
The file ``tomcrypt\_cfg.h'' is what lets you control various high level macros which control the behaviour
37333733
of the library.
37343734
37353735
\subsubsection{ARGTYPE}
@@ -3748,10 +3748,10 @@ \subsubsection{Endianess}
37483748
Currently LibTomCrypt will detect x86-32 and x86-64 running GCC as well as x86-32 running MSVC.
37493749
37503750
\section{The Configure Script}
3751-
There are also options you can specify from the configure script or ``mycrypt\_custom.h''.
3751+
There are also options you can specify from the configure script or ``tomcrypt\_custom.h''.
37523752
37533753
\subsection{X memory routines}
3754-
At the top of mycrypt\_custom.h are four macros denoted as XMALLOC, XCALLOC, XREALLOC and XFREE which resolve to
3754+
At the top of tomcrypt\_custom.h are four macros denoted as XMALLOC, XCALLOC, XREALLOC and XFREE which resolve to
37553755
the name of the respective functions. This lets you substitute in your own memory routines. If you substitute in
37563756
your own functions they must behave like the standard C library functions in terms of what they expect as input and
37573757
output. By default the library uses the standard C routines.
@@ -3830,7 +3830,7 @@ \subsection{RSA Only Tweak}
38303830
to reduce the library size. Follow these steps
38313831
38323832
\begin{enumerate}
3833-
\item Undefine MDSA, MECC and MDH from mycrypt\_custom.h
3833+
\item Undefine MDSA, MECC and MDH from tomcrypt\_custom.h
38343834
\item Undefine LTM\_ALL from tommath\_superclass.h
38353835
\item Define SC\_RSA\_1 from tommath\_superclass.h
38363836
\item Rebuild the library.

doc/crypt.pdf

126 Bytes
Binary file not shown.

makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# Modified by Clay Culver
55

66
# The version
7-
VERSION=1.01
7+
VERSION=1.02
88

99
# Compiler and Linker Names
1010
#CC=gcc

makefile.shared

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# Tom St Denis
77

88
# The version
9-
VERSION=0:101
9+
VERSION=0:102
1010

1111
# Compiler and Linker Names
1212
CC=libtool --mode=compile gcc

src/encauth/gcm/gcm_add_aad.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -101,13 +101,10 @@ int gcm_add_aad(gcm_state *gcm,
101101

102102
/* start adding AAD data to the state */
103103
for (; x < adatalen; x++) {
104-
gcm->buf[gcm->buflen++] = *adata++;
104+
gcm->X[gcm->buflen++] ^= *adata++;
105105

106106
if (gcm->buflen == 16) {
107107
/* GF mult it */
108-
for (y = 0; y < 16; y++) {
109-
gcm->X[y] ^= gcm->buf[y];
110-
}
111108
gcm_mult_h(gcm, gcm->X);
112109
gcm->buflen = 0;
113110
gcm->totlen += 128;

src/encauth/gcm/gcm_done.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,6 @@ int gcm_done(gcm_state *gcm,
4949

5050
/* handle remaining ciphertext */
5151
if (gcm->buflen) {
52-
for (x = 0; x < (unsigned long)gcm->buflen; x++) {
53-
gcm->X[x] ^= gcm->buf[x];
54-
}
5552
gcm->pttotlen += gcm->buflen * CONST64(8);
5653
gcm_mult_h(gcm, gcm->X);
5754
}

src/encauth/gcm/gcm_process.c

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,10 @@ int gcm_process(gcm_state *gcm,
3636
int err;
3737

3838
LTC_ARGCHK(gcm != NULL);
39-
LTC_ARGCHK(pt != NULL);
40-
LTC_ARGCHK(ct != NULL);
39+
if (ptlen > 0) {
40+
LTC_ARGCHK(pt != NULL);
41+
LTC_ARGCHK(ct != NULL);
42+
}
4143

4244
if (gcm->buflen > 16 || gcm->buflen < 0) {
4345
return CRYPT_INVALID_ARG;
@@ -51,9 +53,6 @@ int gcm_process(gcm_state *gcm,
5153
if (gcm->mode == GCM_MODE_AAD) {
5254
/* let's process the AAD */
5355
if (gcm->buflen) {
54-
for (x = 0; x < (unsigned long)gcm->buflen; x++) {
55-
gcm->X[x] ^= gcm->buf[x];
56-
}
5756
gcm->totlen += gcm->buflen * CONST64(8);
5857
gcm_mult_h(gcm, gcm->X);
5958
}
@@ -115,9 +114,6 @@ int gcm_process(gcm_state *gcm,
115114
/* process text */
116115
for (; x < ptlen; x++) {
117116
if (gcm->buflen == 16) {
118-
for (y = 0; y < 16; y++) {
119-
gcm->X[y] ^= gcm->buf[y];
120-
}
121117
gcm->pttotlen += 128;
122118
gcm_mult_h(gcm, gcm->X);
123119

@@ -135,7 +131,7 @@ int gcm_process(gcm_state *gcm,
135131
b = ct[x];
136132
pt[x] = ct[x] ^ gcm->buf[gcm->buflen];
137133
}
138-
gcm->buf[gcm->buflen++] = b;
134+
gcm->X[gcm->buflen++] ^= b;
139135
}
140136

141137
return CRYPT_OK;

src/encauth/gcm/gcm_test.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@
2323
*/
2424
int gcm_test(void)
2525
{
26+
#ifndef LTC_TEST
27+
return CRYPT_NOP;
28+
#else
2629
static const struct {
2730
unsigned char K[32];
2831
int keylen;
@@ -355,6 +358,7 @@ int gcm_test(void)
355358

356359
}
357360
return CRYPT_OK;
361+
#endif
358362
}
359363

360364
#endif

0 commit comments

Comments
 (0)