blob: 48030c7dfb51939532f43ed142bfadb5a27b35c8 [file] [log] [blame]
Steffen Klasserta38f7902011-09-27 07:23:50 +02001/*
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. */
22enum {
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_MAX
29};
30#define CRYPTO_MSG_MAX (__CRYPTO_MSG_MAX - 1)
31#define CRYPTO_NR_MSGTYPES (CRYPTO_MSG_MAX + 1 - CRYPTO_MSG_BASE)
32
33#define CRYPTO_MAX_NAME CRYPTO_MAX_ALG_NAME
34
35/* Netlink message attributes. */
36enum crypto_attr_type_t {
37 CRYPTOCFGA_UNSPEC,
38 CRYPTOCFGA_PRIORITY_VAL, /* __u32 */
Steffen Klassert6c5a86f52011-09-27 07:25:05 +020039 CRYPTOCFGA_REPORT_LARVAL, /* struct crypto_report_larval */
Steffen Klassertf4d663c2011-09-27 07:26:10 +020040 CRYPTOCFGA_REPORT_HASH, /* struct crypto_report_hash */
Steffen Klassert50496a12011-09-27 07:41:54 +020041 CRYPTOCFGA_REPORT_BLKCIPHER, /* struct crypto_report_blkcipher */
Steffen Klassert6ad414f2011-09-27 07:44:27 +020042 CRYPTOCFGA_REPORT_AEAD, /* struct crypto_report_aead */
Steffen Klasserta38f7902011-09-27 07:23:50 +020043 __CRYPTOCFGA_MAX
44
45#define CRYPTOCFGA_MAX (__CRYPTOCFGA_MAX - 1)
46};
47
48struct crypto_user_alg {
49 char cru_name[CRYPTO_MAX_ALG_NAME];
50 char cru_driver_name[CRYPTO_MAX_ALG_NAME];
51 char cru_module_name[CRYPTO_MAX_ALG_NAME];
52 __u32 cru_type;
53 __u32 cru_mask;
54 __u32 cru_refcnt;
55 __u32 cru_flags;
56};
Steffen Klassert6c5a86f52011-09-27 07:25:05 +020057
58struct crypto_report_larval {
59 char type[CRYPTO_MAX_NAME];
60};
Steffen Klassertf4d663c2011-09-27 07:26:10 +020061
62struct crypto_report_hash {
63 char type[CRYPTO_MAX_NAME];
64 unsigned int blocksize;
65 unsigned int digestsize;
66};
Steffen Klassert50496a12011-09-27 07:41:54 +020067
68struct crypto_report_blkcipher {
69 char type[CRYPTO_MAX_NAME];
70 char geniv[CRYPTO_MAX_NAME];
71 unsigned int blocksize;
72 unsigned int min_keysize;
73 unsigned int max_keysize;
74 unsigned int ivsize;
75};
Steffen Klassert6ad414f2011-09-27 07:44:27 +020076
77struct crypto_report_aead {
78 char type[CRYPTO_MAX_NAME];
79 char geniv[CRYPTO_MAX_NAME];
80 unsigned int blocksize;
81 unsigned int maxauthsize;
82 unsigned int ivsize;
83};