1 /****************************************************************************
2  ****************************************************************************
3  ***
4  ***   This header was automatically generated from a Linux kernel header
5  ***   of the same name, to make information necessary for userspace to
6  ***   call into the kernel available to libc.  It contains only constants,
7  ***   structures, and macros generated from the original header, and thus,
8  ***   contains no copyrightable information.
9  ***
10  ***   To edit the content of this header, modify the corresponding
11  ***   source file (e.g. under external/kernel-headers/original/) then
12  ***   run bionic/libc/kernel/tools/update_all.py
13  ***
14  ***   Any manual change here will be lost the next time this script will
15  ***   be run. You've been warned!
16  ***
17  ****************************************************************************
18  ****************************************************************************/
19 #ifndef _UAPI_LINUX_CRYPTOUSER_H
20 #define _UAPI_LINUX_CRYPTOUSER_H
21 #include <linux/types.h>
22 enum {
23   CRYPTO_MSG_BASE = 0x10,
24   CRYPTO_MSG_NEWALG = 0x10,
25   CRYPTO_MSG_DELALG,
26   CRYPTO_MSG_UPDATEALG,
27   CRYPTO_MSG_GETALG,
28   CRYPTO_MSG_DELRNG,
29   CRYPTO_MSG_GETSTAT,
30   __CRYPTO_MSG_MAX
31 };
32 #define CRYPTO_MSG_MAX (__CRYPTO_MSG_MAX - 1)
33 #define CRYPTO_NR_MSGTYPES (CRYPTO_MSG_MAX + 1 - CRYPTO_MSG_BASE)
34 #define CRYPTO_MAX_NAME 64
35 enum crypto_attr_type_t {
36   CRYPTOCFGA_UNSPEC,
37   CRYPTOCFGA_PRIORITY_VAL,
38   CRYPTOCFGA_REPORT_LARVAL,
39   CRYPTOCFGA_REPORT_HASH,
40   CRYPTOCFGA_REPORT_BLKCIPHER,
41   CRYPTOCFGA_REPORT_AEAD,
42   CRYPTOCFGA_REPORT_COMPRESS,
43   CRYPTOCFGA_REPORT_RNG,
44   CRYPTOCFGA_REPORT_CIPHER,
45   CRYPTOCFGA_REPORT_AKCIPHER,
46   CRYPTOCFGA_REPORT_KPP,
47   CRYPTOCFGA_REPORT_ACOMP,
48   CRYPTOCFGA_STAT_LARVAL,
49   CRYPTOCFGA_STAT_HASH,
50   CRYPTOCFGA_STAT_BLKCIPHER,
51   CRYPTOCFGA_STAT_AEAD,
52   CRYPTOCFGA_STAT_COMPRESS,
53   CRYPTOCFGA_STAT_RNG,
54   CRYPTOCFGA_STAT_CIPHER,
55   CRYPTOCFGA_STAT_AKCIPHER,
56   CRYPTOCFGA_STAT_KPP,
57   CRYPTOCFGA_STAT_ACOMP,
58   __CRYPTOCFGA_MAX
59 #define CRYPTOCFGA_MAX (__CRYPTOCFGA_MAX - 1)
60 };
61 struct crypto_user_alg {
62   char cru_name[CRYPTO_MAX_NAME];
63   char cru_driver_name[CRYPTO_MAX_NAME];
64   char cru_module_name[CRYPTO_MAX_NAME];
65   __u32 cru_type;
66   __u32 cru_mask;
67   __u32 cru_refcnt;
68   __u32 cru_flags;
69 };
70 struct crypto_stat_aead {
71   char type[CRYPTO_MAX_NAME];
72   __u64 stat_encrypt_cnt;
73   __u64 stat_encrypt_tlen;
74   __u64 stat_decrypt_cnt;
75   __u64 stat_decrypt_tlen;
76   __u64 stat_err_cnt;
77 };
78 struct crypto_stat_akcipher {
79   char type[CRYPTO_MAX_NAME];
80   __u64 stat_encrypt_cnt;
81   __u64 stat_encrypt_tlen;
82   __u64 stat_decrypt_cnt;
83   __u64 stat_decrypt_tlen;
84   __u64 stat_verify_cnt;
85   __u64 stat_sign_cnt;
86   __u64 stat_err_cnt;
87 };
88 struct crypto_stat_cipher {
89   char type[CRYPTO_MAX_NAME];
90   __u64 stat_encrypt_cnt;
91   __u64 stat_encrypt_tlen;
92   __u64 stat_decrypt_cnt;
93   __u64 stat_decrypt_tlen;
94   __u64 stat_err_cnt;
95 };
96 struct crypto_stat_compress {
97   char type[CRYPTO_MAX_NAME];
98   __u64 stat_compress_cnt;
99   __u64 stat_compress_tlen;
100   __u64 stat_decompress_cnt;
101   __u64 stat_decompress_tlen;
102   __u64 stat_err_cnt;
103 };
104 struct crypto_stat_hash {
105   char type[CRYPTO_MAX_NAME];
106   __u64 stat_hash_cnt;
107   __u64 stat_hash_tlen;
108   __u64 stat_err_cnt;
109 };
110 struct crypto_stat_kpp {
111   char type[CRYPTO_MAX_NAME];
112   __u64 stat_setsecret_cnt;
113   __u64 stat_generate_public_key_cnt;
114   __u64 stat_compute_shared_secret_cnt;
115   __u64 stat_err_cnt;
116 };
117 struct crypto_stat_rng {
118   char type[CRYPTO_MAX_NAME];
119   __u64 stat_generate_cnt;
120   __u64 stat_generate_tlen;
121   __u64 stat_seed_cnt;
122   __u64 stat_err_cnt;
123 };
124 struct crypto_stat_larval {
125   char type[CRYPTO_MAX_NAME];
126 };
127 struct crypto_report_larval {
128   char type[CRYPTO_MAX_NAME];
129 };
130 struct crypto_report_hash {
131   char type[CRYPTO_MAX_NAME];
132   unsigned int blocksize;
133   unsigned int digestsize;
134 };
135 struct crypto_report_cipher {
136   char type[CRYPTO_MAX_NAME];
137   unsigned int blocksize;
138   unsigned int min_keysize;
139   unsigned int max_keysize;
140 };
141 struct crypto_report_blkcipher {
142   char type[CRYPTO_MAX_NAME];
143   char geniv[CRYPTO_MAX_NAME];
144   unsigned int blocksize;
145   unsigned int min_keysize;
146   unsigned int max_keysize;
147   unsigned int ivsize;
148 };
149 struct crypto_report_aead {
150   char type[CRYPTO_MAX_NAME];
151   char geniv[CRYPTO_MAX_NAME];
152   unsigned int blocksize;
153   unsigned int maxauthsize;
154   unsigned int ivsize;
155 };
156 struct crypto_report_comp {
157   char type[CRYPTO_MAX_NAME];
158 };
159 struct crypto_report_rng {
160   char type[CRYPTO_MAX_NAME];
161   unsigned int seedsize;
162 };
163 struct crypto_report_akcipher {
164   char type[CRYPTO_MAX_NAME];
165 };
166 struct crypto_report_kpp {
167   char type[CRYPTO_MAX_NAME];
168 };
169 struct crypto_report_acomp {
170   char type[CRYPTO_MAX_NAME];
171 };
172 #define CRYPTO_REPORT_MAXSIZE (sizeof(struct crypto_user_alg) + sizeof(struct crypto_report_blkcipher))
173 #endif
174