[PATCH 07/16] crypto: sha512 - replace sha512_generic with wrapper around SHA-512 library
Eric Biggers
ebiggers at kernel.org
Tue Jun 10 20:39:57 PDT 2025
On Wed, Jun 11, 2025 at 10:24:41AM +0800, Herbert Xu wrote:
> Eric Biggers <ebiggers at kernel.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
More information about the linux-arm-kernel
mailing list