Enable assembler code for AES, DES, GCM, SHA1, SHA256 and SHA512.
authormiod <miod@openbsd.org>
Sat, 3 May 2014 20:06:13 +0000 (20:06 +0000)
committermiod <miod@openbsd.org>
Sat, 3 May 2014 20:06:13 +0000 (20:06 +0000)
The sparcv9 BN code is not enabled, as it expects to run on a 32-bit
userland and will need to be fixed for 64-bit userland first.

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

diff --git a/lib/libcrypto/arch/sparc64/Makefile.inc b/lib/libcrypto/arch/sparc64/Makefile.inc
new file mode 100644 (file)
index 0000000..2565bd4
--- /dev/null
@@ -0,0 +1,46 @@
+# $OpenBSD: Makefile.inc,v 1.1 2014/05/03 20:06:13 miod Exp $
+
+# sparc64-specific libcrypto build rules
+
+# aes
+SRCS+= aes_core.c aes_cbc.c 
+CFLAGS+= -DAES_ASM
+SSLASM+= aes aes-sparcv9 aes-sparcv9
+# bf
+SRCS+= bf_enc.c
+# bn
+SRCS+= bn_asm.c
+# des
+SRCS+= fcrypt_b.c
+SRCS+= des_enc-sparc.S
+GENERATED+= des_enc-sparc.S
+des_enc-sparc.S: ${LCRYPTO_SRC}/des/asm/des_enc.m4
+       m4 ${LCRYPTO_SRC}/des/asm/des_enc.m4 > ${.TARGET}
+# modes
+CFLAGS+= -DGHASH_ASM
+SSLASM+= modes ghash-sparcv9 ghash-sparcv9
+# rc4
+SRCS+= rc4_enc.c rc4_skey.c
+## rc5
+#SRCS+= rc5_enc.c 
+# sha
+SSLASM+= sha sha1-sparcv9 sha1-sparcv9
+CFLAGS+= -DSHA1_ASM
+SSLASM+= sha sha512-sparcv9 sha256-sparcv9
+CFLAGS+= -DSHA256_ASM
+SSLASM+= sha sha512-sparcv9 sha512-sparcv9
+CFLAGS+= -DSHA512_ASM
+# 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/env CC=${CC} /usr/bin/perl \
+               ${LCRYPTO_SRC}/${dir}/asm/${src}.pl ${.TARGET} -m64 > ${.TARGET}
+.endfor
+
+# not until Montgomery code enabled
+#CFLAGS+= -DOPENSSL_CPUID_OBJ
+#SRCS+=        sparccpuid.S sparcv9cap.c
diff --git a/lib/libcrypto/crypto/arch/sparc64/Makefile.inc b/lib/libcrypto/crypto/arch/sparc64/Makefile.inc
new file mode 100644 (file)
index 0000000..2565bd4
--- /dev/null
@@ -0,0 +1,46 @@
+# $OpenBSD: Makefile.inc,v 1.1 2014/05/03 20:06:13 miod Exp $
+
+# sparc64-specific libcrypto build rules
+
+# aes
+SRCS+= aes_core.c aes_cbc.c 
+CFLAGS+= -DAES_ASM
+SSLASM+= aes aes-sparcv9 aes-sparcv9
+# bf
+SRCS+= bf_enc.c
+# bn
+SRCS+= bn_asm.c
+# des
+SRCS+= fcrypt_b.c
+SRCS+= des_enc-sparc.S
+GENERATED+= des_enc-sparc.S
+des_enc-sparc.S: ${LCRYPTO_SRC}/des/asm/des_enc.m4
+       m4 ${LCRYPTO_SRC}/des/asm/des_enc.m4 > ${.TARGET}
+# modes
+CFLAGS+= -DGHASH_ASM
+SSLASM+= modes ghash-sparcv9 ghash-sparcv9
+# rc4
+SRCS+= rc4_enc.c rc4_skey.c
+## rc5
+#SRCS+= rc5_enc.c 
+# sha
+SSLASM+= sha sha1-sparcv9 sha1-sparcv9
+CFLAGS+= -DSHA1_ASM
+SSLASM+= sha sha512-sparcv9 sha256-sparcv9
+CFLAGS+= -DSHA256_ASM
+SSLASM+= sha sha512-sparcv9 sha512-sparcv9
+CFLAGS+= -DSHA512_ASM
+# 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/env CC=${CC} /usr/bin/perl \
+               ${LCRYPTO_SRC}/${dir}/asm/${src}.pl ${.TARGET} -m64 > ${.TARGET}
+.endfor
+
+# not until Montgomery code enabled
+#CFLAGS+= -DOPENSSL_CPUID_OBJ
+#SRCS+=        sparccpuid.S sparcv9cap.c