crypto: sun4i-ss - linearize buffers content must be kept
authorCorentin Labbe <clabbe@baylibre.com>
Mon, 14 Dec 2020 20:02:25 +0000 (20:02 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 4 Mar 2021 10:37:37 +0000 (11:37 +0100)
commit99e9cb7bc13befed01303354e05cba713ac617b0
tree9e36ce770d3bb09f192cf7cf7d11515afc75ca43
parent5d93dad67df85a41b52f97fc53b5066207f4c65f
crypto: sun4i-ss - linearize buffers content must be kept

[ Upstream commit 583513510a7acd2306787865bcd19ebb2f629d42 ]

When running the non-optimized cipher function, SS produce partial random
output.
This is due to linearize buffers being reseted after each loop.

For preserving stack, instead of moving them back to start of function,
I move them in sun4i_ss_ctx.

Fixes: 8d3bcb9900ca ("crypto: sun4i-ss - reduce stack usage")
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/allwinner/sun4i-ss/sun4i-ss-cipher.c
drivers/crypto/allwinner/sun4i-ss/sun4i-ss.h