.. | .. |
---|
9 | 9 | |
---|
10 | 10 | #include <crypto/algapi.h> |
---|
11 | 11 | #include <crypto/internal/chacha.h> |
---|
| 12 | +#include <crypto/internal/simd.h> |
---|
12 | 13 | #include <crypto/internal/skcipher.h> |
---|
13 | 14 | #include <linux/jump_label.h> |
---|
14 | 15 | #include <linux/kernel.h> |
---|
.. | .. |
---|
33 | 34 | |
---|
34 | 35 | static inline bool neon_usable(void) |
---|
35 | 36 | { |
---|
36 | | - return static_branch_likely(&use_neon) && may_use_simd(); |
---|
| 37 | + return static_branch_likely(&use_neon) && crypto_simd_usable(); |
---|
37 | 38 | } |
---|
38 | 39 | |
---|
39 | 40 | static void chacha_doneon(u32 *state, u8 *dst, const u8 *src, |
---|
.. | .. |
---|
295 | 296 | { |
---|
296 | 297 | int err = 0; |
---|
297 | 298 | |
---|
298 | | - if (IS_REACHABLE(CONFIG_CRYPTO_BLKCIPHER)) { |
---|
| 299 | + if (IS_REACHABLE(CONFIG_CRYPTO_SKCIPHER)) { |
---|
299 | 300 | err = crypto_register_skciphers(arm_algs, ARRAY_SIZE(arm_algs)); |
---|
300 | 301 | if (err) |
---|
301 | 302 | return err; |
---|
.. | .. |
---|
319 | 320 | static_branch_enable(&use_neon); |
---|
320 | 321 | } |
---|
321 | 322 | |
---|
322 | | - if (IS_REACHABLE(CONFIG_CRYPTO_BLKCIPHER)) { |
---|
| 323 | + if (IS_REACHABLE(CONFIG_CRYPTO_SKCIPHER)) { |
---|
323 | 324 | err = crypto_register_skciphers(neon_algs, ARRAY_SIZE(neon_algs)); |
---|
324 | 325 | if (err) |
---|
325 | 326 | crypto_unregister_skciphers(arm_algs, ARRAY_SIZE(arm_algs)); |
---|
.. | .. |
---|
330 | 331 | |
---|
331 | 332 | static void __exit chacha_simd_mod_fini(void) |
---|
332 | 333 | { |
---|
333 | | - if (IS_REACHABLE(CONFIG_CRYPTO_BLKCIPHER)) { |
---|
| 334 | + if (IS_REACHABLE(CONFIG_CRYPTO_SKCIPHER)) { |
---|
334 | 335 | crypto_unregister_skciphers(arm_algs, ARRAY_SIZE(arm_algs)); |
---|
335 | 336 | if (IS_ENABLED(CONFIG_KERNEL_MODE_NEON) && (elf_hwcap & HWCAP_NEON)) |
---|
336 | 337 | crypto_unregister_skciphers(neon_algs, ARRAY_SIZE(neon_algs)); |
---|