Re: [PATCH v2 00/12] Curve25519 cleanup

2025-09-15 Thread Eric Biggers
On Sat, Sep 06, 2025 at 02:35:11PM -0700, Eric Biggers wrote: > This series is targeting libcrypto-next. It can also be retrieved from: > > git fetch > https://git.kernel.org/pub/scm/linux/kernel/git/ebiggers/linux.git > curve25519-v2 > > This series removes the unus

Re: [PATCH v2 12/12] wireguard: kconfig: Simplify crypto kconfig selections

2025-09-08 Thread Eric Biggers
On Mon, Sep 08, 2025 at 06:35:04PM +0200, Jason A. Donenfeld wrote: > Hi Eric, > > Just a small nit -- would you commit this with the subject line all > lower case, like the other wireguard commits? Done. > By the way, I have been reading every single one of your patches. It > didn't seem like i

Re: [PATCH v2 07/12] lib/crypto: tests: Migrate Curve25519 self-test to KUnit

2025-09-06 Thread Eric Biggers
On Sat, Sep 06, 2025 at 02:35:18PM -0700, Eric Biggers wrote: > +static struct kunit_case curve25519_test_cases[] = { > + KUNIT_CASE(test_curve25519), > + KUNIT_CASE(test_curve25519_basepoint), > + {}, > +}; > + > +static struct kunit_suite curve25519_test_su

[PATCH v2 12/12] wireguard: kconfig: Simplify crypto kconfig selections

2025-09-06 Thread Eric Biggers
KMSAN dependencies internally. - Add a selection of CRYPTO_LIB_UTILS, since WireGuard directly calls crypto_memneq(). This gets selected indirectly by CRYPTO_LIB_CURVE25519 and CRYPTO_LIB_CHACHA20POLY1305 anyway, but it's best to make this dependency explicit. Signed-off-by: Er

[PATCH v2 00/12] Curve25519 cleanup

2025-09-06 Thread Eric Biggers
rom messages in test_curve25519() - Use NSEC_PER_SEC instead of literal 10 - Added an Acked-by Eric Biggers (12): crypto: hisilicon/hpre - Remove unused curve25519 kpp support crypto: arm/curve25519 - Remove unused kpp support crypto: powerpc/curve25519 - Remove unused kpp support crypto: x86/curv

[PATCH v2 01/12] crypto: hisilicon/hpre - Remove unused curve25519 kpp support

2025-09-06 Thread Eric Biggers
Curve25519 is used only via the library API, not the crypto_kpp API. In preparation for removing the unused crypto_kpp API for Curve25519, remove the unused "hpre-curve25519" kpp algorithm. Cc: Longfang Liu Cc: Zhiqi Song Signed-off-by: Eric Biggers --- drivers/crypto/hisilic

[PATCH v2 08/12] lib/crypto: tests: Add Curve25519 benchmark

2025-09-06 Thread Eric Biggers
Add a benchmark to curve25519_kunit. This brings it in line with the other crypto KUnit tests and provides an easy way to measure performance. Signed-off-by: Eric Biggers --- lib/crypto/tests/curve25519_kunit.c | 31 + 1 file changed, 31 insertions(+) diff --git a

[PATCH v2 02/12] crypto: arm/curve25519 - Remove unused kpp support

2025-09-06 Thread Eric Biggers
le via the library API. It's also worth noting that even if the kpp support for Curve25519 comes back later, there is no need for arch-specific kpp glue code like this, as a single kpp algorithm that wraps the library API is sufficient. Signed-off-by: Eric Biggers --- arch/arm/crypto/Kconfig

[PATCH v2 10/12] lib/crypto: curve25519: Consolidate into single module

2025-09-06 Thread Eric Biggers
generic Curve25519 code. And the Curve25519 functions are very long anyway, so inlining doesn't matter as much for Curve25519 as it does for some other algorithms.) Signed-off-by: Eric Biggers --- arch/arm/crypto/Kconfig | 12 - arch/arm/crypto/Mak

[PATCH v2 11/12] lib/crypto: tests: Enable Curve25519 test when CRYPTO_SELFTESTS

2025-09-06 Thread Eric Biggers
. Signed-off-by: Eric Biggers --- lib/crypto/tests/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/crypto/tests/Kconfig b/lib/crypto/tests/Kconfig index eaca60d3e0a36..578af717e13a7 100644 --- a/lib/crypto/tests/Kconfig +++ b/lib/crypto/tests/Kconfig @@ -11,11

[PATCH v2 05/12] crypto: testmgr - Remove curve25519 kpp tests

2025-09-06 Thread Eric Biggers
s the same list of test vectors. So they didn't really provide any additional value. Signed-off-by: Eric Biggers --- crypto/testmgr.c |6 - crypto/testmgr.h | 1225 -- 2 files changed, 1231 deletions(-) diff --git a/crypto/testmgr.c b/crypto/

[PATCH v2 09/12] lib/crypto: curve25519: Move a couple functions out-of-line

2025-09-06 Thread Eric Biggers
Move curve25519() and curve25519_generate_public() from curve25519.h to curve25519.c. There's no good reason for them to be inline. Signed-off-by: Eric Biggers --- include/crypto/curve25519.h | 28 +++- lib/crypto/curve25519.c

[PATCH v2 04/12] crypto: x86/curve25519 - Remove unused kpp support

