1 /* $NetBSD: bf_enc_686.S,v 1.1 2001/09/09 11:01:02 tls Exp $ */
2 /* $FreeBSD: src/sys/crypto/blowfish/arch/i386/bf_enc_686.S,v 1.1.2.1 2002/03/26 10:12:24 ume Exp $ */
3 /* $DragonFly: src/sys/crypto/blowfish/arch/i386/bf_enc_686.S,v 1.3 2006/10/23 21:50:31 dillon 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-686.pl elf' by
64 * Jason R. Thorpe <thorpej@zembu.com> and Thor Lancelot Simon
68 #include <machine/asm.h>
69 #define _C_LABEL CNAME
78 /* Load the 2 words */
83 /* P pointer, s and enc flag */
96 movl 72(%edi,%eax,4),%esi
97 movl 1096(%edi,%ebx,4),%ebp
101 movl 2120(%edi,%eax,4),%eax
103 movl 3144(%edi,%ebx,4),%ebp
115 movl 72(%edi,%eax,4),%esi
116 movl 1096(%edi,%ebx,4),%ebp
120 movl 2120(%edi,%eax,4),%eax
122 movl 3144(%edi,%ebx,4),%ebp
134 movl 72(%edi,%eax,4),%esi
135 movl 1096(%edi,%ebx,4),%ebp
139 movl 2120(%edi,%eax,4),%eax
141 movl 3144(%edi,%ebx,4),%ebp
153 movl 72(%edi,%eax,4),%esi
154 movl 1096(%edi,%ebx,4),%ebp
158 movl 2120(%edi,%eax,4),%eax
160 movl 3144(%edi,%ebx,4),%ebp
172 movl 72(%edi,%eax,4),%esi
173 movl 1096(%edi,%ebx,4),%ebp
177 movl 2120(%edi,%eax,4),%eax
179 movl 3144(%edi,%ebx,4),%ebp
191 movl 72(%edi,%eax,4),%esi
192 movl 1096(%edi,%ebx,4),%ebp
196 movl 2120(%edi,%eax,4),%eax
198 movl 3144(%edi,%ebx,4),%ebp
210 movl 72(%edi,%eax,4),%esi
211 movl 1096(%edi,%ebx,4),%ebp
215 movl 2120(%edi,%eax,4),%eax
217 movl 3144(%edi,%ebx,4),%ebp
229 movl 72(%edi,%eax,4),%esi
230 movl 1096(%edi,%ebx,4),%ebp
234 movl 2120(%edi,%eax,4),%eax
236 movl 3144(%edi,%ebx,4),%ebp
248 movl 72(%edi,%eax,4),%esi
249 movl 1096(%edi,%ebx,4),%ebp
253 movl 2120(%edi,%eax,4),%eax
255 movl 3144(%edi,%ebx,4),%ebp
267 movl 72(%edi,%eax,4),%esi
268 movl 1096(%edi,%ebx,4),%ebp
272 movl 2120(%edi,%eax,4),%eax
274 movl 3144(%edi,%ebx,4),%ebp
286 movl 72(%edi,%eax,4),%esi
287 movl 1096(%edi,%ebx,4),%ebp
291 movl 2120(%edi,%eax,4),%eax
293 movl 3144(%edi,%ebx,4),%ebp
305 movl 72(%edi,%eax,4),%esi
306 movl 1096(%edi,%ebx,4),%ebp
310 movl 2120(%edi,%eax,4),%eax
312 movl 3144(%edi,%ebx,4),%ebp
324 movl 72(%edi,%eax,4),%esi
325 movl 1096(%edi,%ebx,4),%ebp
329 movl 2120(%edi,%eax,4),%eax
331 movl 3144(%edi,%ebx,4),%ebp
343 movl 72(%edi,%eax,4),%esi
344 movl 1096(%edi,%ebx,4),%ebp
348 movl 2120(%edi,%eax,4),%eax
350 movl 3144(%edi,%ebx,4),%ebp
362 movl 72(%edi,%eax,4),%esi
363 movl 1096(%edi,%ebx,4),%ebp
367 movl 2120(%edi,%eax,4),%eax
369 movl 3144(%edi,%ebx,4),%ebp
381 movl 72(%edi,%eax,4),%esi
382 movl 1096(%edi,%ebx,4),%ebp
386 movl 2120(%edi,%eax,4),%eax
388 movl 3144(%edi,%ebx,4),%ebp
402 .size _C_LABEL(BF_encrypt),.L_BF_encrypt_end-_C_LABEL(BF_encrypt)
411 /* Load the 2 words */
416 /* P pointer, s and enc flag */
429 movl 72(%edi,%eax,4),%esi
430 movl 1096(%edi,%ebx,4),%ebp
434 movl 2120(%edi,%eax,4),%eax
436 movl 3144(%edi,%ebx,4),%ebp
448 movl 72(%edi,%eax,4),%esi
449 movl 1096(%edi,%ebx,4),%ebp
453 movl 2120(%edi,%eax,4),%eax
455 movl 3144(%edi,%ebx,4),%ebp
467 movl 72(%edi,%eax,4),%esi
468 movl 1096(%edi,%ebx,4),%ebp
472 movl 2120(%edi,%eax,4),%eax
474 movl 3144(%edi,%ebx,4),%ebp
486 movl 72(%edi,%eax,4),%esi
487 movl 1096(%edi,%ebx,4),%ebp
491 movl 2120(%edi,%eax,4),%eax
493 movl 3144(%edi,%ebx,4),%ebp
505 movl 72(%edi,%eax,4),%esi
506 movl 1096(%edi,%ebx,4),%ebp
510 movl 2120(%edi,%eax,4),%eax
512 movl 3144(%edi,%ebx,4),%ebp
524 movl 72(%edi,%eax,4),%esi
525 movl 1096(%edi,%ebx,4),%ebp
529 movl 2120(%edi,%eax,4),%eax
531 movl 3144(%edi,%ebx,4),%ebp
543 movl 72(%edi,%eax,4),%esi
544 movl 1096(%edi,%ebx,4),%ebp
548 movl 2120(%edi,%eax,4),%eax
550 movl 3144(%edi,%ebx,4),%ebp
562 movl 72(%edi,%eax,4),%esi
563 movl 1096(%edi,%ebx,4),%ebp
567 movl 2120(%edi,%eax,4),%eax
569 movl 3144(%edi,%ebx,4),%ebp
581 movl 72(%edi,%eax,4),%esi
582 movl 1096(%edi,%ebx,4),%ebp
586 movl 2120(%edi,%eax,4),%eax
588 movl 3144(%edi,%ebx,4),%ebp
600 movl 72(%edi,%eax,4),%esi
601 movl 1096(%edi,%ebx,4),%ebp
605 movl 2120(%edi,%eax,4),%eax
607 movl 3144(%edi,%ebx,4),%ebp
619 movl 72(%edi,%eax,4),%esi
620 movl 1096(%edi,%ebx,4),%ebp
624 movl 2120(%edi,%eax,4),%eax
626 movl 3144(%edi,%ebx,4),%ebp
638 movl 72(%edi,%eax,4),%esi
639 movl 1096(%edi,%ebx,4),%ebp
643 movl 2120(%edi,%eax,4),%eax
645 movl 3144(%edi,%ebx,4),%ebp
657 movl 72(%edi,%eax,4),%esi
658 movl 1096(%edi,%ebx,4),%ebp
662 movl 2120(%edi,%eax,4),%eax
664 movl 3144(%edi,%ebx,4),%ebp
676 movl 72(%edi,%eax,4),%esi
677 movl 1096(%edi,%ebx,4),%ebp
681 movl 2120(%edi,%eax,4),%eax
683 movl 3144(%edi,%ebx,4),%ebp
695 movl 72(%edi,%eax,4),%esi
696 movl 1096(%edi,%ebx,4),%ebp
700 movl 2120(%edi,%eax,4),%eax
702 movl 3144(%edi,%ebx,4),%ebp
714 movl 72(%edi,%eax,4),%esi
715 movl 1096(%edi,%ebx,4),%ebp
719 movl 2120(%edi,%eax,4),%eax
721 movl 3144(%edi,%ebx,4),%ebp
735 .size _C_LABEL(BF_decrypt),.L_BF_decrypt_end-_C_LABEL(BF_decrypt)