crypto: qat - allow xts requests not multiple of block
authorGiovanni Cabiddu <giovanni.cabiddu@intel.com>
Mon, 29 Jun 2020 17:16:17 +0000 (18:16 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 19 Aug 2020 06:23:28 +0000 (08:23 +0200)
commite966e1c761887ca928f44d3ff73df802f98338ad
treec7df2590fec161666ff65a023b0ee2f86938f8a6
parent74c0a318d7a1858214601fc4c3f31c4a075fa3b8
crypto: qat - allow xts requests not multiple of block

[ Upstream commit 528f776df67c440361b2847b4da400d8754bf030 ]

Allow AES-XTS requests that are not multiple of the block size.
If a request is smaller than the block size, return -EINVAL.

This fixes the following issue reported by the crypto testmgr self-test:

  alg: skcipher: qat_aes_xts encryption failed on test vector "random: len=116 klen=64"; expected_error=0, actual_error=-22, cfg="random: inplace may_sleep use_finup src_divs=[<reimport>45.85%@+4077, <flush>54.15%@alignmask+18]"

Fixes: 96ee111a659e ("crypto: qat - return error for block...")
Signed-off-by: Giovanni Cabiddu <giovanni.cabiddu@intel.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/crypto/qat/qat_common/qat_algs.c