svn commit: r305152 - in stable/11: crypto/openssl/crypto/bn/asm crypto/openssl/crypto/sha/asm secure/lib/libcrypto secure/lib/libcrypto/arm
Jung-uk Kim
jkim at FreeBSD.org
Wed Aug 31 20:30:51 UTC 2016
Author: jkim
Date: Wed Aug 31 20:30:49 2016
New Revision: 305152
URL: https://svnweb.freebsd.org/changeset/base/305152
Log:
MFC: r304636
Build OpenSSL assembly sources for arm.
Added:
stable/11/secure/lib/libcrypto/arm/
- copied from r304636, head/secure/lib/libcrypto/arm/
Modified:
stable/11/crypto/openssl/crypto/bn/asm/armv4-gf2m.pl
stable/11/crypto/openssl/crypto/sha/asm/sha256-armv4.pl
stable/11/secure/lib/libcrypto/Makefile
stable/11/secure/lib/libcrypto/Makefile.asm
stable/11/secure/lib/libcrypto/Makefile.inc
Directory Properties:
stable/11/ (props changed)
Modified: stable/11/crypto/openssl/crypto/bn/asm/armv4-gf2m.pl
==============================================================================
--- stable/11/crypto/openssl/crypto/bn/asm/armv4-gf2m.pl Wed Aug 31 20:25:37 2016 (r305151)
+++ stable/11/crypto/openssl/crypto/bn/asm/armv4-gf2m.pl Wed Aug 31 20:30:49 2016 (r305152)
@@ -213,8 +213,8 @@ $code.=<<___;
.align 5
.LNEON:
ldr r12, [sp] @ 5th argument
- vmov.32 $a, r2, r1
- vmov.32 $b, r12, r3
+ vmov $a, r2, r1
+ vmov $b, r12, r3
vmov.i64 $k48, #0x0000ffffffffffff
vmov.i64 $k32, #0x00000000ffffffff
vmov.i64 $k16, #0x000000000000ffff
Modified: stable/11/crypto/openssl/crypto/sha/asm/sha256-armv4.pl
==============================================================================
--- stable/11/crypto/openssl/crypto/sha/asm/sha256-armv4.pl Wed Aug 31 20:25:37 2016 (r305151)
+++ stable/11/crypto/openssl/crypto/sha/asm/sha256-armv4.pl Wed Aug 31 20:30:49 2016 (r305152)
@@ -595,7 +595,7 @@ sha256_block_data_order_armv8:
adr $Ktbl,.LARMv8
sub $Ktbl,$Ktbl,#.LARMv8-K256
# else
- adrl $Ktbl,K256
+ sub $Ktbl,$Ktbl,#256+32
# endif
add $len,$inp,$len,lsl#6 @ len to point at the end of inp
Modified: stable/11/secure/lib/libcrypto/Makefile
==============================================================================
--- stable/11/secure/lib/libcrypto/Makefile Wed Aug 31 20:25:37 2016 (r305151)
+++ stable/11/secure/lib/libcrypto/Makefile Wed Aug 31 20:30:49 2016 (r305152)
@@ -24,6 +24,8 @@ SRCS= cpt_err.c cryptlib.c cversion.c ex
o_fips.c o_init.c o_str.c o_time.c uid.c
.if defined(ASM_amd64)
SRCS+= x86_64cpuid.S
+.elif defined(ASM_arm)
+SRCS+= armcap.c armv4cpuid.S
.elif defined(ASM_i386)
SRCS+= x86cpuid.S
.else
@@ -36,6 +38,8 @@ SRCS+= aes_cfb.c aes_ctr.c aes_ecb.c aes
.if defined(ASM_amd64)
SRCS+= aes-x86_64.S aesni-mb-x86_64.S aesni-sha1-x86_64.S \
aesni-sha256-x86_64.S aesni-x86_64.S bsaes-x86_64.S vpaes-x86_64.S
+.elif defined(ASM_arm)
+SRCS+= aes-armv4.S aes_cbc.c aesv8-armx.S bsaes-armv7.S
.elif defined(ASM_i386)
SRCS+= aes-586.S aesni-x86.S vpaes-x86.S
.else
@@ -85,6 +89,8 @@ SRCS+= bn_add.c bn_blind.c bn_const.c bn
.if defined(ASM_amd64)
SRCS+= rsaz-avx2.S rsaz-x86_64.S rsaz_exp.c x86_64-gcc.c x86_64-gf2m.S \
x86_64-mont.S x86_64-mont5.S
+.elif defined(ASM_arm)
+SRCS+= armv4-mont.S armv4-gf2m.S bn_asm.c
.elif defined(ASM_i386)
SRCS+= bn-586.S co-586.S x86-gf2m.S x86-mont.S
.else
@@ -234,6 +240,8 @@ SRCS+= cbc128.c ccm128.c cfb128.c ctr128
wrap128.c xts128.c
.if defined(ASM_amd64)
SRCS+= aesni-gcm-x86_64.S ghash-x86_64.S
+.elif defined(ASM_arm)
+SRCS+= ghash-armv4.S ghashv8-armx.S
.elif defined(ASM_i386)
SRCS+= ghash-x86.S
.endif
@@ -319,6 +327,8 @@ SRCS+= sha1_one.c sha1dgst.c sha256.c sh
.if defined(ASM_amd64)
SRCS+= sha1-mb-x86_64.S sha1-x86_64.S sha256-mb-x86_64.S sha256-x86_64.S \
sha512-x86_64.S
+.elif defined(ASM_arm)
+SRCS+= sha1-armv4-large.S sha256-armv4.S sha512-armv4.S
.elif defined(ASM_i386)
SRCS+= sha1-586.S sha256-586.S sha512-586.S
.endif
Modified: stable/11/secure/lib/libcrypto/Makefile.asm
==============================================================================
--- stable/11/secure/lib/libcrypto/Makefile.asm Wed Aug 31 20:25:37 2016 (r305151)
+++ stable/11/secure/lib/libcrypto/Makefile.asm Wed Aug 31 20:30:49 2016 (r305152)
@@ -78,6 +78,46 @@ ${s}.S: ${s}.s
cat ${s}.s ) > ${.TARGET}
.endfor
+.elif defined(ASM_arm)
+
+.PATH: ${LCRYPTO_SRC}/crypto \
+ ${LCRYPTO_SRC}/crypto/aes/asm \
+ ${LCRYPTO_SRC}/crypto/bn/asm \
+ ${LCRYPTO_SRC}/crypto/modes/asm \
+ ${LCRYPTO_SRC}/crypto/sha/asm
+
+PERLPATH= -I${LCRYPTO_SRC}/crypto/perlasm
+
+# aes
+SRCS= aesv8-armx.pl bsaes-armv7.pl
+
+# bn
+SRCS+= armv4-mont.pl armv4-gf2m.pl
+
+# modes
+SRCS+= ghash-armv4.pl ghashv8-armx.pl
+
+# sha
+SRCS+= sha1-armv4-large.pl sha256-armv4.pl sha512-armv4.pl
+
+ASM= aes-armv4.S ${SRCS:R:S/$/.S/}
+
+all: ${ASM}
+
+CLEANFILES= ${ASM} ${SRCS:R:S/$/.s/}
+.SUFFIXES: .pl
+
+aes-armv4.S: aes-armv4.pl
+ ( echo '# $$'FreeBSD'$$' ;\
+ echo '# Do not modify. This file is auto-generated from ${.ALLSRC:T}.' ;\
+ env CC=cc perl ${.ALLSRC} elf ) > ${.TARGET}
+
+.pl.S:
+ env CC=cc perl ${.IMPSRC} elf ${.TARGET:R:S/$/.s/}
+ ( echo ' # $$'FreeBSD'$$' ;\
+ echo ' # Do not modify. This file is auto-generated from ${.IMPSRC:T:R:S/$/.pl/}.' ;\
+ cat ${.TARGET:R:S/$/.s/}) > ${.TARGET}
+
.elif defined(ASM_i386)
.PATH: ${LCRYPTO_SRC}/crypto \
Modified: stable/11/secure/lib/libcrypto/Makefile.inc
==============================================================================
--- stable/11/secure/lib/libcrypto/Makefile.inc Wed Aug 31 20:25:37 2016 (r305151)
+++ stable/11/secure/lib/libcrypto/Makefile.inc Wed Aug 31 20:30:49 2016 (r305152)
@@ -29,6 +29,8 @@ _ASM_AVX!= { \
.if ${_ASM_AVX} == yes
ASM_${MACHINE_CPUARCH}=
.endif
+.elif ${MACHINE_CPUARCH} == "arm"
+ASM_arm=
.endif
.if defined(ASM_amd64)
@@ -40,6 +42,11 @@ CFLAGS+=-DMD5_ASM
CFLAGS+=-DGHASH_ASM
CFLAGS+=-DSHA1_ASM -DSHA256_ASM -DSHA512_ASM
CFLAGS+=-DWHIRLPOOL_ASM
+.elif defined(ASM_arm)
+CFLAGS+=-DAES_ASM -DBSAES_ASM
+CFLAGS+=-DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_GF2m
+CFLAGS+=-DGHASH_ASM
+CFLAGS+=-DSHA1_ASM -DSHA256_ASM -DSHA512_ASM
.elif defined(ASM_i386)
CFLAGS+=-DOPENSSL_IA32_SSE2
CFLAGS+=-DAES_ASM -DVPAES_ASM
More information about the svn-src-stable
mailing list