diff options
author | beck <> | 1999-09-29 04:37:45 +0000 |
---|---|---|
committer | beck <> | 1999-09-29 04:37:45 +0000 |
commit | de8f24ea083384bb66b32ec105dc4743c5663cdf (patch) | |
tree | 1412176ae62a3cab2cf2b0b92150fcbceaac6092 /src/lib/libcrypto/rc5 | |
parent | cb929d29896bcb87c2a97417fbd03e50078fc178 (diff) | |
download | openbsd-de8f24ea083384bb66b32ec105dc4743c5663cdf.tar.gz openbsd-de8f24ea083384bb66b32ec105dc4743c5663cdf.tar.bz2 openbsd-de8f24ea083384bb66b32ec105dc4743c5663cdf.zip |
OpenSSL 0.9.4 merge
Diffstat (limited to 'src/lib/libcrypto/rc5')
-rw-r--r-- | src/lib/libcrypto/rc5/Makefile.ssl | 41 | ||||
-rw-r--r-- | src/lib/libcrypto/rc5/Makefile.uni | 3 | ||||
-rw-r--r-- | src/lib/libcrypto/rc5/asm/r586unix.cpp | 628 | ||||
-rw-r--r-- | src/lib/libcrypto/rc5/asm/rc5-586.pl | 2 | ||||
-rw-r--r-- | src/lib/libcrypto/rc5/rc5.h | 17 |
5 files changed, 30 insertions, 661 deletions
diff --git a/src/lib/libcrypto/rc5/Makefile.ssl b/src/lib/libcrypto/rc5/Makefile.ssl index 5e98ee2348..666c4b6539 100644 --- a/src/lib/libcrypto/rc5/Makefile.ssl +++ b/src/lib/libcrypto/rc5/Makefile.ssl | |||
@@ -8,9 +8,11 @@ CC= cc | |||
8 | CPP= $(CC) -E | 8 | CPP= $(CC) -E |
9 | INCLUDES= | 9 | INCLUDES= |
10 | CFLAG=-g | 10 | CFLAG=-g |
11 | INSTALL_PREFIX= | ||
12 | OPENSSLDIR= /usr/local/ssl | ||
11 | INSTALLTOP=/usr/local/ssl | 13 | INSTALLTOP=/usr/local/ssl |
12 | MAKE= make -f Makefile.ssl | 14 | MAKE= make -f Makefile.ssl |
13 | MAKEDEPEND= makedepend -f Makefile.ssl | 15 | MAKEDEPEND= $(TOP)/util/domd $(TOP) |
14 | MAKEFILE= Makefile.ssl | 16 | MAKEFILE= Makefile.ssl |
15 | AR= ar r | 17 | AR= ar r |
16 | 18 | ||
@@ -42,7 +44,7 @@ all: lib | |||
42 | 44 | ||
43 | lib: $(LIBOBJ) | 45 | lib: $(LIBOBJ) |
44 | $(AR) $(LIB) $(LIBOBJ) | 46 | $(AR) $(LIB) $(LIBOBJ) |
45 | sh $(TOP)/util/ranlib.sh $(LIB) | 47 | $(RANLIB) $(LIB) |
46 | @touch lib | 48 | @touch lib |
47 | 49 | ||
48 | # elf | 50 | # elf |
@@ -61,27 +63,25 @@ asm/r586-out.o: asm/r586unix.cpp | |||
61 | 63 | ||
62 | # bsdi | 64 | # bsdi |
63 | asm/r586bsdi.o: asm/r586unix.cpp | 65 | asm/r586bsdi.o: asm/r586unix.cpp |
64 | $(CPP) -DBSDI asm/r586unix.cpp | as -o asm/r586bsdi.o | 66 | $(CPP) -DBSDI asm/r586unix.cpp | sed 's/ :/:/' | as -o asm/r586bsdi.o |
65 | 67 | ||
66 | asm/r586unix.cpp: | 68 | asm/r586unix.cpp: |
67 | (cd asm; perl rc5-586.pl cpp >r586unix.cpp) | 69 | (cd asm; $(PERL) rc5-586.pl cpp >r586unix.cpp) |
68 | 70 | ||
69 | files: | 71 | files: |
70 | perl $(TOP)/util/files.pl Makefile.ssl >> $(TOP)/MINFO | 72 | $(PERL) $(TOP)/util/files.pl Makefile.ssl >> $(TOP)/MINFO |
71 | 73 | ||
72 | links: | 74 | links: |
73 | /bin/rm -f Makefile | 75 | @$(TOP)/util/point.sh Makefile.ssl Makefile |
74 | $(TOP)/util/point.sh Makefile.ssl Makefile ; | 76 | @$(PERL) $(TOP)/util/mklink.pl ../../include/openssl $(EXHEADER) |
75 | $(TOP)/util/point.sh ../../doc/rc5.doc rc5.doc ; | 77 | @$(PERL) $(TOP)/util/mklink.pl ../../test $(TEST) |
76 | $(TOP)/util/mklink.sh ../../include $(EXHEADER) | 78 | @$(PERL) $(TOP)/util/mklink.pl ../../apps $(APPS) |
77 | $(TOP)/util/mklink.sh ../../test $(TEST) | ||
78 | $(TOP)/util/mklink.sh ../../apps $(APPS) | ||
79 | 79 | ||
80 | install: | 80 | install: |
81 | @for i in $(EXHEADER) ; \ | 81 | @for i in $(EXHEADER) ; \ |
82 | do \ | 82 | do \ |
83 | (cp $$i $(INSTALLTOP)/include/$$i; \ | 83 | (cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i; \ |
84 | chmod 644 $(INSTALLTOP)/include/$$i ); \ | 84 | chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i ); \ |
85 | done; | 85 | done; |
86 | 86 | ||
87 | tags: | 87 | tags: |
@@ -93,15 +93,20 @@ lint: | |||
93 | lint -DLINT $(INCLUDES) $(SRC)>fluff | 93 | lint -DLINT $(INCLUDES) $(SRC)>fluff |
94 | 94 | ||
95 | depend: | 95 | depend: |
96 | $(MAKEDEPEND) $(INCLUDES) $(PROGS) $(LIBSRC) | 96 | $(MAKEDEPEND) $(INCLUDES) $(DEPFLAG) $(PROGS) $(LIBSRC) |
97 | 97 | ||
98 | dclean: | 98 | dclean: |
99 | perl -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new | 99 | $(PERL) -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new |
100 | mv -f Makefile.new $(MAKEFILE) | 100 | mv -f Makefile.new $(MAKEFILE) |
101 | 101 | ||
102 | clean: | 102 | clean: |
103 | /bin/rm -f *.o asm/*.o *.obj lib tags core .pure .nfs* *.old *.bak fluff | 103 | rm -f asm/r586unix.cpp *.o asm/*.o *.obj lib tags core .pure .nfs* *.old *.bak fluff |
104 | |||
105 | errors: | ||
106 | 104 | ||
107 | # DO NOT DELETE THIS LINE -- make depend depends on it. | 105 | # DO NOT DELETE THIS LINE -- make depend depends on it. |
106 | |||
107 | rc5_ecb.o: ../../include/openssl/opensslv.h ../../include/openssl/rc5.h | ||
108 | rc5_ecb.o: rc5_locl.h | ||
109 | rc5_enc.o: ../../include/openssl/rc5.h rc5_locl.h | ||
110 | rc5_skey.o: ../../include/openssl/rc5.h rc5_locl.h | ||
111 | rc5cfb64.o: ../../include/openssl/rc5.h rc5_locl.h | ||
112 | rc5ofb64.o: ../../include/openssl/rc5.h rc5_locl.h | ||
diff --git a/src/lib/libcrypto/rc5/Makefile.uni b/src/lib/libcrypto/rc5/Makefile.uni index e50b3f2d19..4dc20c6fcf 100644 --- a/src/lib/libcrypto/rc5/Makefile.uni +++ b/src/lib/libcrypto/rc5/Makefile.uni | |||
@@ -15,6 +15,7 @@ MAKE= make | |||
15 | MAKEDEPEND= makedepend | 15 | MAKEDEPEND= makedepend |
16 | MAKEFILE= Makefile.uni | 16 | MAKEFILE= Makefile.uni |
17 | AR= ar r | 17 | AR= ar r |
18 | RANLIB= ranlib | ||
18 | 19 | ||
19 | IDEA_ENC=rc2_cbc.o | 20 | IDEA_ENC=rc2_cbc.o |
20 | 21 | ||
@@ -39,7 +40,7 @@ all: $(LIB) $(TEST) $(APPS) | |||
39 | 40 | ||
40 | $(LIB): $(LIBOBJ) | 41 | $(LIB): $(LIBOBJ) |
41 | $(AR) $(LIB) $(LIBOBJ) | 42 | $(AR) $(LIB) $(LIBOBJ) |
42 | sh $(TOP)/ranlib.sh $(LIB) | 43 | $(RANLIB) $(LIB) |
43 | 44 | ||
44 | test: $(TEST) | 45 | test: $(TEST) |
45 | ./$(TEST) | 46 | ./$(TEST) |
diff --git a/src/lib/libcrypto/rc5/asm/r586unix.cpp b/src/lib/libcrypto/rc5/asm/r586unix.cpp deleted file mode 100644 index a25dd5a9a4..0000000000 --- a/src/lib/libcrypto/rc5/asm/r586unix.cpp +++ /dev/null | |||
@@ -1,628 +0,0 @@ | |||
1 | /* Run the C pre-processor over this file with one of the following defined | ||
2 | * ELF - elf object files, | ||
3 | * OUT - a.out object files, | ||
4 | * BSDI - BSDI style a.out object files | ||
5 | * SOL - Solaris style elf | ||
6 | */ | ||
7 | |||
8 | #define TYPE(a,b) .type a,b | ||
9 | #define SIZE(a,b) .size a,b | ||
10 | |||
11 | #if defined(OUT) || defined(BSDI) | ||
12 | #define RC5_32_encrypt _RC5_32_encrypt | ||
13 | #define RC5_32_decrypt _RC5_32_decrypt | ||
14 | #define RC5_32_cbc_encrypt _RC5_32_cbc_encrypt | ||
15 | |||
16 | #endif | ||
17 | |||
18 | #ifdef OUT | ||
19 | #define OK 1 | ||
20 | #define ALIGN 4 | ||
21 | #endif | ||
22 | |||
23 | #ifdef BSDI | ||
24 | #define OK 1 | ||
25 | #define ALIGN 4 | ||
26 | #undef SIZE | ||
27 | #undef TYPE | ||
28 | #define SIZE(a,b) | ||
29 | #define TYPE(a,b) | ||
30 | #endif | ||
31 | |||
32 | #if defined(ELF) || defined(SOL) | ||
33 | #define OK 1 | ||
34 | #define ALIGN 16 | ||
35 | #endif | ||
36 | |||
37 | #ifndef OK | ||
38 | You need to define one of | ||
39 | ELF - elf systems - linux-elf, NetBSD and DG-UX | ||
40 | OUT - a.out systems - linux-a.out and FreeBSD | ||
41 | SOL - solaris systems, which are elf with strange comment lines | ||
42 | BSDI - a.out with a very primative version of as. | ||
43 | #endif | ||
44 | |||
45 | /* Let the Assembler begin :-) */ | ||
46 | /* Don't even think of reading this code */ | ||
47 | /* It was automatically generated by rc5-586.pl */ | ||
48 | /* Which is a perl program used to generate the x86 assember for */ | ||
49 | /* any of elf, a.out, BSDI,Win32, or Solaris */ | ||
50 | /* eric <eay@cryptsoft.com> */ | ||
51 | |||
52 | .file "rc5-586.s" | ||
53 | .version "01.01" | ||
54 | gcc2_compiled.: | ||
55 | .text | ||
56 | .align ALIGN | ||
57 | .globl RC5_32_encrypt | ||
58 | TYPE(RC5_32_encrypt,@function) | ||
59 | RC5_32_encrypt: | ||
60 | |||
61 | pushl %ebp | ||
62 | pushl %esi | ||
63 | pushl %edi | ||
64 | movl 16(%esp), %edx | ||
65 | movl 20(%esp), %ebp | ||
66 | /* Load the 2 words */ | ||
67 | movl (%edx), %edi | ||
68 | movl 4(%edx), %esi | ||
69 | pushl %ebx | ||
70 | movl (%ebp), %ebx | ||
71 | addl 4(%ebp), %edi | ||
72 | addl 8(%ebp), %esi | ||
73 | xorl %esi, %edi | ||
74 | movl 12(%ebp), %eax | ||
75 | movl %esi, %ecx | ||
76 | roll %cl, %edi | ||
77 | addl %eax, %edi | ||
78 | xorl %edi, %esi | ||
79 | movl 16(%ebp), %eax | ||
80 | movl %edi, %ecx | ||
81 | roll %cl, %esi | ||
82 | addl %eax, %esi | ||
83 | xorl %esi, %edi | ||
84 | movl 20(%ebp), %eax | ||
85 | movl %esi, %ecx | ||
86 | roll %cl, %edi | ||
87 | addl %eax, %edi | ||
88 | xorl %edi, %esi | ||
89 | movl 24(%ebp), %eax | ||
90 | movl %edi, %ecx | ||
91 | roll %cl, %esi | ||
92 | addl %eax, %esi | ||
93 | xorl %esi, %edi | ||
94 | movl 28(%ebp), %eax | ||
95 | movl %esi, %ecx | ||
96 | roll %cl, %edi | ||
97 | addl %eax, %edi | ||
98 | xorl %edi, %esi | ||
99 | movl 32(%ebp), %eax | ||
100 | movl %edi, %ecx | ||
101 | roll %cl, %esi | ||
102 | addl %eax, %esi | ||
103 | xorl %esi, %edi | ||
104 | movl 36(%ebp), %eax | ||
105 | movl %esi, %ecx | ||
106 | roll %cl, %edi | ||
107 | addl %eax, %edi | ||
108 | xorl %edi, %esi | ||
109 | movl 40(%ebp), %eax | ||
110 | movl %edi, %ecx | ||
111 | roll %cl, %esi | ||
112 | addl %eax, %esi | ||
113 | xorl %esi, %edi | ||
114 | movl 44(%ebp), %eax | ||
115 | movl %esi, %ecx | ||
116 | roll %cl, %edi | ||
117 | addl %eax, %edi | ||
118 | xorl %edi, %esi | ||
119 | movl 48(%ebp), %eax | ||
120 | movl %edi, %ecx | ||
121 | roll %cl, %esi | ||
122 | addl %eax, %esi | ||
123 | xorl %esi, %edi | ||
124 | movl 52(%ebp), %eax | ||
125 | movl %esi, %ecx | ||
126 | roll %cl, %edi | ||
127 | addl %eax, %edi | ||
128 | xorl %edi, %esi | ||
129 | movl 56(%ebp), %eax | ||
130 | movl %edi, %ecx | ||
131 | roll %cl, %esi | ||
132 | addl %eax, %esi | ||
133 | xorl %esi, %edi | ||
134 | movl 60(%ebp), %eax | ||
135 | movl %esi, %ecx | ||
136 | roll %cl, %edi | ||
137 | addl %eax, %edi | ||
138 | xorl %edi, %esi | ||
139 | movl 64(%ebp), %eax | ||
140 | movl %edi, %ecx | ||
141 | roll %cl, %esi | ||
142 | addl %eax, %esi | ||
143 | xorl %esi, %edi | ||
144 | movl 68(%ebp), %eax | ||
145 | movl %esi, %ecx | ||
146 | roll %cl, %edi | ||
147 | addl %eax, %edi | ||
148 | xorl %edi, %esi | ||
149 | movl 72(%ebp), %eax | ||
150 | movl %edi, %ecx | ||
151 | roll %cl, %esi | ||
152 | addl %eax, %esi | ||
153 | cmpl $8, %ebx | ||
154 | je .L000rc5_exit | ||
155 | xorl %esi, %edi | ||
156 | movl 76(%ebp), %eax | ||
157 | movl %esi, %ecx | ||
158 | roll %cl, %edi | ||
159 | addl %eax, %edi | ||
160 | xorl %edi, %esi | ||
161 | movl 80(%ebp), %eax | ||
162 | movl %edi, %ecx | ||
163 | roll %cl, %esi | ||
164 | addl %eax, %esi | ||
165 | xorl %esi, %edi | ||
166 | movl 84(%ebp), %eax | ||
167 | movl %esi, %ecx | ||
168 | roll %cl, %edi | ||
169 | addl %eax, %edi | ||
170 | xorl %edi, %esi | ||
171 | movl 88(%ebp), %eax | ||
172 | movl %edi, %ecx | ||
173 | roll %cl, %esi | ||
174 | addl %eax, %esi | ||
175 | xorl %esi, %edi | ||
176 | movl 92(%ebp), %eax | ||
177 | movl %esi, %ecx | ||
178 | roll %cl, %edi | ||
179 | addl %eax, %edi | ||
180 | xorl %edi, %esi | ||
181 | movl 96(%ebp), %eax | ||
182 | movl %edi, %ecx | ||
183 | roll %cl, %esi | ||
184 | addl %eax, %esi | ||
185 | xorl %esi, %edi | ||
186 | movl 100(%ebp), %eax | ||
187 | movl %esi, %ecx | ||
188 | roll %cl, %edi | ||
189 | addl %eax, %edi | ||
190 | xorl %edi, %esi | ||
191 | movl 104(%ebp), %eax | ||
192 | movl %edi, %ecx | ||
193 | roll %cl, %esi | ||
194 | addl %eax, %esi | ||
195 | cmpl $12, %ebx | ||
196 | je .L000rc5_exit | ||
197 | xorl %esi, %edi | ||
198 | movl 108(%ebp), %eax | ||
199 | movl %esi, %ecx | ||
200 | roll %cl, %edi | ||
201 | addl %eax, %edi | ||
202 | xorl %edi, %esi | ||
203 | movl 112(%ebp), %eax | ||
204 | movl %edi, %ecx | ||
205 | roll %cl, %esi | ||
206 | addl %eax, %esi | ||
207 | xorl %esi, %edi | ||
208 | movl 116(%ebp), %eax | ||
209 | movl %esi, %ecx | ||
210 | roll %cl, %edi | ||
211 | addl %eax, %edi | ||
212 | xorl %edi, %esi | ||
213 | movl 120(%ebp), %eax | ||
214 | movl %edi, %ecx | ||
215 | roll %cl, %esi | ||
216 | addl %eax, %esi | ||
217 | xorl %esi, %edi | ||
218 | movl 124(%ebp), %eax | ||
219 | movl %esi, %ecx | ||
220 | roll %cl, %edi | ||
221 | addl %eax, %edi | ||
222 | xorl %edi, %esi | ||
223 | movl 128(%ebp), %eax | ||
224 | movl %edi, %ecx | ||
225 | roll %cl, %esi | ||
226 | addl %eax, %esi | ||
227 | xorl %esi, %edi | ||
228 | movl 132(%ebp), %eax | ||
229 | movl %esi, %ecx | ||
230 | roll %cl, %edi | ||
231 | addl %eax, %edi | ||
232 | xorl %edi, %esi | ||
233 | movl 136(%ebp), %eax | ||
234 | movl %edi, %ecx | ||
235 | roll %cl, %esi | ||
236 | addl %eax, %esi | ||
237 | .L000rc5_exit: | ||
238 | movl %edi, (%edx) | ||
239 | movl %esi, 4(%edx) | ||
240 | popl %ebx | ||
241 | popl %edi | ||
242 | popl %esi | ||
243 | popl %ebp | ||
244 | ret | ||
245 | .RC5_32_encrypt_end: | ||
246 | SIZE(RC5_32_encrypt,.RC5_32_encrypt_end-RC5_32_encrypt) | ||
247 | .ident "desasm.pl" | ||
248 | .text | ||
249 | .align ALIGN | ||
250 | .globl RC5_32_decrypt | ||
251 | TYPE(RC5_32_decrypt,@function) | ||
252 | RC5_32_decrypt: | ||
253 | |||
254 | pushl %ebp | ||
255 | pushl %esi | ||
256 | pushl %edi | ||
257 | movl 16(%esp), %edx | ||
258 | movl 20(%esp), %ebp | ||
259 | /* Load the 2 words */ | ||
260 | movl (%edx), %edi | ||
261 | movl 4(%edx), %esi | ||
262 | pushl %ebx | ||
263 | movl (%ebp), %ebx | ||
264 | cmpl $12, %ebx | ||
265 | je .L001rc5_dec_12 | ||
266 | cmpl $8, %ebx | ||
267 | je .L002rc5_dec_8 | ||
268 | movl 136(%ebp), %eax | ||
269 | subl %eax, %esi | ||
270 | movl %edi, %ecx | ||
271 | rorl %cl, %esi | ||
272 | xorl %edi, %esi | ||
273 | movl 132(%ebp), %eax | ||
274 | subl %eax, %edi | ||
275 | movl %esi, %ecx | ||
276 | rorl %cl, %edi | ||
277 | xorl %esi, %edi | ||
278 | movl 128(%ebp), %eax | ||
279 | subl %eax, %esi | ||
280 | movl %edi, %ecx | ||
281 | rorl %cl, %esi | ||
282 | xorl %edi, %esi | ||
283 | movl 124(%ebp), %eax | ||
284 | subl %eax, %edi | ||
285 | movl %esi, %ecx | ||
286 | rorl %cl, %edi | ||
287 | xorl %esi, %edi | ||
288 | movl 120(%ebp), %eax | ||
289 | subl %eax, %esi | ||
290 | movl %edi, %ecx | ||
291 | rorl %cl, %esi | ||
292 | xorl %edi, %esi | ||
293 | movl 116(%ebp), %eax | ||
294 | subl %eax, %edi | ||
295 | movl %esi, %ecx | ||
296 | rorl %cl, %edi | ||
297 | xorl %esi, %edi | ||
298 | movl 112(%ebp), %eax | ||
299 | subl %eax, %esi | ||
300 | movl %edi, %ecx | ||
301 | rorl %cl, %esi | ||
302 | xorl %edi, %esi | ||
303 | movl 108(%ebp), %eax | ||
304 | subl %eax, %edi | ||
305 | movl %esi, %ecx | ||
306 | rorl %cl, %edi | ||
307 | xorl %esi, %edi | ||
308 | .L001rc5_dec_12: | ||
309 | movl 104(%ebp), %eax | ||
310 | subl %eax, %esi | ||
311 | movl %edi, %ecx | ||
312 | rorl %cl, %esi | ||
313 | xorl %edi, %esi | ||
314 | movl 100(%ebp), %eax | ||
315 | subl %eax, %edi | ||
316 | movl %esi, %ecx | ||
317 | rorl %cl, %edi | ||
318 | xorl %esi, %edi | ||
319 | movl 96(%ebp), %eax | ||
320 | subl %eax, %esi | ||
321 | movl %edi, %ecx | ||
322 | rorl %cl, %esi | ||
323 | xorl %edi, %esi | ||
324 | movl 92(%ebp), %eax | ||
325 | subl %eax, %edi | ||
326 | movl %esi, %ecx | ||
327 | rorl %cl, %edi | ||
328 | xorl %esi, %edi | ||
329 | movl 88(%ebp), %eax | ||
330 | subl %eax, %esi | ||
331 | movl %edi, %ecx | ||
332 | rorl %cl, %esi | ||
333 | xorl %edi, %esi | ||
334 | movl 84(%ebp), %eax | ||
335 | subl %eax, %edi | ||
336 | movl %esi, %ecx | ||
337 | rorl %cl, %edi | ||
338 | xorl %esi, %edi | ||
339 | movl 80(%ebp), %eax | ||
340 | subl %eax, %esi | ||
341 | movl %edi, %ecx | ||
342 | rorl %cl, %esi | ||
343 | xorl %edi, %esi | ||
344 | movl 76(%ebp), %eax | ||
345 | subl %eax, %edi | ||
346 | movl %esi, %ecx | ||
347 | rorl %cl, %edi | ||
348 | xorl %esi, %edi | ||
349 | .L002rc5_dec_8: | ||
350 | movl 72(%ebp), %eax | ||
351 | subl %eax, %esi | ||
352 | movl %edi, %ecx | ||
353 | rorl %cl, %esi | ||
354 | xorl %edi, %esi | ||
355 | movl 68(%ebp), %eax | ||
356 | subl %eax, %edi | ||
357 | movl %esi, %ecx | ||
358 | rorl %cl, %edi | ||
359 | xorl %esi, %edi | ||
360 | movl 64(%ebp), %eax | ||
361 | subl %eax, %esi | ||
362 | movl %edi, %ecx | ||
363 | rorl %cl, %esi | ||
364 | xorl %edi, %esi | ||
365 | movl 60(%ebp), %eax | ||
366 | subl %eax, %edi | ||
367 | movl %esi, %ecx | ||
368 | rorl %cl, %edi | ||
369 | xorl %esi, %edi | ||
370 | movl 56(%ebp), %eax | ||
371 | subl %eax, %esi | ||
372 | movl %edi, %ecx | ||
373 | rorl %cl, %esi | ||
374 | xorl %edi, %esi | ||
375 | movl 52(%ebp), %eax | ||
376 | subl %eax, %edi | ||
377 | movl %esi, %ecx | ||
378 | rorl %cl, %edi | ||
379 | xorl %esi, %edi | ||
380 | movl 48(%ebp), %eax | ||
381 | subl %eax, %esi | ||
382 | movl %edi, %ecx | ||
383 | rorl %cl, %esi | ||
384 | xorl %edi, %esi | ||
385 | movl 44(%ebp), %eax | ||
386 | subl %eax, %edi | ||
387 | movl %esi, %ecx | ||
388 | rorl %cl, %edi | ||
389 | xorl %esi, %edi | ||
390 | movl 40(%ebp), %eax | ||
391 | subl %eax, %esi | ||
392 | movl %edi, %ecx | ||
393 | rorl %cl, %esi | ||
394 | xorl %edi, %esi | ||
395 | movl 36(%ebp), %eax | ||
396 | subl %eax, %edi | ||
397 | movl %esi, %ecx | ||
398 | rorl %cl, %edi | ||
399 | xorl %esi, %edi | ||
400 | movl 32(%ebp), %eax | ||
401 | subl %eax, %esi | ||
402 | movl %edi, %ecx | ||
403 | rorl %cl, %esi | ||
404 | xorl %edi, %esi | ||
405 | movl 28(%ebp), %eax | ||
406 | subl %eax, %edi | ||
407 | movl %esi, %ecx | ||
408 | rorl %cl, %edi | ||
409 | xorl %esi, %edi | ||
410 | movl 24(%ebp), %eax | ||
411 | subl %eax, %esi | ||
412 | movl %edi, %ecx | ||
413 | rorl %cl, %esi | ||
414 | xorl %edi, %esi | ||
415 | movl 20(%ebp), %eax | ||
416 | subl %eax, %edi | ||
417 | movl %esi, %ecx | ||
418 | rorl %cl, %edi | ||
419 | xorl %esi, %edi | ||
420 | movl 16(%ebp), %eax | ||
421 | subl %eax, %esi | ||
422 | movl %edi, %ecx | ||
423 | rorl %cl, %esi | ||
424 | xorl %edi, %esi | ||
425 | movl 12(%ebp), %eax | ||
426 | subl %eax, %edi | ||
427 | movl %esi, %ecx | ||
428 | rorl %cl, %edi | ||
429 | xorl %esi, %edi | ||
430 | subl 8(%ebp), %esi | ||
431 | subl 4(%ebp), %edi | ||
432 | .L003rc5_exit: | ||
433 | movl %edi, (%edx) | ||
434 | movl %esi, 4(%edx) | ||
435 | popl %ebx | ||
436 | popl %edi | ||
437 | popl %esi | ||
438 | popl %ebp | ||
439 | ret | ||
440 | .RC5_32_decrypt_end: | ||
441 | SIZE(RC5_32_decrypt,.RC5_32_decrypt_end-RC5_32_decrypt) | ||
442 | .ident "desasm.pl" | ||
443 | .text | ||
444 | .align ALIGN | ||
445 | .globl RC5_32_cbc_encrypt | ||
446 | TYPE(RC5_32_cbc_encrypt,@function) | ||
447 | RC5_32_cbc_encrypt: | ||
448 | |||
449 | pushl %ebp | ||
450 | pushl %ebx | ||
451 | pushl %esi | ||
452 | pushl %edi | ||
453 | movl 28(%esp), %ebp | ||
454 | /* getting iv ptr from parameter 4 */ | ||
455 | movl 36(%esp), %ebx | ||
456 | movl (%ebx), %esi | ||
457 | movl 4(%ebx), %edi | ||
458 | pushl %edi | ||
459 | pushl %esi | ||
460 | pushl %edi | ||
461 | pushl %esi | ||
462 | movl %esp, %ebx | ||
463 | movl 36(%esp), %esi | ||
464 | movl 40(%esp), %edi | ||
465 | /* getting encrypt flag from parameter 5 */ | ||
466 | movl 56(%esp), %ecx | ||
467 | /* get and push parameter 3 */ | ||
468 | movl 48(%esp), %eax | ||
469 | pushl %eax | ||
470 | pushl %ebx | ||
471 | cmpl $0, %ecx | ||
472 | jz .L004decrypt | ||
473 | andl $4294967288, %ebp | ||
474 | movl 8(%esp), %eax | ||
475 | movl 12(%esp), %ebx | ||
476 | jz .L005encrypt_finish | ||
477 | .L006encrypt_loop: | ||
478 | movl (%esi), %ecx | ||
479 | movl 4(%esi), %edx | ||
480 | xorl %ecx, %eax | ||
481 | xorl %edx, %ebx | ||
482 | movl %eax, 8(%esp) | ||
483 | movl %ebx, 12(%esp) | ||
484 | call RC5_32_encrypt | ||
485 | movl 8(%esp), %eax | ||
486 | movl 12(%esp), %ebx | ||
487 | movl %eax, (%edi) | ||
488 | movl %ebx, 4(%edi) | ||
489 | addl $8, %esi | ||
490 | addl $8, %edi | ||
491 | subl $8, %ebp | ||
492 | jnz .L006encrypt_loop | ||
493 | .L005encrypt_finish: | ||
494 | movl 52(%esp), %ebp | ||
495 | andl $7, %ebp | ||
496 | jz .L007finish | ||
497 | xorl %ecx, %ecx | ||
498 | xorl %edx, %edx | ||
499 | movl .L008cbc_enc_jmp_table(,%ebp,4),%ebp | ||
500 | jmp *%ebp | ||
501 | .L009ej7: | ||
502 | movb 6(%esi), %dh | ||
503 | sall $8, %edx | ||
504 | .L010ej6: | ||
505 | movb 5(%esi), %dh | ||
506 | .L011ej5: | ||
507 | movb 4(%esi), %dl | ||
508 | .L012ej4: | ||
509 | movl (%esi), %ecx | ||
510 | jmp .L013ejend | ||
511 | .L014ej3: | ||
512 | movb 2(%esi), %ch | ||
513 | sall $8, %ecx | ||
514 | .L015ej2: | ||
515 | movb 1(%esi), %ch | ||
516 | .L016ej1: | ||
517 | movb (%esi), %cl | ||
518 | .L013ejend: | ||
519 | xorl %ecx, %eax | ||
520 | xorl %edx, %ebx | ||
521 | movl %eax, 8(%esp) | ||
522 | movl %ebx, 12(%esp) | ||
523 | call RC5_32_encrypt | ||
524 | movl 8(%esp), %eax | ||
525 | movl 12(%esp), %ebx | ||
526 | movl %eax, (%edi) | ||
527 | movl %ebx, 4(%edi) | ||
528 | jmp .L007finish | ||
529 | .align ALIGN | ||
530 | .L004decrypt: | ||
531 | andl $4294967288, %ebp | ||
532 | movl 16(%esp), %eax | ||
533 | movl 20(%esp), %ebx | ||
534 | jz .L017decrypt_finish | ||
535 | .L018decrypt_loop: | ||
536 | movl (%esi), %eax | ||
537 | movl 4(%esi), %ebx | ||
538 | movl %eax, 8(%esp) | ||
539 | movl %ebx, 12(%esp) | ||
540 | call RC5_32_decrypt | ||
541 | movl 8(%esp), %eax | ||
542 | movl 12(%esp), %ebx | ||
543 | movl 16(%esp), %ecx | ||
544 | movl 20(%esp), %edx | ||
545 | xorl %eax, %ecx | ||
546 | xorl %ebx, %edx | ||
547 | movl (%esi), %eax | ||
548 | movl 4(%esi), %ebx | ||
549 | movl %ecx, (%edi) | ||
550 | movl %edx, 4(%edi) | ||
551 | movl %eax, 16(%esp) | ||
552 | movl %ebx, 20(%esp) | ||
553 | addl $8, %esi | ||
554 | addl $8, %edi | ||
555 | subl $8, %ebp | ||
556 | jnz .L018decrypt_loop | ||
557 | .L017decrypt_finish: | ||
558 | movl 52(%esp), %ebp | ||
559 | andl $7, %ebp | ||
560 | jz .L007finish | ||
561 | movl (%esi), %eax | ||
562 | movl 4(%esi), %ebx | ||
563 | movl %eax, 8(%esp) | ||
564 | movl %ebx, 12(%esp) | ||
565 | call RC5_32_decrypt | ||
566 | movl 8(%esp), %eax | ||
567 | movl 12(%esp), %ebx | ||
568 | movl 16(%esp), %ecx | ||
569 | movl 20(%esp), %edx | ||
570 | xorl %eax, %ecx | ||
571 | xorl %ebx, %edx | ||
572 | movl (%esi), %eax | ||
573 | movl 4(%esi), %ebx | ||
574 | .L019dj7: | ||
575 | rorl $16, %edx | ||
576 | movb %dl, 6(%edi) | ||
577 | shrl $16, %edx | ||
578 | .L020dj6: | ||
579 | movb %dh, 5(%edi) | ||
580 | .L021dj5: | ||
581 | movb %dl, 4(%edi) | ||
582 | .L022dj4: | ||
583 | movl %ecx, (%edi) | ||
584 | jmp .L023djend | ||
585 | .L024dj3: | ||
586 | rorl $16, %ecx | ||
587 | movb %cl, 2(%edi) | ||
588 | sall $16, %ecx | ||
589 | .L025dj2: | ||
590 | movb %ch, 1(%esi) | ||
591 | .L026dj1: | ||
592 | movb %cl, (%esi) | ||
593 | .L023djend: | ||
594 | jmp .L007finish | ||
595 | .align ALIGN | ||
596 | .L007finish: | ||
597 | movl 60(%esp), %ecx | ||
598 | addl $24, %esp | ||
599 | movl %eax, (%ecx) | ||
600 | movl %ebx, 4(%ecx) | ||
601 | popl %edi | ||
602 | popl %esi | ||
603 | popl %ebx | ||
604 | popl %ebp | ||
605 | ret | ||
606 | .align ALIGN | ||
607 | .L008cbc_enc_jmp_table: | ||
608 | .long 0 | ||
609 | .long .L016ej1 | ||
610 | .long .L015ej2 | ||
611 | .long .L014ej3 | ||
612 | .long .L012ej4 | ||
613 | .long .L011ej5 | ||
614 | .long .L010ej6 | ||
615 | .long .L009ej7 | ||
616 | .align ALIGN | ||
617 | .L027cbc_dec_jmp_table: | ||
618 | .long 0 | ||
619 | .long .L026dj1 | ||
620 | .long .L025dj2 | ||
621 | .long .L024dj3 | ||
622 | .long .L022dj4 | ||
623 | .long .L021dj5 | ||
624 | .long .L020dj6 | ||
625 | .long .L019dj7 | ||
626 | .RC5_32_cbc_encrypt_end: | ||
627 | SIZE(RC5_32_cbc_encrypt,.RC5_32_cbc_encrypt_end-RC5_32_cbc_encrypt) | ||
628 | .ident "desasm.pl" | ||
diff --git a/src/lib/libcrypto/rc5/asm/rc5-586.pl b/src/lib/libcrypto/rc5/asm/rc5-586.pl index 172bd9ee1b..edff1d1e64 100644 --- a/src/lib/libcrypto/rc5/asm/rc5-586.pl +++ b/src/lib/libcrypto/rc5/asm/rc5-586.pl | |||
@@ -1,4 +1,4 @@ | |||
1 | #!/usr/bin/perl | 1 | #!/usr/local/bin/perl |
2 | 2 | ||
3 | push(@INC,"perlasm","../../perlasm"); | 3 | push(@INC,"perlasm","../../perlasm"); |
4 | require "x86asm.pl"; | 4 | require "x86asm.pl"; |
diff --git a/src/lib/libcrypto/rc5/rc5.h b/src/lib/libcrypto/rc5/rc5.h index 5fd64e3f10..38e901502b 100644 --- a/src/lib/libcrypto/rc5/rc5.h +++ b/src/lib/libcrypto/rc5/rc5.h | |||
@@ -63,6 +63,10 @@ | |||
63 | extern "C" { | 63 | extern "C" { |
64 | #endif | 64 | #endif |
65 | 65 | ||
66 | #ifdef NO_RC5 | ||
67 | #error RC5 is disabled. | ||
68 | #endif | ||
69 | |||
66 | #define RC5_ENCRYPT 1 | 70 | #define RC5_ENCRYPT 1 |
67 | #define RC5_DECRYPT 0 | 71 | #define RC5_DECRYPT 0 |
68 | 72 | ||
@@ -88,7 +92,6 @@ typedef struct rc5_key_st | |||
88 | RC5_32_INT data[2*(RC5_16_ROUNDS+1)]; | 92 | RC5_32_INT data[2*(RC5_16_ROUNDS+1)]; |
89 | } RC5_32_KEY; | 93 | } RC5_32_KEY; |
90 | 94 | ||
91 | #ifndef NOPROTO | ||
92 | 95 | ||
93 | void RC5_32_set_key(RC5_32_KEY *key, int len, unsigned char *data, | 96 | void RC5_32_set_key(RC5_32_KEY *key, int len, unsigned char *data, |
94 | int rounds); | 97 | int rounds); |
@@ -103,18 +106,6 @@ void RC5_32_cfb64_encrypt(unsigned char *in, unsigned char *out, long length, | |||
103 | void RC5_32_ofb64_encrypt(unsigned char *in, unsigned char *out, long length, | 106 | void RC5_32_ofb64_encrypt(unsigned char *in, unsigned char *out, long length, |
104 | RC5_32_KEY *schedule, unsigned char *ivec, int *num); | 107 | RC5_32_KEY *schedule, unsigned char *ivec, int *num); |
105 | 108 | ||
106 | #else | ||
107 | |||
108 | void RC5_32_set_key(); | ||
109 | void RC5_32_ecb_encrypt(); | ||
110 | void RC5_32_encrypt(); | ||
111 | void RC5_32_decrypt(); | ||
112 | void RC5_32_cbc_encrypt(); | ||
113 | void RC5_32_cfb64_encrypt(); | ||
114 | void RC5_32_ofb64_encrypt(); | ||
115 | |||
116 | #endif | ||
117 | |||
118 | #ifdef __cplusplus | 109 | #ifdef __cplusplus |
119 | } | 110 | } |
120 | #endif | 111 | #endif |