diff options
Diffstat (limited to 'libtomcrypt/testprof')
-rw-r--r-- | libtomcrypt/testprof/base64_test.c | 6 | ||||
-rw-r--r-- | libtomcrypt/testprof/cipher_hash_test.c | 6 | ||||
-rw-r--r-- | libtomcrypt/testprof/der_tests.c | 8 | ||||
-rw-r--r-- | libtomcrypt/testprof/dsa_test.c | 8 | ||||
-rw-r--r-- | libtomcrypt/testprof/ecc_test.c | 8 | ||||
-rw-r--r-- | libtomcrypt/testprof/katja_test.c | 2 | ||||
-rw-r--r-- | libtomcrypt/testprof/mac_test.c | 16 | ||||
-rw-r--r-- | libtomcrypt/testprof/modes_test.c | 10 | ||||
-rw-r--r-- | libtomcrypt/testprof/pkcs_1_test.c | 10 | ||||
-rw-r--r-- | libtomcrypt/testprof/rsa_test.c | 24 | ||||
-rw-r--r-- | libtomcrypt/testprof/store_test.c | 6 | ||||
-rw-r--r-- | libtomcrypt/testprof/test_driver.c | 6 | ||||
-rw-r--r-- | libtomcrypt/testprof/tomcrypt_test.h | 6 | ||||
-rw-r--r-- | libtomcrypt/testprof/x86_prof.c | 105 |
14 files changed, 114 insertions, 107 deletions
diff --git a/libtomcrypt/testprof/base64_test.c b/libtomcrypt/testprof/base64_test.c index af20a67..5ce55dd 100644 --- a/libtomcrypt/testprof/base64_test.c +++ b/libtomcrypt/testprof/base64_test.c @@ -19,6 +19,6 @@ int base64_test(void) return 0; } -/* $Source: /cvs/libtom/libtomcrypt/testprof/base64_test.c,v $ */ -/* $Revision: 1.5 $ */ -/* $Date: 2005/05/21 12:51:25 $ */ +/* $Source$ */ +/* $Revision$ */ +/* $Date$ */ diff --git a/libtomcrypt/testprof/cipher_hash_test.c b/libtomcrypt/testprof/cipher_hash_test.c index 27232e2..666d913 100644 --- a/libtomcrypt/testprof/cipher_hash_test.c +++ b/libtomcrypt/testprof/cipher_hash_test.c @@ -40,6 +40,6 @@ int cipher_hash_test(void) return 0; } -/* $Source: /cvs/libtom/libtomcrypt/testprof/cipher_hash_test.c,v $ */ -/* $Revision: 1.3 $ */ -/* $Date: 2005/05/05 14:35:59 $ */ +/* $Source$ */ +/* $Revision$ */ +/* $Date$ */ diff --git a/libtomcrypt/testprof/der_tests.c b/libtomcrypt/testprof/der_tests.c index 2881886..2778d50 100644 --- a/libtomcrypt/testprof/der_tests.c +++ b/libtomcrypt/testprof/der_tests.c @@ -1,5 +1,5 @@ #include <tomcrypt_test.h> -#if defined(GMP_DESC) || defined(USE_GMP) +#if defined(GMP_LTC_DESC) || defined(USE_GMP) #include <gmp.h> #endif @@ -848,6 +848,6 @@ tmp_time.off_hh); #endif -/* $Source: /cvs/libtom/libtomcrypt/testprof/der_tests.c,v $ */ -/* $Revision: 1.49 $ */ -/* $Date: 2006/11/26 02:10:21 $ */ +/* $Source$ */ +/* $Revision$ */ +/* $Date$ */ diff --git a/libtomcrypt/testprof/dsa_test.c b/libtomcrypt/testprof/dsa_test.c index f623092..2398ba2 100644 --- a/libtomcrypt/testprof/dsa_test.c +++ b/libtomcrypt/testprof/dsa_test.c @@ -1,6 +1,6 @@ #include <tomcrypt_test.h> -#ifdef MDSA +#ifdef LTC_MDSA int dsa_test(void) { @@ -77,6 +77,6 @@ int dsa_test(void) #endif -/* $Source: /cvs/libtom/libtomcrypt/testprof/dsa_test.c,v $ */ -/* $Revision: 1.9 $ */ -/* $Date: 2005/10/30 18:49:14 $ */ +/* $Source$ */ +/* $Revision$ */ +/* $Date$ */ diff --git a/libtomcrypt/testprof/ecc_test.c b/libtomcrypt/testprof/ecc_test.c index ccfabe2..d623af3 100644 --- a/libtomcrypt/testprof/ecc_test.c +++ b/libtomcrypt/testprof/ecc_test.c @@ -1,6 +1,6 @@ #include <tomcrypt_test.h> -#ifdef MECC +#ifdef LTC_MECC static int sizes[] = { #ifdef ECC112 @@ -247,6 +247,6 @@ int ecc_tests(void) #endif -/* $Source: /cvs/libtom/libtomcrypt/testprof/ecc_test.c,v $ */ -/* $Revision: 1.21 $ */ -/* $Date: 2006/12/04 03:21:03 $ */ +/* $Source$ */ +/* $Revision$ */ +/* $Date$ */ diff --git a/libtomcrypt/testprof/katja_test.c b/libtomcrypt/testprof/katja_test.c index 47d01fe..86fe6b0 100644 --- a/libtomcrypt/testprof/katja_test.c +++ b/libtomcrypt/testprof/katja_test.c @@ -13,7 +13,7 @@ int katja_test(void) hash_idx = find_hash("sha1"); prng_idx = find_prng("yarrow"); if (hash_idx == -1 || prng_idx == -1) { - fprintf(stderr, "katja_test requires SHA1 and yarrow"); + fprintf(stderr, "katja_test requires LTC_SHA1 and yarrow"); return 1; } diff --git a/libtomcrypt/testprof/mac_test.c b/libtomcrypt/testprof/mac_test.c index 410e4b5..c09bb1d 100644 --- a/libtomcrypt/testprof/mac_test.c +++ b/libtomcrypt/testprof/mac_test.c @@ -18,24 +18,24 @@ int mac_test(void) #ifdef LTC_F9_MODE DO(f9_test()); #endif -#ifdef EAX_MODE +#ifdef LTC_EAX_MODE DO(eax_test()); #endif -#ifdef OCB_MODE +#ifdef LTC_OCB_MODE DO(ocb_test()); #endif -#ifdef CCM_MODE +#ifdef LTC_CCM_MODE DO(ccm_test()); #endif -#ifdef GCM_MODE +#ifdef LTC_GCM_MODE DO(gcm_test()); #endif -#ifdef PELICAN +#ifdef LTC_PELICAN DO(pelican_test()); #endif return 0; } -/* $Source: /cvs/libtom/libtomcrypt/testprof/mac_test.c,v $ */ -/* $Revision: 1.5 $ */ -/* $Date: 2006/11/08 21:57:04 $ */ +/* $Source$ */ +/* $Revision$ */ +/* $Date$ */ diff --git a/libtomcrypt/testprof/modes_test.c b/libtomcrypt/testprof/modes_test.c index 8999c0d..c1cd1c4 100644 --- a/libtomcrypt/testprof/modes_test.c +++ b/libtomcrypt/testprof/modes_test.c @@ -106,10 +106,14 @@ int modes_test(void) #ifdef LTC_CTR_MODE DO(ctr_test()); #endif + +#ifdef LTC_XTS_MODE + DO(xts_test()); +#endif return 0; } -/* $Source: /cvs/libtom/libtomcrypt/testprof/modes_test.c,v $ */ -/* $Revision: 1.14 $ */ -/* $Date: 2006/11/13 11:55:25 $ */ +/* $Source$ */ +/* $Revision$ */ +/* $Date$ */ diff --git a/libtomcrypt/testprof/pkcs_1_test.c b/libtomcrypt/testprof/pkcs_1_test.c index da725fc..6f59ce9 100644 --- a/libtomcrypt/testprof/pkcs_1_test.c +++ b/libtomcrypt/testprof/pkcs_1_test.c @@ -1,6 +1,6 @@ #include <tomcrypt_test.h> -#ifdef PKCS_1 +#ifdef LTC_PKCS_1 int pkcs_1_test(void) { @@ -33,7 +33,7 @@ int pkcs_1_test(void) /* pick a random saltlen 0..16 */ saltlen = abs(rand()) % 17; - /* PKCS #1 v2.0 supports modlens not multiple of 8 */ + /* LTC_PKCS #1 v2.0 supports modlens not multiple of 8 */ modlen = 800 + (abs(rand()) % 224); /* encode it */ @@ -88,6 +88,6 @@ int pkcs_1_test(void) #endif -/* $Source: /cvs/libtom/libtomcrypt/testprof/pkcs_1_test.c,v $ */ -/* $Revision: 1.7 $ */ -/* $Date: 2006/11/30 03:30:45 $ */ +/* $Source$ */ +/* $Revision$ */ +/* $Date$ */ diff --git a/libtomcrypt/testprof/rsa_test.c b/libtomcrypt/testprof/rsa_test.c index 4868d6b..2d5c063 100644 --- a/libtomcrypt/testprof/rsa_test.c +++ b/libtomcrypt/testprof/rsa_test.c @@ -1,6 +1,6 @@ #include <tomcrypt_test.h> -#ifdef MRSA +#ifdef LTC_MRSA #define RSA_MSGSIZE 78 @@ -137,7 +137,7 @@ int rsa_test(void) hash_idx = find_hash("sha1"); prng_idx = find_prng("yarrow"); if (hash_idx == -1 || prng_idx == -1) { - fprintf(stderr, "rsa_test requires SHA1 and yarrow"); + fprintf(stderr, "rsa_test requires LTC_SHA1 and yarrow"); return 1; } @@ -257,14 +257,14 @@ for (cnt = 0; cnt < len; ) { } } - /* encrypt the key PKCS #1 v1.5 (payload from 1 to 117 bytes) */ + /* encrypt the key LTC_PKCS #1 v1.5 (payload from 1 to 117 bytes) */ for (rsa_msgsize = 1; rsa_msgsize <= 117; rsa_msgsize++) { len = sizeof(out); len2 = rsa_msgsize; - DO(rsa_encrypt_key_ex(in, rsa_msgsize, out, &len, NULL, 0, &yarrow_prng, prng_idx, 0, LTC_PKCS_1_V1_5, &key)); + DO(rsa_encrypt_key_ex(in, rsa_msgsize, out, &len, NULL, 0, &yarrow_prng, prng_idx, 0, LTC_LTC_PKCS_1_V1_5, &key)); len2 = rsa_msgsize; - DO(rsa_decrypt_key_ex(out, len, tmp, &len2, NULL, 0, 0, LTC_PKCS_1_V1_5, &stat, &key)); + DO(rsa_decrypt_key_ex(out, len, tmp, &len2, NULL, 0, 0, LTC_LTC_PKCS_1_V1_5, &stat, &key)); if (!(stat == 1 && stat2 == 0)) { fprintf(stderr, "rsa_decrypt_key_ex failed, %d, %d", stat, stat2); return 1; @@ -349,13 +349,13 @@ for (cnt = 0; cnt < len; ) { return 1; } - /* sign a message with PKCS #1 v1.5 */ + /* sign a message with LTC_PKCS #1 v1.5 */ len = sizeof(out); - DO(rsa_sign_hash_ex(in, 20, out, &len, LTC_PKCS_1_V1_5, &yarrow_prng, prng_idx, hash_idx, 8, &privKey)); - DO(rsa_verify_hash_ex(out, len, in, 20, LTC_PKCS_1_V1_5, hash_idx, 8, &stat, &pubKey)); + DO(rsa_sign_hash_ex(in, 20, out, &len, LTC_LTC_PKCS_1_V1_5, &yarrow_prng, prng_idx, hash_idx, 8, &privKey)); + DO(rsa_verify_hash_ex(out, len, in, 20, LTC_LTC_PKCS_1_V1_5, hash_idx, 8, &stat, &pubKey)); /* change a byte */ in[0] ^= 1; - DO(rsa_verify_hash_ex(out, len, in, 20, LTC_PKCS_1_V1_5, hash_idx, 8, &stat2, &pubKey)); + DO(rsa_verify_hash_ex(out, len, in, 20, LTC_LTC_PKCS_1_V1_5, hash_idx, 8, &stat2, &pubKey)); if (!(stat == 1 && stat2 == 0)) { fprintf(stderr, "rsa_verify_hash_ex failed, %d, %d", stat, stat2); @@ -382,6 +382,6 @@ int rsa_test(void) #endif -/* $Source: /cvs/libtom/libtomcrypt/testprof/rsa_test.c,v $ */ -/* $Revision: 1.18 $ */ -/* $Date: 2006/11/21 00:10:18 $ */ +/* $Source$ */ +/* $Revision$ */ +/* $Date$ */ diff --git a/libtomcrypt/testprof/store_test.c b/libtomcrypt/testprof/store_test.c index 5a38d65..71666ba 100644 --- a/libtomcrypt/testprof/store_test.c +++ b/libtomcrypt/testprof/store_test.c @@ -73,6 +73,6 @@ int store_test(void) return 0; } -/* $Source: /cvs/libtom/libtomcrypt/testprof/store_test.c,v $ */ -/* $Revision: 1.6 $ */ -/* $Date: 2005/05/05 14:35:59 $ */ +/* $Source$ */ +/* $Revision$ */ +/* $Date$ */ diff --git a/libtomcrypt/testprof/test_driver.c b/libtomcrypt/testprof/test_driver.c index 25740a0..6e54668 100644 --- a/libtomcrypt/testprof/test_driver.c +++ b/libtomcrypt/testprof/test_driver.c @@ -10,6 +10,6 @@ void run_cmd(int res, int line, char *file, char *cmd) } } -/* $Source: /cvs/libtom/libtomcrypt/testprof/test_driver.c,v $ */ -/* $Revision: 1.2 $ */ -/* $Date: 2006/11/13 23:14:33 $ */ +/* $Source$ */ +/* $Revision$ */ +/* $Date$ */ diff --git a/libtomcrypt/testprof/tomcrypt_test.h b/libtomcrypt/testprof/tomcrypt_test.h index b4396fb..4ac0a97 100644 --- a/libtomcrypt/testprof/tomcrypt_test.h +++ b/libtomcrypt/testprof/tomcrypt_test.h @@ -78,6 +78,6 @@ void time_encmacs(void); #endif -/* $Source: /cvs/libtom/libtomcrypt/testprof/tomcrypt_test.h,v $ */ -/* $Revision: 1.14 $ */ -/* $Date: 2006/10/18 03:36:34 $ */ +/* $Source$ */ +/* $Revision$ */ +/* $Date$ */ diff --git a/libtomcrypt/testprof/x86_prof.c b/libtomcrypt/testprof/x86_prof.c index 96667a2..a9a8985 100644 --- a/libtomcrypt/testprof/x86_prof.c +++ b/libtomcrypt/testprof/x86_prof.c @@ -124,105 +124,108 @@ void init_timer(void) void reg_algs(void) { int err; -#ifdef RIJNDAEL +#ifdef LTC_RIJNDAEL register_cipher (&aes_desc); #endif -#ifdef BLOWFISH +#ifdef LTC_BLOWFISH register_cipher (&blowfish_desc); #endif -#ifdef XTEA +#ifdef LTC_XTEA register_cipher (&xtea_desc); #endif -#ifdef RC5 +#ifdef LTC_RC5 register_cipher (&rc5_desc); #endif -#ifdef RC6 +#ifdef LTC_RC6 register_cipher (&rc6_desc); #endif -#ifdef SAFERP +#ifdef LTC_SAFERP register_cipher (&saferp_desc); #endif -#ifdef TWOFISH +#ifdef LTC_TWOFISH register_cipher (&twofish_desc); #endif -#ifdef SAFER +#ifdef LTC_SAFER register_cipher (&safer_k64_desc); register_cipher (&safer_sk64_desc); register_cipher (&safer_k128_desc); register_cipher (&safer_sk128_desc); #endif -#ifdef RC2 +#ifdef LTC_RC2 register_cipher (&rc2_desc); #endif -#ifdef DES +#ifdef LTC_DES register_cipher (&des_desc); register_cipher (&des3_desc); #endif -#ifdef CAST5 +#ifdef LTC_CAST5 register_cipher (&cast5_desc); #endif -#ifdef NOEKEON +#ifdef LTC_NOEKEON register_cipher (&noekeon_desc); #endif -#ifdef SKIPJACK +#ifdef LTC_SKIPJACK register_cipher (&skipjack_desc); #endif -#ifdef KHAZAD +#ifdef LTC_KHAZAD register_cipher (&khazad_desc); #endif -#ifdef ANUBIS +#ifdef LTC_ANUBIS register_cipher (&anubis_desc); #endif -#ifdef KSEED +#ifdef LTC_KSEED register_cipher (&kseed_desc); #endif #ifdef LTC_KASUMI register_cipher (&kasumi_desc); #endif +#ifdef LTC_MULTI2 + register_cipher (&multi2_desc); +#endif -#ifdef TIGER +#ifdef LTC_TIGER register_hash (&tiger_desc); #endif -#ifdef MD2 +#ifdef LTC_MD2 register_hash (&md2_desc); #endif -#ifdef MD4 +#ifdef LTC_MD4 register_hash (&md4_desc); #endif -#ifdef MD5 +#ifdef LTC_MD5 register_hash (&md5_desc); #endif -#ifdef SHA1 +#ifdef LTC_SHA1 register_hash (&sha1_desc); #endif -#ifdef SHA224 +#ifdef LTC_SHA224 register_hash (&sha224_desc); #endif -#ifdef SHA256 +#ifdef LTC_SHA256 register_hash (&sha256_desc); #endif -#ifdef SHA384 +#ifdef LTC_SHA384 register_hash (&sha384_desc); #endif -#ifdef SHA512 +#ifdef LTC_SHA512 register_hash (&sha512_desc); #endif -#ifdef RIPEMD128 +#ifdef LTC_RIPEMD128 register_hash (&rmd128_desc); #endif -#ifdef RIPEMD160 +#ifdef LTC_RIPEMD160 register_hash (&rmd160_desc); #endif -#ifdef RIPEMD256 +#ifdef LTC_RIPEMD256 register_hash (&rmd256_desc); #endif -#ifdef RIPEMD320 +#ifdef LTC_RIPEMD320 register_hash (&rmd320_desc); #endif -#ifdef WHIRLPOOL +#ifdef LTC_WHIRLPOOL register_hash (&whirlpool_desc); #endif -#ifdef CHC_HASH +#ifdef LTC_CHC_HASH register_hash(&chc_desc); if ((err = chc_register(register_cipher(&aes_desc))) != CRYPT_OK) { fprintf(stderr, "chc_register error: %s\n", error_to_string(err)); @@ -231,17 +234,17 @@ void reg_algs(void) #endif -#ifndef YARROW +#ifndef LTC_YARROW #error This demo requires Yarrow. #endif register_prng(&yarrow_desc); -#ifdef FORTUNA +#ifdef LTC_FORTUNA register_prng(&fortuna_desc); #endif -#ifdef RC4 +#ifdef LTC_RC4 register_prng(&rc4_desc); #endif -#ifdef SOBER128 +#ifdef LTC_SOBER128 register_prng(&sober128_desc); #endif @@ -759,7 +762,7 @@ void time_prng(void) } } -#ifdef MDSA +#ifdef LTC_MDSA /* time various DSA operations */ void time_dsa(void) { @@ -804,7 +807,7 @@ static const struct { #endif -#ifdef MRSA +#ifdef LTC_MRSA /* time various RSA operations */ void time_rsa(void) { @@ -998,7 +1001,7 @@ void time_katja(void) void time_katja(void) { fprintf(stderr, "NO Katja\n"); } #endif -#ifdef MECC +#ifdef LTC_MECC /* time various ECC operations */ void time_ecc(void) { @@ -1166,7 +1169,7 @@ void time_macs_(unsigned long MAC_SIZE) hash_idx = find_hash("sha1"); if (cipher_idx == -1 || hash_idx == -1) { - fprintf(stderr, "Warning the MAC tests requires AES and SHA1 to operate... so sorry\n"); + fprintf(stderr, "Warning the MAC tests requires AES and LTC_SHA1 to operate... so sorry\n"); return; } @@ -1186,7 +1189,7 @@ void time_macs_(unsigned long MAC_SIZE) t1 = t_read() - t1; if (t1 < t2) t2 = t1; } - fprintf(stderr, "OMAC-%s\t\t%9llu\n", cipher_descriptor[cipher_idx].name, t2/(ulong64)(MAC_SIZE*1024)); + fprintf(stderr, "LTC_OMAC-%s\t\t%9llu\n", cipher_descriptor[cipher_idx].name, t2/(ulong64)(MAC_SIZE*1024)); #endif #ifdef LTC_XCBC @@ -1237,7 +1240,7 @@ void time_macs_(unsigned long MAC_SIZE) fprintf(stderr, "PMAC-AES\t\t%9llu\n", t2/(ulong64)(MAC_SIZE*1024)); #endif -#ifdef PELICAN +#ifdef LTC_PELICAN t2 = -1; for (x = 0; x < 10000; x++) { t_start(); @@ -1250,7 +1253,7 @@ void time_macs_(unsigned long MAC_SIZE) t1 = t_read() - t1; if (t1 < t2) t2 = t1; } - fprintf(stderr, "PELICAN \t\t%9llu\n", t2/(ulong64)(MAC_SIZE*1024)); + fprintf(stderr, "LTC_PELICAN \t\t%9llu\n", t2/(ulong64)(MAC_SIZE*1024)); #endif #ifdef LTC_HMAC @@ -1266,7 +1269,7 @@ void time_macs_(unsigned long MAC_SIZE) t1 = t_read() - t1; if (t1 < t2) t2 = t1; } - fprintf(stderr, "HMAC-%s\t\t%9llu\n", hash_descriptor[hash_idx].name, t2/(ulong64)(MAC_SIZE*1024)); + fprintf(stderr, "LTC_HMAC-%s\t\t%9llu\n", hash_descriptor[hash_idx].name, t2/(ulong64)(MAC_SIZE*1024)); #endif XFREE(buf); @@ -1301,7 +1304,7 @@ void time_encmacs_(unsigned long MAC_SIZE) yarrow_read(key, 16, &yarrow_prng); yarrow_read(IV, 16, &yarrow_prng); -#ifdef EAX_MODE +#ifdef LTC_EAX_MODE t2 = -1; for (x = 0; x < 10000; x++) { t_start(); @@ -1317,7 +1320,7 @@ void time_encmacs_(unsigned long MAC_SIZE) fprintf(stderr, "EAX \t\t\t%9llu\n", t2/(ulong64)(MAC_SIZE*1024)); #endif -#ifdef OCB_MODE +#ifdef LTC_OCB_MODE t2 = -1; for (x = 0; x < 10000; x++) { t_start(); @@ -1333,7 +1336,7 @@ void time_encmacs_(unsigned long MAC_SIZE) fprintf(stderr, "OCB \t\t\t%9llu\n", t2/(ulong64)(MAC_SIZE*1024)); #endif -#ifdef CCM_MODE +#ifdef LTC_CCM_MODE t2 = -1; for (x = 0; x < 10000; x++) { t_start(); @@ -1365,7 +1368,7 @@ void time_encmacs_(unsigned long MAC_SIZE) cipher_descriptor[cipher_idx].done(&skey); #endif -#ifdef GCM_MODE +#ifdef LTC_GCM_MODE t2 = -1; for (x = 0; x < 100; x++) { t_start(); @@ -1382,7 +1385,7 @@ void time_encmacs_(unsigned long MAC_SIZE) { gcm_state gcm -#ifdef GCM_TABLES_SSE2 +#ifdef LTC_GCM_TABLES_SSE2 __attribute__ ((aligned (16))) #endif ; @@ -1431,6 +1434,6 @@ void time_encmacs(void) time_encmacs_(32); } -/* $Source: /cvs/libtom/libtomcrypt/testprof/x86_prof.c,v $ */ -/* $Revision: 1.51 $ */ -/* $Date: 2006/11/21 00:10:18 $ */ +/* $Source$ */ +/* $Revision$ */ +/* $Date$ */ |