added libtomcrypt-1.14
This commit is contained in:
committed by
Steffen Jaeckel
parent
1eed98f629
commit
479cc9c261
@@ -5,16 +5,16 @@ int modes_test(void)
|
||||
{
|
||||
unsigned char pt[64], ct[64], tmp[64], key[16], iv[16], iv2[16];
|
||||
int cipher_idx;
|
||||
#ifdef CBC
|
||||
#ifdef LTC_CBC_MODE
|
||||
symmetric_CBC cbc;
|
||||
#endif
|
||||
#ifdef CFB
|
||||
#ifdef LTC_CFB_MODE
|
||||
symmetric_CFB cfb;
|
||||
#endif
|
||||
#ifdef OFB
|
||||
#ifdef LTC_OFB_MODE
|
||||
symmetric_OFB ofb;
|
||||
#endif
|
||||
#ifdef CTR
|
||||
#ifdef LTC_CTR_MODE
|
||||
symmetric_CTR ctr;
|
||||
#endif
|
||||
unsigned long l;
|
||||
@@ -35,11 +35,11 @@ int modes_test(void)
|
||||
DO(f8_test_mode());
|
||||
#endif
|
||||
|
||||
#ifdef LRW_MODE
|
||||
#ifdef LTC_LRW_MODE
|
||||
DO(lrw_test());
|
||||
#endif
|
||||
|
||||
#ifdef CBC
|
||||
#ifdef LTC_CBC_MODE
|
||||
/* test CBC mode */
|
||||
/* encode the block */
|
||||
DO(cbc_start(cipher_idx, iv, key, 16, 0, &cbc));
|
||||
@@ -61,7 +61,7 @@ int modes_test(void)
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CFB
|
||||
#ifdef LTC_CFB_MODE
|
||||
/* test CFB mode */
|
||||
/* encode the block */
|
||||
DO(cfb_start(cipher_idx, iv, key, 16, 0, &cfb));
|
||||
@@ -84,7 +84,7 @@ int modes_test(void)
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef OFB
|
||||
#ifdef LTC_OFB_MODE
|
||||
/* test OFB mode */
|
||||
/* encode the block */
|
||||
DO(ofb_start(cipher_idx, iv, key, 16, 0, &ofb));
|
||||
@@ -106,7 +106,7 @@ int modes_test(void)
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CTR
|
||||
#ifdef LTC_CTR_MODE
|
||||
/* test CTR mode */
|
||||
/* encode the block */
|
||||
DO(ctr_start(cipher_idx, iv, key, 16, 0, CTR_COUNTER_LITTLE_ENDIAN, &ctr));
|
||||
|
||||
@@ -18,7 +18,12 @@ typedef struct {
|
||||
extern prng_state yarrow_prng;
|
||||
|
||||
void run_cmd(int res, int line, char *file, char *cmd);
|
||||
#define DO(x) { run_cmd((x), __LINE__, __FILE__, #x); }
|
||||
|
||||
#ifdef LTC_VERBOSE
|
||||
#define DO(x) do { fprintf(stderr, "%s:\n", #x); run_cmd((x), __LINE__, __FILE__, #x); } while (0);
|
||||
#else
|
||||
#define DO(x) do { run_cmd((x), __LINE__, __FILE__, #x); } while (0);
|
||||
#endif
|
||||
|
||||
/* TESTS */
|
||||
int cipher_hash_test(void);
|
||||
|
||||
+8
-4
@@ -347,7 +347,7 @@ int time_cipher(void)
|
||||
return 0;
|
||||
}
|
||||
|
||||
#ifdef CBC
|
||||
#ifdef LTC_CBC_MODE
|
||||
int time_cipher2(void)
|
||||
{
|
||||
unsigned long x, y1;
|
||||
@@ -422,7 +422,7 @@ int time_cipher2(void)
|
||||
int time_cipher2(void) { fprintf(stderr, "NO CBC\n"); return 0; }
|
||||
#endif
|
||||
|
||||
#ifdef CTR
|
||||
#ifdef LTC_CTR_MODE
|
||||
int time_cipher3(void)
|
||||
{
|
||||
unsigned long x, y1;
|
||||
@@ -497,7 +497,7 @@ int time_cipher3(void)
|
||||
int time_cipher3(void) { fprintf(stderr, "NO CTR\n"); return 0; }
|
||||
#endif
|
||||
|
||||
#ifdef LRW_MODE
|
||||
#ifdef LTC_LRW_MODE
|
||||
int time_cipher4(void)
|
||||
{
|
||||
unsigned long x, y1;
|
||||
@@ -1157,7 +1157,11 @@ void time_encmacs_(unsigned long MAC_SIZE)
|
||||
fprintf(stderr, "GCM (no-precomp)\t%9llu\n", t2/(ulong64)(MAC_SIZE*1024));
|
||||
|
||||
{
|
||||
gcm_state gcm;
|
||||
gcm_state gcm
|
||||
#ifdef GCM_TABLES_SSE2
|
||||
__attribute__ ((aligned (16)))
|
||||
#endif
|
||||
;
|
||||
|
||||
if ((err = gcm_init(&gcm, cipher_idx, key, 16)) != CRYPT_OK) { fprintf(stderr, "gcm_init: %s\n", error_to_string(err)); exit(EXIT_FAILURE); }
|
||||
t2 = -1;
|
||||
|
||||
Reference in New Issue
Block a user