These changes are the raw update to linux-4.4.6-rt14. Kernel sources
[kvmfornfv.git] / kernel / include / uapi / linux / cryptouser.h
1 /*
2  * Crypto user configuration API.
3  *
4  * Copyright (C) 2011 secunet Security Networks AG
5  * Copyright (C) 2011 Steffen Klassert <steffen.klassert@secunet.com>
6  *
7  * This program is free software; you can redistribute it and/or modify it
8  * under the terms and conditions of the GNU General Public License,
9  * version 2, as published by the Free Software Foundation.
10  *
11  * This program is distributed in the hope it will be useful, but WITHOUT
12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
14  * more details.
15  *
16  * You should have received a copy of the GNU General Public License along with
17  * this program; if not, write to the Free Software Foundation, Inc.,
18  * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
19  */
20
21 /* Netlink configuration messages.  */
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_MAX
30 };
31 #define CRYPTO_MSG_MAX (__CRYPTO_MSG_MAX - 1)
32 #define CRYPTO_NR_MSGTYPES (CRYPTO_MSG_MAX + 1 - CRYPTO_MSG_BASE)
33
34 #define CRYPTO_MAX_NAME CRYPTO_MAX_ALG_NAME
35
36 /* Netlink message attributes.  */
37 enum crypto_attr_type_t {
38         CRYPTOCFGA_UNSPEC,
39         CRYPTOCFGA_PRIORITY_VAL,        /* __u32 */
40         CRYPTOCFGA_REPORT_LARVAL,       /* struct crypto_report_larval */
41         CRYPTOCFGA_REPORT_HASH,         /* struct crypto_report_hash */
42         CRYPTOCFGA_REPORT_BLKCIPHER,    /* struct crypto_report_blkcipher */
43         CRYPTOCFGA_REPORT_AEAD,         /* struct crypto_report_aead */
44         CRYPTOCFGA_REPORT_COMPRESS,     /* struct crypto_report_comp */
45         CRYPTOCFGA_REPORT_RNG,          /* struct crypto_report_rng */
46         CRYPTOCFGA_REPORT_CIPHER,       /* struct crypto_report_cipher */
47         CRYPTOCFGA_REPORT_AKCIPHER,     /* struct crypto_report_akcipher */
48         __CRYPTOCFGA_MAX
49
50 #define CRYPTOCFGA_MAX (__CRYPTOCFGA_MAX - 1)
51 };
52
53 struct crypto_user_alg {
54         char cru_name[CRYPTO_MAX_ALG_NAME];
55         char cru_driver_name[CRYPTO_MAX_ALG_NAME];
56         char cru_module_name[CRYPTO_MAX_ALG_NAME];
57         __u32 cru_type;
58         __u32 cru_mask;
59         __u32 cru_refcnt;
60         __u32 cru_flags;
61 };
62
63 struct crypto_report_larval {
64         char type[CRYPTO_MAX_NAME];
65 };
66
67 struct crypto_report_hash {
68         char type[CRYPTO_MAX_NAME];
69         unsigned int blocksize;
70         unsigned int digestsize;
71 };
72
73 struct crypto_report_cipher {
74         char type[CRYPTO_MAX_ALG_NAME];
75         unsigned int blocksize;
76         unsigned int min_keysize;
77         unsigned int max_keysize;
78 };
79
80 struct crypto_report_blkcipher {
81         char type[CRYPTO_MAX_NAME];
82         char geniv[CRYPTO_MAX_NAME];
83         unsigned int blocksize;
84         unsigned int min_keysize;
85         unsigned int max_keysize;
86         unsigned int ivsize;
87 };
88
89 struct crypto_report_aead {
90         char type[CRYPTO_MAX_NAME];
91         char geniv[CRYPTO_MAX_NAME];
92         unsigned int blocksize;
93         unsigned int maxauthsize;
94         unsigned int ivsize;
95 };
96
97 struct crypto_report_comp {
98         char type[CRYPTO_MAX_NAME];
99 };
100
101 struct crypto_report_rng {
102         char type[CRYPTO_MAX_NAME];
103         unsigned int seedsize;
104 };
105
106 struct crypto_report_akcipher {
107         char type[CRYPTO_MAX_NAME];
108 };
109
110 #define CRYPTO_REPORT_MAXSIZE (sizeof(struct crypto_user_alg) + \
111                                sizeof(struct crypto_report_blkcipher))