linux/arch/x86/lib
Linus Torvalds 13150742b0 Crypto library updates for 6.17
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.)
 -----BEGIN PGP SIGNATURE-----
 
 iIoEABYIADIWIQSacvsUNc7UX4ntmEPzXCl4vpKOKwUCaIZ93BQcZWJpZ2dlcnNA
 a2VybmVsLm9yZwAKCRDzXCl4vpKOK8HCAQD3O9P0qd6wscne5XuRwaybzKHQ2AqU
 OlhlDZWQQEvYAgD/aa6KP/DS+8RKGj0TBn6bACAJyXyDygFXq5a5s9pGzAs=
 =UmMM
 -----END PGP SIGNATURE-----

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
  ...
2025-07-28 17:58:52 -07:00
..
.gitignore lib/crypto: x86: Move arch/x86/lib/crypto/ into lib/crypto/ 2025-06-30 09:26:20 -07:00
atomic64_32.c
atomic64_386_32.S
atomic64_cx8_32.S locking/atomic/x86: Introduce the read64_nonatomic macro to x86_32 with cx8 2024-07-17 16:28:11 +02:00
bhi.S x86/bhi: Add BHI stubs 2025-02-26 13:48:52 +01:00
cache-smp.c x86: fix missing includes/forward declarations 2023-12-20 16:40:30 -05:00
checksum_32.S x86/headers: Replace #include <asm/export.h> with #include <linux/export.h> 2023-10-03 10:38:07 +02:00
clear_page_64.S x86/cfi: Clean up linkage 2025-02-14 10:32:05 +01:00
cmdline.c x86/setup: Parse the builtin command line before merging 2024-07-31 21:46:35 +02:00
cmpxchg8b_emu.S x86/cpufeatures: Rename X86_CMPXCHG64 to X86_CX8 2025-02-28 11:42:34 +01:00
cmpxchg16b_emu.S x86/percpu: Introduce %rip-relative addressing to PER_CPU_VAR() 2023-10-20 12:19:51 +02:00
copy_mc_64.S
copy_mc.c x86: call instrumentation hooks from copy_mc.c 2024-04-25 21:07:02 -07:00
copy_page_64.S x86,kcfi: Fix EXPORT_SYMBOL vs kCFI 2025-02-14 10:32:05 +01:00
copy_user_64.S x86/uaccess: Improve performance by aligning writes to 8 bytes in copy_user_generic(), on non-FSRM/ERMS CPUs 2025-03-28 22:57:44 +01:00
copy_user_uncached_64.S x86/cfi: Clean up linkage 2025-02-14 10:32:05 +01:00
cpu.c
csum-copy_64.S
csum-partial_64.c x86/csum: clean up `csum_partial' further 2024-01-04 15:42:30 -08:00
csum-wrappers_64.c x86/lib: Address kernel-doc warnings 2023-10-03 22:46:47 +02:00
delay.c x86/asm: Rename rep_nop() to native_pause() 2025-04-18 10:19:26 +02:00
error-inject.c
getuser.S x86/runtime-const: Add the RUNTIME_CONST_PTR assembly macro 2025-03-19 11:26:24 +01:00
hweight.S x86/cfi: Clean up linkage 2025-02-14 10:32:05 +01:00
inat.c
insn-eval.c Merge branch 'x86/msr' into x86/core, to resolve conflicts 2025-05-13 10:42:06 +02:00
insn.c x86/insn: Stop decoding i64 instructions in x86-64 mode at opcode 2025-05-06 12:03:16 +02:00
iomem.c x86/asm: Remove semicolon from "rep" prefixes 2025-04-18 09:33:33 +02:00
kaslr.c x86/msr: Add explicit includes of <asm/msr.h> 2025-05-02 10:23:47 +02:00
Makefile Crypto library updates for 6.17 2025-07-28 17:58:52 -07:00
memcpy_32.c
memcpy_64.S x86/boot: Add a bunch of PIC aliases 2025-05-04 15:59:43 +02:00
memmove_32.S x86/headers: Replace #include <asm/export.h> with #include <linux/export.h> 2023-10-03 10:38:07 +02:00
memmove_64.S x86,kcfi: Fix EXPORT_SYMBOL vs kCFI 2025-02-14 10:32:05 +01:00
memset_64.S x86/boot: Add a bunch of PIC aliases 2025-05-04 15:59:43 +02:00
misc.c x86/lib: Fix overflow when counting digits 2023-11-17 06:26:14 -08:00
msr-reg-export.c
msr-reg.S x86,kcfi: Fix EXPORT_SYMBOL vs kCFI 2025-02-14 10:32:05 +01:00
msr-smp.c x86/msr: Rename 'wrmsrl_on_cpu()' to 'wrmsrq_on_cpu()' 2025-04-10 11:59:05 +02:00
msr.c x86/msr: Rename 'wrmsrl_safe()' to 'wrmsrq_safe()' 2025-04-10 11:58:44 +02:00
pc-conf-reg.c
putuser.S x86/cfi: Clean up linkage 2025-02-14 10:32:05 +01:00
retpoline.S Merge commit 'its-for-linus-20250509-merge' into x86/core, to resolve conflicts 2025-05-13 10:47:10 +02:00
string_32.c x86/asm: Remove semicolon from "rep" prefixes 2025-04-18 09:33:33 +02:00
strstr_32.c x86/asm: Remove semicolon from "rep" prefixes 2025-04-18 09:33:33 +02:00
usercopy_32.c x86/asm: Remove semicolon from "rep" prefixes 2025-04-18 09:33:33 +02:00
usercopy_64.c x86/usercopy: Fix kernel-doc func param name in clean_cache_range()'s description 2025-02-23 11:52:48 +01:00
usercopy.c
x86-opcode-map.txt x86/insn: Stop decoding i64 instructions in x86-64 mode at opcode 2025-05-06 12:03:16 +02:00