crypto: rockchip - better handle cipher key
authorCorentin Labbe <clabbe@baylibre.com>
Tue, 27 Sep 2022 07:54:46 +0000 (07:54 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 31 Dec 2022 12:32:30 +0000 (13:32 +0100)
commit89117da0102c7ce575da96f80abf5c8c956b5fe6
tree2e123cbec334a38ec9a82ad6efd503da5eb6b43b
parent2edab0edfef55c3296643e6549834ee8fc8b7819
crypto: rockchip - better handle cipher key

[ Upstream commit d6b23ccef82816050c2fd458c9dabfa0e0af09b9 ]

The key should not be set in hardware too much in advance, this will
fail it 2 TFM with different keys generate alternative requests.
The key should be stored and used just before doing cipher operations.

Fixes: ce0183cb6464b ("crypto: rockchip - switch to skcipher API")
Reviewed-by: John Keeping <john@metanate.com>
Signed-off-by: Corentin Labbe <clabbe@baylibre.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/crypto/rockchip/rk3288_crypto.h
drivers/crypto/rockchip/rk3288_crypto_skcipher.c