Merge tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost
[cris-mirror.git] / include / uapi / linux / cryptouser.h
blob19bf0ca6d6353c41d4037c55c005078846ceabb7
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 #include <linux/types.h>
24 /* Netlink configuration messages. */
25 enum {
26 CRYPTO_MSG_BASE = 0x10,
27 CRYPTO_MSG_NEWALG = 0x10,
28 CRYPTO_MSG_DELALG,
29 CRYPTO_MSG_UPDATEALG,
30 CRYPTO_MSG_GETALG,
31 CRYPTO_MSG_DELRNG,
32 __CRYPTO_MSG_MAX
34 #define CRYPTO_MSG_MAX (__CRYPTO_MSG_MAX - 1)
35 #define CRYPTO_NR_MSGTYPES (CRYPTO_MSG_MAX + 1 - CRYPTO_MSG_BASE)
37 #define CRYPTO_MAX_NAME 64
39 /* Netlink message attributes. */
40 enum crypto_attr_type_t {
41 CRYPTOCFGA_UNSPEC,
42 CRYPTOCFGA_PRIORITY_VAL, /* __u32 */
43 CRYPTOCFGA_REPORT_LARVAL, /* struct crypto_report_larval */
44 CRYPTOCFGA_REPORT_HASH, /* struct crypto_report_hash */
45 CRYPTOCFGA_REPORT_BLKCIPHER, /* struct crypto_report_blkcipher */
46 CRYPTOCFGA_REPORT_AEAD, /* struct crypto_report_aead */
47 CRYPTOCFGA_REPORT_COMPRESS, /* struct crypto_report_comp */
48 CRYPTOCFGA_REPORT_RNG, /* struct crypto_report_rng */
49 CRYPTOCFGA_REPORT_CIPHER, /* struct crypto_report_cipher */
50 CRYPTOCFGA_REPORT_AKCIPHER, /* struct crypto_report_akcipher */
51 CRYPTOCFGA_REPORT_KPP, /* struct crypto_report_kpp */
52 CRYPTOCFGA_REPORT_ACOMP, /* struct crypto_report_acomp */
53 __CRYPTOCFGA_MAX
55 #define CRYPTOCFGA_MAX (__CRYPTOCFGA_MAX - 1)
58 struct crypto_user_alg {
59 char cru_name[CRYPTO_MAX_NAME];
60 char cru_driver_name[CRYPTO_MAX_NAME];
61 char cru_module_name[CRYPTO_MAX_NAME];
62 __u32 cru_type;
63 __u32 cru_mask;
64 __u32 cru_refcnt;
65 __u32 cru_flags;
68 struct crypto_report_larval {
69 char type[CRYPTO_MAX_NAME];
72 struct crypto_report_hash {
73 char type[CRYPTO_MAX_NAME];
74 unsigned int blocksize;
75 unsigned int digestsize;
78 struct crypto_report_cipher {
79 char type[CRYPTO_MAX_NAME];
80 unsigned int blocksize;
81 unsigned int min_keysize;
82 unsigned int max_keysize;
85 struct crypto_report_blkcipher {
86 char type[CRYPTO_MAX_NAME];
87 char geniv[CRYPTO_MAX_NAME];
88 unsigned int blocksize;
89 unsigned int min_keysize;
90 unsigned int max_keysize;
91 unsigned int ivsize;
94 struct crypto_report_aead {
95 char type[CRYPTO_MAX_NAME];
96 char geniv[CRYPTO_MAX_NAME];
97 unsigned int blocksize;
98 unsigned int maxauthsize;
99 unsigned int ivsize;
102 struct crypto_report_comp {
103 char type[CRYPTO_MAX_NAME];
106 struct crypto_report_rng {
107 char type[CRYPTO_MAX_NAME];
108 unsigned int seedsize;
111 struct crypto_report_akcipher {
112 char type[CRYPTO_MAX_NAME];
115 struct crypto_report_kpp {
116 char type[CRYPTO_MAX_NAME];
119 struct crypto_report_acomp {
120 char type[CRYPTO_MAX_NAME];
123 #define CRYPTO_REPORT_MAXSIZE (sizeof(struct crypto_user_alg) + \
124 sizeof(struct crypto_report_blkcipher))