logo

oasis-root

Compiled tree of Oasis Linux based on own branch at <https://hacktivis.me/git/oasis/> git clone https://anongit.hacktivis.me/git/oasis-root.git

cryptouser.h (5812B)


  1. /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
  2. /*
  3. * Crypto user configuration API.
  4. *
  5. * Copyright (C) 2011 secunet Security Networks AG
  6. * Copyright (C) 2011 Steffen Klassert <steffen.klassert@secunet.com>
  7. *
  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.
  11. *
  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.
  16. *
  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.
  20. */
  21. #ifndef _LINUX_CRYPTOUSER_H
  22. #define _LINUX_CRYPTOUSER_H
  23. #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_GETSTAT, /* No longer supported, do not use. */
  33. __CRYPTO_MSG_MAX
  34. };
  35. #define CRYPTO_MSG_MAX (__CRYPTO_MSG_MAX - 1)
  36. #define CRYPTO_NR_MSGTYPES (CRYPTO_MSG_MAX + 1 - CRYPTO_MSG_BASE)
  37. #define CRYPTO_MAX_NAME 64
  38. /* Netlink message attributes. */
  39. enum crypto_attr_type_t {
  40. CRYPTOCFGA_UNSPEC,
  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 */
  51. CRYPTOCFGA_REPORT_ACOMP, /* struct crypto_report_acomp */
  52. CRYPTOCFGA_STAT_LARVAL, /* No longer supported, do not use. */
  53. CRYPTOCFGA_STAT_HASH, /* No longer supported, do not use. */
  54. CRYPTOCFGA_STAT_BLKCIPHER, /* No longer supported, do not use. */
  55. CRYPTOCFGA_STAT_AEAD, /* No longer supported, do not use. */
  56. CRYPTOCFGA_STAT_COMPRESS, /* No longer supported, do not use. */
  57. CRYPTOCFGA_STAT_RNG, /* No longer supported, do not use. */
  58. CRYPTOCFGA_STAT_CIPHER, /* No longer supported, do not use. */
  59. CRYPTOCFGA_STAT_AKCIPHER, /* No longer supported, do not use. */
  60. CRYPTOCFGA_STAT_KPP, /* No longer supported, do not use. */
  61. CRYPTOCFGA_STAT_ACOMP, /* No longer supported, do not use. */
  62. __CRYPTOCFGA_MAX
  63. #define CRYPTOCFGA_MAX (__CRYPTOCFGA_MAX - 1)
  64. };
  65. struct crypto_user_alg {
  66. char cru_name[CRYPTO_MAX_NAME];
  67. char cru_driver_name[CRYPTO_MAX_NAME];
  68. char cru_module_name[CRYPTO_MAX_NAME];
  69. __u32 cru_type;
  70. __u32 cru_mask;
  71. __u32 cru_refcnt;
  72. __u32 cru_flags;
  73. };
  74. /* No longer supported, do not use. */
  75. struct crypto_stat_aead {
  76. char type[CRYPTO_MAX_NAME];
  77. __u64 stat_encrypt_cnt;
  78. __u64 stat_encrypt_tlen;
  79. __u64 stat_decrypt_cnt;
  80. __u64 stat_decrypt_tlen;
  81. __u64 stat_err_cnt;
  82. };
  83. /* No longer supported, do not use. */
  84. struct crypto_stat_akcipher {
  85. char type[CRYPTO_MAX_NAME];
  86. __u64 stat_encrypt_cnt;
  87. __u64 stat_encrypt_tlen;
  88. __u64 stat_decrypt_cnt;
  89. __u64 stat_decrypt_tlen;
  90. __u64 stat_verify_cnt;
  91. __u64 stat_sign_cnt;
  92. __u64 stat_err_cnt;
  93. };
  94. /* No longer supported, do not use. */
  95. struct crypto_stat_cipher {
  96. char type[CRYPTO_MAX_NAME];
  97. __u64 stat_encrypt_cnt;
  98. __u64 stat_encrypt_tlen;
  99. __u64 stat_decrypt_cnt;
  100. __u64 stat_decrypt_tlen;
  101. __u64 stat_err_cnt;
  102. };
  103. /* No longer supported, do not use. */
  104. struct crypto_stat_compress {
  105. char type[CRYPTO_MAX_NAME];
  106. __u64 stat_compress_cnt;
  107. __u64 stat_compress_tlen;
  108. __u64 stat_decompress_cnt;
  109. __u64 stat_decompress_tlen;
  110. __u64 stat_err_cnt;
  111. };
  112. /* No longer supported, do not use. */
  113. struct crypto_stat_hash {
  114. char type[CRYPTO_MAX_NAME];
  115. __u64 stat_hash_cnt;
  116. __u64 stat_hash_tlen;
  117. __u64 stat_err_cnt;
  118. };
  119. /* No longer supported, do not use. */
  120. struct crypto_stat_kpp {
  121. char type[CRYPTO_MAX_NAME];
  122. __u64 stat_setsecret_cnt;
  123. __u64 stat_generate_public_key_cnt;
  124. __u64 stat_compute_shared_secret_cnt;
  125. __u64 stat_err_cnt;
  126. };
  127. /* No longer supported, do not use. */
  128. struct crypto_stat_rng {
  129. char type[CRYPTO_MAX_NAME];
  130. __u64 stat_generate_cnt;
  131. __u64 stat_generate_tlen;
  132. __u64 stat_seed_cnt;
  133. __u64 stat_err_cnt;
  134. };
  135. /* No longer supported, do not use. */
  136. struct crypto_stat_larval {
  137. char type[CRYPTO_MAX_NAME];
  138. };
  139. struct crypto_report_larval {
  140. char type[CRYPTO_MAX_NAME];
  141. };
  142. struct crypto_report_hash {
  143. char type[CRYPTO_MAX_NAME];
  144. unsigned int blocksize;
  145. unsigned int digestsize;
  146. };
  147. struct crypto_report_cipher {
  148. char type[CRYPTO_MAX_NAME];
  149. unsigned int blocksize;
  150. unsigned int min_keysize;
  151. unsigned int max_keysize;
  152. };
  153. struct crypto_report_blkcipher {
  154. char type[CRYPTO_MAX_NAME];
  155. char geniv[CRYPTO_MAX_NAME];
  156. unsigned int blocksize;
  157. unsigned int min_keysize;
  158. unsigned int max_keysize;
  159. unsigned int ivsize;
  160. };
  161. struct crypto_report_aead {
  162. char type[CRYPTO_MAX_NAME];
  163. char geniv[CRYPTO_MAX_NAME];
  164. unsigned int blocksize;
  165. unsigned int maxauthsize;
  166. unsigned int ivsize;
  167. };
  168. struct crypto_report_comp {
  169. char type[CRYPTO_MAX_NAME];
  170. };
  171. struct crypto_report_rng {
  172. char type[CRYPTO_MAX_NAME];
  173. unsigned int seedsize;
  174. };
  175. struct crypto_report_akcipher {
  176. char type[CRYPTO_MAX_NAME];
  177. };
  178. struct crypto_report_kpp {
  179. char type[CRYPTO_MAX_NAME];
  180. };
  181. struct crypto_report_acomp {
  182. char type[CRYPTO_MAX_NAME];
  183. };
  184. #define CRYPTO_REPORT_MAXSIZE (sizeof(struct crypto_user_alg) + \
  185. sizeof(struct crypto_report_blkcipher))
  186. #endif /* _LINUX_CRYPTOUSER_H */