crypto: stm32 - check request size and scatterlist size when using DMA.
authorThomas Bourgoin <thomas.bourgoin@foss.st.com>
Thu, 13 Jul 2023 15:15:16 +0000 (17:15 +0200)
committerHerbert Xu <herbert@gondor.apana.org.au>
Sat, 22 Jul 2023 01:59:38 +0000 (13:59 +1200)
commita10618f397062823a84cd4abedc51f46b9d4410f
tree182792fc7c9f693e3f2059850e9c009da2f39553
parentd9c83f71eeceed2cb54bb78be84f2d4055fd9a1f
crypto: stm32 - check request size and scatterlist size when using DMA.

When we are sending the data to HASH with the DMA, we send all the data
provided in the scatterlists of the request.
But in some cases (ex : tcrypt performances tests), we should only send
req->nbytes
When iterating through the scatterlist we verify if it is the last
scatterlist or if the number of bytes sent plus the data of the current
scatterlist is superior of the total number of bytes to hash.

Signed-off-by: Thomas Bourgoin <thomas.bourgoin@foss.st.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/stm32/stm32-hash.c