diff options
-rw-r--r-- | arch/x86/crypto/Makefile | 4 | ||||
-rw-r--r-- | arch/x86/crypto/aesni-intel_glue.c | 8 | ||||
-rw-r--r-- | arch/x86/crypto/fpu.c | 10 | ||||
-rw-r--r-- | crypto/Kconfig | 6 |
4 files changed, 11 insertions, 17 deletions
diff --git a/arch/x86/crypto/Makefile b/arch/x86/crypto/Makefile index 1a58ad89fdf7..c04f1b7a9139 100644 --- a/arch/x86/crypto/Makefile +++ b/arch/x86/crypto/Makefile | |||
@@ -2,8 +2,6 @@ | |||
2 | # Arch-specific CryptoAPI modules. | 2 | # Arch-specific CryptoAPI modules. |
3 | # | 3 | # |
4 | 4 | ||
5 | obj-$(CONFIG_CRYPTO_FPU) += fpu.o | ||
6 | |||
7 | obj-$(CONFIG_CRYPTO_AES_586) += aes-i586.o | 5 | obj-$(CONFIG_CRYPTO_AES_586) += aes-i586.o |
8 | obj-$(CONFIG_CRYPTO_TWOFISH_586) += twofish-i586.o | 6 | obj-$(CONFIG_CRYPTO_TWOFISH_586) += twofish-i586.o |
9 | obj-$(CONFIG_CRYPTO_SALSA20_586) += salsa20-i586.o | 7 | obj-$(CONFIG_CRYPTO_SALSA20_586) += salsa20-i586.o |
@@ -24,6 +22,6 @@ aes-x86_64-y := aes-x86_64-asm_64.o aes_glue.o | |||
24 | twofish-x86_64-y := twofish-x86_64-asm_64.o twofish_glue.o | 22 | twofish-x86_64-y := twofish-x86_64-asm_64.o twofish_glue.o |
25 | salsa20-x86_64-y := salsa20-x86_64-asm_64.o salsa20_glue.o | 23 | salsa20-x86_64-y := salsa20-x86_64-asm_64.o salsa20_glue.o |
26 | 24 | ||
27 | aesni-intel-y := aesni-intel_asm.o aesni-intel_glue.o | 25 | aesni-intel-y := aesni-intel_asm.o aesni-intel_glue.o fpu.o |
28 | 26 | ||
29 | ghash-clmulni-intel-y := ghash-clmulni-intel_asm.o ghash-clmulni-intel_glue.o | 27 | ghash-clmulni-intel-y := ghash-clmulni-intel_asm.o ghash-clmulni-intel_glue.o |
diff --git a/arch/x86/crypto/aesni-intel_glue.c b/arch/x86/crypto/aesni-intel_glue.c index 2577613fb32b..cbc60ef359bc 100644 --- a/arch/x86/crypto/aesni-intel_glue.c +++ b/arch/x86/crypto/aesni-intel_glue.c | |||
@@ -140,6 +140,9 @@ asmlinkage void aesni_gcm_dec(void *ctx, u8 *out, | |||
140 | u8 *hash_subkey, const u8 *aad, unsigned long aad_len, | 140 | u8 *hash_subkey, const u8 *aad, unsigned long aad_len, |
141 | u8 *auth_tag, unsigned long auth_tag_len); | 141 | u8 *auth_tag, unsigned long auth_tag_len); |
142 | 142 | ||
143 | int crypto_fpu_init(void); | ||
144 | void crypto_fpu_exit(void); | ||
145 | |||
143 | static inline struct | 146 | static inline struct |
144 | aesni_rfc4106_gcm_ctx *aesni_rfc4106_gcm_ctx_get(struct crypto_aead *tfm) | 147 | aesni_rfc4106_gcm_ctx *aesni_rfc4106_gcm_ctx_get(struct crypto_aead *tfm) |
145 | { | 148 | { |
@@ -1257,6 +1260,8 @@ static int __init aesni_init(void) | |||
1257 | return -ENODEV; | 1260 | return -ENODEV; |
1258 | } | 1261 | } |
1259 | 1262 | ||
1263 | if ((err = crypto_fpu_init())) | ||
1264 | goto fpu_err; | ||
1260 | if ((err = crypto_register_alg(&aesni_alg))) | 1265 | if ((err = crypto_register_alg(&aesni_alg))) |
1261 | goto aes_err; | 1266 | goto aes_err; |
1262 | if ((err = crypto_register_alg(&__aesni_alg))) | 1267 | if ((err = crypto_register_alg(&__aesni_alg))) |
@@ -1334,6 +1339,7 @@ blk_ecb_err: | |||
1334 | __aes_err: | 1339 | __aes_err: |
1335 | crypto_unregister_alg(&aesni_alg); | 1340 | crypto_unregister_alg(&aesni_alg); |
1336 | aes_err: | 1341 | aes_err: |
1342 | fpu_err: | ||
1337 | return err; | 1343 | return err; |
1338 | } | 1344 | } |
1339 | 1345 | ||
@@ -1363,6 +1369,8 @@ static void __exit aesni_exit(void) | |||
1363 | crypto_unregister_alg(&blk_ecb_alg); | 1369 | crypto_unregister_alg(&blk_ecb_alg); |
1364 | crypto_unregister_alg(&__aesni_alg); | 1370 | crypto_unregister_alg(&__aesni_alg); |
1365 | crypto_unregister_alg(&aesni_alg); | 1371 | crypto_unregister_alg(&aesni_alg); |
1372 | |||
1373 | crypto_fpu_exit(); | ||
1366 | } | 1374 | } |
1367 | 1375 | ||
1368 | module_init(aesni_init); | 1376 | module_init(aesni_init); |
diff --git a/arch/x86/crypto/fpu.c b/arch/x86/crypto/fpu.c index 1a8f8649c035..98d7a188f46b 100644 --- a/arch/x86/crypto/fpu.c +++ b/arch/x86/crypto/fpu.c | |||
@@ -150,18 +150,12 @@ static struct crypto_template crypto_fpu_tmpl = { | |||
150 | .module = THIS_MODULE, | 150 | .module = THIS_MODULE, |
151 | }; | 151 | }; |
152 | 152 | ||
153 | static int __init crypto_fpu_module_init(void) | 153 | int __init crypto_fpu_init(void) |
154 | { | 154 | { |
155 | return crypto_register_template(&crypto_fpu_tmpl); | 155 | return crypto_register_template(&crypto_fpu_tmpl); |
156 | } | 156 | } |
157 | 157 | ||
158 | static void __exit crypto_fpu_module_exit(void) | 158 | void __exit crypto_fpu_exit(void) |
159 | { | 159 | { |
160 | crypto_unregister_template(&crypto_fpu_tmpl); | 160 | crypto_unregister_template(&crypto_fpu_tmpl); |
161 | } | 161 | } |
162 | |||
163 | module_init(crypto_fpu_module_init); | ||
164 | module_exit(crypto_fpu_module_exit); | ||
165 | |||
166 | MODULE_LICENSE("GPL"); | ||
167 | MODULE_DESCRIPTION("FPU block cipher wrapper"); | ||
diff --git a/crypto/Kconfig b/crypto/Kconfig index 4b7cb0e691cd..87b22ca9c223 100644 --- a/crypto/Kconfig +++ b/crypto/Kconfig | |||
@@ -264,11 +264,6 @@ config CRYPTO_XTS | |||
264 | key size 256, 384 or 512 bits. This implementation currently | 264 | key size 256, 384 or 512 bits. This implementation currently |
265 | can't handle a sectorsize which is not a multiple of 16 bytes. | 265 | can't handle a sectorsize which is not a multiple of 16 bytes. |
266 | 266 | ||
267 | config CRYPTO_FPU | ||
268 | tristate | ||
269 | select CRYPTO_BLKCIPHER | ||
270 | select CRYPTO_MANAGER | ||
271 | |||
272 | comment "Hash modes" | 267 | comment "Hash modes" |
273 | 268 | ||
274 | config CRYPTO_HMAC | 269 | config CRYPTO_HMAC |
@@ -543,7 +538,6 @@ config CRYPTO_AES_NI_INTEL | |||
543 | select CRYPTO_AES_586 if !64BIT | 538 | select CRYPTO_AES_586 if !64BIT |
544 | select CRYPTO_CRYPTD | 539 | select CRYPTO_CRYPTD |
545 | select CRYPTO_ALGAPI | 540 | select CRYPTO_ALGAPI |
546 | select CRYPTO_FPU | ||
547 | help | 541 | help |
548 | Use Intel AES-NI instructions for AES algorithm. | 542 | Use Intel AES-NI instructions for AES algorithm. |
549 | 543 | ||