blob: 1d145bd29540e9ad3e12c1f5129f86faf6f5b211 [file] [log] [blame]
Christopher Ferris05d08e92016-02-04 13:16:38 -08001/****************************************************************************
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 ****************************************************************************/
Christopher Ferris9584fa42019-12-09 15:36:13 -080019#ifndef _UAPI_LINUX_CRYPTOUSER_H
20#define _UAPI_LINUX_CRYPTOUSER_H
Christopher Ferris525ce912017-07-26 13:12:53 -070021#include <linux/types.h>
Christopher Ferris05d08e92016-02-04 13:16:38 -080022enum {
23 CRYPTO_MSG_BASE = 0x10,
24 CRYPTO_MSG_NEWALG = 0x10,
25 CRYPTO_MSG_DELALG,
Christopher Ferris05d08e92016-02-04 13:16:38 -080026 CRYPTO_MSG_UPDATEALG,
27 CRYPTO_MSG_GETALG,
28 CRYPTO_MSG_DELRNG,
Christopher Ferris86a48372019-01-10 14:14:59 -080029 CRYPTO_MSG_GETSTAT,
Christopher Ferris05d08e92016-02-04 13:16:38 -080030 __CRYPTO_MSG_MAX
Christopher Ferris05d08e92016-02-04 13:16:38 -080031};
32#define CRYPTO_MSG_MAX (__CRYPTO_MSG_MAX - 1)
33#define CRYPTO_NR_MSGTYPES (CRYPTO_MSG_MAX + 1 - CRYPTO_MSG_BASE)
Christopher Ferris525ce912017-07-26 13:12:53 -070034#define CRYPTO_MAX_NAME 64
Christopher Ferris05d08e92016-02-04 13:16:38 -080035enum crypto_attr_type_t {
36 CRYPTOCFGA_UNSPEC,
37 CRYPTOCFGA_PRIORITY_VAL,
38 CRYPTOCFGA_REPORT_LARVAL,
Christopher Ferris05d08e92016-02-04 13:16:38 -080039 CRYPTOCFGA_REPORT_HASH,
40 CRYPTOCFGA_REPORT_BLKCIPHER,
41 CRYPTOCFGA_REPORT_AEAD,
42 CRYPTOCFGA_REPORT_COMPRESS,
Christopher Ferris05d08e92016-02-04 13:16:38 -080043 CRYPTOCFGA_REPORT_RNG,
44 CRYPTOCFGA_REPORT_CIPHER,
45 CRYPTOCFGA_REPORT_AKCIPHER,
Christopher Ferris49f525c2016-12-12 14:55:36 -080046 CRYPTOCFGA_REPORT_KPP,
Christopher Ferris48af7cb2017-02-21 12:35:09 -080047 CRYPTOCFGA_REPORT_ACOMP,
Christopher Ferris86a48372019-01-10 14:14:59 -080048 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,
Christopher Ferris49f525c2016-12-12 14:55:36 -080058 __CRYPTOCFGA_MAX
Christopher Ferris05d08e92016-02-04 13:16:38 -080059#define CRYPTOCFGA_MAX (__CRYPTOCFGA_MAX - 1)
60};
Christopher Ferris48af7cb2017-02-21 12:35:09 -080061struct crypto_user_alg {
Christopher Ferris525ce912017-07-26 13:12:53 -070062 char cru_name[CRYPTO_MAX_NAME];
63 char cru_driver_name[CRYPTO_MAX_NAME];
64 char cru_module_name[CRYPTO_MAX_NAME];
Christopher Ferris48af7cb2017-02-21 12:35:09 -080065 __u32 cru_type;
Christopher Ferris49f525c2016-12-12 14:55:36 -080066 __u32 cru_mask;
Christopher Ferris05d08e92016-02-04 13:16:38 -080067 __u32 cru_refcnt;
68 __u32 cru_flags;
Christopher Ferris48af7cb2017-02-21 12:35:09 -080069};
Christopher Ferrisd842e432019-03-07 10:21:59 -080070struct crypto_stat_aead {
Christopher Ferris86a48372019-01-10 14:14:59 -080071 char type[CRYPTO_MAX_NAME];
Christopher Ferrisd842e432019-03-07 10:21:59 -080072 __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};
78struct 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};
88struct 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};
96struct 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};
104struct 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};
110struct 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};
117struct 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};
124struct crypto_stat_larval {
125 char type[CRYPTO_MAX_NAME];
Christopher Ferris86a48372019-01-10 14:14:59 -0800126};
Christopher Ferris49f525c2016-12-12 14:55:36 -0800127struct crypto_report_larval {
Christopher Ferris05d08e92016-02-04 13:16:38 -0800128 char type[CRYPTO_MAX_NAME];
129};
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800130struct crypto_report_hash {
Christopher Ferris49f525c2016-12-12 14:55:36 -0800131 char type[CRYPTO_MAX_NAME];
Christopher Ferris05d08e92016-02-04 13:16:38 -0800132 unsigned int blocksize;
133 unsigned int digestsize;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800134};
Christopher Ferris49f525c2016-12-12 14:55:36 -0800135struct crypto_report_cipher {
Christopher Ferris525ce912017-07-26 13:12:53 -0700136 char type[CRYPTO_MAX_NAME];
Christopher Ferris05d08e92016-02-04 13:16:38 -0800137 unsigned int blocksize;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800138 unsigned int min_keysize;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800139 unsigned int max_keysize;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800140};
141struct crypto_report_blkcipher {
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800142 char type[CRYPTO_MAX_NAME];
Christopher Ferris49f525c2016-12-12 14:55:36 -0800143 char geniv[CRYPTO_MAX_NAME];
Christopher Ferris05d08e92016-02-04 13:16:38 -0800144 unsigned int blocksize;
145 unsigned int min_keysize;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800146 unsigned int max_keysize;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800147 unsigned int ivsize;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800148};
149struct crypto_report_aead {
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800150 char type[CRYPTO_MAX_NAME];
Christopher Ferris49f525c2016-12-12 14:55:36 -0800151 char geniv[CRYPTO_MAX_NAME];
Christopher Ferris05d08e92016-02-04 13:16:38 -0800152 unsigned int blocksize;
153 unsigned int maxauthsize;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800154 unsigned int ivsize;
Christopher Ferris49f525c2016-12-12 14:55:36 -0800155};
Christopher Ferris05d08e92016-02-04 13:16:38 -0800156struct crypto_report_comp {
157 char type[CRYPTO_MAX_NAME];
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800158};
Christopher Ferris49f525c2016-12-12 14:55:36 -0800159struct crypto_report_rng {
Christopher Ferris05d08e92016-02-04 13:16:38 -0800160 char type[CRYPTO_MAX_NAME];
161 unsigned int seedsize;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800162};
Christopher Ferris05d08e92016-02-04 13:16:38 -0800163struct crypto_report_akcipher {
Christopher Ferris49f525c2016-12-12 14:55:36 -0800164 char type[CRYPTO_MAX_NAME];
165};
166struct crypto_report_kpp {
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800167 char type[CRYPTO_MAX_NAME];
168};
169struct crypto_report_acomp {
Christopher Ferris05d08e92016-02-04 13:16:38 -0800170 char type[CRYPTO_MAX_NAME];
171};
172#define CRYPTO_REPORT_MAXSIZE (sizeof(struct crypto_user_alg) + sizeof(struct crypto_report_blkcipher))
Christopher Ferris9584fa42019-12-09 15:36:13 -0800173#endif