* [PATCH 063/106] crypto: convert exported crypto symbol into pluggable interface for CONFIG_CRYPTO_BLOWFISH and CONFIG_CRYPTO_BLOWFISH_COMMON crypto
From: Jay Wang @ 2026-02-12 2:46 UTC (permalink / raw)
To: Herbert Xu, David S . Miller, linux-crypto
Cc: Jay Wang, Vegard Nossum, Nicolai Stange, Ilia Okomin,
Catalin Marinas, Will Deacon, Thomas Gleixner, Ingo Molnar,
Borislav Petkov, Luis Chamberlain, Petr Pavlu, Nathan Chancellor,
Nicolas Schier, linux-arm-kernel, x86, linux-kbuild,
linux-modules
In-Reply-To: <20260212024725.11264-1-wanjay@amazon.com>
Apply Crypto API wrappers to the exported crypto symbol in
CONFIG_CRYPTO_BLOWFISH- and CONFIG_CRYPTO_BLOWFISH_COMMON-related crypto
to convert them into pluggable interface.
Signed-off-by: Jay Wang <wanjay@amazon.com>
---
crypto/Makefile | 4 ++--
crypto/blowfish_generic.c | 4 ++--
crypto/fips140/fips140-api.c | 10 ++++++++++
include/crypto/blowfish.h | 6 ++++--
4 files changed, 18 insertions(+), 6 deletions(-)
diff --git a/crypto/Makefile b/crypto/Makefile
index 84dff7084f71..795c76357bff 100644
--- a/crypto/Makefile
+++ b/crypto/Makefile
@@ -128,8 +128,8 @@ crypto-objs-$(CONFIG_CRYPTO_PCRYPT) += pcrypt.o
crypto-objs-$(CONFIG_CRYPTO_CRYPTD) += cryptd.o
crypto-objs-$(CONFIG_CRYPTO_DES) += des_generic.o
crypto-objs-$(CONFIG_CRYPTO_FCRYPT) += fcrypt.o
-obj-$(CONFIG_CRYPTO_BLOWFISH) += blowfish_generic.o
-obj-$(CONFIG_CRYPTO_BLOWFISH_COMMON) += blowfish_common.o
+crypto-objs-$(CONFIG_CRYPTO_BLOWFISH) += blowfish_generic.o
+crypto-objs-$(CONFIG_CRYPTO_BLOWFISH_COMMON) += blowfish_common.o
obj-$(CONFIG_CRYPTO_TWOFISH) += twofish_generic.o
obj-$(CONFIG_CRYPTO_TWOFISH_COMMON) += twofish_common.o
obj-$(CONFIG_CRYPTO_SERPENT) += serpent_generic.o
diff --git a/crypto/blowfish_generic.c b/crypto/blowfish_generic.c
index f3c5f9b09850..8a0390b14867 100644
--- a/crypto/blowfish_generic.c
+++ b/crypto/blowfish_generic.c
@@ -124,8 +124,8 @@ static void __exit blowfish_mod_fini(void)
crypto_unregister_alg(&alg);
}
-module_init(blowfish_mod_init);
-module_exit(blowfish_mod_fini);
+crypto_module_init(blowfish_mod_init);
+crypto_module_exit(blowfish_mod_fini);
MODULE_LICENSE("GPL");
MODULE_DESCRIPTION("Blowfish Cipher Algorithm");
diff --git a/crypto/fips140/fips140-api.c b/crypto/fips140/fips140-api.c
index 1452439319cc..61f7884d0f34 100644
--- a/crypto/fips140/fips140-api.c
+++ b/crypto/fips140/fips140-api.c
@@ -644,3 +644,13 @@ DEFINE_CRYPTO_API_STUB(cryptd_aead_queued);
DEFINE_CRYPTO_API_STUB(cryptd_free_aead);
#endif
+/*
+ * crypto/blowfish_common.c
+ */
+#if IS_BUILTIN(CONFIG_CRYPTO_BLOWFISH_COMMON)
+
+#include <crypto/blowfish.h>
+
+DEFINE_CRYPTO_API_STUB(blowfish_setkey);
+
+#endif
diff --git a/include/crypto/blowfish.h b/include/crypto/blowfish.h
index 9b384670b356..46e42a89bdf9 100644
--- a/include/crypto/blowfish.h
+++ b/include/crypto/blowfish.h
@@ -6,6 +6,7 @@
#ifndef _CRYPTO_BLOWFISH_H
#define _CRYPTO_BLOWFISH_H
+#include <crypto/api.h>
#include <linux/types.h>
#include <linux/crypto.h>
@@ -18,7 +19,8 @@ struct bf_ctx {
u32 s[1024];
};
-int blowfish_setkey(struct crypto_tfm *tfm, const u8 *key,
- unsigned int key_len);
+DECLARE_CRYPTO_API(CONFIG_CRYPTO_BLOWFISH_COMMON, blowfish_setkey, int,
+ (struct crypto_tfm *tfm, const u8 *key, unsigned int key_len),
+ (tfm, key, key_len));
#endif
--
2.47.3
^ permalink raw reply related
* [PATCH 062/106] crypto: convert exported crypto symbol into pluggable interface for CONFIG_CRYPTO_FCRYPT crypto
From: Jay Wang @ 2026-02-12 2:46 UTC (permalink / raw)
To: Herbert Xu, David S . Miller, linux-crypto
Cc: Jay Wang, Vegard Nossum, Nicolai Stange, Ilia Okomin,
Catalin Marinas, Will Deacon, Thomas Gleixner, Ingo Molnar,
Borislav Petkov, Luis Chamberlain, Petr Pavlu, Nathan Chancellor,
Nicolas Schier, linux-arm-kernel, x86, linux-kbuild,
linux-modules
In-Reply-To: <20260212024725.11264-1-wanjay@amazon.com>
Apply Crypto API wrappers to the exported crypto symbol in
CONFIG_CRYPTO_FCRYPT-related crypto to convert them into pluggable
interface.
Signed-off-by: Jay Wang <wanjay@amazon.com>
---
crypto/Makefile | 2 +-
crypto/fcrypt.c | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/crypto/Makefile b/crypto/Makefile
index 05fdb0e2f1be..84dff7084f71 100644
--- a/crypto/Makefile
+++ b/crypto/Makefile
@@ -127,7 +127,7 @@ CFLAGS_aegis128-neon-inner.o += -isystem $(shell $(CC) -print-file-name=include)
crypto-objs-$(CONFIG_CRYPTO_PCRYPT) += pcrypt.o
crypto-objs-$(CONFIG_CRYPTO_CRYPTD) += cryptd.o
crypto-objs-$(CONFIG_CRYPTO_DES) += des_generic.o
-obj-$(CONFIG_CRYPTO_FCRYPT) += fcrypt.o
+crypto-objs-$(CONFIG_CRYPTO_FCRYPT) += fcrypt.o
obj-$(CONFIG_CRYPTO_BLOWFISH) += blowfish_generic.o
obj-$(CONFIG_CRYPTO_BLOWFISH_COMMON) += blowfish_common.o
obj-$(CONFIG_CRYPTO_TWOFISH) += twofish_generic.o
diff --git a/crypto/fcrypt.c b/crypto/fcrypt.c
index 80036835cec5..f1c9ae91d4b5 100644
--- a/crypto/fcrypt.c
+++ b/crypto/fcrypt.c
@@ -411,8 +411,8 @@ static void __exit fcrypt_mod_fini(void)
crypto_unregister_alg(&fcrypt_alg);
}
-module_init(fcrypt_mod_init);
-module_exit(fcrypt_mod_fini);
+crypto_module_init(fcrypt_mod_init);
+crypto_module_exit(fcrypt_mod_fini);
MODULE_LICENSE("Dual BSD/GPL");
MODULE_DESCRIPTION("FCrypt Cipher Algorithm");
--
2.47.3
^ permalink raw reply related
* [PATCH 061/106] crypto: convert exported crypto symbol into pluggable interface for CONFIG_CRYPTO_DES crypto
From: Jay Wang @ 2026-02-12 2:46 UTC (permalink / raw)
To: Herbert Xu, David S . Miller, linux-crypto
Cc: Jay Wang, Vegard Nossum, Nicolai Stange, Ilia Okomin,
Catalin Marinas, Will Deacon, Thomas Gleixner, Ingo Molnar,
Borislav Petkov, Luis Chamberlain, Petr Pavlu, Nathan Chancellor,
Nicolas Schier, linux-arm-kernel, x86, linux-kbuild,
linux-modules
In-Reply-To: <20260212024725.11264-1-wanjay@amazon.com>
Apply Crypto API wrappers to the exported crypto symbol in
CONFIG_CRYPTO_DES-related crypto to convert them into pluggable
interface.
Signed-off-by: Jay Wang <wanjay@amazon.com>
---
crypto/Makefile | 2 +-
crypto/des_generic.c | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/crypto/Makefile b/crypto/Makefile
index f029e0decaa1..05fdb0e2f1be 100644
--- a/crypto/Makefile
+++ b/crypto/Makefile
@@ -126,7 +126,7 @@ CFLAGS_aegis128-neon-inner.o += -isystem $(shell $(CC) -print-file-name=include)
crypto-objs-$(CONFIG_CRYPTO_PCRYPT) += pcrypt.o
crypto-objs-$(CONFIG_CRYPTO_CRYPTD) += cryptd.o
-obj-$(CONFIG_CRYPTO_DES) += des_generic.o
+crypto-objs-$(CONFIG_CRYPTO_DES) += des_generic.o
obj-$(CONFIG_CRYPTO_FCRYPT) += fcrypt.o
obj-$(CONFIG_CRYPTO_BLOWFISH) += blowfish_generic.o
obj-$(CONFIG_CRYPTO_BLOWFISH_COMMON) += blowfish_common.o
diff --git a/crypto/des_generic.c b/crypto/des_generic.c
index fce341400914..8f767317d396 100644
--- a/crypto/des_generic.c
+++ b/crypto/des_generic.c
@@ -122,8 +122,8 @@ static void __exit des_generic_mod_fini(void)
crypto_unregister_algs(des_algs, ARRAY_SIZE(des_algs));
}
-module_init(des_generic_mod_init);
-module_exit(des_generic_mod_fini);
+crypto_module_init(des_generic_mod_init);
+crypto_module_exit(des_generic_mod_fini);
MODULE_LICENSE("GPL");
MODULE_DESCRIPTION("DES & Triple DES EDE Cipher Algorithms");
--
2.47.3
^ permalink raw reply related
* [PATCH 060/106] crypto: convert exported crypto symbol into pluggable interface for CONFIG_CRYPTO_CRYPTD crypto
From: Jay Wang @ 2026-02-12 2:46 UTC (permalink / raw)
To: Herbert Xu, David S . Miller, linux-crypto
Cc: Jay Wang, Vegard Nossum, Nicolai Stange, Ilia Okomin,
Catalin Marinas, Will Deacon, Thomas Gleixner, Ingo Molnar,
Borislav Petkov, Luis Chamberlain, Petr Pavlu, Nathan Chancellor,
Nicolas Schier, linux-arm-kernel, x86, linux-kbuild,
linux-modules
In-Reply-To: <20260212024725.11264-1-wanjay@amazon.com>
Apply Crypto API wrappers to the exported crypto symbol in
CONFIG_CRYPTO_CRYPTD-related crypto to convert them into pluggable
interface.
This patch is partially based on work by Vegard Nossum, with
modifications. Unlike the original, we do not include
DEFINE_CRYPTO_API since only one copy of the crypto symbols is
kept, either in the crypto module or in the main kernel, and we ensure
such wrapper do not have impact on crypto already chosen built as
module.
Co-developed-by: Vegard Nossum <vegard.nossum@oracle.com>
Signed-off-by: Jay Wang <wanjay@amazon.com>
---
crypto/Makefile | 2 +-
crypto/cryptd.c | 4 +--
crypto/fips140/fips140-api.c | 22 ++++++++++++++
include/crypto/cryptd.h | 56 +++++++++++++++++++++++++-----------
4 files changed, 65 insertions(+), 19 deletions(-)
diff --git a/crypto/Makefile b/crypto/Makefile
index b371a8788d39..f029e0decaa1 100644
--- a/crypto/Makefile
+++ b/crypto/Makefile
@@ -125,7 +125,7 @@ endif
CFLAGS_aegis128-neon-inner.o += -isystem $(shell $(CC) -print-file-name=include)
crypto-objs-$(CONFIG_CRYPTO_PCRYPT) += pcrypt.o
-obj-$(CONFIG_CRYPTO_CRYPTD) += cryptd.o
+crypto-objs-$(CONFIG_CRYPTO_CRYPTD) += cryptd.o
obj-$(CONFIG_CRYPTO_DES) += des_generic.o
obj-$(CONFIG_CRYPTO_FCRYPT) += fcrypt.o
obj-$(CONFIG_CRYPTO_BLOWFISH) += blowfish_generic.o
diff --git a/crypto/cryptd.c b/crypto/cryptd.c
index cd38f4676176..8b1ba67d752c 100644
--- a/crypto/cryptd.c
+++ b/crypto/cryptd.c
@@ -1145,8 +1145,8 @@ static void __exit cryptd_exit(void)
crypto_unregister_template(&cryptd_tmpl);
}
-module_init(cryptd_init);
-module_exit(cryptd_exit);
+crypto_module_init(cryptd_init);
+crypto_module_exit(cryptd_exit);
MODULE_LICENSE("GPL");
MODULE_DESCRIPTION("Software async crypto daemon");
diff --git a/crypto/fips140/fips140-api.c b/crypto/fips140/fips140-api.c
index 3c6dfcac5db5..1452439319cc 100644
--- a/crypto/fips140/fips140-api.c
+++ b/crypto/fips140/fips140-api.c
@@ -622,3 +622,25 @@ DEFINE_CRYPTO_API_STUB(ecc_point_is_zero);
DEFINE_CRYPTO_API_STUB(ecc_point_mult_shamir);
#endif
+/*
+ * crypto/cryptd.c
+ */
+#if IS_BUILTIN(CONFIG_CRYPTO_CRYPTD)
+
+#include <crypto/cryptd.h>
+
+DEFINE_CRYPTO_API_STUB(cryptd_alloc_skcipher);
+DEFINE_CRYPTO_API_STUB(cryptd_skcipher_child);
+DEFINE_CRYPTO_API_STUB(cryptd_skcipher_queued);
+DEFINE_CRYPTO_API_STUB(cryptd_free_skcipher);
+DEFINE_CRYPTO_API_STUB(cryptd_alloc_ahash);
+DEFINE_CRYPTO_API_STUB(cryptd_ahash_child);
+DEFINE_CRYPTO_API_STUB(cryptd_shash_desc);
+DEFINE_CRYPTO_API_STUB(cryptd_ahash_queued);
+DEFINE_CRYPTO_API_STUB(cryptd_free_ahash);
+DEFINE_CRYPTO_API_STUB(cryptd_alloc_aead);
+DEFINE_CRYPTO_API_STUB(cryptd_aead_child);
+DEFINE_CRYPTO_API_STUB(cryptd_aead_queued);
+DEFINE_CRYPTO_API_STUB(cryptd_free_aead);
+
+#endif
diff --git a/include/crypto/cryptd.h b/include/crypto/cryptd.h
index 796d986e58e1..35b4d06e41f5 100644
--- a/include/crypto/cryptd.h
+++ b/include/crypto/cryptd.h
@@ -13,6 +13,7 @@
#ifndef _CRYPTO_CRYPT_H
#define _CRYPTO_CRYPT_H
+#include <crypto/api.h>
#include <linux/types.h>
#include <crypto/aead.h>
@@ -24,12 +25,19 @@ struct cryptd_skcipher {
};
/* alg_name should be algorithm to be cryptd-ed */
-struct cryptd_skcipher *cryptd_alloc_skcipher(const char *alg_name,
- u32 type, u32 mask);
-struct crypto_skcipher *cryptd_skcipher_child(struct cryptd_skcipher *tfm);
+DECLARE_CRYPTO_API(CONFIG_CRYPTO_CRYPTD, cryptd_alloc_skcipher, struct cryptd_skcipher *,
+ (const char *alg_name, u32 type, u32 mask),
+ (alg_name, type, mask));
+DECLARE_CRYPTO_API(CONFIG_CRYPTO_CRYPTD, cryptd_skcipher_child, struct crypto_skcipher *,
+ (struct cryptd_skcipher *tfm),
+ (tfm));
/* Must be called without moving CPUs. */
-bool cryptd_skcipher_queued(struct cryptd_skcipher *tfm);
-void cryptd_free_skcipher(struct cryptd_skcipher *tfm);
+DECLARE_CRYPTO_API(CONFIG_CRYPTO_CRYPTD, cryptd_skcipher_queued, bool,
+ (struct cryptd_skcipher *tfm),
+ (tfm));
+DECLARE_CRYPTO_API(CONFIG_CRYPTO_CRYPTD, cryptd_free_skcipher, void,
+ (struct cryptd_skcipher *tfm),
+ (tfm));
struct cryptd_ahash {
struct crypto_ahash base;
@@ -42,13 +50,22 @@ static inline struct cryptd_ahash *__cryptd_ahash_cast(
}
/* alg_name should be algorithm to be cryptd-ed */
-struct cryptd_ahash *cryptd_alloc_ahash(const char *alg_name,
- u32 type, u32 mask);
-struct crypto_shash *cryptd_ahash_child(struct cryptd_ahash *tfm);
-struct shash_desc *cryptd_shash_desc(struct ahash_request *req);
+DECLARE_CRYPTO_API(CONFIG_CRYPTO_CRYPTD, cryptd_alloc_ahash, struct cryptd_ahash *,
+ (const char *alg_name, u32 type, u32 mask),
+ (alg_name, type, mask));
+DECLARE_CRYPTO_API(CONFIG_CRYPTO_CRYPTD, cryptd_ahash_child, struct crypto_shash *,
+ (struct cryptd_ahash *tfm),
+ (tfm));
+DECLARE_CRYPTO_API(CONFIG_CRYPTO_CRYPTD, cryptd_shash_desc, struct shash_desc *,
+ (struct ahash_request *req),
+ (req));
/* Must be called without moving CPUs. */
-bool cryptd_ahash_queued(struct cryptd_ahash *tfm);
-void cryptd_free_ahash(struct cryptd_ahash *tfm);
+DECLARE_CRYPTO_API(CONFIG_CRYPTO_CRYPTD, cryptd_ahash_queued, bool,
+ (struct cryptd_ahash *tfm),
+ (tfm));
+DECLARE_CRYPTO_API(CONFIG_CRYPTO_CRYPTD, cryptd_free_ahash, void,
+ (struct cryptd_ahash *tfm),
+ (tfm));
struct cryptd_aead {
struct crypto_aead base;
@@ -60,13 +77,20 @@ static inline struct cryptd_aead *__cryptd_aead_cast(
return (struct cryptd_aead *)tfm;
}
-struct cryptd_aead *cryptd_alloc_aead(const char *alg_name,
- u32 type, u32 mask);
+DECLARE_CRYPTO_API(CONFIG_CRYPTO_CRYPTD, cryptd_alloc_aead, struct cryptd_aead *,
+ (const char *alg_name, u32 type, u32 mask),
+ (alg_name, type, mask));
-struct crypto_aead *cryptd_aead_child(struct cryptd_aead *tfm);
+DECLARE_CRYPTO_API(CONFIG_CRYPTO_CRYPTD, cryptd_aead_child, struct crypto_aead *,
+ (struct cryptd_aead *tfm),
+ (tfm));
/* Must be called without moving CPUs. */
-bool cryptd_aead_queued(struct cryptd_aead *tfm);
+DECLARE_CRYPTO_API(CONFIG_CRYPTO_CRYPTD, cryptd_aead_queued, bool,
+ (struct cryptd_aead *tfm),
+ (tfm));
-void cryptd_free_aead(struct cryptd_aead *tfm);
+DECLARE_CRYPTO_API(CONFIG_CRYPTO_CRYPTD, cryptd_free_aead, void,
+ (struct cryptd_aead *tfm),
+ (tfm));
#endif
--
2.47.3
^ permalink raw reply related
* [PATCH 059/106] crypto: convert exported crypto symbol into pluggable interface for CONFIG_CRYPTO_PCRYPT crypto
From: Jay Wang @ 2026-02-12 2:46 UTC (permalink / raw)
To: Herbert Xu, David S . Miller, linux-crypto
Cc: Jay Wang, Vegard Nossum, Nicolai Stange, Ilia Okomin,
Catalin Marinas, Will Deacon, Thomas Gleixner, Ingo Molnar,
Borislav Petkov, Luis Chamberlain, Petr Pavlu, Nathan Chancellor,
Nicolas Schier, linux-arm-kernel, x86, linux-kbuild,
linux-modules
In-Reply-To: <20260212024725.11264-1-wanjay@amazon.com>
From: Vegard Nossum <vegard.nossum@oracle.com>
Apply Crypto API wrappers to the exported crypto symbol in
CONFIG_CRYPTO_PCRYPT-related crypto to convert them into pluggable
interface.
Signed-off-by: Vegard Nossum <vegard.nossum@oracle.com>
[add pcrypt.o into crypto-objs-y; revise commit message]
Signed-off-by: Jay Wang <wanjay@amazon.com>
---
crypto/Makefile | 2 +-
crypto/pcrypt.c | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/crypto/Makefile b/crypto/Makefile
index cb1761303151..b371a8788d39 100644
--- a/crypto/Makefile
+++ b/crypto/Makefile
@@ -124,7 +124,7 @@ endif
# Enable <arm_neon.h>
CFLAGS_aegis128-neon-inner.o += -isystem $(shell $(CC) -print-file-name=include)
-obj-$(CONFIG_CRYPTO_PCRYPT) += pcrypt.o
+crypto-objs-$(CONFIG_CRYPTO_PCRYPT) += pcrypt.o
obj-$(CONFIG_CRYPTO_CRYPTD) += cryptd.o
obj-$(CONFIG_CRYPTO_DES) += des_generic.o
obj-$(CONFIG_CRYPTO_FCRYPT) += fcrypt.o
diff --git a/crypto/pcrypt.c b/crypto/pcrypt.c
index c3a9d4f2995c..b9cf7df64c4e 100644
--- a/crypto/pcrypt.c
+++ b/crypto/pcrypt.c
@@ -378,8 +378,8 @@ static void __exit pcrypt_exit(void)
kset_unregister(pcrypt_kset);
}
-module_init(pcrypt_init);
-module_exit(pcrypt_exit);
+crypto_module_init(pcrypt_init);
+crypto_module_exit(pcrypt_exit);
MODULE_LICENSE("GPL");
MODULE_AUTHOR("Steffen Klassert <steffen.klassert@secunet.com>");
--
2.47.3
^ permalink raw reply related
* [PATCH 058/106] crypto: convert exported crypto symbol into pluggable interface for CONFIG_CRYPTO_AEGIS128 crypto
From: Jay Wang @ 2026-02-12 2:46 UTC (permalink / raw)
To: Herbert Xu, David S . Miller, linux-crypto
Cc: Jay Wang, Vegard Nossum, Nicolai Stange, Ilia Okomin,
Catalin Marinas, Will Deacon, Thomas Gleixner, Ingo Molnar,
Borislav Petkov, Luis Chamberlain, Petr Pavlu, Nathan Chancellor,
Nicolas Schier, linux-arm-kernel, x86, linux-kbuild,
linux-modules
In-Reply-To: <20260212024725.11264-1-wanjay@amazon.com>
Apply Crypto API wrappers to the exported crypto symbol in
CONFIG_CRYPTO_AEGIS128-related crypto to convert them into pluggable
interface.
Signed-off-by: Jay Wang <wanjay@amazon.com>
---
crypto/Makefile | 2 +-
crypto/aegis128-core.c | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/crypto/Makefile b/crypto/Makefile
index f71f2359ce08..cb1761303151 100644
--- a/crypto/Makefile
+++ b/crypto/Makefile
@@ -101,7 +101,7 @@ crypto-objs-$(CONFIG_CRYPTO_ADIANTUM) += adiantum.o
crypto-objs-$(CONFIG_CRYPTO_GCM) += gcm.o
crypto-objs-$(CONFIG_CRYPTO_CCM) += ccm.o
crypto-objs-$(CONFIG_CRYPTO_CHACHA20POLY1305) += chacha20poly1305.o
-obj-$(CONFIG_CRYPTO_AEGIS128) += aegis128.o
+crypto-objs-$(CONFIG_CRYPTO_AEGIS128) += aegis128.o
aegis128-y := aegis128-core.o
ifeq ($(ARCH),arm)
diff --git a/crypto/aegis128-core.c b/crypto/aegis128-core.c
index ca80d861345d..2c8dfafcfdc8 100644
--- a/crypto/aegis128-core.c
+++ b/crypto/aegis128-core.c
@@ -566,8 +566,8 @@ static void __exit crypto_aegis128_module_exit(void)
crypto_unregister_aead(&crypto_aegis128_alg_generic);
}
-module_init(crypto_aegis128_module_init);
-module_exit(crypto_aegis128_module_exit);
+crypto_module_init(crypto_aegis128_module_init);
+crypto_module_exit(crypto_aegis128_module_exit);
MODULE_LICENSE("GPL");
MODULE_AUTHOR("Ondrej Mosnacek <omosnacek@gmail.com>");
--
2.47.3
^ permalink raw reply related
* [PATCH 057/106] crypto: convert exported crypto symbol into pluggable interface for CONFIG_CRYPTO_CHACHA20POLY1305 crypto
From: Jay Wang @ 2026-02-12 2:46 UTC (permalink / raw)
To: Herbert Xu, David S . Miller, linux-crypto
Cc: Jay Wang, Vegard Nossum, Nicolai Stange, Ilia Okomin,
Catalin Marinas, Will Deacon, Thomas Gleixner, Ingo Molnar,
Borislav Petkov, Luis Chamberlain, Petr Pavlu, Nathan Chancellor,
Nicolas Schier, linux-arm-kernel, x86, linux-kbuild,
linux-modules
In-Reply-To: <20260212024725.11264-1-wanjay@amazon.com>
Apply Crypto API wrappers to the exported crypto symbol in
CONFIG_CRYPTO_CHACHA20POLY1305-related crypto to convert them into
pluggable interface.
Signed-off-by: Jay Wang <wanjay@amazon.com>
---
crypto/Makefile | 2 +-
crypto/chacha20poly1305.c | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/crypto/Makefile b/crypto/Makefile
index cb509e854784..f71f2359ce08 100644
--- a/crypto/Makefile
+++ b/crypto/Makefile
@@ -100,7 +100,7 @@ crypto-objs-$(CONFIG_CRYPTO_HCTR2) += hctr2.o
crypto-objs-$(CONFIG_CRYPTO_ADIANTUM) += adiantum.o
crypto-objs-$(CONFIG_CRYPTO_GCM) += gcm.o
crypto-objs-$(CONFIG_CRYPTO_CCM) += ccm.o
-obj-$(CONFIG_CRYPTO_CHACHA20POLY1305) += chacha20poly1305.o
+crypto-objs-$(CONFIG_CRYPTO_CHACHA20POLY1305) += chacha20poly1305.o
obj-$(CONFIG_CRYPTO_AEGIS128) += aegis128.o
aegis128-y := aegis128-core.o
diff --git a/crypto/chacha20poly1305.c b/crypto/chacha20poly1305.c
index b4b5a7198d84..2e5fe0b060af 100644
--- a/crypto/chacha20poly1305.c
+++ b/crypto/chacha20poly1305.c
@@ -476,8 +476,8 @@ static void __exit chacha20poly1305_module_exit(void)
ARRAY_SIZE(rfc7539_tmpls));
}
-module_init(chacha20poly1305_module_init);
-module_exit(chacha20poly1305_module_exit);
+crypto_module_init(chacha20poly1305_module_init);
+crypto_module_exit(chacha20poly1305_module_exit);
MODULE_LICENSE("GPL");
MODULE_AUTHOR("Martin Willi <martin@strongswan.org>");
--
2.47.3
^ permalink raw reply related
* [PATCH 056/106] crypto: convert exported crypto symbol into pluggable interface for CONFIG_CRYPTO_CHACHA20 crypto
From: Jay Wang @ 2026-02-12 2:46 UTC (permalink / raw)
To: Herbert Xu, David S . Miller, linux-crypto
Cc: Jay Wang, Vegard Nossum, Nicolai Stange, Ilia Okomin,
Catalin Marinas, Will Deacon, Thomas Gleixner, Ingo Molnar,
Borislav Petkov, Luis Chamberlain, Petr Pavlu, Nathan Chancellor,
Nicolas Schier, linux-arm-kernel, x86, linux-kbuild,
linux-modules
In-Reply-To: <20260212024725.11264-1-wanjay@amazon.com>
Apply Crypto API wrappers to the exported crypto symbol in
CONFIG_CRYPTO_CHACHA20-related crypto to convert them into pluggable
interface.
Signed-off-by: Jay Wang <wanjay@amazon.com>
---
crypto/Makefile | 2 +-
crypto/chacha.c | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/crypto/Makefile b/crypto/Makefile
index 34e278185d16..cb509e854784 100644
--- a/crypto/Makefile
+++ b/crypto/Makefile
@@ -147,7 +147,7 @@ obj-$(CONFIG_CRYPTO_KHAZAD) += khazad.o
obj-$(CONFIG_CRYPTO_ANUBIS) += anubis.o
obj-$(CONFIG_CRYPTO_SEED) += seed.o
obj-$(CONFIG_CRYPTO_ARIA) += aria_generic.o
-obj-$(CONFIG_CRYPTO_CHACHA20) += chacha.o
+crypto-objs-$(CONFIG_CRYPTO_CHACHA20) += chacha.o
CFLAGS_chacha.o += -DARCH=$(ARCH)
obj-$(CONFIG_CRYPTO_DEFLATE) += deflate.o
obj-$(CONFIG_CRYPTO_MICHAEL_MIC) += michael_mic.o
diff --git a/crypto/chacha.c b/crypto/chacha.c
index ec16d5a33f3c..13335c7e4941 100644
--- a/crypto/chacha.c
+++ b/crypto/chacha.c
@@ -161,8 +161,8 @@ static void __exit crypto_chacha_mod_fini(void)
crypto_unregister_skciphers(algs, ARRAY_SIZE(algs));
}
-module_init(crypto_chacha_mod_init);
-module_exit(crypto_chacha_mod_fini);
+crypto_module_init(crypto_chacha_mod_init);
+crypto_module_exit(crypto_chacha_mod_fini);
MODULE_LICENSE("GPL");
MODULE_AUTHOR("Martin Willi <martin@strongswan.org>");
--
2.47.3
^ permalink raw reply related
* [PATCH 055/106] crypto: convert exported crypto symbol into pluggable interface for CONFIG_CRYPTO_ADIANTUM crypto
From: Jay Wang @ 2026-02-12 2:46 UTC (permalink / raw)
To: Herbert Xu, David S . Miller, linux-crypto
Cc: Jay Wang, Vegard Nossum, Nicolai Stange, Ilia Okomin,
Catalin Marinas, Will Deacon, Thomas Gleixner, Ingo Molnar,
Borislav Petkov, Luis Chamberlain, Petr Pavlu, Nathan Chancellor,
Nicolas Schier, linux-arm-kernel, x86, linux-kbuild,
linux-modules
In-Reply-To: <20260212024725.11264-1-wanjay@amazon.com>
Apply Crypto API wrappers to the exported crypto symbol in
CONFIG_CRYPTO_ADIANTUM-related crypto to convert them into pluggable
interface.
Signed-off-by: Jay Wang <wanjay@amazon.com>
---
crypto/Makefile | 2 +-
crypto/adiantum.c | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/crypto/Makefile b/crypto/Makefile
index c3b0de034a47..34e278185d16 100644
--- a/crypto/Makefile
+++ b/crypto/Makefile
@@ -97,7 +97,7 @@ crypto-objs-$(CONFIG_CRYPTO_XTS) += xts.o
crypto-objs-$(CONFIG_CRYPTO_CTR) += ctr.o
crypto-objs-$(CONFIG_CRYPTO_XCTR) += xctr.o
crypto-objs-$(CONFIG_CRYPTO_HCTR2) += hctr2.o
-obj-$(CONFIG_CRYPTO_ADIANTUM) += adiantum.o
+crypto-objs-$(CONFIG_CRYPTO_ADIANTUM) += adiantum.o
crypto-objs-$(CONFIG_CRYPTO_GCM) += gcm.o
crypto-objs-$(CONFIG_CRYPTO_CCM) += ccm.o
obj-$(CONFIG_CRYPTO_CHACHA20POLY1305) += chacha20poly1305.o
diff --git a/crypto/adiantum.c b/crypto/adiantum.c
index 5ddf585abb66..8e8e8654432c 100644
--- a/crypto/adiantum.c
+++ b/crypto/adiantum.c
@@ -683,8 +683,8 @@ static void __exit adiantum_module_exit(void)
crypto_unregister_template(&adiantum_tmpl);
}
-module_init(adiantum_module_init);
-module_exit(adiantum_module_exit);
+crypto_module_init(adiantum_module_init);
+crypto_module_exit(adiantum_module_exit);
MODULE_DESCRIPTION("Adiantum length-preserving encryption mode");
MODULE_LICENSE("GPL v2");
--
2.47.3
^ permalink raw reply related
* [PATCH 054/106] crypto: convert exported crypto symbol into pluggable interface for CONFIG_CRYPTO_XCTR and CONFIG_CRYPTO_HCTR2 crypto
From: Jay Wang @ 2026-02-12 2:46 UTC (permalink / raw)
To: Herbert Xu, David S . Miller, linux-crypto
Cc: Jay Wang, Vegard Nossum, Nicolai Stange, Ilia Okomin,
Catalin Marinas, Will Deacon, Thomas Gleixner, Ingo Molnar,
Borislav Petkov, Luis Chamberlain, Petr Pavlu, Nathan Chancellor,
Nicolas Schier, linux-arm-kernel, x86, linux-kbuild,
linux-modules
In-Reply-To: <20260212024725.11264-1-wanjay@amazon.com>
Apply Crypto API wrappers to the exported crypto symbol in
CONFIG_CRYPTO_XCTR- and CONFIG_CRYPTO_HCTR2-related crypto to convert
them into pluggable interface.
Signed-off-by: Jay Wang <wanjay@amazon.com>
---
crypto/Makefile | 4 ++--
crypto/hctr2.c | 4 ++--
crypto/xctr.c | 4 ++--
3 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/crypto/Makefile b/crypto/Makefile
index 33e4e3a03c40..c3b0de034a47 100644
--- a/crypto/Makefile
+++ b/crypto/Makefile
@@ -95,8 +95,8 @@ crypto-objs-$(CONFIG_CRYPTO_CTS) += cts.o
crypto-objs-$(CONFIG_CRYPTO_LRW) += lrw.o
crypto-objs-$(CONFIG_CRYPTO_XTS) += xts.o
crypto-objs-$(CONFIG_CRYPTO_CTR) += ctr.o
-obj-$(CONFIG_CRYPTO_XCTR) += xctr.o
-obj-$(CONFIG_CRYPTO_HCTR2) += hctr2.o
+crypto-objs-$(CONFIG_CRYPTO_XCTR) += xctr.o
+crypto-objs-$(CONFIG_CRYPTO_HCTR2) += hctr2.o
obj-$(CONFIG_CRYPTO_ADIANTUM) += adiantum.o
crypto-objs-$(CONFIG_CRYPTO_GCM) += gcm.o
crypto-objs-$(CONFIG_CRYPTO_CCM) += ccm.o
diff --git a/crypto/hctr2.c b/crypto/hctr2.c
index f4cd6c29b4d3..78c0fc9faee5 100644
--- a/crypto/hctr2.c
+++ b/crypto/hctr2.c
@@ -472,8 +472,8 @@ static void __exit hctr2_module_exit(void)
ARRAY_SIZE(hctr2_tmpls));
}
-module_init(hctr2_module_init);
-module_exit(hctr2_module_exit);
+crypto_module_init(hctr2_module_init);
+crypto_module_exit(hctr2_module_exit);
MODULE_DESCRIPTION("HCTR2 length-preserving encryption mode");
MODULE_LICENSE("GPL v2");
diff --git a/crypto/xctr.c b/crypto/xctr.c
index 607ab82cb19b..e3dee674b941 100644
--- a/crypto/xctr.c
+++ b/crypto/xctr.c
@@ -182,8 +182,8 @@ static void __exit crypto_xctr_module_exit(void)
crypto_unregister_template(&crypto_xctr_tmpl);
}
-module_init(crypto_xctr_module_init);
-module_exit(crypto_xctr_module_exit);
+crypto_module_init(crypto_xctr_module_init);
+crypto_module_exit(crypto_xctr_module_exit);
MODULE_LICENSE("GPL");
MODULE_DESCRIPTION("XCTR block cipher mode of operation");
--
2.47.3
^ permalink raw reply related
* [PATCH 053/106] crypto: convert exported crypto symbol into pluggable interface for CONFIG_CRYPTO_XTS crypto
From: Jay Wang @ 2026-02-12 2:46 UTC (permalink / raw)
To: Herbert Xu, David S . Miller, linux-crypto
Cc: Jay Wang, Vegard Nossum, Nicolai Stange, Ilia Okomin,
Catalin Marinas, Will Deacon, Thomas Gleixner, Ingo Molnar,
Borislav Petkov, Luis Chamberlain, Petr Pavlu, Nathan Chancellor,
Nicolas Schier, linux-arm-kernel, x86, linux-kbuild,
linux-modules
In-Reply-To: <20260212024725.11264-1-wanjay@amazon.com>
Apply Crypto API wrappers to the exported crypto symbol in
CONFIG_CRYPTO_XTS-related crypto to convert them into pluggable
interface.
Signed-off-by: Jay Wang <wanjay@amazon.com>
---
crypto/Makefile | 2 +-
crypto/xts.c | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/crypto/Makefile b/crypto/Makefile
index 73c700538792..33e4e3a03c40 100644
--- a/crypto/Makefile
+++ b/crypto/Makefile
@@ -93,7 +93,7 @@ crypto-objs-$(CONFIG_CRYPTO_CBC) += cbc.o
crypto-objs-$(CONFIG_CRYPTO_PCBC) += pcbc.o
crypto-objs-$(CONFIG_CRYPTO_CTS) += cts.o
crypto-objs-$(CONFIG_CRYPTO_LRW) += lrw.o
-obj-$(CONFIG_CRYPTO_XTS) += xts.o
+crypto-objs-$(CONFIG_CRYPTO_XTS) += xts.o
crypto-objs-$(CONFIG_CRYPTO_CTR) += ctr.o
obj-$(CONFIG_CRYPTO_XCTR) += xctr.o
obj-$(CONFIG_CRYPTO_HCTR2) += hctr2.o
diff --git a/crypto/xts.c b/crypto/xts.c
index 3da8f5e053d6..97e499893292 100644
--- a/crypto/xts.c
+++ b/crypto/xts.c
@@ -466,8 +466,8 @@ static void __exit xts_module_exit(void)
crypto_unregister_template(&xts_tmpl);
}
-module_init(xts_module_init);
-module_exit(xts_module_exit);
+crypto_module_init(xts_module_init);
+crypto_module_exit(xts_module_exit);
MODULE_LICENSE("GPL");
MODULE_DESCRIPTION("XTS block cipher mode");
--
2.47.3
^ permalink raw reply related
* [PATCH 052/106] crypto: convert exported crypto symbol into pluggable interface for CONFIG_CRYPTO_LRW crypto
From: Jay Wang @ 2026-02-12 2:46 UTC (permalink / raw)
To: Herbert Xu, David S . Miller, linux-crypto
Cc: Jay Wang, Vegard Nossum, Nicolai Stange, Ilia Okomin,
Catalin Marinas, Will Deacon, Thomas Gleixner, Ingo Molnar,
Borislav Petkov, Luis Chamberlain, Petr Pavlu, Nathan Chancellor,
Nicolas Schier, linux-arm-kernel, x86, linux-kbuild,
linux-modules
In-Reply-To: <20260212024725.11264-1-wanjay@amazon.com>
Apply Crypto API wrappers to the exported crypto symbol in
CONFIG_CRYPTO_LRW-related crypto to convert them into pluggable
interface.
Signed-off-by: Jay Wang <wanjay@amazon.com>
---
crypto/Makefile | 2 +-
crypto/lrw.c | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/crypto/Makefile b/crypto/Makefile
index 9ee71f7c0af7..73c700538792 100644
--- a/crypto/Makefile
+++ b/crypto/Makefile
@@ -92,7 +92,7 @@ crypto-objs-$(CONFIG_CRYPTO_ECB) += ecb.o
crypto-objs-$(CONFIG_CRYPTO_CBC) += cbc.o
crypto-objs-$(CONFIG_CRYPTO_PCBC) += pcbc.o
crypto-objs-$(CONFIG_CRYPTO_CTS) += cts.o
-obj-$(CONFIG_CRYPTO_LRW) += lrw.o
+crypto-objs-$(CONFIG_CRYPTO_LRW) += lrw.o
obj-$(CONFIG_CRYPTO_XTS) += xts.o
crypto-objs-$(CONFIG_CRYPTO_CTR) += ctr.o
obj-$(CONFIG_CRYPTO_XCTR) += xctr.o
diff --git a/crypto/lrw.c b/crypto/lrw.c
index dd403b800513..776f052fa56d 100644
--- a/crypto/lrw.c
+++ b/crypto/lrw.c
@@ -420,8 +420,8 @@ static void __exit lrw_module_exit(void)
crypto_unregister_template(&lrw_tmpl);
}
-module_init(lrw_module_init);
-module_exit(lrw_module_exit);
+crypto_module_init(lrw_module_init);
+crypto_module_exit(lrw_module_exit);
MODULE_LICENSE("GPL");
MODULE_DESCRIPTION("LRW block cipher mode");
--
2.47.3
^ permalink raw reply related
* [PATCH 051/106] crypto: convert exported crypto symbol into pluggable interface for CONFIG_CRYPTO_CTS crypto
From: Jay Wang @ 2026-02-12 2:46 UTC (permalink / raw)
To: Herbert Xu, David S . Miller, linux-crypto
Cc: Jay Wang, Vegard Nossum, Nicolai Stange, Ilia Okomin,
Catalin Marinas, Will Deacon, Thomas Gleixner, Ingo Molnar,
Borislav Petkov, Luis Chamberlain, Petr Pavlu, Nathan Chancellor,
Nicolas Schier, linux-arm-kernel, x86, linux-kbuild,
linux-modules
In-Reply-To: <20260212024725.11264-1-wanjay@amazon.com>
Apply Crypto API wrappers to the exported crypto symbol in
CONFIG_CRYPTO_CTS-related crypto to convert them into pluggable
interface.
Signed-off-by: Jay Wang <wanjay@amazon.com>
---
crypto/Makefile | 2 +-
crypto/cts.c | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/crypto/Makefile b/crypto/Makefile
index 6515459115d8..9ee71f7c0af7 100644
--- a/crypto/Makefile
+++ b/crypto/Makefile
@@ -91,7 +91,7 @@ crypto-objs-$(CONFIG_CRYPTO_BLAKE2B) += blake2b.o
crypto-objs-$(CONFIG_CRYPTO_ECB) += ecb.o
crypto-objs-$(CONFIG_CRYPTO_CBC) += cbc.o
crypto-objs-$(CONFIG_CRYPTO_PCBC) += pcbc.o
-obj-$(CONFIG_CRYPTO_CTS) += cts.o
+crypto-objs-$(CONFIG_CRYPTO_CTS) += cts.o
obj-$(CONFIG_CRYPTO_LRW) += lrw.o
obj-$(CONFIG_CRYPTO_XTS) += xts.o
crypto-objs-$(CONFIG_CRYPTO_CTR) += ctr.o
diff --git a/crypto/cts.c b/crypto/cts.c
index 48898d5e24ff..8b762d0d42cd 100644
--- a/crypto/cts.c
+++ b/crypto/cts.c
@@ -402,8 +402,8 @@ static void __exit crypto_cts_module_exit(void)
crypto_unregister_template(&crypto_cts_tmpl);
}
-module_init(crypto_cts_module_init);
-module_exit(crypto_cts_module_exit);
+crypto_module_init(crypto_cts_module_init);
+crypto_module_exit(crypto_cts_module_exit);
MODULE_LICENSE("Dual BSD/GPL");
MODULE_DESCRIPTION("CTS-CBC CipherText Stealing for CBC");
--
2.47.3
^ permalink raw reply related
* [PATCH 050/106] crypto: convert exported crypto symbol into pluggable interface for CONFIG_CRYPTO_PCBC crypto
From: Jay Wang @ 2026-02-12 2:46 UTC (permalink / raw)
To: Herbert Xu, David S . Miller, linux-crypto
Cc: Jay Wang, Vegard Nossum, Nicolai Stange, Ilia Okomin,
Catalin Marinas, Will Deacon, Thomas Gleixner, Ingo Molnar,
Borislav Petkov, Luis Chamberlain, Petr Pavlu, Nathan Chancellor,
Nicolas Schier, linux-arm-kernel, x86, linux-kbuild,
linux-modules
In-Reply-To: <20260212024725.11264-1-wanjay@amazon.com>
Apply Crypto API wrappers to the exported crypto symbol in
CONFIG_CRYPTO_PCBC-related crypto to convert them into pluggable
interface.
Signed-off-by: Jay Wang <wanjay@amazon.com>
---
crypto/Makefile | 2 +-
crypto/pcbc.c | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/crypto/Makefile b/crypto/Makefile
index dfcfcd0601dd..6515459115d8 100644
--- a/crypto/Makefile
+++ b/crypto/Makefile
@@ -90,7 +90,7 @@ CFLAGS_wp512.o := $(call cc-option,-fno-schedule-insns) # https://gcc.gnu.org/b
crypto-objs-$(CONFIG_CRYPTO_BLAKE2B) += blake2b.o
crypto-objs-$(CONFIG_CRYPTO_ECB) += ecb.o
crypto-objs-$(CONFIG_CRYPTO_CBC) += cbc.o
-obj-$(CONFIG_CRYPTO_PCBC) += pcbc.o
+crypto-objs-$(CONFIG_CRYPTO_PCBC) += pcbc.o
obj-$(CONFIG_CRYPTO_CTS) += cts.o
obj-$(CONFIG_CRYPTO_LRW) += lrw.o
obj-$(CONFIG_CRYPTO_XTS) += xts.o
diff --git a/crypto/pcbc.c b/crypto/pcbc.c
index d092717ea4fc..a0f3e16f049f 100644
--- a/crypto/pcbc.c
+++ b/crypto/pcbc.c
@@ -186,8 +186,8 @@ static void __exit crypto_pcbc_module_exit(void)
crypto_unregister_template(&crypto_pcbc_tmpl);
}
-module_init(crypto_pcbc_module_init);
-module_exit(crypto_pcbc_module_exit);
+crypto_module_init(crypto_pcbc_module_init);
+crypto_module_exit(crypto_pcbc_module_exit);
MODULE_LICENSE("GPL");
MODULE_DESCRIPTION("PCBC block cipher mode of operation");
--
2.47.3
^ permalink raw reply related
* [PATCH 049/106] crypto: convert exported crypto symbol into pluggable interface for CONFIG_CRYPTO_BLAKE2B crypto
From: Jay Wang @ 2026-02-12 2:46 UTC (permalink / raw)
To: Herbert Xu, David S . Miller, linux-crypto
Cc: Jay Wang, Vegard Nossum, Nicolai Stange, Ilia Okomin,
Catalin Marinas, Will Deacon, Thomas Gleixner, Ingo Molnar,
Borislav Petkov, Luis Chamberlain, Petr Pavlu, Nathan Chancellor,
Nicolas Schier, linux-arm-kernel, x86, linux-kbuild,
linux-modules
In-Reply-To: <20260212024725.11264-1-wanjay@amazon.com>
Apply Crypto API wrappers to the exported crypto symbol in
CONFIG_CRYPTO_BLAKE2B-related crypto to convert them into pluggable
interface.
Signed-off-by: Jay Wang <wanjay@amazon.com>
---
crypto/Makefile | 2 +-
crypto/blake2b.c | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/crypto/Makefile b/crypto/Makefile
index 0a0190292dd0..dfcfcd0601dd 100644
--- a/crypto/Makefile
+++ b/crypto/Makefile
@@ -87,7 +87,7 @@ crypto-objs-$(CONFIG_CRYPTO_SM3_GENERIC) += sm3_generic.o
crypto-objs-$(CONFIG_CRYPTO_STREEBOG) += streebog_generic.o
crypto-objs-$(CONFIG_CRYPTO_WP512) += wp512.o
CFLAGS_wp512.o := $(call cc-option,-fno-schedule-insns) # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79149
-obj-$(CONFIG_CRYPTO_BLAKE2B) += blake2b.o
+crypto-objs-$(CONFIG_CRYPTO_BLAKE2B) += blake2b.o
crypto-objs-$(CONFIG_CRYPTO_ECB) += ecb.o
crypto-objs-$(CONFIG_CRYPTO_CBC) += cbc.o
obj-$(CONFIG_CRYPTO_PCBC) += pcbc.o
diff --git a/crypto/blake2b.c b/crypto/blake2b.c
index 67a6dae43a54..74a2706aa7be 100644
--- a/crypto/blake2b.c
+++ b/crypto/blake2b.c
@@ -90,13 +90,13 @@ static int __init crypto_blake2b_mod_init(void)
{
return crypto_register_shashes(algs, ARRAY_SIZE(algs));
}
-module_init(crypto_blake2b_mod_init);
+crypto_module_init(crypto_blake2b_mod_init);
static void __exit crypto_blake2b_mod_exit(void)
{
crypto_unregister_shashes(algs, ARRAY_SIZE(algs));
}
-module_exit(crypto_blake2b_mod_exit);
+crypto_module_exit(crypto_blake2b_mod_exit);
MODULE_LICENSE("GPL");
MODULE_DESCRIPTION("Crypto API support for BLAKE2b");
--
2.47.3
^ permalink raw reply related
* [PATCH 048/106] crypto: convert exported crypto symbol into pluggable interface for CONFIG_CRYPTO_WP512 crypto
From: Jay Wang @ 2026-02-12 2:46 UTC (permalink / raw)
To: Herbert Xu, David S . Miller, linux-crypto
Cc: Jay Wang, Vegard Nossum, Nicolai Stange, Ilia Okomin,
Catalin Marinas, Will Deacon, Thomas Gleixner, Ingo Molnar,
Borislav Petkov, Luis Chamberlain, Petr Pavlu, Nathan Chancellor,
Nicolas Schier, linux-arm-kernel, x86, linux-kbuild,
linux-modules
In-Reply-To: <20260212024725.11264-1-wanjay@amazon.com>
Apply Crypto API wrappers to the exported crypto symbol in
CONFIG_CRYPTO_WP512-related crypto to convert them into pluggable
interface.
Signed-off-by: Jay Wang <wanjay@amazon.com>
---
crypto/Makefile | 2 +-
crypto/wp512.c | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/crypto/Makefile b/crypto/Makefile
index c83ad9bb4324..0a0190292dd0 100644
--- a/crypto/Makefile
+++ b/crypto/Makefile
@@ -85,7 +85,7 @@ crypto-objs-$(CONFIG_CRYPTO_SHA512) += sha512.o
crypto-objs-$(CONFIG_CRYPTO_SHA3) += sha3.o
crypto-objs-$(CONFIG_CRYPTO_SM3_GENERIC) += sm3_generic.o
crypto-objs-$(CONFIG_CRYPTO_STREEBOG) += streebog_generic.o
-obj-$(CONFIG_CRYPTO_WP512) += wp512.o
+crypto-objs-$(CONFIG_CRYPTO_WP512) += wp512.o
CFLAGS_wp512.o := $(call cc-option,-fno-schedule-insns) # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79149
obj-$(CONFIG_CRYPTO_BLAKE2B) += blake2b.o
crypto-objs-$(CONFIG_CRYPTO_ECB) += ecb.o
diff --git a/crypto/wp512.c b/crypto/wp512.c
index 229b189a7988..2d76d4639d44 100644
--- a/crypto/wp512.c
+++ b/crypto/wp512.c
@@ -1138,8 +1138,8 @@ MODULE_ALIAS_CRYPTO("wp512");
MODULE_ALIAS_CRYPTO("wp384");
MODULE_ALIAS_CRYPTO("wp256");
-module_init(wp512_mod_init);
-module_exit(wp512_mod_fini);
+crypto_module_init(wp512_mod_init);
+crypto_module_exit(wp512_mod_fini);
MODULE_LICENSE("GPL");
MODULE_DESCRIPTION("Whirlpool Message Digest Algorithm");
--
2.47.3
^ permalink raw reply related
* [PATCH 047/106] crypto: convert exported crypto symbol into pluggable interface for CONFIG_CRYPTO_STREEBOG crypto
From: Jay Wang @ 2026-02-12 2:46 UTC (permalink / raw)
To: Herbert Xu, David S . Miller, linux-crypto
Cc: Jay Wang, Vegard Nossum, Nicolai Stange, Ilia Okomin,
Catalin Marinas, Will Deacon, Thomas Gleixner, Ingo Molnar,
Borislav Petkov, Luis Chamberlain, Petr Pavlu, Nathan Chancellor,
Nicolas Schier, linux-arm-kernel, x86, linux-kbuild,
linux-modules
In-Reply-To: <20260212024725.11264-1-wanjay@amazon.com>
Apply Crypto API wrappers to the exported crypto symbol in
CONFIG_CRYPTO_STREEBOG-related crypto to convert them into pluggable
interface.
Signed-off-by: Jay Wang <wanjay@amazon.com>
---
crypto/Makefile | 2 +-
crypto/streebog_generic.c | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/crypto/Makefile b/crypto/Makefile
index 64df3408cca0..c83ad9bb4324 100644
--- a/crypto/Makefile
+++ b/crypto/Makefile
@@ -84,7 +84,7 @@ crypto-objs-$(CONFIG_CRYPTO_SHA256) += sha256.o
crypto-objs-$(CONFIG_CRYPTO_SHA512) += sha512.o
crypto-objs-$(CONFIG_CRYPTO_SHA3) += sha3.o
crypto-objs-$(CONFIG_CRYPTO_SM3_GENERIC) += sm3_generic.o
-obj-$(CONFIG_CRYPTO_STREEBOG) += streebog_generic.o
+crypto-objs-$(CONFIG_CRYPTO_STREEBOG) += streebog_generic.o
obj-$(CONFIG_CRYPTO_WP512) += wp512.o
CFLAGS_wp512.o := $(call cc-option,-fno-schedule-insns) # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79149
obj-$(CONFIG_CRYPTO_BLAKE2B) += blake2b.o
diff --git a/crypto/streebog_generic.c b/crypto/streebog_generic.c
index 57bbf70f4c22..1ed42a26bec9 100644
--- a/crypto/streebog_generic.c
+++ b/crypto/streebog_generic.c
@@ -1061,8 +1061,8 @@ static void __exit streebog_mod_fini(void)
crypto_unregister_shashes(algs, ARRAY_SIZE(algs));
}
-module_init(streebog_mod_init);
-module_exit(streebog_mod_fini);
+crypto_module_init(streebog_mod_init);
+crypto_module_exit(streebog_mod_fini);
MODULE_LICENSE("GPL");
MODULE_AUTHOR("Vitaly Chikunov <vt@altlinux.org>");
--
2.47.3
^ permalink raw reply related
* [PATCH 046/106] crypto: convert exported crypto symbol into pluggable interface for CONFIG_CRYPTO_SM3_GENERIC crypto
From: Jay Wang @ 2026-02-12 2:46 UTC (permalink / raw)
To: Herbert Xu, David S . Miller, linux-crypto
Cc: Jay Wang, Vegard Nossum, Nicolai Stange, Ilia Okomin,
Catalin Marinas, Will Deacon, Thomas Gleixner, Ingo Molnar,
Borislav Petkov, Luis Chamberlain, Petr Pavlu, Nathan Chancellor,
Nicolas Schier, linux-arm-kernel, x86, linux-kbuild,
linux-modules
In-Reply-To: <20260212024725.11264-1-wanjay@amazon.com>
Apply Crypto API wrappers to the exported crypto symbol in
CONFIG_CRYPTO_SM3_GENERIC-related crypto to convert them into pluggable
interface.
Signed-off-by: Jay Wang <wanjay@amazon.com>
---
crypto/Makefile | 2 +-
crypto/sm3_generic.c | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/crypto/Makefile b/crypto/Makefile
index ba7bc1e3a65a..64df3408cca0 100644
--- a/crypto/Makefile
+++ b/crypto/Makefile
@@ -83,7 +83,7 @@ crypto-objs-$(CONFIG_CRYPTO_SHA1) += sha1.o
crypto-objs-$(CONFIG_CRYPTO_SHA256) += sha256.o
crypto-objs-$(CONFIG_CRYPTO_SHA512) += sha512.o
crypto-objs-$(CONFIG_CRYPTO_SHA3) += sha3.o
-obj-$(CONFIG_CRYPTO_SM3_GENERIC) += sm3_generic.o
+crypto-objs-$(CONFIG_CRYPTO_SM3_GENERIC) += sm3_generic.o
obj-$(CONFIG_CRYPTO_STREEBOG) += streebog_generic.o
obj-$(CONFIG_CRYPTO_WP512) += wp512.o
CFLAGS_wp512.o := $(call cc-option,-fno-schedule-insns) # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79149
diff --git a/crypto/sm3_generic.c b/crypto/sm3_generic.c
index 7529139fcc96..90e75d3576d2 100644
--- a/crypto/sm3_generic.c
+++ b/crypto/sm3_generic.c
@@ -62,8 +62,8 @@ static void __exit sm3_generic_mod_fini(void)
crypto_unregister_shash(&sm3_alg);
}
-module_init(sm3_generic_mod_init);
-module_exit(sm3_generic_mod_fini);
+crypto_module_init(sm3_generic_mod_init);
+crypto_module_exit(sm3_generic_mod_fini);
MODULE_LICENSE("GPL v2");
MODULE_DESCRIPTION("SM3 Secure Hash Algorithm");
--
2.47.3
^ permalink raw reply related
* [PATCH 045/106] crypto: convert exported crypto symbol into pluggable interface for CONFIG_CRYPTO_SHA1 crypto
From: Jay Wang @ 2026-02-12 2:46 UTC (permalink / raw)
To: Herbert Xu, David S . Miller, linux-crypto
Cc: Jay Wang, Vegard Nossum, Nicolai Stange, Ilia Okomin,
Catalin Marinas, Will Deacon, Thomas Gleixner, Ingo Molnar,
Borislav Petkov, Luis Chamberlain, Petr Pavlu, Nathan Chancellor,
Nicolas Schier, linux-arm-kernel, x86, linux-kbuild,
linux-modules
In-Reply-To: <20260212024725.11264-1-wanjay@amazon.com>
Apply Crypto API wrappers to the exported crypto symbol in
CONFIG_CRYPTO_SHA1-related crypto to convert them into pluggable
interface.
Co-developed-by: Vegard Nossum <vegard.nossum@oracle.com>
Signed-off-by: Jay Wang <wanjay@amazon.com>
---
crypto/Makefile | 2 +-
crypto/sha1.c | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/crypto/Makefile b/crypto/Makefile
index 45f0ae639ccd..ba7bc1e3a65a 100644
--- a/crypto/Makefile
+++ b/crypto/Makefile
@@ -79,7 +79,7 @@ crypto-objs-$(CONFIG_CRYPTO_NULL) += crypto_null.o
crypto-objs-$(CONFIG_CRYPTO_MD4) += md4.o
crypto-objs-$(CONFIG_CRYPTO_MD5) += md5.o
crypto-objs-$(CONFIG_CRYPTO_RMD160) += rmd160.o
-obj-$(CONFIG_CRYPTO_SHA1) += sha1.o
+crypto-objs-$(CONFIG_CRYPTO_SHA1) += sha1.o
crypto-objs-$(CONFIG_CRYPTO_SHA256) += sha256.o
crypto-objs-$(CONFIG_CRYPTO_SHA512) += sha512.o
crypto-objs-$(CONFIG_CRYPTO_SHA3) += sha3.o
diff --git a/crypto/sha1.c b/crypto/sha1.c
index 4fbf61cf0370..fe7028d018a8 100644
--- a/crypto/sha1.c
+++ b/crypto/sha1.c
@@ -223,13 +223,13 @@ static int __init crypto_sha1_mod_init(void)
{
return crypto_register_shashes(algs, ARRAY_SIZE(algs));
}
-module_init(crypto_sha1_mod_init);
+crypto_module_init(crypto_sha1_mod_init);
static void __exit crypto_sha1_mod_exit(void)
{
crypto_unregister_shashes(algs, ARRAY_SIZE(algs));
}
-module_exit(crypto_sha1_mod_exit);
+crypto_module_exit(crypto_sha1_mod_exit);
MODULE_LICENSE("GPL");
MODULE_DESCRIPTION("Crypto API support for SHA-1 and HMAC-SHA1");
--
2.47.3
^ permalink raw reply related
* [PATCH 044/106] crypto: convert exported crypto symbol into pluggable interface for CONFIG_CRYPTO_RMD160 crypto
From: Jay Wang @ 2026-02-12 2:46 UTC (permalink / raw)
To: Herbert Xu, David S . Miller, linux-crypto
Cc: Jay Wang, Vegard Nossum, Nicolai Stange, Ilia Okomin,
Catalin Marinas, Will Deacon, Thomas Gleixner, Ingo Molnar,
Borislav Petkov, Luis Chamberlain, Petr Pavlu, Nathan Chancellor,
Nicolas Schier, linux-arm-kernel, x86, linux-kbuild,
linux-modules
In-Reply-To: <20260212024725.11264-1-wanjay@amazon.com>
Apply Crypto API wrappers to the exported crypto symbol in
CONFIG_CRYPTO_RMD160-related crypto to convert them into pluggable
interface.
Signed-off-by: Jay Wang <wanjay@amazon.com>
---
crypto/Makefile | 2 +-
crypto/rmd160.c | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/crypto/Makefile b/crypto/Makefile
index 32f038ff47de..45f0ae639ccd 100644
--- a/crypto/Makefile
+++ b/crypto/Makefile
@@ -78,7 +78,7 @@ crypto-objs-$(CONFIG_CRYPTO_XCBC) += xcbc.o
crypto-objs-$(CONFIG_CRYPTO_NULL) += crypto_null.o
crypto-objs-$(CONFIG_CRYPTO_MD4) += md4.o
crypto-objs-$(CONFIG_CRYPTO_MD5) += md5.o
-obj-$(CONFIG_CRYPTO_RMD160) += rmd160.o
+crypto-objs-$(CONFIG_CRYPTO_RMD160) += rmd160.o
obj-$(CONFIG_CRYPTO_SHA1) += sha1.o
crypto-objs-$(CONFIG_CRYPTO_SHA256) += sha256.o
crypto-objs-$(CONFIG_CRYPTO_SHA512) += sha512.o
diff --git a/crypto/rmd160.c b/crypto/rmd160.c
index 9860b60c9be4..0d68e7b763d8 100644
--- a/crypto/rmd160.c
+++ b/crypto/rmd160.c
@@ -342,8 +342,8 @@ static void __exit rmd160_mod_fini(void)
crypto_unregister_shash(&alg);
}
-module_init(rmd160_mod_init);
-module_exit(rmd160_mod_fini);
+crypto_module_init(rmd160_mod_init);
+crypto_module_exit(rmd160_mod_fini);
MODULE_LICENSE("GPL");
MODULE_AUTHOR("Adrian-Ken Rueegsegger <ken@codelabs.ch>");
--
2.47.3
^ permalink raw reply related
* [PATCH 043/106] crypto: convert exported crypto symbol into pluggable interface for CONFIG_CRYPTO_MD4 crypto
From: Jay Wang @ 2026-02-12 2:46 UTC (permalink / raw)
To: Herbert Xu, David S . Miller, linux-crypto
Cc: Jay Wang, Vegard Nossum, Nicolai Stange, Ilia Okomin,
Catalin Marinas, Will Deacon, Thomas Gleixner, Ingo Molnar,
Borislav Petkov, Luis Chamberlain, Petr Pavlu, Nathan Chancellor,
Nicolas Schier, linux-arm-kernel, x86, linux-kbuild,
linux-modules
In-Reply-To: <20260212024725.11264-1-wanjay@amazon.com>
Apply Crypto API wrappers to the exported crypto symbol in
CONFIG_CRYPTO_MD4-related crypto to convert them into pluggable
interface.
Signed-off-by: Jay Wang <wanjay@amazon.com>
---
crypto/Makefile | 2 +-
crypto/md4.c | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/crypto/Makefile b/crypto/Makefile
index 6d1077d11538..32f038ff47de 100644
--- a/crypto/Makefile
+++ b/crypto/Makefile
@@ -76,7 +76,7 @@ crypto-objs-$(CONFIG_CRYPTO_CMAC) += cmac.o
crypto-objs-$(CONFIG_CRYPTO_HMAC) += hmac.o
crypto-objs-$(CONFIG_CRYPTO_XCBC) += xcbc.o
crypto-objs-$(CONFIG_CRYPTO_NULL) += crypto_null.o
-obj-$(CONFIG_CRYPTO_MD4) += md4.o
+crypto-objs-$(CONFIG_CRYPTO_MD4) += md4.o
crypto-objs-$(CONFIG_CRYPTO_MD5) += md5.o
obj-$(CONFIG_CRYPTO_RMD160) += rmd160.o
obj-$(CONFIG_CRYPTO_SHA1) += sha1.o
diff --git a/crypto/md4.c b/crypto/md4.c
index 55bf47e23c13..04a7ce7eb460 100644
--- a/crypto/md4.c
+++ b/crypto/md4.c
@@ -233,8 +233,8 @@ static void __exit md4_mod_fini(void)
crypto_unregister_shash(&alg);
}
-module_init(md4_mod_init);
-module_exit(md4_mod_fini);
+crypto_module_init(md4_mod_init);
+crypto_module_exit(md4_mod_fini);
MODULE_LICENSE("GPL");
MODULE_DESCRIPTION("MD4 Message Digest Algorithm");
--
2.47.3
^ permalink raw reply related
* [PATCH 042/106] crypto: convert exported crypto symbol into pluggable interface for CONFIG_CRYPTO_NULL crypto
From: Jay Wang @ 2026-02-12 2:46 UTC (permalink / raw)
To: Herbert Xu, David S . Miller, linux-crypto
Cc: Jay Wang, Vegard Nossum, Nicolai Stange, Ilia Okomin,
Catalin Marinas, Will Deacon, Thomas Gleixner, Ingo Molnar,
Borislav Petkov, Luis Chamberlain, Petr Pavlu, Nathan Chancellor,
Nicolas Schier, linux-arm-kernel, x86, linux-kbuild,
linux-modules
In-Reply-To: <20260212024725.11264-1-wanjay@amazon.com>
Apply Crypto API wrappers to the exported crypto symbol in
CONFIG_CRYPTO_NULL-related crypto to convert them into pluggable
interface.
Signed-off-by: Jay Wang <wanjay@amazon.com>
---
crypto/Makefile | 2 +-
crypto/crypto_null.c | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/crypto/Makefile b/crypto/Makefile
index c98e6a397159..6d1077d11538 100644
--- a/crypto/Makefile
+++ b/crypto/Makefile
@@ -75,7 +75,7 @@ crypto-objs-$(CONFIG_CRYPTO_USER) += crypto_user.o
crypto-objs-$(CONFIG_CRYPTO_CMAC) += cmac.o
crypto-objs-$(CONFIG_CRYPTO_HMAC) += hmac.o
crypto-objs-$(CONFIG_CRYPTO_XCBC) += xcbc.o
-obj-$(CONFIG_CRYPTO_NULL) += crypto_null.o
+crypto-objs-$(CONFIG_CRYPTO_NULL) += crypto_null.o
obj-$(CONFIG_CRYPTO_MD4) += md4.o
crypto-objs-$(CONFIG_CRYPTO_MD5) += md5.o
obj-$(CONFIG_CRYPTO_RMD160) += rmd160.o
diff --git a/crypto/crypto_null.c b/crypto/crypto_null.c
index 34588f39fdfc..e2245e691585 100644
--- a/crypto/crypto_null.c
+++ b/crypto/crypto_null.c
@@ -148,8 +148,8 @@ static void __exit crypto_null_mod_fini(void)
crypto_unregister_skcipher(&skcipher_null);
}
-module_init(crypto_null_mod_init);
-module_exit(crypto_null_mod_fini);
+crypto_module_init(crypto_null_mod_init);
+crypto_module_exit(crypto_null_mod_fini);
MODULE_LICENSE("GPL");
MODULE_DESCRIPTION("Null Cryptographic Algorithms");
--
2.47.3
^ permalink raw reply related
* [PATCH 041/106] crypto: convert exported crypto symbol into pluggable interface for CONFIG_CRYPTO_XCBC crypto
From: Jay Wang @ 2026-02-12 2:46 UTC (permalink / raw)
To: Herbert Xu, David S . Miller, linux-crypto
Cc: Jay Wang, Vegard Nossum, Nicolai Stange, Ilia Okomin,
Catalin Marinas, Will Deacon, Thomas Gleixner, Ingo Molnar,
Borislav Petkov, Luis Chamberlain, Petr Pavlu, Nathan Chancellor,
Nicolas Schier, linux-arm-kernel, x86, linux-kbuild,
linux-modules
In-Reply-To: <20260212024725.11264-1-wanjay@amazon.com>
Apply Crypto API wrappers to the exported crypto symbol in
CONFIG_CRYPTO_XCBC-related crypto to convert them into pluggable
interface.
Signed-off-by: Jay Wang <wanjay@amazon.com>
---
crypto/Makefile | 2 +-
crypto/xcbc.c | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/crypto/Makefile b/crypto/Makefile
index 390d38d17e4b..c98e6a397159 100644
--- a/crypto/Makefile
+++ b/crypto/Makefile
@@ -74,7 +74,7 @@ crypto-objs-$(CONFIG_CRYPTO_MANAGER2) += cryptomgr.o
crypto-objs-$(CONFIG_CRYPTO_USER) += crypto_user.o
crypto-objs-$(CONFIG_CRYPTO_CMAC) += cmac.o
crypto-objs-$(CONFIG_CRYPTO_HMAC) += hmac.o
-obj-$(CONFIG_CRYPTO_XCBC) += xcbc.o
+crypto-objs-$(CONFIG_CRYPTO_XCBC) += xcbc.o
obj-$(CONFIG_CRYPTO_NULL) += crypto_null.o
obj-$(CONFIG_CRYPTO_MD4) += md4.o
crypto-objs-$(CONFIG_CRYPTO_MD5) += md5.o
diff --git a/crypto/xcbc.c b/crypto/xcbc.c
index 6c5f6766fdd6..90da46fe3bb7 100644
--- a/crypto/xcbc.c
+++ b/crypto/xcbc.c
@@ -199,8 +199,8 @@ static void __exit crypto_xcbc_module_exit(void)
crypto_unregister_template(&crypto_xcbc_tmpl);
}
-module_init(crypto_xcbc_module_init);
-module_exit(crypto_xcbc_module_exit);
+crypto_module_init(crypto_xcbc_module_init);
+crypto_module_exit(crypto_xcbc_module_exit);
MODULE_LICENSE("GPL");
MODULE_DESCRIPTION("XCBC keyed hash algorithm");
--
2.47.3
^ permalink raw reply related
* [PATCH 040/106] crypto: convert exported crypto symbol into pluggable interface for CONFIG_CRYPTO_USER crypto
From: Jay Wang @ 2026-02-12 2:46 UTC (permalink / raw)
To: Herbert Xu, David S . Miller, linux-crypto
Cc: Jay Wang, Vegard Nossum, Nicolai Stange, Ilia Okomin,
Catalin Marinas, Will Deacon, Thomas Gleixner, Ingo Molnar,
Borislav Petkov, Luis Chamberlain, Petr Pavlu, Nathan Chancellor,
Nicolas Schier, linux-arm-kernel, x86, linux-kbuild,
linux-modules
In-Reply-To: <20260212024725.11264-1-wanjay@amazon.com>
Apply Crypto API wrappers to the exported crypto symbol in
CONFIG_CRYPTO_USER-related crypto to convert them into pluggable
interface.
Signed-off-by: Jay Wang <wanjay@amazon.com>
---
crypto/Makefile | 2 +-
crypto/crypto_user.c | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/crypto/Makefile b/crypto/Makefile
index 2e3704e67e14..390d38d17e4b 100644
--- a/crypto/Makefile
+++ b/crypto/Makefile
@@ -71,7 +71,7 @@ crypto-objs-$(CONFIG_CRYPTO_ACOMP2) += crypto_acompress.o
cryptomgr-y := algboss.o testmgr.o
crypto-objs-$(CONFIG_CRYPTO_MANAGER2) += cryptomgr.o
-obj-$(CONFIG_CRYPTO_USER) += crypto_user.o
+crypto-objs-$(CONFIG_CRYPTO_USER) += crypto_user.o
crypto-objs-$(CONFIG_CRYPTO_CMAC) += cmac.o
crypto-objs-$(CONFIG_CRYPTO_HMAC) += hmac.o
obj-$(CONFIG_CRYPTO_XCBC) += xcbc.o
diff --git a/crypto/crypto_user.c b/crypto/crypto_user.c
index 3187e0d276f9..8d03a2ff24de 100644
--- a/crypto/crypto_user.c
+++ b/crypto/crypto_user.c
@@ -498,8 +498,8 @@ static void __exit crypto_user_exit(void)
unregister_pernet_subsys(&crypto_netlink_net_ops);
}
-module_init(crypto_user_init);
-module_exit(crypto_user_exit);
+crypto_module_init(crypto_user_init);
+crypto_module_exit(crypto_user_exit);
MODULE_LICENSE("GPL");
MODULE_AUTHOR("Steffen Klassert <steffen.klassert@secunet.com>");
MODULE_DESCRIPTION("Crypto userspace configuration API");
--
2.47.3
^ permalink raw reply related
* [PATCH 039/106] crypto: convert exported crypto symbol into pluggable interface for CONFIG_CRYPTO_ECDSA and CONFIG_CRYPTO_ECC crypto
From: Jay Wang @ 2026-02-12 2:46 UTC (permalink / raw)
To: Herbert Xu, David S . Miller, linux-crypto
Cc: Jay Wang, Vegard Nossum, Nicolai Stange, Ilia Okomin,
Catalin Marinas, Will Deacon, Thomas Gleixner, Ingo Molnar,
Borislav Petkov, Luis Chamberlain, Petr Pavlu, Nathan Chancellor,
Nicolas Schier, linux-arm-kernel, x86, linux-kbuild,
linux-modules
In-Reply-To: <20260212024725.11264-1-wanjay@amazon.com>
Apply Crypto API wrappers to the exported crypto symbol in
CONFIG_CRYPTO_ECDSA- and CONFIG_CRYPTO_ECC-related crypto to convert
them into pluggable interface.
This patch is partially based on work by Vegard Nossum, with
modifications. Unlike the original, we do not include
DEFINE_CRYPTO_API since only one copy of the crypto symbols is
kept, either in the crypto module or in the main kernel, and we ensure
such wrapper do not have impact on crypto already chosen built as
module.
Co-developed-by: Vegard Nossum <vegard.nossum@oracle.com>
Signed-off-by: Jay Wang <wanjay@amazon.com>
---
crypto/Makefile | 4 +-
crypto/ecdsa.c | 4 +-
crypto/fips140/fips140-api.c | 33 +++++++++++++
include/crypto/ecc_curve.h | 9 +++-
include/crypto/internal/ecc.h | 91 ++++++++++++++++++++++-------------
5 files changed, 102 insertions(+), 39 deletions(-)
diff --git a/crypto/Makefile b/crypto/Makefile
index 7b1188d5d953..2e3704e67e14 100644
--- a/crypto/Makefile
+++ b/crypto/Makefile
@@ -60,7 +60,7 @@ ecdsa_generic-y += ecdsa.o
ecdsa_generic-y += ecdsa-x962.o
ecdsa_generic-y += ecdsa-p1363.o
ecdsa_generic-y += ecdsasignature.asn1.o
-obj-$(CONFIG_CRYPTO_ECDSA) += ecdsa_generic.o
+crypto-objs-$(CONFIG_CRYPTO_ECDSA) += ecdsa_generic.o
obj-$(CONFIG_CRYPTO_MLDSA) += mldsa.o
@@ -178,7 +178,7 @@ obj-$(CONFIG_CRYPTO_USER_API_SKCIPHER) += algif_skcipher.o
obj-$(CONFIG_CRYPTO_USER_API_RNG) += algif_rng.o
obj-$(CONFIG_CRYPTO_USER_API_AEAD) += algif_aead.o
obj-$(CONFIG_CRYPTO_ZSTD) += zstd.o
-obj-$(CONFIG_CRYPTO_ECC) += ecc.o
+crypto-objs-$(CONFIG_CRYPTO_ECC) += ecc.o
obj-$(CONFIG_CRYPTO_ESSIV) += essiv.o
ecdh_generic-y += ecdh.o
diff --git a/crypto/ecdsa.c b/crypto/ecdsa.c
index ce8e4364842f..64903419e6db 100644
--- a/crypto/ecdsa.c
+++ b/crypto/ecdsa.c
@@ -334,8 +334,8 @@ static void __exit ecdsa_exit(void)
crypto_unregister_sig(&ecdsa_nist_p521);
}
-module_init(ecdsa_init);
-module_exit(ecdsa_exit);
+crypto_module_init(ecdsa_init);
+crypto_module_exit(ecdsa_exit);
MODULE_LICENSE("GPL");
MODULE_AUTHOR("Stefan Berger <stefanb@linux.ibm.com>");
diff --git a/crypto/fips140/fips140-api.c b/crypto/fips140/fips140-api.c
index 0b1794340b77..3c6dfcac5db5 100644
--- a/crypto/fips140/fips140-api.c
+++ b/crypto/fips140/fips140-api.c
@@ -589,3 +589,36 @@ DEFINE_CRYPTO_API_STUB(crypto_dh_encode_key);
DEFINE_CRYPTO_API_STUB(crypto_dh_decode_key);
#endif
+/*
+ * crypto/ecc.c
+ */
+#if IS_BUILTIN(CONFIG_CRYPTO_ECC)
+
+#include <crypto/ecc_curve.h>
+
+DEFINE_CRYPTO_API_STUB(ecc_get_curve);
+DEFINE_CRYPTO_API_STUB(ecc_get_curve25519);
+
+#include <crypto/internal/ecc.h>
+
+DEFINE_CRYPTO_API_STUB(ecc_digits_from_bytes);
+DEFINE_CRYPTO_API_STUB(ecc_is_key_valid);
+DEFINE_CRYPTO_API_STUB(ecc_gen_privkey);
+DEFINE_CRYPTO_API_STUB(ecc_make_pub_key);
+DEFINE_CRYPTO_API_STUB(crypto_ecdh_shared_secret);
+DEFINE_CRYPTO_API_STUB(ecc_is_pubkey_valid_partial);
+DEFINE_CRYPTO_API_STUB(ecc_is_pubkey_valid_full);
+DEFINE_CRYPTO_API_STUB(vli_is_zero);
+DEFINE_CRYPTO_API_STUB(vli_cmp);
+DEFINE_CRYPTO_API_STUB(vli_sub);
+DEFINE_CRYPTO_API_STUB(vli_from_be64);
+DEFINE_CRYPTO_API_STUB(vli_from_le64);
+DEFINE_CRYPTO_API_STUB(vli_mod_inv);
+DEFINE_CRYPTO_API_STUB(vli_mod_mult_slow);
+DEFINE_CRYPTO_API_STUB(vli_num_bits);
+DEFINE_CRYPTO_API_STUB(ecc_alloc_point);
+DEFINE_CRYPTO_API_STUB(ecc_free_point);
+DEFINE_CRYPTO_API_STUB(ecc_point_is_zero);
+DEFINE_CRYPTO_API_STUB(ecc_point_mult_shamir);
+
+#endif
diff --git a/include/crypto/ecc_curve.h b/include/crypto/ecc_curve.h
index 7d90c5e82266..f0804215de69 100644
--- a/include/crypto/ecc_curve.h
+++ b/include/crypto/ecc_curve.h
@@ -4,6 +4,7 @@
#ifndef _CRYTO_ECC_CURVE_H
#define _CRYTO_ECC_CURVE_H
+#include <crypto/api.h>
#include <linux/types.h>
/**
@@ -50,13 +51,17 @@ struct ecc_curve {
*
* Returns curve if get curve succssful, NULL otherwise
*/
-const struct ecc_curve *ecc_get_curve(unsigned int curve_id);
+DECLARE_CRYPTO_API(CONFIG_CRYPTO_ECC, ecc_get_curve, const struct ecc_curve *,
+ (unsigned int curve_id),
+ (curve_id));
/**
* ecc_get_curve25519() - get curve25519 curve;
*
* Returns curve25519
*/
-const struct ecc_curve *ecc_get_curve25519(void);
+DECLARE_CRYPTO_API(CONFIG_CRYPTO_ECC, ecc_get_curve25519, const struct ecc_curve *,
+ (void),
+ ());
#endif
diff --git a/include/crypto/internal/ecc.h b/include/crypto/internal/ecc.h
index 57cd75242141..0325d4edf82a 100644
--- a/include/crypto/internal/ecc.h
+++ b/include/crypto/internal/ecc.h
@@ -26,6 +26,7 @@
#ifndef _CRYPTO_ECC_H
#define _CRYPTO_ECC_H
+#include <crypto/api.h>
#include <crypto/ecc_curve.h>
#include <linux/unaligned.h>
@@ -79,8 +80,9 @@ static inline void ecc_swap_digits(const void *in, u64 *out, unsigned int ndigit
* The first byte in the input byte array is expected to hold the most
* significant bits of the large integer.
*/
-void ecc_digits_from_bytes(const u8 *in, unsigned int nbytes,
- u64 *out, unsigned int ndigits);
+DECLARE_CRYPTO_API(CONFIG_CRYPTO_ECC, ecc_digits_from_bytes, void,
+ (const u8 *in, unsigned int nbytes, u64 *out, unsigned int ndigits),
+ (in, nbytes, out, ndigits));
/**
* ecc_is_key_valid() - Validate a given ECDH private key
@@ -92,8 +94,9 @@ void ecc_digits_from_bytes(const u8 *in, unsigned int nbytes,
*
* Returns 0 if the key is acceptable, a negative value otherwise
*/
-int ecc_is_key_valid(unsigned int curve_id, unsigned int ndigits,
- const u64 *private_key, unsigned int private_key_len);
+DECLARE_CRYPTO_API(CONFIG_CRYPTO_ECC, ecc_is_key_valid, int,
+ (unsigned int curve_id, unsigned int ndigits, const u64 *private_key, unsigned int private_key_len),
+ (curve_id, ndigits, private_key, private_key_len));
/**
* ecc_gen_privkey() - Generates an ECC private key.
@@ -107,8 +110,9 @@ int ecc_is_key_valid(unsigned int curve_id, unsigned int ndigits,
* Returns 0 if the private key was generated successfully, a negative value
* if an error occurred.
*/
-int ecc_gen_privkey(unsigned int curve_id, unsigned int ndigits,
- u64 *private_key);
+DECLARE_CRYPTO_API(CONFIG_CRYPTO_ECC, ecc_gen_privkey, int,
+ (unsigned int curve_id, unsigned int ndigits, u64 *private_key),
+ (curve_id, ndigits, private_key));
/**
* ecc_make_pub_key() - Compute an ECC public key
@@ -121,8 +125,9 @@ int ecc_gen_privkey(unsigned int curve_id, unsigned int ndigits,
* Returns 0 if the public key was generated successfully, a negative value
* if an error occurred.
*/
-int ecc_make_pub_key(const unsigned int curve_id, unsigned int ndigits,
- const u64 *private_key, u64 *public_key);
+DECLARE_CRYPTO_API(CONFIG_CRYPTO_ECC, ecc_make_pub_key, int,
+ (const unsigned int curve_id, unsigned int ndigits, const u64 *private_key, u64 *public_key),
+ (curve_id, ndigits, private_key, public_key));
/**
* crypto_ecdh_shared_secret() - Compute a shared secret
@@ -139,9 +144,9 @@ int ecc_make_pub_key(const unsigned int curve_id, unsigned int ndigits,
* Returns 0 if the shared secret was generated successfully, a negative value
* if an error occurred.
*/
-int crypto_ecdh_shared_secret(unsigned int curve_id, unsigned int ndigits,
- const u64 *private_key, const u64 *public_key,
- u64 *secret);
+DECLARE_CRYPTO_API(CONFIG_CRYPTO_ECC, crypto_ecdh_shared_secret, int,
+ (unsigned int curve_id, unsigned int ndigits, const u64 *private_key, const u64 *public_key, u64 *secret),
+ (curve_id, ndigits, private_key, public_key, secret));
/**
* ecc_is_pubkey_valid_partial() - Partial public key validation
@@ -157,8 +162,9 @@ int crypto_ecdh_shared_secret(unsigned int curve_id, unsigned int ndigits,
*
* Return: 0 if validation is successful, -EINVAL if validation is failed.
*/
-int ecc_is_pubkey_valid_partial(const struct ecc_curve *curve,
- struct ecc_point *pk);
+DECLARE_CRYPTO_API(CONFIG_CRYPTO_ECC, ecc_is_pubkey_valid_partial, int,
+ (const struct ecc_curve *curve, struct ecc_point *pk),
+ (curve, pk));
/**
* ecc_is_pubkey_valid_full() - Full public key validation
@@ -171,8 +177,9 @@ int ecc_is_pubkey_valid_partial(const struct ecc_curve *curve,
*
* Return: 0 if validation is successful, -EINVAL if validation is failed.
*/
-int ecc_is_pubkey_valid_full(const struct ecc_curve *curve,
- struct ecc_point *pk);
+DECLARE_CRYPTO_API(CONFIG_CRYPTO_ECC, ecc_is_pubkey_valid_full, int,
+ (const struct ecc_curve *curve, struct ecc_point *pk),
+ (curve, pk));
/**
* vli_is_zero() - Determine is vli is zero
@@ -180,7 +187,9 @@ int ecc_is_pubkey_valid_full(const struct ecc_curve *curve,
* @vli: vli to check.
* @ndigits: length of the @vli
*/
-bool vli_is_zero(const u64 *vli, unsigned int ndigits);
+DECLARE_CRYPTO_API(CONFIG_CRYPTO_ECC, vli_is_zero, bool,
+ (const u64 *vli, unsigned int ndigits),
+ (vli, ndigits));
/**
* vli_cmp() - compare left and right vlis
@@ -192,7 +201,9 @@ bool vli_is_zero(const u64 *vli, unsigned int ndigits);
* Returns sign of @left - @right, i.e. -1 if @left < @right,
* 0 if @left == @right, 1 if @left > @right.
*/
-int vli_cmp(const u64 *left, const u64 *right, unsigned int ndigits);
+DECLARE_CRYPTO_API(CONFIG_CRYPTO_ECC, vli_cmp, int,
+ (const u64 *left, const u64 *right, unsigned int ndigits),
+ (left, right, ndigits));
/**
* vli_sub() - Subtracts right from left
@@ -206,8 +217,9 @@ int vli_cmp(const u64 *left, const u64 *right, unsigned int ndigits);
*
* Return: carry bit.
*/
-u64 vli_sub(u64 *result, const u64 *left, const u64 *right,
- unsigned int ndigits);
+DECLARE_CRYPTO_API(CONFIG_CRYPTO_ECC, vli_sub, u64,
+ (u64 *result, const u64 *left, const u64 *right, unsigned int ndigits),
+ (result, left, right, ndigits));
/**
* vli_from_be64() - Load vli from big-endian u64 array
@@ -216,7 +228,9 @@ u64 vli_sub(u64 *result, const u64 *left, const u64 *right,
* @src: source array of u64 BE values
* @ndigits: length of both vli and array
*/
-void vli_from_be64(u64 *dest, const void *src, unsigned int ndigits);
+DECLARE_CRYPTO_API(CONFIG_CRYPTO_ECC, vli_from_be64, void,
+ (u64 *dest, const void *src, unsigned int ndigits),
+ (dest, src, ndigits));
/**
* vli_from_le64() - Load vli from little-endian u64 array
@@ -225,7 +239,9 @@ void vli_from_be64(u64 *dest, const void *src, unsigned int ndigits);
* @src: source array of u64 LE values
* @ndigits: length of both vli and array
*/
-void vli_from_le64(u64 *dest, const void *src, unsigned int ndigits);
+DECLARE_CRYPTO_API(CONFIG_CRYPTO_ECC, vli_from_le64, void,
+ (u64 *dest, const void *src, unsigned int ndigits),
+ (dest, src, ndigits));
/**
* vli_mod_inv() - Modular inversion
@@ -235,8 +251,9 @@ void vli_from_le64(u64 *dest, const void *src, unsigned int ndigits);
* @mod: modulus
* @ndigits: length of all vlis
*/
-void vli_mod_inv(u64 *result, const u64 *input, const u64 *mod,
- unsigned int ndigits);
+DECLARE_CRYPTO_API(CONFIG_CRYPTO_ECC, vli_mod_inv, void,
+ (u64 *result, const u64 *input, const u64 *mod, unsigned int ndigits),
+ (result, input, mod, ndigits));
/**
* vli_mod_mult_slow() - Modular multiplication
@@ -249,8 +266,9 @@ void vli_mod_inv(u64 *result, const u64 *input, const u64 *mod,
*
* Note: Assumes that mod is big enough curve order.
*/
-void vli_mod_mult_slow(u64 *result, const u64 *left, const u64 *right,
- const u64 *mod, unsigned int ndigits);
+DECLARE_CRYPTO_API(CONFIG_CRYPTO_ECC, vli_mod_mult_slow, void,
+ (u64 *result, const u64 *left, const u64 *right, const u64 *mod, unsigned int ndigits),
+ (result, left, right, mod, ndigits));
/**
* vli_num_bits() - Counts the number of bits required for vli.
@@ -260,7 +278,9 @@ void vli_mod_mult_slow(u64 *result, const u64 *left, const u64 *right,
*
* Return: The number of bits required to represent @vli.
*/
-unsigned int vli_num_bits(const u64 *vli, unsigned int ndigits);
+DECLARE_CRYPTO_API(CONFIG_CRYPTO_ECC, vli_num_bits, unsigned int,
+ (const u64 *vli, unsigned int ndigits),
+ (vli, ndigits));
/**
* ecc_aloc_point() - Allocate ECC point.
@@ -269,14 +289,18 @@ unsigned int vli_num_bits(const u64 *vli, unsigned int ndigits);
*
* Return: Pointer to the allocated point or NULL if allocation failed.
*/
-struct ecc_point *ecc_alloc_point(unsigned int ndigits);
+DECLARE_CRYPTO_API(CONFIG_CRYPTO_ECC, ecc_alloc_point, struct ecc_point *,
+ (unsigned int ndigits),
+ (ndigits));
/**
* ecc_free_point() - Free ECC point.
*
* @p: The point to free.
*/
-void ecc_free_point(struct ecc_point *p);
+DECLARE_CRYPTO_API(CONFIG_CRYPTO_ECC, ecc_free_point, void,
+ (struct ecc_point *p),
+ (p));
/**
* ecc_point_is_zero() - Check if point is zero.
@@ -285,7 +309,9 @@ void ecc_free_point(struct ecc_point *p);
*
* Return: true if point is the point at infinity, false otherwise.
*/
-bool ecc_point_is_zero(const struct ecc_point *point);
+DECLARE_CRYPTO_API(CONFIG_CRYPTO_ECC, ecc_point_is_zero, bool,
+ (const struct ecc_point *point),
+ (point));
/**
* ecc_point_mult_shamir() - Add two points multiplied by scalars
@@ -300,10 +326,9 @@ bool ecc_point_is_zero(const struct ecc_point *point);
* Returns result = x * p + x * q over the curve.
* This works faster than two multiplications and addition.
*/
-void ecc_point_mult_shamir(const struct ecc_point *result,
- const u64 *x, const struct ecc_point *p,
- const u64 *y, const struct ecc_point *q,
- const struct ecc_curve *curve);
+DECLARE_CRYPTO_API(CONFIG_CRYPTO_ECC, ecc_point_mult_shamir, void,
+ (const struct ecc_point *result, const u64 *x, const struct ecc_point *p, const u64 *y, const struct ecc_point *q, const struct ecc_curve *curve),
+ (result, x, p, y, q, curve));
extern struct crypto_template ecdsa_x962_tmpl;
extern struct crypto_template ecdsa_p1363_tmpl;
--
2.47.3
^ permalink raw reply related
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox