linux/lib/crypto
Linus Torvalds 95615dd9ff Crypto library updates for 7.4
- Migrate the x86 and riscv optimized implementations of various AES
   modes (ECB, CBC, CBC-CTS, CTR, XCTR, XTS) into lib/crypto/.
 
   This makes the library APIs be properly accelerated on these
   architectures, while still accelerating crypto_skcipher as well.
 
   It removes a lot of redundant glue code, since the crypto API
   boilerplate no longer needs to be duplicated for these architectures.
 
   It also fixes the longstanding issue where optimizations for these
   AES modes were disabled by default on these architectures.
 
 - Optimize AES-XTS on SPARC64 using the SPARC crypto opcodes
 
 - Move the SipHash code into lib/crypto/
 
 - Update the ChaCha and Poly1305 functions to take size_t lengths,
   resolving issues where lengths over INT_MAX were mishandled
 
 - Make frame pointer unwinding work properly in some of the x86
   assembly functions, by following the standard %rbp convention
 
 - Add helper functions for zeroizing structs
 
 - Make a few documentation improvements
 -----BEGIN PGP SIGNATURE-----
 
 iIoEABYIADIWIQSacvsUNc7UX4ntmEPzXCl4vpKOKwUCatTfbBQcZWJpZ2dlcnNA
 a2VybmVsLm9yZwAKCRDzXCl4vpKOK9yhAP0RU5ofTuvc8jj2o02JlXnnxwzda+zh
 tpJYOIHfW6+2UwD/XjbNgngca3ByRL2f3rt2xdSaqSIjmRMP4Blkgeazsw4=
 =zs1E
 -----END PGP SIGNATURE-----

Merge tag 'libcrypto-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiggers/linux

Pull crypto library updates from Eric Biggers:

 - Migrate the x86 and riscv optimized implementations of various AES
   modes (ECB, CBC, CBC-CTS, CTR, XCTR, XTS) into lib/crypto/.

   This makes the library APIs be properly accelerated on these
   architectures, while still accelerating crypto_skcipher as well.

   It removes a lot of redundant glue code, since the crypto API
   boilerplate no longer needs to be duplicated for these architectures.

   It also fixes the longstanding issue where optimizations for these
   AES modes were disabled by default on these architectures.

 - Optimize AES-XTS on SPARC64 using the SPARC crypto opcodes

 - Move the SipHash code into lib/crypto/

 - Update the ChaCha and Poly1305 functions to take size_t lengths,
   resolving issues where lengths over INT_MAX were mishandled

 - Make frame pointer unwinding work properly in some of the x86
   assembly functions, by following the standard %rbp convention

 - Add helper functions for zeroizing structs

 - Make a few documentation improvements

* tag 'libcrypto-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiggers/linux: (49 commits)
  lib/crypto: md5: remove unused header
  lib/crypto: mips/chacha: Handle lengths of 2 GiB or more
  lib/crypto: arm/chacha: Handle lengths of 2 GiB or more in scalar code
  lib/crypto: chacha: Use size_t length
  lib/crypto: poly1305: Use size_t length
  lib/crypto: x86/sha512: Follow the normal %rbp convention
  lib/crypto: x86/sha256: Follow the normal %rbp convention
  lib/crypto: x86/sha1: Follow the normal %rbp convention
  lib/crypto: chacha20poly1305: zeroize state in __chacha20poly1305_decrypt
  lib/crypto: sparc/aes-xts: Add optimization using the AES opcodes
  lib: Move SipHash into lib/crypto/
  lib/crypto: x86/aes-ctr: Remove some unreachable code
  crypto: x86/aesni-intel - Add transitional selections
  crypto: aes - Boost priority of encryption modes further
  lib/crypto: x86/aes: Set RNDKEY in aes_cbc_encrypt_aesni()
  lib/crypto: riscv/aes-xts: Migrate optimized code into library
  lib/crypto: riscv/aes-ctr: Migrate optimized code into library
  lib/crypto: riscv/aes-cbc: Migrate optimized code into library
  lib/crypto: riscv/aes-ecb: Migrate optimized code into library
  lib/crypto: riscv/aes: Pass key struct to assembly code
  ...