2025-09-06 Thread Eric Biggers
le via the library API. It's also worth noting that even if the kpp support for Curve25519 comes back later, there is no need for arch-specific kpp glue code like this, as a single kpp algorithm that wraps the library API is sufficient. Signed-off-by: Eric Biggers --- arch/x86/crypto/Kconfig

[PATCH v2 06/12] crypto: curve25519 - Remove unused kpp support

2025-09-06 Thread Eric Biggers
y API (), which is a simpler and easier-to-use API and is the API that is actually being used. Acked-by: Geert Uytterhoeven # m68k Signed-off-by: Eric Biggers --- arch/m68k/configs/amiga_defconfig| 1 - arch/m68k/configs/apollo_defconfig | 1 - arch/m68k/configs/atari_defconfig|

[PATCH v2 07/12] lib/crypto: tests: Migrate Curve25519 self-test to KUnit

2025-09-06 Thread Eric Biggers
ependency, since the Curve25519 code is still entangled with CRYPTO. A later commit will fix that. Signed-off-by: Eric Biggers --- include/crypto/curve25519.h | 2 - lib/crypto/Makefile | 1 - lib/crypto/curve25519.c | 3 - lib/

[PATCH v2 03/12] crypto: powerpc/curve25519 - Remove unused kpp support

2025-09-06 Thread Eric Biggers
ssible via the library API. It's also worth noting that even if the kpp support for Curve25519 comes back later, there is no need for arch-specific kpp glue code like this, as a single kpp algorithm that wraps the library API is sufficient. Signed-off-by: Eric Biggers --- arch/powerpc

[PATCH 4/6] lib/crypto: curve25519: Move a couple functions out-of-line

2025-09-03 Thread Eric Biggers
Move curve25519() and curve25519_generate_public() from curve25519.h to curve25519.c. There's no good reason for them to be inline. Signed-off-by: Eric Biggers --- include/crypto/curve25519.h | 28 +++- lib/crypto/curve25519.c

[PATCH 1/6] crypto: curve25519 - Remove kpp support

2025-09-03 Thread Eric Biggers
e25519 remains fully supported for in-kernel users via the library API (crypto/curve25519.h). Signed-off-by: Eric Biggers --- arch/arm/crypto/Kconfig |1 - arch/arm/crypto/curve25519-glue.c | 77 +- arch/m68k/configs/amiga_defconfig |1

[PATCH 2/6] lib/crypto: tests: Migrate Curve25519 self-test to KUnit

2025-09-03 Thread Eric Biggers
ependency, since the Curve25519 code is still entangled with CRYPTO. A later commit will fix that. Signed-off-by: Eric Biggers --- include/crypto/curve25519.h | 2 - lib/crypto/Makefile | 1 - lib/crypto/curve25519.c | 3 - lib/

[PATCH 0/6] Curve25519 cleanup

2025-09-02 Thread Eric Biggers
reorganizes the generic and arch-optimized Curve25519 code to all be located in lib/crypto/ and built into a single libcurve25519 module. Eric Biggers (6): crypto: curve25519 - Remove kpp support lib/crypto: tests: Migrate Curve25519 self-test to KUnit lib/crypto: tests: Add Curve25519 benchmark

[PATCH 6/6] wireguard: kconfig: Simplify crypto kconfig selections

2025-09-02 Thread Eric Biggers
KMSAN dependencies internally. - Add a selection of CRYPTO_LIB_UTILS, since WireGuard directly calls crypto_memneq(). This gets selected indirectly by CRYPTO_LIB_CURVE25519 and CRYPTO_LIB_CHACHA20POLY1305 anyway, but it's best to make this dependency explicit. Signed-off-by: Er

Re: [PATCH 5/6] lib/crypto: curve25519: Consolidate into single module

2025-09-02 Thread Eric Biggers
On Mon, Sep 01, 2025 at 01:18:14PM -0700, Eric Biggers wrote: > diff --git a/lib/crypto/tests/Kconfig b/lib/crypto/tests/Kconfig > index 7e4e66f30a7a6..c0f3b64489dd6 100644 > --- a/lib/crypto/tests/Kconfig > +++ b/lib/crypto/tests/Kconfig > @@ -11,13 +11,14 @@ config CRYPTO_LIB_BLA

[PATCH 5/6] lib/crypto: curve25519: Consolidate into single module

2025-09-01 Thread Eric Biggers
generic Curve25519 code. And the Curve25519 functions are very long anyway, so inlining doesn't matter as much for Curve25519 as it does for some other algorithms.) Signed-off-by: Eric Biggers --- arch/arm/crypto/Kconfig | 12 - arch/arm/crypto/Mak

[PATCH 3/6] lib/crypto: tests: Add Curve25519 benchmark

2025-09-01 Thread Eric Biggers
Add a benchmark to curve25519_kunit. This brings it in line with the other crypto KUnit tests and provides an easy way to measure performance. Signed-off-by: Eric Biggers --- lib/crypto/tests/curve25519_kunit.c | 31 + 1 file changed, 31 insertions(+) diff --git a

Re: [PATCH v2 0/7] MD5 library functions

2025-08-11 Thread Eric Biggers
On Tue, Aug 05, 2025 at 03:28:48PM -0700, Eric Biggers wrote: > This series is targeting libcrypto-next and can also be retrieved from: > > git fetch > https://git.kernel.org/pub/scm/linux/kernel/git/ebiggers/linux.git md5-lib-v2 > > This series introduces a library API fo

Re: [PATCH v2 6/7] crypto: md5 - Wrap library and add HMAC support

