summaryrefslogtreecommitdiffstats
path: root/crypto/evp/e_aes.c
diff options
context:
space:
mode:
authorAndy Polyakov <appro@openssl.org>2013-04-23 17:52:14 +0200
committerAndy Polyakov <appro@openssl.org>2013-04-23 17:52:14 +0200
commit9575d1a91ad9dd6eb5c964365dfbb72dbd3d1333 (patch)
treeeefeb2d6479372ad5b673cd0c486e646dd14494f /crypto/evp/e_aes.c
parent75fe422323c3d5efd89d846d1b8fede3fed246cf (diff)
bsaes-armv7.pl: add bsaes_cbc_encrypt and bsaes_ctr32_encrypt_blocks.
Submitted by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Contributor claims ~50% improvement in CTR and ~9% in CBC decrypt on Cortex-A15.
Diffstat (limited to 'crypto/evp/e_aes.c')
-rw-r--r--crypto/evp/e_aes.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/crypto/evp/e_aes.c b/crypto/evp/e_aes.c
index a7d4ce4420..c0fd0312b0 100644
--- a/crypto/evp/e_aes.c
+++ b/crypto/evp/e_aes.c
@@ -892,6 +892,14 @@ static const EVP_CIPHER aes_##keylen##_##mode = { \
NULL,NULL,aes_##mode##_ctrl,NULL }; \
const EVP_CIPHER *EVP_aes_##keylen##_##mode(void) \
{ return &aes_##keylen##_##mode; }
+
+#endif
+
+#if defined(AES_ASM) && defined(BSAES_ASM) && (defined(__arm__) || defined(__arm))
+#include "arm_arch.h"
+#if __ARM_ARCH__>=7
+#define BSAES_CAPABLE (OPENSSL_armcap_P & ARMV7_NEON)
+#endif
#endif
#define BLOCK_CIPHER_generic_pack(nid,keylen,flags) \
@@ -1624,11 +1632,13 @@ static int aes_xts_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
xctx->stream = NULL;
#endif
/* key_len is two AES keys */
+#if !(defined(__arm__) || defined(__arm)) /* not yet? */
#ifdef BSAES_CAPABLE
if (BSAES_CAPABLE)
xctx->stream = enc ? bsaes_xts_encrypt : bsaes_xts_decrypt;
else
#endif
+#endif
#ifdef VPAES_CAPABLE
if (VPAES_CAPABLE)
{