Re: [PATCH v2] lib/crypto: md5: remove unused header

From: Mohamad Raizudeen

Date: Thu Oct 15 2026 - 22:29:57 EST


On Thu, Oct 15, 2026 at 05:56:55PM +0000, Eric Biggers wrote:
> On Thu, Oct 15, 2026 at 11:38:06AM +0530, Mohamad Raizudeen wrote:
> > The code handles memory accesses using direct pointer casts and
> > functions like 'cpu_to_le64()' instead of the unaligned helpers.
>
> This should say "using memcpy() instead of the unaligned helpers". The
> actual unaligned accesses in lib/crypto/md5.c are the following:
>
> memcpy(in, data, MD5_BLOCK_SIZE);
> le32_to_cpu_array(in, ARRAY_SIZE(in));
>
> and:
>
> cpu_to_le32_array(ctx->state.h, ARRAY_SIZE(ctx->state.h));
> memcpy(out, ctx->state.h, MD5_DIGEST_SIZE);
>
> - Eric

You are right, the main data block accesses use memcpy().

The reason I mentioned "direct pointer access" because of the
`*(__le64 *)` cast used for the bitcount padding in __md5_final() and
hmac_md5_final(). But I agree that mentioning memcpy() is more accurate
for the whole file.

I will update the commit message and send a v3 soon.

Thanks,
Mohamad Raizudeen