Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/lib/libcrypto/arch/i386 Add support for building the assembl...



details:   https://anonhg.NetBSD.org/src/rev/436901db62a5
branches:  trunk
changeset: 495568:436901db62a5
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Mon Jul 31 19:08:02 2000 +0000

description:
Add support for building the assembly version of MD5 from OpenSSL.

Before:
Doing md5 for 3s on 8 size blocks: 1490796 md5's in 3.00s
Doing md5 for 3s on 64 size blocks: 895849 md5's in 3.00s
Doing md5 for 3s on 256 size blocks: 410807 md5's in 3.00s
Doing md5 for 3s on 1024 size blocks: 129416 md5's in 3.00s
Doing md5 for 3s on 8192 size blocks: 17527 md5's in 3.00s
type              8 bytes     64 bytes    256 bytes   1024 bytes   8192 bytes
md5               3975.46k    19111.45k    35055.53k    44173.99k    47860.39k

After:
Doing md5 for 3s on 8 size blocks: 2041410 md5's in 3.00s
Doing md5 for 3s on 64 size blocks: 1345402 md5's in 3.00s
Doing md5 for 3s on 256 size blocks: 669827 md5's in 3.10s
Doing md5 for 3s on 1024 size blocks: 221744 md5's in 2.96s
Doing md5 for 3s on 8192 size blocks: 30685 md5's in 3.00s
type              8 bytes     64 bytes    256 bytes   1024 bytes   8192 bytes
md5               5443.76k    28701.91k    56968.68k    76711.44k    83790.51k

diffstat:

 lib/libcrypto/arch/i386/md5.inc        |   14 +
 lib/libcrypto/arch/i386/md5_dgst_586.S |  738 +++++++++++++++++++++++++++++++++
 2 files changed, 752 insertions(+), 0 deletions(-)

diffs (truncated from 760 to 300 lines):

