mirror of
https://github.com/torvalds/linux.git
synced 2026-07-27 09:36:22 +02:00
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 <thorsten.blum@linux.dev> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
This commit is contained in:
parent
2b7b16c905
commit
08b0f3a775
|
|
@ -1724,8 +1724,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);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user