hc
2024-01-05 071106ecf68c401173c58808b1cf5f68cc50d390
kernel/include/uapi/linux/cryptouser.h
....@@ -19,6 +19,9 @@
1919 * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
2020 */
2121
22
+#ifndef _UAPI_LINUX_CRYPTOUSER_H
23
+#define _UAPI_LINUX_CRYPTOUSER_H
24
+
2225 #include <linux/types.h>
2326
2427 /* Netlink configuration messages. */
....@@ -29,6 +32,7 @@
2932 CRYPTO_MSG_UPDATEALG,
3033 CRYPTO_MSG_GETALG,
3134 CRYPTO_MSG_DELRNG,
35
+ CRYPTO_MSG_GETSTAT,
3236 __CRYPTO_MSG_MAX
3337 };
3438 #define CRYPTO_MSG_MAX (__CRYPTO_MSG_MAX - 1)
....@@ -50,6 +54,16 @@
5054 CRYPTOCFGA_REPORT_AKCIPHER, /* struct crypto_report_akcipher */
5155 CRYPTOCFGA_REPORT_KPP, /* struct crypto_report_kpp */
5256 CRYPTOCFGA_REPORT_ACOMP, /* struct crypto_report_acomp */
57
+ CRYPTOCFGA_STAT_LARVAL, /* struct crypto_stat */
58
+ CRYPTOCFGA_STAT_HASH, /* struct crypto_stat */
59
+ CRYPTOCFGA_STAT_BLKCIPHER, /* struct crypto_stat */
60
+ CRYPTOCFGA_STAT_AEAD, /* struct crypto_stat */
61
+ CRYPTOCFGA_STAT_COMPRESS, /* struct crypto_stat */
62
+ CRYPTOCFGA_STAT_RNG, /* struct crypto_stat */
63
+ CRYPTOCFGA_STAT_CIPHER, /* struct crypto_stat */
64
+ CRYPTOCFGA_STAT_AKCIPHER, /* struct crypto_stat */
65
+ CRYPTOCFGA_STAT_KPP, /* struct crypto_stat */
66
+ CRYPTOCFGA_STAT_ACOMP, /* struct crypto_stat */
5367 __CRYPTOCFGA_MAX
5468
5569 #define CRYPTOCFGA_MAX (__CRYPTOCFGA_MAX - 1)
....@@ -63,6 +77,71 @@
6377 __u32 cru_mask;
6478 __u32 cru_refcnt;
6579 __u32 cru_flags;
80
+};
81
+
82
+struct crypto_stat_aead {
83
+ char type[CRYPTO_MAX_NAME];
84
+ __u64 stat_encrypt_cnt;
85
+ __u64 stat_encrypt_tlen;
86
+ __u64 stat_decrypt_cnt;
87
+ __u64 stat_decrypt_tlen;
88
+ __u64 stat_err_cnt;
89
+};
90
+
91
+struct crypto_stat_akcipher {
92
+ char type[CRYPTO_MAX_NAME];
93
+ __u64 stat_encrypt_cnt;
94
+ __u64 stat_encrypt_tlen;
95
+ __u64 stat_decrypt_cnt;
96
+ __u64 stat_decrypt_tlen;
97
+ __u64 stat_verify_cnt;
98
+ __u64 stat_sign_cnt;
99
+ __u64 stat_err_cnt;
100
+};
101
+
102
+struct crypto_stat_cipher {
103
+ char type[CRYPTO_MAX_NAME];
104
+ __u64 stat_encrypt_cnt;
105
+ __u64 stat_encrypt_tlen;
106
+ __u64 stat_decrypt_cnt;
107
+ __u64 stat_decrypt_tlen;
108
+ __u64 stat_err_cnt;
109
+};
110
+
111
+struct crypto_stat_compress {
112
+ char type[CRYPTO_MAX_NAME];
113
+ __u64 stat_compress_cnt;
114
+ __u64 stat_compress_tlen;
115
+ __u64 stat_decompress_cnt;
116
+ __u64 stat_decompress_tlen;
117
+ __u64 stat_err_cnt;
118
+};
119
+
120
+struct crypto_stat_hash {
121
+ char type[CRYPTO_MAX_NAME];
122
+ __u64 stat_hash_cnt;
123
+ __u64 stat_hash_tlen;
124
+ __u64 stat_err_cnt;
125
+};
126
+
127
+struct crypto_stat_kpp {
128
+ char type[CRYPTO_MAX_NAME];
129
+ __u64 stat_setsecret_cnt;
130
+ __u64 stat_generate_public_key_cnt;
131
+ __u64 stat_compute_shared_secret_cnt;
132
+ __u64 stat_err_cnt;
133
+};
134
+
135
+struct crypto_stat_rng {
136
+ char type[CRYPTO_MAX_NAME];
137
+ __u64 stat_generate_cnt;
138
+ __u64 stat_generate_tlen;
139
+ __u64 stat_seed_cnt;
140
+ __u64 stat_err_cnt;
141
+};
142
+
143
+struct crypto_stat_larval {
144
+ char type[CRYPTO_MAX_NAME];
66145 };
67146
68147 struct crypto_report_larval {
....@@ -122,3 +201,5 @@
122201
123202 #define CRYPTO_REPORT_MAXSIZE (sizeof(struct crypto_user_alg) + \
124203 sizeof(struct crypto_report_blkcipher))
204
+
205
+#endif /* _UAPI_LINUX_CRYPTOUSER_H */