openssl/providers/implementations/ciphers
Daniel Hu 4908787f21 SM4 optimization for ARM by ASIMD
This patch optimizes SM4 for ARM processor using ASIMD instruction

It will improve performance if both of following conditions are met:
1) Input data equal to or more than 4 blocks
2) Cipher mode allows parallelism, including ECB,CTR,GCM or CBC decryption

This patch implements SM4 SBOX lookup in vector registers, with the
benefit of constant processing time over existing C implementation.

It is only enabled for micro-architecture N1/V1. In the ideal scenario,
performance can reach up to 2.7X

When either of above two conditions is not met, e.g. single block input
or CFB/OFB mode, CBC encryption, performance could drop about 50%.

The assembly code has been reviewed internally by ARM engineer
Fangming.Fang@arm.com

Signed-off-by: Daniel Hu <Daniel.Hu@arm.com>

Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/17951)
2022-04-12 10:37:42 +02:00
..
build.info providers: Add SM4 GCM implementation 2021-09-28 19:27:58 +10:00
cipher_aes_cbc_hmac_sha1_hw.c Update copyright year 2021-06-17 13:24:59 +01:00
cipher_aes_cbc_hmac_sha256_hw.c Update copyright year 2021-06-17 13:24:59 +01:00
cipher_aes_cbc_hmac_sha.c Move libssl related defines used by fips provider to prov_ssl.h 2021-06-04 17:06:47 +02:00
cipher_aes_cbc_hmac_sha.h
cipher_aes_ccm_hw_aesni.inc
cipher_aes_ccm_hw_s390x.inc
cipher_aes_ccm_hw_t4.inc
cipher_aes_ccm_hw.c
cipher_aes_ccm.c
cipher_aes_ccm.h
cipher_aes_cts.inc Refactor cipher aes_cts code so that it can be used by other 128bit ciphers 2021-08-18 08:38:40 +10:00
cipher_aes_gcm_hw_aesni.inc AES-GCM enabled with AVX512 vAES and vPCLMULQDQ. 2022-02-10 15:10:12 +01:00
cipher_aes_gcm_hw_armv8.inc Optimize AES-GCM for uarchs with unroll and new instructions 2022-01-25 14:30:00 +11:00
cipher_aes_gcm_hw_ppc.inc Fixed counter overflow 2022-02-07 11:29:18 +11:00
cipher_aes_gcm_hw_s390x.inc Update copyright year 2021-06-17 13:24:59 +01:00
cipher_aes_gcm_hw_t4.inc
cipher_aes_gcm_hw_vaes_avx512.inc AES-GCM enabled with AVX512 vAES and vPCLMULQDQ. 2022-02-10 15:10:12 +01:00
cipher_aes_gcm_hw.c AES-GCM performance optimzation with stitched method for p9+ ppc64le 2022-01-24 11:25:53 +11:00
cipher_aes_gcm.c Remove lower limit on GCM mode ciphers 2021-07-14 12:02:03 +02:00
cipher_aes_gcm.h Update copyright year 2021-06-17 13:24:59 +01:00
cipher_aes_hw_aesni.inc
cipher_aes_hw_s390x.inc Fix CipherInit on s390x. 2021-06-08 14:32:44 +10:00
cipher_aes_hw_t4.inc
cipher_aes_hw.c aes: rename new bsaes_ symbols -> ossl_bsaes_ ones 2021-05-27 09:35:50 +10:00
cipher_aes_ocb_hw.c
cipher_aes_ocb.c support params argument to AES cipher init calls 2021-03-12 08:27:21 +10:00
cipher_aes_ocb.h
cipher_aes_siv_hw.c Update copyright year 2021-04-08 13:04:41 +01:00
cipher_aes_siv.c Fix incorrect OSSL_CIPHER_PARAM_SPEED get_ctx_params 2021-05-28 14:29:13 +02:00
cipher_aes_siv.h
cipher_aes_wrp.c aes-wrap: improve error handling 2021-08-26 09:33:52 +10:00
cipher_aes_xts_fips.c Update copyright year 2021-04-08 13:04:41 +01:00
cipher_aes_xts_hw.c Update copyright year 2021-06-17 13:24:59 +01:00
cipher_aes_xts.c Add ossl_provider symbols 2021-03-18 17:52:38 +10:00
cipher_aes_xts.h Update copyright year 2021-04-08 13:04:41 +01:00
cipher_aes.c
cipher_aes.h
cipher_aria_ccm_hw.c Add ossl_aria symbols 2021-03-18 17:52:37 +10:00
cipher_aria_ccm.c
cipher_aria_ccm.h
cipher_aria_gcm_hw.c Add ossl_aria symbols 2021-03-18 17:52:37 +10:00
cipher_aria_gcm.c Remove lower limit on GCM mode ciphers 2021-07-14 12:02:03 +02:00
cipher_aria_gcm.h
cipher_aria_hw.c Add ossl_aria symbols 2021-03-18 17:52:37 +10:00
cipher_aria.c
cipher_aria.h
cipher_blowfish_hw.c
cipher_blowfish.c
cipher_blowfish.h
cipher_camellia_cts.inc Add support for camellia cbc cts mode 2021-08-18 08:38:40 +10:00
cipher_camellia_hw_t4.inc
cipher_camellia_hw.c
cipher_camellia.c Update copyright year 2021-09-07 13:35:43 +02:00
cipher_camellia.h Update copyright year 2021-06-17 13:24:59 +01:00
cipher_cast5_hw.c
cipher_cast5.c
cipher_cast.h
cipher_chacha20_hw.c
cipher_chacha20_poly1305_hw.c
cipher_chacha20_poly1305.c
cipher_chacha20_poly1305.h
cipher_chacha20.c fix some code with obvious wrong coding style 2021-10-28 13:10:46 +10:00
cipher_chacha20.h
cipher_cts.c Move e_os.h to include/internal 2022-02-05 05:31:09 +01:00
cipher_cts.h Refactor cipher aes_cts code so that it can be used by other 128bit ciphers 2021-08-18 08:38:40 +10:00
cipher_des_hw.c
cipher_des.c Add a gettable for provider ciphers to return the EVP_CIPH_RAND_KEY flag 2021-06-08 15:16:06 +10:00
cipher_des.h
cipher_desx_hw.c
cipher_desx.c
cipher_idea_hw.c
cipher_idea.c
cipher_idea.h
cipher_null.c prov: support param argument to null cipher init calls 2021-03-12 08:27:21 +10:00
cipher_rc2_hw.c
cipher_rc2.c Fixes #15070. Allow custom algorithm ID ASN.1 encoding for provided ciphers 2021-05-07 11:00:54 +02:00
cipher_rc2.h
cipher_rc4_hmac_md5_hw.c
cipher_rc4_hmac_md5.c
cipher_rc4_hmac_md5.h
cipher_rc4_hw.c
cipher_rc4.c
cipher_rc4.h
cipher_rc5_hw.c
cipher_rc5.c
cipher_rc5.h
cipher_seed_hw.c
cipher_seed.c
cipher_seed.h
cipher_sm4_ccm_hw.c providers: Add SM4 GCM implementation 2021-09-28 19:27:58 +10:00
cipher_sm4_ccm.c providers: Add SM4 GCM implementation 2021-09-28 19:27:58 +10:00
cipher_sm4_ccm.h providers: Add SM4 GCM implementation 2021-09-28 19:27:58 +10:00
cipher_sm4_gcm_hw.c SM4 optimization for ARM by ASIMD 2022-04-12 10:37:42 +02:00
cipher_sm4_gcm.c providers: Add SM4 GCM implementation 2021-09-28 19:27:58 +10:00
cipher_sm4_gcm.h providers: Add SM4 GCM implementation 2021-09-28 19:27:58 +10:00
cipher_sm4_hw.c SM4 optimization for ARM by ASIMD 2022-04-12 10:37:42 +02:00
cipher_sm4.c
cipher_sm4.h SM4 optimization for ARM by HW instruction 2022-01-18 11:52:14 +01:00
cipher_tdes_common.c prov: add zero strenght arguments to BN and RAND RNG calls 2021-05-29 17:17:12 +10:00
cipher_tdes_default_hw.c
cipher_tdes_default.c Fix IV length of DES EDE ECB implementations 2022-01-27 12:01:41 +11:00
cipher_tdes_default.h
cipher_tdes_hw.c
cipher_tdes_wrap_hw.c
cipher_tdes_wrap.c Add a gettable for provider ciphers to return the EVP_CIPH_RAND_KEY flag 2021-06-08 15:16:06 +10:00
cipher_tdes.c Fix IV length of DES EDE ECB implementations 2022-01-27 12:01:41 +11:00
cipher_tdes.h Add a gettable for provider ciphers to return the EVP_CIPH_RAND_KEY flag 2021-06-08 15:16:06 +10:00
ciphercommon_block.c fix some code with obvious wrong coding style 2021-10-28 13:10:46 +10:00
ciphercommon_ccm_hw.c
ciphercommon_ccm.c prov: support params argument to common cipher init calls 2021-03-12 08:27:21 +10:00
ciphercommon_gcm_hw.c
ciphercommon_gcm.c Remove lower limit on GCM mode ciphers 2021-07-14 12:02:03 +02:00
ciphercommon_hw.c Fix param indentation in ciphercommon_hw.c 2021-06-01 15:22:30 +10:00
ciphercommon_local.h
ciphercommon.c Add a gettable for provider ciphers to return the EVP_CIPH_RAND_KEY flag 2021-06-08 15:16:06 +10:00