Browse Source

fixing compile failure in demos for -DLTC_EASY

Karel Miko 8 years ago
parent
commit
dde11de781
3 changed files with 20 additions and 1 deletions
  1. 1 0
      demos/hashsum.c
  2. 4 1
      demos/multi.c
  3. 15 0
      demos/tv_gen.c

+ 1 - 0
demos/hashsum.c

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

+ 4 - 1
demos/multi.c

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

+ 15 - 0
demos/tv_gen.c

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