[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250611033957.GA1484147@sol>
Date: Tue, 10 Jun 2025 20:39:57 -0700
From: Eric Biggers <ebiggers@...nel.org>
To: Herbert Xu <herbert@...dor.apana.org.au>
Cc: linux-crypto@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org, linux-mips@...r.kernel.org,
linux-riscv@...ts.infradead.org, linux-s390@...r.kernel.org,
sparclinux@...r.kernel.org, x86@...nel.org, ardb@...nel.org,
Jason@...c4.com, torvalds@...ux-foundation.org
Subject: Re: [PATCH 07/16] crypto: sha512 - replace sha512_generic with
wrapper around SHA-512 library
On Wed, Jun 11, 2025 at 10:24:41AM +0800, Herbert Xu wrote:
> Eric Biggers <ebiggers@...nel.org> wrote:
> >
> > + {
> > + .base.cra_name = "sha512",
> > + .base.cra_driver_name = "sha512-lib",
> > + .base.cra_priority = 100,
> > + .base.cra_blocksize = SHA512_BLOCK_SIZE,
> > + .base.cra_module = THIS_MODULE,
> > + .digestsize = SHA512_DIGEST_SIZE,
> > + .init = crypto_sha512_init,
> > + .update = crypto_sha512_update,
> > + .final = crypto_sha512_final,
> > + .digest = crypto_sha512_digest,
> > + .descsize = sizeof(struct sha512_ctx),
> > + },
>
> This changes the export format which breaks fallback support
> for ahash drivers.
>
> You need to retain the existing export format.
Do you have a concrete example (meaning, a specific driver) where this actually
matters? Historically, export and import have always had to be paired for the
same transformation object, i.e. import was called only with the output of
export. There is, and has never been, any test that tests otherwise. This
seems like a brand new "requirement" that you've made up unnecessarily.
It also makes much more sense for the export format to simply be the struct used
by the library (e.g. sha512_ctx), not some undocumented struct generated by
pointer arithmetic.
And drivers should just use the library as their fallback, or else just do what
they did before when they must not have been depending on a particular format.
I'll add export and import functions if you insist, but it seems pointless.
Could you at least provide proper definitions for the legacy structs so that I
don't have to do pointer arithmetic to generate them?
- Eric
Powered by blists - more mailing lists