2025-08-05 Thread Eric Biggers
On Tue, Aug 05, 2025 at 03:28:54PM -0700, Eric Biggers wrote: > Reimplement crypto/md5.c on top of the new MD5 library functions. Also > add support for HMAC-MD5, again just wrapping the library functions. > > This closely mirrors crypto/sha1.c. > > Signed-off-by: Eric Bigger

[PATCH v2 6/7] crypto: md5 - Wrap library and add HMAC support

2025-08-05 Thread Eric Biggers
Reimplement crypto/md5.c on top of the new MD5 library functions. Also add support for HMAC-MD5, again just wrapping the library functions. This closely mirrors crypto/sha1.c. Signed-off-by: Eric Biggers --- crypto/Kconfig| 2 +- crypto/md5.c | 359

[PATCH v2 7/7] lib/crypto: tests: Add KUnit tests for MD5 and HMAC-MD5

2025-08-05 Thread Eric Biggers
x27;t have to be run at build time. Signed-off-by: Eric Biggers --- lib/crypto/tests/Kconfig| 10 ++ lib/crypto/tests/Makefile | 1 + lib/crypto/tests/md5-testvecs.h | 186 lib/crypto/tests/md5_kunit.c| 39 +++ 4 files changed, 236 inser

[PATCH v2 5/7] lib/crypto: sparc/md5: Migrate optimized code into library

2025-08-05 Thread Eric Biggers
code was disabled by default. MD5 still remains available through crypto_shash, but individual architectures no longer need to handle it. Note: to see the diff from arch/sparc/crypto/md5_glue.c to lib/crypto/sparc/md5.h, view this commit with 'git show -M10'. Signed-off-by: Eric Biggers

[PATCH v2 4/7] lib/crypto: powerpc/md5: Migrate optimized code into library

2025-08-05 Thread Eric Biggers
MD5 code was disabled by default. MD5 still remains available through crypto_shash, but individual architectures no longer need to handle it. Signed-off-by: Eric Biggers --- arch/powerpc/configs/powernv_defconfig| 1 - arch/powerpc/configs/ppc64_defconfig | 1 - arch/powerpc

[PATCH v2 2/7] lib/crypto: mips/md5: Migrate optimized code into library

2025-08-05 Thread Eric Biggers
was disabled by default. MD5 still remains available through crypto_shash, but individual architectures no longer need to handle it. Note: to see the diff from arch/mips/cavium-octeon/crypto/octeon-md5.c to lib/crypto/mips/md5.h, view this commit with 'git show -M10'. Signed-off-by: Er

[PATCH v2 3/7] mips: cavium-octeon: Move octeon-crypto.c into parent dir

2025-08-05 Thread Eric Biggers
Since octeon-crypto.c is the only remaining source file in arch/mips/cavium-octeon/crypto/, move it into its parent directory arch/mips/cavium-octeon/. Then remove the directory arch/mips/cavium-octeon/crypto/, including its Makefile. Signed-off-by: Eric Biggers --- arch/mips/cavium-octeon

[PATCH v2 1/7] lib/crypto: md5: Add MD5 and HMAC-MD5 library functions

2025-08-05 Thread Eric Biggers
"md5" and "hmac(md5)" crypto_shash algorithms will also be reimplemented on top of these library functions. For "hmac(md5)" this will provide a faster, more streamlined implementation. Signed-off-by: Eric Biggers --- include/crypto/md5.h | 181 +

[PATCH v2 0/7] MD5 library functions

2025-08-05 Thread Eric Biggers
ecture-optimized MD5 code, since unfortunately there were objections to removing it. Eric Biggers (7): lib/crypto: md5: Add MD5 and HMAC-MD5 library functions lib/crypto: mips/md5: Migrate optimized code into library mips: cavium-octeon: Move octeon-crypto.c into parent dir lib/crypto:

Re: Crypto use cases

2025-08-05 Thread Eric Biggers
On Tue, Aug 05, 2025 at 04:17:49PM +0900, Simon Richter wrote: > Hi, > > On 8/5/25 13:58, Eric Biggers wrote: > > > What does this have to do with this thread, which is about the PowerPC > > optimized MD5 code? > > Hence the new subject. It is still related to rem

Re: [PATCH 3/7] crypto: powerpc/md5 - Remove PowerPC optimized MD5 code

2025-08-05 Thread Eric Biggers
On Tue, Aug 05, 2025 at 08:27:14AM +0200, Christophe Leroy wrote: > > What? That's crazy. Userspace MD5 code would be faster and more > > reliable. No need to make syscalls, transfer data to and from the > > kernel, have an external dependency, etc. Is this the coreutils md5sum? > > We need to

Re: Crypto use cases (was: Remove PowerPC optimized MD5 code)

2025-08-04 Thread Eric Biggers
On Tue, Aug 05, 2025 at 01:49:31PM +0900, Simon Richter wrote: > Hi, > > On 8/5/25 07:59, Eric Biggers wrote: > > > > md5sum uses the kernel's MD5 code: > > > What? That's crazy. Userspace MD5 code would be faster and more > > reliable. No need t

Re: [PATCH 3/7] crypto: powerpc/md5 - Remove PowerPC optimized MD5 code

