New ctrl to set current certificate.
[oweals/openssl.git] / crypto / evp / e_aes.c
index 5278001a2121c786a6b9e51276110a0f21fee2ad..77e4bead71450334d85b69d744582121d671d9ff 100644 (file)
@@ -157,6 +157,11 @@ void AES_xts_decrypt(const char *inp,char *out,size_t len,
                        const unsigned char iv[16]);
 #endif
 
+#if    defined(VPAES_ASM) && (defined(__powerpc__) || defined(__ppc__) || defined(_ARCH_PPC))
+extern unsigned int OPENSSL_ppccap_P;
+#define        VPAES_CAPABLE   (OPENSSL_ppccap_P&(1<<1))
+#endif
+
 #if    defined(AES_ASM) && !defined(I386_ONLY) &&      (  \
        ((defined(__i386)       || defined(__i386__)    || \
          defined(_M_IX86)) && defined(OPENSSL_IA32_SSE2))|| \
@@ -897,6 +902,13 @@ 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)            \
        BLOCK_CIPHER_generic(nid,keylen,16,16,cbc,cbc,CBC,flags|EVP_CIPH_FLAG_DEFAULT_ASN1)     \
        BLOCK_CIPHER_generic(nid,keylen,16,0,ecb,ecb,ECB,flags|EVP_CIPH_FLAG_DEFAULT_ASN1)      \
@@ -994,7 +1006,7 @@ static int aes_cbc_cipher(EVP_CIPHER_CTX *ctx,unsigned char *out,
        else if (ctx->encrypt)
                CRYPTO_cbc128_encrypt(in,out,len,&dat->ks,ctx->iv,dat->block);
        else
-               CRYPTO_cbc128_encrypt(in,out,len,&dat->ks,ctx->iv,dat->block);
+               CRYPTO_cbc128_decrypt(in,out,len,&dat->ks,ctx->iv,dat->block);
 
        return 1;
 }