comparison libtomcrypt/demos/encrypt.c @ 415:8b9aba1d5fa4 channel-fix

merge of '73fe066c5d9e2395354ba74756124d45c978a04d' and 'f5014cc84558f1e8eba42dbecf9f72f94bfe6134'
author Matt Johnston <matt@ucc.asn.au>
date Tue, 06 Feb 2007 16:00:18 +0000
parents 0cbe8f6dbf9e
children f849a5ca2efc
comparison
equal deleted inserted replaced
414:c53a26c430e5 415:8b9aba1d5fa4
168 if (fread(IV,1,ivsize,fdin) != ivsize) { 168 if (fread(IV,1,ivsize,fdin) != ivsize) {
169 printf("Error reading IV from input.\n"); 169 printf("Error reading IV from input.\n");
170 exit(-1); 170 exit(-1);
171 } 171 }
172 172
173 if ((errno = ctr_start(cipher_idx,IV,key,ks,0,&ctr)) != CRYPT_OK) { 173 if ((errno = ctr_start(cipher_idx,IV,key,ks,0,CTR_COUNTER_LITTLE_ENDIAN,&ctr)) != CRYPT_OK) {
174 printf("ctr_start error: %s\n",error_to_string(errno)); 174 printf("ctr_start error: %s\n",error_to_string(errno));
175 exit(-1); 175 exit(-1);
176 } 176 }
177 177
178 /* IV done */ 178 /* IV done */
210 if (fwrite(IV,1,ivsize,fdout) != ivsize) { 210 if (fwrite(IV,1,ivsize,fdout) != ivsize) {
211 printf("Error writing IV to output.\n"); 211 printf("Error writing IV to output.\n");
212 exit(-1); 212 exit(-1);
213 } 213 }
214 214
215 if ((errno = ctr_start(cipher_idx,IV,key,ks,0,&ctr)) != CRYPT_OK) { 215 if ((errno = ctr_start(cipher_idx,IV,key,ks,0,CTR_COUNTER_LITTLE_ENDIAN,&ctr)) != CRYPT_OK) {
216 printf("ctr_start error: %s\n",error_to_string(errno)); 216 printf("ctr_start error: %s\n",error_to_string(errno));
217 exit(-1); 217 exit(-1);
218 } 218 }
219 219
220 do { 220 do {
235 } 235 }
236 return 0; 236 return 0;
237 } 237 }
238 238
239 /* $Source: /cvs/libtom/libtomcrypt/demos/encrypt.c,v $ */ 239 /* $Source: /cvs/libtom/libtomcrypt/demos/encrypt.c,v $ */
240 /* $Revision: 1.2 $ */ 240 /* $Revision: 1.3 $ */
241 /* $Date: 2005/05/05 14:35:56 $ */ 241 /* $Date: 2005/08/04 20:43:50 $ */