mirror of
https://github.com/openssl/openssl.git
synced 2024-12-03 05:41:46 +08:00
63b996e752
Vectorized 'stitched' encrypt + ghash implementation of AES-GCM enabled with AVX512 vAES and vPCLMULQDQ instructions (available starting Intel's IceLake micro-architecture). The performance details for representative IceLake Server and Client platforms are shown below Performance data: OpenSSL Speed KBs/Sec Intel(R) Xeon(R) Platinum 8380 CPU @ 2.30GHz (1Core/1Thread) Payload in Bytes 16 64 256 1024 8192 16384 AES-128-GCM Baseline 478708.27 1118296.96 2428092.52 3518199.4 4172355.99 4235762.07 Patched 534613.95 2009345.55 3775588.15 5059517.64 8476794.88 8941541.79 Speedup 1.12 1.80 1.55 1.44 2.03 2.11 AES-256-GCM Baseline 399237.27 961699.9 2136377.65 2979889.15 3554823.37 3617757.5 Patched 475948.13 1720128.51 3462407.12 4696832.2 7532013.16 7924953.91 Speedup 1.19 1.79 1.62 1.58 2.12 2.19 Intel(R) Core(TM) i7-1065G7 CPU @ 1.30GHz (1Core/1Thread) Payload in Bytes 16 64 256 1024 8192 16384 AES-128-GCM Baseline 259128.54 570756.43 1362554.16 1990654.57 2359128.88 2401671.58 Patched 292139.47 1079320.95 2001974.63 2829007.46 4510318.59 4705314.41 Speedup 1.13 1.89 1.47 1.42 1.91 1.96 AES-256-GCM Baseline 236000.34 550506.76 1234638.08 1716734.57 2011255.6 2028099.99 Patched 247256.32 919731.34 1773270.43 2553239.55 3953115.14 4111227.29 Speedup 1.05 1.67 1.44 1.49 1.97 2.03 Reviewed-by: TJ O'Dwyer, Marcel Cornu, Pablo de Lara Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/17239)
87 lines
2.7 KiB
Plaintext
87 lines
2.7 KiB
Plaintext
LIBS=../../libcrypto
|
|
|
|
$MODESASM=
|
|
IF[{- !$disabled{asm} -}]
|
|
$MODESASM_x86=ghash-x86.s
|
|
$MODESDEF_x86=GHASH_ASM
|
|
$MODESASM_x86_64=ghash-x86_64.s aesni-gcm-x86_64.s aes-gcm-avx512.s
|
|
$MODESDEF_x86_64=GHASH_ASM
|
|
|
|
# ghash-ia64.s doesn't work on VMS
|
|
IF[{- $config{target} !~ /^vms-/ -}]
|
|
$MODESASM_ia64=ghash-ia64.s
|
|
$MODESDEF_ia64=GHASH_ASM
|
|
ENDIF
|
|
|
|
$MODESASM_sparcv9=ghash-sparcv9.S
|
|
$MODESDEF_sparcv9=GHASH_ASM
|
|
|
|
$MODESASM_alpha=ghash-alpha.S
|
|
$MODESDEF_alpha=GHASH_ASM
|
|
|
|
$MODESASM_s390x=ghash-s390x.S
|
|
$MODESDEF_s390x=GHASH_ASM
|
|
|
|
$MODESASM_armv4=ghash-armv4.S ghashv8-armx.S
|
|
$MODESDEF_armv4=GHASH_ASM
|
|
$MODESASM_aarch64=ghashv8-armx.S aes-gcm-armv8_64.S aes-gcm-armv8-unroll8_64.S
|
|
$MODESDEF_aarch64=
|
|
|
|
$MODESASM_parisc11=ghash-parisc.s
|
|
$MODESDEF_parisc11=GHASH_ASM
|
|
$MODESASM_parisc20_64=$MODESASM_parisc11
|
|
$MODESDEF_parisc20_64=$MODESDEF_parisc11
|
|
|
|
$MODESASM_ppc32=ghashp8-ppc.s aes-gcm-ppc.s
|
|
$MODESDEF_ppc32=
|
|
$MODESASM_ppc64=$MODESASM_ppc32
|
|
$MODESDEF_ppc64=$MODESDEF_ppc32
|
|
|
|
$MODESASM_c64xplus=ghash-c64xplus.s
|
|
$MODESDEF_c64xplus=GHASH_ASM
|
|
|
|
# Now that we have defined all the arch specific variables, use the
|
|
# appropriate one, and define the appropriate macros
|
|
IF[$MODESASM_{- $target{asm_arch} -}]
|
|
$MODESASM=$MODESASM_{- $target{asm_arch} -}
|
|
$MODESDEF=$MODESDEF_{- $target{asm_arch} -}
|
|
ENDIF
|
|
ENDIF
|
|
|
|
$COMMON=cbc128.c ctr128.c cfb128.c ofb128.c gcm128.c ccm128.c xts128.c \
|
|
wrap128.c $MODESASM
|
|
SOURCE[../../libcrypto]=$COMMON \
|
|
cts128.c ocb128.c siv128.c
|
|
SOURCE[../../providers/libfips.a]=$COMMON
|
|
|
|
# Implementations are now spread across several libraries, so the defines
|
|
# need to be applied to all affected libraries and modules.
|
|
DEFINE[../../libcrypto]=$MODESDEF
|
|
DEFINE[../../providers/libfips.a]=$MODESDEF
|
|
|
|
|
|
INCLUDE[gcm128.o]=..
|
|
|
|
GENERATE[ghash-ia64.s]=asm/ghash-ia64.pl
|
|
GENERATE[ghash-x86.s]=asm/ghash-x86.pl
|
|
GENERATE[ghash-x86_64.s]=asm/ghash-x86_64.pl
|
|
GENERATE[aesni-gcm-x86_64.s]=asm/aesni-gcm-x86_64.pl
|
|
GENERATE[aes-gcm-avx512.s]=asm/aes-gcm-avx512.pl
|
|
GENERATE[ghash-sparcv9.S]=asm/ghash-sparcv9.pl
|
|
INCLUDE[ghash-sparcv9.o]=..
|
|
GENERATE[ghash-alpha.S]=asm/ghash-alpha.pl
|
|
GENERATE[ghash-parisc.s]=asm/ghash-parisc.pl
|
|
GENERATE[ghashp8-ppc.s]=asm/ghashp8-ppc.pl
|
|
GENERATE[aes-gcm-ppc.s]=asm/aes-gcm-ppc.pl
|
|
GENERATE[ghash-armv4.S]=asm/ghash-armv4.pl
|
|
INCLUDE[ghash-armv4.o]=..
|
|
GENERATE[ghashv8-armx.S]=asm/ghashv8-armx.pl
|
|
INCLUDE[ghashv8-armx.o]=..
|
|
GENERATE[aes-gcm-armv8_64.S]=asm/aes-gcm-armv8_64.pl
|
|
INCLUDE[aes-gcm-armv8_64.o]=..
|
|
GENERATE[aes-gcm-armv8-unroll8_64.S]=asm/aes-gcm-armv8-unroll8_64.pl
|
|
INCLUDE[aes-gcm-armv8-unroll8_64.o]=..
|
|
GENERATE[ghash-s390x.S]=asm/ghash-s390x.pl
|
|
INCLUDE[ghash-s390x.o]=..
|
|
GENERATE[ghash-c64xplus.S]=asm/ghash-c64xplus.pl
|