• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // SPDX-License-Identifier: GPL-2.0-or-later
2 /*
3  * Copyright 2019 Google LLC
4  */
5 
6 #ifndef IF_ALG_H__
7 #define IF_ALG_H__
8 
9 #ifdef HAVE_LINUX_IF_ALG_H
10 #  include <linux/if_alg.h>
11 #else
12 #  include <stdint.h>
13 
14 struct sockaddr_alg {
15 	uint16_t	salg_family;
16 	uint8_t		salg_type[14];
17 	uint32_t	salg_feat;
18 	uint32_t	salg_mask;
19 	uint8_t		salg_name[64];
20 };
21 
22 struct af_alg_iv {
23 	uint32_t	ivlen;
24 	uint8_t		iv[0];
25 };
26 
27 #define ALG_SET_KEY		1
28 #define ALG_SET_IV		2
29 #define ALG_SET_OP		3
30 #define ALG_SET_AEAD_ASSOCLEN	4
31 #define ALG_SET_AEAD_AUTHSIZE	5
32 
33 #define ALG_OP_DECRYPT		0
34 #define ALG_OP_ENCRYPT		1
35 
36 #endif /* !HAVE_LINUX_IF_ALG_H */
37 
38 #endif /* IF_ALG_H__ */
39