added libtomcrypt-1.09
This commit is contained in:
committed by
Steffen Jaeckel
parent
1eeff0bfb4
commit
a3ce807bae
@@ -5,10 +5,18 @@ int modes_test(void)
|
||||
{
|
||||
unsigned char pt[64], ct[64], tmp[64], key[16], iv[16], iv2[16];
|
||||
int cipher_idx;
|
||||
#ifdef CBC
|
||||
symmetric_CBC cbc;
|
||||
#endif
|
||||
#ifdef CFB
|
||||
symmetric_CFB cfb;
|
||||
#endif
|
||||
#ifdef OFB
|
||||
symmetric_OFB ofb;
|
||||
#endif
|
||||
#ifdef CTR
|
||||
symmetric_CTR ctr;
|
||||
#endif
|
||||
unsigned long l;
|
||||
|
||||
/* make a random pt, key and iv */
|
||||
@@ -23,6 +31,10 @@ int modes_test(void)
|
||||
return 1;
|
||||
}
|
||||
|
||||
#ifdef LRW_MODE
|
||||
DO(lrw_test());
|
||||
#endif
|
||||
|
||||
#ifdef CBC
|
||||
/* test CBC mode */
|
||||
/* encode the block */
|
||||
|
||||
+13
-4
@@ -233,7 +233,11 @@ register_prng(&rc4_desc);
|
||||
register_prng(&sober128_desc);
|
||||
#endif
|
||||
|
||||
rng_make_prng(128, find_prng("yarrow"), &yarrow_prng, NULL);
|
||||
if ((err = rng_make_prng(128, find_prng("yarrow"), &yarrow_prng, NULL)) != CRYPT_OK) {
|
||||
fprintf(stderr, "rng_make_prng failed: %s\n", error_to_string(err));
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
int time_keysched(void)
|
||||
@@ -886,7 +890,12 @@ void time_macs_(unsigned long MAC_SIZE)
|
||||
}
|
||||
|
||||
cipher_idx = find_cipher("aes");
|
||||
hash_idx = find_hash("md5");
|
||||
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");
|
||||
return;
|
||||
}
|
||||
|
||||
yarrow_read(buf, MAC_SIZE*1024, &yarrow_prng);
|
||||
yarrow_read(key, 16, &yarrow_prng);
|
||||
@@ -904,7 +913,7 @@ void time_macs_(unsigned long MAC_SIZE)
|
||||
t1 = t_read() - t1;
|
||||
if (t1 < t2) t2 = t1;
|
||||
}
|
||||
fprintf(stderr, "OMAC-AES\t\t%9llu\n", t2/(ulong64)(MAC_SIZE*1024));
|
||||
fprintf(stderr, "OMAC-%s\t\t%9llu\n", cipher_descriptor[cipher_idx].name, t2/(ulong64)(MAC_SIZE*1024));
|
||||
#endif
|
||||
|
||||
#ifdef PMAC
|
||||
@@ -952,7 +961,7 @@ void time_macs_(unsigned long MAC_SIZE)
|
||||
t1 = t_read() - t1;
|
||||
if (t1 < t2) t2 = t1;
|
||||
}
|
||||
fprintf(stderr, "HMAC-MD5\t\t%9llu\n", t2/(ulong64)(MAC_SIZE*1024));
|
||||
fprintf(stderr, "HMAC-%s\t\t%9llu\n", hash_descriptor[hash_idx].name, t2/(ulong64)(MAC_SIZE*1024));
|
||||
#endif
|
||||
|
||||
XFREE(buf);
|
||||
|
||||
Reference in New Issue
Block a user