Enable assembler bits for BN (Montgomery), SHA1 and SHA256.
authormiod <miod@openbsd.org>
Sat, 3 May 2014 11:41:05 +0000 (11:41 +0000)
committermiod <miod@openbsd.org>
Sat, 3 May 2014 11:41:05 +0000 (11:41 +0000)
Assembler bits for AES remain commented out as they run slower than the C code.

lib/libcrypto/arch/powerpc/Makefile.inc [new file with mode: 0644]
lib/libcrypto/crypto/arch/powerpc/Makefile.inc [new file with mode: 0644]

diff --git a/lib/libcrypto/arch/powerpc/Makefile.inc b/lib/libcrypto/arch/powerpc/Makefile.inc
new file mode 100644 (file)
index 0000000..b6ef263
--- /dev/null
@@ -0,0 +1,44 @@
+# $OpenBSD: Makefile.inc,v 1.1 2014/05/03 11:41:05 miod Exp $
+
+# powerpc-specific libcrypto build rules
+
+# aes
+SRCS+= aes_core.c aes_cbc.c 
+# slower than C code
+#CFLAGS+= -DAES_ASM
+#SSLASM+= aes aes-ppc aes-ppc
+# bf
+SRCS+= bf_enc.c
+# bn
+SSLASM+= bn ppc bn-ppc
+SSLASM+= bn ppc-mont ppc-mont          # bn_mul_mont_int
+#SSLASM+= bn ppc64-mont ppc64-mont     # bn_mul_mont_fpu64
+CFLAGS+= -DOPENSSL_BN_ASM_MONT
+# des
+SRCS+= des_enc.c fcrypt_b.c
+# rc4
+SRCS+= rc4_enc.c rc4_skey.c
+## rc5
+#SRCS+= rc5_enc.c 
+# sha
+CFLAGS+= -DSHA1_ASM
+SSLASM+= sha sha1-ppc sha1-ppc
+CFLAGS+= -DSHA256_ASM
+SSLASM+= sha sha512-ppc sha256-ppc
+# whrlpool
+SRCS+= wp_block.c
+
+.for dir src dst in ${SSLASM}
+SRCS+= ${dst}.S
+GENERATED+=${dst}.S
+${dst}.S: ${LCRYPTO_SRC}/${dir}/asm/${src}.pl
+       /usr/bin/perl \
+               ${LCRYPTO_SRC}/${dir}/asm/${src}.pl linux32 ${.TARGET} > ${.TARGET}
+.endfor
+
+#CFLAGS+= -DOPENSSL_CPUID_OBJ          # it's commented out in ppccap.c
+SRCS+= ppccpuid.S ppccap.c
+GENERATED+=ppccpuid.S
+ppccpuid.S: ${LCRYPTO_SRC}/ppccpuid.pl
+       /usr/bin/perl \
+               ${LCRYPTO_SRC}/ppccpuid.pl linux32 > ${.TARGET}
diff --git a/lib/libcrypto/crypto/arch/powerpc/Makefile.inc b/lib/libcrypto/crypto/arch/powerpc/Makefile.inc
new file mode 100644 (file)
index 0000000..b6ef263
--- /dev/null
@@ -0,0 +1,44 @@
+# $OpenBSD: Makefile.inc,v 1.1 2014/05/03 11:41:05 miod Exp $
+
+# powerpc-specific libcrypto build rules
+
+# aes
+SRCS+= aes_core.c aes_cbc.c 
+# slower than C code
+#CFLAGS+= -DAES_ASM
+#SSLASM+= aes aes-ppc aes-ppc
+# bf
+SRCS+= bf_enc.c
+# bn
+SSLASM+= bn ppc bn-ppc
+SSLASM+= bn ppc-mont ppc-mont          # bn_mul_mont_int
+#SSLASM+= bn ppc64-mont ppc64-mont     # bn_mul_mont_fpu64
+CFLAGS+= -DOPENSSL_BN_ASM_MONT
+# des
+SRCS+= des_enc.c fcrypt_b.c
+# rc4
+SRCS+= rc4_enc.c rc4_skey.c
+## rc5
+#SRCS+= rc5_enc.c 
+# sha
+CFLAGS+= -DSHA1_ASM
+SSLASM+= sha sha1-ppc sha1-ppc
+CFLAGS+= -DSHA256_ASM
+SSLASM+= sha sha512-ppc sha256-ppc
+# whrlpool
+SRCS+= wp_block.c
+
+.for dir src dst in ${SSLASM}
+SRCS+= ${dst}.S
+GENERATED+=${dst}.S
+${dst}.S: ${LCRYPTO_SRC}/${dir}/asm/${src}.pl
+       /usr/bin/perl \
+               ${LCRYPTO_SRC}/${dir}/asm/${src}.pl linux32 ${.TARGET} > ${.TARGET}
+.endfor
+
+#CFLAGS+= -DOPENSSL_CPUID_OBJ          # it's commented out in ppccap.c
+SRCS+= ppccpuid.S ppccap.c
+GENERATED+=ppccpuid.S
+ppccpuid.S: ${LCRYPTO_SRC}/ppccpuid.pl
+       /usr/bin/perl \
+               ${LCRYPTO_SRC}/ppccpuid.pl linux32 > ${.TARGET}