Merge tag 'powerpc-6.14-1' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc...
[linux-stable.git] / include / uapi / linux / cryptouser.h
blobdb05e04199726c4cb23c7d864a811546ed8ea830
1 /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2 /*
3 * Crypto user configuration API.
5 * Copyright (C) 2011 secunet Security Networks AG
6 * Copyright (C) 2011 Steffen Klassert <steffen.klassert@secunet.com>
8 * This program is free software; you can redistribute it and/or modify it
9 * under the terms and conditions of the GNU General Public License,
10 * version 2, as published by the Free Software Foundation.
12 * This program is distributed in the hope it will be useful, but WITHOUT
13 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
15 * more details.
17 * You should have received a copy of the GNU General Public License along with
18 * this program; if not, write to the Free Software Foundation, Inc.,
19 * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
22 #ifndef _UAPI_LINUX_CRYPTOUSER_H
23 #define _UAPI_LINUX_CRYPTOUSER_H
25 #include <linux/types.h>
27 /* Netlink configuration messages. */
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, /* No longer supported, do not use. */
36 __CRYPTO_MSG_MAX
38 #define CRYPTO_MSG_MAX (__CRYPTO_MSG_MAX - 1)
39 #define CRYPTO_NR_MSGTYPES (CRYPTO_MSG_MAX + 1 - CRYPTO_MSG_BASE)
41 #define CRYPTO_MAX_NAME 64
43 /* Netlink message attributes. */
44 enum crypto_attr_type_t {
45 CRYPTOCFGA_UNSPEC,
46 CRYPTOCFGA_PRIORITY_VAL, /* __u32 */
47 CRYPTOCFGA_REPORT_LARVAL, /* struct crypto_report_larval */
48 CRYPTOCFGA_REPORT_HASH, /* struct crypto_report_hash */
49 CRYPTOCFGA_REPORT_BLKCIPHER, /* struct crypto_report_blkcipher */
50 CRYPTOCFGA_REPORT_AEAD, /* struct crypto_report_aead */
51 CRYPTOCFGA_REPORT_COMPRESS, /* struct crypto_report_comp */
52 CRYPTOCFGA_REPORT_RNG, /* struct crypto_report_rng */
53 CRYPTOCFGA_REPORT_CIPHER, /* struct crypto_report_cipher */
54 CRYPTOCFGA_REPORT_AKCIPHER, /* struct crypto_report_akcipher */
55 CRYPTOCFGA_REPORT_KPP, /* struct crypto_report_kpp */
56 CRYPTOCFGA_REPORT_ACOMP, /* struct crypto_report_acomp */
57 CRYPTOCFGA_STAT_LARVAL, /* No longer supported, do not use. */
58 CRYPTOCFGA_STAT_HASH, /* No longer supported, do not use. */
59 CRYPTOCFGA_STAT_BLKCIPHER, /* No longer supported, do not use. */
60 CRYPTOCFGA_STAT_AEAD, /* No longer supported, do not use. */
61 CRYPTOCFGA_STAT_COMPRESS, /* No longer supported, do not use. */
62 CRYPTOCFGA_STAT_RNG, /* No longer supported, do not use. */
63 CRYPTOCFGA_STAT_CIPHER, /* No longer supported, do not use. */
64 CRYPTOCFGA_STAT_AKCIPHER, /* No longer supported, do not use. */
65 CRYPTOCFGA_STAT_KPP, /* No longer supported, do not use. */
66 CRYPTOCFGA_STAT_ACOMP, /* No longer supported, do not use. */
67 CRYPTOCFGA_REPORT_SIG, /* struct crypto_report_sig */
68 __CRYPTOCFGA_MAX
70 #define CRYPTOCFGA_MAX (__CRYPTOCFGA_MAX - 1)
73 struct crypto_user_alg {
74 char cru_name[CRYPTO_MAX_NAME];
75 char cru_driver_name[CRYPTO_MAX_NAME];
76 char cru_module_name[CRYPTO_MAX_NAME];
77 __u32 cru_type;
78 __u32 cru_mask;
79 __u32 cru_refcnt;
80 __u32 cru_flags;
83 /* No longer supported, do not use. */
84 struct crypto_stat_aead {
85 char type[CRYPTO_MAX_NAME];
86 __u64 stat_encrypt_cnt;
87 __u64 stat_encrypt_tlen;
88 __u64 stat_decrypt_cnt;
89 __u64 stat_decrypt_tlen;
90 __u64 stat_err_cnt;
93 /* No longer supported, do not use. */
94 struct crypto_stat_akcipher {
95 char type[CRYPTO_MAX_NAME];
96 __u64 stat_encrypt_cnt;
97 __u64 stat_encrypt_tlen;
98 __u64 stat_decrypt_cnt;
99 __u64 stat_decrypt_tlen;
100 __u64 stat_verify_cnt;
101 __u64 stat_sign_cnt;
102 __u64 stat_err_cnt;
105 /* No longer supported, do not use. */
106 struct crypto_stat_cipher {
107 char type[CRYPTO_MAX_NAME];
108 __u64 stat_encrypt_cnt;
109 __u64 stat_encrypt_tlen;
110 __u64 stat_decrypt_cnt;
111 __u64 stat_decrypt_tlen;
112 __u64 stat_err_cnt;
115 /* No longer supported, do not use. */
116 struct crypto_stat_compress {
117 char type[CRYPTO_MAX_NAME];
118 __u64 stat_compress_cnt;
119 __u64 stat_compress_tlen;
120 __u64 stat_decompress_cnt;
121 __u64 stat_decompress_tlen;
122 __u64 stat_err_cnt;
125 /* No longer supported, do not use. */
126 struct crypto_stat_hash {
127 char type[CRYPTO_MAX_NAME];
128 __u64 stat_hash_cnt;
129 __u64 stat_hash_tlen;
130 __u64 stat_err_cnt;
133 /* No longer supported, do not use. */
134 struct crypto_stat_kpp {
135 char type[CRYPTO_MAX_NAME];
136 __u64 stat_setsecret_cnt;
137 __u64 stat_generate_public_key_cnt;
138 __u64 stat_compute_shared_secret_cnt;
139 __u64 stat_err_cnt;
142 /* No longer supported, do not use. */
143 struct crypto_stat_rng {
144 char type[CRYPTO_MAX_NAME];
145 __u64 stat_generate_cnt;
146 __u64 stat_generate_tlen;
147 __u64 stat_seed_cnt;
148 __u64 stat_err_cnt;
151 /* No longer supported, do not use. */
152 struct crypto_stat_larval {
153 char type[CRYPTO_MAX_NAME];
156 struct crypto_report_larval {
157 char type[CRYPTO_MAX_NAME];
160 struct crypto_report_hash {
161 char type[CRYPTO_MAX_NAME];
162 unsigned int blocksize;
163 unsigned int digestsize;
166 struct crypto_report_cipher {
167 char type[CRYPTO_MAX_NAME];
168 unsigned int blocksize;
169 unsigned int min_keysize;
170 unsigned int max_keysize;
173 struct crypto_report_blkcipher {
174 char type[CRYPTO_MAX_NAME];
175 char geniv[CRYPTO_MAX_NAME];
176 unsigned int blocksize;
177 unsigned int min_keysize;
178 unsigned int max_keysize;
179 unsigned int ivsize;
182 struct crypto_report_aead {
183 char type[CRYPTO_MAX_NAME];
184 char geniv[CRYPTO_MAX_NAME];
185 unsigned int blocksize;
186 unsigned int maxauthsize;
187 unsigned int ivsize;
190 struct crypto_report_comp {
191 char type[CRYPTO_MAX_NAME];
194 struct crypto_report_rng {
195 char type[CRYPTO_MAX_NAME];
196 unsigned int seedsize;
199 struct crypto_report_akcipher {
200 char type[CRYPTO_MAX_NAME];
203 struct crypto_report_kpp {
204 char type[CRYPTO_MAX_NAME];
207 struct crypto_report_acomp {
208 char type[CRYPTO_MAX_NAME];
211 struct crypto_report_sig {
212 char type[CRYPTO_MAX_NAME];
215 #define CRYPTO_REPORT_MAXSIZE (sizeof(struct crypto_user_alg) + \
216 sizeof(struct crypto_report_blkcipher))
218 #endif /* _UAPI_LINUX_CRYPTOUSER_H */