diff options
| author | Rusydi H. Makarim <rusydi.makarim@kriptograf.id> | 2025-12-14 14:15:12 +0300 |
|---|---|---|
| committer | Eric Biggers <ebiggers@kernel.org> | 2026-01-12 22:07:50 +0300 |
| commit | c8bf0b969d274036e82381818630eb8651c294f2 (patch) | |
| tree | 6fd4b541f4fe4247dd0979361672d87b5281c819 /lib | |
| parent | 0d8e6c0a1178cbe88e38113bf2a4277b4b21a76f (diff) | |
| download | linux-c8bf0b969d274036e82381818630eb8651c294f2.tar.xz | |
lib/crypto: md5: Use rol32() instead of open-coding it
For the bitwise left rotation in MD5STEP, use rol32() from
<linux/bitops.h> instead of open-coding it.
Signed-off-by: Rusydi H. Makarim <rusydi.makarim@kriptograf.id>
Link: https://lore.kernel.org/r/20251214-rol32_in_md5-v1-1-20f5f11a92b2@kriptograf.id
Signed-off-by: Eric Biggers <ebiggers@kernel.org>
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/crypto/md5.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/crypto/md5.c b/lib/crypto/md5.c index c0610ea1370e..c4af57db0ea8 100644 --- a/lib/crypto/md5.c +++ b/lib/crypto/md5.c @@ -29,7 +29,7 @@ static const struct md5_block_state md5_iv = { #define F4(x, y, z) (y ^ (x | ~z)) #define MD5STEP(f, w, x, y, z, in, s) \ - (w += f(x, y, z) + in, w = (w << s | w >> (32 - s)) + x) + (w += f(x, y, z) + in, w = rol32(w, s) + x) static void md5_block_generic(struct md5_block_state *state, const u8 data[MD5_BLOCK_SIZE]) |