diff -r bba8d398f45d -r 436901db62a5 lib/libcrypto/arch/i386/md5.inc
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/lib/libcrypto/arch/i386/md5.inc   Mon Jul 31 19:08:02 2000 +0000
@@ -0,0 +1,14 @@
+#      $NetBSD: md5.inc,v 1.1 2000/07/31 19:08:02 thorpej Exp $
+#
+#      @(#) Copyright (c) 1995 Simon J. Gerraty
+#
+#      SRCS extracted from /home/current/src/lib/libcrypto/../../crypto/dist/openssl/crypto/md5/Makefile.ssl
+#
+
+.PATH: ${OPENSSLSRC}/crypto/md5
+.PATH: ${.CURDIR}/arch/i386
+
+CPPFLAGS+=     -I${OPENSSLSRC}/crypto/md5
+CPPFLAGS+=     -DMD5_ASM
+
+SRCS+=md5_dgst.c md5_dgst_586.S md5_one.c
diff -r bba8d398f45d -r 436901db62a5 lib/libcrypto/arch/i386/md5_dgst_586.S
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/lib/libcrypto/arch/i386/md5_dgst_586.S    Mon Jul 31 19:08:02 2000 +0000
@@ -0,0 +1,738 @@
+/*     $NetBSD: md5_dgst_586.S,v 1.1 2000/07/31 19:08:03 thorpej Exp $ */
+
+/* Copyright (C) 1995-1998 Eric Young (eay%cryptsoft.com@localhost)
+ * All rights reserved.
+ *
+ * This package is an SSL implementation written
+ * by Eric Young (eay%cryptsoft.com@localhost).
+ * The implementation was written so as to conform with Netscapes SSL.
+ * 
+ * This library is free for commercial and non-commercial use as long as
+ * the following conditions are aheared to.  The following conditions
+ * apply to all code found in this distribution, be it the RC4, RSA,
+ * lhash, DES, etc., code; not just the SSL code.  The SSL documentation
+ * included with this distribution is covered by the same copyright terms
+ * except that the holder is Tim Hudson (tjh%cryptsoft.com@localhost).
+ * 
+ * Copyright remains Eric Young's, and as such any Copyright notices in
+ * the code are not to be removed.
+ * If this package is used in a product, Eric Young should be given attribution
+ * as the author of the parts of the library used.
+ * This can be in the form of a textual message at program startup or
+ * in documentation (online or textual) provided with the package.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ *    must display the following acknowledgement:
+ *    "This product includes cryptographic software written by
+ *     Eric Young (eay%cryptsoft.com@localhost)"
+ *    The word 'cryptographic' can be left out if the rouines from the library
+ *    being used are not cryptographic related :-).
+ * 4. If you include any Windows specific code (or a derivative thereof) from 
+ *    the apps directory (application code) you must include an acknowledgement:
+ *    "This product includes software written by Tim Hudson (tjh%cryptsoft.com@localhost)"
+ * 
+ * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * 
+ * The licence and distribution terms for any publically available version or
+ * derivative of this code cannot be changed.  i.e. this code cannot simply be
+ * copied and put under another distribution licence
+ * [including the GNU Public Licence.]
+ */
+
+/*
+ * Modified from the output of `perl md5-586.pl elf' by
+ * Jason R. Thorpe <thorpej%zembu.com@localhost>.
+ */
+
+#include <machine/asm.h>
+
+ENTRY(md5_block_asm_host_order)
+       pushl   %esi
+       pushl   %edi
+       movl    12(%esp),       %edi
+       movl    16(%esp),       %esi
+       movl    20(%esp),       %ecx
+       pushl   %ebp
+       sall    $6,             %ecx
+       pushl   %ebx
+       addl    %esi,           %ecx
+       subl    $64,            %ecx
+       movl    (%edi),         %eax
+       pushl   %ecx
+       movl    4(%edi),        %ebx
+       movl    8(%edi),        %ecx
+       movl    12(%edi),       %edx
+L000start:
+
+       /* R0 section */
+       movl    %ecx,           %edi
+       movl    (%esi),         %ebp
+       /* R0 0 */
+       xorl    %edx,           %edi
+       andl    %ebx,           %edi
+       leal    3614090360(%eax,%ebp,1),%eax
+       xorl    %edx,           %edi
+       addl    %edi,           %eax
+       movl    %ebx,           %edi
+       roll    $7,             %eax
+       movl    4(%esi),        %ebp
+       addl    %ebx,           %eax
+       /* R0 1 */
+       xorl    %ecx,           %edi
+       andl    %eax,           %edi
+       leal    3905402710(%edx,%ebp,1),%edx
+       xorl    %ecx,           %edi
+       addl    %edi,           %edx
+       movl    %eax,           %edi
+       roll    $12,            %edx
+       movl    8(%esi),        %ebp
+       addl    %eax,           %edx
+       /* R0 2 */
+       xorl    %ebx,           %edi
+       andl    %edx,           %edi
+       leal    606105819(%ecx,%ebp,1),%ecx
+       xorl    %ebx,           %edi
+       addl    %edi,           %ecx
+       movl    %edx,           %edi
+       roll    $17,            %ecx
+       movl    12(%esi),       %ebp
+       addl    %edx,           %ecx
+       /* R0 3 */
+       xorl    %eax,           %edi
+       andl    %ecx,           %edi
+       leal    3250441966(%ebx,%ebp,1),%ebx
+       xorl    %eax,           %edi
+       addl    %edi,           %ebx
+       movl    %ecx,           %edi
+       roll    $22,            %ebx
+       movl    16(%esi),       %ebp
+       addl    %ecx,           %ebx
+       /* R0 4 */
+       xorl    %edx,           %edi
+       andl    %ebx,           %edi
+       leal    4118548399(%eax,%ebp,1),%eax
+       xorl    %edx,           %edi
+       addl    %edi,           %eax
+       movl    %ebx,           %edi
+       roll    $7,             %eax
+       movl    20(%esi),       %ebp
+       addl    %ebx,           %eax
+       /* R0 5 */
+       xorl    %ecx,           %edi
+       andl    %eax,           %edi
+       leal    1200080426(%edx,%ebp,1),%edx
+       xorl    %ecx,           %edi
+       addl    %edi,           %edx
+       movl    %eax,           %edi
+       roll    $12,            %edx
+       movl    24(%esi),       %ebp
+       addl    %eax,           %edx
+       /* R0 6 */
+       xorl    %ebx,           %edi
+       andl    %edx,           %edi
+       leal    2821735955(%ecx,%ebp,1),%ecx
+       xorl    %ebx,           %edi
+       addl    %edi,           %ecx
+       movl    %edx,           %edi
+       roll    $17,            %ecx
+       movl    28(%esi),       %ebp
+       addl    %edx,           %ecx
+       /* R0 7 */
+       xorl    %eax,           %edi
+       andl    %ecx,           %edi
+       leal    4249261313(%ebx,%ebp,1),%ebx
+       xorl    %eax,           %edi
+       addl    %edi,           %ebx
+       movl    %ecx,           %edi
+       roll    $22,            %ebx
+       movl    32(%esi),       %ebp
+       addl    %ecx,           %ebx
+       /* R0 8 */
+       xorl    %edx,           %edi
+       andl    %ebx,           %edi
+       leal    1770035416(%eax,%ebp,1),%eax
+       xorl    %edx,           %edi
+       addl    %edi,           %eax
+       movl    %ebx,           %edi
+       roll    $7,             %eax
+       movl    36(%esi),       %ebp
+       addl    %ebx,           %eax
+       /* R0 9 */
+       xorl    %ecx,           %edi
+       andl    %eax,           %edi
+       leal    2336552879(%edx,%ebp,1),%edx
+       xorl    %ecx,           %edi
+       addl    %edi,           %edx
+       movl    %eax,           %edi
+       roll    $12,            %edx
+       movl    40(%esi),       %ebp
+       addl    %eax,           %edx
+       /* R0 10 */
+       xorl    %ebx,           %edi
+       andl    %edx,           %edi
+       leal    4294925233(%ecx,%ebp,1),%ecx
+       xorl    %ebx,           %edi
+       addl    %edi,           %ecx
+       movl    %edx,           %edi
+       roll    $17,            %ecx
+       movl    44(%esi),       %ebp
+       addl    %edx,           %ecx
+       /* R0 11 */
+       xorl    %eax,           %edi
+       andl    %ecx,           %edi
+       leal    2304563134(%ebx,%ebp,1),%ebx
+       xorl    %eax,           %edi
+       addl    %edi,           %ebx
+       movl    %ecx,           %edi
+       roll    $22,            %ebx
+       movl    48(%esi),       %ebp
+       addl    %ecx,           %ebx
+       /* R0 12 */
+       xorl    %edx,           %edi
+       andl    %ebx,           %edi
+       leal    1804603682(%eax,%ebp,1),%eax
+       xorl    %edx,           %edi
+       addl    %edi,           %eax
+       movl    %ebx,           %edi
+       roll    $7,             %eax
+       movl    52(%esi),       %ebp
+       addl    %ebx,           %eax
+       /* R0 13 */
+       xorl    %ecx,           %edi
+       andl    %eax,           %edi
+       leal    4254626195(%edx,%ebp,1),%edx
+       xorl    %ecx,           %edi
+       addl    %edi,           %edx
+       movl    %eax,           %edi
+       roll    $12,            %edx
+       movl    56(%esi),       %ebp
+       addl    %eax,           %edx
+       /* R0 14 */
+       xorl    %ebx,           %edi
+       andl    %edx,           %edi
+       leal    2792965006(%ecx,%ebp,1),%ecx
+       xorl    %ebx,           %edi
+       addl    %edi,           %ecx
+       movl    %edx,           %edi
+       roll    $17,            %ecx
+       movl    60(%esi),       %ebp
+       addl    %edx,           %ecx
+       /* R0 15 */
+       xorl    %eax,           %edi
+       andl    %ecx,           %edi
+       leal    1236535329(%ebx,%ebp,1),%ebx
+       xorl    %eax,           %edi
+       addl    %edi,           %ebx
+       movl    %ecx,           %edi
+       roll    $22,            %ebx
+       movl    4(%esi),        %ebp
+       addl    %ecx,           %ebx
+
+       /* R1 section */
+       /* R1 16 */
+       leal    4129170786(%eax,%ebp,1),%eax
+       xorl    %ebx,           %edi
+       andl    %edx,           %edi
+       movl    24(%esi),       %ebp
+       xorl    %ecx,           %edi
+       addl    %edi,           %eax
+       movl    %ebx,           %edi
+       roll    $5,             %eax
+       addl    %ebx,           %eax
+       /* R1 17 */
+       leal    3225465664(%edx,%ebp,1),%edx
+       xorl    %eax,           %edi
+       andl    %ecx,           %edi
+       movl    44(%esi),       %ebp
+       xorl    %ebx,           %edi
+       addl    %edi,           %edx
+       movl    %eax,           %edi
+       roll    $9,             %edx
+       addl    %eax,           %edx
+       /* R1 18 */
+       leal    643717713(%ecx,%ebp,1),%ecx
+       xorl    %edx,           %edi
+       andl    %ebx,           %edi
+       movl    (%esi),         %ebp
+       xorl    %eax,           %edi
+       addl    %edi,           %ecx
+       movl    %edx,           %edi
+       roll    $14,            %ecx



Home | Main Index | Thread Index | Old Index