1
2
3
4
5
6 #ifndef _CRYPTO_INTERNAL_SIMD_H
7 #define _CRYPTO_INTERNAL_SIMD_H
8
9 #include <linux/percpu.h>
10 #include <linux/types.h>
11
12
13
14 struct simd_skcipher_alg;
15 struct skcipher_alg;
16
17 struct simd_skcipher_alg *simd_skcipher_create_compat(const char *algname,
18 const char *drvname,
19 const char *basename);
20 struct simd_skcipher_alg *simd_skcipher_create(const char *algname,
21 const char *basename);
22 void simd_skcipher_free(struct simd_skcipher_alg *alg);
23
24 int simd_register_skciphers_compat(struct skcipher_alg *algs, int count,
25 struct simd_skcipher_alg **simd_algs);
26
27 void simd_unregister_skciphers(struct skcipher_alg *algs, int count,
28 struct simd_skcipher_alg **simd_algs);
29
30
31
32 struct simd_aead_alg;
33 struct aead_alg;
34
35 struct simd_aead_alg *simd_aead_create_compat(const char *algname,
36 const char *drvname,
37 const char *basename);
38 struct simd_aead_alg *simd_aead_create(const char *algname,
39 const char *basename);
40 void simd_aead_free(struct simd_aead_alg *alg);
41
42 int simd_register_aeads_compat(struct aead_alg *algs, int count,
43 struct simd_aead_alg **simd_algs);
44
45 void simd_unregister_aeads(struct aead_alg *algs, int count,
46 struct simd_aead_alg **simd_algs);
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61 #ifdef CONFIG_CRYPTO_MANAGER_EXTRA_TESTS
62 DECLARE_PER_CPU(bool, crypto_simd_disabled_for_test);
63 #define crypto_simd_usable() \
64 (may_use_simd() && !this_cpu_read(crypto_simd_disabled_for_test))
65 #else
66 #define crypto_simd_usable() may_use_simd()
67 #endif
68
69 #endif