Enable use of assembly code for AES, BN (Montgomery), SHA1, SHA256 and SHA512.
authormiod <miod@openbsd.org>
Thu, 1 May 2014 22:27:59 +0000 (22:27 +0000)
committermiod <miod@openbsd.org>
Thu, 1 May 2014 22:27:59 +0000 (22:27 +0000)
RC4 assembler code is not used, as it runs about 35% slower than the C code.

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

diff --git a/lib/libcrypto/arch/hppa/Makefile.inc b/lib/libcrypto/arch/hppa/Makefile.inc
new file mode 100644 (file)
index 0000000..a25c693
--- /dev/null
@@ -0,0 +1,50 @@
+# $OpenBSD: Makefile.inc,v 1.1 2014/05/01 22:27:59 miod Exp $
+
+# hppa-specific libcrypto build rules
+
+# aes
+SRCS+= aes_core.c aes_cbc.c 
+CFLAGS+= -DAES_ASM
+SSLASM+= aes aes-parisc aes-parisc
+# bf
+SRCS+= bf_enc.c
+# bn
+SRCS+= bn_asm.c
+SSLASM+= bn parisc-mont parisc-mont
+# des
+SRCS+= des_enc.c fcrypt_b.c
+# modes
+CFLAGS+= -DGHASH_ASM
+SSLASM+= modes ghash-parisc ghash-parisc
+# rc4
+.if 0  # about 35% slower than C code
+SSLASM+= rc4 rc4-parisc rc4-parisc
+.else
+SRCS+= rc4_enc.c rc4_skey.c
+.endif
+## rc5
+#SRCS+= rc5_enc.c 
+# sha
+CFLAGS+= -DSHA1_ASM
+SSLASM+= sha sha1-parisc sha1-parisc
+CFLAGS+= -DSHA256_ASM
+SSLASM+= sha sha512-parisc sha256-parisc
+CFLAGS+= -DSHA512_ASM
+SSLASM+= sha sha512-parisc sha512-parisc
+# 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 32 ${.TARGET} > ${.TARGET}
+.endfor
+
+CFLAGS+= -DOPENSSL_CPUID_OBJ
+SRCS+= pariscid.S
+GENERATED+=pariscid.S
+pariscid.S: ${LCRYPTO_SRC}/pariscid.pl
+       /usr/bin/perl \
+               ${LCRYPTO_SRC}/pariscid.pl 32 > ${.TARGET}
diff --git a/lib/libcrypto/crypto/arch/hppa/Makefile.inc b/lib/libcrypto/crypto/arch/hppa/Makefile.inc
new file mode 100644 (file)
index 0000000..a25c693
--- /dev/null
@@ -0,0 +1,50 @@
+# $OpenBSD: Makefile.inc,v 1.1 2014/05/01 22:27:59 miod Exp $
+
+# hppa-specific libcrypto build rules
+
+# aes
+SRCS+= aes_core.c aes_cbc.c 
+CFLAGS+= -DAES_ASM
+SSLASM+= aes aes-parisc aes-parisc
+# bf
+SRCS+= bf_enc.c
+# bn
+SRCS+= bn_asm.c
+SSLASM+= bn parisc-mont parisc-mont
+# des
+SRCS+= des_enc.c fcrypt_b.c
+# modes
+CFLAGS+= -DGHASH_ASM
+SSLASM+= modes ghash-parisc ghash-parisc
+# rc4
+.if 0  # about 35% slower than C code
+SSLASM+= rc4 rc4-parisc rc4-parisc
+.else
+SRCS+= rc4_enc.c rc4_skey.c
+.endif
+## rc5
+#SRCS+= rc5_enc.c 
+# sha
+CFLAGS+= -DSHA1_ASM
+SSLASM+= sha sha1-parisc sha1-parisc
+CFLAGS+= -DSHA256_ASM
+SSLASM+= sha sha512-parisc sha256-parisc
+CFLAGS+= -DSHA512_ASM
+SSLASM+= sha sha512-parisc sha512-parisc
+# 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 32 ${.TARGET} > ${.TARGET}
+.endfor
+
+CFLAGS+= -DOPENSSL_CPUID_OBJ
+SRCS+= pariscid.S
+GENERATED+=pariscid.S
+pariscid.S: ${LCRYPTO_SRC}/pariscid.pl
+       /usr/bin/perl \
+               ${LCRYPTO_SRC}/pariscid.pl 32 > ${.TARGET}