mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Mohamad Raizudeen <raizudeen.kerneldev@gmail.com>
To: Eric Biggers <ebiggers@kernel.org>
Cc: herbert@gondor.apana.org.au, ardb@kernel.org, Jason@zx2c4.com,
	skhan@linuxfoundation.org, me@brighamcampbell.com,
	jkoolstra@xs4all.nl, linux-crypto@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] lib/crypto: md5: remove unused header
Date: Fri, 16 Oct 2026 07:56:31 +0530	[thread overview]
Message-ID: <atGLVxfnna9yZR11@kernel> (raw)
In-Reply-To: <20261015175655.GA2170687@google.com>

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

      reply	other threads:[~2026-10-16  2:26 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-15  6:08 Mohamad Raizudeen
2026-10-15 17:56 ` Eric Biggers
2026-10-16  2:26   ` Mohamad Raizudeen [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=atGLVxfnna9yZR11@kernel \
    --to=raizudeen.kerneldev@gmail.com \
    --cc=Jason@zx2c4.com \
    --cc=ardb@kernel.org \
    --cc=ebiggers@kernel.org \
    --cc=herbert@gondor.apana.org.au \
    --cc=jkoolstra@xs4all.nl \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=me@brighamcampbell.com \
    --cc=skhan@linuxfoundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®