aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/crypto/aesni-intel_glue.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86/crypto/aesni-intel_glue.c')
-rw-r--r--arch/x86/crypto/aesni-intel_glue.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/arch/x86/crypto/aesni-intel_glue.c b/arch/x86/crypto/aesni-intel_glue.c
index 7c04d0da709..1b9c22bea8a 100644
--- a/arch/x86/crypto/aesni-intel_glue.c
+++ b/arch/x86/crypto/aesni-intel_glue.c
@@ -515,6 +515,11 @@ static int xts_aesni_setkey(struct crypto_tfm *tfm, const u8 *key,
515} 515}
516 516
517 517
518static void aesni_xts_tweak(void *ctx, u8 *out, const u8 *in)
519{
520 aesni_enc(ctx, out, in);
521}
522
518static int xts_encrypt(struct blkcipher_desc *desc, struct scatterlist *dst, 523static int xts_encrypt(struct blkcipher_desc *desc, struct scatterlist *dst,
519 struct scatterlist *src, unsigned int nbytes) 524 struct scatterlist *src, unsigned int nbytes)
520{ 525{
@@ -525,7 +530,7 @@ static int xts_encrypt(struct blkcipher_desc *desc, struct scatterlist *dst,
525 .tbuflen = sizeof(buf), 530 .tbuflen = sizeof(buf),
526 531
527 .tweak_ctx = aes_ctx(ctx->raw_tweak_ctx), 532 .tweak_ctx = aes_ctx(ctx->raw_tweak_ctx),
528 .tweak_fn = XTS_TWEAK_CAST(aesni_enc), 533 .tweak_fn = aesni_xts_tweak,
529 .crypt_ctx = aes_ctx(ctx->raw_crypt_ctx), 534 .crypt_ctx = aes_ctx(ctx->raw_crypt_ctx),
530 .crypt_fn = lrw_xts_encrypt_callback, 535 .crypt_fn = lrw_xts_encrypt_callback,
531 }; 536 };
@@ -550,7 +555,7 @@ static int xts_decrypt(struct blkcipher_desc *desc, struct scatterlist *dst,
550 .tbuflen = sizeof(buf), 555 .tbuflen = sizeof(buf),
551 556
552 .tweak_ctx = aes_ctx(ctx->raw_tweak_ctx), 557 .tweak_ctx = aes_ctx(ctx->raw_tweak_ctx),
553 .tweak_fn = XTS_TWEAK_CAST(aesni_enc), 558 .tweak_fn = aesni_xts_tweak,
554 .crypt_ctx = aes_ctx(ctx->raw_crypt_ctx), 559 .crypt_ctx = aes_ctx(ctx->raw_crypt_ctx),
555 .crypt_fn = lrw_xts_decrypt_callback, 560 .crypt_fn = lrw_xts_decrypt_callback,
556 }; 561 };