crypto: cast5 - use memcpy_and_pad() in cast5_setkey()

Use memcpy_and_pad() instead of separate memcpy() and memset() calls to
simplify cast5_setkey().

Signed-off-by: Thorsten Blum <blum@kernel.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
This commit is contained in:
Thorsten Blum 2026-09-21 08:11:20 +02:00 committed by Herbert Xu
parent 67aefeccc4
commit dfcaf2d961

View File

@ -483,9 +483,7 @@ int cast5_setkey(struct crypto_tfm *tfm, const u8 *key, unsigned int key_len)
c->rr = key_len <= 10 ? 1 : 0;
memset(p_key, 0, 16);
memcpy(p_key, key, key_len);
memcpy_and_pad(p_key, sizeof(p_key), key, key_len, 0);
x[0] = be32_to_cpu(p_key[0]);
x[1] = be32_to_cpu(p_key[1]);