only unroll on i386 and amd64 (where confirmed to be much faster).
authortedu <tedu@openbsd.org>
Thu, 18 Dec 2014 20:29:08 +0000 (20:29 +0000)
committertedu <tedu@openbsd.org>
Thu, 18 Dec 2014 20:29:08 +0000 (20:29 +0000)
naddy found sparc64 gets a little slower when unrolled.
ok deraadt

lib/libc/hash/sha2.c
sys/crypto/sha2.c

index db6046c..f77dc6b 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: sha2.c,v 1.19 2014/12/17 19:42:44 tedu Exp $  */
+/*     $OpenBSD: sha2.c,v 1.20 2014/12/18 20:29:08 tedu Exp $  */
 
 /*
  * FILE:       sha2.c
@@ -52,7 +52,9 @@
  *   #define SHA2_UNROLL_TRANSFORM
  *
  */
+#if defined(__amd64__) || defined(__i386__)
 #define SHA2_UNROLL_TRANSFORM
+#endif
 
 /*** SHA-224/256/384/512 Machine Architecture Definitions *****************/
 /*
index 06912c3..5ccb340 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: sha2.c,v 1.10 2014/12/17 19:40:24 tedu Exp $  */
+/*     $OpenBSD: sha2.c,v 1.11 2014/12/18 20:29:08 tedu Exp $  */
 
 /*
  * FILE:       sha2.c
  *
  */
 #ifndef SMALL_KERNEL
+#if defined(__amd64__) || defined(__i386__)
 #define SHA2_UNROLL_TRANSFORM
 #endif
-
+#endif
 
 /*** SHA-256/384/512 Machine Architecture Definitions *****************/
 /*