if_alg.h 946 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. /* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
  2. /*
  3. * if_alg: User-space algorithm interface
  4. *
  5. * Copyright (c) 2010 Herbert Xu <herbert@gondor.apana.org.au>
  6. *
  7. * This program is free software; you can redistribute it and/or modify it
  8. * under the terms of the GNU General Public License as published by the Free
  9. * Software Foundation; either version 2 of the License, or (at your option)
  10. * any later version.
  11. *
  12. */
  13. #ifndef _LINUX_IF_ALG_H
  14. #define _LINUX_IF_ALG_H
  15. #include <linux/types.h>
  16. struct sockaddr_alg {
  17. __u16 salg_family;
  18. __u8 salg_type[14];
  19. __u32 salg_feat;
  20. __u32 salg_mask;
  21. __u8 salg_name[64];
  22. };
  23. struct af_alg_iv {
  24. __u32 ivlen;
  25. __u8 iv[0];
  26. };
  27. /* Socket options */
  28. #define ALG_SET_KEY 1
  29. #define ALG_SET_IV 2
  30. #define ALG_SET_OP 3
  31. #define ALG_SET_AEAD_ASSOCLEN 4
  32. #define ALG_SET_AEAD_AUTHSIZE 5
  33. /* Operations */
  34. #define ALG_OP_DECRYPT 0
  35. #define ALG_OP_ENCRYPT 1
  36. #endif /* _LINUX_IF_ALG_H */