diff options
38 files changed, 0 insertions, 2704 deletions
diff --git a/src/lib/libcrypto/des/DES.pm b/src/lib/libcrypto/des/DES.pm deleted file mode 100644 index 6a175b6ca4..0000000000 --- a/src/lib/libcrypto/des/DES.pm +++ /dev/null | |||
@@ -1,19 +0,0 @@ | |||
1 | package DES; | ||
2 | |||
3 | require Exporter; | ||
4 | require DynaLoader; | ||
5 | @ISA = qw(Exporter DynaLoader); | ||
6 | # Items to export into callers namespace by default | ||
7 | # (move infrequently used names to @EXPORT_OK below) | ||
8 | @EXPORT = qw( | ||
9 | ); | ||
10 | # Other items we are prepared to export if requested | ||
11 | @EXPORT_OK = qw( | ||
12 | crypt | ||
13 | ); | ||
14 | |||
15 | # Preloaded methods go here. Autoload methods go after __END__, and are | ||
16 | # processed by the autosplit program. | ||
17 | bootstrap DES; | ||
18 | 1; | ||
19 | __END__ | ||
diff --git a/src/lib/libcrypto/des/DES.xs b/src/lib/libcrypto/des/DES.xs deleted file mode 100644 index b8050b9edf..0000000000 --- a/src/lib/libcrypto/des/DES.xs +++ /dev/null | |||
@@ -1,268 +0,0 @@ | |||
1 | #include "EXTERN.h" | ||
2 | #include "perl.h" | ||
3 | #include "XSUB.h" | ||
4 | #include "des.h" | ||
5 | |||
6 | #define deschar char | ||
7 | static STRLEN len; | ||
8 | |||
9 | static int | ||
10 | not_here(s) | ||
11 | char *s; | ||
12 | { | ||
13 | croak("%s not implemented on this architecture", s); | ||
14 | return -1; | ||
15 | } | ||
16 | |||
17 | MODULE = DES PACKAGE = DES PREFIX = des_ | ||
18 | |||
19 | char * | ||
20 | des_crypt(buf,salt) | ||
21 | char * buf | ||
22 | char * salt | ||
23 | |||
24 | void | ||
25 | des_set_odd_parity(key) | ||
26 | des_cblock * key | ||
27 | PPCODE: | ||
28 | { | ||
29 | SV *s; | ||
30 | |||
31 | s=sv_newmortal(); | ||
32 | sv_setpvn(s,(char *)key,8); | ||
33 | des_set_odd_parity((des_cblock *)SvPV(s,na)); | ||
34 | PUSHs(s); | ||
35 | } | ||
36 | |||
37 | int | ||
38 | des_is_weak_key(key) | ||
39 | des_cblock * key | ||
40 | |||
41 | des_key_schedule | ||
42 | des_set_key(key) | ||
43 | des_cblock * key | ||
44 | CODE: | ||
45 | des_set_key(key,RETVAL); | ||
46 | OUTPUT: | ||
47 | RETVAL | ||
48 | |||
49 | des_cblock | ||
50 | des_ecb_encrypt(input,ks,encrypt) | ||
51 | des_cblock * input | ||
52 | des_key_schedule * ks | ||
53 | int encrypt | ||
54 | CODE: | ||
55 | des_ecb_encrypt(input,&RETVAL,*ks,encrypt); | ||
56 | OUTPUT: | ||
57 | RETVAL | ||
58 | |||
59 | void | ||
60 | des_cbc_encrypt(input,ks,ivec,encrypt) | ||
61 | char * input | ||
62 | des_key_schedule * ks | ||
63 | des_cblock * ivec | ||
64 | int encrypt | ||
65 | PPCODE: | ||
66 | { | ||
67 | SV *s; | ||
68 | STRLEN len,l; | ||
69 | char *c; | ||
70 | |||
71 | l=SvCUR(ST(0)); | ||
72 | len=((((unsigned long)l)+7)/8)*8; | ||
73 | s=sv_newmortal(); | ||
74 | sv_setpvn(s,"",0); | ||
75 | SvGROW(s,len); | ||
76 | SvCUR_set(s,len); | ||
77 | c=(char *)SvPV(s,na); | ||
78 | des_cbc_encrypt((des_cblock *)input,(des_cblock *)c, | ||
79 | l,*ks,ivec,encrypt); | ||
80 | sv_setpvn(ST(2),(char *)c[len-8],8); | ||
81 | PUSHs(s); | ||
82 | } | ||
83 | |||
84 | void | ||
85 | des_cbc3_encrypt(input,ks1,ks2,ivec1,ivec2,encrypt) | ||
86 | char * input | ||
87 | des_key_schedule * ks1 | ||
88 | des_key_schedule * ks2 | ||
89 | des_cblock * ivec1 | ||
90 | des_cblock * ivec2 | ||
91 | int encrypt | ||
92 | PPCODE: | ||
93 | { | ||
94 | SV *s; | ||
95 | STRLEN len,l; | ||
96 | |||
97 | l=SvCUR(ST(0)); | ||
98 | len=((((unsigned long)l)+7)/8)*8; | ||
99 | s=sv_newmortal(); | ||
100 | sv_setpvn(s,"",0); | ||
101 | SvGROW(s,len); | ||
102 | SvCUR_set(s,len); | ||
103 | des_3cbc_encrypt((des_cblock *)input,(des_cblock *)SvPV(s,na), | ||
104 | l,*ks1,*ks2,ivec1,ivec2,encrypt); | ||
105 | sv_setpvn(ST(3),(char *)ivec1,8); | ||
106 | sv_setpvn(ST(4),(char *)ivec2,8); | ||
107 | PUSHs(s); | ||
108 | } | ||
109 | |||
110 | void | ||
111 | des_cbc_cksum(input,ks,ivec) | ||
112 | char * input | ||
113 | des_key_schedule * ks | ||
114 | des_cblock * ivec | ||
115 | PPCODE: | ||
116 | { | ||
117 | SV *s1,*s2; | ||
118 | STRLEN len,l; | ||
119 | des_cblock c; | ||
120 | unsigned long i1,i2; | ||
121 | |||
122 | s1=sv_newmortal(); | ||
123 | s2=sv_newmortal(); | ||
124 | l=SvCUR(ST(0)); | ||
125 | des_cbc_cksum((des_cblock *)input,(des_cblock *)c, | ||
126 | l,*ks,ivec); | ||
127 | i1=c[4]|(c[5]<<8)|(c[6]<<16)|(c[7]<<24); | ||
128 | i2=c[0]|(c[1]<<8)|(c[2]<<16)|(c[3]<<24); | ||
129 | sv_setiv(s1,i1); | ||
130 | sv_setiv(s2,i2); | ||
131 | sv_setpvn(ST(2),(char *)c,8); | ||
132 | PUSHs(s1); | ||
133 | PUSHs(s2); | ||
134 | } | ||
135 | |||
136 | void | ||
137 | des_cfb_encrypt(input,numbits,ks,ivec,encrypt) | ||
138 | char * input | ||
139 | int numbits | ||
140 | des_key_schedule * ks | ||
141 | des_cblock * ivec | ||
142 | int encrypt | ||
143 | PPCODE: | ||
144 | { | ||
145 | SV *s; | ||
146 | STRLEN len; | ||
147 | char *c; | ||
148 | |||
149 | len=SvCUR(ST(0)); | ||
150 | s=sv_newmortal(); | ||
151 | sv_setpvn(s,"",0); | ||
152 | SvGROW(s,len); | ||
153 | SvCUR_set(s,len); | ||
154 | c=(char *)SvPV(s,na); | ||
155 | des_cfb_encrypt((unsigned char *)input,(unsigned char *)c, | ||
156 | (int)numbits,(long)len,*ks,ivec,encrypt); | ||
157 | sv_setpvn(ST(3),(char *)ivec,8); | ||
158 | PUSHs(s); | ||
159 | } | ||
160 | |||
161 | des_cblock * | ||
162 | des_ecb3_encrypt(input,ks1,ks2,encrypt) | ||
163 | des_cblock * input | ||
164 | des_key_schedule * ks1 | ||
165 | des_key_schedule * ks2 | ||
166 | int encrypt | ||
167 | CODE: | ||
168 | { | ||
169 | des_cblock c; | ||
170 | |||
171 | des_ecb3_encrypt((des_cblock *)input,(des_cblock *)&c, | ||
172 | *ks1,*ks2,encrypt); | ||
173 | RETVAL= &c; | ||
174 | } | ||
175 | OUTPUT: | ||
176 | RETVAL | ||
177 | |||
178 | void | ||
179 | des_ofb_encrypt(input,numbits,ks,ivec) | ||
180 | unsigned char * input | ||
181 | int numbits | ||
182 | des_key_schedule * ks | ||
183 | des_cblock * ivec | ||
184 | PPCODE: | ||
185 | { | ||
186 | SV *s; | ||
187 | STRLEN len,l; | ||
188 | unsigned char *c; | ||
189 | |||
190 | len=SvCUR(ST(0)); | ||
191 | s=sv_newmortal(); | ||
192 | sv_setpvn(s,"",0); | ||
193 | SvGROW(s,len); | ||
194 | SvCUR_set(s,len); | ||
195 | c=(unsigned char *)SvPV(s,na); | ||
196 | des_ofb_encrypt((unsigned char *)input,(unsigned char *)c, | ||
197 | numbits,len,*ks,ivec); | ||
198 | sv_setpvn(ST(3),(char *)ivec,8); | ||
199 | PUSHs(s); | ||
200 | } | ||
201 | |||
202 | void | ||
203 | des_pcbc_encrypt(input,ks,ivec,encrypt) | ||
204 | char * input | ||
205 | des_key_schedule * ks | ||
206 | des_cblock * ivec | ||
207 | int encrypt | ||
208 | PPCODE: | ||
209 | { | ||
210 | SV *s; | ||
211 | STRLEN len,l; | ||
212 | char *c; | ||
213 | |||
214 | l=SvCUR(ST(0)); | ||
215 | len=((((unsigned long)l)+7)/8)*8; | ||
216 | s=sv_newmortal(); | ||
217 | sv_setpvn(s,"",0); | ||
218 | SvGROW(s,len); | ||
219 | SvCUR_set(s,len); | ||
220 | c=(char *)SvPV(s,na); | ||
221 | des_pcbc_encrypt((des_cblock *)input,(des_cblock *)c, | ||
222 | l,*ks,ivec,encrypt); | ||
223 | sv_setpvn(ST(2),(char *)c[len-8],8); | ||
224 | PUSHs(s); | ||
225 | } | ||
226 | |||
227 | des_cblock * | ||
228 | des_random_key() | ||
229 | CODE: | ||
230 | { | ||
231 | des_cblock c; | ||
232 | |||
233 | des_random_key(c); | ||
234 | RETVAL=&c; | ||
235 | } | ||
236 | OUTPUT: | ||
237 | RETVAL | ||
238 | |||
239 | des_cblock * | ||
240 | des_string_to_key(str) | ||
241 | char * str | ||
242 | CODE: | ||
243 | { | ||
244 | des_cblock c; | ||
245 | |||
246 | des_string_to_key(str,&c); | ||
247 | RETVAL=&c; | ||
248 | } | ||
249 | OUTPUT: | ||
250 | RETVAL | ||
251 | |||
252 | void | ||
253 | des_string_to_2keys(str) | ||
254 | char * str | ||
255 | PPCODE: | ||
256 | { | ||
257 | des_cblock c1,c2; | ||
258 | SV *s1,*s2; | ||
259 | |||
260 | des_string_to_2keys(str,&c1,&c2); | ||
261 | EXTEND(sp,2); | ||
262 | s1=sv_newmortal(); | ||
263 | sv_setpvn(s1,(char *)c1,8); | ||
264 | s2=sv_newmortal(); | ||
265 | sv_setpvn(s2,(char *)c2,8); | ||
266 | PUSHs(s1); | ||
267 | PUSHs(s2); | ||
268 | } | ||
diff --git a/src/lib/libcrypto/des/FILES0 b/src/lib/libcrypto/des/FILES0 index 4c7ea2de7a..2e8211ad2a 100644 --- a/src/lib/libcrypto/des/FILES0 +++ b/src/lib/libcrypto/des/FILES0 | |||
@@ -1,31 +1,10 @@ | |||
1 | /* General stuff */ | 1 | /* General stuff */ |
2 | COPYRIGHT - Copyright info. | 2 | COPYRIGHT - Copyright info. |
3 | MODES.DES - A description of the features of the different modes of DES. | ||
4 | FILES - This file. | 3 | FILES - This file. |
5 | INSTALL - How to make things compile. | ||
6 | Imakefile - For use with kerberos. | ||
7 | README - What this package is. | 4 | README - What this package is. |
8 | VERSION - Which version this is and what was changed. | 5 | VERSION - Which version this is and what was changed. |
9 | KERBEROS - Kerberos version 4 notes. | ||
10 | Makefile.PL - An old makefile to build with perl5, not current. | ||
11 | Makefile.ssl - The SSLeay makefile | ||
12 | Makefile.uni - The normal unix makefile. | ||
13 | GNUmakefile - The makefile for use with glibc. | ||
14 | makefile.bc - A Borland C makefile | ||
15 | times - Some outputs from 'speed' on some machines. | ||
16 | vms.com - For use when compiling under VMS | ||
17 | |||
18 | /* My SunOS des(1) replacement */ | ||
19 | des.c - des(1) source code. | ||
20 | des.man - des(1) manual. | ||
21 | |||
22 | /* Testing and timing programs. */ | ||
23 | destest.c - Source for libdes.a test program. | ||
24 | speed.c - Source for libdes.a timing program. | ||
25 | rpw.c - Source for libdes.a testing password reading routines. | ||
26 | 6 | ||
27 | /* libdes.a source code */ | 7 | /* libdes.a source code */ |
28 | des_crypt.man - libdes.a manual page. | ||
29 | des.h - Public libdes.a header file. | 8 | des.h - Public libdes.a header file. |
30 | ecb_enc.c - des_ecb_encrypt() source, this contains the basic DES code. | 9 | ecb_enc.c - des_ecb_encrypt() source, this contains the basic DES code. |
31 | ecb3_enc.c - des_ecb3_encrypt() source. | 10 | ecb3_enc.c - des_ecb3_encrypt() source. |
@@ -62,35 +41,4 @@ des_ver.h - header file for the external definition of the | |||
62 | version string. | 41 | version string. |
63 | des.doc - SSLeay documentation for the library. | 42 | des.doc - SSLeay documentation for the library. |
64 | 43 | ||
65 | /* The perl scripts - you can ignore these files they are only | ||
66 | * included for the curious */ | ||
67 | des.pl - des in perl anyone? des_set_key and des_ecb_encrypt | ||
68 | both done in a perl library. | ||
69 | testdes.pl - Testing program for des.pl | ||
70 | doIP - Perl script used to develop IP xor/shift code. | ||
71 | doPC1 - Perl script used to develop PC1 xor/shift code. | ||
72 | doPC2 - Generates sk.h. | ||
73 | PC1 - Output of doPC1 should be the same as output from PC1. | ||
74 | PC2 - used in development of doPC2. | ||
75 | shifts.pl - Perl library used by my perl scripts. | ||
76 | |||
77 | /* I started making a perl5 dynamic library for libdes | ||
78 | * but did not fully finish, these files are part of that effort. */ | ||
79 | DES.pm | ||
80 | DES.pod | ||
81 | DES.xs | ||
82 | t | ||
83 | typemap | ||
84 | |||
85 | /* The following are for use with sun RPC implementaions. */ | ||
86 | rpc_des.h | ||
87 | rpc_enc.c | ||
88 | |||
89 | /* The following are contibuted by Mark Murray <mark@grondar.za>. They | ||
90 | * are not normally built into libdes due to machine specific routines | ||
91 | * contained in them. They are for use in the most recent incarnation of | ||
92 | * export kerberos v 4 (eBones). */ | ||
93 | supp.c | ||
94 | new_rkey.c | ||
95 | |||
96 | 44 | ||
diff --git a/src/lib/libcrypto/des/INSTALL b/src/lib/libcrypto/des/INSTALL deleted file mode 100644 index 8aebdfe110..0000000000 --- a/src/lib/libcrypto/des/INSTALL +++ /dev/null | |||
@@ -1,69 +0,0 @@ | |||
1 | Check the CC and CFLAGS lines in the makefile | ||
2 | |||
3 | If your C library does not support the times(3) function, change the | ||
4 | #define TIMES to | ||
5 | #undef TIMES in speed.c | ||
6 | If it does, check the HZ value for the times(3) function. | ||
7 | If your system does not define CLK_TCK it will be assumed to | ||
8 | be 100.0. | ||
9 | |||
10 | If possible use gcc v 2.7.? | ||
11 | Turn on the maximum optimising (normally '-O3 -fomit-frame-pointer' for gcc) | ||
12 | In recent times, some system compilers give better performace. | ||
13 | |||
14 | type 'make' | ||
15 | |||
16 | run './destest' to check things are ok. | ||
17 | run './rpw' to check the tty code for reading passwords works. | ||
18 | run './speed' to see how fast those optimisations make the library run :-) | ||
19 | run './des_opts' to determin the best compile time options. | ||
20 | |||
21 | The output from des_opts should be put in the makefile options and des_enc.c | ||
22 | should be rebuilt. For 64 bit computers, do not use the DES_PTR option. | ||
23 | For the DEC Alpha, edit des.h and change DES_LONG to 'unsigned int' | ||
24 | and then you can use the 'DES_PTR' option. | ||
25 | |||
26 | The file options.txt has the options listed for best speed on quite a | ||
27 | few systems. Look and the options (UNROLL, PTR, RISC2 etc) and then | ||
28 | turn on the relevant option in the Makefile. | ||
29 | |||
30 | There are some special Makefile targets that make life easier. | ||
31 | make cc - standard cc build | ||
32 | make gcc - standard gcc build | ||
33 | make x86-elf - x86 assembler (elf), linux-elf. | ||
34 | make x86-out - x86 assembler (a.out), FreeBSD | ||
35 | make x86-solaris- x86 assembler | ||
36 | make x86-bsdi - x86 assembler (a.out with primative assembler). | ||
37 | |||
38 | If at all possible use the assembler (for Windows NT/95, use | ||
39 | asm/win32.obj to link with). The x86 assembler is very very fast. | ||
40 | |||
41 | A make install will by default install | ||
42 | libdes.a in /usr/local/lib/libdes.a | ||
43 | des in /usr/local/bin/des | ||
44 | des_crypt.man in /usr/local/man/man3/des_crypt.3 | ||
45 | des.man in /usr/local/man/man1/des.1 | ||
46 | des.h in /usr/include/des.h | ||
47 | |||
48 | des(1) should be compatible with sunOS's but I have been unable to | ||
49 | test it. | ||
50 | |||
51 | These routines should compile on MSDOS, most 32bit and 64bit version | ||
52 | of Unix (BSD and SYSV) and VMS, without modification. | ||
53 | The only problems should be #include files that are in the wrong places. | ||
54 | |||
55 | These routines can be compiled under MSDOS. | ||
56 | I have successfully encrypted files using des(1) under MSDOS and then | ||
57 | decrypted the files on a SparcStation. | ||
58 | I have been able to compile and test the routines with | ||
59 | Microsoft C v 5.1 and Turbo C v 2.0. | ||
60 | The code in this library is in no way optimised for the 16bit | ||
61 | operation of MSDOS. | ||
62 | |||
63 | When building for glibc, ignore all of the above and just unpack into | ||
64 | glibc-1.??/des and then gmake as per normal. | ||
65 | |||
66 | As a final note on performace. Certain CPUs like sparcs and Alpha often give | ||
67 | a %10 speed difference depending on the link order. It is rather anoying | ||
68 | when one program reports 'x' DES encrypts a second and another reports | ||
69 | 'x*0.9' the speed. | ||
diff --git a/src/lib/libcrypto/des/KERBEROS b/src/lib/libcrypto/des/KERBEROS deleted file mode 100644 index f401b10014..0000000000 --- a/src/lib/libcrypto/des/KERBEROS +++ /dev/null | |||
@@ -1,41 +0,0 @@ | |||
1 | [ This is an old file, I don't know if it is true anymore | ||
2 | but I will leave the file here - eay 21/11/95 ] | ||
3 | |||
4 | To use this library with Bones (kerberos without DES): | ||
5 | 1) Get my modified Bones - eBones. It can be found on | ||
6 | gondwana.ecr.mu.oz.au (128.250.1.63) /pub/athena/eBones-p9.tar.Z | ||
7 | and | ||
8 | nic.funet.fi (128.214.6.100) /pub/unix/security/Kerberos/eBones-p9.tar.Z | ||
9 | |||
10 | 2) Unpack this library in src/lib/des, makeing sure it is version | ||
11 | 3.00 or greater (libdes.tar.93-10-07.Z). This versions differences | ||
12 | from the version in comp.sources.misc volume 29 patchlevel2. | ||
13 | The primarily difference is that it should compile under kerberos :-). | ||
14 | It can be found at. | ||
15 | ftp.psy.uq.oz.au (130.102.32.1) /pub/DES/libdes.tar.93-10-07.Z | ||
16 | |||
17 | Now do a normal kerberos build and things should work. | ||
18 | |||
19 | One problem I found when I was build on my local sun. | ||
20 | --- | ||
21 | For sunOS 4.1.1 apply the following patch to src/util/ss/make_commands.c | ||
22 | |||
23 | *** make_commands.c.orig Fri Jul 3 04:18:35 1987 | ||
24 | --- make_commands.c Wed May 20 08:47:42 1992 | ||
25 | *************** | ||
26 | *** 98,104 **** | ||
27 | if (!rename(o_file, z_file)) { | ||
28 | if (!vfork()) { | ||
29 | chdir("/tmp"); | ||
30 | ! execl("/bin/ld", "ld", "-o", o_file+5, "-s", "-r", "-n", | ||
31 | z_file+5, 0); | ||
32 | perror("/bin/ld"); | ||
33 | _exit(1); | ||
34 | --- 98,104 ---- | ||
35 | if (!rename(o_file, z_file)) { | ||
36 | if (!vfork()) { | ||
37 | chdir("/tmp"); | ||
38 | ! execl("/bin/ld", "ld", "-o", o_file+5, "-s", "-r", | ||
39 | z_file+5, 0); | ||
40 | perror("/bin/ld"); | ||
41 | _exit(1); | ||
diff --git a/src/lib/libcrypto/des/des.pod b/src/lib/libcrypto/des/des.pod deleted file mode 100644 index bf479e83d2..0000000000 --- a/src/lib/libcrypto/des/des.pod +++ /dev/null | |||
@@ -1,217 +0,0 @@ | |||
1 | =pod | ||
2 | |||
3 | =head1 NAME | ||
4 | |||
5 | des - encrypt or decrypt data using Data Encryption Standard | ||
6 | |||
7 | =head1 SYNOPSIS | ||
8 | |||
9 | B<des> | ||
10 | ( | ||
11 | B<-e> | ||
12 | | | ||
13 | B<-E> | ||
14 | ) | ( | ||
15 | B<-d> | ||
16 | | | ||
17 | B<-D> | ||
18 | ) | ( | ||
19 | B<->[B<cC>][B<ckname>] | ||
20 | ) | | ||
21 | [ | ||
22 | B<-b3hfs> | ||
23 | ] [ | ||
24 | B<-k> | ||
25 | I<key> | ||
26 | ] | ||
27 | ] [ | ||
28 | B<-u>[I<uuname>] | ||
29 | [ | ||
30 | I<input-file> | ||
31 | [ | ||
32 | I<output-file> | ||
33 | ] ] | ||
34 | |||
35 | =head1 NOTE | ||
36 | |||
37 | This page describes the B<des> stand-alone program, not the B<openssl des> | ||
38 | command. | ||
39 | |||
40 | =head1 DESCRIPTION | ||
41 | |||
42 | B<des> | ||
43 | encrypts and decrypts data using the | ||
44 | Data Encryption Standard algorithm. | ||
45 | One of | ||
46 | B<-e>, B<-E> | ||
47 | (for encrypt) or | ||
48 | B<-d>, B<-D> | ||
49 | (for decrypt) must be specified. | ||
50 | It is also possible to use | ||
51 | B<-c> | ||
52 | or | ||
53 | B<-C> | ||
54 | in conjunction or instead of the a encrypt/decrypt option to generate | ||
55 | a 16 character hexadecimal checksum, generated via the | ||
56 | I<des_cbc_cksum>. | ||
57 | |||
58 | Two standard encryption modes are supported by the | ||
59 | B<des> | ||
60 | program, Cipher Block Chaining (the default) and Electronic Code Book | ||
61 | (specified with | ||
62 | B<-b>). | ||
63 | |||
64 | The key used for the DES | ||
65 | algorithm is obtained by prompting the user unless the | ||
66 | B<-k> | ||
67 | I<key> | ||
68 | option is given. | ||
69 | If the key is an argument to the | ||
70 | B<des> | ||
71 | command, it is potentially visible to users executing | ||
72 | ps(1) | ||
73 | or a derivative. To minimise this possibility, | ||
74 | B<des> | ||
75 | takes care to destroy the key argument immediately upon entry. | ||
76 | If your shell keeps a history file be careful to make sure it is not | ||
77 | world readable. | ||
78 | |||
79 | Since this program attempts to maintain compatibility with sunOS's | ||
80 | des(1) command, there are 2 different methods used to convert the user | ||
81 | supplied key to a des key. | ||
82 | Whenever and one or more of | ||
83 | B<-E>, B<-D>, B<-C> | ||
84 | or | ||
85 | B<-3> | ||
86 | options are used, the key conversion procedure will not be compatible | ||
87 | with the sunOS des(1) version but will use all the user supplied | ||
88 | character to generate the des key. | ||
89 | B<des> | ||
90 | command reads from standard input unless | ||
91 | I<input-file> | ||
92 | is specified and writes to standard output unless | ||
93 | I<output-file> | ||
94 | is given. | ||
95 | |||
96 | =head1 OPTIONS | ||
97 | |||
98 | =over 4 | ||
99 | |||
100 | =item B<-b> | ||
101 | |||
102 | Select ECB | ||
103 | (eight bytes at a time) encryption mode. | ||
104 | |||
105 | =item B<-3> | ||
106 | |||
107 | Encrypt using triple encryption. | ||
108 | By default triple cbc encryption is used but if the | ||
109 | B<-b> | ||
110 | option is used then triple ECB encryption is performed. | ||
111 | If the key is less than 8 characters long, the flag has no effect. | ||
112 | |||
113 | =item B<-e> | ||
114 | |||
115 | Encrypt data using an 8 byte key in a manner compatible with sunOS | ||
116 | des(1). | ||
117 | |||
118 | =item B<-E> | ||
119 | |||
120 | Encrypt data using a key of nearly unlimited length (1024 bytes). | ||
121 | This will product a more secure encryption. | ||
122 | |||
123 | =item B<-d> | ||
124 | |||
125 | Decrypt data that was encrypted with the B<-e> option. | ||
126 | |||
127 | =item B<-D> | ||
128 | |||
129 | Decrypt data that was encrypted with the B<-E> option. | ||
130 | |||
131 | =item B<-c> | ||
132 | |||
133 | Generate a 16 character hexadecimal cbc checksum and output this to | ||
134 | stderr. | ||
135 | If a filename was specified after the | ||
136 | B<-c> | ||
137 | option, the checksum is output to that file. | ||
138 | The checksum is generated using a key generated in a sunOS compatible | ||
139 | manner. | ||
140 | |||
141 | =item B<-C> | ||
142 | |||
143 | A cbc checksum is generated in the same manner as described for the | ||
144 | B<-c> | ||
145 | option but the DES key is generated in the same manner as used for the | ||
146 | B<-E> | ||
147 | and | ||
148 | B<-D> | ||
149 | options | ||
150 | |||
151 | =item B<-f> | ||
152 | |||
153 | Does nothing - allowed for compatibility with sunOS des(1) command. | ||
154 | |||
155 | =item B<-s> | ||
156 | |||
157 | Does nothing - allowed for compatibility with sunOS des(1) command. | ||
158 | |||
159 | =item B<-k> I<key> | ||
160 | |||
161 | Use the encryption | ||
162 | I<key> | ||
163 | specified. | ||
164 | |||
165 | =item B<-h> | ||
166 | |||
167 | The | ||
168 | I<key> | ||
169 | is assumed to be a 16 character hexadecimal number. | ||
170 | If the | ||
171 | B<-3> | ||
172 | option is used the key is assumed to be a 32 character hexadecimal | ||
173 | number. | ||
174 | |||
175 | =item B<-u> | ||
176 | |||
177 | This flag is used to read and write uuencoded files. If decrypting, | ||
178 | the input file is assumed to contain uuencoded, DES encrypted data. | ||
179 | If encrypting, the characters following the B<-u> are used as the name of | ||
180 | the uuencoded file to embed in the begin line of the uuencoded | ||
181 | output. If there is no name specified after the B<-u>, the name text.des | ||
182 | will be embedded in the header. | ||
183 | |||
184 | =head1 SEE ALSO | ||
185 | |||
186 | ps(1), | ||
187 | L<des_crypt(3)|des_crypt(3)> | ||
188 | |||
189 | =head1 BUGS | ||
190 | |||
191 | The problem with using the | ||
192 | B<-e> | ||
193 | option is the short key length. | ||
194 | It would be better to use a real 56-bit key rather than an | ||
195 | ASCII-based 56-bit pattern. Knowing that the key was derived from ASCII | ||
196 | radically reduces the time necessary for a brute-force cryptographic attack. | ||
197 | My attempt to remove this problem is to add an alternative text-key to | ||
198 | DES-key function. This alternative function (accessed via | ||
199 | B<-E>, B<-D>, B<-S> | ||
200 | and | ||
201 | B<-3>) | ||
202 | uses DES to help generate the key. | ||
203 | |||
204 | Be carefully when using the B<-u> option. Doing B<des -ud> I<filename> will | ||
205 | not decrypt filename (the B<-u> option will gobble the B<-d> option). | ||
206 | |||
207 | The VMS operating system operates in a world where files are always a | ||
208 | multiple of 512 bytes. This causes problems when encrypted data is | ||
209 | send from Unix to VMS since a 88 byte file will suddenly be padded | ||
210 | with 424 null bytes. To get around this problem, use the B<-u> option | ||
211 | to uuencode the data before it is send to the VMS system. | ||
212 | |||
213 | =head1 AUTHOR | ||
214 | |||
215 | Eric Young (eay@cryptsoft.com) | ||
216 | |||
217 | =cut | ||
diff --git a/src/lib/libcrypto/des/makefile.bc b/src/lib/libcrypto/des/makefile.bc deleted file mode 100644 index 1fe6d4915a..0000000000 --- a/src/lib/libcrypto/des/makefile.bc +++ /dev/null | |||
@@ -1,50 +0,0 @@ | |||
1 | # | ||
2 | # Origional BC Makefile from Teun <Teun.Nijssen@kub.nl> | ||
3 | # | ||
4 | # | ||
5 | CC = bcc | ||
6 | TLIB = tlib /0 /C | ||
7 | # note: the -3 flag produces code for 386, 486, Pentium etc; omit it for 286s | ||
8 | OPTIMIZE= -3 -O2 | ||
9 | #WINDOWS= -W | ||
10 | CFLAGS = -c -ml -d $(OPTIMIZE) $(WINDOWS) -DMSDOS | ||
11 | LFLAGS = -ml $(WINDOWS) | ||
12 | |||
13 | .c.obj: | ||
14 | $(CC) $(CFLAGS) $*.c | ||
15 | |||
16 | .obj.exe: | ||
17 | $(CC) $(LFLAGS) -e$*.exe $*.obj libdes.lib | ||
18 | |||
19 | all: $(LIB) destest.exe rpw.exe des.exe speed.exe | ||
20 | |||
21 | # "make clean": use a directory containing only libdes .exe and .obj files... | ||
22 | clean: | ||
23 | del *.exe | ||
24 | del *.obj | ||
25 | del libdes.lib | ||
26 | del libdes.rsp | ||
27 | |||
28 | OBJS= cbc_cksm.obj cbc_enc.obj ecb_enc.obj pcbc_enc.obj \ | ||
29 | qud_cksm.obj rand_key.obj set_key.obj str2key.obj \ | ||
30 | enc_read.obj enc_writ.obj fcrypt.obj cfb_enc.obj \ | ||
31 | ecb3_enc.obj ofb_enc.obj cbc3_enc.obj read_pwd.obj\ | ||
32 | cfb64enc.obj ofb64enc.obj ede_enc.obj cfb64ede.obj\ | ||
33 | ofb64ede.obj supp.obj | ||
34 | |||
35 | LIB= libdes.lib | ||
36 | |||
37 | $(LIB): $(OBJS) | ||
38 | del $(LIB) | ||
39 | makersp "+%s &\n" &&| | ||
40 | $(OBJS) | ||
41 | | >libdes.rsp | ||
42 | $(TLIB) libdes.lib @libdes.rsp,nul | ||
43 | del libdes.rsp | ||
44 | |||
45 | destest.exe: destest.obj libdes.lib | ||
46 | rpw.exe: rpw.obj libdes.lib | ||
47 | speed.exe: speed.obj libdes.lib | ||
48 | des.exe: des.obj libdes.lib | ||
49 | |||
50 | |||
diff --git a/src/lib/libcrypto/des/rpw.c b/src/lib/libcrypto/des/rpw.c deleted file mode 100644 index 8a9473c4f9..0000000000 --- a/src/lib/libcrypto/des/rpw.c +++ /dev/null | |||
@@ -1,99 +0,0 @@ | |||
1 | /* crypto/des/rpw.c */ | ||
2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | ||
3 | * All rights reserved. | ||
4 | * | ||
5 | * This package is an SSL implementation written | ||
6 | * by Eric Young (eay@cryptsoft.com). | ||
7 | * The implementation was written so as to conform with Netscapes SSL. | ||
8 | * | ||
9 | * This library is free for commercial and non-commercial use as long as | ||
10 | * the following conditions are aheared to. The following conditions | ||
11 | * apply to all code found in this distribution, be it the RC4, RSA, | ||
12 | * lhash, DES, etc., code; not just the SSL code. The SSL documentation | ||
13 | * included with this distribution is covered by the same copyright terms | ||
14 | * except that the holder is Tim Hudson (tjh@cryptsoft.com). | ||
15 | * | ||
16 | * Copyright remains Eric Young's, and as such any Copyright notices in | ||
17 | * the code are not to be removed. | ||
18 | * If this package is used in a product, Eric Young should be given attribution | ||
19 | * as the author of the parts of the library used. | ||
20 | * This can be in the form of a textual message at program startup or | ||
21 | * in documentation (online or textual) provided with the package. | ||
22 | * | ||
23 | * Redistribution and use in source and binary forms, with or without | ||
24 | * modification, are permitted provided that the following conditions | ||
25 | * are met: | ||
26 | * 1. Redistributions of source code must retain the copyright | ||
27 | * notice, this list of conditions and the following disclaimer. | ||
28 | * 2. Redistributions in binary form must reproduce the above copyright | ||
29 | * notice, this list of conditions and the following disclaimer in the | ||
30 | * documentation and/or other materials provided with the distribution. | ||
31 | * 3. All advertising materials mentioning features or use of this software | ||
32 | * must display the following acknowledgement: | ||
33 | * "This product includes cryptographic software written by | ||
34 | * Eric Young (eay@cryptsoft.com)" | ||
35 | * The word 'cryptographic' can be left out if the rouines from the library | ||
36 | * being used are not cryptographic related :-). | ||
37 | * 4. If you include any Windows specific code (or a derivative thereof) from | ||
38 | * the apps directory (application code) you must include an acknowledgement: | ||
39 | * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" | ||
40 | * | ||
41 | * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND | ||
42 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
43 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
44 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE | ||
45 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
46 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | ||
47 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
48 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||
49 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | ||
50 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | ||
51 | * SUCH DAMAGE. | ||
52 | * | ||
53 | * The licence and distribution terms for any publically available version or | ||
54 | * derivative of this code cannot be changed. i.e. this code cannot simply be | ||
55 | * copied and put under another distribution licence | ||
56 | * [including the GNU Public Licence.] | ||
57 | */ | ||
58 | |||
59 | #include <stdio.h> | ||
60 | #include <openssl/des.h> | ||
61 | |||
62 | int main(int argc, char *argv[]) | ||
63 | { | ||
64 | DES_cblock k,k1; | ||
65 | int i; | ||
66 | |||
67 | printf("read passwd\n"); | ||
68 | if ((i=des_read_password(&k,"Enter password:",0)) == 0) | ||
69 | { | ||
70 | printf("password = "); | ||
71 | for (i=0; i<8; i++) | ||
72 | printf("%02x ",k[i]); | ||
73 | } | ||
74 | else | ||
75 | printf("error %d\n",i); | ||
76 | printf("\n"); | ||
77 | printf("read 2passwds and verify\n"); | ||
78 | if ((i=des_read_2passwords(&k,&k1, | ||
79 | "Enter verified password:",1)) == 0) | ||
80 | { | ||
81 | printf("password1 = "); | ||
82 | for (i=0; i<8; i++) | ||
83 | printf("%02x ",k[i]); | ||
84 | printf("\n"); | ||
85 | printf("password2 = "); | ||
86 | for (i=0; i<8; i++) | ||
87 | printf("%02x ",k1[i]); | ||
88 | printf("\n"); | ||
89 | exit(1); | ||
90 | } | ||
91 | else | ||
92 | { | ||
93 | printf("error %d\n",i); | ||
94 | exit(0); | ||
95 | } | ||
96 | #ifdef LINT | ||
97 | return(0); | ||
98 | #endif | ||
99 | } | ||
diff --git a/src/lib/libcrypto/des/speed.c b/src/lib/libcrypto/des/speed.c deleted file mode 100644 index 2f52c1c40f..0000000000 --- a/src/lib/libcrypto/des/speed.c +++ /dev/null | |||
@@ -1,313 +0,0 @@ | |||
1 | /* crypto/des/speed.c */ | ||
2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | ||
3 | * All rights reserved. | ||
4 | * | ||
5 | * This package is an SSL implementation written | ||
6 | * by Eric Young (eay@cryptsoft.com). | ||
7 | * The implementation was written so as to conform with Netscapes SSL. | ||
8 | * | ||
9 | * This library is free for commercial and non-commercial use as long as | ||
10 | * the following conditions are aheared to. The following conditions | ||
11 | * apply to all code found in this distribution, be it the RC4, RSA, | ||
12 | * lhash, DES, etc., code; not just the SSL code. The SSL documentation | ||
13 | * included with this distribution is covered by the same copyright terms | ||
14 | * except that the holder is Tim Hudson (tjh@cryptsoft.com). | ||
15 | * | ||
16 | * Copyright remains Eric Young's, and as such any Copyright notices in | ||
17 | * the code are not to be removed. | ||
18 | * If this package is used in a product, Eric Young should be given attribution | ||
19 | * as the author of the parts of the library used. | ||
20 | * This can be in the form of a textual message at program startup or | ||
21 | * in documentation (online or textual) provided with the package. | ||
22 | * | ||
23 | * Redistribution and use in source and binary forms, with or without | ||
24 | * modification, are permitted provided that the following conditions | ||
25 | * are met: | ||
26 | * 1. Redistributions of source code must retain the copyright | ||
27 | * notice, this list of conditions and the following disclaimer. | ||
28 | * 2. Redistributions in binary form must reproduce the above copyright | ||
29 | * notice, this list of conditions and the following disclaimer in the | ||
30 | * documentation and/or other materials provided with the distribution. | ||
31 | * 3. All advertising materials mentioning features or use of this software | ||
32 | * must display the following acknowledgement: | ||
33 | * "This product includes cryptographic software written by | ||
34 | * Eric Young (eay@cryptsoft.com)" | ||
35 | * The word 'cryptographic' can be left out if the rouines from the library | ||
36 | * being used are not cryptographic related :-). | ||
37 | * 4. If you include any Windows specific code (or a derivative thereof) from | ||
38 | * the apps directory (application code) you must include an acknowledgement: | ||
39 | * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" | ||
40 | * | ||
41 | * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND | ||
42 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
43 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
44 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE | ||
45 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
46 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | ||
47 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
48 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||
49 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | ||
50 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | ||
51 | * SUCH DAMAGE. | ||
52 | * | ||
53 | * The licence and distribution terms for any publically available version or | ||
54 | * derivative of this code cannot be changed. i.e. this code cannot simply be | ||
55 | * copied and put under another distribution licence | ||
56 | * [including the GNU Public Licence.] | ||
57 | */ | ||
58 | |||
59 | /* 11-Sep-92 Andrew Daviel Support for Silicon Graphics IRIX added */ | ||
60 | /* 06-Apr-92 Luke Brennan Support for VMS and add extra signal calls */ | ||
61 | |||
62 | #if !defined(OPENSSL_SYS_MSDOS) && (!defined(OPENSSL_SYS_VMS) || defined(__DECC)) && !defined(OPENSSL_SYS_MACOSX) | ||
63 | #define TIMES | ||
64 | #endif | ||
65 | |||
66 | #include <stdio.h> | ||
67 | |||
68 | #include <openssl/e_os2.h> | ||
69 | #include <unistd.h> | ||
70 | |||
71 | #ifndef OPENSSL_SYS_NETWARE | ||
72 | #include <signal.h> | ||
73 | #define crypt(c,s) (des_crypt((c),(s))) | ||
74 | #endif | ||
75 | |||
76 | #ifndef _IRIX | ||
77 | #include <time.h> | ||
78 | #endif | ||
79 | #ifdef TIMES | ||
80 | #include <sys/types.h> | ||
81 | #include <sys/times.h> | ||
82 | #endif | ||
83 | |||
84 | /* Depending on the VMS version, the tms structure is perhaps defined. | ||
85 | The __TMS macro will show if it was. If it wasn't defined, we should | ||
86 | undefine TIMES, since that tells the rest of the program how things | ||
87 | should be handled. -- Richard Levitte */ | ||
88 | #if defined(OPENSSL_SYS_VMS_DECC) && !defined(__TMS) | ||
89 | #undef TIMES | ||
90 | #endif | ||
91 | |||
92 | #ifndef TIMES | ||
93 | #include <sys/timeb.h> | ||
94 | #endif | ||
95 | |||
96 | #if defined(sun) || defined(__ultrix) | ||
97 | #define _POSIX_SOURCE | ||
98 | #include <limits.h> | ||
99 | #include <sys/param.h> | ||
100 | #endif | ||
101 | |||
102 | #include <openssl/des.h> | ||
103 | |||
104 | /* The following if from times(3) man page. It may need to be changed */ | ||
105 | #ifndef HZ | ||
106 | # ifndef CLK_TCK | ||
107 | # ifndef _BSD_CLK_TCK_ /* FreeBSD fix */ | ||
108 | # define HZ 100.0 | ||
109 | # else /* _BSD_CLK_TCK_ */ | ||
110 | # define HZ ((double)_BSD_CLK_TCK_) | ||
111 | # endif | ||
112 | # else /* CLK_TCK */ | ||
113 | # define HZ ((double)CLK_TCK) | ||
114 | # endif | ||
115 | #endif | ||
116 | |||
117 | #define BUFSIZE ((long)1024) | ||
118 | long run=0; | ||
119 | |||
120 | double Time_F(int s); | ||
121 | #ifdef SIGALRM | ||
122 | #if defined(__STDC__) || defined(sgi) || defined(_AIX) | ||
123 | #define SIGRETTYPE void | ||
124 | #else | ||
125 | #define SIGRETTYPE int | ||
126 | #endif | ||
127 | |||
128 | SIGRETTYPE sig_done(int sig); | ||
129 | SIGRETTYPE sig_done(int sig) | ||
130 | { | ||
131 | signal(SIGALRM,sig_done); | ||
132 | run=0; | ||
133 | #ifdef LINT | ||
134 | sig=sig; | ||
135 | #endif | ||
136 | } | ||
137 | #endif | ||
138 | |||
139 | #define START 0 | ||
140 | #define STOP 1 | ||
141 | |||
142 | double Time_F(int s) | ||
143 | { | ||
144 | double ret; | ||
145 | #ifdef TIMES | ||
146 | static struct tms tstart,tend; | ||
147 | |||
148 | if (s == START) | ||
149 | { | ||
150 | times(&tstart); | ||
151 | return(0); | ||
152 | } | ||
153 | else | ||
154 | { | ||
155 | times(&tend); | ||
156 | ret=((double)(tend.tms_utime-tstart.tms_utime))/HZ; | ||
157 | return((ret == 0.0)?1e-6:ret); | ||
158 | } | ||
159 | #else /* !times() */ | ||
160 | static struct timeb tstart,tend; | ||
161 | long i; | ||
162 | |||
163 | if (s == START) | ||
164 | { | ||
165 | ftime(&tstart); | ||
166 | return(0); | ||
167 | } | ||
168 | else | ||
169 | { | ||
170 | ftime(&tend); | ||
171 | i=(long)tend.millitm-(long)tstart.millitm; | ||
172 | ret=((double)(tend.time-tstart.time))+((double)i)/1e3; | ||
173 | return((ret == 0.0)?1e-6:ret); | ||
174 | } | ||
175 | #endif | ||
176 | } | ||
177 | |||
178 | int main(int argc, char **argv) | ||
179 | { | ||
180 | long count; | ||
181 | static unsigned char buf[BUFSIZE]; | ||
182 | static DES_cblock key ={0x12,0x34,0x56,0x78,0x9a,0xbc,0xde,0xf0}; | ||
183 | static DES_cblock key2={0x34,0x56,0x78,0x9a,0xbc,0xde,0xf0,0x12}; | ||
184 | static DES_cblock key3={0x56,0x78,0x9a,0xbc,0xde,0xf0,0x12,0x34}; | ||
185 | DES_key_schedule sch,sch2,sch3; | ||
186 | double a,b,c,d,e; | ||
187 | #ifndef SIGALRM | ||
188 | long ca,cb,cc,cd,ce; | ||
189 | #endif | ||
190 | |||
191 | #ifndef TIMES | ||
192 | printf("To get the most accurate results, try to run this\n"); | ||
193 | printf("program when this computer is idle.\n"); | ||
194 | #endif | ||
195 | |||
196 | DES_set_key_unchecked(&key2,&sch2); | ||
197 | DES_set_key_unchecked(&key3,&sch3); | ||
198 | |||
199 | #ifndef SIGALRM | ||
200 | printf("First we calculate the approximate speed ...\n"); | ||
201 | DES_set_key_unchecked(&key,&sch); | ||
202 | count=10; | ||
203 | do { | ||
204 | long i; | ||
205 | DES_LONG data[2]; | ||
206 | |||
207 | count*=2; | ||
208 | Time_F(START); | ||
209 | for (i=count; i; i--) | ||
210 | DES_encrypt1(data,&sch,DES_ENCRYPT); | ||
211 | d=Time_F(STOP); | ||
212 | } while (d < 3.0); | ||
213 | ca=count; | ||
214 | cb=count*3; | ||
215 | cc=count*3*8/BUFSIZE+1; | ||
216 | cd=count*8/BUFSIZE+1; | ||
217 | ce=count/20+1; | ||
218 | printf("Doing set_key %ld times\n",ca); | ||
219 | #define COND(d) (count != (d)) | ||
220 | #define COUNT(d) (d) | ||
221 | #else | ||
222 | #define COND(c) (run) | ||
223 | #define COUNT(d) (count) | ||
224 | signal(SIGALRM,sig_done); | ||
225 | printf("Doing set_key for 10 seconds\n"); | ||
226 | alarm(10); | ||
227 | #endif | ||
228 | |||
229 | Time_F(START); | ||
230 | for (count=0,run=1; COND(ca); count++) | ||
231 | DES_set_key_unchecked(&key,&sch); | ||
232 | d=Time_F(STOP); | ||
233 | printf("%ld set_key's in %.2f seconds\n",count,d); | ||
234 | a=((double)COUNT(ca))/d; | ||
235 | |||
236 | #ifdef SIGALRM | ||
237 | printf("Doing DES_encrypt's for 10 seconds\n"); | ||
238 | alarm(10); | ||
239 | #else | ||
240 | printf("Doing DES_encrypt %ld times\n",cb); | ||
241 | #endif | ||
242 | Time_F(START); | ||
243 | for (count=0,run=1; COND(cb); count++) | ||
244 | { | ||
245 | DES_LONG data[2]; | ||
246 | |||
247 | DES_encrypt1(data,&sch,DES_ENCRYPT); | ||
248 | } | ||
249 | d=Time_F(STOP); | ||
250 | printf("%ld DES_encrypt's in %.2f second\n",count,d); | ||
251 | b=((double)COUNT(cb)*8)/d; | ||
252 | |||
253 | #ifdef SIGALRM | ||
254 | printf("Doing DES_cbc_encrypt on %ld byte blocks for 10 seconds\n", | ||
255 | BUFSIZE); | ||
256 | alarm(10); | ||
257 | #else | ||
258 | printf("Doing DES_cbc_encrypt %ld times on %ld byte blocks\n",cc, | ||
259 | BUFSIZE); | ||
260 | #endif | ||
261 | Time_F(START); | ||
262 | for (count=0,run=1; COND(cc); count++) | ||
263 | DES_ncbc_encrypt(buf,buf,BUFSIZE,&sch, | ||
264 | &key,DES_ENCRYPT); | ||
265 | d=Time_F(STOP); | ||
266 | printf("%ld DES_cbc_encrypt's of %ld byte blocks in %.2f second\n", | ||
267 | count,BUFSIZE,d); | ||
268 | c=((double)COUNT(cc)*BUFSIZE)/d; | ||
269 | |||
270 | #ifdef SIGALRM | ||
271 | printf("Doing DES_ede_cbc_encrypt on %ld byte blocks for 10 seconds\n", | ||
272 | BUFSIZE); | ||
273 | alarm(10); | ||
274 | #else | ||
275 | printf("Doing DES_ede_cbc_encrypt %ld times on %ld byte blocks\n",cd, | ||
276 | BUFSIZE); | ||
277 | #endif | ||
278 | Time_F(START); | ||
279 | for (count=0,run=1; COND(cd); count++) | ||
280 | DES_ede3_cbc_encrypt(buf,buf,BUFSIZE, | ||
281 | &sch, | ||
282 | &sch2, | ||
283 | &sch3, | ||
284 | &key, | ||
285 | DES_ENCRYPT); | ||
286 | d=Time_F(STOP); | ||
287 | printf("%ld DES_ede_cbc_encrypt's of %ld byte blocks in %.2f second\n", | ||
288 | count,BUFSIZE,d); | ||
289 | d=((double)COUNT(cd)*BUFSIZE)/d; | ||
290 | |||
291 | #ifdef SIGALRM | ||
292 | printf("Doing crypt for 10 seconds\n"); | ||
293 | alarm(10); | ||
294 | #else | ||
295 | printf("Doing crypt %ld times\n",ce); | ||
296 | #endif | ||
297 | Time_F(START); | ||
298 | for (count=0,run=1; COND(ce); count++) | ||
299 | crypt("testing1","ef"); | ||
300 | e=Time_F(STOP); | ||
301 | printf("%ld crypts in %.2f second\n",count,e); | ||
302 | e=((double)COUNT(ce))/e; | ||
303 | |||
304 | printf("set_key per sec = %12.2f (%9.3fuS)\n",a,1.0e6/a); | ||
305 | printf("DES raw ecb bytes per sec = %12.2f (%9.3fuS)\n",b,8.0e6/b); | ||
306 | printf("DES cbc bytes per sec = %12.2f (%9.3fuS)\n",c,8.0e6/c); | ||
307 | printf("DES ede cbc bytes per sec = %12.2f (%9.3fuS)\n",d,8.0e6/d); | ||
308 | printf("crypt per sec = %12.2f (%9.3fuS)\n",e,1.0e6/e); | ||
309 | exit(0); | ||
310 | #if defined(LINT) || defined(OPENSSL_SYS_MSDOS) | ||
311 | return(0); | ||
312 | #endif | ||
313 | } | ||
diff --git a/src/lib/libcrypto/des/t/test b/src/lib/libcrypto/des/t/test deleted file mode 100644 index 97acd0552e..0000000000 --- a/src/lib/libcrypto/des/t/test +++ /dev/null | |||
@@ -1,27 +0,0 @@ | |||
1 | #!./perl | ||
2 | |||
3 | BEGIN { push(@INC, qw(../../../lib ../../lib ../lib lib)); } | ||
4 | |||
5 | use DES; | ||
6 | |||
7 | $key='00000000'; | ||
8 | $ks=DES::set_key($key); | ||
9 | @a=split(//,$ks); | ||
10 | foreach (@a) { printf "%02x-",ord($_); } | ||
11 | print "\n"; | ||
12 | |||
13 | |||
14 | $key=DES::random_key(); | ||
15 | print "($_)\n"; | ||
16 | @a=split(//,$key); | ||
17 | foreach (@a) { printf "%02x-",ord($_); } | ||
18 | print "\n"; | ||
19 | $str="this is and again into the breach"; | ||
20 | ($k1,$k2)=DES::string_to_2keys($str); | ||
21 | @a=split(//,$k1); | ||
22 | foreach (@a) { printf "%02x-",ord($_); } | ||
23 | print "\n"; | ||
24 | @a=split(//,$k2); | ||
25 | foreach (@a) { printf "%02x-",ord($_); } | ||
26 | print "\n"; | ||
27 | |||
diff --git a/src/lib/libcrypto/des/times/486-50.sol b/src/lib/libcrypto/des/times/486-50.sol deleted file mode 100644 index 0de62d6db3..0000000000 --- a/src/lib/libcrypto/des/times/486-50.sol +++ /dev/null | |||
@@ -1,16 +0,0 @@ | |||
1 | Solaris 2.4, 486 50mhz, gcc 2.6.3 | ||
2 | options des ecb/s | ||
3 | 16 r2 i 43552.51 100.0% | ||
4 | 16 r1 i 43487.45 99.9% | ||
5 | 16 c p 43003.23 98.7% | ||
6 | 16 r2 p 42339.00 97.2% | ||
7 | 16 c i 41900.91 96.2% | ||
8 | 16 r1 p 41360.64 95.0% | ||
9 | 4 c i 38728.48 88.9% | ||
10 | 4 c p 38225.63 87.8% | ||
11 | 4 r1 i 38085.79 87.4% | ||
12 | 4 r2 i 37825.64 86.9% | ||
13 | 4 r2 p 34611.00 79.5% | ||
14 | 4 r1 p 31802.00 73.0% | ||
15 | -DDES_UNROLL -DDES_RISC2 | ||
16 | |||
diff --git a/src/lib/libcrypto/des/times/586-100.lnx b/src/lib/libcrypto/des/times/586-100.lnx deleted file mode 100644 index 4323914a11..0000000000 --- a/src/lib/libcrypto/des/times/586-100.lnx +++ /dev/null | |||
@@ -1,20 +0,0 @@ | |||
1 | Pentium 100 | ||
2 | Linux 2 kernel | ||
3 | gcc 2.7.0 -O3 -fomit-frame-pointer | ||
4 | No X server running, just a console, it makes the top speed jump from 151,000 | ||
5 | to 158,000 :-). | ||
6 | options des ecb/s | ||
7 | assember 281000.00 177.1% | ||
8 | 16 r1 p 158667.40 100.0% | ||
9 | 16 r1 i 148471.70 93.6% | ||
10 | 16 r2 p 143961.80 90.7% | ||
11 | 16 r2 i 141689.20 89.3% | ||
12 | 4 r1 i 140100.00 88.3% | ||
13 | 4 r2 i 134049.40 84.5% | ||
14 | 16 c i 124145.20 78.2% | ||
15 | 16 c p 121584.20 76.6% | ||
16 | 4 c i 118116.00 74.4% | ||
17 | 4 r2 p 117977.90 74.4% | ||
18 | 4 c p 114971.40 72.5% | ||
19 | 4 r1 p 114578.40 72.2% | ||
20 | -DDES_UNROLL -DDES_RISC1 -DDES_PTR | ||
diff --git a/src/lib/libcrypto/des/times/686-200.fre b/src/lib/libcrypto/des/times/686-200.fre deleted file mode 100644 index 7d83f6adee..0000000000 --- a/src/lib/libcrypto/des/times/686-200.fre +++ /dev/null | |||
@@ -1,18 +0,0 @@ | |||
1 | Pentium 100 | ||
2 | Free BSD 2.1.5 kernel | ||
3 | gcc 2.7.2.2 -O3 -fomit-frame-pointer | ||
4 | options des ecb/s | ||
5 | assember 578000.00 133.1% | ||
6 | 16 r2 i 434454.80 100.0% | ||
7 | 16 r1 i 433621.43 99.8% | ||
8 | 16 r2 p 431375.69 99.3% | ||
9 | 4 r1 i 423722.30 97.5% | ||
10 | 4 r2 i 422399.40 97.2% | ||
11 | 16 r1 p 421739.40 97.1% | ||
12 | 16 c i 399027.94 91.8% | ||
13 | 16 c p 372251.70 85.7% | ||
14 | 4 c i 365118.35 84.0% | ||
15 | 4 c p 352880.51 81.2% | ||
16 | 4 r2 p 255104.90 58.7% | ||
17 | 4 r1 p 251289.18 57.8% | ||
18 | -DDES_UNROLL -DDES_RISC2 | ||
diff --git a/src/lib/libcrypto/des/times/aix.cc b/src/lib/libcrypto/des/times/aix.cc deleted file mode 100644 index d96b74e2ce..0000000000 --- a/src/lib/libcrypto/des/times/aix.cc +++ /dev/null | |||
@@ -1,26 +0,0 @@ | |||
1 | From: Paco Garcia <pgarcia@cam.es> | ||
2 | |||
3 | This machine is a Bull Estrella Minitower Model MT604-100 | ||
4 | Processor : PPC604 | ||
5 | P.Speed : 100Mhz | ||
6 | Data/Instr Cache : 16 K | ||
7 | L2 Cache : 256 K | ||
8 | PCI BUS Speed : 33 Mhz | ||
9 | TransfRate PCI : 132 MB/s | ||
10 | Memory : 96 MB | ||
11 | |||
12 | options des ecb/s | ||
13 | 4 c p 275118.61 100.0% | ||
14 | 4 c i 273545.07 99.4% | ||
15 | 4 r2 p 270441.02 98.3% | ||
16 | 4 r1 p 253052.15 92.0% | ||
17 | 4 r2 i 240842.97 87.5% | ||
18 | 4 r1 i 240556.66 87.4% | ||
19 | 16 c i 224603.99 81.6% | ||
20 | 16 c p 224483.98 81.6% | ||
21 | 16 r2 p 215691.19 78.4% | ||
22 | 16 r1 p 208332.83 75.7% | ||
23 | 16 r1 i 199206.50 72.4% | ||
24 | 16 r2 i 198963.70 72.3% | ||
25 | -DDES_PTR | ||
26 | |||
diff --git a/src/lib/libcrypto/des/times/alpha.cc b/src/lib/libcrypto/des/times/alpha.cc deleted file mode 100644 index 95c17efae7..0000000000 --- a/src/lib/libcrypto/des/times/alpha.cc +++ /dev/null | |||
@@ -1,18 +0,0 @@ | |||
1 | cc -O2 | ||
2 | DES_LONG is 'unsigned int' | ||
3 | |||
4 | options des ecb/s | ||
5 | 4 r2 p 181146.14 100.0% | ||
6 | 16 r2 p 172102.94 95.0% | ||
7 | 4 r2 i 165424.11 91.3% | ||
8 | 16 c p 160468.64 88.6% | ||
9 | 4 c p 156653.59 86.5% | ||
10 | 4 c i 155245.18 85.7% | ||
11 | 4 r1 p 154729.68 85.4% | ||
12 | 16 r2 i 154137.69 85.1% | ||
13 | 16 r1 p 152357.96 84.1% | ||
14 | 16 c i 148743.91 82.1% | ||
15 | 4 r1 i 146695.59 81.0% | ||
16 | 16 r1 i 144961.00 80.0% | ||
17 | -DDES_RISC2 -DDES_PTR | ||
18 | |||
diff --git a/src/lib/libcrypto/des/times/hpux.cc b/src/lib/libcrypto/des/times/hpux.cc deleted file mode 100644 index 3de856ddac..0000000000 --- a/src/lib/libcrypto/des/times/hpux.cc +++ /dev/null | |||
@@ -1,17 +0,0 @@ | |||
1 | HPUX 10 - 9000/887 - cc -D_HPUX_SOURCE -Aa +ESlit +O2 -Wl,-a,archive | ||
2 | |||
3 | options des ecb/s | ||
4 | 16 c i 149448.90 100.0% | ||
5 | 4 c i 145861.79 97.6% | ||
6 | 16 r2 i 141710.96 94.8% | ||
7 | 16 r1 i 139455.33 93.3% | ||
8 | 4 r2 i 138800.00 92.9% | ||
9 | 4 r1 i 136692.65 91.5% | ||
10 | 16 r2 p 110228.17 73.8% | ||
11 | 16 r1 p 109397.07 73.2% | ||
12 | 16 c p 109209.89 73.1% | ||
13 | 4 c p 108014.71 72.3% | ||
14 | 4 r2 p 107873.88 72.2% | ||
15 | 4 r1 p 107685.83 72.1% | ||
16 | -DDES_UNROLL | ||
17 | |||
diff --git a/src/lib/libcrypto/des/times/sparc.gcc b/src/lib/libcrypto/des/times/sparc.gcc deleted file mode 100644 index 8eaa042104..0000000000 --- a/src/lib/libcrypto/des/times/sparc.gcc +++ /dev/null | |||
@@ -1,17 +0,0 @@ | |||
1 | solaris 2.5.1 - sparc 10 50mhz - gcc 2.7.2 | ||
2 | |||
3 | options des ecb/s | ||
4 | 16 c i 124382.70 100.0% | ||
5 | 4 c i 118884.68 95.6% | ||
6 | 16 c p 112261.20 90.3% | ||
7 | 16 r2 i 111777.10 89.9% | ||
8 | 16 r2 p 108896.30 87.5% | ||
9 | 16 r1 p 108791.59 87.5% | ||
10 | 4 c p 107290.10 86.3% | ||
11 | 4 r1 p 104583.80 84.1% | ||
12 | 16 r1 i 104206.20 83.8% | ||
13 | 4 r2 p 103709.80 83.4% | ||
14 | 4 r2 i 98306.43 79.0% | ||
15 | 4 r1 i 91525.80 73.6% | ||
16 | -DDES_UNROLL | ||
17 | |||
diff --git a/src/lib/libcrypto/des/times/usparc.cc b/src/lib/libcrypto/des/times/usparc.cc deleted file mode 100644 index 0864285ef6..0000000000 --- a/src/lib/libcrypto/des/times/usparc.cc +++ /dev/null | |||
@@ -1,31 +0,0 @@ | |||
1 | solaris 2.5.1 usparc 167mhz?? - SC4.0 cc -fast -Xa -xO5 | ||
2 | |||
3 | For the ultra sparc, SunC 4.0 cc -fast -Xa -xO5, running 'des_opts' | ||
4 | gives a speed of 475,000 des/s while 'speed' gives 417,000 des/s. | ||
5 | I believe the difference is tied up in optimisation that the compiler | ||
6 | is able to perform when the code is 'inlined'. For 'speed', the DES | ||
7 | routines are being linked from a library. I'll record the higher | ||
8 | speed since if performance is everything, you can always inline | ||
9 | 'des_enc.c'. | ||
10 | |||
11 | [ 16-Jan-06 - I've been playing with the | ||
12 | '-xtarget=ultra -xarch=v8plus -Xa -xO5 -Xa' | ||
13 | and while it makes the des_opts numbers much slower, it makes the | ||
14 | actual 'speed' numbers look better which is a realistic version of | ||
15 | using the libraries. ] | ||
16 | |||
17 | options des ecb/s | ||
18 | 16 r1 p 475516.90 100.0% | ||
19 | 16 r2 p 439388.10 92.4% | ||
20 | 16 c i 427001.40 89.8% | ||
21 | 16 c p 419516.50 88.2% | ||
22 | 4 r2 p 409491.70 86.1% | ||
23 | 4 r1 p 404266.90 85.0% | ||
24 | 4 c p 398121.00 83.7% | ||
25 | 4 c i 370588.40 77.9% | ||
26 | 4 r1 i 362742.20 76.3% | ||
27 | 16 r2 i 331275.50 69.7% | ||
28 | 16 r1 i 324730.60 68.3% | ||
29 | 4 r2 i 63535.10 13.4% <-- very very weird, must be cache problems. | ||
30 | -DDES_UNROLL -DDES_RISC1 -DDES_PTR | ||
31 | |||
diff --git a/src/lib/libcrypto/des/typemap b/src/lib/libcrypto/des/typemap deleted file mode 100644 index a524f53634..0000000000 --- a/src/lib/libcrypto/des/typemap +++ /dev/null | |||
@@ -1,34 +0,0 @@ | |||
1 | # | ||
2 | # DES SECTION | ||
3 | # | ||
4 | deschar * T_DESCHARP | ||
5 | des_cblock * T_CBLOCK | ||
6 | des_cblock T_CBLOCK | ||
7 | des_key_schedule T_SCHEDULE | ||
8 | des_key_schedule * T_SCHEDULE | ||
9 | |||
10 | INPUT | ||
11 | T_CBLOCK | ||
12 | $var=(des_cblock *)SvPV($arg,len); | ||
13 | if (len < DES_KEY_SZ) | ||
14 | { | ||
15 | croak(\"$var needs to be at least %u bytes long\",DES_KEY_SZ); | ||
16 | } | ||
17 | |||
18 | T_SCHEDULE | ||
19 | $var=(des_key_schedule *)SvPV($arg,len); | ||
20 | if (len < DES_SCHEDULE_SZ) | ||
21 | { | ||
22 | croak(\"$var needs to be at least %u bytes long\", | ||
23 | DES_SCHEDULE_SZ); | ||
24 | } | ||
25 | |||
26 | OUTPUT | ||
27 | T_CBLOCK | ||
28 | sv_setpvn($arg,(char *)$var,DES_KEY_SZ); | ||
29 | |||
30 | T_SCHEDULE | ||
31 | sv_setpvn($arg,(char *)$var,DES_SCHEDULE_SZ); | ||
32 | |||
33 | T_DESCHARP | ||
34 | sv_setpvn($arg,(char *)$var,len); | ||
diff --git a/src/lib/libssl/src/crypto/des/DES.pm b/src/lib/libssl/src/crypto/des/DES.pm deleted file mode 100644 index 6a175b6ca4..0000000000 --- a/src/lib/libssl/src/crypto/des/DES.pm +++ /dev/null | |||
@@ -1,19 +0,0 @@ | |||
1 | package DES; | ||
2 | |||
3 | require Exporter; | ||
4 | require DynaLoader; | ||
5 | @ISA = qw(Exporter DynaLoader); | ||
6 | # Items to export into callers namespace by default | ||
7 | # (move infrequently used names to @EXPORT_OK below) | ||
8 | @EXPORT = qw( | ||
9 | ); | ||
10 | # Other items we are prepared to export if requested | ||
11 | @EXPORT_OK = qw( | ||
12 | crypt | ||
13 | ); | ||
14 | |||
15 | # Preloaded methods go here. Autoload methods go after __END__, and are | ||
16 | # processed by the autosplit program. | ||
17 | bootstrap DES; | ||
18 | 1; | ||
19 | __END__ | ||
diff --git a/src/lib/libssl/src/crypto/des/DES.xs b/src/lib/libssl/src/crypto/des/DES.xs deleted file mode 100644 index b8050b9edf..0000000000 --- a/src/lib/libssl/src/crypto/des/DES.xs +++ /dev/null | |||
@@ -1,268 +0,0 @@ | |||
1 | #include "EXTERN.h" | ||
2 | #include "perl.h" | ||
3 | #include "XSUB.h" | ||
4 | #include "des.h" | ||
5 | |||
6 | #define deschar char | ||
7 | static STRLEN len; | ||
8 | |||
9 | static int | ||
10 | not_here(s) | ||
11 | char *s; | ||
12 | { | ||
13 | croak("%s not implemented on this architecture", s); | ||
14 | return -1; | ||
15 | } | ||
16 | |||
17 | MODULE = DES PACKAGE = DES PREFIX = des_ | ||
18 | |||
19 | char * | ||
20 | des_crypt(buf,salt) | ||
21 | char * buf | ||
22 | char * salt | ||
23 | |||
24 | void | ||
25 | des_set_odd_parity(key) | ||
26 | des_cblock * key | ||
27 | PPCODE: | ||
28 | { | ||
29 | SV *s; | ||
30 | |||
31 | s=sv_newmortal(); | ||
32 | sv_setpvn(s,(char *)key,8); | ||
33 | des_set_odd_parity((des_cblock *)SvPV(s,na)); | ||
34 | PUSHs(s); | ||
35 | } | ||
36 | |||
37 | int | ||
38 | des_is_weak_key(key) | ||
39 | des_cblock * key | ||
40 | |||
41 | des_key_schedule | ||
42 | des_set_key(key) | ||
43 | des_cblock * key | ||
44 | CODE: | ||
45 | des_set_key(key,RETVAL); | ||
46 | OUTPUT: | ||
47 | RETVAL | ||
48 | |||
49 | des_cblock | ||
50 | des_ecb_encrypt(input,ks,encrypt) | ||
51 | des_cblock * input | ||
52 | des_key_schedule * ks | ||
53 | int encrypt | ||
54 | CODE: | ||
55 | des_ecb_encrypt(input,&RETVAL,*ks,encrypt); | ||
56 | OUTPUT: | ||
57 | RETVAL | ||
58 | |||
59 | void | ||
60 | des_cbc_encrypt(input,ks,ivec,encrypt) | ||
61 | char * input | ||
62 | des_key_schedule * ks | ||
63 | des_cblock * ivec | ||
64 | int encrypt | ||
65 | PPCODE: | ||
66 | { | ||
67 | SV *s; | ||
68 | STRLEN len,l; | ||
69 | char *c; | ||
70 | |||
71 | l=SvCUR(ST(0)); | ||
72 | len=((((unsigned long)l)+7)/8)*8; | ||
73 | s=sv_newmortal(); | ||
74 | sv_setpvn(s,"",0); | ||
75 | SvGROW(s,len); | ||
76 | SvCUR_set(s,len); | ||
77 | c=(char *)SvPV(s,na); | ||
78 | des_cbc_encrypt((des_cblock *)input,(des_cblock *)c, | ||
79 | l,*ks,ivec,encrypt); | ||
80 | sv_setpvn(ST(2),(char *)c[len-8],8); | ||
81 | PUSHs(s); | ||
82 | } | ||
83 | |||
84 | void | ||
85 | des_cbc3_encrypt(input,ks1,ks2,ivec1,ivec2,encrypt) | ||
86 | char * input | ||
87 | des_key_schedule * ks1 | ||
88 | des_key_schedule * ks2 | ||
89 | des_cblock * ivec1 | ||
90 | des_cblock * ivec2 | ||
91 | int encrypt | ||
92 | PPCODE: | ||
93 | { | ||
94 | SV *s; | ||
95 | STRLEN len,l; | ||
96 | |||
97 | l=SvCUR(ST(0)); | ||
98 | len=((((unsigned long)l)+7)/8)*8; | ||
99 | s=sv_newmortal(); | ||
100 | sv_setpvn(s,"",0); | ||
101 | SvGROW(s,len); | ||
102 | SvCUR_set(s,len); | ||
103 | des_3cbc_encrypt((des_cblock *)input,(des_cblock *)SvPV(s,na), | ||
104 | l,*ks1,*ks2,ivec1,ivec2,encrypt); | ||
105 | sv_setpvn(ST(3),(char *)ivec1,8); | ||
106 | sv_setpvn(ST(4),(char *)ivec2,8); | ||
107 | PUSHs(s); | ||
108 | } | ||
109 | |||
110 | void | ||
111 | des_cbc_cksum(input,ks,ivec) | ||
112 | char * input | ||
113 | des_key_schedule * ks | ||
114 | des_cblock * ivec | ||
115 | PPCODE: | ||
116 | { | ||
117 | SV *s1,*s2; | ||
118 | STRLEN len,l; | ||
119 | des_cblock c; | ||
120 | unsigned long i1,i2; | ||
121 | |||
122 | s1=sv_newmortal(); | ||
123 | s2=sv_newmortal(); | ||
124 | l=SvCUR(ST(0)); | ||
125 | des_cbc_cksum((des_cblock *)input,(des_cblock *)c, | ||
126 | l,*ks,ivec); | ||
127 | i1=c[4]|(c[5]<<8)|(c[6]<<16)|(c[7]<<24); | ||
128 | i2=c[0]|(c[1]<<8)|(c[2]<<16)|(c[3]<<24); | ||
129 | sv_setiv(s1,i1); | ||
130 | sv_setiv(s2,i2); | ||
131 | sv_setpvn(ST(2),(char *)c,8); | ||
132 | PUSHs(s1); | ||
133 | PUSHs(s2); | ||
134 | } | ||
135 | |||
136 | void | ||
137 | des_cfb_encrypt(input,numbits,ks,ivec,encrypt) | ||
138 | char * input | ||
139 | int numbits | ||
140 | des_key_schedule * ks | ||
141 | des_cblock * ivec | ||
142 | int encrypt | ||
143 | PPCODE: | ||
144 | { | ||
145 | SV *s; | ||
146 | STRLEN len; | ||
147 | char *c; | ||
148 | |||
149 | len=SvCUR(ST(0)); | ||
150 | s=sv_newmortal(); | ||
151 | sv_setpvn(s,"",0); | ||
152 | SvGROW(s,len); | ||
153 | SvCUR_set(s,len); | ||
154 | c=(char *)SvPV(s,na); | ||
155 | des_cfb_encrypt((unsigned char *)input,(unsigned char *)c, | ||
156 | (int)numbits,(long)len,*ks,ivec,encrypt); | ||
157 | sv_setpvn(ST(3),(char *)ivec,8); | ||
158 | PUSHs(s); | ||
159 | } | ||
160 | |||
161 | des_cblock * | ||
162 | des_ecb3_encrypt(input,ks1,ks2,encrypt) | ||
163 | des_cblock * input | ||
164 | des_key_schedule * ks1 | ||
165 | des_key_schedule * ks2 | ||
166 | int encrypt | ||
167 | CODE: | ||
168 | { | ||
169 | des_cblock c; | ||
170 | |||
171 | des_ecb3_encrypt((des_cblock *)input,(des_cblock *)&c, | ||
172 | *ks1,*ks2,encrypt); | ||
173 | RETVAL= &c; | ||
174 | } | ||
175 | OUTPUT: | ||
176 | RETVAL | ||
177 | |||
178 | void | ||
179 | des_ofb_encrypt(input,numbits,ks,ivec) | ||
180 | unsigned char * input | ||
181 | int numbits | ||
182 | des_key_schedule * ks | ||
183 | des_cblock * ivec | ||
184 | PPCODE: | ||
185 | { | ||
186 | SV *s; | ||
187 | STRLEN len,l; | ||
188 | unsigned char *c; | ||
189 | |||
190 | len=SvCUR(ST(0)); | ||
191 | s=sv_newmortal(); | ||
192 | sv_setpvn(s,"",0); | ||
193 | SvGROW(s,len); | ||
194 | SvCUR_set(s,len); | ||
195 | c=(unsigned char *)SvPV(s,na); | ||
196 | des_ofb_encrypt((unsigned char *)input,(unsigned char *)c, | ||
197 | numbits,len,*ks,ivec); | ||
198 | sv_setpvn(ST(3),(char *)ivec,8); | ||
199 | PUSHs(s); | ||
200 | } | ||
201 | |||
202 | void | ||
203 | des_pcbc_encrypt(input,ks,ivec,encrypt) | ||
204 | char * input | ||
205 | des_key_schedule * ks | ||
206 | des_cblock * ivec | ||
207 | int encrypt | ||
208 | PPCODE: | ||
209 | { | ||
210 | SV *s; | ||
211 | STRLEN len,l; | ||
212 | char *c; | ||
213 | |||
214 | l=SvCUR(ST(0)); | ||
215 | len=((((unsigned long)l)+7)/8)*8; | ||
216 | s=sv_newmortal(); | ||
217 | sv_setpvn(s,"",0); | ||
218 | SvGROW(s,len); | ||
219 | SvCUR_set(s,len); | ||
220 | c=(char *)SvPV(s,na); | ||
221 | des_pcbc_encrypt((des_cblock *)input,(des_cblock *)c, | ||
222 | l,*ks,ivec,encrypt); | ||
223 | sv_setpvn(ST(2),(char *)c[len-8],8); | ||
224 | PUSHs(s); | ||
225 | } | ||
226 | |||
227 | des_cblock * | ||
228 | des_random_key() | ||
229 | CODE: | ||
230 | { | ||
231 | des_cblock c; | ||
232 | |||
233 | des_random_key(c); | ||
234 | RETVAL=&c; | ||
235 | } | ||
236 | OUTPUT: | ||
237 | RETVAL | ||
238 | |||
239 | des_cblock * | ||
240 | des_string_to_key(str) | ||
241 | char * str | ||
242 | CODE: | ||
243 | { | ||
244 | des_cblock c; | ||
245 | |||
246 | des_string_to_key(str,&c); | ||
247 | RETVAL=&c; | ||
248 | } | ||
249 | OUTPUT: | ||
250 | RETVAL | ||
251 | |||
252 | void | ||
253 | des_string_to_2keys(str) | ||
254 | char * str | ||
255 | PPCODE: | ||
256 | { | ||
257 | des_cblock c1,c2; | ||
258 | SV *s1,*s2; | ||
259 | |||
260 | des_string_to_2keys(str,&c1,&c2); | ||
261 | EXTEND(sp,2); | ||
262 | s1=sv_newmortal(); | ||
263 | sv_setpvn(s1,(char *)c1,8); | ||
264 | s2=sv_newmortal(); | ||
265 | sv_setpvn(s2,(char *)c2,8); | ||
266 | PUSHs(s1); | ||
267 | PUSHs(s2); | ||
268 | } | ||
diff --git a/src/lib/libssl/src/crypto/des/FILES0 b/src/lib/libssl/src/crypto/des/FILES0 index 4c7ea2de7a..2e8211ad2a 100644 --- a/src/lib/libssl/src/crypto/des/FILES0 +++ b/src/lib/libssl/src/crypto/des/FILES0 | |||
@@ -1,31 +1,10 @@ | |||
1 | /* General stuff */ | 1 | /* General stuff */ |
2 | COPYRIGHT - Copyright info. | 2 | COPYRIGHT - Copyright info. |
3 | MODES.DES - A description of the features of the different modes of DES. | ||
4 | FILES - This file. | 3 | FILES - This file. |
5 | INSTALL - How to make things compile. | ||
6 | Imakefile - For use with kerberos. | ||
7 | README - What this package is. | 4 | README - What this package is. |
8 | VERSION - Which version this is and what was changed. | 5 | VERSION - Which version this is and what was changed. |
9 | KERBEROS - Kerberos version 4 notes. | ||
10 | Makefile.PL - An old makefile to build with perl5, not current. | ||
11 | Makefile.ssl - The SSLeay makefile | ||
12 | Makefile.uni - The normal unix makefile. | ||
13 | GNUmakefile - The makefile for use with glibc. | ||
14 | makefile.bc - A Borland C makefile | ||
15 | times - Some outputs from 'speed' on some machines. | ||
16 | vms.com - For use when compiling under VMS | ||
17 | |||
18 | /* My SunOS des(1) replacement */ | ||
19 | des.c - des(1) source code. | ||
20 | des.man - des(1) manual. | ||
21 | |||
22 | /* Testing and timing programs. */ | ||
23 | destest.c - Source for libdes.a test program. | ||
24 | speed.c - Source for libdes.a timing program. | ||
25 | rpw.c - Source for libdes.a testing password reading routines. | ||
26 | 6 | ||
27 | /* libdes.a source code */ | 7 | /* libdes.a source code */ |
28 | des_crypt.man - libdes.a manual page. | ||
29 | des.h - Public libdes.a header file. | 8 | des.h - Public libdes.a header file. |
30 | ecb_enc.c - des_ecb_encrypt() source, this contains the basic DES code. | 9 | ecb_enc.c - des_ecb_encrypt() source, this contains the basic DES code. |
31 | ecb3_enc.c - des_ecb3_encrypt() source. | 10 | ecb3_enc.c - des_ecb3_encrypt() source. |
@@ -62,35 +41,4 @@ des_ver.h - header file for the external definition of the | |||
62 | version string. | 41 | version string. |
63 | des.doc - SSLeay documentation for the library. | 42 | des.doc - SSLeay documentation for the library. |
64 | 43 | ||
65 | /* The perl scripts - you can ignore these files they are only | ||
66 | * included for the curious */ | ||
67 | des.pl - des in perl anyone? des_set_key and des_ecb_encrypt | ||
68 | both done in a perl library. | ||
69 | testdes.pl - Testing program for des.pl | ||
70 | doIP - Perl script used to develop IP xor/shift code. | ||
71 | doPC1 - Perl script used to develop PC1 xor/shift code. | ||
72 | doPC2 - Generates sk.h. | ||
73 | PC1 - Output of doPC1 should be the same as output from PC1. | ||
74 | PC2 - used in development of doPC2. | ||
75 | shifts.pl - Perl library used by my perl scripts. | ||
76 | |||
77 | /* I started making a perl5 dynamic library for libdes | ||
78 | * but did not fully finish, these files are part of that effort. */ | ||
79 | DES.pm | ||
80 | DES.pod | ||
81 | DES.xs | ||
82 | t | ||
83 | typemap | ||
84 | |||
85 | /* The following are for use with sun RPC implementaions. */ | ||
86 | rpc_des.h | ||
87 | rpc_enc.c | ||
88 | |||
89 | /* The following are contibuted by Mark Murray <mark@grondar.za>. They | ||
90 | * are not normally built into libdes due to machine specific routines | ||
91 | * contained in them. They are for use in the most recent incarnation of | ||
92 | * export kerberos v 4 (eBones). */ | ||
93 | supp.c | ||
94 | new_rkey.c | ||
95 | |||
96 | 44 | ||
diff --git a/src/lib/libssl/src/crypto/des/INSTALL b/src/lib/libssl/src/crypto/des/INSTALL deleted file mode 100644 index 8aebdfe110..0000000000 --- a/src/lib/libssl/src/crypto/des/INSTALL +++ /dev/null | |||
@@ -1,69 +0,0 @@ | |||
1 | Check the CC and CFLAGS lines in the makefile | ||
2 | |||
3 | If your C library does not support the times(3) function, change the | ||
4 | #define TIMES to | ||
5 | #undef TIMES in speed.c | ||
6 | If it does, check the HZ value for the times(3) function. | ||
7 | If your system does not define CLK_TCK it will be assumed to | ||
8 | be 100.0. | ||
9 | |||
10 | If possible use gcc v 2.7.? | ||
11 | Turn on the maximum optimising (normally '-O3 -fomit-frame-pointer' for gcc) | ||
12 | In recent times, some system compilers give better performace. | ||
13 | |||
14 | type 'make' | ||
15 | |||
16 | run './destest' to check things are ok. | ||
17 | run './rpw' to check the tty code for reading passwords works. | ||
18 | run './speed' to see how fast those optimisations make the library run :-) | ||
19 | run './des_opts' to determin the best compile time options. | ||
20 | |||
21 | The output from des_opts should be put in the makefile options and des_enc.c | ||
22 | should be rebuilt. For 64 bit computers, do not use the DES_PTR option. | ||
23 | For the DEC Alpha, edit des.h and change DES_LONG to 'unsigned int' | ||
24 | and then you can use the 'DES_PTR' option. | ||
25 | |||
26 | The file options.txt has the options listed for best speed on quite a | ||
27 | few systems. Look and the options (UNROLL, PTR, RISC2 etc) and then | ||
28 | turn on the relevant option in the Makefile. | ||
29 | |||
30 | There are some special Makefile targets that make life easier. | ||
31 | make cc - standard cc build | ||
32 | make gcc - standard gcc build | ||
33 | make x86-elf - x86 assembler (elf), linux-elf. | ||
34 | make x86-out - x86 assembler (a.out), FreeBSD | ||
35 | make x86-solaris- x86 assembler | ||
36 | make x86-bsdi - x86 assembler (a.out with primative assembler). | ||
37 | |||
38 | If at all possible use the assembler (for Windows NT/95, use | ||
39 | asm/win32.obj to link with). The x86 assembler is very very fast. | ||
40 | |||
41 | A make install will by default install | ||
42 | libdes.a in /usr/local/lib/libdes.a | ||
43 | des in /usr/local/bin/des | ||
44 | des_crypt.man in /usr/local/man/man3/des_crypt.3 | ||
45 | des.man in /usr/local/man/man1/des.1 | ||
46 | des.h in /usr/include/des.h | ||
47 | |||
48 | des(1) should be compatible with sunOS's but I have been unable to | ||
49 | test it. | ||
50 | |||
51 | These routines should compile on MSDOS, most 32bit and 64bit version | ||
52 | of Unix (BSD and SYSV) and VMS, without modification. | ||
53 | The only problems should be #include files that are in the wrong places. | ||
54 | |||
55 | These routines can be compiled under MSDOS. | ||
56 | I have successfully encrypted files using des(1) under MSDOS and then | ||
57 | decrypted the files on a SparcStation. | ||
58 | I have been able to compile and test the routines with | ||
59 | Microsoft C v 5.1 and Turbo C v 2.0. | ||
60 | The code in this library is in no way optimised for the 16bit | ||
61 | operation of MSDOS. | ||
62 | |||
63 | When building for glibc, ignore all of the above and just unpack into | ||
64 | glibc-1.??/des and then gmake as per normal. | ||
65 | |||
66 | As a final note on performace. Certain CPUs like sparcs and Alpha often give | ||
67 | a %10 speed difference depending on the link order. It is rather anoying | ||
68 | when one program reports 'x' DES encrypts a second and another reports | ||
69 | 'x*0.9' the speed. | ||
diff --git a/src/lib/libssl/src/crypto/des/KERBEROS b/src/lib/libssl/src/crypto/des/KERBEROS deleted file mode 100644 index f401b10014..0000000000 --- a/src/lib/libssl/src/crypto/des/KERBEROS +++ /dev/null | |||
@@ -1,41 +0,0 @@ | |||
1 | [ This is an old file, I don't know if it is true anymore | ||
2 | but I will leave the file here - eay 21/11/95 ] | ||
3 | |||
4 | To use this library with Bones (kerberos without DES): | ||
5 | 1) Get my modified Bones - eBones. It can be found on | ||
6 | gondwana.ecr.mu.oz.au (128.250.1.63) /pub/athena/eBones-p9.tar.Z | ||
7 | and | ||
8 | nic.funet.fi (128.214.6.100) /pub/unix/security/Kerberos/eBones-p9.tar.Z | ||
9 | |||
10 | 2) Unpack this library in src/lib/des, makeing sure it is version | ||
11 | 3.00 or greater (libdes.tar.93-10-07.Z). This versions differences | ||
12 | from the version in comp.sources.misc volume 29 patchlevel2. | ||
13 | The primarily difference is that it should compile under kerberos :-). | ||
14 | It can be found at. | ||
15 | ftp.psy.uq.oz.au (130.102.32.1) /pub/DES/libdes.tar.93-10-07.Z | ||
16 | |||
17 | Now do a normal kerberos build and things should work. | ||
18 | |||
19 | One problem I found when I was build on my local sun. | ||
20 | --- | ||
21 | For sunOS 4.1.1 apply the following patch to src/util/ss/make_commands.c | ||
22 | |||
23 | *** make_commands.c.orig Fri Jul 3 04:18:35 1987 | ||
24 | --- make_commands.c Wed May 20 08:47:42 1992 | ||
25 | *************** | ||
26 | *** 98,104 **** | ||
27 | if (!rename(o_file, z_file)) { | ||
28 | if (!vfork()) { | ||
29 | chdir("/tmp"); | ||
30 | ! execl("/bin/ld", "ld", "-o", o_file+5, "-s", "-r", "-n", | ||
31 | z_file+5, 0); | ||
32 | perror("/bin/ld"); | ||
33 | _exit(1); | ||
34 | --- 98,104 ---- | ||
35 | if (!rename(o_file, z_file)) { | ||
36 | if (!vfork()) { | ||
37 | chdir("/tmp"); | ||
38 | ! execl("/bin/ld", "ld", "-o", o_file+5, "-s", "-r", | ||
39 | z_file+5, 0); | ||
40 | perror("/bin/ld"); | ||
41 | _exit(1); | ||
diff --git a/src/lib/libssl/src/crypto/des/des.pod b/src/lib/libssl/src/crypto/des/des.pod deleted file mode 100644 index bf479e83d2..0000000000 --- a/src/lib/libssl/src/crypto/des/des.pod +++ /dev/null | |||
@@ -1,217 +0,0 @@ | |||
1 | =pod | ||
2 | |||
3 | =head1 NAME | ||
4 | |||
5 | des - encrypt or decrypt data using Data Encryption Standard | ||
6 | |||
7 | =head1 SYNOPSIS | ||
8 | |||
9 | B<des> | ||
10 | ( | ||
11 | B<-e> | ||
12 | | | ||
13 | B<-E> | ||
14 | ) | ( | ||
15 | B<-d> | ||
16 | | | ||
17 | B<-D> | ||
18 | ) | ( | ||
19 | B<->[B<cC>][B<ckname>] | ||
20 | ) | | ||
21 | [ | ||
22 | B<-b3hfs> | ||
23 | ] [ | ||
24 | B<-k> | ||
25 | I<key> | ||
26 | ] | ||
27 | ] [ | ||
28 | B<-u>[I<uuname>] | ||
29 | [ | ||
30 | I<input-file> | ||
31 | [ | ||
32 | I<output-file> | ||
33 | ] ] | ||
34 | |||
35 | =head1 NOTE | ||
36 | |||
37 | This page describes the B<des> stand-alone program, not the B<openssl des> | ||
38 | command. | ||
39 | |||
40 | =head1 DESCRIPTION | ||
41 | |||
42 | B<des> | ||
43 | encrypts and decrypts data using the | ||
44 | Data Encryption Standard algorithm. | ||
45 | One of | ||
46 | B<-e>, B<-E> | ||
47 | (for encrypt) or | ||
48 | B<-d>, B<-D> | ||
49 | (for decrypt) must be specified. | ||
50 | It is also possible to use | ||
51 | B<-c> | ||
52 | or | ||
53 | B<-C> | ||
54 | in conjunction or instead of the a encrypt/decrypt option to generate | ||
55 | a 16 character hexadecimal checksum, generated via the | ||
56 | I<des_cbc_cksum>. | ||
57 | |||
58 | Two standard encryption modes are supported by the | ||
59 | B<des> | ||
60 | program, Cipher Block Chaining (the default) and Electronic Code Book | ||
61 | (specified with | ||
62 | B<-b>). | ||
63 | |||
64 | The key used for the DES | ||
65 | algorithm is obtained by prompting the user unless the | ||
66 | B<-k> | ||
67 | I<key> | ||
68 | option is given. | ||
69 | If the key is an argument to the | ||
70 | B<des> | ||
71 | command, it is potentially visible to users executing | ||
72 | ps(1) | ||
73 | or a derivative. To minimise this possibility, | ||
74 | B<des> | ||
75 | takes care to destroy the key argument immediately upon entry. | ||
76 | If your shell keeps a history file be careful to make sure it is not | ||
77 | world readable. | ||
78 | |||
79 | Since this program attempts to maintain compatibility with sunOS's | ||
80 | des(1) command, there are 2 different methods used to convert the user | ||
81 | supplied key to a des key. | ||
82 | Whenever and one or more of | ||
83 | B<-E>, B<-D>, B<-C> | ||
84 | or | ||
85 | B<-3> | ||
86 | options are used, the key conversion procedure will not be compatible | ||
87 | with the sunOS des(1) version but will use all the user supplied | ||
88 | character to generate the des key. | ||
89 | B<des> | ||
90 | command reads from standard input unless | ||
91 | I<input-file> | ||
92 | is specified and writes to standard output unless | ||
93 | I<output-file> | ||
94 | is given. | ||
95 | |||
96 | =head1 OPTIONS | ||
97 | |||
98 | =over 4 | ||
99 | |||
100 | =item B<-b> | ||
101 | |||
102 | Select ECB | ||
103 | (eight bytes at a time) encryption mode. | ||
104 | |||
105 | =item B<-3> | ||
106 | |||
107 | Encrypt using triple encryption. | ||
108 | By default triple cbc encryption is used but if the | ||
109 | B<-b> | ||
110 | option is used then triple ECB encryption is performed. | ||
111 | If the key is less than 8 characters long, the flag has no effect. | ||
112 | |||
113 | =item B<-e> | ||
114 | |||
115 | Encrypt data using an 8 byte key in a manner compatible with sunOS | ||
116 | des(1). | ||
117 | |||
118 | =item B<-E> | ||
119 | |||
120 | Encrypt data using a key of nearly unlimited length (1024 bytes). | ||
121 | This will product a more secure encryption. | ||
122 | |||
123 | =item B<-d> | ||
124 | |||
125 | Decrypt data that was encrypted with the B<-e> option. | ||
126 | |||
127 | =item B<-D> | ||
128 | |||
129 | Decrypt data that was encrypted with the B<-E> option. | ||
130 | |||
131 | =item B<-c> | ||
132 | |||
133 | Generate a 16 character hexadecimal cbc checksum and output this to | ||
134 | stderr. | ||
135 | If a filename was specified after the | ||
136 | B<-c> | ||
137 | option, the checksum is output to that file. | ||
138 | The checksum is generated using a key generated in a sunOS compatible | ||
139 | manner. | ||
140 | |||
141 | =item B<-C> | ||
142 | |||
143 | A cbc checksum is generated in the same manner as described for the | ||
144 | B<-c> | ||
145 | option but the DES key is generated in the same manner as used for the | ||
146 | B<-E> | ||
147 | and | ||
148 | B<-D> | ||
149 | options | ||
150 | |||
151 | =item B<-f> | ||
152 | |||
153 | Does nothing - allowed for compatibility with sunOS des(1) command. | ||
154 | |||
155 | =item B<-s> | ||
156 | |||
157 | Does nothing - allowed for compatibility with sunOS des(1) command. | ||
158 | |||
159 | =item B<-k> I<key> | ||
160 | |||
161 | Use the encryption | ||
162 | I<key> | ||
163 | specified. | ||
164 | |||
165 | =item B<-h> | ||
166 | |||
167 | The | ||
168 | I<key> | ||
169 | is assumed to be a 16 character hexadecimal number. | ||
170 | If the | ||
171 | B<-3> | ||
172 | option is used the key is assumed to be a 32 character hexadecimal | ||
173 | number. | ||
174 | |||
175 | =item B<-u> | ||
176 | |||
177 | This flag is used to read and write uuencoded files. If decrypting, | ||
178 | the input file is assumed to contain uuencoded, DES encrypted data. | ||
179 | If encrypting, the characters following the B<-u> are used as the name of | ||
180 | the uuencoded file to embed in the begin line of the uuencoded | ||
181 | output. If there is no name specified after the B<-u>, the name text.des | ||
182 | will be embedded in the header. | ||
183 | |||
184 | =head1 SEE ALSO | ||
185 | |||
186 | ps(1), | ||
187 | L<des_crypt(3)|des_crypt(3)> | ||
188 | |||
189 | =head1 BUGS | ||
190 | |||
191 | The problem with using the | ||
192 | B<-e> | ||
193 | option is the short key length. | ||
194 | It would be better to use a real 56-bit key rather than an | ||
195 | ASCII-based 56-bit pattern. Knowing that the key was derived from ASCII | ||
196 | radically reduces the time necessary for a brute-force cryptographic attack. | ||
197 | My attempt to remove this problem is to add an alternative text-key to | ||
198 | DES-key function. This alternative function (accessed via | ||
199 | B<-E>, B<-D>, B<-S> | ||
200 | and | ||
201 | B<-3>) | ||
202 | uses DES to help generate the key. | ||
203 | |||
204 | Be carefully when using the B<-u> option. Doing B<des -ud> I<filename> will | ||
205 | not decrypt filename (the B<-u> option will gobble the B<-d> option). | ||
206 | |||
207 | The VMS operating system operates in a world where files are always a | ||
208 | multiple of 512 bytes. This causes problems when encrypted data is | ||
209 | send from Unix to VMS since a 88 byte file will suddenly be padded | ||
210 | with 424 null bytes. To get around this problem, use the B<-u> option | ||
211 | to uuencode the data before it is send to the VMS system. | ||
212 | |||
213 | =head1 AUTHOR | ||
214 | |||
215 | Eric Young (eay@cryptsoft.com) | ||
216 | |||
217 | =cut | ||
diff --git a/src/lib/libssl/src/crypto/des/makefile.bc b/src/lib/libssl/src/crypto/des/makefile.bc deleted file mode 100644 index 1fe6d4915a..0000000000 --- a/src/lib/libssl/src/crypto/des/makefile.bc +++ /dev/null | |||
@@ -1,50 +0,0 @@ | |||
1 | # | ||
2 | # Origional BC Makefile from Teun <Teun.Nijssen@kub.nl> | ||
3 | # | ||
4 | # | ||
5 | CC = bcc | ||
6 | TLIB = tlib /0 /C | ||
7 | # note: the -3 flag produces code for 386, 486, Pentium etc; omit it for 286s | ||
8 | OPTIMIZE= -3 -O2 | ||
9 | #WINDOWS= -W | ||
10 | CFLAGS = -c -ml -d $(OPTIMIZE) $(WINDOWS) -DMSDOS | ||
11 | LFLAGS = -ml $(WINDOWS) | ||
12 | |||
13 | .c.obj: | ||
14 | $(CC) $(CFLAGS) $*.c | ||
15 | |||
16 | .obj.exe: | ||
17 | $(CC) $(LFLAGS) -e$*.exe $*.obj libdes.lib | ||
18 | |||
19 | all: $(LIB) destest.exe rpw.exe des.exe speed.exe | ||
20 | |||
21 | # "make clean": use a directory containing only libdes .exe and .obj files... | ||
22 | clean: | ||
23 | del *.exe | ||
24 | del *.obj | ||
25 | del libdes.lib | ||
26 | del libdes.rsp | ||
27 | |||
28 | OBJS= cbc_cksm.obj cbc_enc.obj ecb_enc.obj pcbc_enc.obj \ | ||
29 | qud_cksm.obj rand_key.obj set_key.obj str2key.obj \ | ||
30 | enc_read.obj enc_writ.obj fcrypt.obj cfb_enc.obj \ | ||
31 | ecb3_enc.obj ofb_enc.obj cbc3_enc.obj read_pwd.obj\ | ||
32 | cfb64enc.obj ofb64enc.obj ede_enc.obj cfb64ede.obj\ | ||
33 | ofb64ede.obj supp.obj | ||
34 | |||
35 | LIB= libdes.lib | ||
36 | |||
37 | $(LIB): $(OBJS) | ||
38 | del $(LIB) | ||
39 | makersp "+%s &\n" &&| | ||
40 | $(OBJS) | ||
41 | | >libdes.rsp | ||
42 | $(TLIB) libdes.lib @libdes.rsp,nul | ||
43 | del libdes.rsp | ||
44 | |||
45 | destest.exe: destest.obj libdes.lib | ||
46 | rpw.exe: rpw.obj libdes.lib | ||
47 | speed.exe: speed.obj libdes.lib | ||
48 | des.exe: des.obj libdes.lib | ||
49 | |||
50 | |||
diff --git a/src/lib/libssl/src/crypto/des/rpw.c b/src/lib/libssl/src/crypto/des/rpw.c deleted file mode 100644 index 8a9473c4f9..0000000000 --- a/src/lib/libssl/src/crypto/des/rpw.c +++ /dev/null | |||
@@ -1,99 +0,0 @@ | |||
1 | /* crypto/des/rpw.c */ | ||
2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | ||
3 | * All rights reserved. | ||
4 | * | ||
5 | * This package is an SSL implementation written | ||
6 | * by Eric Young (eay@cryptsoft.com). | ||
7 | * The implementation was written so as to conform with Netscapes SSL. | ||
8 | * | ||
9 | * This library is free for commercial and non-commercial use as long as | ||
10 | * the following conditions are aheared to. The following conditions | ||
11 | * apply to all code found in this distribution, be it the RC4, RSA, | ||
12 | * lhash, DES, etc., code; not just the SSL code. The SSL documentation | ||
13 | * included with this distribution is covered by the same copyright terms | ||
14 | * except that the holder is Tim Hudson (tjh@cryptsoft.com). | ||
15 | * | ||
16 | * Copyright remains Eric Young's, and as such any Copyright notices in | ||
17 | * the code are not to be removed. | ||
18 | * If this package is used in a product, Eric Young should be given attribution | ||
19 | * as the author of the parts of the library used. | ||
20 | * This can be in the form of a textual message at program startup or | ||
21 | * in documentation (online or textual) provided with the package. | ||
22 | * | ||
23 | * Redistribution and use in source and binary forms, with or without | ||
24 | * modification, are permitted provided that the following conditions | ||
25 | * are met: | ||
26 | * 1. Redistributions of source code must retain the copyright | ||
27 | * notice, this list of conditions and the following disclaimer. | ||
28 | * 2. Redistributions in binary form must reproduce the above copyright | ||
29 | * notice, this list of conditions and the following disclaimer in the | ||
30 | * documentation and/or other materials provided with the distribution. | ||
31 | * 3. All advertising materials mentioning features or use of this software | ||
32 | * must display the following acknowledgement: | ||
33 | * "This product includes cryptographic software written by | ||
34 | * Eric Young (eay@cryptsoft.com)" | ||
35 | * The word 'cryptographic' can be left out if the rouines from the library | ||
36 | * being used are not cryptographic related :-). | ||
37 | * 4. If you include any Windows specific code (or a derivative thereof) from | ||
38 | * the apps directory (application code) you must include an acknowledgement: | ||
39 | * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" | ||
40 | * | ||
41 | * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND | ||
42 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
43 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
44 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE | ||
45 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
46 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | ||
47 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
48 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||
49 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | ||
50 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | ||
51 | * SUCH DAMAGE. | ||
52 | * | ||
53 | * The licence and distribution terms for any publically available version or | ||
54 | * derivative of this code cannot be changed. i.e. this code cannot simply be | ||
55 | * copied and put under another distribution licence | ||
56 | * [including the GNU Public Licence.] | ||
57 | */ | ||
58 | |||
59 | #include <stdio.h> | ||
60 | #include <openssl/des.h> | ||
61 | |||
62 | int main(int argc, char *argv[]) | ||
63 | { | ||
64 | DES_cblock k,k1; | ||
65 | int i; | ||
66 | |||
67 | printf("read passwd\n"); | ||
68 | if ((i=des_read_password(&k,"Enter password:",0)) == 0) | ||
69 | { | ||
70 | printf("password = "); | ||
71 | for (i=0; i<8; i++) | ||
72 | printf("%02x ",k[i]); | ||
73 | } | ||
74 | else | ||
75 | printf("error %d\n",i); | ||
76 | printf("\n"); | ||
77 | printf("read 2passwds and verify\n"); | ||
78 | if ((i=des_read_2passwords(&k,&k1, | ||
79 | "Enter verified password:",1)) == 0) | ||
80 | { | ||
81 | printf("password1 = "); | ||
82 | for (i=0; i<8; i++) | ||
83 | printf("%02x ",k[i]); | ||
84 | printf("\n"); | ||
85 | printf("password2 = "); | ||
86 | for (i=0; i<8; i++) | ||
87 | printf("%02x ",k1[i]); | ||
88 | printf("\n"); | ||
89 | exit(1); | ||
90 | } | ||
91 | else | ||
92 | { | ||
93 | printf("error %d\n",i); | ||
94 | exit(0); | ||
95 | } | ||
96 | #ifdef LINT | ||
97 | return(0); | ||
98 | #endif | ||
99 | } | ||
diff --git a/src/lib/libssl/src/crypto/des/speed.c b/src/lib/libssl/src/crypto/des/speed.c deleted file mode 100644 index 2f52c1c40f..0000000000 --- a/src/lib/libssl/src/crypto/des/speed.c +++ /dev/null | |||
@@ -1,313 +0,0 @@ | |||
1 | /* crypto/des/speed.c */ | ||
2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | ||
3 | * All rights reserved. | ||
4 | * | ||
5 | * This package is an SSL implementation written | ||
6 | * by Eric Young (eay@cryptsoft.com). | ||
7 | * The implementation was written so as to conform with Netscapes SSL. | ||
8 | * | ||
9 | * This library is free for commercial and non-commercial use as long as | ||
10 | * the following conditions are aheared to. The following conditions | ||
11 | * apply to all code found in this distribution, be it the RC4, RSA, | ||
12 | * lhash, DES, etc., code; not just the SSL code. The SSL documentation | ||
13 | * included with this distribution is covered by the same copyright terms | ||
14 | * except that the holder is Tim Hudson (tjh@cryptsoft.com). | ||
15 | * | ||
16 | * Copyright remains Eric Young's, and as such any Copyright notices in | ||
17 | * the code are not to be removed. | ||
18 | * If this package is used in a product, Eric Young should be given attribution | ||
19 | * as the author of the parts of the library used. | ||
20 | * This can be in the form of a textual message at program startup or | ||
21 | * in documentation (online or textual) provided with the package. | ||
22 | * | ||
23 | * Redistribution and use in source and binary forms, with or without | ||
24 | * modification, are permitted provided that the following conditions | ||
25 | * are met: | ||
26 | * 1. Redistributions of source code must retain the copyright | ||
27 | * notice, this list of conditions and the following disclaimer. | ||
28 | * 2. Redistributions in binary form must reproduce the above copyright | ||
29 | * notice, this list of conditions and the following disclaimer in the | ||
30 | * documentation and/or other materials provided with the distribution. | ||
31 | * 3. All advertising materials mentioning features or use of this software | ||
32 | * must display the following acknowledgement: | ||
33 | * "This product includes cryptographic software written by | ||
34 | * Eric Young (eay@cryptsoft.com)" | ||
35 | * The word 'cryptographic' can be left out if the rouines from the library | ||
36 | * being used are not cryptographic related :-). | ||
37 | * 4. If you include any Windows specific code (or a derivative thereof) from | ||
38 | * the apps directory (application code) you must include an acknowledgement: | ||
39 | * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" | ||
40 | * | ||
41 | * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND | ||
42 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
43 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
44 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE | ||
45 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
46 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | ||
47 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
48 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||
49 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | ||
50 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | ||
51 | * SUCH DAMAGE. | ||
52 | * | ||
53 | * The licence and distribution terms for any publically available version or | ||
54 | * derivative of this code cannot be changed. i.e. this code cannot simply be | ||
55 | * copied and put under another distribution licence | ||
56 | * [including the GNU Public Licence.] | ||
57 | */ | ||
58 | |||
59 | /* 11-Sep-92 Andrew Daviel Support for Silicon Graphics IRIX added */ | ||
60 | /* 06-Apr-92 Luke Brennan Support for VMS and add extra signal calls */ | ||
61 | |||
62 | #if !defined(OPENSSL_SYS_MSDOS) && (!defined(OPENSSL_SYS_VMS) || defined(__DECC)) && !defined(OPENSSL_SYS_MACOSX) | ||
63 | #define TIMES | ||
64 | #endif | ||
65 | |||
66 | #include <stdio.h> | ||
67 | |||
68 | #include <openssl/e_os2.h> | ||
69 | #include <unistd.h> | ||
70 | |||
71 | #ifndef OPENSSL_SYS_NETWARE | ||
72 | #include <signal.h> | ||
73 | #define crypt(c,s) (des_crypt((c),(s))) | ||
74 | #endif | ||
75 | |||
76 | #ifndef _IRIX | ||
77 | #include <time.h> | ||
78 | #endif | ||
79 | #ifdef TIMES | ||
80 | #include <sys/types.h> | ||
81 | #include <sys/times.h> | ||
82 | #endif | ||
83 | |||
84 | /* Depending on the VMS version, the tms structure is perhaps defined. | ||
85 | The __TMS macro will show if it was. If it wasn't defined, we should | ||
86 | undefine TIMES, since that tells the rest of the program how things | ||
87 | should be handled. -- Richard Levitte */ | ||
88 | #if defined(OPENSSL_SYS_VMS_DECC) && !defined(__TMS) | ||
89 | #undef TIMES | ||
90 | #endif | ||
91 | |||
92 | #ifndef TIMES | ||
93 | #include <sys/timeb.h> | ||
94 | #endif | ||
95 | |||
96 | #if defined(sun) || defined(__ultrix) | ||
97 | #define _POSIX_SOURCE | ||
98 | #include <limits.h> | ||
99 | #include <sys/param.h> | ||
100 | #endif | ||
101 | |||
102 | #include <openssl/des.h> | ||
103 | |||
104 | /* The following if from times(3) man page. It may need to be changed */ | ||
105 | #ifndef HZ | ||
106 | # ifndef CLK_TCK | ||
107 | # ifndef _BSD_CLK_TCK_ /* FreeBSD fix */ | ||
108 | # define HZ 100.0 | ||
109 | # else /* _BSD_CLK_TCK_ */ | ||
110 | # define HZ ((double)_BSD_CLK_TCK_) | ||
111 | # endif | ||
112 | # else /* CLK_TCK */ | ||
113 | # define HZ ((double)CLK_TCK) | ||
114 | # endif | ||
115 | #endif | ||
116 | |||
117 | #define BUFSIZE ((long)1024) | ||
118 | long run=0; | ||
119 | |||
120 | double Time_F(int s); | ||
121 | #ifdef SIGALRM | ||
122 | #if defined(__STDC__) || defined(sgi) || defined(_AIX) | ||
123 | #define SIGRETTYPE void | ||
124 | #else | ||
125 | #define SIGRETTYPE int | ||
126 | #endif | ||
127 | |||
128 | SIGRETTYPE sig_done(int sig); | ||
129 | SIGRETTYPE sig_done(int sig) | ||
130 | { | ||
131 | signal(SIGALRM,sig_done); | ||
132 | run=0; | ||
133 | #ifdef LINT | ||
134 | sig=sig; | ||
135 | #endif | ||
136 | } | ||
137 | #endif | ||
138 | |||
139 | #define START 0 | ||
140 | #define STOP 1 | ||
141 | |||
142 | double Time_F(int s) | ||
143 | { | ||
144 | double ret; | ||
145 | #ifdef TIMES | ||
146 | static struct tms tstart,tend; | ||
147 | |||
148 | if (s == START) | ||
149 | { | ||
150 | times(&tstart); | ||
151 | return(0); | ||
152 | } | ||
153 | else | ||
154 | { | ||
155 | times(&tend); | ||
156 | ret=((double)(tend.tms_utime-tstart.tms_utime))/HZ; | ||
157 | return((ret == 0.0)?1e-6:ret); | ||
158 | } | ||
159 | #else /* !times() */ | ||
160 | static struct timeb tstart,tend; | ||
161 | long i; | ||
162 | |||
163 | if (s == START) | ||
164 | { | ||
165 | ftime(&tstart); | ||
166 | return(0); | ||
167 | } | ||
168 | else | ||
169 | { | ||
170 | ftime(&tend); | ||
171 | i=(long)tend.millitm-(long)tstart.millitm; | ||
172 | ret=((double)(tend.time-tstart.time))+((double)i)/1e3; | ||
173 | return((ret == 0.0)?1e-6:ret); | ||
174 | } | ||
175 | #endif | ||
176 | } | ||
177 | |||
178 | int main(int argc, char **argv) | ||
179 | { | ||
180 | long count; | ||
181 | static unsigned char buf[BUFSIZE]; | ||
182 | static DES_cblock key ={0x12,0x34,0x56,0x78,0x9a,0xbc,0xde,0xf0}; | ||
183 | static DES_cblock key2={0x34,0x56,0x78,0x9a,0xbc,0xde,0xf0,0x12}; | ||
184 | static DES_cblock key3={0x56,0x78,0x9a,0xbc,0xde,0xf0,0x12,0x34}; | ||
185 | DES_key_schedule sch,sch2,sch3; | ||
186 | double a,b,c,d,e; | ||
187 | #ifndef SIGALRM | ||
188 | long ca,cb,cc,cd,ce; | ||
189 | #endif | ||
190 | |||
191 | #ifndef TIMES | ||
192 | printf("To get the most accurate results, try to run this\n"); | ||
193 | printf("program when this computer is idle.\n"); | ||
194 | #endif | ||
195 | |||
196 | DES_set_key_unchecked(&key2,&sch2); | ||
197 | DES_set_key_unchecked(&key3,&sch3); | ||
198 | |||
199 | #ifndef SIGALRM | ||
200 | printf("First we calculate the approximate speed ...\n"); | ||
201 | DES_set_key_unchecked(&key,&sch); | ||
202 | count=10; | ||
203 | do { | ||
204 | long i; | ||
205 | DES_LONG data[2]; | ||
206 | |||
207 | count*=2; | ||
208 | Time_F(START); | ||
209 | for (i=count; i; i--) | ||
210 | DES_encrypt1(data,&sch,DES_ENCRYPT); | ||
211 | d=Time_F(STOP); | ||
212 | } while (d < 3.0); | ||
213 | ca=count; | ||
214 | cb=count*3; | ||
215 | cc=count*3*8/BUFSIZE+1; | ||
216 | cd=count*8/BUFSIZE+1; | ||
217 | ce=count/20+1; | ||
218 | printf("Doing set_key %ld times\n",ca); | ||
219 | #define COND(d) (count != (d)) | ||
220 | #define COUNT(d) (d) | ||
221 | #else | ||
222 | #define COND(c) (run) | ||
223 | #define COUNT(d) (count) | ||
224 | signal(SIGALRM,sig_done); | ||
225 | printf("Doing set_key for 10 seconds\n"); | ||
226 | alarm(10); | ||
227 | #endif | ||
228 | |||
229 | Time_F(START); | ||
230 | for (count=0,run=1; COND(ca); count++) | ||
231 | DES_set_key_unchecked(&key,&sch); | ||
232 | d=Time_F(STOP); | ||
233 | printf("%ld set_key's in %.2f seconds\n",count,d); | ||
234 | a=((double)COUNT(ca))/d; | ||
235 | |||
236 | #ifdef SIGALRM | ||
237 | printf("Doing DES_encrypt's for 10 seconds\n"); | ||
238 | alarm(10); | ||
239 | #else | ||
240 | printf("Doing DES_encrypt %ld times\n",cb); | ||
241 | #endif | ||
242 | Time_F(START); | ||
243 | for (count=0,run=1; COND(cb); count++) | ||
244 | { | ||
245 | DES_LONG data[2]; | ||
246 | |||
247 | DES_encrypt1(data,&sch,DES_ENCRYPT); | ||
248 | } | ||
249 | d=Time_F(STOP); | ||
250 | printf("%ld DES_encrypt's in %.2f second\n",count,d); | ||
251 | b=((double)COUNT(cb)*8)/d; | ||
252 | |||
253 | #ifdef SIGALRM | ||
254 | printf("Doing DES_cbc_encrypt on %ld byte blocks for 10 seconds\n", | ||
255 | BUFSIZE); | ||
256 | alarm(10); | ||
257 | #else | ||
258 | printf("Doing DES_cbc_encrypt %ld times on %ld byte blocks\n",cc, | ||
259 | BUFSIZE); | ||
260 | #endif | ||
261 | Time_F(START); | ||
262 | for (count=0,run=1; COND(cc); count++) | ||
263 | DES_ncbc_encrypt(buf,buf,BUFSIZE,&sch, | ||
264 | &key,DES_ENCRYPT); | ||
265 | d=Time_F(STOP); | ||
266 | printf("%ld DES_cbc_encrypt's of %ld byte blocks in %.2f second\n", | ||
267 | count,BUFSIZE,d); | ||
268 | c=((double)COUNT(cc)*BUFSIZE)/d; | ||
269 | |||
270 | #ifdef SIGALRM | ||
271 | printf("Doing DES_ede_cbc_encrypt on %ld byte blocks for 10 seconds\n", | ||
272 | BUFSIZE); | ||
273 | alarm(10); | ||
274 | #else | ||
275 | printf("Doing DES_ede_cbc_encrypt %ld times on %ld byte blocks\n",cd, | ||
276 | BUFSIZE); | ||
277 | #endif | ||
278 | Time_F(START); | ||
279 | for (count=0,run=1; COND(cd); count++) | ||
280 | DES_ede3_cbc_encrypt(buf,buf,BUFSIZE, | ||
281 | &sch, | ||
282 | &sch2, | ||
283 | &sch3, | ||
284 | &key, | ||
285 | DES_ENCRYPT); | ||
286 | d=Time_F(STOP); | ||
287 | printf("%ld DES_ede_cbc_encrypt's of %ld byte blocks in %.2f second\n", | ||
288 | count,BUFSIZE,d); | ||
289 | d=((double)COUNT(cd)*BUFSIZE)/d; | ||
290 | |||
291 | #ifdef SIGALRM | ||
292 | printf("Doing crypt for 10 seconds\n"); | ||
293 | alarm(10); | ||
294 | #else | ||
295 | printf("Doing crypt %ld times\n",ce); | ||
296 | #endif | ||
297 | Time_F(START); | ||
298 | for (count=0,run=1; COND(ce); count++) | ||
299 | crypt("testing1","ef"); | ||
300 | e=Time_F(STOP); | ||
301 | printf("%ld crypts in %.2f second\n",count,e); | ||
302 | e=((double)COUNT(ce))/e; | ||
303 | |||
304 | printf("set_key per sec = %12.2f (%9.3fuS)\n",a,1.0e6/a); | ||
305 | printf("DES raw ecb bytes per sec = %12.2f (%9.3fuS)\n",b,8.0e6/b); | ||
306 | printf("DES cbc bytes per sec = %12.2f (%9.3fuS)\n",c,8.0e6/c); | ||
307 | printf("DES ede cbc bytes per sec = %12.2f (%9.3fuS)\n",d,8.0e6/d); | ||
308 | printf("crypt per sec = %12.2f (%9.3fuS)\n",e,1.0e6/e); | ||
309 | exit(0); | ||
310 | #if defined(LINT) || defined(OPENSSL_SYS_MSDOS) | ||
311 | return(0); | ||
312 | #endif | ||
313 | } | ||
diff --git a/src/lib/libssl/src/crypto/des/t/test b/src/lib/libssl/src/crypto/des/t/test deleted file mode 100644 index 97acd0552e..0000000000 --- a/src/lib/libssl/src/crypto/des/t/test +++ /dev/null | |||
@@ -1,27 +0,0 @@ | |||
1 | #!./perl | ||
2 | |||
3 | BEGIN { push(@INC, qw(../../../lib ../../lib ../lib lib)); } | ||
4 | |||
5 | use DES; | ||
6 | |||
7 | $key='00000000'; | ||
8 | $ks=DES::set_key($key); | ||
9 | @a=split(//,$ks); | ||
10 | foreach (@a) { printf "%02x-",ord($_); } | ||
11 | print "\n"; | ||
12 | |||
13 | |||
14 | $key=DES::random_key(); | ||
15 | print "($_)\n"; | ||
16 | @a=split(//,$key); | ||
17 | foreach (@a) { printf "%02x-",ord($_); } | ||
18 | print "\n"; | ||
19 | $str="this is and again into the breach"; | ||
20 | ($k1,$k2)=DES::string_to_2keys($str); | ||
21 | @a=split(//,$k1); | ||
22 | foreach (@a) { printf "%02x-",ord($_); } | ||
23 | print "\n"; | ||
24 | @a=split(//,$k2); | ||
25 | foreach (@a) { printf "%02x-",ord($_); } | ||
26 | print "\n"; | ||
27 | |||
diff --git a/src/lib/libssl/src/crypto/des/times/486-50.sol b/src/lib/libssl/src/crypto/des/times/486-50.sol deleted file mode 100644 index 0de62d6db3..0000000000 --- a/src/lib/libssl/src/crypto/des/times/486-50.sol +++ /dev/null | |||
@@ -1,16 +0,0 @@ | |||
1 | Solaris 2.4, 486 50mhz, gcc 2.6.3 | ||
2 | options des ecb/s | ||
3 | 16 r2 i 43552.51 100.0% | ||
4 | 16 r1 i 43487.45 99.9% | ||
5 | 16 c p 43003.23 98.7% | ||
6 | 16 r2 p 42339.00 97.2% | ||
7 | 16 c i 41900.91 96.2% | ||
8 | 16 r1 p 41360.64 95.0% | ||
9 | 4 c i 38728.48 88.9% | ||
10 | 4 c p 38225.63 87.8% | ||
11 | 4 r1 i 38085.79 87.4% | ||
12 | 4 r2 i 37825.64 86.9% | ||
13 | 4 r2 p 34611.00 79.5% | ||
14 | 4 r1 p 31802.00 73.0% | ||
15 | -DDES_UNROLL -DDES_RISC2 | ||
16 | |||
diff --git a/src/lib/libssl/src/crypto/des/times/586-100.lnx b/src/lib/libssl/src/crypto/des/times/586-100.lnx deleted file mode 100644 index 4323914a11..0000000000 --- a/src/lib/libssl/src/crypto/des/times/586-100.lnx +++ /dev/null | |||
@@ -1,20 +0,0 @@ | |||
1 | Pentium 100 | ||
2 | Linux 2 kernel | ||
3 | gcc 2.7.0 -O3 -fomit-frame-pointer | ||
4 | No X server running, just a console, it makes the top speed jump from 151,000 | ||
5 | to 158,000 :-). | ||
6 | options des ecb/s | ||
7 | assember 281000.00 177.1% | ||
8 | 16 r1 p 158667.40 100.0% | ||
9 | 16 r1 i 148471.70 93.6% | ||
10 | 16 r2 p 143961.80 90.7% | ||
11 | 16 r2 i 141689.20 89.3% | ||
12 | 4 r1 i 140100.00 88.3% | ||
13 | 4 r2 i 134049.40 84.5% | ||
14 | 16 c i 124145.20 78.2% | ||
15 | 16 c p 121584.20 76.6% | ||
16 | 4 c i 118116.00 74.4% | ||
17 | 4 r2 p 117977.90 74.4% | ||
18 | 4 c p 114971.40 72.5% | ||
19 | 4 r1 p 114578.40 72.2% | ||
20 | -DDES_UNROLL -DDES_RISC1 -DDES_PTR | ||
diff --git a/src/lib/libssl/src/crypto/des/times/686-200.fre b/src/lib/libssl/src/crypto/des/times/686-200.fre deleted file mode 100644 index 7d83f6adee..0000000000 --- a/src/lib/libssl/src/crypto/des/times/686-200.fre +++ /dev/null | |||
@@ -1,18 +0,0 @@ | |||
1 | Pentium 100 | ||
2 | Free BSD 2.1.5 kernel | ||
3 | gcc 2.7.2.2 -O3 -fomit-frame-pointer | ||
4 | options des ecb/s | ||
5 | assember 578000.00 133.1% | ||
6 | 16 r2 i 434454.80 100.0% | ||
7 | 16 r1 i 433621.43 99.8% | ||
8 | 16 r2 p 431375.69 99.3% | ||
9 | 4 r1 i 423722.30 97.5% | ||
10 | 4 r2 i 422399.40 97.2% | ||
11 | 16 r1 p 421739.40 97.1% | ||
12 | 16 c i 399027.94 91.8% | ||
13 | 16 c p 372251.70 85.7% | ||
14 | 4 c i 365118.35 84.0% | ||
15 | 4 c p 352880.51 81.2% | ||
16 | 4 r2 p 255104.90 58.7% | ||
17 | 4 r1 p 251289.18 57.8% | ||
18 | -DDES_UNROLL -DDES_RISC2 | ||
diff --git a/src/lib/libssl/src/crypto/des/times/aix.cc b/src/lib/libssl/src/crypto/des/times/aix.cc deleted file mode 100644 index d96b74e2ce..0000000000 --- a/src/lib/libssl/src/crypto/des/times/aix.cc +++ /dev/null | |||
@@ -1,26 +0,0 @@ | |||
1 | From: Paco Garcia <pgarcia@cam.es> | ||
2 | |||
3 | This machine is a Bull Estrella Minitower Model MT604-100 | ||
4 | Processor : PPC604 | ||
5 | P.Speed : 100Mhz | ||
6 | Data/Instr Cache : 16 K | ||
7 | L2 Cache : 256 K | ||
8 | PCI BUS Speed : 33 Mhz | ||
9 | TransfRate PCI : 132 MB/s | ||
10 | Memory : 96 MB | ||
11 | |||
12 | options des ecb/s | ||
13 | 4 c p 275118.61 100.0% | ||
14 | 4 c i 273545.07 99.4% | ||
15 | 4 r2 p 270441.02 98.3% | ||
16 | 4 r1 p 253052.15 92.0% | ||
17 | 4 r2 i 240842.97 87.5% | ||
18 | 4 r1 i 240556.66 87.4% | ||
19 | 16 c i 224603.99 81.6% | ||
20 | 16 c p 224483.98 81.6% | ||
21 | 16 r2 p 215691.19 78.4% | ||
22 | 16 r1 p 208332.83 75.7% | ||
23 | 16 r1 i 199206.50 72.4% | ||
24 | 16 r2 i 198963.70 72.3% | ||
25 | -DDES_PTR | ||
26 | |||
diff --git a/src/lib/libssl/src/crypto/des/times/alpha.cc b/src/lib/libssl/src/crypto/des/times/alpha.cc deleted file mode 100644 index 95c17efae7..0000000000 --- a/src/lib/libssl/src/crypto/des/times/alpha.cc +++ /dev/null | |||
@@ -1,18 +0,0 @@ | |||
1 | cc -O2 | ||
2 | DES_LONG is 'unsigned int' | ||
3 | |||
4 | options des ecb/s | ||
5 | 4 r2 p 181146.14 100.0% | ||
6 | 16 r2 p 172102.94 95.0% | ||
7 | 4 r2 i 165424.11 91.3% | ||
8 | 16 c p 160468.64 88.6% | ||
9 | 4 c p 156653.59 86.5% | ||
10 | 4 c i 155245.18 85.7% | ||
11 | 4 r1 p 154729.68 85.4% | ||
12 | 16 r2 i 154137.69 85.1% | ||
13 | 16 r1 p 152357.96 84.1% | ||
14 | 16 c i 148743.91 82.1% | ||
15 | 4 r1 i 146695.59 81.0% | ||
16 | 16 r1 i 144961.00 80.0% | ||
17 | -DDES_RISC2 -DDES_PTR | ||
18 | |||
diff --git a/src/lib/libssl/src/crypto/des/times/hpux.cc b/src/lib/libssl/src/crypto/des/times/hpux.cc deleted file mode 100644 index 3de856ddac..0000000000 --- a/src/lib/libssl/src/crypto/des/times/hpux.cc +++ /dev/null | |||
@@ -1,17 +0,0 @@ | |||
1 | HPUX 10 - 9000/887 - cc -D_HPUX_SOURCE -Aa +ESlit +O2 -Wl,-a,archive | ||
2 | |||
3 | options des ecb/s | ||
4 | 16 c i 149448.90 100.0% | ||
5 | 4 c i 145861.79 97.6% | ||
6 | 16 r2 i 141710.96 94.8% | ||
7 | 16 r1 i 139455.33 93.3% | ||
8 | 4 r2 i 138800.00 92.9% | ||
9 | 4 r1 i 136692.65 91.5% | ||
10 | 16 r2 p 110228.17 73.8% | ||
11 | 16 r1 p 109397.07 73.2% | ||
12 | 16 c p 109209.89 73.1% | ||
13 | 4 c p 108014.71 72.3% | ||
14 | 4 r2 p 107873.88 72.2% | ||
15 | 4 r1 p 107685.83 72.1% | ||
16 | -DDES_UNROLL | ||
17 | |||
diff --git a/src/lib/libssl/src/crypto/des/times/sparc.gcc b/src/lib/libssl/src/crypto/des/times/sparc.gcc deleted file mode 100644 index 8eaa042104..0000000000 --- a/src/lib/libssl/src/crypto/des/times/sparc.gcc +++ /dev/null | |||
@@ -1,17 +0,0 @@ | |||
1 | solaris 2.5.1 - sparc 10 50mhz - gcc 2.7.2 | ||
2 | |||
3 | options des ecb/s | ||
4 | 16 c i 124382.70 100.0% | ||
5 | 4 c i 118884.68 95.6% | ||
6 | 16 c p 112261.20 90.3% | ||
7 | 16 r2 i 111777.10 89.9% | ||
8 | 16 r2 p 108896.30 87.5% | ||
9 | 16 r1 p 108791.59 87.5% | ||
10 | 4 c p 107290.10 86.3% | ||
11 | 4 r1 p 104583.80 84.1% | ||
12 | 16 r1 i 104206.20 83.8% | ||
13 | 4 r2 p 103709.80 83.4% | ||
14 | 4 r2 i 98306.43 79.0% | ||
15 | 4 r1 i 91525.80 73.6% | ||
16 | -DDES_UNROLL | ||
17 | |||
diff --git a/src/lib/libssl/src/crypto/des/times/usparc.cc b/src/lib/libssl/src/crypto/des/times/usparc.cc deleted file mode 100644 index 0864285ef6..0000000000 --- a/src/lib/libssl/src/crypto/des/times/usparc.cc +++ /dev/null | |||
@@ -1,31 +0,0 @@ | |||
1 | solaris 2.5.1 usparc 167mhz?? - SC4.0 cc -fast -Xa -xO5 | ||
2 | |||
3 | For the ultra sparc, SunC 4.0 cc -fast -Xa -xO5, running 'des_opts' | ||
4 | gives a speed of 475,000 des/s while 'speed' gives 417,000 des/s. | ||
5 | I believe the difference is tied up in optimisation that the compiler | ||
6 | is able to perform when the code is 'inlined'. For 'speed', the DES | ||
7 | routines are being linked from a library. I'll record the higher | ||
8 | speed since if performance is everything, you can always inline | ||
9 | 'des_enc.c'. | ||
10 | |||
11 | [ 16-Jan-06 - I've been playing with the | ||
12 | '-xtarget=ultra -xarch=v8plus -Xa -xO5 -Xa' | ||
13 | and while it makes the des_opts numbers much slower, it makes the | ||
14 | actual 'speed' numbers look better which is a realistic version of | ||
15 | using the libraries. ] | ||
16 | |||
17 | options des ecb/s | ||
18 | 16 r1 p 475516.90 100.0% | ||
19 | 16 r2 p 439388.10 92.4% | ||
20 | 16 c i 427001.40 89.8% | ||
21 | 16 c p 419516.50 88.2% | ||
22 | 4 r2 p 409491.70 86.1% | ||
23 | 4 r1 p 404266.90 85.0% | ||
24 | 4 c p 398121.00 83.7% | ||
25 | 4 c i 370588.40 77.9% | ||
26 | 4 r1 i 362742.20 76.3% | ||
27 | 16 r2 i 331275.50 69.7% | ||
28 | 16 r1 i 324730.60 68.3% | ||
29 | 4 r2 i 63535.10 13.4% <-- very very weird, must be cache problems. | ||
30 | -DDES_UNROLL -DDES_RISC1 -DDES_PTR | ||
31 | |||
diff --git a/src/lib/libssl/src/crypto/des/typemap b/src/lib/libssl/src/crypto/des/typemap deleted file mode 100644 index a524f53634..0000000000 --- a/src/lib/libssl/src/crypto/des/typemap +++ /dev/null | |||
@@ -1,34 +0,0 @@ | |||
1 | # | ||
2 | # DES SECTION | ||
3 | # | ||
4 | deschar * T_DESCHARP | ||
5 | des_cblock * T_CBLOCK | ||
6 | des_cblock T_CBLOCK | ||
7 | des_key_schedule T_SCHEDULE | ||
8 | des_key_schedule * T_SCHEDULE | ||
9 | |||
10 | INPUT | ||
11 | T_CBLOCK | ||
12 | $var=(des_cblock *)SvPV($arg,len); | ||
13 | if (len < DES_KEY_SZ) | ||
14 | { | ||
15 | croak(\"$var needs to be at least %u bytes long\",DES_KEY_SZ); | ||
16 | } | ||
17 | |||
18 | T_SCHEDULE | ||
19 | $var=(des_key_schedule *)SvPV($arg,len); | ||
20 | if (len < DES_SCHEDULE_SZ) | ||
21 | { | ||
22 | croak(\"$var needs to be at least %u bytes long\", | ||
23 | DES_SCHEDULE_SZ); | ||
24 | } | ||
25 | |||
26 | OUTPUT | ||
27 | T_CBLOCK | ||
28 | sv_setpvn($arg,(char *)$var,DES_KEY_SZ); | ||
29 | |||
30 | T_SCHEDULE | ||
31 | sv_setpvn($arg,(char *)$var,DES_SCHEDULE_SZ); | ||
32 | |||
33 | T_DESCHARP | ||
34 | sv_setpvn($arg,(char *)$var,len); | ||