2 * Crypto user configuration API.
4 * Copyright (C) 2011 secunet Security Networks AG
5 * Copyright (C) 2011 Steffen Klassert <steffen.klassert@secunet.com>
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.
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
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.
21 #include <linux/types.h>
23 /* Netlink configuration messages. */
25 CRYPTO_MSG_BASE = 0x10,
26 CRYPTO_MSG_NEWALG = 0x10,
33 #define CRYPTO_MSG_MAX (__CRYPTO_MSG_MAX - 1)
34 #define CRYPTO_NR_MSGTYPES (CRYPTO_MSG_MAX + 1 - CRYPTO_MSG_BASE)
36 #define CRYPTO_MAX_NAME CRYPTO_MAX_ALG_NAME
38 /* Netlink message attributes. */
39 enum crypto_attr_type_t {
41 CRYPTOCFGA_PRIORITY_VAL, /* __u32 */
42 CRYPTOCFGA_REPORT_LARVAL, /* struct crypto_report_larval */
43 CRYPTOCFGA_REPORT_HASH, /* struct crypto_report_hash */
44 CRYPTOCFGA_REPORT_BLKCIPHER, /* struct crypto_report_blkcipher */
45 CRYPTOCFGA_REPORT_AEAD, /* struct crypto_report_aead */
46 CRYPTOCFGA_REPORT_COMPRESS, /* struct crypto_report_comp */
47 CRYPTOCFGA_REPORT_RNG, /* struct crypto_report_rng */
48 CRYPTOCFGA_REPORT_CIPHER, /* struct crypto_report_cipher */
49 CRYPTOCFGA_REPORT_AKCIPHER, /* struct crypto_report_akcipher */
50 CRYPTOCFGA_REPORT_KPP, /* struct crypto_report_kpp */
53 #define CRYPTOCFGA_MAX (__CRYPTOCFGA_MAX - 1)
56 struct crypto_user_alg {
57 char cru_name[CRYPTO_MAX_ALG_NAME];
58 char cru_driver_name[CRYPTO_MAX_ALG_NAME];
59 char cru_module_name[CRYPTO_MAX_ALG_NAME];
66 struct crypto_report_larval {
67 char type[CRYPTO_MAX_NAME];
70 struct crypto_report_hash {
71 char type[CRYPTO_MAX_NAME];
72 unsigned int blocksize;
73 unsigned int digestsize;
76 struct crypto_report_cipher {
77 char type[CRYPTO_MAX_ALG_NAME];
78 unsigned int blocksize;
79 unsigned int min_keysize;
80 unsigned int max_keysize;
83 struct crypto_report_blkcipher {
84 char type[CRYPTO_MAX_NAME];
85 char geniv[CRYPTO_MAX_NAME];
86 unsigned int blocksize;
87 unsigned int min_keysize;
88 unsigned int max_keysize;
92 struct crypto_report_aead {
93 char type[CRYPTO_MAX_NAME];
94 char geniv[CRYPTO_MAX_NAME];
95 unsigned int blocksize;
96 unsigned int maxauthsize;
100 struct crypto_report_comp {
101 char type[CRYPTO_MAX_NAME];
104 struct crypto_report_rng {
105 char type[CRYPTO_MAX_NAME];
106 unsigned int seedsize;
109 struct crypto_report_akcipher {
110 char type[CRYPTO_MAX_NAME];
113 struct crypto_report_kpp {
114 char type[CRYPTO_MAX_NAME];
117 #define CRYPTO_REPORT_MAXSIZE (sizeof(struct crypto_user_alg) + \
118 sizeof(struct crypto_report_blkcipher))