cryptoauthlib_sys/
bindings.rs

1/* automatically generated by rust-bindgen 0.58.1 */
2
3pub const _STRING_H: u32 = 1;
4pub const _FEATURES_H: u32 = 1;
5pub const _DEFAULT_SOURCE: u32 = 1;
6pub const __USE_ISOC11: u32 = 1;
7pub const __USE_ISOC99: u32 = 1;
8pub const __USE_ISOC95: u32 = 1;
9pub const __USE_POSIX_IMPLICITLY: u32 = 1;
10pub const _POSIX_SOURCE: u32 = 1;
11pub const _POSIX_C_SOURCE: u32 = 200809;
12pub const __USE_POSIX: u32 = 1;
13pub const __USE_POSIX2: u32 = 1;
14pub const __USE_POSIX199309: u32 = 1;
15pub const __USE_POSIX199506: u32 = 1;
16pub const __USE_XOPEN2K: u32 = 1;
17pub const __USE_XOPEN2K8: u32 = 1;
18pub const _ATFILE_SOURCE: u32 = 1;
19pub const __USE_MISC: u32 = 1;
20pub const __USE_ATFILE: u32 = 1;
21pub const __USE_FORTIFY_LEVEL: u32 = 0;
22pub const __GLIBC_USE_DEPRECATED_GETS: u32 = 0;
23pub const _STDC_PREDEF_H: u32 = 1;
24pub const __STDC_IEC_559__: u32 = 1;
25pub const __STDC_IEC_559_COMPLEX__: u32 = 1;
26pub const __STDC_ISO_10646__: u32 = 201706;
27pub const __STDC_NO_THREADS__: u32 = 1;
28pub const __GNU_LIBRARY__: u32 = 6;
29pub const __GLIBC__: u32 = 2;
30pub const __GLIBC_MINOR__: u32 = 27;
31pub const _SYS_CDEFS_H: u32 = 1;
32pub const __glibc_c99_flexarr_available: u32 = 1;
33pub const __WORDSIZE: u32 = 64;
34pub const __WORDSIZE_TIME64_COMPAT32: u32 = 1;
35pub const __SYSCALL_WORDSIZE: u32 = 64;
36pub const __HAVE_GENERIC_SELECTION: u32 = 1;
37pub const __GLIBC_USE_LIB_EXT2: u32 = 0;
38pub const __GLIBC_USE_IEC_60559_BFP_EXT: u32 = 0;
39pub const __GLIBC_USE_IEC_60559_FUNCS_EXT: u32 = 0;
40pub const __GLIBC_USE_IEC_60559_TYPES_EXT: u32 = 0;
41pub const _BITS_TYPES_LOCALE_T_H: u32 = 1;
42pub const _BITS_TYPES___LOCALE_T_H: u32 = 1;
43pub const _STRINGS_H: u32 = 1;
44pub const ATCA_POST_DELAY_MSEC: u32 = 25;
45pub const _STDINT_H: u32 = 1;
46pub const _BITS_TYPES_H: u32 = 1;
47pub const _BITS_TYPESIZES_H: u32 = 1;
48pub const __OFF_T_MATCHES_OFF64_T: u32 = 1;
49pub const __INO_T_MATCHES_INO64_T: u32 = 1;
50pub const __RLIM_T_MATCHES_RLIM64_T: u32 = 1;
51pub const __FD_SETSIZE: u32 = 1024;
52pub const _BITS_WCHAR_H: u32 = 1;
53pub const _BITS_STDINT_INTN_H: u32 = 1;
54pub const _BITS_STDINT_UINTN_H: u32 = 1;
55pub const INT8_MIN: i32 = -128;
56pub const INT16_MIN: i32 = -32768;
57pub const INT32_MIN: i32 = -2147483648;
58pub const INT8_MAX: u32 = 127;
59pub const INT16_MAX: u32 = 32767;
60pub const INT32_MAX: u32 = 2147483647;
61pub const UINT8_MAX: u32 = 255;
62pub const UINT16_MAX: u32 = 65535;
63pub const UINT32_MAX: u32 = 4294967295;
64pub const INT_LEAST8_MIN: i32 = -128;
65pub const INT_LEAST16_MIN: i32 = -32768;
66pub const INT_LEAST32_MIN: i32 = -2147483648;
67pub const INT_LEAST8_MAX: u32 = 127;
68pub const INT_LEAST16_MAX: u32 = 32767;
69pub const INT_LEAST32_MAX: u32 = 2147483647;
70pub const UINT_LEAST8_MAX: u32 = 255;
71pub const UINT_LEAST16_MAX: u32 = 65535;
72pub const UINT_LEAST32_MAX: u32 = 4294967295;
73pub const INT_FAST8_MIN: i32 = -128;
74pub const INT_FAST16_MIN: i64 = -9223372036854775808;
75pub const INT_FAST32_MIN: i64 = -9223372036854775808;
76pub const INT_FAST8_MAX: u32 = 127;
77pub const INT_FAST16_MAX: u64 = 9223372036854775807;
78pub const INT_FAST32_MAX: u64 = 9223372036854775807;
79pub const UINT_FAST8_MAX: u32 = 255;
80pub const UINT_FAST16_MAX: i32 = -1;
81pub const UINT_FAST32_MAX: i32 = -1;
82pub const INTPTR_MIN: i64 = -9223372036854775808;
83pub const INTPTR_MAX: u64 = 9223372036854775807;
84pub const UINTPTR_MAX: i32 = -1;
85pub const PTRDIFF_MIN: i64 = -9223372036854775808;
86pub const PTRDIFF_MAX: u64 = 9223372036854775807;
87pub const SIG_ATOMIC_MIN: i32 = -2147483648;
88pub const SIG_ATOMIC_MAX: u32 = 2147483647;
89pub const SIZE_MAX: i32 = -1;
90pub const WINT_MIN: u32 = 0;
91pub const WINT_MAX: u32 = 4294967295;
92pub const true_: u32 = 1;
93pub const false_: u32 = 0;
94pub const __bool_true_false_are_defined: u32 = 1;
95pub const ATCA_BLOCK_SIZE: u32 = 32;
96pub const ATCA_WORD_SIZE: u32 = 4;
97pub const ATCA_PUB_KEY_PAD: u32 = 4;
98pub const ATCA_SERIAL_NUM_SIZE: u32 = 9;
99pub const ATCA_KEY_COUNT: u32 = 16;
100pub const ATCA_ECC_CONFIG_SIZE: u32 = 128;
101pub const ATCA_SHA_CONFIG_SIZE: u32 = 88;
102pub const ATCA_OTP_SIZE: u32 = 64;
103pub const ATCA_AES_GFM_SIZE: u32 = 32;
104pub const ATCA_CHIPMODE_OFFSET: u32 = 19;
105pub const ATCA_PUB_KEY_SIZE: u32 = 64;
106pub const ATCA_PRIV_KEY_SIZE: u32 = 32;
107pub const ATCA_SIG_SIZE: u32 = 64;
108pub const ATCA_KEY_SIZE: u32 = 32;
109pub const RSA2048_KEY_SIZE: u32 = 256;
110pub const OUTNONCE_SIZE: u32 = 32;
111pub const ATCA_COUNT_IDX: u32 = 0;
112pub const ATCA_OPCODE_IDX: u32 = 1;
113pub const ATCA_PARAM1_IDX: u32 = 2;
114pub const ATCA_PARAM2_IDX: u32 = 3;
115pub const ATCA_DATA_IDX: u32 = 5;
116pub const ATCA_RSP_DATA_IDX: u32 = 1;
117pub const ATCA_ADDRESS_MASK_CONFIG: u32 = 31;
118pub const ATCA_ADDRESS_MASK_OTP: u32 = 15;
119pub const ATCA_ADDRESS_MASK: u32 = 127;
120pub const ATCA_TEMPKEY_KEYID: u32 = 65535;
121pub const ATCA_B283_KEY_TYPE: u32 = 0;
122pub const ATCA_K283_KEY_TYPE: u32 = 1;
123pub const ATCA_P256_KEY_TYPE: u32 = 4;
124pub const ATCA_AES_KEY_TYPE: u32 = 6;
125pub const ATCA_SHA_KEY_TYPE: u32 = 7;
126pub const AES_MODE_IDX: u32 = 2;
127pub const AES_KEYID_IDX: u32 = 3;
128pub const AES_INPUT_IDX: u32 = 5;
129pub const AES_COUNT: u32 = 23;
130pub const AES_MODE_KEY_BLOCK_POS: u32 = 6;
131pub const AES_DATA_SIZE: u32 = 16;
132pub const CHECKMAC_MODE_IDX: u32 = 2;
133pub const CHECKMAC_KEYID_IDX: u32 = 3;
134pub const CHECKMAC_CLIENT_CHALLENGE_IDX: u32 = 5;
135pub const CHECKMAC_CLIENT_RESPONSE_IDX: u32 = 37;
136pub const CHECKMAC_DATA_IDX: u32 = 69;
137pub const CHECKMAC_COUNT: u32 = 84;
138pub const CHECKMAC_CLIENT_CHALLENGE_SIZE: u32 = 32;
139pub const CHECKMAC_CLIENT_RESPONSE_SIZE: u32 = 32;
140pub const CHECKMAC_OTHER_DATA_SIZE: u32 = 13;
141pub const CHECKMAC_CLIENT_COMMAND_SIZE: u32 = 4;
142pub const CHECKMAC_CMD_MATCH: u32 = 0;
143pub const CHECKMAC_CMD_MISMATCH: u32 = 1;
144pub const COUNTER_MODE_IDX: u32 = 2;
145pub const COUNTER_KEYID_IDX: u32 = 3;
146pub const DERIVE_KEY_RANDOM_IDX: u32 = 2;
147pub const DERIVE_KEY_TARGETKEY_IDX: u32 = 3;
148pub const DERIVE_KEY_MAC_IDX: u32 = 5;
149pub const DERIVE_KEY_COUNT_LARGE: u32 = 39;
150pub const DERIVE_KEY_MAC_SIZE: u32 = 32;
151pub const ECDH_KEY_SIZE: u32 = 32;
152pub const GENDIG_ZONE_IDX: u32 = 2;
153pub const GENDIG_KEYID_IDX: u32 = 3;
154pub const GENDIG_DATA_IDX: u32 = 5;
155pub const GENKEY_MODE_IDX: u32 = 2;
156pub const GENKEY_KEYID_IDX: u32 = 3;
157pub const GENKEY_DATA_IDX: u32 = 5;
158pub const GENKEY_COUNT_DATA: u32 = 10;
159pub const GENKEY_OTHER_DATA_SIZE: u32 = 3;
160pub const HMAC_MODE_IDX: u32 = 2;
161pub const HMAC_KEYID_IDX: u32 = 3;
162pub const HMAC_DIGEST_SIZE: u32 = 32;
163pub const INFO_PARAM1_IDX: u32 = 2;
164pub const INFO_PARAM2_IDX: u32 = 3;
165pub const KDF_MODE_IDX: u32 = 2;
166pub const KDF_KEYID_IDX: u32 = 3;
167pub const KDF_DETAILS_IDX: u32 = 5;
168pub const KDF_DETAILS_SIZE: u32 = 4;
169pub const KDF_MESSAGE_IDX: u32 = 9;
170pub const LOCK_ZONE_IDX: u32 = 2;
171pub const LOCK_SUMMARY_IDX: u32 = 3;
172pub const LOCK_ZONE_MASK: u32 = 191;
173pub const ATCA_UNLOCKED: u32 = 85;
174pub const ATCA_LOCKED: u32 = 0;
175pub const MAC_MODE_IDX: u32 = 2;
176pub const MAC_KEYID_IDX: u32 = 3;
177pub const MAC_CHALLENGE_IDX: u32 = 5;
178pub const MAC_COUNT_LONG: u32 = 39;
179pub const MAC_CHALLENGE_SIZE: u32 = 32;
180pub const MAC_SIZE: u32 = 32;
181pub const NONCE_MODE_IDX: u32 = 2;
182pub const NONCE_PARAM2_IDX: u32 = 3;
183pub const NONCE_INPUT_IDX: u32 = 5;
184pub const NONCE_NUMIN_SIZE: u32 = 20;
185pub const NONCE_NUMIN_SIZE_PASSTHROUGH: u32 = 32;
186pub const PAUSE_SELECT_IDX: u32 = 2;
187pub const PAUSE_PARAM2_IDX: u32 = 3;
188pub const PRIVWRITE_ZONE_IDX: u32 = 2;
189pub const PRIVWRITE_KEYID_IDX: u32 = 3;
190pub const PRIVWRITE_VALUE_IDX: u32 = 5;
191pub const PRIVWRITE_MAC_IDX: u32 = 41;
192pub const PRIVWRITE_COUNT: u32 = 75;
193pub const RANDOM_MODE_IDX: u32 = 2;
194pub const RANDOM_PARAM2_IDX: u32 = 3;
195pub const READ_ZONE_IDX: u32 = 2;
196pub const READ_ADDR_IDX: u32 = 3;
197pub const SECUREBOOT_MODE_IDX: u32 = 2;
198pub const SECUREBOOT_DIGEST_SIZE: u32 = 32;
199pub const SECUREBOOT_SIGNATURE_SIZE: u32 = 64;
200pub const SECUREBOOT_MAC_SIZE: u32 = 32;
201pub const SECUREBOOTCONFIG_OFFSET: u32 = 70;
202pub const SELFTEST_MODE_IDX: u32 = 2;
203pub const ATCA_SHA_DIGEST_SIZE: u32 = 32;
204pub const SHA_DATA_MAX: u32 = 64;
205pub const ATCA_SHA256_BLOCK_SIZE: u32 = 64;
206pub const SHA_CONTEXT_MAX_SIZE: u32 = 99;
207pub const SIGN_MODE_IDX: u32 = 2;
208pub const SIGN_KEYID_IDX: u32 = 3;
209pub const UPDATE_MODE_IDX: u32 = 2;
210pub const UPDATE_VALUE_IDX: u32 = 3;
211pub const VERIFY_MODE_IDX: u32 = 2;
212pub const VERIFY_KEYID_IDX: u32 = 3;
213pub const VERIFY_DATA_IDX: u32 = 5;
214pub const VERIFY_256_STORED_COUNT: u32 = 71;
215pub const VERIFY_283_STORED_COUNT: u32 = 79;
216pub const VERIFY_256_VALIDATE_COUNT: u32 = 90;
217pub const VERIFY_283_VALIDATE_COUNT: u32 = 98;
218pub const VERIFY_256_EXTERNAL_COUNT: u32 = 135;
219pub const VERIFY_283_EXTERNAL_COUNT: u32 = 151;
220pub const VERIFY_256_KEY_SIZE: u32 = 64;
221pub const VERIFY_283_KEY_SIZE: u32 = 72;
222pub const VERIFY_256_SIGNATURE_SIZE: u32 = 64;
223pub const VERIFY_283_SIGNATURE_SIZE: u32 = 72;
224pub const VERIFY_OTHER_DATA_SIZE: u32 = 19;
225pub const WRITE_ZONE_IDX: u32 = 2;
226pub const WRITE_ADDR_IDX: u32 = 3;
227pub const WRITE_VALUE_IDX: u32 = 5;
228pub const WRITE_MAC_VS_IDX: u32 = 9;
229pub const WRITE_MAC_VL_IDX: u32 = 37;
230pub const WRITE_MAC_SIZE: u32 = 32;
231pub const ATCA_SHA2_256_DIGEST_SIZE: u32 = 32;
232pub const ATCA_AES_GCM_IV_STD_LENGTH: u32 = 12;
233pub type size_t = ::std::os::raw::c_ulong;
234pub type wchar_t = ::std::os::raw::c_int;
235#[repr(C)]
236#[repr(align(16))]
237#[derive(Debug, Copy, Clone)]
238pub struct max_align_t {
239    pub __clang_max_align_nonce1: ::std::os::raw::c_longlong,
240    pub __bindgen_padding_0: u64,
241    pub __clang_max_align_nonce2: u128,
242}
243#[allow(deref_nullptr)]
244#[test]
245fn bindgen_test_layout_max_align_t() {
246    assert_eq!(
247        ::std::mem::size_of::<max_align_t>(),
248        32usize,
249        concat!("Size of: ", stringify!(max_align_t))
250    );
251    assert_eq!(
252        ::std::mem::align_of::<max_align_t>(),
253        16usize,
254        concat!("Alignment of ", stringify!(max_align_t))
255    );
256    assert_eq!(
257        unsafe {
258            &(*(::std::ptr::null::<max_align_t>())).__clang_max_align_nonce1 as *const _ as usize
259        },
260        0usize,
261        concat!(
262            "Offset of field: ",
263            stringify!(max_align_t),
264            "::",
265            stringify!(__clang_max_align_nonce1)
266        )
267    );
268    assert_eq!(
269        unsafe {
270            &(*(::std::ptr::null::<max_align_t>())).__clang_max_align_nonce2 as *const _ as usize
271        },
272        16usize,
273        concat!(
274            "Offset of field: ",
275            stringify!(max_align_t),
276            "::",
277            stringify!(__clang_max_align_nonce2)
278        )
279    );
280}
281extern "C" {
282    pub fn memcpy(
283        __dest: *mut ::std::os::raw::c_void,
284        __src: *const ::std::os::raw::c_void,
285        __n: ::std::os::raw::c_ulong,
286    ) -> *mut ::std::os::raw::c_void;
287}
288extern "C" {
289    pub fn memmove(
290        __dest: *mut ::std::os::raw::c_void,
291        __src: *const ::std::os::raw::c_void,
292        __n: ::std::os::raw::c_ulong,
293    ) -> *mut ::std::os::raw::c_void;
294}
295extern "C" {
296    pub fn memccpy(
297        __dest: *mut ::std::os::raw::c_void,
298        __src: *const ::std::os::raw::c_void,
299        __c: ::std::os::raw::c_int,
300        __n: size_t,
301    ) -> *mut ::std::os::raw::c_void;
302}
303extern "C" {
304    pub fn memset(
305        __s: *mut ::std::os::raw::c_void,
306        __c: ::std::os::raw::c_int,
307        __n: ::std::os::raw::c_ulong,
308    ) -> *mut ::std::os::raw::c_void;
309}
310extern "C" {
311    pub fn memcmp(
312        __s1: *const ::std::os::raw::c_void,
313        __s2: *const ::std::os::raw::c_void,
314        __n: ::std::os::raw::c_ulong,
315    ) -> ::std::os::raw::c_int;
316}
317extern "C" {
318    pub fn memchr(
319        __s: *const ::std::os::raw::c_void,
320        __c: ::std::os::raw::c_int,
321        __n: ::std::os::raw::c_ulong,
322    ) -> *mut ::std::os::raw::c_void;
323}
324extern "C" {
325    pub fn strcpy(
326        __dest: *mut ::std::os::raw::c_char,
327        __src: *const ::std::os::raw::c_char,
328    ) -> *mut ::std::os::raw::c_char;
329}
330extern "C" {
331    pub fn strncpy(
332        __dest: *mut ::std::os::raw::c_char,
333        __src: *const ::std::os::raw::c_char,
334        __n: ::std::os::raw::c_ulong,
335    ) -> *mut ::std::os::raw::c_char;
336}
337extern "C" {
338    pub fn strcat(
339        __dest: *mut ::std::os::raw::c_char,
340        __src: *const ::std::os::raw::c_char,
341    ) -> *mut ::std::os::raw::c_char;
342}
343extern "C" {
344    pub fn strncat(
345        __dest: *mut ::std::os::raw::c_char,
346        __src: *const ::std::os::raw::c_char,
347        __n: ::std::os::raw::c_ulong,
348    ) -> *mut ::std::os::raw::c_char;
349}
350extern "C" {
351    pub fn strcmp(
352        __s1: *const ::std::os::raw::c_char,
353        __s2: *const ::std::os::raw::c_char,
354    ) -> ::std::os::raw::c_int;
355}
356extern "C" {
357    pub fn strncmp(
358        __s1: *const ::std::os::raw::c_char,
359        __s2: *const ::std::os::raw::c_char,
360        __n: ::std::os::raw::c_ulong,
361    ) -> ::std::os::raw::c_int;
362}
363extern "C" {
364    pub fn strcoll(
365        __s1: *const ::std::os::raw::c_char,
366        __s2: *const ::std::os::raw::c_char,
367    ) -> ::std::os::raw::c_int;
368}
369extern "C" {
370    pub fn strxfrm(
371        __dest: *mut ::std::os::raw::c_char,
372        __src: *const ::std::os::raw::c_char,
373        __n: ::std::os::raw::c_ulong,
374    ) -> ::std::os::raw::c_ulong;
375}
376#[repr(C)]
377#[derive(Debug, Copy, Clone)]
378pub struct __locale_struct {
379    pub __locales: [*mut __locale_data; 13usize],
380    pub __ctype_b: *const ::std::os::raw::c_ushort,
381    pub __ctype_tolower: *const ::std::os::raw::c_int,
382    pub __ctype_toupper: *const ::std::os::raw::c_int,
383    pub __names: [*const ::std::os::raw::c_char; 13usize],
384}
385#[allow(deref_nullptr)]
386#[test]
387fn bindgen_test_layout___locale_struct() {
388    assert_eq!(
389        ::std::mem::size_of::<__locale_struct>(),
390        232usize,
391        concat!("Size of: ", stringify!(__locale_struct))
392    );
393    assert_eq!(
394        ::std::mem::align_of::<__locale_struct>(),
395        8usize,
396        concat!("Alignment of ", stringify!(__locale_struct))
397    );
398    assert_eq!(
399        unsafe { &(*(::std::ptr::null::<__locale_struct>())).__locales as *const _ as usize },
400        0usize,
401        concat!(
402            "Offset of field: ",
403            stringify!(__locale_struct),
404            "::",
405            stringify!(__locales)
406        )
407    );
408    assert_eq!(
409        unsafe { &(*(::std::ptr::null::<__locale_struct>())).__ctype_b as *const _ as usize },
410        104usize,
411        concat!(
412            "Offset of field: ",
413            stringify!(__locale_struct),
414            "::",
415            stringify!(__ctype_b)
416        )
417    );
418    assert_eq!(
419        unsafe { &(*(::std::ptr::null::<__locale_struct>())).__ctype_tolower as *const _ as usize },
420        112usize,
421        concat!(
422            "Offset of field: ",
423            stringify!(__locale_struct),
424            "::",
425            stringify!(__ctype_tolower)
426        )
427    );
428    assert_eq!(
429        unsafe { &(*(::std::ptr::null::<__locale_struct>())).__ctype_toupper as *const _ as usize },
430        120usize,
431        concat!(
432            "Offset of field: ",
433            stringify!(__locale_struct),
434            "::",
435            stringify!(__ctype_toupper)
436        )
437    );
438    assert_eq!(
439        unsafe { &(*(::std::ptr::null::<__locale_struct>())).__names as *const _ as usize },
440        128usize,
441        concat!(
442            "Offset of field: ",
443            stringify!(__locale_struct),
444            "::",
445            stringify!(__names)
446        )
447    );
448}
449pub type __locale_t = *mut __locale_struct;
450pub type locale_t = __locale_t;
451extern "C" {
452    pub fn strcoll_l(
453        __s1: *const ::std::os::raw::c_char,
454        __s2: *const ::std::os::raw::c_char,
455        __l: locale_t,
456    ) -> ::std::os::raw::c_int;
457}
458extern "C" {
459    pub fn strxfrm_l(
460        __dest: *mut ::std::os::raw::c_char,
461        __src: *const ::std::os::raw::c_char,
462        __n: size_t,
463        __l: locale_t,
464    ) -> size_t;
465}
466extern "C" {
467    pub fn strdup(__s: *const ::std::os::raw::c_char) -> *mut ::std::os::raw::c_char;
468}
469extern "C" {
470    pub fn strndup(
471        __string: *const ::std::os::raw::c_char,
472        __n: ::std::os::raw::c_ulong,
473    ) -> *mut ::std::os::raw::c_char;
474}
475extern "C" {
476    pub fn strchr(
477        __s: *const ::std::os::raw::c_char,
478        __c: ::std::os::raw::c_int,
479    ) -> *mut ::std::os::raw::c_char;
480}
481extern "C" {
482    pub fn strrchr(
483        __s: *const ::std::os::raw::c_char,
484        __c: ::std::os::raw::c_int,
485    ) -> *mut ::std::os::raw::c_char;
486}
487extern "C" {
488    pub fn strcspn(
489        __s: *const ::std::os::raw::c_char,
490        __reject: *const ::std::os::raw::c_char,
491    ) -> ::std::os::raw::c_ulong;
492}
493extern "C" {
494    pub fn strspn(
495        __s: *const ::std::os::raw::c_char,
496        __accept: *const ::std::os::raw::c_char,
497    ) -> ::std::os::raw::c_ulong;
498}
499extern "C" {
500    pub fn strpbrk(
501        __s: *const ::std::os::raw::c_char,
502        __accept: *const ::std::os::raw::c_char,
503    ) -> *mut ::std::os::raw::c_char;
504}
505extern "C" {
506    pub fn strstr(
507        __haystack: *const ::std::os::raw::c_char,
508        __needle: *const ::std::os::raw::c_char,
509    ) -> *mut ::std::os::raw::c_char;
510}
511extern "C" {
512    pub fn strtok(
513        __s: *mut ::std::os::raw::c_char,
514        __delim: *const ::std::os::raw::c_char,
515    ) -> *mut ::std::os::raw::c_char;
516}
517extern "C" {
518    pub fn __strtok_r(
519        __s: *mut ::std::os::raw::c_char,
520        __delim: *const ::std::os::raw::c_char,
521        __save_ptr: *mut *mut ::std::os::raw::c_char,
522    ) -> *mut ::std::os::raw::c_char;
523}
524extern "C" {
525    pub fn strtok_r(
526        __s: *mut ::std::os::raw::c_char,
527        __delim: *const ::std::os::raw::c_char,
528        __save_ptr: *mut *mut ::std::os::raw::c_char,
529    ) -> *mut ::std::os::raw::c_char;
530}
531extern "C" {
532    pub fn strlen(__s: *const ::std::os::raw::c_char) -> ::std::os::raw::c_ulong;
533}
534extern "C" {
535    pub fn strnlen(__string: *const ::std::os::raw::c_char, __maxlen: size_t) -> size_t;
536}
537extern "C" {
538    pub fn strerror(__errnum: ::std::os::raw::c_int) -> *mut ::std::os::raw::c_char;
539}
540extern "C" {
541    #[link_name = "\u{1}__xpg_strerror_r"]
542    pub fn strerror_r(
543        __errnum: ::std::os::raw::c_int,
544        __buf: *mut ::std::os::raw::c_char,
545        __buflen: size_t,
546    ) -> ::std::os::raw::c_int;
547}
548extern "C" {
549    pub fn strerror_l(
550        __errnum: ::std::os::raw::c_int,
551        __l: locale_t,
552    ) -> *mut ::std::os::raw::c_char;
553}
554extern "C" {
555    pub fn bcmp(
556        __s1: *const ::std::os::raw::c_void,
557        __s2: *const ::std::os::raw::c_void,
558        __n: size_t,
559    ) -> ::std::os::raw::c_int;
560}
561extern "C" {
562    pub fn bcopy(
563        __src: *const ::std::os::raw::c_void,
564        __dest: *mut ::std::os::raw::c_void,
565        __n: size_t,
566    );
567}
568extern "C" {
569    pub fn bzero(__s: *mut ::std::os::raw::c_void, __n: ::std::os::raw::c_ulong);
570}
571extern "C" {
572    pub fn index(
573        __s: *const ::std::os::raw::c_char,
574        __c: ::std::os::raw::c_int,
575    ) -> *mut ::std::os::raw::c_char;
576}
577extern "C" {
578    pub fn rindex(
579        __s: *const ::std::os::raw::c_char,
580        __c: ::std::os::raw::c_int,
581    ) -> *mut ::std::os::raw::c_char;
582}
583extern "C" {
584    pub fn ffs(__i: ::std::os::raw::c_int) -> ::std::os::raw::c_int;
585}
586extern "C" {
587    pub fn ffsl(__l: ::std::os::raw::c_long) -> ::std::os::raw::c_int;
588}
589extern "C" {
590    pub fn ffsll(__ll: ::std::os::raw::c_longlong) -> ::std::os::raw::c_int;
591}
592extern "C" {
593    pub fn strcasecmp(
594        __s1: *const ::std::os::raw::c_char,
595        __s2: *const ::std::os::raw::c_char,
596    ) -> ::std::os::raw::c_int;
597}
598extern "C" {
599    pub fn strncasecmp(
600        __s1: *const ::std::os::raw::c_char,
601        __s2: *const ::std::os::raw::c_char,
602        __n: ::std::os::raw::c_ulong,
603    ) -> ::std::os::raw::c_int;
604}
605extern "C" {
606    pub fn strcasecmp_l(
607        __s1: *const ::std::os::raw::c_char,
608        __s2: *const ::std::os::raw::c_char,
609        __loc: locale_t,
610    ) -> ::std::os::raw::c_int;
611}
612extern "C" {
613    pub fn strncasecmp_l(
614        __s1: *const ::std::os::raw::c_char,
615        __s2: *const ::std::os::raw::c_char,
616        __n: size_t,
617        __loc: locale_t,
618    ) -> ::std::os::raw::c_int;
619}
620extern "C" {
621    pub fn explicit_bzero(__s: *mut ::std::os::raw::c_void, __n: size_t);
622}
623extern "C" {
624    pub fn strsep(
625        __stringp: *mut *mut ::std::os::raw::c_char,
626        __delim: *const ::std::os::raw::c_char,
627    ) -> *mut ::std::os::raw::c_char;
628}
629extern "C" {
630    pub fn strsignal(__sig: ::std::os::raw::c_int) -> *mut ::std::os::raw::c_char;
631}
632extern "C" {
633    pub fn __stpcpy(
634        __dest: *mut ::std::os::raw::c_char,
635        __src: *const ::std::os::raw::c_char,
636    ) -> *mut ::std::os::raw::c_char;
637}
638extern "C" {
639    pub fn stpcpy(
640        __dest: *mut ::std::os::raw::c_char,
641        __src: *const ::std::os::raw::c_char,
642    ) -> *mut ::std::os::raw::c_char;
643}
644extern "C" {
645    pub fn __stpncpy(
646        __dest: *mut ::std::os::raw::c_char,
647        __src: *const ::std::os::raw::c_char,
648        __n: size_t,
649    ) -> *mut ::std::os::raw::c_char;
650}
651extern "C" {
652    pub fn stpncpy(
653        __dest: *mut ::std::os::raw::c_char,
654        __src: *const ::std::os::raw::c_char,
655        __n: ::std::os::raw::c_ulong,
656    ) -> *mut ::std::os::raw::c_char;
657}
658pub type __u_char = ::std::os::raw::c_uchar;
659pub type __u_short = ::std::os::raw::c_ushort;
660pub type __u_int = ::std::os::raw::c_uint;
661pub type __u_long = ::std::os::raw::c_ulong;
662pub type __int8_t = ::std::os::raw::c_schar;
663pub type __uint8_t = ::std::os::raw::c_uchar;
664pub type __int16_t = ::std::os::raw::c_short;
665pub type __uint16_t = ::std::os::raw::c_ushort;
666pub type __int32_t = ::std::os::raw::c_int;
667pub type __uint32_t = ::std::os::raw::c_uint;
668pub type __int64_t = ::std::os::raw::c_long;
669pub type __uint64_t = ::std::os::raw::c_ulong;
670pub type __quad_t = ::std::os::raw::c_long;
671pub type __u_quad_t = ::std::os::raw::c_ulong;
672pub type __intmax_t = ::std::os::raw::c_long;
673pub type __uintmax_t = ::std::os::raw::c_ulong;
674pub type __dev_t = ::std::os::raw::c_ulong;
675pub type __uid_t = ::std::os::raw::c_uint;
676pub type __gid_t = ::std::os::raw::c_uint;
677pub type __ino_t = ::std::os::raw::c_ulong;
678pub type __ino64_t = ::std::os::raw::c_ulong;
679pub type __mode_t = ::std::os::raw::c_uint;
680pub type __nlink_t = ::std::os::raw::c_ulong;
681pub type __off_t = ::std::os::raw::c_long;
682pub type __off64_t = ::std::os::raw::c_long;
683pub type __pid_t = ::std::os::raw::c_int;
684#[repr(C)]
685#[derive(Debug, Copy, Clone)]
686pub struct __fsid_t {
687    pub __val: [::std::os::raw::c_int; 2usize],
688}
689#[allow(deref_nullptr)]
690#[test]
691fn bindgen_test_layout___fsid_t() {
692    assert_eq!(
693        ::std::mem::size_of::<__fsid_t>(),
694        8usize,
695        concat!("Size of: ", stringify!(__fsid_t))
696    );
697    assert_eq!(
698        ::std::mem::align_of::<__fsid_t>(),
699        4usize,
700        concat!("Alignment of ", stringify!(__fsid_t))
701    );
702    assert_eq!(
703        unsafe { &(*(::std::ptr::null::<__fsid_t>())).__val as *const _ as usize },
704        0usize,
705        concat!(
706            "Offset of field: ",
707            stringify!(__fsid_t),
708            "::",
709            stringify!(__val)
710        )
711    );
712}
713pub type __clock_t = ::std::os::raw::c_long;
714pub type __rlim_t = ::std::os::raw::c_ulong;
715pub type __rlim64_t = ::std::os::raw::c_ulong;
716pub type __id_t = ::std::os::raw::c_uint;
717pub type __time_t = ::std::os::raw::c_long;
718pub type __useconds_t = ::std::os::raw::c_uint;
719pub type __suseconds_t = ::std::os::raw::c_long;
720pub type __daddr_t = ::std::os::raw::c_int;
721pub type __key_t = ::std::os::raw::c_int;
722pub type __clockid_t = ::std::os::raw::c_int;
723pub type __timer_t = *mut ::std::os::raw::c_void;
724pub type __blksize_t = ::std::os::raw::c_long;
725pub type __blkcnt_t = ::std::os::raw::c_long;
726pub type __blkcnt64_t = ::std::os::raw::c_long;
727pub type __fsblkcnt_t = ::std::os::raw::c_ulong;
728pub type __fsblkcnt64_t = ::std::os::raw::c_ulong;
729pub type __fsfilcnt_t = ::std::os::raw::c_ulong;
730pub type __fsfilcnt64_t = ::std::os::raw::c_ulong;
731pub type __fsword_t = ::std::os::raw::c_long;
732pub type __ssize_t = ::std::os::raw::c_long;
733pub type __syscall_slong_t = ::std::os::raw::c_long;
734pub type __syscall_ulong_t = ::std::os::raw::c_ulong;
735pub type __loff_t = __off64_t;
736pub type __caddr_t = *mut ::std::os::raw::c_char;
737pub type __intptr_t = ::std::os::raw::c_long;
738pub type __socklen_t = ::std::os::raw::c_uint;
739pub type __sig_atomic_t = ::std::os::raw::c_int;
740pub type int_least8_t = ::std::os::raw::c_schar;
741pub type int_least16_t = ::std::os::raw::c_short;
742pub type int_least32_t = ::std::os::raw::c_int;
743pub type int_least64_t = ::std::os::raw::c_long;
744pub type uint_least8_t = ::std::os::raw::c_uchar;
745pub type uint_least16_t = ::std::os::raw::c_ushort;
746pub type uint_least32_t = ::std::os::raw::c_uint;
747pub type uint_least64_t = ::std::os::raw::c_ulong;
748pub type int_fast8_t = ::std::os::raw::c_schar;
749pub type int_fast16_t = ::std::os::raw::c_long;
750pub type int_fast32_t = ::std::os::raw::c_long;
751pub type int_fast64_t = ::std::os::raw::c_long;
752pub type uint_fast8_t = ::std::os::raw::c_uchar;
753pub type uint_fast16_t = ::std::os::raw::c_ulong;
754pub type uint_fast32_t = ::std::os::raw::c_ulong;
755pub type uint_fast64_t = ::std::os::raw::c_ulong;
756pub type intmax_t = __intmax_t;
757pub type uintmax_t = __uintmax_t;
758#[doc = "!< Function succeeded."]
759pub const ATCA_STATUS_ATCA_SUCCESS: ATCA_STATUS = 0;
760pub const ATCA_STATUS_ATCA_CONFIG_ZONE_LOCKED: ATCA_STATUS = 1;
761pub const ATCA_STATUS_ATCA_DATA_ZONE_LOCKED: ATCA_STATUS = 2;
762#[doc = "!< response status byte indicates CheckMac failure (status byte = 0x01)"]
763pub const ATCA_STATUS_ATCA_WAKE_FAILED: ATCA_STATUS = 208;
764#[doc = "!< response status byte indicates CheckMac failure (status byte = 0x01)"]
765pub const ATCA_STATUS_ATCA_CHECKMAC_VERIFY_FAILED: ATCA_STATUS = 209;
766#[doc = "!< response status byte indicates parsing error (status byte = 0x03)"]
767pub const ATCA_STATUS_ATCA_PARSE_ERROR: ATCA_STATUS = 210;
768#[doc = "!< response status byte indicates DEVICE did not receive data properly (status byte = 0xFF)"]
769pub const ATCA_STATUS_ATCA_STATUS_CRC: ATCA_STATUS = 212;
770#[doc = "!< response status byte is unknown"]
771pub const ATCA_STATUS_ATCA_STATUS_UNKNOWN: ATCA_STATUS = 213;
772#[doc = "!< response status byte is ECC fault (status byte = 0x05)"]
773pub const ATCA_STATUS_ATCA_STATUS_ECC: ATCA_STATUS = 214;
774#[doc = "!< response status byte is Self Test Error, chip in failure mode (status byte = 0x07)"]
775pub const ATCA_STATUS_ATCA_STATUS_SELFTEST_ERROR: ATCA_STATUS = 215;
776#[doc = "!< Function could not execute due to incorrect condition / state."]
777pub const ATCA_STATUS_ATCA_FUNC_FAIL: ATCA_STATUS = 224;
778#[doc = "!< unspecified error"]
779pub const ATCA_STATUS_ATCA_GEN_FAIL: ATCA_STATUS = 225;
780#[doc = "!< bad argument (out of range, null pointer, etc.)"]
781pub const ATCA_STATUS_ATCA_BAD_PARAM: ATCA_STATUS = 226;
782#[doc = "!< invalid device id, id not set"]
783pub const ATCA_STATUS_ATCA_INVALID_ID: ATCA_STATUS = 227;
784#[doc = "!< Count value is out of range or greater than buffer size."]
785pub const ATCA_STATUS_ATCA_INVALID_SIZE: ATCA_STATUS = 228;
786#[doc = "!< CRC error in data received from device"]
787pub const ATCA_STATUS_ATCA_RX_CRC_ERROR: ATCA_STATUS = 229;
788#[doc = "!< Timed out while waiting for response. Number of bytes received is > 0."]
789pub const ATCA_STATUS_ATCA_RX_FAIL: ATCA_STATUS = 230;
790#[doc = "!< Not an error while the Command layer is polling for a command response."]
791pub const ATCA_STATUS_ATCA_RX_NO_RESPONSE: ATCA_STATUS = 231;
792#[doc = "!< Re-synchronization succeeded, but only after generating a Wake-up"]
793pub const ATCA_STATUS_ATCA_RESYNC_WITH_WAKEUP: ATCA_STATUS = 232;
794#[doc = "!< for protocols needing parity"]
795pub const ATCA_STATUS_ATCA_PARITY_ERROR: ATCA_STATUS = 233;
796#[doc = "!< for Microchip PHY protocol, timeout on transmission waiting for master"]
797pub const ATCA_STATUS_ATCA_TX_TIMEOUT: ATCA_STATUS = 234;
798#[doc = "!< for Microchip PHY protocol, timeout on receipt waiting for master"]
799pub const ATCA_STATUS_ATCA_RX_TIMEOUT: ATCA_STATUS = 235;
800#[doc = "!< Device did not respond too many times during a transmission. Could indicate no device present."]
801pub const ATCA_STATUS_ATCA_TOO_MANY_COMM_RETRIES: ATCA_STATUS = 236;
802#[doc = "!< Supplied buffer is too small for data required"]
803pub const ATCA_STATUS_ATCA_SMALL_BUFFER: ATCA_STATUS = 237;
804#[doc = "!< Communication with device failed. Same as in hardware dependent modules."]
805pub const ATCA_STATUS_ATCA_COMM_FAIL: ATCA_STATUS = 240;
806#[doc = "!< Timed out while waiting for response. Number of bytes received is 0."]
807pub const ATCA_STATUS_ATCA_TIMEOUT: ATCA_STATUS = 241;
808#[doc = "!< opcode is not supported by the device"]
809pub const ATCA_STATUS_ATCA_BAD_OPCODE: ATCA_STATUS = 242;
810#[doc = "!< received proper wake token"]
811pub const ATCA_STATUS_ATCA_WAKE_SUCCESS: ATCA_STATUS = 243;
812#[doc = "!< chip was in a state where it could not execute the command, response status byte indicates command execution error (status byte = 0x0F)"]
813pub const ATCA_STATUS_ATCA_EXECUTION_ERROR: ATCA_STATUS = 244;
814#[doc = "!< Function or some element of it hasn't been implemented yet"]
815pub const ATCA_STATUS_ATCA_UNIMPLEMENTED: ATCA_STATUS = 245;
816#[doc = "!< Code failed run-time consistency check"]
817pub const ATCA_STATUS_ATCA_ASSERT_FAILURE: ATCA_STATUS = 246;
818#[doc = "!< Failed to write"]
819pub const ATCA_STATUS_ATCA_TX_FAIL: ATCA_STATUS = 247;
820#[doc = "!< required zone was not locked"]
821pub const ATCA_STATUS_ATCA_NOT_LOCKED: ATCA_STATUS = 248;
822#[doc = "!< For protocols that support device discovery (kit protocol), no devices were found"]
823pub const ATCA_STATUS_ATCA_NO_DEVICES: ATCA_STATUS = 249;
824#[doc = "!< random number generator health test error"]
825pub const ATCA_STATUS_ATCA_HEALTH_TEST_ERROR: ATCA_STATUS = 250;
826#[doc = "!< Couldn't allocate required memory"]
827pub const ATCA_STATUS_ATCA_ALLOC_FAILURE: ATCA_STATUS = 251;
828#[doc = "!< Use flags on the device indicates its consumed fully"]
829pub const ATCA_STATUS_ATCA_USE_FLAGS_CONSUMED: ATCA_STATUS = 252;
830pub type ATCA_STATUS = ::std::os::raw::c_uint;
831pub const ATCADeviceType_ATSHA204A: ATCADeviceType = 0;
832pub const ATCADeviceType_ATECC108A: ATCADeviceType = 1;
833pub const ATCADeviceType_ATECC508A: ATCADeviceType = 2;
834pub const ATCADeviceType_ATECC608A: ATCADeviceType = 3;
835pub const ATCADeviceType_ATSHA206A: ATCADeviceType = 4;
836pub const ATCADeviceType_ATCA_DEV_UNKNOWN: ATCADeviceType = 32;
837#[doc = " \\brief The supported Device type in Cryptoauthlib library"]
838pub type ATCADeviceType = ::std::os::raw::c_uint;
839#[doc = " \\brief atca_command is the C object backing ATCACommand."]
840#[repr(C)]
841#[derive(Debug, Copy, Clone)]
842pub struct atca_command {
843    pub dt: ATCADeviceType,
844    pub clock_divider: u8,
845    pub execution_time_msec: u16,
846}
847#[allow(deref_nullptr)]
848#[test]
849fn bindgen_test_layout_atca_command() {
850    assert_eq!(
851        ::std::mem::size_of::<atca_command>(),
852        8usize,
853        concat!("Size of: ", stringify!(atca_command))
854    );
855    assert_eq!(
856        ::std::mem::align_of::<atca_command>(),
857        4usize,
858        concat!("Alignment of ", stringify!(atca_command))
859    );
860    assert_eq!(
861        unsafe { &(*(::std::ptr::null::<atca_command>())).dt as *const _ as usize },
862        0usize,
863        concat!(
864            "Offset of field: ",
865            stringify!(atca_command),
866            "::",
867            stringify!(dt)
868        )
869    );
870    assert_eq!(
871        unsafe { &(*(::std::ptr::null::<atca_command>())).clock_divider as *const _ as usize },
872        4usize,
873        concat!(
874            "Offset of field: ",
875            stringify!(atca_command),
876            "::",
877            stringify!(clock_divider)
878        )
879    );
880    assert_eq!(
881        unsafe {
882            &(*(::std::ptr::null::<atca_command>())).execution_time_msec as *const _ as usize
883        },
884        6usize,
885        concat!(
886            "Offset of field: ",
887            stringify!(atca_command),
888            "::",
889            stringify!(execution_time_msec)
890        )
891    );
892}
893pub type ATCACommand = *mut atca_command;
894extern "C" {
895    pub fn initATCACommand(device_type: ATCADeviceType, ca_cmd: ATCACommand) -> ATCA_STATUS;
896}
897extern "C" {
898    pub fn newATCACommand(device_type: ATCADeviceType) -> ATCACommand;
899}
900extern "C" {
901    pub fn deleteATCACommand(ca_cmd: *mut ATCACommand);
902}
903#[repr(C)]
904#[derive(Copy, Clone)]
905pub struct ATCAPacket {
906    pub _reserved: u8,
907    pub txsize: u8,
908    pub opcode: u8,
909    pub param1: u8,
910    pub param2: u16,
911    pub data: [u8; 192usize],
912    pub execTime: u8,
913}
914#[allow(deref_nullptr)]
915#[test]
916fn bindgen_test_layout_ATCAPacket() {
917    assert_eq!(
918        ::std::mem::size_of::<ATCAPacket>(),
919        200usize,
920        concat!("Size of: ", stringify!(ATCAPacket))
921    );
922    assert_eq!(
923        ::std::mem::align_of::<ATCAPacket>(),
924        2usize,
925        concat!("Alignment of ", stringify!(ATCAPacket))
926    );
927    assert_eq!(
928        unsafe { &(*(::std::ptr::null::<ATCAPacket>()))._reserved as *const _ as usize },
929        0usize,
930        concat!(
931            "Offset of field: ",
932            stringify!(ATCAPacket),
933            "::",
934            stringify!(_reserved)
935        )
936    );
937    assert_eq!(
938        unsafe { &(*(::std::ptr::null::<ATCAPacket>())).txsize as *const _ as usize },
939        1usize,
940        concat!(
941            "Offset of field: ",
942            stringify!(ATCAPacket),
943            "::",
944            stringify!(txsize)
945        )
946    );
947    assert_eq!(
948        unsafe { &(*(::std::ptr::null::<ATCAPacket>())).opcode as *const _ as usize },
949        2usize,
950        concat!(
951            "Offset of field: ",
952            stringify!(ATCAPacket),
953            "::",
954            stringify!(opcode)
955        )
956    );
957    assert_eq!(
958        unsafe { &(*(::std::ptr::null::<ATCAPacket>())).param1 as *const _ as usize },
959        3usize,
960        concat!(
961            "Offset of field: ",
962            stringify!(ATCAPacket),
963            "::",
964            stringify!(param1)
965        )
966    );
967    assert_eq!(
968        unsafe { &(*(::std::ptr::null::<ATCAPacket>())).param2 as *const _ as usize },
969        4usize,
970        concat!(
971            "Offset of field: ",
972            stringify!(ATCAPacket),
973            "::",
974            stringify!(param2)
975        )
976    );
977    assert_eq!(
978        unsafe { &(*(::std::ptr::null::<ATCAPacket>())).data as *const _ as usize },
979        6usize,
980        concat!(
981            "Offset of field: ",
982            stringify!(ATCAPacket),
983            "::",
984            stringify!(data)
985        )
986    );
987    assert_eq!(
988        unsafe { &(*(::std::ptr::null::<ATCAPacket>())).execTime as *const _ as usize },
989        198usize,
990        concat!(
991            "Offset of field: ",
992            stringify!(ATCAPacket),
993            "::",
994            stringify!(execTime)
995        )
996    );
997}
998extern "C" {
999    pub fn atCheckMAC(ca_cmd: ATCACommand, packet: *mut ATCAPacket) -> ATCA_STATUS;
1000}
1001extern "C" {
1002    pub fn atCounter(ca_cmd: ATCACommand, packet: *mut ATCAPacket) -> ATCA_STATUS;
1003}
1004extern "C" {
1005    pub fn atDeriveKey(ca_cmd: ATCACommand, packet: *mut ATCAPacket, has_mac: bool) -> ATCA_STATUS;
1006}
1007extern "C" {
1008    pub fn atECDH(ca_cmd: ATCACommand, packet: *mut ATCAPacket) -> ATCA_STATUS;
1009}
1010extern "C" {
1011    pub fn atGenDig(
1012        ca_cmd: ATCACommand,
1013        packet: *mut ATCAPacket,
1014        is_no_mac_key: bool,
1015    ) -> ATCA_STATUS;
1016}
1017extern "C" {
1018    pub fn atGenKey(ca_cmd: ATCACommand, packet: *mut ATCAPacket) -> ATCA_STATUS;
1019}
1020extern "C" {
1021    pub fn atHMAC(ca_cmd: ATCACommand, packet: *mut ATCAPacket) -> ATCA_STATUS;
1022}
1023extern "C" {
1024    pub fn atInfo(ca_cmd: ATCACommand, packet: *mut ATCAPacket) -> ATCA_STATUS;
1025}
1026extern "C" {
1027    pub fn atLock(ca_cmd: ATCACommand, packet: *mut ATCAPacket) -> ATCA_STATUS;
1028}
1029extern "C" {
1030    pub fn atMAC(ca_cmd: ATCACommand, packet: *mut ATCAPacket) -> ATCA_STATUS;
1031}
1032extern "C" {
1033    pub fn atNonce(ca_cmd: ATCACommand, packet: *mut ATCAPacket) -> ATCA_STATUS;
1034}
1035extern "C" {
1036    pub fn atPause(ca_cmd: ATCACommand, packet: *mut ATCAPacket) -> ATCA_STATUS;
1037}
1038extern "C" {
1039    pub fn atPrivWrite(ca_cmd: ATCACommand, packet: *mut ATCAPacket) -> ATCA_STATUS;
1040}
1041extern "C" {
1042    pub fn atRandom(ca_cmd: ATCACommand, packet: *mut ATCAPacket) -> ATCA_STATUS;
1043}
1044extern "C" {
1045    pub fn atRead(ca_cmd: ATCACommand, packet: *mut ATCAPacket) -> ATCA_STATUS;
1046}
1047extern "C" {
1048    pub fn atSecureBoot(ca_cmd: ATCACommand, packet: *mut ATCAPacket) -> ATCA_STATUS;
1049}
1050extern "C" {
1051    pub fn atSHA(
1052        ca_cmd: ATCACommand,
1053        packet: *mut ATCAPacket,
1054        write_context_size: u16,
1055    ) -> ATCA_STATUS;
1056}
1057extern "C" {
1058    pub fn atSign(ca_cmd: ATCACommand, packet: *mut ATCAPacket) -> ATCA_STATUS;
1059}
1060extern "C" {
1061    pub fn atUpdateExtra(ca_cmd: ATCACommand, packet: *mut ATCAPacket) -> ATCA_STATUS;
1062}
1063extern "C" {
1064    pub fn atVerify(ca_cmd: ATCACommand, packet: *mut ATCAPacket) -> ATCA_STATUS;
1065}
1066extern "C" {
1067    pub fn atWrite(ca_cmd: ATCACommand, packet: *mut ATCAPacket, has_mac: bool) -> ATCA_STATUS;
1068}
1069extern "C" {
1070    pub fn atAES(ca_cmd: ATCACommand, packet: *mut ATCAPacket) -> ATCA_STATUS;
1071}
1072extern "C" {
1073    pub fn atSelfTest(ca_cmd: ATCACommand, packet: *mut ATCAPacket) -> ATCA_STATUS;
1074}
1075extern "C" {
1076    pub fn atKDF(ca_cmd: ATCACommand, packet: *mut ATCAPacket) -> ATCA_STATUS;
1077}
1078extern "C" {
1079    pub fn atIsSHAFamily(device_type: ATCADeviceType) -> bool;
1080}
1081extern "C" {
1082    pub fn atIsECCFamily(device_type: ATCADeviceType) -> bool;
1083}
1084extern "C" {
1085    pub fn isATCAError(data: *mut u8) -> ATCA_STATUS;
1086}
1087extern "C" {
1088    pub fn atCRC(length: size_t, data: *const u8, crc_le: *mut u8);
1089}
1090extern "C" {
1091    pub fn atCalcCrc(pkt: *mut ATCAPacket);
1092}
1093extern "C" {
1094    pub fn atCheckCrc(response: *const u8) -> ATCA_STATUS;
1095}
1096pub const ATCAIfaceType_ATCA_I2C_IFACE: ATCAIfaceType = 0;
1097pub const ATCAIfaceType_ATCA_SWI_IFACE: ATCAIfaceType = 1;
1098pub const ATCAIfaceType_ATCA_UART_IFACE: ATCAIfaceType = 2;
1099pub const ATCAIfaceType_ATCA_SPI_IFACE: ATCAIfaceType = 3;
1100pub const ATCAIfaceType_ATCA_HID_IFACE: ATCAIfaceType = 4;
1101pub const ATCAIfaceType_ATCA_CUSTOM_IFACE: ATCAIfaceType = 5;
1102pub const ATCAIfaceType_ATCA_UNKNOWN_IFACE: ATCAIfaceType = 6;
1103pub type ATCAIfaceType = ::std::os::raw::c_uint;
1104pub const ATCAKitType_ATCA_KIT_AUTO_IFACE: ATCAKitType = 0;
1105pub const ATCAKitType_ATCA_KIT_I2C_IFACE: ATCAKitType = 1;
1106pub const ATCAKitType_ATCA_KIT_SWI_IFACE: ATCAKitType = 2;
1107pub const ATCAKitType_ATCA_KIT_UNKNOWN_IFACE: ATCAKitType = 3;
1108pub type ATCAKitType = ::std::os::raw::c_uint;
1109#[repr(C)]
1110#[derive(Copy, Clone)]
1111pub struct ATCAIfaceCfg {
1112    pub iface_type: ATCAIfaceType,
1113    pub devtype: ATCADeviceType,
1114    pub __bindgen_anon_1: ATCAIfaceCfg__bindgen_ty_1,
1115    pub wake_delay: u16,
1116    pub rx_retries: ::std::os::raw::c_int,
1117    pub cfg_data: *mut ::std::os::raw::c_void,
1118}
1119#[repr(C)]
1120#[derive(Copy, Clone)]
1121pub union ATCAIfaceCfg__bindgen_ty_1 {
1122    pub atcai2c: ATCAIfaceCfg__bindgen_ty_1__bindgen_ty_1,
1123    pub atcaswi: ATCAIfaceCfg__bindgen_ty_1__bindgen_ty_2,
1124    pub atcauart: ATCAIfaceCfg__bindgen_ty_1__bindgen_ty_3,
1125    pub atcahid: ATCAIfaceCfg__bindgen_ty_1__bindgen_ty_4,
1126    pub atcacustom: ATCAIfaceCfg__bindgen_ty_1__bindgen_ty_5,
1127}
1128#[repr(C)]
1129#[derive(Debug, Copy, Clone)]
1130pub struct ATCAIfaceCfg__bindgen_ty_1__bindgen_ty_1 {
1131    pub slave_address: u8,
1132    pub bus: u8,
1133    pub baud: u32,
1134}
1135#[allow(deref_nullptr)]
1136#[test]
1137fn bindgen_test_layout_ATCAIfaceCfg__bindgen_ty_1__bindgen_ty_1() {
1138    assert_eq!(
1139        ::std::mem::size_of::<ATCAIfaceCfg__bindgen_ty_1__bindgen_ty_1>(),
1140        8usize,
1141        concat!(
1142            "Size of: ",
1143            stringify!(ATCAIfaceCfg__bindgen_ty_1__bindgen_ty_1)
1144        )
1145    );
1146    assert_eq!(
1147        ::std::mem::align_of::<ATCAIfaceCfg__bindgen_ty_1__bindgen_ty_1>(),
1148        4usize,
1149        concat!(
1150            "Alignment of ",
1151            stringify!(ATCAIfaceCfg__bindgen_ty_1__bindgen_ty_1)
1152        )
1153    );
1154    assert_eq!(
1155        unsafe {
1156            &(*(::std::ptr::null::<ATCAIfaceCfg__bindgen_ty_1__bindgen_ty_1>())).slave_address
1157                as *const _ as usize
1158        },
1159        0usize,
1160        concat!(
1161            "Offset of field: ",
1162            stringify!(ATCAIfaceCfg__bindgen_ty_1__bindgen_ty_1),
1163            "::",
1164            stringify!(slave_address)
1165        )
1166    );
1167    assert_eq!(
1168        unsafe {
1169            &(*(::std::ptr::null::<ATCAIfaceCfg__bindgen_ty_1__bindgen_ty_1>())).bus as *const _
1170                as usize
1171        },
1172        1usize,
1173        concat!(
1174            "Offset of field: ",
1175            stringify!(ATCAIfaceCfg__bindgen_ty_1__bindgen_ty_1),
1176            "::",
1177            stringify!(bus)
1178        )
1179    );
1180    assert_eq!(
1181        unsafe {
1182            &(*(::std::ptr::null::<ATCAIfaceCfg__bindgen_ty_1__bindgen_ty_1>())).baud as *const _
1183                as usize
1184        },
1185        4usize,
1186        concat!(
1187            "Offset of field: ",
1188            stringify!(ATCAIfaceCfg__bindgen_ty_1__bindgen_ty_1),
1189            "::",
1190            stringify!(baud)
1191        )
1192    );
1193}
1194#[repr(C)]
1195#[derive(Debug, Copy, Clone)]
1196pub struct ATCAIfaceCfg__bindgen_ty_1__bindgen_ty_2 {
1197    pub bus: u8,
1198}
1199#[allow(deref_nullptr)]
1200#[test]
1201fn bindgen_test_layout_ATCAIfaceCfg__bindgen_ty_1__bindgen_ty_2() {
1202    assert_eq!(
1203        ::std::mem::size_of::<ATCAIfaceCfg__bindgen_ty_1__bindgen_ty_2>(),
1204        1usize,
1205        concat!(
1206            "Size of: ",
1207            stringify!(ATCAIfaceCfg__bindgen_ty_1__bindgen_ty_2)
1208        )
1209    );
1210    assert_eq!(
1211        ::std::mem::align_of::<ATCAIfaceCfg__bindgen_ty_1__bindgen_ty_2>(),
1212        1usize,
1213        concat!(
1214            "Alignment of ",
1215            stringify!(ATCAIfaceCfg__bindgen_ty_1__bindgen_ty_2)
1216        )
1217    );
1218    assert_eq!(
1219        unsafe {
1220            &(*(::std::ptr::null::<ATCAIfaceCfg__bindgen_ty_1__bindgen_ty_2>())).bus as *const _
1221                as usize
1222        },
1223        0usize,
1224        concat!(
1225            "Offset of field: ",
1226            stringify!(ATCAIfaceCfg__bindgen_ty_1__bindgen_ty_2),
1227            "::",
1228            stringify!(bus)
1229        )
1230    );
1231}
1232#[repr(C)]
1233#[derive(Debug, Copy, Clone)]
1234pub struct ATCAIfaceCfg__bindgen_ty_1__bindgen_ty_3 {
1235    pub port: ::std::os::raw::c_int,
1236    pub baud: u32,
1237    pub wordsize: u8,
1238    pub parity: u8,
1239    pub stopbits: u8,
1240}
1241#[allow(deref_nullptr)]
1242#[test]
1243fn bindgen_test_layout_ATCAIfaceCfg__bindgen_ty_1__bindgen_ty_3() {
1244    assert_eq!(
1245        ::std::mem::size_of::<ATCAIfaceCfg__bindgen_ty_1__bindgen_ty_3>(),
1246        12usize,
1247        concat!(
1248            "Size of: ",
1249            stringify!(ATCAIfaceCfg__bindgen_ty_1__bindgen_ty_3)
1250        )
1251    );
1252    assert_eq!(
1253        ::std::mem::align_of::<ATCAIfaceCfg__bindgen_ty_1__bindgen_ty_3>(),
1254        4usize,
1255        concat!(
1256            "Alignment of ",
1257            stringify!(ATCAIfaceCfg__bindgen_ty_1__bindgen_ty_3)
1258        )
1259    );
1260    assert_eq!(
1261        unsafe {
1262            &(*(::std::ptr::null::<ATCAIfaceCfg__bindgen_ty_1__bindgen_ty_3>())).port as *const _
1263                as usize
1264        },
1265        0usize,
1266        concat!(
1267            "Offset of field: ",
1268            stringify!(ATCAIfaceCfg__bindgen_ty_1__bindgen_ty_3),
1269            "::",
1270            stringify!(port)
1271        )
1272    );
1273    assert_eq!(
1274        unsafe {
1275            &(*(::std::ptr::null::<ATCAIfaceCfg__bindgen_ty_1__bindgen_ty_3>())).baud as *const _
1276                as usize
1277        },
1278        4usize,
1279        concat!(
1280            "Offset of field: ",
1281            stringify!(ATCAIfaceCfg__bindgen_ty_1__bindgen_ty_3),
1282            "::",
1283            stringify!(baud)
1284        )
1285    );
1286    assert_eq!(
1287        unsafe {
1288            &(*(::std::ptr::null::<ATCAIfaceCfg__bindgen_ty_1__bindgen_ty_3>())).wordsize
1289                as *const _ as usize
1290        },
1291        8usize,
1292        concat!(
1293            "Offset of field: ",
1294            stringify!(ATCAIfaceCfg__bindgen_ty_1__bindgen_ty_3),
1295            "::",
1296            stringify!(wordsize)
1297        )
1298    );
1299    assert_eq!(
1300        unsafe {
1301            &(*(::std::ptr::null::<ATCAIfaceCfg__bindgen_ty_1__bindgen_ty_3>())).parity as *const _
1302                as usize
1303        },
1304        9usize,
1305        concat!(
1306            "Offset of field: ",
1307            stringify!(ATCAIfaceCfg__bindgen_ty_1__bindgen_ty_3),
1308            "::",
1309            stringify!(parity)
1310        )
1311    );
1312    assert_eq!(
1313        unsafe {
1314            &(*(::std::ptr::null::<ATCAIfaceCfg__bindgen_ty_1__bindgen_ty_3>())).stopbits
1315                as *const _ as usize
1316        },
1317        10usize,
1318        concat!(
1319            "Offset of field: ",
1320            stringify!(ATCAIfaceCfg__bindgen_ty_1__bindgen_ty_3),
1321            "::",
1322            stringify!(stopbits)
1323        )
1324    );
1325}
1326#[repr(C)]
1327#[derive(Debug, Copy, Clone)]
1328pub struct ATCAIfaceCfg__bindgen_ty_1__bindgen_ty_4 {
1329    pub idx: ::std::os::raw::c_int,
1330    pub dev_interface: ATCAKitType,
1331    pub dev_identity: u8,
1332    pub vid: u32,
1333    pub pid: u32,
1334    pub packetsize: u32,
1335}
1336#[allow(deref_nullptr)]
1337#[test]
1338fn bindgen_test_layout_ATCAIfaceCfg__bindgen_ty_1__bindgen_ty_4() {
1339    assert_eq!(
1340        ::std::mem::size_of::<ATCAIfaceCfg__bindgen_ty_1__bindgen_ty_4>(),
1341        24usize,
1342        concat!(
1343            "Size of: ",
1344            stringify!(ATCAIfaceCfg__bindgen_ty_1__bindgen_ty_4)
1345        )
1346    );
1347    assert_eq!(
1348        ::std::mem::align_of::<ATCAIfaceCfg__bindgen_ty_1__bindgen_ty_4>(),
1349        4usize,
1350        concat!(
1351            "Alignment of ",
1352            stringify!(ATCAIfaceCfg__bindgen_ty_1__bindgen_ty_4)
1353        )
1354    );
1355    assert_eq!(
1356        unsafe {
1357            &(*(::std::ptr::null::<ATCAIfaceCfg__bindgen_ty_1__bindgen_ty_4>())).idx as *const _
1358                as usize
1359        },
1360        0usize,
1361        concat!(
1362            "Offset of field: ",
1363            stringify!(ATCAIfaceCfg__bindgen_ty_1__bindgen_ty_4),
1364            "::",
1365            stringify!(idx)
1366        )
1367    );
1368    assert_eq!(
1369        unsafe {
1370            &(*(::std::ptr::null::<ATCAIfaceCfg__bindgen_ty_1__bindgen_ty_4>())).dev_interface
1371                as *const _ as usize
1372        },
1373        4usize,
1374        concat!(
1375            "Offset of field: ",
1376            stringify!(ATCAIfaceCfg__bindgen_ty_1__bindgen_ty_4),
1377            "::",
1378            stringify!(dev_interface)
1379        )
1380    );
1381    assert_eq!(
1382        unsafe {
1383            &(*(::std::ptr::null::<ATCAIfaceCfg__bindgen_ty_1__bindgen_ty_4>())).dev_identity
1384                as *const _ as usize
1385        },
1386        8usize,
1387        concat!(
1388            "Offset of field: ",
1389            stringify!(ATCAIfaceCfg__bindgen_ty_1__bindgen_ty_4),
1390            "::",
1391            stringify!(dev_identity)
1392        )
1393    );
1394    assert_eq!(
1395        unsafe {
1396            &(*(::std::ptr::null::<ATCAIfaceCfg__bindgen_ty_1__bindgen_ty_4>())).vid as *const _
1397                as usize
1398        },
1399        12usize,
1400        concat!(
1401            "Offset of field: ",
1402            stringify!(ATCAIfaceCfg__bindgen_ty_1__bindgen_ty_4),
1403            "::",
1404            stringify!(vid)
1405        )
1406    );
1407    assert_eq!(
1408        unsafe {
1409            &(*(::std::ptr::null::<ATCAIfaceCfg__bindgen_ty_1__bindgen_ty_4>())).pid as *const _
1410                as usize
1411        },
1412        16usize,
1413        concat!(
1414            "Offset of field: ",
1415            stringify!(ATCAIfaceCfg__bindgen_ty_1__bindgen_ty_4),
1416            "::",
1417            stringify!(pid)
1418        )
1419    );
1420    assert_eq!(
1421        unsafe {
1422            &(*(::std::ptr::null::<ATCAIfaceCfg__bindgen_ty_1__bindgen_ty_4>())).packetsize
1423                as *const _ as usize
1424        },
1425        20usize,
1426        concat!(
1427            "Offset of field: ",
1428            stringify!(ATCAIfaceCfg__bindgen_ty_1__bindgen_ty_4),
1429            "::",
1430            stringify!(packetsize)
1431        )
1432    );
1433}
1434#[repr(C)]
1435#[derive(Debug, Copy, Clone)]
1436pub struct ATCAIfaceCfg__bindgen_ty_1__bindgen_ty_5 {
1437    pub halinit: ::std::option::Option<
1438        unsafe extern "C" fn(
1439            hal: *mut ::std::os::raw::c_void,
1440            cfg: *mut ::std::os::raw::c_void,
1441        ) -> ATCA_STATUS,
1442    >,
1443    pub halpostinit: ::std::option::Option<
1444        unsafe extern "C" fn(iface: *mut ::std::os::raw::c_void) -> ATCA_STATUS,
1445    >,
1446    pub halsend: ::std::option::Option<
1447        unsafe extern "C" fn(
1448            iface: *mut ::std::os::raw::c_void,
1449            txdata: *mut u8,
1450            txlength: ::std::os::raw::c_int,
1451        ) -> ATCA_STATUS,
1452    >,
1453    pub halreceive: ::std::option::Option<
1454        unsafe extern "C" fn(
1455            iface: *mut ::std::os::raw::c_void,
1456            rxdata: *mut u8,
1457            rxlength: *mut u16,
1458        ) -> ATCA_STATUS,
1459    >,
1460    pub halwake: ::std::option::Option<
1461        unsafe extern "C" fn(iface: *mut ::std::os::raw::c_void) -> ATCA_STATUS,
1462    >,
1463    pub halidle: ::std::option::Option<
1464        unsafe extern "C" fn(iface: *mut ::std::os::raw::c_void) -> ATCA_STATUS,
1465    >,
1466    pub halsleep: ::std::option::Option<
1467        unsafe extern "C" fn(iface: *mut ::std::os::raw::c_void) -> ATCA_STATUS,
1468    >,
1469    pub halrelease: ::std::option::Option<
1470        unsafe extern "C" fn(hal_data: *mut ::std::os::raw::c_void) -> ATCA_STATUS,
1471    >,
1472}
1473#[allow(deref_nullptr)]
1474#[test]
1475fn bindgen_test_layout_ATCAIfaceCfg__bindgen_ty_1__bindgen_ty_5() {
1476    assert_eq!(
1477        ::std::mem::size_of::<ATCAIfaceCfg__bindgen_ty_1__bindgen_ty_5>(),
1478        64usize,
1479        concat!(
1480            "Size of: ",
1481            stringify!(ATCAIfaceCfg__bindgen_ty_1__bindgen_ty_5)
1482        )
1483    );
1484    assert_eq!(
1485        ::std::mem::align_of::<ATCAIfaceCfg__bindgen_ty_1__bindgen_ty_5>(),
1486        8usize,
1487        concat!(
1488            "Alignment of ",
1489            stringify!(ATCAIfaceCfg__bindgen_ty_1__bindgen_ty_5)
1490        )
1491    );
1492    assert_eq!(
1493        unsafe {
1494            &(*(::std::ptr::null::<ATCAIfaceCfg__bindgen_ty_1__bindgen_ty_5>())).halinit as *const _
1495                as usize
1496        },
1497        0usize,
1498        concat!(
1499            "Offset of field: ",
1500            stringify!(ATCAIfaceCfg__bindgen_ty_1__bindgen_ty_5),
1501            "::",
1502            stringify!(halinit)
1503        )
1504    );
1505    assert_eq!(
1506        unsafe {
1507            &(*(::std::ptr::null::<ATCAIfaceCfg__bindgen_ty_1__bindgen_ty_5>())).halpostinit
1508                as *const _ as usize
1509        },
1510        8usize,
1511        concat!(
1512            "Offset of field: ",
1513            stringify!(ATCAIfaceCfg__bindgen_ty_1__bindgen_ty_5),
1514            "::",
1515            stringify!(halpostinit)
1516        )
1517    );
1518    assert_eq!(
1519        unsafe {
1520            &(*(::std::ptr::null::<ATCAIfaceCfg__bindgen_ty_1__bindgen_ty_5>())).halsend as *const _
1521                as usize
1522        },
1523        16usize,
1524        concat!(
1525            "Offset of field: ",
1526            stringify!(ATCAIfaceCfg__bindgen_ty_1__bindgen_ty_5),
1527            "::",
1528            stringify!(halsend)
1529        )
1530    );
1531    assert_eq!(
1532        unsafe {
1533            &(*(::std::ptr::null::<ATCAIfaceCfg__bindgen_ty_1__bindgen_ty_5>())).halreceive
1534                as *const _ as usize
1535        },
1536        24usize,
1537        concat!(
1538            "Offset of field: ",
1539            stringify!(ATCAIfaceCfg__bindgen_ty_1__bindgen_ty_5),
1540            "::",
1541            stringify!(halreceive)
1542        )
1543    );
1544    assert_eq!(
1545        unsafe {
1546            &(*(::std::ptr::null::<ATCAIfaceCfg__bindgen_ty_1__bindgen_ty_5>())).halwake as *const _
1547                as usize
1548        },
1549        32usize,
1550        concat!(
1551            "Offset of field: ",
1552            stringify!(ATCAIfaceCfg__bindgen_ty_1__bindgen_ty_5),
1553            "::",
1554            stringify!(halwake)
1555        )
1556    );
1557    assert_eq!(
1558        unsafe {
1559            &(*(::std::ptr::null::<ATCAIfaceCfg__bindgen_ty_1__bindgen_ty_5>())).halidle as *const _
1560                as usize
1561        },
1562        40usize,
1563        concat!(
1564            "Offset of field: ",
1565            stringify!(ATCAIfaceCfg__bindgen_ty_1__bindgen_ty_5),
1566            "::",
1567            stringify!(halidle)
1568        )
1569    );
1570    assert_eq!(
1571        unsafe {
1572            &(*(::std::ptr::null::<ATCAIfaceCfg__bindgen_ty_1__bindgen_ty_5>())).halsleep
1573                as *const _ as usize
1574        },
1575        48usize,
1576        concat!(
1577            "Offset of field: ",
1578            stringify!(ATCAIfaceCfg__bindgen_ty_1__bindgen_ty_5),
1579            "::",
1580            stringify!(halsleep)
1581        )
1582    );
1583    assert_eq!(
1584        unsafe {
1585            &(*(::std::ptr::null::<ATCAIfaceCfg__bindgen_ty_1__bindgen_ty_5>())).halrelease
1586                as *const _ as usize
1587        },
1588        56usize,
1589        concat!(
1590            "Offset of field: ",
1591            stringify!(ATCAIfaceCfg__bindgen_ty_1__bindgen_ty_5),
1592            "::",
1593            stringify!(halrelease)
1594        )
1595    );
1596}
1597#[allow(deref_nullptr)]
1598#[test]
1599fn bindgen_test_layout_ATCAIfaceCfg__bindgen_ty_1() {
1600    assert_eq!(
1601        ::std::mem::size_of::<ATCAIfaceCfg__bindgen_ty_1>(),
1602        64usize,
1603        concat!("Size of: ", stringify!(ATCAIfaceCfg__bindgen_ty_1))
1604    );
1605    assert_eq!(
1606        ::std::mem::align_of::<ATCAIfaceCfg__bindgen_ty_1>(),
1607        8usize,
1608        concat!("Alignment of ", stringify!(ATCAIfaceCfg__bindgen_ty_1))
1609    );
1610    assert_eq!(
1611        unsafe {
1612            &(*(::std::ptr::null::<ATCAIfaceCfg__bindgen_ty_1>())).atcai2c as *const _ as usize
1613        },
1614        0usize,
1615        concat!(
1616            "Offset of field: ",
1617            stringify!(ATCAIfaceCfg__bindgen_ty_1),
1618            "::",
1619            stringify!(atcai2c)
1620        )
1621    );
1622    assert_eq!(
1623        unsafe {
1624            &(*(::std::ptr::null::<ATCAIfaceCfg__bindgen_ty_1>())).atcaswi as *const _ as usize
1625        },
1626        0usize,
1627        concat!(
1628            "Offset of field: ",
1629            stringify!(ATCAIfaceCfg__bindgen_ty_1),
1630            "::",
1631            stringify!(atcaswi)
1632        )
1633    );
1634    assert_eq!(
1635        unsafe {
1636            &(*(::std::ptr::null::<ATCAIfaceCfg__bindgen_ty_1>())).atcauart as *const _ as usize
1637        },
1638        0usize,
1639        concat!(
1640            "Offset of field: ",
1641            stringify!(ATCAIfaceCfg__bindgen_ty_1),
1642            "::",
1643            stringify!(atcauart)
1644        )
1645    );
1646    assert_eq!(
1647        unsafe {
1648            &(*(::std::ptr::null::<ATCAIfaceCfg__bindgen_ty_1>())).atcahid as *const _ as usize
1649        },
1650        0usize,
1651        concat!(
1652            "Offset of field: ",
1653            stringify!(ATCAIfaceCfg__bindgen_ty_1),
1654            "::",
1655            stringify!(atcahid)
1656        )
1657    );
1658    assert_eq!(
1659        unsafe {
1660            &(*(::std::ptr::null::<ATCAIfaceCfg__bindgen_ty_1>())).atcacustom as *const _ as usize
1661        },
1662        0usize,
1663        concat!(
1664            "Offset of field: ",
1665            stringify!(ATCAIfaceCfg__bindgen_ty_1),
1666            "::",
1667            stringify!(atcacustom)
1668        )
1669    );
1670}
1671#[allow(deref_nullptr)]
1672#[test]
1673fn bindgen_test_layout_ATCAIfaceCfg() {
1674    assert_eq!(
1675        ::std::mem::size_of::<ATCAIfaceCfg>(),
1676        88usize,
1677        concat!("Size of: ", stringify!(ATCAIfaceCfg))
1678    );
1679    assert_eq!(
1680        ::std::mem::align_of::<ATCAIfaceCfg>(),
1681        8usize,
1682        concat!("Alignment of ", stringify!(ATCAIfaceCfg))
1683    );
1684    assert_eq!(
1685        unsafe { &(*(::std::ptr::null::<ATCAIfaceCfg>())).iface_type as *const _ as usize },
1686        0usize,
1687        concat!(
1688            "Offset of field: ",
1689            stringify!(ATCAIfaceCfg),
1690            "::",
1691            stringify!(iface_type)
1692        )
1693    );
1694    assert_eq!(
1695        unsafe { &(*(::std::ptr::null::<ATCAIfaceCfg>())).devtype as *const _ as usize },
1696        4usize,
1697        concat!(
1698            "Offset of field: ",
1699            stringify!(ATCAIfaceCfg),
1700            "::",
1701            stringify!(devtype)
1702        )
1703    );
1704    assert_eq!(
1705        unsafe { &(*(::std::ptr::null::<ATCAIfaceCfg>())).wake_delay as *const _ as usize },
1706        72usize,
1707        concat!(
1708            "Offset of field: ",
1709            stringify!(ATCAIfaceCfg),
1710            "::",
1711            stringify!(wake_delay)
1712        )
1713    );
1714    assert_eq!(
1715        unsafe { &(*(::std::ptr::null::<ATCAIfaceCfg>())).rx_retries as *const _ as usize },
1716        76usize,
1717        concat!(
1718            "Offset of field: ",
1719            stringify!(ATCAIfaceCfg),
1720            "::",
1721            stringify!(rx_retries)
1722        )
1723    );
1724    assert_eq!(
1725        unsafe { &(*(::std::ptr::null::<ATCAIfaceCfg>())).cfg_data as *const _ as usize },
1726        80usize,
1727        concat!(
1728            "Offset of field: ",
1729            stringify!(ATCAIfaceCfg),
1730            "::",
1731            stringify!(cfg_data)
1732        )
1733    );
1734}
1735pub type ATCAIface = *mut atca_iface;
1736#[doc = " \\brief atca_iface is the C object backing ATCAIface.  See the atca_iface.h file for"]
1737#[doc = " details on the ATCAIface methods"]
1738#[repr(C)]
1739#[derive(Debug, Copy, Clone)]
1740pub struct atca_iface {
1741    pub mType: ATCAIfaceType,
1742    pub mIfaceCFG: *mut ATCAIfaceCfg,
1743    pub atinit: ::std::option::Option<
1744        unsafe extern "C" fn(
1745            hal: *mut ::std::os::raw::c_void,
1746            arg1: *mut ATCAIfaceCfg,
1747        ) -> ATCA_STATUS,
1748    >,
1749    pub atpostinit: ::std::option::Option<unsafe extern "C" fn(hal: ATCAIface) -> ATCA_STATUS>,
1750    pub atsend: ::std::option::Option<
1751        unsafe extern "C" fn(
1752            hal: ATCAIface,
1753            txdata: *mut u8,
1754            txlength: ::std::os::raw::c_int,
1755        ) -> ATCA_STATUS,
1756    >,
1757    pub atreceive: ::std::option::Option<
1758        unsafe extern "C" fn(hal: ATCAIface, rxdata: *mut u8, rxlength: *mut u16) -> ATCA_STATUS,
1759    >,
1760    pub atwake: ::std::option::Option<unsafe extern "C" fn(hal: ATCAIface) -> ATCA_STATUS>,
1761    pub atidle: ::std::option::Option<unsafe extern "C" fn(hal: ATCAIface) -> ATCA_STATUS>,
1762    pub atsleep: ::std::option::Option<unsafe extern "C" fn(hal: ATCAIface) -> ATCA_STATUS>,
1763    pub hal_data: *mut ::std::os::raw::c_void,
1764}
1765#[allow(deref_nullptr)]
1766#[test]
1767fn bindgen_test_layout_atca_iface() {
1768    assert_eq!(
1769        ::std::mem::size_of::<atca_iface>(),
1770        80usize,
1771        concat!("Size of: ", stringify!(atca_iface))
1772    );
1773    assert_eq!(
1774        ::std::mem::align_of::<atca_iface>(),
1775        8usize,
1776        concat!("Alignment of ", stringify!(atca_iface))
1777    );
1778    assert_eq!(
1779        unsafe { &(*(::std::ptr::null::<atca_iface>())).mType as *const _ as usize },
1780        0usize,
1781        concat!(
1782            "Offset of field: ",
1783            stringify!(atca_iface),
1784            "::",
1785            stringify!(mType)
1786        )
1787    );
1788    assert_eq!(
1789        unsafe { &(*(::std::ptr::null::<atca_iface>())).mIfaceCFG as *const _ as usize },
1790        8usize,
1791        concat!(
1792            "Offset of field: ",
1793            stringify!(atca_iface),
1794            "::",
1795            stringify!(mIfaceCFG)
1796        )
1797    );
1798    assert_eq!(
1799        unsafe { &(*(::std::ptr::null::<atca_iface>())).atinit as *const _ as usize },
1800        16usize,
1801        concat!(
1802            "Offset of field: ",
1803            stringify!(atca_iface),
1804            "::",
1805            stringify!(atinit)
1806        )
1807    );
1808    assert_eq!(
1809        unsafe { &(*(::std::ptr::null::<atca_iface>())).atpostinit as *const _ as usize },
1810        24usize,
1811        concat!(
1812            "Offset of field: ",
1813            stringify!(atca_iface),
1814            "::",
1815            stringify!(atpostinit)
1816        )
1817    );
1818    assert_eq!(
1819        unsafe { &(*(::std::ptr::null::<atca_iface>())).atsend as *const _ as usize },
1820        32usize,
1821        concat!(
1822            "Offset of field: ",
1823            stringify!(atca_iface),
1824            "::",
1825            stringify!(atsend)
1826        )
1827    );
1828    assert_eq!(
1829        unsafe { &(*(::std::ptr::null::<atca_iface>())).atreceive as *const _ as usize },
1830        40usize,
1831        concat!(
1832            "Offset of field: ",
1833            stringify!(atca_iface),
1834            "::",
1835            stringify!(atreceive)
1836        )
1837    );
1838    assert_eq!(
1839        unsafe { &(*(::std::ptr::null::<atca_iface>())).atwake as *const _ as usize },
1840        48usize,
1841        concat!(
1842            "Offset of field: ",
1843            stringify!(atca_iface),
1844            "::",
1845            stringify!(atwake)
1846        )
1847    );
1848    assert_eq!(
1849        unsafe { &(*(::std::ptr::null::<atca_iface>())).atidle as *const _ as usize },
1850        56usize,
1851        concat!(
1852            "Offset of field: ",
1853            stringify!(atca_iface),
1854            "::",
1855            stringify!(atidle)
1856        )
1857    );
1858    assert_eq!(
1859        unsafe { &(*(::std::ptr::null::<atca_iface>())).atsleep as *const _ as usize },
1860        64usize,
1861        concat!(
1862            "Offset of field: ",
1863            stringify!(atca_iface),
1864            "::",
1865            stringify!(atsleep)
1866        )
1867    );
1868    assert_eq!(
1869        unsafe { &(*(::std::ptr::null::<atca_iface>())).hal_data as *const _ as usize },
1870        72usize,
1871        concat!(
1872            "Offset of field: ",
1873            stringify!(atca_iface),
1874            "::",
1875            stringify!(hal_data)
1876        )
1877    );
1878}
1879extern "C" {
1880    pub fn initATCAIface(cfg: *mut ATCAIfaceCfg, ca_iface: ATCAIface) -> ATCA_STATUS;
1881}
1882extern "C" {
1883    pub fn newATCAIface(cfg: *mut ATCAIfaceCfg) -> ATCAIface;
1884}
1885extern "C" {
1886    pub fn releaseATCAIface(ca_iface: ATCAIface) -> ATCA_STATUS;
1887}
1888extern "C" {
1889    pub fn deleteATCAIface(ca_iface: *mut ATCAIface);
1890}
1891extern "C" {
1892    pub fn atinit(ca_iface: ATCAIface) -> ATCA_STATUS;
1893}
1894extern "C" {
1895    pub fn atpostinit(ca_iface: ATCAIface) -> ATCA_STATUS;
1896}
1897extern "C" {
1898    pub fn atsend(
1899        ca_iface: ATCAIface,
1900        txdata: *mut u8,
1901        txlength: ::std::os::raw::c_int,
1902    ) -> ATCA_STATUS;
1903}
1904extern "C" {
1905    pub fn atreceive(ca_iface: ATCAIface, rxdata: *mut u8, rxlength: *mut u16) -> ATCA_STATUS;
1906}
1907extern "C" {
1908    pub fn atwake(ca_iface: ATCAIface) -> ATCA_STATUS;
1909}
1910extern "C" {
1911    pub fn atidle(ca_iface: ATCAIface) -> ATCA_STATUS;
1912}
1913extern "C" {
1914    pub fn atsleep(ca_iface: ATCAIface) -> ATCA_STATUS;
1915}
1916extern "C" {
1917    pub fn atgetifacecfg(ca_iface: ATCAIface) -> *mut ATCAIfaceCfg;
1918}
1919extern "C" {
1920    pub fn atgetifacehaldat(ca_iface: ATCAIface) -> *mut ::std::os::raw::c_void;
1921}
1922#[doc = " \\brief an intermediary data structure to allow the HAL layer to point the standard API functions"]
1923#[doc = "used by the upper layers to the HAL implementation for the interface.  This isolates the upper layers"]
1924#[doc = "and loosely couples the ATCAIface object from the physical implementation."]
1925#[repr(C)]
1926#[derive(Debug, Copy, Clone)]
1927pub struct ATCAHAL_t {
1928    pub halinit: ::std::option::Option<
1929        unsafe extern "C" fn(
1930            hal: *mut ::std::os::raw::c_void,
1931            cfg: *mut ATCAIfaceCfg,
1932        ) -> ATCA_STATUS,
1933    >,
1934    pub halpostinit: ::std::option::Option<unsafe extern "C" fn(iface: ATCAIface) -> ATCA_STATUS>,
1935    pub halsend: ::std::option::Option<
1936        unsafe extern "C" fn(
1937            iface: ATCAIface,
1938            txdata: *mut u8,
1939            txlength: ::std::os::raw::c_int,
1940        ) -> ATCA_STATUS,
1941    >,
1942    pub halreceive: ::std::option::Option<
1943        unsafe extern "C" fn(iface: ATCAIface, rxdata: *mut u8, rxlength: *mut u16) -> ATCA_STATUS,
1944    >,
1945    pub halwake: ::std::option::Option<unsafe extern "C" fn(iface: ATCAIface) -> ATCA_STATUS>,
1946    pub halidle: ::std::option::Option<unsafe extern "C" fn(iface: ATCAIface) -> ATCA_STATUS>,
1947    pub halsleep: ::std::option::Option<unsafe extern "C" fn(iface: ATCAIface) -> ATCA_STATUS>,
1948    pub halrelease: ::std::option::Option<
1949        unsafe extern "C" fn(hal_data: *mut ::std::os::raw::c_void) -> ATCA_STATUS,
1950    >,
1951    pub hal_data: *mut ::std::os::raw::c_void,
1952}
1953#[allow(deref_nullptr)]
1954#[test]
1955fn bindgen_test_layout_ATCAHAL_t() {
1956    assert_eq!(
1957        ::std::mem::size_of::<ATCAHAL_t>(),
1958        72usize,
1959        concat!("Size of: ", stringify!(ATCAHAL_t))
1960    );
1961    assert_eq!(
1962        ::std::mem::align_of::<ATCAHAL_t>(),
1963        8usize,
1964        concat!("Alignment of ", stringify!(ATCAHAL_t))
1965    );
1966    assert_eq!(
1967        unsafe { &(*(::std::ptr::null::<ATCAHAL_t>())).halinit as *const _ as usize },
1968        0usize,
1969        concat!(
1970            "Offset of field: ",
1971            stringify!(ATCAHAL_t),
1972            "::",
1973            stringify!(halinit)
1974        )
1975    );
1976    assert_eq!(
1977        unsafe { &(*(::std::ptr::null::<ATCAHAL_t>())).halpostinit as *const _ as usize },
1978        8usize,
1979        concat!(
1980            "Offset of field: ",
1981            stringify!(ATCAHAL_t),
1982            "::",
1983            stringify!(halpostinit)
1984        )
1985    );
1986    assert_eq!(
1987        unsafe { &(*(::std::ptr::null::<ATCAHAL_t>())).halsend as *const _ as usize },
1988        16usize,
1989        concat!(
1990            "Offset of field: ",
1991            stringify!(ATCAHAL_t),
1992            "::",
1993            stringify!(halsend)
1994        )
1995    );
1996    assert_eq!(
1997        unsafe { &(*(::std::ptr::null::<ATCAHAL_t>())).halreceive as *const _ as usize },
1998        24usize,
1999        concat!(
2000            "Offset of field: ",
2001            stringify!(ATCAHAL_t),
2002            "::",
2003            stringify!(halreceive)
2004        )
2005    );
2006    assert_eq!(
2007        unsafe { &(*(::std::ptr::null::<ATCAHAL_t>())).halwake as *const _ as usize },
2008        32usize,
2009        concat!(
2010            "Offset of field: ",
2011            stringify!(ATCAHAL_t),
2012            "::",
2013            stringify!(halwake)
2014        )
2015    );
2016    assert_eq!(
2017        unsafe { &(*(::std::ptr::null::<ATCAHAL_t>())).halidle as *const _ as usize },
2018        40usize,
2019        concat!(
2020            "Offset of field: ",
2021            stringify!(ATCAHAL_t),
2022            "::",
2023            stringify!(halidle)
2024        )
2025    );
2026    assert_eq!(
2027        unsafe { &(*(::std::ptr::null::<ATCAHAL_t>())).halsleep as *const _ as usize },
2028        48usize,
2029        concat!(
2030            "Offset of field: ",
2031            stringify!(ATCAHAL_t),
2032            "::",
2033            stringify!(halsleep)
2034        )
2035    );
2036    assert_eq!(
2037        unsafe { &(*(::std::ptr::null::<ATCAHAL_t>())).halrelease as *const _ as usize },
2038        56usize,
2039        concat!(
2040            "Offset of field: ",
2041            stringify!(ATCAHAL_t),
2042            "::",
2043            stringify!(halrelease)
2044        )
2045    );
2046    assert_eq!(
2047        unsafe { &(*(::std::ptr::null::<ATCAHAL_t>())).hal_data as *const _ as usize },
2048        64usize,
2049        concat!(
2050            "Offset of field: ",
2051            stringify!(ATCAHAL_t),
2052            "::",
2053            stringify!(hal_data)
2054        )
2055    );
2056}
2057extern "C" {
2058    pub fn hal_iface_init(arg1: *mut ATCAIfaceCfg, hal: *mut ATCAHAL_t) -> ATCA_STATUS;
2059}
2060extern "C" {
2061    pub fn hal_iface_release(
2062        arg1: ATCAIfaceType,
2063        hal_data: *mut ::std::os::raw::c_void,
2064    ) -> ATCA_STATUS;
2065}
2066extern "C" {
2067    pub fn hal_check_wake(response: *const u8, response_size: ::std::os::raw::c_int)
2068        -> ATCA_STATUS;
2069}
2070extern "C" {
2071    pub fn hal_i2c_init(hal: *mut ::std::os::raw::c_void, cfg: *mut ATCAIfaceCfg) -> ATCA_STATUS;
2072}
2073extern "C" {
2074    pub fn hal_i2c_post_init(iface: ATCAIface) -> ATCA_STATUS;
2075}
2076extern "C" {
2077    pub fn hal_i2c_send(
2078        iface: ATCAIface,
2079        txdata: *mut u8,
2080        txlength: ::std::os::raw::c_int,
2081    ) -> ATCA_STATUS;
2082}
2083extern "C" {
2084    pub fn hal_i2c_receive(iface: ATCAIface, rxdata: *mut u8, rxlength: *mut u16) -> ATCA_STATUS;
2085}
2086extern "C" {
2087    pub fn hal_i2c_wake(iface: ATCAIface) -> ATCA_STATUS;
2088}
2089extern "C" {
2090    pub fn hal_i2c_idle(iface: ATCAIface) -> ATCA_STATUS;
2091}
2092extern "C" {
2093    pub fn hal_i2c_sleep(iface: ATCAIface) -> ATCA_STATUS;
2094}
2095extern "C" {
2096    pub fn hal_i2c_release(hal_data: *mut ::std::os::raw::c_void) -> ATCA_STATUS;
2097}
2098extern "C" {
2099    pub fn hal_i2c_discover_buses(
2100        i2c_buses: *mut ::std::os::raw::c_int,
2101        max_buses: ::std::os::raw::c_int,
2102    ) -> ATCA_STATUS;
2103}
2104extern "C" {
2105    pub fn hal_i2c_discover_devices(
2106        bus_num: ::std::os::raw::c_int,
2107        cfg: *mut ATCAIfaceCfg,
2108        found: *mut ::std::os::raw::c_int,
2109    ) -> ATCA_STATUS;
2110}
2111extern "C" {
2112    pub fn atca_delay_ms(ms: u32);
2113}
2114extern "C" {
2115    pub fn atca_delay_us(us: u32);
2116}
2117extern "C" {
2118    #[doc = " \\brief Timer API implemented at the HAL level"]
2119    pub fn hal_rtos_delay_ms(ms: u32);
2120}
2121extern "C" {
2122    pub fn hal_delay_ms(ms: u32);
2123}
2124extern "C" {
2125    pub fn hal_delay_us(us: u32);
2126}
2127extern "C" {
2128    #[doc = " \\brief Optional hal interfaces"]
2129    pub fn hal_create_mutex(
2130        ppMutex: *mut *mut ::std::os::raw::c_void,
2131        pName: *mut ::std::os::raw::c_char,
2132    ) -> ATCA_STATUS;
2133}
2134extern "C" {
2135    pub fn hal_destroy_mutex(pMutex: *mut ::std::os::raw::c_void) -> ATCA_STATUS;
2136}
2137extern "C" {
2138    pub fn hal_lock_mutex(pMutex: *mut ::std::os::raw::c_void) -> ATCA_STATUS;
2139}
2140extern "C" {
2141    pub fn hal_unlock_mutex(pMutex: *mut ::std::os::raw::c_void) -> ATCA_STATUS;
2142}
2143#[doc = " \\brief atca_device is the C object backing ATCADevice.  See the"]
2144#[doc = "         atca_device.h file for details on the ATCADevice methods."]
2145#[repr(C)]
2146#[derive(Debug, Copy, Clone)]
2147pub struct atca_device {
2148    #[doc = "!< Command set for a given CryptoAuth device"]
2149    pub mCommands: ATCACommand,
2150    #[doc = "!< Physical interface"]
2151    pub mIface: ATCAIface,
2152}
2153#[allow(deref_nullptr)]
2154#[test]
2155fn bindgen_test_layout_atca_device() {
2156    assert_eq!(
2157        ::std::mem::size_of::<atca_device>(),
2158        16usize,
2159        concat!("Size of: ", stringify!(atca_device))
2160    );
2161    assert_eq!(
2162        ::std::mem::align_of::<atca_device>(),
2163        8usize,
2164        concat!("Alignment of ", stringify!(atca_device))
2165    );
2166    assert_eq!(
2167        unsafe { &(*(::std::ptr::null::<atca_device>())).mCommands as *const _ as usize },
2168        0usize,
2169        concat!(
2170            "Offset of field: ",
2171            stringify!(atca_device),
2172            "::",
2173            stringify!(mCommands)
2174        )
2175    );
2176    assert_eq!(
2177        unsafe { &(*(::std::ptr::null::<atca_device>())).mIface as *const _ as usize },
2178        8usize,
2179        concat!(
2180            "Offset of field: ",
2181            stringify!(atca_device),
2182            "::",
2183            stringify!(mIface)
2184        )
2185    );
2186}
2187pub type ATCADevice = *mut atca_device;
2188extern "C" {
2189    pub fn initATCADevice(cfg: *mut ATCAIfaceCfg, cadev: ATCADevice) -> ATCA_STATUS;
2190}
2191extern "C" {
2192    pub fn newATCADevice(cfg: *mut ATCAIfaceCfg) -> ATCADevice;
2193}
2194extern "C" {
2195    pub fn releaseATCADevice(ca_dev: ATCADevice) -> ATCA_STATUS;
2196}
2197extern "C" {
2198    pub fn deleteATCADevice(ca_dev: *mut ATCADevice);
2199}
2200extern "C" {
2201    pub fn atGetCommands(dev: ATCADevice) -> ATCACommand;
2202}
2203extern "C" {
2204    pub fn atGetIFace(dev: ATCADevice) -> ATCAIface;
2205}
2206extern "C" {
2207    pub static mut cfg_ateccx08a_i2c_default: ATCAIfaceCfg;
2208}
2209extern "C" {
2210    pub static mut cfg_ateccx08a_swi_default: ATCAIfaceCfg;
2211}
2212extern "C" {
2213    pub static mut cfg_ateccx08a_kitcdc_default: ATCAIfaceCfg;
2214}
2215extern "C" {
2216    pub static mut cfg_ateccx08a_kithid_default: ATCAIfaceCfg;
2217}
2218extern "C" {
2219    pub static mut cfg_atsha20xa_i2c_default: ATCAIfaceCfg;
2220}
2221extern "C" {
2222    pub static mut cfg_atsha20xa_swi_default: ATCAIfaceCfg;
2223}
2224extern "C" {
2225    pub static mut cfg_atsha20xa_kitcdc_default: ATCAIfaceCfg;
2226}
2227extern "C" {
2228    pub static mut cfg_atsha20xa_kithid_default: ATCAIfaceCfg;
2229}
2230#[repr(C)]
2231#[derive(Copy, Clone)]
2232pub struct atcac_sha2_256_ctx {
2233    #[doc = "!< Filler value to make sure the actual implementation has enough room to store its context. uint32_t is used to remove some alignment warnings."]
2234    pub pad: [u32; 48usize],
2235}
2236#[allow(deref_nullptr)]
2237#[test]
2238fn bindgen_test_layout_atcac_sha2_256_ctx() {
2239    assert_eq!(
2240        ::std::mem::size_of::<atcac_sha2_256_ctx>(),
2241        192usize,
2242        concat!("Size of: ", stringify!(atcac_sha2_256_ctx))
2243    );
2244    assert_eq!(
2245        ::std::mem::align_of::<atcac_sha2_256_ctx>(),
2246        4usize,
2247        concat!("Alignment of ", stringify!(atcac_sha2_256_ctx))
2248    );
2249    assert_eq!(
2250        unsafe { &(*(::std::ptr::null::<atcac_sha2_256_ctx>())).pad as *const _ as usize },
2251        0usize,
2252        concat!(
2253            "Offset of field: ",
2254            stringify!(atcac_sha2_256_ctx),
2255            "::",
2256            stringify!(pad)
2257        )
2258    );
2259}
2260extern "C" {
2261    pub fn atcac_sw_sha2_256_init(ctx: *mut atcac_sha2_256_ctx) -> ::std::os::raw::c_int;
2262}
2263extern "C" {
2264    pub fn atcac_sw_sha2_256_update(
2265        ctx: *mut atcac_sha2_256_ctx,
2266        data: *const u8,
2267        data_size: size_t,
2268    ) -> ::std::os::raw::c_int;
2269}
2270extern "C" {
2271    pub fn atcac_sw_sha2_256_finish(
2272        ctx: *mut atcac_sha2_256_ctx,
2273        digest: *mut u8,
2274    ) -> ::std::os::raw::c_int;
2275}
2276extern "C" {
2277    pub fn atcac_sw_sha2_256(
2278        data: *const u8,
2279        data_size: size_t,
2280        digest: *mut u8,
2281    ) -> ::std::os::raw::c_int;
2282}
2283extern "C" {
2284    pub static mut _gDevice: ATCADevice;
2285}
2286extern "C" {
2287    pub fn atcab_version(ver_str: *mut ::std::os::raw::c_char) -> ATCA_STATUS;
2288}
2289extern "C" {
2290    pub fn atcab_init(cfg: *mut ATCAIfaceCfg) -> ATCA_STATUS;
2291}
2292extern "C" {
2293    pub fn atcab_init_device(ca_device: ATCADevice) -> ATCA_STATUS;
2294}
2295extern "C" {
2296    pub fn atcab_release() -> ATCA_STATUS;
2297}
2298extern "C" {
2299    pub fn atcab_get_device() -> ATCADevice;
2300}
2301extern "C" {
2302    pub fn atcab_get_device_type() -> ATCADeviceType;
2303}
2304extern "C" {
2305    pub fn _atcab_exit() -> ATCA_STATUS;
2306}
2307extern "C" {
2308    pub fn atcab_wakeup() -> ATCA_STATUS;
2309}
2310extern "C" {
2311    pub fn atcab_idle() -> ATCA_STATUS;
2312}
2313extern "C" {
2314    pub fn atcab_sleep() -> ATCA_STATUS;
2315}
2316extern "C" {
2317    pub fn atcab_cfg_discover(
2318        cfg_array: *mut ATCAIfaceCfg,
2319        max: ::std::os::raw::c_int,
2320    ) -> ATCA_STATUS;
2321}
2322extern "C" {
2323    pub fn atcab_get_addr(
2324        zone: u8,
2325        slot: u16,
2326        block: u8,
2327        offset: u8,
2328        addr: *mut u16,
2329    ) -> ATCA_STATUS;
2330}
2331extern "C" {
2332    pub fn atcab_get_zone_size(zone: u8, slot: u16, size: *mut size_t) -> ATCA_STATUS;
2333}
2334extern "C" {
2335    pub static mut atca_basic_aes_gcm_version: *const ::std::os::raw::c_char;
2336}
2337#[doc = " Context structure for AES GCM operations."]
2338#[repr(C)]
2339#[derive(Debug, Copy, Clone)]
2340pub struct atca_aes_gcm_ctx {
2341    #[doc = "!< Key location. Can either be a slot number or ATCA_TEMPKEY_KEYID for TempKey."]
2342    pub key_id: u16,
2343    #[doc = "!< Index of the 16-byte block to use within the key location for the actual key."]
2344    pub key_block: u8,
2345    #[doc = "!< Counter block, comprises of nonce + count value (16 bytes)."]
2346    pub cb: [u8; 16usize],
2347    #[doc = "!< Size of the data being encrypted/decrypted in bytes."]
2348    pub data_size: u32,
2349    #[doc = "!< Size of the additional authenticated data in bytes."]
2350    pub aad_size: u32,
2351    #[doc = "!< Subkey for ghash functions in GCM."]
2352    pub h: [u8; 16usize],
2353    #[doc = "!< Precounter block generated from IV."]
2354    pub j0: [u8; 16usize],
2355    #[doc = "!< Current GHASH output"]
2356    pub y: [u8; 16usize],
2357    #[doc = "!< Partial blocks of data waiting to be processed"]
2358    pub partial_aad: [u8; 16usize],
2359    #[doc = "!< Amount of data in the partial block buffer"]
2360    pub partial_aad_size: u32,
2361    #[doc = "!< Last encrypted counter block"]
2362    pub enc_cb: [u8; 16usize],
2363    #[doc = "!< Last ciphertext block"]
2364    pub ciphertext_block: [u8; 16usize],
2365}
2366#[allow(deref_nullptr)]
2367#[test]
2368fn bindgen_test_layout_atca_aes_gcm_ctx() {
2369    assert_eq!(
2370        ::std::mem::size_of::<atca_aes_gcm_ctx>(),
2371        128usize,
2372        concat!("Size of: ", stringify!(atca_aes_gcm_ctx))
2373    );
2374    assert_eq!(
2375        ::std::mem::align_of::<atca_aes_gcm_ctx>(),
2376        4usize,
2377        concat!("Alignment of ", stringify!(atca_aes_gcm_ctx))
2378    );
2379    assert_eq!(
2380        unsafe { &(*(::std::ptr::null::<atca_aes_gcm_ctx>())).key_id as *const _ as usize },
2381        0usize,
2382        concat!(
2383            "Offset of field: ",
2384            stringify!(atca_aes_gcm_ctx),
2385            "::",
2386            stringify!(key_id)
2387        )
2388    );
2389    assert_eq!(
2390        unsafe { &(*(::std::ptr::null::<atca_aes_gcm_ctx>())).key_block as *const _ as usize },
2391        2usize,
2392        concat!(
2393            "Offset of field: ",
2394            stringify!(atca_aes_gcm_ctx),
2395            "::",
2396            stringify!(key_block)
2397        )
2398    );
2399    assert_eq!(
2400        unsafe { &(*(::std::ptr::null::<atca_aes_gcm_ctx>())).cb as *const _ as usize },
2401        3usize,
2402        concat!(
2403            "Offset of field: ",
2404            stringify!(atca_aes_gcm_ctx),
2405            "::",
2406            stringify!(cb)
2407        )
2408    );
2409    assert_eq!(
2410        unsafe { &(*(::std::ptr::null::<atca_aes_gcm_ctx>())).data_size as *const _ as usize },
2411        20usize,
2412        concat!(
2413            "Offset of field: ",
2414            stringify!(atca_aes_gcm_ctx),
2415            "::",
2416            stringify!(data_size)
2417        )
2418    );
2419    assert_eq!(
2420        unsafe { &(*(::std::ptr::null::<atca_aes_gcm_ctx>())).aad_size as *const _ as usize },
2421        24usize,
2422        concat!(
2423            "Offset of field: ",
2424            stringify!(atca_aes_gcm_ctx),
2425            "::",
2426            stringify!(aad_size)
2427        )
2428    );
2429    assert_eq!(
2430        unsafe { &(*(::std::ptr::null::<atca_aes_gcm_ctx>())).h as *const _ as usize },
2431        28usize,
2432        concat!(
2433            "Offset of field: ",
2434            stringify!(atca_aes_gcm_ctx),
2435            "::",
2436            stringify!(h)
2437        )
2438    );
2439    assert_eq!(
2440        unsafe { &(*(::std::ptr::null::<atca_aes_gcm_ctx>())).j0 as *const _ as usize },
2441        44usize,
2442        concat!(
2443            "Offset of field: ",
2444            stringify!(atca_aes_gcm_ctx),
2445            "::",
2446            stringify!(j0)
2447        )
2448    );
2449    assert_eq!(
2450        unsafe { &(*(::std::ptr::null::<atca_aes_gcm_ctx>())).y as *const _ as usize },
2451        60usize,
2452        concat!(
2453            "Offset of field: ",
2454            stringify!(atca_aes_gcm_ctx),
2455            "::",
2456            stringify!(y)
2457        )
2458    );
2459    assert_eq!(
2460        unsafe { &(*(::std::ptr::null::<atca_aes_gcm_ctx>())).partial_aad as *const _ as usize },
2461        76usize,
2462        concat!(
2463            "Offset of field: ",
2464            stringify!(atca_aes_gcm_ctx),
2465            "::",
2466            stringify!(partial_aad)
2467        )
2468    );
2469    assert_eq!(
2470        unsafe {
2471            &(*(::std::ptr::null::<atca_aes_gcm_ctx>())).partial_aad_size as *const _ as usize
2472        },
2473        92usize,
2474        concat!(
2475            "Offset of field: ",
2476            stringify!(atca_aes_gcm_ctx),
2477            "::",
2478            stringify!(partial_aad_size)
2479        )
2480    );
2481    assert_eq!(
2482        unsafe { &(*(::std::ptr::null::<atca_aes_gcm_ctx>())).enc_cb as *const _ as usize },
2483        96usize,
2484        concat!(
2485            "Offset of field: ",
2486            stringify!(atca_aes_gcm_ctx),
2487            "::",
2488            stringify!(enc_cb)
2489        )
2490    );
2491    assert_eq!(
2492        unsafe {
2493            &(*(::std::ptr::null::<atca_aes_gcm_ctx>())).ciphertext_block as *const _ as usize
2494        },
2495        112usize,
2496        concat!(
2497            "Offset of field: ",
2498            stringify!(atca_aes_gcm_ctx),
2499            "::",
2500            stringify!(ciphertext_block)
2501        )
2502    );
2503}
2504pub type atca_aes_gcm_ctx_t = atca_aes_gcm_ctx;
2505extern "C" {
2506    pub fn atcab_aes_gcm_init(
2507        ctx: *mut atca_aes_gcm_ctx_t,
2508        key_id: u16,
2509        key_block: u8,
2510        iv: *const u8,
2511        iv_size: size_t,
2512    ) -> ATCA_STATUS;
2513}
2514extern "C" {
2515    pub fn atcab_aes_gcm_init_rand(
2516        ctx: *mut atca_aes_gcm_ctx_t,
2517        key_id: u16,
2518        key_block: u8,
2519        rand_size: size_t,
2520        free_field: *const u8,
2521        free_field_size: size_t,
2522        iv: *mut u8,
2523    ) -> ATCA_STATUS;
2524}
2525extern "C" {
2526    pub fn atcab_aes_gcm_aad_update(
2527        ctx: *mut atca_aes_gcm_ctx_t,
2528        aad: *const u8,
2529        aad_size: u32,
2530    ) -> ATCA_STATUS;
2531}
2532extern "C" {
2533    pub fn atcab_aes_gcm_encrypt_update(
2534        ctx: *mut atca_aes_gcm_ctx_t,
2535        plaintext: *const u8,
2536        plaintext_size: u32,
2537        ciphertext: *mut u8,
2538    ) -> ATCA_STATUS;
2539}
2540extern "C" {
2541    pub fn atcab_aes_gcm_encrypt_finish(
2542        ctx: *mut atca_aes_gcm_ctx_t,
2543        tag: *mut u8,
2544        tag_size: size_t,
2545    ) -> ATCA_STATUS;
2546}
2547extern "C" {
2548    pub fn atcab_aes_gcm_decrypt_update(
2549        ctx: *mut atca_aes_gcm_ctx_t,
2550        ciphertext: *const u8,
2551        ciphertext_size: u32,
2552        plaintext: *mut u8,
2553    ) -> ATCA_STATUS;
2554}
2555extern "C" {
2556    pub fn atcab_aes_gcm_decrypt_finish(
2557        ctx: *mut atca_aes_gcm_ctx_t,
2558        tag: *const u8,
2559        tag_size: size_t,
2560        is_verified: *mut bool,
2561    ) -> ATCA_STATUS;
2562}
2563extern "C" {
2564    pub fn atcab_aes(mode: u8, key_id: u16, aes_in: *const u8, aes_out: *mut u8) -> ATCA_STATUS;
2565}
2566extern "C" {
2567    pub fn atcab_aes_encrypt(
2568        key_id: u16,
2569        key_block: u8,
2570        plaintext: *const u8,
2571        ciphertext: *mut u8,
2572    ) -> ATCA_STATUS;
2573}
2574extern "C" {
2575    pub fn atcab_aes_decrypt(
2576        key_id: u16,
2577        key_block: u8,
2578        ciphertext: *const u8,
2579        plaintext: *mut u8,
2580    ) -> ATCA_STATUS;
2581}
2582extern "C" {
2583    pub fn atcab_aes_gfm(h: *const u8, input: *const u8, output: *mut u8) -> ATCA_STATUS;
2584}
2585#[repr(C)]
2586#[derive(Debug, Copy, Clone)]
2587pub struct atca_aes_cbc_ctx {
2588    #[doc = "!< Key location. Can either be a slot number or ATCA_TEMPKEY_KEYID for TempKey."]
2589    pub key_id: u16,
2590    #[doc = "!< Index of the 16-byte block to use within the key location for the actual key."]
2591    pub key_block: u8,
2592    #[doc = "!< Ciphertext from last operation."]
2593    pub ciphertext: [u8; 16usize],
2594}
2595#[allow(deref_nullptr)]
2596#[test]
2597fn bindgen_test_layout_atca_aes_cbc_ctx() {
2598    assert_eq!(
2599        ::std::mem::size_of::<atca_aes_cbc_ctx>(),
2600        20usize,
2601        concat!("Size of: ", stringify!(atca_aes_cbc_ctx))
2602    );
2603    assert_eq!(
2604        ::std::mem::align_of::<atca_aes_cbc_ctx>(),
2605        2usize,
2606        concat!("Alignment of ", stringify!(atca_aes_cbc_ctx))
2607    );
2608    assert_eq!(
2609        unsafe { &(*(::std::ptr::null::<atca_aes_cbc_ctx>())).key_id as *const _ as usize },
2610        0usize,
2611        concat!(
2612            "Offset of field: ",
2613            stringify!(atca_aes_cbc_ctx),
2614            "::",
2615            stringify!(key_id)
2616        )
2617    );
2618    assert_eq!(
2619        unsafe { &(*(::std::ptr::null::<atca_aes_cbc_ctx>())).key_block as *const _ as usize },
2620        2usize,
2621        concat!(
2622            "Offset of field: ",
2623            stringify!(atca_aes_cbc_ctx),
2624            "::",
2625            stringify!(key_block)
2626        )
2627    );
2628    assert_eq!(
2629        unsafe { &(*(::std::ptr::null::<atca_aes_cbc_ctx>())).ciphertext as *const _ as usize },
2630        3usize,
2631        concat!(
2632            "Offset of field: ",
2633            stringify!(atca_aes_cbc_ctx),
2634            "::",
2635            stringify!(ciphertext)
2636        )
2637    );
2638}
2639pub type atca_aes_cbc_ctx_t = atca_aes_cbc_ctx;
2640extern "C" {
2641    pub fn atcab_aes_cbc_init(
2642        ctx: *mut atca_aes_cbc_ctx_t,
2643        key_id: u16,
2644        key_block: u8,
2645        iv: *const u8,
2646    ) -> ATCA_STATUS;
2647}
2648extern "C" {
2649    pub fn atcab_aes_cbc_encrypt_block(
2650        ctx: *mut atca_aes_cbc_ctx_t,
2651        plaintext: *const u8,
2652        ciphertext: *mut u8,
2653    ) -> ATCA_STATUS;
2654}
2655extern "C" {
2656    pub fn atcab_aes_cbc_decrypt_block(
2657        ctx: *mut atca_aes_cbc_ctx_t,
2658        ciphertext: *const u8,
2659        plaintext: *mut u8,
2660    ) -> ATCA_STATUS;
2661}
2662#[repr(C)]
2663#[derive(Debug, Copy, Clone)]
2664pub struct atca_aes_cmac_ctx {
2665    #[doc = "!< CBC context"]
2666    pub cbc_ctx: atca_aes_cbc_ctx_t,
2667    #[doc = "!< Number of bytes in current block."]
2668    pub block_size: u32,
2669    #[doc = "!< Unprocessed message storage."]
2670    pub block: [u8; 16usize],
2671}
2672#[allow(deref_nullptr)]
2673#[test]
2674fn bindgen_test_layout_atca_aes_cmac_ctx() {
2675    assert_eq!(
2676        ::std::mem::size_of::<atca_aes_cmac_ctx>(),
2677        40usize,
2678        concat!("Size of: ", stringify!(atca_aes_cmac_ctx))
2679    );
2680    assert_eq!(
2681        ::std::mem::align_of::<atca_aes_cmac_ctx>(),
2682        4usize,
2683        concat!("Alignment of ", stringify!(atca_aes_cmac_ctx))
2684    );
2685    assert_eq!(
2686        unsafe { &(*(::std::ptr::null::<atca_aes_cmac_ctx>())).cbc_ctx as *const _ as usize },
2687        0usize,
2688        concat!(
2689            "Offset of field: ",
2690            stringify!(atca_aes_cmac_ctx),
2691            "::",
2692            stringify!(cbc_ctx)
2693        )
2694    );
2695    assert_eq!(
2696        unsafe { &(*(::std::ptr::null::<atca_aes_cmac_ctx>())).block_size as *const _ as usize },
2697        20usize,
2698        concat!(
2699            "Offset of field: ",
2700            stringify!(atca_aes_cmac_ctx),
2701            "::",
2702            stringify!(block_size)
2703        )
2704    );
2705    assert_eq!(
2706        unsafe { &(*(::std::ptr::null::<atca_aes_cmac_ctx>())).block as *const _ as usize },
2707        24usize,
2708        concat!(
2709            "Offset of field: ",
2710            stringify!(atca_aes_cmac_ctx),
2711            "::",
2712            stringify!(block)
2713        )
2714    );
2715}
2716pub type atca_aes_cmac_ctx_t = atca_aes_cmac_ctx;
2717extern "C" {
2718    pub fn atcab_aes_cmac_init(
2719        ctx: *mut atca_aes_cmac_ctx_t,
2720        key_id: u16,
2721        key_block: u8,
2722    ) -> ATCA_STATUS;
2723}
2724extern "C" {
2725    pub fn atcab_aes_cmac_update(
2726        ctx: *mut atca_aes_cmac_ctx_t,
2727        data: *const u8,
2728        data_size: u32,
2729    ) -> ATCA_STATUS;
2730}
2731extern "C" {
2732    pub fn atcab_aes_cmac_finish(
2733        ctx: *mut atca_aes_cmac_ctx_t,
2734        cmac: *mut u8,
2735        cmac_size: u32,
2736    ) -> ATCA_STATUS;
2737}
2738#[repr(C)]
2739#[derive(Debug, Copy, Clone)]
2740pub struct atca_aes_ctr_ctx {
2741    #[doc = "!< Key location. Can either be a slot number or ATCA_TEMPKEY_KEYID for TempKey."]
2742    pub key_id: u16,
2743    #[doc = "!< Index of the 16-byte block to use within the key location for the actual key."]
2744    pub key_block: u8,
2745    #[doc = "!< Counter block, comprises of nonce + count value (16 bytes)."]
2746    pub cb: [u8; 16usize],
2747    #[doc = "!< Size of counter in the initialization vector."]
2748    pub counter_size: u8,
2749}
2750#[allow(deref_nullptr)]
2751#[test]
2752fn bindgen_test_layout_atca_aes_ctr_ctx() {
2753    assert_eq!(
2754        ::std::mem::size_of::<atca_aes_ctr_ctx>(),
2755        20usize,
2756        concat!("Size of: ", stringify!(atca_aes_ctr_ctx))
2757    );
2758    assert_eq!(
2759        ::std::mem::align_of::<atca_aes_ctr_ctx>(),
2760        2usize,
2761        concat!("Alignment of ", stringify!(atca_aes_ctr_ctx))
2762    );
2763    assert_eq!(
2764        unsafe { &(*(::std::ptr::null::<atca_aes_ctr_ctx>())).key_id as *const _ as usize },
2765        0usize,
2766        concat!(
2767            "Offset of field: ",
2768            stringify!(atca_aes_ctr_ctx),
2769            "::",
2770            stringify!(key_id)
2771        )
2772    );
2773    assert_eq!(
2774        unsafe { &(*(::std::ptr::null::<atca_aes_ctr_ctx>())).key_block as *const _ as usize },
2775        2usize,
2776        concat!(
2777            "Offset of field: ",
2778            stringify!(atca_aes_ctr_ctx),
2779            "::",
2780            stringify!(key_block)
2781        )
2782    );
2783    assert_eq!(
2784        unsafe { &(*(::std::ptr::null::<atca_aes_ctr_ctx>())).cb as *const _ as usize },
2785        3usize,
2786        concat!(
2787            "Offset of field: ",
2788            stringify!(atca_aes_ctr_ctx),
2789            "::",
2790            stringify!(cb)
2791        )
2792    );
2793    assert_eq!(
2794        unsafe { &(*(::std::ptr::null::<atca_aes_ctr_ctx>())).counter_size as *const _ as usize },
2795        19usize,
2796        concat!(
2797            "Offset of field: ",
2798            stringify!(atca_aes_ctr_ctx),
2799            "::",
2800            stringify!(counter_size)
2801        )
2802    );
2803}
2804pub type atca_aes_ctr_ctx_t = atca_aes_ctr_ctx;
2805extern "C" {
2806    pub fn atcab_aes_ctr_init(
2807        ctx: *mut atca_aes_ctr_ctx_t,
2808        key_id: u16,
2809        key_block: u8,
2810        counter_size: u8,
2811        iv: *const u8,
2812    ) -> ATCA_STATUS;
2813}
2814extern "C" {
2815    pub fn atcab_aes_ctr_init_rand(
2816        ctx: *mut atca_aes_ctr_ctx_t,
2817        key_id: u16,
2818        key_block: u8,
2819        counter_size: u8,
2820        iv: *mut u8,
2821    ) -> ATCA_STATUS;
2822}
2823extern "C" {
2824    pub fn atcab_aes_ctr_block(
2825        ctx: *mut atca_aes_ctr_ctx_t,
2826        input: *const u8,
2827        output: *mut u8,
2828    ) -> ATCA_STATUS;
2829}
2830extern "C" {
2831    pub fn atcab_aes_ctr_encrypt_block(
2832        ctx: *mut atca_aes_ctr_ctx_t,
2833        plaintext: *const u8,
2834        ciphertext: *mut u8,
2835    ) -> ATCA_STATUS;
2836}
2837extern "C" {
2838    pub fn atcab_aes_ctr_decrypt_block(
2839        ctx: *mut atca_aes_ctr_ctx_t,
2840        ciphertext: *const u8,
2841        plaintext: *mut u8,
2842    ) -> ATCA_STATUS;
2843}
2844extern "C" {
2845    pub fn atcab_aes_ctr_increment(ctx: *mut atca_aes_ctr_ctx_t) -> ATCA_STATUS;
2846}
2847extern "C" {
2848    pub fn atcab_checkmac(
2849        mode: u8,
2850        key_id: u16,
2851        challenge: *const u8,
2852        response: *const u8,
2853        other_data: *const u8,
2854    ) -> ATCA_STATUS;
2855}
2856extern "C" {
2857    pub fn atcab_counter(mode: u8, counter_id: u16, counter_value: *mut u32) -> ATCA_STATUS;
2858}
2859extern "C" {
2860    pub fn atcab_counter_increment(counter_id: u16, counter_value: *mut u32) -> ATCA_STATUS;
2861}
2862extern "C" {
2863    pub fn atcab_counter_read(counter_id: u16, counter_value: *mut u32) -> ATCA_STATUS;
2864}
2865extern "C" {
2866    pub fn atcab_derivekey(mode: u8, key_id: u16, mac: *const u8) -> ATCA_STATUS;
2867}
2868extern "C" {
2869    pub fn atcab_ecdh_base(
2870        mode: u8,
2871        key_id: u16,
2872        public_key: *const u8,
2873        pms: *mut u8,
2874        out_nonce: *mut u8,
2875    ) -> ATCA_STATUS;
2876}
2877extern "C" {
2878    pub fn atcab_ecdh(key_id: u16, public_key: *const u8, pms: *mut u8) -> ATCA_STATUS;
2879}
2880extern "C" {
2881    pub fn atcab_ecdh_enc(
2882        key_id: u16,
2883        public_key: *const u8,
2884        pms: *mut u8,
2885        read_key: *const u8,
2886        read_key_id: u16,
2887        num_in: *const u8,
2888    ) -> ATCA_STATUS;
2889}
2890extern "C" {
2891    pub fn atcab_ecdh_ioenc(
2892        key_id: u16,
2893        public_key: *const u8,
2894        pms: *mut u8,
2895        io_key: *const u8,
2896    ) -> ATCA_STATUS;
2897}
2898extern "C" {
2899    pub fn atcab_ecdh_tempkey(public_key: *const u8, pms: *mut u8) -> ATCA_STATUS;
2900}
2901extern "C" {
2902    pub fn atcab_ecdh_tempkey_ioenc(
2903        public_key: *const u8,
2904        pms: *mut u8,
2905        io_key: *const u8,
2906    ) -> ATCA_STATUS;
2907}
2908extern "C" {
2909    pub fn atcab_gendig(
2910        zone: u8,
2911        key_id: u16,
2912        other_data: *const u8,
2913        other_data_size: u8,
2914    ) -> ATCA_STATUS;
2915}
2916extern "C" {
2917    pub fn atcab_genkey_base(
2918        mode: u8,
2919        key_id: u16,
2920        other_data: *const u8,
2921        public_key: *mut u8,
2922    ) -> ATCA_STATUS;
2923}
2924extern "C" {
2925    pub fn atcab_genkey(key_id: u16, public_key: *mut u8) -> ATCA_STATUS;
2926}
2927extern "C" {
2928    pub fn atcab_get_pubkey(key_id: u16, public_key: *mut u8) -> ATCA_STATUS;
2929}
2930extern "C" {
2931    pub fn atcab_hmac(mode: u8, key_id: u16, digest: *mut u8) -> ATCA_STATUS;
2932}
2933extern "C" {
2934    pub fn atcab_info_base(mode: u8, param2: u16, out_data: *mut u8) -> ATCA_STATUS;
2935}
2936extern "C" {
2937    pub fn atcab_info(revision: *mut u8) -> ATCA_STATUS;
2938}
2939extern "C" {
2940    pub fn atcab_info_set_latch(state: bool) -> ATCA_STATUS;
2941}
2942extern "C" {
2943    pub fn atcab_info_get_latch(state: *mut bool) -> ATCA_STATUS;
2944}
2945extern "C" {
2946    pub fn atcab_kdf(
2947        mode: u8,
2948        key_id: u16,
2949        details: u32,
2950        message: *const u8,
2951        out_data: *mut u8,
2952        out_nonce: *mut u8,
2953    ) -> ATCA_STATUS;
2954}
2955extern "C" {
2956    pub fn atcab_lock(mode: u8, summary_crc: u16) -> ATCA_STATUS;
2957}
2958extern "C" {
2959    pub fn atcab_lock_config_zone() -> ATCA_STATUS;
2960}
2961extern "C" {
2962    pub fn atcab_lock_config_zone_crc(summary_crc: u16) -> ATCA_STATUS;
2963}
2964extern "C" {
2965    pub fn atcab_lock_data_zone() -> ATCA_STATUS;
2966}
2967extern "C" {
2968    pub fn atcab_lock_data_zone_crc(summary_crc: u16) -> ATCA_STATUS;
2969}
2970extern "C" {
2971    pub fn atcab_lock_data_slot(slot: u16) -> ATCA_STATUS;
2972}
2973extern "C" {
2974    pub fn atcab_mac(mode: u8, key_id: u16, challenge: *const u8, digest: *mut u8) -> ATCA_STATUS;
2975}
2976extern "C" {
2977    pub fn atcab_nonce_base(
2978        mode: u8,
2979        zero: u16,
2980        num_in: *const u8,
2981        rand_out: *mut u8,
2982    ) -> ATCA_STATUS;
2983}
2984extern "C" {
2985    pub fn atcab_nonce(num_in: *const u8) -> ATCA_STATUS;
2986}
2987extern "C" {
2988    pub fn atcab_nonce_load(target: u8, num_in: *const u8, num_in_size: u16) -> ATCA_STATUS;
2989}
2990extern "C" {
2991    pub fn atcab_nonce_rand(num_in: *const u8, rand_out: *mut u8) -> ATCA_STATUS;
2992}
2993extern "C" {
2994    pub fn atcab_challenge(num_in: *const u8) -> ATCA_STATUS;
2995}
2996extern "C" {
2997    pub fn atcab_challenge_seed_update(num_in: *const u8, rand_out: *mut u8) -> ATCA_STATUS;
2998}
2999extern "C" {
3000    pub fn atcab_priv_write(
3001        key_id: u16,
3002        priv_key: *const u8,
3003        write_key_id: u16,
3004        write_key: *const u8,
3005        num_in: *const u8,
3006    ) -> ATCA_STATUS;
3007}
3008extern "C" {
3009    pub fn atcab_random(rand_out: *mut u8) -> ATCA_STATUS;
3010}
3011extern "C" {
3012    pub fn atcab_read_zone(
3013        zone: u8,
3014        slot: u16,
3015        block: u8,
3016        offset: u8,
3017        data: *mut u8,
3018        len: u8,
3019    ) -> ATCA_STATUS;
3020}
3021extern "C" {
3022    pub fn atcab_is_locked(zone: u8, is_locked: *mut bool) -> ATCA_STATUS;
3023}
3024extern "C" {
3025    pub fn atcab_is_slot_locked(slot: u16, is_locked: *mut bool) -> ATCA_STATUS;
3026}
3027extern "C" {
3028    pub fn atcab_read_bytes_zone(
3029        zone: u8,
3030        slot: u16,
3031        offset: size_t,
3032        data: *mut u8,
3033        length: size_t,
3034    ) -> ATCA_STATUS;
3035}
3036extern "C" {
3037    pub fn atcab_read_serial_number(serial_number: *mut u8) -> ATCA_STATUS;
3038}
3039extern "C" {
3040    pub fn atcab_read_pubkey(slot: u16, public_key: *mut u8) -> ATCA_STATUS;
3041}
3042extern "C" {
3043    pub fn atcab_read_sig(slot: u16, sig: *mut u8) -> ATCA_STATUS;
3044}
3045extern "C" {
3046    pub fn atcab_read_config_zone(config_data: *mut u8) -> ATCA_STATUS;
3047}
3048extern "C" {
3049    pub fn atcab_cmp_config_zone(config_data: *mut u8, same_config: *mut bool) -> ATCA_STATUS;
3050}
3051extern "C" {
3052    pub fn atcab_read_enc(
3053        key_id: u16,
3054        block: u8,
3055        data: *mut u8,
3056        enc_key: *const u8,
3057        enc_key_id: u16,
3058        num_in: *const u8,
3059    ) -> ATCA_STATUS;
3060}
3061extern "C" {
3062    pub fn atcab_secureboot(
3063        mode: u8,
3064        param2: u16,
3065        digest: *const u8,
3066        signature: *const u8,
3067        mac: *mut u8,
3068    ) -> ATCA_STATUS;
3069}
3070extern "C" {
3071    pub fn atcab_secureboot_mac(
3072        mode: u8,
3073        digest: *const u8,
3074        signature: *const u8,
3075        num_in: *const u8,
3076        io_key: *const u8,
3077        is_verified: *mut bool,
3078    ) -> ATCA_STATUS;
3079}
3080extern "C" {
3081    pub fn atcab_selftest(mode: u8, param2: u16, result: *mut u8) -> ATCA_STATUS;
3082}
3083#[repr(C)]
3084#[derive(Copy, Clone)]
3085pub struct atca_sha256_ctx {
3086    #[doc = "!< Total number of message bytes processed"]
3087    pub total_msg_size: u32,
3088    #[doc = "!< Number of bytes in current block"]
3089    pub block_size: u32,
3090    #[doc = "!< Unprocessed message storage"]
3091    pub block: [u8; 128usize],
3092}
3093#[allow(deref_nullptr)]
3094#[test]
3095fn bindgen_test_layout_atca_sha256_ctx() {
3096    assert_eq!(
3097        ::std::mem::size_of::<atca_sha256_ctx>(),
3098        136usize,
3099        concat!("Size of: ", stringify!(atca_sha256_ctx))
3100    );
3101    assert_eq!(
3102        ::std::mem::align_of::<atca_sha256_ctx>(),
3103        4usize,
3104        concat!("Alignment of ", stringify!(atca_sha256_ctx))
3105    );
3106    assert_eq!(
3107        unsafe { &(*(::std::ptr::null::<atca_sha256_ctx>())).total_msg_size as *const _ as usize },
3108        0usize,
3109        concat!(
3110            "Offset of field: ",
3111            stringify!(atca_sha256_ctx),
3112            "::",
3113            stringify!(total_msg_size)
3114        )
3115    );
3116    assert_eq!(
3117        unsafe { &(*(::std::ptr::null::<atca_sha256_ctx>())).block_size as *const _ as usize },
3118        4usize,
3119        concat!(
3120            "Offset of field: ",
3121            stringify!(atca_sha256_ctx),
3122            "::",
3123            stringify!(block_size)
3124        )
3125    );
3126    assert_eq!(
3127        unsafe { &(*(::std::ptr::null::<atca_sha256_ctx>())).block as *const _ as usize },
3128        8usize,
3129        concat!(
3130            "Offset of field: ",
3131            stringify!(atca_sha256_ctx),
3132            "::",
3133            stringify!(block)
3134        )
3135    );
3136}
3137pub type atca_sha256_ctx_t = atca_sha256_ctx;
3138pub type atca_hmac_sha256_ctx_t = atca_sha256_ctx_t;
3139extern "C" {
3140    pub fn atcab_sha_base(
3141        mode: u8,
3142        length: u16,
3143        data_in: *const u8,
3144        data_out: *mut u8,
3145        data_out_size: *mut u16,
3146    ) -> ATCA_STATUS;
3147}
3148extern "C" {
3149    pub fn atcab_sha_start() -> ATCA_STATUS;
3150}
3151extern "C" {
3152    pub fn atcab_sha_update(message: *const u8) -> ATCA_STATUS;
3153}
3154extern "C" {
3155    pub fn atcab_sha_end(digest: *mut u8, length: u16, message: *const u8) -> ATCA_STATUS;
3156}
3157extern "C" {
3158    pub fn atcab_sha_read_context(context: *mut u8, context_size: *mut u16) -> ATCA_STATUS;
3159}
3160extern "C" {
3161    pub fn atcab_sha_write_context(context: *const u8, context_size: u16) -> ATCA_STATUS;
3162}
3163extern "C" {
3164    pub fn atcab_sha(length: u16, message: *const u8, digest: *mut u8) -> ATCA_STATUS;
3165}
3166extern "C" {
3167    pub fn atcab_hw_sha2_256(data: *const u8, data_size: size_t, digest: *mut u8) -> ATCA_STATUS;
3168}
3169extern "C" {
3170    pub fn atcab_hw_sha2_256_init(ctx: *mut atca_sha256_ctx_t) -> ATCA_STATUS;
3171}
3172extern "C" {
3173    pub fn atcab_hw_sha2_256_update(
3174        ctx: *mut atca_sha256_ctx_t,
3175        data: *const u8,
3176        data_size: size_t,
3177    ) -> ATCA_STATUS;
3178}
3179extern "C" {
3180    pub fn atcab_hw_sha2_256_finish(ctx: *mut atca_sha256_ctx_t, digest: *mut u8) -> ATCA_STATUS;
3181}
3182extern "C" {
3183    pub fn atcab_sha_hmac_init(ctx: *mut atca_hmac_sha256_ctx_t, key_slot: u16) -> ATCA_STATUS;
3184}
3185extern "C" {
3186    pub fn atcab_sha_hmac_update(
3187        ctx: *mut atca_hmac_sha256_ctx_t,
3188        data: *const u8,
3189        data_size: size_t,
3190    ) -> ATCA_STATUS;
3191}
3192extern "C" {
3193    pub fn atcab_sha_hmac_finish(
3194        ctx: *mut atca_hmac_sha256_ctx_t,
3195        digest: *mut u8,
3196        target: u8,
3197    ) -> ATCA_STATUS;
3198}
3199extern "C" {
3200    pub fn atcab_sha_hmac(
3201        data: *const u8,
3202        data_size: size_t,
3203        key_slot: u16,
3204        digest: *mut u8,
3205        target: u8,
3206    ) -> ATCA_STATUS;
3207}
3208extern "C" {
3209    pub fn atcab_sign_base(mode: u8, key_id: u16, signature: *mut u8) -> ATCA_STATUS;
3210}
3211extern "C" {
3212    pub fn atcab_sign(key_id: u16, msg: *const u8, signature: *mut u8) -> ATCA_STATUS;
3213}
3214extern "C" {
3215    pub fn atcab_sign_internal(
3216        key_id: u16,
3217        is_invalidate: bool,
3218        is_full_sn: bool,
3219        signature: *mut u8,
3220    ) -> ATCA_STATUS;
3221}
3222extern "C" {
3223    pub fn atcab_updateextra(mode: u8, new_value: u16) -> ATCA_STATUS;
3224}
3225extern "C" {
3226    pub fn atcab_verify(
3227        mode: u8,
3228        key_id: u16,
3229        signature: *const u8,
3230        public_key: *const u8,
3231        other_data: *const u8,
3232        mac: *mut u8,
3233    ) -> ATCA_STATUS;
3234}
3235extern "C" {
3236    pub fn atcab_verify_extern(
3237        message: *const u8,
3238        signature: *const u8,
3239        public_key: *const u8,
3240        is_verified: *mut bool,
3241    ) -> ATCA_STATUS;
3242}
3243extern "C" {
3244    pub fn atcab_verify_extern_mac(
3245        message: *const u8,
3246        signature: *const u8,
3247        public_key: *const u8,
3248        num_in: *const u8,
3249        io_key: *const u8,
3250        is_verified: *mut bool,
3251    ) -> ATCA_STATUS;
3252}
3253extern "C" {
3254    pub fn atcab_verify_stored(
3255        message: *const u8,
3256        signature: *const u8,
3257        key_id: u16,
3258        is_verified: *mut bool,
3259    ) -> ATCA_STATUS;
3260}
3261extern "C" {
3262    pub fn atcab_verify_stored_mac(
3263        message: *const u8,
3264        signature: *const u8,
3265        key_id: u16,
3266        num_in: *const u8,
3267        io_key: *const u8,
3268        is_verified: *mut bool,
3269    ) -> ATCA_STATUS;
3270}
3271extern "C" {
3272    pub fn atcab_verify_validate(
3273        key_id: u16,
3274        signature: *const u8,
3275        other_data: *const u8,
3276        is_verified: *mut bool,
3277    ) -> ATCA_STATUS;
3278}
3279extern "C" {
3280    pub fn atcab_verify_invalidate(
3281        key_id: u16,
3282        signature: *const u8,
3283        other_data: *const u8,
3284        is_verified: *mut bool,
3285    ) -> ATCA_STATUS;
3286}
3287extern "C" {
3288    pub fn atcab_write(zone: u8, address: u16, value: *const u8, mac: *const u8) -> ATCA_STATUS;
3289}
3290extern "C" {
3291    pub fn atcab_write_zone(
3292        zone: u8,
3293        slot: u16,
3294        block: u8,
3295        offset: u8,
3296        data: *const u8,
3297        len: u8,
3298    ) -> ATCA_STATUS;
3299}
3300extern "C" {
3301    pub fn atcab_write_bytes_zone(
3302        zone: u8,
3303        slot: u16,
3304        offset_bytes: size_t,
3305        data: *const u8,
3306        length: size_t,
3307    ) -> ATCA_STATUS;
3308}
3309extern "C" {
3310    pub fn atcab_write_pubkey(slot: u16, public_key: *const u8) -> ATCA_STATUS;
3311}
3312extern "C" {
3313    pub fn atcab_write_config_zone(config_data: *const u8) -> ATCA_STATUS;
3314}
3315extern "C" {
3316    pub fn atcab_write_enc(
3317        key_id: u16,
3318        block: u8,
3319        data: *const u8,
3320        enc_key: *const u8,
3321        enc_key_id: u16,
3322        num_in: *const u8,
3323    ) -> ATCA_STATUS;
3324}
3325extern "C" {
3326    pub fn atcab_write_config_counter(counter_id: u16, counter_value: u32) -> ATCA_STATUS;
3327}
3328extern "C" {
3329    pub fn atcab_printbin(binary: *mut u8, bin_len: size_t, add_space: bool) -> ATCA_STATUS;
3330}
3331extern "C" {
3332    pub fn atcab_bin2hex(
3333        bin: *const u8,
3334        bin_size: size_t,
3335        hex: *mut ::std::os::raw::c_char,
3336        hex_size: *mut size_t,
3337    ) -> ATCA_STATUS;
3338}
3339extern "C" {
3340    pub fn atcab_bin2hex_(
3341        bin: *const u8,
3342        bin_size: size_t,
3343        hex: *mut ::std::os::raw::c_char,
3344        hex_size: *mut size_t,
3345        is_pretty: bool,
3346        is_space: bool,
3347        is_upper: bool,
3348    ) -> ATCA_STATUS;
3349}
3350extern "C" {
3351    pub fn atcab_hex2bin(
3352        ascii_hex: *const ::std::os::raw::c_char,
3353        ascii_hex_len: size_t,
3354        binary: *mut u8,
3355        bin_len: *mut size_t,
3356    ) -> ATCA_STATUS;
3357}
3358extern "C" {
3359    pub fn atcab_hex2bin_(
3360        hex: *const ::std::os::raw::c_char,
3361        hex_size: size_t,
3362        bin: *mut u8,
3363        bin_size: *mut size_t,
3364        is_space: bool,
3365    ) -> ATCA_STATUS;
3366}
3367extern "C" {
3368    pub fn atcab_printbin_sp(binary: *mut u8, bin_len: size_t) -> ATCA_STATUS;
3369}
3370extern "C" {
3371    pub fn atcab_printbin_label(
3372        label: *const ::std::os::raw::c_char,
3373        binary: *mut u8,
3374        bin_len: size_t,
3375    ) -> ATCA_STATUS;
3376}
3377extern "C" {
3378    pub fn packHex(
3379        ascii_hex: *const ::std::os::raw::c_char,
3380        ascii_hex_len: size_t,
3381        packed_hex: *mut ::std::os::raw::c_char,
3382        packed_len: *mut size_t,
3383    ) -> ATCA_STATUS;
3384}
3385extern "C" {
3386    pub fn isDigit(c: ::std::os::raw::c_char) -> bool;
3387}
3388extern "C" {
3389    pub fn isWhiteSpace(c: ::std::os::raw::c_char) -> bool;
3390}
3391extern "C" {
3392    pub fn isAlpha(c: ::std::os::raw::c_char) -> bool;
3393}
3394extern "C" {
3395    pub fn isHexAlpha(c: ::std::os::raw::c_char) -> bool;
3396}
3397extern "C" {
3398    pub fn isHex(c: ::std::os::raw::c_char) -> bool;
3399}
3400extern "C" {
3401    pub fn isHexDigit(c: ::std::os::raw::c_char) -> bool;
3402}
3403extern "C" {
3404    pub fn isBase64(c: ::std::os::raw::c_char, rules: *const u8) -> bool;
3405}
3406extern "C" {
3407    pub fn isBase64Digit(c: ::std::os::raw::c_char, rules: *const u8) -> bool;
3408}
3409extern "C" {
3410    pub fn base64Index(c: ::std::os::raw::c_char, rules: *const u8) -> u8;
3411}
3412extern "C" {
3413    pub fn base64Char(id: u8, rules: *const u8) -> ::std::os::raw::c_char;
3414}
3415extern "C" {
3416    pub static mut atcab_b64rules_default: [u8; 4usize];
3417}
3418extern "C" {
3419    pub static mut atcab_b64rules_mime: [u8; 4usize];
3420}
3421extern "C" {
3422    pub static mut atcab_b64rules_urlsafe: [u8; 4usize];
3423}
3424extern "C" {
3425    pub fn atcab_base64decode_(
3426        encoded: *const ::std::os::raw::c_char,
3427        encoded_size: size_t,
3428        data: *mut u8,
3429        data_size: *mut size_t,
3430        rules: *const u8,
3431    ) -> ATCA_STATUS;
3432}
3433extern "C" {
3434    pub fn atcab_base64decode(
3435        encoded: *const ::std::os::raw::c_char,
3436        encoded_size: size_t,
3437        data: *mut u8,
3438        data_size: *mut size_t,
3439    ) -> ATCA_STATUS;
3440}
3441extern "C" {
3442    pub fn atcab_base64encode_(
3443        data: *const u8,
3444        data_size: size_t,
3445        encoded: *mut ::std::os::raw::c_char,
3446        encoded_size: *mut size_t,
3447        rules: *const u8,
3448    ) -> ATCA_STATUS;
3449}
3450extern "C" {
3451    pub fn atcab_base64encode(
3452        data: *const u8,
3453        data_size: size_t,
3454        encoded: *mut ::std::os::raw::c_char,
3455        encoded_size: *mut size_t,
3456    ) -> ATCA_STATUS;
3457}
3458extern "C" {
3459    pub fn atcab_reversal(
3460        bin: *const u8,
3461        bin_size: size_t,
3462        dest: *mut u8,
3463        dest_size: *mut size_t,
3464    ) -> ATCA_STATUS;
3465}
3466#[repr(C)]
3467#[derive(Debug, Copy, Clone)]
3468pub struct __locale_data {
3469    pub _address: u8,
3470}