Skip to content

Commit 0dde292

Browse files
committed
Merge tag 'libcrypto-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiggers/linux
Pull crypto library fixes from Eric Biggers: - Fix a build error in certain configurations - Clarify some parts of the documentation - Remove unused code that I forgot to remove in commit cf52058 ("lib/crypto: powerpc/md5: Drop powerpc optimized MD5 code") * tag 'libcrypto-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiggers/linux: crypto: aes - Fix conditions for selecting MAC dependencies lib/crypto: docs: Improve introduction sentence lib/crypto: docs: Fix some sentence fragments lib/crypto: md5: Remove support for md5_mod_init_arch()
2 parents e13caf1 + e073f12 commit 0dde292

7 files changed

Lines changed: 30 additions & 42 deletions

File tree

Documentation/crypto/libcrypto-blockcipher.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@ Block ciphers
66
AES
77
---
88

9-
Support for the AES block cipher.
9+
This API provides support for the AES block cipher.
1010

1111
.. kernel-doc:: include/crypto/aes.h
1212

1313
DES
1414
---
1515

16-
Support for the DES block cipher. This algorithm is obsolete and is supported
17-
only for backwards compatibility.
16+
This API provides support for the DES block cipher. This algorithm is obsolete
17+
and is supported only for backwards compatibility.
1818

1919
.. kernel-doc:: include/crypto/des.h

Documentation/crypto/libcrypto-hash.rst

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -6,81 +6,83 @@ Hash functions, MACs, and XOFs
66
AES-CMAC and AES-XCBC-MAC
77
-------------------------
88

9-
Support for the AES-CMAC and AES-XCBC-MAC message authentication codes.
9+
This API provides support for the AES-CMAC and AES-XCBC-MAC message
10+
authentication codes.
1011

1112
.. kernel-doc:: include/crypto/aes-cbc-macs.h
1213

1314
BLAKE2b
1415
-------
1516

16-
Support for the BLAKE2b cryptographic hash function.
17+
This API provides support for the BLAKE2b cryptographic hash function.
1718

1819
.. kernel-doc:: include/crypto/blake2b.h
1920

2021
BLAKE2s
2122
-------
2223

23-
Support for the BLAKE2s cryptographic hash function.
24+
This API provides support for the BLAKE2s cryptographic hash function.
2425

2526
.. kernel-doc:: include/crypto/blake2s.h
2627

2728
GHASH and POLYVAL
2829
-----------------
2930

30-
Support for the GHASH and POLYVAL universal hash functions. These algorithms
31-
are used only as internal components of other algorithms.
31+
This API provides support for the GHASH and POLYVAL universal hash functions.
32+
These algorithms are used only as internal components of other algorithms.
3233

3334
.. kernel-doc:: include/crypto/gf128hash.h
3435

3536
MD5
3637
---
3738

38-
Support for the MD5 cryptographic hash function and HMAC-MD5. This algorithm is
39-
obsolete and is supported only for backwards compatibility.
39+
This API provides support for the MD5 cryptographic hash function and HMAC-MD5.
40+
This algorithm is obsolete and is supported only for backwards compatibility.
4041

4142
.. kernel-doc:: include/crypto/md5.h
4243

4344
NH
4445
--
4546

46-
Support for the NH universal hash function. This algorithm is used only as an
47-
internal component of other algorithms.
47+
This API provides support for the NH universal hash function. This algorithm is
48+
used only as an internal component of other algorithms.
4849

4950
.. kernel-doc:: include/crypto/nh.h
5051

5152
Poly1305
5253
--------
5354

54-
Support for the Poly1305 universal hash function. This algorithm is used only
55-
as an internal component of other algorithms.
55+
This API provides support for the Poly1305 universal hash function. This
56+
algorithm is used only as an internal component of other algorithms.
5657

5758
.. kernel-doc:: include/crypto/poly1305.h
5859

5960
SHA-1
6061
-----
6162

62-
Support for the SHA-1 cryptographic hash function and HMAC-SHA1. This algorithm
63-
is obsolete and is supported only for backwards compatibility.
63+
This API provides support for the SHA-1 cryptographic hash function and
64+
HMAC-SHA1. This algorithm is obsolete and is supported only for backwards
65+
compatibility.
6466

