blob: bc2bcdec377b4b75738166b0b047a9c50d6a676d [file] [log] [blame]
Greg Kroah-Hartmane2be04c2017-11-01 15:09:13 +01001/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
Herbert Xu03c8efc2010-10-19 21:12:39 +08002/*
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
Stephan Muelleraf8e8072014-12-03 20:55:42 +010036#define ALG_SET_AEAD_ASSOCLEN 4
37#define ALG_SET_AEAD_AUTHSIZE 5
Herbert Xu03c8efc2010-10-19 21:12:39 +080038
39/* Operations */
40#define ALG_OP_DECRYPT 0
41#define ALG_OP_ENCRYPT 1
42
43#endif /* _LINUX_IF_ALG_H */