aboutsummaryrefslogtreecommitdiffstats
path: root/crypto/evp/e_aes.c
diff options
context:
space:
mode:
authorAndy Polyakov <appro@openssl.org>2011-11-15 12:18:40 +0000
committerAndy Polyakov <appro@openssl.org>2011-11-15 12:18:40 +0000
commit77aae9654f05cd37d440af95e0ffbe29ba8cee12 (patch)
treefadd541bd011c935d9586e4b57ec9f5c96786113 /crypto/evp/e_aes.c
parentae551760917614647ad6fbacec6e4c1b495a94cf (diff)
downloadopenssl-77aae9654f05cd37d440af95e0ffbe29ba8cee12.tar.gz
Configure, e_aes.c: allow for XTS assembler implementation.
Diffstat (limited to 'crypto/evp/e_aes.c')
-rw-r--r--crypto/evp/e_aes.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/crypto/evp/e_aes.c b/crypto/evp/e_aes.c
index cd0af63819..519e0143d2 100644
--- a/crypto/evp/e_aes.c
+++ b/crypto/evp/e_aes.c
@@ -145,6 +145,14 @@ void AES_ctr32_encrypt(const unsigned char *in, unsigned char *out,
size_t blocks, const AES_KEY *key,
const unsigned char ivec[AES_BLOCK_SIZE]);
#endif
+#ifdef AES_XTS_ASM
+void AES_xts_encrypt(const char *inp,char *out,size_t len,
+ const AES_KEY *key1, const AES_KEY *key2,
+ const unsigned char iv[16]);
+void AES_xts_decrypt(const char *inp,char *out,size_t len,
+ const AES_KEY *key1, const AES_KEY *key2,
+ const unsigned char iv[16]);
+#endif
#if defined(AES_ASM) && !defined(I386_ONLY) && ( \
((defined(__i386) || defined(__i386__) || \
@@ -1051,7 +1059,11 @@ static int aes_xts_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
if (key) do
{
+#ifdef AES_XTS_ASM
+ xctx->stream = enc ? AES_xts_encrypt : AES_xts_decrypt;
+#else
xctx->stream = NULL;
+#endif
/* key_len is two AES keys */
#ifdef BSAES_CAPABLE
if (BSAES_CAPABLE)