pinweaver: Build for Ti50
Add Makefile, Cargo.toml, build.rs, etc to enable building the
Pinweaver library for Ti50.
Add bindings.rs (generated using bindgen) to allow the library to be
called from Rust.
BUG=b:165024054
TEST=pinweaver_client selftest
Change-Id: Id332af73b99259f9c5267abdb707ec34591179d7
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/pinweaver/+/3652226
Commit-Queue: Edward Hill <ecgh@chromium.org>
Reviewed-by: Andrey Pronin <apronin@chromium.org>
Tested-by: Edward Hill <ecgh@chromium.org>
diff --git a/eal/ti50/Cargo.toml b/eal/ti50/Cargo.toml
new file mode 100644
index 0000000..c4d577f
--- /dev/null
+++ b/eal/ti50/Cargo.toml
@@ -0,0 +1,8 @@
+[package]
+name = "pinweaver-sys"
+version = "0.0.1"
+edition = "2021"
+links = "pinweaver"
+
+[dependencies]
+cty = "0.2"
diff --git a/eal/ti50/Makefile b/eal/ti50/Makefile
new file mode 100644
index 0000000..c915cdf
--- /dev/null
+++ b/eal/ti50/Makefile
@@ -0,0 +1,115 @@
+# Copyright 2022 The ChromiumOS Authors.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+include ../../../ti50/common/build.lib.c.mk
+
+##############################################################################
+# Library name
+# Default path to library
+CLIB_PATH := $(CURDIR)/../..
+CLIB_NAME = pinweaver
+
+CLIB_SYM = $(CLIB_PATH)/eal/ti50/$(CLIB_NAME).sym
+
+CFLAGS += -Wno-flexible-array-extensions -Wno-padded
+CFLAGS += -I$(CLIB_PATH) -I$(CLIB_PATH)/eal/ti50
+
+# output directory
+ODIR := $(BUILD_DIR)
+COV_ODIR := $(ODIR)-cov
+
+CLIB_GIT_HASH := "$(shell pushd $(CLIB_PATH) >/dev/null;\
+ git describe --always --dirty --exclude '*' ; popd >/dev/null)"
+
+CFLAGS_VERSION := -DCLIB_GIT_HASH=\"$(CLIB_GIT_HASH)\"
+
+SOURCES := pinweaver.c eal/ti50/pinweaver_eal.c
+
+# Intermediate target - native object from LTO parts
+CLIB_OBJ = $(ODIR)/$(CLIB_NAME)-native.o
+CLIB_LST = $(ODIR)/$(CLIB_NAME)-native.lst
+CLIB_OBJSYM = $(ODIR)/$(CLIB_NAME)-clean.o
+CLIB_OBJSYMLST = $(ODIR)/$(CLIB_NAME)-clean.lst
+
+# The purpose of this Makefile
+FINAL_LIB_NAME := lib$(CLIB_NAME).a
+FINAL_LIB := $(BUILD_DIR)/$(FINAL_LIB_NAME)
+
+COV_OBJECTS = $(patsubst %.c, $(COV_ODIR)/%.o, $(COV_SOURCES))
+OBJECTS=$(patsubst %.c, $(ODIR)/%.o, $(SOURCES))
+ASM_OBJECTS=$(patsubst %.S, $(ODIR)/%.o, $(ASM_SOURCES))
+
+# Pull in .h dependancies
+-include $(OBJECTS:.o=.d)
+-include $(COV_OBJECTS:.o=.d)
+
+$(info Building version $(CLIB_GIT_HASH) in $(CLIB_PATH))
+# Use V=1 for verbose output
+ifneq ($(V),)
+$(info ********************************************)
+$(info BUILD_DIR = $(BUILD_DIR))
+$(info FINAL_LIB = $(FINAL_LIB))
+$(info CC = $(CC))
+$(info CLIB_PATH = $(CLIB_PATH))
+$(info SOURCES = $(SOURCES))
+$(info ASM_SOURCES = $(ASM_SOURCES))
+$(info OBJECTS = $(OBJECTS))
+$(info ********************************************)
+endif
+
+.PHONY: all
+all: $(FINAL_LIB) $(CLIB_OBJ) $(MAKEFILE_LIST) $(OBJECTS)
+
+# this rule builds $(OBJECTS)
+$(ODIR)/%.o: $(CLIB_PATH)/%.c $(MAKEFILE_LIST) $(CLIB_HDR)
+ @echo " CC $(notdir $<)"
+ ${Q}mkdir -p $(dir $@)
+ $(Q)$(CC) -c -o $@ $(CFLAGS) -MMD -MF $@.d $<
+ $(Q)$(CC) -S -o $@.S $(CFLAGS) -MMD -MF $@.d $<
+
+$(ODIR)/%.o: $(CLIB_PATH)/%.S $(MAKEFILE_LIST) | $(ODIR)
+ @echo " AS $(notdir $<)"
+ $(Q)$(AS) $(LLVM_AS_FLAGS) -o=$@ $<
+
+$(CLIB_OBJ): $(OBJECTS) $(ASM_OBJECTS) $(COV_OBJECTS) | $(ODIR)
+ @echo " LD $(notdir $@)"
+ $(Q)$(CC) $(CFLAGS_LD_LTO) -Wl,-Map=$@.map -o $@ $^
+
+
+# Object file with removed internal symbols
+$(CLIB_OBJSYM): $(CLIB_OBJ) $(CLIB_SYM) $(MAKEFILE_LIST) | $(ODIR)
+ @echo " OBJCOPY $(notdir $@)"
+ $(Q)$(OBJCOPY) --strip-unneeded --localize-hidden \
+ --keep-global-symbols=$(CLIB_SYM) $< $@
+
+$(CLIB_OBJSYMLST): $(CLIB_OBJSYM) | $(ODIR)
+ @echo " OBJDUMP $(notdir $@)"
+ $(Q)$(OBJDUMP) $(OBJDUMP_FLAGS) $< > $@
+
+#$(FINAL_LIB): $(OBJECTS) $(ASM_OBJECTS)
+$(FINAL_LIB): $(CLIB_OBJSYM)
+ @echo " AR $(notdir $@) in $(dir $@)"
+ $(Q)rm -f $@
+ $(Q)$(AR) scr $@ $^
+ @echo " OBJDUMP $(notdir $@.lst)"
+ $(Q)$(OBJDUMP) $(OBJDUMP_FLAGS) $@ > $@.lst
+
+.PHONY: test
+test: $(TEST)
+$(TEST): $(TEST_SRC) $(FINAL_LIB)
+ @echo " CC $(notdir $@)"
+ $(Q)$(CC) -o $@ $(CFLAGS_TARGET_TEST) -I include $(TEST_SRC)\
+ -L $(BUILD_DIR) -Wl,-l$(CLIB_NAME)
+ $(TEST)
+
+################################ CLEAN TARGET #################################
+.PHONY: clean
+clean:
+ $(Q)rm -rf $(OBJECTS) $(COV_OBJECTS)
+ $(Q)rm -rf $(BUILD_DIR)
+
+.PHONY: format
+format:
+ $(Q)find . -path ./config -prune -o \( -iname \*.h -o -iname \*.c \) \
+ -exec $(CLANG_FORMAT) -i -style=file {} +
diff --git a/eal/ti50/build.rs b/eal/ti50/build.rs
new file mode 100644
index 0000000..540802c
--- /dev/null
+++ b/eal/ti50/build.rs
@@ -0,0 +1,20 @@
+// Copyright 2022 The ChromiumOS Authors.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+use std::env;
+use std::process::Command;
+
+fn main() {
+ let out_dir = env::var("OUT_DIR").unwrap();
+ println!("cargo:rerun-if-changed=.");
+ let success = Command::new("make")
+ .spawn()
+ .expect("Error invoking Make")
+ .wait()
+ .unwrap()
+ .success();
+ assert!(success, "Error making pinweaver");
+ println!("cargo:rustc-link-search=native={}", out_dir);
+ println!("cargo:rustc-link-lib=static=pinweaver");
+}
diff --git a/eal/ti50/pinweaver.sym b/eal/ti50/pinweaver.sym
new file mode 100644
index 0000000..138fab4
--- /dev/null
+++ b/eal/ti50/pinweaver.sym
@@ -0,0 +1,2 @@
+pinweaver_init
+pinweaver_command
diff --git a/eal/ti50/pinweaver_eal.c b/eal/ti50/pinweaver_eal.c
new file mode 100644
index 0000000..c70af96
--- /dev/null
+++ b/eal/ti50/pinweaver_eal.c
@@ -0,0 +1,27 @@
+/* Copyright 2022 The ChromiumOS Authors.
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+#include <stdio.h>
+#include <stdint.h>
+#include <stdarg.h>
+
+static const char* const error_str = "ERROR";
+
+void putnstr(const char* s, uint32_t n);
+
+int printf(const char* format, ...) {
+ va_list args;
+ char str[256];
+ int res;
+ va_start(args, format);
+ res = vsnprintf(str, sizeof(str), format, args);
+ va_end(args);
+ if (res > 0)
+ putnstr(str, res);
+ else
+ putnstr(error_str, sizeof(error_str));
+
+ return res;
+}
diff --git a/eal/ti50/pinweaver_eal_types.h b/eal/ti50/pinweaver_eal_types.h
new file mode 100644
index 0000000..fec4046
--- /dev/null
+++ b/eal/ti50/pinweaver_eal_types.h
@@ -0,0 +1,21 @@
+
+/* Copyright 2022 The ChromiumOS Authors.
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+#ifndef __PINWEAVER_EAL_TYPES_H
+#define __PINWEAVER_EAL_TYPES_H
+
+typedef uint32_t pinweaver_eal_sha256_ctx_t;
+typedef uint32_t pinweaver_eal_hmac_sha256_ctx_t;
+
+int printf(const char* format, ...);
+
+#define PINWEAVER_EAL_INFO(...) \
+ do { \
+ printf(__VA_ARGS__); \
+ printf("\n"); \
+ } while(0)
+
+#endif /* __PINWEAVER_EAL_TYPES_H */
diff --git a/eal/ti50/src/bindings.rs b/eal/ti50/src/bindings.rs
new file mode 100644
index 0000000..b34e7af
--- /dev/null
+++ b/eal/ti50/src/bindings.rs
@@ -0,0 +1,2702 @@
+// Copyright 2022 The ChromiumOS Authors.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+/* automatically generated by rust-bindgen 0.59.1 */
+
+#[repr(C)]
+#[derive(Default)]
+pub struct __IncompleteArrayField<T>(::core::marker::PhantomData<T>, [T; 0]);
+impl<T> __IncompleteArrayField<T> {
+ #[inline]
+ pub const fn new() -> Self {
+ __IncompleteArrayField(::core::marker::PhantomData, [])
+ }
+ #[inline]
+ pub fn as_ptr(&self) -> *const T {
+ self as *const _ as *const T
+ }
+ #[inline]
+ pub fn as_mut_ptr(&mut self) -> *mut T {
+ self as *mut _ as *mut T
+ }
+ #[inline]
+ pub unsafe fn as_slice(&self, len: usize) -> &[T] {
+ ::core::slice::from_raw_parts(self.as_ptr(), len)
+ }
+ #[inline]
+ pub unsafe fn as_mut_slice(&mut self, len: usize) -> &mut [T] {
+ ::core::slice::from_raw_parts_mut(self.as_mut_ptr(), len)
+ }
+}
+impl<T> ::core::fmt::Debug for __IncompleteArrayField<T> {
+ fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
+ fmt.write_str("__IncompleteArrayField")
+ }
+}
+#[repr(C)]
+pub struct __BindgenUnionField<T>(::core::marker::PhantomData<T>);
+impl<T> __BindgenUnionField<T> {
+ #[inline]
+ pub const fn new() -> Self {
+ __BindgenUnionField(::core::marker::PhantomData)
+ }
+ #[inline]
+ pub unsafe fn as_ref(&self) -> &T {
+ ::core::mem::transmute(self)
+ }
+ #[inline]
+ pub unsafe fn as_mut(&mut self) -> &mut T {
+ ::core::mem::transmute(self)
+ }
+}
+impl<T> ::core::default::Default for __BindgenUnionField<T> {
+ #[inline]
+ fn default() -> Self {
+ Self::new()
+ }
+}
+impl<T> ::core::clone::Clone for __BindgenUnionField<T> {
+ #[inline]
+ fn clone(&self) -> Self {
+ Self::new()
+ }
+}
+impl<T> ::core::marker::Copy for __BindgenUnionField<T> {}
+impl<T> ::core::fmt::Debug for __BindgenUnionField<T> {
+ fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
+ fmt.write_str("__BindgenUnionField")
+ }
+}
+impl<T> ::core::hash::Hash for __BindgenUnionField<T> {
+ fn hash<H: ::core::hash::Hasher>(&self, _state: &mut H) {}
+}
+impl<T> ::core::cmp::PartialEq for __BindgenUnionField<T> {
+ fn eq(&self, _other: &__BindgenUnionField<T>) -> bool {
+ true
+ }
+}
+impl<T> ::core::cmp::Eq for __BindgenUnionField<T> {}
+pub const _STDINT_H: u32 = 1;
+pub const _FEATURES_H: u32 = 1;
+pub const _DEFAULT_SOURCE: u32 = 1;
+pub const __GLIBC_USE_ISOC2X: u32 = 0;
+pub const __USE_ISOC11: u32 = 1;
+pub const __USE_ISOC99: u32 = 1;
+pub const __USE_ISOC95: u32 = 1;
+pub const __USE_POSIX_IMPLICITLY: u32 = 1;
+pub const _POSIX_SOURCE: u32 = 1;
+pub const _POSIX_C_SOURCE: u32 = 200809;
+pub const __USE_POSIX: u32 = 1;
+pub const __USE_POSIX2: u32 = 1;
+pub const __USE_POSIX199309: u32 = 1;
+pub const __USE_POSIX199506: u32 = 1;
+pub const __USE_XOPEN2K: u32 = 1;
+pub const __USE_XOPEN2K8: u32 = 1;
+pub const _ATFILE_SOURCE: u32 = 1;
+pub const __USE_MISC: u32 = 1;
+pub const __USE_ATFILE: u32 = 1;
+pub const __USE_FORTIFY_LEVEL: u32 = 0;
+pub const __GLIBC_USE_DEPRECATED_GETS: u32 = 0;
+pub const __GLIBC_USE_DEPRECATED_SCANF: u32 = 0;
+pub const _STDC_PREDEF_H: u32 = 1;
+pub const __STDC_IEC_559__: u32 = 1;
+pub const __STDC_IEC_559_COMPLEX__: u32 = 1;
+pub const __STDC_ISO_10646__: u32 = 201706;
+pub const __GNU_LIBRARY__: u32 = 6;
+pub const __GLIBC__: u32 = 2;
+pub const __GLIBC_MINOR__: u32 = 33;
+pub const _SYS_CDEFS_H: u32 = 1;
+pub const __glibc_c99_flexarr_available: u32 = 1;
+pub const __WORDSIZE: u32 = 64;
+pub const __WORDSIZE_TIME64_COMPAT32: u32 = 1;
+pub const __SYSCALL_WORDSIZE: u32 = 64;
+pub const __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI: u32 = 0;
+pub const __HAVE_GENERIC_SELECTION: u32 = 1;
+pub const __GLIBC_USE_LIB_EXT2: u32 = 0;
+pub const __GLIBC_USE_IEC_60559_BFP_EXT: u32 = 0;
+pub const __GLIBC_USE_IEC_60559_BFP_EXT_C2X: u32 = 0;
+pub const __GLIBC_USE_IEC_60559_FUNCS_EXT: u32 = 0;
+pub const __GLIBC_USE_IEC_60559_FUNCS_EXT_C2X: u32 = 0;
+pub const __GLIBC_USE_IEC_60559_TYPES_EXT: u32 = 0;
+pub const _BITS_TYPES_H: u32 = 1;
+pub const __TIMESIZE: u32 = 64;
+pub const _BITS_TYPESIZES_H: u32 = 1;
+pub const __OFF_T_MATCHES_OFF64_T: u32 = 1;
+pub const __INO_T_MATCHES_INO64_T: u32 = 1;
+pub const __RLIM_T_MATCHES_RLIM64_T: u32 = 1;
+pub const __STATFS_MATCHES_STATFS64: u32 = 1;
+pub const __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64: u32 = 1;
+pub const __FD_SETSIZE: u32 = 1024;
+pub const _BITS_TIME64_H: u32 = 1;
+pub const _BITS_WCHAR_H: u32 = 1;
+pub const _BITS_STDINT_INTN_H: u32 = 1;
+pub const _BITS_STDINT_UINTN_H: u32 = 1;
+pub const INT8_MIN: i32 = -128;
+pub const INT16_MIN: i32 = -32768;
+pub const INT32_MIN: i32 = -2147483648;
+pub const INT8_MAX: u32 = 127;
+pub const INT16_MAX: u32 = 32767;
+pub const INT32_MAX: u32 = 2147483647;
+pub const UINT8_MAX: u32 = 255;
+pub const UINT16_MAX: u32 = 65535;
+pub const UINT32_MAX: u32 = 4294967295;
+pub const INT_LEAST8_MIN: i32 = -128;
+pub const INT_LEAST16_MIN: i32 = -32768;
+pub const INT_LEAST32_MIN: i32 = -2147483648;
+pub const INT_LEAST8_MAX: u32 = 127;
+pub const INT_LEAST16_MAX: u32 = 32767;
+pub const INT_LEAST32_MAX: u32 = 2147483647;
+pub const UINT_LEAST8_MAX: u32 = 255;
+pub const UINT_LEAST16_MAX: u32 = 65535;
+pub const UINT_LEAST32_MAX: u32 = 4294967295;
+pub const INT_FAST8_MIN: i32 = -128;
+pub const INT_FAST16_MIN: i64 = -9223372036854775808;
+pub const INT_FAST32_MIN: i64 = -9223372036854775808;
+pub const INT_FAST8_MAX: u32 = 127;
+pub const INT_FAST16_MAX: u64 = 9223372036854775807;
+pub const INT_FAST32_MAX: u64 = 9223372036854775807;
+pub const UINT_FAST8_MAX: u32 = 255;
+pub const UINT_FAST16_MAX: i32 = -1;
+pub const UINT_FAST32_MAX: i32 = -1;
+pub const INTPTR_MIN: i64 = -9223372036854775808;
+pub const INTPTR_MAX: u64 = 9223372036854775807;
+pub const UINTPTR_MAX: i32 = -1;
+pub const PTRDIFF_MIN: i64 = -9223372036854775808;
+pub const PTRDIFF_MAX: u64 = 9223372036854775807;
+pub const SIG_ATOMIC_MIN: i32 = -2147483648;
+pub const SIG_ATOMIC_MAX: u32 = 2147483647;
+pub const SIZE_MAX: i32 = -1;
+pub const WINT_MIN: u32 = 0;
+pub const WINT_MAX: u32 = 4294967295;
+pub const PW_PROTOCOL_VERSION: u32 = 1;
+pub const PW_LEAF_MAJOR_VERSION: u32 = 0;
+pub const PW_LEAF_MINOR_VERSION: u32 = 1;
+pub const PW_MAX_MESSAGE_SIZE: u32 = 2036;
+pub const PW_WRAP_BLOCK_SIZE: u32 = 16;
+pub const PW_BLOCK_ATTEMPTS: u32 = 4294967295;
+pub const PW_HASH_SIZE: u32 = 32;
+pub const PW_SCHED_COUNT: u32 = 16;
+pub const PW_MAX_PCR_CRITERIA_COUNT: u32 = 2;
+pub const PW_SECRET_SIZE: u32 = 32;
+pub const PW_MAX_PATH_SIZE: u32 = 1024;
+pub const PW_STORAGE_VERSION: u32 = 0;
+pub const BITS_PER_LEVEL_MIN: u32 = 1;
+pub const BITS_PER_LEVEL_MAX: u32 = 5;
+pub const HEIGHT_MIN: u32 = 1;
+pub const PW_LOG_ENTRY_COUNT: u32 = 2;
+pub const PW_TREE_VAR: &'static [u8; 5usize] = b"pwT0\0";
+pub const PW_LOG_VAR0: &'static [u8; 5usize] = b"pwL0\0";
+pub const PW_MAX_VAR_USAGE: u32 = 192;
+pub type size_t = cty::c_ulong;
+pub type wchar_t = cty::c_int;
+#[repr(C)]
+#[repr(align(16))]
+#[derive(Debug, Copy, Clone)]
+pub struct max_align_t {
+ pub __clang_max_align_nonce1: cty::c_longlong,
+ pub __bindgen_padding_0: u64,
+ pub __clang_max_align_nonce2: u128,
+}
+#[test]
+fn bindgen_test_layout_max_align_t() {
+ assert_eq!(
+ ::core::mem::size_of::<max_align_t>(),
+ 32usize,
+ concat!("Size of: ", stringify!(max_align_t))
+ );
+ assert_eq!(
+ ::core::mem::align_of::<max_align_t>(),
+ 16usize,
+ concat!("Alignment of ", stringify!(max_align_t))
+ );
+ assert_eq!(
+ unsafe {
+ &(*(::core::ptr::null::<max_align_t>())).__clang_max_align_nonce1 as *const _ as usize
+ },
+ 0usize,
+ concat!(
+ "Offset of field: ",
+ stringify!(max_align_t),
+ "::",
+ stringify!(__clang_max_align_nonce1)
+ )
+ );
+ assert_eq!(
+ unsafe {
+ &(*(::core::ptr::null::<max_align_t>())).__clang_max_align_nonce2 as *const _ as usize
+ },
+ 16usize,
+ concat!(
+ "Offset of field: ",
+ stringify!(max_align_t),
+ "::",
+ stringify!(__clang_max_align_nonce2)
+ )
+ );
+}
+pub type __u_char = cty::c_uchar;
+pub type __u_short = cty::c_ushort;
+pub type __u_int = cty::c_uint;
+pub type __u_long = cty::c_ulong;
+pub type __int8_t = cty::c_schar;
+pub type __uint8_t = cty::c_uchar;
+pub type __int16_t = cty::c_short;
+pub type __uint16_t = cty::c_ushort;
+pub type __int32_t = cty::c_int;
+pub type __uint32_t = cty::c_uint;
+pub type __int64_t = cty::c_long;
+pub type __uint64_t = cty::c_ulong;
+pub type __int_least8_t = __int8_t;
+pub type __uint_least8_t = __uint8_t;
+pub type __int_least16_t = __int16_t;
+pub type __uint_least16_t = __uint16_t;
+pub type __int_least32_t = __int32_t;
+pub type __uint_least32_t = __uint32_t;
+pub type __int_least64_t = __int64_t;
+pub type __uint_least64_t = __uint64_t;
+pub type __quad_t = cty::c_long;
+pub type __u_quad_t = cty::c_ulong;
+pub type __intmax_t = cty::c_long;
+pub type __uintmax_t = cty::c_ulong;
+pub type __dev_t = cty::c_ulong;
+pub type __uid_t = cty::c_uint;
+pub type __gid_t = cty::c_uint;
+pub type __ino_t = cty::c_ulong;
+pub type __ino64_t = cty::c_ulong;
+pub type __mode_t = cty::c_uint;
+pub type __nlink_t = cty::c_ulong;
+pub type __off_t = cty::c_long;
+pub type __off64_t = cty::c_long;
+pub type __pid_t = cty::c_int;
+#[repr(C)]
+#[derive(Debug, Copy, Clone)]
+pub struct __fsid_t {
+ pub __val: [cty::c_int; 2usize],
+}
+#[test]
+fn bindgen_test_layout___fsid_t() {
+ assert_eq!(
+ ::core::mem::size_of::<__fsid_t>(),
+ 8usize,
+ concat!("Size of: ", stringify!(__fsid_t))
+ );
+ assert_eq!(
+ ::core::mem::align_of::<__fsid_t>(),
+ 4usize,
+ concat!("Alignment of ", stringify!(__fsid_t))
+ );
+ assert_eq!(
+ unsafe { &(*(::core::ptr::null::<__fsid_t>())).__val as *const _ as usize },
+ 0usize,
+ concat!(
+ "Offset of field: ",
+ stringify!(__fsid_t),
+ "::",
+ stringify!(__val)
+ )
+ );
+}
+pub type __clock_t = cty::c_long;
+pub type __rlim_t = cty::c_ulong;
+pub type __rlim64_t = cty::c_ulong;
+pub type __id_t = cty::c_uint;
+pub type __time_t = cty::c_long;
+pub type __useconds_t = cty::c_uint;
+pub type __suseconds_t = cty::c_long;
+pub type __suseconds64_t = cty::c_long;
+pub type __daddr_t = cty::c_int;
+pub type __key_t = cty::c_int;
+pub type __clockid_t = cty::c_int;
+pub type __timer_t = *mut cty::c_void;
+pub type __blksize_t = cty::c_long;
+pub type __blkcnt_t = cty::c_long;
+pub type __blkcnt64_t = cty::c_long;
+pub type __fsblkcnt_t = cty::c_ulong;
+pub type __fsblkcnt64_t = cty::c_ulong;
+pub type __fsfilcnt_t = cty::c_ulong;
+pub type __fsfilcnt64_t = cty::c_ulong;
+pub type __fsword_t = cty::c_long;
+pub type __ssize_t = cty::c_long;
+pub type __syscall_slong_t = cty::c_long;
+pub type __syscall_ulong_t = cty::c_ulong;
+pub type __loff_t = __off64_t;
+pub type __caddr_t = *mut cty::c_char;
+pub type __intptr_t = cty::c_long;
+pub type __socklen_t = cty::c_uint;
+pub type __sig_atomic_t = cty::c_int;
+pub type int_least8_t = __int_least8_t;
+pub type int_least16_t = __int_least16_t;
+pub type int_least32_t = __int_least32_t;
+pub type int_least64_t = __int_least64_t;
+pub type uint_least8_t = __uint_least8_t;
+pub type uint_least16_t = __uint_least16_t;
+pub type uint_least32_t = __uint_least32_t;
+pub type uint_least64_t = __uint_least64_t;
+pub type int_fast8_t = cty::c_schar;
+pub type int_fast16_t = cty::c_long;
+pub type int_fast32_t = cty::c_long;
+pub type int_fast64_t = cty::c_long;
+pub type uint_fast8_t = cty::c_uchar;
+pub type uint_fast16_t = cty::c_ulong;
+pub type uint_fast32_t = cty::c_ulong;
+pub type uint_fast64_t = cty::c_ulong;
+pub type intmax_t = __intmax_t;
+pub type uintmax_t = __uintmax_t;
+pub const pw_error_codes_enum_PW_ERR_VERSION_MISMATCH: pw_error_codes_enum = 65536;
+pub const pw_error_codes_enum_PW_ERR_TREE_INVALID: pw_error_codes_enum = 65537;
+pub const pw_error_codes_enum_PW_ERR_LENGTH_INVALID: pw_error_codes_enum = 65538;
+pub const pw_error_codes_enum_PW_ERR_TYPE_INVALID: pw_error_codes_enum = 65539;
+pub const pw_error_codes_enum_PW_ERR_BITS_PER_LEVEL_INVALID: pw_error_codes_enum = 65540;
+pub const pw_error_codes_enum_PW_ERR_HEIGHT_INVALID: pw_error_codes_enum = 65541;
+pub const pw_error_codes_enum_PW_ERR_LABEL_INVALID: pw_error_codes_enum = 65542;
+pub const pw_error_codes_enum_PW_ERR_DELAY_SCHEDULE_INVALID: pw_error_codes_enum = 65543;
+pub const pw_error_codes_enum_PW_ERR_PATH_AUTH_FAILED: pw_error_codes_enum = 65544;
+pub const pw_error_codes_enum_PW_ERR_LEAF_VERSION_MISMATCH: pw_error_codes_enum = 65545;
+pub const pw_error_codes_enum_PW_ERR_HMAC_AUTH_FAILED: pw_error_codes_enum = 65546;
+pub const pw_error_codes_enum_PW_ERR_LOWENT_AUTH_FAILED: pw_error_codes_enum = 65547;
+pub const pw_error_codes_enum_PW_ERR_RESET_AUTH_FAILED: pw_error_codes_enum = 65548;
+pub const pw_error_codes_enum_PW_ERR_CRYPTO_FAILURE: pw_error_codes_enum = 65549;
+pub const pw_error_codes_enum_PW_ERR_RATE_LIMIT_REACHED: pw_error_codes_enum = 65550;
+pub const pw_error_codes_enum_PW_ERR_ROOT_NOT_FOUND: pw_error_codes_enum = 65551;
+pub const pw_error_codes_enum_PW_ERR_NV_EMPTY: pw_error_codes_enum = 65552;
+pub const pw_error_codes_enum_PW_ERR_NV_LENGTH_MISMATCH: pw_error_codes_enum = 65553;
+pub const pw_error_codes_enum_PW_ERR_NV_VERSION_MISMATCH: pw_error_codes_enum = 65554;
+pub const pw_error_codes_enum_PW_ERR_PCR_NOT_MATCH: pw_error_codes_enum = 65555;
+pub const pw_error_codes_enum_PW_ERR_INTERNAL_FAILURE: pw_error_codes_enum = 65556;
+pub type pw_error_codes_enum = cty::c_uint;
+#[repr(C, packed)]
+#[derive(Debug, Copy, Clone)]
+pub struct bits_per_level_t {
+ pub v: u8,
+}
+#[test]
+fn bindgen_test_layout_bits_per_level_t() {
+ assert_eq!(
+ ::core::mem::size_of::<bits_per_level_t>(),
+ 1usize,
+ concat!("Size of: ", stringify!(bits_per_level_t))
+ );
+ assert_eq!(
+ ::core::mem::align_of::<bits_per_level_t>(),
+ 1usize,
+ concat!("Alignment of ", stringify!(bits_per_level_t))
+ );
+ assert_eq!(
+ unsafe { &(*(::core::ptr::null::<bits_per_level_t>())).v as *const _ as usize },
+ 0usize,
+ concat!(
+ "Offset of field: ",
+ stringify!(bits_per_level_t),
+ "::",
+ stringify!(v)
+ )
+ );
+}
+#[repr(C, packed)]
+#[derive(Debug, Copy, Clone)]
+pub struct height_t {
+ pub v: u8,
+}
+#[test]
+fn bindgen_test_layout_height_t() {
+ assert_eq!(
+ ::core::mem::size_of::<height_t>(),
+ 1usize,
+ concat!("Size of: ", stringify!(height_t))
+ );
+ assert_eq!(
+ ::core::mem::align_of::<height_t>(),
+ 1usize,
+ concat!("Alignment of ", stringify!(height_t))
+ );
+ assert_eq!(
+ unsafe { &(*(::core::ptr::null::<height_t>())).v as *const _ as usize },
+ 0usize,
+ concat!(
+ "Offset of field: ",
+ stringify!(height_t),
+ "::",
+ stringify!(v)
+ )
+ );
+}
+#[repr(C, packed)]
+#[derive(Debug, Copy, Clone)]
+pub struct index_t {
+ pub v: u8,
+}
+#[test]
+fn bindgen_test_layout_index_t() {
+ assert_eq!(
+ ::core::mem::size_of::<index_t>(),
+ 1usize,
+ concat!("Size of: ", stringify!(index_t))
+ );
+ assert_eq!(
+ ::core::mem::align_of::<index_t>(),
+ 1usize,
+ concat!("Alignment of ", stringify!(index_t))
+ );
+ assert_eq!(
+ unsafe { &(*(::core::ptr::null::<index_t>())).v as *const _ as usize },
+ 0usize,
+ concat!(
+ "Offset of field: ",
+ stringify!(index_t),
+ "::",
+ stringify!(v)
+ )
+ );
+}
+#[repr(C, packed)]
+#[derive(Debug, Copy, Clone)]
+pub struct label_t {
+ pub v: u64,
+}
+#[test]
+fn bindgen_test_layout_label_t() {
+ assert_eq!(
+ ::core::mem::size_of::<label_t>(),
+ 8usize,
+ concat!("Size of: ", stringify!(label_t))
+ );
+ assert_eq!(
+ ::core::mem::align_of::<label_t>(),
+ 1usize,
+ concat!("Alignment of ", stringify!(label_t))
+ );
+ assert_eq!(
+ unsafe { &(*(::core::ptr::null::<label_t>())).v as *const _ as usize },
+ 0usize,
+ concat!(
+ "Offset of field: ",
+ stringify!(label_t),
+ "::",
+ stringify!(v)
+ )
+ );
+}
+#[repr(C, packed)]
+#[derive(Debug, Copy, Clone)]
+pub struct attempt_count_t {
+ pub v: u32,
+}
+#[test]
+fn bindgen_test_layout_attempt_count_t() {
+ assert_eq!(
+ ::core::mem::size_of::<attempt_count_t>(),
+ 4usize,
+ concat!("Size of: ", stringify!(attempt_count_t))
+ );
+ assert_eq!(
+ ::core::mem::align_of::<attempt_count_t>(),
+ 1usize,
+ concat!("Alignment of ", stringify!(attempt_count_t))
+ );
+ assert_eq!(
+ unsafe { &(*(::core::ptr::null::<attempt_count_t>())).v as *const _ as usize },
+ 0usize,
+ concat!(
+ "Offset of field: ",
+ stringify!(attempt_count_t),
+ "::",
+ stringify!(v)
+ )
+ );
+}
+#[repr(C, packed)]
+#[derive(Debug, Copy, Clone)]
+pub struct pw_timestamp_t {
+ pub boot_count: u32,
+ pub timer_value: u64,
+}
+#[test]
+fn bindgen_test_layout_pw_timestamp_t() {
+ assert_eq!(
+ ::core::mem::size_of::<pw_timestamp_t>(),
+ 12usize,
+ concat!("Size of: ", stringify!(pw_timestamp_t))
+ );
+ assert_eq!(
+ ::core::mem::align_of::<pw_timestamp_t>(),
+ 1usize,
+ concat!("Alignment of ", stringify!(pw_timestamp_t))
+ );
+ assert_eq!(
+ unsafe { &(*(::core::ptr::null::<pw_timestamp_t>())).boot_count as *const _ as usize },
+ 0usize,
+ concat!(
+ "Offset of field: ",
+ stringify!(pw_timestamp_t),
+ "::",
+ stringify!(boot_count)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(::core::ptr::null::<pw_timestamp_t>())).timer_value as *const _ as usize },
+ 4usize,
+ concat!(
+ "Offset of field: ",
+ stringify!(pw_timestamp_t),
+ "::",
+ stringify!(timer_value)
+ )
+ );
+}
+#[repr(C, packed)]
+#[derive(Debug, Copy, Clone)]
+pub struct time_diff_t {
+ pub v: u32,
+}
+#[test]
+fn bindgen_test_layout_time_diff_t() {
+ assert_eq!(
+ ::core::mem::size_of::<time_diff_t>(),
+ 4usize,
+ concat!("Size of: ", stringify!(time_diff_t))
+ );
+ assert_eq!(
+ ::core::mem::align_of::<time_diff_t>(),
+ 1usize,
+ concat!("Alignment of ", stringify!(time_diff_t))
+ );
+ assert_eq!(
+ unsafe { &(*(::core::ptr::null::<time_diff_t>())).v as *const _ as usize },
+ 0usize,
+ concat!(
+ "Offset of field: ",
+ stringify!(time_diff_t),
+ "::",
+ stringify!(v)
+ )
+ );
+}
+#[repr(C, packed)]
+#[derive(Debug, Copy, Clone)]
+pub struct delay_schedule_entry_t {
+ pub attempt_count: attempt_count_t,
+ pub time_diff: time_diff_t,
+}
+#[test]
+fn bindgen_test_layout_delay_schedule_entry_t() {
+ assert_eq!(
+ ::core::mem::size_of::<delay_schedule_entry_t>(),
+ 8usize,
+ concat!("Size of: ", stringify!(delay_schedule_entry_t))
+ );
+ assert_eq!(
+ ::core::mem::align_of::<delay_schedule_entry_t>(),
+ 1usize,
+ concat!("Alignment of ", stringify!(delay_schedule_entry_t))
+ );
+ assert_eq!(
+ unsafe {
+ &(*(::core::ptr::null::<delay_schedule_entry_t>())).attempt_count as *const _ as usize
+ },
+ 0usize,
+ concat!(
+ "Offset of field: ",
+ stringify!(delay_schedule_entry_t),
+ "::",
+ stringify!(attempt_count)
+ )
+ );
+ assert_eq!(
+ unsafe {
+ &(*(::core::ptr::null::<delay_schedule_entry_t>())).time_diff as *const _ as usize
+ },
+ 4usize,
+ concat!(
+ "Offset of field: ",
+ stringify!(delay_schedule_entry_t),
+ "::",
+ stringify!(time_diff)
+ )
+ );
+}
+#[repr(C, packed)]
+#[derive(Debug, Copy, Clone)]
+pub struct valid_pcr_value_t {
+ pub bitmask: [u8; 2usize],
+ pub digest: [u8; 32usize],
+}
+#[test]
+fn bindgen_test_layout_valid_pcr_value_t() {
+ assert_eq!(
+ ::core::mem::size_of::<valid_pcr_value_t>(),
+ 34usize,
+ concat!("Size of: ", stringify!(valid_pcr_value_t))
+ );
+ assert_eq!(
+ ::core::mem::align_of::<valid_pcr_value_t>(),
+ 1usize,
+ concat!("Alignment of ", stringify!(valid_pcr_value_t))
+ );
+ assert_eq!(
+ unsafe { &(*(::core::ptr::null::<valid_pcr_value_t>())).bitmask as *const _ as usize },
+ 0usize,
+ concat!(
+ "Offset of field: ",
+ stringify!(valid_pcr_value_t),
+ "::",
+ stringify!(bitmask)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(::core::ptr::null::<valid_pcr_value_t>())).digest as *const _ as usize },
+ 2usize,
+ concat!(
+ "Offset of field: ",
+ stringify!(valid_pcr_value_t),
+ "::",
+ stringify!(digest)
+ )
+ );
+}
+#[repr(C, packed)]
+#[derive(Debug, Copy, Clone)]
+pub struct leaf_version_t {
+ pub minor: u16,
+ pub major: u16,
+}
+#[test]
+fn bindgen_test_layout_leaf_version_t() {
+ assert_eq!(
+ ::core::mem::size_of::<leaf_version_t>(),
+ 4usize,
+ concat!("Size of: ", stringify!(leaf_version_t))
+ );
+ assert_eq!(
+ ::core::mem::align_of::<leaf_version_t>(),
+ 1usize,
+ concat!("Alignment of ", stringify!(leaf_version_t))
+ );
+ assert_eq!(
+ unsafe { &(*(::core::ptr::null::<leaf_version_t>())).minor as *const _ as usize },
+ 0usize,
+ concat!(
+ "Offset of field: ",
+ stringify!(leaf_version_t),
+ "::",
+ stringify!(minor)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(::core::ptr::null::<leaf_version_t>())).major as *const _ as usize },
+ 2usize,
+ concat!(
+ "Offset of field: ",
+ stringify!(leaf_version_t),
+ "::",
+ stringify!(major)
+ )
+ );
+}
+#[repr(C, packed)]
+#[derive(Debug, Copy, Clone)]
+pub struct leaf_header_t {
+ pub leaf_version: leaf_version_t,
+ pub pub_len: u16,
+ pub sec_len: u16,
+}
+#[test]
+fn bindgen_test_layout_leaf_header_t() {
+ assert_eq!(
+ ::core::mem::size_of::<leaf_header_t>(),
+ 8usize,
+ concat!("Size of: ", stringify!(leaf_header_t))
+ );
+ assert_eq!(
+ ::core::mem::align_of::<leaf_header_t>(),
+ 1usize,
+ concat!("Alignment of ", stringify!(leaf_header_t))
+ );
+ assert_eq!(
+ unsafe { &(*(::core::ptr::null::<leaf_header_t>())).leaf_version as *const _ as usize },
+ 0usize,
+ concat!(
+ "Offset of field: ",
+ stringify!(leaf_header_t),
+ "::",
+ stringify!(leaf_version)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(::core::ptr::null::<leaf_header_t>())).pub_len as *const _ as usize },
+ 4usize,
+ concat!(
+ "Offset of field: ",
+ stringify!(leaf_header_t),
+ "::",
+ stringify!(pub_len)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(::core::ptr::null::<leaf_header_t>())).sec_len as *const _ as usize },
+ 6usize,
+ concat!(
+ "Offset of field: ",
+ stringify!(leaf_header_t),
+ "::",
+ stringify!(sec_len)
+ )
+ );
+}
+#[repr(C, packed)]
+#[derive(Debug, Copy, Clone)]
+pub struct leaf_public_data_t {
+ pub label: label_t,
+ pub delay_schedule: [delay_schedule_entry_t; 16usize],
+ pub timestamp: pw_timestamp_t,
+ pub attempt_count: attempt_count_t,
+ pub valid_pcr_criteria: [valid_pcr_value_t; 2usize],
+}
+#[test]
+fn bindgen_test_layout_leaf_public_data_t() {
+ assert_eq!(
+ ::core::mem::size_of::<leaf_public_data_t>(),
+ 220usize,
+ concat!("Size of: ", stringify!(leaf_public_data_t))
+ );
+ assert_eq!(
+ ::core::mem::align_of::<leaf_public_data_t>(),
+ 1usize,
+ concat!("Alignment of ", stringify!(leaf_public_data_t))
+ );
+ assert_eq!(
+ unsafe { &(*(::core::ptr::null::<leaf_public_data_t>())).label as *const _ as usize },
+ 0usize,
+ concat!(
+ "Offset of field: ",
+ stringify!(leaf_public_data_t),
+ "::",
+ stringify!(label)
+ )
+ );
+ assert_eq!(
+ unsafe {
+ &(*(::core::ptr::null::<leaf_public_data_t>())).delay_schedule as *const _ as usize
+ },
+ 8usize,
+ concat!(
+ "Offset of field: ",
+ stringify!(leaf_public_data_t),
+ "::",
+ stringify!(delay_schedule)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(::core::ptr::null::<leaf_public_data_t>())).timestamp as *const _ as usize },
+ 136usize,
+ concat!(
+ "Offset of field: ",
+ stringify!(leaf_public_data_t),
+ "::",
+ stringify!(timestamp)
+ )
+ );
+ assert_eq!(
+ unsafe {
+ &(*(::core::ptr::null::<leaf_public_data_t>())).attempt_count as *const _ as usize
+ },
+ 148usize,
+ concat!(
+ "Offset of field: ",
+ stringify!(leaf_public_data_t),
+ "::",
+ stringify!(attempt_count)
+ )
+ );
+ assert_eq!(
+ unsafe {
+ &(*(::core::ptr::null::<leaf_public_data_t>())).valid_pcr_criteria as *const _ as usize
+ },
+ 152usize,
+ concat!(
+ "Offset of field: ",
+ stringify!(leaf_public_data_t),
+ "::",
+ stringify!(valid_pcr_criteria)
+ )
+ );
+}
+#[repr(C, packed)]
+#[derive(Debug)]
+pub struct unimported_leaf_data_t {
+ pub head: leaf_header_t,
+ pub hmac: [u8; 32usize],
+ pub iv: [u8; 16usize],
+ pub payload: __IncompleteArrayField<u8>,
+}
+#[test]
+fn bindgen_test_layout_unimported_leaf_data_t() {
+ assert_eq!(
+ ::core::mem::size_of::<unimported_leaf_data_t>(),
+ 56usize,
+ concat!("Size of: ", stringify!(unimported_leaf_data_t))
+ );
+ assert_eq!(
+ ::core::mem::align_of::<unimported_leaf_data_t>(),
+ 1usize,
+ concat!("Alignment of ", stringify!(unimported_leaf_data_t))
+ );
+ assert_eq!(
+ unsafe { &(*(::core::ptr::null::<unimported_leaf_data_t>())).head as *const _ as usize },
+ 0usize,
+ concat!(
+ "Offset of field: ",
+ stringify!(unimported_leaf_data_t),
+ "::",
+ stringify!(head)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(::core::ptr::null::<unimported_leaf_data_t>())).hmac as *const _ as usize },
+ 8usize,
+ concat!(
+ "Offset of field: ",
+ stringify!(unimported_leaf_data_t),
+ "::",
+ stringify!(hmac)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(::core::ptr::null::<unimported_leaf_data_t>())).iv as *const _ as usize },
+ 40usize,
+ concat!(
+ "Offset of field: ",
+ stringify!(unimported_leaf_data_t),
+ "::",
+ stringify!(iv)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(::core::ptr::null::<unimported_leaf_data_t>())).payload as *const _ as usize },
+ 56usize,
+ concat!(
+ "Offset of field: ",
+ stringify!(unimported_leaf_data_t),
+ "::",
+ stringify!(payload)
+ )
+ );
+}
+pub const pw_message_type_enum_PW_MT_INVALID: pw_message_type_enum = 0;
+pub const pw_message_type_enum_PW_RESET_TREE: pw_message_type_enum = 1;
+pub const pw_message_type_enum_PW_INSERT_LEAF: pw_message_type_enum = 2;
+pub const pw_message_type_enum_PW_REMOVE_LEAF: pw_message_type_enum = 3;
+pub const pw_message_type_enum_PW_TRY_AUTH: pw_message_type_enum = 4;
+pub const pw_message_type_enum_PW_RESET_AUTH: pw_message_type_enum = 5;
+pub const pw_message_type_enum_PW_GET_LOG: pw_message_type_enum = 6;
+pub const pw_message_type_enum_PW_LOG_REPLAY: pw_message_type_enum = 7;
+pub type pw_message_type_enum = cty::c_uint;
+#[repr(C, packed)]
+#[derive(Debug, Copy, Clone)]
+pub struct pw_message_type_t {
+ pub v: u8,
+}
+#[test]
+fn bindgen_test_layout_pw_message_type_t() {
+ assert_eq!(
+ ::core::mem::size_of::<pw_message_type_t>(),
+ 1usize,
+ concat!("Size of: ", stringify!(pw_message_type_t))
+ );
+ assert_eq!(
+ ::core::mem::align_of::<pw_message_type_t>(),
+ 1usize,
+ concat!("Alignment of ", stringify!(pw_message_type_t))
+ );
+ assert_eq!(
+ unsafe { &(*(::core::ptr::null::<pw_message_type_t>())).v as *const _ as usize },
+ 0usize,
+ concat!(
+ "Offset of field: ",
+ stringify!(pw_message_type_t),
+ "::",
+ stringify!(v)
+ )
+ );
+}
+#[repr(C, packed)]
+#[derive(Debug, Copy, Clone)]
+pub struct pw_request_header_t {
+ pub version: u8,
+ pub type_: pw_message_type_t,
+ pub data_length: u16,
+}
+#[test]
+fn bindgen_test_layout_pw_request_header_t() {
+ assert_eq!(
+ ::core::mem::size_of::<pw_request_header_t>(),
+ 4usize,
+ concat!("Size of: ", stringify!(pw_request_header_t))
+ );
+ assert_eq!(
+ ::core::mem::align_of::<pw_request_header_t>(),
+ 1usize,
+ concat!("Alignment of ", stringify!(pw_request_header_t))
+ );
+ assert_eq!(
+ unsafe { &(*(::core::ptr::null::<pw_request_header_t>())).version as *const _ as usize },
+ 0usize,
+ concat!(
+ "Offset of field: ",
+ stringify!(pw_request_header_t),
+ "::",
+ stringify!(version)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(::core::ptr::null::<pw_request_header_t>())).type_ as *const _ as usize },
+ 1usize,
+ concat!(
+ "Offset of field: ",
+ stringify!(pw_request_header_t),
+ "::",
+ stringify!(type_)
+ )
+ );
+ assert_eq!(
+ unsafe {
+ &(*(::core::ptr::null::<pw_request_header_t>())).data_length as *const _ as usize
+ },
+ 2usize,
+ concat!(
+ "Offset of field: ",
+ stringify!(pw_request_header_t),
+ "::",
+ stringify!(data_length)
+ )
+ );
+}
+#[repr(C, packed)]
+#[derive(Debug, Copy, Clone)]
+pub struct pw_response_header_t {
+ pub version: u8,
+ pub data_length: u16,
+ pub result_code: u32,
+ pub root: [u8; 32usize],
+}
+#[test]
+fn bindgen_test_layout_pw_response_header_t() {
+ assert_eq!(
+ ::core::mem::size_of::<pw_response_header_t>(),
+ 39usize,
+ concat!("Size of: ", stringify!(pw_response_header_t))
+ );
+ assert_eq!(
+ ::core::mem::align_of::<pw_response_header_t>(),
+ 1usize,
+ concat!("Alignment of ", stringify!(pw_response_header_t))
+ );
+ assert_eq!(
+ unsafe { &(*(::core::ptr::null::<pw_response_header_t>())).version as *const _ as usize },
+ 0usize,
+ concat!(
+ "Offset of field: ",
+ stringify!(pw_response_header_t),
+ "::",
+ stringify!(version)
+ )
+ );
+ assert_eq!(
+ unsafe {
+ &(*(::core::ptr::null::<pw_response_header_t>())).data_length as *const _ as usize
+ },
+ 1usize,
+ concat!(
+ "Offset of field: ",
+ stringify!(pw_response_header_t),
+ "::",
+ stringify!(data_length)
+ )
+ );
+ assert_eq!(
+ unsafe {
+ &(*(::core::ptr::null::<pw_response_header_t>())).result_code as *const _ as usize
+ },
+ 3usize,
+ concat!(
+ "Offset of field: ",
+ stringify!(pw_response_header_t),
+ "::",
+ stringify!(result_code)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(::core::ptr::null::<pw_response_header_t>())).root as *const _ as usize },
+ 7usize,
+ concat!(
+ "Offset of field: ",
+ stringify!(pw_response_header_t),
+ "::",
+ stringify!(root)
+ )
+ );
+}
+#[repr(C, packed)]
+#[derive(Debug, Copy, Clone)]
+pub struct pw_request_reset_tree_t {
+ pub bits_per_level: bits_per_level_t,
+ pub height: height_t,
+}
+#[test]
+fn bindgen_test_layout_pw_request_reset_tree_t() {
+ assert_eq!(
+ ::core::mem::size_of::<pw_request_reset_tree_t>(),
+ 2usize,
+ concat!("Size of: ", stringify!(pw_request_reset_tree_t))
+ );
+ assert_eq!(
+ ::core::mem::align_of::<pw_request_reset_tree_t>(),
+ 1usize,
+ concat!("Alignment of ", stringify!(pw_request_reset_tree_t))
+ );
+ assert_eq!(
+ unsafe {
+ &(*(::core::ptr::null::<pw_request_reset_tree_t>())).bits_per_level as *const _ as usize
+ },
+ 0usize,
+ concat!(
+ "Offset of field: ",
+ stringify!(pw_request_reset_tree_t),
+ "::",
+ stringify!(bits_per_level)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(::core::ptr::null::<pw_request_reset_tree_t>())).height as *const _ as usize },
+ 1usize,
+ concat!(
+ "Offset of field: ",
+ stringify!(pw_request_reset_tree_t),
+ "::",
+ stringify!(height)
+ )
+ );
+}
+#[repr(C, packed)]
+#[derive(Debug)]
+pub struct pw_request_insert_leaf00_t {
+ pub label: label_t,
+ pub delay_schedule: [delay_schedule_entry_t; 16usize],
+ pub low_entropy_secret: [u8; 32usize],
+ pub high_entropy_secret: [u8; 32usize],
+ pub reset_secret: [u8; 32usize],
+ pub path_hashes: __IncompleteArrayField<[u8; 32usize]>,
+}
+#[test]
+fn bindgen_test_layout_pw_request_insert_leaf00_t() {
+ assert_eq!(
+ ::core::mem::size_of::<pw_request_insert_leaf00_t>(),
+ 232usize,
+ concat!("Size of: ", stringify!(pw_request_insert_leaf00_t))
+ );
+ assert_eq!(
+ ::core::mem::align_of::<pw_request_insert_leaf00_t>(),
+ 1usize,
+ concat!("Alignment of ", stringify!(pw_request_insert_leaf00_t))
+ );
+ assert_eq!(
+ unsafe {
+ &(*(::core::ptr::null::<pw_request_insert_leaf00_t>())).label as *const _ as usize
+ },
+ 0usize,
+ concat!(
+ "Offset of field: ",
+ stringify!(pw_request_insert_leaf00_t),
+ "::",
+ stringify!(label)
+ )
+ );
+ assert_eq!(
+ unsafe {
+ &(*(::core::ptr::null::<pw_request_insert_leaf00_t>())).delay_schedule as *const _
+ as usize
+ },
+ 8usize,
+ concat!(
+ "Offset of field: ",
+ stringify!(pw_request_insert_leaf00_t),
+ "::",
+ stringify!(delay_schedule)
+ )
+ );
+ assert_eq!(
+ unsafe {
+ &(*(::core::ptr::null::<pw_request_insert_leaf00_t>())).low_entropy_secret as *const _
+ as usize
+ },
+ 136usize,
+ concat!(
+ "Offset of field: ",
+ stringify!(pw_request_insert_leaf00_t),
+ "::",
+ stringify!(low_entropy_secret)
+ )
+ );
+ assert_eq!(
+ unsafe {
+ &(*(::core::ptr::null::<pw_request_insert_leaf00_t>())).high_entropy_secret as *const _
+ as usize
+ },
+ 168usize,
+ concat!(
+ "Offset of field: ",
+ stringify!(pw_request_insert_leaf00_t),
+ "::",
+ stringify!(high_entropy_secret)
+ )
+ );
+ assert_eq!(
+ unsafe {
+ &(*(::core::ptr::null::<pw_request_insert_leaf00_t>())).reset_secret as *const _
+ as usize
+ },
+ 200usize,
+ concat!(
+ "Offset of field: ",
+ stringify!(pw_request_insert_leaf00_t),
+ "::",
+ stringify!(reset_secret)
+ )
+ );
+ assert_eq!(
+ unsafe {
+ &(*(::core::ptr::null::<pw_request_insert_leaf00_t>())).path_hashes as *const _ as usize
+ },
+ 232usize,
+ concat!(
+ "Offset of field: ",
+ stringify!(pw_request_insert_leaf00_t),
+ "::",
+ stringify!(path_hashes)
+ )
+ );
+}
+#[repr(C, packed)]
+#[derive(Debug)]
+pub struct pw_request_insert_leaf_t {
+ pub label: label_t,
+ pub delay_schedule: [delay_schedule_entry_t; 16usize],
+ pub low_entropy_secret: [u8; 32usize],
+ pub high_entropy_secret: [u8; 32usize],
+ pub reset_secret: [u8; 32usize],
+ pub valid_pcr_criteria: [valid_pcr_value_t; 2usize],
+ pub path_hashes: __IncompleteArrayField<[u8; 32usize]>,
+}
+#[test]
+fn bindgen_test_layout_pw_request_insert_leaf_t() {
+ assert_eq!(
+ ::core::mem::size_of::<pw_request_insert_leaf_t>(),
+ 300usize,
+ concat!("Size of: ", stringify!(pw_request_insert_leaf_t))
+ );
+ assert_eq!(
+ ::core::mem::align_of::<pw_request_insert_leaf_t>(),
+ 1usize,
+ concat!("Alignment of ", stringify!(pw_request_insert_leaf_t))
+ );
+ assert_eq!(
+ unsafe { &(*(::core::ptr::null::<pw_request_insert_leaf_t>())).label as *const _ as usize },
+ 0usize,
+ concat!(
+ "Offset of field: ",
+ stringify!(pw_request_insert_leaf_t),
+ "::",
+ stringify!(label)
+ )
+ );
+ assert_eq!(
+ unsafe {
+ &(*(::core::ptr::null::<pw_request_insert_leaf_t>())).delay_schedule as *const _
+ as usize
+ },
+ 8usize,
+ concat!(
+ "Offset of field: ",
+ stringify!(pw_request_insert_leaf_t),
+ "::",
+ stringify!(delay_schedule)
+ )
+ );
+ assert_eq!(
+ unsafe {
+ &(*(::core::ptr::null::<pw_request_insert_leaf_t>())).low_entropy_secret as *const _
+ as usize
+ },
+ 136usize,
+ concat!(
+ "Offset of field: ",
+ stringify!(pw_request_insert_leaf_t),
+ "::",
+ stringify!(low_entropy_secret)
+ )
+ );
+ assert_eq!(
+ unsafe {
+ &(*(::core::ptr::null::<pw_request_insert_leaf_t>())).high_entropy_secret as *const _
+ as usize
+ },
+ 168usize,
+ concat!(
+ "Offset of field: ",
+ stringify!(pw_request_insert_leaf_t),
+ "::",
+ stringify!(high_entropy_secret)
+ )
+ );
+ assert_eq!(
+ unsafe {
+ &(*(::core::ptr::null::<pw_request_insert_leaf_t>())).reset_secret as *const _ as usize
+ },
+ 200usize,
+ concat!(
+ "Offset of field: ",
+ stringify!(pw_request_insert_leaf_t),
+ "::",
+ stringify!(reset_secret)
+ )
+ );
+ assert_eq!(
+ unsafe {
+ &(*(::core::ptr::null::<pw_request_insert_leaf_t>())).valid_pcr_criteria as *const _
+ as usize
+ },
+ 232usize,
+ concat!(
+ "Offset of field: ",
+ stringify!(pw_request_insert_leaf_t),
+ "::",
+ stringify!(valid_pcr_criteria)
+ )
+ );
+ assert_eq!(
+ unsafe {
+ &(*(::core::ptr::null::<pw_request_insert_leaf_t>())).path_hashes as *const _ as usize
+ },
+ 300usize,
+ concat!(
+ "Offset of field: ",
+ stringify!(pw_request_insert_leaf_t),
+ "::",
+ stringify!(path_hashes)
+ )
+ );
+}
+#[repr(C, packed)]
+#[derive(Debug)]
+pub struct pw_response_insert_leaf_t {
+ pub unimported_leaf_data: unimported_leaf_data_t,
+}
+#[test]
+fn bindgen_test_layout_pw_response_insert_leaf_t() {
+ assert_eq!(
+ ::core::mem::size_of::<pw_response_insert_leaf_t>(),
+ 56usize,
+ concat!("Size of: ", stringify!(pw_response_insert_leaf_t))
+ );
+ assert_eq!(
+ ::core::mem::align_of::<pw_response_insert_leaf_t>(),
+ 1usize,
+ concat!("Alignment of ", stringify!(pw_response_insert_leaf_t))
+ );
+ assert_eq!(
+ unsafe {
+ &(*(::core::ptr::null::<pw_response_insert_leaf_t>())).unimported_leaf_data as *const _
+ as usize
+ },
+ 0usize,
+ concat!(
+ "Offset of field: ",
+ stringify!(pw_response_insert_leaf_t),
+ "::",
+ stringify!(unimported_leaf_data)
+ )
+ );
+}
+#[repr(C, packed)]
+#[derive(Debug)]
+pub struct pw_request_remove_leaf_t {
+ pub leaf_location: label_t,
+ pub leaf_hmac: [u8; 32usize],
+ pub path_hashes: __IncompleteArrayField<[u8; 32usize]>,
+}
+#[test]
+fn bindgen_test_layout_pw_request_remove_leaf_t() {
+ assert_eq!(
+ ::core::mem::size_of::<pw_request_remove_leaf_t>(),
+ 40usize,
+ concat!("Size of: ", stringify!(pw_request_remove_leaf_t))
+ );
+ assert_eq!(
+ ::core::mem::align_of::<pw_request_remove_leaf_t>(),
+ 1usize,
+ concat!("Alignment of ", stringify!(pw_request_remove_leaf_t))
+ );
+ assert_eq!(
+ unsafe {
+ &(*(::core::ptr::null::<pw_request_remove_leaf_t>())).leaf_location as *const _ as usize
+ },
+ 0usize,
+ concat!(
+ "Offset of field: ",
+ stringify!(pw_request_remove_leaf_t),
+ "::",
+ stringify!(leaf_location)
+ )
+ );
+ assert_eq!(
+ unsafe {
+ &(*(::core::ptr::null::<pw_request_remove_leaf_t>())).leaf_hmac as *const _ as usize
+ },
+ 8usize,
+ concat!(
+ "Offset of field: ",
+ stringify!(pw_request_remove_leaf_t),
+ "::",
+ stringify!(leaf_hmac)
+ )
+ );
+ assert_eq!(
+ unsafe {
+ &(*(::core::ptr::null::<pw_request_remove_leaf_t>())).path_hashes as *const _ as usize
+ },
+ 40usize,
+ concat!(
+ "Offset of field: ",
+ stringify!(pw_request_remove_leaf_t),
+ "::",
+ stringify!(path_hashes)
+ )
+ );
+}
+#[repr(C, packed)]
+#[derive(Debug)]
+pub struct pw_request_try_auth_t {
+ pub low_entropy_secret: [u8; 32usize],
+ pub unimported_leaf_data: unimported_leaf_data_t,
+}
+#[test]
+fn bindgen_test_layout_pw_request_try_auth_t() {
+ assert_eq!(
+ ::core::mem::size_of::<pw_request_try_auth_t>(),
+ 88usize,
+ concat!("Size of: ", stringify!(pw_request_try_auth_t))
+ );
+ assert_eq!(
+ ::core::mem::align_of::<pw_request_try_auth_t>(),
+ 1usize,
+ concat!("Alignment of ", stringify!(pw_request_try_auth_t))
+ );
+ assert_eq!(
+ unsafe {
+ &(*(::core::ptr::null::<pw_request_try_auth_t>())).low_entropy_secret as *const _
+ as usize
+ },
+ 0usize,
+ concat!(
+ "Offset of field: ",
+ stringify!(pw_request_try_auth_t),
+ "::",
+ stringify!(low_entropy_secret)
+ )
+ );
+ assert_eq!(
+ unsafe {
+ &(*(::core::ptr::null::<pw_request_try_auth_t>())).unimported_leaf_data as *const _
+ as usize
+ },
+ 32usize,
+ concat!(
+ "Offset of field: ",
+ stringify!(pw_request_try_auth_t),
+ "::",
+ stringify!(unimported_leaf_data)
+ )
+ );
+}
+#[repr(C, packed)]
+#[derive(Debug)]
+pub struct pw_response_try_auth00_t {
+ pub seconds_to_wait: time_diff_t,
+ pub high_entropy_secret: [u8; 32usize],
+ pub unimported_leaf_data: unimported_leaf_data_t,
+}
+#[test]
+fn bindgen_test_layout_pw_response_try_auth00_t() {
+ assert_eq!(
+ ::core::mem::size_of::<pw_response_try_auth00_t>(),
+ 92usize,
+ concat!("Size of: ", stringify!(pw_response_try_auth00_t))
+ );
+ assert_eq!(
+ ::core::mem::align_of::<pw_response_try_auth00_t>(),
+ 1usize,
+ concat!("Alignment of ", stringify!(pw_response_try_auth00_t))
+ );
+ assert_eq!(
+ unsafe {
+ &(*(::core::ptr::null::<pw_response_try_auth00_t>())).seconds_to_wait as *const _
+ as usize
+ },
+ 0usize,
+ concat!(
+ "Offset of field: ",
+ stringify!(pw_response_try_auth00_t),
+ "::",
+ stringify!(seconds_to_wait)
+ )
+ );
+ assert_eq!(
+ unsafe {
+ &(*(::core::ptr::null::<pw_response_try_auth00_t>())).high_entropy_secret as *const _
+ as usize
+ },
+ 4usize,
+ concat!(
+ "Offset of field: ",
+ stringify!(pw_response_try_auth00_t),
+ "::",
+ stringify!(high_entropy_secret)
+ )
+ );
+ assert_eq!(
+ unsafe {
+ &(*(::core::ptr::null::<pw_response_try_auth00_t>())).unimported_leaf_data as *const _
+ as usize
+ },
+ 36usize,
+ concat!(
+ "Offset of field: ",
+ stringify!(pw_response_try_auth00_t),
+ "::",
+ stringify!(unimported_leaf_data)
+ )
+ );
+}
+#[repr(C, packed)]
+#[derive(Debug)]
+pub struct pw_response_try_auth_t {
+ pub seconds_to_wait: time_diff_t,
+ pub high_entropy_secret: [u8; 32usize],
+ pub reset_secret: [u8; 32usize],
+ pub unimported_leaf_data: unimported_leaf_data_t,
+}
+#[test]
+fn bindgen_test_layout_pw_response_try_auth_t() {
+ assert_eq!(
+ ::core::mem::size_of::<pw_response_try_auth_t>(),
+ 124usize,
+ concat!("Size of: ", stringify!(pw_response_try_auth_t))
+ );
+ assert_eq!(
+ ::core::mem::align_of::<pw_response_try_auth_t>(),
+ 1usize,
+ concat!("Alignment of ", stringify!(pw_response_try_auth_t))
+ );
+ assert_eq!(
+ unsafe {
+ &(*(::core::ptr::null::<pw_response_try_auth_t>())).seconds_to_wait as *const _ as usize
+ },
+ 0usize,
+ concat!(
+ "Offset of field: ",
+ stringify!(pw_response_try_auth_t),
+ "::",
+ stringify!(seconds_to_wait)
+ )
+ );
+ assert_eq!(
+ unsafe {
+ &(*(::core::ptr::null::<pw_response_try_auth_t>())).high_entropy_secret as *const _
+ as usize
+ },
+ 4usize,
+ concat!(
+ "Offset of field: ",
+ stringify!(pw_response_try_auth_t),
+ "::",
+ stringify!(high_entropy_secret)
+ )
+ );
+ assert_eq!(
+ unsafe {
+ &(*(::core::ptr::null::<pw_response_try_auth_t>())).reset_secret as *const _ as usize
+ },
+ 36usize,
+ concat!(
+ "Offset of field: ",
+ stringify!(pw_response_try_auth_t),
+ "::",
+ stringify!(reset_secret)
+ )
+ );
+ assert_eq!(
+ unsafe {
+ &(*(::core::ptr::null::<pw_response_try_auth_t>())).unimported_leaf_data as *const _
+ as usize
+ },
+ 68usize,
+ concat!(
+ "Offset of field: ",
+ stringify!(pw_response_try_auth_t),
+ "::",
+ stringify!(unimported_leaf_data)
+ )
+ );
+}
+#[repr(C, packed)]
+#[derive(Debug)]
+pub struct pw_request_reset_auth_t {
+ pub reset_secret: [u8; 32usize],
+ pub unimported_leaf_data: unimported_leaf_data_t,
+}
+#[test]
+fn bindgen_test_layout_pw_request_reset_auth_t() {
+ assert_eq!(
+ ::core::mem::size_of::<pw_request_reset_auth_t>(),
+ 88usize,
+ concat!("Size of: ", stringify!(pw_request_reset_auth_t))
+ );
+ assert_eq!(
+ ::core::mem::align_of::<pw_request_reset_auth_t>(),
+ 1usize,
+ concat!("Alignment of ", stringify!(pw_request_reset_auth_t))
+ );
+ assert_eq!(
+ unsafe {
+ &(*(::core::ptr::null::<pw_request_reset_auth_t>())).reset_secret as *const _ as usize
+ },
+ 0usize,
+ concat!(
+ "Offset of field: ",
+ stringify!(pw_request_reset_auth_t),
+ "::",
+ stringify!(reset_secret)
+ )
+ );
+ assert_eq!(
+ unsafe {
+ &(*(::core::ptr::null::<pw_request_reset_auth_t>())).unimported_leaf_data as *const _
+ as usize
+ },
+ 32usize,
+ concat!(
+ "Offset of field: ",
+ stringify!(pw_request_reset_auth_t),
+ "::",
+ stringify!(unimported_leaf_data)
+ )
+ );
+}
+#[repr(C, packed)]
+#[derive(Debug)]
+pub struct pw_response_reset_auth_t {
+ pub high_entropy_secret: [u8; 32usize],
+ pub unimported_leaf_data: unimported_leaf_data_t,
+}
+#[test]
+fn bindgen_test_layout_pw_response_reset_auth_t() {
+ assert_eq!(
+ ::core::mem::size_of::<pw_response_reset_auth_t>(),
+ 88usize,
+ concat!("Size of: ", stringify!(pw_response_reset_auth_t))
+ );
+ assert_eq!(
+ ::core::mem::align_of::<pw_response_reset_auth_t>(),
+ 1usize,
+ concat!("Alignment of ", stringify!(pw_response_reset_auth_t))
+ );
+ assert_eq!(
+ unsafe {
+ &(*(::core::ptr::null::<pw_response_reset_auth_t>())).high_entropy_secret as *const _
+ as usize
+ },
+ 0usize,
+ concat!(
+ "Offset of field: ",
+ stringify!(pw_response_reset_auth_t),
+ "::",
+ stringify!(high_entropy_secret)
+ )
+ );
+ assert_eq!(
+ unsafe {
+ &(*(::core::ptr::null::<pw_response_reset_auth_t>())).unimported_leaf_data as *const _
+ as usize
+ },
+ 32usize,
+ concat!(
+ "Offset of field: ",
+ stringify!(pw_response_reset_auth_t),
+ "::",
+ stringify!(unimported_leaf_data)
+ )
+ );
+}
+#[repr(C, packed)]
+#[derive(Debug, Copy, Clone)]
+pub struct pw_request_get_log_t {
+ pub root: [u8; 32usize],
+}
+#[test]
+fn bindgen_test_layout_pw_request_get_log_t() {
+ assert_eq!(
+ ::core::mem::size_of::<pw_request_get_log_t>(),
+ 32usize,
+ concat!("Size of: ", stringify!(pw_request_get_log_t))
+ );
+ assert_eq!(
+ ::core::mem::align_of::<pw_request_get_log_t>(),
+ 1usize,
+ concat!("Alignment of ", stringify!(pw_request_get_log_t))
+ );
+ assert_eq!(
+ unsafe { &(*(::core::ptr::null::<pw_request_get_log_t>())).root as *const _ as usize },
+ 0usize,
+ concat!(
+ "Offset of field: ",
+ stringify!(pw_request_get_log_t),
+ "::",
+ stringify!(root)
+ )
+ );
+}
+#[repr(C, packed)]
+#[derive(Debug)]
+pub struct pw_request_log_replay_t {
+ pub log_root: [u8; 32usize],
+ pub unimported_leaf_data: unimported_leaf_data_t,
+}
+#[test]
+fn bindgen_test_layout_pw_request_log_replay_t() {
+ assert_eq!(
+ ::core::mem::size_of::<pw_request_log_replay_t>(),
+ 88usize,
+ concat!("Size of: ", stringify!(pw_request_log_replay_t))
+ );
+ assert_eq!(
+ ::core::mem::align_of::<pw_request_log_replay_t>(),
+ 1usize,
+ concat!("Alignment of ", stringify!(pw_request_log_replay_t))
+ );
+ assert_eq!(
+ unsafe {
+ &(*(::core::ptr::null::<pw_request_log_replay_t>())).log_root as *const _ as usize
+ },
+ 0usize,
+ concat!(
+ "Offset of field: ",
+ stringify!(pw_request_log_replay_t),
+ "::",
+ stringify!(log_root)
+ )
+ );
+ assert_eq!(
+ unsafe {
+ &(*(::core::ptr::null::<pw_request_log_replay_t>())).unimported_leaf_data as *const _
+ as usize
+ },
+ 32usize,
+ concat!(
+ "Offset of field: ",
+ stringify!(pw_request_log_replay_t),
+ "::",
+ stringify!(unimported_leaf_data)
+ )
+ );
+}
+#[repr(C, packed)]
+#[derive(Debug)]
+pub struct pw_response_log_replay_t {
+ pub unimported_leaf_data: unimported_leaf_data_t,
+}
+#[test]
+fn bindgen_test_layout_pw_response_log_replay_t() {
+ assert_eq!(
+ ::core::mem::size_of::<pw_response_log_replay_t>(),
+ 56usize,
+ concat!("Size of: ", stringify!(pw_response_log_replay_t))
+ );
+ assert_eq!(
+ ::core::mem::align_of::<pw_response_log_replay_t>(),
+ 1usize,
+ concat!("Alignment of ", stringify!(pw_response_log_replay_t))
+ );
+ assert_eq!(
+ unsafe {
+ &(*(::core::ptr::null::<pw_response_log_replay_t>())).unimported_leaf_data as *const _
+ as usize
+ },
+ 0usize,
+ concat!(
+ "Offset of field: ",
+ stringify!(pw_response_log_replay_t),
+ "::",
+ stringify!(unimported_leaf_data)
+ )
+ );
+}
+#[repr(C, packed)]
+#[derive(Copy, Clone)]
+pub struct pw_get_log_entry_t {
+ pub root: [u8; 32usize],
+ pub label: label_t,
+ pub type_: pw_message_type_t,
+ pub __bindgen_anon_1: pw_get_log_entry_t__bindgen_ty_1,
+}
+#[repr(C)]
+#[derive(Copy, Clone)]
+pub union pw_get_log_entry_t__bindgen_ty_1 {
+ pub leaf_hmac: [u8; 32usize],
+ pub __bindgen_anon_1: pw_get_log_entry_t__bindgen_ty_1__bindgen_ty_1,
+}
+#[repr(C, packed)]
+#[derive(Debug, Copy, Clone)]
+pub struct pw_get_log_entry_t__bindgen_ty_1__bindgen_ty_1 {
+ pub timestamp: pw_timestamp_t,
+ pub return_code: i32,
+}
+#[test]
+fn bindgen_test_layout_pw_get_log_entry_t__bindgen_ty_1__bindgen_ty_1() {
+ assert_eq!(
+ ::core::mem::size_of::<pw_get_log_entry_t__bindgen_ty_1__bindgen_ty_1>(),
+ 16usize,
+ concat!(
+ "Size of: ",
+ stringify!(pw_get_log_entry_t__bindgen_ty_1__bindgen_ty_1)
+ )
+ );
+ assert_eq!(
+ ::core::mem::align_of::<pw_get_log_entry_t__bindgen_ty_1__bindgen_ty_1>(),
+ 1usize,
+ concat!(
+ "Alignment of ",
+ stringify!(pw_get_log_entry_t__bindgen_ty_1__bindgen_ty_1)
+ )
+ );
+ assert_eq!(
+ unsafe {
+ &(*(::core::ptr::null::<pw_get_log_entry_t__bindgen_ty_1__bindgen_ty_1>())).timestamp
+ as *const _ as usize
+ },
+ 0usize,
+ concat!(
+ "Offset of field: ",
+ stringify!(pw_get_log_entry_t__bindgen_ty_1__bindgen_ty_1),
+ "::",
+ stringify!(timestamp)
+ )
+ );
+ assert_eq!(
+ unsafe {
+ &(*(::core::ptr::null::<pw_get_log_entry_t__bindgen_ty_1__bindgen_ty_1>())).return_code
+ as *const _ as usize
+ },
+ 12usize,
+ concat!(
+ "Offset of field: ",
+ stringify!(pw_get_log_entry_t__bindgen_ty_1__bindgen_ty_1),
+ "::",
+ stringify!(return_code)
+ )
+ );
+}
+#[test]
+fn bindgen_test_layout_pw_get_log_entry_t__bindgen_ty_1() {
+ assert_eq!(
+ ::core::mem::size_of::<pw_get_log_entry_t__bindgen_ty_1>(),
+ 32usize,
+ concat!("Size of: ", stringify!(pw_get_log_entry_t__bindgen_ty_1))
+ );
+ assert_eq!(
+ ::core::mem::align_of::<pw_get_log_entry_t__bindgen_ty_1>(),
+ 1usize,
+ concat!(
+ "Alignment of ",
+ stringify!(pw_get_log_entry_t__bindgen_ty_1)
+ )
+ );
+ assert_eq!(
+ unsafe {
+ &(*(::core::ptr::null::<pw_get_log_entry_t__bindgen_ty_1>())).leaf_hmac as *const _
+ as usize
+ },
+ 0usize,
+ concat!(
+ "Offset of field: ",
+ stringify!(pw_get_log_entry_t__bindgen_ty_1),
+ "::",
+ stringify!(leaf_hmac)
+ )
+ );
+}
+#[test]
+fn bindgen_test_layout_pw_get_log_entry_t() {
+ assert_eq!(
+ ::core::mem::size_of::<pw_get_log_entry_t>(),
+ 73usize,
+ concat!("Size of: ", stringify!(pw_get_log_entry_t))
+ );
+ assert_eq!(
+ ::core::mem::align_of::<pw_get_log_entry_t>(),
+ 1usize,
+ concat!("Alignment of ", stringify!(pw_get_log_entry_t))
+ );
+ assert_eq!(
+ unsafe { &(*(::core::ptr::null::<pw_get_log_entry_t>())).root as *const _ as usize },
+ 0usize,
+ concat!(
+ "Offset of field: ",
+ stringify!(pw_get_log_entry_t),
+ "::",
+ stringify!(root)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(::core::ptr::null::<pw_get_log_entry_t>())).label as *const _ as usize },
+ 32usize,
+ concat!(
+ "Offset of field: ",
+ stringify!(pw_get_log_entry_t),
+ "::",
+ stringify!(label)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(::core::ptr::null::<pw_get_log_entry_t>())).type_ as *const _ as usize },
+ 40usize,
+ concat!(
+ "Offset of field: ",
+ stringify!(pw_get_log_entry_t),
+ "::",
+ stringify!(type_)
+ )
+ );
+}
+#[repr(C, packed)]
+pub struct pw_request_t {
+ pub header: pw_request_header_t,
+ pub data: pw_request_t__bindgen_ty_1,
+}
+#[repr(C)]
+pub struct pw_request_t__bindgen_ty_1 {
+ pub reset_tree: __BindgenUnionField<pw_request_reset_tree_t>,
+ pub insert_leaf00: __BindgenUnionField<pw_request_insert_leaf00_t>,
+ pub insert_leaf: __BindgenUnionField<pw_request_insert_leaf_t>,
+ pub remove_leaf: __BindgenUnionField<pw_request_remove_leaf_t>,
+ pub try_auth: __BindgenUnionField<pw_request_try_auth_t>,
+ pub reset_auth: __BindgenUnionField<pw_request_reset_auth_t>,
+ pub get_log: __BindgenUnionField<pw_request_get_log_t>,
+ pub log_replay: __BindgenUnionField<pw_request_log_replay_t>,
+ pub bindgen_union_field: [u8; 300usize],
+}
+#[test]
+fn bindgen_test_layout_pw_request_t__bindgen_ty_1() {
+ assert_eq!(
+ ::core::mem::size_of::<pw_request_t__bindgen_ty_1>(),
+ 300usize,
+ concat!("Size of: ", stringify!(pw_request_t__bindgen_ty_1))
+ );
+ assert_eq!(
+ ::core::mem::align_of::<pw_request_t__bindgen_ty_1>(),
+ 1usize,
+ concat!("Alignment of ", stringify!(pw_request_t__bindgen_ty_1))
+ );
+ assert_eq!(
+ unsafe {
+ &(*(::core::ptr::null::<pw_request_t__bindgen_ty_1>())).reset_tree as *const _ as usize
+ },
+ 0usize,
+ concat!(
+ "Offset of field: ",
+ stringify!(pw_request_t__bindgen_ty_1),
+ "::",
+ stringify!(reset_tree)
+ )
+ );
+ assert_eq!(
+ unsafe {
+ &(*(::core::ptr::null::<pw_request_t__bindgen_ty_1>())).insert_leaf00 as *const _
+ as usize
+ },
+ 0usize,
+ concat!(
+ "Offset of field: ",
+ stringify!(pw_request_t__bindgen_ty_1),
+ "::",
+ stringify!(insert_leaf00)
+ )
+ );
+ assert_eq!(
+ unsafe {
+ &(*(::core::ptr::null::<pw_request_t__bindgen_ty_1>())).insert_leaf as *const _ as usize
+ },
+ 0usize,
+ concat!(
+ "Offset of field: ",
+ stringify!(pw_request_t__bindgen_ty_1),
+ "::",
+ stringify!(insert_leaf)
+ )
+ );
+ assert_eq!(
+ unsafe {
+ &(*(::core::ptr::null::<pw_request_t__bindgen_ty_1>())).remove_leaf as *const _ as usize
+ },
+ 0usize,
+ concat!(
+ "Offset of field: ",
+ stringify!(pw_request_t__bindgen_ty_1),
+ "::",
+ stringify!(remove_leaf)
+ )
+ );
+ assert_eq!(
+ unsafe {
+ &(*(::core::ptr::null::<pw_request_t__bindgen_ty_1>())).try_auth as *const _ as usize
+ },
+ 0usize,
+ concat!(
+ "Offset of field: ",
+ stringify!(pw_request_t__bindgen_ty_1),
+ "::",
+ stringify!(try_auth)
+ )
+ );
+ assert_eq!(
+ unsafe {
+ &(*(::core::ptr::null::<pw_request_t__bindgen_ty_1>())).reset_auth as *const _ as usize
+ },
+ 0usize,
+ concat!(
+ "Offset of field: ",
+ stringify!(pw_request_t__bindgen_ty_1),
+ "::",
+ stringify!(reset_auth)
+ )
+ );
+ assert_eq!(
+ unsafe {
+ &(*(::core::ptr::null::<pw_request_t__bindgen_ty_1>())).get_log as *const _ as usize
+ },
+ 0usize,
+ concat!(
+ "Offset of field: ",
+ stringify!(pw_request_t__bindgen_ty_1),
+ "::",
+ stringify!(get_log)
+ )
+ );
+ assert_eq!(
+ unsafe {
+ &(*(::core::ptr::null::<pw_request_t__bindgen_ty_1>())).log_replay as *const _ as usize
+ },
+ 0usize,
+ concat!(
+ "Offset of field: ",
+ stringify!(pw_request_t__bindgen_ty_1),
+ "::",
+ stringify!(log_replay)
+ )
+ );
+}
+#[test]
+fn bindgen_test_layout_pw_request_t() {
+ assert_eq!(
+ ::core::mem::size_of::<pw_request_t>(),
+ 304usize,
+ concat!("Size of: ", stringify!(pw_request_t))
+ );
+ assert_eq!(
+ ::core::mem::align_of::<pw_request_t>(),
+ 1usize,
+ concat!("Alignment of ", stringify!(pw_request_t))
+ );
+ assert_eq!(
+ unsafe { &(*(::core::ptr::null::<pw_request_t>())).header as *const _ as usize },
+ 0usize,
+ concat!(
+ "Offset of field: ",
+ stringify!(pw_request_t),
+ "::",
+ stringify!(header)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(::core::ptr::null::<pw_request_t>())).data as *const _ as usize },
+ 4usize,
+ concat!(
+ "Offset of field: ",
+ stringify!(pw_request_t),
+ "::",
+ stringify!(data)
+ )
+ );
+}
+#[repr(C, packed)]
+pub struct pw_response_t {
+ pub header: pw_response_header_t,
+ pub data: pw_response_t__bindgen_ty_1,
+}
+#[repr(C)]
+pub struct pw_response_t__bindgen_ty_1 {
+ pub insert_leaf: __BindgenUnionField<pw_response_insert_leaf_t>,
+ pub try_auth00: __BindgenUnionField<pw_response_try_auth00_t>,
+ pub try_auth: __BindgenUnionField<pw_response_try_auth_t>,
+ pub reset_auth: __BindgenUnionField<pw_response_reset_auth_t>,
+ pub get_log: __BindgenUnionField<[u8; 0usize]>,
+ pub log_replay: __BindgenUnionField<pw_response_log_replay_t>,
+ pub bindgen_union_field: [u8; 124usize],
+}
+#[test]
+fn bindgen_test_layout_pw_response_t__bindgen_ty_1() {
+ assert_eq!(
+ ::core::mem::size_of::<pw_response_t__bindgen_ty_1>(),
+ 124usize,
+ concat!("Size of: ", stringify!(pw_response_t__bindgen_ty_1))
+ );
+ assert_eq!(
+ ::core::mem::align_of::<pw_response_t__bindgen_ty_1>(),
+ 1usize,
+ concat!("Alignment of ", stringify!(pw_response_t__bindgen_ty_1))
+ );
+ assert_eq!(
+ unsafe {
+ &(*(::core::ptr::null::<pw_response_t__bindgen_ty_1>())).insert_leaf as *const _
+ as usize
+ },
+ 0usize,
+ concat!(
+ "Offset of field: ",
+ stringify!(pw_response_t__bindgen_ty_1),
+ "::",
+ stringify!(insert_leaf)
+ )
+ );
+ assert_eq!(
+ unsafe {
+ &(*(::core::ptr::null::<pw_response_t__bindgen_ty_1>())).try_auth00 as *const _ as usize
+ },
+ 0usize,
+ concat!(
+ "Offset of field: ",
+ stringify!(pw_response_t__bindgen_ty_1),
+ "::",
+ stringify!(try_auth00)
+ )
+ );
+ assert_eq!(
+ unsafe {
+ &(*(::core::ptr::null::<pw_response_t__bindgen_ty_1>())).try_auth as *const _ as usize
+ },
+ 0usize,
+ concat!(
+ "Offset of field: ",
+ stringify!(pw_response_t__bindgen_ty_1),
+ "::",
+ stringify!(try_auth)
+ )
+ );
+ assert_eq!(
+ unsafe {
+ &(*(::core::ptr::null::<pw_response_t__bindgen_ty_1>())).reset_auth as *const _ as usize
+ },
+ 0usize,
+ concat!(
+ "Offset of field: ",
+ stringify!(pw_response_t__bindgen_ty_1),
+ "::",
+ stringify!(reset_auth)
+ )
+ );
+ assert_eq!(
+ unsafe {
+ &(*(::core::ptr::null::<pw_response_t__bindgen_ty_1>())).get_log as *const _ as usize
+ },
+ 0usize,
+ concat!(
+ "Offset of field: ",
+ stringify!(pw_response_t__bindgen_ty_1),
+ "::",
+ stringify!(get_log)
+ )
+ );
+ assert_eq!(
+ unsafe {
+ &(*(::core::ptr::null::<pw_response_t__bindgen_ty_1>())).log_replay as *const _ as usize
+ },
+ 0usize,
+ concat!(
+ "Offset of field: ",
+ stringify!(pw_response_t__bindgen_ty_1),
+ "::",
+ stringify!(log_replay)
+ )
+ );
+}
+#[test]
+fn bindgen_test_layout_pw_response_t() {
+ assert_eq!(
+ ::core::mem::size_of::<pw_response_t>(),
+ 163usize,
+ concat!("Size of: ", stringify!(pw_response_t))
+ );
+ assert_eq!(
+ ::core::mem::align_of::<pw_response_t>(),
+ 1usize,
+ concat!("Alignment of ", stringify!(pw_response_t))
+ );
+ assert_eq!(
+ unsafe { &(*(::core::ptr::null::<pw_response_t>())).header as *const _ as usize },
+ 0usize,
+ concat!(
+ "Offset of field: ",
+ stringify!(pw_response_t),
+ "::",
+ stringify!(header)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(::core::ptr::null::<pw_response_t>())).data as *const _ as usize },
+ 39usize,
+ concat!(
+ "Offset of field: ",
+ stringify!(pw_response_t),
+ "::",
+ stringify!(data)
+ )
+ );
+}
+#[repr(C)]
+#[repr(align(4))]
+#[derive(Debug, Copy, Clone)]
+pub struct merkle_tree_t {
+ pub bits_per_level: bits_per_level_t,
+ pub height: height_t,
+ pub root: [u8; 32usize],
+ pub key_derivation_nonce: [u8; 16usize],
+ pub __bindgen_padding_0: [u8; 2usize],
+ pub hmac_key: [u8; 32usize],
+ pub wrap_key: [u8; 32usize],
+}
+#[test]
+fn bindgen_test_layout_merkle_tree_t() {
+ assert_eq!(
+ ::core::mem::size_of::<merkle_tree_t>(),
+ 116usize,
+ concat!("Size of: ", stringify!(merkle_tree_t))
+ );
+ assert_eq!(
+ ::core::mem::align_of::<merkle_tree_t>(),
+ 4usize,
+ concat!("Alignment of ", stringify!(merkle_tree_t))
+ );
+ assert_eq!(
+ unsafe { &(*(::core::ptr::null::<merkle_tree_t>())).bits_per_level as *const _ as usize },
+ 0usize,
+ concat!(
+ "Offset of field: ",
+ stringify!(merkle_tree_t),
+ "::",
+ stringify!(bits_per_level)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(::core::ptr::null::<merkle_tree_t>())).height as *const _ as usize },
+ 1usize,
+ concat!(
+ "Offset of field: ",
+ stringify!(merkle_tree_t),
+ "::",
+ stringify!(height)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(::core::ptr::null::<merkle_tree_t>())).root as *const _ as usize },
+ 2usize,
+ concat!(
+ "Offset of field: ",
+ stringify!(merkle_tree_t),
+ "::",
+ stringify!(root)
+ )
+ );
+ assert_eq!(
+ unsafe {
+ &(*(::core::ptr::null::<merkle_tree_t>())).key_derivation_nonce as *const _ as usize
+ },
+ 34usize,
+ concat!(
+ "Offset of field: ",
+ stringify!(merkle_tree_t),
+ "::",
+ stringify!(key_derivation_nonce)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(::core::ptr::null::<merkle_tree_t>())).hmac_key as *const _ as usize },
+ 52usize,
+ concat!(
+ "Offset of field: ",
+ stringify!(merkle_tree_t),
+ "::",
+ stringify!(hmac_key)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(::core::ptr::null::<merkle_tree_t>())).wrap_key as *const _ as usize },
+ 84usize,
+ concat!(
+ "Offset of field: ",
+ stringify!(merkle_tree_t),
+ "::",
+ stringify!(wrap_key)
+ )
+ );
+}
+#[repr(C, packed)]
+#[derive(Debug, Copy, Clone)]
+pub struct pw_long_term_storage_t {
+ pub storage_version: u16,
+ pub bits_per_level: bits_per_level_t,
+ pub height: height_t,
+ pub key_derivation_nonce: [u8; 16usize],
+}
+#[test]
+fn bindgen_test_layout_pw_long_term_storage_t() {
+ assert_eq!(
+ ::core::mem::size_of::<pw_long_term_storage_t>(),
+ 20usize,
+ concat!("Size of: ", stringify!(pw_long_term_storage_t))
+ );
+ assert_eq!(
+ ::core::mem::align_of::<pw_long_term_storage_t>(),
+ 1usize,
+ concat!("Alignment of ", stringify!(pw_long_term_storage_t))
+ );
+ assert_eq!(
+ unsafe {
+ &(*(::core::ptr::null::<pw_long_term_storage_t>())).storage_version as *const _ as usize
+ },
+ 0usize,
+ concat!(
+ "Offset of field: ",
+ stringify!(pw_long_term_storage_t),
+ "::",
+ stringify!(storage_version)
+ )
+ );
+ assert_eq!(
+ unsafe {
+ &(*(::core::ptr::null::<pw_long_term_storage_t>())).bits_per_level as *const _ as usize
+ },
+ 2usize,
+ concat!(
+ "Offset of field: ",
+ stringify!(pw_long_term_storage_t),
+ "::",
+ stringify!(bits_per_level)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(::core::ptr::null::<pw_long_term_storage_t>())).height as *const _ as usize },
+ 3usize,
+ concat!(
+ "Offset of field: ",
+ stringify!(pw_long_term_storage_t),
+ "::",
+ stringify!(height)
+ )
+ );
+ assert_eq!(
+ unsafe {
+ &(*(::core::ptr::null::<pw_long_term_storage_t>())).key_derivation_nonce as *const _
+ as usize
+ },
+ 4usize,
+ concat!(
+ "Offset of field: ",
+ stringify!(pw_long_term_storage_t),
+ "::",
+ stringify!(key_derivation_nonce)
+ )
+ );
+}
+#[repr(C, packed)]
+#[derive(Copy, Clone)]
+pub struct pw_log_storage_t {
+ pub storage_version: u16,
+ pub restart_count: u32,
+ pub entries: [pw_get_log_entry_t; 2usize],
+}
+#[test]
+fn bindgen_test_layout_pw_log_storage_t() {
+ assert_eq!(
+ ::core::mem::size_of::<pw_log_storage_t>(),
+ 152usize,
+ concat!("Size of: ", stringify!(pw_log_storage_t))
+ );
+ assert_eq!(
+ ::core::mem::align_of::<pw_log_storage_t>(),
+ 1usize,
+ concat!("Alignment of ", stringify!(pw_log_storage_t))
+ );
+ assert_eq!(
+ unsafe {
+ &(*(::core::ptr::null::<pw_log_storage_t>())).storage_version as *const _ as usize
+ },
+ 0usize,
+ concat!(
+ "Offset of field: ",
+ stringify!(pw_log_storage_t),
+ "::",
+ stringify!(storage_version)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(::core::ptr::null::<pw_log_storage_t>())).restart_count as *const _ as usize },
+ 2usize,
+ concat!(
+ "Offset of field: ",
+ stringify!(pw_log_storage_t),
+ "::",
+ stringify!(restart_count)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(::core::ptr::null::<pw_log_storage_t>())).entries as *const _ as usize },
+ 6usize,
+ concat!(
+ "Offset of field: ",
+ stringify!(pw_log_storage_t),
+ "::",
+ stringify!(entries)
+ )
+ );
+}
+#[repr(C)]
+#[repr(align(16))]
+#[derive(Debug, Copy, Clone)]
+pub struct leaf_sensitive_data_t {
+ pub low_entropy_secret: [u8; 32usize],
+ pub high_entropy_secret: [u8; 32usize],
+ pub reset_secret: [u8; 32usize],
+}
+#[test]
+fn bindgen_test_layout_leaf_sensitive_data_t() {
+ assert_eq!(
+ ::core::mem::size_of::<leaf_sensitive_data_t>(),
+ 96usize,
+ concat!("Size of: ", stringify!(leaf_sensitive_data_t))
+ );
+ assert_eq!(
+ ::core::mem::align_of::<leaf_sensitive_data_t>(),
+ 16usize,
+ concat!("Alignment of ", stringify!(leaf_sensitive_data_t))
+ );
+ assert_eq!(
+ unsafe {
+ &(*(::core::ptr::null::<leaf_sensitive_data_t>())).low_entropy_secret as *const _
+ as usize
+ },
+ 0usize,
+ concat!(
+ "Offset of field: ",
+ stringify!(leaf_sensitive_data_t),
+ "::",
+ stringify!(low_entropy_secret)
+ )
+ );
+ assert_eq!(
+ unsafe {
+ &(*(::core::ptr::null::<leaf_sensitive_data_t>())).high_entropy_secret as *const _
+ as usize
+ },
+ 32usize,
+ concat!(
+ "Offset of field: ",
+ stringify!(leaf_sensitive_data_t),
+ "::",
+ stringify!(high_entropy_secret)
+ )
+ );
+ assert_eq!(
+ unsafe {
+ &(*(::core::ptr::null::<leaf_sensitive_data_t>())).reset_secret as *const _ as usize
+ },
+ 64usize,
+ concat!(
+ "Offset of field: ",
+ stringify!(leaf_sensitive_data_t),
+ "::",
+ stringify!(reset_secret)
+ )
+ );
+}
+#[repr(C, packed)]
+#[derive(Debug, Copy, Clone)]
+pub struct wrapped_leaf_data_t {
+ pub head: leaf_header_t,
+ pub hmac: [u8; 32usize],
+ pub iv: [u8; 16usize],
+ pub pub_: leaf_public_data_t,
+ pub cipher_text: [u8; 96usize],
+}
+#[test]
+fn bindgen_test_layout_wrapped_leaf_data_t() {
+ assert_eq!(
+ ::core::mem::size_of::<wrapped_leaf_data_t>(),
+ 372usize,
+ concat!("Size of: ", stringify!(wrapped_leaf_data_t))
+ );
+ assert_eq!(
+ ::core::mem::align_of::<wrapped_leaf_data_t>(),
+ 1usize,
+ concat!("Alignment of ", stringify!(wrapped_leaf_data_t))
+ );
+ assert_eq!(
+ unsafe { &(*(::core::ptr::null::<wrapped_leaf_data_t>())).head as *const _ as usize },
+ 0usize,
+ concat!(
+ "Offset of field: ",
+ stringify!(wrapped_leaf_data_t),
+ "::",
+ stringify!(head)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(::core::ptr::null::<wrapped_leaf_data_t>())).hmac as *const _ as usize },
+ 8usize,
+ concat!(
+ "Offset of field: ",
+ stringify!(wrapped_leaf_data_t),
+ "::",
+ stringify!(hmac)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(::core::ptr::null::<wrapped_leaf_data_t>())).iv as *const _ as usize },
+ 40usize,
+ concat!(
+ "Offset of field: ",
+ stringify!(wrapped_leaf_data_t),
+ "::",
+ stringify!(iv)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(::core::ptr::null::<wrapped_leaf_data_t>())).pub_ as *const _ as usize },
+ 56usize,
+ concat!(
+ "Offset of field: ",
+ stringify!(wrapped_leaf_data_t),
+ "::",
+ stringify!(pub_)
+ )
+ );
+ assert_eq!(
+ unsafe {
+ &(*(::core::ptr::null::<wrapped_leaf_data_t>())).cipher_text as *const _ as usize
+ },
+ 276usize,
+ concat!(
+ "Offset of field: ",
+ stringify!(wrapped_leaf_data_t),
+ "::",
+ stringify!(cipher_text)
+ )
+ );
+}
+#[repr(C)]
+#[derive(Debug, Copy, Clone)]
+pub struct imported_leaf_data_t {
+ pub head: *const leaf_header_t,
+ pub hmac: *const u8,
+ pub iv: *const u8,
+ pub pub_: *const leaf_public_data_t,
+ pub cipher_text: *const u8,
+ pub hashes: *const [u8; 32usize],
+}
+#[test]
+fn bindgen_test_layout_imported_leaf_data_t() {
+ assert_eq!(
+ ::core::mem::size_of::<imported_leaf_data_t>(),
+ 48usize,
+ concat!("Size of: ", stringify!(imported_leaf_data_t))
+ );
+ assert_eq!(
+ ::core::mem::align_of::<imported_leaf_data_t>(),
+ 8usize,
+ concat!("Alignment of ", stringify!(imported_leaf_data_t))
+ );
+ assert_eq!(
+ unsafe { &(*(::core::ptr::null::<imported_leaf_data_t>())).head as *const _ as usize },
+ 0usize,
+ concat!(
+ "Offset of field: ",
+ stringify!(imported_leaf_data_t),
+ "::",
+ stringify!(head)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(::core::ptr::null::<imported_leaf_data_t>())).hmac as *const _ as usize },
+ 8usize,
+ concat!(
+ "Offset of field: ",
+ stringify!(imported_leaf_data_t),
+ "::",
+ stringify!(hmac)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(::core::ptr::null::<imported_leaf_data_t>())).iv as *const _ as usize },
+ 16usize,
+ concat!(
+ "Offset of field: ",
+ stringify!(imported_leaf_data_t),
+ "::",
+ stringify!(iv)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(::core::ptr::null::<imported_leaf_data_t>())).pub_ as *const _ as usize },
+ 24usize,
+ concat!(
+ "Offset of field: ",
+ stringify!(imported_leaf_data_t),
+ "::",
+ stringify!(pub_)
+ )
+ );
+ assert_eq!(
+ unsafe {
+ &(*(::core::ptr::null::<imported_leaf_data_t>())).cipher_text as *const _ as usize
+ },
+ 32usize,
+ concat!(
+ "Offset of field: ",
+ stringify!(imported_leaf_data_t),
+ "::",
+ stringify!(cipher_text)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(::core::ptr::null::<imported_leaf_data_t>())).hashes as *const _ as usize },
+ 40usize,
+ concat!(
+ "Offset of field: ",
+ stringify!(imported_leaf_data_t),
+ "::",
+ stringify!(hashes)
+ )
+ );
+}
+#[repr(C)]
+#[repr(align(16))]
+#[derive(Debug, Copy, Clone)]
+pub struct leaf_data_t {
+ pub pub_: leaf_public_data_t,
+ pub __bindgen_padding_0: [u64; 0usize],
+ pub sec: leaf_sensitive_data_t,
+}
+#[test]
+fn bindgen_test_layout_leaf_data_t() {
+ assert_eq!(
+ ::core::mem::size_of::<leaf_data_t>(),
+ 320usize,
+ concat!("Size of: ", stringify!(leaf_data_t))
+ );
+ assert_eq!(
+ ::core::mem::align_of::<leaf_data_t>(),
+ 16usize,
+ concat!("Alignment of ", stringify!(leaf_data_t))
+ );
+ assert_eq!(
+ unsafe { &(*(::core::ptr::null::<leaf_data_t>())).pub_ as *const _ as usize },
+ 0usize,
+ concat!(
+ "Offset of field: ",
+ stringify!(leaf_data_t),
+ "::",
+ stringify!(pub_)
+ )
+ );
+ assert_eq!(
+ unsafe { &(*(::core::ptr::null::<leaf_data_t>())).sec as *const _ as usize },
+ 224usize,
+ concat!(
+ "Offset of field: ",
+ stringify!(leaf_data_t),
+ "::",
+ stringify!(sec)
+ )
+ );
+}
+extern "C" {
+ pub fn pinweaver_init();
+}
+pub const pinweaver_command_res_t_PW_CMD_RES_SUCCESS: pinweaver_command_res_t = 0;
+pub const pinweaver_command_res_t_PW_CMD_RES_TOO_SMALL: pinweaver_command_res_t = 1;
+pub const pinweaver_command_res_t_PW_CMD_RES_SIZE: pinweaver_command_res_t = 2;
+pub type pinweaver_command_res_t = cty::c_uint;
+extern "C" {
+ pub fn pinweaver_command(
+ request_buf: *mut cty::c_void,
+ request_size: size_t,
+ response_buf: *mut cty::c_void,
+ response_size: *mut size_t,
+ ) -> pinweaver_command_res_t;
+}
+extern "C" {
+ pub fn pw_handle_request(
+ merkle_tree: *mut merkle_tree_t,
+ request: *mut pw_request_t,
+ response: *mut pw_response_t,
+ ) -> cty::c_int;
+}
+extern "C" {
+ pub fn import_leaf(
+ unimported: *const unimported_leaf_data_t,
+ imported: *mut imported_leaf_data_t,
+ );
+}
+extern "C" {
+ pub fn get_path_auxiliary_hash_count(merkle_tree: *const merkle_tree_t) -> cty::c_int;
+}
+extern "C" {
+ pub fn compute_hash(
+ hashes: *const [u8; 32usize],
+ num_hashes: u16,
+ location: index_t,
+ child_hash: *const u8,
+ result: *mut u8,
+ ) -> cty::c_int;
+}
+extern "C" {
+ pub fn force_restart_count(mock_value: u32);
+}
+extern "C" {
+ pub fn store_log_data(log: *const pw_log_storage_t) -> cty::c_int;
+}
+extern "C" {
+ pub fn store_merkle_tree(merkle_tree: *const merkle_tree_t) -> cty::c_int;
+}
+extern "C" {
+ pub fn log_insert_leaf(label: label_t, root: *const u8, hmac: *const u8) -> cty::c_int;
+}
+extern "C" {
+ pub fn log_remove_leaf(label: label_t, root: *const u8) -> cty::c_int;
+}
+extern "C" {
+ pub fn log_auth(
+ label: label_t,
+ root: *const u8,
+ code: cty::c_int,
+ timestamp: pw_timestamp_t,
+ ) -> cty::c_int;
+}
diff --git a/eal/ti50/src/lib.rs b/eal/ti50/src/lib.rs
new file mode 100644
index 0000000..4359690
--- /dev/null
+++ b/eal/ti50/src/lib.rs
@@ -0,0 +1,11 @@
+// Copyright 2022 The ChromiumOS Authors.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#![no_std]
+#![allow(non_camel_case_types)]
+#![allow(dead_code)]
+#![allow(non_upper_case_globals)]
+
+mod bindings;
+pub use bindings::*;
diff --git a/pinweaver.h b/pinweaver.h
index 3841d7f..c3dcc92 100644
--- a/pinweaver.h
+++ b/pinweaver.h
@@ -91,7 +91,7 @@
/* Do not remove fields within the same PW_LEAF_MAJOR_VERSION. */
/* Encrypted part of the leaf data.
*/
-struct PW_PACKED PW_ALIGN_TO_BLK leaf_sensitive_data_t {
+struct PW_ALIGN_TO_BLK leaf_sensitive_data_t {
uint8_t low_entropy_secret[PW_SECRET_SIZE];
uint8_t high_entropy_secret[PW_SECRET_SIZE];
uint8_t reset_secret[PW_SECRET_SIZE];
diff --git a/pinweaver_eal.h b/pinweaver_eal.h
index 00ba4cb..243071a 100644
--- a/pinweaver_eal.h
+++ b/pinweaver_eal.h
@@ -87,7 +87,7 @@
/*
* Get number of seconds since cold boot.
*/
-uint64_t pinweaver_eal_seconds_since_boot();
+uint64_t pinweaver_eal_seconds_since_boot(void);
/*
* Functions for calculating SHA256 of the values of the selected PCRs.
@@ -101,7 +101,7 @@
* Storage functions.
* Return 0 on success.
*/
-int pinweaver_eal_storage_start();
+int pinweaver_eal_storage_start(void);
int pinweaver_eal_storage_init_state(uint8_t root_hash[PW_HASH_SIZE],
uint32_t *restart_count);
diff --git a/pinweaver_types.h b/pinweaver_types.h
index a3c9994..21aec3f 100644
--- a/pinweaver_types.h
+++ b/pinweaver_types.h
@@ -8,6 +8,7 @@
#ifndef __PINWEAVER_PINWEAVER_TYPES_H
#define __PINWEAVER_PINWEAVER_TYPES_H
+#include <stddef.h>
#include <stdint.h>
#ifdef __cplusplus