Enable assembler code for AES, BN (Montgomery), GCM128, SHA1, SHA256 and SHA512.
authormiod <miod@openbsd.org>
Sat, 3 May 2014 19:38:25 +0000 (19:38 +0000)
committermiod <miod@openbsd.org>
Sat, 3 May 2014 19:38:25 +0000 (19:38 +0000)
Note that GCM128 Neon code is currently not built (and thus not tested), as
the current toolchain does not support Neon instructions.

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

diff --git a/lib/libcrypto/arch/arm/Makefile.inc b/lib/libcrypto/arch/arm/Makefile.inc
new file mode 100644 (file)
index 0000000..08179b7
--- /dev/null
@@ -0,0 +1,45 @@
+# $oPenBSD: Makefile.inc,v 1.2 2014/05/02 18:21:39 miod Exp $
+
+# arm-specific libcrypto build rules
+
+# aes
+SRCS+= aes_cbc.c 
+CFLAGS+= -DAES_ASM
+SSLASM+= aes aes-armv4
+# bf
+SRCS+= bf_enc.c
+# bn
+SRCS+= bn_asm.c
+CFLAGS+= -DOPENSSL_BN_ASM_MONT
+SSLASM+= bn armv4-mont
+CFLAGS+= -DOPENSSL_BN_ASM_GF2m
+SSLASM+= bn armv4-gf2m
+# des
+SRCS+= des_enc.c fcrypt_b.c
+# modes
+CFLAGS+= -DGHASH_ASM
+SSLASM+= modes ghash-armv4
+# rc4
+SRCS+= rc4_enc.c rc4_skey.c
+## rc5
+#SRCS+= rc5_enc.c 
+# sha
+CFLAGS+= -DSHA1_ASM
+SSLASM+= sha sha1-armv4-large
+CFLAGS+= -DSHA256_ASM
+SSLASM+= sha sha256-armv4
+CFLAGS+= -DSHA512_ASM
+SSLASM+= sha sha512-armv4
+# whrlpool
+SRCS+= wp_block.c
+
+.for dir f in ${SSLASM}
+SRCS+= ${f}.S
+GENERATED+=${f}.S
+${f}.S: ${LCRYPTO_SRC}/${dir}/asm/${f}.pl
+       /usr/bin/perl \
+               ${LCRYPTO_SRC}/${dir}/asm/${f}.pl void ${.TARGET} > ${.TARGET}
+.endfor
+
+CFLAGS+= -DOPENSSL_CPUID_OBJ
+SRCS+= armv4cpuid.S armcap.c
diff --git a/lib/libcrypto/crypto/arch/arm/Makefile.inc b/lib/libcrypto/crypto/arch/arm/Makefile.inc
new file mode 100644 (file)
index 0000000..08179b7
--- /dev/null
@@ -0,0 +1,45 @@
+# $oPenBSD: Makefile.inc,v 1.2 2014/05/02 18:21:39 miod Exp $
+
+# arm-specific libcrypto build rules
+
+# aes
+SRCS+= aes_cbc.c 
+CFLAGS+= -DAES_ASM
+SSLASM+= aes aes-armv4
+# bf
+SRCS+= bf_enc.c
+# bn
+SRCS+= bn_asm.c
+CFLAGS+= -DOPENSSL_BN_ASM_MONT
+SSLASM+= bn armv4-mont
+CFLAGS+= -DOPENSSL_BN_ASM_GF2m
+SSLASM+= bn armv4-gf2m
+# des
+SRCS+= des_enc.c fcrypt_b.c
+# modes
+CFLAGS+= -DGHASH_ASM
+SSLASM+= modes ghash-armv4
+# rc4
+SRCS+= rc4_enc.c rc4_skey.c
+## rc5
+#SRCS+= rc5_enc.c 
+# sha
+CFLAGS+= -DSHA1_ASM
+SSLASM+= sha sha1-armv4-large
+CFLAGS+= -DSHA256_ASM
+SSLASM+= sha sha256-armv4
+CFLAGS+= -DSHA512_ASM
+SSLASM+= sha sha512-armv4
+# whrlpool
+SRCS+= wp_block.c
+
+.for dir f in ${SSLASM}
+SRCS+= ${f}.S
+GENERATED+=${f}.S
+${f}.S: ${LCRYPTO_SRC}/${dir}/asm/${f}.pl
+       /usr/bin/perl \
+               ${LCRYPTO_SRC}/${dir}/asm/${f}.pl void ${.TARGET} > ${.TARGET}
+.endfor
+
+CFLAGS+= -DOPENSSL_CPUID_OBJ
+SRCS+= armv4cpuid.S armcap.c