mirror of
https://github.com/torvalds/linux.git
synced 2026-11-07 06:17:02 +01:00
crypto: ixp4xx - use memcpy_and_pad() in register_chain_var()
Use memcpy_and_pad() instead of separate memcpy() and memset() calls to simplify register_chain_var(). Signed-off-by: Thorsten Blum <blum@kernel.org> Reviewed-by: Linus Walleij <linusw@kernel.org> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
This commit is contained in:
parent
1dfb15e642
commit
d76957328a
|
|
@ -707,8 +707,7 @@ static int register_chain_var(struct crypto_tfm *tfm, u8 xpad, u32 target,
|
|||
return -EAGAIN;
|
||||
}
|
||||
|
||||
memcpy(pad, key, key_len);
|
||||
memset(pad + key_len, 0, HMAC_PAD_BLOCKLEN - key_len);
|
||||
memcpy_and_pad(pad, HMAC_PAD_BLOCKLEN, key, key_len, 0);
|
||||
for (i = 0; i < HMAC_PAD_BLOCKLEN; i++)
|
||||
pad[i] ^= xpad;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user