xref: /freebsd/tests/sys/opencrypto/cryptodevh.py (revision af23369a6deaaeb612ab266eb88b8bb8d560c322)
1# $FreeBSD$
2# Generated by h2py from stdin
3
4# Included from sys/ioccom.h
5IOCPARM_SHIFT = 13
6IOCPARM_MASK = ((1 << IOCPARM_SHIFT) - 1)
7def IOCPARM_LEN(x): return (((x) >> 16) & IOCPARM_MASK)
8
9def IOCBASECMD(x): return ((x) & ~(IOCPARM_MASK << 16))
10
11def IOCGROUP(x): return (((x) >> 8) & 0xff)
12
13IOCPARM_MAX = (1 << IOCPARM_SHIFT)
14IOC_VOID = 0x20000000
15IOC_OUT = 0x40000000
16IOC_IN = 0x80000000
17IOC_INOUT = (IOC_IN|IOC_OUT)
18IOC_DIRMASK = (IOC_VOID|IOC_OUT|IOC_IN)
19
20# Included from sys/cdefs.h
21def __has_feature(x): return 0
22
23def __has_include(x): return 0
24
25def __has_builtin(x): return 0
26
27__GNUCLIKE_ASM = 3
28__GNUCLIKE_ASM = 2
29__GNUCLIKE___TYPEOF = 1
30__GNUCLIKE___SECTION = 1
31__GNUCLIKE_CTOR_SECTION_HANDLING = 1
32__GNUCLIKE_BUILTIN_CONSTANT_P = 1
33__GNUCLIKE_BUILTIN_VARARGS = 1
34__GNUCLIKE_BUILTIN_STDARG = 1
35__GNUCLIKE_BUILTIN_VAALIST = 1
36__GNUC_VA_LIST_COMPATIBILITY = 1
37__GNUCLIKE_BUILTIN_NEXT_ARG = 1
38__GNUCLIKE_BUILTIN_MEMCPY = 1
39__CC_SUPPORTS_INLINE = 1
40__CC_SUPPORTS___INLINE = 1
41__CC_SUPPORTS___INLINE__ = 1
42__CC_SUPPORTS___FUNC__ = 1
43__CC_SUPPORTS_WARNING = 1
44__CC_SUPPORTS_VARADIC_XXX = 1
45__CC_SUPPORTS_DYNAMIC_ARRAY_INIT = 1
46def __P(protos): return protos
47
48def __STRING(x): return #x
49
50def __XSTRING(x): return __STRING(x)
51
52def __P(protos): return ()
53
54def __STRING(x): return "x"
55
56def __aligned(x): return __attribute__((__aligned__(x)))
57
58def __section(x): return __attribute__((__section__(x)))
59
60def __aligned(x): return __attribute__((__aligned__(x)))
61
62def __section(x): return __attribute__((__section__(x)))
63
64def _Alignas(x): return alignas(x)
65
66def _Alignas(x): return __aligned(x)
67
68def _Alignof(x): return alignof(x)
69
70def _Alignof(x): return __alignof(x)
71
72def __nonnull(x): return __attribute__((__nonnull__(x)))
73
74def __predict_true(exp): return __builtin_expect((exp), 1)
75
76def __predict_false(exp): return __builtin_expect((exp), 0)
77
78def __predict_true(exp): return (exp)
79
80def __predict_false(exp): return (exp)
81
82def __format_arg(fmtarg): return __attribute__((__format_arg__ (fmtarg)))
83
84def __GLOBL(sym): return __GLOBL1(sym)
85
86def __FBSDID(s): return __IDSTRING(__CONCAT(__rcsid_,__LINE__),s)
87
88def __RCSID(s): return __IDSTRING(__CONCAT(__rcsid_,__LINE__),s)
89
90def __RCSID_SOURCE(s): return __IDSTRING(__CONCAT(__rcsid_source_,__LINE__),s)
91
92def __SCCSID(s): return __IDSTRING(__CONCAT(__sccsid_,__LINE__),s)
93
94def __COPYRIGHT(s): return __IDSTRING(__CONCAT(__copyright_,__LINE__),s)
95
96_POSIX_C_SOURCE = 199009
97_POSIX_C_SOURCE = 199209
98__XSI_VISIBLE = 700
99_POSIX_C_SOURCE = 200809
100__XSI_VISIBLE = 600
101_POSIX_C_SOURCE = 200112
102__XSI_VISIBLE = 500
103_POSIX_C_SOURCE = 199506
104_POSIX_C_SOURCE = 198808
105__POSIX_VISIBLE = 200809
106__ISO_C_VISIBLE = 1999
107__POSIX_VISIBLE = 200112
108__ISO_C_VISIBLE = 1999
109__POSIX_VISIBLE = 199506
110__ISO_C_VISIBLE = 1990
111__POSIX_VISIBLE = 199309
112__ISO_C_VISIBLE = 1990
113__POSIX_VISIBLE = 199209
114__ISO_C_VISIBLE = 1990
115__POSIX_VISIBLE = 199009
116__ISO_C_VISIBLE = 1990
117__POSIX_VISIBLE = 198808
118__ISO_C_VISIBLE = 0
119__POSIX_VISIBLE = 0
120__XSI_VISIBLE = 0
121__BSD_VISIBLE = 0
122__ISO_C_VISIBLE = 1990
123__POSIX_VISIBLE = 0
124__XSI_VISIBLE = 0
125__BSD_VISIBLE = 0
126__ISO_C_VISIBLE = 1999
127__POSIX_VISIBLE = 0
128__XSI_VISIBLE = 0
129__BSD_VISIBLE = 0
130__ISO_C_VISIBLE = 2011
131__POSIX_VISIBLE = 200809
132__XSI_VISIBLE = 700
133__BSD_VISIBLE = 1
134__ISO_C_VISIBLE = 2011
135CRYPTO_DRIVERS_INITIAL = 4
136CRYPTO_SW_SESSIONS = 32
137NULL_HASH_LEN = 16
138MD5_HASH_LEN = 16
139SHA1_HASH_LEN = 20
140RIPEMD160_HASH_LEN = 20
141SHA2_256_HASH_LEN = 32
142SHA2_384_HASH_LEN = 48
143SHA2_512_HASH_LEN = 64
144MD5_KPDK_HASH_LEN = 16
145SHA1_KPDK_HASH_LEN = 20
146HASH_MAX_LEN = SHA2_512_HASH_LEN
147NULL_HMAC_BLOCK_LEN = 64
148MD5_HMAC_BLOCK_LEN = 64
149SHA1_HMAC_BLOCK_LEN = 64
150RIPEMD160_HMAC_BLOCK_LEN = 64
151SHA2_256_HMAC_BLOCK_LEN = 64
152SHA2_384_HMAC_BLOCK_LEN = 128
153SHA2_512_HMAC_BLOCK_LEN = 128
154HMAC_MAX_BLOCK_LEN = SHA2_512_HMAC_BLOCK_LEN
155HMAC_IPAD_VAL = 0x36
156HMAC_OPAD_VAL = 0x5C
157NULL_BLOCK_LEN = 4
158DES_BLOCK_LEN = 8
159DES3_BLOCK_LEN = 8
160BLOWFISH_BLOCK_LEN = 8
161SKIPJACK_BLOCK_LEN = 8
162CAST128_BLOCK_LEN = 8
163RIJNDAEL128_BLOCK_LEN = 16
164AES_BLOCK_LEN = RIJNDAEL128_BLOCK_LEN
165CAMELLIA_BLOCK_LEN = 16
166EALG_MAX_BLOCK_LEN = AES_BLOCK_LEN
167AALG_MAX_RESULT_LEN = 64
168CRYPTO_ALGORITHM_MIN = 1
169CRYPTO_DES_CBC = 1
170CRYPTO_3DES_CBC = 2
171CRYPTO_BLF_CBC = 3
172CRYPTO_CAST_CBC = 4
173CRYPTO_SKIPJACK_CBC = 5
174CRYPTO_MD5_HMAC = 6
175CRYPTO_SHA1_HMAC = 7
176CRYPTO_RIPEMD160_HMAC = 8
177CRYPTO_MD5_KPDK = 9
178CRYPTO_SHA1_KPDK = 10
179CRYPTO_RIJNDAEL128_CBC = 11
180CRYPTO_AES_CBC = 11
181CRYPTO_ARC4 = 12
182CRYPTO_MD5 = 13
183CRYPTO_SHA1 = 14
184CRYPTO_NULL_HMAC = 15
185CRYPTO_NULL_CBC = 16
186CRYPTO_DEFLATE_COMP = 17
187CRYPTO_SHA2_256_HMAC = 18
188CRYPTO_SHA2_384_HMAC = 19
189CRYPTO_SHA2_512_HMAC = 20
190CRYPTO_CAMELLIA_CBC = 21
191CRYPTO_AES_XTS = 22
192CRYPTO_AES_ICM = 23
193CRYPTO_AES_NIST_GMAC = 24
194CRYPTO_AES_NIST_GCM_16 = 25
195CRYPTO_BLAKE2B = 29
196CRYPTO_BLAKE2S = 30
197CRYPTO_CHACHA20 = 31
198CRYPTO_SHA2_224_HMAC = 32
199CRYPTO_RIPEMD160 = 33
200CRYPTO_SHA2_224 = 34
201CRYPTO_SHA2_256 = 35
202CRYPTO_SHA2_384 = 36
203CRYPTO_SHA2_512 = 37
204CRYPTO_POLY1305 = 38
205CRYPTO_AES_CCM_CBC_MAC = 39
206CRYPTO_AES_CCM_16 = 40
207CRYPTO_ALGORITHM_MAX = 40
208CRYPTO_ALG_FLAG_SUPPORTED = 0x01
209CRYPTO_ALG_FLAG_RNG_ENABLE = 0x02
210CRYPTO_ALG_FLAG_DSA_SHA = 0x04
211CRYPTO_FLAG_HARDWARE = 0x01000000
212CRYPTO_FLAG_SOFTWARE = 0x02000000
213COP_ENCRYPT = 1
214COP_DECRYPT = 2
215COP_F_BATCH = 0x0008
216CRK_MAXPARAM = 8
217CRK_ALGORITM_MIN = 0
218CRK_MOD_EXP = 0
219CRK_MOD_EXP_CRT = 1
220CRK_DSA_SIGN = 2
221CRK_DSA_VERIFY = 3
222CRK_DH_COMPUTE_KEY = 4
223CRK_ALGORITHM_MAX = 4
224CRF_MOD_EXP = (1 << CRK_MOD_EXP)
225CRF_MOD_EXP_CRT = (1 << CRK_MOD_EXP_CRT)
226CRF_DSA_SIGN = (1 << CRK_DSA_SIGN)
227CRF_DSA_VERIFY = (1 << CRK_DSA_VERIFY)
228CRF_DH_COMPUTE_KEY = (1 << CRK_DH_COMPUTE_KEY)
229CRD_F_ENCRYPT = 0x01
230CRD_F_IV_PRESENT = 0x02
231CRD_F_IV_EXPLICIT = 0x04
232CRD_F_DSA_SHA_NEEDED = 0x08
233CRD_F_COMP = 0x0f
234CRD_F_KEY_EXPLICIT = 0x10
235CRYPTO_F_IMBUF = 0x0001
236CRYPTO_F_IOV = 0x0002
237CRYPTO_F_BATCH = 0x0008
238CRYPTO_F_CBIMM = 0x0010
239CRYPTO_F_DONE = 0x0020
240CRYPTO_F_CBIFSYNC = 0x0040
241CRYPTO_BUF_CONTIG = 0x0
242CRYPTO_BUF_IOV = 0x1
243CRYPTO_BUF_MBUF = 0x2
244CRYPTO_OP_DECRYPT = 0x0
245CRYPTO_OP_ENCRYPT = 0x1
246CRYPTO_HINT_MORE = 0x1
247def CRYPTO_SESID2HID(_sid): return (((_sid) >> 32) & 0x00ffffff)
248
249def CRYPTO_SESID2CAPS(_sid): return (((_sid) >> 32) & 0xff000000)
250
251def CRYPTO_SESID2LID(_sid): return (((u_int32_t) (_sid)) & 0xffffffff)
252
253CRYPTOCAP_F_HARDWARE = CRYPTO_FLAG_HARDWARE
254CRYPTOCAP_F_SOFTWARE = CRYPTO_FLAG_SOFTWARE
255CRYPTOCAP_F_SYNC = 0x04000000
256CRYPTO_SYMQ = 0x1
257CRYPTO_ASYMQ = 0x2
258