Mercurial > dropbear
comparison demos/encrypt.c @ 380:d5faf4814ddb libtomcrypt-orig libtomcrypt-1.16
Update to LibTomCrypt 1.16
author | Matt Johnston <matt@ucc.asn.au> |
---|---|
date | Thu, 11 Jan 2007 02:22:00 +0000 |
parents | 59400faa4b44 |
children |
comparison
equal
deleted
inserted
replaced
280:59400faa4b44 | 380:d5faf4814ddb |
---|---|
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 $ */ |