linux-stable/drivers/crypto
Horia Geantă 3a5a9e1ef3 crypto: caam/qi2 - fix chacha20 data size error
HW generates a Data Size error for chacha20 requests that are not
a multiple of 64B, since algorithm state (AS) does not have
the FINAL bit set.

Since updating req->iv (for chaining) is not required,
modify skcipher descriptors to set the FINAL bit for chacha20.

[Note that for skcipher decryption we know that ctx1_iv_off is 0,
which allows for an optimization by not checking algorithm type,
since append_dec_op1() sets FINAL bit for all algorithms except AES.]

Also drop the descriptor operations that save the IV.
However, in order to keep code logic simple, things like
S/G tables generation etc. are not touched.

Cc: <stable@vger.kernel.org> # v5.3+
Fixes: 334d37c9e2 ("crypto: caam - update IV using HW support")
Signed-off-by: Horia Geantă <horia.geanta@nxp.com>
Tested-by: Valentin Ciocoi Radulescu <valentin.ciocoi@nxp.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2020-03-06 12:28:25 +11:00
..
allwinner crypto: sun8i-ce - fix description of stat_fb 2020-03-06 12:28:21 +11:00
amcc crypto: crypto4xx - use GFP_KERNEL for big allocations 2020-01-09 11:30:53 +08:00
amlogic crypto: amlogic - fix removal of module 2020-01-16 15:18:12 +08:00
axis crypto: remove CRYPTO_TFM_RES_BAD_KEY_LEN 2020-01-09 11:30:53 +08:00
bcm crypto: remove propagation of CRYPTO_TFM_RES_* flags 2020-01-09 11:30:53 +08:00
caam crypto: caam/qi2 - fix chacha20 data size error 2020-03-06 12:28:25 +11:00
cavium crypto: Replace zero-length array with flexible-array member 2020-03-06 12:28:21 +11:00
ccp crypto: remove CRYPTO_TFM_RES_BAD_KEY_LEN 2020-01-09 11:30:53 +08:00
ccree crypto: ccree - use devm_kzalloc() for hash data 2020-02-22 09:25:46 +08:00
chelsio crypto: chelsio/chtls - Fixed boolinit.cocci warning 2020-03-06 12:28:24 +11:00
hisilicon crypto: hisilicon - qm depends on UACCE 2020-03-06 12:28:24 +11:00
inside-secure crypto: remove propagation of CRYPTO_TFM_RES_* flags 2020-01-09 11:30:53 +08:00
marvell crypto: remove CRYPTO_TFM_RES_BAD_KEY_LEN 2020-01-09 11:30:53 +08:00
mediatek crypto: Replace zero-length array with flexible-array member 2020-03-06 12:28:21 +11:00
nx crypto: Replace zero-length array with flexible-array member 2020-03-06 12:28:21 +11:00
qat crypto: qat - spelling s/Decrytp/Decrypt/ 2020-02-22 09:25:47 +08:00
qce crypto: qce - handle AES-XTS cases that qce fails 2020-02-13 17:05:27 +08:00
rockchip crypto: remove CRYPTO_TFM_RES_BAD_KEY_LEN 2020-01-09 11:30:53 +08:00
stm32 crypto: remove CRYPTO_TFM_RES_BAD_KEY_LEN 2020-01-09 11:30:53 +08:00
ux500 crypto: remove CRYPTO_TFM_RES_BAD_KEY_LEN 2020-01-09 11:30:53 +08:00
virtio crypto: remove CRYPTO_TFM_RES_BAD_KEY_LEN 2020-01-09 11:30:53 +08:00
vmx crypto: vmx - reject xts inputs that are too short 2020-01-16 15:18:13 +08:00
xilinx crypto: xilinx - Add Xilinx AES driver 2020-02-28 08:36:46 +08:00
atmel-aes-regs.h
atmel-aes.c crypto: atmel-{aes,sha,tdes} - Retire crypto_platform_data 2020-01-22 16:21:09 +08:00
atmel-authenc.h crypto: remove propagation of CRYPTO_TFM_RES_* flags 2020-01-09 11:30:53 +08:00
atmel-ecc.c crypto: atmel-ecc - factor out code that can be shared 2019-05-30 15:35:45 +08:00
atmel-i2c.c crypto: atmel - Fix -Wunused-const-variable warning 2019-08-30 18:05:31 +10:00
atmel-i2c.h crypto: atmel - Fix -Wunused-const-variable warning 2019-08-30 18:05:31 +10:00
atmel-sha-regs.h
atmel-sha.c crypto: atmel-{aes,sha,tdes} - Retire crypto_platform_data 2020-01-22 16:21:09 +08:00
atmel-sha204a.c crypto: atmel-sha204a - Use device-managed registration API 2019-08-02 14:43:59 +10:00
atmel-tdes-regs.h
atmel-tdes.c crypto: atmel-{aes,sha,tdes} - Retire crypto_platform_data 2020-01-22 16:21:09 +08:00
exynos-rng.c crypto: exynos - use devm_platform_ioremap_resource() to simplify code 2019-08-09 15:11:59 +10:00
geode-aes.c crypto: remove propagation of CRYPTO_TFM_RES_* flags 2020-01-09 11:30:53 +08:00
geode-aes.h crypto: geode-aes - convert to skcipher API and make thread-safe 2019-10-23 19:46:56 +11:00
hifn_795x.c remove ioremap_nocache and devm_ioremap_nocache 2020-01-06 09:45:59 +01:00
img-hash.c crypto: img-hash - Replace zero-length array with flexible-array member 2020-02-22 09:25:48 +08:00
ixp4xx_crypto.c crypto: remove CRYPTO_TFM_RES_WEAK_KEY 2020-01-09 11:30:53 +08:00
Kconfig crypto: xilinx - Add Xilinx AES driver 2020-02-28 08:36:46 +08:00
Makefile crypto: xilinx - Add Xilinx AES driver 2020-02-28 08:36:46 +08:00
mxs-dcp.c crypto: mxs-dcp - fix scatterlist linearization for hash 2020-03-06 12:28:21 +11:00
n2_asm.S
n2_core.c crypto: remove CRYPTO_TFM_RES_BAD_KEY_LEN 2020-01-09 11:30:53 +08:00
n2_core.h
omap-aes-gcm.c crypto: omap-aes-gcm - convert to use crypto engine 2019-12-11 16:37:00 +08:00
omap-aes.c crypto: omap-aes-gcm - convert to use crypto engine 2019-12-11 16:37:00 +08:00
omap-aes.h crypto: omap-aes-gcm - convert to use crypto engine 2019-12-11 16:37:00 +08:00
omap-crypto.c crypto: omap-crypto - copy the temporary data to output buffer properly 2019-12-11 16:37:00 +08:00
omap-crypto.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
omap-des.c crypto: omap-des - handle NULL cipher request 2019-12-11 16:37:00 +08:00
omap-sham.c crypto: Replace zero-length array with flexible-array member 2020-03-06 12:28:21 +11:00
padlock-aes.c crypto: remove CRYPTO_TFM_RES_BAD_KEY_LEN 2020-01-09 11:30:53 +08:00
padlock-sha.c crypto: padlock-sha - Use init_tfm/exit_tfm interface 2019-12-11 16:48:39 +08:00
picoxcell_crypto.c crypto: remove propagation of CRYPTO_TFM_RES_* flags 2020-01-09 11:30:53 +08:00
picoxcell_crypto_regs.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 156 2019-05-30 11:26:35 -07:00
qcom-rng.c crypto: qcom-rng - use devm_platform_ioremap_resource() to simplify code 2019-08-09 15:12:03 +10:00
s5p-sss.c crypto: s5p-sss - Replace zero-length array with flexible-array member 2020-02-22 09:25:48 +08:00
sahara.c crypto: remove propagation of CRYPTO_TFM_RES_* flags 2020-01-09 11:30:53 +08:00
talitos.c crypto: remove CRYPTO_TFM_RES_BAD_KEY_LEN 2020-01-09 11:30:53 +08:00
talitos.h crypto: talitos - drop icv_ool 2019-07-03 22:13:11 +08:00