bsaes-armv7.pl: add bsaes_cbc_encrypt and bsaes_ctr32_encrypt_blocks.
[openssl.git] / crypto / evp / e_aes.c
index a7d4ce4420399ecb3bcb0925e5419de0f0fd2972..c0fd0312b0df67d6d7fc5b85ff5897a68b4fa120 100644 (file)
@@ -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)
                    {