1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 #ifndef _UAPI_LINUX_CRYPTOUSER_H
23 #define _UAPI_LINUX_CRYPTOUSER_H
24
25 #include <linux/types.h>
26
27
28 enum {
29 CRYPTO_MSG_BASE = 0x10,
30 CRYPTO_MSG_NEWALG = 0x10,
31 CRYPTO_MSG_DELALG,
32 CRYPTO_MSG_UPDATEALG,
33 CRYPTO_MSG_GETALG,
34 CRYPTO_MSG_DELRNG,
35 CRYPTO_MSG_GETSTAT,
36 __CRYPTO_MSG_MAX
37 };
38 #define CRYPTO_MSG_MAX (__CRYPTO_MSG_MAX - 1)
39 #define CRYPTO_NR_MSGTYPES (CRYPTO_MSG_MAX + 1 - CRYPTO_MSG_BASE)
40
41 #define CRYPTO_MAX_NAME 64
42
43
44 enum crypto_attr_type_t {
45 CRYPTOCFGA_UNSPEC,
46 CRYPTOCFGA_PRIORITY_VAL,
47 CRYPTOCFGA_REPORT_LARVAL,
48 CRYPTOCFGA_REPORT_HASH,
49 CRYPTOCFGA_REPORT_BLKCIPHER,
50 CRYPTOCFGA_REPORT_AEAD,
51 CRYPTOCFGA_REPORT_COMPRESS,
52 CRYPTOCFGA_REPORT_RNG,
53 CRYPTOCFGA_REPORT_CIPHER,
54 CRYPTOCFGA_REPORT_AKCIPHER,
55 CRYPTOCFGA_REPORT_KPP,
56 CRYPTOCFGA_REPORT_ACOMP,
57 CRYPTOCFGA_STAT_LARVAL,
58 CRYPTOCFGA_STAT_HASH,
59 CRYPTOCFGA_STAT_BLKCIPHER,
60 CRYPTOCFGA_STAT_AEAD,
61 CRYPTOCFGA_STAT_COMPRESS,
62 CRYPTOCFGA_STAT_RNG,
63 CRYPTOCFGA_STAT_CIPHER,
64 CRYPTOCFGA_STAT_AKCIPHER,
65 CRYPTOCFGA_STAT_KPP,
66 CRYPTOCFGA_STAT_ACOMP,
67 __CRYPTOCFGA_MAX
68
69 #define CRYPTOCFGA_MAX (__CRYPTOCFGA_MAX - 1)
70 };
71
72 struct crypto_user_alg {
73 char cru_name[CRYPTO_MAX_NAME];
74 char cru_driver_name[CRYPTO_MAX_NAME];
75 char cru_module_name[CRYPTO_MAX_NAME];
76 __u32 cru_type;
77 __u32 cru_mask;
78 __u32 cru_refcnt;
79 __u32 cru_flags;
80 };
81
82 struct crypto_stat_aead {
83 char type[CRYPTO_MAX_NAME];
84 __u64 stat_encrypt_cnt;
85 __u64 stat_encrypt_tlen;
86 __u64 stat_decrypt_cnt;
87 __u64 stat_decrypt_tlen;
88 __u64 stat_err_cnt;
89 };
90
91 struct crypto_stat_akcipher {
92 char type[CRYPTO_MAX_NAME];
93 __u64 stat_encrypt_cnt;
94 __u64 stat_encrypt_tlen;
95 __u64 stat_decrypt_cnt;
96 __u64 stat_decrypt_tlen;
97 __u64 stat_verify_cnt;
98 __u64 stat_sign_cnt;
99 __u64 stat_err_cnt;
100 };
101
102 struct crypto_stat_cipher {
103 char type[CRYPTO_MAX_NAME];
104 __u64 stat_encrypt_cnt;
105 __u64 stat_encrypt_tlen;
106 __u64 stat_decrypt_cnt;
107 __u64 stat_decrypt_tlen;
108 __u64 stat_err_cnt;
109 };
110
111 struct crypto_stat_compress {
112 char type[CRYPTO_MAX_NAME];
113 __u64 stat_compress_cnt;
114 __u64 stat_compress_tlen;
115 __u64 stat_decompress_cnt;
116 __u64 stat_decompress_tlen;
117 __u64 stat_err_cnt;
118 };
119
120 struct crypto_stat_hash {
121 char type[CRYPTO_MAX_NAME];
122 __u64 stat_hash_cnt;
123 __u64 stat_hash_tlen;
124 __u64 stat_err_cnt;
125 };
126
127 struct crypto_stat_kpp {
128 char type[CRYPTO_MAX_NAME];
129 __u64 stat_setsecret_cnt;
130 __u64 stat_generate_public_key_cnt;
131 __u64 stat_compute_shared_secret_cnt;
132 __u64 stat_err_cnt;
133 };
134
135 struct crypto_stat_rng {
136 char type[CRYPTO_MAX_NAME];
137 __u64 stat_generate_cnt;
138 __u64 stat_generate_tlen;
139 __u64 stat_seed_cnt;
140 __u64 stat_err_cnt;
141 };
142
143 struct crypto_stat_larval {
144 char type[CRYPTO_MAX_NAME];
145 };
146
147 struct crypto_report_larval {
148 char type[CRYPTO_MAX_NAME];
149 };
150
151 struct crypto_report_hash {
152 char type[CRYPTO_MAX_NAME];
153 unsigned int blocksize;
154 unsigned int digestsize;
155 };
156
157 struct crypto_report_cipher {
158 char type[CRYPTO_MAX_NAME];
159 unsigned int blocksize;
160 unsigned int min_keysize;
161 unsigned int max_keysize;
162 };
163
164 struct crypto_report_blkcipher {
165 char type[CRYPTO_MAX_NAME];
166 char geniv[CRYPTO_MAX_NAME];
167 unsigned int blocksize;
168 unsigned int min_keysize;
169 unsigned int max_keysize;
170 unsigned int ivsize;
171 };
172
173 struct crypto_report_aead {
174 char type[CRYPTO_MAX_NAME];
175 char geniv[CRYPTO_MAX_NAME];
176 unsigned int blocksize;
177 unsigned int maxauthsize;
178 unsigned int ivsize;
179 };
180
181 struct crypto_report_comp {
182 char type[CRYPTO_MAX_NAME];
183 };
184
185 struct crypto_report_rng {
186 char type[CRYPTO_MAX_NAME];
187 unsigned int seedsize;
188 };
189
190 struct crypto_report_akcipher {
191 char type[CRYPTO_MAX_NAME];
192 };
193
194 struct crypto_report_kpp {
195 char type[CRYPTO_MAX_NAME];
196 };
197
198 struct crypto_report_acomp {
199 char type[CRYPTO_MAX_NAME];
200 };
201
202 #define CRYPTO_REPORT_MAXSIZE (sizeof(struct crypto_user_alg) + \
203 sizeof(struct crypto_report_blkcipher))
204
205 #endif