Commit f3b834d5 authored by Matt Johnston's avatar Matt Johnston

Update to LibTomCrypt 1.16

--HG--
branch : libtomcrypt-orig
extra : convert_revision : 52840647ac7f5c707c3bd158d119a15734a7ef28
parent c57e1d8d
......@@ -23,7 +23,7 @@ PROJECT_NAME = LibTomCrypt
# This could be handy for archiving the generated documentation or
# if some version control system is used.
PROJECT_NUMBER = 1.05
PROJECT_NUMBER = 1.16
# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
# base path where the generated documentation will be put.
......@@ -1028,14 +1028,14 @@ CLASS_DIAGRAMS = YES
# inheritance and usage relations if the target is undocumented
# or is not a class.
HIDE_UNDOC_RELATIONS = YES
HIDE_UNDOC_RELATIONS = NO
# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is
# available from the path. This tool is part of Graphviz, a graph visualization
# toolkit from AT&T and Lucent Bell Labs. The other options in this section
# have no effect if this option is set to NO (the default)
HAVE_DOT = YES
HAVE_DOT = NO
# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen
# will generate a graph for each documented class showing the direct and
......
See doc/crypt.pdf
For 1.06
stopped at ch12
-- needs examples for ecc/dsa!!! (and for asn.1)
1. export ECC functions globally [e.g. mulmod and the sets]
- goal is tv_gen module and test vectors
2. ASN.1 SET and T61String
3. phase out DH code [RSA/ECC/DSA is enough]
4. Some ASN.1 demo programs [for now read the source code!]
5. Start working towards making the bignum code plugable
6. Look into other ECC point muls and consider a "precomp" interface
7. Add OID for ciphers and PRNGs to their descriptors
must have for v1.16
- document PK build flags
- document makefile flags [INSTALL_* for instance]
- prepare manual for printing (both soft and hard cover)
Nice to have [in order of precedence]
- add X9.63 IES
- add CPP macros like OpenSSL has for ASN1 (e.g. encode/decode functions, etc) shameless ripoff :-)
......@@ -2,12 +2,12 @@
echo "$1 ($2, $3)..."
make clean 1>/dev/null 2>/dev/null
echo -n "building..."
CFLAGS="$2 $CFLAGS" make -j3 -f $3 test tv_gen 1>gcc_1.txt 2>gcc_2.txt || (echo "build $1 failed see gcc_2.txt for more information" && cat gcc_2.txt && exit 1)
CFLAGS="$2 $CFLAGS $4" EXTRALIBS="$5" make -j4 -f $3 test tv_gen 1>gcc_1.txt 2>gcc_2.txt || (echo "build $1 failed see gcc_2.txt for more information" && cat gcc_2.txt && exit 1)
echo -n "testing..."
if [ -a test ] && [ -f test ] && [ -x test ]; then
((./test >test_std.txt 2>test_err.txt && ./tv_gen > tv.txt) && echo "$1 test passed." && echo "y" > testok.txt) || (echo "$1 test failed" && cat test_err.txt && exit 1)
if find *_tv.txt -type f 1>/dev/null 2>/dev/null ; then
for f in *_tv.txt; do if (diff $f notes/$f) then true; else (echo "tv_gen $f failed" && rm -f testok.txt && exit 1); fi; done
for f in *_tv.txt; do if (diff --ignore-case $f notes/$f) then true; else (echo "tv_gen $f failed" && rm -f testok.txt && exit 1); fi; done
fi
fi
if [ -a testok.txt ] && [ -f testok.txt ]; then
......@@ -16,5 +16,5 @@ fi
exit 1
# $Source: /cvs/libtom/libtomcrypt/build.sh,v $
# $Revision: 1.5 $
# $Date: 2005/06/27 13:04:05 $
# $Revision: 1.9 $
# $Date: 2006/03/18 14:10:55 $
This diff is collapsed.
\addvspace {10\[email protected] }
\addvspace {10\[email protected] }
\contentsline {figure}{\numberline {2.1}{\ignorespaces Load And Store Macros}}{9}{figure.2.1}
\contentsline {figure}{\numberline {2.2}{\ignorespaces Rotate Macros}}{9}{figure.2.2}
\addvspace {10\[email protected] }
\contentsline {figure}{\numberline {3.1}{\ignorespaces Built--In Software Ciphers}}{19}{figure.3.1}
\contentsline {figure}{\numberline {3.2}{\ignorespaces Twofish Build Options}}{21}{figure.3.2}
\addvspace {10\[email protected] }
\contentsline {figure}{\numberline {4.1}{\ignorespaces Built--In Software Hashes}}{57}{figure.4.1}
\addvspace {10\[email protected] }
\addvspace {10\[email protected] }
\contentsline {figure}{\numberline {6.1}{\ignorespaces List of Provided PRNGs}}{82}{figure.6.1}
\addvspace {10\[email protected] }
\addvspace {10\[email protected] }
\addvspace {10\[email protected] }
\contentsline {figure}{\numberline {9.1}{\ignorespaces DSA Key Sizes}}{119}{figure.9.1}
\addvspace {10\[email protected] }
\contentsline {figure}{\numberline {10.1}{\ignorespaces List of ASN.1 Supported Types}}{127}{figure.10.1}
\addvspace {10\[email protected] }
\addvspace {10\[email protected] }
\contentsline {figure}{\numberline {12.1}{\ignorespaces RSA/DH Key Strength}}{149}{figure.12.1}
\contentsline {figure}{\numberline {12.2}{\ignorespaces ECC Key Strength}}{149}{figure.12.2}
\addvspace {10\[email protected] }
\addvspace {10\[email protected] }
This diff is collapsed.
......@@ -170,7 +170,7 @@ int main(int argc, char *argv[])
exit(-1);
}
if ((errno = ctr_start(cipher_idx,IV,key,ks,0,&ctr)) != CRYPT_OK) {
if ((errno = ctr_start(cipher_idx,IV,key,ks,0,CTR_COUNTER_LITTLE_ENDIAN,&ctr)) != CRYPT_OK) {
printf("ctr_start error: %s\n",error_to_string(errno));
exit(-1);
}
......@@ -212,7 +212,7 @@ int main(int argc, char *argv[])
exit(-1);
}
if ((errno = ctr_start(cipher_idx,IV,key,ks,0,&ctr)) != CRYPT_OK) {
if ((errno = ctr_start(cipher_idx,IV,key,ks,0,CTR_COUNTER_LITTLE_ENDIAN,&ctr)) != CRYPT_OK) {
printf("ctr_start error: %s\n",error_to_string(errno));
exit(-1);
}
......@@ -237,5 +237,5 @@ int main(int argc, char *argv[])
}
/* $Source: /cvs/libtom/libtomcrypt/demos/encrypt.c,v $ */
/* $Revision: 1.2 $ */
/* $Date: 2005/05/05 14:35:56 $ */
/* $Revision: 1.3 $ */
/* $Date: 2005/08/04 20:43:50 $ */
......@@ -13,21 +13,21 @@ int main(void)
/* HASH testing */
len = sizeof(buf[0]);
hash_memory(find_hash("sha256"), "hello", 5, buf[0], &len);
hash_memory(find_hash("sha256"), (unsigned char*)"hello", 5, buf[0], &len);
len2 = sizeof(buf[0]);
hash_memory_multi(find_hash("sha256"), buf[1], &len2, "hello", 5, NULL);
hash_memory_multi(find_hash("sha256"), buf[1], &len2, (unsigned char*)"hello", 5, NULL);
if (len != len2 || memcmp(buf[0], buf[1], len)) {
printf("Failed: %d %lu %lu\n", __LINE__, len, len2);
return EXIT_FAILURE;
}
len2 = sizeof(buf[0]);
hash_memory_multi(find_hash("sha256"), buf[1], &len2, "he", 2, "llo", 3, NULL);
hash_memory_multi(find_hash("sha256"), buf[1], &len2, (unsigned char*)"he", 2UL, "llo", 3UL, NULL, 0);
if (len != len2 || memcmp(buf[0], buf[1], len)) {
printf("Failed: %d %lu %lu\n", __LINE__, len, len2);
return EXIT_FAILURE;
}
len2 = sizeof(buf[0]);
hash_memory_multi(find_hash("sha256"), buf[1], &len2, "h", 1, "e", 1, "l", 1, "l", 1, "o", 1, NULL);
hash_memory_multi(find_hash("sha256"), buf[1], &len2, (unsigned char*)"h", 1UL, "e", 1UL, "l", 1UL, "l", 1UL, "o", 1UL, NULL);
if (len != len2 || memcmp(buf[0], buf[1], len)) {
printf("Failed: %d %lu %lu\n", __LINE__, len, len2);
return EXIT_FAILURE;
......@@ -35,21 +35,21 @@ int main(void)
/* HMAC */
len = sizeof(buf[0]);
hmac_memory(find_hash("sha256"), key, 16, "hello", 5, buf[0], &len);
hmac_memory(find_hash("sha256"), key, 16, (unsigned char*)"hello", 5, buf[0], &len);
len2 = sizeof(buf[0]);
hmac_memory_multi(find_hash("sha256"), key, 16, buf[1], &len2, "hello", 5, NULL);
hmac_memory_multi(find_hash("sha256"), key, 16, buf[1], &len2, (unsigned char*)"hello", 5UL, NULL);
if (len != len2 || memcmp(buf[0], buf[1], len)) {
printf("Failed: %d %lu %lu\n", __LINE__, len, len2);
return EXIT_FAILURE;
}
len2 = sizeof(buf[0]);
hmac_memory_multi(find_hash("sha256"), key, 16, buf[1], &len2, "he", 2, "llo", 3, NULL);
hmac_memory_multi(find_hash("sha256"), key, 16, buf[1], &len2, (unsigned char*)"he", 2UL, "llo", 3UL, NULL);
if (len != len2 || memcmp(buf[0], buf[1], len)) {
printf("Failed: %d %lu %lu\n", __LINE__, len, len2);
return EXIT_FAILURE;
}
len2 = sizeof(buf[0]);
hmac_memory_multi(find_hash("sha256"), key, 16, buf[1], &len2, "h", 1, "e", 1, "l", 1, "l", 1, "o", 1, NULL);
hmac_memory_multi(find_hash("sha256"), key, 16, buf[1], &len2, (unsigned char*)"h", 1UL, "e", 1UL, "l", 1UL, "l", 1UL, "o", 1UL, NULL);
if (len != len2 || memcmp(buf[0], buf[1], len)) {
printf("Failed: %d %lu %lu\n", __LINE__, len, len2);
return EXIT_FAILURE;
......@@ -57,21 +57,21 @@ int main(void)
/* OMAC */
len = sizeof(buf[0]);
omac_memory(find_cipher("aes"), key, 16, "hello", 5, buf[0], &len);
omac_memory(find_cipher("aes"), key, 16, (unsigned char*)"hello", 5, buf[0], &len);
len2 = sizeof(buf[0]);
omac_memory_multi(find_cipher("aes"), key, 16, buf[1], &len2, "hello", 5, NULL);
omac_memory_multi(find_cipher("aes"), key, 16, buf[1], &len2, (unsigned char*)"hello", 5UL, NULL);
if (len != len2 || memcmp(buf[0], buf[1], len)) {
printf("Failed: %d %lu %lu\n", __LINE__, len, len2);
return EXIT_FAILURE;
}
len2 = sizeof(buf[0]);
omac_memory_multi(find_cipher("aes"), key, 16, buf[1], &len2, "he", 2, "llo", 3, NULL);
omac_memory_multi(find_cipher("aes"), key, 16, buf[1], &len2, (unsigned char*)"he", 2UL, "llo", 3UL, NULL);
if (len != len2 || memcmp(buf[0], buf[1], len)) {
printf("Failed: %d %lu %lu\n", __LINE__, len, len2);
return EXIT_FAILURE;
}
len2 = sizeof(buf[0]);
omac_memory_multi(find_cipher("aes"), key, 16, buf[1], &len2, "h", 1, "e", 1, "l", 1, "l", 1, "o", 1, NULL);
omac_memory_multi(find_cipher("aes"), key, 16, buf[1], &len2, (unsigned char*)"h", 1UL, "e", 1UL, "l", 1UL, "l", 1UL, "o", 1UL, NULL);
if (len != len2 || memcmp(buf[0], buf[1], len)) {
printf("Failed: %d %lu %lu\n", __LINE__, len, len2);
return EXIT_FAILURE;
......@@ -79,21 +79,21 @@ int main(void)
/* PMAC */
len = sizeof(buf[0]);
pmac_memory(find_cipher("aes"), key, 16, "hello", 5, buf[0], &len);
pmac_memory(find_cipher("aes"), key, 16, (unsigned char*)"hello", 5, buf[0], &len);
len2 = sizeof(buf[0]);
pmac_memory_multi(find_cipher("aes"), key, 16, buf[1], &len2, "hello", 5, NULL);
pmac_memory_multi(find_cipher("aes"), key, 16, buf[1], &len2, (unsigned char*)"hello", 5, NULL);
if (len != len2 || memcmp(buf[0], buf[1], len)) {
printf("Failed: %d %lu %lu\n", __LINE__, len, len2);
return EXIT_FAILURE;
}
len2 = sizeof(buf[0]);
pmac_memory_multi(find_cipher("aes"), key, 16, buf[1], &len2, "he", 2, "llo", 3, NULL);
pmac_memory_multi(find_cipher("aes"), key, 16, buf[1], &len2, (unsigned char*)"he", 2UL, "llo", 3UL, NULL);
if (len != len2 || memcmp(buf[0], buf[1], len)) {
printf("Failed: %d %lu %lu\n", __LINE__, len, len2);
return EXIT_FAILURE;
}
len2 = sizeof(buf[0]);
pmac_memory_multi(find_cipher("aes"), key, 16, buf[1], &len2, "h", 1, "e", 1, "l", 1, "l", 1, "o", 1, NULL);
pmac_memory_multi(find_cipher("aes"), key, 16, buf[1], &len2, (unsigned char*)"h", 1UL, "e", 1UL, "l", 1UL, "l", 1UL, "o", 1UL, NULL);
if (len != len2 || memcmp(buf[0], buf[1], len)) {
printf("Failed: %d %lu %lu\n", __LINE__, len, len2);
return EXIT_FAILURE;
......@@ -106,5 +106,5 @@ int main(void)
/* $Source: /cvs/libtom/libtomcrypt/demos/multi.c,v $ */
/* $Revision: 1.2 $ */
/* $Date: 2005/05/05 14:35:56 $ */
/* $Revision: 1.3 $ */
/* $Date: 2006/06/07 22:25:09 $ */
// small demo app that just includes a cipher/hash/prng
/* small demo app that just includes a cipher/hash/prng */
#include <tomcrypt.h>
int main(void)
......@@ -10,5 +10,5 @@ int main(void)
}
/* $Source: /cvs/libtom/libtomcrypt/demos/small.c,v $ */
/* $Revision: 1.2 $ */
/* $Date: 2005/05/05 14:35:56 $ */
/* $Revision: 1.3 $ */
/* $Date: 2006/06/07 22:25:09 $ */
......@@ -4,6 +4,18 @@ int main(void)
{
int x;
reg_algs();
#ifdef USE_LTM
ltc_mp = ltm_desc;
#elif defined(USE_TFM)
ltc_mp = tfm_desc;
#elif defined(USE_GMP)
ltc_mp = gmp_desc;
#else
extern ltc_math_descriptor EXT_MATH_LIB;
ltc_mp = EXT_MATH_LIB;
#endif
printf("build == \n%s\n", crypt_build_settings);
printf("\nstore_test...."); fflush(stdout); x = store_test(); printf(x ? "failed" : "passed");if (x) exit(EXIT_FAILURE);
printf("\ncipher_test..."); fflush(stdout); x = cipher_hash_test(); printf(x ? "failed" : "passed");if (x) exit(EXIT_FAILURE);
......@@ -12,13 +24,13 @@ int main(void)
printf("\nmac_test......"); fflush(stdout); x = mac_test(); printf(x ? "failed" : "passed");if (x) exit(EXIT_FAILURE);
printf("\npkcs_1_test..."); fflush(stdout); x = pkcs_1_test(); printf(x ? "failed" : "passed");if (x) exit(EXIT_FAILURE);
printf("\nrsa_test......"); fflush(stdout); x = rsa_test(); printf(x ? "failed" : "passed");if (x) exit(EXIT_FAILURE);
printf("\necc_test......"); fflush(stdout); x = ecc_tests(); printf(x ? "failed" : "passed");if (x) exit(EXIT_FAILURE);
printf("\necc_test......"); fflush(stdout); x = ecc_tests(); printf(x ? "failed" : "passed");if (x) exit(EXIT_FAILURE);
printf("\ndsa_test......"); fflush(stdout); x = dsa_test(); printf(x ? "failed" : "passed");if (x) exit(EXIT_FAILURE);
printf("\ndh_test......."); fflush(stdout); x = dh_tests(); printf(x ? "failed" : "passed");if (x) exit(EXIT_FAILURE);
printf("\nkatja_test...."); fflush(stdout); x = katja_test(); printf(x ? "failed" : "passed");if (x) exit(EXIT_FAILURE);
printf("\n");
return EXIT_SUCCESS;
}
/* $Source: /cvs/libtom/libtomcrypt/demos/test.c,v $ */
/* $Revision: 1.12 $ */
/* $Date: 2005/06/19 12:06:58 $ */
/* $Revision: 1.28 $ */
/* $Date: 2006/05/25 10:50:08 $ */
......@@ -2,12 +2,26 @@
int main(void)
{
init_timer();
reg_algs();
#ifdef USE_LTM
ltc_mp = ltm_desc;
#elif defined(USE_TFM)
ltc_mp = tfm_desc;
#elif defined(USE_GMP)
ltc_mp = gmp_desc;
#else
extern ltc_math_descriptor EXT_MATH_LIB;
ltc_mp = EXT_MATH_LIB;
#endif
time_keysched();
time_cipher();
time_cipher2();
time_cipher3();
time_cipher4();
time_hash();
time_macs();
time_encmacs();
......@@ -16,11 +30,13 @@ time_mult();
time_sqr();
time_rsa();
time_ecc();
time_dh();
#ifdef USE_LTM
time_katja();
#endif
return EXIT_SUCCESS;
}
/* $Source: /cvs/libtom/libtomcrypt/demos/timing.c,v $ */
/* $Revision: 1.17 $ */
/* $Date: 2005/06/23 02:16:26 $ */
/* $Revision: 1.61 $ */
/* $Date: 2006/12/03 03:08:35 $ */
......@@ -98,6 +98,18 @@ void reg_algs(void)
}
#endif
#ifdef USE_LTM
ltc_mp = ltm_desc;
#elif defined(USE_TFM)
ltc_mp = tfm_desc;
#elif defined(USE_GMP)
ltc_mp = gmp_desc;
#else
extern ltc_math_descriptor EXT_MATH_LIB;
ltc_mp = EXT_MATH_LIB;
#endif
}
void hash_gen(void)
......@@ -541,7 +553,7 @@ void ccm_gen(void)
plaintext[z] = (unsigned char)(z & 255);
}
len = sizeof(tag);
if ((err = ccm_memory(x, key, kl, nonce, 13, plaintext, y1, plaintext, y1, plaintext, tag, &len, CCM_ENCRYPT)) != CRYPT_OK) {
if ((err = ccm_memory(x, key, kl, NULL, nonce, 13, plaintext, y1, plaintext, y1, plaintext, tag, &len, CCM_ENCRYPT)) != CRYPT_OK) {
printf("Error CCM'ing: %s\n", error_to_string(err));
exit(EXIT_FAILURE);
}
......@@ -641,30 +653,134 @@ void base64_gen(void)
fclose(out);
}
void math_gen(void)
{
}
void ecc_gen(void)
{
FILE *out;
unsigned char str[512];
void *k, *order, *modulus;
ecc_point *G, *R;
int x;
out = fopen("ecc_tv.txt", "w");
fprintf(out, "ecc vectors. These are for kG for k=1,3,9,27,...,3**n until k > order of the curve outputs are <k,x,y> triplets\n\n");
G = ltc_ecc_new_point();
R = ltc_ecc_new_point();
mp_init(&k);
mp_init(&order);
mp_init(&modulus);
for (x = 0; ltc_ecc_sets[x].size != 0; x++) {
fprintf(out, "ECC-%d\n", ltc_ecc_sets[x].size*8);
mp_set(k, 1);
mp_read_radix(order, (char *)ltc_ecc_sets[x].order, 16);
mp_read_radix(modulus, (char *)ltc_ecc_sets[x].prime, 16);
mp_read_radix(G->x, (char *)ltc_ecc_sets[x].Gx, 16);
mp_read_radix(G->y, (char *)ltc_ecc_sets[x].Gy, 16);
mp_set(G->z, 1);
while (mp_cmp(k, order) == LTC_MP_LT) {
ltc_mp.ecc_ptmul(k, G, R, modulus, 1);
mp_tohex(k, (char*)str); fprintf(out, "%s, ", (char*)str);
mp_tohex(R->x, (char*)str); fprintf(out, "%s, ", (char*)str);
mp_tohex(R->y, (char*)str); fprintf(out, "%s\n", (char*)str);
mp_mul_d(k, 3, k);
}
}
mp_clear_multi(k, order, modulus, NULL);
ltc_ecc_del_point(G);
ltc_ecc_del_point(R);
fclose(out);
}
void lrw_gen(void)
{
FILE *out;
unsigned char tweak[16], key[16], iv[16], buf[1024];
int x, y, err;
symmetric_LRW lrw;
/* initialize default key and tweak */
for (x = 0; x < 16; x++) {
tweak[x] = key[x] = iv[x] = x;
}
out = fopen("lrw_tv.txt", "w");
for (x = 16; x < (int)(sizeof(buf)); x += 16) {
if ((err = lrw_start(find_cipher("aes"), iv, key, 16, tweak, 0, &lrw)) != CRYPT_OK) {
fprintf(stderr, "Error starting LRW-AES: %s\n", error_to_string(err));
exit(EXIT_FAILURE);
}
/* encrypt incremental */
for (y = 0; y < x; y++) {
buf[y] = y & 255;
}
if ((err = lrw_encrypt(buf, buf, x, &lrw)) != CRYPT_OK) {
fprintf(stderr, "Error encrypting with LRW-AES: %s\n", error_to_string(err));
exit(EXIT_FAILURE);
}
/* display it */
fprintf(out, "%d:", x);
for (y = 0; y < x; y++) {
fprintf(out, "%02x", buf[y]);
}
fprintf(out, "\n");
/* reset IV */
if ((err = lrw_setiv(iv, 16, &lrw)) != CRYPT_OK) {
fprintf(stderr, "Error setting IV: %s\n", error_to_string(err));
exit(EXIT_FAILURE);
}
/* copy new tweak, iv and key */
for (y = 0; y < 16; y++) {
key[y] = buf[y];
iv[y] = buf[(y+16)%x];
tweak[y] = buf[(y+32)%x];
}
if ((err = lrw_decrypt(buf, buf, x, &lrw)) != CRYPT_OK) {
fprintf(stderr, "Error decrypting with LRW-AES: %s\n", error_to_string(err));
exit(EXIT_FAILURE);
}
/* display it */
fprintf(out, "%d:", x);
for (y = 0; y < x; y++) {
fprintf(out, "%02x", buf[y]);
}
fprintf(out, "\n");
lrw_done(&lrw);
}
fclose(out);
}
int main(void)
{
reg_algs();
printf("Generating hash vectors..."); fflush(stdout); hash_gen(); printf("done\n");
printf("Generating hash vectors..."); fflush(stdout); hash_gen(); printf("done\n");
printf("Generating cipher vectors..."); fflush(stdout); cipher_gen(); printf("done\n");
printf("Generating HMAC vectors..."); fflush(stdout); hmac_gen(); printf("done\n");
printf("Generating OMAC vectors..."); fflush(stdout); omac_gen(); printf("done\n");
printf("Generating PMAC vectors..."); fflush(stdout); pmac_gen(); printf("done\n");
printf("Generating EAX vectors..."); fflush(stdout); eax_gen(); printf("done\n");
printf("Generating OCB vectors..."); fflush(stdout); ocb_gen(); printf("done\n");
printf("Generating CCM vectors..."); fflush(stdout); ccm_gen(); printf("done\n");
printf("Generating GCM vectors..."); fflush(stdout); gcm_gen(); printf("done\n");
printf("Generating HMAC vectors..."); fflush(stdout); hmac_gen(); printf("done\n");
printf("Generating OMAC vectors..."); fflush(stdout); omac_gen(); printf("done\n");
printf("Generating PMAC vectors..."); fflush(stdout); pmac_gen(); printf("done\n");
printf("Generating EAX vectors..."); fflush(stdout); eax_gen(); printf("done\n");
printf("Generating OCB vectors..."); fflush(stdout); ocb_gen(); printf("done\n");
printf("Generating CCM vectors..."); fflush(stdout); ccm_gen(); printf("done\n");
printf("Generating GCM vectors..."); fflush(stdout); gcm_gen(); printf("done\n");
printf("Generating BASE64 vectors..."); fflush(stdout); base64_gen(); printf("done\n");
printf("Generating MATH vectors..."); fflush(stdout); math_gen(); printf("done\n");
printf("Generating ECC vectors..."); fflush(stdout); ecc_gen(); printf("done\n");
printf("Generating LRW vectors..."); fflush(stdout); lrw_gen(); printf("done\n");
return 0;
}
/* $Source: /cvs/libtom/libtomcrypt/demos/tv_gen.c,v $ */
/* $Revision: 1.4 $ */
/* $Date: 2005/05/05 14:35:56 $ */
/* $Revision: 1.15 $ */
/* $Date: 2006/06/09 22:10:27 $ */
No preview for this file type
<hr width="80%">
Code by <a href="http://www.libtomcrypt.org/">Tom</a><br>
Code by <a href="http://www.libtomcrypt.com/">Tom</a><br>
Docs using <img src="doxygen.png" alt="doxygen" align="middle" border=0>
<a href="http://jlcooke.ca/tom/hidden_image.png">
<!--
/* $Source: /cvs/libtom/libtomcrypt/doc/footer.html,v $ */
/* $Revision: 1.3 $ */
/* $Date: 2005/05/07 10:09:20 $ */
/* $Revision: 1.4 $ */
/* $Date: 2006/03/31 14:15:34 $ */
-->
#!/usr/bin/perl
# we want to filter every between START_INS and END_INS out and then insert crap from another file (this is fun)
$dst = shift;
$ins = shift;
open(SRC,"<$dst");
open(INS,"<$ins");
open(TMP,">tmp.delme");
$l = 0;
while (<SRC>) {
if ($_ =~ /START_INS/) {
print TMP $_;
$l = 1;
while (<INS>) {
print TMP $_;
}
close INS;
} elsif ($_ =~ /END_INS/) {
print TMP $_;
$l = 0;
} elsif ($l == 0) {
print TMP $_;
}
}
close TMP;
close SRC;
open(IN,"<crypt.ind");
open(OUT,">crypt.ind.tmp");
$a = <IN>;
print OUT "$a\n\\addcontentsline{toc}{chapter}{Index}\n";
while (<IN>) {
print OUT $_;
}
close OUT;
close IN;
system("mv -f crypt.ind.tmp crypt.ind");