blob: bc2bcdec377b4b75738166b0b047a9c50d6a676d [file] [log] [blame]
Christopher Ferris25981132017-11-14 16:53:49 -08001/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
Ben Cheng30692c62013-10-15 18:26:18 -07002/*
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
14#ifndef _LINUX_IF_ALG_H
15#define _LINUX_IF_ALG_H
16
17#include <linux/types.h>
18
19struct sockaddr_alg {
20 __u16 salg_family;
21 __u8 salg_type[14];
22 __u32 salg_feat;
23 __u32 salg_mask;
24 __u8 salg_name[64];
25};
26
27struct af_alg_iv {
28 __u32 ivlen;
29 __u8 iv[0];
30};
31
32/* Socket options */
33#define ALG_SET_KEY 1
34#define ALG_SET_IV 2
35#define ALG_SET_OP 3
Christopher Ferris12e1f282016-02-04 12:35:07 -080036#define ALG_SET_AEAD_ASSOCLEN 4
37#define ALG_SET_AEAD_AUTHSIZE 5
Ben Cheng30692c62013-10-15 18:26:18 -070038
39/* Operations */
40#define ALG_OP_DECRYPT 0
41#define ALG_OP_ENCRYPT 1
42
43#endif /* _LINUX_IF_ALG_H */