Add the DragonFly cvs id and perform general cleanups on cvs/rcs/sccs ids. Most
[dragonfly.git] / secure / lib / libcrypto / i386 / rc5-586.s
1         # $FreeBSD: src/secure/lib/libcrypto/i386/rc5-586.s,v 1.1.4.1 2003/02/14 22:38:15 nectar Exp $
2         # $DragonFly: src/secure/lib/libcrypto/i386/Attic/rc5-586.s,v 1.2 2003/06/17 04:27:48 dillon Exp $
3         # Dont even think of reading this code 
4         # It was automatically generated by rc5-586.pl 
5         # Which is a perl program used to generate the x86 assember for 
6         # any of elf, a.out, BSDI, Win32, gaswin (for GNU as on Win32) or Solaris 
7         # eric <eay@cryptsoft.com> 
8
9         .file   "rc5-586.s"
10         .version        "01.01"
11 gcc2_compiled.:
12 .text
13         .align 16
14 .globl RC5_32_encrypt
15         .type   RC5_32_encrypt,@function
16 RC5_32_encrypt:
17
18         pushl   %ebp
19         pushl   %esi
20         pushl   %edi
21         movl    16(%esp),       %edx
22         movl    20(%esp),       %ebp
23         # Load the 2 words 
24         movl    (%edx),         %edi
25         movl    4(%edx),        %esi
26         pushl   %ebx
27         movl    (%ebp),         %ebx
28         addl    4(%ebp),        %edi
29         addl    8(%ebp),        %esi
30         xorl    %esi,           %edi
31         movl    12(%ebp),       %eax
32         movl    %esi,           %ecx
33         roll    %cl,            %edi
34         addl    %eax,           %edi
35         xorl    %edi,           %esi
36         movl    16(%ebp),       %eax
37         movl    %edi,           %ecx
38         roll    %cl,            %esi
39         addl    %eax,           %esi
40         xorl    %esi,           %edi
41         movl    20(%ebp),       %eax
42         movl    %esi,           %ecx
43         roll    %cl,            %edi
44         addl    %eax,           %edi
45         xorl    %edi,           %esi
46         movl    24(%ebp),       %eax
47         movl    %edi,           %ecx
48         roll    %cl,            %esi
49         addl    %eax,           %esi
50         xorl    %esi,           %edi
51         movl    28(%ebp),       %eax
52         movl    %esi,           %ecx
53         roll    %cl,            %edi
54         addl    %eax,           %edi
55         xorl    %edi,           %esi
56         movl    32(%ebp),       %eax
57         movl    %edi,           %ecx
58         roll    %cl,            %esi
59         addl    %eax,           %esi
60         xorl    %esi,           %edi
61         movl    36(%ebp),       %eax
62         movl    %esi,           %ecx
63         roll    %cl,            %edi
64         addl    %eax,           %edi
65         xorl    %edi,           %esi
66         movl    40(%ebp),       %eax
67         movl    %edi,           %ecx
68         roll    %cl,            %esi
69         addl    %eax,           %esi
70         xorl    %esi,           %edi
71         movl    44(%ebp),       %eax
72         movl    %esi,           %ecx
73         roll    %cl,            %edi
74         addl    %eax,           %edi
75         xorl    %edi,           %esi
76         movl    48(%ebp),       %eax
77         movl    %edi,           %ecx
78         roll    %cl,            %esi
79         addl    %eax,           %esi
80         xorl    %esi,           %edi
81         movl    52(%ebp),       %eax
82         movl    %esi,           %ecx
83         roll    %cl,            %edi
84         addl    %eax,           %edi
85         xorl    %edi,           %esi
86         movl    56(%ebp),       %eax
87         movl    %edi,           %ecx
88         roll    %cl,            %esi
89         addl    %eax,           %esi
90         xorl    %esi,           %edi
91         movl    60(%ebp),       %eax
92         movl    %esi,           %ecx
93         roll    %cl,            %edi
94         addl    %eax,           %edi
95         xorl    %edi,           %esi
96         movl    64(%ebp),       %eax
97         movl    %edi,           %ecx
98         roll    %cl,            %esi
99         addl    %eax,           %esi
100         xorl    %esi,           %edi
101         movl    68(%ebp),       %eax
102         movl    %esi,           %ecx
103         roll    %cl,            %edi
104         addl    %eax,           %edi
105         xorl    %edi,           %esi
106         movl    72(%ebp),       %eax
107         movl    %edi,           %ecx
108         roll    %cl,            %esi
109         addl    %eax,           %esi
110         cmpl    $8,             %ebx
111         je      .L000rc5_exit
112         xorl    %esi,           %edi
113         movl    76(%ebp),       %eax
114         movl    %esi,           %ecx
115         roll    %cl,            %edi
116         addl    %eax,           %edi
117         xorl    %edi,           %esi
118         movl    80(%ebp),       %eax
119         movl    %edi,           %ecx
120         roll    %cl,            %esi
121         addl    %eax,           %esi
122         xorl    %esi,           %edi
123         movl    84(%ebp),       %eax
124         movl    %esi,           %ecx
125         roll    %cl,            %edi
126         addl    %eax,           %edi
127         xorl    %edi,           %esi
128         movl    88(%ebp),       %eax
129         movl    %edi,           %ecx
130         roll    %cl,            %esi
131         addl    %eax,           %esi
132         xorl    %esi,           %edi
133         movl    92(%ebp),       %eax
134         movl    %esi,           %ecx
135         roll    %cl,            %edi
136         addl    %eax,           %edi
137         xorl    %edi,           %esi
138         movl    96(%ebp),       %eax
139         movl    %edi,           %ecx
140         roll    %cl,            %esi
141         addl    %eax,           %esi
142         xorl    %esi,           %edi
143         movl    100(%ebp),      %eax
144         movl    %esi,           %ecx
145         roll    %cl,            %edi
146         addl    %eax,           %edi
147         xorl    %edi,           %esi
148         movl    104(%ebp),      %eax
149         movl    %edi,           %ecx
150         roll    %cl,            %esi
151         addl    %eax,           %esi
152         cmpl    $12,            %ebx
153         je      .L000rc5_exit
154         xorl    %esi,           %edi
155         movl    108(%ebp),      %eax
156         movl    %esi,           %ecx
157         roll    %cl,            %edi
158         addl    %eax,           %edi
159         xorl    %edi,           %esi
160         movl    112(%ebp),      %eax
161         movl    %edi,           %ecx
162         roll    %cl,            %esi
163         addl    %eax,           %esi
164         xorl    %esi,           %edi
165         movl    116(%ebp),      %eax
166         movl    %esi,           %ecx
167         roll    %cl,            %edi
168         addl    %eax,           %edi
169         xorl    %edi,           %esi
170         movl    120(%ebp),      %eax
171         movl    %edi,           %ecx
172         roll    %cl,            %esi
173         addl    %eax,           %esi
174         xorl    %esi,           %edi
175         movl    124(%ebp),      %eax
176         movl    %esi,           %ecx
177         roll    %cl,            %edi
178         addl    %eax,           %edi
179         xorl    %edi,           %esi
180         movl    128(%ebp),      %eax
181         movl    %edi,           %ecx
182         roll    %cl,            %esi
183         addl    %eax,           %esi
184         xorl    %esi,           %edi
185         movl    132(%ebp),      %eax
186         movl    %esi,           %ecx
187         roll    %cl,            %edi
188         addl    %eax,           %edi
189         xorl    %edi,           %esi
190         movl    136(%ebp),      %eax
191         movl    %edi,           %ecx
192         roll    %cl,            %esi
193         addl    %eax,           %esi
194 .L000rc5_exit:
195         movl    %edi,           (%edx)
196         movl    %esi,           4(%edx)
197         popl    %ebx
198         popl    %edi
199         popl    %esi
200         popl    %ebp
201         ret
202 .L_RC5_32_encrypt_end:
203         .size   RC5_32_encrypt,.L_RC5_32_encrypt_end-RC5_32_encrypt
204 .ident  "desasm.pl"
205 .text
206         .align 16
207 .globl RC5_32_decrypt
208         .type   RC5_32_decrypt,@function
209 RC5_32_decrypt:
210
211         pushl   %ebp
212         pushl   %esi
213         pushl   %edi
214         movl    16(%esp),       %edx
215         movl    20(%esp),       %ebp
216         # Load the 2 words 
217         movl    (%edx),         %edi
218         movl    4(%edx),        %esi
219         pushl   %ebx
220         movl    (%ebp),         %ebx
221         cmpl    $12,            %ebx
222         je      .L001rc5_dec_12
223         cmpl    $8,             %ebx
224         je      .L002rc5_dec_8
225         movl    136(%ebp),      %eax
226         subl    %eax,           %esi
227         movl    %edi,           %ecx
228         rorl    %cl,            %esi
229         xorl    %edi,           %esi
230         movl    132(%ebp),      %eax
231         subl    %eax,           %edi
232         movl    %esi,           %ecx
233         rorl    %cl,            %edi
234         xorl    %esi,           %edi
235         movl    128(%ebp),      %eax
236         subl    %eax,           %esi
237         movl    %edi,           %ecx
238         rorl    %cl,            %esi
239         xorl    %edi,           %esi
240         movl    124(%ebp),      %eax
241         subl    %eax,           %edi
242         movl    %esi,           %ecx
243         rorl    %cl,            %edi
244         xorl    %esi,           %edi
245         movl    120(%ebp),      %eax
246         subl    %eax,           %esi
247         movl    %edi,           %ecx
248         rorl    %cl,            %esi
249         xorl    %edi,           %esi
250         movl    116(%ebp),      %eax
251         subl    %eax,           %edi
252         movl    %esi,           %ecx
253         rorl    %cl,            %edi
254         xorl    %esi,           %edi
255         movl    112(%ebp),      %eax
256         subl    %eax,           %esi
257         movl    %edi,           %ecx
258         rorl    %cl,            %esi
259         xorl    %edi,           %esi
260         movl    108(%ebp),      %eax
261         subl    %eax,           %edi
262         movl    %esi,           %ecx
263         rorl    %cl,            %edi
264         xorl    %esi,           %edi
265 .L001rc5_dec_12:
266         movl    104(%ebp),      %eax
267         subl    %eax,           %esi
268         movl    %edi,           %ecx
269         rorl    %cl,            %esi
270         xorl    %edi,           %esi
271         movl    100(%ebp),      %eax
272         subl    %eax,           %edi
273         movl    %esi,           %ecx
274         rorl    %cl,            %edi
275         xorl    %esi,           %edi
276         movl    96(%ebp),       %eax
277         subl    %eax,           %esi
278         movl    %edi,           %ecx
279         rorl    %cl,            %esi
280         xorl    %edi,           %esi
281         movl    92(%ebp),       %eax
282         subl    %eax,           %edi
283         movl    %esi,           %ecx
284         rorl    %cl,            %edi
285         xorl    %esi,           %edi
286         movl    88(%ebp),       %eax
287         subl    %eax,           %esi
288         movl    %edi,           %ecx
289         rorl    %cl,            %esi
290         xorl    %edi,           %esi
291         movl    84(%ebp),       %eax
292         subl    %eax,           %edi
293         movl    %esi,           %ecx
294         rorl    %cl,            %edi
295         xorl    %esi,           %edi
296         movl    80(%ebp),       %eax
297         subl    %eax,           %esi
298         movl    %edi,           %ecx
299         rorl    %cl,            %esi
300         xorl    %edi,           %esi
301         movl    76(%ebp),       %eax
302         subl    %eax,           %edi
303         movl    %esi,           %ecx
304         rorl    %cl,            %edi
305         xorl    %esi,           %edi
306 .L002rc5_dec_8:
307         movl    72(%ebp),       %eax
308         subl    %eax,           %esi
309         movl    %edi,           %ecx
310         rorl    %cl,            %esi
311         xorl    %edi,           %esi
312         movl    68(%ebp),       %eax
313         subl    %eax,           %edi
314         movl    %esi,           %ecx
315         rorl    %cl,            %edi
316         xorl    %esi,           %edi
317         movl    64(%ebp),       %eax
318         subl    %eax,           %esi
319         movl    %edi,           %ecx
320         rorl    %cl,            %esi
321         xorl    %edi,           %esi
322         movl    60(%ebp),       %eax
323         subl    %eax,           %edi
324         movl    %esi,           %ecx
325         rorl    %cl,            %edi
326         xorl    %esi,           %edi
327         movl    56(%ebp),       %eax
328         subl    %eax,           %esi
329         movl    %edi,           %ecx
330         rorl    %cl,            %esi
331         xorl    %edi,           %esi
332         movl    52(%ebp),       %eax
333         subl    %eax,           %edi
334         movl    %esi,           %ecx
335         rorl    %cl,            %edi
336         xorl    %esi,           %edi
337         movl    48(%ebp),       %eax
338         subl    %eax,           %esi
339         movl    %edi,           %ecx
340         rorl    %cl,            %esi
341         xorl    %edi,           %esi
342         movl    44(%ebp),       %eax
343         subl    %eax,           %edi
344         movl    %esi,           %ecx
345         rorl    %cl,            %edi
346         xorl    %esi,           %edi
347         movl    40(%ebp),       %eax
348         subl    %eax,           %esi
349         movl    %edi,           %ecx
350         rorl    %cl,            %esi
351         xorl    %edi,           %esi
352         movl    36(%ebp),       %eax
353         subl    %eax,           %edi
354         movl    %esi,           %ecx
355         rorl    %cl,            %edi
356         xorl    %esi,           %edi
357         movl    32(%ebp),       %eax
358         subl    %eax,           %esi
359         movl    %edi,           %ecx
360         rorl    %cl,            %esi
361         xorl    %edi,           %esi
362         movl    28(%ebp),       %eax
363         subl    %eax,           %edi
364         movl    %esi,           %ecx
365         rorl    %cl,            %edi
366         xorl    %esi,           %edi
367         movl    24(%ebp),       %eax
368         subl    %eax,           %esi
369         movl    %edi,           %ecx
370         rorl    %cl,            %esi
371         xorl    %edi,           %esi
372         movl    20(%ebp),       %eax
373         subl    %eax,           %edi
374         movl    %esi,           %ecx
375         rorl    %cl,            %edi
376         xorl    %esi,           %edi
377         movl    16(%ebp),       %eax
378         subl    %eax,           %esi
379         movl    %edi,           %ecx
380         rorl    %cl,            %esi
381         xorl    %edi,           %esi
382         movl    12(%ebp),       %eax
383         subl    %eax,           %edi
384         movl    %esi,           %ecx
385         rorl    %cl,            %edi
386         xorl    %esi,           %edi
387         subl    8(%ebp),        %esi
388         subl    4(%ebp),        %edi
389 .L003rc5_exit:
390         movl    %edi,           (%edx)
391         movl    %esi,           4(%edx)
392         popl    %ebx
393         popl    %edi
394         popl    %esi
395         popl    %ebp
396         ret
397 .L_RC5_32_decrypt_end:
398         .size   RC5_32_decrypt,.L_RC5_32_decrypt_end-RC5_32_decrypt
399 .ident  "desasm.pl"
400 .text
401         .align 16
402 .globl RC5_32_cbc_encrypt
403         .type   RC5_32_cbc_encrypt,@function
404 RC5_32_cbc_encrypt:
405
406         pushl   %ebp
407         pushl   %ebx
408         pushl   %esi
409         pushl   %edi
410         movl    28(%esp),       %ebp
411         # getting iv ptr from parameter 4 
412         movl    36(%esp),       %ebx
413         movl    (%ebx),         %esi
414         movl    4(%ebx),        %edi
415         pushl   %edi
416         pushl   %esi
417         pushl   %edi
418         pushl   %esi
419         movl    %esp,           %ebx
420         movl    36(%esp),       %esi
421         movl    40(%esp),       %edi
422         # getting encrypt flag from parameter 5 
423         movl    56(%esp),       %ecx
424         # get and push parameter 3 
425         movl    48(%esp),       %eax
426         pushl   %eax
427         pushl   %ebx
428         cmpl    $0,             %ecx
429         jz      .L004decrypt
430         andl    $4294967288,    %ebp
431         movl    8(%esp),        %eax
432         movl    12(%esp),       %ebx
433         jz      .L005encrypt_finish
434 .L006encrypt_loop:
435         movl    (%esi),         %ecx
436         movl    4(%esi),        %edx
437         xorl    %ecx,           %eax
438         xorl    %edx,           %ebx
439         movl    %eax,           8(%esp)
440         movl    %ebx,           12(%esp)
441         call    RC5_32_encrypt
442         movl    8(%esp),        %eax
443         movl    12(%esp),       %ebx
444         movl    %eax,           (%edi)
445         movl    %ebx,           4(%edi)
446         addl    $8,             %esi
447         addl    $8,             %edi
448         subl    $8,             %ebp
449         jnz     .L006encrypt_loop
450 .L005encrypt_finish:
451         movl    52(%esp),       %ebp
452         andl    $7,             %ebp
453         jz      .L007finish
454         xorl    %ecx,           %ecx
455         xorl    %edx,           %edx
456         movl    .L008cbc_enc_jmp_table(,%ebp,4),%ebp
457         jmp     *%ebp
458 .L009ej7:
459         movb    6(%esi),        %dh
460         sall    $8,             %edx
461 .L010ej6:
462         movb    5(%esi),        %dh
463 .L011ej5:
464         movb    4(%esi),        %dl
465 .L012ej4:
466         movl    (%esi),         %ecx
467         jmp     .L013ejend
468 .L014ej3:
469         movb    2(%esi),        %ch
470         sall    $8,             %ecx
471 .L015ej2:
472         movb    1(%esi),        %ch
473 .L016ej1:
474         movb    (%esi),         %cl
475 .L013ejend:
476         xorl    %ecx,           %eax
477         xorl    %edx,           %ebx
478         movl    %eax,           8(%esp)
479         movl    %ebx,           12(%esp)
480         call    RC5_32_encrypt
481         movl    8(%esp),        %eax
482         movl    12(%esp),       %ebx
483         movl    %eax,           (%edi)
484         movl    %ebx,           4(%edi)
485         jmp     .L007finish
486 .align 16
487 .L004decrypt:
488         andl    $4294967288,    %ebp
489         movl    16(%esp),       %eax
490         movl    20(%esp),       %ebx
491         jz      .L017decrypt_finish
492 .L018decrypt_loop:
493         movl    (%esi),         %eax
494         movl    4(%esi),        %ebx
495         movl    %eax,           8(%esp)
496         movl    %ebx,           12(%esp)
497         call    RC5_32_decrypt
498         movl    8(%esp),        %eax
499         movl    12(%esp),       %ebx
500         movl    16(%esp),       %ecx
501         movl    20(%esp),       %edx
502         xorl    %eax,           %ecx
503         xorl    %ebx,           %edx
504         movl    (%esi),         %eax
505         movl    4(%esi),        %ebx
506         movl    %ecx,           (%edi)
507         movl    %edx,           4(%edi)
508         movl    %eax,           16(%esp)
509         movl    %ebx,           20(%esp)
510         addl    $8,             %esi
511         addl    $8,             %edi
512         subl    $8,             %ebp
513         jnz     .L018decrypt_loop
514 .L017decrypt_finish:
515         movl    52(%esp),       %ebp
516         andl    $7,             %ebp
517         jz      .L007finish
518         movl    (%esi),         %eax
519         movl    4(%esi),        %ebx
520         movl    %eax,           8(%esp)
521         movl    %ebx,           12(%esp)
522         call    RC5_32_decrypt
523         movl    8(%esp),        %eax
524         movl    12(%esp),       %ebx
525         movl    16(%esp),       %ecx
526         movl    20(%esp),       %edx
527         xorl    %eax,           %ecx
528         xorl    %ebx,           %edx
529         movl    (%esi),         %eax
530         movl    4(%esi),        %ebx
531 .L019dj7:
532         rorl    $16,            %edx
533         movb    %dl,            6(%edi)
534         shrl    $16,            %edx
535 .L020dj6:
536         movb    %dh,            5(%edi)
537 .L021dj5:
538         movb    %dl,            4(%edi)
539 .L022dj4:
540         movl    %ecx,           (%edi)
541         jmp     .L023djend
542 .L024dj3:
543         rorl    $16,            %ecx
544         movb    %cl,            2(%edi)
545         sall    $16,            %ecx
546 .L025dj2:
547         movb    %ch,            1(%esi)
548 .L026dj1:
549         movb    %cl,            (%esi)
550 .L023djend:
551         jmp     .L007finish
552 .align 16
553 .L007finish:
554         movl    60(%esp),       %ecx
555         addl    $24,            %esp
556         movl    %eax,           (%ecx)
557         movl    %ebx,           4(%ecx)
558         popl    %edi
559         popl    %esi
560         popl    %ebx
561         popl    %ebp
562         ret
563 .align 16
564 .L008cbc_enc_jmp_table:
565         .long 0
566         .long .L016ej1
567         .long .L015ej2
568         .long .L014ej3
569         .long .L012ej4
570         .long .L011ej5
571         .long .L010ej6
572         .long .L009ej7
573 .align 16
574 .L027cbc_dec_jmp_table:
575         .long 0
576         .long .L026dj1
577         .long .L025dj2
578         .long .L024dj3
579         .long .L022dj4
580         .long .L021dj5
581         .long .L020dj6
582         .long .L019dj7
583 .L_RC5_32_cbc_encrypt_end:
584         .size   RC5_32_cbc_encrypt,.L_RC5_32_cbc_encrypt_end-RC5_32_cbc_encrypt
585 .ident  "desasm.pl"