crypto: marvell/cesa - ensure iter.base.op_len is the full op length
authorRussell King <rmk+kernel@arm.linux.org.uk>
Sun, 18 Oct 2015 16:24:26 +0000 (17:24 +0100)
committerHerbert Xu <herbert@gondor.apana.org.au>
Tue, 20 Oct 2015 14:11:07 +0000 (22:11 +0800)
commitbd274b10856b91f702fa767114aa7e6ac45b933d
treea71d3c810d82a26226a71dc845a84a360c879e78
parentd9bba4c3ebbc65b9113624eb1690bed776fb6106
crypto: marvell/cesa - ensure iter.base.op_len is the full op length

When we process the last request of data, and the request contains user
data, the loop in mv_cesa_ahash_dma_req_init() marks the first data size
as being iter.base.op_len which does not include the size of the cache
data.  This means we end up hashing an insufficient amount of data.

Fix this by always including the cache size in the first operation
length of any request.

This has the effect that for a request containing no user data,

iter.base.op_len === iter.src.op_offset === creq->cache_ptr

As a result, we include one further change to use iter.base.op_len in
the cache-but-no-user-data case to make the next change clearer.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/marvell/hash.c