2025-08-04 Thread Eric Biggers
On Mon, Aug 04, 2025 at 10:59:01PM +, Eric Biggers wrote: > On Mon, Aug 04, 2025 at 09:02:27PM +0200, Christophe Leroy wrote: > > > > > > Le 04/08/2025 à 20:09, Eric Biggers a écrit : > > > On Mon, Aug 04, 2025 at 07:42:15PM +0200, Christophe Leroy wrote: >

Re: [PATCH 3/7] crypto: powerpc/md5 - Remove PowerPC optimized MD5 code

2025-08-04 Thread Eric Biggers
On Mon, Aug 04, 2025 at 09:02:27PM +0200, Christophe Leroy wrote: > > > Le 04/08/2025 à 20:09, Eric Biggers a écrit : > > On Mon, Aug 04, 2025 at 07:42:15PM +0200, Christophe Leroy wrote: > > > > > > > > > Le 03/08/2025 à 22:44, Eric Biggers a écr

Re: [PATCH 3/7] crypto: powerpc/md5 - Remove PowerPC optimized MD5 code

2025-08-04 Thread Eric Biggers
On Mon, Aug 04, 2025 at 07:42:15PM +0200, Christophe Leroy wrote: > > > Le 03/08/2025 à 22:44, Eric Biggers a écrit : > > MD5 is insecure, is no longer commonly used, and has never been > > optimized for the most common architectures in the kernel. Only mips, > &

Re: [PATCH 4/7] crypto: sparc/md5 - Remove SPARC64 optimized MD5 code

2025-08-03 Thread Eric Biggers
On Mon, Aug 04, 2025 at 01:44:21PM +0900, Simon Richter wrote: > Hi, > > On 8/4/25 05:44, Eric Biggers wrote: > > > Taken together, it's clear that it's time to retire these additional MD5 > > implementations, and focus maintenance on the MD5 generic C code.

Re: [PATCH 3/7] crypto: powerpc/md5 - Remove PowerPC optimized MD5 code

2025-08-03 Thread Eric Biggers
On Sun, Aug 03, 2025 at 05:27:01PM -0500, Segher Boessenkool wrote: > You are replacing a known-working target implementation by a lower > performance generic implementation. That's probably correct, though FWIW there have been quite a few cases where optimized assembly code in the kernel actually

Re: [PATCH 3/7] crypto: powerpc/md5 - Remove PowerPC optimized MD5 code

2025-08-03 Thread Eric Biggers
On Sun, Aug 03, 2025 at 05:07:10PM -0500, Segher Boessenkool wrote: > On Sun, Aug 03, 2025 at 01:44:29PM -0700, Eric Biggers wrote: > > MD5 is insecure, > > Really? Have you found an attack? Can you explain it to the rest of > the world? > > MD5 is not recommended

[PATCH 6/7] crypto: md5 - Wrap library and add HMAC support

2025-08-03 Thread Eric Biggers
Reimplement crypto/md5.c on top of the new MD5 library functions. Also add support for HMAC-MD5, again just wrapping the library functions. This closely mirrors crypto/sha1.c. Signed-off-by: Eric Biggers --- crypto/Kconfig| 2 +- crypto/md5.c | 359

[PATCH 7/7] lib/crypto: tests: Add KUnit tests for MD5 and HMAC-MD5

2025-08-03 Thread Eric Biggers
x27;t have to be run at build time. Signed-off-by: Eric Biggers --- lib/crypto/tests/Kconfig| 10 ++ lib/crypto/tests/Makefile | 1 + lib/crypto/tests/md5-testvecs.h | 186 lib/crypto/tests/md5_kunit.c| 39 +++ 4 files changed, 236 inser

[PATCH 5/7] lib/crypto: md5: Add MD5 and HMAC-MD5 library functions

2025-08-03 Thread Eric Biggers
s the flexibility to upgrade to a more modern algorithm, which I'll be proposing instead.) As usual, the "md5" and "hmac(md5)" crypto_shash algorithms will also be reimplemented on top of these library functions. For "hmac(md5)" this will provide a faster, more streamli

[PATCH 3/7] crypto: powerpc/md5 - Remove PowerPC optimized MD5 code

2025-08-03 Thread Eric Biggers
SoCs. Taken together, it's clear that it's time to retire these additional MD5 implementations, and focus maintenance on the MD5 generic C code. This commit removes the PowerPC optimized MD5 code. Signed-off-by: Eric Biggers --- arch/powerpc/configs/powernv_defconfig | 1 - ar

[PATCH 4/7] crypto: sparc/md5 - Remove SPARC64 optimized MD5 code

2025-08-03 Thread Eric Biggers
SoCs. Taken together, it's clear that it's time to retire these additional MD5 implementations, and focus maintenance on the MD5 generic C code. This commit removes the SPARC64 optimized MD5 code. Signed-off-by: Eric Biggers --- arch/sparc/crypto/Kconfig| 10 -- arch/sparc/crypt

[PATCH 1/7] mips: cavium-octeon: Remove Octeon optimized MD5 code

2025-08-03 Thread Eric Biggers
SoCs. Taken together, it's clear that it's time to retire these additional MD5 implementations, and focus maintenance on the MD5 generic C code. This commit removes the Cavium Octeon optimized MD5 code. Signed-off-by: Eric Biggers --- arch/mips/cavium-octeon/crypto/Makefile |

[PATCH 2/7] mips: cavium-octeon: Move octeon-crypto.c into parent dir

