OSDN Git Service

crypto: inside-secure - fix hash when length is a multiple of a block
authorAntoine Tenart <antoine.tenart@free-electrons.com>
Tue, 26 Dec 2017 16:21:17 +0000 (17:21 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 3 Feb 2018 16:38:50 +0000 (17:38 +0100)
commitbb9eec7b301eeb178fc1305708ae8902fa507953
tree90dd04e8d12605131bcd8d0903dd7437baf0ecf4
parent5ca02df0160233e463b043897cd17e32d38cb70e
crypto: inside-secure - fix hash when length is a multiple of a block

commit 809778e02cd45d0625439fee67688f655627bb3c upstream.

This patch fixes the hash support in the SafeXcel driver when the update
size is a multiple of a block size, and when a final call is made just
after with a size of 0. In such cases the driver should cache the last
block from the update to avoid handling 0 length data on the final call
(that's a hardware limitation).

Fixes: 1b44c5a60c13 ("crypto: inside-secure - add SafeXcel EIP197 crypto engine driver")
Signed-off-by: Antoine Tenart <antoine.tenart@free-electrons.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/crypto/inside-secure/safexcel_hash.c