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