Mercurial > dropbear
comparison libtomcrypt/demos/encrypt.c @ 382:0cbe8f6dbf9e
propagate from branch 'au.asn.ucc.matt.ltc.dropbear' (head 2af22fb4e878750b88f80f90d439b316d229796f)
to branch 'au.asn.ucc.matt.dropbear' (head 02c413252c90e9de8e03d91e9939dde3029f5c0a)
author | Matt Johnston <matt@ucc.asn.au> |
---|---|
date | Thu, 11 Jan 2007 02:41:05 +0000 |
parents | 1b9e69c058d2 |
children | f849a5ca2efc |
comparison
equal
deleted
inserted
replaced
379:b66a00272a90 | 382:0cbe8f6dbf9e |
---|---|
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 $ */ |