1 /* $NetBSD: bf_enc_586.S,v 1.1 2001/09/09 11:01:01 tls Exp $ */
2 /* $FreeBSD: src/sys/crypto/blowfish/arch/i386/bf_enc_586.S,v 1.1.2.1 2002/03/26 10:12:24 ume Exp $ */
3 /* $DragonFly: src/sys/crypto/blowfish/arch/i386/bf_enc_586.S,v 1.3 2004/02/13 16:13:44 joerg Exp $ */
5 /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
8 * This package is an SSL implementation written
9 * by Eric Young (eay@cryptsoft.com).
10 * The implementation was written so as to conform with Netscapes SSL.
12 * This library is free for commercial and non-commercial use as long as
13 * the following conditions are aheared to. The following conditions
14 * apply to all code found in this distribution, be it the RC4, RSA,
15 * lhash, DES, etc., code; not just the SSL code. The SSL documentation
16 * included with this distribution is covered by the same copyright terms
17 * except that the holder is Tim Hudson (tjh@cryptsoft.com).
19 * Copyright remains Eric Young's, and as such any Copyright notices in
20 * the code are not to be removed.
21 * If this package is used in a product, Eric Young should be given attribution
22 * as the author of the parts of the library used.
23 * This can be in the form of a textual message at program startup or
24 * in documentation (online or textual) provided with the package.
26 * Redistribution and use in source and binary forms, with or without
27 * modification, are permitted provided that the following conditions
29 * 1. Redistributions of source code must retain the copyright
30 * notice, this list of conditions and the following disclaimer.
31 * 2. Redistributions in binary form must reproduce the above copyright
32 * notice, this list of conditions and the following disclaimer in the
33 * documentation and/or other materials provided with the distribution.
34 * 3. All advertising materials mentioning features or use of this software
35 * must display the following acknowledgement:
36 * "This product includes cryptographic software written by
37 * Eric Young (eay@cryptsoft.com)"
38 * The word 'cryptographic' can be left out if the rouines from the library
39 * being used are not cryptographic related :-).
40 * 4. If you include any Windows specific code (or a derivative thereof) from
41 * the apps directory (application code) you must include an acknowledgement:
42 * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
44 * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
45 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
46 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
47 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
48 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
49 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
50 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
51 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
52 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
53 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
56 * The licence and distribution terms for any publically available version or
57 * derivative of this code cannot be changed. i.e. this code cannot simply be
58 * copied and put under another distribution licence
59 * [including the GNU Public Licence.]
63 * Modified from the output of `perl bf-586.pl elf' by
64 * Jason R. Thorpe <thorpej@zembu.com> and Thor Lancelot Simon
68 #include <i386/include/asm.h>
69 #define _C_LABEL CNAME
78 /* Load the 2 words */
96 movl 72(%ebp,%eax,4),%eax
97 movl 1096(%ebp,%ebx,4),%ebx
99 movl 2120(%ebp,%ecx,4),%eax
101 movl 3144(%ebp,%edx,4),%edx
116 movl 72(%ebp,%eax,4),%eax
117 movl 1096(%ebp,%ebx,4),%ebx
119 movl 2120(%ebp,%ecx,4),%eax
121 movl 3144(%ebp,%edx,4),%edx
136 movl 72(%ebp,%eax,4),%eax
137 movl 1096(%ebp,%ebx,4),%ebx
139 movl 2120(%ebp,%ecx,4),%eax
141 movl 3144(%ebp,%edx,4),%edx
156 movl 72(%ebp,%eax,4),%eax
157 movl 1096(%ebp,%ebx,4),%ebx
159 movl 2120(%ebp,%ecx,4),%eax
161 movl 3144(%ebp,%edx,4),%edx
176 movl 72(%ebp,%eax,4),%eax
177 movl 1096(%ebp,%ebx,4),%ebx
179 movl 2120(%ebp,%ecx,4),%eax
181 movl 3144(%ebp,%edx,4),%edx
196 movl 72(%ebp,%eax,4),%eax
197 movl 1096(%ebp,%ebx,4),%ebx
199 movl 2120(%ebp,%ecx,4),%eax
201 movl 3144(%ebp,%edx,4),%edx
216 movl 72(%ebp,%eax,4),%eax
217 movl 1096(%ebp,%ebx,4),%ebx
219 movl 2120(%ebp,%ecx,4),%eax
221 movl 3144(%ebp,%edx,4),%edx
236 movl 72(%ebp,%eax,4),%eax
237 movl 1096(%ebp,%ebx,4),%ebx
239 movl 2120(%ebp,%ecx,4),%eax
241 movl 3144(%ebp,%edx,4),%edx
256 movl 72(%ebp,%eax,4),%eax
257 movl 1096(%ebp,%ebx,4),%ebx
259 movl 2120(%ebp,%ecx,4),%eax
261 movl 3144(%ebp,%edx,4),%edx
276 movl 72(%ebp,%eax,4),%eax
277 movl 1096(%ebp,%ebx,4),%ebx
279 movl 2120(%ebp,%ecx,4),%eax
281 movl 3144(%ebp,%edx,4),%edx
296 movl 72(%ebp,%eax,4),%eax
297 movl 1096(%ebp,%ebx,4),%ebx
299 movl 2120(%ebp,%ecx,4),%eax
301 movl 3144(%ebp,%edx,4),%edx
316 movl 72(%ebp,%eax,4),%eax
317 movl 1096(%ebp,%ebx,4),%ebx
319 movl 2120(%ebp,%ecx,4),%eax
321 movl 3144(%ebp,%edx,4),%edx
336 movl 72(%ebp,%eax,4),%eax
337 movl 1096(%ebp,%ebx,4),%ebx
339 movl 2120(%ebp,%ecx,4),%eax
341 movl 3144(%ebp,%edx,4),%edx
356 movl 72(%ebp,%eax,4),%eax
357 movl 1096(%ebp,%ebx,4),%ebx
359 movl 2120(%ebp,%ecx,4),%eax
361 movl 3144(%ebp,%edx,4),%edx
376 movl 72(%ebp,%eax,4),%eax
377 movl 1096(%ebp,%ebx,4),%ebx
379 movl 2120(%ebp,%ecx,4),%eax
381 movl 3144(%ebp,%edx,4),%edx
396 movl 72(%ebp,%eax,4),%eax
397 movl 1096(%ebp,%ebx,4),%ebx
399 movl 2120(%ebp,%ecx,4),%eax
401 movl 3144(%ebp,%edx,4),%edx
403 /* Load parameter 0 (16) enc=1 */
416 .size _C_LABEL(BF_encrypt),.L_BF_encrypt_end-_C_LABEL(BF_encrypt)
425 /* Load the 2 words */
443 movl 72(%ebp,%eax,4),%eax
444 movl 1096(%ebp,%ebx,4),%ebx
446 movl 2120(%ebp,%ecx,4),%eax
448 movl 3144(%ebp,%edx,4),%edx
463 movl 72(%ebp,%eax,4),%eax
464 movl 1096(%ebp,%ebx,4),%ebx
466 movl 2120(%ebp,%ecx,4),%eax
468 movl 3144(%ebp,%edx,4),%edx
483 movl 72(%ebp,%eax,4),%eax
484 movl 1096(%ebp,%ebx,4),%ebx
486 movl 2120(%ebp,%ecx,4),%eax
488 movl 3144(%ebp,%edx,4),%edx
503 movl 72(%ebp,%eax,4),%eax
504 movl 1096(%ebp,%ebx,4),%ebx
506 movl 2120(%ebp,%ecx,4),%eax
508 movl 3144(%ebp,%edx,4),%edx
523 movl 72(%ebp,%eax,4),%eax
524 movl 1096(%ebp,%ebx,4),%ebx
526 movl 2120(%ebp,%ecx,4),%eax
528 movl 3144(%ebp,%edx,4),%edx
543 movl 72(%ebp,%eax,4),%eax
544 movl 1096(%ebp,%ebx,4),%ebx
546 movl 2120(%ebp,%ecx,4),%eax
548 movl 3144(%ebp,%edx,4),%edx
563 movl 72(%ebp,%eax,4),%eax
564 movl 1096(%ebp,%ebx,4),%ebx
566 movl 2120(%ebp,%ecx,4),%eax
568 movl 3144(%ebp,%edx,4),%edx
583 movl 72(%ebp,%eax,4),%eax
584 movl 1096(%ebp,%ebx,4),%ebx
586 movl 2120(%ebp,%ecx,4),%eax
588 movl 3144(%ebp,%edx,4),%edx
603 movl 72(%ebp,%eax,4),%eax
604 movl 1096(%ebp,%ebx,4),%ebx
606 movl 2120(%ebp,%ecx,4),%eax
608 movl 3144(%ebp,%edx,4),%edx
623 movl 72(%ebp,%eax,4),%eax
624 movl 1096(%ebp,%ebx,4),%ebx
626 movl 2120(%ebp,%ecx,4),%eax
628 movl 3144(%ebp,%edx,4),%edx
643 movl 72(%ebp,%eax,4),%eax
644 movl 1096(%ebp,%ebx,4),%ebx
646 movl 2120(%ebp,%ecx,4),%eax
648 movl 3144(%ebp,%edx,4),%edx
663 movl 72(%ebp,%eax,4),%eax
664 movl 1096(%ebp,%ebx,4),%ebx
666 movl 2120(%ebp,%ecx,4),%eax
668 movl 3144(%ebp,%edx,4),%edx
683 movl 72(%ebp,%eax,4),%eax
684 movl 1096(%ebp,%ebx,4),%ebx
686 movl 2120(%ebp,%ecx,4),%eax
688 movl 3144(%ebp,%edx,4),%edx
703 movl 72(%ebp,%eax,4),%eax
704 movl 1096(%ebp,%ebx,4),%ebx
706 movl 2120(%ebp,%ecx,4),%eax
708 movl 3144(%ebp,%edx,4),%edx
723 movl 72(%ebp,%eax,4),%eax
724 movl 1096(%ebp,%ebx,4),%ebx
726 movl 2120(%ebp,%ecx,4),%eax
728 movl 3144(%ebp,%edx,4),%edx
743 movl 72(%ebp,%eax,4),%eax
744 movl 1096(%ebp,%ebx,4),%ebx
746 movl 2120(%ebp,%ecx,4),%eax
748 movl 3144(%ebp,%edx,4),%edx
750 /* Load parameter 0 (1) enc=0 */
763 .size _C_LABEL(BF_decrypt),.L_BF_decrypt_end-_C_LABEL(BF_decrypt)