comparison demos/encrypt.c @ 381:999a5eb4ed10 libtomcrypt-dropbear

propagate from branch 'au.asn.ucc.matt.ltc.orig' (head 52840647ac7f5c707c3bd158d119a15734a7ef28) to branch 'au.asn.ucc.matt.ltc.dropbear' (head 20dccfc09627970a312d77fb41dc2970b62689c3)
author Matt Johnston <matt@ucc.asn.au>
date Thu, 11 Jan 2007 02:39:21 +0000
parents d5faf4814ddb
children
comparison
equal deleted inserted replaced
281:997e6f7dc01e 381:999a5eb4ed10
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 $ */