6567
.. kernel-doc:: include/crypto/sha1.h
6668

6769
SHA-2
6870
-----
6971

70-
Support for the SHA-2 family of cryptographic hash functions, including SHA-224,
71-
SHA-256, SHA-384, and SHA-512. This also includes their corresponding HMACs:
72-
HMAC-SHA224, HMAC-SHA256, HMAC-SHA384, and HMAC-SHA512.
72+
This API provides support for the SHA-2 family of cryptographic hash functions,
73+
including SHA-224, SHA-256, SHA-384, and SHA-512. This also includes their
74+
corresponding HMACs: HMAC-SHA224, HMAC-SHA256, HMAC-SHA384, and HMAC-SHA512.
7375

7476
.. kernel-doc:: include/crypto/sha2.h
7577

7678
SHA-3
7779
-----
7880

79-
The SHA-3 functions are documented in :ref:`sha3`.
81+
The SHA-3 API is documented in :ref:`sha3`.
8082

8183
SM3
8284
---
8385

84-
Support for the SM3 cryptographic hash function.
86+
This API provides support for the SM3 cryptographic hash function.
8587

8688
.. kernel-doc:: include/crypto/sm3.h

Documentation/crypto/libcrypto-signature.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ Digital signature algorithms
66
ML-DSA
77
------
88

9-
Support for the ML-DSA digital signature algorithm.
9+
This API provides support for the ML-DSA digital signature algorithm.
1010

1111
.. kernel-doc:: include/crypto/mldsa.h

Documentation/crypto/libcrypto.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@
44
Crypto library
55
==============
66

7-
``lib/crypto/`` provides faster and easier access to cryptographic algorithms
8-
than the traditional crypto API.
7+
The Linux kernel's crypto library (``lib/crypto/``) provides kernel-internal
8+
users of cryptographic algorithms with faster and easier access to those
9+
algorithms than the traditional kernel crypto API.
910

1011
Each cryptographic algorithm is supported via a set of dedicated functions.
1112
"Crypto agility", where needed, is left to calling code.

crypto/Kconfig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -358,8 +358,8 @@ config CRYPTO_AES
358358
tristate "AES (Advanced Encryption Standard)"
359359
select CRYPTO_ALGAPI
360360
select CRYPTO_LIB_AES
361-
select CRYPTO_LIB_AES_CBC_MACS if CRYPTO_CMAC || CRYPTO_XCBC || CRYPTO_CCM
362-
select CRYPTO_HASH if CRYPTO_CMAC || CRYPTO_XCBC || CRYPTO_CCM
361+
select CRYPTO_LIB_AES_CBC_MACS if CRYPTO_CMAC != n || CRYPTO_XCBC != n || CRYPTO_CCM != n
362+
select CRYPTO_HASH if CRYPTO_CMAC != n || CRYPTO_XCBC != n || CRYPTO_CCM != n
363363
help
364364
AES cipher algorithms (Rijndael)(FIPS-197, ISO/IEC 18033-3)
365365

lib/crypto/Kconfig

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@ config CRYPTO_LIB_UTILS
88

99
config CRYPTO_LIB_AES
1010
tristate
11-
# Select dependencies of modes that are part of libaes.
12-
select CRYPTO_LIB_UTILS if CRYPTO_LIB_AES_CBC_MACS
11+
select CRYPTO_LIB_UTILS
1312

1413
config CRYPTO_LIB_AES_ARCH
1514
bool

lib/crypto/md5.c

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -298,19 +298,5 @@ void hmac_md5_usingrawkey(const u8 *raw_key, size_t raw_key_len,
298298
}
299299
EXPORT_SYMBOL_GPL(hmac_md5_usingrawkey);
300300

301-
#ifdef md5_mod_init_arch
302-
static int __init md5_mod_init(void)
303-
{
304-
md5_mod_init_arch();
305-
return 0;
306-
}
307-
subsys_initcall(md5_mod_init);
308-
309-
static void __exit md5_mod_exit(void)
310-
{
311-
}
312-
module_exit(md5_mod_exit);
313-
#endif
314-
315301
MODULE_DESCRIPTION("MD5 and HMAC-MD5 library functions");
316302
MODULE_LICENSE("GPL");

0 commit comments

Comments
 (0)