diff options
author | Danny Tsen <dtsen@us.ibm.com> | 2021-10-18 10:51:42 -0400 |
---|---|---|
committer | Pauli <pauli@openssl.org> | 2022-01-24 11:25:53 +1100 |
commit | 44a563dde1584cd9284e80b6e45ee5019be8d36c (patch) | |
tree | c909c5c37731b561770dbfa9df0802767cec79ae /include | |
parent | d94c2f1b98318cea4416c4dcd5e5f878de8d458f (diff) |
AES-GCM performance optimzation with stitched method for p9+ ppc64le
Assembly code reviewed by Shricharan Srivatsan <ssrivat@us.ibm.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/16854)
Diffstat (limited to 'include')
-rw-r--r-- | include/crypto/aes_platform.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/include/crypto/aes_platform.h b/include/crypto/aes_platform.h index e95ad5aa5d..9e74d86a50 100644 --- a/include/crypto/aes_platform.h +++ b/include/crypto/aes_platform.h @@ -74,6 +74,18 @@ void AES_xts_decrypt(const unsigned char *inp, unsigned char *out, size_t len, # define HWAES_ctr32_encrypt_blocks aes_p8_ctr32_encrypt_blocks # define HWAES_xts_encrypt aes_p8_xts_encrypt # define HWAES_xts_decrypt aes_p8_xts_decrypt +# define PPC_AES_GCM_CAPABLE (OPENSSL_ppccap_P & PPC_MADD300) +# define AES_GCM_ENC_BYTES 128 +# define AES_GCM_DEC_BYTES 128 +size_t ppc_aes_gcm_encrypt(const unsigned char *in, unsigned char *out, size_t len, + const void *key, unsigned char ivec[16], u64 *Xi); +size_t ppc_aes_gcm_decrypt(const unsigned char *in, unsigned char *out, size_t len, + const void *key, unsigned char ivec[16], u64 *Xi); +void gcm_ghash_p8(u64 Xi[2],const u128 Htable[16],const u8 *inp, size_t len); +# define AES_gcm_encrypt ppc_aes_gcm_encrypt +# define AES_gcm_decrypt ppc_aes_gcm_decrypt +# define AES_GCM_ASM(gctx) ((gctx)->ctr==aes_p8_ctr32_encrypt_blocks && \ + (gctx)->gcm.ghash==gcm_ghash_p8) # endif /* PPC */ # if (defined(__arm__) || defined(__arm) || defined(__aarch64__)) |