2025-08-03 Thread Eric Biggers
Since octeon-crypto.c is the only remaining source file in arch/mips/cavium-octeon/crypto/, move it into its parent directory arch/mips/cavium-octeon/. Then remove the directory arch/mips/cavium-octeon/crypto/, including its Makefile. Signed-off-by: Eric Biggers --- arch/mips/cavium-octeon

[PATCH 0/7] MD5 library functions

2025-08-03 Thread Eric Biggers
to implement legacy protocols. This should again look quite boring and familiar, as it mirrors the SHA-1 and SHA-2 changes closely. The MD5 changes are quite a bit simpler, though, since we'll only be supporting the generic C MD5 code. Of course there's also only one variant of MD5, unlik

Re: [PATCH 00/26] SHA-1 library functions

2025-07-18 Thread Eric Biggers
On Sat, Jul 12, 2025 at 04:22:51PM -0700, Eric Biggers wrote: > For 6.17, I'd like to take patches 1-15 at the most. Patches 16-26 > would be for later, and I'll probably resend them individually later for > subsystem maintainers to take. FYI, patches 1-15 have been in linux-

Re: [PATCH 03/26] lib/crypto: sha1: Add SHA-1 library functions

2025-07-13 Thread Eric Biggers
On Sun, Jul 13, 2025 at 03:05:16PM +, Elliott, Robert (Servers) wrote: > > -Original Message- > > From: Eric Biggers > > Sent: Saturday, July 12, 2025 6:23 PM > > Subject: [PATCH 03/26] lib/crypto: sha1: Add SHA-1 library functions > ... >

[PATCH 24/26] KEYS: trusted_tpm1: Use SHA-1 library instead of crypto_shash

2025-07-12 Thread Eric Biggers
Use the SHA-1 library functions instead of crypto_shash. This is simpler and faster. Signed-off-by: Eric Biggers --- security/keys/trusted-keys/Kconfig| 4 +- security/keys/trusted-keys/trusted_tpm1.c | 221 -- 2 files changed, 35 insertions(+), 190 deletions

[PATCH 25/26] ipv6: Switch to higher-level SHA-1 functions

2025-07-12 Thread Eric Biggers
level functions sha1_init() and sha1_update() to get the same result, provided that the resulting state is used directly, skipping sha1_final(). So, let's do that instead. This will allow removing the low-level API. Signed-off-by: Eric Biggers --- net/ipv6/addrconf.c | 23 +++

[PATCH 26/26] lib/crypto: sha1: Remove low-level functions from API

2025-07-12 Thread Eric Biggers
Signed-off-by: Eric Biggers --- include/crypto/sha1.h | 10 --- lib/crypto/sha1.c | 63 --- 2 files changed, 17 insertions(+), 56 deletions(-) diff --git a/include/crypto/sha1.h b/include/crypto/sha1.h index 162a529ec8413..34658f4d76e3b 100644 --- a

[PATCH 23/26] ppp: mppe: Use SHA-1 library instead of crypto_shash

2025-07-12 Thread Eric Biggers
Use the SHA-1 library instead of crypto_shash. This is simpler and faster. Signed-off-by: Eric Biggers --- drivers/net/ppp/Kconfig| 3 +- drivers/net/ppp/ppp_mppe.c | 109 +++-- 2 files changed, 20 insertions(+), 92 deletions(-) diff --git a/drivers/net

[PATCH 20/26] lib/digsig: Use SHA-1 library instead of crypto_shash

2025-07-12 Thread Eric Biggers
Use the SHA-1 library functions instead of crypto_shash. This is simpler and faster. Signed-off-by: Eric Biggers --- lib/Kconfig | 3 +-- lib/digsig.c | 46 ++ 2 files changed, 7 insertions(+), 42 deletions(-) diff --git a/lib/Kconfig b/lib

[PATCH 21/26] drm/bridge: it6505: Use SHA-1 library instead of crypto_shash

2025-07-12 Thread Eric Biggers
Use the SHA-1 library instead of crypto_shash. This is simpler and faster. Signed-off-by: Eric Biggers --- drivers/gpu/drm/bridge/Kconfig | 3 +-- drivers/gpu/drm/bridge/ite-it6505.c | 33 ++--- 2 files changed, 3 insertions(+), 33 deletions(-) diff --git a

[PATCH 19/26] tee: Use SHA-1 library instead of crypto_shash

2025-07-12 Thread Eric Biggers
Use the SHA-1 library functions instead of crypto_shash. This is simpler and faster. Signed-off-by: Eric Biggers --- drivers/tee/Kconfig| 3 +-- drivers/tee/tee_core.c | 55 +++--- 2 files changed, 10 insertions(+), 48 deletions(-) diff --git a/drivers

[PATCH 17/26] sctp: Use HMAC-SHA1 and HMAC-SHA256 library functions

2025-07-12 Thread Eric Biggers
For SCTP authenticated chunks, use the HMAC-SHA1 and HMAC-SHA256 library functions instead of crypto_shash. This is simpler and faster. Signed-off-by: Eric Biggers --- include/net/sctp/auth.h | 12 +-- include/net/sctp/constants.h | 2 - include/net/sctp/structs.h | 5 -- net/sctp

[PATCH 18/26] ipv6: sr: Use HMAC-SHA1 and HMAC-SHA256 library functions

2025-07-12 Thread Eric Biggers
Use the HMAC-SHA1 and HMAC-SHA256 library functions instead of crypto_shash. This is simpler and faster. Signed-off-by: Eric Biggers --- include/net/seg6_hmac.h | 12 --- net/ipv6/Kconfig| 6 +- net/ipv6/seg6.c | 7 -- net/ipv6/seg6_hmac.c| 199

