LinuxPPC-Dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Biggers <ebiggers@kernel.org>
To: Ard Biesheuvel <ardb@kernel.org>
Cc: linux-crypto@vger.kernel.org,
	"Jason A . Donenfeld" <Jason@zx2c4.com>,
	Herbert Xu <herbert@gondor.apana.org.au>,
	Madhavan Srinivasan <maddy@linux.ibm.com>,
	Michael Ellerman <mpe@ellerman.id.au>,
	Nicholas Piggin <npiggin@gmail.com>,
	"Christophe Leroy (CS GROUP)" <chleroy@kernel.org>,
	Ritesh Harjani <ritesh.list@gmail.com>,
	Shrikanth Hegde <sshegde@linux.ibm.com>,
	linuxppc-dev@lists.ozlabs.org
Subject: Re: [PATCH] lib/crypto: powerpc/poly1305: Remove BROKEN implementation
Date: Thu, 29 Oct 2026 10:10:31 -0700	[thread overview]
Message-ID: <20261029171031.GC1862@quark> (raw)
In-Reply-To: <7c8500c2-4b59-40e2-a227-b488f1336fef@app.fastmail.com>

On Thu, Oct 29, 2026 at 10:42:40AM +0100, Ard Biesheuvel wrote:
> On Thu, 29 Oct 2026, at 07:35, Eric Biggers wrote:
> > The PowerPC implementation of Poly1305 has been marked as BROKEN for
> > well over a year, since commit bc8169003b41 ("crypto: powerpc/poly1305 -
> > add depends on BROKEN for now").  So, it's not being built or used.
> >
> > The justification for marking it BROKEN was that it didn't work in
> > softirq context.  That still fully applies.
> >
> > However, it turns out the assembly file actually also contains logic
> > bugs that make it compute incorrect Poly1305 values in some cases.  This
> > is shown by it failing the test case test_poly1305_split_update_carry
> > (if "depends on BROKEN" is removed).  The cause of that appears to be a
> > lost carry bit in Carry_reduction.  However, there also appears to be a
> > bug in do_final_update where it incorrectly assumes v6 is fully reduced.
> >
> > In addition, poly1305_emit_64 contains a secret-dependent branch.
> >
> > Let's just drop this code.  A fixed version can be reconsidered later.
> >
> > Signed-off-by: Eric Biggers <ebiggers@kernel.org>
> > ---
> >  lib/crypto/Kconfig                     |    6 +-
> >  lib/crypto/Makefile                    |    2 -
> >  lib/crypto/powerpc/poly1305-p10le_64.S | 1076 ------------------------
> >  lib/crypto/powerpc/poly1305.h          |   76 --
> >  4 files changed, 1 insertion(+), 1159 deletions(-)
> >  delete mode 100644 lib/crypto/powerpc/poly1305-p10le_64.S
> >  delete mode 100644 lib/crypto/powerpc/poly1305.h
> >
> 
> Reviewed-by: Ard Biesheuvel <ardb@kernel.org>

Applied to https://git.kernel.org/pub/scm/linux/kernel/git/ebiggers/linux.git/log/?h=libcrypto-fixes

- Eric


      reply	other threads:[~2026-10-29 17:10 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-29  6:35 [PATCH] lib/crypto: powerpc/poly1305: Remove BROKEN implementation Eric Biggers
2026-10-29  9:42 ` Ard Biesheuvel
2026-10-29 17:10   ` Eric Biggers [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=20261029171031.GC1862@quark \
    --to=ebiggers@kernel.org \
    --cc=Jason@zx2c4.com \
    --cc=ardb@kernel.org \
    --cc=chleroy@kernel.org \
    --cc=herbert@gondor.apana.org.au \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=maddy@linux.ibm.com \
    --cc=mpe@ellerman.id.au \
    --cc=npiggin@gmail.com \
    --cc=ritesh.list@gmail.com \
    --cc=sshegde@linux.ibm.com \
    /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