2026-10-20 15:38:53 -10:00
..
arm lib/crypto: arm/chacha: Handle lengths of 2 GiB or more in scalar code 2026-10-15 23:17:16 -07:00
arm64 Crypto library updates for 7.4 2026-10-20 15:38:53 -10:00
mips lib/crypto: mips/chacha: Handle lengths of 2 GiB or more 2026-10-15 23:17:16 -07:00
mpi Crypto library fix and documentation update for 7.1 2026-04-21 11:46:22 -07:00
powerpc lib/crypto: chacha: Use size_t length 2026-10-15 23:16:46 -07:00
riscv lib/crypto: chacha: Use size_t length 2026-10-15 23:16:46 -07:00
s390 lib/crypto: chacha: Use size_t length 2026-10-15 23:16:46 -07:00
sparc lib/crypto: sparc/aes-xts: Add optimization using the AES opcodes 2026-10-04 21:40:47 +02:00
tests Crypto library updates for 7.4 2026-10-20 15:38:53 -10:00
x86 Crypto library updates for 7.4 2026-10-20 15:38:53 -10:00
.kunitconfig lib: Move SipHash into lib/crypto/ 2026-10-03 18:30:12 +02:00
aes.c lib/crypto: aes-xctr: Pass counter by value to aes_xctr_arch() 2026-09-30 09:42:09 -07:00
aescfb.c lib/crypto: Include <crypto/utils.h> instead of <crypto/algapi.h> 2026-03-31 17:19:31 -07:00
arc4.c lib/crypto: Explicitly include <linux/export.h> 2025-06-30 09:26:19 -07:00
blake2b.c lib/crypto: blake2: Provide functions for zeroizing blake2*_ctx structures 2026-09-30 09:33:54 -07:00
blake2s.c lib/crypto: blake2: Provide functions for zeroizing blake2*_ctx structures 2026-09-30 09:33:54 -07:00
chacha-block-generic.c lib/crypto: chacha: Zeroize permuted_state before it leaves scope 2026-03-27 13:35:35 -07:00
chacha.c lib/crypto: chacha: Use size_t length 2026-10-15 23:16:46 -07:00
chacha20poly1305.c lib/crypto: chacha20poly1305: zeroize state in __chacha20poly1305_decrypt 2026-10-05 17:13:25 +02:00
curve25519-fiat32.c move asm/unaligned.h to linux/unaligned.h 2024-10-02 17:23:23 -04:00
curve25519-hacl64.c move asm/unaligned.h to linux/unaligned.h 2024-10-02 17:23:23 -04:00
curve25519.c lib/crypto: curve25519: Consolidate into single module 2025-09-06 16:32:43 -07:00
des.c lib/crypto: Explicitly include <linux/export.h> 2025-06-30 09:26:19 -07:00
fips-aes.h lib/crypto: aes: Add FIPS self-tests for GCM and CCM 2026-08-10 20:17:56 -07:00
fips-mldsa.h lib/crypto: mldsa: Add FIPS cryptographic algorithm self-test 2026-01-12 11:07:50 -08:00
fips-sha.h lib/crypto: fips: Split fips.h into fips-aes.h and fips-sha.h 2026-08-10 20:17:55 -07:00
gf128hash.c lib/crypto: gf128hash: mark clmul32() as noinline_for_stack 2026-06-11 12:57:49 -07:00
gf128mul.c lib/crypto: gf128mul: Remove unused 4k_lle functions 2026-03-23 16:44:30 -07:00
hash_info.c lib/crypto: hash_info: Move hash_info.c into lib/crypto/ 2025-07-08 12:03:44 -07:00
Kconfig lib/crypto: aesgcm: Remove old AES-GCM library 2026-07-23 09:30:30 -07:00
Makefile lib: Move SipHash into lib/crypto/ 2026-10-03 18:30:12 +02:00
md5.c lib/crypto: md5: remove unused header 2026-10-16 00:28:55 -07:00
memneq.c lib/crypto: Include <crypto/utils.h> instead of <crypto/algapi.h> 2026-03-31 17:19:31 -07:00
mldsa.c lib/crypto: mldsa: Clarify the documentation for mldsa_verify() slightly 2026-02-03 19:28:51 -08:00
nh.c lib/crypto: nh: Add NH library 2026-01-12 11:07:49 -08:00
poly1305-donna32.c lib/crypto: poly1305: Use size_t length 2026-10-15 23:09:15 -07:00
poly1305-donna64.c lib/crypto: poly1305: Use size_t length 2026-10-15 23:09:15 -07:00
poly1305.c Crypto library updates for 7.4 2026-10-20 15:38:53 -10:00
sha1.c lib/crypto: sha1: Provide functions for zeroizing hmac_sha1 structures 2026-09-30 09:33:54 -07:00
sha3.c lib/crypto: fips: Split fips.h into fips-aes.h and fips-sha.h 2026-08-10 20:17:55 -07:00
sha256.c lib/crypto: fips: Split fips.h into fips-aes.h and fips-sha.h 2026-08-10 20:17:55 -07:00
sha512.c lib/crypto: fips: Split fips.h into fips-aes.h and fips-sha.h 2026-08-10 20:17:55 -07:00
simd.c crypto: api - move crypto_simd_disabled_for_test to lib 2024-10-28 18:33:11 +08:00
siphash.c lib: Move SipHash into lib/crypto/ 2026-10-03 18:30:12 +02:00
sm3.c lib/crypto: sm3: Provide a function for zeroizing the sm3_ctx structure 2026-09-30 09:33:54 -07:00
utils.c lib/crypto: Explicitly include <linux/export.h> 2025-06-30 09:26:19 -07:00