[PATCH 22/26] nfc: s3fwrn5: Use SHA-1 library instead of crypto_shash

2025-07-12 Thread Eric Biggers
Use the SHA-1 library instead of crypto_shash. This is simpler and faster. Signed-off-by: Eric Biggers --- drivers/nfc/s3fwrn5/Kconfig| 3 +-- drivers/nfc/s3fwrn5/firmware.c | 17 + 2 files changed, 2 insertions(+), 18 deletions(-) diff --git a/drivers/nfc/s3fwrn5/Kconfig

[PATCH 13/26] lib/crypto: x86/sha1: Migrate optimized code into library

2025-07-12 Thread Eric Biggers
was disabled by default. SHA-1 still remains available through crypto_shash, but individual architectures no longer need to handle it. Signed-off-by: Eric Biggers --- arch/x86/crypto/Kconfig | 14 - arch/x86/crypto/Makefile | 3 - arch/x86/crypto

[PATCH 15/26] lib/crypto: tests: Add KUnit tests for SHA-1 and HMAC-SHA1

2025-07-12 Thread Eric Biggers
won't have to be run at build time. Signed-off-by: Eric Biggers --- lib/crypto/tests/Kconfig | 10 ++ lib/crypto/tests/Makefile| 1 + lib/crypto/tests/sha1-testvecs.h | 212 +++ lib/crypto/tests/sha1_kunit.c| 39 ++ 4 files changed

[PATCH 14/26] crypto: sha1 - Remove sha1_base.h

2025-07-12 Thread Eric Biggers
sha1_base.h is no longer used, so remove it. Signed-off-by: Eric Biggers --- include/crypto/sha1_base.h | 82 -- 1 file changed, 82 deletions(-) delete mode 100644 include/crypto/sha1_base.h diff --git a/include/crypto/sha1_base.h b/include/crypto

[PATCH 16/26] bpf: Use sha1() instead of sha1_transform() in bpf_prog_calc_tag()

2025-07-12 Thread Eric Biggers
Now that there's a proper SHA-1 library API, just use that instead of the low-level SHA-1 compression function. This eliminates the need for bpf_prog_calc_tag() to implement the SHA-1 padding itself. No functional change. Signed-off-by: Eric Biggers --- include/linux/filter.h

[PATCH 12/26] lib/crypto: sparc/sha1: Migrate optimized code into library

2025-07-12 Thread Eric Biggers
SHA-1 code was disabled by default. SHA-1 still remains available through crypto_shash, but individual architectures no longer need to handle it. Note: to see the diff from arch/sparc/crypto/sha1_glue.c to lib/crypto/sparc/sha1.h, view this commit with 'git show -M10'. Signed-off-by: Er

[PATCH 10/26] lib/crypto: powerpc/sha1: Migrate optimized code into library

2025-07-12 Thread Eric Biggers
ned-off-by: Eric Biggers --- arch/powerpc/configs/44x/akebono_defconfig| 1 - arch/powerpc/configs/powernv_defconfig| 1 - arch/powerpc/configs/ppc64_defconfig | 1 - arch/powerpc/crypto/Kconfig | 16 --- arch/powerpc/crypto/Makefile

[PATCH 09/26] lib/crypto: mips/sha1: Migrate optimized code into library

2025-07-12 Thread Eric Biggers
code was disabled by default. SHA-1 still remains available through crypto_shash, but individual architectures no longer need to handle it. Note: to see the diff from arch/mips/cavium-octeon/crypto/octeon-sha1.c to lib/crypto/mips/sha1.h, view this commit with 'git show -M10'. Signed-of

[PATCH 08/26] lib/crypto: arm64/sha1: Migrate optimized code into library

