- Timestamp:
- Feb 3, 2019, 8:58:44 PM (6 years ago)
- Branches:
- master
- Children:
- 40def31a, 7aa6811, 8861654, c2a8e22, 35cdda2
- Parents:
- 238c3a5
- git-author:
- Anders Kaseorg <andersk@mit.edu> (01/31/19 02:09:10)
- git-committer:
- Anders Kaseorg <andersk@mit.edu> (02/03/19 20:58:44)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
zcrypt.c
r238c3a5 r9a0d25d 95 95 }; 96 96 97 static void owl_zcrypt_string_to_schedule(char *keystring, des_key_schedule *schedule) {98 des_cblock key;99 100 des_string_to_key(keystring, &key);101 des_key_sched(&key, *schedule);97 static void owl_zcrypt_string_to_schedule(char *keystring, DES_key_schedule *schedule) { 98 DES_cblock key; 99 100 DES_string_to_key(keystring, &key); 101 DES_key_sched(&key, schedule); 102 102 } 103 103 … … 720 720 int do_encrypt_des(const char *keyfile, const char *in, int length, FILE *outfile) 721 721 { 722 des_key_schedule schedule;722 DES_key_schedule schedule; 723 723 unsigned char input[8], output[8]; 724 724 const char *inptr; … … 766 766 767 767 /* Encrypt and output the block */ 768 des_ecb_encrypt(&input, &output,schedule, TRUE);768 DES_ecb_encrypt(&input, &output, &schedule, TRUE); 769 769 block_to_ascii(output, outfile); 770 770 … … 905 905 906 906 int do_decrypt_des(const char *keyfile) { 907 des_key_schedule schedule;907 DES_key_schedule schedule; 908 908 unsigned char input[8], output[8]; 909 909 char tmp[9]; … … 915 915 have a NULL-terminated string we can call printf/strlen on. 916 916 917 We don't pass 'tmp' to des_ecb_encrypt directly, because it's917 We don't pass 'tmp' to DES_ecb_encrypt directly, because it's 918 918 prototyped as taking 'unsigned char[8]', and this avoids a stupid 919 919 cast. … … 933 933 while (read_ascii_block(input)) 934 934 { 935 des_ecb_encrypt(&input, &output,schedule, FALSE);935 DES_ecb_encrypt(&input, &output, &schedule, FALSE); 936 936 memcpy(tmp, output, 8); 937 937 printf("%s", tmp);
Note: See TracChangeset
for help on using the changeset viewer.