crypto: atmel-sha - use memcpy_and_pad to simplify hmac_setup
Subsystems (2)
PATCH 1/1 crypto: atmel-sha - use memcpy_and_pad to simplify hmac_setup
Use memcpy_and_pad() instead of memcpy() followed by memset() to simplify atmel_sha_hmac_setup().
Signed-off-by Thorsten Blum <[email protected]>
--- drivers/crypto/atmel-sha.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/crypto/atmel-sha.c +1 -2
@@ -1731,8 +1731,7 @@ static int atmel_sha_hmac_setup(struct atmel_sha_dev *dd,return atmel_sha_hmac_prehash_key (dd, key, keylen);/* Prepare ipad. */ -memcpy ((u8 *)hmac->ipad, key, keylen); -memset ((u8 *)hmac->ipad + keylen,0 , bs - keylen); +memcpy_and_pad (hmac->ipad, bs, key, keylen,0 );return atmel_sha_hmac_compute_ipad_hash (dd); }
Herbert Xu
maintainerQuoted 7 lines · Thorsten Blum
Use
memcpy_and_pad()instead ofmemcpy()followed bymemset()to simplifyatmel_sha_hmac_setup().Signed-off-by Thorsten Blum <[email protected]>--- drivers/crypto/atmel-sha.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
Patch applied. Thanks.
Signature · 3 lines
Email: Herbert Xu <[email protected]> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt