linux-yocto/crypto
Linus Torvalds d8768fb12a Crypto library updates for 6.18
- Add a RISC-V optimized implementation of Poly1305. This code was
   written by Andy Polyakov and contributed by Zhihang Shao.
 
 - Migrate the MD5 code into lib/crypto/, and add KUnit tests for MD5.
   Yes, it's still the 90s, and several kernel subsystems are still using
   MD5 for legacy use cases. As long as that remains the case, it's
   helpful to clean it up in the same way as I've been doing for other
   algorithms. Later, I plan to convert most of these users of MD5 to use
   the new MD5 library API instead of the generic crypto API.
 
 - Simplify the organization of the ChaCha, Poly1305, BLAKE2s, and
   Curve25519 code. Consolidate these into one module per algorithm,
   and centralize the configuration and build process. This is the same
   reorganization that has already been successful for SHA-1 and SHA-2.
 
 - Remove the unused crypto_kpp API for Curve25519.
 
 - Migrate the BLAKE2s and Curve25519 self-tests to KUnit.
 
 - Always enable the architecture-optimized BLAKE2s code.
 
 Due to interdependencies between test and non-test code, both are
 included in this pull request. The broken-down diffstat is as follows:
 
     Tests:            735 insertions(+), 1917 deletions(-)
     RISC-V Poly1305:  877 insertions(+), 1 deletion(-)
     Other:           1777 insertions(+), 3117 deletions(-)
 
 Besides the new RISC-V code which is an addition, there are quite a
 few simplifications due to the improved code organization for multiple
 algorithms, the removal of the unused crypto_kpp API for Curve25519
 and redundant tests, and the redesign of the BLAKE2s test.
 -----BEGIN PGP SIGNATURE-----
 
 iIoEABYIADIWIQSacvsUNc7UX4ntmEPzXCl4vpKOKwUCaNgwUhQcZWJpZ2dlcnNA
 a2VybmVsLm9yZwAKCRDzXCl4vpKOK3EnAP96hB1wD12DvIovGCmWnnlbzOt+CoK2
 B5CW74eYEZiSbwD7BiKPDqvSmLzEBtbKmOSwRvxKuQ2uGGef3USFKYVCiw0=
 =DY5R
 -----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:

 - Add a RISC-V optimized implementation of Poly1305. This code was
   written by Andy Polyakov and contributed by Zhihang Shao.

 - Migrate the MD5 code into lib/crypto/, and add KUnit tests for MD5.

   Yes, it's still the 90s, and several kernel subsystems are still
   using MD5 for legacy use cases. As long as that remains the case,
   it's helpful to clean it up in the same way as I've been doing for
   other algorithms.

   Later, I plan to convert most of these users of MD5 to use the new
   MD5 library API instead of the generic crypto API.

 - Simplify the organization of the ChaCha, Poly1305, BLAKE2s, and
   Curve25519 code.

   Consolidate these into one module per algorithm, and centralize the
   configuration and build process. This is the same reorganization that
   has already been successful for SHA-1 and SHA-2.

 - Remove the unused crypto_kpp API for Curve25519.

 - Migrate the BLAKE2s and Curve25519 self-tests to KUnit.

 - Always enable the architecture-optimized BLAKE2s code.

* tag 'libcrypto-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiggers/linux: (38 commits)
  crypto: md5 - Implement export_core() and import_core()
  wireguard: kconfig: simplify crypto kconfig selections
  lib/crypto: tests: Enable Curve25519 test when CRYPTO_SELFTESTS
  lib/crypto: curve25519: Consolidate into single module
  lib/crypto: curve25519: Move a couple functions out-of-line
  lib/crypto: tests: Add Curve25519 benchmark
  lib/crypto: tests: Migrate Curve25519 self-test to KUnit
  crypto: curve25519 - Remove unused kpp support
  crypto: testmgr - Remove curve25519 kpp tests
  crypto: x86/curve25519 - Remove unused kpp support
  crypto: powerpc/curve25519 - Remove unused kpp support
  crypto: arm/curve25519 - Remove unused kpp support
  crypto: hisilicon/hpre - Remove unused curve25519 kpp support
  lib/crypto: tests: Add KUnit tests for BLAKE2s
  lib/crypto: blake2s: Consolidate into single C translation unit
  lib/crypto: blake2s: Move generic code into blake2s.c
  lib/crypto: blake2s: Always enable arch-optimized BLAKE2s code
  lib/crypto: blake2s: Remove obsolete self-test
  lib/crypto: x86/blake2s: Reduce size of BLAKE2S_SIGMA2
  lib/crypto: chacha: Consolidate into single module
  ...
2025-09-29 15:48:56 -07:00
..
asymmetric_keys EFI updates for v6.16 2025-05-30 12:42:57 -07:00
async_tx lib/raid6: replace custom zero page with ZERO_PAGE 2025-07-09 22:57:54 -07:00
krb5 crypto: krb5 - Fix memory leak in krb5_test_one_prf() 2025-07-18 20:52:00 +10:00
842.c Revert "crypto: run initcalls for generic implementations earlier" 2025-05-05 18:20:44 +08:00
acompress.c crypto: api - Rename CRYPTO_ALG_REQ_CHAIN to CRYPTO_ALG_REQ_VIRT 2025-05-05 18:20:45 +08:00
adiantum.c Revert "crypto: run initcalls for generic implementations earlier" 2025-05-05 18:20:44 +08:00
aead.c crypto: api - Add support for duplicating algorithms before registration 2025-04-16 15:36:24 +08:00
aegis-neon.h
aegis.h
aegis128-core.c Revert "crypto: run initcalls for generic implementations earlier" 2025-05-05 18:20:44 +08:00
aegis128-neon-inner.c
aegis128-neon.c
aes_generic.c Revert "crypto: run initcalls for generic implementations earlier" 2025-05-05 18:20:44 +08:00
aes_ti.c
af_alg.c crypto: af_alg - Disallow concurrent writes in af_alg_sendmsg 2025-09-18 17:24:59 +08:00
ahash.c This update includes the following changes: 2025-07-31 09:45:28 -07:00
akcipher.c crypto: api - Add support for duplicating algorithms before registration 2025-04-16 15:36:24 +08:00
algapi.c crypto: algapi - Add driver template support to crypto_inst_setname 2025-05-19 13:48:20 +08:00
algboss.c crypto: testmgr - replace CRYPTO_MANAGER_DISABLE_TESTS with CRYPTO_SELFTESTS 2025-05-12 13:33:14 +08:00
algif_aead.c crypto: algif_aead - use memcpy_sglist() instead of null skcipher 2025-05-12 13:32:53 +08:00
algif_hash.c crypto: algif_hash - fix double free in hash_accept 2025-05-19 13:44:16 +08:00
algif_rng.c
algif_skcipher.c
ansi_cprng.c Revert "crypto: run initcalls for generic implementations earlier" 2025-05-05 18:20:44 +08:00
anubis.c Revert "crypto: run initcalls for generic implementations earlier" 2025-05-05 18:20:44 +08:00
api.c crypto: api - Redo lookup on EEXIST 2025-05-23 19:25:47 +08:00
arc4.c Revert "crypto: run initcalls for generic implementations earlier" 2025-05-05 18:20:44 +08:00
aria_generic.c Revert "crypto: run initcalls for generic implementations earlier" 2025-05-05 18:20:44 +08:00
authenc.c crypto: authenc - use memcpy_sglist() instead of null skcipher 2025-05-12 13:32:53 +08:00
authencesn.c crypto: authenc - use memcpy_sglist() instead of null skcipher 2025-05-12 13:32:53 +08:00
blake2b_generic.c Revert "crypto: run initcalls for generic implementations earlier" 2025-05-05 18:20:44 +08:00
blowfish_common.c
blowfish_generic.c Revert "crypto: run initcalls for generic implementations earlier" 2025-05-05 18:20:44 +08:00
bpf_crypto_skcipher.c crypto: bpf - Add MODULE_DESCRIPTION for skcipher 2025-03-02 15:19:43 +08:00
camellia_generic.c Revert "crypto: run initcalls for generic implementations earlier" 2025-05-05 18:20:44 +08:00
cast_common.c
cast5_generic.c Revert "crypto: run initcalls for generic implementations earlier" 2025-05-05 18:20:44 +08:00
cast6_generic.c Revert "crypto: run initcalls for generic implementations earlier" 2025-05-05 18:20:44 +08:00
cbc.c Revert "crypto: run initcalls for generic implementations earlier" 2025-05-05 18:20:44 +08:00
ccm.c Revert "crypto: run initcalls for generic implementations earlier" 2025-05-05 18:20:44 +08:00
chacha.c crypto: chacha - register only "-lib" drivers 2025-08-29 09:50:19 -07:00
chacha20poly1305.c Revert "crypto: run initcalls for generic implementations earlier" 2025-05-05 18:20:44 +08:00
cipher.c module: Convert symbol namespace to string literal 2024-12-02 11:34:44 -08:00
cmac.c Revert "crypto: run initcalls for generic implementations earlier" 2025-05-05 18:20:44 +08:00
compress.h crypto: acomp - Move stream management into scomp layer 2025-03-15 16:21:22 +08:00
crc32.c crypto/crc32[c]: register only "-lib" drivers 2025-06-30 09:31:56 -07:00
crc32c.c crypto/crc32[c]: register only "-lib" drivers 2025-06-30 09:31:56 -07:00
cryptd.c crypto: cryptd - Use nested-BH locking for cryptd_cpu_queue 2025-07-18 20:51:59 +10:00
crypto_engine.c crypto: engine - remove {prepare,unprepare}_crypt_hardware callbacks 2025-07-18 20:52:00 +10:00
crypto_null.c crypto: null - use memcpy_sglist() 2025-05-12 13:32:53 +08:00
crypto_user.c crypto: remove obsolete 'comp' compression API 2025-03-21 17:39:06 +08:00
ctr.c Revert "crypto: run initcalls for generic implementations earlier" 2025-05-05 18:20:44 +08:00
cts.c Revert "crypto: run initcalls for generic implementations earlier" 2025-05-05 18:20:44 +08:00
deflate.c crypto: acomp - Fix CFI failure due to type punning 2025-07-18 20:52:00 +10:00
des_generic.c Revert "crypto: run initcalls for generic implementations earlier" 2025-05-05 18:20:44 +08:00
dh_helper.c
dh.c Revert "crypto: run initcalls for generic implementations earlier" 2025-05-05 18:20:44 +08:00
drbg.c Revert "crypto: run initcalls for generic implementations earlier" 2025-05-05 18:20:44 +08:00
ecb.c Revert "crypto: run initcalls for generic implementations earlier" 2025-05-05 18:20:44 +08:00
ecc_curve_defs.h
ecc.c crypto: ecdsa - Harden against integer overflows in DIV_ROUND_UP() 2025-02-09 18:08:12 +08:00
ecdh_helper.c
ecdh.c Revert "crypto: run initcalls for generic implementations earlier" 2025-05-05 18:20:44 +08:00
ecdsa-p1363.c crypto: ecdsa - Fix NIST P521 key size reported by KEYCTL_PKEY_QUERY 2025-04-16 15:16:21 +08:00
ecdsa-x962.c crypto: ecdsa - Fix NIST P521 key size reported by KEYCTL_PKEY_QUERY 2025-04-16 15:16:21 +08:00
ecdsa.c Revert "crypto: run initcalls for generic implementations earlier" 2025-05-05 18:20:44 +08:00
ecdsasignature.asn1
echainiv.c crypto: geniv - use memcpy_sglist() instead of null skcipher 2025-05-12 13:32:53 +08:00
ecrdsa_defs.h
ecrdsa_params.asn1
ecrdsa_pub_key.asn1
ecrdsa.c crypto: ecdsa - Fix NIST P521 key size reported by KEYCTL_PKEY_QUERY 2025-04-16 15:16:21 +08:00
essiv.c Revert "crypto: run initcalls for generic implementations earlier" 2025-05-05 18:20:44 +08:00
fcrypt.c Revert "crypto: run initcalls for generic implementations earlier" 2025-05-05 18:20:44 +08:00
fips.c Revert "crypto: run initcalls for generic implementations earlier" 2025-05-05 18:20:44 +08:00
gcm.c crypto: gcm - use memcpy_sglist() instead of null skcipher 2025-05-12 13:32:53 +08:00
geniv.c crypto: geniv - use memcpy_sglist() instead of null skcipher 2025-05-12 13:32:53 +08:00
ghash-generic.c Revert "crypto: run initcalls for generic implementations earlier" 2025-05-05 18:20:44 +08:00
hash.h
hctr2.c Revert "crypto: run initcalls for generic implementations earlier" 2025-05-05 18:20:44 +08:00
hkdf.c crypto: hkdf - move to late_initcall 2025-06-11 10:59:45 +08:00
hmac.c crypto: hmac - Add ahash support 2025-05-19 13:48:20 +08:00
internal.h crypto: testmgr - replace CRYPTO_MANAGER_DISABLE_TESTS with CRYPTO_SELFTESTS 2025-05-12 13:33:14 +08:00
jitterentropy-kcapi.c crypto: jitter - fix intermediary handling 2025-07-07 15:27:04 +12:00
jitterentropy-testing.c crypto: jitter - output full sample from test interface 2024-10-19 08:44:30 +08:00
jitterentropy.c crypto: jitter - replace ARRAY_SIZE definition with header include 2025-07-18 20:52:01 +10:00
jitterentropy.h crypto: jitter - output full sample from test interface 2024-10-19 08:44:30 +08:00
Kconfig crypto: curve25519 - Remove unused kpp support 2025-09-06 14:45:49 -07:00
kdf_sp800108.c crypto: testmgr - replace CRYPTO_MANAGER_DISABLE_TESTS with CRYPTO_SELFTESTS 2025-05-12 13:33:14 +08:00
khazad.c Revert "crypto: run initcalls for generic implementations earlier" 2025-05-05 18:20:44 +08:00
kpp.c crypto: api - Add support for duplicating algorithms before registration 2025-04-16 15:36:24 +08:00
krb5enc.c Revert "crypto: run initcalls for generic implementations earlier" 2025-05-05 18:20:44 +08:00
lrw.c crypto: lrw - Only add ecb if it is not already there 2025-05-19 13:48:20 +08:00
lskcipher.c crypto: api - Add support for duplicating algorithms before registration 2025-04-16 15:36:24 +08:00
lz4.c Revert "crypto: run initcalls for generic implementations earlier" 2025-05-05 18:20:44 +08:00
lz4hc.c Revert "crypto: run initcalls for generic implementations earlier" 2025-05-05 18:20:44 +08:00
lzo-rle.c Revert "crypto: run initcalls for generic implementations earlier" 2025-05-05 18:20:44 +08:00
lzo.c Revert "crypto: run initcalls for generic implementations earlier" 2025-05-05 18:20:44 +08:00
Makefile crypto: curve25519 - Remove unused kpp support 2025-09-06 14:45:49 -07:00
md4.c Revert "crypto: run initcalls for generic implementations earlier" 2025-05-05 18:20:44 +08:00
md5.c crypto: md5 - Implement export_core() and import_core() 2025-09-08 09:47:38 -07:00
michael_mic.c Revert "crypto: run initcalls for generic implementations earlier" 2025-05-05 18:20:44 +08:00
nhpoly1305.c Revert "crypto: run initcalls for generic implementations earlier" 2025-05-05 18:20:44 +08:00
pcbc.c Revert "crypto: run initcalls for generic implementations earlier" 2025-05-05 18:20:44 +08:00
pcrypt.c crypto: pcrypt - Optimize pcrypt_aead_init_tfm() 2025-06-13 17:26:17 +08:00
polyval-generic.c Revert "crypto: run initcalls for generic implementations earlier" 2025-05-05 18:20:44 +08:00
proc.c crypto: remove obsolete 'comp' compression API 2025-03-21 17:39:06 +08:00
ripemd.h
rmd160.c Revert "crypto: run initcalls for generic implementations earlier" 2025-05-05 18:20:44 +08:00
rng.c crypto: api - Add support for duplicating algorithms before registration 2025-04-16 15:36:24 +08:00
rsa_helper.c
rsa-pkcs1pad.c crypto: rsassa-pkcs1 - Migrate to sig_alg backend 2024-10-05 13:22:04 +08:00
rsa.c Revert "crypto: run initcalls for generic implementations earlier" 2025-05-05 18:20:44 +08:00
rsaprivkey.asn1
rsapubkey.asn1
rsassa-pkcs1.c crypto: ecdsa - Fix NIST P521 key size reported by KEYCTL_PKEY_QUERY 2025-04-16 15:16:21 +08:00
scatterwalk.c crypto: scatterwalk - Move skcipher walk and use it for memcpy_sglist 2025-04-28 19:45:26 +08:00
scompress.c crypto: api - Rename CRYPTO_ALG_REQ_CHAIN to CRYPTO_ALG_REQ_VIRT 2025-05-05 18:20:45 +08:00
seed.c Revert "crypto: run initcalls for generic implementations earlier" 2025-05-05 18:20:44 +08:00
seqiv.c crypto: geniv - use memcpy_sglist() instead of null skcipher 2025-05-12 13:32:53 +08:00
serpent_generic.c Revert "crypto: run initcalls for generic implementations earlier" 2025-05-05 18:20:44 +08:00
sha1.c crypto: sha1 - Implement export_core() and import_core() 2025-09-02 19:02:35 -07:00
sha3_generic.c crypto: sha3-generic - Use API partial block handling 2025-04-23 15:52:46 +08:00
sha256.c crypto: sha256 - Implement export_core() and import_core() 2025-09-02 19:02:37 -07:00
sha512.c crypto: sha512 - Implement export_core() and import_core() 2025-09-02 19:02:39 -07:00
shash.c crypto: shash - Fix buffer overrun in import function 2025-05-27 13:43:32 +08:00
sig.c crypto: api - Add support for duplicating algorithms before registration 2025-04-16 15:36:24 +08:00
simd.c
skcipher.c crypto: scatterwalk - Move skcipher walk and use it for memcpy_sglist 2025-04-28 19:45:26 +08:00
skcipher.h
sm3_generic.c Revert "crypto: run initcalls for generic implementations earlier" 2025-05-05 18:20:44 +08:00
sm4_generic.c Revert "crypto: run initcalls for generic implementations earlier" 2025-05-05 18:20:44 +08:00
sm4.c
streebog_generic.c Revert "crypto: run initcalls for generic implementations earlier" 2025-05-05 18:20:44 +08:00
tcrypt.c crypto: tcrypt - rename CRYPTO_TEST to CRYPTO_BENCHMARK 2025-05-12 13:32:53 +08:00
tcrypt.h crypto: tcrypt - rename CRYPTO_TEST to CRYPTO_BENCHMARK 2025-05-12 13:32:53 +08:00
tea.c Revert "crypto: run initcalls for generic implementations earlier" 2025-05-05 18:20:44 +08:00
testmgr.c crypto: testmgr - Remove curve25519 kpp tests 2025-09-06 14:45:49 -07:00
testmgr.h crypto: testmgr - Remove curve25519 kpp tests 2025-09-06 14:45:49 -07:00
twofish_common.c
twofish_generic.c Revert "crypto: run initcalls for generic implementations earlier" 2025-05-05 18:20:44 +08:00
wp512.c crypto: wp512 - Use API partial block handling 2025-06-23 16:56:56 +08:00
xcbc.c Revert "crypto: run initcalls for generic implementations earlier" 2025-05-05 18:20:44 +08:00
xctr.c Revert "crypto: run initcalls for generic implementations earlier" 2025-05-05 18:20:44 +08:00
xor.c
xts.c crypto: xts - Only add ecb if it is not already there 2025-05-19 13:48:20 +08:00
xxhash_generic.c Revert "crypto: run initcalls for generic implementations earlier" 2025-05-05 18:20:44 +08:00
zstd.c crypto: acomp - Fix CFI failure due to type punning 2025-07-18 20:52:00 +10:00