summaryrefslogtreecommitdiffstats
path: root/kernel/tests/include/lapi/if_alg.h
blob: 9c04a444cac6606ea7010fe07a6c238f2dac1411 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
// SPDX-License-Identifier: GPL-2.0-or-later
/*
 * Copyright 2019 Google LLC
 */

#ifndef IF_ALG_H__
#define IF_ALG_H__

#ifdef HAVE_LINUX_IF_ALG_H
#  include <linux/if_alg.h>
#endif
#  include <stdint.h>

#ifndef HAVE_STRUCT_SOCKADDR_ALG
struct sockaddr_alg {
	uint16_t	salg_family;
	uint8_t		salg_type[14];
	uint32_t	salg_feat;
	uint32_t	salg_mask;
	uint8_t		salg_name[64];
};
#endif

#ifndef HAVE_STRUCT_AF_ALG_IV
struct af_alg_iv {
	uint32_t	ivlen;
	uint8_t		iv[0];
};
#endif

#ifndef ALG_SET_KEY
# define ALG_SET_KEY		1
#endif

#ifndef ALG_SET_IV
# define ALG_SET_IV		2
#endif

#ifndef ALG_SET_OP
# define ALG_SET_OP		3
#endif

#ifndef ALG_SET_AEAD_ASSOCLEN
# define ALG_SET_AEAD_ASSOCLEN	4
#endif

#ifndef ALG_SET_AEAD_AUTHSIZE
# define ALG_SET_AEAD_AUTHSIZE	5
#endif

#ifndef ALG_OP_DECRYPT
# define ALG_OP_DECRYPT		0
#endif

#ifndef ALG_OP_ENCRYPT
# define ALG_OP_ENCRYPT		1
#endif

#endif /* IF_ALG_H__ */