aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2025-07-28 17:58:52 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2025-07-28 17:58:52 -0700
commit13150742b09e720fdf021de14cd2b98b37415a89 (patch)
treeb748355558f8077a2ce8cbc57712198aec45c715
parenta578dd095dfe8b56c167201d9aea43e47d27f807 (diff)
parentdebc1e5a431779c027a5752f247a4de2e4f702b2 (diff)
Merge tag 'libcrypto-updates-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiggers/linux
Pull crypto library updates from Eric Biggers: "This is the main crypto library pull request for 6.17. The main focus this cycle is on reorganizing the SHA-1 and SHA-2 code, providing high-quality library APIs for SHA-1 and SHA-2 including HMAC support, and establishing conventions for lib/crypto/ going forward: - Migrate the SHA-1 and SHA-512 code (and also SHA-384 which shares most of the SHA-512 code) into lib/crypto/. This includes both the generic and architecture-optimized code. Greatly simplify how the architecture-optimized code is integrated. Add an easy-to-use library API for each SHA variant, including HMAC support. Finally, reimplement the crypto_shash support on top of the library API. - Apply the same reorganization to the SHA-256 code (and also SHA-224 which shares most of the SHA-256 code). This is a somewhat smaller change, due to my earlier work on SHA-256. But this brings in all the same additional improvements that I made for SHA-1 and SHA-512. There are also some smaller changes: - Move the architecture-optimized ChaCha, Poly1305, and BLAKE2s code from arch/$(SRCARCH)/lib/crypto/ to lib/crypto/$(SRCARCH)/. For these algorithms it's just a move, not a full reorganization yet. - Fix the MIPS chacha-core.S to build with the clang assembler. - Fix the Poly1305 functions to work in all contexts. - Fix a performance regression in the x86_64 Poly1305 code. - Clean up the x86_64 SHA-NI optimized SHA-1 assembly code. Note that since the new organization of the SHA code is much simpler, the diffstat of this pull request is negative, despite the addition of new fully-documented library APIs for multiple SHA and HMAC-SHA variants. These APIs will allow further simplifications across the kernel as users start using them instead of the old-school crypto API. (I've already written a lot of such conversion patches, removing over 1000 more lines of code. But most of those will target 6.18 or later)" * tag 'libcrypto-updates-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiggers/linux: (67 commits) lib/crypto: arm64/sha512-ce: Drop compatibility macros for older binutils lib/crypto: x86/sha1-ni: Convert to use rounds macros lib/crypto: x86/sha1-ni: Minor optimizations and cleanup crypto: sha1 - Remove sha1_base.h lib/crypto: x86/sha1: Migrate optimized code into library lib/crypto: sparc/sha1: Migrate optimized code into library lib/crypto: s390/sha1: Migrate optimized code into library lib/crypto: powerpc/sha1: Migrate optimized code into library lib/crypto: mips/sha1: Migrate optimized code into library lib/crypto: arm64/sha1: Migrate optimized code into library lib/crypto: arm/sha1: Migrate optimized code into library crypto: sha1 - Use same state format as legacy drivers crypto: sha1 - Wrap library and add HMAC support lib/crypto: sha1: Add HMAC support lib/crypto: sha1: Add SHA-1 library functions lib/crypto: sha1: Rename sha1_init() to sha1_init_raw() crypto: x86/sha1 - Rename conflicting symbol lib/crypto: sha2: Add hmac_sha*_init_usingrawkey() lib/crypto: arm/poly1305: Remove unneeded empty weak function lib/crypto: x86/poly1305: Fix performance regression on short messages ...
-rw-r--r--MAINTAINERS1
-rw-r--r--arch/arm/configs/exynos_defconfig2
-rw-r--r--arch/arm/configs/milbeaut_m10v_defconfig3
-rw-r--r--arch/arm/configs/multi_v7_defconfig3
-rw-r--r--arch/arm/configs/omap2plus_defconfig2
-rw-r--r--arch/arm/configs/pxa_defconfig2
-rw-r--r--arch/arm/crypto/Kconfig41
-rw-r--r--arch/arm/crypto/Makefile21
-rw-r--r--arch/arm/crypto/sha1-ce-glue.c72
-rw-r--r--arch/arm/crypto/sha1_glue.c75
-rw-r--r--arch/arm/crypto/sha1_neon_glue.c83
-rw-r--r--arch/arm/crypto/sha512-glue.c110
-rw-r--r--arch/arm/crypto/sha512-neon-glue.c75
-rw-r--r--arch/arm/crypto/sha512.h3
-rw-r--r--arch/arm/lib/.gitignore4
-rw-r--r--arch/arm/lib/Makefile2
-rw-r--r--arch/arm/lib/crypto/sha256.c64
-rw-r--r--arch/arm64/configs/defconfig2
-rw-r--r--arch/arm64/crypto/Kconfig30
-rw-r--r--arch/arm64/crypto/Makefile17
-rw-r--r--arch/arm64/crypto/sha1-ce-glue.c118
-rw-r--r--arch/arm64/crypto/sha512-ce-glue.c96
-rw-r--r--arch/arm64/crypto/sha512-glue.c83
-rw-r--r--arch/arm64/lib/.gitignore4
-rw-r--r--arch/arm64/lib/Makefile3
-rw-r--r--arch/arm64/lib/crypto/sha256.c75
-rw-r--r--arch/mips/cavium-octeon/Kconfig6
-rw-r--r--arch/mips/cavium-octeon/crypto/Makefile3
-rw-r--r--arch/mips/cavium-octeon/crypto/octeon-crypto.c3
-rw-r--r--arch/mips/cavium-octeon/crypto/octeon-md5.c3
-rw-r--r--arch/mips/cavium-octeon/crypto/octeon-sha1.c147
-rw-r--r--arch/mips/cavium-octeon/crypto/octeon-sha512.c167
-rw-r--r--arch/mips/configs/cavium_octeon_defconfig2
-rw-r--r--arch/mips/crypto/Kconfig20
-rw-r--r--arch/mips/include/asm/octeon/crypto.h (renamed from arch/mips/cavium-octeon/crypto/octeon-crypto.h)0
-rw-r--r--arch/mips/lib/.gitignore4
-rw-r--r--arch/mips/lib/Makefile2
-rw-r--r--arch/powerpc/configs/44x/akebono_defconfig1
-rw-r--r--arch/powerpc/configs/powernv_defconfig1
-rw-r--r--arch/powerpc/configs/ppc64_defconfig1
-rw-r--r--arch/powerpc/crypto/Kconfig16
-rw-r--r--arch/powerpc/crypto/Makefile4
-rw-r--r--arch/powerpc/crypto/sha1-spe-glue.c107
-rw-r--r--arch/powerpc/crypto/sha1.c78
-rw-r--r--arch/powerpc/lib/Makefile2
-rw-r--r--arch/riscv/crypto/Kconfig11
-rw-r--r--arch/riscv/crypto/Makefile3
-rw-r--r--arch/riscv/crypto/sha512-riscv64-glue.c124
-rw-r--r--arch/riscv/lib/Makefile1
-rw-r--r--arch/riscv/lib/crypto/Kconfig16
-rw-r--r--arch/riscv/lib/crypto/sha256.c67
-rw-r--r--arch/riscv/purgatory/purgatory.c8
-rw-r--r--arch/s390/configs/debug_defconfig2
-rw-r--r--arch/s390/configs/defconfig2
-rw-r--r--arch/s390/crypto/Kconfig20
-rw-r--r--arch/s390/crypto/Makefile2
-rw-r--r--arch/s390/crypto/sha1_s390.c105
-rw-r--r--arch/s390/crypto/sha512_s390.c154
-rw-r--r--arch/s390/lib/Makefile1
-rw-r--r--arch/s390/lib/crypto/sha256.c47
-rw-r--r--arch/s390/purgatory/purgatory.c2
-rw-r--r--arch/sparc/crypto/Kconfig20
-rw-r--r--arch/sparc/crypto/Makefile4
-rw-r--r--arch/sparc/crypto/sha1_glue.c94
-rw-r--r--arch/sparc/crypto/sha512_glue.c122
-rw-r--r--arch/sparc/lib/Makefile1
-rw-r--r--arch/sparc/lib/crypto/Kconfig8
-rw-r--r--arch/sparc/lib/crypto/Makefile4
-rw-r--r--arch/x86/crypto/Kconfig27
-rw-r--r--arch/x86/crypto/Makefile6
-rw-r--r--arch/x86/crypto/sha1_ni_asm.S304
-rw-r--r--arch/x86/crypto/sha1_ssse3_glue.c324
-rw-r--r--arch/x86/crypto/sha512_ssse3_glue.c322
-rw-r--r--arch/x86/lib/.gitignore4
-rw-r--r--arch/x86/lib/Makefile2
-rw-r--r--arch/x86/lib/crypto/sha256.c80
-rw-r--r--arch/x86/purgatory/purgatory.c2
-rw-r--r--crypto/Kconfig14
-rw-r--r--crypto/Makefile6
-rw-r--r--crypto/sha1.c201
-rw-r--r--crypto/sha1_generic.c87
-rw-r--r--crypto/sha256.c371
-rw-r--r--crypto/sha512.c354
-rw-r--r--crypto/sha512_generic.c217
-rw-r--r--crypto/testmgr.c28
-rw-r--r--drivers/char/tpm/tpm2-sessions.c12
-rw-r--r--drivers/crypto/img-hash.c6
-rw-r--r--drivers/crypto/starfive/jh7110-hash.c16
-rw-r--r--include/crypto/internal/sha2.h66
-rw-r--r--include/crypto/sha1.h180
-rw-r--r--include/crypto/sha1_base.h82
-rw-r--r--include/crypto/sha2.h800
-rw-r--r--include/crypto/sha512_base.h120
-rw-r--r--kernel/bpf/core.c2
-rw-r--r--kernel/kexec_file.c10
-rw-r--r--lib/crypto/Kconfig77
-rw-r--r--lib/crypto/Makefile107
-rw-r--r--lib/crypto/aes.c1
-rw-r--r--lib/crypto/aescfb.c7
-rw-r--r--lib/crypto/aesgcm.c5
-rw-r--r--lib/crypto/arc4.c1
-rw-r--r--lib/crypto/arm/.gitignore (renamed from arch/arm/lib/crypto/.gitignore)1
-rw-r--r--lib/crypto/arm/Kconfig (renamed from arch/arm/lib/crypto/Kconfig)7
-rw-r--r--lib/crypto/arm/Makefile (renamed from arch/arm/lib/crypto/Makefile)8
-rw-r--r--lib/crypto/arm/blake2s-core.S (renamed from arch/arm/lib/crypto/blake2s-core.S)0
-rw-r--r--lib/crypto/arm/blake2s-glue.c (renamed from arch/arm/lib/crypto/blake2s-glue.c)0
-rw-r--r--lib/crypto/arm/chacha-glue.c (renamed from arch/arm/lib/crypto/chacha-glue.c)0
-rw-r--r--lib/crypto/arm/chacha-neon-core.S (renamed from arch/arm/lib/crypto/chacha-neon-core.S)0
-rw-r--r--lib/crypto/arm/chacha-scalar-core.S (renamed from arch/arm/lib/crypto/chacha-scalar-core.S)0
-rw-r--r--lib/crypto/arm/poly1305-armv4.pl (renamed from arch/arm/lib/crypto/poly1305-armv4.pl)2
-rw-r--r--lib/crypto/arm/poly1305-glue.c (renamed from arch/arm/lib/crypto/poly1305-glue.c)8
-rw-r--r--lib/crypto/arm/sha1-armv4-large.S (renamed from arch/arm/crypto/sha1-armv4-large.S)0
-rw-r--r--lib/crypto/arm/sha1-armv7-neon.S (renamed from arch/arm/crypto/sha1-armv7-neon.S)13
-rw-r--r--lib/crypto/arm/sha1-ce-core.S (renamed from arch/arm/crypto/sha1-ce-core.S)4
-rw-r--r--lib/crypto/arm/sha1.h46
-rw-r--r--lib/crypto/arm/sha256-armv4.pl (renamed from arch/arm/lib/crypto/sha256-armv4.pl)20
-rw-r--r--lib/crypto/arm/sha256-ce.S (renamed from arch/arm/lib/crypto/sha256-ce.S)2
-rw-r--r--lib/crypto/arm/sha256.h46
-rw-r--r--lib/crypto/arm/sha512-armv4.pl (renamed from arch/arm/crypto/sha512-armv4.pl)0
-rw-r--r--lib/crypto/arm/sha512.h38
-rw-r--r--lib/crypto/arm64/.gitignore (renamed from arch/arm64/lib/crypto/.gitignore)1
-rw-r--r--lib/crypto/arm64/Kconfig (renamed from arch/arm64/lib/crypto/Kconfig)6
-rw-r--r--lib/crypto/arm64/Makefile (renamed from arch/arm64/lib/crypto/Makefile)9
-rw-r--r--lib/crypto/arm64/chacha-neon-core.S (renamed from arch/arm64/lib/crypto/chacha-neon-core.S)0
-rw-r--r--lib/crypto/arm64/chacha-neon-glue.c (renamed from arch/arm64/lib/crypto/chacha-neon-glue.c)0
-rw-r--r--lib/crypto/arm64/poly1305-armv8.pl (renamed from arch/arm64/lib/crypto/poly1305-armv8.pl)0
-rw-r--r--lib/crypto/arm64/poly1305-glue.c (renamed from arch/arm64/lib/crypto/poly1305-glue.c)3
-rw-r--r--lib/crypto/arm64/sha1-ce-core.S (renamed from arch/arm64/crypto/sha1-ce-core.S)40
-rw-r--r--lib/crypto/arm64/sha1.h39
-rw-r--r--lib/crypto/arm64/sha2