crypto: stm32/cryp - fix CTR counter carry
authorNicolas Toromanoff <nicolas.toromanoff@foss.st.com>
Tue, 30 Nov 2021 07:54:55 +0000 (08:54 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 27 Jan 2022 09:53:55 +0000 (10:53 +0100)
commite9e0dd5da8ca4623e30ab1abd67882ddcda05050
treeffb139808de63d6fcafb81e9dc673f7c7f6d4a09
parentc40b1bc851e0816f45520f31b44e8461de13fc5c
crypto: stm32/cryp - fix CTR counter carry

[ Upstream commit 41c76690b0990efacd15d35cfb4e77318cd80ebb ]

STM32 CRYP hardware doesn't manage CTR counter bigger than max U32, as
a workaround, at each block the current IV is saved, if the saved IV
lower u32 is 0xFFFFFFFF, the full IV is manually incremented, and set
in hardware.
Fixes: bbb2832620ac ("crypto: stm32 - Fix sparse warnings")

Signed-off-by: Nicolas Toromanoff <nicolas.toromanoff@foss.st.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/crypto/stm32/stm32-cryp.c