2025-07-12 Thread Eric Biggers
. (Support for that has been omitted for now, for simplicity and because usually it isn't performance-critical.) To match sha1_blocks(), change the type of the nblocks parameter and the return value of __sha1_ce_transform() from int to size_t. Update the assembly code accordingly. Signed-off-by:

[PATCH 11/26] lib/crypto: s390/sha1: Migrate optimized code into library

2025-07-12 Thread Eric Biggers
code was disabled by default. SHA-1 still remains available through crypto_shash, but individual architectures no longer need to handle it. Signed-off-by: Eric Biggers --- arch/s390/configs/debug_defconfig | 1 - arch/s390/configs/defconfig | 1 - arch/s390/crypto/Kconfig

[PATCH 07/26] lib/crypto: arm/sha1: Migrate optimized code into library

2025-07-12 Thread Eric Biggers
as size_t. Signed-off-by: Eric Biggers --- arch/arm/configs/exynos_defconfig | 1 - arch/arm/configs/milbeaut_m10v_defconfig | 2 - arch/arm/configs/multi_v7_defconfig | 2 - arch/arm/configs/omap2plus_defconfig | 1 - arch/arm/configs/pxa_defconfig

[PATCH 04/26] lib/crypto: sha1: Add HMAC support

2025-07-12 Thread Eric Biggers
ted_tpm1.c. Those are currently using crypto_shash, but using the library functions would be much simpler. Signed-off-by: Eric Biggers --- include/crypto/sha1.h | 118 ++ lib/crypto/sha1.c | 106 - 2 files ch

[PATCH 05/26] crypto: sha1 - Wrap library and add HMAC support

2025-07-12 Thread Eric Biggers
rypto/sha1_generic.c to crypto/sha1.c, view this commit with 'git show -M10'. Signed-off-by: Eric Biggers --- crypto/Makefile | 2 +- crypto/sha1.c | 135 ++ crypto/sha1_generic.c | 87 crypto/testmg

[PATCH 06/26] crypto: sha1 - Use same state format as legacy drivers

2025-07-12 Thread Eric Biggers
Same as sha256 and sha512: Use the state format that the generic partial block handling code produces, as requested by Herbert, even though this is applicable only to legacy drivers. Signed-off-by: Eric Biggers --- crypto/sha1.c | 66 +++ 1 file

[PATCH 03/26] lib/crypto: sha1: Add SHA-1 library functions

2025-07-12 Thread Eric Biggers
Add a library interface for SHA-1, following the SHA-2 one. As was the case with SHA-2, this will be useful for various in-kernel users. The crypto_shash interface will be reimplemented on top of it as well. Signed-off-by: Eric Biggers --- include/crypto/sha1.h | 60

[PATCH 01/26] crypto: x86/sha1 - Rename conflicting symbol

2025-07-12 Thread Eric Biggers
r the initial introduction of the library. Signed-off-by: Eric Biggers --- arch/x86/crypto/sha1_ssse3_glue.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/arch/x86/crypto/sha1_ssse3_glue.c b/arch/x86/crypto/sha1_ssse3_glue.c index 0a912bfc86c51..826579a7473c4 100644

[PATCH 02/26] lib/crypto: sha1: Rename sha1_init() to sha1_init_raw()

2025-07-12 Thread Eric Biggers
Rename the existing sha1_init() to sha1_init_raw(), since it conflicts with the upcoming library function. This will later be removed, but this keeps the kernel building for the introduction of the library. Signed-off-by: Eric Biggers --- include/crypto/sha1.h | 2 +- kernel/bpf/core.c | 2

[PATCH 00/26] SHA-1 library functions

2025-07-12 Thread Eric Biggers
th SHA-1 and SHA-2, in the case of some users that use both algorithms). The diffstat for that part is: 27 files changed, 169 insertions(+), 903 deletions(-) For 6.17, I'd like to take patches 1-15 at the most. Patches 16-26 would be for later, and I'll probably resend them indi

Re: [PATCH v2 00/14] SHA-256 library improvements

2025-07-03 Thread Eric Biggers
On Mon, Jun 30, 2025 at 09:06:31AM -0700, Eric Biggers wrote: > This series is also available at: > > git fetch > https://git.kernel.org/pub/scm/linux/kernel/git/ebiggers/linux.git > sha256-lib-cleanup-v2 > > This series improves the SHA-224 and SHA-256 library code to

[PATCH v2 10/14] crypto: sha256 - Use same state format as legacy drivers

2025-06-30 Thread Eric Biggers
Make the export and import functions for the sha224, sha256, hmac(sha224), and hmac(sha256) shash algorithms use the same format as the padlock-sha and nx-sha256 drivers, as required by Herbert. Signed-off-by: Eric Biggers --- crypto/sha256.c | 95

[PATCH v2 14/14] lib/crypto: sha256: Document the SHA-224 and SHA-256 API

2025-06-30 Thread Eric Biggers
Add kerneldoc comments, consistent with the kerneldoc comments of the SHA-384 and SHA-512 API. Signed-off-by: Eric Biggers --- include/crypto/sha2.h | 76 +++ 1 file changed, 76 insertions(+) diff --git a/include/crypto/sha2.h b/include/crypto/sha2.h

[PATCH v2 11/14] lib/crypto: sha256: Remove sha256_is_arch_optimized()

2025-06-30 Thread Eric Biggers
Remove sha256_is_arch_optimized(), since it is no longer used. Signed-off-by: Eric Biggers --- arch/mips/cavium-octeon/crypto/octeon-sha256.c | 6 -- include/crypto/internal/sha2.h | 8 lib/crypto/arm/sha256.c| 7 --- lib/crypto/arm64

[PATCH v2 07/14] lib/crypto: sha256: Propagate sha256_block_state type to implementations

2025-06-30 Thread Eric Biggers
The previous commit made the SHA-256 compression function state be strongly typed, but it wasn't propagated all the way down to the implementations of it. Do that now. Signed-off-by: Eric Biggers --- .../mips/cavium-octeon/crypto/octeon-sha256.c | 2 +- include/crypto/internal/s

[PATCH v2 13/14] lib/crypto: sha256: Sync sha256_update() with sha512_update()

2025-06-30 Thread Eric Biggers
t more readable. Signed-off-by: Eric Biggers --- lib/crypto/sha256.c | 28 +--- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/lib/crypto/sha256.c b/lib/crypto/sha256.c index 68936d5cd7745..808438d4f4278 100644 --- a/lib/crypto/sha256.c +++ b/lib/crypto/sha256.c

[PATCH v2 06/14] lib/crypto: sha256: Make library API use strongly-typed contexts

2025-06-30 Thread Eric Biggers
e variable 'sctx' anyway, which suggests that *_ctx would be the more natural name for the actual struct. Therefore: update the SHA-224 and SHA-256 APIs, implementation, and calling code accordingly. In the new structs, also strongly-type the compression function state. Signed-off-by: Eri

[PATCH v2 04/14] lib/crypto: sha256: Remove sha256_blocks_simd()

