openssl/crypto/evp
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
..
asymcipher.c fix some code with obvious wrong coding style 2021-10-28 13:10:46 +10:00
bio_b64.c
bio_enc.c
bio_md.c
bio_ok.c
build.info
c_allc.c enc : add support for wrap mode 2022-02-18 15:04:28 +11:00
c_alld.c
cmeth_lib.c Fix EVP_MD_meth_dup and EVP_CIPHER_meth_dup 2021-07-28 09:36:54 +10:00
ctrl_params_translate.c Move e_os.h to include/internal 2022-02-05 05:31:09 +01:00
dh_ctrl.c
dh_support.c
digest.c EVP_MD performance fix (refcount cache contention) 2022-03-13 11:43:26 +11:00
dsa_ctrl.c
e_aes_cbc_hmac_sha1.c aes: avoid accessing key length field directly 2022-02-07 09:45:57 +11:00
e_aes_cbc_hmac_sha256.c
e_aes.c aes: avoid accessing key length field directly 2022-02-07 09:45:57 +11:00
e_aria.c fix some code with obvious wrong coding style 2021-10-28 13:10:46 +10:00
e_bf.c
e_camellia.c fix some code with obvious wrong coding style 2021-10-28 13:10:46 +10:00
e_cast.c
e_chacha20_poly1305.c fix some code with obvious wrong coding style 2021-10-28 13:10:46 +10:00
e_des3.c Split bignum code out of the sparcv9cap.c 2021-07-15 09:33:04 +02:00
e_des.c Split bignum code out of the sparcv9cap.c 2021-07-15 09:33:04 +02:00
e_idea.c fix some code with obvious wrong coding style 2021-10-28 13:10:46 +10:00
e_null.c
e_old.c
e_rc2.c
e_rc4_hmac_md5.c
e_rc4.c
e_rc5.c Address coverity 1493382 argument cannot be negative 2021-11-08 08:55:32 +10:00
e_seed.c fix some code with obvious wrong coding style 2021-10-28 13:10:46 +10:00
e_sm4.c SM4 optimization for ARM by ASIMD 2022-04-12 10:37:42 +02:00
e_xcbc_d.c
ec_ctrl.c
ec_support.c Move e_os.h to include/internal 2022-02-05 05:31:09 +01:00
encode.c
evp_cnf.c Don't try and load the config file while already loading the config file 2021-07-28 10:35:06 +10:00
evp_enc.c Fix Coverity 1503096: out-of-bounds access 2022-04-03 12:55:23 +10:00
evp_err.c
evp_fetch.c Refactor OSSL_LIB_CTX to avoid using CRYPTO_EX_DATA 2022-04-01 10:49:19 +11:00
evp_key.c
evp_lib.c evp enc: cache cipher key length 2022-02-07 09:46:16 +11:00
evp_local.h evp enc: cache cipher IV length 2022-02-07 09:45:57 +11:00
evp_pbe.c
evp_pkey.c EVP: Add EVP_PKEY_get0_provider() and EVP_PKEY_CTX_get0_provider() 2021-07-26 12:11:54 +02:00
evp_rand.c fips module header inclusion fine-tunning 2021-07-06 10:52:27 +10:00
evp_utils.c
exchange.c EVP_PKEY_derive_set_peer_ex: Export the peer key to proper keymgmt 2022-01-10 17:31:57 +01:00
kdf_lib.c fips module header inclusion fine-tunning 2021-07-06 10:52:27 +10:00
kdf_meth.c
kem.c CORE: Encure that cached fetches can be done per provider 2021-10-27 12:41:15 +02:00
keymgmt_lib.c EVP: fix evp_keymgmt_util_match so that it actually tries cross export the other way if the first attempt fails 2022-01-14 17:15:58 +01:00
keymgmt_meth.c EVP: Add evp_keymgmt_fetch_from_prov() 2021-10-27 12:41:10 +02:00
legacy_blake2.c
legacy_md2.c
legacy_md4.c
legacy_md5_sha1.c
legacy_md5.c
legacy_mdc2.c
legacy_meth.h
legacy_ripemd.c
legacy_sha.c
legacy_wp.c
m_null.c
m_sigver.c EVP_MD performance fix (refcount cache contention) 2022-03-13 11:43:26 +11:00
mac_lib.c Enforce a size check in EVP_MAC_final() 2021-10-22 08:43:26 +01:00
mac_meth.c Fix copyrights 2022-02-03 13:56:38 +01:00
names.c
p5_crpt2.c Crypto/evp: Fix null pointer dereference 2022-04-11 14:13:57 +10:00
p5_crpt.c
p_dec.c
p_enc.c
p_legacy.c
p_lib.c Move e_os.h to include/internal 2022-02-05 05:31:09 +01:00
p_open.c
p_seal.c
p_sign.c
p_verify.c
pbe_scrypt.c
pmeth_check.c Make EVP_PKEY_check() be an alias for EVP_PKEY_pairwise_check() 2021-07-15 10:54:25 +10:00
pmeth_gn.c drop unused callback variable 2022-01-13 10:01:02 +01:00
pmeth_lib.c fix some code with obvious wrong coding style 2021-10-28 13:10:46 +10:00
signature.c CORE: Encure that cached fetches can be done per provider 2021-10-27 12:41:15 +02:00