cryptouser.h 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  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. /* Netlink configuration messages. */
  21. enum {
  22. CRYPTO_MSG_BASE = 0x10,
  23. CRYPTO_MSG_NEWALG = 0x10,
  24. CRYPTO_MSG_DELALG,
  25. CRYPTO_MSG_UPDATEALG,
  26. CRYPTO_MSG_GETALG,
  27. __CRYPTO_MSG_MAX
  28. };
  29. #define CRYPTO_MSG_MAX (__CRYPTO_MSG_MAX - 1)
  30. #define CRYPTO_NR_MSGTYPES (CRYPTO_MSG_MAX + 1 - CRYPTO_MSG_BASE)
  31. #define CRYPTO_MAX_NAME CRYPTO_MAX_ALG_NAME
  32. /* Netlink message attributes. */
  33. enum crypto_attr_type_t {
  34. CRYPTOCFGA_UNSPEC,
  35. CRYPTOCFGA_PRIORITY_VAL, /* __u32 */
  36. CRYPTOCFGA_REPORT_LARVAL, /* struct crypto_report_larval */
  37. CRYPTOCFGA_REPORT_HASH, /* struct crypto_report_hash */
  38. CRYPTOCFGA_REPORT_BLKCIPHER, /* struct crypto_report_blkcipher */
  39. __CRYPTOCFGA_MAX
  40. #define CRYPTOCFGA_MAX (__CRYPTOCFGA_MAX - 1)
  41. };
  42. struct crypto_user_alg {
  43. char cru_name[CRYPTO_MAX_ALG_NAME];
  44. char cru_driver_name[CRYPTO_MAX_ALG_NAME];
  45. char cru_module_name[CRYPTO_MAX_ALG_NAME];
  46. __u32 cru_type;
  47. __u32 cru_mask;
  48. __u32 cru_refcnt;
  49. __u32 cru_flags;
  50. };
  51. struct crypto_report_larval {
  52. char type[CRYPTO_MAX_NAME];
  53. };
  54. struct crypto_report_hash {
  55. char type[CRYPTO_MAX_NAME];
  56. unsigned int blocksize;
  57. unsigned int digestsize;
  58. };
  59. struct crypto_report_blkcipher {
  60. char type[CRYPTO_MAX_NAME];
  61. char geniv[CRYPTO_MAX_NAME];
  62. unsigned int blocksize;
  63. unsigned int min_keysize;
  64. unsigned int max_keysize;
  65. unsigned int ivsize;
  66. };