2025-06-30 Thread Eric Biggers
function. This renaming also required an update to lib/crypto/arm64/sha512.h, since sha2-armv8.pl is shared by both SHA-256 and SHA-512. Signed-off-by: Eric Biggers --- include/crypto/internal/sha2.h | 6 -- lib/crypto/Kconfig | 8 lib/crypto/arm/Kconfig |

[PATCH v2 05/14] lib/crypto: sha256: Add sha224() and sha224_update()

2025-06-30 Thread Eric Biggers
which functions are the same between SHA-224 and SHA-256. Also, this is a prerequisite for using different context types for each. Signed-off-by: Eric Biggers --- include/crypto/sha2.h | 10 -- lib/crypto/sha256.c | 10 ++ 2 files changed, 18 insertions(+), 2 deletions(-) diff

[PATCH v2 00/14] SHA-256 library improvements

2025-06-30 Thread Eric Biggers
code from purgatory, where it isn't needed Eric Biggers (14): libceph: Rename hmac_sha256() to ceph_hmac_sha256() cxl/test: Simplify fw_buf_checksum_show() lib/crypto: sha256: Reorder some code lib/crypto: sha256: Remove sha256_blocks_simd() lib/crypto: sha256: Add sha224() an

[PATCH v2 03/14] lib/crypto: sha256: Reorder some code

2025-06-30 Thread Eric Biggers
that. No code changes other than reordering. Signed-off-by: Eric Biggers --- include/crypto/sha2.h | 60 +-- lib/crypto/sha256.c | 12 - 2 files changed, 36 insertions(+), 36 deletions(-) diff --git a/include/crypto/sha2.h b/include/crypto/sha2.h

[PATCH v2 02/14] cxl/test: Simplify fw_buf_checksum_show()

2025-06-30 Thread Eric Biggers
First, just use sha256() instead of a sequence of sha256_init(), sha256_update(), and sha256_final(). The result is the same. Second, use *phN instead of open-coding the conversion of bytes to hex. Signed-off-by: Eric Biggers --- tools/testing/cxl/test/mem.c | 21 ++--- 1 file

[PATCH v2 01/14] libceph: Rename hmac_sha256() to ceph_hmac_sha256()

2025-06-30 Thread Eric Biggers
Rename hmac_sha256() to ceph_hmac_sha256(), to avoid a naming conflict with the upcoming hmac_sha256() library function. This code will be able to use the HMAC-SHA256 library, but that's left for a later commit. Signed-off-by: Eric Biggers --- net/ceph/messenger_v2.c | 12 ++-- 1

[PATCH 04/18] lib/crypto: sha512: Reorder some code in sha512.c

2025-06-25 Thread Eric Biggers
Put the IVs before the round constants, since the IVs are used first. Put __sha512_final() just above sha384_final() and sha512_final(), which are the functions that call it. No code changes other than reordering. Signed-off-by: Eric Biggers --- lib/crypto/sha512.c | 72

[PATCH 01/18] libceph: Rename hmac_sha256() to ceph_hmac_sha256()

2025-06-25 Thread Eric Biggers
Rename hmac_sha256() to ceph_hmac_sha256(), to avoid a naming conflict with the upcoming hmac_sha256() library function. This code will be able to use the HMAC-SHA256 library, but that's left for a later commit. Signed-off-by: Eric Biggers --- net/ceph/messenger_v2.c | 12 ++-- 1

[PATCH 02/18] cxl/test: Simplify fw_buf_checksum_show()

2025-06-25 Thread Eric Biggers
First, just use sha256() instead of a sequence of sha256_init(), sha256_update(), and sha256_final(). The result is the same. Second, use *phN instead of open-coding the conversion of bytes to hex. Signed-off-by: Eric Biggers --- tools/testing/cxl/test/mem.c | 21 ++--- 1 file

[PATCH 14/18] crypto: sha256 - Use same state format as legacy drivers

2025-06-25 Thread Eric Biggers
Make the export and import functions for the sha224, sha256, hmac(sha224), and hmac(sha256) shash algorithms use the same format as the padlock-sha and nx-sha256 drivers, as required by Herbert. Signed-off-by: Eric Biggers --- crypto/sha256.c | 95

[PATCH 15/18] lib/crypto: sha512: Remove sha256_is_arch_optimized()

2025-06-25 Thread Eric Biggers
Remove sha256_is_arch_optimized(), since it is no longer used. Signed-off-by: Eric Biggers --- arch/mips/cavium-octeon/crypto/octeon-sha256.c | 6 -- include/crypto/internal/sha2.h | 8 lib/crypto/arm/sha256.c| 7 --- lib/crypto/arm64

[PATCH 08/18] lib/crypto: sha256: Remove sha256_blocks_simd()

2025-06-25 Thread Eric Biggers
his footgun and simplifying the code is well worth the very small performance cost of doing the check. Signed-off-by: Eric Biggers --- include/crypto/internal/sha2.h | 6 -- lib/crypto/Kconfig | 8 lib/crypto/arm/Kconfig | 1 - lib/crypto/arm/sha25

[PATCH 03/18] crypto: sha512 - Use the correct legacy export format

2025-06-25 Thread Eric Biggers
It appears the legacy export format is intended to have the value of the bytecount field be block-aligned, so update __crypto_sha512_export() and __crypto_sha512_import() to match. Fixes: e62c2fe56418 ("crypto: sha512 - Use same state format as legacy drivers") Signed-off-by: Er

  1   2   3   4   5   >