fixing compile failure in demos for -DLTC_EASY

This commit is contained in:
Karel Miko 2017-03-01 11:48:39 +01:00
parent 00308d8651
commit dde11de781
3 changed files with 20 additions and 1 deletions

View File

@ -67,6 +67,7 @@ int main(int argc, char **argv)
void register_algs(void)
{
int err;
LTC_UNUSED_PARAM(err);
#ifdef LTC_TIGER
register_hash (&tiger_desc);

View File

@ -56,6 +56,7 @@ int main(void)
}
/* LTC_OMAC */
#ifdef LTC_OMAC
len = sizeof(buf[0]);
omac_memory(find_cipher("aes"), key, 16, (unsigned char*)"hello", 5, buf[0], &len);
len2 = sizeof(buf[0]);
@ -76,8 +77,10 @@ int main(void)
printf("Failed: %d %lu %lu\n", __LINE__, len, len2);
return EXIT_FAILURE;
}
#endif
/* PMAC */
#ifdef LTC_PMAC
len = sizeof(buf[0]);
pmac_memory(find_cipher("aes"), key, 16, (unsigned char*)"hello", 5, buf[0], &len);
len2 = sizeof(buf[0]);
@ -98,7 +101,7 @@ int main(void)
printf("Failed: %d %lu %lu\n", __LINE__, len, len2);
return EXIT_FAILURE;
}
#endif
printf("All passed\n");
return EXIT_SUCCESS;

View File

@ -3,6 +3,7 @@
void reg_algs(void)
{
int err;
LTC_UNUSED_PARAM(err);
#ifdef LTC_RIJNDAEL
register_cipher (&aes_desc);
@ -340,6 +341,7 @@ void omac_gen(void)
void pmac_gen(void)
{
#ifdef LTC_PMAC
unsigned char key[MAXBLOCKSIZE], output[MAXBLOCKSIZE], input[MAXBLOCKSIZE*2+2];
int err, x, y, z, kl;
FILE *out;
@ -391,10 +393,12 @@ void pmac_gen(void)
fprintf(out, "\n");
}
fclose(out);
#endif
}
void eax_gen(void)
{
#ifdef LTC_EAX_MODE
int err, kl, x, y1, z;
FILE *out;
unsigned char key[MAXBLOCKSIZE], nonce[MAXBLOCKSIZE*2], header[MAXBLOCKSIZE*2],
@ -451,10 +455,12 @@ void eax_gen(void)
fprintf(out, "\n");
}
fclose(out);
#endif
}
void ocb_gen(void)
{
#ifdef LTC_OCB_MODE
int err, kl, x, y1, z;
FILE *out;
unsigned char key[MAXBLOCKSIZE], nonce[MAXBLOCKSIZE*2],
@ -514,10 +520,12 @@ void ocb_gen(void)
fprintf(out, "\n");
}
fclose(out);
#endif
}
void ocb3_gen(void)
{
#ifdef LTC_OCB3_MODE
int err, kl, x, y1, z;
FILE *out;
unsigned char key[MAXBLOCKSIZE], nonce[MAXBLOCKSIZE*2],
@ -577,10 +585,12 @@ void ocb3_gen(void)
fprintf(out, "\n");
}
fclose(out);
#endif
}
void ccm_gen(void)
{
#ifdef LTC_CCM_MODE
int err, kl, x, y1, z;
FILE *out;
unsigned char key[MAXBLOCKSIZE], nonce[MAXBLOCKSIZE*2],
@ -640,10 +650,12 @@ void ccm_gen(void)
fprintf(out, "\n");
}
fclose(out);
#endif
}
void gcm_gen(void)
{
#ifdef LTC_GCM_MODE
int err, kl, x, y1, z;
FILE *out;
unsigned char key[MAXBLOCKSIZE], plaintext[MAXBLOCKSIZE*2], tag[MAXBLOCKSIZE];
@ -697,6 +709,7 @@ void gcm_gen(void)
fprintf(out, "\n");
}
fclose(out);
#endif
}
void base64_gen(void)
@ -764,6 +777,7 @@ void ecc_gen(void)
void lrw_gen(void)
{
#ifdef LTC_LRW_MODE
FILE *out;
unsigned char tweak[16], key[16], iv[16], buf[1024];
int x, y, err;
@ -825,6 +839,7 @@ void lrw_gen(void)
lrw_done(&lrw);
}
fclose(out);
#endif
}
int main(void)