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 14 #ifndef _LINUX_IF_ALG_H 15 #define _LINUX_IF_ALG_H 16 17 #include <linux/types.h> 18 19 struct 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 27 struct 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 36 #define ALG_SET_AEAD_ASSOCLEN 4 37 #define ALG_SET_AEAD_AUTHSIZE 5 38 39 /* Operations */ 40 #define ALG_OP_DECRYPT 0 41 #define ALG_OP_ENCRYPT 1 42 43 #endif /* _LINUX_IF_ALG_H */ 44