components/openssl/openssl-1.0.0/engines/t4/t4_sha2.S
changeset 603 1b966e9a6b03
parent 426 8c675b553a27
--- a/components/openssl/openssl-1.0.0/engines/t4/t4_sha2.S	Tue Nov 29 05:42:26 2011 -0800
+++ b/components/openssl/openssl-1.0.0/engines/t4/t4_sha2.S	Tue Nov 29 11:18:53 2011 -0800
@@ -1,23 +1,53 @@
 /*
- * CDDL HEADER START
+ * ====================================================================
+ * Copyright (c) 1998-2011 The OpenSSL Project.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
  *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
+ * 1. Redistributions of source code must retain the above 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 acknowledgment:
+ *    "This product includes software developed by the OpenSSL Project
+ *    for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
  *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
+ * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
+ *    endorse or promote products derived from this software without
+ *    prior written permission. For written permission, please contact
+ *    [email protected].
+ *
+ * 5. Products derived from this software may not be called "OpenSSL"
+ *    nor may "OpenSSL" appear in their names without prior written
+ *    permission of the OpenSSL Project.
+ *
+ * 6. Redistributions of any form whatsoever must retain the following
+ *    acknowledgment:
+ *    "This product includes software developed by the OpenSSL Project
+ *    for use in the OpenSSL Toolkit (http://www.openssl.org/)"
  *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
+ * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
+ * EXPRESSED 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 OpenSSL PROJECT OR
+ * ITS 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.
+ * ====================================================================
  */
+
 /*
  * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
  */
@@ -27,18 +57,19 @@
 #if defined(lint) || defined(__lint)
 
 #include <sys/types.h>
-#include <sys/sha2.h>
+#include <openssl/sha.h>
+#include "../engine/eng_t4_sha2_asm.h"
 
 /*ARGSUSED*/
 void
-t4_sha256_multiblock(SHA2_CTX *ctx, const uint8_t *input,
-    size_t nr_blocks)
+t4_sha256_multiblock(T4_SHA256_CTX *c, const void *input,
+	size_t num)
 { return; }
 
 /*ARGSUSED*/
 void
-t4_sha512_multiblock(SHA2_CTX *ctx, const uint8_t *input,
-    size_t nr_blocks)
+t4_sha512_multiblock(T4_SHA512_CTX *c, const void *input,
+	size_t num)
 { return; }
 
 #else	/* lint || __lint */
@@ -75,6 +106,8 @@
 	ldd	[%o1 + 0x30], %f20	!load 8 bytes of data
 	ldd	[%o1 + 0x38], %f22	!load 8 bytes of data
 
+!perform crypto instruction here
+	!sha256
 	.byte	0x81, 0xb0, 0x28, 0x40
 
 	dec	%o2
@@ -115,6 +148,8 @@
 	faligndata %f20, %f22, %f20
 	faligndata %f22, %f24, %f22
 
+!perform crypto instruction here
+	!sha256
 	.byte	0x81, 0xb0, 0x28, 0x40
 
 	dec	%o2
@@ -181,6 +216,8 @@
 	ldd	[%o1 + 0x70], %f44	!load 8 bytes of data
 	ldd	[%o1 + 0x78], %f46	!load 8 bytes of data
 
+!perform crypto instruction here
+	!sha512
 	.byte	0x81, 0xb0, 0x28, 0x60
 
 	dec	%o2
@@ -245,6 +282,8 @@
 	faligndata %f44, %f46, %f44
 	faligndata %f46, %f48, %f46
 
+!perform crypto instruction here
+	!sha512
 	.byte	0x81, 0xb0, 0x28, 0x60
 
 	dec	%o2