Thread (34 messages) 34 messages, 4 authors, 2025-06-16

Re: [PATCH 07/16] crypto: sha512 - replace sha512_generic with wrapper around SHA-512 library

From: Eric Biggers <ebiggers@kernel.org>
Date: 2025-06-11 03:40:21
Also in: linux-crypto, linux-mips, linux-riscv, linux-s390, lkml, sparclinux

On Wed, Jun 11, 2025 at 10:24:41AM +0800, Herbert Xu wrote:
Eric Biggers [off-list ref] wrote:
quoted
+       {
+               .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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help