mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git
synced 2026-04-04 04:37:39 -04:00
crypto: marvell/cesa - use memcpy_and_pad in mv_cesa_ahash_export
Replace memset() followed by memcpy() with memcpy_and_pad() to simplify the code and to write to 'cache' only once. Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
This commit is contained in:
committed by
Herbert Xu
parent
f30579bbae
commit
914b0c68d4
@@ -847,8 +847,7 @@ static int mv_cesa_ahash_export(struct ahash_request *req, void *hash,
|
||||
|
||||
*len = creq->len;
|
||||
memcpy(hash, creq->state, digsize);
|
||||
memset(cache, 0, blocksize);
|
||||
memcpy(cache, creq->cache, creq->cache_ptr);
|
||||
memcpy_and_pad(cache, blocksize, creq->cache, creq->cache_ptr, 0);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user