comparison libtomcrypt/demos/encrypt.c @ 1439:8d24733026c5 coverity

merge
author Matt Johnston <matt@ucc.asn.au>
date Sat, 24 Jun 2017 23:33:16 +0800
parents f849a5ca2efc
children
comparison
equal deleted inserted replaced
1400:238a439670f5 1439:8d24733026c5
24 24
25 void register_algs(void) 25 void register_algs(void)
26 { 26 {
27 int x; 27 int x;
28 28
29 #ifdef RIJNDAEL 29 #ifdef LTC_RIJNDAEL
30 register_cipher (&aes_desc); 30 register_cipher (&aes_desc);
31 #endif 31 #endif
32 #ifdef BLOWFISH 32 #ifdef LTC_BLOWFISH
33 register_cipher (&blowfish_desc); 33 register_cipher (&blowfish_desc);
34 #endif 34 #endif
35 #ifdef XTEA 35 #ifdef LTC_XTEA
36 register_cipher (&xtea_desc); 36 register_cipher (&xtea_desc);
37 #endif 37 #endif
38 #ifdef RC5 38 #ifdef LTC_RC5
39 register_cipher (&rc5_desc); 39 register_cipher (&rc5_desc);
40 #endif 40 #endif
41 #ifdef RC6 41 #ifdef LTC_RC6
42 register_cipher (&rc6_desc); 42 register_cipher (&rc6_desc);
43 #endif 43 #endif
44 #ifdef SAFERP 44 #ifdef LTC_SAFERP
45 register_cipher (&saferp_desc); 45 register_cipher (&saferp_desc);
46 #endif 46 #endif
47 #ifdef TWOFISH 47 #ifdef LTC_TWOFISH
48 register_cipher (&twofish_desc); 48 register_cipher (&twofish_desc);
49 #endif 49 #endif
50 #ifdef SAFER 50 #ifdef LTC_SAFER
51 register_cipher (&safer_k64_desc); 51 register_cipher (&safer_k64_desc);
52 register_cipher (&safer_sk64_desc); 52 register_cipher (&safer_sk64_desc);
53 register_cipher (&safer_k128_desc); 53 register_cipher (&safer_k128_desc);
54 register_cipher (&safer_sk128_desc); 54 register_cipher (&safer_sk128_desc);
55 #endif 55 #endif
56 #ifdef RC2 56 #ifdef LTC_RC2
57 register_cipher (&rc2_desc); 57 register_cipher (&rc2_desc);
58 #endif 58 #endif
59 #ifdef DES 59 #ifdef LTC_DES
60 register_cipher (&des_desc); 60 register_cipher (&des_desc);
61 register_cipher (&des3_desc); 61 register_cipher (&des3_desc);
62 #endif 62 #endif
63 #ifdef CAST5 63 #ifdef LTC_CAST5
64 register_cipher (&cast5_desc); 64 register_cipher (&cast5_desc);
65 #endif 65 #endif
66 #ifdef NOEKEON 66 #ifdef LTC_NOEKEON
67 register_cipher (&noekeon_desc); 67 register_cipher (&noekeon_desc);
68 #endif 68 #endif
69 #ifdef SKIPJACK 69 #ifdef LTC_SKIPJACK
70 register_cipher (&skipjack_desc); 70 register_cipher (&skipjack_desc);
71 #endif 71 #endif
72 #ifdef KHAZAD 72 #ifdef LTC_KHAZAD
73 register_cipher (&khazad_desc); 73 register_cipher (&khazad_desc);
74 #endif 74 #endif
75 #ifdef ANUBIS 75 #ifdef LTC_ANUBIS
76 register_cipher (&anubis_desc); 76 register_cipher (&anubis_desc);
77 #endif 77 #endif
78 78
79 if (register_hash(&sha256_desc) == -1) { 79 if (register_hash(&sha256_desc) == -1) {
80 printf("Error registering SHA256\n"); 80 printf("Error registering LTC_SHA256\n");
81 exit(-1); 81 exit(-1);
82 } 82 }
83 83
84 if (register_prng(&yarrow_desc) == -1) { 84 if (register_prng(&yarrow_desc) == -1) {
85 printf("Error registering yarrow PRNG\n"); 85 printf("Error registering yarrow PRNG\n");
142 exit(-1); 142 exit(-1);
143 } 143 }
144 144
145 hash_idx = find_hash("sha256"); 145 hash_idx = find_hash("sha256");
146 if (hash_idx == -1) { 146 if (hash_idx == -1) {
147 printf("SHA256 not found...?\n"); 147 printf("LTC_SHA256 not found...?\n");
148 exit(-1); 148 exit(-1);
149 } 149 }
150 150
151 ivsize = cipher_descriptor[cipher_idx].block_length; 151 ivsize = cipher_descriptor[cipher_idx].block_length;
152 ks = hash_descriptor[hash_idx].hashsize; 152 ks = hash_descriptor[hash_idx].hashsize;
234 fclose(fdin); 234 fclose(fdin);
235 } 235 }
236 return 0; 236 return 0;
237 } 237 }
238 238
239 /* $Source: /cvs/libtom/libtomcrypt/demos/encrypt.c,v $ */ 239 /* $Source$ */
240 /* $Revision: 1.3 $ */ 240 /* $Revision$ */
241 /* $Date: 2005/08/04 20:43:50 $ */ 241 /* $Date$ */