From 8533d67c0a38d8ac00fa29fcf0ad248950a81ba3 Mon Sep 17 00:00:00 2001 From: Jesper Brynolf Date: Mon, 9 Sep 2024 19:14:22 +0200 Subject: [PATCH] Dependency Update Updates all the dependencies of the crate in order to be able to use newer versions of rust and and remove old lints and checks. - Updates Rust edition to 2021 - Updates MSRV to 1.74.0 - Updates crate dependencies. - Updates lock file. - Updates minimum supported tpm2-tss version to 4.0.1. - Updates the Fedora version the CI test image is based on to 37. Co-authored-by: Ionut Mihalcea Co-authored-by: Travis Finkenauer Co-authored-by: William Brown Signed-off-by: Jesper Brynolf --- .clippy.toml | 2 +- .github/workflows/ci.yml | 6 +- Cargo.toml | 2 +- README.md | 4 +- tss-esapi-sys/Cargo.toml | 6 +- tss-esapi-sys/README.md | 2 +- tss-esapi-sys/build.rs | 11 +- tss-esapi-sys/regenerate-bindings.sh | 4 +- .../src/bindings/aarch64-unknown-linux-gnu.rs | 4623 ++++++---------- .../src/bindings/arm-unknown-linux-gnueabi.rs | 4629 ++++++---------- .../src/bindings/x86_64-unknown-linux-gnu.rs | 4637 ++++++----------- tss-esapi/Cargo.toml | 18 +- .../tpm_commands/attestation_commands.rs | 2 - tss-esapi/src/lib.rs | 8 +- tss-esapi/tests/Cargo.lock.frozen | 508 +- tss-esapi/tests/Dockerfile-fedora | 2 +- tss-esapi/tests/Dockerfile-ubuntu | 7 +- tss-esapi/tests/create_frozen_cargo_lock | 16 + tss-esapi/tests/cross-compile.sh | 4 +- tss-esapi/tests/valgrind.sh | 1 + 20 files changed, 4857 insertions(+), 9635 deletions(-) create mode 100755 tss-esapi/tests/create_frozen_cargo_lock diff --git a/.clippy.toml b/.clippy.toml index e90d7e34..3b9db9df 100644 --- a/.clippy.toml +++ b/.clippy.toml @@ -1 +1 @@ -msrv = "1.66.0" +msrv = "1.74.0" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8f7f281e..1de026f4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -31,7 +31,7 @@ jobs: - name: Build the container run: docker build -t ubuntucontainer tss-esapi/tests/ --file tss-esapi/tests/Dockerfile-ubuntu --target tpm2-tools - name: Run the container - run: docker run -v $(pwd):/tmp/rust-tss-esapi -w /tmp/rust-tss-esapi/tss-esapi --env RUST_TOOLCHAIN_VERSION=1.66.0 ubuntucontainer /tmp/rust-tss-esapi/tss-esapi/tests/all-ubuntu.sh + run: docker run -v $(pwd):/tmp/rust-tss-esapi -w /tmp/rust-tss-esapi/tss-esapi --env RUST_TOOLCHAIN_VERSION=1.74.0 ubuntucontainer /tmp/rust-tss-esapi/tss-esapi/tests/all-ubuntu.sh # All in one job as I think it is a big overhead to build and run the Docker # container? tests-ubuntu: @@ -52,7 +52,7 @@ jobs: steps: - uses: actions/checkout@v2 - name: Build the container - run: docker build -t ubuntucontainer tss-esapi/tests/ --build-arg TPM2_TSS_VERSION=4.0.1 --file tss-esapi/tests/Dockerfile-ubuntu --target tpm2-tools + run: docker build -t ubuntucontainer tss-esapi/tests/ --build-arg TPM2_TSS_VERSION=4.1.3 --file tss-esapi/tests/Dockerfile-ubuntu --target tpm2-tools - name: Run the container run: docker run -v $(pwd):/tmp/rust-tss-esapi -w /tmp/rust-tss-esapi/tss-esapi ubuntucontainer /tmp/rust-tss-esapi/tss-esapi/tests/all-ubuntu.sh @@ -118,6 +118,6 @@ jobs: - name: Build the container run: docker build -t ubuntucontainer tss-esapi/tests/ --file tss-esapi/tests/Dockerfile-ubuntu --target tpm2-tss - name: Check Clippy lints MSRV - run: docker run -v $(pwd):/tmp/rust-tss-esapi -w /tmp/rust-tss-esapi/tss-esapi --env RUST_TOOLCHAIN_VERSION=1.66.0 ubuntucontainer /tmp/rust-tss-esapi/tss-esapi/tests/lint-checks.sh + run: docker run -v $(pwd):/tmp/rust-tss-esapi -w /tmp/rust-tss-esapi/tss-esapi --env RUST_TOOLCHAIN_VERSION=1.74.0 ubuntucontainer /tmp/rust-tss-esapi/tss-esapi/tests/lint-checks.sh - name: Check Clippy lints latest run: docker run -v $(pwd):/tmp/rust-tss-esapi -w /tmp/rust-tss-esapi/tss-esapi ubuntucontainer /tmp/rust-tss-esapi/tss-esapi/tests/lint-checks.sh diff --git a/Cargo.toml b/Cargo.toml index 7432e3ec..e88eb84a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,3 +1,3 @@ [workspace] -members = ["tss-esapi", "tss-esapi-sys"] resolver = "2" +members = ["tss-esapi", "tss-esapi-sys"] diff --git a/README.md b/README.md index 9f4a3f60..dee736ba 100644 --- a/README.md +++ b/README.md @@ -9,8 +9,8 @@ At the moment we test (via CI) and support the following Rust compiler versions: * On Ubuntu we test with: - The latest stable compiler version, as accessible through `rustup`. - - The 1.66 compiler version. -* On Fedora we test with the compiler version included with the Fedora 36 release. + - The 1.74.0 compiler version. +* On Fedora we test with the compiler version included with the Fedora 38 release. * On Fedora rawhide we test with the compiler version included. If you need support for other versions of the compiler, get in touch with us to see what we can do! diff --git a/tss-esapi-sys/Cargo.toml b/tss-esapi-sys/Cargo.toml index 0e8615fc..5cba60b4 100644 --- a/tss-esapi-sys/Cargo.toml +++ b/tss-esapi-sys/Cargo.toml @@ -2,7 +2,7 @@ name = "tss-esapi-sys" version = "0.5.0" authors = ["Parsec Project Contributors"] -edition = "2018" +edition = "2021" description = "FFI wrapper around TSS 2.0 Enhanced System API" readme = "README.md" keywords = ["tpm", "tss", "esys", "esapi"] @@ -11,10 +11,10 @@ license = "Apache-2.0" repository = "https://github.com/parallaxsecond/rust-tss-esapi" documentation = "https://docs.rs/crate/tss-esapi-sys" links = "tss2-esys" -rust-version = "1.66.0" +rust-version = "1.74.0" [build-dependencies] -bindgen = { version = "0.66.1", optional = true } +bindgen = { version = "0.70.1", optional = true } pkg-config = "0.3.18" target-lexicon = "0.12.0" cfg-if = "1.0.0" diff --git a/tss-esapi-sys/README.md b/tss-esapi-sys/README.md index 6f87584f..6d347dba 100644 --- a/tss-esapi-sys/README.md +++ b/tss-esapi-sys/README.md @@ -18,7 +18,7 @@ must therefore link to all of them at build time. The paths to the libraries are discovered using `pkg-config` - make sure they are discoverable in this way on your system. Our build script looks for -`tss2-esys`, `tss2-tctildr` and `tss2-mu`. A minimum version of `3.2.2` is +`tss2-esys`, `tss2-tctildr` and `tss2-mu`. A minimum version of `4.0.1` is required for all of them. Having installed the open-source implementation libraries at `/usr/local/lib` (by default), it diff --git a/tss-esapi-sys/build.rs b/tss-esapi-sys/build.rs index d261d567..ff1e854f 100644 --- a/tss-esapi-sys/build.rs +++ b/tss-esapi-sys/build.rs @@ -53,16 +53,20 @@ pub mod tpm2_tss { fs::read_dir, path::{Path, PathBuf}, }; - const MINIMUM_VERSION: &str = "3.2.2"; + const MINIMUM_VERSION: &str = "4.0.1"; const PATH_ENV_VAR_NAME: &str = "TPM2_TSS_PATH"; /// The installed tpm2-tss libraries that are of /// interest. pub struct Installation { _tss2_sys: Library, + #[allow(unused)] tss2_esys: Library, + #[allow(unused)] tss2_tctildr: Library, + #[allow(unused)] tss2_mu: Library, + #[allow(unused)] tss2_tcti_tbs: Option, } @@ -119,6 +123,7 @@ pub mod tpm2_tss { fn bindgen_builder(&self) -> bindgen::Builder { let mut builder = bindgen::Builder::default() .size_t_is_usize(false) + .rust_target(bindgen::RustTarget::Stable_1_73) // lower or equal to MSRV. .clang_arg(self.tss2_esys.include_dir_arg()) .clang_arg(self.tss2_tctildr.include_dir_arg()) .clang_arg(self.tss2_mu.include_dir_arg()) @@ -261,8 +266,10 @@ pub mod tpm2_tss { /// Struct holding the information for a library. struct Library { + #[allow(unused)] header_file: Option, version: String, + #[allow(unused)] name: String, } @@ -333,6 +340,7 @@ pub mod tpm2_tss { /// - If the library was probe without requiring header files. /// - If the library specifies a header file does not have a parent directory. /// - If the library specifies a header file path that contain invalid utf-8 characters. + #[allow(unused)] pub fn include_dir_arg(&self) -> String { self.header_file .as_ref() @@ -356,6 +364,7 @@ pub mod tpm2_tss { /// /// # Panics /// - If the library specifies a header file path that contain invalid utf-8 characters. + #[allow(unused)] pub fn header_file_arg(&self) -> &str { self.header_file.as_ref().map_or_else( || { diff --git a/tss-esapi-sys/regenerate-bindings.sh b/tss-esapi-sys/regenerate-bindings.sh index af5dafba..c6acc00d 100755 --- a/tss-esapi-sys/regenerate-bindings.sh +++ b/tss-esapi-sys/regenerate-bindings.sh @@ -11,7 +11,7 @@ set -euf -o pipefail OPENSSL_GIT="https://github.com/openssl/openssl.git" OPENSSL_VERSION="OpenSSL_1_1_1j" TPM2_TSS_GIT="https://github.com/tpm2-software/tpm2-tss.git" -TPM2_TSS_VERSION="3.2.2" +TPM2_TSS_VERSION="4.0.1" export SYSROOT="/tmp/sysroot" @@ -48,7 +48,7 @@ cross-compile-openssl() { cross-compile-tpm2-tss() { pushd /tmp/tpm2-tss [ ! -f configure ] && ./bootstrap - ./configure --enable-fapi=no --prefix=/ --build=x86_64-pc-linux-gnu --host=$1 --target=$1 CC=$1-gcc + ./configure --disable-fapi --disable-policy --prefix=/ --build=x86_64-pc-linux-gnu --host=$1 --target=$1 CC=$1-gcc make clean make -j$(nproc) make DESTDIR="$SYSROOT" install diff --git a/tss-esapi-sys/src/bindings/aarch64-unknown-linux-gnu.rs b/tss-esapi-sys/src/bindings/aarch64-unknown-linux-gnu.rs index 9300d8d3..13c45405 100644 --- a/tss-esapi-sys/src/bindings/aarch64-unknown-linux-gnu.rs +++ b/tss-esapi-sys/src/bindings/aarch64-unknown-linux-gnu.rs @@ -1,5 +1,5 @@ -/* automatically generated by rust-bindgen 0.69.4 */ -/* TPM2_TSS_VERSION="3.2.2" */ +/* automatically generated by rust-bindgen 0.70.1 */ +/* TPM2_TSS_VERSION="4.0.1" */ pub const _STDINT_H: u32 = 1; pub const _FEATURES_H: u32 = 1; @@ -148,6 +148,7 @@ pub const TSS2_BASE_RC_BAD_KEY: u32 = 50; pub const TSS2_BASE_RC_NO_HANDLE: u32 = 51; pub const TSS2_BASE_RC_NOT_PROVISIONED: u32 = 52; pub const TSS2_BASE_RC_ALREADY_PROVISIONED: u32 = 53; +pub const TSS2_BASE_RC_CALLBACK_NULL: u32 = 54; pub const TSS2_LAYER_IMPLEMENTATION_SPECIFIC_OFFSET: u32 = 63488; pub const TSS2_LEVEL_IMPLEMENTATION_SPECIFIC_SHIFT: u32 = 11; pub const TPM2_MAX_COMMAND_SIZE: u32 = 4096; @@ -240,7 +241,25 @@ pub const ESYS_TR_RH_PLATFORM: u32 = 268; pub const ESYS_TR_RH_PLATFORM_NV: u32 = 269; pub const ESYS_TR_RH_AUTH_FIRST: u32 = 272; pub const ESYS_TR_RH_ACT_FIRST: u32 = 288; +pub const ESYS_TR_RH_ACT_0: u32 = 288; +pub const ESYS_TR_RH_ACT_1: u32 = 289; +pub const ESYS_TR_RH_ACT_2: u32 = 290; +pub const ESYS_TR_RH_ACT_3: u32 = 291; +pub const ESYS_TR_RH_ACT_4: u32 = 292; +pub const ESYS_TR_RH_ACT_5: u32 = 293; +pub const ESYS_TR_RH_ACT_6: u32 = 294; +pub const ESYS_TR_RH_ACT_7: u32 = 295; +pub const ESYS_TR_RH_ACT_8: u32 = 296; +pub const ESYS_TR_RH_ACT_9: u32 = 297; +pub const ESYS_TR_RH_ACT_A: u32 = 298; +pub const ESYS_TR_RH_ACT_B: u32 = 299; +pub const ESYS_TR_RH_ACT_C: u32 = 300; +pub const ESYS_TR_RH_ACT_D: u32 = 301; +pub const ESYS_TR_RH_ACT_E: u32 = 302; +pub const ESYS_TR_RH_ACT_F: u32 = 303; pub const ESYS_TR_RH_ACT_LAST: u32 = 303; +pub const ESYS_TR_RH_AC_FIRST: u32 = 320; +pub const ESYS_TR_RH_AC_LAST: u32 = 65855; pub const _INTTYPES_H: u32 = 1; pub const ____gwchar_t_defined: u32 = 1; pub const __PRI64_PREFIX: &[u8; 2] = b"l\0"; @@ -519,22 +538,17 @@ fn bindgen_test_layout___fsid_t() { assert_eq!( ::std::mem::size_of::<__fsid_t>(), 8usize, - concat!("Size of: ", stringify!(__fsid_t)) + "Size of __fsid_t" ); assert_eq!( ::std::mem::align_of::<__fsid_t>(), 4usize, - concat!("Alignment of ", stringify!(__fsid_t)) + "Alignment of __fsid_t" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__val) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(__fsid_t), - "::", - stringify!(__val) - ) + "Offset of field: __fsid_t::__val" ); } pub type __clock_t = ::std::os::raw::c_long; @@ -610,52 +624,32 @@ fn bindgen_test_layout_TSS2_ABI_VERSION() { assert_eq!( ::std::mem::size_of::(), 16usize, - concat!("Size of: ", stringify!(TSS2_ABI_VERSION)) + "Size of TSS2_ABI_VERSION" ); assert_eq!( ::std::mem::align_of::(), 4usize, - concat!("Alignment of ", stringify!(TSS2_ABI_VERSION)) + "Alignment of TSS2_ABI_VERSION" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).tssCreator) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TSS2_ABI_VERSION), - "::", - stringify!(tssCreator) - ) + "Offset of field: TSS2_ABI_VERSION::tssCreator" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).tssFamily) as usize - ptr as usize }, 4usize, - concat!( - "Offset of field: ", - stringify!(TSS2_ABI_VERSION), - "::", - stringify!(tssFamily) - ) + "Offset of field: TSS2_ABI_VERSION::tssFamily" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).tssLevel) as usize - ptr as usize }, 8usize, - concat!( - "Offset of field: ", - stringify!(TSS2_ABI_VERSION), - "::", - stringify!(tssLevel) - ) + "Offset of field: TSS2_ABI_VERSION::tssLevel" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).tssVersion) as usize - ptr as usize }, 12usize, - concat!( - "Offset of field: ", - stringify!(TSS2_ABI_VERSION), - "::", - stringify!(tssVersion) - ) + "Offset of field: TSS2_ABI_VERSION::tssVersion" ); } pub type TSS2_RC = u32; @@ -697,6 +691,7 @@ pub type TPMA_X509_KEY_USAGE = u32; pub type TPMA_ACT = u32; pub type TPMI_YES_NO = BYTE; pub type TPMI_DH_OBJECT = TPM2_HANDLE; +pub type TPMI_DH_PARENT = TPM2_HANDLE; pub type TPMI_DH_PERSISTENT = TPM2_HANDLE; pub type TPMI_DH_ENTITY = TPM2_HANDLE; pub type TPMI_DH_PCR = TPM2_HANDLE; @@ -733,7 +728,7 @@ pub type TPMI_ALG_CIPHER_MODE = TPM2_ALG_ID; #[repr(C)] #[derive(Debug, Default, Copy, Clone)] pub struct TPMS_EMPTY { - pub empty: [BYTE; 1usize], + pub empty: [UINT8; 1usize], } #[test] fn bindgen_test_layout_TPMS_EMPTY() { @@ -742,69 +737,23 @@ fn bindgen_test_layout_TPMS_EMPTY() { assert_eq!( ::std::mem::size_of::(), 1usize, - concat!("Size of: ", stringify!(TPMS_EMPTY)) + "Size of TPMS_EMPTY" ); assert_eq!( ::std::mem::align_of::(), 1usize, - concat!("Alignment of ", stringify!(TPMS_EMPTY)) + "Alignment of TPMS_EMPTY" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).empty) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMS_EMPTY), - "::", - stringify!(empty) - ) - ); -} -#[repr(C)] -#[derive(Debug, Default, Copy, Clone)] -pub struct TPMS_ALGORITHM_DESCRIPTION { - pub alg: TPM2_ALG_ID, - pub attributes: TPMA_ALGORITHM, -} -#[test] -fn bindgen_test_layout_TPMS_ALGORITHM_DESCRIPTION() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 8usize, - concat!("Size of: ", stringify!(TPMS_ALGORITHM_DESCRIPTION)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(TPMS_ALGORITHM_DESCRIPTION)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).alg) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(TPMS_ALGORITHM_DESCRIPTION), - "::", - stringify!(alg) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).attributes) as usize - ptr as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(TPMS_ALGORITHM_DESCRIPTION), - "::", - stringify!(attributes) - ) + "Offset of field: TPMS_EMPTY::empty" ); } #[repr(C)] #[derive(Copy, Clone)] pub union TPMU_HA { + pub sha: [BYTE; 20usize], pub sha1: [BYTE; 20usize], pub sha256: [BYTE; 32usize], pub sha384: [BYTE; 48usize], @@ -815,65 +764,41 @@ pub union TPMU_HA { fn bindgen_test_layout_TPMU_HA() { const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 64usize, - concat!("Size of: ", stringify!(TPMU_HA)) - ); + assert_eq!(::std::mem::size_of::(), 64usize, "Size of TPMU_HA"); assert_eq!( ::std::mem::align_of::(), 1usize, - concat!("Alignment of ", stringify!(TPMU_HA)) + "Alignment of TPMU_HA" + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).sha) as usize - ptr as usize }, + 0usize, + "Offset of field: TPMU_HA::sha" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).sha1) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_HA), - "::", - stringify!(sha1) - ) + "Offset of field: TPMU_HA::sha1" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).sha256) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_HA), - "::", - stringify!(sha256) - ) + "Offset of field: TPMU_HA::sha256" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).sha384) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_HA), - "::", - stringify!(sha384) - ) + "Offset of field: TPMU_HA::sha384" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).sha512) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_HA), - "::", - stringify!(sha512) - ) + "Offset of field: TPMU_HA::sha512" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).sm3_256) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_HA), - "::", - stringify!(sm3_256) - ) + "Offset of field: TPMU_HA::sm3_256" ); } impl Default for TPMU_HA { @@ -895,35 +820,21 @@ pub struct TPMT_HA { fn bindgen_test_layout_TPMT_HA() { const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 66usize, - concat!("Size of: ", stringify!(TPMT_HA)) - ); + assert_eq!(::std::mem::size_of::(), 66usize, "Size of TPMT_HA"); assert_eq!( ::std::mem::align_of::(), 2usize, - concat!("Alignment of ", stringify!(TPMT_HA)) + "Alignment of TPMT_HA" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).hashAlg) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMT_HA), - "::", - stringify!(hashAlg) - ) + "Offset of field: TPMT_HA::hashAlg" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).digest) as usize - ptr as usize }, 2usize, - concat!( - "Offset of field: ", - stringify!(TPMT_HA), - "::", - stringify!(digest) - ) + "Offset of field: TPMT_HA::digest" ); } impl Default for TPMT_HA { @@ -948,32 +859,22 @@ fn bindgen_test_layout_TPM2B_DIGEST() { assert_eq!( ::std::mem::size_of::(), 66usize, - concat!("Size of: ", stringify!(TPM2B_DIGEST)) + "Size of TPM2B_DIGEST" ); assert_eq!( ::std::mem::align_of::(), 2usize, - concat!("Alignment of ", stringify!(TPM2B_DIGEST)) + "Alignment of TPM2B_DIGEST" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).size) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPM2B_DIGEST), - "::", - stringify!(size) - ) + "Offset of field: TPM2B_DIGEST::size" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).buffer) as usize - ptr as usize }, 2usize, - concat!( - "Offset of field: ", - stringify!(TPM2B_DIGEST), - "::", - stringify!(buffer) - ) + "Offset of field: TPM2B_DIGEST::buffer" ); } impl Default for TPM2B_DIGEST { @@ -998,32 +899,22 @@ fn bindgen_test_layout_TPM2B_DATA() { assert_eq!( ::std::mem::size_of::(), 66usize, - concat!("Size of: ", stringify!(TPM2B_DATA)) + "Size of TPM2B_DATA" ); assert_eq!( ::std::mem::align_of::(), 2usize, - concat!("Alignment of ", stringify!(TPM2B_DATA)) + "Alignment of TPM2B_DATA" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).size) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPM2B_DATA), - "::", - stringify!(size) - ) + "Offset of field: TPM2B_DATA::size" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).buffer) as usize - ptr as usize }, 2usize, - concat!( - "Offset of field: ", - stringify!(TPM2B_DATA), - "::", - stringify!(buffer) - ) + "Offset of field: TPM2B_DATA::buffer" ); } impl Default for TPM2B_DATA { @@ -1051,32 +942,22 @@ fn bindgen_test_layout_TPM2B_EVENT() { assert_eq!( ::std::mem::size_of::(), 1026usize, - concat!("Size of: ", stringify!(TPM2B_EVENT)) + "Size of TPM2B_EVENT" ); assert_eq!( ::std::mem::align_of::(), 2usize, - concat!("Alignment of ", stringify!(TPM2B_EVENT)) + "Alignment of TPM2B_EVENT" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).size) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPM2B_EVENT), - "::", - stringify!(size) - ) + "Offset of field: TPM2B_EVENT::size" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).buffer) as usize - ptr as usize }, 2usize, - concat!( - "Offset of field: ", - stringify!(TPM2B_EVENT), - "::", - stringify!(buffer) - ) + "Offset of field: TPM2B_EVENT::buffer" ); } impl Default for TPM2B_EVENT { @@ -1101,32 +982,22 @@ fn bindgen_test_layout_TPM2B_MAX_BUFFER() { assert_eq!( ::std::mem::size_of::(), 1026usize, - concat!("Size of: ", stringify!(TPM2B_MAX_BUFFER)) + "Size of TPM2B_MAX_BUFFER" ); assert_eq!( ::std::mem::align_of::(), 2usize, - concat!("Alignment of ", stringify!(TPM2B_MAX_BUFFER)) + "Alignment of TPM2B_MAX_BUFFER" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).size) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPM2B_MAX_BUFFER), - "::", - stringify!(size) - ) + "Offset of field: TPM2B_MAX_BUFFER::size" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).buffer) as usize - ptr as usize }, 2usize, - concat!( - "Offset of field: ", - stringify!(TPM2B_MAX_BUFFER), - "::", - stringify!(buffer) - ) + "Offset of field: TPM2B_MAX_BUFFER::buffer" ); } impl Default for TPM2B_MAX_BUFFER { @@ -1151,32 +1022,22 @@ fn bindgen_test_layout_TPM2B_MAX_NV_BUFFER() { assert_eq!( ::std::mem::size_of::(), 2050usize, - concat!("Size of: ", stringify!(TPM2B_MAX_NV_BUFFER)) + "Size of TPM2B_MAX_NV_BUFFER" ); assert_eq!( ::std::mem::align_of::(), 2usize, - concat!("Alignment of ", stringify!(TPM2B_MAX_NV_BUFFER)) + "Alignment of TPM2B_MAX_NV_BUFFER" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).size) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPM2B_MAX_NV_BUFFER), - "::", - stringify!(size) - ) + "Offset of field: TPM2B_MAX_NV_BUFFER::size" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).buffer) as usize - ptr as usize }, 2usize, - concat!( - "Offset of field: ", - stringify!(TPM2B_MAX_NV_BUFFER), - "::", - stringify!(buffer) - ) + "Offset of field: TPM2B_MAX_NV_BUFFER::buffer" ); } impl Default for TPM2B_MAX_NV_BUFFER { @@ -1202,32 +1063,22 @@ fn bindgen_test_layout_TPM2B_IV() { assert_eq!( ::std::mem::size_of::(), 18usize, - concat!("Size of: ", stringify!(TPM2B_IV)) + "Size of TPM2B_IV" ); assert_eq!( ::std::mem::align_of::(), 2usize, - concat!("Alignment of ", stringify!(TPM2B_IV)) + "Alignment of TPM2B_IV" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).size) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPM2B_IV), - "::", - stringify!(size) - ) + "Offset of field: TPM2B_IV::size" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).buffer) as usize - ptr as usize }, 2usize, - concat!( - "Offset of field: ", - stringify!(TPM2B_IV), - "::", - stringify!(buffer) - ) + "Offset of field: TPM2B_IV::buffer" ); } #[repr(C)] @@ -1243,32 +1094,22 @@ fn bindgen_test_layout_TPMU_NAME() { assert_eq!( ::std::mem::size_of::(), 68usize, - concat!("Size of: ", stringify!(TPMU_NAME)) + "Size of TPMU_NAME" ); assert_eq!( ::std::mem::align_of::(), 4usize, - concat!("Alignment of ", stringify!(TPMU_NAME)) + "Alignment of TPMU_NAME" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).digest) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_NAME), - "::", - stringify!(digest) - ) + "Offset of field: TPMU_NAME::digest" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).handle) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_NAME), - "::", - stringify!(handle) - ) + "Offset of field: TPMU_NAME::handle" ); } impl Default for TPMU_NAME { @@ -1293,32 +1134,22 @@ fn bindgen_test_layout_TPM2B_NAME() { assert_eq!( ::std::mem::size_of::(), 70usize, - concat!("Size of: ", stringify!(TPM2B_NAME)) + "Size of TPM2B_NAME" ); assert_eq!( ::std::mem::align_of::(), 2usize, - concat!("Alignment of ", stringify!(TPM2B_NAME)) + "Alignment of TPM2B_NAME" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).size) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPM2B_NAME), - "::", - stringify!(size) - ) + "Offset of field: TPM2B_NAME::size" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).name) as usize - ptr as usize }, 2usize, - concat!( - "Offset of field: ", - stringify!(TPM2B_NAME), - "::", - stringify!(name) - ) + "Offset of field: TPM2B_NAME::name" ); } impl Default for TPM2B_NAME { @@ -1343,32 +1174,22 @@ fn bindgen_test_layout_TPMS_PCR_SELECT() { assert_eq!( ::std::mem::size_of::(), 5usize, - concat!("Size of: ", stringify!(TPMS_PCR_SELECT)) + "Size of TPMS_PCR_SELECT" ); assert_eq!( ::std::mem::align_of::(), 1usize, - concat!("Alignment of ", stringify!(TPMS_PCR_SELECT)) + "Alignment of TPMS_PCR_SELECT" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).sizeofSelect) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMS_PCR_SELECT), - "::", - stringify!(sizeofSelect) - ) + "Offset of field: TPMS_PCR_SELECT::sizeofSelect" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).pcrSelect) as usize - ptr as usize }, 1usize, - concat!( - "Offset of field: ", - stringify!(TPMS_PCR_SELECT), - "::", - stringify!(pcrSelect) - ) + "Offset of field: TPMS_PCR_SELECT::pcrSelect" ); } #[repr(C)] @@ -1385,42 +1206,27 @@ fn bindgen_test_layout_TPMS_PCR_SELECTION() { assert_eq!( ::std::mem::size_of::(), 8usize, - concat!("Size of: ", stringify!(TPMS_PCR_SELECTION)) + "Size of TPMS_PCR_SELECTION" ); assert_eq!( ::std::mem::align_of::(), 2usize, - concat!("Alignment of ", stringify!(TPMS_PCR_SELECTION)) + "Alignment of TPMS_PCR_SELECTION" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).hash) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMS_PCR_SELECTION), - "::", - stringify!(hash) - ) + "Offset of field: TPMS_PCR_SELECTION::hash" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).sizeofSelect) as usize - ptr as usize }, 2usize, - concat!( - "Offset of field: ", - stringify!(TPMS_PCR_SELECTION), - "::", - stringify!(sizeofSelect) - ) + "Offset of field: TPMS_PCR_SELECTION::sizeofSelect" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).pcrSelect) as usize - ptr as usize }, 3usize, - concat!( - "Offset of field: ", - stringify!(TPMS_PCR_SELECTION), - "::", - stringify!(pcrSelect) - ) + "Offset of field: TPMS_PCR_SELECTION::pcrSelect" ); } #[repr(C)] @@ -1437,42 +1243,27 @@ fn bindgen_test_layout_TPMT_TK_CREATION() { assert_eq!( ::std::mem::size_of::(), 76usize, - concat!("Size of: ", stringify!(TPMT_TK_CREATION)) + "Size of TPMT_TK_CREATION" ); assert_eq!( ::std::mem::align_of::(), 4usize, - concat!("Alignment of ", stringify!(TPMT_TK_CREATION)) + "Alignment of TPMT_TK_CREATION" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).tag) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMT_TK_CREATION), - "::", - stringify!(tag) - ) + "Offset of field: TPMT_TK_CREATION::tag" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).hierarchy) as usize - ptr as usize }, 4usize, - concat!( - "Offset of field: ", - stringify!(TPMT_TK_CREATION), - "::", - stringify!(hierarchy) - ) + "Offset of field: TPMT_TK_CREATION::hierarchy" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).digest) as usize - ptr as usize }, 8usize, - concat!( - "Offset of field: ", - stringify!(TPMT_TK_CREATION), - "::", - stringify!(digest) - ) + "Offset of field: TPMT_TK_CREATION::digest" ); } impl Default for TPMT_TK_CREATION { @@ -1498,42 +1289,27 @@ fn bindgen_test_layout_TPMT_TK_VERIFIED() { assert_eq!( ::std::mem::size_of::(), 76usize, - concat!("Size of: ", stringify!(TPMT_TK_VERIFIED)) + "Size of TPMT_TK_VERIFIED" ); assert_eq!( ::std::mem::align_of::(), 4usize, - concat!("Alignment of ", stringify!(TPMT_TK_VERIFIED)) + "Alignment of TPMT_TK_VERIFIED" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).tag) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMT_TK_VERIFIED), - "::", - stringify!(tag) - ) + "Offset of field: TPMT_TK_VERIFIED::tag" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).hierarchy) as usize - ptr as usize }, 4usize, - concat!( - "Offset of field: ", - stringify!(TPMT_TK_VERIFIED), - "::", - stringify!(hierarchy) - ) + "Offset of field: TPMT_TK_VERIFIED::hierarchy" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).digest) as usize - ptr as usize }, 8usize, - concat!( - "Offset of field: ", - stringify!(TPMT_TK_VERIFIED), - "::", - stringify!(digest) - ) + "Offset of field: TPMT_TK_VERIFIED::digest" ); } impl Default for TPMT_TK_VERIFIED { @@ -1559,42 +1335,27 @@ fn bindgen_test_layout_TPMT_TK_AUTH() { assert_eq!( ::std::mem::size_of::(), 76usize, - concat!("Size of: ", stringify!(TPMT_TK_AUTH)) + "Size of TPMT_TK_AUTH" ); assert_eq!( ::std::mem::align_of::(), 4usize, - concat!("Alignment of ", stringify!(TPMT_TK_AUTH)) + "Alignment of TPMT_TK_AUTH" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).tag) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMT_TK_AUTH), - "::", - stringify!(tag) - ) + "Offset of field: TPMT_TK_AUTH::tag" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).hierarchy) as usize - ptr as usize }, 4usize, - concat!( - "Offset of field: ", - stringify!(TPMT_TK_AUTH), - "::", - stringify!(hierarchy) - ) + "Offset of field: TPMT_TK_AUTH::hierarchy" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).digest) as usize - ptr as usize }, 8usize, - concat!( - "Offset of field: ", - stringify!(TPMT_TK_AUTH), - "::", - stringify!(digest) - ) + "Offset of field: TPMT_TK_AUTH::digest" ); } impl Default for TPMT_TK_AUTH { @@ -1620,42 +1381,27 @@ fn bindgen_test_layout_TPMT_TK_HASHCHECK() { assert_eq!( ::std::mem::size_of::(), 76usize, - concat!("Size of: ", stringify!(TPMT_TK_HASHCHECK)) + "Size of TPMT_TK_HASHCHECK" ); assert_eq!( ::std::mem::align_of::(), 4usize, - concat!("Alignment of ", stringify!(TPMT_TK_HASHCHECK)) + "Alignment of TPMT_TK_HASHCHECK" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).tag) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMT_TK_HASHCHECK), - "::", - stringify!(tag) - ) + "Offset of field: TPMT_TK_HASHCHECK::tag" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).hierarchy) as usize - ptr as usize }, 4usize, - concat!( - "Offset of field: ", - stringify!(TPMT_TK_HASHCHECK), - "::", - stringify!(hierarchy) - ) + "Offset of field: TPMT_TK_HASHCHECK::hierarchy" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).digest) as usize - ptr as usize }, 8usize, - concat!( - "Offset of field: ", - stringify!(TPMT_TK_HASHCHECK), - "::", - stringify!(digest) - ) + "Offset of field: TPMT_TK_HASHCHECK::digest" ); } impl Default for TPMT_TK_HASHCHECK { @@ -1680,32 +1426,22 @@ fn bindgen_test_layout_TPMS_ALG_PROPERTY() { assert_eq!( ::std::mem::size_of::(), 8usize, - concat!("Size of: ", stringify!(TPMS_ALG_PROPERTY)) + "Size of TPMS_ALG_PROPERTY" ); assert_eq!( ::std::mem::align_of::(), 4usize, - concat!("Alignment of ", stringify!(TPMS_ALG_PROPERTY)) + "Alignment of TPMS_ALG_PROPERTY" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).alg) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMS_ALG_PROPERTY), - "::", - stringify!(alg) - ) + "Offset of field: TPMS_ALG_PROPERTY::alg" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).algProperties) as usize - ptr as usize }, 4usize, - concat!( - "Offset of field: ", - stringify!(TPMS_ALG_PROPERTY), - "::", - stringify!(algProperties) - ) + "Offset of field: TPMS_ALG_PROPERTY::algProperties" ); } #[repr(C)] @@ -1721,32 +1457,22 @@ fn bindgen_test_layout_TPMS_TAGGED_PROPERTY() { assert_eq!( ::std::mem::size_of::(), 8usize, - concat!("Size of: ", stringify!(TPMS_TAGGED_PROPERTY)) + "Size of TPMS_TAGGED_PROPERTY" ); assert_eq!( ::std::mem::align_of::(), 4usize, - concat!("Alignment of ", stringify!(TPMS_TAGGED_PROPERTY)) + "Alignment of TPMS_TAGGED_PROPERTY" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).property) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMS_TAGGED_PROPERTY), - "::", - stringify!(property) - ) + "Offset of field: TPMS_TAGGED_PROPERTY::property" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).value) as usize - ptr as usize }, 4usize, - concat!( - "Offset of field: ", - stringify!(TPMS_TAGGED_PROPERTY), - "::", - stringify!(value) - ) + "Offset of field: TPMS_TAGGED_PROPERTY::value" ); } #[repr(C)] @@ -1764,42 +1490,27 @@ fn bindgen_test_layout_TPMS_TAGGED_PCR_SELECT() { assert_eq!( ::std::mem::size_of::(), 12usize, - concat!("Size of: ", stringify!(TPMS_TAGGED_PCR_SELECT)) + "Size of TPMS_TAGGED_PCR_SELECT" ); assert_eq!( ::std::mem::align_of::(), 4usize, - concat!("Alignment of ", stringify!(TPMS_TAGGED_PCR_SELECT)) + "Alignment of TPMS_TAGGED_PCR_SELECT" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).tag) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMS_TAGGED_PCR_SELECT), - "::", - stringify!(tag) - ) + "Offset of field: TPMS_TAGGED_PCR_SELECT::tag" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).sizeofSelect) as usize - ptr as usize }, 4usize, - concat!( - "Offset of field: ", - stringify!(TPMS_TAGGED_PCR_SELECT), - "::", - stringify!(sizeofSelect) - ) + "Offset of field: TPMS_TAGGED_PCR_SELECT::sizeofSelect" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).pcrSelect) as usize - ptr as usize }, 5usize, - concat!( - "Offset of field: ", - stringify!(TPMS_TAGGED_PCR_SELECT), - "::", - stringify!(pcrSelect) - ) + "Offset of field: TPMS_TAGGED_PCR_SELECT::pcrSelect" ); } #[repr(C)] @@ -1815,32 +1526,22 @@ fn bindgen_test_layout_TPMS_TAGGED_POLICY() { assert_eq!( ::std::mem::size_of::(), 72usize, - concat!("Size of: ", stringify!(TPMS_TAGGED_POLICY)) + "Size of TPMS_TAGGED_POLICY" ); assert_eq!( ::std::mem::align_of::(), 4usize, - concat!("Alignment of ", stringify!(TPMS_TAGGED_POLICY)) + "Alignment of TPMS_TAGGED_POLICY" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).handle) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMS_TAGGED_POLICY), - "::", - stringify!(handle) - ) + "Offset of field: TPMS_TAGGED_POLICY::handle" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).policyHash) as usize - ptr as usize }, 4usize, - concat!( - "Offset of field: ", - stringify!(TPMS_TAGGED_POLICY), - "::", - stringify!(policyHash) - ) + "Offset of field: TPMS_TAGGED_POLICY::policyHash" ); } impl Default for TPMS_TAGGED_POLICY { @@ -1866,42 +1567,27 @@ fn bindgen_test_layout_TPMS_ACT_DATA() { assert_eq!( ::std::mem::size_of::(), 12usize, - concat!("Size of: ", stringify!(TPMS_ACT_DATA)) + "Size of TPMS_ACT_DATA" ); assert_eq!( ::std::mem::align_of::(), 4usize, - concat!("Alignment of ", stringify!(TPMS_ACT_DATA)) + "Alignment of TPMS_ACT_DATA" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).handle) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMS_ACT_DATA), - "::", - stringify!(handle) - ) + "Offset of field: TPMS_ACT_DATA::handle" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).timeout) as usize - ptr as usize }, 4usize, - concat!( - "Offset of field: ", - stringify!(TPMS_ACT_DATA), - "::", - stringify!(timeout) - ) + "Offset of field: TPMS_ACT_DATA::timeout" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).attributes) as usize - ptr as usize }, 8usize, - concat!( - "Offset of field: ", - stringify!(TPMS_ACT_DATA), - "::", - stringify!(attributes) - ) + "Offset of field: TPMS_ACT_DATA::attributes" ); } #[repr(C)] @@ -1917,32 +1603,22 @@ fn bindgen_test_layout_TPML_CC() { assert_eq!( ::std::mem::size_of::(), 1028usize, - concat!("Size of: ", stringify!(TPML_CC)) + "Size of TPML_CC" ); assert_eq!( ::std::mem::align_of::(), 4usize, - concat!("Alignment of ", stringify!(TPML_CC)) + "Alignment of TPML_CC" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).count) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPML_CC), - "::", - stringify!(count) - ) + "Offset of field: TPML_CC::count" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).commandCodes) as usize - ptr as usize }, 4usize, - concat!( - "Offset of field: ", - stringify!(TPML_CC), - "::", - stringify!(commandCodes) - ) + "Offset of field: TPML_CC::commandCodes" ); } impl Default for TPML_CC { @@ -1967,32 +1643,22 @@ fn bindgen_test_layout_TPML_CCA() { assert_eq!( ::std::mem::size_of::(), 1028usize, - concat!("Size of: ", stringify!(TPML_CCA)) + "Size of TPML_CCA" ); assert_eq!( ::std::mem::align_of::(), 4usize, - concat!("Alignment of ", stringify!(TPML_CCA)) + "Alignment of TPML_CCA" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).count) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPML_CCA), - "::", - stringify!(count) - ) + "Offset of field: TPML_CCA::count" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).commandAttributes) as usize - ptr as usize }, 4usize, - concat!( - "Offset of field: ", - stringify!(TPML_CCA), - "::", - stringify!(commandAttributes) - ) + "Offset of field: TPML_CCA::commandAttributes" ); } impl Default for TPML_CCA { @@ -2017,32 +1683,22 @@ fn bindgen_test_layout_TPML_ALG() { assert_eq!( ::std::mem::size_of::(), 260usize, - concat!("Size of: ", stringify!(TPML_ALG)) + "Size of TPML_ALG" ); assert_eq!( ::std::mem::align_of::(), 4usize, - concat!("Alignment of ", stringify!(TPML_ALG)) + "Alignment of TPML_ALG" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).count) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPML_ALG), - "::", - stringify!(count) - ) + "Offset of field: TPML_ALG::count" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).algorithms) as usize - ptr as usize }, 4usize, - concat!( - "Offset of field: ", - stringify!(TPML_ALG), - "::", - stringify!(algorithms) - ) + "Offset of field: TPML_ALG::algorithms" ); } impl Default for TPML_ALG { @@ -2067,32 +1723,22 @@ fn bindgen_test_layout_TPML_HANDLE() { assert_eq!( ::std::mem::size_of::(), 1020usize, - concat!("Size of: ", stringify!(TPML_HANDLE)) + "Size of TPML_HANDLE" ); assert_eq!( ::std::mem::align_of::(), 4usize, - concat!("Alignment of ", stringify!(TPML_HANDLE)) + "Alignment of TPML_HANDLE" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).count) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPML_HANDLE), - "::", - stringify!(count) - ) + "Offset of field: TPML_HANDLE::count" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).handle) as usize - ptr as usize }, 4usize, - concat!( - "Offset of field: ", - stringify!(TPML_HANDLE), - "::", - stringify!(handle) - ) + "Offset of field: TPML_HANDLE::handle" ); } impl Default for TPML_HANDLE { @@ -2117,32 +1763,22 @@ fn bindgen_test_layout_TPML_DIGEST() { assert_eq!( ::std::mem::size_of::(), 532usize, - concat!("Size of: ", stringify!(TPML_DIGEST)) + "Size of TPML_DIGEST" ); assert_eq!( ::std::mem::align_of::(), 4usize, - concat!("Alignment of ", stringify!(TPML_DIGEST)) + "Alignment of TPML_DIGEST" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).count) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPML_DIGEST), - "::", - stringify!(count) - ) + "Offset of field: TPML_DIGEST::count" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).digests) as usize - ptr as usize }, 4usize, - concat!( - "Offset of field: ", - stringify!(TPML_DIGEST), - "::", - stringify!(digests) - ) + "Offset of field: TPML_DIGEST::digests" ); } impl Default for TPML_DIGEST { @@ -2167,32 +1803,22 @@ fn bindgen_test_layout_TPML_DIGEST_VALUES() { assert_eq!( ::std::mem::size_of::(), 1060usize, - concat!("Size of: ", stringify!(TPML_DIGEST_VALUES)) + "Size of TPML_DIGEST_VALUES" ); assert_eq!( ::std::mem::align_of::(), 4usize, - concat!("Alignment of ", stringify!(TPML_DIGEST_VALUES)) + "Alignment of TPML_DIGEST_VALUES" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).count) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPML_DIGEST_VALUES), - "::", - stringify!(count) - ) + "Offset of field: TPML_DIGEST_VALUES::count" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).digests) as usize - ptr as usize }, 4usize, - concat!( - "Offset of field: ", - stringify!(TPML_DIGEST_VALUES), - "::", - stringify!(digests) - ) + "Offset of field: TPML_DIGEST_VALUES::digests" ); } impl Default for TPML_DIGEST_VALUES { @@ -2217,32 +1843,22 @@ fn bindgen_test_layout_TPML_PCR_SELECTION() { assert_eq!( ::std::mem::size_of::(), 132usize, - concat!("Size of: ", stringify!(TPML_PCR_SELECTION)) + "Size of TPML_PCR_SELECTION" ); assert_eq!( ::std::mem::align_of::(), 4usize, - concat!("Alignment of ", stringify!(TPML_PCR_SELECTION)) + "Alignment of TPML_PCR_SELECTION" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).count) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPML_PCR_SELECTION), - "::", - stringify!(count) - ) + "Offset of field: TPML_PCR_SELECTION::count" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).pcrSelections) as usize - ptr as usize }, 4usize, - concat!( - "Offset of field: ", - stringify!(TPML_PCR_SELECTION), - "::", - stringify!(pcrSelections) - ) + "Offset of field: TPML_PCR_SELECTION::pcrSelections" ); } #[repr(C)] @@ -2258,32 +1874,22 @@ fn bindgen_test_layout_TPML_ALG_PROPERTY() { assert_eq!( ::std::mem::size_of::(), 1020usize, - concat!("Size of: ", stringify!(TPML_ALG_PROPERTY)) + "Size of TPML_ALG_PROPERTY" ); assert_eq!( ::std::mem::align_of::(), 4usize, - concat!("Alignment of ", stringify!(TPML_ALG_PROPERTY)) + "Alignment of TPML_ALG_PROPERTY" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).count) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPML_ALG_PROPERTY), - "::", - stringify!(count) - ) + "Offset of field: TPML_ALG_PROPERTY::count" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).algProperties) as usize - ptr as usize }, 4usize, - concat!( - "Offset of field: ", - stringify!(TPML_ALG_PROPERTY), - "::", - stringify!(algProperties) - ) + "Offset of field: TPML_ALG_PROPERTY::algProperties" ); } impl Default for TPML_ALG_PROPERTY { @@ -2309,32 +1915,22 @@ fn bindgen_test_layout_TPML_TAGGED_TPM_PROPERTY() { assert_eq!( ::std::mem::size_of::(), 1020usize, - concat!("Size of: ", stringify!(TPML_TAGGED_TPM_PROPERTY)) + "Size of TPML_TAGGED_TPM_PROPERTY" ); assert_eq!( ::std::mem::align_of::(), 4usize, - concat!("Alignment of ", stringify!(TPML_TAGGED_TPM_PROPERTY)) + "Alignment of TPML_TAGGED_TPM_PROPERTY" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).count) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPML_TAGGED_TPM_PROPERTY), - "::", - stringify!(count) - ) + "Offset of field: TPML_TAGGED_TPM_PROPERTY::count" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).tpmProperty) as usize - ptr as usize }, 4usize, - concat!( - "Offset of field: ", - stringify!(TPML_TAGGED_TPM_PROPERTY), - "::", - stringify!(tpmProperty) - ) + "Offset of field: TPML_TAGGED_TPM_PROPERTY::tpmProperty" ); } impl Default for TPML_TAGGED_TPM_PROPERTY { @@ -2360,32 +1956,22 @@ fn bindgen_test_layout_TPML_TAGGED_PCR_PROPERTY() { assert_eq!( ::std::mem::size_of::(), 1012usize, - concat!("Size of: ", stringify!(TPML_TAGGED_PCR_PROPERTY)) + "Size of TPML_TAGGED_PCR_PROPERTY" ); assert_eq!( ::std::mem::align_of::(), 4usize, - concat!("Alignment of ", stringify!(TPML_TAGGED_PCR_PROPERTY)) + "Alignment of TPML_TAGGED_PCR_PROPERTY" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).count) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPML_TAGGED_PCR_PROPERTY), - "::", - stringify!(count) - ) + "Offset of field: TPML_TAGGED_PCR_PROPERTY::count" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).pcrProperty) as usize - ptr as usize }, 4usize, - concat!( - "Offset of field: ", - stringify!(TPML_TAGGED_PCR_PROPERTY), - "::", - stringify!(pcrProperty) - ) + "Offset of field: TPML_TAGGED_PCR_PROPERTY::pcrProperty" ); } impl Default for TPML_TAGGED_PCR_PROPERTY { @@ -2410,32 +1996,22 @@ fn bindgen_test_layout_TPML_ECC_CURVE() { assert_eq!( ::std::mem::size_of::(), 1020usize, - concat!("Size of: ", stringify!(TPML_ECC_CURVE)) + "Size of TPML_ECC_CURVE" ); assert_eq!( ::std::mem::align_of::(), 4usize, - concat!("Alignment of ", stringify!(TPML_ECC_CURVE)) + "Alignment of TPML_ECC_CURVE" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).count) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPML_ECC_CURVE), - "::", - stringify!(count) - ) + "Offset of field: TPML_ECC_CURVE::count" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).eccCurves) as usize - ptr as usize }, 4usize, - concat!( - "Offset of field: ", - stringify!(TPML_ECC_CURVE), - "::", - stringify!(eccCurves) - ) + "Offset of field: TPML_ECC_CURVE::eccCurves" ); } impl Default for TPML_ECC_CURVE { @@ -2460,32 +2036,22 @@ fn bindgen_test_layout_TPML_TAGGED_POLICY() { assert_eq!( ::std::mem::size_of::(), 1012usize, - concat!("Size of: ", stringify!(TPML_TAGGED_POLICY)) + "Size of TPML_TAGGED_POLICY" ); assert_eq!( ::std::mem::align_of::(), 4usize, - concat!("Alignment of ", stringify!(TPML_TAGGED_POLICY)) + "Alignment of TPML_TAGGED_POLICY" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).count) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPML_TAGGED_POLICY), - "::", - stringify!(count) - ) + "Offset of field: TPML_TAGGED_POLICY::count" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).policies) as usize - ptr as usize }, 4usize, - concat!( - "Offset of field: ", - stringify!(TPML_TAGGED_POLICY), - "::", - stringify!(policies) - ) + "Offset of field: TPML_TAGGED_POLICY::policies" ); } impl Default for TPML_TAGGED_POLICY { @@ -2510,32 +2076,22 @@ fn bindgen_test_layout_TPML_ACT_DATA() { assert_eq!( ::std::mem::size_of::(), 1012usize, - concat!("Size of: ", stringify!(TPML_ACT_DATA)) + "Size of TPML_ACT_DATA" ); assert_eq!( ::std::mem::align_of::(), 4usize, - concat!("Alignment of ", stringify!(TPML_ACT_DATA)) + "Alignment of TPML_ACT_DATA" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).count) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPML_ACT_DATA), - "::", - stringify!(count) - ) + "Offset of field: TPML_ACT_DATA::count" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).actData) as usize - ptr as usize }, 4usize, - concat!( - "Offset of field: ", - stringify!(TPML_ACT_DATA), - "::", - stringify!(actData) - ) + "Offset of field: TPML_ACT_DATA::actData" ); } impl Default for TPML_ACT_DATA { @@ -2549,47 +2105,36 @@ impl Default for TPML_ACT_DATA { } #[repr(C)] #[derive(Debug, Copy, Clone)] -pub struct TPML_INTEL_PTT_PROPERTY { - pub count: UINT32, - pub property: [UINT32; 256usize], +pub struct TPM2B_MAX_CAP_BUFFER { + pub size: UINT16, + pub buffer: [BYTE; 1024usize], } #[test] -fn bindgen_test_layout_TPML_INTEL_PTT_PROPERTY() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); +fn bindgen_test_layout_TPM2B_MAX_CAP_BUFFER() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); let ptr = UNINIT.as_ptr(); assert_eq!( - ::std::mem::size_of::(), - 1028usize, - concat!("Size of: ", stringify!(TPML_INTEL_PTT_PROPERTY)) + ::std::mem::size_of::(), + 1026usize, + "Size of TPM2B_MAX_CAP_BUFFER" ); assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(TPML_INTEL_PTT_PROPERTY)) + ::std::mem::align_of::(), + 2usize, + "Alignment of TPM2B_MAX_CAP_BUFFER" ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).count) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).size) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPML_INTEL_PTT_PROPERTY), - "::", - stringify!(count) - ) + "Offset of field: TPM2B_MAX_CAP_BUFFER::size" ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).property) as usize - ptr as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(TPML_INTEL_PTT_PROPERTY), - "::", - stringify!(property) - ) + unsafe { ::std::ptr::addr_of!((*ptr).buffer) as usize - ptr as usize }, + 2usize, + "Offset of field: TPM2B_MAX_CAP_BUFFER::buffer" ); } -impl Default for TPML_INTEL_PTT_PROPERTY { +impl Default for TPM2B_MAX_CAP_BUFFER { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { @@ -2612,7 +2157,7 @@ pub union TPMU_CAPABILITIES { pub eccCurves: TPML_ECC_CURVE, pub authPolicies: TPML_TAGGED_POLICY, pub actData: TPML_ACT_DATA, - pub intelPttProperty: TPML_INTEL_PTT_PROPERTY, + pub vendor: TPM2B_MAX_CAP_BUFFER, } #[test] fn bindgen_test_layout_TPMU_CAPABILITIES() { @@ -2621,132 +2166,72 @@ fn bindgen_test_layout_TPMU_CAPABILITIES() { assert_eq!( ::std::mem::size_of::(), 1028usize, - concat!("Size of: ", stringify!(TPMU_CAPABILITIES)) + "Size of TPMU_CAPABILITIES" ); assert_eq!( ::std::mem::align_of::(), 4usize, - concat!("Alignment of ", stringify!(TPMU_CAPABILITIES)) + "Alignment of TPMU_CAPABILITIES" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).algorithms) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_CAPABILITIES), - "::", - stringify!(algorithms) - ) + "Offset of field: TPMU_CAPABILITIES::algorithms" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).handles) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_CAPABILITIES), - "::", - stringify!(handles) - ) + "Offset of field: TPMU_CAPABILITIES::handles" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).command) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_CAPABILITIES), - "::", - stringify!(command) - ) + "Offset of field: TPMU_CAPABILITIES::command" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).ppCommands) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_CAPABILITIES), - "::", - stringify!(ppCommands) - ) + "Offset of field: TPMU_CAPABILITIES::ppCommands" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).auditCommands) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_CAPABILITIES), - "::", - stringify!(auditCommands) - ) + "Offset of field: TPMU_CAPABILITIES::auditCommands" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).assignedPCR) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_CAPABILITIES), - "::", - stringify!(assignedPCR) - ) + "Offset of field: TPMU_CAPABILITIES::assignedPCR" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).tpmProperties) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_CAPABILITIES), - "::", - stringify!(tpmProperties) - ) + "Offset of field: TPMU_CAPABILITIES::tpmProperties" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).pcrProperties) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_CAPABILITIES), - "::", - stringify!(pcrProperties) - ) + "Offset of field: TPMU_CAPABILITIES::pcrProperties" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).eccCurves) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_CAPABILITIES), - "::", - stringify!(eccCurves) - ) + "Offset of field: TPMU_CAPABILITIES::eccCurves" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).authPolicies) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_CAPABILITIES), - "::", - stringify!(authPolicies) - ) + "Offset of field: TPMU_CAPABILITIES::authPolicies" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).actData) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_CAPABILITIES), - "::", - stringify!(actData) - ) + "Offset of field: TPMU_CAPABILITIES::actData" ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).intelPttProperty) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).vendor) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_CAPABILITIES), - "::", - stringify!(intelPttProperty) - ) + "Offset of field: TPMU_CAPABILITIES::vendor" ); } impl Default for TPMU_CAPABILITIES { @@ -2771,32 +2256,22 @@ fn bindgen_test_layout_TPMS_CAPABILITY_DATA() { assert_eq!( ::std::mem::size_of::(), 1032usize, - concat!("Size of: ", stringify!(TPMS_CAPABILITY_DATA)) + "Size of TPMS_CAPABILITY_DATA" ); assert_eq!( ::std::mem::align_of::(), 4usize, - concat!("Alignment of ", stringify!(TPMS_CAPABILITY_DATA)) + "Alignment of TPMS_CAPABILITY_DATA" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).capability) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMS_CAPABILITY_DATA), - "::", - stringify!(capability) - ) + "Offset of field: TPMS_CAPABILITY_DATA::capability" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).data) as usize - ptr as usize }, 4usize, - concat!( - "Offset of field: ", - stringify!(TPMS_CAPABILITY_DATA), - "::", - stringify!(data) - ) + "Offset of field: TPMS_CAPABILITY_DATA::data" ); } impl Default for TPMS_CAPABILITY_DATA { @@ -2823,52 +2298,32 @@ fn bindgen_test_layout_TPMS_CLOCK_INFO() { assert_eq!( ::std::mem::size_of::(), 24usize, - concat!("Size of: ", stringify!(TPMS_CLOCK_INFO)) + "Size of TPMS_CLOCK_INFO" ); assert_eq!( ::std::mem::align_of::(), 8usize, - concat!("Alignment of ", stringify!(TPMS_CLOCK_INFO)) + "Alignment of TPMS_CLOCK_INFO" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).clock) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMS_CLOCK_INFO), - "::", - stringify!(clock) - ) + "Offset of field: TPMS_CLOCK_INFO::clock" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).resetCount) as usize - ptr as usize }, 8usize, - concat!( - "Offset of field: ", - stringify!(TPMS_CLOCK_INFO), - "::", - stringify!(resetCount) - ) + "Offset of field: TPMS_CLOCK_INFO::resetCount" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).restartCount) as usize - ptr as usize }, 12usize, - concat!( - "Offset of field: ", - stringify!(TPMS_CLOCK_INFO), - "::", - stringify!(restartCount) - ) + "Offset of field: TPMS_CLOCK_INFO::restartCount" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).safe) as usize - ptr as usize }, 16usize, - concat!( - "Offset of field: ", - stringify!(TPMS_CLOCK_INFO), - "::", - stringify!(safe) - ) + "Offset of field: TPMS_CLOCK_INFO::safe" ); } #[repr(C)] @@ -2884,32 +2339,22 @@ fn bindgen_test_layout_TPMS_TIME_INFO() { assert_eq!( ::std::mem::size_of::(), 32usize, - concat!("Size of: ", stringify!(TPMS_TIME_INFO)) + "Size of TPMS_TIME_INFO" ); assert_eq!( ::std::mem::align_of::(), 8usize, - concat!("Alignment of ", stringify!(TPMS_TIME_INFO)) + "Alignment of TPMS_TIME_INFO" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).time) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMS_TIME_INFO), - "::", - stringify!(time) - ) + "Offset of field: TPMS_TIME_INFO::time" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).clockInfo) as usize - ptr as usize }, 8usize, - concat!( - "Offset of field: ", - stringify!(TPMS_TIME_INFO), - "::", - stringify!(clockInfo) - ) + "Offset of field: TPMS_TIME_INFO::clockInfo" ); } #[repr(C)] @@ -2926,32 +2371,22 @@ fn bindgen_test_layout_TPMS_TIME_ATTEST_INFO() { assert_eq!( ::std::mem::size_of::(), 40usize, - concat!("Size of: ", stringify!(TPMS_TIME_ATTEST_INFO)) + "Size of TPMS_TIME_ATTEST_INFO" ); assert_eq!( ::std::mem::align_of::(), 8usize, - concat!("Alignment of ", stringify!(TPMS_TIME_ATTEST_INFO)) + "Alignment of TPMS_TIME_ATTEST_INFO" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).time) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMS_TIME_ATTEST_INFO), - "::", - stringify!(time) - ) + "Offset of field: TPMS_TIME_ATTEST_INFO::time" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).firmwareVersion) as usize - ptr as usize }, 32usize, - concat!( - "Offset of field: ", - stringify!(TPMS_TIME_ATTEST_INFO), - "::", - stringify!(firmwareVersion) - ) + "Offset of field: TPMS_TIME_ATTEST_INFO::firmwareVersion" ); } #[repr(C)] @@ -2967,32 +2402,22 @@ fn bindgen_test_layout_TPMS_CERTIFY_INFO() { assert_eq!( ::std::mem::size_of::(), 140usize, - concat!("Size of: ", stringify!(TPMS_CERTIFY_INFO)) + "Size of TPMS_CERTIFY_INFO" ); assert_eq!( ::std::mem::align_of::(), 2usize, - concat!("Alignment of ", stringify!(TPMS_CERTIFY_INFO)) + "Alignment of TPMS_CERTIFY_INFO" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).name) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMS_CERTIFY_INFO), - "::", - stringify!(name) - ) + "Offset of field: TPMS_CERTIFY_INFO::name" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).qualifiedName) as usize - ptr as usize }, 70usize, - concat!( - "Offset of field: ", - stringify!(TPMS_CERTIFY_INFO), - "::", - stringify!(qualifiedName) - ) + "Offset of field: TPMS_CERTIFY_INFO::qualifiedName" ); } impl Default for TPMS_CERTIFY_INFO { @@ -3017,32 +2442,22 @@ fn bindgen_test_layout_TPMS_QUOTE_INFO() { assert_eq!( ::std::mem::size_of::(), 200usize, - concat!("Size of: ", stringify!(TPMS_QUOTE_INFO)) + "Size of TPMS_QUOTE_INFO" ); assert_eq!( ::std::mem::align_of::(), 4usize, - concat!("Alignment of ", stringify!(TPMS_QUOTE_INFO)) + "Alignment of TPMS_QUOTE_INFO" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).pcrSelect) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMS_QUOTE_INFO), - "::", - stringify!(pcrSelect) - ) + "Offset of field: TPMS_QUOTE_INFO::pcrSelect" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).pcrDigest) as usize - ptr as usize }, 132usize, - concat!( - "Offset of field: ", - stringify!(TPMS_QUOTE_INFO), - "::", - stringify!(pcrDigest) - ) + "Offset of field: TPMS_QUOTE_INFO::pcrDigest" ); } impl Default for TPMS_QUOTE_INFO { @@ -3070,52 +2485,32 @@ fn bindgen_test_layout_TPMS_COMMAND_AUDIT_INFO() { assert_eq!( ::std::mem::size_of::(), 144usize, - concat!("Size of: ", stringify!(TPMS_COMMAND_AUDIT_INFO)) + "Size of TPMS_COMMAND_AUDIT_INFO" ); assert_eq!( ::std::mem::align_of::(), 8usize, - concat!("Alignment of ", stringify!(TPMS_COMMAND_AUDIT_INFO)) + "Alignment of TPMS_COMMAND_AUDIT_INFO" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).auditCounter) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMS_COMMAND_AUDIT_INFO), - "::", - stringify!(auditCounter) - ) + "Offset of field: TPMS_COMMAND_AUDIT_INFO::auditCounter" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).digestAlg) as usize - ptr as usize }, 8usize, - concat!( - "Offset of field: ", - stringify!(TPMS_COMMAND_AUDIT_INFO), - "::", - stringify!(digestAlg) - ) + "Offset of field: TPMS_COMMAND_AUDIT_INFO::digestAlg" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).auditDigest) as usize - ptr as usize }, 10usize, - concat!( - "Offset of field: ", - stringify!(TPMS_COMMAND_AUDIT_INFO), - "::", - stringify!(auditDigest) - ) + "Offset of field: TPMS_COMMAND_AUDIT_INFO::auditDigest" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).commandDigest) as usize - ptr as usize }, 76usize, - concat!( - "Offset of field: ", - stringify!(TPMS_COMMAND_AUDIT_INFO), - "::", - stringify!(commandDigest) - ) + "Offset of field: TPMS_COMMAND_AUDIT_INFO::commandDigest" ); } impl Default for TPMS_COMMAND_AUDIT_INFO { @@ -3141,32 +2536,22 @@ fn bindgen_test_layout_TPMS_SESSION_AUDIT_INFO() { assert_eq!( ::std::mem::size_of::(), 68usize, - concat!("Size of: ", stringify!(TPMS_SESSION_AUDIT_INFO)) + "Size of TPMS_SESSION_AUDIT_INFO" ); assert_eq!( ::std::mem::align_of::(), 2usize, - concat!("Alignment of ", stringify!(TPMS_SESSION_AUDIT_INFO)) + "Alignment of TPMS_SESSION_AUDIT_INFO" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).exclusiveSession) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMS_SESSION_AUDIT_INFO), - "::", - stringify!(exclusiveSession) - ) + "Offset of field: TPMS_SESSION_AUDIT_INFO::exclusiveSession" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).sessionDigest) as usize - ptr as usize }, 2usize, - concat!( - "Offset of field: ", - stringify!(TPMS_SESSION_AUDIT_INFO), - "::", - stringify!(sessionDigest) - ) + "Offset of field: TPMS_SESSION_AUDIT_INFO::sessionDigest" ); } impl Default for TPMS_SESSION_AUDIT_INFO { @@ -3191,32 +2576,22 @@ fn bindgen_test_layout_TPMS_CREATION_INFO() { assert_eq!( ::std::mem::size_of::(), 136usize, - concat!("Size of: ", stringify!(TPMS_CREATION_INFO)) + "Size of TPMS_CREATION_INFO" ); assert_eq!( ::std::mem::align_of::(), 2usize, - concat!("Alignment of ", stringify!(TPMS_CREATION_INFO)) + "Alignment of TPMS_CREATION_INFO" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).objectName) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMS_CREATION_INFO), - "::", - stringify!(objectName) - ) + "Offset of field: TPMS_CREATION_INFO::objectName" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).creationHash) as usize - ptr as usize }, 70usize, - concat!( - "Offset of field: ", - stringify!(TPMS_CREATION_INFO), - "::", - stringify!(creationHash) - ) + "Offset of field: TPMS_CREATION_INFO::creationHash" ); } impl Default for TPMS_CREATION_INFO { @@ -3242,42 +2617,27 @@ fn bindgen_test_layout_TPMS_NV_CERTIFY_INFO() { assert_eq!( ::std::mem::size_of::(), 2122usize, - concat!("Size of: ", stringify!(TPMS_NV_CERTIFY_INFO)) + "Size of TPMS_NV_CERTIFY_INFO" ); assert_eq!( ::std::mem::align_of::(), 2usize, - concat!("Alignment of ", stringify!(TPMS_NV_CERTIFY_INFO)) + "Alignment of TPMS_NV_CERTIFY_INFO" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).indexName) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMS_NV_CERTIFY_INFO), - "::", - stringify!(indexName) - ) + "Offset of field: TPMS_NV_CERTIFY_INFO::indexName" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).offset) as usize - ptr as usize }, 70usize, - concat!( - "Offset of field: ", - stringify!(TPMS_NV_CERTIFY_INFO), - "::", - stringify!(offset) - ) + "Offset of field: TPMS_NV_CERTIFY_INFO::offset" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).nvContents) as usize - ptr as usize }, 72usize, - concat!( - "Offset of field: ", - stringify!(TPMS_NV_CERTIFY_INFO), - "::", - stringify!(nvContents) - ) + "Offset of field: TPMS_NV_CERTIFY_INFO::nvContents" ); } impl Default for TPMS_NV_CERTIFY_INFO { @@ -3303,32 +2663,22 @@ fn bindgen_test_layout_TPMS_NV_DIGEST_CERTIFY_INFO() { assert_eq!( ::std::mem::size_of::(), 136usize, - concat!("Size of: ", stringify!(TPMS_NV_DIGEST_CERTIFY_INFO)) + "Size of TPMS_NV_DIGEST_CERTIFY_INFO" ); assert_eq!( ::std::mem::align_of::(), 2usize, - concat!("Alignment of ", stringify!(TPMS_NV_DIGEST_CERTIFY_INFO)) + "Alignment of TPMS_NV_DIGEST_CERTIFY_INFO" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).indexName) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMS_NV_DIGEST_CERTIFY_INFO), - "::", - stringify!(indexName) - ) + "Offset of field: TPMS_NV_DIGEST_CERTIFY_INFO::indexName" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).nvDigest) as usize - ptr as usize }, 70usize, - concat!( - "Offset of field: ", - stringify!(TPMS_NV_DIGEST_CERTIFY_INFO), - "::", - stringify!(nvDigest) - ) + "Offset of field: TPMS_NV_DIGEST_CERTIFY_INFO::nvDigest" ); } impl Default for TPMS_NV_DIGEST_CERTIFY_INFO { @@ -3359,82 +2709,47 @@ fn bindgen_test_layout_TPMU_ATTEST() { assert_eq!( ::std::mem::size_of::(), 2128usize, - concat!("Size of: ", stringify!(TPMU_ATTEST)) + "Size of TPMU_ATTEST" ); assert_eq!( ::std::mem::align_of::(), 8usize, - concat!("Alignment of ", stringify!(TPMU_ATTEST)) + "Alignment of TPMU_ATTEST" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).certify) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_ATTEST), - "::", - stringify!(certify) - ) + "Offset of field: TPMU_ATTEST::certify" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).creation) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_ATTEST), - "::", - stringify!(creation) - ) + "Offset of field: TPMU_ATTEST::creation" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).quote) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_ATTEST), - "::", - stringify!(quote) - ) + "Offset of field: TPMU_ATTEST::quote" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).commandAudit) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_ATTEST), - "::", - stringify!(commandAudit) - ) + "Offset of field: TPMU_ATTEST::commandAudit" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).sessionAudit) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_ATTEST), - "::", - stringify!(sessionAudit) - ) + "Offset of field: TPMU_ATTEST::sessionAudit" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).time) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_ATTEST), - "::", - stringify!(time) - ) + "Offset of field: TPMU_ATTEST::time" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).nv) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_ATTEST), - "::", - stringify!(nv) - ) + "Offset of field: TPMU_ATTEST::nv" ); } impl Default for TPMU_ATTEST { @@ -3464,82 +2779,47 @@ fn bindgen_test_layout_TPMS_ATTEST() { assert_eq!( ::std::mem::size_of::(), 2304usize, - concat!("Size of: ", stringify!(TPMS_ATTEST)) + "Size of TPMS_ATTEST" ); assert_eq!( ::std::mem::align_of::(), 8usize, - concat!("Alignment of ", stringify!(TPMS_ATTEST)) + "Alignment of TPMS_ATTEST" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).magic) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMS_ATTEST), - "::", - stringify!(magic) - ) + "Offset of field: TPMS_ATTEST::magic" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).type_) as usize - ptr as usize }, 4usize, - concat!( - "Offset of field: ", - stringify!(TPMS_ATTEST), - "::", - stringify!(type_) - ) + "Offset of field: TPMS_ATTEST::type_" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).qualifiedSigner) as usize - ptr as usize }, 6usize, - concat!( - "Offset of field: ", - stringify!(TPMS_ATTEST), - "::", - stringify!(qualifiedSigner) - ) + "Offset of field: TPMS_ATTEST::qualifiedSigner" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).extraData) as usize - ptr as usize }, 76usize, - concat!( - "Offset of field: ", - stringify!(TPMS_ATTEST), - "::", - stringify!(extraData) - ) + "Offset of field: TPMS_ATTEST::extraData" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).clockInfo) as usize - ptr as usize }, 144usize, - concat!( - "Offset of field: ", - stringify!(TPMS_ATTEST), - "::", - stringify!(clockInfo) - ) + "Offset of field: TPMS_ATTEST::clockInfo" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).firmwareVersion) as usize - ptr as usize }, 168usize, - concat!( - "Offset of field: ", - stringify!(TPMS_ATTEST), - "::", - stringify!(firmwareVersion) - ) + "Offset of field: TPMS_ATTEST::firmwareVersion" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).attested) as usize - ptr as usize }, 176usize, - concat!( - "Offset of field: ", - stringify!(TPMS_ATTEST), - "::", - stringify!(attested) - ) + "Offset of field: TPMS_ATTEST::attested" ); } impl Default for TPMS_ATTEST { @@ -3564,32 +2844,22 @@ fn bindgen_test_layout_TPM2B_ATTEST() { assert_eq!( ::std::mem::size_of::(), 2306usize, - concat!("Size of: ", stringify!(TPM2B_ATTEST)) + "Size of TPM2B_ATTEST" ); assert_eq!( ::std::mem::align_of::(), 2usize, - concat!("Alignment of ", stringify!(TPM2B_ATTEST)) + "Alignment of TPM2B_ATTEST" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).size) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPM2B_ATTEST), - "::", - stringify!(size) - ) + "Offset of field: TPM2B_ATTEST::size" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).attestationData) as usize - ptr as usize }, 2usize, - concat!( - "Offset of field: ", - stringify!(TPM2B_ATTEST), - "::", - stringify!(attestationData) - ) + "Offset of field: TPM2B_ATTEST::attestationData" ); } impl Default for TPM2B_ATTEST { @@ -3616,52 +2886,32 @@ fn bindgen_test_layout_TPMS_AUTH_COMMAND() { assert_eq!( ::std::mem::size_of::(), 140usize, - concat!("Size of: ", stringify!(TPMS_AUTH_COMMAND)) + "Size of TPMS_AUTH_COMMAND" ); assert_eq!( ::std::mem::align_of::(), 4usize, - concat!("Alignment of ", stringify!(TPMS_AUTH_COMMAND)) + "Alignment of TPMS_AUTH_COMMAND" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).sessionHandle) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMS_AUTH_COMMAND), - "::", - stringify!(sessionHandle) - ) + "Offset of field: TPMS_AUTH_COMMAND::sessionHandle" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).nonce) as usize - ptr as usize }, 4usize, - concat!( - "Offset of field: ", - stringify!(TPMS_AUTH_COMMAND), - "::", - stringify!(nonce) - ) + "Offset of field: TPMS_AUTH_COMMAND::nonce" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).sessionAttributes) as usize - ptr as usize }, 70usize, - concat!( - "Offset of field: ", - stringify!(TPMS_AUTH_COMMAND), - "::", - stringify!(sessionAttributes) - ) + "Offset of field: TPMS_AUTH_COMMAND::sessionAttributes" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).hmac) as usize - ptr as usize }, 72usize, - concat!( - "Offset of field: ", - stringify!(TPMS_AUTH_COMMAND), - "::", - stringify!(hmac) - ) + "Offset of field: TPMS_AUTH_COMMAND::hmac" ); } impl Default for TPMS_AUTH_COMMAND { @@ -3687,42 +2937,27 @@ fn bindgen_test_layout_TPMS_AUTH_RESPONSE() { assert_eq!( ::std::mem::size_of::(), 134usize, - concat!("Size of: ", stringify!(TPMS_AUTH_RESPONSE)) + "Size of TPMS_AUTH_RESPONSE" ); assert_eq!( ::std::mem::align_of::(), 2usize, - concat!("Alignment of ", stringify!(TPMS_AUTH_RESPONSE)) + "Alignment of TPMS_AUTH_RESPONSE" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).nonce) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMS_AUTH_RESPONSE), - "::", - stringify!(nonce) - ) + "Offset of field: TPMS_AUTH_RESPONSE::nonce" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).sessionAttributes) as usize - ptr as usize }, 66usize, - concat!( - "Offset of field: ", - stringify!(TPMS_AUTH_RESPONSE), - "::", - stringify!(sessionAttributes) - ) + "Offset of field: TPMS_AUTH_RESPONSE::sessionAttributes" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).hmac) as usize - ptr as usize }, 68usize, - concat!( - "Offset of field: ", - stringify!(TPMS_AUTH_RESPONSE), - "::", - stringify!(hmac) - ) + "Offset of field: TPMS_AUTH_RESPONSE::hmac" ); } impl Default for TPMS_AUTH_RESPONSE { @@ -3745,6 +2980,7 @@ pub union TPMU_SYM_KEY_BITS { pub camellia: TPMI_CAMELLIA_KEY_BITS, pub sym: TPM2_KEY_BITS, pub exclusiveOr: TPMI_ALG_HASH, + pub null: TPMS_EMPTY, } #[test] fn bindgen_test_layout_TPMU_SYM_KEY_BITS() { @@ -3753,62 +2989,42 @@ fn bindgen_test_layout_TPMU_SYM_KEY_BITS() { assert_eq!( ::std::mem::size_of::(), 2usize, - concat!("Size of: ", stringify!(TPMU_SYM_KEY_BITS)) + "Size of TPMU_SYM_KEY_BITS" ); assert_eq!( ::std::mem::align_of::(), 2usize, - concat!("Alignment of ", stringify!(TPMU_SYM_KEY_BITS)) + "Alignment of TPMU_SYM_KEY_BITS" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).aes) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_SYM_KEY_BITS), - "::", - stringify!(aes) - ) + "Offset of field: TPMU_SYM_KEY_BITS::aes" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).sm4) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_SYM_KEY_BITS), - "::", - stringify!(sm4) - ) + "Offset of field: TPMU_SYM_KEY_BITS::sm4" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).camellia) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_SYM_KEY_BITS), - "::", - stringify!(camellia) - ) + "Offset of field: TPMU_SYM_KEY_BITS::camellia" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).sym) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_SYM_KEY_BITS), - "::", - stringify!(sym) - ) + "Offset of field: TPMU_SYM_KEY_BITS::sym" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).exclusiveOr) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_SYM_KEY_BITS), - "::", - stringify!(exclusiveOr) - ) + "Offset of field: TPMU_SYM_KEY_BITS::exclusiveOr" + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).null) as usize - ptr as usize }, + 0usize, + "Offset of field: TPMU_SYM_KEY_BITS::null" ); } impl Default for TPMU_SYM_KEY_BITS { @@ -3827,6 +3043,8 @@ pub union TPMU_SYM_MODE { pub sm4: TPMI_ALG_SYM_MODE, pub camellia: TPMI_ALG_SYM_MODE, pub sym: TPMI_ALG_SYM_MODE, + pub exclusiveOr: TPMS_EMPTY, + pub null: TPMS_EMPTY, } #[test] fn bindgen_test_layout_TPMU_SYM_MODE() { @@ -3835,52 +3053,42 @@ fn bindgen_test_layout_TPMU_SYM_MODE() { assert_eq!( ::std::mem::size_of::(), 2usize, - concat!("Size of: ", stringify!(TPMU_SYM_MODE)) + "Size of TPMU_SYM_MODE" ); assert_eq!( ::std::mem::align_of::(), 2usize, - concat!("Alignment of ", stringify!(TPMU_SYM_MODE)) + "Alignment of TPMU_SYM_MODE" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).aes) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_SYM_MODE), - "::", - stringify!(aes) - ) + "Offset of field: TPMU_SYM_MODE::aes" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).sm4) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_SYM_MODE), - "::", - stringify!(sm4) - ) + "Offset of field: TPMU_SYM_MODE::sm4" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).camellia) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_SYM_MODE), - "::", - stringify!(camellia) - ) + "Offset of field: TPMU_SYM_MODE::camellia" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).sym) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_SYM_MODE), - "::", - stringify!(sym) - ) + "Offset of field: TPMU_SYM_MODE::sym" + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).exclusiveOr) as usize - ptr as usize }, + 0usize, + "Offset of field: TPMU_SYM_MODE::exclusiveOr" + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).null) as usize - ptr as usize }, + 0usize, + "Offset of field: TPMU_SYM_MODE::null" ); } impl Default for TPMU_SYM_MODE { @@ -3906,42 +3114,27 @@ fn bindgen_test_layout_TPMT_SYM_DEF() { assert_eq!( ::std::mem::size_of::(), 6usize, - concat!("Size of: ", stringify!(TPMT_SYM_DEF)) + "Size of TPMT_SYM_DEF" ); assert_eq!( ::std::mem::align_of::(), 2usize, - concat!("Alignment of ", stringify!(TPMT_SYM_DEF)) + "Alignment of TPMT_SYM_DEF" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).algorithm) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMT_SYM_DEF), - "::", - stringify!(algorithm) - ) + "Offset of field: TPMT_SYM_DEF::algorithm" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).keyBits) as usize - ptr as usize }, 2usize, - concat!( - "Offset of field: ", - stringify!(TPMT_SYM_DEF), - "::", - stringify!(keyBits) - ) + "Offset of field: TPMT_SYM_DEF::keyBits" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).mode) as usize - ptr as usize }, 4usize, - concat!( - "Offset of field: ", - stringify!(TPMT_SYM_DEF), - "::", - stringify!(mode) - ) + "Offset of field: TPMT_SYM_DEF::mode" ); } impl Default for TPMT_SYM_DEF { @@ -3967,42 +3160,27 @@ fn bindgen_test_layout_TPMT_SYM_DEF_OBJECT() { assert_eq!( ::std::mem::size_of::(), 6usize, - concat!("Size of: ", stringify!(TPMT_SYM_DEF_OBJECT)) + "Size of TPMT_SYM_DEF_OBJECT" ); assert_eq!( ::std::mem::align_of::(), 2usize, - concat!("Alignment of ", stringify!(TPMT_SYM_DEF_OBJECT)) + "Alignment of TPMT_SYM_DEF_OBJECT" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).algorithm) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMT_SYM_DEF_OBJECT), - "::", - stringify!(algorithm) - ) + "Offset of field: TPMT_SYM_DEF_OBJECT::algorithm" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).keyBits) as usize - ptr as usize }, 2usize, - concat!( - "Offset of field: ", - stringify!(TPMT_SYM_DEF_OBJECT), - "::", - stringify!(keyBits) - ) + "Offset of field: TPMT_SYM_DEF_OBJECT::keyBits" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).mode) as usize - ptr as usize }, 4usize, - concat!( - "Offset of field: ", - stringify!(TPMT_SYM_DEF_OBJECT), - "::", - stringify!(mode) - ) + "Offset of field: TPMT_SYM_DEF_OBJECT::mode" ); } impl Default for TPMT_SYM_DEF_OBJECT { @@ -4027,32 +3205,22 @@ fn bindgen_test_layout_TPM2B_SYM_KEY() { assert_eq!( ::std::mem::size_of::(), 34usize, - concat!("Size of: ", stringify!(TPM2B_SYM_KEY)) + "Size of TPM2B_SYM_KEY" ); assert_eq!( ::std::mem::align_of::(), 2usize, - concat!("Alignment of ", stringify!(TPM2B_SYM_KEY)) + "Alignment of TPM2B_SYM_KEY" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).size) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPM2B_SYM_KEY), - "::", - stringify!(size) - ) + "Offset of field: TPM2B_SYM_KEY::size" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).buffer) as usize - ptr as usize }, 2usize, - concat!( - "Offset of field: ", - stringify!(TPM2B_SYM_KEY), - "::", - stringify!(buffer) - ) + "Offset of field: TPM2B_SYM_KEY::buffer" ); } #[repr(C)] @@ -4067,22 +3235,17 @@ fn bindgen_test_layout_TPMS_SYMCIPHER_PARMS() { assert_eq!( ::std::mem::size_of::(), 6usize, - concat!("Size of: ", stringify!(TPMS_SYMCIPHER_PARMS)) + "Size of TPMS_SYMCIPHER_PARMS" ); assert_eq!( ::std::mem::align_of::(), 2usize, - concat!("Alignment of ", stringify!(TPMS_SYMCIPHER_PARMS)) + "Alignment of TPMS_SYMCIPHER_PARMS" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).sym) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMS_SYMCIPHER_PARMS), - "::", - stringify!(sym) - ) + "Offset of field: TPMS_SYMCIPHER_PARMS::sym" ); } impl Default for TPMS_SYMCIPHER_PARMS { @@ -4095,6 +3258,149 @@ impl Default for TPMS_SYMCIPHER_PARMS { } } #[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct TPM2B_LABEL { + pub size: UINT16, + pub buffer: [BYTE; 32usize], +} +#[test] +fn bindgen_test_layout_TPM2B_LABEL() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 34usize, + "Size of TPM2B_LABEL" + ); + assert_eq!( + ::std::mem::align_of::(), + 2usize, + "Alignment of TPM2B_LABEL" + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).size) as usize - ptr as usize }, + 0usize, + "Offset of field: TPM2B_LABEL::size" + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).buffer) as usize - ptr as usize }, + 2usize, + "Offset of field: TPM2B_LABEL::buffer" + ); +} +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct TPMS_DERIVE { + pub label: TPM2B_LABEL, + pub context: TPM2B_LABEL, +} +#[test] +fn bindgen_test_layout_TPMS_DERIVE() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 68usize, + "Size of TPMS_DERIVE" + ); + assert_eq!( + ::std::mem::align_of::(), + 2usize, + "Alignment of TPMS_DERIVE" + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).label) as usize - ptr as usize }, + 0usize, + "Offset of field: TPMS_DERIVE::label" + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).context) as usize - ptr as usize }, + 34usize, + "Offset of field: TPMS_DERIVE::context" + ); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct TPM2B_DERIVE { + pub size: UINT16, + pub buffer: [BYTE; 68usize], +} +#[test] +fn bindgen_test_layout_TPM2B_DERIVE() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 70usize, + "Size of TPM2B_DERIVE" + ); + assert_eq!( + ::std::mem::align_of::(), + 2usize, + "Alignment of TPM2B_DERIVE" + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).size) as usize - ptr as usize }, + 0usize, + "Offset of field: TPM2B_DERIVE::size" + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).buffer) as usize - ptr as usize }, + 2usize, + "Offset of field: TPM2B_DERIVE::buffer" + ); +} +impl Default for TPM2B_DERIVE { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union TPMU_SENSITIVE_CREATE { + pub create: [BYTE; 256usize], + pub derive: TPMS_DERIVE, +} +#[test] +fn bindgen_test_layout_TPMU_SENSITIVE_CREATE() { + const UNINIT: ::std::mem::MaybeUninit = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 256usize, + "Size of TPMU_SENSITIVE_CREATE" + ); + assert_eq!( + ::std::mem::align_of::(), + 2usize, + "Alignment of TPMU_SENSITIVE_CREATE" + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).create) as usize - ptr as usize }, + 0usize, + "Offset of field: TPMU_SENSITIVE_CREATE::create" + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).derive) as usize - ptr as usize }, + 0usize, + "Offset of field: TPMU_SENSITIVE_CREATE::derive" + ); +} +impl Default for TPMU_SENSITIVE_CREATE { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +#[repr(C)] #[derive(Debug, Copy, Clone)] pub struct TPM2B_SENSITIVE_DATA { pub size: UINT16, @@ -4107,32 +3413,22 @@ fn bindgen_test_layout_TPM2B_SENSITIVE_DATA() { assert_eq!( ::std::mem::size_of::(), 258usize, - concat!("Size of: ", stringify!(TPM2B_SENSITIVE_DATA)) + "Size of TPM2B_SENSITIVE_DATA" ); assert_eq!( ::std::mem::align_of::(), 2usize, - concat!("Alignment of ", stringify!(TPM2B_SENSITIVE_DATA)) + "Alignment of TPM2B_SENSITIVE_DATA" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).size) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPM2B_SENSITIVE_DATA), - "::", - stringify!(size) - ) + "Offset of field: TPM2B_SENSITIVE_DATA::size" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).buffer) as usize - ptr as usize }, 2usize, - concat!( - "Offset of field: ", - stringify!(TPM2B_SENSITIVE_DATA), - "::", - stringify!(buffer) - ) + "Offset of field: TPM2B_SENSITIVE_DATA::buffer" ); } impl Default for TPM2B_SENSITIVE_DATA { @@ -4158,32 +3454,22 @@ fn bindgen_test_layout_TPMS_SENSITIVE_CREATE() { assert_eq!( ::std::mem::size_of::(), 324usize, - concat!("Size of: ", stringify!(TPMS_SENSITIVE_CREATE)) + "Size of TPMS_SENSITIVE_CREATE" ); assert_eq!( ::std::mem::align_of::(), 2usize, - concat!("Alignment of ", stringify!(TPMS_SENSITIVE_CREATE)) + "Alignment of TPMS_SENSITIVE_CREATE" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).userAuth) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMS_SENSITIVE_CREATE), - "::", - stringify!(userAuth) - ) + "Offset of field: TPMS_SENSITIVE_CREATE::userAuth" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).data) as usize - ptr as usize }, 66usize, - concat!( - "Offset of field: ", - stringify!(TPMS_SENSITIVE_CREATE), - "::", - stringify!(data) - ) + "Offset of field: TPMS_SENSITIVE_CREATE::data" ); } impl Default for TPMS_SENSITIVE_CREATE { @@ -4209,32 +3495,22 @@ fn bindgen_test_layout_TPM2B_SENSITIVE_CREATE() { assert_eq!( ::std::mem::size_of::(), 326usize, - concat!("Size of: ", stringify!(TPM2B_SENSITIVE_CREATE)) + "Size of TPM2B_SENSITIVE_CREATE" ); assert_eq!( ::std::mem::align_of::(), 2usize, - concat!("Alignment of ", stringify!(TPM2B_SENSITIVE_CREATE)) + "Alignment of TPM2B_SENSITIVE_CREATE" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).size) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPM2B_SENSITIVE_CREATE), - "::", - stringify!(size) - ) + "Offset of field: TPM2B_SENSITIVE_CREATE::size" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).sensitive) as usize - ptr as usize }, 2usize, - concat!( - "Offset of field: ", - stringify!(TPM2B_SENSITIVE_CREATE), - "::", - stringify!(sensitive) - ) + "Offset of field: TPM2B_SENSITIVE_CREATE::sensitive" ); } impl Default for TPM2B_SENSITIVE_CREATE { @@ -4258,22 +3534,17 @@ fn bindgen_test_layout_TPMS_SCHEME_HASH() { assert_eq!( ::std::mem::size_of::(), 2usize, - concat!("Size of: ", stringify!(TPMS_SCHEME_HASH)) + "Size of TPMS_SCHEME_HASH" ); assert_eq!( ::std::mem::align_of::(), 2usize, - concat!("Alignment of ", stringify!(TPMS_SCHEME_HASH)) + "Alignment of TPMS_SCHEME_HASH" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).hashAlg) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMS_SCHEME_HASH), - "::", - stringify!(hashAlg) - ) + "Offset of field: TPMS_SCHEME_HASH::hashAlg" ); } #[repr(C)] @@ -4289,32 +3560,22 @@ fn bindgen_test_layout_TPMS_SCHEME_ECDAA() { assert_eq!( ::std::mem::size_of::(), 4usize, - concat!("Size of: ", stringify!(TPMS_SCHEME_ECDAA)) + "Size of TPMS_SCHEME_ECDAA" ); assert_eq!( ::std::mem::align_of::(), 2usize, - concat!("Alignment of ", stringify!(TPMS_SCHEME_ECDAA)) + "Alignment of TPMS_SCHEME_ECDAA" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).hashAlg) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMS_SCHEME_ECDAA), - "::", - stringify!(hashAlg) - ) + "Offset of field: TPMS_SCHEME_ECDAA::hashAlg" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).count) as usize - ptr as usize }, 2usize, - concat!( - "Offset of field: ", - stringify!(TPMS_SCHEME_ECDAA), - "::", - stringify!(count) - ) + "Offset of field: TPMS_SCHEME_ECDAA::count" ); } pub type TPMI_ALG_KEYEDHASH_SCHEME = TPM2_ALG_ID; @@ -4332,32 +3593,22 @@ fn bindgen_test_layout_TPMS_SCHEME_XOR() { assert_eq!( ::std::mem::size_of::(), 4usize, - concat!("Size of: ", stringify!(TPMS_SCHEME_XOR)) + "Size of TPMS_SCHEME_XOR" ); assert_eq!( ::std::mem::align_of::(), 2usize, - concat!("Alignment of ", stringify!(TPMS_SCHEME_XOR)) + "Alignment of TPMS_SCHEME_XOR" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).hashAlg) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMS_SCHEME_XOR), - "::", - stringify!(hashAlg) - ) + "Offset of field: TPMS_SCHEME_XOR::hashAlg" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).kdf) as usize - ptr as usize }, 2usize, - concat!( - "Offset of field: ", - stringify!(TPMS_SCHEME_XOR), - "::", - stringify!(kdf) - ) + "Offset of field: TPMS_SCHEME_XOR::kdf" ); } #[repr(C)] @@ -4365,6 +3616,7 @@ fn bindgen_test_layout_TPMS_SCHEME_XOR() { pub union TPMU_SCHEME_KEYEDHASH { pub hmac: TPMS_SCHEME_HMAC, pub exclusiveOr: TPMS_SCHEME_XOR, + pub null: TPMS_EMPTY, } #[test] fn bindgen_test_layout_TPMU_SCHEME_KEYEDHASH() { @@ -4374,32 +3626,27 @@ fn bindgen_test_layout_TPMU_SCHEME_KEYEDHASH() { assert_eq!( ::std::mem::size_of::(), 4usize, - concat!("Size of: ", stringify!(TPMU_SCHEME_KEYEDHASH)) + "Size of TPMU_SCHEME_KEYEDHASH" ); assert_eq!( ::std::mem::align_of::(), 2usize, - concat!("Alignment of ", stringify!(TPMU_SCHEME_KEYEDHASH)) + "Alignment of TPMU_SCHEME_KEYEDHASH" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).hmac) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_SCHEME_KEYEDHASH), - "::", - stringify!(hmac) - ) + "Offset of field: TPMU_SCHEME_KEYEDHASH::hmac" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).exclusiveOr) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_SCHEME_KEYEDHASH), - "::", - stringify!(exclusiveOr) - ) + "Offset of field: TPMU_SCHEME_KEYEDHASH::exclusiveOr" + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).null) as usize - ptr as usize }, + 0usize, + "Offset of field: TPMU_SCHEME_KEYEDHASH::null" ); } impl Default for TPMU_SCHEME_KEYEDHASH { @@ -4425,32 +3672,22 @@ fn bindgen_test_layout_TPMT_KEYEDHASH_SCHEME() { assert_eq!( ::std::mem::size_of::(), 6usize, - concat!("Size of: ", stringify!(TPMT_KEYEDHASH_SCHEME)) + "Size of TPMT_KEYEDHASH_SCHEME" ); assert_eq!( ::std::mem::align_of::(), 2usize, - concat!("Alignment of ", stringify!(TPMT_KEYEDHASH_SCHEME)) + "Alignment of TPMT_KEYEDHASH_SCHEME" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).scheme) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMT_KEYEDHASH_SCHEME), - "::", - stringify!(scheme) - ) + "Offset of field: TPMT_KEYEDHASH_SCHEME::scheme" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).details) as usize - ptr as usize }, 2usize, - concat!( - "Offset of field: ", - stringify!(TPMT_KEYEDHASH_SCHEME), - "::", - stringify!(details) - ) + "Offset of field: TPMT_KEYEDHASH_SCHEME::details" ); } impl Default for TPMT_KEYEDHASH_SCHEME { @@ -4479,6 +3716,7 @@ pub union TPMU_SIG_SCHEME { pub ecschnorr: TPMS_SIG_SCHEME_ECSCHNORR, pub hmac: TPMS_SCHEME_HMAC, pub any: TPMS_SCHEME_HASH, + pub null: TPMS_EMPTY, } #[test] fn bindgen_test_layout_TPMU_SIG_SCHEME() { @@ -4487,92 +3725,57 @@ fn bindgen_test_layout_TPMU_SIG_SCHEME() { assert_eq!( ::std::mem::size_of::(), 4usize, - concat!("Size of: ", stringify!(TPMU_SIG_SCHEME)) + "Size of TPMU_SIG_SCHEME" ); assert_eq!( ::std::mem::align_of::(), 2usize, - concat!("Alignment of ", stringify!(TPMU_SIG_SCHEME)) + "Alignment of TPMU_SIG_SCHEME" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).rsassa) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_SIG_SCHEME), - "::", - stringify!(rsassa) - ) + "Offset of field: TPMU_SIG_SCHEME::rsassa" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).rsapss) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_SIG_SCHEME), - "::", - stringify!(rsapss) - ) + "Offset of field: TPMU_SIG_SCHEME::rsapss" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).ecdsa) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_SIG_SCHEME), - "::", - stringify!(ecdsa) - ) + "Offset of field: TPMU_SIG_SCHEME::ecdsa" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).ecdaa) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_SIG_SCHEME), - "::", - stringify!(ecdaa) - ) + "Offset of field: TPMU_SIG_SCHEME::ecdaa" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).sm2) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_SIG_SCHEME), - "::", - stringify!(sm2) - ) + "Offset of field: TPMU_SIG_SCHEME::sm2" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).ecschnorr) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_SIG_SCHEME), - "::", - stringify!(ecschnorr) - ) + "Offset of field: TPMU_SIG_SCHEME::ecschnorr" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).hmac) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_SIG_SCHEME), - "::", - stringify!(hmac) - ) + "Offset of field: TPMU_SIG_SCHEME::hmac" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).any) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_SIG_SCHEME), - "::", - stringify!(any) - ) + "Offset of field: TPMU_SIG_SCHEME::any" + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).null) as usize - ptr as usize }, + 0usize, + "Offset of field: TPMU_SIG_SCHEME::null" ); } impl Default for TPMU_SIG_SCHEME { @@ -4597,32 +3800,22 @@ fn bindgen_test_layout_TPMT_SIG_SCHEME() { assert_eq!( ::std::mem::size_of::(), 6usize, - concat!("Size of: ", stringify!(TPMT_SIG_SCHEME)) + "Size of TPMT_SIG_SCHEME" ); assert_eq!( ::std::mem::align_of::(), 2usize, - concat!("Alignment of ", stringify!(TPMT_SIG_SCHEME)) + "Alignment of TPMT_SIG_SCHEME" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).scheme) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMT_SIG_SCHEME), - "::", - stringify!(scheme) - ) + "Offset of field: TPMT_SIG_SCHEME::scheme" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).details) as usize - ptr as usize }, 2usize, - concat!( - "Offset of field: ", - stringify!(TPMT_SIG_SCHEME), - "::", - stringify!(details) - ) + "Offset of field: TPMT_SIG_SCHEME::details" ); } impl Default for TPMT_SIG_SCHEME { @@ -4649,6 +3842,7 @@ pub union TPMU_KDF_SCHEME { pub kdf1_sp800_56a: TPMS_SCHEME_KDF1_SP800_56A, pub kdf2: TPMS_SCHEME_KDF2, pub kdf1_sp800_108: TPMS_SCHEME_KDF1_SP800_108, + pub null: TPMS_EMPTY, } #[test] fn bindgen_test_layout_TPMU_KDF_SCHEME() { @@ -4657,52 +3851,37 @@ fn bindgen_test_layout_TPMU_KDF_SCHEME() { assert_eq!( ::std::mem::size_of::(), 2usize, - concat!("Size of: ", stringify!(TPMU_KDF_SCHEME)) + "Size of TPMU_KDF_SCHEME" ); assert_eq!( ::std::mem::align_of::(), 2usize, - concat!("Alignment of ", stringify!(TPMU_KDF_SCHEME)) + "Alignment of TPMU_KDF_SCHEME" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).mgf1) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_KDF_SCHEME), - "::", - stringify!(mgf1) - ) + "Offset of field: TPMU_KDF_SCHEME::mgf1" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).kdf1_sp800_56a) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_KDF_SCHEME), - "::", - stringify!(kdf1_sp800_56a) - ) + "Offset of field: TPMU_KDF_SCHEME::kdf1_sp800_56a" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).kdf2) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_KDF_SCHEME), - "::", - stringify!(kdf2) - ) + "Offset of field: TPMU_KDF_SCHEME::kdf2" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).kdf1_sp800_108) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_KDF_SCHEME), - "::", - stringify!(kdf1_sp800_108) - ) + "Offset of field: TPMU_KDF_SCHEME::kdf1_sp800_108" + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).null) as usize - ptr as usize }, + 0usize, + "Offset of field: TPMU_KDF_SCHEME::null" ); } impl Default for TPMU_KDF_SCHEME { @@ -4727,32 +3906,22 @@ fn bindgen_test_layout_TPMT_KDF_SCHEME() { assert_eq!( ::std::mem::size_of::(), 4usize, - concat!("Size of: ", stringify!(TPMT_KDF_SCHEME)) + "Size of TPMT_KDF_SCHEME" ); assert_eq!( ::std::mem::align_of::(), 2usize, - concat!("Alignment of ", stringify!(TPMT_KDF_SCHEME)) + "Alignment of TPMT_KDF_SCHEME" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).scheme) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMT_KDF_SCHEME), - "::", - stringify!(scheme) - ) + "Offset of field: TPMT_KDF_SCHEME::scheme" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).details) as usize - ptr as usize }, 2usize, - concat!( - "Offset of field: ", - stringify!(TPMT_KDF_SCHEME), - "::", - stringify!(details) - ) + "Offset of field: TPMT_KDF_SCHEME::details" ); } impl Default for TPMT_KDF_SCHEME { @@ -4779,6 +3948,7 @@ pub union TPMU_ASYM_SCHEME { pub rsaes: TPMS_ENC_SCHEME_RSAES, pub oaep: TPMS_ENC_SCHEME_OAEP, pub anySig: TPMS_SCHEME_HASH, + pub null: TPMS_EMPTY, } #[test] fn bindgen_test_layout_TPMU_ASYM_SCHEME() { @@ -4787,122 +3957,72 @@ fn bindgen_test_layout_TPMU_ASYM_SCHEME() { assert_eq!( ::std::mem::size_of::(), 4usize, - concat!("Size of: ", stringify!(TPMU_ASYM_SCHEME)) + "Size of TPMU_ASYM_SCHEME" ); assert_eq!( ::std::mem::align_of::(), 2usize, - concat!("Alignment of ", stringify!(TPMU_ASYM_SCHEME)) + "Alignment of TPMU_ASYM_SCHEME" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).ecdh) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_ASYM_SCHEME), - "::", - stringify!(ecdh) - ) + "Offset of field: TPMU_ASYM_SCHEME::ecdh" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).ecmqv) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_ASYM_SCHEME), - "::", - stringify!(ecmqv) - ) + "Offset of field: TPMU_ASYM_SCHEME::ecmqv" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).rsassa) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_ASYM_SCHEME), - "::", - stringify!(rsassa) - ) + "Offset of field: TPMU_ASYM_SCHEME::rsassa" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).rsapss) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_ASYM_SCHEME), - "::", - stringify!(rsapss) - ) + "Offset of field: TPMU_ASYM_SCHEME::rsapss" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).ecdsa) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_ASYM_SCHEME), - "::", - stringify!(ecdsa) - ) + "Offset of field: TPMU_ASYM_SCHEME::ecdsa" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).ecdaa) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_ASYM_SCHEME), - "::", - stringify!(ecdaa) - ) + "Offset of field: TPMU_ASYM_SCHEME::ecdaa" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).sm2) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_ASYM_SCHEME), - "::", - stringify!(sm2) - ) + "Offset of field: TPMU_ASYM_SCHEME::sm2" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).ecschnorr) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_ASYM_SCHEME), - "::", - stringify!(ecschnorr) - ) + "Offset of field: TPMU_ASYM_SCHEME::ecschnorr" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).rsaes) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_ASYM_SCHEME), - "::", - stringify!(rsaes) - ) + "Offset of field: TPMU_ASYM_SCHEME::rsaes" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).oaep) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_ASYM_SCHEME), - "::", - stringify!(oaep) - ) + "Offset of field: TPMU_ASYM_SCHEME::oaep" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).anySig) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_ASYM_SCHEME), - "::", - stringify!(anySig) - ) + "Offset of field: TPMU_ASYM_SCHEME::anySig" + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).null) as usize - ptr as usize }, + 0usize, + "Offset of field: TPMU_ASYM_SCHEME::null" ); } impl Default for TPMU_ASYM_SCHEME { @@ -4927,32 +4047,22 @@ fn bindgen_test_layout_TPMT_ASYM_SCHEME() { assert_eq!( ::std::mem::size_of::(), 6usize, - concat!("Size of: ", stringify!(TPMT_ASYM_SCHEME)) + "Size of TPMT_ASYM_SCHEME" ); assert_eq!( ::std::mem::align_of::(), 2usize, - concat!("Alignment of ", stringify!(TPMT_ASYM_SCHEME)) + "Alignment of TPMT_ASYM_SCHEME" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).scheme) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMT_ASYM_SCHEME), - "::", - stringify!(scheme) - ) + "Offset of field: TPMT_ASYM_SCHEME::scheme" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).details) as usize - ptr as usize }, 2usize, - concat!( - "Offset of field: ", - stringify!(TPMT_ASYM_SCHEME), - "::", - stringify!(details) - ) + "Offset of field: TPMT_ASYM_SCHEME::details" ); } impl Default for TPMT_ASYM_SCHEME { @@ -4978,32 +4088,22 @@ fn bindgen_test_layout_TPMT_RSA_SCHEME() { assert_eq!( ::std::mem::size_of::(), 6usize, - concat!("Size of: ", stringify!(TPMT_RSA_SCHEME)) + "Size of TPMT_RSA_SCHEME" ); assert_eq!( ::std::mem::align_of::(), 2usize, - concat!("Alignment of ", stringify!(TPMT_RSA_SCHEME)) + "Alignment of TPMT_RSA_SCHEME" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).scheme) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMT_RSA_SCHEME), - "::", - stringify!(scheme) - ) + "Offset of field: TPMT_RSA_SCHEME::scheme" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).details) as usize - ptr as usize }, 2usize, - concat!( - "Offset of field: ", - stringify!(TPMT_RSA_SCHEME), - "::", - stringify!(details) - ) + "Offset of field: TPMT_RSA_SCHEME::details" ); } impl Default for TPMT_RSA_SCHEME { @@ -5029,32 +4129,22 @@ fn bindgen_test_layout_TPMT_RSA_DECRYPT() { assert_eq!( ::std::mem::size_of::(), 6usize, - concat!("Size of: ", stringify!(TPMT_RSA_DECRYPT)) + "Size of TPMT_RSA_DECRYPT" ); assert_eq!( ::std::mem::align_of::(), 2usize, - concat!("Alignment of ", stringify!(TPMT_RSA_DECRYPT)) + "Alignment of TPMT_RSA_DECRYPT" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).scheme) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMT_RSA_DECRYPT), - "::", - stringify!(scheme) - ) + "Offset of field: TPMT_RSA_DECRYPT::scheme" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).details) as usize - ptr as usize }, 2usize, - concat!( - "Offset of field: ", - stringify!(TPMT_RSA_DECRYPT), - "::", - stringify!(details) - ) + "Offset of field: TPMT_RSA_DECRYPT::details" ); } impl Default for TPMT_RSA_DECRYPT { @@ -5079,32 +4169,22 @@ fn bindgen_test_layout_TPM2B_PUBLIC_KEY_RSA() { assert_eq!( ::std::mem::size_of::(), 514usize, - concat!("Size of: ", stringify!(TPM2B_PUBLIC_KEY_RSA)) + "Size of TPM2B_PUBLIC_KEY_RSA" ); assert_eq!( ::std::mem::align_of::(), 2usize, - concat!("Alignment of ", stringify!(TPM2B_PUBLIC_KEY_RSA)) + "Alignment of TPM2B_PUBLIC_KEY_RSA" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).size) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPM2B_PUBLIC_KEY_RSA), - "::", - stringify!(size) - ) + "Offset of field: TPM2B_PUBLIC_KEY_RSA::size" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).buffer) as usize - ptr as usize }, 2usize, - concat!( - "Offset of field: ", - stringify!(TPM2B_PUBLIC_KEY_RSA), - "::", - stringify!(buffer) - ) + "Offset of field: TPM2B_PUBLIC_KEY_RSA::buffer" ); } impl Default for TPM2B_PUBLIC_KEY_RSA { @@ -5121,7 +4201,7 @@ pub type TPMI_RSA_KEY_BITS = TPM2_KEY_BITS; #[derive(Debug, Copy, Clone)] pub struct TPM2B_PRIVATE_KEY_RSA { pub size: UINT16, - pub buffer: [BYTE; 256usize], + pub buffer: [BYTE; 1280usize], } #[test] fn bindgen_test_layout_TPM2B_PRIVATE_KEY_RSA() { @@ -5130,33 +4210,23 @@ fn bindgen_test_layout_TPM2B_PRIVATE_KEY_RSA() { let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), - 258usize, - concat!("Size of: ", stringify!(TPM2B_PRIVATE_KEY_RSA)) + 1282usize, + "Size of TPM2B_PRIVATE_KEY_RSA" ); assert_eq!( ::std::mem::align_of::(), 2usize, - concat!("Alignment of ", stringify!(TPM2B_PRIVATE_KEY_RSA)) + "Alignment of TPM2B_PRIVATE_KEY_RSA" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).size) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPM2B_PRIVATE_KEY_RSA), - "::", - stringify!(size) - ) + "Offset of field: TPM2B_PRIVATE_KEY_RSA::size" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).buffer) as usize - ptr as usize }, 2usize, - concat!( - "Offset of field: ", - stringify!(TPM2B_PRIVATE_KEY_RSA), - "::", - stringify!(buffer) - ) + "Offset of field: TPM2B_PRIVATE_KEY_RSA::buffer" ); } impl Default for TPM2B_PRIVATE_KEY_RSA { @@ -5181,32 +4251,22 @@ fn bindgen_test_layout_TPM2B_ECC_PARAMETER() { assert_eq!( ::std::mem::size_of::(), 130usize, - concat!("Size of: ", stringify!(TPM2B_ECC_PARAMETER)) + "Size of TPM2B_ECC_PARAMETER" ); assert_eq!( ::std::mem::align_of::(), 2usize, - concat!("Alignment of ", stringify!(TPM2B_ECC_PARAMETER)) + "Alignment of TPM2B_ECC_PARAMETER" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).size) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPM2B_ECC_PARAMETER), - "::", - stringify!(size) - ) + "Offset of field: TPM2B_ECC_PARAMETER::size" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).buffer) as usize - ptr as usize }, 2usize, - concat!( - "Offset of field: ", - stringify!(TPM2B_ECC_PARAMETER), - "::", - stringify!(buffer) - ) + "Offset of field: TPM2B_ECC_PARAMETER::buffer" ); } impl Default for TPM2B_ECC_PARAMETER { @@ -5231,32 +4291,22 @@ fn bindgen_test_layout_TPMS_ECC_POINT() { assert_eq!( ::std::mem::size_of::(), 260usize, - concat!("Size of: ", stringify!(TPMS_ECC_POINT)) + "Size of TPMS_ECC_POINT" ); assert_eq!( ::std::mem::align_of::(), 2usize, - concat!("Alignment of ", stringify!(TPMS_ECC_POINT)) + "Alignment of TPMS_ECC_POINT" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).x) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMS_ECC_POINT), - "::", - stringify!(x) - ) + "Offset of field: TPMS_ECC_POINT::x" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).y) as usize - ptr as usize }, 130usize, - concat!( - "Offset of field: ", - stringify!(TPMS_ECC_POINT), - "::", - stringify!(y) - ) + "Offset of field: TPMS_ECC_POINT::y" ); } impl Default for TPMS_ECC_POINT { @@ -5281,32 +4331,22 @@ fn bindgen_test_layout_TPM2B_ECC_POINT() { assert_eq!( ::std::mem::size_of::(), 262usize, - concat!("Size of: ", stringify!(TPM2B_ECC_POINT)) + "Size of TPM2B_ECC_POINT" ); assert_eq!( ::std::mem::align_of::(), 2usize, - concat!("Alignment of ", stringify!(TPM2B_ECC_POINT)) + "Alignment of TPM2B_ECC_POINT" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).size) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPM2B_ECC_POINT), - "::", - stringify!(size) - ) + "Offset of field: TPM2B_ECC_POINT::size" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).point) as usize - ptr as usize }, 2usize, - concat!( - "Offset of field: ", - stringify!(TPM2B_ECC_POINT), - "::", - stringify!(point) - ) + "Offset of field: TPM2B_ECC_POINT::point" ); } impl Default for TPM2B_ECC_POINT { @@ -5333,32 +4373,22 @@ fn bindgen_test_layout_TPMT_ECC_SCHEME() { assert_eq!( ::std::mem::size_of::(), 6usize, - concat!("Size of: ", stringify!(TPMT_ECC_SCHEME)) + "Size of TPMT_ECC_SCHEME" ); assert_eq!( ::std::mem::align_of::(), 2usize, - concat!("Alignment of ", stringify!(TPMT_ECC_SCHEME)) + "Alignment of TPMT_ECC_SCHEME" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).scheme) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMT_ECC_SCHEME), - "::", - stringify!(scheme) - ) + "Offset of field: TPMT_ECC_SCHEME::scheme" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).details) as usize - ptr as usize }, 2usize, - concat!( - "Offset of field: ", - stringify!(TPMT_ECC_SCHEME), - "::", - stringify!(details) - ) + "Offset of field: TPMT_ECC_SCHEME::details" ); } impl Default for TPMT_ECC_SCHEME { @@ -5393,122 +4423,67 @@ fn bindgen_test_layout_TPMS_ALGORITHM_DETAIL_ECC() { assert_eq!( ::std::mem::size_of::(), 924usize, - concat!("Size of: ", stringify!(TPMS_ALGORITHM_DETAIL_ECC)) + "Size of TPMS_ALGORITHM_DETAIL_ECC" ); assert_eq!( ::std::mem::align_of::(), 2usize, - concat!("Alignment of ", stringify!(TPMS_ALGORITHM_DETAIL_ECC)) + "Alignment of TPMS_ALGORITHM_DETAIL_ECC" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).curveID) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMS_ALGORITHM_DETAIL_ECC), - "::", - stringify!(curveID) - ) + "Offset of field: TPMS_ALGORITHM_DETAIL_ECC::curveID" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).keySize) as usize - ptr as usize }, 2usize, - concat!( - "Offset of field: ", - stringify!(TPMS_ALGORITHM_DETAIL_ECC), - "::", - stringify!(keySize) - ) + "Offset of field: TPMS_ALGORITHM_DETAIL_ECC::keySize" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).kdf) as usize - ptr as usize }, 4usize, - concat!( - "Offset of field: ", - stringify!(TPMS_ALGORITHM_DETAIL_ECC), - "::", - stringify!(kdf) - ) + "Offset of field: TPMS_ALGORITHM_DETAIL_ECC::kdf" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).sign) as usize - ptr as usize }, 8usize, - concat!( - "Offset of field: ", - stringify!(TPMS_ALGORITHM_DETAIL_ECC), - "::", - stringify!(sign) - ) + "Offset of field: TPMS_ALGORITHM_DETAIL_ECC::sign" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).p) as usize - ptr as usize }, 14usize, - concat!( - "Offset of field: ", - stringify!(TPMS_ALGORITHM_DETAIL_ECC), - "::", - stringify!(p) - ) + "Offset of field: TPMS_ALGORITHM_DETAIL_ECC::p" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).a) as usize - ptr as usize }, 144usize, - concat!( - "Offset of field: ", - stringify!(TPMS_ALGORITHM_DETAIL_ECC), - "::", - stringify!(a) - ) + "Offset of field: TPMS_ALGORITHM_DETAIL_ECC::a" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).b) as usize - ptr as usize }, 274usize, - concat!( - "Offset of field: ", - stringify!(TPMS_ALGORITHM_DETAIL_ECC), - "::", - stringify!(b) - ) + "Offset of field: TPMS_ALGORITHM_DETAIL_ECC::b" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).gX) as usize - ptr as usize }, 404usize, - concat!( - "Offset of field: ", - stringify!(TPMS_ALGORITHM_DETAIL_ECC), - "::", - stringify!(gX) - ) + "Offset of field: TPMS_ALGORITHM_DETAIL_ECC::gX" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).gY) as usize - ptr as usize }, 534usize, - concat!( - "Offset of field: ", - stringify!(TPMS_ALGORITHM_DETAIL_ECC), - "::", - stringify!(gY) - ) + "Offset of field: TPMS_ALGORITHM_DETAIL_ECC::gY" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).n) as usize - ptr as usize }, 664usize, - concat!( - "Offset of field: ", - stringify!(TPMS_ALGORITHM_DETAIL_ECC), - "::", - stringify!(n) - ) + "Offset of field: TPMS_ALGORITHM_DETAIL_ECC::n" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).h) as usize - ptr as usize }, 794usize, - concat!( - "Offset of field: ", - stringify!(TPMS_ALGORITHM_DETAIL_ECC), - "::", - stringify!(h) - ) + "Offset of field: TPMS_ALGORITHM_DETAIL_ECC::h" ); } impl Default for TPMS_ALGORITHM_DETAIL_ECC { @@ -5533,32 +4508,22 @@ fn bindgen_test_layout_TPMS_SIGNATURE_RSA() { assert_eq!( ::std::mem::size_of::(), 516usize, - concat!("Size of: ", stringify!(TPMS_SIGNATURE_RSA)) + "Size of TPMS_SIGNATURE_RSA" ); assert_eq!( ::std::mem::align_of::(), 2usize, - concat!("Alignment of ", stringify!(TPMS_SIGNATURE_RSA)) + "Alignment of TPMS_SIGNATURE_RSA" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).hash) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMS_SIGNATURE_RSA), - "::", - stringify!(hash) - ) + "Offset of field: TPMS_SIGNATURE_RSA::hash" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).sig) as usize - ptr as usize }, 2usize, - concat!( - "Offset of field: ", - stringify!(TPMS_SIGNATURE_RSA), - "::", - stringify!(sig) - ) + "Offset of field: TPMS_SIGNATURE_RSA::sig" ); } impl Default for TPMS_SIGNATURE_RSA { @@ -5586,42 +4551,27 @@ fn bindgen_test_layout_TPMS_SIGNATURE_ECC() { assert_eq!( ::std::mem::size_of::(), 262usize, - concat!("Size of: ", stringify!(TPMS_SIGNATURE_ECC)) + "Size of TPMS_SIGNATURE_ECC" ); assert_eq!( ::std::mem::align_of::(), 2usize, - concat!("Alignment of ", stringify!(TPMS_SIGNATURE_ECC)) + "Alignment of TPMS_SIGNATURE_ECC" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).hash) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMS_SIGNATURE_ECC), - "::", - stringify!(hash) - ) + "Offset of field: TPMS_SIGNATURE_ECC::hash" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).signatureR) as usize - ptr as usize }, 2usize, - concat!( - "Offset of field: ", - stringify!(TPMS_SIGNATURE_ECC), - "::", - stringify!(signatureR) - ) + "Offset of field: TPMS_SIGNATURE_ECC::signatureR" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).signatureS) as usize - ptr as usize }, 132usize, - concat!( - "Offset of field: ", - stringify!(TPMS_SIGNATURE_ECC), - "::", - stringify!(signatureS) - ) + "Offset of field: TPMS_SIGNATURE_ECC::signatureS" ); } impl Default for TPMS_SIGNATURE_ECC { @@ -5648,6 +4598,7 @@ pub union TPMU_SIGNATURE { pub ecschnorr: TPMS_SIGNATURE_ECSCHNORR, pub hmac: TPMT_HA, pub any: TPMS_SCHEME_HASH, + pub null: TPMS_EMPTY, } #[test] fn bindgen_test_layout_TPMU_SIGNATURE() { @@ -5656,92 +4607,57 @@ fn bindgen_test_layout_TPMU_SIGNATURE() { assert_eq!( ::std::mem::size_of::(), 516usize, - concat!("Size of: ", stringify!(TPMU_SIGNATURE)) + "Size of TPMU_SIGNATURE" ); assert_eq!( ::std::mem::align_of::(), 2usize, - concat!("Alignment of ", stringify!(TPMU_SIGNATURE)) + "Alignment of TPMU_SIGNATURE" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).rsassa) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_SIGNATURE), - "::", - stringify!(rsassa) - ) + "Offset of field: TPMU_SIGNATURE::rsassa" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).rsapss) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_SIGNATURE), - "::", - stringify!(rsapss) - ) + "Offset of field: TPMU_SIGNATURE::rsapss" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).ecdsa) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_SIGNATURE), - "::", - stringify!(ecdsa) - ) + "Offset of field: TPMU_SIGNATURE::ecdsa" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).ecdaa) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_SIGNATURE), - "::", - stringify!(ecdaa) - ) + "Offset of field: TPMU_SIGNATURE::ecdaa" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).sm2) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_SIGNATURE), - "::", - stringify!(sm2) - ) + "Offset of field: TPMU_SIGNATURE::sm2" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).ecschnorr) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_SIGNATURE), - "::", - stringify!(ecschnorr) - ) + "Offset of field: TPMU_SIGNATURE::ecschnorr" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).hmac) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_SIGNATURE), - "::", - stringify!(hmac) - ) + "Offset of field: TPMU_SIGNATURE::hmac" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).any) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_SIGNATURE), - "::", - stringify!(any) - ) + "Offset of field: TPMU_SIGNATURE::any" + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).null) as usize - ptr as usize }, + 0usize, + "Offset of field: TPMU_SIGNATURE::null" ); } impl Default for TPMU_SIGNATURE { @@ -5766,32 +4682,22 @@ fn bindgen_test_layout_TPMT_SIGNATURE() { assert_eq!( ::std::mem::size_of::(), 518usize, - concat!("Size of: ", stringify!(TPMT_SIGNATURE)) + "Size of TPMT_SIGNATURE" ); assert_eq!( ::std::mem::align_of::(), 2usize, - concat!("Alignment of ", stringify!(TPMT_SIGNATURE)) + "Alignment of TPMT_SIGNATURE" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).sigAlg) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMT_SIGNATURE), - "::", - stringify!(sigAlg) - ) + "Offset of field: TPMT_SIGNATURE::sigAlg" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).signature) as usize - ptr as usize }, 2usize, - concat!( - "Offset of field: ", - stringify!(TPMT_SIGNATURE), - "::", - stringify!(signature) - ) + "Offset of field: TPMT_SIGNATURE::signature" ); } impl Default for TPMT_SIGNATURE { @@ -5819,52 +4725,32 @@ fn bindgen_test_layout_TPMU_ENCRYPTED_SECRET() { assert_eq!( ::std::mem::size_of::(), 512usize, - concat!("Size of: ", stringify!(TPMU_ENCRYPTED_SECRET)) + "Size of TPMU_ENCRYPTED_SECRET" ); assert_eq!( ::std::mem::align_of::(), 1usize, - concat!("Alignment of ", stringify!(TPMU_ENCRYPTED_SECRET)) + "Alignment of TPMU_ENCRYPTED_SECRET" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).ecc) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_ENCRYPTED_SECRET), - "::", - stringify!(ecc) - ) + "Offset of field: TPMU_ENCRYPTED_SECRET::ecc" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).rsa) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_ENCRYPTED_SECRET), - "::", - stringify!(rsa) - ) + "Offset of field: TPMU_ENCRYPTED_SECRET::rsa" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).symmetric) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_ENCRYPTED_SECRET), - "::", - stringify!(symmetric) - ) + "Offset of field: TPMU_ENCRYPTED_SECRET::symmetric" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).keyedHash) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_ENCRYPTED_SECRET), - "::", - stringify!(keyedHash) - ) + "Offset of field: TPMU_ENCRYPTED_SECRET::keyedHash" ); } impl Default for TPMU_ENCRYPTED_SECRET { @@ -5890,32 +4776,22 @@ fn bindgen_test_layout_TPM2B_ENCRYPTED_SECRET() { assert_eq!( ::std::mem::size_of::(), 514usize, - concat!("Size of: ", stringify!(TPM2B_ENCRYPTED_SECRET)) + "Size of TPM2B_ENCRYPTED_SECRET" ); assert_eq!( ::std::mem::align_of::(), 2usize, - concat!("Alignment of ", stringify!(TPM2B_ENCRYPTED_SECRET)) + "Alignment of TPM2B_ENCRYPTED_SECRET" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).size) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPM2B_ENCRYPTED_SECRET), - "::", - stringify!(size) - ) + "Offset of field: TPM2B_ENCRYPTED_SECRET::size" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).secret) as usize - ptr as usize }, 2usize, - concat!( - "Offset of field: ", - stringify!(TPM2B_ENCRYPTED_SECRET), - "::", - stringify!(secret) - ) + "Offset of field: TPM2B_ENCRYPTED_SECRET::secret" ); } impl Default for TPM2B_ENCRYPTED_SECRET { @@ -5935,6 +4811,7 @@ pub union TPMU_PUBLIC_ID { pub sym: TPM2B_DIGEST, pub rsa: TPM2B_PUBLIC_KEY_RSA, pub ecc: TPMS_ECC_POINT, + pub derive: TPMS_DERIVE, } #[test] fn bindgen_test_layout_TPMU_PUBLIC_ID() { @@ -5943,52 +4820,37 @@ fn bindgen_test_layout_TPMU_PUBLIC_ID() { assert_eq!( ::std::mem::size_of::(), 514usize, - concat!("Size of: ", stringify!(TPMU_PUBLIC_ID)) + "Size of TPMU_PUBLIC_ID" ); assert_eq!( ::std::mem::align_of::(), 2usize, - concat!("Alignment of ", stringify!(TPMU_PUBLIC_ID)) + "Alignment of TPMU_PUBLIC_ID" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).keyedHash) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_PUBLIC_ID), - "::", - stringify!(keyedHash) - ) + "Offset of field: TPMU_PUBLIC_ID::keyedHash" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).sym) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_PUBLIC_ID), - "::", - stringify!(sym) - ) + "Offset of field: TPMU_PUBLIC_ID::sym" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).rsa) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_PUBLIC_ID), - "::", - stringify!(rsa) - ) + "Offset of field: TPMU_PUBLIC_ID::rsa" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).ecc) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_PUBLIC_ID), - "::", - stringify!(ecc) - ) + "Offset of field: TPMU_PUBLIC_ID::ecc" + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).derive) as usize - ptr as usize }, + 0usize, + "Offset of field: TPMU_PUBLIC_ID::derive" ); } impl Default for TPMU_PUBLIC_ID { @@ -6012,22 +4874,17 @@ fn bindgen_test_layout_TPMS_KEYEDHASH_PARMS() { assert_eq!( ::std::mem::size_of::(), 6usize, - concat!("Size of: ", stringify!(TPMS_KEYEDHASH_PARMS)) + "Size of TPMS_KEYEDHASH_PARMS" ); assert_eq!( ::std::mem::align_of::(), 2usize, - concat!("Alignment of ", stringify!(TPMS_KEYEDHASH_PARMS)) + "Alignment of TPMS_KEYEDHASH_PARMS" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).scheme) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMS_KEYEDHASH_PARMS), - "::", - stringify!(scheme) - ) + "Offset of field: TPMS_KEYEDHASH_PARMS::scheme" ); } impl Default for TPMS_KEYEDHASH_PARMS { @@ -6052,32 +4909,22 @@ fn bindgen_test_layout_TPMS_ASYM_PARMS() { assert_eq!( ::std::mem::size_of::(), 12usize, - concat!("Size of: ", stringify!(TPMS_ASYM_PARMS)) + "Size of TPMS_ASYM_PARMS" ); assert_eq!( ::std::mem::align_of::(), 2usize, - concat!("Alignment of ", stringify!(TPMS_ASYM_PARMS)) + "Alignment of TPMS_ASYM_PARMS" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).symmetric) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMS_ASYM_PARMS), - "::", - stringify!(symmetric) - ) + "Offset of field: TPMS_ASYM_PARMS::symmetric" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).scheme) as usize - ptr as usize }, 6usize, - concat!( - "Offset of field: ", - stringify!(TPMS_ASYM_PARMS), - "::", - stringify!(scheme) - ) + "Offset of field: TPMS_ASYM_PARMS::scheme" ); } impl Default for TPMS_ASYM_PARMS { @@ -6104,52 +4951,32 @@ fn bindgen_test_layout_TPMS_RSA_PARMS() { assert_eq!( ::std::mem::size_of::(), 20usize, - concat!("Size of: ", stringify!(TPMS_RSA_PARMS)) + "Size of TPMS_RSA_PARMS" ); assert_eq!( ::std::mem::align_of::(), 4usize, - concat!("Alignment of ", stringify!(TPMS_RSA_PARMS)) + "Alignment of TPMS_RSA_PARMS" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).symmetric) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMS_RSA_PARMS), - "::", - stringify!(symmetric) - ) + "Offset of field: TPMS_RSA_PARMS::symmetric" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).scheme) as usize - ptr as usize }, 6usize, - concat!( - "Offset of field: ", - stringify!(TPMS_RSA_PARMS), - "::", - stringify!(scheme) - ) + "Offset of field: TPMS_RSA_PARMS::scheme" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).keyBits) as usize - ptr as usize }, 12usize, - concat!( - "Offset of field: ", - stringify!(TPMS_RSA_PARMS), - "::", - stringify!(keyBits) - ) + "Offset of field: TPMS_RSA_PARMS::keyBits" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).exponent) as usize - ptr as usize }, 16usize, - concat!( - "Offset of field: ", - stringify!(TPMS_RSA_PARMS), - "::", - stringify!(exponent) - ) + "Offset of field: TPMS_RSA_PARMS::exponent" ); } impl Default for TPMS_RSA_PARMS { @@ -6176,52 +5003,32 @@ fn bindgen_test_layout_TPMS_ECC_PARMS() { assert_eq!( ::std::mem::size_of::(), 18usize, - concat!("Size of: ", stringify!(TPMS_ECC_PARMS)) + "Size of TPMS_ECC_PARMS" ); assert_eq!( ::std::mem::align_of::(), 2usize, - concat!("Alignment of ", stringify!(TPMS_ECC_PARMS)) + "Alignment of TPMS_ECC_PARMS" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).symmetric) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMS_ECC_PARMS), - "::", - stringify!(symmetric) - ) + "Offset of field: TPMS_ECC_PARMS::symmetric" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).scheme) as usize - ptr as usize }, 6usize, - concat!( - "Offset of field: ", - stringify!(TPMS_ECC_PARMS), - "::", - stringify!(scheme) - ) + "Offset of field: TPMS_ECC_PARMS::scheme" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).curveID) as usize - ptr as usize }, 12usize, - concat!( - "Offset of field: ", - stringify!(TPMS_ECC_PARMS), - "::", - stringify!(curveID) - ) + "Offset of field: TPMS_ECC_PARMS::curveID" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).kdf) as usize - ptr as usize }, 14usize, - concat!( - "Offset of field: ", - stringify!(TPMS_ECC_PARMS), - "::", - stringify!(kdf) - ) + "Offset of field: TPMS_ECC_PARMS::kdf" ); } impl Default for TPMS_ECC_PARMS { @@ -6249,62 +5056,37 @@ fn bindgen_test_layout_TPMU_PUBLIC_PARMS() { assert_eq!( ::std::mem::size_of::(), 20usize, - concat!("Size of: ", stringify!(TPMU_PUBLIC_PARMS)) + "Size of TPMU_PUBLIC_PARMS" ); assert_eq!( ::std::mem::align_of::(), 4usize, - concat!("Alignment of ", stringify!(TPMU_PUBLIC_PARMS)) + "Alignment of TPMU_PUBLIC_PARMS" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).keyedHashDetail) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_PUBLIC_PARMS), - "::", - stringify!(keyedHashDetail) - ) + "Offset of field: TPMU_PUBLIC_PARMS::keyedHashDetail" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).symDetail) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_PUBLIC_PARMS), - "::", - stringify!(symDetail) - ) + "Offset of field: TPMU_PUBLIC_PARMS::symDetail" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).rsaDetail) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_PUBLIC_PARMS), - "::", - stringify!(rsaDetail) - ) + "Offset of field: TPMU_PUBLIC_PARMS::rsaDetail" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).eccDetail) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_PUBLIC_PARMS), - "::", - stringify!(eccDetail) - ) + "Offset of field: TPMU_PUBLIC_PARMS::eccDetail" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).asymDetail) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_PUBLIC_PARMS), - "::", - stringify!(asymDetail) - ) + "Offset of field: TPMU_PUBLIC_PARMS::asymDetail" ); } impl Default for TPMU_PUBLIC_PARMS { @@ -6329,32 +5111,22 @@ fn bindgen_test_layout_TPMT_PUBLIC_PARMS() { assert_eq!( ::std::mem::size_of::(), 24usize, - concat!("Size of: ", stringify!(TPMT_PUBLIC_PARMS)) + "Size of TPMT_PUBLIC_PARMS" ); assert_eq!( ::std::mem::align_of::(), 4usize, - concat!("Alignment of ", stringify!(TPMT_PUBLIC_PARMS)) + "Alignment of TPMT_PUBLIC_PARMS" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).type_) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMT_PUBLIC_PARMS), - "::", - stringify!(type_) - ) + "Offset of field: TPMT_PUBLIC_PARMS::type_" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).parameters) as usize - ptr as usize }, 4usize, - concat!( - "Offset of field: ", - stringify!(TPMT_PUBLIC_PARMS), - "::", - stringify!(parameters) - ) + "Offset of field: TPMT_PUBLIC_PARMS::parameters" ); } impl Default for TPMT_PUBLIC_PARMS { @@ -6383,72 +5155,42 @@ fn bindgen_test_layout_TPMT_PUBLIC() { assert_eq!( ::std::mem::size_of::(), 612usize, - concat!("Size of: ", stringify!(TPMT_PUBLIC)) + "Size of TPMT_PUBLIC" ); assert_eq!( ::std::mem::align_of::(), 4usize, - concat!("Alignment of ", stringify!(TPMT_PUBLIC)) + "Alignment of TPMT_PUBLIC" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).type_) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMT_PUBLIC), - "::", - stringify!(type_) - ) + "Offset of field: TPMT_PUBLIC::type_" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).nameAlg) as usize - ptr as usize }, 2usize, - concat!( - "Offset of field: ", - stringify!(TPMT_PUBLIC), - "::", - stringify!(nameAlg) - ) + "Offset of field: TPMT_PUBLIC::nameAlg" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).objectAttributes) as usize - ptr as usize }, 4usize, - concat!( - "Offset of field: ", - stringify!(TPMT_PUBLIC), - "::", - stringify!(objectAttributes) - ) + "Offset of field: TPMT_PUBLIC::objectAttributes" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).authPolicy) as usize - ptr as usize }, 8usize, - concat!( - "Offset of field: ", - stringify!(TPMT_PUBLIC), - "::", - stringify!(authPolicy) - ) + "Offset of field: TPMT_PUBLIC::authPolicy" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).parameters) as usize - ptr as usize }, 76usize, - concat!( - "Offset of field: ", - stringify!(TPMT_PUBLIC), - "::", - stringify!(parameters) - ) + "Offset of field: TPMT_PUBLIC::parameters" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).unique) as usize - ptr as usize }, 96usize, - concat!( - "Offset of field: ", - stringify!(TPMT_PUBLIC), - "::", - stringify!(unique) - ) + "Offset of field: TPMT_PUBLIC::unique" ); } impl Default for TPMT_PUBLIC { @@ -6473,32 +5215,22 @@ fn bindgen_test_layout_TPM2B_PUBLIC() { assert_eq!( ::std::mem::size_of::(), 616usize, - concat!("Size of: ", stringify!(TPM2B_PUBLIC)) + "Size of TPM2B_PUBLIC" ); assert_eq!( ::std::mem::align_of::(), 4usize, - concat!("Alignment of ", stringify!(TPM2B_PUBLIC)) + "Alignment of TPM2B_PUBLIC" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).size) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPM2B_PUBLIC), - "::", - stringify!(size) - ) + "Offset of field: TPM2B_PUBLIC::size" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).publicArea) as usize - ptr as usize }, 4usize, - concat!( - "Offset of field: ", - stringify!(TPM2B_PUBLIC), - "::", - stringify!(publicArea) - ) + "Offset of field: TPM2B_PUBLIC::publicArea" ); } impl Default for TPM2B_PUBLIC { @@ -6523,32 +5255,22 @@ fn bindgen_test_layout_TPM2B_TEMPLATE() { assert_eq!( ::std::mem::size_of::(), 614usize, - concat!("Size of: ", stringify!(TPM2B_TEMPLATE)) + "Size of TPM2B_TEMPLATE" ); assert_eq!( ::std::mem::align_of::(), 2usize, - concat!("Alignment of ", stringify!(TPM2B_TEMPLATE)) + "Alignment of TPM2B_TEMPLATE" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).size) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPM2B_TEMPLATE), - "::", - stringify!(size) - ) + "Offset of field: TPM2B_TEMPLATE::size" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).buffer) as usize - ptr as usize }, 2usize, - concat!( - "Offset of field: ", - stringify!(TPM2B_TEMPLATE), - "::", - stringify!(buffer) - ) + "Offset of field: TPM2B_TEMPLATE::buffer" ); } impl Default for TPM2B_TEMPLATE { @@ -6574,32 +5296,22 @@ fn bindgen_test_layout_TPM2B_PRIVATE_VENDOR_SPECIFIC() { assert_eq!( ::std::mem::size_of::(), 1282usize, - concat!("Size of: ", stringify!(TPM2B_PRIVATE_VENDOR_SPECIFIC)) + "Size of TPM2B_PRIVATE_VENDOR_SPECIFIC" ); assert_eq!( ::std::mem::align_of::(), 2usize, - concat!("Alignment of ", stringify!(TPM2B_PRIVATE_VENDOR_SPECIFIC)) + "Alignment of TPM2B_PRIVATE_VENDOR_SPECIFIC" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).size) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPM2B_PRIVATE_VENDOR_SPECIFIC), - "::", - stringify!(size) - ) + "Offset of field: TPM2B_PRIVATE_VENDOR_SPECIFIC::size" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).buffer) as usize - ptr as usize }, 2usize, - concat!( - "Offset of field: ", - stringify!(TPM2B_PRIVATE_VENDOR_SPECIFIC), - "::", - stringify!(buffer) - ) + "Offset of field: TPM2B_PRIVATE_VENDOR_SPECIFIC::buffer" ); } impl Default for TPM2B_PRIVATE_VENDOR_SPECIFIC { @@ -6628,62 +5340,37 @@ fn bindgen_test_layout_TPMU_SENSITIVE_COMPOSITE() { assert_eq!( ::std::mem::size_of::(), 1282usize, - concat!("Size of: ", stringify!(TPMU_SENSITIVE_COMPOSITE)) + "Size of TPMU_SENSITIVE_COMPOSITE" ); assert_eq!( ::std::mem::align_of::(), 2usize, - concat!("Alignment of ", stringify!(TPMU_SENSITIVE_COMPOSITE)) + "Alignment of TPMU_SENSITIVE_COMPOSITE" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).rsa) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_SENSITIVE_COMPOSITE), - "::", - stringify!(rsa) - ) + "Offset of field: TPMU_SENSITIVE_COMPOSITE::rsa" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).ecc) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_SENSITIVE_COMPOSITE), - "::", - stringify!(ecc) - ) + "Offset of field: TPMU_SENSITIVE_COMPOSITE::ecc" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).bits) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_SENSITIVE_COMPOSITE), - "::", - stringify!(bits) - ) + "Offset of field: TPMU_SENSITIVE_COMPOSITE::bits" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).sym) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_SENSITIVE_COMPOSITE), - "::", - stringify!(sym) - ) + "Offset of field: TPMU_SENSITIVE_COMPOSITE::sym" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).any) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_SENSITIVE_COMPOSITE), - "::", - stringify!(any) - ) + "Offset of field: TPMU_SENSITIVE_COMPOSITE::any" ); } impl Default for TPMU_SENSITIVE_COMPOSITE { @@ -6710,52 +5397,32 @@ fn bindgen_test_layout_TPMT_SENSITIVE() { assert_eq!( ::std::mem::size_of::(), 1416usize, - concat!("Size of: ", stringify!(TPMT_SENSITIVE)) + "Size of TPMT_SENSITIVE" ); assert_eq!( ::std::mem::align_of::(), 2usize, - concat!("Alignment of ", stringify!(TPMT_SENSITIVE)) + "Alignment of TPMT_SENSITIVE" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).sensitiveType) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMT_SENSITIVE), - "::", - stringify!(sensitiveType) - ) + "Offset of field: TPMT_SENSITIVE::sensitiveType" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).authValue) as usize - ptr as usize }, 2usize, - concat!( - "Offset of field: ", - stringify!(TPMT_SENSITIVE), - "::", - stringify!(authValue) - ) + "Offset of field: TPMT_SENSITIVE::authValue" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).seedValue) as usize - ptr as usize }, 68usize, - concat!( - "Offset of field: ", - stringify!(TPMT_SENSITIVE), - "::", - stringify!(seedValue) - ) + "Offset of field: TPMT_SENSITIVE::seedValue" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).sensitive) as usize - ptr as usize }, 134usize, - concat!( - "Offset of field: ", - stringify!(TPMT_SENSITIVE), - "::", - stringify!(sensitive) - ) + "Offset of field: TPMT_SENSITIVE::sensitive" ); } impl Default for TPMT_SENSITIVE { @@ -6780,32 +5447,22 @@ fn bindgen_test_layout_TPM2B_SENSITIVE() { assert_eq!( ::std::mem::size_of::(), 1418usize, - concat!("Size of: ", stringify!(TPM2B_SENSITIVE)) + "Size of TPM2B_SENSITIVE" ); assert_eq!( ::std::mem::align_of::(), 2usize, - concat!("Alignment of ", stringify!(TPM2B_SENSITIVE)) + "Alignment of TPM2B_SENSITIVE" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).size) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPM2B_SENSITIVE), - "::", - stringify!(size) - ) + "Offset of field: TPM2B_SENSITIVE::size" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).sensitiveArea) as usize - ptr as usize }, 2usize, - concat!( - "Offset of field: ", - stringify!(TPM2B_SENSITIVE), - "::", - stringify!(sensitiveArea) - ) + "Offset of field: TPM2B_SENSITIVE::sensitiveArea" ); } impl Default for TPM2B_SENSITIVE { @@ -6831,42 +5488,27 @@ fn bindgen_test_layout__PRIVATE() { assert_eq!( ::std::mem::size_of::<_PRIVATE>(), 1550usize, - concat!("Size of: ", stringify!(_PRIVATE)) + "Size of _PRIVATE" ); assert_eq!( ::std::mem::align_of::<_PRIVATE>(), 2usize, - concat!("Alignment of ", stringify!(_PRIVATE)) + "Alignment of _PRIVATE" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).integrityOuter) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(_PRIVATE), - "::", - stringify!(integrityOuter) - ) + "Offset of field: _PRIVATE::integrityOuter" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).integrityInner) as usize - ptr as usize }, 66usize, - concat!( - "Offset of field: ", - stringify!(_PRIVATE), - "::", - stringify!(integrityInner) - ) + "Offset of field: _PRIVATE::integrityInner" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).sensitive) as usize - ptr as usize }, 132usize, - concat!( - "Offset of field: ", - stringify!(_PRIVATE), - "::", - stringify!(sensitive) - ) + "Offset of field: _PRIVATE::sensitive" ); } impl Default for _PRIVATE { @@ -6891,32 +5533,22 @@ fn bindgen_test_layout_TPM2B_PRIVATE() { assert_eq!( ::std::mem::size_of::(), 1552usize, - concat!("Size of: ", stringify!(TPM2B_PRIVATE)) + "Size of TPM2B_PRIVATE" ); assert_eq!( ::std::mem::align_of::(), 2usize, - concat!("Alignment of ", stringify!(TPM2B_PRIVATE)) + "Alignment of TPM2B_PRIVATE" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).size) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPM2B_PRIVATE), - "::", - stringify!(size) - ) + "Offset of field: TPM2B_PRIVATE::size" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).buffer) as usize - ptr as usize }, 2usize, - concat!( - "Offset of field: ", - stringify!(TPM2B_PRIVATE), - "::", - stringify!(buffer) - ) + "Offset of field: TPM2B_PRIVATE::buffer" ); } impl Default for TPM2B_PRIVATE { @@ -6941,32 +5573,22 @@ fn bindgen_test_layout_TPMS_ID_OBJECT() { assert_eq!( ::std::mem::size_of::(), 132usize, - concat!("Size of: ", stringify!(TPMS_ID_OBJECT)) + "Size of TPMS_ID_OBJECT" ); assert_eq!( ::std::mem::align_of::(), 2usize, - concat!("Alignment of ", stringify!(TPMS_ID_OBJECT)) + "Alignment of TPMS_ID_OBJECT" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).integrityHMAC) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMS_ID_OBJECT), - "::", - stringify!(integrityHMAC) - ) + "Offset of field: TPMS_ID_OBJECT::integrityHMAC" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).encIdentity) as usize - ptr as usize }, 66usize, - concat!( - "Offset of field: ", - stringify!(TPMS_ID_OBJECT), - "::", - stringify!(encIdentity) - ) + "Offset of field: TPMS_ID_OBJECT::encIdentity" ); } impl Default for TPMS_ID_OBJECT { @@ -6991,32 +5613,22 @@ fn bindgen_test_layout_TPM2B_ID_OBJECT() { assert_eq!( ::std::mem::size_of::(), 134usize, - concat!("Size of: ", stringify!(TPM2B_ID_OBJECT)) + "Size of TPM2B_ID_OBJECT" ); assert_eq!( ::std::mem::align_of::(), 2usize, - concat!("Alignment of ", stringify!(TPM2B_ID_OBJECT)) + "Alignment of TPM2B_ID_OBJECT" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).size) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPM2B_ID_OBJECT), - "::", - stringify!(size) - ) + "Offset of field: TPM2B_ID_OBJECT::size" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).credential) as usize - ptr as usize }, 2usize, - concat!( - "Offset of field: ", - stringify!(TPM2B_ID_OBJECT), - "::", - stringify!(credential) - ) + "Offset of field: TPM2B_ID_OBJECT::credential" ); } impl Default for TPM2B_ID_OBJECT { @@ -7044,32 +5656,22 @@ fn bindgen_test_layout_TPMS_NV_PIN_COUNTER_PARAMETERS() { assert_eq!( ::std::mem::size_of::(), 8usize, - concat!("Size of: ", stringify!(TPMS_NV_PIN_COUNTER_PARAMETERS)) + "Size of TPMS_NV_PIN_COUNTER_PARAMETERS" ); assert_eq!( ::std::mem::align_of::(), 4usize, - concat!("Alignment of ", stringify!(TPMS_NV_PIN_COUNTER_PARAMETERS)) + "Alignment of TPMS_NV_PIN_COUNTER_PARAMETERS" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).pinCount) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMS_NV_PIN_COUNTER_PARAMETERS), - "::", - stringify!(pinCount) - ) + "Offset of field: TPMS_NV_PIN_COUNTER_PARAMETERS::pinCount" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).pinLimit) as usize - ptr as usize }, 4usize, - concat!( - "Offset of field: ", - stringify!(TPMS_NV_PIN_COUNTER_PARAMETERS), - "::", - stringify!(pinLimit) - ) + "Offset of field: TPMS_NV_PIN_COUNTER_PARAMETERS::pinLimit" ); } pub type TPMA_NV = u32; @@ -7089,62 +5691,37 @@ fn bindgen_test_layout_TPMS_NV_PUBLIC() { assert_eq!( ::std::mem::size_of::(), 80usize, - concat!("Size of: ", stringify!(TPMS_NV_PUBLIC)) + "Size of TPMS_NV_PUBLIC" ); assert_eq!( ::std::mem::align_of::(), 4usize, - concat!("Alignment of ", stringify!(TPMS_NV_PUBLIC)) + "Alignment of TPMS_NV_PUBLIC" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).nvIndex) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMS_NV_PUBLIC), - "::", - stringify!(nvIndex) - ) + "Offset of field: TPMS_NV_PUBLIC::nvIndex" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).nameAlg) as usize - ptr as usize }, 4usize, - concat!( - "Offset of field: ", - stringify!(TPMS_NV_PUBLIC), - "::", - stringify!(nameAlg) - ) + "Offset of field: TPMS_NV_PUBLIC::nameAlg" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).attributes) as usize - ptr as usize }, 8usize, - concat!( - "Offset of field: ", - stringify!(TPMS_NV_PUBLIC), - "::", - stringify!(attributes) - ) + "Offset of field: TPMS_NV_PUBLIC::attributes" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).authPolicy) as usize - ptr as usize }, 12usize, - concat!( - "Offset of field: ", - stringify!(TPMS_NV_PUBLIC), - "::", - stringify!(authPolicy) - ) + "Offset of field: TPMS_NV_PUBLIC::authPolicy" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).dataSize) as usize - ptr as usize }, 78usize, - concat!( - "Offset of field: ", - stringify!(TPMS_NV_PUBLIC), - "::", - stringify!(dataSize) - ) + "Offset of field: TPMS_NV_PUBLIC::dataSize" ); } impl Default for TPMS_NV_PUBLIC { @@ -7169,32 +5746,22 @@ fn bindgen_test_layout_TPM2B_NV_PUBLIC() { assert_eq!( ::std::mem::size_of::(), 84usize, - concat!("Size of: ", stringify!(TPM2B_NV_PUBLIC)) + "Size of TPM2B_NV_PUBLIC" ); assert_eq!( ::std::mem::align_of::(), 4usize, - concat!("Alignment of ", stringify!(TPM2B_NV_PUBLIC)) + "Alignment of TPM2B_NV_PUBLIC" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).size) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPM2B_NV_PUBLIC), - "::", - stringify!(size) - ) + "Offset of field: TPM2B_NV_PUBLIC::size" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).nvPublic) as usize - ptr as usize }, 4usize, - concat!( - "Offset of field: ", - stringify!(TPM2B_NV_PUBLIC), - "::", - stringify!(nvPublic) - ) + "Offset of field: TPM2B_NV_PUBLIC::nvPublic" ); } impl Default for TPM2B_NV_PUBLIC { @@ -7220,32 +5787,22 @@ fn bindgen_test_layout_TPM2B_CONTEXT_SENSITIVE() { assert_eq!( ::std::mem::size_of::(), 5122usize, - concat!("Size of: ", stringify!(TPM2B_CONTEXT_SENSITIVE)) + "Size of TPM2B_CONTEXT_SENSITIVE" ); assert_eq!( ::std::mem::align_of::(), 2usize, - concat!("Alignment of ", stringify!(TPM2B_CONTEXT_SENSITIVE)) + "Alignment of TPM2B_CONTEXT_SENSITIVE" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).size) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPM2B_CONTEXT_SENSITIVE), - "::", - stringify!(size) - ) + "Offset of field: TPM2B_CONTEXT_SENSITIVE::size" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).buffer) as usize - ptr as usize }, 2usize, - concat!( - "Offset of field: ", - stringify!(TPM2B_CONTEXT_SENSITIVE), - "::", - stringify!(buffer) - ) + "Offset of field: TPM2B_CONTEXT_SENSITIVE::buffer" ); } impl Default for TPM2B_CONTEXT_SENSITIVE { @@ -7270,32 +5827,22 @@ fn bindgen_test_layout_TPMS_CONTEXT_DATA() { assert_eq!( ::std::mem::size_of::(), 5188usize, - concat!("Size of: ", stringify!(TPMS_CONTEXT_DATA)) + "Size of TPMS_CONTEXT_DATA" ); assert_eq!( ::std::mem::align_of::(), 2usize, - concat!("Alignment of ", stringify!(TPMS_CONTEXT_DATA)) + "Alignment of TPMS_CONTEXT_DATA" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).integrity) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMS_CONTEXT_DATA), - "::", - stringify!(integrity) - ) + "Offset of field: TPMS_CONTEXT_DATA::integrity" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).encrypted) as usize - ptr as usize }, 66usize, - concat!( - "Offset of field: ", - stringify!(TPMS_CONTEXT_DATA), - "::", - stringify!(encrypted) - ) + "Offset of field: TPMS_CONTEXT_DATA::encrypted" ); } impl Default for TPMS_CONTEXT_DATA { @@ -7320,32 +5867,22 @@ fn bindgen_test_layout_TPM2B_CONTEXT_DATA() { assert_eq!( ::std::mem::size_of::(), 5190usize, - concat!("Size of: ", stringify!(TPM2B_CONTEXT_DATA)) + "Size of TPM2B_CONTEXT_DATA" ); assert_eq!( ::std::mem::align_of::(), 2usize, - concat!("Alignment of ", stringify!(TPM2B_CONTEXT_DATA)) + "Alignment of TPM2B_CONTEXT_DATA" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).size) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPM2B_CONTEXT_DATA), - "::", - stringify!(size) - ) + "Offset of field: TPM2B_CONTEXT_DATA::size" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).buffer) as usize - ptr as usize }, 2usize, - concat!( - "Offset of field: ", - stringify!(TPM2B_CONTEXT_DATA), - "::", - stringify!(buffer) - ) + "Offset of field: TPM2B_CONTEXT_DATA::buffer" ); } impl Default for TPM2B_CONTEXT_DATA { @@ -7372,52 +5909,32 @@ fn bindgen_test_layout_TPMS_CONTEXT() { assert_eq!( ::std::mem::size_of::(), 5208usize, - concat!("Size of: ", stringify!(TPMS_CONTEXT)) + "Size of TPMS_CONTEXT" ); assert_eq!( ::std::mem::align_of::(), 8usize, - concat!("Alignment of ", stringify!(TPMS_CONTEXT)) + "Alignment of TPMS_CONTEXT" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).sequence) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMS_CONTEXT), - "::", - stringify!(sequence) - ) + "Offset of field: TPMS_CONTEXT::sequence" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).savedHandle) as usize - ptr as usize }, 8usize, - concat!( - "Offset of field: ", - stringify!(TPMS_CONTEXT), - "::", - stringify!(savedHandle) - ) + "Offset of field: TPMS_CONTEXT::savedHandle" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).hierarchy) as usize - ptr as usize }, 12usize, - concat!( - "Offset of field: ", - stringify!(TPMS_CONTEXT), - "::", - stringify!(hierarchy) - ) + "Offset of field: TPMS_CONTEXT::hierarchy" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).contextBlob) as usize - ptr as usize }, 16usize, - concat!( - "Offset of field: ", - stringify!(TPMS_CONTEXT), - "::", - stringify!(contextBlob) - ) + "Offset of field: TPMS_CONTEXT::contextBlob" ); } impl Default for TPMS_CONTEXT { @@ -7447,82 +5964,47 @@ fn bindgen_test_layout_TPMS_CREATION_DATA() { assert_eq!( ::std::mem::size_of::(), 408usize, - concat!("Size of: ", stringify!(TPMS_CREATION_DATA)) + "Size of TPMS_CREATION_DATA" ); assert_eq!( ::std::mem::align_of::(), 4usize, - concat!("Alignment of ", stringify!(TPMS_CREATION_DATA)) + "Alignment of TPMS_CREATION_DATA" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).pcrSelect) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMS_CREATION_DATA), - "::", - stringify!(pcrSelect) - ) + "Offset of field: TPMS_CREATION_DATA::pcrSelect" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).pcrDigest) as usize - ptr as usize }, 132usize, - concat!( - "Offset of field: ", - stringify!(TPMS_CREATION_DATA), - "::", - stringify!(pcrDigest) - ) + "Offset of field: TPMS_CREATION_DATA::pcrDigest" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).locality) as usize - ptr as usize }, 198usize, - concat!( - "Offset of field: ", - stringify!(TPMS_CREATION_DATA), - "::", - stringify!(locality) - ) + "Offset of field: TPMS_CREATION_DATA::locality" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).parentNameAlg) as usize - ptr as usize }, 200usize, - concat!( - "Offset of field: ", - stringify!(TPMS_CREATION_DATA), - "::", - stringify!(parentNameAlg) - ) + "Offset of field: TPMS_CREATION_DATA::parentNameAlg" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).parentName) as usize - ptr as usize }, 202usize, - concat!( - "Offset of field: ", - stringify!(TPMS_CREATION_DATA), - "::", - stringify!(parentName) - ) + "Offset of field: TPMS_CREATION_DATA::parentName" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).parentQualifiedName) as usize - ptr as usize }, 272usize, - concat!( - "Offset of field: ", - stringify!(TPMS_CREATION_DATA), - "::", - stringify!(parentQualifiedName) - ) + "Offset of field: TPMS_CREATION_DATA::parentQualifiedName" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).outsideInfo) as usize - ptr as usize }, 342usize, - concat!( - "Offset of field: ", - stringify!(TPMS_CREATION_DATA), - "::", - stringify!(outsideInfo) - ) + "Offset of field: TPMS_CREATION_DATA::outsideInfo" ); } impl Default for TPMS_CREATION_DATA { @@ -7547,32 +6029,22 @@ fn bindgen_test_layout_TPM2B_CREATION_DATA() { assert_eq!( ::std::mem::size_of::(), 412usize, - concat!("Size of: ", stringify!(TPM2B_CREATION_DATA)) + "Size of TPM2B_CREATION_DATA" ); assert_eq!( ::std::mem::align_of::(), 4usize, - concat!("Alignment of ", stringify!(TPM2B_CREATION_DATA)) + "Alignment of TPM2B_CREATION_DATA" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).size) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPM2B_CREATION_DATA), - "::", - stringify!(size) - ) + "Offset of field: TPM2B_CREATION_DATA::size" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).creationData) as usize - ptr as usize }, 4usize, - concat!( - "Offset of field: ", - stringify!(TPM2B_CREATION_DATA), - "::", - stringify!(creationData) - ) + "Offset of field: TPM2B_CREATION_DATA::creationData" ); } impl Default for TPM2B_CREATION_DATA { @@ -7599,32 +6071,22 @@ fn bindgen_test_layout_TPMS_AC_OUTPUT() { assert_eq!( ::std::mem::size_of::(), 8usize, - concat!("Size of: ", stringify!(TPMS_AC_OUTPUT)) + "Size of TPMS_AC_OUTPUT" ); assert_eq!( ::std::mem::align_of::(), 4usize, - concat!("Alignment of ", stringify!(TPMS_AC_OUTPUT)) + "Alignment of TPMS_AC_OUTPUT" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).tag) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMS_AC_OUTPUT), - "::", - stringify!(tag) - ) + "Offset of field: TPMS_AC_OUTPUT::tag" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).data) as usize - ptr as usize }, 4usize, - concat!( - "Offset of field: ", - stringify!(TPMS_AC_OUTPUT), - "::", - stringify!(data) - ) + "Offset of field: TPMS_AC_OUTPUT::data" ); } #[repr(C)] @@ -7640,32 +6102,22 @@ fn bindgen_test_layout_TPML_AC_CAPABILITIES() { assert_eq!( ::std::mem::size_of::(), 1028usize, - concat!("Size of: ", stringify!(TPML_AC_CAPABILITIES)) + "Size of TPML_AC_CAPABILITIES" ); assert_eq!( ::std::mem::align_of::(), 4usize, - concat!("Alignment of ", stringify!(TPML_AC_CAPABILITIES)) + "Alignment of TPML_AC_CAPABILITIES" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).count) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPML_AC_CAPABILITIES), - "::", - stringify!(count) - ) + "Offset of field: TPML_AC_CAPABILITIES::count" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).acCapabilities) as usize - ptr as usize }, 4usize, - concat!( - "Offset of field: ", - stringify!(TPML_AC_CAPABILITIES), - "::", - stringify!(acCapabilities) - ) + "Offset of field: TPML_AC_CAPABILITIES::acCapabilities" ); } impl Default for TPML_AC_CAPABILITIES { @@ -7677,6 +6129,47 @@ impl Default for TPML_AC_CAPABILITIES { } } } +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct TPML_INTEL_PTT_PROPERTY { + pub count: UINT32, + pub property: [UINT32; 256usize], +} +#[test] +fn bindgen_test_layout_TPML_INTEL_PTT_PROPERTY() { + const UNINIT: ::std::mem::MaybeUninit = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 1028usize, + "Size of TPML_INTEL_PTT_PROPERTY" + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + "Alignment of TPML_INTEL_PTT_PROPERTY" + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).count) as usize - ptr as usize }, + 0usize, + "Offset of field: TPML_INTEL_PTT_PROPERTY::count" + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).property) as usize - ptr as usize }, + 4usize, + "Offset of field: TPML_INTEL_PTT_PROPERTY::property" + ); +} +impl Default for TPML_INTEL_PTT_PROPERTY { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} pub type nfds_t = ::std::os::raw::c_ulong; #[repr(C)] #[derive(Debug, Default, Copy, Clone)] @@ -7689,45 +6182,26 @@ pub struct pollfd { fn bindgen_test_layout_pollfd() { const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 8usize, - concat!("Size of: ", stringify!(pollfd)) - ); + assert_eq!(::std::mem::size_of::(), 8usize, "Size of pollfd"); assert_eq!( ::std::mem::align_of::(), 4usize, - concat!("Alignment of ", stringify!(pollfd)) + "Alignment of pollfd" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).fd) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(pollfd), - "::", - stringify!(fd) - ) + "Offset of field: pollfd::fd" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).events) as usize - ptr as usize }, 4usize, - concat!( - "Offset of field: ", - stringify!(pollfd), - "::", - stringify!(events) - ) + "Offset of field: pollfd::events" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).revents) as usize - ptr as usize }, 6usize, - concat!( - "Offset of field: ", - stringify!(pollfd), - "::", - stringify!(revents) - ) + "Offset of field: pollfd::revents" ); } extern "C" { @@ -7807,92 +6281,52 @@ fn bindgen_test_layout_TSS2_TCTI_CONTEXT_COMMON_V1() { assert_eq!( ::std::mem::size_of::(), 64usize, - concat!("Size of: ", stringify!(TSS2_TCTI_CONTEXT_COMMON_V1)) + "Size of TSS2_TCTI_CONTEXT_COMMON_V1" ); assert_eq!( ::std::mem::align_of::(), 8usize, - concat!("Alignment of ", stringify!(TSS2_TCTI_CONTEXT_COMMON_V1)) + "Alignment of TSS2_TCTI_CONTEXT_COMMON_V1" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).magic) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TSS2_TCTI_CONTEXT_COMMON_V1), - "::", - stringify!(magic) - ) + "Offset of field: TSS2_TCTI_CONTEXT_COMMON_V1::magic" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).version) as usize - ptr as usize }, 8usize, - concat!( - "Offset of field: ", - stringify!(TSS2_TCTI_CONTEXT_COMMON_V1), - "::", - stringify!(version) - ) + "Offset of field: TSS2_TCTI_CONTEXT_COMMON_V1::version" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).transmit) as usize - ptr as usize }, 16usize, - concat!( - "Offset of field: ", - stringify!(TSS2_TCTI_CONTEXT_COMMON_V1), - "::", - stringify!(transmit) - ) + "Offset of field: TSS2_TCTI_CONTEXT_COMMON_V1::transmit" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).receive) as usize - ptr as usize }, 24usize, - concat!( - "Offset of field: ", - stringify!(TSS2_TCTI_CONTEXT_COMMON_V1), - "::", - stringify!(receive) - ) + "Offset of field: TSS2_TCTI_CONTEXT_COMMON_V1::receive" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).finalize) as usize - ptr as usize }, 32usize, - concat!( - "Offset of field: ", - stringify!(TSS2_TCTI_CONTEXT_COMMON_V1), - "::", - stringify!(finalize) - ) + "Offset of field: TSS2_TCTI_CONTEXT_COMMON_V1::finalize" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).cancel) as usize - ptr as usize }, 40usize, - concat!( - "Offset of field: ", - stringify!(TSS2_TCTI_CONTEXT_COMMON_V1), - "::", - stringify!(cancel) - ) + "Offset of field: TSS2_TCTI_CONTEXT_COMMON_V1::cancel" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).getPollHandles) as usize - ptr as usize }, 48usize, - concat!( - "Offset of field: ", - stringify!(TSS2_TCTI_CONTEXT_COMMON_V1), - "::", - stringify!(getPollHandles) - ) + "Offset of field: TSS2_TCTI_CONTEXT_COMMON_V1::getPollHandles" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).setLocality) as usize - ptr as usize }, 56usize, - concat!( - "Offset of field: ", - stringify!(TSS2_TCTI_CONTEXT_COMMON_V1), - "::", - stringify!(setLocality) - ) + "Offset of field: TSS2_TCTI_CONTEXT_COMMON_V1::setLocality" ); } #[repr(C)] @@ -7909,32 +6343,22 @@ fn bindgen_test_layout_TSS2_TCTI_CONTEXT_COMMON_V2() { assert_eq!( ::std::mem::size_of::(), 72usize, - concat!("Size of: ", stringify!(TSS2_TCTI_CONTEXT_COMMON_V2)) + "Size of TSS2_TCTI_CONTEXT_COMMON_V2" ); assert_eq!( ::std::mem::align_of::(), 8usize, - concat!("Alignment of ", stringify!(TSS2_TCTI_CONTEXT_COMMON_V2)) + "Alignment of TSS2_TCTI_CONTEXT_COMMON_V2" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).v1) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TSS2_TCTI_CONTEXT_COMMON_V2), - "::", - stringify!(v1) - ) + "Offset of field: TSS2_TCTI_CONTEXT_COMMON_V2::v1" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).makeSticky) as usize - ptr as usize }, 64usize, - concat!( - "Offset of field: ", - stringify!(TSS2_TCTI_CONTEXT_COMMON_V2), - "::", - stringify!(makeSticky) - ) + "Offset of field: TSS2_TCTI_CONTEXT_COMMON_V2::makeSticky" ); } pub type TSS2_TCTI_CONTEXT_COMMON_CURRENT = TSS2_TCTI_CONTEXT_COMMON_V2; @@ -7954,62 +6378,37 @@ fn bindgen_test_layout_TSS2_TCTI_INFO() { assert_eq!( ::std::mem::size_of::(), 40usize, - concat!("Size of: ", stringify!(TSS2_TCTI_INFO)) + "Size of TSS2_TCTI_INFO" ); assert_eq!( ::std::mem::align_of::(), 8usize, - concat!("Alignment of ", stringify!(TSS2_TCTI_INFO)) + "Alignment of TSS2_TCTI_INFO" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).version) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TSS2_TCTI_INFO), - "::", - stringify!(version) - ) + "Offset of field: TSS2_TCTI_INFO::version" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).name) as usize - ptr as usize }, 8usize, - concat!( - "Offset of field: ", - stringify!(TSS2_TCTI_INFO), - "::", - stringify!(name) - ) + "Offset of field: TSS2_TCTI_INFO::name" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).description) as usize - ptr as usize }, 16usize, - concat!( - "Offset of field: ", - stringify!(TSS2_TCTI_INFO), - "::", - stringify!(description) - ) + "Offset of field: TSS2_TCTI_INFO::description" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).config_help) as usize - ptr as usize }, 24usize, - concat!( - "Offset of field: ", - stringify!(TSS2_TCTI_INFO), - "::", - stringify!(config_help) - ) + "Offset of field: TSS2_TCTI_INFO::config_help" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).init) as usize - ptr as usize }, 32usize, - concat!( - "Offset of field: ", - stringify!(TSS2_TCTI_INFO), - "::", - stringify!(init) - ) + "Offset of field: TSS2_TCTI_INFO::init" ); } impl Default for TSS2_TCTI_INFO { @@ -8043,32 +6442,22 @@ fn bindgen_test_layout_TSS2L_SYS_AUTH_COMMAND() { assert_eq!( ::std::mem::size_of::(), 424usize, - concat!("Size of: ", stringify!(TSS2L_SYS_AUTH_COMMAND)) + "Size of TSS2L_SYS_AUTH_COMMAND" ); assert_eq!( ::std::mem::align_of::(), 4usize, - concat!("Alignment of ", stringify!(TSS2L_SYS_AUTH_COMMAND)) + "Alignment of TSS2L_SYS_AUTH_COMMAND" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).count) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TSS2L_SYS_AUTH_COMMAND), - "::", - stringify!(count) - ) + "Offset of field: TSS2L_SYS_AUTH_COMMAND::count" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).auths) as usize - ptr as usize }, 4usize, - concat!( - "Offset of field: ", - stringify!(TSS2L_SYS_AUTH_COMMAND), - "::", - stringify!(auths) - ) + "Offset of field: TSS2L_SYS_AUTH_COMMAND::auths" ); } impl Default for TSS2L_SYS_AUTH_COMMAND { @@ -8094,32 +6483,22 @@ fn bindgen_test_layout_TSS2L_SYS_AUTH_RESPONSE() { assert_eq!( ::std::mem::size_of::(), 404usize, - concat!("Size of: ", stringify!(TSS2L_SYS_AUTH_RESPONSE)) + "Size of TSS2L_SYS_AUTH_RESPONSE" ); assert_eq!( ::std::mem::align_of::(), 2usize, - concat!("Alignment of ", stringify!(TSS2L_SYS_AUTH_RESPONSE)) + "Alignment of TSS2L_SYS_AUTH_RESPONSE" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).count) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TSS2L_SYS_AUTH_RESPONSE), - "::", - stringify!(count) - ) + "Offset of field: TSS2L_SYS_AUTH_RESPONSE::count" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).auths) as usize - ptr as usize }, 2usize, - concat!( - "Offset of field: ", - stringify!(TSS2L_SYS_AUTH_RESPONSE), - "::", - stringify!(auths) - ) + "Offset of field: TSS2L_SYS_AUTH_RESPONSE::auths" ); } impl Default for TSS2L_SYS_AUTH_RESPONSE { @@ -8933,6 +7312,31 @@ extern "C" { rspAuthsArray: *mut TSS2L_SYS_AUTH_RESPONSE, ) -> TSS2_RC; } +extern "C" { + pub fn Tss2_Sys_MAC_Prepare( + sysContext: *mut TSS2_SYS_CONTEXT, + handle: TPMI_DH_OBJECT, + buffer: *const TPM2B_MAX_BUFFER, + inScheme: TPMI_ALG_MAC_SCHEME, + ) -> TSS2_RC; +} +extern "C" { + pub fn Tss2_Sys_MAC_Complete( + sysContext: *mut TSS2_SYS_CONTEXT, + outMAC: *mut TPM2B_DIGEST, + ) -> TSS2_RC; +} +extern "C" { + pub fn Tss2_Sys_MAC( + sysContext: *mut TSS2_SYS_CONTEXT, + handle: TPMI_DH_OBJECT, + cmdAuths: *const TSS2L_SYS_AUTH_COMMAND, + buffer: *const TPM2B_MAX_BUFFER, + inScheme: TPMI_ALG_MAC_SCHEME, + outMAC: *mut TPM2B_DIGEST, + rspAuths: *mut TSS2L_SYS_AUTH_RESPONSE, + ) -> TSS2_RC; +} extern "C" { pub fn Tss2_Sys_GetRandom_Prepare( sysContext: *mut TSS2_SYS_CONTEXT, @@ -8996,6 +7400,31 @@ extern "C" { rspAuthsArray: *mut TSS2L_SYS_AUTH_RESPONSE, ) -> TSS2_RC; } +extern "C" { + pub fn Tss2_Sys_MAC_Start_Prepare( + sysContext: *mut TSS2_SYS_CONTEXT, + handle: TPMI_DH_OBJECT, + auth: *const TPM2B_AUTH, + inScheme: TPMI_ALG_MAC_SCHEME, + ) -> TSS2_RC; +} +extern "C" { + pub fn Tss2_Sys_MAC_Start_Complete( + sysContext: *mut TSS2_SYS_CONTEXT, + sequenceHandle: *mut TPMI_DH_OBJECT, + ) -> TSS2_RC; +} +extern "C" { + pub fn Tss2_Sys_MAC_Start( + sysContext: *mut TSS2_SYS_CONTEXT, + handle: TPMI_DH_OBJECT, + cmdAuths: *const TSS2L_SYS_AUTH_COMMAND, + auth: *const TPM2B_AUTH, + inScheme: TPMI_ALG_MAC_SCHEME, + sequenceHandle: *mut TPMI_DH_OBJECT, + rspAuthsArray: *mut TSS2L_SYS_AUTH_RESPONSE, + ) -> TSS2_RC; +} extern "C" { pub fn Tss2_Sys_HashSequenceStart_Prepare( sysContext: *mut TSS2_SYS_CONTEXT, @@ -10983,8 +9412,248 @@ pub type ESYS_TR = u32; pub struct ESYS_CONTEXT { _unused: [u8; 0], } -extern "C" { - pub fn Esys_Initialize( +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct ESYS_CRYPTO_CONTEXT_BLOB { + _unused: [u8; 0], +} +pub type ESYS_CRYPTO_HASH_START_FNP = ::std::option::Option< + unsafe extern "C" fn( + context: *mut *mut ESYS_CRYPTO_CONTEXT_BLOB, + hashAlg: TPM2_ALG_ID, + userdata: *mut ::std::os::raw::c_void, + ) -> TSS2_RC, +>; +pub type ESYS_CRYPTO_HASH_UPDATE_FNP = ::std::option::Option< + unsafe extern "C" fn( + context: *mut ESYS_CRYPTO_CONTEXT_BLOB, + buffer: *const u8, + size: size_t, + userdata: *mut ::std::os::raw::c_void, + ) -> TSS2_RC, +>; +pub type ESYS_CRYPTO_HASH_FINISH_FNP = ::std::option::Option< + unsafe extern "C" fn( + context: *mut *mut ESYS_CRYPTO_CONTEXT_BLOB, + buffer: *mut u8, + size: *mut size_t, + userdata: *mut ::std::os::raw::c_void, + ) -> TSS2_RC, +>; +pub type ESYS_CRYPTO_HASH_ABORT_FNP = ::std::option::Option< + unsafe extern "C" fn( + context: *mut *mut ESYS_CRYPTO_CONTEXT_BLOB, + userdata: *mut ::std::os::raw::c_void, + ), +>; +pub type ESYS_CRYPTO_HMAC_START_FNP = ::std::option::Option< + unsafe extern "C" fn( + context: *mut *mut ESYS_CRYPTO_CONTEXT_BLOB, + hashAlg: TPM2_ALG_ID, + key: *const u8, + size: size_t, + userdata: *mut ::std::os::raw::c_void, + ) -> TSS2_RC, +>; +pub type ESYS_CRYPTO_HMAC_UPDATE_FNP = ::std::option::Option< + unsafe extern "C" fn( + context: *mut ESYS_CRYPTO_CONTEXT_BLOB, + buffer: *const u8, + size: size_t, + userdata: *mut ::std::os::raw::c_void, + ) -> TSS2_RC, +>; +pub type ESYS_CRYPTO_HMAC_FINISH_FNP = ::std::option::Option< + unsafe extern "C" fn( + context: *mut *mut ESYS_CRYPTO_CONTEXT_BLOB, + buffer: *mut u8, + size: *mut size_t, + userdata: *mut ::std::os::raw::c_void, + ) -> TSS2_RC, +>; +pub type ESYS_CRYPTO_HMAC_ABORT_FNP = ::std::option::Option< + unsafe extern "C" fn( + context: *mut *mut ESYS_CRYPTO_CONTEXT_BLOB, + userdata: *mut ::std::os::raw::c_void, + ), +>; +pub type ESYS_CRYPTO_GET_RANDOM2B_FNP = ::std::option::Option< + unsafe extern "C" fn( + nonce: *mut TPM2B_NONCE, + num_bytes: size_t, + userdata: *mut ::std::os::raw::c_void, + ) -> TSS2_RC, +>; +pub type ESYS_CRYPTO_GET_ECDH_POINT_FNP = ::std::option::Option< + unsafe extern "C" fn( + key: *mut TPM2B_PUBLIC, + max_out_size: size_t, + Z: *mut TPM2B_ECC_PARAMETER, + Q: *mut TPMS_ECC_POINT, + out_buffer: *mut BYTE, + out_size: *mut size_t, + userdata: *mut ::std::os::raw::c_void, + ) -> TSS2_RC, +>; +pub type ESYS_CRYPTO_AES_ENCRYPT_FNP = ::std::option::Option< + unsafe extern "C" fn( + key: *mut u8, + tpm_sym_alg: TPM2_ALG_ID, + key_bits: TPMI_AES_KEY_BITS, + tpm_mode: TPM2_ALG_ID, + buffer: *mut u8, + buffer_size: size_t, + iv: *mut u8, + userdata: *mut ::std::os::raw::c_void, + ) -> TSS2_RC, +>; +pub type ESYS_CRYPTO_AES_DECRYPT_FNP = ::std::option::Option< + unsafe extern "C" fn( + key: *mut u8, + tpm_sym_alg: TPM2_ALG_ID, + key_bits: TPMI_AES_KEY_BITS, + tpm_mode: TPM2_ALG_ID, + buffer: *mut u8, + buffer_size: size_t, + iv: *mut u8, + userdata: *mut ::std::os::raw::c_void, + ) -> TSS2_RC, +>; +pub type ESYS_CRYPTO_PK_RSA_ENCRYPT_FNP = ::std::option::Option< + unsafe extern "C" fn( + pub_tpm_key: *mut TPM2B_PUBLIC, + in_size: size_t, + in_buffer: *mut BYTE, + max_out_size: size_t, + out_buffer: *mut BYTE, + out_size: *mut size_t, + label: *const ::std::os::raw::c_char, + userdata: *mut ::std::os::raw::c_void, + ) -> TSS2_RC, +>; +pub type ESYS_CRYPTO_INIT_FNP = + ::std::option::Option TSS2_RC>; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct ESYS_CRYPTO_CALLBACKS { + pub rsa_pk_encrypt: ESYS_CRYPTO_PK_RSA_ENCRYPT_FNP, + pub hash_start: ESYS_CRYPTO_HASH_START_FNP, + pub hash_update: ESYS_CRYPTO_HASH_UPDATE_FNP, + pub hash_finish: ESYS_CRYPTO_HASH_FINISH_FNP, + pub hash_abort: ESYS_CRYPTO_HASH_ABORT_FNP, + pub hmac_start: ESYS_CRYPTO_HMAC_START_FNP, + pub hmac_update: ESYS_CRYPTO_HMAC_UPDATE_FNP, + pub hmac_finish: ESYS_CRYPTO_HMAC_FINISH_FNP, + pub hmac_abort: ESYS_CRYPTO_HMAC_ABORT_FNP, + pub get_random2b: ESYS_CRYPTO_GET_RANDOM2B_FNP, + pub get_ecdh_point: ESYS_CRYPTO_GET_ECDH_POINT_FNP, + pub aes_encrypt: ESYS_CRYPTO_AES_ENCRYPT_FNP, + pub aes_decrypt: ESYS_CRYPTO_AES_DECRYPT_FNP, + pub init: ESYS_CRYPTO_INIT_FNP, + pub userdata: *mut ::std::os::raw::c_void, +} +#[test] +fn bindgen_test_layout_ESYS_CRYPTO_CALLBACKS() { + const UNINIT: ::std::mem::MaybeUninit = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 120usize, + "Size of ESYS_CRYPTO_CALLBACKS" + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + "Alignment of ESYS_CRYPTO_CALLBACKS" + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).rsa_pk_encrypt) as usize - ptr as usize }, + 0usize, + "Offset of field: ESYS_CRYPTO_CALLBACKS::rsa_pk_encrypt" + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).hash_start) as usize - ptr as usize }, + 8usize, + "Offset of field: ESYS_CRYPTO_CALLBACKS::hash_start" + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).hash_update) as usize - ptr as usize }, + 16usize, + "Offset of field: ESYS_CRYPTO_CALLBACKS::hash_update" + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).hash_finish) as usize - ptr as usize }, + 24usize, + "Offset of field: ESYS_CRYPTO_CALLBACKS::hash_finish" + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).hash_abort) as usize - ptr as usize }, + 32usize, + "Offset of field: ESYS_CRYPTO_CALLBACKS::hash_abort" + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).hmac_start) as usize - ptr as usize }, + 40usize, + "Offset of field: ESYS_CRYPTO_CALLBACKS::hmac_start" + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).hmac_update) as usize - ptr as usize }, + 48usize, + "Offset of field: ESYS_CRYPTO_CALLBACKS::hmac_update" + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).hmac_finish) as usize - ptr as usize }, + 56usize, + "Offset of field: ESYS_CRYPTO_CALLBACKS::hmac_finish" + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).hmac_abort) as usize - ptr as usize }, + 64usize, + "Offset of field: ESYS_CRYPTO_CALLBACKS::hmac_abort" + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).get_random2b) as usize - ptr as usize }, + 72usize, + "Offset of field: ESYS_CRYPTO_CALLBACKS::get_random2b" + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).get_ecdh_point) as usize - ptr as usize }, + 80usize, + "Offset of field: ESYS_CRYPTO_CALLBACKS::get_ecdh_point" + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).aes_encrypt) as usize - ptr as usize }, + 88usize, + "Offset of field: ESYS_CRYPTO_CALLBACKS::aes_encrypt" + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).aes_decrypt) as usize - ptr as usize }, + 96usize, + "Offset of field: ESYS_CRYPTO_CALLBACKS::aes_decrypt" + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).init) as usize - ptr as usize }, + 104usize, + "Offset of field: ESYS_CRYPTO_CALLBACKS::init" + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).userdata) as usize - ptr as usize }, + 112usize, + "Offset of field: ESYS_CRYPTO_CALLBACKS::userdata" + ); +} +impl Default for ESYS_CRYPTO_CALLBACKS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +extern "C" { + pub fn Esys_Initialize( esys_context: *mut *mut ESYS_CONTEXT, tcti: *mut TSS2_TCTI_CONTEXT, abiVersion: *mut TSS2_ABI_VERSION, @@ -11439,6 +10108,95 @@ extern "C" { extern "C" { pub fn Esys_ACT_SetTimeout_Finish(esysContext: *mut ESYS_CONTEXT) -> TSS2_RC; } +extern "C" { + pub fn Esys_AC_GetCapability_Async( + esysContext: *mut ESYS_CONTEXT, + optionalSession1: ESYS_TR, + optionalSession2: ESYS_TR, + optionalSession3: ESYS_TR, + ac: ESYS_TR, + capability: TPM_AT, + count: UINT32, + ) -> TSS2_RC; +} +extern "C" { + pub fn Esys_AC_GetCapability_Finish( + esysContext: *mut ESYS_CONTEXT, + moreData: *mut TPMI_YES_NO, + capabilityData: *mut *mut TPML_AC_CAPABILITIES, + ) -> TSS2_RC; +} +extern "C" { + pub fn Esys_AC_GetCapability( + esysContext: *mut ESYS_CONTEXT, + optionalSession1: ESYS_TR, + optionalSession2: ESYS_TR, + optionalSession3: ESYS_TR, + ac: ESYS_TR, + capability: TPM_AT, + count: UINT32, + moreData: *mut TPMI_YES_NO, + capabilityData: *mut *mut TPML_AC_CAPABILITIES, + ) -> TSS2_RC; +} +extern "C" { + pub fn Esys_AC_Send_Async( + esysContext: *mut ESYS_CONTEXT, + sendObject: ESYS_TR, + nvAuthHandle: ESYS_TR, + optionalSession1: ESYS_TR, + optionalSession2: ESYS_TR, + optionalSession3: ESYS_TR, + ac: ESYS_TR, + acDataIn: *mut TPM2B_MAX_BUFFER, + ) -> TSS2_RC; +} +extern "C" { + pub fn Esys_AC_Send_Finish( + esysContext: *mut ESYS_CONTEXT, + acDataOut: *mut *mut TPMS_AC_OUTPUT, + ) -> TSS2_RC; +} +extern "C" { + pub fn Esys_AC_Send( + esysContext: *mut ESYS_CONTEXT, + sendObject: ESYS_TR, + nvAuthHandle: ESYS_TR, + optionalSession1: ESYS_TR, + optionalSession2: ESYS_TR, + optionalSession3: ESYS_TR, + ac: ESYS_TR, + acDataIn: *mut TPM2B_MAX_BUFFER, + acDataOut: *mut *mut TPMS_AC_OUTPUT, + ) -> TSS2_RC; +} +extern "C" { + pub fn Esys_Policy_AC_SendSelect_Async( + esysContext: *mut ESYS_CONTEXT, + policySession1: ESYS_TR, + optionalSession2: ESYS_TR, + optionalSession3: ESYS_TR, + objectName: *mut TPM2B_NAME, + authHandleName: *mut TPM2B_NAME, + acName: *mut TPM2B_NAME, + includeObject: TPMI_YES_NO, + ) -> TSS2_RC; +} +extern "C" { + pub fn Esys_Policy_AC_SendSelect_Finish(esysContext: *mut ESYS_CONTEXT) -> TSS2_RC; +} +extern "C" { + pub fn Esys_Policy_AC_SendSelect( + esysContext: *mut ESYS_CONTEXT, + policySession1: ESYS_TR, + optionalSession2: ESYS_TR, + optionalSession3: ESYS_TR, + objectName: *mut TPM2B_NAME, + authHandleName: *mut TPM2B_NAME, + acName: *mut TPM2B_NAME, + includeObject: TPMI_YES_NO, + ) -> TSS2_RC; +} extern "C" { pub fn Esys_MakeCredential( esysContext: *mut ESYS_CONTEXT, @@ -11968,6 +10726,35 @@ extern "C" { outHMAC: *mut *mut TPM2B_DIGEST, ) -> TSS2_RC; } +extern "C" { + pub fn Esys_MAC_Async( + esysContext: *mut ESYS_CONTEXT, + handle: ESYS_TR, + handleSession1: ESYS_TR, + optionalSession2: ESYS_TR, + optionalSession3: ESYS_TR, + buffer: *const TPM2B_MAX_BUFFER, + inScheme: TPMI_ALG_MAC_SCHEME, + ) -> TSS2_RC; +} +extern "C" { + pub fn Esys_MAC_Finish( + esysContext: *mut ESYS_CONTEXT, + outMAC: *mut *mut TPM2B_DIGEST, + ) -> TSS2_RC; +} +extern "C" { + pub fn Esys_MAC( + esysContext: *mut ESYS_CONTEXT, + handle: ESYS_TR, + handleSession1: ESYS_TR, + optionalSession2: ESYS_TR, + optionalSession3: ESYS_TR, + buffer: *const TPM2B_MAX_BUFFER, + inScheme: TPMI_ALG_MAC_SCHEME, + outMAC: *mut *mut TPM2B_DIGEST, + ) -> TSS2_RC; +} extern "C" { pub fn Esys_GetRandom( esysContext: *mut ESYS_CONTEXT, @@ -12043,6 +10830,35 @@ extern "C" { sequenceHandle: *mut ESYS_TR, ) -> TSS2_RC; } +extern "C" { + pub fn Esys_MAC_Start( + esysContext: *mut ESYS_CONTEXT, + handle: ESYS_TR, + handleSession1: ESYS_TR, + optionalSession2: ESYS_TR, + optionalSession3: ESYS_TR, + auth: *const TPM2B_AUTH, + inScheme: TPMI_ALG_MAC_SCHEME, + sequenceHandle: *mut ESYS_TR, + ) -> TSS2_RC; +} +extern "C" { + pub fn Esys_MAC_Start_Async( + esysContext: *mut ESYS_CONTEXT, + handle: ESYS_TR, + handleSession1: ESYS_TR, + optionalSession2: ESYS_TR, + optionalSession3: ESYS_TR, + auth: *const TPM2B_AUTH, + inScheme: TPMI_ALG_MAC_SCHEME, + ) -> TSS2_RC; +} +extern "C" { + pub fn Esys_MAC_Start_Finish( + esysContext: *mut ESYS_CONTEXT, + sequenceHandle: *mut ESYS_TR, + ) -> TSS2_RC; +} extern "C" { pub fn Esys_HashSequenceStart( esysContext: *mut ESYS_CONTEXT, @@ -14214,6 +13030,12 @@ extern "C" { sys_context: *mut *mut TSS2_SYS_CONTEXT, ) -> TSS2_RC; } +extern "C" { + pub fn Esys_SetCryptoCallbacks( + esysContext: *mut ESYS_CONTEXT, + callbacks: *mut ESYS_CRYPTO_CALLBACKS, + ) -> TSS2_RC; +} pub type __gwchar_t = ::std::os::raw::c_uint; #[repr(C)] #[derive(Debug, Default, Copy, Clone)] @@ -14228,32 +13050,22 @@ fn bindgen_test_layout_imaxdiv_t() { assert_eq!( ::std::mem::size_of::(), 16usize, - concat!("Size of: ", stringify!(imaxdiv_t)) + "Size of imaxdiv_t" ); assert_eq!( ::std::mem::align_of::(), 8usize, - concat!("Alignment of ", stringify!(imaxdiv_t)) + "Alignment of imaxdiv_t" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).quot) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(imaxdiv_t), - "::", - stringify!(quot) - ) + "Offset of field: imaxdiv_t::quot" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).rem) as usize - ptr as usize }, 8usize, - concat!( - "Offset of field: ", - stringify!(imaxdiv_t), - "::", - stringify!(rem) - ) + "Offset of field: imaxdiv_t::rem" ); } extern "C" { @@ -14305,35 +13117,21 @@ pub struct div_t { fn bindgen_test_layout_div_t() { const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 8usize, - concat!("Size of: ", stringify!(div_t)) - ); + assert_eq!(::std::mem::size_of::(), 8usize, "Size of div_t"); assert_eq!( ::std::mem::align_of::(), 4usize, - concat!("Alignment of ", stringify!(div_t)) + "Alignment of div_t" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).quot) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(div_t), - "::", - stringify!(quot) - ) + "Offset of field: div_t::quot" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).rem) as usize - ptr as usize }, 4usize, - concat!( - "Offset of field: ", - stringify!(div_t), - "::", - stringify!(rem) - ) + "Offset of field: div_t::rem" ); } #[repr(C)] @@ -14346,35 +13144,21 @@ pub struct ldiv_t { fn bindgen_test_layout_ldiv_t() { const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 16usize, - concat!("Size of: ", stringify!(ldiv_t)) - ); + assert_eq!(::std::mem::size_of::(), 16usize, "Size of ldiv_t"); assert_eq!( ::std::mem::align_of::(), 8usize, - concat!("Alignment of ", stringify!(ldiv_t)) + "Alignment of ldiv_t" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).quot) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(ldiv_t), - "::", - stringify!(quot) - ) + "Offset of field: ldiv_t::quot" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).rem) as usize - ptr as usize }, 8usize, - concat!( - "Offset of field: ", - stringify!(ldiv_t), - "::", - stringify!(rem) - ) + "Offset of field: ldiv_t::rem" ); } #[repr(C)] @@ -14387,35 +13171,21 @@ pub struct lldiv_t { fn bindgen_test_layout_lldiv_t() { const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 16usize, - concat!("Size of: ", stringify!(lldiv_t)) - ); + assert_eq!(::std::mem::size_of::(), 16usize, "Size of lldiv_t"); assert_eq!( ::std::mem::align_of::(), 8usize, - concat!("Alignment of ", stringify!(lldiv_t)) + "Alignment of lldiv_t" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).quot) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(lldiv_t), - "::", - stringify!(quot) - ) + "Offset of field: lldiv_t::quot" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).rem) as usize - ptr as usize }, 8usize, - concat!( - "Offset of field: ", - stringify!(lldiv_t), - "::", - stringify!(rem) - ) + "Offset of field: lldiv_t::rem" ); } extern "C" { @@ -14544,22 +13314,17 @@ fn bindgen_test_layout___sigset_t() { assert_eq!( ::std::mem::size_of::<__sigset_t>(), 128usize, - concat!("Size of: ", stringify!(__sigset_t)) + "Size of __sigset_t" ); assert_eq!( ::std::mem::align_of::<__sigset_t>(), 8usize, - concat!("Alignment of ", stringify!(__sigset_t)) + "Alignment of __sigset_t" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__val) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(__sigset_t), - "::", - stringify!(__val) - ) + "Offset of field: __sigset_t::__val" ); } pub type sigset_t = __sigset_t; @@ -14573,35 +13338,21 @@ pub struct timeval { fn bindgen_test_layout_timeval() { const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 16usize, - concat!("Size of: ", stringify!(timeval)) - ); + assert_eq!(::std::mem::size_of::(), 16usize, "Size of timeval"); assert_eq!( ::std::mem::align_of::(), 8usize, - concat!("Alignment of ", stringify!(timeval)) + "Alignment of timeval" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).tv_sec) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(timeval), - "::", - stringify!(tv_sec) - ) + "Offset of field: timeval::tv_sec" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).tv_usec) as usize - ptr as usize }, 8usize, - concat!( - "Offset of field: ", - stringify!(timeval), - "::", - stringify!(tv_usec) - ) + "Offset of field: timeval::tv_usec" ); } #[repr(C)] @@ -14617,32 +13368,22 @@ fn bindgen_test_layout_timespec() { assert_eq!( ::std::mem::size_of::(), 16usize, - concat!("Size of: ", stringify!(timespec)) + "Size of timespec" ); assert_eq!( ::std::mem::align_of::(), 8usize, - concat!("Alignment of ", stringify!(timespec)) + "Alignment of timespec" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).tv_sec) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(timespec), - "::", - stringify!(tv_sec) - ) + "Offset of field: timespec::tv_sec" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).tv_nsec) as usize - ptr as usize }, 8usize, - concat!( - "Offset of field: ", - stringify!(timespec), - "::", - stringify!(tv_nsec) - ) + "Offset of field: timespec::tv_nsec" ); } pub type suseconds_t = __suseconds_t; @@ -14656,25 +13397,16 @@ pub struct fd_set { fn bindgen_test_layout_fd_set() { const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 128usize, - concat!("Size of: ", stringify!(fd_set)) - ); + assert_eq!(::std::mem::size_of::(), 128usize, "Size of fd_set"); assert_eq!( ::std::mem::align_of::(), 8usize, - concat!("Alignment of ", stringify!(fd_set)) + "Alignment of fd_set" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__fds_bits) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(fd_set), - "::", - stringify!(__fds_bits) - ) + "Offset of field: fd_set::__fds_bits" ); } pub type fd_mask = __fd_mask; @@ -14721,35 +13453,22 @@ fn bindgen_test_layout___atomic_wide_counter__bindgen_ty_1() { assert_eq!( ::std::mem::size_of::<__atomic_wide_counter__bindgen_ty_1>(), 8usize, - concat!("Size of: ", stringify!(__atomic_wide_counter__bindgen_ty_1)) + "Size of __atomic_wide_counter__bindgen_ty_1" ); assert_eq!( ::std::mem::align_of::<__atomic_wide_counter__bindgen_ty_1>(), 4usize, - concat!( - "Alignment of ", - stringify!(__atomic_wide_counter__bindgen_ty_1) - ) + "Alignment of __atomic_wide_counter__bindgen_ty_1" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__low) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(__atomic_wide_counter__bindgen_ty_1), - "::", - stringify!(__low) - ) + "Offset of field: __atomic_wide_counter__bindgen_ty_1::__low" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__high) as usize - ptr as usize }, 4usize, - concat!( - "Offset of field: ", - stringify!(__atomic_wide_counter__bindgen_ty_1), - "::", - stringify!(__high) - ) + "Offset of field: __atomic_wide_counter__bindgen_ty_1::__high" ); } #[test] @@ -14760,32 +13479,22 @@ fn bindgen_test_layout___atomic_wide_counter() { assert_eq!( ::std::mem::size_of::<__atomic_wide_counter>(), 8usize, - concat!("Size of: ", stringify!(__atomic_wide_counter)) + "Size of __atomic_wide_counter" ); assert_eq!( ::std::mem::align_of::<__atomic_wide_counter>(), 8usize, - concat!("Alignment of ", stringify!(__atomic_wide_counter)) + "Alignment of __atomic_wide_counter" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__value64) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(__atomic_wide_counter), - "::", - stringify!(__value64) - ) + "Offset of field: __atomic_wide_counter::__value64" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__value32) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(__atomic_wide_counter), - "::", - stringify!(__value32) - ) + "Offset of field: __atomic_wide_counter::__value32" ); } impl Default for __atomic_wide_counter { @@ -14811,32 +13520,22 @@ fn bindgen_test_layout___pthread_internal_list() { assert_eq!( ::std::mem::size_of::<__pthread_internal_list>(), 16usize, - concat!("Size of: ", stringify!(__pthread_internal_list)) + "Size of __pthread_internal_list" ); assert_eq!( ::std::mem::align_of::<__pthread_internal_list>(), 8usize, - concat!("Alignment of ", stringify!(__pthread_internal_list)) + "Alignment of __pthread_internal_list" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__prev) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(__pthread_internal_list), - "::", - stringify!(__prev) - ) + "Offset of field: __pthread_internal_list::__prev" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__next) as usize - ptr as usize }, 8usize, - concat!( - "Offset of field: ", - stringify!(__pthread_internal_list), - "::", - stringify!(__next) - ) + "Offset of field: __pthread_internal_list::__next" ); } impl Default for __pthread_internal_list { @@ -14862,22 +13561,17 @@ fn bindgen_test_layout___pthread_internal_slist() { assert_eq!( ::std::mem::size_of::<__pthread_internal_slist>(), 8usize, - concat!("Size of: ", stringify!(__pthread_internal_slist)) + "Size of __pthread_internal_slist" ); assert_eq!( ::std::mem::align_of::<__pthread_internal_slist>(), 8usize, - concat!("Alignment of ", stringify!(__pthread_internal_slist)) + "Alignment of __pthread_internal_slist" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__next) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(__pthread_internal_slist), - "::", - stringify!(__next) - ) + "Offset of field: __pthread_internal_slist::__next" ); } impl Default for __pthread_internal_slist { @@ -14908,82 +13602,47 @@ fn bindgen_test_layout___pthread_mutex_s() { assert_eq!( ::std::mem::size_of::<__pthread_mutex_s>(), 40usize, - concat!("Size of: ", stringify!(__pthread_mutex_s)) + "Size of __pthread_mutex_s" ); assert_eq!( ::std::mem::align_of::<__pthread_mutex_s>(), 8usize, - concat!("Alignment of ", stringify!(__pthread_mutex_s)) + "Alignment of __pthread_mutex_s" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__lock) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(__pthread_mutex_s), - "::", - stringify!(__lock) - ) + "Offset of field: __pthread_mutex_s::__lock" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__count) as usize - ptr as usize }, 4usize, - concat!( - "Offset of field: ", - stringify!(__pthread_mutex_s), - "::", - stringify!(__count) - ) + "Offset of field: __pthread_mutex_s::__count" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__owner) as usize - ptr as usize }, 8usize, - concat!( - "Offset of field: ", - stringify!(__pthread_mutex_s), - "::", - stringify!(__owner) - ) + "Offset of field: __pthread_mutex_s::__owner" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__nusers) as usize - ptr as usize }, 12usize, - concat!( - "Offset of field: ", - stringify!(__pthread_mutex_s), - "::", - stringify!(__nusers) - ) + "Offset of field: __pthread_mutex_s::__nusers" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__kind) as usize - ptr as usize }, 16usize, - concat!( - "Offset of field: ", - stringify!(__pthread_mutex_s), - "::", - stringify!(__kind) - ) + "Offset of field: __pthread_mutex_s::__kind" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__spins) as usize - ptr as usize }, 20usize, - concat!( - "Offset of field: ", - stringify!(__pthread_mutex_s), - "::", - stringify!(__spins) - ) + "Offset of field: __pthread_mutex_s::__spins" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__list) as usize - ptr as usize }, 24usize, - concat!( - "Offset of field: ", - stringify!(__pthread_mutex_s), - "::", - stringify!(__list) - ) + "Offset of field: __pthread_mutex_s::__list" ); } impl Default for __pthread_mutex_s { @@ -15018,122 +13677,67 @@ fn bindgen_test_layout___pthread_rwlock_arch_t() { assert_eq!( ::std::mem::size_of::<__pthread_rwlock_arch_t>(), 56usize, - concat!("Size of: ", stringify!(__pthread_rwlock_arch_t)) + "Size of __pthread_rwlock_arch_t" ); assert_eq!( ::std::mem::align_of::<__pthread_rwlock_arch_t>(), 8usize, - concat!("Alignment of ", stringify!(__pthread_rwlock_arch_t)) + "Alignment of __pthread_rwlock_arch_t" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__readers) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(__pthread_rwlock_arch_t), - "::", - stringify!(__readers) - ) + "Offset of field: __pthread_rwlock_arch_t::__readers" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__writers) as usize - ptr as usize }, 4usize, - concat!( - "Offset of field: ", - stringify!(__pthread_rwlock_arch_t), - "::", - stringify!(__writers) - ) + "Offset of field: __pthread_rwlock_arch_t::__writers" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__wrphase_futex) as usize - ptr as usize }, 8usize, - concat!( - "Offset of field: ", - stringify!(__pthread_rwlock_arch_t), - "::", - stringify!(__wrphase_futex) - ) + "Offset of field: __pthread_rwlock_arch_t::__wrphase_futex" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__writers_futex) as usize - ptr as usize }, 12usize, - concat!( - "Offset of field: ", - stringify!(__pthread_rwlock_arch_t), - "::", - stringify!(__writers_futex) - ) + "Offset of field: __pthread_rwlock_arch_t::__writers_futex" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__pad3) as usize - ptr as usize }, 16usize, - concat!( - "Offset of field: ", - stringify!(__pthread_rwlock_arch_t), - "::", - stringify!(__pad3) - ) + "Offset of field: __pthread_rwlock_arch_t::__pad3" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__pad4) as usize - ptr as usize }, 20usize, - concat!( - "Offset of field: ", - stringify!(__pthread_rwlock_arch_t), - "::", - stringify!(__pad4) - ) + "Offset of field: __pthread_rwlock_arch_t::__pad4" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__cur_writer) as usize - ptr as usize }, 24usize, - concat!( - "Offset of field: ", - stringify!(__pthread_rwlock_arch_t), - "::", - stringify!(__cur_writer) - ) + "Offset of field: __pthread_rwlock_arch_t::__cur_writer" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__shared) as usize - ptr as usize }, 28usize, - concat!( - "Offset of field: ", - stringify!(__pthread_rwlock_arch_t), - "::", - stringify!(__shared) - ) + "Offset of field: __pthread_rwlock_arch_t::__shared" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__pad1) as usize - ptr as usize }, 32usize, - concat!( - "Offset of field: ", - stringify!(__pthread_rwlock_arch_t), - "::", - stringify!(__pad1) - ) + "Offset of field: __pthread_rwlock_arch_t::__pad1" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__pad2) as usize - ptr as usize }, 40usize, - concat!( - "Offset of field: ", - stringify!(__pthread_rwlock_arch_t), - "::", - stringify!(__pad2) - ) + "Offset of field: __pthread_rwlock_arch_t::__pad2" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__flags) as usize - ptr as usize }, 48usize, - concat!( - "Offset of field: ", - stringify!(__pthread_rwlock_arch_t), - "::", - stringify!(__flags) - ) + "Offset of field: __pthread_rwlock_arch_t::__flags" ); } #[repr(C)] @@ -15154,82 +13758,47 @@ fn bindgen_test_layout___pthread_cond_s() { assert_eq!( ::std::mem::size_of::<__pthread_cond_s>(), 48usize, - concat!("Size of: ", stringify!(__pthread_cond_s)) + "Size of __pthread_cond_s" ); assert_eq!( ::std::mem::align_of::<__pthread_cond_s>(), 8usize, - concat!("Alignment of ", stringify!(__pthread_cond_s)) + "Alignment of __pthread_cond_s" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__wseq) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(__pthread_cond_s), - "::", - stringify!(__wseq) - ) + "Offset of field: __pthread_cond_s::__wseq" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__g1_start) as usize - ptr as usize }, 8usize, - concat!( - "Offset of field: ", - stringify!(__pthread_cond_s), - "::", - stringify!(__g1_start) - ) + "Offset of field: __pthread_cond_s::__g1_start" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__g_refs) as usize - ptr as usize }, 16usize, - concat!( - "Offset of field: ", - stringify!(__pthread_cond_s), - "::", - stringify!(__g_refs) - ) + "Offset of field: __pthread_cond_s::__g_refs" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__g_size) as usize - ptr as usize }, 24usize, - concat!( - "Offset of field: ", - stringify!(__pthread_cond_s), - "::", - stringify!(__g_size) - ) + "Offset of field: __pthread_cond_s::__g_size" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__g1_orig_size) as usize - ptr as usize }, 32usize, - concat!( - "Offset of field: ", - stringify!(__pthread_cond_s), - "::", - stringify!(__g1_orig_size) - ) + "Offset of field: __pthread_cond_s::__g1_orig_size" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__wrefs) as usize - ptr as usize }, 36usize, - concat!( - "Offset of field: ", - stringify!(__pthread_cond_s), - "::", - stringify!(__wrefs) - ) + "Offset of field: __pthread_cond_s::__wrefs" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__g_signals) as usize - ptr as usize }, 40usize, - concat!( - "Offset of field: ", - stringify!(__pthread_cond_s), - "::", - stringify!(__g_signals) - ) + "Offset of field: __pthread_cond_s::__g_signals" ); } impl Default for __pthread_cond_s { @@ -15255,22 +13824,17 @@ fn bindgen_test_layout___once_flag() { assert_eq!( ::std::mem::size_of::<__once_flag>(), 4usize, - concat!("Size of: ", stringify!(__once_flag)) + "Size of __once_flag" ); assert_eq!( ::std::mem::align_of::<__once_flag>(), 4usize, - concat!("Alignment of ", stringify!(__once_flag)) + "Alignment of __once_flag" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__data) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(__once_flag), - "::", - stringify!(__data) - ) + "Offset of field: __once_flag::__data" ); } pub type pthread_t = ::std::os::raw::c_ulong; @@ -15287,32 +13851,22 @@ fn bindgen_test_layout_pthread_mutexattr_t() { assert_eq!( ::std::mem::size_of::(), 8usize, - concat!("Size of: ", stringify!(pthread_mutexattr_t)) + "Size of pthread_mutexattr_t" ); assert_eq!( ::std::mem::align_of::(), 4usize, - concat!("Alignment of ", stringify!(pthread_mutexattr_t)) + "Alignment of pthread_mutexattr_t" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__size) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(pthread_mutexattr_t), - "::", - stringify!(__size) - ) + "Offset of field: pthread_mutexattr_t::__size" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__align) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(pthread_mutexattr_t), - "::", - stringify!(__align) - ) + "Offset of field: pthread_mutexattr_t::__align" ); } impl Default for pthread_mutexattr_t { @@ -15337,32 +13891,22 @@ fn bindgen_test_layout_pthread_condattr_t() { assert_eq!( ::std::mem::size_of::(), 8usize, - concat!("Size of: ", stringify!(pthread_condattr_t)) + "Size of pthread_condattr_t" ); assert_eq!( ::std::mem::align_of::(), 4usize, - concat!("Alignment of ", stringify!(pthread_condattr_t)) + "Alignment of pthread_condattr_t" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__size) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(pthread_condattr_t), - "::", - stringify!(__size) - ) + "Offset of field: pthread_condattr_t::__size" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__align) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(pthread_condattr_t), - "::", - stringify!(__align) - ) + "Offset of field: pthread_condattr_t::__align" ); } impl Default for pthread_condattr_t { @@ -15389,32 +13933,22 @@ fn bindgen_test_layout_pthread_attr_t() { assert_eq!( ::std::mem::size_of::(), 64usize, - concat!("Size of: ", stringify!(pthread_attr_t)) + "Size of pthread_attr_t" ); assert_eq!( ::std::mem::align_of::(), 8usize, - concat!("Alignment of ", stringify!(pthread_attr_t)) + "Alignment of pthread_attr_t" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__size) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(pthread_attr_t), - "::", - stringify!(__size) - ) + "Offset of field: pthread_attr_t::__size" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__align) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(pthread_attr_t), - "::", - stringify!(__align) - ) + "Offset of field: pthread_attr_t::__align" ); } impl Default for pthread_attr_t { @@ -15440,42 +13974,27 @@ fn bindgen_test_layout_pthread_mutex_t() { assert_eq!( ::std::mem::size_of::(), 48usize, - concat!("Size of: ", stringify!(pthread_mutex_t)) + "Size of pthread_mutex_t" ); assert_eq!( ::std::mem::align_of::(), 8usize, - concat!("Alignment of ", stringify!(pthread_mutex_t)) + "Alignment of pthread_mutex_t" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__data) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(pthread_mutex_t), - "::", - stringify!(__data) - ) + "Offset of field: pthread_mutex_t::__data" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__size) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(pthread_mutex_t), - "::", - stringify!(__size) - ) + "Offset of field: pthread_mutex_t::__size" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__align) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(pthread_mutex_t), - "::", - stringify!(__align) - ) + "Offset of field: pthread_mutex_t::__align" ); } impl Default for pthread_mutex_t { @@ -15501,42 +14020,27 @@ fn bindgen_test_layout_pthread_cond_t() { assert_eq!( ::std::mem::size_of::(), 48usize, - concat!("Size of: ", stringify!(pthread_cond_t)) + "Size of pthread_cond_t" ); assert_eq!( ::std::mem::align_of::(), 8usize, - concat!("Alignment of ", stringify!(pthread_cond_t)) + "Alignment of pthread_cond_t" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__data) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(pthread_cond_t), - "::", - stringify!(__data) - ) + "Offset of field: pthread_cond_t::__data" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__size) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(pthread_cond_t), - "::", - stringify!(__size) - ) + "Offset of field: pthread_cond_t::__size" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__align) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(pthread_cond_t), - "::", - stringify!(__align) - ) + "Offset of field: pthread_cond_t::__align" ); } impl Default for pthread_cond_t { @@ -15562,42 +14066,27 @@ fn bindgen_test_layout_pthread_rwlock_t() { assert_eq!( ::std::mem::size_of::(), 56usize, - concat!("Size of: ", stringify!(pthread_rwlock_t)) + "Size of pthread_rwlock_t" ); assert_eq!( ::std::mem::align_of::(), 8usize, - concat!("Alignment of ", stringify!(pthread_rwlock_t)) + "Alignment of pthread_rwlock_t" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__data) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(pthread_rwlock_t), - "::", - stringify!(__data) - ) + "Offset of field: pthread_rwlock_t::__data" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__size) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(pthread_rwlock_t), - "::", - stringify!(__size) - ) + "Offset of field: pthread_rwlock_t::__size" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__align) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(pthread_rwlock_t), - "::", - stringify!(__align) - ) + "Offset of field: pthread_rwlock_t::__align" ); } impl Default for pthread_rwlock_t { @@ -15622,32 +14111,22 @@ fn bindgen_test_layout_pthread_rwlockattr_t() { assert_eq!( ::std::mem::size_of::(), 8usize, - concat!("Size of: ", stringify!(pthread_rwlockattr_t)) + "Size of pthread_rwlockattr_t" ); assert_eq!( ::std::mem::align_of::(), 8usize, - concat!("Alignment of ", stringify!(pthread_rwlockattr_t)) + "Alignment of pthread_rwlockattr_t" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__size) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(pthread_rwlockattr_t), - "::", - stringify!(__size) - ) + "Offset of field: pthread_rwlockattr_t::__size" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__align) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(pthread_rwlockattr_t), - "::", - stringify!(__align) - ) + "Offset of field: pthread_rwlockattr_t::__align" ); } impl Default for pthread_rwlockattr_t { @@ -15673,32 +14152,22 @@ fn bindgen_test_layout_pthread_barrier_t() { assert_eq!( ::std::mem::size_of::(), 32usize, - concat!("Size of: ", stringify!(pthread_barrier_t)) + "Size of pthread_barrier_t" ); assert_eq!( ::std::mem::align_of::(), 8usize, - concat!("Alignment of ", stringify!(pthread_barrier_t)) + "Alignment of pthread_barrier_t" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__size) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(pthread_barrier_t), - "::", - stringify!(__size) - ) + "Offset of field: pthread_barrier_t::__size" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__align) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(pthread_barrier_t), - "::", - stringify!(__align) - ) + "Offset of field: pthread_barrier_t::__align" ); } impl Default for pthread_barrier_t { @@ -15724,32 +14193,22 @@ fn bindgen_test_layout_pthread_barrierattr_t() { assert_eq!( ::std::mem::size_of::(), 8usize, - concat!("Size of: ", stringify!(pthread_barrierattr_t)) + "Size of pthread_barrierattr_t" ); assert_eq!( ::std::mem::align_of::(), 4usize, - concat!("Alignment of ", stringify!(pthread_barrierattr_t)) + "Alignment of pthread_barrierattr_t" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__size) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(pthread_barrierattr_t), - "::", - stringify!(__size) - ) + "Offset of field: pthread_barrierattr_t::__size" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__align) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(pthread_barrierattr_t), - "::", - stringify!(__align) - ) + "Offset of field: pthread_barrierattr_t::__align" ); } impl Default for pthread_barrierattr_t { @@ -15795,82 +14254,47 @@ fn bindgen_test_layout_random_data() { assert_eq!( ::std::mem::size_of::(), 48usize, - concat!("Size of: ", stringify!(random_data)) + "Size of random_data" ); assert_eq!( ::std::mem::align_of::(), 8usize, - concat!("Alignment of ", stringify!(random_data)) + "Alignment of random_data" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).fptr) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(random_data), - "::", - stringify!(fptr) - ) + "Offset of field: random_data::fptr" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).rptr) as usize - ptr as usize }, 8usize, - concat!( - "Offset of field: ", - stringify!(random_data), - "::", - stringify!(rptr) - ) + "Offset of field: random_data::rptr" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).state) as usize - ptr as usize }, 16usize, - concat!( - "Offset of field: ", - stringify!(random_data), - "::", - stringify!(state) - ) + "Offset of field: random_data::state" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).rand_type) as usize - ptr as usize }, 24usize, - concat!( - "Offset of field: ", - stringify!(random_data), - "::", - stringify!(rand_type) - ) + "Offset of field: random_data::rand_type" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).rand_deg) as usize - ptr as usize }, 28usize, - concat!( - "Offset of field: ", - stringify!(random_data), - "::", - stringify!(rand_deg) - ) + "Offset of field: random_data::rand_deg" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).rand_sep) as usize - ptr as usize }, 32usize, - concat!( - "Offset of field: ", - stringify!(random_data), - "::", - stringify!(rand_sep) - ) + "Offset of field: random_data::rand_sep" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).end_ptr) as usize - ptr as usize }, 40usize, - concat!( - "Offset of field: ", - stringify!(random_data), - "::", - stringify!(end_ptr) - ) + "Offset of field: random_data::end_ptr" ); } impl Default for random_data { @@ -15957,62 +14381,37 @@ fn bindgen_test_layout_drand48_data() { assert_eq!( ::std::mem::size_of::(), 24usize, - concat!("Size of: ", stringify!(drand48_data)) + "Size of drand48_data" ); assert_eq!( ::std::mem::align_of::(), 8usize, - concat!("Alignment of ", stringify!(drand48_data)) + "Alignment of drand48_data" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__x) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(drand48_data), - "::", - stringify!(__x) - ) + "Offset of field: drand48_data::__x" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__old_x) as usize - ptr as usize }, 6usize, - concat!( - "Offset of field: ", - stringify!(drand48_data), - "::", - stringify!(__old_x) - ) + "Offset of field: drand48_data::__old_x" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__c) as usize - ptr as usize }, 12usize, - concat!( - "Offset of field: ", - stringify!(drand48_data), - "::", - stringify!(__c) - ) + "Offset of field: drand48_data::__c" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__init) as usize - ptr as usize }, 14usize, - concat!( - "Offset of field: ", - stringify!(drand48_data), - "::", - stringify!(__init) - ) + "Offset of field: drand48_data::__init" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__a) as usize - ptr as usize }, 16usize, - concat!( - "Offset of field: ", - stringify!(drand48_data), - "::", - stringify!(__a) - ) + "Offset of field: drand48_data::__a" ); } extern "C" { @@ -17215,22 +15614,6 @@ extern "C" { dest: *mut TPMS_ALG_PROPERTY, ) -> TSS2_RC; } -extern "C" { - pub fn Tss2_MU_TPMS_ALGORITHM_DESCRIPTION_Marshal( - src: *const TPMS_ALGORITHM_DESCRIPTION, - buffer: *mut u8, - buffer_size: size_t, - offset: *mut size_t, - ) -> TSS2_RC; -} -extern "C" { - pub fn Tss2_MU_TPMS_ALGORITHM_DESCRIPTION_Unmarshal( - buffer: *const u8, - buffer_size: size_t, - offset: *mut size_t, - dest: *mut TPMS_ALGORITHM_DESCRIPTION, - ) -> TSS2_RC; -} extern "C" { pub fn Tss2_MU_TPMS_TAGGED_PROPERTY_Marshal( src: *const TPMS_TAGGED_PROPERTY, @@ -17967,22 +16350,6 @@ extern "C" { dest: *mut TPML_TAGGED_TPM_PROPERTY, ) -> TSS2_RC; } -extern "C" { - pub fn Tss2_MU_TPML_INTEL_PTT_PROPERTY_Marshal( - src: *const TPML_INTEL_PTT_PROPERTY, - buffer: *mut u8, - buffer_size: size_t, - offset: *mut size_t, - ) -> TSS2_RC; -} -extern "C" { - pub fn Tss2_MU_TPML_INTEL_PTT_PROPERTY_Unmarshal( - buffer: *const u8, - buffer_size: size_t, - offset: *mut size_t, - dest: *mut TPML_INTEL_PTT_PROPERTY, - ) -> TSS2_RC; -} extern "C" { pub fn Tss2_MU_TPML_AC_CAPABILITIES_Marshal( src: *const TPML_AC_CAPABILITIES, @@ -18685,3 +17052,35 @@ extern "C" { out: *mut TPMS_EMPTY, ) -> TSS2_RC; } +extern "C" { + pub fn Tss2_MU_TPM2B_MAX_CAP_BUFFER_Marshal( + src: *const TPM2B_MAX_CAP_BUFFER, + buffer: *mut u8, + buffer_size: size_t, + offset: *mut size_t, + ) -> TSS2_RC; +} +extern "C" { + pub fn Tss2_MU_TPM2B_MAX_CAP_BUFFER_Unmarshal( + buffer: *const u8, + buffer_size: size_t, + offset: *mut size_t, + dest: *mut TPM2B_MAX_CAP_BUFFER, + ) -> TSS2_RC; +} +extern "C" { + pub fn Tss2_MU_TPML_INTEL_PTT_PROPERTY_Marshal( + src: *const TPML_INTEL_PTT_PROPERTY, + buffer: *mut u8, + buffer_size: size_t, + offset: *mut size_t, + ) -> TSS2_RC; +} +extern "C" { + pub fn Tss2_MU_TPML_INTEL_PTT_PROPERTY_Unmarshal( + buffer: *const u8, + buffer_size: size_t, + offset: *mut size_t, + dest: *mut TPML_INTEL_PTT_PROPERTY, + ) -> TSS2_RC; +} diff --git a/tss-esapi-sys/src/bindings/arm-unknown-linux-gnueabi.rs b/tss-esapi-sys/src/bindings/arm-unknown-linux-gnueabi.rs index fd1ad14d..7df5202b 100644 --- a/tss-esapi-sys/src/bindings/arm-unknown-linux-gnueabi.rs +++ b/tss-esapi-sys/src/bindings/arm-unknown-linux-gnueabi.rs @@ -1,5 +1,5 @@ -/* automatically generated by rust-bindgen 0.69.4 */ -/* TPM2_TSS_VERSION="3.2.2" */ +/* automatically generated by rust-bindgen 0.70.1 */ +/* TPM2_TSS_VERSION="4.0.1" */ pub const _STDINT_H: u32 = 1; pub const _FEATURES_H: u32 = 1; @@ -150,6 +150,7 @@ pub const TSS2_BASE_RC_BAD_KEY: u32 = 50; pub const TSS2_BASE_RC_NO_HANDLE: u32 = 51; pub const TSS2_BASE_RC_NOT_PROVISIONED: u32 = 52; pub const TSS2_BASE_RC_ALREADY_PROVISIONED: u32 = 53; +pub const TSS2_BASE_RC_CALLBACK_NULL: u32 = 54; pub const TSS2_LAYER_IMPLEMENTATION_SPECIFIC_OFFSET: u32 = 63488; pub const TSS2_LEVEL_IMPLEMENTATION_SPECIFIC_SHIFT: u32 = 11; pub const TPM2_MAX_COMMAND_SIZE: u32 = 4096; @@ -242,7 +243,25 @@ pub const ESYS_TR_RH_PLATFORM: u32 = 268; pub const ESYS_TR_RH_PLATFORM_NV: u32 = 269; pub const ESYS_TR_RH_AUTH_FIRST: u32 = 272; pub const ESYS_TR_RH_ACT_FIRST: u32 = 288; +pub const ESYS_TR_RH_ACT_0: u32 = 288; +pub const ESYS_TR_RH_ACT_1: u32 = 289; +pub const ESYS_TR_RH_ACT_2: u32 = 290; +pub const ESYS_TR_RH_ACT_3: u32 = 291; +pub const ESYS_TR_RH_ACT_4: u32 = 292; +pub const ESYS_TR_RH_ACT_5: u32 = 293; +pub const ESYS_TR_RH_ACT_6: u32 = 294; +pub const ESYS_TR_RH_ACT_7: u32 = 295; +pub const ESYS_TR_RH_ACT_8: u32 = 296; +pub const ESYS_TR_RH_ACT_9: u32 = 297; +pub const ESYS_TR_RH_ACT_A: u32 = 298; +pub const ESYS_TR_RH_ACT_B: u32 = 299; +pub const ESYS_TR_RH_ACT_C: u32 = 300; +pub const ESYS_TR_RH_ACT_D: u32 = 301; +pub const ESYS_TR_RH_ACT_E: u32 = 302; +pub const ESYS_TR_RH_ACT_F: u32 = 303; pub const ESYS_TR_RH_ACT_LAST: u32 = 303; +pub const ESYS_TR_RH_AC_FIRST: u32 = 320; +pub const ESYS_TR_RH_AC_LAST: u32 = 65855; pub const _INTTYPES_H: u32 = 1; pub const ____gwchar_t_defined: u32 = 1; pub const __PRI64_PREFIX: &[u8; 3] = b"ll\0"; @@ -487,22 +506,17 @@ fn bindgen_test_layout___fsid_t() { assert_eq!( ::std::mem::size_of::<__fsid_t>(), 8usize, - concat!("Size of: ", stringify!(__fsid_t)) + "Size of __fsid_t" ); assert_eq!( ::std::mem::align_of::<__fsid_t>(), 4usize, - concat!("Alignment of ", stringify!(__fsid_t)) + "Alignment of __fsid_t" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__val) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(__fsid_t), - "::", - stringify!(__val) - ) + "Offset of field: __fsid_t::__val" ); } pub type __clock_t = ::std::os::raw::c_long; @@ -579,52 +593,32 @@ fn bindgen_test_layout_TSS2_ABI_VERSION() { assert_eq!( ::std::mem::size_of::(), 16usize, - concat!("Size of: ", stringify!(TSS2_ABI_VERSION)) + "Size of TSS2_ABI_VERSION" ); assert_eq!( ::std::mem::align_of::(), 4usize, - concat!("Alignment of ", stringify!(TSS2_ABI_VERSION)) + "Alignment of TSS2_ABI_VERSION" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).tssCreator) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TSS2_ABI_VERSION), - "::", - stringify!(tssCreator) - ) + "Offset of field: TSS2_ABI_VERSION::tssCreator" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).tssFamily) as usize - ptr as usize }, 4usize, - concat!( - "Offset of field: ", - stringify!(TSS2_ABI_VERSION), - "::", - stringify!(tssFamily) - ) + "Offset of field: TSS2_ABI_VERSION::tssFamily" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).tssLevel) as usize - ptr as usize }, 8usize, - concat!( - "Offset of field: ", - stringify!(TSS2_ABI_VERSION), - "::", - stringify!(tssLevel) - ) + "Offset of field: TSS2_ABI_VERSION::tssLevel" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).tssVersion) as usize - ptr as usize }, 12usize, - concat!( - "Offset of field: ", - stringify!(TSS2_ABI_VERSION), - "::", - stringify!(tssVersion) - ) + "Offset of field: TSS2_ABI_VERSION::tssVersion" ); } pub type TSS2_RC = u32; @@ -666,6 +660,7 @@ pub type TPMA_X509_KEY_USAGE = u32; pub type TPMA_ACT = u32; pub type TPMI_YES_NO = BYTE; pub type TPMI_DH_OBJECT = TPM2_HANDLE; +pub type TPMI_DH_PARENT = TPM2_HANDLE; pub type TPMI_DH_PERSISTENT = TPM2_HANDLE; pub type TPMI_DH_ENTITY = TPM2_HANDLE; pub type TPMI_DH_PCR = TPM2_HANDLE; @@ -702,7 +697,7 @@ pub type TPMI_ALG_CIPHER_MODE = TPM2_ALG_ID; #[repr(C)] #[derive(Debug, Default, Copy, Clone)] pub struct TPMS_EMPTY { - pub empty: [BYTE; 1usize], + pub empty: [UINT8; 1usize], } #[test] fn bindgen_test_layout_TPMS_EMPTY() { @@ -711,69 +706,23 @@ fn bindgen_test_layout_TPMS_EMPTY() { assert_eq!( ::std::mem::size_of::(), 1usize, - concat!("Size of: ", stringify!(TPMS_EMPTY)) + "Size of TPMS_EMPTY" ); assert_eq!( ::std::mem::align_of::(), 1usize, - concat!("Alignment of ", stringify!(TPMS_EMPTY)) + "Alignment of TPMS_EMPTY" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).empty) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMS_EMPTY), - "::", - stringify!(empty) - ) - ); -} -#[repr(C)] -#[derive(Debug, Default, Copy, Clone)] -pub struct TPMS_ALGORITHM_DESCRIPTION { - pub alg: TPM2_ALG_ID, - pub attributes: TPMA_ALGORITHM, -} -#[test] -fn bindgen_test_layout_TPMS_ALGORITHM_DESCRIPTION() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 8usize, - concat!("Size of: ", stringify!(TPMS_ALGORITHM_DESCRIPTION)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(TPMS_ALGORITHM_DESCRIPTION)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).alg) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(TPMS_ALGORITHM_DESCRIPTION), - "::", - stringify!(alg) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).attributes) as usize - ptr as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(TPMS_ALGORITHM_DESCRIPTION), - "::", - stringify!(attributes) - ) + "Offset of field: TPMS_EMPTY::empty" ); } #[repr(C)] #[derive(Copy, Clone)] pub union TPMU_HA { + pub sha: [BYTE; 20usize], pub sha1: [BYTE; 20usize], pub sha256: [BYTE; 32usize], pub sha384: [BYTE; 48usize], @@ -784,65 +733,41 @@ pub union TPMU_HA { fn bindgen_test_layout_TPMU_HA() { const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 64usize, - concat!("Size of: ", stringify!(TPMU_HA)) - ); + assert_eq!(::std::mem::size_of::(), 64usize, "Size of TPMU_HA"); assert_eq!( ::std::mem::align_of::(), 1usize, - concat!("Alignment of ", stringify!(TPMU_HA)) + "Alignment of TPMU_HA" + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).sha) as usize - ptr as usize }, + 0usize, + "Offset of field: TPMU_HA::sha" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).sha1) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_HA), - "::", - stringify!(sha1) - ) + "Offset of field: TPMU_HA::sha1" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).sha256) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_HA), - "::", - stringify!(sha256) - ) + "Offset of field: TPMU_HA::sha256" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).sha384) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_HA), - "::", - stringify!(sha384) - ) + "Offset of field: TPMU_HA::sha384" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).sha512) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_HA), - "::", - stringify!(sha512) - ) + "Offset of field: TPMU_HA::sha512" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).sm3_256) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_HA), - "::", - stringify!(sm3_256) - ) + "Offset of field: TPMU_HA::sm3_256" ); } impl Default for TPMU_HA { @@ -864,35 +789,21 @@ pub struct TPMT_HA { fn bindgen_test_layout_TPMT_HA() { const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 66usize, - concat!("Size of: ", stringify!(TPMT_HA)) - ); + assert_eq!(::std::mem::size_of::(), 66usize, "Size of TPMT_HA"); assert_eq!( ::std::mem::align_of::(), 2usize, - concat!("Alignment of ", stringify!(TPMT_HA)) + "Alignment of TPMT_HA" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).hashAlg) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMT_HA), - "::", - stringify!(hashAlg) - ) + "Offset of field: TPMT_HA::hashAlg" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).digest) as usize - ptr as usize }, 2usize, - concat!( - "Offset of field: ", - stringify!(TPMT_HA), - "::", - stringify!(digest) - ) + "Offset of field: TPMT_HA::digest" ); } impl Default for TPMT_HA { @@ -917,32 +828,22 @@ fn bindgen_test_layout_TPM2B_DIGEST() { assert_eq!( ::std::mem::size_of::(), 66usize, - concat!("Size of: ", stringify!(TPM2B_DIGEST)) + "Size of TPM2B_DIGEST" ); assert_eq!( ::std::mem::align_of::(), 2usize, - concat!("Alignment of ", stringify!(TPM2B_DIGEST)) + "Alignment of TPM2B_DIGEST" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).size) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPM2B_DIGEST), - "::", - stringify!(size) - ) + "Offset of field: TPM2B_DIGEST::size" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).buffer) as usize - ptr as usize }, 2usize, - concat!( - "Offset of field: ", - stringify!(TPM2B_DIGEST), - "::", - stringify!(buffer) - ) + "Offset of field: TPM2B_DIGEST::buffer" ); } impl Default for TPM2B_DIGEST { @@ -967,32 +868,22 @@ fn bindgen_test_layout_TPM2B_DATA() { assert_eq!( ::std::mem::size_of::(), 66usize, - concat!("Size of: ", stringify!(TPM2B_DATA)) + "Size of TPM2B_DATA" ); assert_eq!( ::std::mem::align_of::(), 2usize, - concat!("Alignment of ", stringify!(TPM2B_DATA)) + "Alignment of TPM2B_DATA" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).size) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPM2B_DATA), - "::", - stringify!(size) - ) + "Offset of field: TPM2B_DATA::size" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).buffer) as usize - ptr as usize }, 2usize, - concat!( - "Offset of field: ", - stringify!(TPM2B_DATA), - "::", - stringify!(buffer) - ) + "Offset of field: TPM2B_DATA::buffer" ); } impl Default for TPM2B_DATA { @@ -1020,32 +911,22 @@ fn bindgen_test_layout_TPM2B_EVENT() { assert_eq!( ::std::mem::size_of::(), 1026usize, - concat!("Size of: ", stringify!(TPM2B_EVENT)) + "Size of TPM2B_EVENT" ); assert_eq!( ::std::mem::align_of::(), 2usize, - concat!("Alignment of ", stringify!(TPM2B_EVENT)) + "Alignment of TPM2B_EVENT" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).size) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPM2B_EVENT), - "::", - stringify!(size) - ) + "Offset of field: TPM2B_EVENT::size" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).buffer) as usize - ptr as usize }, 2usize, - concat!( - "Offset of field: ", - stringify!(TPM2B_EVENT), - "::", - stringify!(buffer) - ) + "Offset of field: TPM2B_EVENT::buffer" ); } impl Default for TPM2B_EVENT { @@ -1070,32 +951,22 @@ fn bindgen_test_layout_TPM2B_MAX_BUFFER() { assert_eq!( ::std::mem::size_of::(), 1026usize, - concat!("Size of: ", stringify!(TPM2B_MAX_BUFFER)) + "Size of TPM2B_MAX_BUFFER" ); assert_eq!( ::std::mem::align_of::(), 2usize, - concat!("Alignment of ", stringify!(TPM2B_MAX_BUFFER)) + "Alignment of TPM2B_MAX_BUFFER" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).size) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPM2B_MAX_BUFFER), - "::", - stringify!(size) - ) + "Offset of field: TPM2B_MAX_BUFFER::size" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).buffer) as usize - ptr as usize }, 2usize, - concat!( - "Offset of field: ", - stringify!(TPM2B_MAX_BUFFER), - "::", - stringify!(buffer) - ) + "Offset of field: TPM2B_MAX_BUFFER::buffer" ); } impl Default for TPM2B_MAX_BUFFER { @@ -1120,32 +991,22 @@ fn bindgen_test_layout_TPM2B_MAX_NV_BUFFER() { assert_eq!( ::std::mem::size_of::(), 2050usize, - concat!("Size of: ", stringify!(TPM2B_MAX_NV_BUFFER)) + "Size of TPM2B_MAX_NV_BUFFER" ); assert_eq!( ::std::mem::align_of::(), 2usize, - concat!("Alignment of ", stringify!(TPM2B_MAX_NV_BUFFER)) + "Alignment of TPM2B_MAX_NV_BUFFER" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).size) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPM2B_MAX_NV_BUFFER), - "::", - stringify!(size) - ) + "Offset of field: TPM2B_MAX_NV_BUFFER::size" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).buffer) as usize - ptr as usize }, 2usize, - concat!( - "Offset of field: ", - stringify!(TPM2B_MAX_NV_BUFFER), - "::", - stringify!(buffer) - ) + "Offset of field: TPM2B_MAX_NV_BUFFER::buffer" ); } impl Default for TPM2B_MAX_NV_BUFFER { @@ -1171,32 +1032,22 @@ fn bindgen_test_layout_TPM2B_IV() { assert_eq!( ::std::mem::size_of::(), 18usize, - concat!("Size of: ", stringify!(TPM2B_IV)) + "Size of TPM2B_IV" ); assert_eq!( ::std::mem::align_of::(), 2usize, - concat!("Alignment of ", stringify!(TPM2B_IV)) + "Alignment of TPM2B_IV" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).size) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPM2B_IV), - "::", - stringify!(size) - ) + "Offset of field: TPM2B_IV::size" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).buffer) as usize - ptr as usize }, 2usize, - concat!( - "Offset of field: ", - stringify!(TPM2B_IV), - "::", - stringify!(buffer) - ) + "Offset of field: TPM2B_IV::buffer" ); } #[repr(C)] @@ -1212,32 +1063,22 @@ fn bindgen_test_layout_TPMU_NAME() { assert_eq!( ::std::mem::size_of::(), 68usize, - concat!("Size of: ", stringify!(TPMU_NAME)) + "Size of TPMU_NAME" ); assert_eq!( ::std::mem::align_of::(), 4usize, - concat!("Alignment of ", stringify!(TPMU_NAME)) + "Alignment of TPMU_NAME" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).digest) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_NAME), - "::", - stringify!(digest) - ) + "Offset of field: TPMU_NAME::digest" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).handle) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_NAME), - "::", - stringify!(handle) - ) + "Offset of field: TPMU_NAME::handle" ); } impl Default for TPMU_NAME { @@ -1262,32 +1103,22 @@ fn bindgen_test_layout_TPM2B_NAME() { assert_eq!( ::std::mem::size_of::(), 70usize, - concat!("Size of: ", stringify!(TPM2B_NAME)) + "Size of TPM2B_NAME" ); assert_eq!( ::std::mem::align_of::(), 2usize, - concat!("Alignment of ", stringify!(TPM2B_NAME)) + "Alignment of TPM2B_NAME" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).size) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPM2B_NAME), - "::", - stringify!(size) - ) + "Offset of field: TPM2B_NAME::size" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).name) as usize - ptr as usize }, 2usize, - concat!( - "Offset of field: ", - stringify!(TPM2B_NAME), - "::", - stringify!(name) - ) + "Offset of field: TPM2B_NAME::name" ); } impl Default for TPM2B_NAME { @@ -1312,32 +1143,22 @@ fn bindgen_test_layout_TPMS_PCR_SELECT() { assert_eq!( ::std::mem::size_of::(), 5usize, - concat!("Size of: ", stringify!(TPMS_PCR_SELECT)) + "Size of TPMS_PCR_SELECT" ); assert_eq!( ::std::mem::align_of::(), 1usize, - concat!("Alignment of ", stringify!(TPMS_PCR_SELECT)) + "Alignment of TPMS_PCR_SELECT" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).sizeofSelect) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMS_PCR_SELECT), - "::", - stringify!(sizeofSelect) - ) + "Offset of field: TPMS_PCR_SELECT::sizeofSelect" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).pcrSelect) as usize - ptr as usize }, 1usize, - concat!( - "Offset of field: ", - stringify!(TPMS_PCR_SELECT), - "::", - stringify!(pcrSelect) - ) + "Offset of field: TPMS_PCR_SELECT::pcrSelect" ); } #[repr(C)] @@ -1354,42 +1175,27 @@ fn bindgen_test_layout_TPMS_PCR_SELECTION() { assert_eq!( ::std::mem::size_of::(), 8usize, - concat!("Size of: ", stringify!(TPMS_PCR_SELECTION)) + "Size of TPMS_PCR_SELECTION" ); assert_eq!( ::std::mem::align_of::(), 2usize, - concat!("Alignment of ", stringify!(TPMS_PCR_SELECTION)) + "Alignment of TPMS_PCR_SELECTION" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).hash) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMS_PCR_SELECTION), - "::", - stringify!(hash) - ) + "Offset of field: TPMS_PCR_SELECTION::hash" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).sizeofSelect) as usize - ptr as usize }, 2usize, - concat!( - "Offset of field: ", - stringify!(TPMS_PCR_SELECTION), - "::", - stringify!(sizeofSelect) - ) + "Offset of field: TPMS_PCR_SELECTION::sizeofSelect" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).pcrSelect) as usize - ptr as usize }, 3usize, - concat!( - "Offset of field: ", - stringify!(TPMS_PCR_SELECTION), - "::", - stringify!(pcrSelect) - ) + "Offset of field: TPMS_PCR_SELECTION::pcrSelect" ); } #[repr(C)] @@ -1406,42 +1212,27 @@ fn bindgen_test_layout_TPMT_TK_CREATION() { assert_eq!( ::std::mem::size_of::(), 76usize, - concat!("Size of: ", stringify!(TPMT_TK_CREATION)) + "Size of TPMT_TK_CREATION" ); assert_eq!( ::std::mem::align_of::(), 4usize, - concat!("Alignment of ", stringify!(TPMT_TK_CREATION)) + "Alignment of TPMT_TK_CREATION" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).tag) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMT_TK_CREATION), - "::", - stringify!(tag) - ) + "Offset of field: TPMT_TK_CREATION::tag" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).hierarchy) as usize - ptr as usize }, 4usize, - concat!( - "Offset of field: ", - stringify!(TPMT_TK_CREATION), - "::", - stringify!(hierarchy) - ) + "Offset of field: TPMT_TK_CREATION::hierarchy" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).digest) as usize - ptr as usize }, 8usize, - concat!( - "Offset of field: ", - stringify!(TPMT_TK_CREATION), - "::", - stringify!(digest) - ) + "Offset of field: TPMT_TK_CREATION::digest" ); } impl Default for TPMT_TK_CREATION { @@ -1467,42 +1258,27 @@ fn bindgen_test_layout_TPMT_TK_VERIFIED() { assert_eq!( ::std::mem::size_of::(), 76usize, - concat!("Size of: ", stringify!(TPMT_TK_VERIFIED)) + "Size of TPMT_TK_VERIFIED" ); assert_eq!( ::std::mem::align_of::(), 4usize, - concat!("Alignment of ", stringify!(TPMT_TK_VERIFIED)) + "Alignment of TPMT_TK_VERIFIED" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).tag) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMT_TK_VERIFIED), - "::", - stringify!(tag) - ) + "Offset of field: TPMT_TK_VERIFIED::tag" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).hierarchy) as usize - ptr as usize }, 4usize, - concat!( - "Offset of field: ", - stringify!(TPMT_TK_VERIFIED), - "::", - stringify!(hierarchy) - ) + "Offset of field: TPMT_TK_VERIFIED::hierarchy" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).digest) as usize - ptr as usize }, 8usize, - concat!( - "Offset of field: ", - stringify!(TPMT_TK_VERIFIED), - "::", - stringify!(digest) - ) + "Offset of field: TPMT_TK_VERIFIED::digest" ); } impl Default for TPMT_TK_VERIFIED { @@ -1528,42 +1304,27 @@ fn bindgen_test_layout_TPMT_TK_AUTH() { assert_eq!( ::std::mem::size_of::(), 76usize, - concat!("Size of: ", stringify!(TPMT_TK_AUTH)) + "Size of TPMT_TK_AUTH" ); assert_eq!( ::std::mem::align_of::(), 4usize, - concat!("Alignment of ", stringify!(TPMT_TK_AUTH)) + "Alignment of TPMT_TK_AUTH" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).tag) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMT_TK_AUTH), - "::", - stringify!(tag) - ) + "Offset of field: TPMT_TK_AUTH::tag" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).hierarchy) as usize - ptr as usize }, 4usize, - concat!( - "Offset of field: ", - stringify!(TPMT_TK_AUTH), - "::", - stringify!(hierarchy) - ) + "Offset of field: TPMT_TK_AUTH::hierarchy" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).digest) as usize - ptr as usize }, 8usize, - concat!( - "Offset of field: ", - stringify!(TPMT_TK_AUTH), - "::", - stringify!(digest) - ) + "Offset of field: TPMT_TK_AUTH::digest" ); } impl Default for TPMT_TK_AUTH { @@ -1589,42 +1350,27 @@ fn bindgen_test_layout_TPMT_TK_HASHCHECK() { assert_eq!( ::std::mem::size_of::(), 76usize, - concat!("Size of: ", stringify!(TPMT_TK_HASHCHECK)) + "Size of TPMT_TK_HASHCHECK" ); assert_eq!( ::std::mem::align_of::(), 4usize, - concat!("Alignment of ", stringify!(TPMT_TK_HASHCHECK)) + "Alignment of TPMT_TK_HASHCHECK" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).tag) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMT_TK_HASHCHECK), - "::", - stringify!(tag) - ) + "Offset of field: TPMT_TK_HASHCHECK::tag" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).hierarchy) as usize - ptr as usize }, 4usize, - concat!( - "Offset of field: ", - stringify!(TPMT_TK_HASHCHECK), - "::", - stringify!(hierarchy) - ) + "Offset of field: TPMT_TK_HASHCHECK::hierarchy" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).digest) as usize - ptr as usize }, 8usize, - concat!( - "Offset of field: ", - stringify!(TPMT_TK_HASHCHECK), - "::", - stringify!(digest) - ) + "Offset of field: TPMT_TK_HASHCHECK::digest" ); } impl Default for TPMT_TK_HASHCHECK { @@ -1649,32 +1395,22 @@ fn bindgen_test_layout_TPMS_ALG_PROPERTY() { assert_eq!( ::std::mem::size_of::(), 8usize, - concat!("Size of: ", stringify!(TPMS_ALG_PROPERTY)) + "Size of TPMS_ALG_PROPERTY" ); assert_eq!( ::std::mem::align_of::(), 4usize, - concat!("Alignment of ", stringify!(TPMS_ALG_PROPERTY)) + "Alignment of TPMS_ALG_PROPERTY" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).alg) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMS_ALG_PROPERTY), - "::", - stringify!(alg) - ) + "Offset of field: TPMS_ALG_PROPERTY::alg" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).algProperties) as usize - ptr as usize }, 4usize, - concat!( - "Offset of field: ", - stringify!(TPMS_ALG_PROPERTY), - "::", - stringify!(algProperties) - ) + "Offset of field: TPMS_ALG_PROPERTY::algProperties" ); } #[repr(C)] @@ -1690,32 +1426,22 @@ fn bindgen_test_layout_TPMS_TAGGED_PROPERTY() { assert_eq!( ::std::mem::size_of::(), 8usize, - concat!("Size of: ", stringify!(TPMS_TAGGED_PROPERTY)) + "Size of TPMS_TAGGED_PROPERTY" ); assert_eq!( ::std::mem::align_of::(), 4usize, - concat!("Alignment of ", stringify!(TPMS_TAGGED_PROPERTY)) + "Alignment of TPMS_TAGGED_PROPERTY" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).property) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMS_TAGGED_PROPERTY), - "::", - stringify!(property) - ) + "Offset of field: TPMS_TAGGED_PROPERTY::property" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).value) as usize - ptr as usize }, 4usize, - concat!( - "Offset of field: ", - stringify!(TPMS_TAGGED_PROPERTY), - "::", - stringify!(value) - ) + "Offset of field: TPMS_TAGGED_PROPERTY::value" ); } #[repr(C)] @@ -1733,42 +1459,27 @@ fn bindgen_test_layout_TPMS_TAGGED_PCR_SELECT() { assert_eq!( ::std::mem::size_of::(), 12usize, - concat!("Size of: ", stringify!(TPMS_TAGGED_PCR_SELECT)) + "Size of TPMS_TAGGED_PCR_SELECT" ); assert_eq!( ::std::mem::align_of::(), 4usize, - concat!("Alignment of ", stringify!(TPMS_TAGGED_PCR_SELECT)) + "Alignment of TPMS_TAGGED_PCR_SELECT" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).tag) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMS_TAGGED_PCR_SELECT), - "::", - stringify!(tag) - ) + "Offset of field: TPMS_TAGGED_PCR_SELECT::tag" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).sizeofSelect) as usize - ptr as usize }, 4usize, - concat!( - "Offset of field: ", - stringify!(TPMS_TAGGED_PCR_SELECT), - "::", - stringify!(sizeofSelect) - ) + "Offset of field: TPMS_TAGGED_PCR_SELECT::sizeofSelect" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).pcrSelect) as usize - ptr as usize }, 5usize, - concat!( - "Offset of field: ", - stringify!(TPMS_TAGGED_PCR_SELECT), - "::", - stringify!(pcrSelect) - ) + "Offset of field: TPMS_TAGGED_PCR_SELECT::pcrSelect" ); } #[repr(C)] @@ -1784,32 +1495,22 @@ fn bindgen_test_layout_TPMS_TAGGED_POLICY() { assert_eq!( ::std::mem::size_of::(), 72usize, - concat!("Size of: ", stringify!(TPMS_TAGGED_POLICY)) + "Size of TPMS_TAGGED_POLICY" ); assert_eq!( ::std::mem::align_of::(), 4usize, - concat!("Alignment of ", stringify!(TPMS_TAGGED_POLICY)) + "Alignment of TPMS_TAGGED_POLICY" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).handle) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMS_TAGGED_POLICY), - "::", - stringify!(handle) - ) + "Offset of field: TPMS_TAGGED_POLICY::handle" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).policyHash) as usize - ptr as usize }, 4usize, - concat!( - "Offset of field: ", - stringify!(TPMS_TAGGED_POLICY), - "::", - stringify!(policyHash) - ) + "Offset of field: TPMS_TAGGED_POLICY::policyHash" ); } impl Default for TPMS_TAGGED_POLICY { @@ -1835,42 +1536,27 @@ fn bindgen_test_layout_TPMS_ACT_DATA() { assert_eq!( ::std::mem::size_of::(), 12usize, - concat!("Size of: ", stringify!(TPMS_ACT_DATA)) + "Size of TPMS_ACT_DATA" ); assert_eq!( ::std::mem::align_of::(), 4usize, - concat!("Alignment of ", stringify!(TPMS_ACT_DATA)) + "Alignment of TPMS_ACT_DATA" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).handle) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMS_ACT_DATA), - "::", - stringify!(handle) - ) + "Offset of field: TPMS_ACT_DATA::handle" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).timeout) as usize - ptr as usize }, 4usize, - concat!( - "Offset of field: ", - stringify!(TPMS_ACT_DATA), - "::", - stringify!(timeout) - ) + "Offset of field: TPMS_ACT_DATA::timeout" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).attributes) as usize - ptr as usize }, 8usize, - concat!( - "Offset of field: ", - stringify!(TPMS_ACT_DATA), - "::", - stringify!(attributes) - ) + "Offset of field: TPMS_ACT_DATA::attributes" ); } #[repr(C)] @@ -1886,32 +1572,22 @@ fn bindgen_test_layout_TPML_CC() { assert_eq!( ::std::mem::size_of::(), 1028usize, - concat!("Size of: ", stringify!(TPML_CC)) + "Size of TPML_CC" ); assert_eq!( ::std::mem::align_of::(), 4usize, - concat!("Alignment of ", stringify!(TPML_CC)) + "Alignment of TPML_CC" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).count) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPML_CC), - "::", - stringify!(count) - ) + "Offset of field: TPML_CC::count" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).commandCodes) as usize - ptr as usize }, 4usize, - concat!( - "Offset of field: ", - stringify!(TPML_CC), - "::", - stringify!(commandCodes) - ) + "Offset of field: TPML_CC::commandCodes" ); } impl Default for TPML_CC { @@ -1936,32 +1612,22 @@ fn bindgen_test_layout_TPML_CCA() { assert_eq!( ::std::mem::size_of::(), 1028usize, - concat!("Size of: ", stringify!(TPML_CCA)) + "Size of TPML_CCA" ); assert_eq!( ::std::mem::align_of::(), 4usize, - concat!("Alignment of ", stringify!(TPML_CCA)) + "Alignment of TPML_CCA" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).count) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPML_CCA), - "::", - stringify!(count) - ) + "Offset of field: TPML_CCA::count" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).commandAttributes) as usize - ptr as usize }, 4usize, - concat!( - "Offset of field: ", - stringify!(TPML_CCA), - "::", - stringify!(commandAttributes) - ) + "Offset of field: TPML_CCA::commandAttributes" ); } impl Default for TPML_CCA { @@ -1986,32 +1652,22 @@ fn bindgen_test_layout_TPML_ALG() { assert_eq!( ::std::mem::size_of::(), 260usize, - concat!("Size of: ", stringify!(TPML_ALG)) + "Size of TPML_ALG" ); assert_eq!( ::std::mem::align_of::(), 4usize, - concat!("Alignment of ", stringify!(TPML_ALG)) + "Alignment of TPML_ALG" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).count) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPML_ALG), - "::", - stringify!(count) - ) + "Offset of field: TPML_ALG::count" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).algorithms) as usize - ptr as usize }, 4usize, - concat!( - "Offset of field: ", - stringify!(TPML_ALG), - "::", - stringify!(algorithms) - ) + "Offset of field: TPML_ALG::algorithms" ); } impl Default for TPML_ALG { @@ -2036,32 +1692,22 @@ fn bindgen_test_layout_TPML_HANDLE() { assert_eq!( ::std::mem::size_of::(), 1020usize, - concat!("Size of: ", stringify!(TPML_HANDLE)) + "Size of TPML_HANDLE" ); assert_eq!( ::std::mem::align_of::(), 4usize, - concat!("Alignment of ", stringify!(TPML_HANDLE)) + "Alignment of TPML_HANDLE" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).count) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPML_HANDLE), - "::", - stringify!(count) - ) + "Offset of field: TPML_HANDLE::count" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).handle) as usize - ptr as usize }, 4usize, - concat!( - "Offset of field: ", - stringify!(TPML_HANDLE), - "::", - stringify!(handle) - ) + "Offset of field: TPML_HANDLE::handle" ); } impl Default for TPML_HANDLE { @@ -2086,32 +1732,22 @@ fn bindgen_test_layout_TPML_DIGEST() { assert_eq!( ::std::mem::size_of::(), 532usize, - concat!("Size of: ", stringify!(TPML_DIGEST)) + "Size of TPML_DIGEST" ); assert_eq!( ::std::mem::align_of::(), 4usize, - concat!("Alignment of ", stringify!(TPML_DIGEST)) + "Alignment of TPML_DIGEST" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).count) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPML_DIGEST), - "::", - stringify!(count) - ) + "Offset of field: TPML_DIGEST::count" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).digests) as usize - ptr as usize }, 4usize, - concat!( - "Offset of field: ", - stringify!(TPML_DIGEST), - "::", - stringify!(digests) - ) + "Offset of field: TPML_DIGEST::digests" ); } impl Default for TPML_DIGEST { @@ -2136,32 +1772,22 @@ fn bindgen_test_layout_TPML_DIGEST_VALUES() { assert_eq!( ::std::mem::size_of::(), 1060usize, - concat!("Size of: ", stringify!(TPML_DIGEST_VALUES)) + "Size of TPML_DIGEST_VALUES" ); assert_eq!( ::std::mem::align_of::(), 4usize, - concat!("Alignment of ", stringify!(TPML_DIGEST_VALUES)) + "Alignment of TPML_DIGEST_VALUES" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).count) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPML_DIGEST_VALUES), - "::", - stringify!(count) - ) + "Offset of field: TPML_DIGEST_VALUES::count" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).digests) as usize - ptr as usize }, 4usize, - concat!( - "Offset of field: ", - stringify!(TPML_DIGEST_VALUES), - "::", - stringify!(digests) - ) + "Offset of field: TPML_DIGEST_VALUES::digests" ); } impl Default for TPML_DIGEST_VALUES { @@ -2186,32 +1812,22 @@ fn bindgen_test_layout_TPML_PCR_SELECTION() { assert_eq!( ::std::mem::size_of::(), 132usize, - concat!("Size of: ", stringify!(TPML_PCR_SELECTION)) + "Size of TPML_PCR_SELECTION" ); assert_eq!( ::std::mem::align_of::(), 4usize, - concat!("Alignment of ", stringify!(TPML_PCR_SELECTION)) + "Alignment of TPML_PCR_SELECTION" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).count) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPML_PCR_SELECTION), - "::", - stringify!(count) - ) + "Offset of field: TPML_PCR_SELECTION::count" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).pcrSelections) as usize - ptr as usize }, 4usize, - concat!( - "Offset of field: ", - stringify!(TPML_PCR_SELECTION), - "::", - stringify!(pcrSelections) - ) + "Offset of field: TPML_PCR_SELECTION::pcrSelections" ); } #[repr(C)] @@ -2227,32 +1843,22 @@ fn bindgen_test_layout_TPML_ALG_PROPERTY() { assert_eq!( ::std::mem::size_of::(), 1020usize, - concat!("Size of: ", stringify!(TPML_ALG_PROPERTY)) + "Size of TPML_ALG_PROPERTY" ); assert_eq!( ::std::mem::align_of::(), 4usize, - concat!("Alignment of ", stringify!(TPML_ALG_PROPERTY)) + "Alignment of TPML_ALG_PROPERTY" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).count) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPML_ALG_PROPERTY), - "::", - stringify!(count) - ) + "Offset of field: TPML_ALG_PROPERTY::count" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).algProperties) as usize - ptr as usize }, 4usize, - concat!( - "Offset of field: ", - stringify!(TPML_ALG_PROPERTY), - "::", - stringify!(algProperties) - ) + "Offset of field: TPML_ALG_PROPERTY::algProperties" ); } impl Default for TPML_ALG_PROPERTY { @@ -2278,32 +1884,22 @@ fn bindgen_test_layout_TPML_TAGGED_TPM_PROPERTY() { assert_eq!( ::std::mem::size_of::(), 1020usize, - concat!("Size of: ", stringify!(TPML_TAGGED_TPM_PROPERTY)) + "Size of TPML_TAGGED_TPM_PROPERTY" ); assert_eq!( ::std::mem::align_of::(), 4usize, - concat!("Alignment of ", stringify!(TPML_TAGGED_TPM_PROPERTY)) + "Alignment of TPML_TAGGED_TPM_PROPERTY" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).count) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPML_TAGGED_TPM_PROPERTY), - "::", - stringify!(count) - ) + "Offset of field: TPML_TAGGED_TPM_PROPERTY::count" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).tpmProperty) as usize - ptr as usize }, 4usize, - concat!( - "Offset of field: ", - stringify!(TPML_TAGGED_TPM_PROPERTY), - "::", - stringify!(tpmProperty) - ) + "Offset of field: TPML_TAGGED_TPM_PROPERTY::tpmProperty" ); } impl Default for TPML_TAGGED_TPM_PROPERTY { @@ -2329,32 +1925,22 @@ fn bindgen_test_layout_TPML_TAGGED_PCR_PROPERTY() { assert_eq!( ::std::mem::size_of::(), 1012usize, - concat!("Size of: ", stringify!(TPML_TAGGED_PCR_PROPERTY)) + "Size of TPML_TAGGED_PCR_PROPERTY" ); assert_eq!( ::std::mem::align_of::(), 4usize, - concat!("Alignment of ", stringify!(TPML_TAGGED_PCR_PROPERTY)) + "Alignment of TPML_TAGGED_PCR_PROPERTY" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).count) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPML_TAGGED_PCR_PROPERTY), - "::", - stringify!(count) - ) + "Offset of field: TPML_TAGGED_PCR_PROPERTY::count" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).pcrProperty) as usize - ptr as usize }, 4usize, - concat!( - "Offset of field: ", - stringify!(TPML_TAGGED_PCR_PROPERTY), - "::", - stringify!(pcrProperty) - ) + "Offset of field: TPML_TAGGED_PCR_PROPERTY::pcrProperty" ); } impl Default for TPML_TAGGED_PCR_PROPERTY { @@ -2379,32 +1965,22 @@ fn bindgen_test_layout_TPML_ECC_CURVE() { assert_eq!( ::std::mem::size_of::(), 1020usize, - concat!("Size of: ", stringify!(TPML_ECC_CURVE)) + "Size of TPML_ECC_CURVE" ); assert_eq!( ::std::mem::align_of::(), 4usize, - concat!("Alignment of ", stringify!(TPML_ECC_CURVE)) + "Alignment of TPML_ECC_CURVE" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).count) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPML_ECC_CURVE), - "::", - stringify!(count) - ) + "Offset of field: TPML_ECC_CURVE::count" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).eccCurves) as usize - ptr as usize }, 4usize, - concat!( - "Offset of field: ", - stringify!(TPML_ECC_CURVE), - "::", - stringify!(eccCurves) - ) + "Offset of field: TPML_ECC_CURVE::eccCurves" ); } impl Default for TPML_ECC_CURVE { @@ -2429,32 +2005,22 @@ fn bindgen_test_layout_TPML_TAGGED_POLICY() { assert_eq!( ::std::mem::size_of::(), 1012usize, - concat!("Size of: ", stringify!(TPML_TAGGED_POLICY)) + "Size of TPML_TAGGED_POLICY" ); assert_eq!( ::std::mem::align_of::(), 4usize, - concat!("Alignment of ", stringify!(TPML_TAGGED_POLICY)) + "Alignment of TPML_TAGGED_POLICY" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).count) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPML_TAGGED_POLICY), - "::", - stringify!(count) - ) + "Offset of field: TPML_TAGGED_POLICY::count" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).policies) as usize - ptr as usize }, 4usize, - concat!( - "Offset of field: ", - stringify!(TPML_TAGGED_POLICY), - "::", - stringify!(policies) - ) + "Offset of field: TPML_TAGGED_POLICY::policies" ); } impl Default for TPML_TAGGED_POLICY { @@ -2479,32 +2045,22 @@ fn bindgen_test_layout_TPML_ACT_DATA() { assert_eq!( ::std::mem::size_of::(), 1012usize, - concat!("Size of: ", stringify!(TPML_ACT_DATA)) + "Size of TPML_ACT_DATA" ); assert_eq!( ::std::mem::align_of::(), 4usize, - concat!("Alignment of ", stringify!(TPML_ACT_DATA)) + "Alignment of TPML_ACT_DATA" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).count) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPML_ACT_DATA), - "::", - stringify!(count) - ) + "Offset of field: TPML_ACT_DATA::count" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).actData) as usize - ptr as usize }, 4usize, - concat!( - "Offset of field: ", - stringify!(TPML_ACT_DATA), - "::", - stringify!(actData) - ) + "Offset of field: TPML_ACT_DATA::actData" ); } impl Default for TPML_ACT_DATA { @@ -2518,47 +2074,36 @@ impl Default for TPML_ACT_DATA { } #[repr(C)] #[derive(Debug, Copy, Clone)] -pub struct TPML_INTEL_PTT_PROPERTY { - pub count: UINT32, - pub property: [UINT32; 256usize], +pub struct TPM2B_MAX_CAP_BUFFER { + pub size: UINT16, + pub buffer: [BYTE; 1024usize], } #[test] -fn bindgen_test_layout_TPML_INTEL_PTT_PROPERTY() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); +fn bindgen_test_layout_TPM2B_MAX_CAP_BUFFER() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); let ptr = UNINIT.as_ptr(); assert_eq!( - ::std::mem::size_of::(), - 1028usize, - concat!("Size of: ", stringify!(TPML_INTEL_PTT_PROPERTY)) + ::std::mem::size_of::(), + 1026usize, + "Size of TPM2B_MAX_CAP_BUFFER" ); assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(TPML_INTEL_PTT_PROPERTY)) + ::std::mem::align_of::(), + 2usize, + "Alignment of TPM2B_MAX_CAP_BUFFER" ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).count) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).size) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPML_INTEL_PTT_PROPERTY), - "::", - stringify!(count) - ) + "Offset of field: TPM2B_MAX_CAP_BUFFER::size" ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).property) as usize - ptr as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(TPML_INTEL_PTT_PROPERTY), - "::", - stringify!(property) - ) + unsafe { ::std::ptr::addr_of!((*ptr).buffer) as usize - ptr as usize }, + 2usize, + "Offset of field: TPM2B_MAX_CAP_BUFFER::buffer" ); } -impl Default for TPML_INTEL_PTT_PROPERTY { +impl Default for TPM2B_MAX_CAP_BUFFER { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { @@ -2581,7 +2126,7 @@ pub union TPMU_CAPABILITIES { pub eccCurves: TPML_ECC_CURVE, pub authPolicies: TPML_TAGGED_POLICY, pub actData: TPML_ACT_DATA, - pub intelPttProperty: TPML_INTEL_PTT_PROPERTY, + pub vendor: TPM2B_MAX_CAP_BUFFER, } #[test] fn bindgen_test_layout_TPMU_CAPABILITIES() { @@ -2590,132 +2135,72 @@ fn bindgen_test_layout_TPMU_CAPABILITIES() { assert_eq!( ::std::mem::size_of::(), 1028usize, - concat!("Size of: ", stringify!(TPMU_CAPABILITIES)) + "Size of TPMU_CAPABILITIES" ); assert_eq!( ::std::mem::align_of::(), 4usize, - concat!("Alignment of ", stringify!(TPMU_CAPABILITIES)) + "Alignment of TPMU_CAPABILITIES" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).algorithms) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_CAPABILITIES), - "::", - stringify!(algorithms) - ) + "Offset of field: TPMU_CAPABILITIES::algorithms" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).handles) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_CAPABILITIES), - "::", - stringify!(handles) - ) + "Offset of field: TPMU_CAPABILITIES::handles" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).command) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_CAPABILITIES), - "::", - stringify!(command) - ) + "Offset of field: TPMU_CAPABILITIES::command" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).ppCommands) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_CAPABILITIES), - "::", - stringify!(ppCommands) - ) + "Offset of field: TPMU_CAPABILITIES::ppCommands" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).auditCommands) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_CAPABILITIES), - "::", - stringify!(auditCommands) - ) + "Offset of field: TPMU_CAPABILITIES::auditCommands" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).assignedPCR) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_CAPABILITIES), - "::", - stringify!(assignedPCR) - ) + "Offset of field: TPMU_CAPABILITIES::assignedPCR" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).tpmProperties) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_CAPABILITIES), - "::", - stringify!(tpmProperties) - ) + "Offset of field: TPMU_CAPABILITIES::tpmProperties" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).pcrProperties) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_CAPABILITIES), - "::", - stringify!(pcrProperties) - ) + "Offset of field: TPMU_CAPABILITIES::pcrProperties" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).eccCurves) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_CAPABILITIES), - "::", - stringify!(eccCurves) - ) + "Offset of field: TPMU_CAPABILITIES::eccCurves" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).authPolicies) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_CAPABILITIES), - "::", - stringify!(authPolicies) - ) + "Offset of field: TPMU_CAPABILITIES::authPolicies" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).actData) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_CAPABILITIES), - "::", - stringify!(actData) - ) + "Offset of field: TPMU_CAPABILITIES::actData" ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).intelPttProperty) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).vendor) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_CAPABILITIES), - "::", - stringify!(intelPttProperty) - ) + "Offset of field: TPMU_CAPABILITIES::vendor" ); } impl Default for TPMU_CAPABILITIES { @@ -2740,32 +2225,22 @@ fn bindgen_test_layout_TPMS_CAPABILITY_DATA() { assert_eq!( ::std::mem::size_of::(), 1032usize, - concat!("Size of: ", stringify!(TPMS_CAPABILITY_DATA)) + "Size of TPMS_CAPABILITY_DATA" ); assert_eq!( ::std::mem::align_of::(), 4usize, - concat!("Alignment of ", stringify!(TPMS_CAPABILITY_DATA)) + "Alignment of TPMS_CAPABILITY_DATA" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).capability) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMS_CAPABILITY_DATA), - "::", - stringify!(capability) - ) + "Offset of field: TPMS_CAPABILITY_DATA::capability" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).data) as usize - ptr as usize }, 4usize, - concat!( - "Offset of field: ", - stringify!(TPMS_CAPABILITY_DATA), - "::", - stringify!(data) - ) + "Offset of field: TPMS_CAPABILITY_DATA::data" ); } impl Default for TPMS_CAPABILITY_DATA { @@ -2792,52 +2267,32 @@ fn bindgen_test_layout_TPMS_CLOCK_INFO() { assert_eq!( ::std::mem::size_of::(), 24usize, - concat!("Size of: ", stringify!(TPMS_CLOCK_INFO)) + "Size of TPMS_CLOCK_INFO" ); assert_eq!( ::std::mem::align_of::(), 8usize, - concat!("Alignment of ", stringify!(TPMS_CLOCK_INFO)) + "Alignment of TPMS_CLOCK_INFO" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).clock) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMS_CLOCK_INFO), - "::", - stringify!(clock) - ) + "Offset of field: TPMS_CLOCK_INFO::clock" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).resetCount) as usize - ptr as usize }, 8usize, - concat!( - "Offset of field: ", - stringify!(TPMS_CLOCK_INFO), - "::", - stringify!(resetCount) - ) + "Offset of field: TPMS_CLOCK_INFO::resetCount" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).restartCount) as usize - ptr as usize }, 12usize, - concat!( - "Offset of field: ", - stringify!(TPMS_CLOCK_INFO), - "::", - stringify!(restartCount) - ) + "Offset of field: TPMS_CLOCK_INFO::restartCount" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).safe) as usize - ptr as usize }, 16usize, - concat!( - "Offset of field: ", - stringify!(TPMS_CLOCK_INFO), - "::", - stringify!(safe) - ) + "Offset of field: TPMS_CLOCK_INFO::safe" ); } #[repr(C)] @@ -2853,32 +2308,22 @@ fn bindgen_test_layout_TPMS_TIME_INFO() { assert_eq!( ::std::mem::size_of::(), 32usize, - concat!("Size of: ", stringify!(TPMS_TIME_INFO)) + "Size of TPMS_TIME_INFO" ); assert_eq!( ::std::mem::align_of::(), 8usize, - concat!("Alignment of ", stringify!(TPMS_TIME_INFO)) + "Alignment of TPMS_TIME_INFO" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).time) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMS_TIME_INFO), - "::", - stringify!(time) - ) + "Offset of field: TPMS_TIME_INFO::time" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).clockInfo) as usize - ptr as usize }, 8usize, - concat!( - "Offset of field: ", - stringify!(TPMS_TIME_INFO), - "::", - stringify!(clockInfo) - ) + "Offset of field: TPMS_TIME_INFO::clockInfo" ); } #[repr(C)] @@ -2895,32 +2340,22 @@ fn bindgen_test_layout_TPMS_TIME_ATTEST_INFO() { assert_eq!( ::std::mem::size_of::(), 40usize, - concat!("Size of: ", stringify!(TPMS_TIME_ATTEST_INFO)) + "Size of TPMS_TIME_ATTEST_INFO" ); assert_eq!( ::std::mem::align_of::(), 8usize, - concat!("Alignment of ", stringify!(TPMS_TIME_ATTEST_INFO)) + "Alignment of TPMS_TIME_ATTEST_INFO" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).time) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMS_TIME_ATTEST_INFO), - "::", - stringify!(time) - ) + "Offset of field: TPMS_TIME_ATTEST_INFO::time" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).firmwareVersion) as usize - ptr as usize }, 32usize, - concat!( - "Offset of field: ", - stringify!(TPMS_TIME_ATTEST_INFO), - "::", - stringify!(firmwareVersion) - ) + "Offset of field: TPMS_TIME_ATTEST_INFO::firmwareVersion" ); } #[repr(C)] @@ -2936,32 +2371,22 @@ fn bindgen_test_layout_TPMS_CERTIFY_INFO() { assert_eq!( ::std::mem::size_of::(), 140usize, - concat!("Size of: ", stringify!(TPMS_CERTIFY_INFO)) + "Size of TPMS_CERTIFY_INFO" ); assert_eq!( ::std::mem::align_of::(), 2usize, - concat!("Alignment of ", stringify!(TPMS_CERTIFY_INFO)) + "Alignment of TPMS_CERTIFY_INFO" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).name) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMS_CERTIFY_INFO), - "::", - stringify!(name) - ) + "Offset of field: TPMS_CERTIFY_INFO::name" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).qualifiedName) as usize - ptr as usize }, 70usize, - concat!( - "Offset of field: ", - stringify!(TPMS_CERTIFY_INFO), - "::", - stringify!(qualifiedName) - ) + "Offset of field: TPMS_CERTIFY_INFO::qualifiedName" ); } impl Default for TPMS_CERTIFY_INFO { @@ -2986,32 +2411,22 @@ fn bindgen_test_layout_TPMS_QUOTE_INFO() { assert_eq!( ::std::mem::size_of::(), 200usize, - concat!("Size of: ", stringify!(TPMS_QUOTE_INFO)) + "Size of TPMS_QUOTE_INFO" ); assert_eq!( ::std::mem::align_of::(), 4usize, - concat!("Alignment of ", stringify!(TPMS_QUOTE_INFO)) + "Alignment of TPMS_QUOTE_INFO" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).pcrSelect) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMS_QUOTE_INFO), - "::", - stringify!(pcrSelect) - ) + "Offset of field: TPMS_QUOTE_INFO::pcrSelect" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).pcrDigest) as usize - ptr as usize }, 132usize, - concat!( - "Offset of field: ", - stringify!(TPMS_QUOTE_INFO), - "::", - stringify!(pcrDigest) - ) + "Offset of field: TPMS_QUOTE_INFO::pcrDigest" ); } impl Default for TPMS_QUOTE_INFO { @@ -3039,52 +2454,32 @@ fn bindgen_test_layout_TPMS_COMMAND_AUDIT_INFO() { assert_eq!( ::std::mem::size_of::(), 144usize, - concat!("Size of: ", stringify!(TPMS_COMMAND_AUDIT_INFO)) + "Size of TPMS_COMMAND_AUDIT_INFO" ); assert_eq!( ::std::mem::align_of::(), 8usize, - concat!("Alignment of ", stringify!(TPMS_COMMAND_AUDIT_INFO)) + "Alignment of TPMS_COMMAND_AUDIT_INFO" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).auditCounter) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMS_COMMAND_AUDIT_INFO), - "::", - stringify!(auditCounter) - ) + "Offset of field: TPMS_COMMAND_AUDIT_INFO::auditCounter" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).digestAlg) as usize - ptr as usize }, 8usize, - concat!( - "Offset of field: ", - stringify!(TPMS_COMMAND_AUDIT_INFO), - "::", - stringify!(digestAlg) - ) + "Offset of field: TPMS_COMMAND_AUDIT_INFO::digestAlg" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).auditDigest) as usize - ptr as usize }, 10usize, - concat!( - "Offset of field: ", - stringify!(TPMS_COMMAND_AUDIT_INFO), - "::", - stringify!(auditDigest) - ) + "Offset of field: TPMS_COMMAND_AUDIT_INFO::auditDigest" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).commandDigest) as usize - ptr as usize }, 76usize, - concat!( - "Offset of field: ", - stringify!(TPMS_COMMAND_AUDIT_INFO), - "::", - stringify!(commandDigest) - ) + "Offset of field: TPMS_COMMAND_AUDIT_INFO::commandDigest" ); } impl Default for TPMS_COMMAND_AUDIT_INFO { @@ -3110,32 +2505,22 @@ fn bindgen_test_layout_TPMS_SESSION_AUDIT_INFO() { assert_eq!( ::std::mem::size_of::(), 68usize, - concat!("Size of: ", stringify!(TPMS_SESSION_AUDIT_INFO)) + "Size of TPMS_SESSION_AUDIT_INFO" ); assert_eq!( ::std::mem::align_of::(), 2usize, - concat!("Alignment of ", stringify!(TPMS_SESSION_AUDIT_INFO)) + "Alignment of TPMS_SESSION_AUDIT_INFO" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).exclusiveSession) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMS_SESSION_AUDIT_INFO), - "::", - stringify!(exclusiveSession) - ) + "Offset of field: TPMS_SESSION_AUDIT_INFO::exclusiveSession" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).sessionDigest) as usize - ptr as usize }, 2usize, - concat!( - "Offset of field: ", - stringify!(TPMS_SESSION_AUDIT_INFO), - "::", - stringify!(sessionDigest) - ) + "Offset of field: TPMS_SESSION_AUDIT_INFO::sessionDigest" ); } impl Default for TPMS_SESSION_AUDIT_INFO { @@ -3160,32 +2545,22 @@ fn bindgen_test_layout_TPMS_CREATION_INFO() { assert_eq!( ::std::mem::size_of::(), 136usize, - concat!("Size of: ", stringify!(TPMS_CREATION_INFO)) + "Size of TPMS_CREATION_INFO" ); assert_eq!( ::std::mem::align_of::(), 2usize, - concat!("Alignment of ", stringify!(TPMS_CREATION_INFO)) + "Alignment of TPMS_CREATION_INFO" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).objectName) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMS_CREATION_INFO), - "::", - stringify!(objectName) - ) + "Offset of field: TPMS_CREATION_INFO::objectName" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).creationHash) as usize - ptr as usize }, 70usize, - concat!( - "Offset of field: ", - stringify!(TPMS_CREATION_INFO), - "::", - stringify!(creationHash) - ) + "Offset of field: TPMS_CREATION_INFO::creationHash" ); } impl Default for TPMS_CREATION_INFO { @@ -3211,42 +2586,27 @@ fn bindgen_test_layout_TPMS_NV_CERTIFY_INFO() { assert_eq!( ::std::mem::size_of::(), 2122usize, - concat!("Size of: ", stringify!(TPMS_NV_CERTIFY_INFO)) + "Size of TPMS_NV_CERTIFY_INFO" ); assert_eq!( ::std::mem::align_of::(), 2usize, - concat!("Alignment of ", stringify!(TPMS_NV_CERTIFY_INFO)) + "Alignment of TPMS_NV_CERTIFY_INFO" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).indexName) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMS_NV_CERTIFY_INFO), - "::", - stringify!(indexName) - ) + "Offset of field: TPMS_NV_CERTIFY_INFO::indexName" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).offset) as usize - ptr as usize }, 70usize, - concat!( - "Offset of field: ", - stringify!(TPMS_NV_CERTIFY_INFO), - "::", - stringify!(offset) - ) + "Offset of field: TPMS_NV_CERTIFY_INFO::offset" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).nvContents) as usize - ptr as usize }, 72usize, - concat!( - "Offset of field: ", - stringify!(TPMS_NV_CERTIFY_INFO), - "::", - stringify!(nvContents) - ) + "Offset of field: TPMS_NV_CERTIFY_INFO::nvContents" ); } impl Default for TPMS_NV_CERTIFY_INFO { @@ -3272,32 +2632,22 @@ fn bindgen_test_layout_TPMS_NV_DIGEST_CERTIFY_INFO() { assert_eq!( ::std::mem::size_of::(), 136usize, - concat!("Size of: ", stringify!(TPMS_NV_DIGEST_CERTIFY_INFO)) + "Size of TPMS_NV_DIGEST_CERTIFY_INFO" ); assert_eq!( ::std::mem::align_of::(), 2usize, - concat!("Alignment of ", stringify!(TPMS_NV_DIGEST_CERTIFY_INFO)) + "Alignment of TPMS_NV_DIGEST_CERTIFY_INFO" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).indexName) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMS_NV_DIGEST_CERTIFY_INFO), - "::", - stringify!(indexName) - ) + "Offset of field: TPMS_NV_DIGEST_CERTIFY_INFO::indexName" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).nvDigest) as usize - ptr as usize }, 70usize, - concat!( - "Offset of field: ", - stringify!(TPMS_NV_DIGEST_CERTIFY_INFO), - "::", - stringify!(nvDigest) - ) + "Offset of field: TPMS_NV_DIGEST_CERTIFY_INFO::nvDigest" ); } impl Default for TPMS_NV_DIGEST_CERTIFY_INFO { @@ -3328,82 +2678,47 @@ fn bindgen_test_layout_TPMU_ATTEST() { assert_eq!( ::std::mem::size_of::(), 2128usize, - concat!("Size of: ", stringify!(TPMU_ATTEST)) + "Size of TPMU_ATTEST" ); assert_eq!( ::std::mem::align_of::(), 8usize, - concat!("Alignment of ", stringify!(TPMU_ATTEST)) + "Alignment of TPMU_ATTEST" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).certify) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_ATTEST), - "::", - stringify!(certify) - ) + "Offset of field: TPMU_ATTEST::certify" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).creation) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_ATTEST), - "::", - stringify!(creation) - ) + "Offset of field: TPMU_ATTEST::creation" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).quote) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_ATTEST), - "::", - stringify!(quote) - ) + "Offset of field: TPMU_ATTEST::quote" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).commandAudit) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_ATTEST), - "::", - stringify!(commandAudit) - ) + "Offset of field: TPMU_ATTEST::commandAudit" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).sessionAudit) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_ATTEST), - "::", - stringify!(sessionAudit) - ) + "Offset of field: TPMU_ATTEST::sessionAudit" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).time) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_ATTEST), - "::", - stringify!(time) - ) + "Offset of field: TPMU_ATTEST::time" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).nv) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_ATTEST), - "::", - stringify!(nv) - ) + "Offset of field: TPMU_ATTEST::nv" ); } impl Default for TPMU_ATTEST { @@ -3433,82 +2748,47 @@ fn bindgen_test_layout_TPMS_ATTEST() { assert_eq!( ::std::mem::size_of::(), 2304usize, - concat!("Size of: ", stringify!(TPMS_ATTEST)) + "Size of TPMS_ATTEST" ); assert_eq!( ::std::mem::align_of::(), 8usize, - concat!("Alignment of ", stringify!(TPMS_ATTEST)) + "Alignment of TPMS_ATTEST" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).magic) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMS_ATTEST), - "::", - stringify!(magic) - ) + "Offset of field: TPMS_ATTEST::magic" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).type_) as usize - ptr as usize }, 4usize, - concat!( - "Offset of field: ", - stringify!(TPMS_ATTEST), - "::", - stringify!(type_) - ) + "Offset of field: TPMS_ATTEST::type_" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).qualifiedSigner) as usize - ptr as usize }, 6usize, - concat!( - "Offset of field: ", - stringify!(TPMS_ATTEST), - "::", - stringify!(qualifiedSigner) - ) + "Offset of field: TPMS_ATTEST::qualifiedSigner" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).extraData) as usize - ptr as usize }, 76usize, - concat!( - "Offset of field: ", - stringify!(TPMS_ATTEST), - "::", - stringify!(extraData) - ) + "Offset of field: TPMS_ATTEST::extraData" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).clockInfo) as usize - ptr as usize }, 144usize, - concat!( - "Offset of field: ", - stringify!(TPMS_ATTEST), - "::", - stringify!(clockInfo) - ) + "Offset of field: TPMS_ATTEST::clockInfo" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).firmwareVersion) as usize - ptr as usize }, 168usize, - concat!( - "Offset of field: ", - stringify!(TPMS_ATTEST), - "::", - stringify!(firmwareVersion) - ) + "Offset of field: TPMS_ATTEST::firmwareVersion" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).attested) as usize - ptr as usize }, 176usize, - concat!( - "Offset of field: ", - stringify!(TPMS_ATTEST), - "::", - stringify!(attested) - ) + "Offset of field: TPMS_ATTEST::attested" ); } impl Default for TPMS_ATTEST { @@ -3533,32 +2813,22 @@ fn bindgen_test_layout_TPM2B_ATTEST() { assert_eq!( ::std::mem::size_of::(), 2306usize, - concat!("Size of: ", stringify!(TPM2B_ATTEST)) + "Size of TPM2B_ATTEST" ); assert_eq!( ::std::mem::align_of::(), 2usize, - concat!("Alignment of ", stringify!(TPM2B_ATTEST)) + "Alignment of TPM2B_ATTEST" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).size) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPM2B_ATTEST), - "::", - stringify!(size) - ) + "Offset of field: TPM2B_ATTEST::size" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).attestationData) as usize - ptr as usize }, 2usize, - concat!( - "Offset of field: ", - stringify!(TPM2B_ATTEST), - "::", - stringify!(attestationData) - ) + "Offset of field: TPM2B_ATTEST::attestationData" ); } impl Default for TPM2B_ATTEST { @@ -3585,52 +2855,32 @@ fn bindgen_test_layout_TPMS_AUTH_COMMAND() { assert_eq!( ::std::mem::size_of::(), 140usize, - concat!("Size of: ", stringify!(TPMS_AUTH_COMMAND)) + "Size of TPMS_AUTH_COMMAND" ); assert_eq!( ::std::mem::align_of::(), 4usize, - concat!("Alignment of ", stringify!(TPMS_AUTH_COMMAND)) + "Alignment of TPMS_AUTH_COMMAND" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).sessionHandle) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMS_AUTH_COMMAND), - "::", - stringify!(sessionHandle) - ) + "Offset of field: TPMS_AUTH_COMMAND::sessionHandle" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).nonce) as usize - ptr as usize }, 4usize, - concat!( - "Offset of field: ", - stringify!(TPMS_AUTH_COMMAND), - "::", - stringify!(nonce) - ) + "Offset of field: TPMS_AUTH_COMMAND::nonce" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).sessionAttributes) as usize - ptr as usize }, 70usize, - concat!( - "Offset of field: ", - stringify!(TPMS_AUTH_COMMAND), - "::", - stringify!(sessionAttributes) - ) + "Offset of field: TPMS_AUTH_COMMAND::sessionAttributes" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).hmac) as usize - ptr as usize }, 72usize, - concat!( - "Offset of field: ", - stringify!(TPMS_AUTH_COMMAND), - "::", - stringify!(hmac) - ) + "Offset of field: TPMS_AUTH_COMMAND::hmac" ); } impl Default for TPMS_AUTH_COMMAND { @@ -3656,42 +2906,27 @@ fn bindgen_test_layout_TPMS_AUTH_RESPONSE() { assert_eq!( ::std::mem::size_of::(), 134usize, - concat!("Size of: ", stringify!(TPMS_AUTH_RESPONSE)) + "Size of TPMS_AUTH_RESPONSE" ); assert_eq!( ::std::mem::align_of::(), 2usize, - concat!("Alignment of ", stringify!(TPMS_AUTH_RESPONSE)) + "Alignment of TPMS_AUTH_RESPONSE" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).nonce) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMS_AUTH_RESPONSE), - "::", - stringify!(nonce) - ) + "Offset of field: TPMS_AUTH_RESPONSE::nonce" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).sessionAttributes) as usize - ptr as usize }, 66usize, - concat!( - "Offset of field: ", - stringify!(TPMS_AUTH_RESPONSE), - "::", - stringify!(sessionAttributes) - ) + "Offset of field: TPMS_AUTH_RESPONSE::sessionAttributes" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).hmac) as usize - ptr as usize }, 68usize, - concat!( - "Offset of field: ", - stringify!(TPMS_AUTH_RESPONSE), - "::", - stringify!(hmac) - ) + "Offset of field: TPMS_AUTH_RESPONSE::hmac" ); } impl Default for TPMS_AUTH_RESPONSE { @@ -3714,6 +2949,7 @@ pub union TPMU_SYM_KEY_BITS { pub camellia: TPMI_CAMELLIA_KEY_BITS, pub sym: TPM2_KEY_BITS, pub exclusiveOr: TPMI_ALG_HASH, + pub null: TPMS_EMPTY, } #[test] fn bindgen_test_layout_TPMU_SYM_KEY_BITS() { @@ -3722,62 +2958,42 @@ fn bindgen_test_layout_TPMU_SYM_KEY_BITS() { assert_eq!( ::std::mem::size_of::(), 2usize, - concat!("Size of: ", stringify!(TPMU_SYM_KEY_BITS)) + "Size of TPMU_SYM_KEY_BITS" ); assert_eq!( ::std::mem::align_of::(), 2usize, - concat!("Alignment of ", stringify!(TPMU_SYM_KEY_BITS)) + "Alignment of TPMU_SYM_KEY_BITS" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).aes) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_SYM_KEY_BITS), - "::", - stringify!(aes) - ) + "Offset of field: TPMU_SYM_KEY_BITS::aes" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).sm4) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_SYM_KEY_BITS), - "::", - stringify!(sm4) - ) + "Offset of field: TPMU_SYM_KEY_BITS::sm4" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).camellia) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_SYM_KEY_BITS), - "::", - stringify!(camellia) - ) + "Offset of field: TPMU_SYM_KEY_BITS::camellia" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).sym) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_SYM_KEY_BITS), - "::", - stringify!(sym) - ) + "Offset of field: TPMU_SYM_KEY_BITS::sym" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).exclusiveOr) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_SYM_KEY_BITS), - "::", - stringify!(exclusiveOr) - ) + "Offset of field: TPMU_SYM_KEY_BITS::exclusiveOr" + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).null) as usize - ptr as usize }, + 0usize, + "Offset of field: TPMU_SYM_KEY_BITS::null" ); } impl Default for TPMU_SYM_KEY_BITS { @@ -3796,6 +3012,8 @@ pub union TPMU_SYM_MODE { pub sm4: TPMI_ALG_SYM_MODE, pub camellia: TPMI_ALG_SYM_MODE, pub sym: TPMI_ALG_SYM_MODE, + pub exclusiveOr: TPMS_EMPTY, + pub null: TPMS_EMPTY, } #[test] fn bindgen_test_layout_TPMU_SYM_MODE() { @@ -3804,52 +3022,42 @@ fn bindgen_test_layout_TPMU_SYM_MODE() { assert_eq!( ::std::mem::size_of::(), 2usize, - concat!("Size of: ", stringify!(TPMU_SYM_MODE)) + "Size of TPMU_SYM_MODE" ); assert_eq!( ::std::mem::align_of::(), 2usize, - concat!("Alignment of ", stringify!(TPMU_SYM_MODE)) + "Alignment of TPMU_SYM_MODE" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).aes) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_SYM_MODE), - "::", - stringify!(aes) - ) + "Offset of field: TPMU_SYM_MODE::aes" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).sm4) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_SYM_MODE), - "::", - stringify!(sm4) - ) + "Offset of field: TPMU_SYM_MODE::sm4" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).camellia) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_SYM_MODE), - "::", - stringify!(camellia) - ) + "Offset of field: TPMU_SYM_MODE::camellia" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).sym) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_SYM_MODE), - "::", - stringify!(sym) - ) + "Offset of field: TPMU_SYM_MODE::sym" + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).exclusiveOr) as usize - ptr as usize }, + 0usize, + "Offset of field: TPMU_SYM_MODE::exclusiveOr" + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).null) as usize - ptr as usize }, + 0usize, + "Offset of field: TPMU_SYM_MODE::null" ); } impl Default for TPMU_SYM_MODE { @@ -3875,42 +3083,27 @@ fn bindgen_test_layout_TPMT_SYM_DEF() { assert_eq!( ::std::mem::size_of::(), 6usize, - concat!("Size of: ", stringify!(TPMT_SYM_DEF)) + "Size of TPMT_SYM_DEF" ); assert_eq!( ::std::mem::align_of::(), 2usize, - concat!("Alignment of ", stringify!(TPMT_SYM_DEF)) + "Alignment of TPMT_SYM_DEF" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).algorithm) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMT_SYM_DEF), - "::", - stringify!(algorithm) - ) + "Offset of field: TPMT_SYM_DEF::algorithm" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).keyBits) as usize - ptr as usize }, 2usize, - concat!( - "Offset of field: ", - stringify!(TPMT_SYM_DEF), - "::", - stringify!(keyBits) - ) + "Offset of field: TPMT_SYM_DEF::keyBits" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).mode) as usize - ptr as usize }, 4usize, - concat!( - "Offset of field: ", - stringify!(TPMT_SYM_DEF), - "::", - stringify!(mode) - ) + "Offset of field: TPMT_SYM_DEF::mode" ); } impl Default for TPMT_SYM_DEF { @@ -3936,42 +3129,27 @@ fn bindgen_test_layout_TPMT_SYM_DEF_OBJECT() { assert_eq!( ::std::mem::size_of::(), 6usize, - concat!("Size of: ", stringify!(TPMT_SYM_DEF_OBJECT)) + "Size of TPMT_SYM_DEF_OBJECT" ); assert_eq!( ::std::mem::align_of::(), 2usize, - concat!("Alignment of ", stringify!(TPMT_SYM_DEF_OBJECT)) + "Alignment of TPMT_SYM_DEF_OBJECT" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).algorithm) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMT_SYM_DEF_OBJECT), - "::", - stringify!(algorithm) - ) + "Offset of field: TPMT_SYM_DEF_OBJECT::algorithm" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).keyBits) as usize - ptr as usize }, 2usize, - concat!( - "Offset of field: ", - stringify!(TPMT_SYM_DEF_OBJECT), - "::", - stringify!(keyBits) - ) + "Offset of field: TPMT_SYM_DEF_OBJECT::keyBits" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).mode) as usize - ptr as usize }, 4usize, - concat!( - "Offset of field: ", - stringify!(TPMT_SYM_DEF_OBJECT), - "::", - stringify!(mode) - ) + "Offset of field: TPMT_SYM_DEF_OBJECT::mode" ); } impl Default for TPMT_SYM_DEF_OBJECT { @@ -3996,32 +3174,22 @@ fn bindgen_test_layout_TPM2B_SYM_KEY() { assert_eq!( ::std::mem::size_of::(), 34usize, - concat!("Size of: ", stringify!(TPM2B_SYM_KEY)) + "Size of TPM2B_SYM_KEY" ); assert_eq!( ::std::mem::align_of::(), 2usize, - concat!("Alignment of ", stringify!(TPM2B_SYM_KEY)) + "Alignment of TPM2B_SYM_KEY" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).size) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPM2B_SYM_KEY), - "::", - stringify!(size) - ) + "Offset of field: TPM2B_SYM_KEY::size" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).buffer) as usize - ptr as usize }, 2usize, - concat!( - "Offset of field: ", - stringify!(TPM2B_SYM_KEY), - "::", - stringify!(buffer) - ) + "Offset of field: TPM2B_SYM_KEY::buffer" ); } #[repr(C)] @@ -4036,22 +3204,17 @@ fn bindgen_test_layout_TPMS_SYMCIPHER_PARMS() { assert_eq!( ::std::mem::size_of::(), 6usize, - concat!("Size of: ", stringify!(TPMS_SYMCIPHER_PARMS)) + "Size of TPMS_SYMCIPHER_PARMS" ); assert_eq!( ::std::mem::align_of::(), 2usize, - concat!("Alignment of ", stringify!(TPMS_SYMCIPHER_PARMS)) + "Alignment of TPMS_SYMCIPHER_PARMS" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).sym) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMS_SYMCIPHER_PARMS), - "::", - stringify!(sym) - ) + "Offset of field: TPMS_SYMCIPHER_PARMS::sym" ); } impl Default for TPMS_SYMCIPHER_PARMS { @@ -4064,6 +3227,149 @@ impl Default for TPMS_SYMCIPHER_PARMS { } } #[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct TPM2B_LABEL { + pub size: UINT16, + pub buffer: [BYTE; 32usize], +} +#[test] +fn bindgen_test_layout_TPM2B_LABEL() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 34usize, + "Size of TPM2B_LABEL" + ); + assert_eq!( + ::std::mem::align_of::(), + 2usize, + "Alignment of TPM2B_LABEL" + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).size) as usize - ptr as usize }, + 0usize, + "Offset of field: TPM2B_LABEL::size" + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).buffer) as usize - ptr as usize }, + 2usize, + "Offset of field: TPM2B_LABEL::buffer" + ); +} +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct TPMS_DERIVE { + pub label: TPM2B_LABEL, + pub context: TPM2B_LABEL, +} +#[test] +fn bindgen_test_layout_TPMS_DERIVE() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 68usize, + "Size of TPMS_DERIVE" + ); + assert_eq!( + ::std::mem::align_of::(), + 2usize, + "Alignment of TPMS_DERIVE" + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).label) as usize - ptr as usize }, + 0usize, + "Offset of field: TPMS_DERIVE::label" + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).context) as usize - ptr as usize }, + 34usize, + "Offset of field: TPMS_DERIVE::context" + ); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct TPM2B_DERIVE { + pub size: UINT16, + pub buffer: [BYTE; 68usize], +} +#[test] +fn bindgen_test_layout_TPM2B_DERIVE() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 70usize, + "Size of TPM2B_DERIVE" + ); + assert_eq!( + ::std::mem::align_of::(), + 2usize, + "Alignment of TPM2B_DERIVE" + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).size) as usize - ptr as usize }, + 0usize, + "Offset of field: TPM2B_DERIVE::size" + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).buffer) as usize - ptr as usize }, + 2usize, + "Offset of field: TPM2B_DERIVE::buffer" + ); +} +impl Default for TPM2B_DERIVE { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union TPMU_SENSITIVE_CREATE { + pub create: [BYTE; 256usize], + pub derive: TPMS_DERIVE, +} +#[test] +fn bindgen_test_layout_TPMU_SENSITIVE_CREATE() { + const UNINIT: ::std::mem::MaybeUninit = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 256usize, + "Size of TPMU_SENSITIVE_CREATE" + ); + assert_eq!( + ::std::mem::align_of::(), + 2usize, + "Alignment of TPMU_SENSITIVE_CREATE" + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).create) as usize - ptr as usize }, + 0usize, + "Offset of field: TPMU_SENSITIVE_CREATE::create" + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).derive) as usize - ptr as usize }, + 0usize, + "Offset of field: TPMU_SENSITIVE_CREATE::derive" + ); +} +impl Default for TPMU_SENSITIVE_CREATE { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +#[repr(C)] #[derive(Debug, Copy, Clone)] pub struct TPM2B_SENSITIVE_DATA { pub size: UINT16, @@ -4076,32 +3382,22 @@ fn bindgen_test_layout_TPM2B_SENSITIVE_DATA() { assert_eq!( ::std::mem::size_of::(), 258usize, - concat!("Size of: ", stringify!(TPM2B_SENSITIVE_DATA)) + "Size of TPM2B_SENSITIVE_DATA" ); assert_eq!( ::std::mem::align_of::(), 2usize, - concat!("Alignment of ", stringify!(TPM2B_SENSITIVE_DATA)) + "Alignment of TPM2B_SENSITIVE_DATA" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).size) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPM2B_SENSITIVE_DATA), - "::", - stringify!(size) - ) + "Offset of field: TPM2B_SENSITIVE_DATA::size" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).buffer) as usize - ptr as usize }, 2usize, - concat!( - "Offset of field: ", - stringify!(TPM2B_SENSITIVE_DATA), - "::", - stringify!(buffer) - ) + "Offset of field: TPM2B_SENSITIVE_DATA::buffer" ); } impl Default for TPM2B_SENSITIVE_DATA { @@ -4127,32 +3423,22 @@ fn bindgen_test_layout_TPMS_SENSITIVE_CREATE() { assert_eq!( ::std::mem::size_of::(), 324usize, - concat!("Size of: ", stringify!(TPMS_SENSITIVE_CREATE)) + "Size of TPMS_SENSITIVE_CREATE" ); assert_eq!( ::std::mem::align_of::(), 2usize, - concat!("Alignment of ", stringify!(TPMS_SENSITIVE_CREATE)) + "Alignment of TPMS_SENSITIVE_CREATE" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).userAuth) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMS_SENSITIVE_CREATE), - "::", - stringify!(userAuth) - ) + "Offset of field: TPMS_SENSITIVE_CREATE::userAuth" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).data) as usize - ptr as usize }, 66usize, - concat!( - "Offset of field: ", - stringify!(TPMS_SENSITIVE_CREATE), - "::", - stringify!(data) - ) + "Offset of field: TPMS_SENSITIVE_CREATE::data" ); } impl Default for TPMS_SENSITIVE_CREATE { @@ -4178,32 +3464,22 @@ fn bindgen_test_layout_TPM2B_SENSITIVE_CREATE() { assert_eq!( ::std::mem::size_of::(), 326usize, - concat!("Size of: ", stringify!(TPM2B_SENSITIVE_CREATE)) + "Size of TPM2B_SENSITIVE_CREATE" ); assert_eq!( ::std::mem::align_of::(), 2usize, - concat!("Alignment of ", stringify!(TPM2B_SENSITIVE_CREATE)) + "Alignment of TPM2B_SENSITIVE_CREATE" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).size) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPM2B_SENSITIVE_CREATE), - "::", - stringify!(size) - ) + "Offset of field: TPM2B_SENSITIVE_CREATE::size" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).sensitive) as usize - ptr as usize }, 2usize, - concat!( - "Offset of field: ", - stringify!(TPM2B_SENSITIVE_CREATE), - "::", - stringify!(sensitive) - ) + "Offset of field: TPM2B_SENSITIVE_CREATE::sensitive" ); } impl Default for TPM2B_SENSITIVE_CREATE { @@ -4227,22 +3503,17 @@ fn bindgen_test_layout_TPMS_SCHEME_HASH() { assert_eq!( ::std::mem::size_of::(), 2usize, - concat!("Size of: ", stringify!(TPMS_SCHEME_HASH)) + "Size of TPMS_SCHEME_HASH" ); assert_eq!( ::std::mem::align_of::(), 2usize, - concat!("Alignment of ", stringify!(TPMS_SCHEME_HASH)) + "Alignment of TPMS_SCHEME_HASH" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).hashAlg) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMS_SCHEME_HASH), - "::", - stringify!(hashAlg) - ) + "Offset of field: TPMS_SCHEME_HASH::hashAlg" ); } #[repr(C)] @@ -4258,32 +3529,22 @@ fn bindgen_test_layout_TPMS_SCHEME_ECDAA() { assert_eq!( ::std::mem::size_of::(), 4usize, - concat!("Size of: ", stringify!(TPMS_SCHEME_ECDAA)) + "Size of TPMS_SCHEME_ECDAA" ); assert_eq!( ::std::mem::align_of::(), 2usize, - concat!("Alignment of ", stringify!(TPMS_SCHEME_ECDAA)) + "Alignment of TPMS_SCHEME_ECDAA" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).hashAlg) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMS_SCHEME_ECDAA), - "::", - stringify!(hashAlg) - ) + "Offset of field: TPMS_SCHEME_ECDAA::hashAlg" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).count) as usize - ptr as usize }, 2usize, - concat!( - "Offset of field: ", - stringify!(TPMS_SCHEME_ECDAA), - "::", - stringify!(count) - ) + "Offset of field: TPMS_SCHEME_ECDAA::count" ); } pub type TPMI_ALG_KEYEDHASH_SCHEME = TPM2_ALG_ID; @@ -4301,32 +3562,22 @@ fn bindgen_test_layout_TPMS_SCHEME_XOR() { assert_eq!( ::std::mem::size_of::(), 4usize, - concat!("Size of: ", stringify!(TPMS_SCHEME_XOR)) + "Size of TPMS_SCHEME_XOR" ); assert_eq!( ::std::mem::align_of::(), 2usize, - concat!("Alignment of ", stringify!(TPMS_SCHEME_XOR)) + "Alignment of TPMS_SCHEME_XOR" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).hashAlg) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMS_SCHEME_XOR), - "::", - stringify!(hashAlg) - ) + "Offset of field: TPMS_SCHEME_XOR::hashAlg" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).kdf) as usize - ptr as usize }, 2usize, - concat!( - "Offset of field: ", - stringify!(TPMS_SCHEME_XOR), - "::", - stringify!(kdf) - ) + "Offset of field: TPMS_SCHEME_XOR::kdf" ); } #[repr(C)] @@ -4334,6 +3585,7 @@ fn bindgen_test_layout_TPMS_SCHEME_XOR() { pub union TPMU_SCHEME_KEYEDHASH { pub hmac: TPMS_SCHEME_HMAC, pub exclusiveOr: TPMS_SCHEME_XOR, + pub null: TPMS_EMPTY, } #[test] fn bindgen_test_layout_TPMU_SCHEME_KEYEDHASH() { @@ -4343,32 +3595,27 @@ fn bindgen_test_layout_TPMU_SCHEME_KEYEDHASH() { assert_eq!( ::std::mem::size_of::(), 4usize, - concat!("Size of: ", stringify!(TPMU_SCHEME_KEYEDHASH)) + "Size of TPMU_SCHEME_KEYEDHASH" ); assert_eq!( ::std::mem::align_of::(), 2usize, - concat!("Alignment of ", stringify!(TPMU_SCHEME_KEYEDHASH)) + "Alignment of TPMU_SCHEME_KEYEDHASH" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).hmac) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_SCHEME_KEYEDHASH), - "::", - stringify!(hmac) - ) + "Offset of field: TPMU_SCHEME_KEYEDHASH::hmac" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).exclusiveOr) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_SCHEME_KEYEDHASH), - "::", - stringify!(exclusiveOr) - ) + "Offset of field: TPMU_SCHEME_KEYEDHASH::exclusiveOr" + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).null) as usize - ptr as usize }, + 0usize, + "Offset of field: TPMU_SCHEME_KEYEDHASH::null" ); } impl Default for TPMU_SCHEME_KEYEDHASH { @@ -4394,32 +3641,22 @@ fn bindgen_test_layout_TPMT_KEYEDHASH_SCHEME() { assert_eq!( ::std::mem::size_of::(), 6usize, - concat!("Size of: ", stringify!(TPMT_KEYEDHASH_SCHEME)) + "Size of TPMT_KEYEDHASH_SCHEME" ); assert_eq!( ::std::mem::align_of::(), 2usize, - concat!("Alignment of ", stringify!(TPMT_KEYEDHASH_SCHEME)) + "Alignment of TPMT_KEYEDHASH_SCHEME" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).scheme) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMT_KEYEDHASH_SCHEME), - "::", - stringify!(scheme) - ) + "Offset of field: TPMT_KEYEDHASH_SCHEME::scheme" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).details) as usize - ptr as usize }, 2usize, - concat!( - "Offset of field: ", - stringify!(TPMT_KEYEDHASH_SCHEME), - "::", - stringify!(details) - ) + "Offset of field: TPMT_KEYEDHASH_SCHEME::details" ); } impl Default for TPMT_KEYEDHASH_SCHEME { @@ -4448,6 +3685,7 @@ pub union TPMU_SIG_SCHEME { pub ecschnorr: TPMS_SIG_SCHEME_ECSCHNORR, pub hmac: TPMS_SCHEME_HMAC, pub any: TPMS_SCHEME_HASH, + pub null: TPMS_EMPTY, } #[test] fn bindgen_test_layout_TPMU_SIG_SCHEME() { @@ -4456,92 +3694,57 @@ fn bindgen_test_layout_TPMU_SIG_SCHEME() { assert_eq!( ::std::mem::size_of::(), 4usize, - concat!("Size of: ", stringify!(TPMU_SIG_SCHEME)) + "Size of TPMU_SIG_SCHEME" ); assert_eq!( ::std::mem::align_of::(), 2usize, - concat!("Alignment of ", stringify!(TPMU_SIG_SCHEME)) + "Alignment of TPMU_SIG_SCHEME" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).rsassa) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_SIG_SCHEME), - "::", - stringify!(rsassa) - ) + "Offset of field: TPMU_SIG_SCHEME::rsassa" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).rsapss) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_SIG_SCHEME), - "::", - stringify!(rsapss) - ) + "Offset of field: TPMU_SIG_SCHEME::rsapss" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).ecdsa) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_SIG_SCHEME), - "::", - stringify!(ecdsa) - ) + "Offset of field: TPMU_SIG_SCHEME::ecdsa" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).ecdaa) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_SIG_SCHEME), - "::", - stringify!(ecdaa) - ) + "Offset of field: TPMU_SIG_SCHEME::ecdaa" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).sm2) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_SIG_SCHEME), - "::", - stringify!(sm2) - ) + "Offset of field: TPMU_SIG_SCHEME::sm2" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).ecschnorr) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_SIG_SCHEME), - "::", - stringify!(ecschnorr) - ) + "Offset of field: TPMU_SIG_SCHEME::ecschnorr" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).hmac) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_SIG_SCHEME), - "::", - stringify!(hmac) - ) + "Offset of field: TPMU_SIG_SCHEME::hmac" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).any) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_SIG_SCHEME), - "::", - stringify!(any) - ) + "Offset of field: TPMU_SIG_SCHEME::any" + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).null) as usize - ptr as usize }, + 0usize, + "Offset of field: TPMU_SIG_SCHEME::null" ); } impl Default for TPMU_SIG_SCHEME { @@ -4566,32 +3769,22 @@ fn bindgen_test_layout_TPMT_SIG_SCHEME() { assert_eq!( ::std::mem::size_of::(), 6usize, - concat!("Size of: ", stringify!(TPMT_SIG_SCHEME)) + "Size of TPMT_SIG_SCHEME" ); assert_eq!( ::std::mem::align_of::(), 2usize, - concat!("Alignment of ", stringify!(TPMT_SIG_SCHEME)) + "Alignment of TPMT_SIG_SCHEME" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).scheme) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMT_SIG_SCHEME), - "::", - stringify!(scheme) - ) + "Offset of field: TPMT_SIG_SCHEME::scheme" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).details) as usize - ptr as usize }, 2usize, - concat!( - "Offset of field: ", - stringify!(TPMT_SIG_SCHEME), - "::", - stringify!(details) - ) + "Offset of field: TPMT_SIG_SCHEME::details" ); } impl Default for TPMT_SIG_SCHEME { @@ -4618,6 +3811,7 @@ pub union TPMU_KDF_SCHEME { pub kdf1_sp800_56a: TPMS_SCHEME_KDF1_SP800_56A, pub kdf2: TPMS_SCHEME_KDF2, pub kdf1_sp800_108: TPMS_SCHEME_KDF1_SP800_108, + pub null: TPMS_EMPTY, } #[test] fn bindgen_test_layout_TPMU_KDF_SCHEME() { @@ -4626,52 +3820,37 @@ fn bindgen_test_layout_TPMU_KDF_SCHEME() { assert_eq!( ::std::mem::size_of::(), 2usize, - concat!("Size of: ", stringify!(TPMU_KDF_SCHEME)) + "Size of TPMU_KDF_SCHEME" ); assert_eq!( ::std::mem::align_of::(), 2usize, - concat!("Alignment of ", stringify!(TPMU_KDF_SCHEME)) + "Alignment of TPMU_KDF_SCHEME" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).mgf1) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_KDF_SCHEME), - "::", - stringify!(mgf1) - ) + "Offset of field: TPMU_KDF_SCHEME::mgf1" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).kdf1_sp800_56a) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_KDF_SCHEME), - "::", - stringify!(kdf1_sp800_56a) - ) + "Offset of field: TPMU_KDF_SCHEME::kdf1_sp800_56a" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).kdf2) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_KDF_SCHEME), - "::", - stringify!(kdf2) - ) + "Offset of field: TPMU_KDF_SCHEME::kdf2" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).kdf1_sp800_108) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_KDF_SCHEME), - "::", - stringify!(kdf1_sp800_108) - ) + "Offset of field: TPMU_KDF_SCHEME::kdf1_sp800_108" + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).null) as usize - ptr as usize }, + 0usize, + "Offset of field: TPMU_KDF_SCHEME::null" ); } impl Default for TPMU_KDF_SCHEME { @@ -4696,32 +3875,22 @@ fn bindgen_test_layout_TPMT_KDF_SCHEME() { assert_eq!( ::std::mem::size_of::(), 4usize, - concat!("Size of: ", stringify!(TPMT_KDF_SCHEME)) + "Size of TPMT_KDF_SCHEME" ); assert_eq!( ::std::mem::align_of::(), 2usize, - concat!("Alignment of ", stringify!(TPMT_KDF_SCHEME)) + "Alignment of TPMT_KDF_SCHEME" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).scheme) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMT_KDF_SCHEME), - "::", - stringify!(scheme) - ) + "Offset of field: TPMT_KDF_SCHEME::scheme" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).details) as usize - ptr as usize }, 2usize, - concat!( - "Offset of field: ", - stringify!(TPMT_KDF_SCHEME), - "::", - stringify!(details) - ) + "Offset of field: TPMT_KDF_SCHEME::details" ); } impl Default for TPMT_KDF_SCHEME { @@ -4748,6 +3917,7 @@ pub union TPMU_ASYM_SCHEME { pub rsaes: TPMS_ENC_SCHEME_RSAES, pub oaep: TPMS_ENC_SCHEME_OAEP, pub anySig: TPMS_SCHEME_HASH, + pub null: TPMS_EMPTY, } #[test] fn bindgen_test_layout_TPMU_ASYM_SCHEME() { @@ -4756,122 +3926,72 @@ fn bindgen_test_layout_TPMU_ASYM_SCHEME() { assert_eq!( ::std::mem::size_of::(), 4usize, - concat!("Size of: ", stringify!(TPMU_ASYM_SCHEME)) + "Size of TPMU_ASYM_SCHEME" ); assert_eq!( ::std::mem::align_of::(), 2usize, - concat!("Alignment of ", stringify!(TPMU_ASYM_SCHEME)) + "Alignment of TPMU_ASYM_SCHEME" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).ecdh) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_ASYM_SCHEME), - "::", - stringify!(ecdh) - ) + "Offset of field: TPMU_ASYM_SCHEME::ecdh" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).ecmqv) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_ASYM_SCHEME), - "::", - stringify!(ecmqv) - ) + "Offset of field: TPMU_ASYM_SCHEME::ecmqv" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).rsassa) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_ASYM_SCHEME), - "::", - stringify!(rsassa) - ) + "Offset of field: TPMU_ASYM_SCHEME::rsassa" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).rsapss) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_ASYM_SCHEME), - "::", - stringify!(rsapss) - ) + "Offset of field: TPMU_ASYM_SCHEME::rsapss" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).ecdsa) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_ASYM_SCHEME), - "::", - stringify!(ecdsa) - ) + "Offset of field: TPMU_ASYM_SCHEME::ecdsa" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).ecdaa) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_ASYM_SCHEME), - "::", - stringify!(ecdaa) - ) + "Offset of field: TPMU_ASYM_SCHEME::ecdaa" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).sm2) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_ASYM_SCHEME), - "::", - stringify!(sm2) - ) + "Offset of field: TPMU_ASYM_SCHEME::sm2" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).ecschnorr) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_ASYM_SCHEME), - "::", - stringify!(ecschnorr) - ) + "Offset of field: TPMU_ASYM_SCHEME::ecschnorr" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).rsaes) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_ASYM_SCHEME), - "::", - stringify!(rsaes) - ) + "Offset of field: TPMU_ASYM_SCHEME::rsaes" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).oaep) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_ASYM_SCHEME), - "::", - stringify!(oaep) - ) + "Offset of field: TPMU_ASYM_SCHEME::oaep" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).anySig) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_ASYM_SCHEME), - "::", - stringify!(anySig) - ) + "Offset of field: TPMU_ASYM_SCHEME::anySig" + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).null) as usize - ptr as usize }, + 0usize, + "Offset of field: TPMU_ASYM_SCHEME::null" ); } impl Default for TPMU_ASYM_SCHEME { @@ -4896,32 +4016,22 @@ fn bindgen_test_layout_TPMT_ASYM_SCHEME() { assert_eq!( ::std::mem::size_of::(), 6usize, - concat!("Size of: ", stringify!(TPMT_ASYM_SCHEME)) + "Size of TPMT_ASYM_SCHEME" ); assert_eq!( ::std::mem::align_of::(), 2usize, - concat!("Alignment of ", stringify!(TPMT_ASYM_SCHEME)) + "Alignment of TPMT_ASYM_SCHEME" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).scheme) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMT_ASYM_SCHEME), - "::", - stringify!(scheme) - ) + "Offset of field: TPMT_ASYM_SCHEME::scheme" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).details) as usize - ptr as usize }, 2usize, - concat!( - "Offset of field: ", - stringify!(TPMT_ASYM_SCHEME), - "::", - stringify!(details) - ) + "Offset of field: TPMT_ASYM_SCHEME::details" ); } impl Default for TPMT_ASYM_SCHEME { @@ -4947,32 +4057,22 @@ fn bindgen_test_layout_TPMT_RSA_SCHEME() { assert_eq!( ::std::mem::size_of::(), 6usize, - concat!("Size of: ", stringify!(TPMT_RSA_SCHEME)) + "Size of TPMT_RSA_SCHEME" ); assert_eq!( ::std::mem::align_of::(), 2usize, - concat!("Alignment of ", stringify!(TPMT_RSA_SCHEME)) + "Alignment of TPMT_RSA_SCHEME" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).scheme) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMT_RSA_SCHEME), - "::", - stringify!(scheme) - ) + "Offset of field: TPMT_RSA_SCHEME::scheme" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).details) as usize - ptr as usize }, 2usize, - concat!( - "Offset of field: ", - stringify!(TPMT_RSA_SCHEME), - "::", - stringify!(details) - ) + "Offset of field: TPMT_RSA_SCHEME::details" ); } impl Default for TPMT_RSA_SCHEME { @@ -4998,32 +4098,22 @@ fn bindgen_test_layout_TPMT_RSA_DECRYPT() { assert_eq!( ::std::mem::size_of::(), 6usize, - concat!("Size of: ", stringify!(TPMT_RSA_DECRYPT)) + "Size of TPMT_RSA_DECRYPT" ); assert_eq!( ::std::mem::align_of::(), 2usize, - concat!("Alignment of ", stringify!(TPMT_RSA_DECRYPT)) + "Alignment of TPMT_RSA_DECRYPT" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).scheme) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMT_RSA_DECRYPT), - "::", - stringify!(scheme) - ) + "Offset of field: TPMT_RSA_DECRYPT::scheme" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).details) as usize - ptr as usize }, 2usize, - concat!( - "Offset of field: ", - stringify!(TPMT_RSA_DECRYPT), - "::", - stringify!(details) - ) + "Offset of field: TPMT_RSA_DECRYPT::details" ); } impl Default for TPMT_RSA_DECRYPT { @@ -5048,32 +4138,22 @@ fn bindgen_test_layout_TPM2B_PUBLIC_KEY_RSA() { assert_eq!( ::std::mem::size_of::(), 514usize, - concat!("Size of: ", stringify!(TPM2B_PUBLIC_KEY_RSA)) + "Size of TPM2B_PUBLIC_KEY_RSA" ); assert_eq!( ::std::mem::align_of::(), 2usize, - concat!("Alignment of ", stringify!(TPM2B_PUBLIC_KEY_RSA)) + "Alignment of TPM2B_PUBLIC_KEY_RSA" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).size) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPM2B_PUBLIC_KEY_RSA), - "::", - stringify!(size) - ) + "Offset of field: TPM2B_PUBLIC_KEY_RSA::size" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).buffer) as usize - ptr as usize }, 2usize, - concat!( - "Offset of field: ", - stringify!(TPM2B_PUBLIC_KEY_RSA), - "::", - stringify!(buffer) - ) + "Offset of field: TPM2B_PUBLIC_KEY_RSA::buffer" ); } impl Default for TPM2B_PUBLIC_KEY_RSA { @@ -5090,7 +4170,7 @@ pub type TPMI_RSA_KEY_BITS = TPM2_KEY_BITS; #[derive(Debug, Copy, Clone)] pub struct TPM2B_PRIVATE_KEY_RSA { pub size: UINT16, - pub buffer: [BYTE; 256usize], + pub buffer: [BYTE; 1280usize], } #[test] fn bindgen_test_layout_TPM2B_PRIVATE_KEY_RSA() { @@ -5099,33 +4179,23 @@ fn bindgen_test_layout_TPM2B_PRIVATE_KEY_RSA() { let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), - 258usize, - concat!("Size of: ", stringify!(TPM2B_PRIVATE_KEY_RSA)) + 1282usize, + "Size of TPM2B_PRIVATE_KEY_RSA" ); assert_eq!( ::std::mem::align_of::(), 2usize, - concat!("Alignment of ", stringify!(TPM2B_PRIVATE_KEY_RSA)) + "Alignment of TPM2B_PRIVATE_KEY_RSA" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).size) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPM2B_PRIVATE_KEY_RSA), - "::", - stringify!(size) - ) + "Offset of field: TPM2B_PRIVATE_KEY_RSA::size" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).buffer) as usize - ptr as usize }, 2usize, - concat!( - "Offset of field: ", - stringify!(TPM2B_PRIVATE_KEY_RSA), - "::", - stringify!(buffer) - ) + "Offset of field: TPM2B_PRIVATE_KEY_RSA::buffer" ); } impl Default for TPM2B_PRIVATE_KEY_RSA { @@ -5150,32 +4220,22 @@ fn bindgen_test_layout_TPM2B_ECC_PARAMETER() { assert_eq!( ::std::mem::size_of::(), 130usize, - concat!("Size of: ", stringify!(TPM2B_ECC_PARAMETER)) + "Size of TPM2B_ECC_PARAMETER" ); assert_eq!( ::std::mem::align_of::(), 2usize, - concat!("Alignment of ", stringify!(TPM2B_ECC_PARAMETER)) + "Alignment of TPM2B_ECC_PARAMETER" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).size) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPM2B_ECC_PARAMETER), - "::", - stringify!(size) - ) + "Offset of field: TPM2B_ECC_PARAMETER::size" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).buffer) as usize - ptr as usize }, 2usize, - concat!( - "Offset of field: ", - stringify!(TPM2B_ECC_PARAMETER), - "::", - stringify!(buffer) - ) + "Offset of field: TPM2B_ECC_PARAMETER::buffer" ); } impl Default for TPM2B_ECC_PARAMETER { @@ -5200,32 +4260,22 @@ fn bindgen_test_layout_TPMS_ECC_POINT() { assert_eq!( ::std::mem::size_of::(), 260usize, - concat!("Size of: ", stringify!(TPMS_ECC_POINT)) + "Size of TPMS_ECC_POINT" ); assert_eq!( ::std::mem::align_of::(), 2usize, - concat!("Alignment of ", stringify!(TPMS_ECC_POINT)) + "Alignment of TPMS_ECC_POINT" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).x) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMS_ECC_POINT), - "::", - stringify!(x) - ) + "Offset of field: TPMS_ECC_POINT::x" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).y) as usize - ptr as usize }, 130usize, - concat!( - "Offset of field: ", - stringify!(TPMS_ECC_POINT), - "::", - stringify!(y) - ) + "Offset of field: TPMS_ECC_POINT::y" ); } impl Default for TPMS_ECC_POINT { @@ -5250,32 +4300,22 @@ fn bindgen_test_layout_TPM2B_ECC_POINT() { assert_eq!( ::std::mem::size_of::(), 262usize, - concat!("Size of: ", stringify!(TPM2B_ECC_POINT)) + "Size of TPM2B_ECC_POINT" ); assert_eq!( ::std::mem::align_of::(), 2usize, - concat!("Alignment of ", stringify!(TPM2B_ECC_POINT)) + "Alignment of TPM2B_ECC_POINT" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).size) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPM2B_ECC_POINT), - "::", - stringify!(size) - ) + "Offset of field: TPM2B_ECC_POINT::size" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).point) as usize - ptr as usize }, 2usize, - concat!( - "Offset of field: ", - stringify!(TPM2B_ECC_POINT), - "::", - stringify!(point) - ) + "Offset of field: TPM2B_ECC_POINT::point" ); } impl Default for TPM2B_ECC_POINT { @@ -5302,32 +4342,22 @@ fn bindgen_test_layout_TPMT_ECC_SCHEME() { assert_eq!( ::std::mem::size_of::(), 6usize, - concat!("Size of: ", stringify!(TPMT_ECC_SCHEME)) + "Size of TPMT_ECC_SCHEME" ); assert_eq!( ::std::mem::align_of::(), 2usize, - concat!("Alignment of ", stringify!(TPMT_ECC_SCHEME)) + "Alignment of TPMT_ECC_SCHEME" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).scheme) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMT_ECC_SCHEME), - "::", - stringify!(scheme) - ) + "Offset of field: TPMT_ECC_SCHEME::scheme" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).details) as usize - ptr as usize }, 2usize, - concat!( - "Offset of field: ", - stringify!(TPMT_ECC_SCHEME), - "::", - stringify!(details) - ) + "Offset of field: TPMT_ECC_SCHEME::details" ); } impl Default for TPMT_ECC_SCHEME { @@ -5362,122 +4392,67 @@ fn bindgen_test_layout_TPMS_ALGORITHM_DETAIL_ECC() { assert_eq!( ::std::mem::size_of::(), 924usize, - concat!("Size of: ", stringify!(TPMS_ALGORITHM_DETAIL_ECC)) + "Size of TPMS_ALGORITHM_DETAIL_ECC" ); assert_eq!( ::std::mem::align_of::(), 2usize, - concat!("Alignment of ", stringify!(TPMS_ALGORITHM_DETAIL_ECC)) + "Alignment of TPMS_ALGORITHM_DETAIL_ECC" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).curveID) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMS_ALGORITHM_DETAIL_ECC), - "::", - stringify!(curveID) - ) + "Offset of field: TPMS_ALGORITHM_DETAIL_ECC::curveID" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).keySize) as usize - ptr as usize }, 2usize, - concat!( - "Offset of field: ", - stringify!(TPMS_ALGORITHM_DETAIL_ECC), - "::", - stringify!(keySize) - ) + "Offset of field: TPMS_ALGORITHM_DETAIL_ECC::keySize" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).kdf) as usize - ptr as usize }, 4usize, - concat!( - "Offset of field: ", - stringify!(TPMS_ALGORITHM_DETAIL_ECC), - "::", - stringify!(kdf) - ) + "Offset of field: TPMS_ALGORITHM_DETAIL_ECC::kdf" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).sign) as usize - ptr as usize }, 8usize, - concat!( - "Offset of field: ", - stringify!(TPMS_ALGORITHM_DETAIL_ECC), - "::", - stringify!(sign) - ) + "Offset of field: TPMS_ALGORITHM_DETAIL_ECC::sign" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).p) as usize - ptr as usize }, 14usize, - concat!( - "Offset of field: ", - stringify!(TPMS_ALGORITHM_DETAIL_ECC), - "::", - stringify!(p) - ) + "Offset of field: TPMS_ALGORITHM_DETAIL_ECC::p" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).a) as usize - ptr as usize }, 144usize, - concat!( - "Offset of field: ", - stringify!(TPMS_ALGORITHM_DETAIL_ECC), - "::", - stringify!(a) - ) + "Offset of field: TPMS_ALGORITHM_DETAIL_ECC::a" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).b) as usize - ptr as usize }, 274usize, - concat!( - "Offset of field: ", - stringify!(TPMS_ALGORITHM_DETAIL_ECC), - "::", - stringify!(b) - ) + "Offset of field: TPMS_ALGORITHM_DETAIL_ECC::b" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).gX) as usize - ptr as usize }, 404usize, - concat!( - "Offset of field: ", - stringify!(TPMS_ALGORITHM_DETAIL_ECC), - "::", - stringify!(gX) - ) + "Offset of field: TPMS_ALGORITHM_DETAIL_ECC::gX" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).gY) as usize - ptr as usize }, 534usize, - concat!( - "Offset of field: ", - stringify!(TPMS_ALGORITHM_DETAIL_ECC), - "::", - stringify!(gY) - ) + "Offset of field: TPMS_ALGORITHM_DETAIL_ECC::gY" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).n) as usize - ptr as usize }, 664usize, - concat!( - "Offset of field: ", - stringify!(TPMS_ALGORITHM_DETAIL_ECC), - "::", - stringify!(n) - ) + "Offset of field: TPMS_ALGORITHM_DETAIL_ECC::n" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).h) as usize - ptr as usize }, 794usize, - concat!( - "Offset of field: ", - stringify!(TPMS_ALGORITHM_DETAIL_ECC), - "::", - stringify!(h) - ) + "Offset of field: TPMS_ALGORITHM_DETAIL_ECC::h" ); } impl Default for TPMS_ALGORITHM_DETAIL_ECC { @@ -5502,32 +4477,22 @@ fn bindgen_test_layout_TPMS_SIGNATURE_RSA() { assert_eq!( ::std::mem::size_of::(), 516usize, - concat!("Size of: ", stringify!(TPMS_SIGNATURE_RSA)) + "Size of TPMS_SIGNATURE_RSA" ); assert_eq!( ::std::mem::align_of::(), 2usize, - concat!("Alignment of ", stringify!(TPMS_SIGNATURE_RSA)) + "Alignment of TPMS_SIGNATURE_RSA" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).hash) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMS_SIGNATURE_RSA), - "::", - stringify!(hash) - ) + "Offset of field: TPMS_SIGNATURE_RSA::hash" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).sig) as usize - ptr as usize }, 2usize, - concat!( - "Offset of field: ", - stringify!(TPMS_SIGNATURE_RSA), - "::", - stringify!(sig) - ) + "Offset of field: TPMS_SIGNATURE_RSA::sig" ); } impl Default for TPMS_SIGNATURE_RSA { @@ -5555,42 +4520,27 @@ fn bindgen_test_layout_TPMS_SIGNATURE_ECC() { assert_eq!( ::std::mem::size_of::(), 262usize, - concat!("Size of: ", stringify!(TPMS_SIGNATURE_ECC)) + "Size of TPMS_SIGNATURE_ECC" ); assert_eq!( ::std::mem::align_of::(), 2usize, - concat!("Alignment of ", stringify!(TPMS_SIGNATURE_ECC)) + "Alignment of TPMS_SIGNATURE_ECC" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).hash) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMS_SIGNATURE_ECC), - "::", - stringify!(hash) - ) + "Offset of field: TPMS_SIGNATURE_ECC::hash" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).signatureR) as usize - ptr as usize }, 2usize, - concat!( - "Offset of field: ", - stringify!(TPMS_SIGNATURE_ECC), - "::", - stringify!(signatureR) - ) + "Offset of field: TPMS_SIGNATURE_ECC::signatureR" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).signatureS) as usize - ptr as usize }, 132usize, - concat!( - "Offset of field: ", - stringify!(TPMS_SIGNATURE_ECC), - "::", - stringify!(signatureS) - ) + "Offset of field: TPMS_SIGNATURE_ECC::signatureS" ); } impl Default for TPMS_SIGNATURE_ECC { @@ -5617,6 +4567,7 @@ pub union TPMU_SIGNATURE { pub ecschnorr: TPMS_SIGNATURE_ECSCHNORR, pub hmac: TPMT_HA, pub any: TPMS_SCHEME_HASH, + pub null: TPMS_EMPTY, } #[test] fn bindgen_test_layout_TPMU_SIGNATURE() { @@ -5625,92 +4576,57 @@ fn bindgen_test_layout_TPMU_SIGNATURE() { assert_eq!( ::std::mem::size_of::(), 516usize, - concat!("Size of: ", stringify!(TPMU_SIGNATURE)) + "Size of TPMU_SIGNATURE" ); assert_eq!( ::std::mem::align_of::(), 2usize, - concat!("Alignment of ", stringify!(TPMU_SIGNATURE)) + "Alignment of TPMU_SIGNATURE" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).rsassa) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_SIGNATURE), - "::", - stringify!(rsassa) - ) + "Offset of field: TPMU_SIGNATURE::rsassa" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).rsapss) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_SIGNATURE), - "::", - stringify!(rsapss) - ) + "Offset of field: TPMU_SIGNATURE::rsapss" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).ecdsa) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_SIGNATURE), - "::", - stringify!(ecdsa) - ) + "Offset of field: TPMU_SIGNATURE::ecdsa" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).ecdaa) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_SIGNATURE), - "::", - stringify!(ecdaa) - ) + "Offset of field: TPMU_SIGNATURE::ecdaa" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).sm2) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_SIGNATURE), - "::", - stringify!(sm2) - ) + "Offset of field: TPMU_SIGNATURE::sm2" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).ecschnorr) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_SIGNATURE), - "::", - stringify!(ecschnorr) - ) + "Offset of field: TPMU_SIGNATURE::ecschnorr" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).hmac) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_SIGNATURE), - "::", - stringify!(hmac) - ) + "Offset of field: TPMU_SIGNATURE::hmac" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).any) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_SIGNATURE), - "::", - stringify!(any) - ) + "Offset of field: TPMU_SIGNATURE::any" + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).null) as usize - ptr as usize }, + 0usize, + "Offset of field: TPMU_SIGNATURE::null" ); } impl Default for TPMU_SIGNATURE { @@ -5735,32 +4651,22 @@ fn bindgen_test_layout_TPMT_SIGNATURE() { assert_eq!( ::std::mem::size_of::(), 518usize, - concat!("Size of: ", stringify!(TPMT_SIGNATURE)) + "Size of TPMT_SIGNATURE" ); assert_eq!( ::std::mem::align_of::(), 2usize, - concat!("Alignment of ", stringify!(TPMT_SIGNATURE)) + "Alignment of TPMT_SIGNATURE" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).sigAlg) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMT_SIGNATURE), - "::", - stringify!(sigAlg) - ) + "Offset of field: TPMT_SIGNATURE::sigAlg" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).signature) as usize - ptr as usize }, 2usize, - concat!( - "Offset of field: ", - stringify!(TPMT_SIGNATURE), - "::", - stringify!(signature) - ) + "Offset of field: TPMT_SIGNATURE::signature" ); } impl Default for TPMT_SIGNATURE { @@ -5788,52 +4694,32 @@ fn bindgen_test_layout_TPMU_ENCRYPTED_SECRET() { assert_eq!( ::std::mem::size_of::(), 512usize, - concat!("Size of: ", stringify!(TPMU_ENCRYPTED_SECRET)) + "Size of TPMU_ENCRYPTED_SECRET" ); assert_eq!( ::std::mem::align_of::(), 1usize, - concat!("Alignment of ", stringify!(TPMU_ENCRYPTED_SECRET)) + "Alignment of TPMU_ENCRYPTED_SECRET" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).ecc) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_ENCRYPTED_SECRET), - "::", - stringify!(ecc) - ) + "Offset of field: TPMU_ENCRYPTED_SECRET::ecc" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).rsa) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_ENCRYPTED_SECRET), - "::", - stringify!(rsa) - ) + "Offset of field: TPMU_ENCRYPTED_SECRET::rsa" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).symmetric) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_ENCRYPTED_SECRET), - "::", - stringify!(symmetric) - ) + "Offset of field: TPMU_ENCRYPTED_SECRET::symmetric" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).keyedHash) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_ENCRYPTED_SECRET), - "::", - stringify!(keyedHash) - ) + "Offset of field: TPMU_ENCRYPTED_SECRET::keyedHash" ); } impl Default for TPMU_ENCRYPTED_SECRET { @@ -5859,32 +4745,22 @@ fn bindgen_test_layout_TPM2B_ENCRYPTED_SECRET() { assert_eq!( ::std::mem::size_of::(), 514usize, - concat!("Size of: ", stringify!(TPM2B_ENCRYPTED_SECRET)) + "Size of TPM2B_ENCRYPTED_SECRET" ); assert_eq!( ::std::mem::align_of::(), 2usize, - concat!("Alignment of ", stringify!(TPM2B_ENCRYPTED_SECRET)) + "Alignment of TPM2B_ENCRYPTED_SECRET" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).size) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPM2B_ENCRYPTED_SECRET), - "::", - stringify!(size) - ) + "Offset of field: TPM2B_ENCRYPTED_SECRET::size" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).secret) as usize - ptr as usize }, 2usize, - concat!( - "Offset of field: ", - stringify!(TPM2B_ENCRYPTED_SECRET), - "::", - stringify!(secret) - ) + "Offset of field: TPM2B_ENCRYPTED_SECRET::secret" ); } impl Default for TPM2B_ENCRYPTED_SECRET { @@ -5904,6 +4780,7 @@ pub union TPMU_PUBLIC_ID { pub sym: TPM2B_DIGEST, pub rsa: TPM2B_PUBLIC_KEY_RSA, pub ecc: TPMS_ECC_POINT, + pub derive: TPMS_DERIVE, } #[test] fn bindgen_test_layout_TPMU_PUBLIC_ID() { @@ -5912,52 +4789,37 @@ fn bindgen_test_layout_TPMU_PUBLIC_ID() { assert_eq!( ::std::mem::size_of::(), 514usize, - concat!("Size of: ", stringify!(TPMU_PUBLIC_ID)) + "Size of TPMU_PUBLIC_ID" ); assert_eq!( ::std::mem::align_of::(), 2usize, - concat!("Alignment of ", stringify!(TPMU_PUBLIC_ID)) + "Alignment of TPMU_PUBLIC_ID" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).keyedHash) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_PUBLIC_ID), - "::", - stringify!(keyedHash) - ) + "Offset of field: TPMU_PUBLIC_ID::keyedHash" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).sym) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_PUBLIC_ID), - "::", - stringify!(sym) - ) + "Offset of field: TPMU_PUBLIC_ID::sym" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).rsa) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_PUBLIC_ID), - "::", - stringify!(rsa) - ) + "Offset of field: TPMU_PUBLIC_ID::rsa" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).ecc) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_PUBLIC_ID), - "::", - stringify!(ecc) - ) + "Offset of field: TPMU_PUBLIC_ID::ecc" + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).derive) as usize - ptr as usize }, + 0usize, + "Offset of field: TPMU_PUBLIC_ID::derive" ); } impl Default for TPMU_PUBLIC_ID { @@ -5981,22 +4843,17 @@ fn bindgen_test_layout_TPMS_KEYEDHASH_PARMS() { assert_eq!( ::std::mem::size_of::(), 6usize, - concat!("Size of: ", stringify!(TPMS_KEYEDHASH_PARMS)) + "Size of TPMS_KEYEDHASH_PARMS" ); assert_eq!( ::std::mem::align_of::(), 2usize, - concat!("Alignment of ", stringify!(TPMS_KEYEDHASH_PARMS)) + "Alignment of TPMS_KEYEDHASH_PARMS" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).scheme) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMS_KEYEDHASH_PARMS), - "::", - stringify!(scheme) - ) + "Offset of field: TPMS_KEYEDHASH_PARMS::scheme" ); } impl Default for TPMS_KEYEDHASH_PARMS { @@ -6021,32 +4878,22 @@ fn bindgen_test_layout_TPMS_ASYM_PARMS() { assert_eq!( ::std::mem::size_of::(), 12usize, - concat!("Size of: ", stringify!(TPMS_ASYM_PARMS)) + "Size of TPMS_ASYM_PARMS" ); assert_eq!( ::std::mem::align_of::(), 2usize, - concat!("Alignment of ", stringify!(TPMS_ASYM_PARMS)) + "Alignment of TPMS_ASYM_PARMS" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).symmetric) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMS_ASYM_PARMS), - "::", - stringify!(symmetric) - ) + "Offset of field: TPMS_ASYM_PARMS::symmetric" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).scheme) as usize - ptr as usize }, 6usize, - concat!( - "Offset of field: ", - stringify!(TPMS_ASYM_PARMS), - "::", - stringify!(scheme) - ) + "Offset of field: TPMS_ASYM_PARMS::scheme" ); } impl Default for TPMS_ASYM_PARMS { @@ -6073,52 +4920,32 @@ fn bindgen_test_layout_TPMS_RSA_PARMS() { assert_eq!( ::std::mem::size_of::(), 20usize, - concat!("Size of: ", stringify!(TPMS_RSA_PARMS)) + "Size of TPMS_RSA_PARMS" ); assert_eq!( ::std::mem::align_of::(), 4usize, - concat!("Alignment of ", stringify!(TPMS_RSA_PARMS)) + "Alignment of TPMS_RSA_PARMS" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).symmetric) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMS_RSA_PARMS), - "::", - stringify!(symmetric) - ) + "Offset of field: TPMS_RSA_PARMS::symmetric" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).scheme) as usize - ptr as usize }, 6usize, - concat!( - "Offset of field: ", - stringify!(TPMS_RSA_PARMS), - "::", - stringify!(scheme) - ) + "Offset of field: TPMS_RSA_PARMS::scheme" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).keyBits) as usize - ptr as usize }, 12usize, - concat!( - "Offset of field: ", - stringify!(TPMS_RSA_PARMS), - "::", - stringify!(keyBits) - ) + "Offset of field: TPMS_RSA_PARMS::keyBits" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).exponent) as usize - ptr as usize }, 16usize, - concat!( - "Offset of field: ", - stringify!(TPMS_RSA_PARMS), - "::", - stringify!(exponent) - ) + "Offset of field: TPMS_RSA_PARMS::exponent" ); } impl Default for TPMS_RSA_PARMS { @@ -6145,52 +4972,32 @@ fn bindgen_test_layout_TPMS_ECC_PARMS() { assert_eq!( ::std::mem::size_of::(), 18usize, - concat!("Size of: ", stringify!(TPMS_ECC_PARMS)) + "Size of TPMS_ECC_PARMS" ); assert_eq!( ::std::mem::align_of::(), 2usize, - concat!("Alignment of ", stringify!(TPMS_ECC_PARMS)) + "Alignment of TPMS_ECC_PARMS" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).symmetric) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMS_ECC_PARMS), - "::", - stringify!(symmetric) - ) + "Offset of field: TPMS_ECC_PARMS::symmetric" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).scheme) as usize - ptr as usize }, 6usize, - concat!( - "Offset of field: ", - stringify!(TPMS_ECC_PARMS), - "::", - stringify!(scheme) - ) + "Offset of field: TPMS_ECC_PARMS::scheme" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).curveID) as usize - ptr as usize }, 12usize, - concat!( - "Offset of field: ", - stringify!(TPMS_ECC_PARMS), - "::", - stringify!(curveID) - ) + "Offset of field: TPMS_ECC_PARMS::curveID" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).kdf) as usize - ptr as usize }, 14usize, - concat!( - "Offset of field: ", - stringify!(TPMS_ECC_PARMS), - "::", - stringify!(kdf) - ) + "Offset of field: TPMS_ECC_PARMS::kdf" ); } impl Default for TPMS_ECC_PARMS { @@ -6218,62 +5025,37 @@ fn bindgen_test_layout_TPMU_PUBLIC_PARMS() { assert_eq!( ::std::mem::size_of::(), 20usize, - concat!("Size of: ", stringify!(TPMU_PUBLIC_PARMS)) + "Size of TPMU_PUBLIC_PARMS" ); assert_eq!( ::std::mem::align_of::(), 4usize, - concat!("Alignment of ", stringify!(TPMU_PUBLIC_PARMS)) + "Alignment of TPMU_PUBLIC_PARMS" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).keyedHashDetail) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_PUBLIC_PARMS), - "::", - stringify!(keyedHashDetail) - ) + "Offset of field: TPMU_PUBLIC_PARMS::keyedHashDetail" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).symDetail) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_PUBLIC_PARMS), - "::", - stringify!(symDetail) - ) + "Offset of field: TPMU_PUBLIC_PARMS::symDetail" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).rsaDetail) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_PUBLIC_PARMS), - "::", - stringify!(rsaDetail) - ) + "Offset of field: TPMU_PUBLIC_PARMS::rsaDetail" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).eccDetail) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_PUBLIC_PARMS), - "::", - stringify!(eccDetail) - ) + "Offset of field: TPMU_PUBLIC_PARMS::eccDetail" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).asymDetail) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_PUBLIC_PARMS), - "::", - stringify!(asymDetail) - ) + "Offset of field: TPMU_PUBLIC_PARMS::asymDetail" ); } impl Default for TPMU_PUBLIC_PARMS { @@ -6298,32 +5080,22 @@ fn bindgen_test_layout_TPMT_PUBLIC_PARMS() { assert_eq!( ::std::mem::size_of::(), 24usize, - concat!("Size of: ", stringify!(TPMT_PUBLIC_PARMS)) + "Size of TPMT_PUBLIC_PARMS" ); assert_eq!( ::std::mem::align_of::(), 4usize, - concat!("Alignment of ", stringify!(TPMT_PUBLIC_PARMS)) + "Alignment of TPMT_PUBLIC_PARMS" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).type_) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMT_PUBLIC_PARMS), - "::", - stringify!(type_) - ) + "Offset of field: TPMT_PUBLIC_PARMS::type_" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).parameters) as usize - ptr as usize }, 4usize, - concat!( - "Offset of field: ", - stringify!(TPMT_PUBLIC_PARMS), - "::", - stringify!(parameters) - ) + "Offset of field: TPMT_PUBLIC_PARMS::parameters" ); } impl Default for TPMT_PUBLIC_PARMS { @@ -6352,72 +5124,42 @@ fn bindgen_test_layout_TPMT_PUBLIC() { assert_eq!( ::std::mem::size_of::(), 612usize, - concat!("Size of: ", stringify!(TPMT_PUBLIC)) + "Size of TPMT_PUBLIC" ); assert_eq!( ::std::mem::align_of::(), 4usize, - concat!("Alignment of ", stringify!(TPMT_PUBLIC)) + "Alignment of TPMT_PUBLIC" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).type_) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMT_PUBLIC), - "::", - stringify!(type_) - ) + "Offset of field: TPMT_PUBLIC::type_" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).nameAlg) as usize - ptr as usize }, 2usize, - concat!( - "Offset of field: ", - stringify!(TPMT_PUBLIC), - "::", - stringify!(nameAlg) - ) + "Offset of field: TPMT_PUBLIC::nameAlg" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).objectAttributes) as usize - ptr as usize }, 4usize, - concat!( - "Offset of field: ", - stringify!(TPMT_PUBLIC), - "::", - stringify!(objectAttributes) - ) + "Offset of field: TPMT_PUBLIC::objectAttributes" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).authPolicy) as usize - ptr as usize }, 8usize, - concat!( - "Offset of field: ", - stringify!(TPMT_PUBLIC), - "::", - stringify!(authPolicy) - ) + "Offset of field: TPMT_PUBLIC::authPolicy" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).parameters) as usize - ptr as usize }, 76usize, - concat!( - "Offset of field: ", - stringify!(TPMT_PUBLIC), - "::", - stringify!(parameters) - ) + "Offset of field: TPMT_PUBLIC::parameters" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).unique) as usize - ptr as usize }, 96usize, - concat!( - "Offset of field: ", - stringify!(TPMT_PUBLIC), - "::", - stringify!(unique) - ) + "Offset of field: TPMT_PUBLIC::unique" ); } impl Default for TPMT_PUBLIC { @@ -6442,32 +5184,22 @@ fn bindgen_test_layout_TPM2B_PUBLIC() { assert_eq!( ::std::mem::size_of::(), 616usize, - concat!("Size of: ", stringify!(TPM2B_PUBLIC)) + "Size of TPM2B_PUBLIC" ); assert_eq!( ::std::mem::align_of::(), 4usize, - concat!("Alignment of ", stringify!(TPM2B_PUBLIC)) + "Alignment of TPM2B_PUBLIC" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).size) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPM2B_PUBLIC), - "::", - stringify!(size) - ) + "Offset of field: TPM2B_PUBLIC::size" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).publicArea) as usize - ptr as usize }, 4usize, - concat!( - "Offset of field: ", - stringify!(TPM2B_PUBLIC), - "::", - stringify!(publicArea) - ) + "Offset of field: TPM2B_PUBLIC::publicArea" ); } impl Default for TPM2B_PUBLIC { @@ -6492,32 +5224,22 @@ fn bindgen_test_layout_TPM2B_TEMPLATE() { assert_eq!( ::std::mem::size_of::(), 614usize, - concat!("Size of: ", stringify!(TPM2B_TEMPLATE)) + "Size of TPM2B_TEMPLATE" ); assert_eq!( ::std::mem::align_of::(), 2usize, - concat!("Alignment of ", stringify!(TPM2B_TEMPLATE)) + "Alignment of TPM2B_TEMPLATE" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).size) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPM2B_TEMPLATE), - "::", - stringify!(size) - ) + "Offset of field: TPM2B_TEMPLATE::size" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).buffer) as usize - ptr as usize }, 2usize, - concat!( - "Offset of field: ", - stringify!(TPM2B_TEMPLATE), - "::", - stringify!(buffer) - ) + "Offset of field: TPM2B_TEMPLATE::buffer" ); } impl Default for TPM2B_TEMPLATE { @@ -6543,32 +5265,22 @@ fn bindgen_test_layout_TPM2B_PRIVATE_VENDOR_SPECIFIC() { assert_eq!( ::std::mem::size_of::(), 1282usize, - concat!("Size of: ", stringify!(TPM2B_PRIVATE_VENDOR_SPECIFIC)) + "Size of TPM2B_PRIVATE_VENDOR_SPECIFIC" ); assert_eq!( ::std::mem::align_of::(), 2usize, - concat!("Alignment of ", stringify!(TPM2B_PRIVATE_VENDOR_SPECIFIC)) + "Alignment of TPM2B_PRIVATE_VENDOR_SPECIFIC" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).size) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPM2B_PRIVATE_VENDOR_SPECIFIC), - "::", - stringify!(size) - ) + "Offset of field: TPM2B_PRIVATE_VENDOR_SPECIFIC::size" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).buffer) as usize - ptr as usize }, 2usize, - concat!( - "Offset of field: ", - stringify!(TPM2B_PRIVATE_VENDOR_SPECIFIC), - "::", - stringify!(buffer) - ) + "Offset of field: TPM2B_PRIVATE_VENDOR_SPECIFIC::buffer" ); } impl Default for TPM2B_PRIVATE_VENDOR_SPECIFIC { @@ -6597,62 +5309,37 @@ fn bindgen_test_layout_TPMU_SENSITIVE_COMPOSITE() { assert_eq!( ::std::mem::size_of::(), 1282usize, - concat!("Size of: ", stringify!(TPMU_SENSITIVE_COMPOSITE)) + "Size of TPMU_SENSITIVE_COMPOSITE" ); assert_eq!( ::std::mem::align_of::(), 2usize, - concat!("Alignment of ", stringify!(TPMU_SENSITIVE_COMPOSITE)) + "Alignment of TPMU_SENSITIVE_COMPOSITE" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).rsa) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_SENSITIVE_COMPOSITE), - "::", - stringify!(rsa) - ) + "Offset of field: TPMU_SENSITIVE_COMPOSITE::rsa" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).ecc) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_SENSITIVE_COMPOSITE), - "::", - stringify!(ecc) - ) + "Offset of field: TPMU_SENSITIVE_COMPOSITE::ecc" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).bits) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_SENSITIVE_COMPOSITE), - "::", - stringify!(bits) - ) + "Offset of field: TPMU_SENSITIVE_COMPOSITE::bits" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).sym) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_SENSITIVE_COMPOSITE), - "::", - stringify!(sym) - ) + "Offset of field: TPMU_SENSITIVE_COMPOSITE::sym" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).any) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_SENSITIVE_COMPOSITE), - "::", - stringify!(any) - ) + "Offset of field: TPMU_SENSITIVE_COMPOSITE::any" ); } impl Default for TPMU_SENSITIVE_COMPOSITE { @@ -6679,52 +5366,32 @@ fn bindgen_test_layout_TPMT_SENSITIVE() { assert_eq!( ::std::mem::size_of::(), 1416usize, - concat!("Size of: ", stringify!(TPMT_SENSITIVE)) + "Size of TPMT_SENSITIVE" ); assert_eq!( ::std::mem::align_of::(), 2usize, - concat!("Alignment of ", stringify!(TPMT_SENSITIVE)) + "Alignment of TPMT_SENSITIVE" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).sensitiveType) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMT_SENSITIVE), - "::", - stringify!(sensitiveType) - ) + "Offset of field: TPMT_SENSITIVE::sensitiveType" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).authValue) as usize - ptr as usize }, 2usize, - concat!( - "Offset of field: ", - stringify!(TPMT_SENSITIVE), - "::", - stringify!(authValue) - ) + "Offset of field: TPMT_SENSITIVE::authValue" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).seedValue) as usize - ptr as usize }, 68usize, - concat!( - "Offset of field: ", - stringify!(TPMT_SENSITIVE), - "::", - stringify!(seedValue) - ) + "Offset of field: TPMT_SENSITIVE::seedValue" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).sensitive) as usize - ptr as usize }, 134usize, - concat!( - "Offset of field: ", - stringify!(TPMT_SENSITIVE), - "::", - stringify!(sensitive) - ) + "Offset of field: TPMT_SENSITIVE::sensitive" ); } impl Default for TPMT_SENSITIVE { @@ -6749,32 +5416,22 @@ fn bindgen_test_layout_TPM2B_SENSITIVE() { assert_eq!( ::std::mem::size_of::(), 1418usize, - concat!("Size of: ", stringify!(TPM2B_SENSITIVE)) + "Size of TPM2B_SENSITIVE" ); assert_eq!( ::std::mem::align_of::(), 2usize, - concat!("Alignment of ", stringify!(TPM2B_SENSITIVE)) + "Alignment of TPM2B_SENSITIVE" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).size) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPM2B_SENSITIVE), - "::", - stringify!(size) - ) + "Offset of field: TPM2B_SENSITIVE::size" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).sensitiveArea) as usize - ptr as usize }, 2usize, - concat!( - "Offset of field: ", - stringify!(TPM2B_SENSITIVE), - "::", - stringify!(sensitiveArea) - ) + "Offset of field: TPM2B_SENSITIVE::sensitiveArea" ); } impl Default for TPM2B_SENSITIVE { @@ -6800,42 +5457,27 @@ fn bindgen_test_layout__PRIVATE() { assert_eq!( ::std::mem::size_of::<_PRIVATE>(), 1550usize, - concat!("Size of: ", stringify!(_PRIVATE)) + "Size of _PRIVATE" ); assert_eq!( ::std::mem::align_of::<_PRIVATE>(), 2usize, - concat!("Alignment of ", stringify!(_PRIVATE)) + "Alignment of _PRIVATE" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).integrityOuter) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(_PRIVATE), - "::", - stringify!(integrityOuter) - ) + "Offset of field: _PRIVATE::integrityOuter" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).integrityInner) as usize - ptr as usize }, 66usize, - concat!( - "Offset of field: ", - stringify!(_PRIVATE), - "::", - stringify!(integrityInner) - ) + "Offset of field: _PRIVATE::integrityInner" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).sensitive) as usize - ptr as usize }, 132usize, - concat!( - "Offset of field: ", - stringify!(_PRIVATE), - "::", - stringify!(sensitive) - ) + "Offset of field: _PRIVATE::sensitive" ); } impl Default for _PRIVATE { @@ -6860,32 +5502,22 @@ fn bindgen_test_layout_TPM2B_PRIVATE() { assert_eq!( ::std::mem::size_of::(), 1552usize, - concat!("Size of: ", stringify!(TPM2B_PRIVATE)) + "Size of TPM2B_PRIVATE" ); assert_eq!( ::std::mem::align_of::(), 2usize, - concat!("Alignment of ", stringify!(TPM2B_PRIVATE)) + "Alignment of TPM2B_PRIVATE" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).size) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPM2B_PRIVATE), - "::", - stringify!(size) - ) + "Offset of field: TPM2B_PRIVATE::size" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).buffer) as usize - ptr as usize }, 2usize, - concat!( - "Offset of field: ", - stringify!(TPM2B_PRIVATE), - "::", - stringify!(buffer) - ) + "Offset of field: TPM2B_PRIVATE::buffer" ); } impl Default for TPM2B_PRIVATE { @@ -6910,32 +5542,22 @@ fn bindgen_test_layout_TPMS_ID_OBJECT() { assert_eq!( ::std::mem::size_of::(), 132usize, - concat!("Size of: ", stringify!(TPMS_ID_OBJECT)) + "Size of TPMS_ID_OBJECT" ); assert_eq!( ::std::mem::align_of::(), 2usize, - concat!("Alignment of ", stringify!(TPMS_ID_OBJECT)) + "Alignment of TPMS_ID_OBJECT" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).integrityHMAC) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMS_ID_OBJECT), - "::", - stringify!(integrityHMAC) - ) + "Offset of field: TPMS_ID_OBJECT::integrityHMAC" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).encIdentity) as usize - ptr as usize }, 66usize, - concat!( - "Offset of field: ", - stringify!(TPMS_ID_OBJECT), - "::", - stringify!(encIdentity) - ) + "Offset of field: TPMS_ID_OBJECT::encIdentity" ); } impl Default for TPMS_ID_OBJECT { @@ -6960,32 +5582,22 @@ fn bindgen_test_layout_TPM2B_ID_OBJECT() { assert_eq!( ::std::mem::size_of::(), 134usize, - concat!("Size of: ", stringify!(TPM2B_ID_OBJECT)) + "Size of TPM2B_ID_OBJECT" ); assert_eq!( ::std::mem::align_of::(), 2usize, - concat!("Alignment of ", stringify!(TPM2B_ID_OBJECT)) + "Alignment of TPM2B_ID_OBJECT" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).size) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPM2B_ID_OBJECT), - "::", - stringify!(size) - ) + "Offset of field: TPM2B_ID_OBJECT::size" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).credential) as usize - ptr as usize }, 2usize, - concat!( - "Offset of field: ", - stringify!(TPM2B_ID_OBJECT), - "::", - stringify!(credential) - ) + "Offset of field: TPM2B_ID_OBJECT::credential" ); } impl Default for TPM2B_ID_OBJECT { @@ -7013,32 +5625,22 @@ fn bindgen_test_layout_TPMS_NV_PIN_COUNTER_PARAMETERS() { assert_eq!( ::std::mem::size_of::(), 8usize, - concat!("Size of: ", stringify!(TPMS_NV_PIN_COUNTER_PARAMETERS)) + "Size of TPMS_NV_PIN_COUNTER_PARAMETERS" ); assert_eq!( ::std::mem::align_of::(), 4usize, - concat!("Alignment of ", stringify!(TPMS_NV_PIN_COUNTER_PARAMETERS)) + "Alignment of TPMS_NV_PIN_COUNTER_PARAMETERS" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).pinCount) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMS_NV_PIN_COUNTER_PARAMETERS), - "::", - stringify!(pinCount) - ) + "Offset of field: TPMS_NV_PIN_COUNTER_PARAMETERS::pinCount" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).pinLimit) as usize - ptr as usize }, 4usize, - concat!( - "Offset of field: ", - stringify!(TPMS_NV_PIN_COUNTER_PARAMETERS), - "::", - stringify!(pinLimit) - ) + "Offset of field: TPMS_NV_PIN_COUNTER_PARAMETERS::pinLimit" ); } pub type TPMA_NV = u32; @@ -7058,62 +5660,37 @@ fn bindgen_test_layout_TPMS_NV_PUBLIC() { assert_eq!( ::std::mem::size_of::(), 80usize, - concat!("Size of: ", stringify!(TPMS_NV_PUBLIC)) + "Size of TPMS_NV_PUBLIC" ); assert_eq!( ::std::mem::align_of::(), 4usize, - concat!("Alignment of ", stringify!(TPMS_NV_PUBLIC)) + "Alignment of TPMS_NV_PUBLIC" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).nvIndex) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMS_NV_PUBLIC), - "::", - stringify!(nvIndex) - ) + "Offset of field: TPMS_NV_PUBLIC::nvIndex" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).nameAlg) as usize - ptr as usize }, 4usize, - concat!( - "Offset of field: ", - stringify!(TPMS_NV_PUBLIC), - "::", - stringify!(nameAlg) - ) + "Offset of field: TPMS_NV_PUBLIC::nameAlg" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).attributes) as usize - ptr as usize }, 8usize, - concat!( - "Offset of field: ", - stringify!(TPMS_NV_PUBLIC), - "::", - stringify!(attributes) - ) + "Offset of field: TPMS_NV_PUBLIC::attributes" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).authPolicy) as usize - ptr as usize }, 12usize, - concat!( - "Offset of field: ", - stringify!(TPMS_NV_PUBLIC), - "::", - stringify!(authPolicy) - ) + "Offset of field: TPMS_NV_PUBLIC::authPolicy" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).dataSize) as usize - ptr as usize }, 78usize, - concat!( - "Offset of field: ", - stringify!(TPMS_NV_PUBLIC), - "::", - stringify!(dataSize) - ) + "Offset of field: TPMS_NV_PUBLIC::dataSize" ); } impl Default for TPMS_NV_PUBLIC { @@ -7138,32 +5715,22 @@ fn bindgen_test_layout_TPM2B_NV_PUBLIC() { assert_eq!( ::std::mem::size_of::(), 84usize, - concat!("Size of: ", stringify!(TPM2B_NV_PUBLIC)) + "Size of TPM2B_NV_PUBLIC" ); assert_eq!( ::std::mem::align_of::(), 4usize, - concat!("Alignment of ", stringify!(TPM2B_NV_PUBLIC)) + "Alignment of TPM2B_NV_PUBLIC" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).size) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPM2B_NV_PUBLIC), - "::", - stringify!(size) - ) + "Offset of field: TPM2B_NV_PUBLIC::size" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).nvPublic) as usize - ptr as usize }, 4usize, - concat!( - "Offset of field: ", - stringify!(TPM2B_NV_PUBLIC), - "::", - stringify!(nvPublic) - ) + "Offset of field: TPM2B_NV_PUBLIC::nvPublic" ); } impl Default for TPM2B_NV_PUBLIC { @@ -7189,32 +5756,22 @@ fn bindgen_test_layout_TPM2B_CONTEXT_SENSITIVE() { assert_eq!( ::std::mem::size_of::(), 5122usize, - concat!("Size of: ", stringify!(TPM2B_CONTEXT_SENSITIVE)) + "Size of TPM2B_CONTEXT_SENSITIVE" ); assert_eq!( ::std::mem::align_of::(), 2usize, - concat!("Alignment of ", stringify!(TPM2B_CONTEXT_SENSITIVE)) + "Alignment of TPM2B_CONTEXT_SENSITIVE" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).size) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPM2B_CONTEXT_SENSITIVE), - "::", - stringify!(size) - ) + "Offset of field: TPM2B_CONTEXT_SENSITIVE::size" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).buffer) as usize - ptr as usize }, 2usize, - concat!( - "Offset of field: ", - stringify!(TPM2B_CONTEXT_SENSITIVE), - "::", - stringify!(buffer) - ) + "Offset of field: TPM2B_CONTEXT_SENSITIVE::buffer" ); } impl Default for TPM2B_CONTEXT_SENSITIVE { @@ -7239,32 +5796,22 @@ fn bindgen_test_layout_TPMS_CONTEXT_DATA() { assert_eq!( ::std::mem::size_of::(), 5188usize, - concat!("Size of: ", stringify!(TPMS_CONTEXT_DATA)) + "Size of TPMS_CONTEXT_DATA" ); assert_eq!( ::std::mem::align_of::(), 2usize, - concat!("Alignment of ", stringify!(TPMS_CONTEXT_DATA)) + "Alignment of TPMS_CONTEXT_DATA" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).integrity) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMS_CONTEXT_DATA), - "::", - stringify!(integrity) - ) + "Offset of field: TPMS_CONTEXT_DATA::integrity" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).encrypted) as usize - ptr as usize }, 66usize, - concat!( - "Offset of field: ", - stringify!(TPMS_CONTEXT_DATA), - "::", - stringify!(encrypted) - ) + "Offset of field: TPMS_CONTEXT_DATA::encrypted" ); } impl Default for TPMS_CONTEXT_DATA { @@ -7289,32 +5836,22 @@ fn bindgen_test_layout_TPM2B_CONTEXT_DATA() { assert_eq!( ::std::mem::size_of::(), 5190usize, - concat!("Size of: ", stringify!(TPM2B_CONTEXT_DATA)) + "Size of TPM2B_CONTEXT_DATA" ); assert_eq!( ::std::mem::align_of::(), 2usize, - concat!("Alignment of ", stringify!(TPM2B_CONTEXT_DATA)) + "Alignment of TPM2B_CONTEXT_DATA" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).size) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPM2B_CONTEXT_DATA), - "::", - stringify!(size) - ) + "Offset of field: TPM2B_CONTEXT_DATA::size" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).buffer) as usize - ptr as usize }, 2usize, - concat!( - "Offset of field: ", - stringify!(TPM2B_CONTEXT_DATA), - "::", - stringify!(buffer) - ) + "Offset of field: TPM2B_CONTEXT_DATA::buffer" ); } impl Default for TPM2B_CONTEXT_DATA { @@ -7341,52 +5878,32 @@ fn bindgen_test_layout_TPMS_CONTEXT() { assert_eq!( ::std::mem::size_of::(), 5208usize, - concat!("Size of: ", stringify!(TPMS_CONTEXT)) + "Size of TPMS_CONTEXT" ); assert_eq!( ::std::mem::align_of::(), 8usize, - concat!("Alignment of ", stringify!(TPMS_CONTEXT)) + "Alignment of TPMS_CONTEXT" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).sequence) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMS_CONTEXT), - "::", - stringify!(sequence) - ) + "Offset of field: TPMS_CONTEXT::sequence" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).savedHandle) as usize - ptr as usize }, 8usize, - concat!( - "Offset of field: ", - stringify!(TPMS_CONTEXT), - "::", - stringify!(savedHandle) - ) + "Offset of field: TPMS_CONTEXT::savedHandle" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).hierarchy) as usize - ptr as usize }, 12usize, - concat!( - "Offset of field: ", - stringify!(TPMS_CONTEXT), - "::", - stringify!(hierarchy) - ) + "Offset of field: TPMS_CONTEXT::hierarchy" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).contextBlob) as usize - ptr as usize }, 16usize, - concat!( - "Offset of field: ", - stringify!(TPMS_CONTEXT), - "::", - stringify!(contextBlob) - ) + "Offset of field: TPMS_CONTEXT::contextBlob" ); } impl Default for TPMS_CONTEXT { @@ -7416,82 +5933,47 @@ fn bindgen_test_layout_TPMS_CREATION_DATA() { assert_eq!( ::std::mem::size_of::(), 408usize, - concat!("Size of: ", stringify!(TPMS_CREATION_DATA)) + "Size of TPMS_CREATION_DATA" ); assert_eq!( ::std::mem::align_of::(), 4usize, - concat!("Alignment of ", stringify!(TPMS_CREATION_DATA)) + "Alignment of TPMS_CREATION_DATA" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).pcrSelect) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMS_CREATION_DATA), - "::", - stringify!(pcrSelect) - ) + "Offset of field: TPMS_CREATION_DATA::pcrSelect" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).pcrDigest) as usize - ptr as usize }, 132usize, - concat!( - "Offset of field: ", - stringify!(TPMS_CREATION_DATA), - "::", - stringify!(pcrDigest) - ) + "Offset of field: TPMS_CREATION_DATA::pcrDigest" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).locality) as usize - ptr as usize }, 198usize, - concat!( - "Offset of field: ", - stringify!(TPMS_CREATION_DATA), - "::", - stringify!(locality) - ) + "Offset of field: TPMS_CREATION_DATA::locality" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).parentNameAlg) as usize - ptr as usize }, 200usize, - concat!( - "Offset of field: ", - stringify!(TPMS_CREATION_DATA), - "::", - stringify!(parentNameAlg) - ) + "Offset of field: TPMS_CREATION_DATA::parentNameAlg" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).parentName) as usize - ptr as usize }, 202usize, - concat!( - "Offset of field: ", - stringify!(TPMS_CREATION_DATA), - "::", - stringify!(parentName) - ) + "Offset of field: TPMS_CREATION_DATA::parentName" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).parentQualifiedName) as usize - ptr as usize }, 272usize, - concat!( - "Offset of field: ", - stringify!(TPMS_CREATION_DATA), - "::", - stringify!(parentQualifiedName) - ) + "Offset of field: TPMS_CREATION_DATA::parentQualifiedName" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).outsideInfo) as usize - ptr as usize }, 342usize, - concat!( - "Offset of field: ", - stringify!(TPMS_CREATION_DATA), - "::", - stringify!(outsideInfo) - ) + "Offset of field: TPMS_CREATION_DATA::outsideInfo" ); } impl Default for TPMS_CREATION_DATA { @@ -7516,32 +5998,22 @@ fn bindgen_test_layout_TPM2B_CREATION_DATA() { assert_eq!( ::std::mem::size_of::(), 412usize, - concat!("Size of: ", stringify!(TPM2B_CREATION_DATA)) + "Size of TPM2B_CREATION_DATA" ); assert_eq!( ::std::mem::align_of::(), 4usize, - concat!("Alignment of ", stringify!(TPM2B_CREATION_DATA)) + "Alignment of TPM2B_CREATION_DATA" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).size) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPM2B_CREATION_DATA), - "::", - stringify!(size) - ) + "Offset of field: TPM2B_CREATION_DATA::size" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).creationData) as usize - ptr as usize }, 4usize, - concat!( - "Offset of field: ", - stringify!(TPM2B_CREATION_DATA), - "::", - stringify!(creationData) - ) + "Offset of field: TPM2B_CREATION_DATA::creationData" ); } impl Default for TPM2B_CREATION_DATA { @@ -7568,32 +6040,22 @@ fn bindgen_test_layout_TPMS_AC_OUTPUT() { assert_eq!( ::std::mem::size_of::(), 8usize, - concat!("Size of: ", stringify!(TPMS_AC_OUTPUT)) + "Size of TPMS_AC_OUTPUT" ); assert_eq!( ::std::mem::align_of::(), 4usize, - concat!("Alignment of ", stringify!(TPMS_AC_OUTPUT)) + "Alignment of TPMS_AC_OUTPUT" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).tag) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMS_AC_OUTPUT), - "::", - stringify!(tag) - ) + "Offset of field: TPMS_AC_OUTPUT::tag" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).data) as usize - ptr as usize }, 4usize, - concat!( - "Offset of field: ", - stringify!(TPMS_AC_OUTPUT), - "::", - stringify!(data) - ) + "Offset of field: TPMS_AC_OUTPUT::data" ); } #[repr(C)] @@ -7609,32 +6071,22 @@ fn bindgen_test_layout_TPML_AC_CAPABILITIES() { assert_eq!( ::std::mem::size_of::(), 1028usize, - concat!("Size of: ", stringify!(TPML_AC_CAPABILITIES)) + "Size of TPML_AC_CAPABILITIES" ); assert_eq!( ::std::mem::align_of::(), 4usize, - concat!("Alignment of ", stringify!(TPML_AC_CAPABILITIES)) + "Alignment of TPML_AC_CAPABILITIES" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).count) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPML_AC_CAPABILITIES), - "::", - stringify!(count) - ) + "Offset of field: TPML_AC_CAPABILITIES::count" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).acCapabilities) as usize - ptr as usize }, 4usize, - concat!( - "Offset of field: ", - stringify!(TPML_AC_CAPABILITIES), - "::", - stringify!(acCapabilities) - ) + "Offset of field: TPML_AC_CAPABILITIES::acCapabilities" ); } impl Default for TPML_AC_CAPABILITIES { @@ -7646,6 +6098,47 @@ impl Default for TPML_AC_CAPABILITIES { } } } +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct TPML_INTEL_PTT_PROPERTY { + pub count: UINT32, + pub property: [UINT32; 256usize], +} +#[test] +fn bindgen_test_layout_TPML_INTEL_PTT_PROPERTY() { + const UNINIT: ::std::mem::MaybeUninit = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 1028usize, + "Size of TPML_INTEL_PTT_PROPERTY" + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + "Alignment of TPML_INTEL_PTT_PROPERTY" + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).count) as usize - ptr as usize }, + 0usize, + "Offset of field: TPML_INTEL_PTT_PROPERTY::count" + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).property) as usize - ptr as usize }, + 4usize, + "Offset of field: TPML_INTEL_PTT_PROPERTY::property" + ); +} +impl Default for TPML_INTEL_PTT_PROPERTY { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} pub type nfds_t = ::std::os::raw::c_ulong; #[repr(C)] #[derive(Debug, Default, Copy, Clone)] @@ -7658,45 +6151,26 @@ pub struct pollfd { fn bindgen_test_layout_pollfd() { const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 8usize, - concat!("Size of: ", stringify!(pollfd)) - ); + assert_eq!(::std::mem::size_of::(), 8usize, "Size of pollfd"); assert_eq!( ::std::mem::align_of::(), 4usize, - concat!("Alignment of ", stringify!(pollfd)) + "Alignment of pollfd" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).fd) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(pollfd), - "::", - stringify!(fd) - ) + "Offset of field: pollfd::fd" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).events) as usize - ptr as usize }, 4usize, - concat!( - "Offset of field: ", - stringify!(pollfd), - "::", - stringify!(events) - ) + "Offset of field: pollfd::events" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).revents) as usize - ptr as usize }, 6usize, - concat!( - "Offset of field: ", - stringify!(pollfd), - "::", - stringify!(revents) - ) + "Offset of field: pollfd::revents" ); } extern "C" { @@ -7776,92 +6250,52 @@ fn bindgen_test_layout_TSS2_TCTI_CONTEXT_COMMON_V1() { assert_eq!( ::std::mem::size_of::(), 40usize, - concat!("Size of: ", stringify!(TSS2_TCTI_CONTEXT_COMMON_V1)) + "Size of TSS2_TCTI_CONTEXT_COMMON_V1" ); assert_eq!( ::std::mem::align_of::(), 8usize, - concat!("Alignment of ", stringify!(TSS2_TCTI_CONTEXT_COMMON_V1)) + "Alignment of TSS2_TCTI_CONTEXT_COMMON_V1" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).magic) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TSS2_TCTI_CONTEXT_COMMON_V1), - "::", - stringify!(magic) - ) + "Offset of field: TSS2_TCTI_CONTEXT_COMMON_V1::magic" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).version) as usize - ptr as usize }, 8usize, - concat!( - "Offset of field: ", - stringify!(TSS2_TCTI_CONTEXT_COMMON_V1), - "::", - stringify!(version) - ) + "Offset of field: TSS2_TCTI_CONTEXT_COMMON_V1::version" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).transmit) as usize - ptr as usize }, 12usize, - concat!( - "Offset of field: ", - stringify!(TSS2_TCTI_CONTEXT_COMMON_V1), - "::", - stringify!(transmit) - ) + "Offset of field: TSS2_TCTI_CONTEXT_COMMON_V1::transmit" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).receive) as usize - ptr as usize }, 16usize, - concat!( - "Offset of field: ", - stringify!(TSS2_TCTI_CONTEXT_COMMON_V1), - "::", - stringify!(receive) - ) + "Offset of field: TSS2_TCTI_CONTEXT_COMMON_V1::receive" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).finalize) as usize - ptr as usize }, 20usize, - concat!( - "Offset of field: ", - stringify!(TSS2_TCTI_CONTEXT_COMMON_V1), - "::", - stringify!(finalize) - ) + "Offset of field: TSS2_TCTI_CONTEXT_COMMON_V1::finalize" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).cancel) as usize - ptr as usize }, 24usize, - concat!( - "Offset of field: ", - stringify!(TSS2_TCTI_CONTEXT_COMMON_V1), - "::", - stringify!(cancel) - ) + "Offset of field: TSS2_TCTI_CONTEXT_COMMON_V1::cancel" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).getPollHandles) as usize - ptr as usize }, 28usize, - concat!( - "Offset of field: ", - stringify!(TSS2_TCTI_CONTEXT_COMMON_V1), - "::", - stringify!(getPollHandles) - ) + "Offset of field: TSS2_TCTI_CONTEXT_COMMON_V1::getPollHandles" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).setLocality) as usize - ptr as usize }, 32usize, - concat!( - "Offset of field: ", - stringify!(TSS2_TCTI_CONTEXT_COMMON_V1), - "::", - stringify!(setLocality) - ) + "Offset of field: TSS2_TCTI_CONTEXT_COMMON_V1::setLocality" ); } #[repr(C)] @@ -7878,32 +6312,22 @@ fn bindgen_test_layout_TSS2_TCTI_CONTEXT_COMMON_V2() { assert_eq!( ::std::mem::size_of::(), 48usize, - concat!("Size of: ", stringify!(TSS2_TCTI_CONTEXT_COMMON_V2)) + "Size of TSS2_TCTI_CONTEXT_COMMON_V2" ); assert_eq!( ::std::mem::align_of::(), 8usize, - concat!("Alignment of ", stringify!(TSS2_TCTI_CONTEXT_COMMON_V2)) + "Alignment of TSS2_TCTI_CONTEXT_COMMON_V2" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).v1) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TSS2_TCTI_CONTEXT_COMMON_V2), - "::", - stringify!(v1) - ) + "Offset of field: TSS2_TCTI_CONTEXT_COMMON_V2::v1" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).makeSticky) as usize - ptr as usize }, 40usize, - concat!( - "Offset of field: ", - stringify!(TSS2_TCTI_CONTEXT_COMMON_V2), - "::", - stringify!(makeSticky) - ) + "Offset of field: TSS2_TCTI_CONTEXT_COMMON_V2::makeSticky" ); } pub type TSS2_TCTI_CONTEXT_COMMON_CURRENT = TSS2_TCTI_CONTEXT_COMMON_V2; @@ -7923,62 +6347,37 @@ fn bindgen_test_layout_TSS2_TCTI_INFO() { assert_eq!( ::std::mem::size_of::(), 20usize, - concat!("Size of: ", stringify!(TSS2_TCTI_INFO)) + "Size of TSS2_TCTI_INFO" ); assert_eq!( ::std::mem::align_of::(), 4usize, - concat!("Alignment of ", stringify!(TSS2_TCTI_INFO)) + "Alignment of TSS2_TCTI_INFO" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).version) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TSS2_TCTI_INFO), - "::", - stringify!(version) - ) + "Offset of field: TSS2_TCTI_INFO::version" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).name) as usize - ptr as usize }, 4usize, - concat!( - "Offset of field: ", - stringify!(TSS2_TCTI_INFO), - "::", - stringify!(name) - ) + "Offset of field: TSS2_TCTI_INFO::name" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).description) as usize - ptr as usize }, 8usize, - concat!( - "Offset of field: ", - stringify!(TSS2_TCTI_INFO), - "::", - stringify!(description) - ) + "Offset of field: TSS2_TCTI_INFO::description" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).config_help) as usize - ptr as usize }, 12usize, - concat!( - "Offset of field: ", - stringify!(TSS2_TCTI_INFO), - "::", - stringify!(config_help) - ) + "Offset of field: TSS2_TCTI_INFO::config_help" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).init) as usize - ptr as usize }, 16usize, - concat!( - "Offset of field: ", - stringify!(TSS2_TCTI_INFO), - "::", - stringify!(init) - ) + "Offset of field: TSS2_TCTI_INFO::init" ); } impl Default for TSS2_TCTI_INFO { @@ -8012,32 +6411,22 @@ fn bindgen_test_layout_TSS2L_SYS_AUTH_COMMAND() { assert_eq!( ::std::mem::size_of::(), 424usize, - concat!("Size of: ", stringify!(TSS2L_SYS_AUTH_COMMAND)) + "Size of TSS2L_SYS_AUTH_COMMAND" ); assert_eq!( ::std::mem::align_of::(), 4usize, - concat!("Alignment of ", stringify!(TSS2L_SYS_AUTH_COMMAND)) + "Alignment of TSS2L_SYS_AUTH_COMMAND" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).count) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TSS2L_SYS_AUTH_COMMAND), - "::", - stringify!(count) - ) + "Offset of field: TSS2L_SYS_AUTH_COMMAND::count" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).auths) as usize - ptr as usize }, 4usize, - concat!( - "Offset of field: ", - stringify!(TSS2L_SYS_AUTH_COMMAND), - "::", - stringify!(auths) - ) + "Offset of field: TSS2L_SYS_AUTH_COMMAND::auths" ); } impl Default for TSS2L_SYS_AUTH_COMMAND { @@ -8063,32 +6452,22 @@ fn bindgen_test_layout_TSS2L_SYS_AUTH_RESPONSE() { assert_eq!( ::std::mem::size_of::(), 404usize, - concat!("Size of: ", stringify!(TSS2L_SYS_AUTH_RESPONSE)) + "Size of TSS2L_SYS_AUTH_RESPONSE" ); assert_eq!( ::std::mem::align_of::(), 2usize, - concat!("Alignment of ", stringify!(TSS2L_SYS_AUTH_RESPONSE)) + "Alignment of TSS2L_SYS_AUTH_RESPONSE" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).count) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TSS2L_SYS_AUTH_RESPONSE), - "::", - stringify!(count) - ) + "Offset of field: TSS2L_SYS_AUTH_RESPONSE::count" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).auths) as usize - ptr as usize }, 2usize, - concat!( - "Offset of field: ", - stringify!(TSS2L_SYS_AUTH_RESPONSE), - "::", - stringify!(auths) - ) + "Offset of field: TSS2L_SYS_AUTH_RESPONSE::auths" ); } impl Default for TSS2L_SYS_AUTH_RESPONSE { @@ -8902,6 +7281,31 @@ extern "C" { rspAuthsArray: *mut TSS2L_SYS_AUTH_RESPONSE, ) -> TSS2_RC; } +extern "C" { + pub fn Tss2_Sys_MAC_Prepare( + sysContext: *mut TSS2_SYS_CONTEXT, + handle: TPMI_DH_OBJECT, + buffer: *const TPM2B_MAX_BUFFER, + inScheme: TPMI_ALG_MAC_SCHEME, + ) -> TSS2_RC; +} +extern "C" { + pub fn Tss2_Sys_MAC_Complete( + sysContext: *mut TSS2_SYS_CONTEXT, + outMAC: *mut TPM2B_DIGEST, + ) -> TSS2_RC; +} +extern "C" { + pub fn Tss2_Sys_MAC( + sysContext: *mut TSS2_SYS_CONTEXT, + handle: TPMI_DH_OBJECT, + cmdAuths: *const TSS2L_SYS_AUTH_COMMAND, + buffer: *const TPM2B_MAX_BUFFER, + inScheme: TPMI_ALG_MAC_SCHEME, + outMAC: *mut TPM2B_DIGEST, + rspAuths: *mut TSS2L_SYS_AUTH_RESPONSE, + ) -> TSS2_RC; +} extern "C" { pub fn Tss2_Sys_GetRandom_Prepare( sysContext: *mut TSS2_SYS_CONTEXT, @@ -8965,6 +7369,31 @@ extern "C" { rspAuthsArray: *mut TSS2L_SYS_AUTH_RESPONSE, ) -> TSS2_RC; } +extern "C" { + pub fn Tss2_Sys_MAC_Start_Prepare( + sysContext: *mut TSS2_SYS_CONTEXT, + handle: TPMI_DH_OBJECT, + auth: *const TPM2B_AUTH, + inScheme: TPMI_ALG_MAC_SCHEME, + ) -> TSS2_RC; +} +extern "C" { + pub fn Tss2_Sys_MAC_Start_Complete( + sysContext: *mut TSS2_SYS_CONTEXT, + sequenceHandle: *mut TPMI_DH_OBJECT, + ) -> TSS2_RC; +} +extern "C" { + pub fn Tss2_Sys_MAC_Start( + sysContext: *mut TSS2_SYS_CONTEXT, + handle: TPMI_DH_OBJECT, + cmdAuths: *const TSS2L_SYS_AUTH_COMMAND, + auth: *const TPM2B_AUTH, + inScheme: TPMI_ALG_MAC_SCHEME, + sequenceHandle: *mut TPMI_DH_OBJECT, + rspAuthsArray: *mut TSS2L_SYS_AUTH_RESPONSE, + ) -> TSS2_RC; +} extern "C" { pub fn Tss2_Sys_HashSequenceStart_Prepare( sysContext: *mut TSS2_SYS_CONTEXT, @@ -10952,9 +9381,249 @@ pub type ESYS_TR = u32; pub struct ESYS_CONTEXT { _unused: [u8; 0], } -extern "C" { - pub fn Esys_Initialize( - esys_context: *mut *mut ESYS_CONTEXT, +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct ESYS_CRYPTO_CONTEXT_BLOB { + _unused: [u8; 0], +} +pub type ESYS_CRYPTO_HASH_START_FNP = ::std::option::Option< + unsafe extern "C" fn( + context: *mut *mut ESYS_CRYPTO_CONTEXT_BLOB, + hashAlg: TPM2_ALG_ID, + userdata: *mut ::std::os::raw::c_void, + ) -> TSS2_RC, +>; +pub type ESYS_CRYPTO_HASH_UPDATE_FNP = ::std::option::Option< + unsafe extern "C" fn( + context: *mut ESYS_CRYPTO_CONTEXT_BLOB, + buffer: *const u8, + size: size_t, + userdata: *mut ::std::os::raw::c_void, + ) -> TSS2_RC, +>; +pub type ESYS_CRYPTO_HASH_FINISH_FNP = ::std::option::Option< + unsafe extern "C" fn( + context: *mut *mut ESYS_CRYPTO_CONTEXT_BLOB, + buffer: *mut u8, + size: *mut size_t, + userdata: *mut ::std::os::raw::c_void, + ) -> TSS2_RC, +>; +pub type ESYS_CRYPTO_HASH_ABORT_FNP = ::std::option::Option< + unsafe extern "C" fn( + context: *mut *mut ESYS_CRYPTO_CONTEXT_BLOB, + userdata: *mut ::std::os::raw::c_void, + ), +>; +pub type ESYS_CRYPTO_HMAC_START_FNP = ::std::option::Option< + unsafe extern "C" fn( + context: *mut *mut ESYS_CRYPTO_CONTEXT_BLOB, + hashAlg: TPM2_ALG_ID, + key: *const u8, + size: size_t, + userdata: *mut ::std::os::raw::c_void, + ) -> TSS2_RC, +>; +pub type ESYS_CRYPTO_HMAC_UPDATE_FNP = ::std::option::Option< + unsafe extern "C" fn( + context: *mut ESYS_CRYPTO_CONTEXT_BLOB, + buffer: *const u8, + size: size_t, + userdata: *mut ::std::os::raw::c_void, + ) -> TSS2_RC, +>; +pub type ESYS_CRYPTO_HMAC_FINISH_FNP = ::std::option::Option< + unsafe extern "C" fn( + context: *mut *mut ESYS_CRYPTO_CONTEXT_BLOB, + buffer: *mut u8, + size: *mut size_t, + userdata: *mut ::std::os::raw::c_void, + ) -> TSS2_RC, +>; +pub type ESYS_CRYPTO_HMAC_ABORT_FNP = ::std::option::Option< + unsafe extern "C" fn( + context: *mut *mut ESYS_CRYPTO_CONTEXT_BLOB, + userdata: *mut ::std::os::raw::c_void, + ), +>; +pub type ESYS_CRYPTO_GET_RANDOM2B_FNP = ::std::option::Option< + unsafe extern "C" fn( + nonce: *mut TPM2B_NONCE, + num_bytes: size_t, + userdata: *mut ::std::os::raw::c_void, + ) -> TSS2_RC, +>; +pub type ESYS_CRYPTO_GET_ECDH_POINT_FNP = ::std::option::Option< + unsafe extern "C" fn( + key: *mut TPM2B_PUBLIC, + max_out_size: size_t, + Z: *mut TPM2B_ECC_PARAMETER, + Q: *mut TPMS_ECC_POINT, + out_buffer: *mut BYTE, + out_size: *mut size_t, + userdata: *mut ::std::os::raw::c_void, + ) -> TSS2_RC, +>; +pub type ESYS_CRYPTO_AES_ENCRYPT_FNP = ::std::option::Option< + unsafe extern "C" fn( + key: *mut u8, + tpm_sym_alg: TPM2_ALG_ID, + key_bits: TPMI_AES_KEY_BITS, + tpm_mode: TPM2_ALG_ID, + buffer: *mut u8, + buffer_size: size_t, + iv: *mut u8, + userdata: *mut ::std::os::raw::c_void, + ) -> TSS2_RC, +>; +pub type ESYS_CRYPTO_AES_DECRYPT_FNP = ::std::option::Option< + unsafe extern "C" fn( + key: *mut u8, + tpm_sym_alg: TPM2_ALG_ID, + key_bits: TPMI_AES_KEY_BITS, + tpm_mode: TPM2_ALG_ID, + buffer: *mut u8, + buffer_size: size_t, + iv: *mut u8, + userdata: *mut ::std::os::raw::c_void, + ) -> TSS2_RC, +>; +pub type ESYS_CRYPTO_PK_RSA_ENCRYPT_FNP = ::std::option::Option< + unsafe extern "C" fn( + pub_tpm_key: *mut TPM2B_PUBLIC, + in_size: size_t, + in_buffer: *mut BYTE, + max_out_size: size_t, + out_buffer: *mut BYTE, + out_size: *mut size_t, + label: *const ::std::os::raw::c_char, + userdata: *mut ::std::os::raw::c_void, + ) -> TSS2_RC, +>; +pub type ESYS_CRYPTO_INIT_FNP = + ::std::option::Option TSS2_RC>; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct ESYS_CRYPTO_CALLBACKS { + pub rsa_pk_encrypt: ESYS_CRYPTO_PK_RSA_ENCRYPT_FNP, + pub hash_start: ESYS_CRYPTO_HASH_START_FNP, + pub hash_update: ESYS_CRYPTO_HASH_UPDATE_FNP, + pub hash_finish: ESYS_CRYPTO_HASH_FINISH_FNP, + pub hash_abort: ESYS_CRYPTO_HASH_ABORT_FNP, + pub hmac_start: ESYS_CRYPTO_HMAC_START_FNP, + pub hmac_update: ESYS_CRYPTO_HMAC_UPDATE_FNP, + pub hmac_finish: ESYS_CRYPTO_HMAC_FINISH_FNP, + pub hmac_abort: ESYS_CRYPTO_HMAC_ABORT_FNP, + pub get_random2b: ESYS_CRYPTO_GET_RANDOM2B_FNP, + pub get_ecdh_point: ESYS_CRYPTO_GET_ECDH_POINT_FNP, + pub aes_encrypt: ESYS_CRYPTO_AES_ENCRYPT_FNP, + pub aes_decrypt: ESYS_CRYPTO_AES_DECRYPT_FNP, + pub init: ESYS_CRYPTO_INIT_FNP, + pub userdata: *mut ::std::os::raw::c_void, +} +#[test] +fn bindgen_test_layout_ESYS_CRYPTO_CALLBACKS() { + const UNINIT: ::std::mem::MaybeUninit = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 60usize, + "Size of ESYS_CRYPTO_CALLBACKS" + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + "Alignment of ESYS_CRYPTO_CALLBACKS" + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).rsa_pk_encrypt) as usize - ptr as usize }, + 0usize, + "Offset of field: ESYS_CRYPTO_CALLBACKS::rsa_pk_encrypt" + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).hash_start) as usize - ptr as usize }, + 4usize, + "Offset of field: ESYS_CRYPTO_CALLBACKS::hash_start" + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).hash_update) as usize - ptr as usize }, + 8usize, + "Offset of field: ESYS_CRYPTO_CALLBACKS::hash_update" + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).hash_finish) as usize - ptr as usize }, + 12usize, + "Offset of field: ESYS_CRYPTO_CALLBACKS::hash_finish" + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).hash_abort) as usize - ptr as usize }, + 16usize, + "Offset of field: ESYS_CRYPTO_CALLBACKS::hash_abort" + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).hmac_start) as usize - ptr as usize }, + 20usize, + "Offset of field: ESYS_CRYPTO_CALLBACKS::hmac_start" + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).hmac_update) as usize - ptr as usize }, + 24usize, + "Offset of field: ESYS_CRYPTO_CALLBACKS::hmac_update" + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).hmac_finish) as usize - ptr as usize }, + 28usize, + "Offset of field: ESYS_CRYPTO_CALLBACKS::hmac_finish" + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).hmac_abort) as usize - ptr as usize }, + 32usize, + "Offset of field: ESYS_CRYPTO_CALLBACKS::hmac_abort" + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).get_random2b) as usize - ptr as usize }, + 36usize, + "Offset of field: ESYS_CRYPTO_CALLBACKS::get_random2b" + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).get_ecdh_point) as usize - ptr as usize }, + 40usize, + "Offset of field: ESYS_CRYPTO_CALLBACKS::get_ecdh_point" + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).aes_encrypt) as usize - ptr as usize }, + 44usize, + "Offset of field: ESYS_CRYPTO_CALLBACKS::aes_encrypt" + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).aes_decrypt) as usize - ptr as usize }, + 48usize, + "Offset of field: ESYS_CRYPTO_CALLBACKS::aes_decrypt" + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).init) as usize - ptr as usize }, + 52usize, + "Offset of field: ESYS_CRYPTO_CALLBACKS::init" + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).userdata) as usize - ptr as usize }, + 56usize, + "Offset of field: ESYS_CRYPTO_CALLBACKS::userdata" + ); +} +impl Default for ESYS_CRYPTO_CALLBACKS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +extern "C" { + pub fn Esys_Initialize( + esys_context: *mut *mut ESYS_CONTEXT, tcti: *mut TSS2_TCTI_CONTEXT, abiVersion: *mut TSS2_ABI_VERSION, ) -> TSS2_RC; @@ -11408,6 +10077,95 @@ extern "C" { extern "C" { pub fn Esys_ACT_SetTimeout_Finish(esysContext: *mut ESYS_CONTEXT) -> TSS2_RC; } +extern "C" { + pub fn Esys_AC_GetCapability_Async( + esysContext: *mut ESYS_CONTEXT, + optionalSession1: ESYS_TR, + optionalSession2: ESYS_TR, + optionalSession3: ESYS_TR, + ac: ESYS_TR, + capability: TPM_AT, + count: UINT32, + ) -> TSS2_RC; +} +extern "C" { + pub fn Esys_AC_GetCapability_Finish( + esysContext: *mut ESYS_CONTEXT, + moreData: *mut TPMI_YES_NO, + capabilityData: *mut *mut TPML_AC_CAPABILITIES, + ) -> TSS2_RC; +} +extern "C" { + pub fn Esys_AC_GetCapability( + esysContext: *mut ESYS_CONTEXT, + optionalSession1: ESYS_TR, + optionalSession2: ESYS_TR, + optionalSession3: ESYS_TR, + ac: ESYS_TR, + capability: TPM_AT, + count: UINT32, + moreData: *mut TPMI_YES_NO, + capabilityData: *mut *mut TPML_AC_CAPABILITIES, + ) -> TSS2_RC; +} +extern "C" { + pub fn Esys_AC_Send_Async( + esysContext: *mut ESYS_CONTEXT, + sendObject: ESYS_TR, + nvAuthHandle: ESYS_TR, + optionalSession1: ESYS_TR, + optionalSession2: ESYS_TR, + optionalSession3: ESYS_TR, + ac: ESYS_TR, + acDataIn: *mut TPM2B_MAX_BUFFER, + ) -> TSS2_RC; +} +extern "C" { + pub fn Esys_AC_Send_Finish( + esysContext: *mut ESYS_CONTEXT, + acDataOut: *mut *mut TPMS_AC_OUTPUT, + ) -> TSS2_RC; +} +extern "C" { + pub fn Esys_AC_Send( + esysContext: *mut ESYS_CONTEXT, + sendObject: ESYS_TR, + nvAuthHandle: ESYS_TR, + optionalSession1: ESYS_TR, + optionalSession2: ESYS_TR, + optionalSession3: ESYS_TR, + ac: ESYS_TR, + acDataIn: *mut TPM2B_MAX_BUFFER, + acDataOut: *mut *mut TPMS_AC_OUTPUT, + ) -> TSS2_RC; +} +extern "C" { + pub fn Esys_Policy_AC_SendSelect_Async( + esysContext: *mut ESYS_CONTEXT, + policySession1: ESYS_TR, + optionalSession2: ESYS_TR, + optionalSession3: ESYS_TR, + objectName: *mut TPM2B_NAME, + authHandleName: *mut TPM2B_NAME, + acName: *mut TPM2B_NAME, + includeObject: TPMI_YES_NO, + ) -> TSS2_RC; +} +extern "C" { + pub fn Esys_Policy_AC_SendSelect_Finish(esysContext: *mut ESYS_CONTEXT) -> TSS2_RC; +} +extern "C" { + pub fn Esys_Policy_AC_SendSelect( + esysContext: *mut ESYS_CONTEXT, + policySession1: ESYS_TR, + optionalSession2: ESYS_TR, + optionalSession3: ESYS_TR, + objectName: *mut TPM2B_NAME, + authHandleName: *mut TPM2B_NAME, + acName: *mut TPM2B_NAME, + includeObject: TPMI_YES_NO, + ) -> TSS2_RC; +} extern "C" { pub fn Esys_MakeCredential( esysContext: *mut ESYS_CONTEXT, @@ -11937,6 +10695,35 @@ extern "C" { outHMAC: *mut *mut TPM2B_DIGEST, ) -> TSS2_RC; } +extern "C" { + pub fn Esys_MAC_Async( + esysContext: *mut ESYS_CONTEXT, + handle: ESYS_TR, + handleSession1: ESYS_TR, + optionalSession2: ESYS_TR, + optionalSession3: ESYS_TR, + buffer: *const TPM2B_MAX_BUFFER, + inScheme: TPMI_ALG_MAC_SCHEME, + ) -> TSS2_RC; +} +extern "C" { + pub fn Esys_MAC_Finish( + esysContext: *mut ESYS_CONTEXT, + outMAC: *mut *mut TPM2B_DIGEST, + ) -> TSS2_RC; +} +extern "C" { + pub fn Esys_MAC( + esysContext: *mut ESYS_CONTEXT, + handle: ESYS_TR, + handleSession1: ESYS_TR, + optionalSession2: ESYS_TR, + optionalSession3: ESYS_TR, + buffer: *const TPM2B_MAX_BUFFER, + inScheme: TPMI_ALG_MAC_SCHEME, + outMAC: *mut *mut TPM2B_DIGEST, + ) -> TSS2_RC; +} extern "C" { pub fn Esys_GetRandom( esysContext: *mut ESYS_CONTEXT, @@ -12012,6 +10799,35 @@ extern "C" { sequenceHandle: *mut ESYS_TR, ) -> TSS2_RC; } +extern "C" { + pub fn Esys_MAC_Start( + esysContext: *mut ESYS_CONTEXT, + handle: ESYS_TR, + handleSession1: ESYS_TR, + optionalSession2: ESYS_TR, + optionalSession3: ESYS_TR, + auth: *const TPM2B_AUTH, + inScheme: TPMI_ALG_MAC_SCHEME, + sequenceHandle: *mut ESYS_TR, + ) -> TSS2_RC; +} +extern "C" { + pub fn Esys_MAC_Start_Async( + esysContext: *mut ESYS_CONTEXT, + handle: ESYS_TR, + handleSession1: ESYS_TR, + optionalSession2: ESYS_TR, + optionalSession3: ESYS_TR, + auth: *const TPM2B_AUTH, + inScheme: TPMI_ALG_MAC_SCHEME, + ) -> TSS2_RC; +} +extern "C" { + pub fn Esys_MAC_Start_Finish( + esysContext: *mut ESYS_CONTEXT, + sequenceHandle: *mut ESYS_TR, + ) -> TSS2_RC; +} extern "C" { pub fn Esys_HashSequenceStart( esysContext: *mut ESYS_CONTEXT, @@ -14183,6 +12999,12 @@ extern "C" { sys_context: *mut *mut TSS2_SYS_CONTEXT, ) -> TSS2_RC; } +extern "C" { + pub fn Esys_SetCryptoCallbacks( + esysContext: *mut ESYS_CONTEXT, + callbacks: *mut ESYS_CRYPTO_CALLBACKS, + ) -> TSS2_RC; +} pub type __gwchar_t = ::std::os::raw::c_uint; #[repr(C)] #[derive(Debug, Default, Copy, Clone)] @@ -14197,32 +13019,22 @@ fn bindgen_test_layout_imaxdiv_t() { assert_eq!( ::std::mem::size_of::(), 16usize, - concat!("Size of: ", stringify!(imaxdiv_t)) + "Size of imaxdiv_t" ); assert_eq!( ::std::mem::align_of::(), 8usize, - concat!("Alignment of ", stringify!(imaxdiv_t)) + "Alignment of imaxdiv_t" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).quot) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(imaxdiv_t), - "::", - stringify!(quot) - ) + "Offset of field: imaxdiv_t::quot" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).rem) as usize - ptr as usize }, 8usize, - concat!( - "Offset of field: ", - stringify!(imaxdiv_t), - "::", - stringify!(rem) - ) + "Offset of field: imaxdiv_t::rem" ); } extern "C" { @@ -14272,35 +13084,21 @@ pub struct div_t { fn bindgen_test_layout_div_t() { const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 8usize, - concat!("Size of: ", stringify!(div_t)) - ); + assert_eq!(::std::mem::size_of::(), 8usize, "Size of div_t"); assert_eq!( ::std::mem::align_of::(), 4usize, - concat!("Alignment of ", stringify!(div_t)) + "Alignment of div_t" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).quot) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(div_t), - "::", - stringify!(quot) - ) + "Offset of field: div_t::quot" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).rem) as usize - ptr as usize }, 4usize, - concat!( - "Offset of field: ", - stringify!(div_t), - "::", - stringify!(rem) - ) + "Offset of field: div_t::rem" ); } #[repr(C)] @@ -14313,35 +13111,21 @@ pub struct ldiv_t { fn bindgen_test_layout_ldiv_t() { const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 8usize, - concat!("Size of: ", stringify!(ldiv_t)) - ); + assert_eq!(::std::mem::size_of::(), 8usize, "Size of ldiv_t"); assert_eq!( ::std::mem::align_of::(), 4usize, - concat!("Alignment of ", stringify!(ldiv_t)) + "Alignment of ldiv_t" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).quot) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(ldiv_t), - "::", - stringify!(quot) - ) + "Offset of field: ldiv_t::quot" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).rem) as usize - ptr as usize }, 4usize, - concat!( - "Offset of field: ", - stringify!(ldiv_t), - "::", - stringify!(rem) - ) + "Offset of field: ldiv_t::rem" ); } #[repr(C)] @@ -14354,35 +13138,21 @@ pub struct lldiv_t { fn bindgen_test_layout_lldiv_t() { const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 16usize, - concat!("Size of: ", stringify!(lldiv_t)) - ); + assert_eq!(::std::mem::size_of::(), 16usize, "Size of lldiv_t"); assert_eq!( ::std::mem::align_of::(), 8usize, - concat!("Alignment of ", stringify!(lldiv_t)) + "Alignment of lldiv_t" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).quot) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(lldiv_t), - "::", - stringify!(quot) - ) + "Offset of field: lldiv_t::quot" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).rem) as usize - ptr as usize }, 8usize, - concat!( - "Offset of field: ", - stringify!(lldiv_t), - "::", - stringify!(rem) - ) + "Offset of field: lldiv_t::rem" ); } extern "C" { @@ -14511,22 +13281,17 @@ fn bindgen_test_layout___sigset_t() { assert_eq!( ::std::mem::size_of::<__sigset_t>(), 128usize, - concat!("Size of: ", stringify!(__sigset_t)) + "Size of __sigset_t" ); assert_eq!( ::std::mem::align_of::<__sigset_t>(), 4usize, - concat!("Alignment of ", stringify!(__sigset_t)) + "Alignment of __sigset_t" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__val) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(__sigset_t), - "::", - stringify!(__val) - ) + "Offset of field: __sigset_t::__val" ); } pub type sigset_t = __sigset_t; @@ -14540,35 +13305,21 @@ pub struct timeval { fn bindgen_test_layout_timeval() { const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 8usize, - concat!("Size of: ", stringify!(timeval)) - ); + assert_eq!(::std::mem::size_of::(), 8usize, "Size of timeval"); assert_eq!( ::std::mem::align_of::(), 4usize, - concat!("Alignment of ", stringify!(timeval)) + "Alignment of timeval" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).tv_sec) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(timeval), - "::", - stringify!(tv_sec) - ) + "Offset of field: timeval::tv_sec" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).tv_usec) as usize - ptr as usize }, 4usize, - concat!( - "Offset of field: ", - stringify!(timeval), - "::", - stringify!(tv_usec) - ) + "Offset of field: timeval::tv_usec" ); } #[repr(C)] @@ -14584,32 +13335,22 @@ fn bindgen_test_layout_timespec() { assert_eq!( ::std::mem::size_of::(), 8usize, - concat!("Size of: ", stringify!(timespec)) + "Size of timespec" ); assert_eq!( ::std::mem::align_of::(), 4usize, - concat!("Alignment of ", stringify!(timespec)) + "Alignment of timespec" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).tv_sec) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(timespec), - "::", - stringify!(tv_sec) - ) + "Offset of field: timespec::tv_sec" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).tv_nsec) as usize - ptr as usize }, 4usize, - concat!( - "Offset of field: ", - stringify!(timespec), - "::", - stringify!(tv_nsec) - ) + "Offset of field: timespec::tv_nsec" ); } pub type suseconds_t = __suseconds_t; @@ -14623,25 +13364,16 @@ pub struct fd_set { fn bindgen_test_layout_fd_set() { const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 128usize, - concat!("Size of: ", stringify!(fd_set)) - ); + assert_eq!(::std::mem::size_of::(), 128usize, "Size of fd_set"); assert_eq!( ::std::mem::align_of::(), 4usize, - concat!("Alignment of ", stringify!(fd_set)) + "Alignment of fd_set" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__fds_bits) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(fd_set), - "::", - stringify!(__fds_bits) - ) + "Offset of field: fd_set::__fds_bits" ); } pub type fd_mask = __fd_mask; @@ -14688,35 +13420,22 @@ fn bindgen_test_layout___atomic_wide_counter__bindgen_ty_1() { assert_eq!( ::std::mem::size_of::<__atomic_wide_counter__bindgen_ty_1>(), 8usize, - concat!("Size of: ", stringify!(__atomic_wide_counter__bindgen_ty_1)) + "Size of __atomic_wide_counter__bindgen_ty_1" ); assert_eq!( ::std::mem::align_of::<__atomic_wide_counter__bindgen_ty_1>(), 4usize, - concat!( - "Alignment of ", - stringify!(__atomic_wide_counter__bindgen_ty_1) - ) + "Alignment of __atomic_wide_counter__bindgen_ty_1" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__low) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(__atomic_wide_counter__bindgen_ty_1), - "::", - stringify!(__low) - ) + "Offset of field: __atomic_wide_counter__bindgen_ty_1::__low" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__high) as usize - ptr as usize }, 4usize, - concat!( - "Offset of field: ", - stringify!(__atomic_wide_counter__bindgen_ty_1), - "::", - stringify!(__high) - ) + "Offset of field: __atomic_wide_counter__bindgen_ty_1::__high" ); } #[test] @@ -14727,32 +13446,22 @@ fn bindgen_test_layout___atomic_wide_counter() { assert_eq!( ::std::mem::size_of::<__atomic_wide_counter>(), 8usize, - concat!("Size of: ", stringify!(__atomic_wide_counter)) + "Size of __atomic_wide_counter" ); assert_eq!( ::std::mem::align_of::<__atomic_wide_counter>(), 8usize, - concat!("Alignment of ", stringify!(__atomic_wide_counter)) + "Alignment of __atomic_wide_counter" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__value64) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(__atomic_wide_counter), - "::", - stringify!(__value64) - ) + "Offset of field: __atomic_wide_counter::__value64" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__value32) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(__atomic_wide_counter), - "::", - stringify!(__value32) - ) + "Offset of field: __atomic_wide_counter::__value32" ); } impl Default for __atomic_wide_counter { @@ -14778,32 +13487,22 @@ fn bindgen_test_layout___pthread_internal_list() { assert_eq!( ::std::mem::size_of::<__pthread_internal_list>(), 8usize, - concat!("Size of: ", stringify!(__pthread_internal_list)) + "Size of __pthread_internal_list" ); assert_eq!( ::std::mem::align_of::<__pthread_internal_list>(), 4usize, - concat!("Alignment of ", stringify!(__pthread_internal_list)) + "Alignment of __pthread_internal_list" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__prev) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(__pthread_internal_list), - "::", - stringify!(__prev) - ) + "Offset of field: __pthread_internal_list::__prev" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__next) as usize - ptr as usize }, 4usize, - concat!( - "Offset of field: ", - stringify!(__pthread_internal_list), - "::", - stringify!(__next) - ) + "Offset of field: __pthread_internal_list::__next" ); } impl Default for __pthread_internal_list { @@ -14829,22 +13528,17 @@ fn bindgen_test_layout___pthread_internal_slist() { assert_eq!( ::std::mem::size_of::<__pthread_internal_slist>(), 4usize, - concat!("Size of: ", stringify!(__pthread_internal_slist)) + "Size of __pthread_internal_slist" ); assert_eq!( ::std::mem::align_of::<__pthread_internal_slist>(), 4usize, - concat!("Alignment of ", stringify!(__pthread_internal_slist)) + "Alignment of __pthread_internal_slist" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__next) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(__pthread_internal_slist), - "::", - stringify!(__next) - ) + "Offset of field: __pthread_internal_slist::__next" ); } impl Default for __pthread_internal_slist { @@ -14881,32 +13575,22 @@ fn bindgen_test_layout___pthread_mutex_s__bindgen_ty_1() { assert_eq!( ::std::mem::size_of::<__pthread_mutex_s__bindgen_ty_1>(), 4usize, - concat!("Size of: ", stringify!(__pthread_mutex_s__bindgen_ty_1)) + "Size of __pthread_mutex_s__bindgen_ty_1" ); assert_eq!( ::std::mem::align_of::<__pthread_mutex_s__bindgen_ty_1>(), 4usize, - concat!("Alignment of ", stringify!(__pthread_mutex_s__bindgen_ty_1)) + "Alignment of __pthread_mutex_s__bindgen_ty_1" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__spins) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(__pthread_mutex_s__bindgen_ty_1), - "::", - stringify!(__spins) - ) + "Offset of field: __pthread_mutex_s__bindgen_ty_1::__spins" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__list) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(__pthread_mutex_s__bindgen_ty_1), - "::", - stringify!(__list) - ) + "Offset of field: __pthread_mutex_s__bindgen_ty_1::__list" ); } impl Default for __pthread_mutex_s__bindgen_ty_1 { @@ -14925,62 +13609,37 @@ fn bindgen_test_layout___pthread_mutex_s() { assert_eq!( ::std::mem::size_of::<__pthread_mutex_s>(), 24usize, - concat!("Size of: ", stringify!(__pthread_mutex_s)) + "Size of __pthread_mutex_s" ); assert_eq!( ::std::mem::align_of::<__pthread_mutex_s>(), 4usize, - concat!("Alignment of ", stringify!(__pthread_mutex_s)) + "Alignment of __pthread_mutex_s" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__lock) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(__pthread_mutex_s), - "::", - stringify!(__lock) - ) + "Offset of field: __pthread_mutex_s::__lock" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__count) as usize - ptr as usize }, 4usize, - concat!( - "Offset of field: ", - stringify!(__pthread_mutex_s), - "::", - stringify!(__count) - ) + "Offset of field: __pthread_mutex_s::__count" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__owner) as usize - ptr as usize }, 8usize, - concat!( - "Offset of field: ", - stringify!(__pthread_mutex_s), - "::", - stringify!(__owner) - ) + "Offset of field: __pthread_mutex_s::__owner" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__kind) as usize - ptr as usize }, 12usize, - concat!( - "Offset of field: ", - stringify!(__pthread_mutex_s), - "::", - stringify!(__kind) - ) + "Offset of field: __pthread_mutex_s::__kind" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__nusers) as usize - ptr as usize }, 16usize, - concat!( - "Offset of field: ", - stringify!(__pthread_mutex_s), - "::", - stringify!(__nusers) - ) + "Offset of field: __pthread_mutex_s::__nusers" ); } impl Default for __pthread_mutex_s { @@ -15015,122 +13674,67 @@ fn bindgen_test_layout___pthread_rwlock_arch_t() { assert_eq!( ::std::mem::size_of::<__pthread_rwlock_arch_t>(), 32usize, - concat!("Size of: ", stringify!(__pthread_rwlock_arch_t)) + "Size of __pthread_rwlock_arch_t" ); assert_eq!( ::std::mem::align_of::<__pthread_rwlock_arch_t>(), 4usize, - concat!("Alignment of ", stringify!(__pthread_rwlock_arch_t)) + "Alignment of __pthread_rwlock_arch_t" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__readers) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(__pthread_rwlock_arch_t), - "::", - stringify!(__readers) - ) + "Offset of field: __pthread_rwlock_arch_t::__readers" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__writers) as usize - ptr as usize }, 4usize, - concat!( - "Offset of field: ", - stringify!(__pthread_rwlock_arch_t), - "::", - stringify!(__writers) - ) + "Offset of field: __pthread_rwlock_arch_t::__writers" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__wrphase_futex) as usize - ptr as usize }, 8usize, - concat!( - "Offset of field: ", - stringify!(__pthread_rwlock_arch_t), - "::", - stringify!(__wrphase_futex) - ) + "Offset of field: __pthread_rwlock_arch_t::__wrphase_futex" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__writers_futex) as usize - ptr as usize }, 12usize, - concat!( - "Offset of field: ", - stringify!(__pthread_rwlock_arch_t), - "::", - stringify!(__writers_futex) - ) + "Offset of field: __pthread_rwlock_arch_t::__writers_futex" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__pad3) as usize - ptr as usize }, 16usize, - concat!( - "Offset of field: ", - stringify!(__pthread_rwlock_arch_t), - "::", - stringify!(__pad3) - ) + "Offset of field: __pthread_rwlock_arch_t::__pad3" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__pad4) as usize - ptr as usize }, 20usize, - concat!( - "Offset of field: ", - stringify!(__pthread_rwlock_arch_t), - "::", - stringify!(__pad4) - ) + "Offset of field: __pthread_rwlock_arch_t::__pad4" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__flags) as usize - ptr as usize }, 24usize, - concat!( - "Offset of field: ", - stringify!(__pthread_rwlock_arch_t), - "::", - stringify!(__flags) - ) + "Offset of field: __pthread_rwlock_arch_t::__flags" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__shared) as usize - ptr as usize }, 25usize, - concat!( - "Offset of field: ", - stringify!(__pthread_rwlock_arch_t), - "::", - stringify!(__shared) - ) + "Offset of field: __pthread_rwlock_arch_t::__shared" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__pad1) as usize - ptr as usize }, 26usize, - concat!( - "Offset of field: ", - stringify!(__pthread_rwlock_arch_t), - "::", - stringify!(__pad1) - ) + "Offset of field: __pthread_rwlock_arch_t::__pad1" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__pad2) as usize - ptr as usize }, 27usize, - concat!( - "Offset of field: ", - stringify!(__pthread_rwlock_arch_t), - "::", - stringify!(__pad2) - ) + "Offset of field: __pthread_rwlock_arch_t::__pad2" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__cur_writer) as usize - ptr as usize }, 28usize, - concat!( - "Offset of field: ", - stringify!(__pthread_rwlock_arch_t), - "::", - stringify!(__cur_writer) - ) + "Offset of field: __pthread_rwlock_arch_t::__cur_writer" ); } #[repr(C)] @@ -15151,82 +13755,47 @@ fn bindgen_test_layout___pthread_cond_s() { assert_eq!( ::std::mem::size_of::<__pthread_cond_s>(), 48usize, - concat!("Size of: ", stringify!(__pthread_cond_s)) + "Size of __pthread_cond_s" ); assert_eq!( ::std::mem::align_of::<__pthread_cond_s>(), 8usize, - concat!("Alignment of ", stringify!(__pthread_cond_s)) + "Alignment of __pthread_cond_s" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__wseq) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(__pthread_cond_s), - "::", - stringify!(__wseq) - ) + "Offset of field: __pthread_cond_s::__wseq" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__g1_start) as usize - ptr as usize }, 8usize, - concat!( - "Offset of field: ", - stringify!(__pthread_cond_s), - "::", - stringify!(__g1_start) - ) + "Offset of field: __pthread_cond_s::__g1_start" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__g_refs) as usize - ptr as usize }, 16usize, - concat!( - "Offset of field: ", - stringify!(__pthread_cond_s), - "::", - stringify!(__g_refs) - ) + "Offset of field: __pthread_cond_s::__g_refs" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__g_size) as usize - ptr as usize }, 24usize, - concat!( - "Offset of field: ", - stringify!(__pthread_cond_s), - "::", - stringify!(__g_size) - ) + "Offset of field: __pthread_cond_s::__g_size" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__g1_orig_size) as usize - ptr as usize }, 32usize, - concat!( - "Offset of field: ", - stringify!(__pthread_cond_s), - "::", - stringify!(__g1_orig_size) - ) + "Offset of field: __pthread_cond_s::__g1_orig_size" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__wrefs) as usize - ptr as usize }, 36usize, - concat!( - "Offset of field: ", - stringify!(__pthread_cond_s), - "::", - stringify!(__wrefs) - ) + "Offset of field: __pthread_cond_s::__wrefs" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__g_signals) as usize - ptr as usize }, 40usize, - concat!( - "Offset of field: ", - stringify!(__pthread_cond_s), - "::", - stringify!(__g_signals) - ) + "Offset of field: __pthread_cond_s::__g_signals" ); } impl Default for __pthread_cond_s { @@ -15252,22 +13821,17 @@ fn bindgen_test_layout___once_flag() { assert_eq!( ::std::mem::size_of::<__once_flag>(), 4usize, - concat!("Size of: ", stringify!(__once_flag)) + "Size of __once_flag" ); assert_eq!( ::std::mem::align_of::<__once_flag>(), 4usize, - concat!("Alignment of ", stringify!(__once_flag)) + "Alignment of __once_flag" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__data) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(__once_flag), - "::", - stringify!(__data) - ) + "Offset of field: __once_flag::__data" ); } pub type pthread_t = ::std::os::raw::c_ulong; @@ -15284,32 +13848,22 @@ fn bindgen_test_layout_pthread_mutexattr_t() { assert_eq!( ::std::mem::size_of::(), 4usize, - concat!("Size of: ", stringify!(pthread_mutexattr_t)) + "Size of pthread_mutexattr_t" ); assert_eq!( ::std::mem::align_of::(), 4usize, - concat!("Alignment of ", stringify!(pthread_mutexattr_t)) + "Alignment of pthread_mutexattr_t" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__size) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(pthread_mutexattr_t), - "::", - stringify!(__size) - ) + "Offset of field: pthread_mutexattr_t::__size" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__align) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(pthread_mutexattr_t), - "::", - stringify!(__align) - ) + "Offset of field: pthread_mutexattr_t::__align" ); } impl Default for pthread_mutexattr_t { @@ -15334,32 +13888,22 @@ fn bindgen_test_layout_pthread_condattr_t() { assert_eq!( ::std::mem::size_of::(), 4usize, - concat!("Size of: ", stringify!(pthread_condattr_t)) + "Size of pthread_condattr_t" ); assert_eq!( ::std::mem::align_of::(), 4usize, - concat!("Alignment of ", stringify!(pthread_condattr_t)) + "Alignment of pthread_condattr_t" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__size) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(pthread_condattr_t), - "::", - stringify!(__size) - ) + "Offset of field: pthread_condattr_t::__size" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__align) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(pthread_condattr_t), - "::", - stringify!(__align) - ) + "Offset of field: pthread_condattr_t::__align" ); } impl Default for pthread_condattr_t { @@ -15386,32 +13930,22 @@ fn bindgen_test_layout_pthread_attr_t() { assert_eq!( ::std::mem::size_of::(), 36usize, - concat!("Size of: ", stringify!(pthread_attr_t)) + "Size of pthread_attr_t" ); assert_eq!( ::std::mem::align_of::(), 4usize, - concat!("Alignment of ", stringify!(pthread_attr_t)) + "Alignment of pthread_attr_t" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__size) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(pthread_attr_t), - "::", - stringify!(__size) - ) + "Offset of field: pthread_attr_t::__size" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__align) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(pthread_attr_t), - "::", - stringify!(__align) - ) + "Offset of field: pthread_attr_t::__align" ); } impl Default for pthread_attr_t { @@ -15437,42 +13971,27 @@ fn bindgen_test_layout_pthread_mutex_t() { assert_eq!( ::std::mem::size_of::(), 24usize, - concat!("Size of: ", stringify!(pthread_mutex_t)) + "Size of pthread_mutex_t" ); assert_eq!( ::std::mem::align_of::(), 4usize, - concat!("Alignment of ", stringify!(pthread_mutex_t)) + "Alignment of pthread_mutex_t" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__data) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(pthread_mutex_t), - "::", - stringify!(__data) - ) + "Offset of field: pthread_mutex_t::__data" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__size) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(pthread_mutex_t), - "::", - stringify!(__size) - ) + "Offset of field: pthread_mutex_t::__size" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__align) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(pthread_mutex_t), - "::", - stringify!(__align) - ) + "Offset of field: pthread_mutex_t::__align" ); } impl Default for pthread_mutex_t { @@ -15498,42 +14017,27 @@ fn bindgen_test_layout_pthread_cond_t() { assert_eq!( ::std::mem::size_of::(), 48usize, - concat!("Size of: ", stringify!(pthread_cond_t)) + "Size of pthread_cond_t" ); assert_eq!( ::std::mem::align_of::(), 8usize, - concat!("Alignment of ", stringify!(pthread_cond_t)) + "Alignment of pthread_cond_t" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__data) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(pthread_cond_t), - "::", - stringify!(__data) - ) + "Offset of field: pthread_cond_t::__data" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__size) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(pthread_cond_t), - "::", - stringify!(__size) - ) + "Offset of field: pthread_cond_t::__size" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__align) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(pthread_cond_t), - "::", - stringify!(__align) - ) + "Offset of field: pthread_cond_t::__align" ); } impl Default for pthread_cond_t { @@ -15559,42 +14063,27 @@ fn bindgen_test_layout_pthread_rwlock_t() { assert_eq!( ::std::mem::size_of::(), 32usize, - concat!("Size of: ", stringify!(pthread_rwlock_t)) + "Size of pthread_rwlock_t" ); assert_eq!( ::std::mem::align_of::(), 4usize, - concat!("Alignment of ", stringify!(pthread_rwlock_t)) + "Alignment of pthread_rwlock_t" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__data) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(pthread_rwlock_t), - "::", - stringify!(__data) - ) + "Offset of field: pthread_rwlock_t::__data" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__size) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(pthread_rwlock_t), - "::", - stringify!(__size) - ) + "Offset of field: pthread_rwlock_t::__size" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__align) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(pthread_rwlock_t), - "::", - stringify!(__align) - ) + "Offset of field: pthread_rwlock_t::__align" ); } impl Default for pthread_rwlock_t { @@ -15619,32 +14108,22 @@ fn bindgen_test_layout_pthread_rwlockattr_t() { assert_eq!( ::std::mem::size_of::(), 8usize, - concat!("Size of: ", stringify!(pthread_rwlockattr_t)) + "Size of pthread_rwlockattr_t" ); assert_eq!( ::std::mem::align_of::(), 4usize, - concat!("Alignment of ", stringify!(pthread_rwlockattr_t)) + "Alignment of pthread_rwlockattr_t" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__size) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(pthread_rwlockattr_t), - "::", - stringify!(__size) - ) + "Offset of field: pthread_rwlockattr_t::__size" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__align) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(pthread_rwlockattr_t), - "::", - stringify!(__align) - ) + "Offset of field: pthread_rwlockattr_t::__align" ); } impl Default for pthread_rwlockattr_t { @@ -15670,32 +14149,22 @@ fn bindgen_test_layout_pthread_barrier_t() { assert_eq!( ::std::mem::size_of::(), 20usize, - concat!("Size of: ", stringify!(pthread_barrier_t)) + "Size of pthread_barrier_t" ); assert_eq!( ::std::mem::align_of::(), 4usize, - concat!("Alignment of ", stringify!(pthread_barrier_t)) + "Alignment of pthread_barrier_t" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__size) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(pthread_barrier_t), - "::", - stringify!(__size) - ) + "Offset of field: pthread_barrier_t::__size" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__align) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(pthread_barrier_t), - "::", - stringify!(__align) - ) + "Offset of field: pthread_barrier_t::__align" ); } impl Default for pthread_barrier_t { @@ -15721,32 +14190,22 @@ fn bindgen_test_layout_pthread_barrierattr_t() { assert_eq!( ::std::mem::size_of::(), 4usize, - concat!("Size of: ", stringify!(pthread_barrierattr_t)) + "Size of pthread_barrierattr_t" ); assert_eq!( ::std::mem::align_of::(), 4usize, - concat!("Alignment of ", stringify!(pthread_barrierattr_t)) + "Alignment of pthread_barrierattr_t" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__size) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(pthread_barrierattr_t), - "::", - stringify!(__size) - ) + "Offset of field: pthread_barrierattr_t::__size" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__align) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(pthread_barrierattr_t), - "::", - stringify!(__align) - ) + "Offset of field: pthread_barrierattr_t::__align" ); } impl Default for pthread_barrierattr_t { @@ -15792,82 +14251,47 @@ fn bindgen_test_layout_random_data() { assert_eq!( ::std::mem::size_of::(), 28usize, - concat!("Size of: ", stringify!(random_data)) + "Size of random_data" ); assert_eq!( ::std::mem::align_of::(), 4usize, - concat!("Alignment of ", stringify!(random_data)) + "Alignment of random_data" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).fptr) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(random_data), - "::", - stringify!(fptr) - ) + "Offset of field: random_data::fptr" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).rptr) as usize - ptr as usize }, 4usize, - concat!( - "Offset of field: ", - stringify!(random_data), - "::", - stringify!(rptr) - ) + "Offset of field: random_data::rptr" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).state) as usize - ptr as usize }, 8usize, - concat!( - "Offset of field: ", - stringify!(random_data), - "::", - stringify!(state) - ) + "Offset of field: random_data::state" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).rand_type) as usize - ptr as usize }, 12usize, - concat!( - "Offset of field: ", - stringify!(random_data), - "::", - stringify!(rand_type) - ) + "Offset of field: random_data::rand_type" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).rand_deg) as usize - ptr as usize }, 16usize, - concat!( - "Offset of field: ", - stringify!(random_data), - "::", - stringify!(rand_deg) - ) + "Offset of field: random_data::rand_deg" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).rand_sep) as usize - ptr as usize }, 20usize, - concat!( - "Offset of field: ", - stringify!(random_data), - "::", - stringify!(rand_sep) - ) + "Offset of field: random_data::rand_sep" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).end_ptr) as usize - ptr as usize }, 24usize, - concat!( - "Offset of field: ", - stringify!(random_data), - "::", - stringify!(end_ptr) - ) + "Offset of field: random_data::end_ptr" ); } impl Default for random_data { @@ -15954,62 +14378,37 @@ fn bindgen_test_layout_drand48_data() { assert_eq!( ::std::mem::size_of::(), 24usize, - concat!("Size of: ", stringify!(drand48_data)) + "Size of drand48_data" ); assert_eq!( ::std::mem::align_of::(), 8usize, - concat!("Alignment of ", stringify!(drand48_data)) + "Alignment of drand48_data" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__x) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(drand48_data), - "::", - stringify!(__x) - ) + "Offset of field: drand48_data::__x" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__old_x) as usize - ptr as usize }, 6usize, - concat!( - "Offset of field: ", - stringify!(drand48_data), - "::", - stringify!(__old_x) - ) + "Offset of field: drand48_data::__old_x" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__c) as usize - ptr as usize }, 12usize, - concat!( - "Offset of field: ", - stringify!(drand48_data), - "::", - stringify!(__c) - ) + "Offset of field: drand48_data::__c" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__init) as usize - ptr as usize }, 14usize, - concat!( - "Offset of field: ", - stringify!(drand48_data), - "::", - stringify!(__init) - ) + "Offset of field: drand48_data::__init" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__a) as usize - ptr as usize }, 16usize, - concat!( - "Offset of field: ", - stringify!(drand48_data), - "::", - stringify!(__a) - ) + "Offset of field: drand48_data::__a" ); } extern "C" { @@ -17212,22 +15611,6 @@ extern "C" { dest: *mut TPMS_ALG_PROPERTY, ) -> TSS2_RC; } -extern "C" { - pub fn Tss2_MU_TPMS_ALGORITHM_DESCRIPTION_Marshal( - src: *const TPMS_ALGORITHM_DESCRIPTION, - buffer: *mut u8, - buffer_size: size_t, - offset: *mut size_t, - ) -> TSS2_RC; -} -extern "C" { - pub fn Tss2_MU_TPMS_ALGORITHM_DESCRIPTION_Unmarshal( - buffer: *const u8, - buffer_size: size_t, - offset: *mut size_t, - dest: *mut TPMS_ALGORITHM_DESCRIPTION, - ) -> TSS2_RC; -} extern "C" { pub fn Tss2_MU_TPMS_TAGGED_PROPERTY_Marshal( src: *const TPMS_TAGGED_PROPERTY, @@ -17964,22 +16347,6 @@ extern "C" { dest: *mut TPML_TAGGED_TPM_PROPERTY, ) -> TSS2_RC; } -extern "C" { - pub fn Tss2_MU_TPML_INTEL_PTT_PROPERTY_Marshal( - src: *const TPML_INTEL_PTT_PROPERTY, - buffer: *mut u8, - buffer_size: size_t, - offset: *mut size_t, - ) -> TSS2_RC; -} -extern "C" { - pub fn Tss2_MU_TPML_INTEL_PTT_PROPERTY_Unmarshal( - buffer: *const u8, - buffer_size: size_t, - offset: *mut size_t, - dest: *mut TPML_INTEL_PTT_PROPERTY, - ) -> TSS2_RC; -} extern "C" { pub fn Tss2_MU_TPML_AC_CAPABILITIES_Marshal( src: *const TPML_AC_CAPABILITIES, @@ -18682,3 +17049,35 @@ extern "C" { out: *mut TPMS_EMPTY, ) -> TSS2_RC; } +extern "C" { + pub fn Tss2_MU_TPM2B_MAX_CAP_BUFFER_Marshal( + src: *const TPM2B_MAX_CAP_BUFFER, + buffer: *mut u8, + buffer_size: size_t, + offset: *mut size_t, + ) -> TSS2_RC; +} +extern "C" { + pub fn Tss2_MU_TPM2B_MAX_CAP_BUFFER_Unmarshal( + buffer: *const u8, + buffer_size: size_t, + offset: *mut size_t, + dest: *mut TPM2B_MAX_CAP_BUFFER, + ) -> TSS2_RC; +} +extern "C" { + pub fn Tss2_MU_TPML_INTEL_PTT_PROPERTY_Marshal( + src: *const TPML_INTEL_PTT_PROPERTY, + buffer: *mut u8, + buffer_size: size_t, + offset: *mut size_t, + ) -> TSS2_RC; +} +extern "C" { + pub fn Tss2_MU_TPML_INTEL_PTT_PROPERTY_Unmarshal( + buffer: *const u8, + buffer_size: size_t, + offset: *mut size_t, + dest: *mut TPML_INTEL_PTT_PROPERTY, + ) -> TSS2_RC; +} diff --git a/tss-esapi-sys/src/bindings/x86_64-unknown-linux-gnu.rs b/tss-esapi-sys/src/bindings/x86_64-unknown-linux-gnu.rs index 05d3f51c..ee0ec97a 100644 --- a/tss-esapi-sys/src/bindings/x86_64-unknown-linux-gnu.rs +++ b/tss-esapi-sys/src/bindings/x86_64-unknown-linux-gnu.rs @@ -1,5 +1,5 @@ -/* automatically generated by rust-bindgen 0.69.4 */ -/* TPM2_TSS_VERSION="3.2.2" */ +/* automatically generated by rust-bindgen 0.70.1 */ +/* TPM2_TSS_VERSION="4.0.1" */ pub const _STDINT_H: u32 = 1; pub const _FEATURES_H: u32 = 1; @@ -150,6 +150,7 @@ pub const TSS2_BASE_RC_BAD_KEY: u32 = 50; pub const TSS2_BASE_RC_NO_HANDLE: u32 = 51; pub const TSS2_BASE_RC_NOT_PROVISIONED: u32 = 52; pub const TSS2_BASE_RC_ALREADY_PROVISIONED: u32 = 53; +pub const TSS2_BASE_RC_CALLBACK_NULL: u32 = 54; pub const TSS2_LAYER_IMPLEMENTATION_SPECIFIC_OFFSET: u32 = 63488; pub const TSS2_LEVEL_IMPLEMENTATION_SPECIFIC_SHIFT: u32 = 11; pub const TPM2_MAX_COMMAND_SIZE: u32 = 4096; @@ -242,7 +243,25 @@ pub const ESYS_TR_RH_PLATFORM: u32 = 268; pub const ESYS_TR_RH_PLATFORM_NV: u32 = 269; pub const ESYS_TR_RH_AUTH_FIRST: u32 = 272; pub const ESYS_TR_RH_ACT_FIRST: u32 = 288; +pub const ESYS_TR_RH_ACT_0: u32 = 288; +pub const ESYS_TR_RH_ACT_1: u32 = 289; +pub const ESYS_TR_RH_ACT_2: u32 = 290; +pub const ESYS_TR_RH_ACT_3: u32 = 291; +pub const ESYS_TR_RH_ACT_4: u32 = 292; +pub const ESYS_TR_RH_ACT_5: u32 = 293; +pub const ESYS_TR_RH_ACT_6: u32 = 294; +pub const ESYS_TR_RH_ACT_7: u32 = 295; +pub const ESYS_TR_RH_ACT_8: u32 = 296; +pub const ESYS_TR_RH_ACT_9: u32 = 297; +pub const ESYS_TR_RH_ACT_A: u32 = 298; +pub const ESYS_TR_RH_ACT_B: u32 = 299; +pub const ESYS_TR_RH_ACT_C: u32 = 300; +pub const ESYS_TR_RH_ACT_D: u32 = 301; +pub const ESYS_TR_RH_ACT_E: u32 = 302; +pub const ESYS_TR_RH_ACT_F: u32 = 303; pub const ESYS_TR_RH_ACT_LAST: u32 = 303; +pub const ESYS_TR_RH_AC_FIRST: u32 = 320; +pub const ESYS_TR_RH_AC_LAST: u32 = 65855; pub const _INTTYPES_H: u32 = 1; pub const ____gwchar_t_defined: u32 = 1; pub const __PRI64_PREFIX: &[u8; 2] = b"l\0"; @@ -521,22 +540,17 @@ fn bindgen_test_layout___fsid_t() { assert_eq!( ::std::mem::size_of::<__fsid_t>(), 8usize, - concat!("Size of: ", stringify!(__fsid_t)) + "Size of __fsid_t" ); assert_eq!( ::std::mem::align_of::<__fsid_t>(), 4usize, - concat!("Alignment of ", stringify!(__fsid_t)) + "Alignment of __fsid_t" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__val) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(__fsid_t), - "::", - stringify!(__val) - ) + "Offset of field: __fsid_t::__val" ); } pub type __clock_t = ::std::os::raw::c_long; @@ -612,52 +626,32 @@ fn bindgen_test_layout_TSS2_ABI_VERSION() { assert_eq!( ::std::mem::size_of::(), 16usize, - concat!("Size of: ", stringify!(TSS2_ABI_VERSION)) + "Size of TSS2_ABI_VERSION" ); assert_eq!( ::std::mem::align_of::(), 4usize, - concat!("Alignment of ", stringify!(TSS2_ABI_VERSION)) + "Alignment of TSS2_ABI_VERSION" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).tssCreator) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TSS2_ABI_VERSION), - "::", - stringify!(tssCreator) - ) + "Offset of field: TSS2_ABI_VERSION::tssCreator" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).tssFamily) as usize - ptr as usize }, 4usize, - concat!( - "Offset of field: ", - stringify!(TSS2_ABI_VERSION), - "::", - stringify!(tssFamily) - ) + "Offset of field: TSS2_ABI_VERSION::tssFamily" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).tssLevel) as usize - ptr as usize }, 8usize, - concat!( - "Offset of field: ", - stringify!(TSS2_ABI_VERSION), - "::", - stringify!(tssLevel) - ) + "Offset of field: TSS2_ABI_VERSION::tssLevel" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).tssVersion) as usize - ptr as usize }, 12usize, - concat!( - "Offset of field: ", - stringify!(TSS2_ABI_VERSION), - "::", - stringify!(tssVersion) - ) + "Offset of field: TSS2_ABI_VERSION::tssVersion" ); } pub type TSS2_RC = u32; @@ -699,6 +693,7 @@ pub type TPMA_X509_KEY_USAGE = u32; pub type TPMA_ACT = u32; pub type TPMI_YES_NO = BYTE; pub type TPMI_DH_OBJECT = TPM2_HANDLE; +pub type TPMI_DH_PARENT = TPM2_HANDLE; pub type TPMI_DH_PERSISTENT = TPM2_HANDLE; pub type TPMI_DH_ENTITY = TPM2_HANDLE; pub type TPMI_DH_PCR = TPM2_HANDLE; @@ -735,7 +730,7 @@ pub type TPMI_ALG_CIPHER_MODE = TPM2_ALG_ID; #[repr(C)] #[derive(Debug, Default, Copy, Clone)] pub struct TPMS_EMPTY { - pub empty: [BYTE; 1usize], + pub empty: [UINT8; 1usize], } #[test] fn bindgen_test_layout_TPMS_EMPTY() { @@ -744,69 +739,23 @@ fn bindgen_test_layout_TPMS_EMPTY() { assert_eq!( ::std::mem::size_of::(), 1usize, - concat!("Size of: ", stringify!(TPMS_EMPTY)) + "Size of TPMS_EMPTY" ); assert_eq!( ::std::mem::align_of::(), 1usize, - concat!("Alignment of ", stringify!(TPMS_EMPTY)) + "Alignment of TPMS_EMPTY" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).empty) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMS_EMPTY), - "::", - stringify!(empty) - ) - ); -} -#[repr(C)] -#[derive(Debug, Default, Copy, Clone)] -pub struct TPMS_ALGORITHM_DESCRIPTION { - pub alg: TPM2_ALG_ID, - pub attributes: TPMA_ALGORITHM, -} -#[test] -fn bindgen_test_layout_TPMS_ALGORITHM_DESCRIPTION() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 8usize, - concat!("Size of: ", stringify!(TPMS_ALGORITHM_DESCRIPTION)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(TPMS_ALGORITHM_DESCRIPTION)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).alg) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(TPMS_ALGORITHM_DESCRIPTION), - "::", - stringify!(alg) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).attributes) as usize - ptr as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(TPMS_ALGORITHM_DESCRIPTION), - "::", - stringify!(attributes) - ) + "Offset of field: TPMS_EMPTY::empty" ); } #[repr(C)] #[derive(Copy, Clone)] pub union TPMU_HA { + pub sha: [BYTE; 20usize], pub sha1: [BYTE; 20usize], pub sha256: [BYTE; 32usize], pub sha384: [BYTE; 48usize], @@ -817,65 +766,41 @@ pub union TPMU_HA { fn bindgen_test_layout_TPMU_HA() { const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 64usize, - concat!("Size of: ", stringify!(TPMU_HA)) - ); + assert_eq!(::std::mem::size_of::(), 64usize, "Size of TPMU_HA"); assert_eq!( ::std::mem::align_of::(), 1usize, - concat!("Alignment of ", stringify!(TPMU_HA)) + "Alignment of TPMU_HA" + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).sha) as usize - ptr as usize }, + 0usize, + "Offset of field: TPMU_HA::sha" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).sha1) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_HA), - "::", - stringify!(sha1) - ) + "Offset of field: TPMU_HA::sha1" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).sha256) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_HA), - "::", - stringify!(sha256) - ) + "Offset of field: TPMU_HA::sha256" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).sha384) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_HA), - "::", - stringify!(sha384) - ) + "Offset of field: TPMU_HA::sha384" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).sha512) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_HA), - "::", - stringify!(sha512) - ) + "Offset of field: TPMU_HA::sha512" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).sm3_256) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_HA), - "::", - stringify!(sm3_256) - ) + "Offset of field: TPMU_HA::sm3_256" ); } impl Default for TPMU_HA { @@ -897,35 +822,21 @@ pub struct TPMT_HA { fn bindgen_test_layout_TPMT_HA() { const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 66usize, - concat!("Size of: ", stringify!(TPMT_HA)) - ); + assert_eq!(::std::mem::size_of::(), 66usize, "Size of TPMT_HA"); assert_eq!( ::std::mem::align_of::(), 2usize, - concat!("Alignment of ", stringify!(TPMT_HA)) + "Alignment of TPMT_HA" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).hashAlg) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMT_HA), - "::", - stringify!(hashAlg) - ) + "Offset of field: TPMT_HA::hashAlg" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).digest) as usize - ptr as usize }, 2usize, - concat!( - "Offset of field: ", - stringify!(TPMT_HA), - "::", - stringify!(digest) - ) + "Offset of field: TPMT_HA::digest" ); } impl Default for TPMT_HA { @@ -950,32 +861,22 @@ fn bindgen_test_layout_TPM2B_DIGEST() { assert_eq!( ::std::mem::size_of::(), 66usize, - concat!("Size of: ", stringify!(TPM2B_DIGEST)) + "Size of TPM2B_DIGEST" ); assert_eq!( ::std::mem::align_of::(), 2usize, - concat!("Alignment of ", stringify!(TPM2B_DIGEST)) + "Alignment of TPM2B_DIGEST" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).size) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPM2B_DIGEST), - "::", - stringify!(size) - ) + "Offset of field: TPM2B_DIGEST::size" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).buffer) as usize - ptr as usize }, 2usize, - concat!( - "Offset of field: ", - stringify!(TPM2B_DIGEST), - "::", - stringify!(buffer) - ) + "Offset of field: TPM2B_DIGEST::buffer" ); } impl Default for TPM2B_DIGEST { @@ -1000,32 +901,22 @@ fn bindgen_test_layout_TPM2B_DATA() { assert_eq!( ::std::mem::size_of::(), 66usize, - concat!("Size of: ", stringify!(TPM2B_DATA)) + "Size of TPM2B_DATA" ); assert_eq!( ::std::mem::align_of::(), 2usize, - concat!("Alignment of ", stringify!(TPM2B_DATA)) + "Alignment of TPM2B_DATA" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).size) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPM2B_DATA), - "::", - stringify!(size) - ) + "Offset of field: TPM2B_DATA::size" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).buffer) as usize - ptr as usize }, 2usize, - concat!( - "Offset of field: ", - stringify!(TPM2B_DATA), - "::", - stringify!(buffer) - ) + "Offset of field: TPM2B_DATA::buffer" ); } impl Default for TPM2B_DATA { @@ -1053,32 +944,22 @@ fn bindgen_test_layout_TPM2B_EVENT() { assert_eq!( ::std::mem::size_of::(), 1026usize, - concat!("Size of: ", stringify!(TPM2B_EVENT)) + "Size of TPM2B_EVENT" ); assert_eq!( ::std::mem::align_of::(), 2usize, - concat!("Alignment of ", stringify!(TPM2B_EVENT)) + "Alignment of TPM2B_EVENT" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).size) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPM2B_EVENT), - "::", - stringify!(size) - ) + "Offset of field: TPM2B_EVENT::size" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).buffer) as usize - ptr as usize }, 2usize, - concat!( - "Offset of field: ", - stringify!(TPM2B_EVENT), - "::", - stringify!(buffer) - ) + "Offset of field: TPM2B_EVENT::buffer" ); } impl Default for TPM2B_EVENT { @@ -1103,32 +984,22 @@ fn bindgen_test_layout_TPM2B_MAX_BUFFER() { assert_eq!( ::std::mem::size_of::(), 1026usize, - concat!("Size of: ", stringify!(TPM2B_MAX_BUFFER)) + "Size of TPM2B_MAX_BUFFER" ); assert_eq!( ::std::mem::align_of::(), 2usize, - concat!("Alignment of ", stringify!(TPM2B_MAX_BUFFER)) + "Alignment of TPM2B_MAX_BUFFER" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).size) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPM2B_MAX_BUFFER), - "::", - stringify!(size) - ) + "Offset of field: TPM2B_MAX_BUFFER::size" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).buffer) as usize - ptr as usize }, 2usize, - concat!( - "Offset of field: ", - stringify!(TPM2B_MAX_BUFFER), - "::", - stringify!(buffer) - ) + "Offset of field: TPM2B_MAX_BUFFER::buffer" ); } impl Default for TPM2B_MAX_BUFFER { @@ -1153,32 +1024,22 @@ fn bindgen_test_layout_TPM2B_MAX_NV_BUFFER() { assert_eq!( ::std::mem::size_of::(), 2050usize, - concat!("Size of: ", stringify!(TPM2B_MAX_NV_BUFFER)) + "Size of TPM2B_MAX_NV_BUFFER" ); assert_eq!( ::std::mem::align_of::(), 2usize, - concat!("Alignment of ", stringify!(TPM2B_MAX_NV_BUFFER)) + "Alignment of TPM2B_MAX_NV_BUFFER" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).size) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPM2B_MAX_NV_BUFFER), - "::", - stringify!(size) - ) + "Offset of field: TPM2B_MAX_NV_BUFFER::size" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).buffer) as usize - ptr as usize }, 2usize, - concat!( - "Offset of field: ", - stringify!(TPM2B_MAX_NV_BUFFER), - "::", - stringify!(buffer) - ) + "Offset of field: TPM2B_MAX_NV_BUFFER::buffer" ); } impl Default for TPM2B_MAX_NV_BUFFER { @@ -1204,32 +1065,22 @@ fn bindgen_test_layout_TPM2B_IV() { assert_eq!( ::std::mem::size_of::(), 18usize, - concat!("Size of: ", stringify!(TPM2B_IV)) + "Size of TPM2B_IV" ); assert_eq!( ::std::mem::align_of::(), 2usize, - concat!("Alignment of ", stringify!(TPM2B_IV)) + "Alignment of TPM2B_IV" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).size) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPM2B_IV), - "::", - stringify!(size) - ) + "Offset of field: TPM2B_IV::size" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).buffer) as usize - ptr as usize }, 2usize, - concat!( - "Offset of field: ", - stringify!(TPM2B_IV), - "::", - stringify!(buffer) - ) + "Offset of field: TPM2B_IV::buffer" ); } #[repr(C)] @@ -1245,32 +1096,22 @@ fn bindgen_test_layout_TPMU_NAME() { assert_eq!( ::std::mem::size_of::(), 68usize, - concat!("Size of: ", stringify!(TPMU_NAME)) + "Size of TPMU_NAME" ); assert_eq!( ::std::mem::align_of::(), 4usize, - concat!("Alignment of ", stringify!(TPMU_NAME)) + "Alignment of TPMU_NAME" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).digest) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_NAME), - "::", - stringify!(digest) - ) + "Offset of field: TPMU_NAME::digest" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).handle) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_NAME), - "::", - stringify!(handle) - ) + "Offset of field: TPMU_NAME::handle" ); } impl Default for TPMU_NAME { @@ -1295,32 +1136,22 @@ fn bindgen_test_layout_TPM2B_NAME() { assert_eq!( ::std::mem::size_of::(), 70usize, - concat!("Size of: ", stringify!(TPM2B_NAME)) + "Size of TPM2B_NAME" ); assert_eq!( ::std::mem::align_of::(), 2usize, - concat!("Alignment of ", stringify!(TPM2B_NAME)) + "Alignment of TPM2B_NAME" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).size) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPM2B_NAME), - "::", - stringify!(size) - ) + "Offset of field: TPM2B_NAME::size" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).name) as usize - ptr as usize }, 2usize, - concat!( - "Offset of field: ", - stringify!(TPM2B_NAME), - "::", - stringify!(name) - ) + "Offset of field: TPM2B_NAME::name" ); } impl Default for TPM2B_NAME { @@ -1345,32 +1176,22 @@ fn bindgen_test_layout_TPMS_PCR_SELECT() { assert_eq!( ::std::mem::size_of::(), 5usize, - concat!("Size of: ", stringify!(TPMS_PCR_SELECT)) + "Size of TPMS_PCR_SELECT" ); assert_eq!( ::std::mem::align_of::(), 1usize, - concat!("Alignment of ", stringify!(TPMS_PCR_SELECT)) + "Alignment of TPMS_PCR_SELECT" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).sizeofSelect) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMS_PCR_SELECT), - "::", - stringify!(sizeofSelect) - ) + "Offset of field: TPMS_PCR_SELECT::sizeofSelect" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).pcrSelect) as usize - ptr as usize }, 1usize, - concat!( - "Offset of field: ", - stringify!(TPMS_PCR_SELECT), - "::", - stringify!(pcrSelect) - ) + "Offset of field: TPMS_PCR_SELECT::pcrSelect" ); } #[repr(C)] @@ -1387,42 +1208,27 @@ fn bindgen_test_layout_TPMS_PCR_SELECTION() { assert_eq!( ::std::mem::size_of::(), 8usize, - concat!("Size of: ", stringify!(TPMS_PCR_SELECTION)) + "Size of TPMS_PCR_SELECTION" ); assert_eq!( ::std::mem::align_of::(), 2usize, - concat!("Alignment of ", stringify!(TPMS_PCR_SELECTION)) + "Alignment of TPMS_PCR_SELECTION" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).hash) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMS_PCR_SELECTION), - "::", - stringify!(hash) - ) + "Offset of field: TPMS_PCR_SELECTION::hash" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).sizeofSelect) as usize - ptr as usize }, 2usize, - concat!( - "Offset of field: ", - stringify!(TPMS_PCR_SELECTION), - "::", - stringify!(sizeofSelect) - ) + "Offset of field: TPMS_PCR_SELECTION::sizeofSelect" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).pcrSelect) as usize - ptr as usize }, 3usize, - concat!( - "Offset of field: ", - stringify!(TPMS_PCR_SELECTION), - "::", - stringify!(pcrSelect) - ) + "Offset of field: TPMS_PCR_SELECTION::pcrSelect" ); } #[repr(C)] @@ -1439,42 +1245,27 @@ fn bindgen_test_layout_TPMT_TK_CREATION() { assert_eq!( ::std::mem::size_of::(), 76usize, - concat!("Size of: ", stringify!(TPMT_TK_CREATION)) + "Size of TPMT_TK_CREATION" ); assert_eq!( ::std::mem::align_of::(), 4usize, - concat!("Alignment of ", stringify!(TPMT_TK_CREATION)) + "Alignment of TPMT_TK_CREATION" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).tag) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMT_TK_CREATION), - "::", - stringify!(tag) - ) + "Offset of field: TPMT_TK_CREATION::tag" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).hierarchy) as usize - ptr as usize }, 4usize, - concat!( - "Offset of field: ", - stringify!(TPMT_TK_CREATION), - "::", - stringify!(hierarchy) - ) + "Offset of field: TPMT_TK_CREATION::hierarchy" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).digest) as usize - ptr as usize }, 8usize, - concat!( - "Offset of field: ", - stringify!(TPMT_TK_CREATION), - "::", - stringify!(digest) - ) + "Offset of field: TPMT_TK_CREATION::digest" ); } impl Default for TPMT_TK_CREATION { @@ -1500,42 +1291,27 @@ fn bindgen_test_layout_TPMT_TK_VERIFIED() { assert_eq!( ::std::mem::size_of::(), 76usize, - concat!("Size of: ", stringify!(TPMT_TK_VERIFIED)) + "Size of TPMT_TK_VERIFIED" ); assert_eq!( ::std::mem::align_of::(), 4usize, - concat!("Alignment of ", stringify!(TPMT_TK_VERIFIED)) + "Alignment of TPMT_TK_VERIFIED" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).tag) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMT_TK_VERIFIED), - "::", - stringify!(tag) - ) + "Offset of field: TPMT_TK_VERIFIED::tag" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).hierarchy) as usize - ptr as usize }, 4usize, - concat!( - "Offset of field: ", - stringify!(TPMT_TK_VERIFIED), - "::", - stringify!(hierarchy) - ) + "Offset of field: TPMT_TK_VERIFIED::hierarchy" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).digest) as usize - ptr as usize }, 8usize, - concat!( - "Offset of field: ", - stringify!(TPMT_TK_VERIFIED), - "::", - stringify!(digest) - ) + "Offset of field: TPMT_TK_VERIFIED::digest" ); } impl Default for TPMT_TK_VERIFIED { @@ -1561,42 +1337,27 @@ fn bindgen_test_layout_TPMT_TK_AUTH() { assert_eq!( ::std::mem::size_of::(), 76usize, - concat!("Size of: ", stringify!(TPMT_TK_AUTH)) + "Size of TPMT_TK_AUTH" ); assert_eq!( ::std::mem::align_of::(), 4usize, - concat!("Alignment of ", stringify!(TPMT_TK_AUTH)) + "Alignment of TPMT_TK_AUTH" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).tag) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMT_TK_AUTH), - "::", - stringify!(tag) - ) + "Offset of field: TPMT_TK_AUTH::tag" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).hierarchy) as usize - ptr as usize }, 4usize, - concat!( - "Offset of field: ", - stringify!(TPMT_TK_AUTH), - "::", - stringify!(hierarchy) - ) + "Offset of field: TPMT_TK_AUTH::hierarchy" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).digest) as usize - ptr as usize }, 8usize, - concat!( - "Offset of field: ", - stringify!(TPMT_TK_AUTH), - "::", - stringify!(digest) - ) + "Offset of field: TPMT_TK_AUTH::digest" ); } impl Default for TPMT_TK_AUTH { @@ -1622,42 +1383,27 @@ fn bindgen_test_layout_TPMT_TK_HASHCHECK() { assert_eq!( ::std::mem::size_of::(), 76usize, - concat!("Size of: ", stringify!(TPMT_TK_HASHCHECK)) + "Size of TPMT_TK_HASHCHECK" ); assert_eq!( ::std::mem::align_of::(), 4usize, - concat!("Alignment of ", stringify!(TPMT_TK_HASHCHECK)) + "Alignment of TPMT_TK_HASHCHECK" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).tag) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMT_TK_HASHCHECK), - "::", - stringify!(tag) - ) + "Offset of field: TPMT_TK_HASHCHECK::tag" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).hierarchy) as usize - ptr as usize }, 4usize, - concat!( - "Offset of field: ", - stringify!(TPMT_TK_HASHCHECK), - "::", - stringify!(hierarchy) - ) + "Offset of field: TPMT_TK_HASHCHECK::hierarchy" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).digest) as usize - ptr as usize }, 8usize, - concat!( - "Offset of field: ", - stringify!(TPMT_TK_HASHCHECK), - "::", - stringify!(digest) - ) + "Offset of field: TPMT_TK_HASHCHECK::digest" ); } impl Default for TPMT_TK_HASHCHECK { @@ -1682,32 +1428,22 @@ fn bindgen_test_layout_TPMS_ALG_PROPERTY() { assert_eq!( ::std::mem::size_of::(), 8usize, - concat!("Size of: ", stringify!(TPMS_ALG_PROPERTY)) + "Size of TPMS_ALG_PROPERTY" ); assert_eq!( ::std::mem::align_of::(), 4usize, - concat!("Alignment of ", stringify!(TPMS_ALG_PROPERTY)) + "Alignment of TPMS_ALG_PROPERTY" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).alg) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMS_ALG_PROPERTY), - "::", - stringify!(alg) - ) + "Offset of field: TPMS_ALG_PROPERTY::alg" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).algProperties) as usize - ptr as usize }, 4usize, - concat!( - "Offset of field: ", - stringify!(TPMS_ALG_PROPERTY), - "::", - stringify!(algProperties) - ) + "Offset of field: TPMS_ALG_PROPERTY::algProperties" ); } #[repr(C)] @@ -1723,32 +1459,22 @@ fn bindgen_test_layout_TPMS_TAGGED_PROPERTY() { assert_eq!( ::std::mem::size_of::(), 8usize, - concat!("Size of: ", stringify!(TPMS_TAGGED_PROPERTY)) + "Size of TPMS_TAGGED_PROPERTY" ); assert_eq!( ::std::mem::align_of::(), 4usize, - concat!("Alignment of ", stringify!(TPMS_TAGGED_PROPERTY)) + "Alignment of TPMS_TAGGED_PROPERTY" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).property) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMS_TAGGED_PROPERTY), - "::", - stringify!(property) - ) + "Offset of field: TPMS_TAGGED_PROPERTY::property" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).value) as usize - ptr as usize }, 4usize, - concat!( - "Offset of field: ", - stringify!(TPMS_TAGGED_PROPERTY), - "::", - stringify!(value) - ) + "Offset of field: TPMS_TAGGED_PROPERTY::value" ); } #[repr(C)] @@ -1766,42 +1492,27 @@ fn bindgen_test_layout_TPMS_TAGGED_PCR_SELECT() { assert_eq!( ::std::mem::size_of::(), 12usize, - concat!("Size of: ", stringify!(TPMS_TAGGED_PCR_SELECT)) + "Size of TPMS_TAGGED_PCR_SELECT" ); assert_eq!( ::std::mem::align_of::(), 4usize, - concat!("Alignment of ", stringify!(TPMS_TAGGED_PCR_SELECT)) + "Alignment of TPMS_TAGGED_PCR_SELECT" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).tag) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMS_TAGGED_PCR_SELECT), - "::", - stringify!(tag) - ) + "Offset of field: TPMS_TAGGED_PCR_SELECT::tag" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).sizeofSelect) as usize - ptr as usize }, 4usize, - concat!( - "Offset of field: ", - stringify!(TPMS_TAGGED_PCR_SELECT), - "::", - stringify!(sizeofSelect) - ) + "Offset of field: TPMS_TAGGED_PCR_SELECT::sizeofSelect" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).pcrSelect) as usize - ptr as usize }, 5usize, - concat!( - "Offset of field: ", - stringify!(TPMS_TAGGED_PCR_SELECT), - "::", - stringify!(pcrSelect) - ) + "Offset of field: TPMS_TAGGED_PCR_SELECT::pcrSelect" ); } #[repr(C)] @@ -1817,32 +1528,22 @@ fn bindgen_test_layout_TPMS_TAGGED_POLICY() { assert_eq!( ::std::mem::size_of::(), 72usize, - concat!("Size of: ", stringify!(TPMS_TAGGED_POLICY)) + "Size of TPMS_TAGGED_POLICY" ); assert_eq!( ::std::mem::align_of::(), 4usize, - concat!("Alignment of ", stringify!(TPMS_TAGGED_POLICY)) + "Alignment of TPMS_TAGGED_POLICY" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).handle) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMS_TAGGED_POLICY), - "::", - stringify!(handle) - ) + "Offset of field: TPMS_TAGGED_POLICY::handle" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).policyHash) as usize - ptr as usize }, 4usize, - concat!( - "Offset of field: ", - stringify!(TPMS_TAGGED_POLICY), - "::", - stringify!(policyHash) - ) + "Offset of field: TPMS_TAGGED_POLICY::policyHash" ); } impl Default for TPMS_TAGGED_POLICY { @@ -1868,42 +1569,27 @@ fn bindgen_test_layout_TPMS_ACT_DATA() { assert_eq!( ::std::mem::size_of::(), 12usize, - concat!("Size of: ", stringify!(TPMS_ACT_DATA)) + "Size of TPMS_ACT_DATA" ); assert_eq!( ::std::mem::align_of::(), 4usize, - concat!("Alignment of ", stringify!(TPMS_ACT_DATA)) + "Alignment of TPMS_ACT_DATA" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).handle) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMS_ACT_DATA), - "::", - stringify!(handle) - ) + "Offset of field: TPMS_ACT_DATA::handle" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).timeout) as usize - ptr as usize }, 4usize, - concat!( - "Offset of field: ", - stringify!(TPMS_ACT_DATA), - "::", - stringify!(timeout) - ) + "Offset of field: TPMS_ACT_DATA::timeout" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).attributes) as usize - ptr as usize }, 8usize, - concat!( - "Offset of field: ", - stringify!(TPMS_ACT_DATA), - "::", - stringify!(attributes) - ) + "Offset of field: TPMS_ACT_DATA::attributes" ); } #[repr(C)] @@ -1919,32 +1605,22 @@ fn bindgen_test_layout_TPML_CC() { assert_eq!( ::std::mem::size_of::(), 1028usize, - concat!("Size of: ", stringify!(TPML_CC)) + "Size of TPML_CC" ); assert_eq!( ::std::mem::align_of::(), 4usize, - concat!("Alignment of ", stringify!(TPML_CC)) + "Alignment of TPML_CC" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).count) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPML_CC), - "::", - stringify!(count) - ) + "Offset of field: TPML_CC::count" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).commandCodes) as usize - ptr as usize }, 4usize, - concat!( - "Offset of field: ", - stringify!(TPML_CC), - "::", - stringify!(commandCodes) - ) + "Offset of field: TPML_CC::commandCodes" ); } impl Default for TPML_CC { @@ -1969,32 +1645,22 @@ fn bindgen_test_layout_TPML_CCA() { assert_eq!( ::std::mem::size_of::(), 1028usize, - concat!("Size of: ", stringify!(TPML_CCA)) + "Size of TPML_CCA" ); assert_eq!( ::std::mem::align_of::(), 4usize, - concat!("Alignment of ", stringify!(TPML_CCA)) + "Alignment of TPML_CCA" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).count) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPML_CCA), - "::", - stringify!(count) - ) + "Offset of field: TPML_CCA::count" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).commandAttributes) as usize - ptr as usize }, 4usize, - concat!( - "Offset of field: ", - stringify!(TPML_CCA), - "::", - stringify!(commandAttributes) - ) + "Offset of field: TPML_CCA::commandAttributes" ); } impl Default for TPML_CCA { @@ -2019,32 +1685,22 @@ fn bindgen_test_layout_TPML_ALG() { assert_eq!( ::std::mem::size_of::(), 260usize, - concat!("Size of: ", stringify!(TPML_ALG)) + "Size of TPML_ALG" ); assert_eq!( ::std::mem::align_of::(), 4usize, - concat!("Alignment of ", stringify!(TPML_ALG)) + "Alignment of TPML_ALG" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).count) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPML_ALG), - "::", - stringify!(count) - ) + "Offset of field: TPML_ALG::count" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).algorithms) as usize - ptr as usize }, 4usize, - concat!( - "Offset of field: ", - stringify!(TPML_ALG), - "::", - stringify!(algorithms) - ) + "Offset of field: TPML_ALG::algorithms" ); } impl Default for TPML_ALG { @@ -2069,32 +1725,22 @@ fn bindgen_test_layout_TPML_HANDLE() { assert_eq!( ::std::mem::size_of::(), 1020usize, - concat!("Size of: ", stringify!(TPML_HANDLE)) + "Size of TPML_HANDLE" ); assert_eq!( ::std::mem::align_of::(), 4usize, - concat!("Alignment of ", stringify!(TPML_HANDLE)) + "Alignment of TPML_HANDLE" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).count) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPML_HANDLE), - "::", - stringify!(count) - ) + "Offset of field: TPML_HANDLE::count" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).handle) as usize - ptr as usize }, 4usize, - concat!( - "Offset of field: ", - stringify!(TPML_HANDLE), - "::", - stringify!(handle) - ) + "Offset of field: TPML_HANDLE::handle" ); } impl Default for TPML_HANDLE { @@ -2119,32 +1765,22 @@ fn bindgen_test_layout_TPML_DIGEST() { assert_eq!( ::std::mem::size_of::(), 532usize, - concat!("Size of: ", stringify!(TPML_DIGEST)) + "Size of TPML_DIGEST" ); assert_eq!( ::std::mem::align_of::(), 4usize, - concat!("Alignment of ", stringify!(TPML_DIGEST)) + "Alignment of TPML_DIGEST" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).count) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPML_DIGEST), - "::", - stringify!(count) - ) + "Offset of field: TPML_DIGEST::count" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).digests) as usize - ptr as usize }, 4usize, - concat!( - "Offset of field: ", - stringify!(TPML_DIGEST), - "::", - stringify!(digests) - ) + "Offset of field: TPML_DIGEST::digests" ); } impl Default for TPML_DIGEST { @@ -2169,32 +1805,22 @@ fn bindgen_test_layout_TPML_DIGEST_VALUES() { assert_eq!( ::std::mem::size_of::(), 1060usize, - concat!("Size of: ", stringify!(TPML_DIGEST_VALUES)) + "Size of TPML_DIGEST_VALUES" ); assert_eq!( ::std::mem::align_of::(), 4usize, - concat!("Alignment of ", stringify!(TPML_DIGEST_VALUES)) + "Alignment of TPML_DIGEST_VALUES" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).count) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPML_DIGEST_VALUES), - "::", - stringify!(count) - ) + "Offset of field: TPML_DIGEST_VALUES::count" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).digests) as usize - ptr as usize }, 4usize, - concat!( - "Offset of field: ", - stringify!(TPML_DIGEST_VALUES), - "::", - stringify!(digests) - ) + "Offset of field: TPML_DIGEST_VALUES::digests" ); } impl Default for TPML_DIGEST_VALUES { @@ -2219,32 +1845,22 @@ fn bindgen_test_layout_TPML_PCR_SELECTION() { assert_eq!( ::std::mem::size_of::(), 132usize, - concat!("Size of: ", stringify!(TPML_PCR_SELECTION)) + "Size of TPML_PCR_SELECTION" ); assert_eq!( ::std::mem::align_of::(), 4usize, - concat!("Alignment of ", stringify!(TPML_PCR_SELECTION)) + "Alignment of TPML_PCR_SELECTION" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).count) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPML_PCR_SELECTION), - "::", - stringify!(count) - ) + "Offset of field: TPML_PCR_SELECTION::count" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).pcrSelections) as usize - ptr as usize }, 4usize, - concat!( - "Offset of field: ", - stringify!(TPML_PCR_SELECTION), - "::", - stringify!(pcrSelections) - ) + "Offset of field: TPML_PCR_SELECTION::pcrSelections" ); } #[repr(C)] @@ -2260,32 +1876,22 @@ fn bindgen_test_layout_TPML_ALG_PROPERTY() { assert_eq!( ::std::mem::size_of::(), 1020usize, - concat!("Size of: ", stringify!(TPML_ALG_PROPERTY)) + "Size of TPML_ALG_PROPERTY" ); assert_eq!( ::std::mem::align_of::(), 4usize, - concat!("Alignment of ", stringify!(TPML_ALG_PROPERTY)) + "Alignment of TPML_ALG_PROPERTY" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).count) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPML_ALG_PROPERTY), - "::", - stringify!(count) - ) + "Offset of field: TPML_ALG_PROPERTY::count" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).algProperties) as usize - ptr as usize }, 4usize, - concat!( - "Offset of field: ", - stringify!(TPML_ALG_PROPERTY), - "::", - stringify!(algProperties) - ) + "Offset of field: TPML_ALG_PROPERTY::algProperties" ); } impl Default for TPML_ALG_PROPERTY { @@ -2311,32 +1917,22 @@ fn bindgen_test_layout_TPML_TAGGED_TPM_PROPERTY() { assert_eq!( ::std::mem::size_of::(), 1020usize, - concat!("Size of: ", stringify!(TPML_TAGGED_TPM_PROPERTY)) + "Size of TPML_TAGGED_TPM_PROPERTY" ); assert_eq!( ::std::mem::align_of::(), 4usize, - concat!("Alignment of ", stringify!(TPML_TAGGED_TPM_PROPERTY)) + "Alignment of TPML_TAGGED_TPM_PROPERTY" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).count) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPML_TAGGED_TPM_PROPERTY), - "::", - stringify!(count) - ) + "Offset of field: TPML_TAGGED_TPM_PROPERTY::count" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).tpmProperty) as usize - ptr as usize }, 4usize, - concat!( - "Offset of field: ", - stringify!(TPML_TAGGED_TPM_PROPERTY), - "::", - stringify!(tpmProperty) - ) + "Offset of field: TPML_TAGGED_TPM_PROPERTY::tpmProperty" ); } impl Default for TPML_TAGGED_TPM_PROPERTY { @@ -2362,32 +1958,22 @@ fn bindgen_test_layout_TPML_TAGGED_PCR_PROPERTY() { assert_eq!( ::std::mem::size_of::(), 1012usize, - concat!("Size of: ", stringify!(TPML_TAGGED_PCR_PROPERTY)) + "Size of TPML_TAGGED_PCR_PROPERTY" ); assert_eq!( ::std::mem::align_of::(), 4usize, - concat!("Alignment of ", stringify!(TPML_TAGGED_PCR_PROPERTY)) + "Alignment of TPML_TAGGED_PCR_PROPERTY" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).count) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPML_TAGGED_PCR_PROPERTY), - "::", - stringify!(count) - ) + "Offset of field: TPML_TAGGED_PCR_PROPERTY::count" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).pcrProperty) as usize - ptr as usize }, 4usize, - concat!( - "Offset of field: ", - stringify!(TPML_TAGGED_PCR_PROPERTY), - "::", - stringify!(pcrProperty) - ) + "Offset of field: TPML_TAGGED_PCR_PROPERTY::pcrProperty" ); } impl Default for TPML_TAGGED_PCR_PROPERTY { @@ -2412,32 +1998,22 @@ fn bindgen_test_layout_TPML_ECC_CURVE() { assert_eq!( ::std::mem::size_of::(), 1020usize, - concat!("Size of: ", stringify!(TPML_ECC_CURVE)) + "Size of TPML_ECC_CURVE" ); assert_eq!( ::std::mem::align_of::(), 4usize, - concat!("Alignment of ", stringify!(TPML_ECC_CURVE)) + "Alignment of TPML_ECC_CURVE" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).count) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPML_ECC_CURVE), - "::", - stringify!(count) - ) + "Offset of field: TPML_ECC_CURVE::count" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).eccCurves) as usize - ptr as usize }, 4usize, - concat!( - "Offset of field: ", - stringify!(TPML_ECC_CURVE), - "::", - stringify!(eccCurves) - ) + "Offset of field: TPML_ECC_CURVE::eccCurves" ); } impl Default for TPML_ECC_CURVE { @@ -2462,32 +2038,22 @@ fn bindgen_test_layout_TPML_TAGGED_POLICY() { assert_eq!( ::std::mem::size_of::(), 1012usize, - concat!("Size of: ", stringify!(TPML_TAGGED_POLICY)) + "Size of TPML_TAGGED_POLICY" ); assert_eq!( ::std::mem::align_of::(), 4usize, - concat!("Alignment of ", stringify!(TPML_TAGGED_POLICY)) + "Alignment of TPML_TAGGED_POLICY" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).count) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPML_TAGGED_POLICY), - "::", - stringify!(count) - ) + "Offset of field: TPML_TAGGED_POLICY::count" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).policies) as usize - ptr as usize }, 4usize, - concat!( - "Offset of field: ", - stringify!(TPML_TAGGED_POLICY), - "::", - stringify!(policies) - ) + "Offset of field: TPML_TAGGED_POLICY::policies" ); } impl Default for TPML_TAGGED_POLICY { @@ -2512,32 +2078,22 @@ fn bindgen_test_layout_TPML_ACT_DATA() { assert_eq!( ::std::mem::size_of::(), 1012usize, - concat!("Size of: ", stringify!(TPML_ACT_DATA)) + "Size of TPML_ACT_DATA" ); assert_eq!( ::std::mem::align_of::(), 4usize, - concat!("Alignment of ", stringify!(TPML_ACT_DATA)) + "Alignment of TPML_ACT_DATA" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).count) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPML_ACT_DATA), - "::", - stringify!(count) - ) + "Offset of field: TPML_ACT_DATA::count" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).actData) as usize - ptr as usize }, 4usize, - concat!( - "Offset of field: ", - stringify!(TPML_ACT_DATA), - "::", - stringify!(actData) - ) + "Offset of field: TPML_ACT_DATA::actData" ); } impl Default for TPML_ACT_DATA { @@ -2551,47 +2107,36 @@ impl Default for TPML_ACT_DATA { } #[repr(C)] #[derive(Debug, Copy, Clone)] -pub struct TPML_INTEL_PTT_PROPERTY { - pub count: UINT32, - pub property: [UINT32; 256usize], +pub struct TPM2B_MAX_CAP_BUFFER { + pub size: UINT16, + pub buffer: [BYTE; 1024usize], } #[test] -fn bindgen_test_layout_TPML_INTEL_PTT_PROPERTY() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); +fn bindgen_test_layout_TPM2B_MAX_CAP_BUFFER() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); let ptr = UNINIT.as_ptr(); assert_eq!( - ::std::mem::size_of::(), - 1028usize, - concat!("Size of: ", stringify!(TPML_INTEL_PTT_PROPERTY)) + ::std::mem::size_of::(), + 1026usize, + "Size of TPM2B_MAX_CAP_BUFFER" ); assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(TPML_INTEL_PTT_PROPERTY)) + ::std::mem::align_of::(), + 2usize, + "Alignment of TPM2B_MAX_CAP_BUFFER" ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).count) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).size) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPML_INTEL_PTT_PROPERTY), - "::", - stringify!(count) - ) + "Offset of field: TPM2B_MAX_CAP_BUFFER::size" ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).property) as usize - ptr as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(TPML_INTEL_PTT_PROPERTY), - "::", - stringify!(property) - ) + unsafe { ::std::ptr::addr_of!((*ptr).buffer) as usize - ptr as usize }, + 2usize, + "Offset of field: TPM2B_MAX_CAP_BUFFER::buffer" ); } -impl Default for TPML_INTEL_PTT_PROPERTY { +impl Default for TPM2B_MAX_CAP_BUFFER { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { @@ -2614,7 +2159,7 @@ pub union TPMU_CAPABILITIES { pub eccCurves: TPML_ECC_CURVE, pub authPolicies: TPML_TAGGED_POLICY, pub actData: TPML_ACT_DATA, - pub intelPttProperty: TPML_INTEL_PTT_PROPERTY, + pub vendor: TPM2B_MAX_CAP_BUFFER, } #[test] fn bindgen_test_layout_TPMU_CAPABILITIES() { @@ -2623,132 +2168,72 @@ fn bindgen_test_layout_TPMU_CAPABILITIES() { assert_eq!( ::std::mem::size_of::(), 1028usize, - concat!("Size of: ", stringify!(TPMU_CAPABILITIES)) + "Size of TPMU_CAPABILITIES" ); assert_eq!( ::std::mem::align_of::(), 4usize, - concat!("Alignment of ", stringify!(TPMU_CAPABILITIES)) + "Alignment of TPMU_CAPABILITIES" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).algorithms) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_CAPABILITIES), - "::", - stringify!(algorithms) - ) + "Offset of field: TPMU_CAPABILITIES::algorithms" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).handles) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_CAPABILITIES), - "::", - stringify!(handles) - ) + "Offset of field: TPMU_CAPABILITIES::handles" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).command) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_CAPABILITIES), - "::", - stringify!(command) - ) + "Offset of field: TPMU_CAPABILITIES::command" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).ppCommands) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_CAPABILITIES), - "::", - stringify!(ppCommands) - ) + "Offset of field: TPMU_CAPABILITIES::ppCommands" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).auditCommands) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_CAPABILITIES), - "::", - stringify!(auditCommands) - ) + "Offset of field: TPMU_CAPABILITIES::auditCommands" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).assignedPCR) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_CAPABILITIES), - "::", - stringify!(assignedPCR) - ) + "Offset of field: TPMU_CAPABILITIES::assignedPCR" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).tpmProperties) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_CAPABILITIES), - "::", - stringify!(tpmProperties) - ) + "Offset of field: TPMU_CAPABILITIES::tpmProperties" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).pcrProperties) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_CAPABILITIES), - "::", - stringify!(pcrProperties) - ) + "Offset of field: TPMU_CAPABILITIES::pcrProperties" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).eccCurves) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_CAPABILITIES), - "::", - stringify!(eccCurves) - ) + "Offset of field: TPMU_CAPABILITIES::eccCurves" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).authPolicies) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_CAPABILITIES), - "::", - stringify!(authPolicies) - ) + "Offset of field: TPMU_CAPABILITIES::authPolicies" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).actData) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_CAPABILITIES), - "::", - stringify!(actData) - ) + "Offset of field: TPMU_CAPABILITIES::actData" ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).intelPttProperty) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).vendor) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_CAPABILITIES), - "::", - stringify!(intelPttProperty) - ) + "Offset of field: TPMU_CAPABILITIES::vendor" ); } impl Default for TPMU_CAPABILITIES { @@ -2773,32 +2258,22 @@ fn bindgen_test_layout_TPMS_CAPABILITY_DATA() { assert_eq!( ::std::mem::size_of::(), 1032usize, - concat!("Size of: ", stringify!(TPMS_CAPABILITY_DATA)) + "Size of TPMS_CAPABILITY_DATA" ); assert_eq!( ::std::mem::align_of::(), 4usize, - concat!("Alignment of ", stringify!(TPMS_CAPABILITY_DATA)) + "Alignment of TPMS_CAPABILITY_DATA" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).capability) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMS_CAPABILITY_DATA), - "::", - stringify!(capability) - ) + "Offset of field: TPMS_CAPABILITY_DATA::capability" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).data) as usize - ptr as usize }, 4usize, - concat!( - "Offset of field: ", - stringify!(TPMS_CAPABILITY_DATA), - "::", - stringify!(data) - ) + "Offset of field: TPMS_CAPABILITY_DATA::data" ); } impl Default for TPMS_CAPABILITY_DATA { @@ -2825,52 +2300,32 @@ fn bindgen_test_layout_TPMS_CLOCK_INFO() { assert_eq!( ::std::mem::size_of::(), 24usize, - concat!("Size of: ", stringify!(TPMS_CLOCK_INFO)) + "Size of TPMS_CLOCK_INFO" ); assert_eq!( ::std::mem::align_of::(), 8usize, - concat!("Alignment of ", stringify!(TPMS_CLOCK_INFO)) + "Alignment of TPMS_CLOCK_INFO" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).clock) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMS_CLOCK_INFO), - "::", - stringify!(clock) - ) + "Offset of field: TPMS_CLOCK_INFO::clock" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).resetCount) as usize - ptr as usize }, 8usize, - concat!( - "Offset of field: ", - stringify!(TPMS_CLOCK_INFO), - "::", - stringify!(resetCount) - ) + "Offset of field: TPMS_CLOCK_INFO::resetCount" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).restartCount) as usize - ptr as usize }, 12usize, - concat!( - "Offset of field: ", - stringify!(TPMS_CLOCK_INFO), - "::", - stringify!(restartCount) - ) + "Offset of field: TPMS_CLOCK_INFO::restartCount" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).safe) as usize - ptr as usize }, 16usize, - concat!( - "Offset of field: ", - stringify!(TPMS_CLOCK_INFO), - "::", - stringify!(safe) - ) + "Offset of field: TPMS_CLOCK_INFO::safe" ); } #[repr(C)] @@ -2886,32 +2341,22 @@ fn bindgen_test_layout_TPMS_TIME_INFO() { assert_eq!( ::std::mem::size_of::(), 32usize, - concat!("Size of: ", stringify!(TPMS_TIME_INFO)) + "Size of TPMS_TIME_INFO" ); assert_eq!( ::std::mem::align_of::(), 8usize, - concat!("Alignment of ", stringify!(TPMS_TIME_INFO)) + "Alignment of TPMS_TIME_INFO" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).time) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMS_TIME_INFO), - "::", - stringify!(time) - ) + "Offset of field: TPMS_TIME_INFO::time" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).clockInfo) as usize - ptr as usize }, 8usize, - concat!( - "Offset of field: ", - stringify!(TPMS_TIME_INFO), - "::", - stringify!(clockInfo) - ) + "Offset of field: TPMS_TIME_INFO::clockInfo" ); } #[repr(C)] @@ -2928,32 +2373,22 @@ fn bindgen_test_layout_TPMS_TIME_ATTEST_INFO() { assert_eq!( ::std::mem::size_of::(), 40usize, - concat!("Size of: ", stringify!(TPMS_TIME_ATTEST_INFO)) + "Size of TPMS_TIME_ATTEST_INFO" ); assert_eq!( ::std::mem::align_of::(), 8usize, - concat!("Alignment of ", stringify!(TPMS_TIME_ATTEST_INFO)) + "Alignment of TPMS_TIME_ATTEST_INFO" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).time) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMS_TIME_ATTEST_INFO), - "::", - stringify!(time) - ) + "Offset of field: TPMS_TIME_ATTEST_INFO::time" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).firmwareVersion) as usize - ptr as usize }, 32usize, - concat!( - "Offset of field: ", - stringify!(TPMS_TIME_ATTEST_INFO), - "::", - stringify!(firmwareVersion) - ) + "Offset of field: TPMS_TIME_ATTEST_INFO::firmwareVersion" ); } #[repr(C)] @@ -2969,32 +2404,22 @@ fn bindgen_test_layout_TPMS_CERTIFY_INFO() { assert_eq!( ::std::mem::size_of::(), 140usize, - concat!("Size of: ", stringify!(TPMS_CERTIFY_INFO)) + "Size of TPMS_CERTIFY_INFO" ); assert_eq!( ::std::mem::align_of::(), 2usize, - concat!("Alignment of ", stringify!(TPMS_CERTIFY_INFO)) + "Alignment of TPMS_CERTIFY_INFO" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).name) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMS_CERTIFY_INFO), - "::", - stringify!(name) - ) + "Offset of field: TPMS_CERTIFY_INFO::name" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).qualifiedName) as usize - ptr as usize }, 70usize, - concat!( - "Offset of field: ", - stringify!(TPMS_CERTIFY_INFO), - "::", - stringify!(qualifiedName) - ) + "Offset of field: TPMS_CERTIFY_INFO::qualifiedName" ); } impl Default for TPMS_CERTIFY_INFO { @@ -3019,32 +2444,22 @@ fn bindgen_test_layout_TPMS_QUOTE_INFO() { assert_eq!( ::std::mem::size_of::(), 200usize, - concat!("Size of: ", stringify!(TPMS_QUOTE_INFO)) + "Size of TPMS_QUOTE_INFO" ); assert_eq!( ::std::mem::align_of::(), 4usize, - concat!("Alignment of ", stringify!(TPMS_QUOTE_INFO)) + "Alignment of TPMS_QUOTE_INFO" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).pcrSelect) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMS_QUOTE_INFO), - "::", - stringify!(pcrSelect) - ) + "Offset of field: TPMS_QUOTE_INFO::pcrSelect" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).pcrDigest) as usize - ptr as usize }, 132usize, - concat!( - "Offset of field: ", - stringify!(TPMS_QUOTE_INFO), - "::", - stringify!(pcrDigest) - ) + "Offset of field: TPMS_QUOTE_INFO::pcrDigest" ); } impl Default for TPMS_QUOTE_INFO { @@ -3072,52 +2487,32 @@ fn bindgen_test_layout_TPMS_COMMAND_AUDIT_INFO() { assert_eq!( ::std::mem::size_of::(), 144usize, - concat!("Size of: ", stringify!(TPMS_COMMAND_AUDIT_INFO)) + "Size of TPMS_COMMAND_AUDIT_INFO" ); assert_eq!( ::std::mem::align_of::(), 8usize, - concat!("Alignment of ", stringify!(TPMS_COMMAND_AUDIT_INFO)) + "Alignment of TPMS_COMMAND_AUDIT_INFO" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).auditCounter) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMS_COMMAND_AUDIT_INFO), - "::", - stringify!(auditCounter) - ) + "Offset of field: TPMS_COMMAND_AUDIT_INFO::auditCounter" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).digestAlg) as usize - ptr as usize }, 8usize, - concat!( - "Offset of field: ", - stringify!(TPMS_COMMAND_AUDIT_INFO), - "::", - stringify!(digestAlg) - ) + "Offset of field: TPMS_COMMAND_AUDIT_INFO::digestAlg" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).auditDigest) as usize - ptr as usize }, 10usize, - concat!( - "Offset of field: ", - stringify!(TPMS_COMMAND_AUDIT_INFO), - "::", - stringify!(auditDigest) - ) + "Offset of field: TPMS_COMMAND_AUDIT_INFO::auditDigest" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).commandDigest) as usize - ptr as usize }, 76usize, - concat!( - "Offset of field: ", - stringify!(TPMS_COMMAND_AUDIT_INFO), - "::", - stringify!(commandDigest) - ) + "Offset of field: TPMS_COMMAND_AUDIT_INFO::commandDigest" ); } impl Default for TPMS_COMMAND_AUDIT_INFO { @@ -3143,32 +2538,22 @@ fn bindgen_test_layout_TPMS_SESSION_AUDIT_INFO() { assert_eq!( ::std::mem::size_of::(), 68usize, - concat!("Size of: ", stringify!(TPMS_SESSION_AUDIT_INFO)) + "Size of TPMS_SESSION_AUDIT_INFO" ); assert_eq!( ::std::mem::align_of::(), 2usize, - concat!("Alignment of ", stringify!(TPMS_SESSION_AUDIT_INFO)) + "Alignment of TPMS_SESSION_AUDIT_INFO" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).exclusiveSession) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMS_SESSION_AUDIT_INFO), - "::", - stringify!(exclusiveSession) - ) + "Offset of field: TPMS_SESSION_AUDIT_INFO::exclusiveSession" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).sessionDigest) as usize - ptr as usize }, 2usize, - concat!( - "Offset of field: ", - stringify!(TPMS_SESSION_AUDIT_INFO), - "::", - stringify!(sessionDigest) - ) + "Offset of field: TPMS_SESSION_AUDIT_INFO::sessionDigest" ); } impl Default for TPMS_SESSION_AUDIT_INFO { @@ -3193,32 +2578,22 @@ fn bindgen_test_layout_TPMS_CREATION_INFO() { assert_eq!( ::std::mem::size_of::(), 136usize, - concat!("Size of: ", stringify!(TPMS_CREATION_INFO)) + "Size of TPMS_CREATION_INFO" ); assert_eq!( ::std::mem::align_of::(), 2usize, - concat!("Alignment of ", stringify!(TPMS_CREATION_INFO)) + "Alignment of TPMS_CREATION_INFO" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).objectName) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMS_CREATION_INFO), - "::", - stringify!(objectName) - ) + "Offset of field: TPMS_CREATION_INFO::objectName" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).creationHash) as usize - ptr as usize }, 70usize, - concat!( - "Offset of field: ", - stringify!(TPMS_CREATION_INFO), - "::", - stringify!(creationHash) - ) + "Offset of field: TPMS_CREATION_INFO::creationHash" ); } impl Default for TPMS_CREATION_INFO { @@ -3244,42 +2619,27 @@ fn bindgen_test_layout_TPMS_NV_CERTIFY_INFO() { assert_eq!( ::std::mem::size_of::(), 2122usize, - concat!("Size of: ", stringify!(TPMS_NV_CERTIFY_INFO)) + "Size of TPMS_NV_CERTIFY_INFO" ); assert_eq!( ::std::mem::align_of::(), 2usize, - concat!("Alignment of ", stringify!(TPMS_NV_CERTIFY_INFO)) + "Alignment of TPMS_NV_CERTIFY_INFO" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).indexName) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMS_NV_CERTIFY_INFO), - "::", - stringify!(indexName) - ) + "Offset of field: TPMS_NV_CERTIFY_INFO::indexName" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).offset) as usize - ptr as usize }, 70usize, - concat!( - "Offset of field: ", - stringify!(TPMS_NV_CERTIFY_INFO), - "::", - stringify!(offset) - ) + "Offset of field: TPMS_NV_CERTIFY_INFO::offset" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).nvContents) as usize - ptr as usize }, 72usize, - concat!( - "Offset of field: ", - stringify!(TPMS_NV_CERTIFY_INFO), - "::", - stringify!(nvContents) - ) + "Offset of field: TPMS_NV_CERTIFY_INFO::nvContents" ); } impl Default for TPMS_NV_CERTIFY_INFO { @@ -3305,32 +2665,22 @@ fn bindgen_test_layout_TPMS_NV_DIGEST_CERTIFY_INFO() { assert_eq!( ::std::mem::size_of::(), 136usize, - concat!("Size of: ", stringify!(TPMS_NV_DIGEST_CERTIFY_INFO)) + "Size of TPMS_NV_DIGEST_CERTIFY_INFO" ); assert_eq!( ::std::mem::align_of::(), 2usize, - concat!("Alignment of ", stringify!(TPMS_NV_DIGEST_CERTIFY_INFO)) + "Alignment of TPMS_NV_DIGEST_CERTIFY_INFO" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).indexName) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMS_NV_DIGEST_CERTIFY_INFO), - "::", - stringify!(indexName) - ) + "Offset of field: TPMS_NV_DIGEST_CERTIFY_INFO::indexName" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).nvDigest) as usize - ptr as usize }, 70usize, - concat!( - "Offset of field: ", - stringify!(TPMS_NV_DIGEST_CERTIFY_INFO), - "::", - stringify!(nvDigest) - ) + "Offset of field: TPMS_NV_DIGEST_CERTIFY_INFO::nvDigest" ); } impl Default for TPMS_NV_DIGEST_CERTIFY_INFO { @@ -3361,82 +2711,47 @@ fn bindgen_test_layout_TPMU_ATTEST() { assert_eq!( ::std::mem::size_of::(), 2128usize, - concat!("Size of: ", stringify!(TPMU_ATTEST)) + "Size of TPMU_ATTEST" ); assert_eq!( ::std::mem::align_of::(), 8usize, - concat!("Alignment of ", stringify!(TPMU_ATTEST)) + "Alignment of TPMU_ATTEST" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).certify) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_ATTEST), - "::", - stringify!(certify) - ) + "Offset of field: TPMU_ATTEST::certify" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).creation) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_ATTEST), - "::", - stringify!(creation) - ) + "Offset of field: TPMU_ATTEST::creation" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).quote) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_ATTEST), - "::", - stringify!(quote) - ) + "Offset of field: TPMU_ATTEST::quote" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).commandAudit) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_ATTEST), - "::", - stringify!(commandAudit) - ) + "Offset of field: TPMU_ATTEST::commandAudit" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).sessionAudit) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_ATTEST), - "::", - stringify!(sessionAudit) - ) + "Offset of field: TPMU_ATTEST::sessionAudit" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).time) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_ATTEST), - "::", - stringify!(time) - ) + "Offset of field: TPMU_ATTEST::time" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).nv) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_ATTEST), - "::", - stringify!(nv) - ) + "Offset of field: TPMU_ATTEST::nv" ); } impl Default for TPMU_ATTEST { @@ -3466,82 +2781,47 @@ fn bindgen_test_layout_TPMS_ATTEST() { assert_eq!( ::std::mem::size_of::(), 2304usize, - concat!("Size of: ", stringify!(TPMS_ATTEST)) + "Size of TPMS_ATTEST" ); assert_eq!( ::std::mem::align_of::(), 8usize, - concat!("Alignment of ", stringify!(TPMS_ATTEST)) + "Alignment of TPMS_ATTEST" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).magic) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMS_ATTEST), - "::", - stringify!(magic) - ) + "Offset of field: TPMS_ATTEST::magic" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).type_) as usize - ptr as usize }, 4usize, - concat!( - "Offset of field: ", - stringify!(TPMS_ATTEST), - "::", - stringify!(type_) - ) + "Offset of field: TPMS_ATTEST::type_" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).qualifiedSigner) as usize - ptr as usize }, 6usize, - concat!( - "Offset of field: ", - stringify!(TPMS_ATTEST), - "::", - stringify!(qualifiedSigner) - ) + "Offset of field: TPMS_ATTEST::qualifiedSigner" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).extraData) as usize - ptr as usize }, 76usize, - concat!( - "Offset of field: ", - stringify!(TPMS_ATTEST), - "::", - stringify!(extraData) - ) + "Offset of field: TPMS_ATTEST::extraData" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).clockInfo) as usize - ptr as usize }, 144usize, - concat!( - "Offset of field: ", - stringify!(TPMS_ATTEST), - "::", - stringify!(clockInfo) - ) + "Offset of field: TPMS_ATTEST::clockInfo" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).firmwareVersion) as usize - ptr as usize }, 168usize, - concat!( - "Offset of field: ", - stringify!(TPMS_ATTEST), - "::", - stringify!(firmwareVersion) - ) + "Offset of field: TPMS_ATTEST::firmwareVersion" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).attested) as usize - ptr as usize }, 176usize, - concat!( - "Offset of field: ", - stringify!(TPMS_ATTEST), - "::", - stringify!(attested) - ) + "Offset of field: TPMS_ATTEST::attested" ); } impl Default for TPMS_ATTEST { @@ -3566,32 +2846,22 @@ fn bindgen_test_layout_TPM2B_ATTEST() { assert_eq!( ::std::mem::size_of::(), 2306usize, - concat!("Size of: ", stringify!(TPM2B_ATTEST)) + "Size of TPM2B_ATTEST" ); assert_eq!( ::std::mem::align_of::(), 2usize, - concat!("Alignment of ", stringify!(TPM2B_ATTEST)) + "Alignment of TPM2B_ATTEST" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).size) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPM2B_ATTEST), - "::", - stringify!(size) - ) + "Offset of field: TPM2B_ATTEST::size" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).attestationData) as usize - ptr as usize }, 2usize, - concat!( - "Offset of field: ", - stringify!(TPM2B_ATTEST), - "::", - stringify!(attestationData) - ) + "Offset of field: TPM2B_ATTEST::attestationData" ); } impl Default for TPM2B_ATTEST { @@ -3618,52 +2888,32 @@ fn bindgen_test_layout_TPMS_AUTH_COMMAND() { assert_eq!( ::std::mem::size_of::(), 140usize, - concat!("Size of: ", stringify!(TPMS_AUTH_COMMAND)) + "Size of TPMS_AUTH_COMMAND" ); assert_eq!( ::std::mem::align_of::(), 4usize, - concat!("Alignment of ", stringify!(TPMS_AUTH_COMMAND)) + "Alignment of TPMS_AUTH_COMMAND" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).sessionHandle) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMS_AUTH_COMMAND), - "::", - stringify!(sessionHandle) - ) + "Offset of field: TPMS_AUTH_COMMAND::sessionHandle" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).nonce) as usize - ptr as usize }, 4usize, - concat!( - "Offset of field: ", - stringify!(TPMS_AUTH_COMMAND), - "::", - stringify!(nonce) - ) + "Offset of field: TPMS_AUTH_COMMAND::nonce" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).sessionAttributes) as usize - ptr as usize }, 70usize, - concat!( - "Offset of field: ", - stringify!(TPMS_AUTH_COMMAND), - "::", - stringify!(sessionAttributes) - ) + "Offset of field: TPMS_AUTH_COMMAND::sessionAttributes" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).hmac) as usize - ptr as usize }, 72usize, - concat!( - "Offset of field: ", - stringify!(TPMS_AUTH_COMMAND), - "::", - stringify!(hmac) - ) + "Offset of field: TPMS_AUTH_COMMAND::hmac" ); } impl Default for TPMS_AUTH_COMMAND { @@ -3689,42 +2939,27 @@ fn bindgen_test_layout_TPMS_AUTH_RESPONSE() { assert_eq!( ::std::mem::size_of::(), 134usize, - concat!("Size of: ", stringify!(TPMS_AUTH_RESPONSE)) + "Size of TPMS_AUTH_RESPONSE" ); assert_eq!( ::std::mem::align_of::(), 2usize, - concat!("Alignment of ", stringify!(TPMS_AUTH_RESPONSE)) + "Alignment of TPMS_AUTH_RESPONSE" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).nonce) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMS_AUTH_RESPONSE), - "::", - stringify!(nonce) - ) + "Offset of field: TPMS_AUTH_RESPONSE::nonce" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).sessionAttributes) as usize - ptr as usize }, 66usize, - concat!( - "Offset of field: ", - stringify!(TPMS_AUTH_RESPONSE), - "::", - stringify!(sessionAttributes) - ) + "Offset of field: TPMS_AUTH_RESPONSE::sessionAttributes" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).hmac) as usize - ptr as usize }, 68usize, - concat!( - "Offset of field: ", - stringify!(TPMS_AUTH_RESPONSE), - "::", - stringify!(hmac) - ) + "Offset of field: TPMS_AUTH_RESPONSE::hmac" ); } impl Default for TPMS_AUTH_RESPONSE { @@ -3747,6 +2982,7 @@ pub union TPMU_SYM_KEY_BITS { pub camellia: TPMI_CAMELLIA_KEY_BITS, pub sym: TPM2_KEY_BITS, pub exclusiveOr: TPMI_ALG_HASH, + pub null: TPMS_EMPTY, } #[test] fn bindgen_test_layout_TPMU_SYM_KEY_BITS() { @@ -3755,62 +2991,42 @@ fn bindgen_test_layout_TPMU_SYM_KEY_BITS() { assert_eq!( ::std::mem::size_of::(), 2usize, - concat!("Size of: ", stringify!(TPMU_SYM_KEY_BITS)) + "Size of TPMU_SYM_KEY_BITS" ); assert_eq!( ::std::mem::align_of::(), 2usize, - concat!("Alignment of ", stringify!(TPMU_SYM_KEY_BITS)) + "Alignment of TPMU_SYM_KEY_BITS" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).aes) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_SYM_KEY_BITS), - "::", - stringify!(aes) - ) + "Offset of field: TPMU_SYM_KEY_BITS::aes" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).sm4) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_SYM_KEY_BITS), - "::", - stringify!(sm4) - ) + "Offset of field: TPMU_SYM_KEY_BITS::sm4" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).camellia) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_SYM_KEY_BITS), - "::", - stringify!(camellia) - ) + "Offset of field: TPMU_SYM_KEY_BITS::camellia" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).sym) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_SYM_KEY_BITS), - "::", - stringify!(sym) - ) + "Offset of field: TPMU_SYM_KEY_BITS::sym" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).exclusiveOr) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_SYM_KEY_BITS), - "::", - stringify!(exclusiveOr) - ) + "Offset of field: TPMU_SYM_KEY_BITS::exclusiveOr" + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).null) as usize - ptr as usize }, + 0usize, + "Offset of field: TPMU_SYM_KEY_BITS::null" ); } impl Default for TPMU_SYM_KEY_BITS { @@ -3829,6 +3045,8 @@ pub union TPMU_SYM_MODE { pub sm4: TPMI_ALG_SYM_MODE, pub camellia: TPMI_ALG_SYM_MODE, pub sym: TPMI_ALG_SYM_MODE, + pub exclusiveOr: TPMS_EMPTY, + pub null: TPMS_EMPTY, } #[test] fn bindgen_test_layout_TPMU_SYM_MODE() { @@ -3837,52 +3055,42 @@ fn bindgen_test_layout_TPMU_SYM_MODE() { assert_eq!( ::std::mem::size_of::(), 2usize, - concat!("Size of: ", stringify!(TPMU_SYM_MODE)) + "Size of TPMU_SYM_MODE" ); assert_eq!( ::std::mem::align_of::(), 2usize, - concat!("Alignment of ", stringify!(TPMU_SYM_MODE)) + "Alignment of TPMU_SYM_MODE" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).aes) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_SYM_MODE), - "::", - stringify!(aes) - ) + "Offset of field: TPMU_SYM_MODE::aes" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).sm4) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_SYM_MODE), - "::", - stringify!(sm4) - ) + "Offset of field: TPMU_SYM_MODE::sm4" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).camellia) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_SYM_MODE), - "::", - stringify!(camellia) - ) + "Offset of field: TPMU_SYM_MODE::camellia" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).sym) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_SYM_MODE), - "::", - stringify!(sym) - ) + "Offset of field: TPMU_SYM_MODE::sym" + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).exclusiveOr) as usize - ptr as usize }, + 0usize, + "Offset of field: TPMU_SYM_MODE::exclusiveOr" + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).null) as usize - ptr as usize }, + 0usize, + "Offset of field: TPMU_SYM_MODE::null" ); } impl Default for TPMU_SYM_MODE { @@ -3908,42 +3116,27 @@ fn bindgen_test_layout_TPMT_SYM_DEF() { assert_eq!( ::std::mem::size_of::(), 6usize, - concat!("Size of: ", stringify!(TPMT_SYM_DEF)) + "Size of TPMT_SYM_DEF" ); assert_eq!( ::std::mem::align_of::(), 2usize, - concat!("Alignment of ", stringify!(TPMT_SYM_DEF)) + "Alignment of TPMT_SYM_DEF" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).algorithm) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMT_SYM_DEF), - "::", - stringify!(algorithm) - ) + "Offset of field: TPMT_SYM_DEF::algorithm" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).keyBits) as usize - ptr as usize }, 2usize, - concat!( - "Offset of field: ", - stringify!(TPMT_SYM_DEF), - "::", - stringify!(keyBits) - ) + "Offset of field: TPMT_SYM_DEF::keyBits" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).mode) as usize - ptr as usize }, 4usize, - concat!( - "Offset of field: ", - stringify!(TPMT_SYM_DEF), - "::", - stringify!(mode) - ) + "Offset of field: TPMT_SYM_DEF::mode" ); } impl Default for TPMT_SYM_DEF { @@ -3969,42 +3162,27 @@ fn bindgen_test_layout_TPMT_SYM_DEF_OBJECT() { assert_eq!( ::std::mem::size_of::(), 6usize, - concat!("Size of: ", stringify!(TPMT_SYM_DEF_OBJECT)) + "Size of TPMT_SYM_DEF_OBJECT" ); assert_eq!( ::std::mem::align_of::(), 2usize, - concat!("Alignment of ", stringify!(TPMT_SYM_DEF_OBJECT)) + "Alignment of TPMT_SYM_DEF_OBJECT" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).algorithm) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMT_SYM_DEF_OBJECT), - "::", - stringify!(algorithm) - ) + "Offset of field: TPMT_SYM_DEF_OBJECT::algorithm" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).keyBits) as usize - ptr as usize }, 2usize, - concat!( - "Offset of field: ", - stringify!(TPMT_SYM_DEF_OBJECT), - "::", - stringify!(keyBits) - ) + "Offset of field: TPMT_SYM_DEF_OBJECT::keyBits" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).mode) as usize - ptr as usize }, 4usize, - concat!( - "Offset of field: ", - stringify!(TPMT_SYM_DEF_OBJECT), - "::", - stringify!(mode) - ) + "Offset of field: TPMT_SYM_DEF_OBJECT::mode" ); } impl Default for TPMT_SYM_DEF_OBJECT { @@ -4029,32 +3207,22 @@ fn bindgen_test_layout_TPM2B_SYM_KEY() { assert_eq!( ::std::mem::size_of::(), 34usize, - concat!("Size of: ", stringify!(TPM2B_SYM_KEY)) + "Size of TPM2B_SYM_KEY" ); assert_eq!( ::std::mem::align_of::(), 2usize, - concat!("Alignment of ", stringify!(TPM2B_SYM_KEY)) + "Alignment of TPM2B_SYM_KEY" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).size) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPM2B_SYM_KEY), - "::", - stringify!(size) - ) + "Offset of field: TPM2B_SYM_KEY::size" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).buffer) as usize - ptr as usize }, 2usize, - concat!( - "Offset of field: ", - stringify!(TPM2B_SYM_KEY), - "::", - stringify!(buffer) - ) + "Offset of field: TPM2B_SYM_KEY::buffer" ); } #[repr(C)] @@ -4069,22 +3237,17 @@ fn bindgen_test_layout_TPMS_SYMCIPHER_PARMS() { assert_eq!( ::std::mem::size_of::(), 6usize, - concat!("Size of: ", stringify!(TPMS_SYMCIPHER_PARMS)) + "Size of TPMS_SYMCIPHER_PARMS" ); assert_eq!( ::std::mem::align_of::(), 2usize, - concat!("Alignment of ", stringify!(TPMS_SYMCIPHER_PARMS)) + "Alignment of TPMS_SYMCIPHER_PARMS" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).sym) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMS_SYMCIPHER_PARMS), - "::", - stringify!(sym) - ) + "Offset of field: TPMS_SYMCIPHER_PARMS::sym" ); } impl Default for TPMS_SYMCIPHER_PARMS { @@ -4097,6 +3260,149 @@ impl Default for TPMS_SYMCIPHER_PARMS { } } #[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct TPM2B_LABEL { + pub size: UINT16, + pub buffer: [BYTE; 32usize], +} +#[test] +fn bindgen_test_layout_TPM2B_LABEL() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 34usize, + "Size of TPM2B_LABEL" + ); + assert_eq!( + ::std::mem::align_of::(), + 2usize, + "Alignment of TPM2B_LABEL" + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).size) as usize - ptr as usize }, + 0usize, + "Offset of field: TPM2B_LABEL::size" + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).buffer) as usize - ptr as usize }, + 2usize, + "Offset of field: TPM2B_LABEL::buffer" + ); +} +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct TPMS_DERIVE { + pub label: TPM2B_LABEL, + pub context: TPM2B_LABEL, +} +#[test] +fn bindgen_test_layout_TPMS_DERIVE() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 68usize, + "Size of TPMS_DERIVE" + ); + assert_eq!( + ::std::mem::align_of::(), + 2usize, + "Alignment of TPMS_DERIVE" + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).label) as usize - ptr as usize }, + 0usize, + "Offset of field: TPMS_DERIVE::label" + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).context) as usize - ptr as usize }, + 34usize, + "Offset of field: TPMS_DERIVE::context" + ); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct TPM2B_DERIVE { + pub size: UINT16, + pub buffer: [BYTE; 68usize], +} +#[test] +fn bindgen_test_layout_TPM2B_DERIVE() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 70usize, + "Size of TPM2B_DERIVE" + ); + assert_eq!( + ::std::mem::align_of::(), + 2usize, + "Alignment of TPM2B_DERIVE" + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).size) as usize - ptr as usize }, + 0usize, + "Offset of field: TPM2B_DERIVE::size" + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).buffer) as usize - ptr as usize }, + 2usize, + "Offset of field: TPM2B_DERIVE::buffer" + ); +} +impl Default for TPM2B_DERIVE { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union TPMU_SENSITIVE_CREATE { + pub create: [BYTE; 256usize], + pub derive: TPMS_DERIVE, +} +#[test] +fn bindgen_test_layout_TPMU_SENSITIVE_CREATE() { + const UNINIT: ::std::mem::MaybeUninit = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 256usize, + "Size of TPMU_SENSITIVE_CREATE" + ); + assert_eq!( + ::std::mem::align_of::(), + 2usize, + "Alignment of TPMU_SENSITIVE_CREATE" + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).create) as usize - ptr as usize }, + 0usize, + "Offset of field: TPMU_SENSITIVE_CREATE::create" + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).derive) as usize - ptr as usize }, + 0usize, + "Offset of field: TPMU_SENSITIVE_CREATE::derive" + ); +} +impl Default for TPMU_SENSITIVE_CREATE { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +#[repr(C)] #[derive(Debug, Copy, Clone)] pub struct TPM2B_SENSITIVE_DATA { pub size: UINT16, @@ -4109,32 +3415,22 @@ fn bindgen_test_layout_TPM2B_SENSITIVE_DATA() { assert_eq!( ::std::mem::size_of::(), 258usize, - concat!("Size of: ", stringify!(TPM2B_SENSITIVE_DATA)) + "Size of TPM2B_SENSITIVE_DATA" ); assert_eq!( ::std::mem::align_of::(), 2usize, - concat!("Alignment of ", stringify!(TPM2B_SENSITIVE_DATA)) + "Alignment of TPM2B_SENSITIVE_DATA" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).size) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPM2B_SENSITIVE_DATA), - "::", - stringify!(size) - ) + "Offset of field: TPM2B_SENSITIVE_DATA::size" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).buffer) as usize - ptr as usize }, 2usize, - concat!( - "Offset of field: ", - stringify!(TPM2B_SENSITIVE_DATA), - "::", - stringify!(buffer) - ) + "Offset of field: TPM2B_SENSITIVE_DATA::buffer" ); } impl Default for TPM2B_SENSITIVE_DATA { @@ -4160,32 +3456,22 @@ fn bindgen_test_layout_TPMS_SENSITIVE_CREATE() { assert_eq!( ::std::mem::size_of::(), 324usize, - concat!("Size of: ", stringify!(TPMS_SENSITIVE_CREATE)) + "Size of TPMS_SENSITIVE_CREATE" ); assert_eq!( ::std::mem::align_of::(), 2usize, - concat!("Alignment of ", stringify!(TPMS_SENSITIVE_CREATE)) + "Alignment of TPMS_SENSITIVE_CREATE" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).userAuth) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMS_SENSITIVE_CREATE), - "::", - stringify!(userAuth) - ) + "Offset of field: TPMS_SENSITIVE_CREATE::userAuth" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).data) as usize - ptr as usize }, 66usize, - concat!( - "Offset of field: ", - stringify!(TPMS_SENSITIVE_CREATE), - "::", - stringify!(data) - ) + "Offset of field: TPMS_SENSITIVE_CREATE::data" ); } impl Default for TPMS_SENSITIVE_CREATE { @@ -4211,32 +3497,22 @@ fn bindgen_test_layout_TPM2B_SENSITIVE_CREATE() { assert_eq!( ::std::mem::size_of::(), 326usize, - concat!("Size of: ", stringify!(TPM2B_SENSITIVE_CREATE)) + "Size of TPM2B_SENSITIVE_CREATE" ); assert_eq!( ::std::mem::align_of::(), 2usize, - concat!("Alignment of ", stringify!(TPM2B_SENSITIVE_CREATE)) + "Alignment of TPM2B_SENSITIVE_CREATE" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).size) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPM2B_SENSITIVE_CREATE), - "::", - stringify!(size) - ) + "Offset of field: TPM2B_SENSITIVE_CREATE::size" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).sensitive) as usize - ptr as usize }, 2usize, - concat!( - "Offset of field: ", - stringify!(TPM2B_SENSITIVE_CREATE), - "::", - stringify!(sensitive) - ) + "Offset of field: TPM2B_SENSITIVE_CREATE::sensitive" ); } impl Default for TPM2B_SENSITIVE_CREATE { @@ -4260,22 +3536,17 @@ fn bindgen_test_layout_TPMS_SCHEME_HASH() { assert_eq!( ::std::mem::size_of::(), 2usize, - concat!("Size of: ", stringify!(TPMS_SCHEME_HASH)) + "Size of TPMS_SCHEME_HASH" ); assert_eq!( ::std::mem::align_of::(), 2usize, - concat!("Alignment of ", stringify!(TPMS_SCHEME_HASH)) + "Alignment of TPMS_SCHEME_HASH" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).hashAlg) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMS_SCHEME_HASH), - "::", - stringify!(hashAlg) - ) + "Offset of field: TPMS_SCHEME_HASH::hashAlg" ); } #[repr(C)] @@ -4291,32 +3562,22 @@ fn bindgen_test_layout_TPMS_SCHEME_ECDAA() { assert_eq!( ::std::mem::size_of::(), 4usize, - concat!("Size of: ", stringify!(TPMS_SCHEME_ECDAA)) + "Size of TPMS_SCHEME_ECDAA" ); assert_eq!( ::std::mem::align_of::(), 2usize, - concat!("Alignment of ", stringify!(TPMS_SCHEME_ECDAA)) + "Alignment of TPMS_SCHEME_ECDAA" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).hashAlg) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMS_SCHEME_ECDAA), - "::", - stringify!(hashAlg) - ) + "Offset of field: TPMS_SCHEME_ECDAA::hashAlg" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).count) as usize - ptr as usize }, 2usize, - concat!( - "Offset of field: ", - stringify!(TPMS_SCHEME_ECDAA), - "::", - stringify!(count) - ) + "Offset of field: TPMS_SCHEME_ECDAA::count" ); } pub type TPMI_ALG_KEYEDHASH_SCHEME = TPM2_ALG_ID; @@ -4334,32 +3595,22 @@ fn bindgen_test_layout_TPMS_SCHEME_XOR() { assert_eq!( ::std::mem::size_of::(), 4usize, - concat!("Size of: ", stringify!(TPMS_SCHEME_XOR)) + "Size of TPMS_SCHEME_XOR" ); assert_eq!( ::std::mem::align_of::(), 2usize, - concat!("Alignment of ", stringify!(TPMS_SCHEME_XOR)) + "Alignment of TPMS_SCHEME_XOR" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).hashAlg) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMS_SCHEME_XOR), - "::", - stringify!(hashAlg) - ) + "Offset of field: TPMS_SCHEME_XOR::hashAlg" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).kdf) as usize - ptr as usize }, 2usize, - concat!( - "Offset of field: ", - stringify!(TPMS_SCHEME_XOR), - "::", - stringify!(kdf) - ) + "Offset of field: TPMS_SCHEME_XOR::kdf" ); } #[repr(C)] @@ -4367,6 +3618,7 @@ fn bindgen_test_layout_TPMS_SCHEME_XOR() { pub union TPMU_SCHEME_KEYEDHASH { pub hmac: TPMS_SCHEME_HMAC, pub exclusiveOr: TPMS_SCHEME_XOR, + pub null: TPMS_EMPTY, } #[test] fn bindgen_test_layout_TPMU_SCHEME_KEYEDHASH() { @@ -4376,32 +3628,27 @@ fn bindgen_test_layout_TPMU_SCHEME_KEYEDHASH() { assert_eq!( ::std::mem::size_of::(), 4usize, - concat!("Size of: ", stringify!(TPMU_SCHEME_KEYEDHASH)) + "Size of TPMU_SCHEME_KEYEDHASH" ); assert_eq!( ::std::mem::align_of::(), 2usize, - concat!("Alignment of ", stringify!(TPMU_SCHEME_KEYEDHASH)) + "Alignment of TPMU_SCHEME_KEYEDHASH" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).hmac) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_SCHEME_KEYEDHASH), - "::", - stringify!(hmac) - ) + "Offset of field: TPMU_SCHEME_KEYEDHASH::hmac" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).exclusiveOr) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_SCHEME_KEYEDHASH), - "::", - stringify!(exclusiveOr) - ) + "Offset of field: TPMU_SCHEME_KEYEDHASH::exclusiveOr" + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).null) as usize - ptr as usize }, + 0usize, + "Offset of field: TPMU_SCHEME_KEYEDHASH::null" ); } impl Default for TPMU_SCHEME_KEYEDHASH { @@ -4427,32 +3674,22 @@ fn bindgen_test_layout_TPMT_KEYEDHASH_SCHEME() { assert_eq!( ::std::mem::size_of::(), 6usize, - concat!("Size of: ", stringify!(TPMT_KEYEDHASH_SCHEME)) + "Size of TPMT_KEYEDHASH_SCHEME" ); assert_eq!( ::std::mem::align_of::(), 2usize, - concat!("Alignment of ", stringify!(TPMT_KEYEDHASH_SCHEME)) + "Alignment of TPMT_KEYEDHASH_SCHEME" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).scheme) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMT_KEYEDHASH_SCHEME), - "::", - stringify!(scheme) - ) + "Offset of field: TPMT_KEYEDHASH_SCHEME::scheme" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).details) as usize - ptr as usize }, 2usize, - concat!( - "Offset of field: ", - stringify!(TPMT_KEYEDHASH_SCHEME), - "::", - stringify!(details) - ) + "Offset of field: TPMT_KEYEDHASH_SCHEME::details" ); } impl Default for TPMT_KEYEDHASH_SCHEME { @@ -4481,6 +3718,7 @@ pub union TPMU_SIG_SCHEME { pub ecschnorr: TPMS_SIG_SCHEME_ECSCHNORR, pub hmac: TPMS_SCHEME_HMAC, pub any: TPMS_SCHEME_HASH, + pub null: TPMS_EMPTY, } #[test] fn bindgen_test_layout_TPMU_SIG_SCHEME() { @@ -4489,92 +3727,57 @@ fn bindgen_test_layout_TPMU_SIG_SCHEME() { assert_eq!( ::std::mem::size_of::(), 4usize, - concat!("Size of: ", stringify!(TPMU_SIG_SCHEME)) + "Size of TPMU_SIG_SCHEME" ); assert_eq!( ::std::mem::align_of::(), 2usize, - concat!("Alignment of ", stringify!(TPMU_SIG_SCHEME)) + "Alignment of TPMU_SIG_SCHEME" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).rsassa) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_SIG_SCHEME), - "::", - stringify!(rsassa) - ) + "Offset of field: TPMU_SIG_SCHEME::rsassa" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).rsapss) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_SIG_SCHEME), - "::", - stringify!(rsapss) - ) + "Offset of field: TPMU_SIG_SCHEME::rsapss" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).ecdsa) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_SIG_SCHEME), - "::", - stringify!(ecdsa) - ) + "Offset of field: TPMU_SIG_SCHEME::ecdsa" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).ecdaa) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_SIG_SCHEME), - "::", - stringify!(ecdaa) - ) + "Offset of field: TPMU_SIG_SCHEME::ecdaa" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).sm2) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_SIG_SCHEME), - "::", - stringify!(sm2) - ) + "Offset of field: TPMU_SIG_SCHEME::sm2" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).ecschnorr) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_SIG_SCHEME), - "::", - stringify!(ecschnorr) - ) + "Offset of field: TPMU_SIG_SCHEME::ecschnorr" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).hmac) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_SIG_SCHEME), - "::", - stringify!(hmac) - ) + "Offset of field: TPMU_SIG_SCHEME::hmac" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).any) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_SIG_SCHEME), - "::", - stringify!(any) - ) + "Offset of field: TPMU_SIG_SCHEME::any" + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).null) as usize - ptr as usize }, + 0usize, + "Offset of field: TPMU_SIG_SCHEME::null" ); } impl Default for TPMU_SIG_SCHEME { @@ -4599,32 +3802,22 @@ fn bindgen_test_layout_TPMT_SIG_SCHEME() { assert_eq!( ::std::mem::size_of::(), 6usize, - concat!("Size of: ", stringify!(TPMT_SIG_SCHEME)) + "Size of TPMT_SIG_SCHEME" ); assert_eq!( ::std::mem::align_of::(), 2usize, - concat!("Alignment of ", stringify!(TPMT_SIG_SCHEME)) + "Alignment of TPMT_SIG_SCHEME" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).scheme) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMT_SIG_SCHEME), - "::", - stringify!(scheme) - ) + "Offset of field: TPMT_SIG_SCHEME::scheme" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).details) as usize - ptr as usize }, 2usize, - concat!( - "Offset of field: ", - stringify!(TPMT_SIG_SCHEME), - "::", - stringify!(details) - ) + "Offset of field: TPMT_SIG_SCHEME::details" ); } impl Default for TPMT_SIG_SCHEME { @@ -4651,6 +3844,7 @@ pub union TPMU_KDF_SCHEME { pub kdf1_sp800_56a: TPMS_SCHEME_KDF1_SP800_56A, pub kdf2: TPMS_SCHEME_KDF2, pub kdf1_sp800_108: TPMS_SCHEME_KDF1_SP800_108, + pub null: TPMS_EMPTY, } #[test] fn bindgen_test_layout_TPMU_KDF_SCHEME() { @@ -4659,52 +3853,37 @@ fn bindgen_test_layout_TPMU_KDF_SCHEME() { assert_eq!( ::std::mem::size_of::(), 2usize, - concat!("Size of: ", stringify!(TPMU_KDF_SCHEME)) + "Size of TPMU_KDF_SCHEME" ); assert_eq!( ::std::mem::align_of::(), 2usize, - concat!("Alignment of ", stringify!(TPMU_KDF_SCHEME)) + "Alignment of TPMU_KDF_SCHEME" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).mgf1) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_KDF_SCHEME), - "::", - stringify!(mgf1) - ) + "Offset of field: TPMU_KDF_SCHEME::mgf1" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).kdf1_sp800_56a) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_KDF_SCHEME), - "::", - stringify!(kdf1_sp800_56a) - ) + "Offset of field: TPMU_KDF_SCHEME::kdf1_sp800_56a" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).kdf2) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_KDF_SCHEME), - "::", - stringify!(kdf2) - ) + "Offset of field: TPMU_KDF_SCHEME::kdf2" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).kdf1_sp800_108) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_KDF_SCHEME), - "::", - stringify!(kdf1_sp800_108) - ) + "Offset of field: TPMU_KDF_SCHEME::kdf1_sp800_108" + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).null) as usize - ptr as usize }, + 0usize, + "Offset of field: TPMU_KDF_SCHEME::null" ); } impl Default for TPMU_KDF_SCHEME { @@ -4729,32 +3908,22 @@ fn bindgen_test_layout_TPMT_KDF_SCHEME() { assert_eq!( ::std::mem::size_of::(), 4usize, - concat!("Size of: ", stringify!(TPMT_KDF_SCHEME)) + "Size of TPMT_KDF_SCHEME" ); assert_eq!( ::std::mem::align_of::(), 2usize, - concat!("Alignment of ", stringify!(TPMT_KDF_SCHEME)) + "Alignment of TPMT_KDF_SCHEME" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).scheme) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMT_KDF_SCHEME), - "::", - stringify!(scheme) - ) + "Offset of field: TPMT_KDF_SCHEME::scheme" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).details) as usize - ptr as usize }, 2usize, - concat!( - "Offset of field: ", - stringify!(TPMT_KDF_SCHEME), - "::", - stringify!(details) - ) + "Offset of field: TPMT_KDF_SCHEME::details" ); } impl Default for TPMT_KDF_SCHEME { @@ -4781,6 +3950,7 @@ pub union TPMU_ASYM_SCHEME { pub rsaes: TPMS_ENC_SCHEME_RSAES, pub oaep: TPMS_ENC_SCHEME_OAEP, pub anySig: TPMS_SCHEME_HASH, + pub null: TPMS_EMPTY, } #[test] fn bindgen_test_layout_TPMU_ASYM_SCHEME() { @@ -4789,122 +3959,72 @@ fn bindgen_test_layout_TPMU_ASYM_SCHEME() { assert_eq!( ::std::mem::size_of::(), 4usize, - concat!("Size of: ", stringify!(TPMU_ASYM_SCHEME)) + "Size of TPMU_ASYM_SCHEME" ); assert_eq!( ::std::mem::align_of::(), 2usize, - concat!("Alignment of ", stringify!(TPMU_ASYM_SCHEME)) + "Alignment of TPMU_ASYM_SCHEME" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).ecdh) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_ASYM_SCHEME), - "::", - stringify!(ecdh) - ) + "Offset of field: TPMU_ASYM_SCHEME::ecdh" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).ecmqv) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_ASYM_SCHEME), - "::", - stringify!(ecmqv) - ) + "Offset of field: TPMU_ASYM_SCHEME::ecmqv" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).rsassa) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_ASYM_SCHEME), - "::", - stringify!(rsassa) - ) + "Offset of field: TPMU_ASYM_SCHEME::rsassa" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).rsapss) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_ASYM_SCHEME), - "::", - stringify!(rsapss) - ) + "Offset of field: TPMU_ASYM_SCHEME::rsapss" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).ecdsa) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_ASYM_SCHEME), - "::", - stringify!(ecdsa) - ) + "Offset of field: TPMU_ASYM_SCHEME::ecdsa" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).ecdaa) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_ASYM_SCHEME), - "::", - stringify!(ecdaa) - ) + "Offset of field: TPMU_ASYM_SCHEME::ecdaa" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).sm2) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_ASYM_SCHEME), - "::", - stringify!(sm2) - ) + "Offset of field: TPMU_ASYM_SCHEME::sm2" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).ecschnorr) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_ASYM_SCHEME), - "::", - stringify!(ecschnorr) - ) + "Offset of field: TPMU_ASYM_SCHEME::ecschnorr" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).rsaes) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_ASYM_SCHEME), - "::", - stringify!(rsaes) - ) + "Offset of field: TPMU_ASYM_SCHEME::rsaes" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).oaep) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_ASYM_SCHEME), - "::", - stringify!(oaep) - ) + "Offset of field: TPMU_ASYM_SCHEME::oaep" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).anySig) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_ASYM_SCHEME), - "::", - stringify!(anySig) - ) + "Offset of field: TPMU_ASYM_SCHEME::anySig" + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).null) as usize - ptr as usize }, + 0usize, + "Offset of field: TPMU_ASYM_SCHEME::null" ); } impl Default for TPMU_ASYM_SCHEME { @@ -4929,32 +4049,22 @@ fn bindgen_test_layout_TPMT_ASYM_SCHEME() { assert_eq!( ::std::mem::size_of::(), 6usize, - concat!("Size of: ", stringify!(TPMT_ASYM_SCHEME)) + "Size of TPMT_ASYM_SCHEME" ); assert_eq!( ::std::mem::align_of::(), 2usize, - concat!("Alignment of ", stringify!(TPMT_ASYM_SCHEME)) + "Alignment of TPMT_ASYM_SCHEME" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).scheme) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMT_ASYM_SCHEME), - "::", - stringify!(scheme) - ) + "Offset of field: TPMT_ASYM_SCHEME::scheme" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).details) as usize - ptr as usize }, 2usize, - concat!( - "Offset of field: ", - stringify!(TPMT_ASYM_SCHEME), - "::", - stringify!(details) - ) + "Offset of field: TPMT_ASYM_SCHEME::details" ); } impl Default for TPMT_ASYM_SCHEME { @@ -4980,32 +4090,22 @@ fn bindgen_test_layout_TPMT_RSA_SCHEME() { assert_eq!( ::std::mem::size_of::(), 6usize, - concat!("Size of: ", stringify!(TPMT_RSA_SCHEME)) + "Size of TPMT_RSA_SCHEME" ); assert_eq!( ::std::mem::align_of::(), 2usize, - concat!("Alignment of ", stringify!(TPMT_RSA_SCHEME)) + "Alignment of TPMT_RSA_SCHEME" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).scheme) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMT_RSA_SCHEME), - "::", - stringify!(scheme) - ) + "Offset of field: TPMT_RSA_SCHEME::scheme" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).details) as usize - ptr as usize }, 2usize, - concat!( - "Offset of field: ", - stringify!(TPMT_RSA_SCHEME), - "::", - stringify!(details) - ) + "Offset of field: TPMT_RSA_SCHEME::details" ); } impl Default for TPMT_RSA_SCHEME { @@ -5031,32 +4131,22 @@ fn bindgen_test_layout_TPMT_RSA_DECRYPT() { assert_eq!( ::std::mem::size_of::(), 6usize, - concat!("Size of: ", stringify!(TPMT_RSA_DECRYPT)) + "Size of TPMT_RSA_DECRYPT" ); assert_eq!( ::std::mem::align_of::(), 2usize, - concat!("Alignment of ", stringify!(TPMT_RSA_DECRYPT)) + "Alignment of TPMT_RSA_DECRYPT" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).scheme) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMT_RSA_DECRYPT), - "::", - stringify!(scheme) - ) + "Offset of field: TPMT_RSA_DECRYPT::scheme" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).details) as usize - ptr as usize }, 2usize, - concat!( - "Offset of field: ", - stringify!(TPMT_RSA_DECRYPT), - "::", - stringify!(details) - ) + "Offset of field: TPMT_RSA_DECRYPT::details" ); } impl Default for TPMT_RSA_DECRYPT { @@ -5081,32 +4171,22 @@ fn bindgen_test_layout_TPM2B_PUBLIC_KEY_RSA() { assert_eq!( ::std::mem::size_of::(), 514usize, - concat!("Size of: ", stringify!(TPM2B_PUBLIC_KEY_RSA)) + "Size of TPM2B_PUBLIC_KEY_RSA" ); assert_eq!( ::std::mem::align_of::(), 2usize, - concat!("Alignment of ", stringify!(TPM2B_PUBLIC_KEY_RSA)) + "Alignment of TPM2B_PUBLIC_KEY_RSA" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).size) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPM2B_PUBLIC_KEY_RSA), - "::", - stringify!(size) - ) + "Offset of field: TPM2B_PUBLIC_KEY_RSA::size" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).buffer) as usize - ptr as usize }, 2usize, - concat!( - "Offset of field: ", - stringify!(TPM2B_PUBLIC_KEY_RSA), - "::", - stringify!(buffer) - ) + "Offset of field: TPM2B_PUBLIC_KEY_RSA::buffer" ); } impl Default for TPM2B_PUBLIC_KEY_RSA { @@ -5123,7 +4203,7 @@ pub type TPMI_RSA_KEY_BITS = TPM2_KEY_BITS; #[derive(Debug, Copy, Clone)] pub struct TPM2B_PRIVATE_KEY_RSA { pub size: UINT16, - pub buffer: [BYTE; 256usize], + pub buffer: [BYTE; 1280usize], } #[test] fn bindgen_test_layout_TPM2B_PRIVATE_KEY_RSA() { @@ -5132,33 +4212,23 @@ fn bindgen_test_layout_TPM2B_PRIVATE_KEY_RSA() { let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), - 258usize, - concat!("Size of: ", stringify!(TPM2B_PRIVATE_KEY_RSA)) + 1282usize, + "Size of TPM2B_PRIVATE_KEY_RSA" ); assert_eq!( ::std::mem::align_of::(), 2usize, - concat!("Alignment of ", stringify!(TPM2B_PRIVATE_KEY_RSA)) + "Alignment of TPM2B_PRIVATE_KEY_RSA" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).size) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPM2B_PRIVATE_KEY_RSA), - "::", - stringify!(size) - ) + "Offset of field: TPM2B_PRIVATE_KEY_RSA::size" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).buffer) as usize - ptr as usize }, 2usize, - concat!( - "Offset of field: ", - stringify!(TPM2B_PRIVATE_KEY_RSA), - "::", - stringify!(buffer) - ) + "Offset of field: TPM2B_PRIVATE_KEY_RSA::buffer" ); } impl Default for TPM2B_PRIVATE_KEY_RSA { @@ -5183,32 +4253,22 @@ fn bindgen_test_layout_TPM2B_ECC_PARAMETER() { assert_eq!( ::std::mem::size_of::(), 130usize, - concat!("Size of: ", stringify!(TPM2B_ECC_PARAMETER)) + "Size of TPM2B_ECC_PARAMETER" ); assert_eq!( ::std::mem::align_of::(), 2usize, - concat!("Alignment of ", stringify!(TPM2B_ECC_PARAMETER)) + "Alignment of TPM2B_ECC_PARAMETER" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).size) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPM2B_ECC_PARAMETER), - "::", - stringify!(size) - ) + "Offset of field: TPM2B_ECC_PARAMETER::size" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).buffer) as usize - ptr as usize }, 2usize, - concat!( - "Offset of field: ", - stringify!(TPM2B_ECC_PARAMETER), - "::", - stringify!(buffer) - ) + "Offset of field: TPM2B_ECC_PARAMETER::buffer" ); } impl Default for TPM2B_ECC_PARAMETER { @@ -5233,32 +4293,22 @@ fn bindgen_test_layout_TPMS_ECC_POINT() { assert_eq!( ::std::mem::size_of::(), 260usize, - concat!("Size of: ", stringify!(TPMS_ECC_POINT)) + "Size of TPMS_ECC_POINT" ); assert_eq!( ::std::mem::align_of::(), 2usize, - concat!("Alignment of ", stringify!(TPMS_ECC_POINT)) + "Alignment of TPMS_ECC_POINT" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).x) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMS_ECC_POINT), - "::", - stringify!(x) - ) + "Offset of field: TPMS_ECC_POINT::x" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).y) as usize - ptr as usize }, 130usize, - concat!( - "Offset of field: ", - stringify!(TPMS_ECC_POINT), - "::", - stringify!(y) - ) + "Offset of field: TPMS_ECC_POINT::y" ); } impl Default for TPMS_ECC_POINT { @@ -5283,32 +4333,22 @@ fn bindgen_test_layout_TPM2B_ECC_POINT() { assert_eq!( ::std::mem::size_of::(), 262usize, - concat!("Size of: ", stringify!(TPM2B_ECC_POINT)) + "Size of TPM2B_ECC_POINT" ); assert_eq!( ::std::mem::align_of::(), 2usize, - concat!("Alignment of ", stringify!(TPM2B_ECC_POINT)) + "Alignment of TPM2B_ECC_POINT" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).size) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPM2B_ECC_POINT), - "::", - stringify!(size) - ) + "Offset of field: TPM2B_ECC_POINT::size" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).point) as usize - ptr as usize }, 2usize, - concat!( - "Offset of field: ", - stringify!(TPM2B_ECC_POINT), - "::", - stringify!(point) - ) + "Offset of field: TPM2B_ECC_POINT::point" ); } impl Default for TPM2B_ECC_POINT { @@ -5335,32 +4375,22 @@ fn bindgen_test_layout_TPMT_ECC_SCHEME() { assert_eq!( ::std::mem::size_of::(), 6usize, - concat!("Size of: ", stringify!(TPMT_ECC_SCHEME)) + "Size of TPMT_ECC_SCHEME" ); assert_eq!( ::std::mem::align_of::(), 2usize, - concat!("Alignment of ", stringify!(TPMT_ECC_SCHEME)) + "Alignment of TPMT_ECC_SCHEME" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).scheme) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMT_ECC_SCHEME), - "::", - stringify!(scheme) - ) + "Offset of field: TPMT_ECC_SCHEME::scheme" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).details) as usize - ptr as usize }, 2usize, - concat!( - "Offset of field: ", - stringify!(TPMT_ECC_SCHEME), - "::", - stringify!(details) - ) + "Offset of field: TPMT_ECC_SCHEME::details" ); } impl Default for TPMT_ECC_SCHEME { @@ -5395,122 +4425,67 @@ fn bindgen_test_layout_TPMS_ALGORITHM_DETAIL_ECC() { assert_eq!( ::std::mem::size_of::(), 924usize, - concat!("Size of: ", stringify!(TPMS_ALGORITHM_DETAIL_ECC)) + "Size of TPMS_ALGORITHM_DETAIL_ECC" ); assert_eq!( ::std::mem::align_of::(), 2usize, - concat!("Alignment of ", stringify!(TPMS_ALGORITHM_DETAIL_ECC)) + "Alignment of TPMS_ALGORITHM_DETAIL_ECC" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).curveID) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMS_ALGORITHM_DETAIL_ECC), - "::", - stringify!(curveID) - ) + "Offset of field: TPMS_ALGORITHM_DETAIL_ECC::curveID" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).keySize) as usize - ptr as usize }, 2usize, - concat!( - "Offset of field: ", - stringify!(TPMS_ALGORITHM_DETAIL_ECC), - "::", - stringify!(keySize) - ) + "Offset of field: TPMS_ALGORITHM_DETAIL_ECC::keySize" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).kdf) as usize - ptr as usize }, 4usize, - concat!( - "Offset of field: ", - stringify!(TPMS_ALGORITHM_DETAIL_ECC), - "::", - stringify!(kdf) - ) + "Offset of field: TPMS_ALGORITHM_DETAIL_ECC::kdf" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).sign) as usize - ptr as usize }, 8usize, - concat!( - "Offset of field: ", - stringify!(TPMS_ALGORITHM_DETAIL_ECC), - "::", - stringify!(sign) - ) + "Offset of field: TPMS_ALGORITHM_DETAIL_ECC::sign" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).p) as usize - ptr as usize }, 14usize, - concat!( - "Offset of field: ", - stringify!(TPMS_ALGORITHM_DETAIL_ECC), - "::", - stringify!(p) - ) + "Offset of field: TPMS_ALGORITHM_DETAIL_ECC::p" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).a) as usize - ptr as usize }, 144usize, - concat!( - "Offset of field: ", - stringify!(TPMS_ALGORITHM_DETAIL_ECC), - "::", - stringify!(a) - ) + "Offset of field: TPMS_ALGORITHM_DETAIL_ECC::a" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).b) as usize - ptr as usize }, 274usize, - concat!( - "Offset of field: ", - stringify!(TPMS_ALGORITHM_DETAIL_ECC), - "::", - stringify!(b) - ) + "Offset of field: TPMS_ALGORITHM_DETAIL_ECC::b" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).gX) as usize - ptr as usize }, 404usize, - concat!( - "Offset of field: ", - stringify!(TPMS_ALGORITHM_DETAIL_ECC), - "::", - stringify!(gX) - ) + "Offset of field: TPMS_ALGORITHM_DETAIL_ECC::gX" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).gY) as usize - ptr as usize }, 534usize, - concat!( - "Offset of field: ", - stringify!(TPMS_ALGORITHM_DETAIL_ECC), - "::", - stringify!(gY) - ) + "Offset of field: TPMS_ALGORITHM_DETAIL_ECC::gY" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).n) as usize - ptr as usize }, 664usize, - concat!( - "Offset of field: ", - stringify!(TPMS_ALGORITHM_DETAIL_ECC), - "::", - stringify!(n) - ) + "Offset of field: TPMS_ALGORITHM_DETAIL_ECC::n" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).h) as usize - ptr as usize }, 794usize, - concat!( - "Offset of field: ", - stringify!(TPMS_ALGORITHM_DETAIL_ECC), - "::", - stringify!(h) - ) + "Offset of field: TPMS_ALGORITHM_DETAIL_ECC::h" ); } impl Default for TPMS_ALGORITHM_DETAIL_ECC { @@ -5535,32 +4510,22 @@ fn bindgen_test_layout_TPMS_SIGNATURE_RSA() { assert_eq!( ::std::mem::size_of::(), 516usize, - concat!("Size of: ", stringify!(TPMS_SIGNATURE_RSA)) + "Size of TPMS_SIGNATURE_RSA" ); assert_eq!( ::std::mem::align_of::(), 2usize, - concat!("Alignment of ", stringify!(TPMS_SIGNATURE_RSA)) + "Alignment of TPMS_SIGNATURE_RSA" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).hash) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMS_SIGNATURE_RSA), - "::", - stringify!(hash) - ) + "Offset of field: TPMS_SIGNATURE_RSA::hash" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).sig) as usize - ptr as usize }, 2usize, - concat!( - "Offset of field: ", - stringify!(TPMS_SIGNATURE_RSA), - "::", - stringify!(sig) - ) + "Offset of field: TPMS_SIGNATURE_RSA::sig" ); } impl Default for TPMS_SIGNATURE_RSA { @@ -5588,42 +4553,27 @@ fn bindgen_test_layout_TPMS_SIGNATURE_ECC() { assert_eq!( ::std::mem::size_of::(), 262usize, - concat!("Size of: ", stringify!(TPMS_SIGNATURE_ECC)) + "Size of TPMS_SIGNATURE_ECC" ); assert_eq!( ::std::mem::align_of::(), 2usize, - concat!("Alignment of ", stringify!(TPMS_SIGNATURE_ECC)) + "Alignment of TPMS_SIGNATURE_ECC" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).hash) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMS_SIGNATURE_ECC), - "::", - stringify!(hash) - ) + "Offset of field: TPMS_SIGNATURE_ECC::hash" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).signatureR) as usize - ptr as usize }, 2usize, - concat!( - "Offset of field: ", - stringify!(TPMS_SIGNATURE_ECC), - "::", - stringify!(signatureR) - ) + "Offset of field: TPMS_SIGNATURE_ECC::signatureR" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).signatureS) as usize - ptr as usize }, 132usize, - concat!( - "Offset of field: ", - stringify!(TPMS_SIGNATURE_ECC), - "::", - stringify!(signatureS) - ) + "Offset of field: TPMS_SIGNATURE_ECC::signatureS" ); } impl Default for TPMS_SIGNATURE_ECC { @@ -5650,6 +4600,7 @@ pub union TPMU_SIGNATURE { pub ecschnorr: TPMS_SIGNATURE_ECSCHNORR, pub hmac: TPMT_HA, pub any: TPMS_SCHEME_HASH, + pub null: TPMS_EMPTY, } #[test] fn bindgen_test_layout_TPMU_SIGNATURE() { @@ -5658,92 +4609,57 @@ fn bindgen_test_layout_TPMU_SIGNATURE() { assert_eq!( ::std::mem::size_of::(), 516usize, - concat!("Size of: ", stringify!(TPMU_SIGNATURE)) + "Size of TPMU_SIGNATURE" ); assert_eq!( ::std::mem::align_of::(), 2usize, - concat!("Alignment of ", stringify!(TPMU_SIGNATURE)) + "Alignment of TPMU_SIGNATURE" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).rsassa) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_SIGNATURE), - "::", - stringify!(rsassa) - ) + "Offset of field: TPMU_SIGNATURE::rsassa" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).rsapss) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_SIGNATURE), - "::", - stringify!(rsapss) - ) + "Offset of field: TPMU_SIGNATURE::rsapss" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).ecdsa) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_SIGNATURE), - "::", - stringify!(ecdsa) - ) + "Offset of field: TPMU_SIGNATURE::ecdsa" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).ecdaa) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_SIGNATURE), - "::", - stringify!(ecdaa) - ) + "Offset of field: TPMU_SIGNATURE::ecdaa" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).sm2) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_SIGNATURE), - "::", - stringify!(sm2) - ) + "Offset of field: TPMU_SIGNATURE::sm2" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).ecschnorr) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_SIGNATURE), - "::", - stringify!(ecschnorr) - ) + "Offset of field: TPMU_SIGNATURE::ecschnorr" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).hmac) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_SIGNATURE), - "::", - stringify!(hmac) - ) + "Offset of field: TPMU_SIGNATURE::hmac" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).any) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_SIGNATURE), - "::", - stringify!(any) - ) + "Offset of field: TPMU_SIGNATURE::any" + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).null) as usize - ptr as usize }, + 0usize, + "Offset of field: TPMU_SIGNATURE::null" ); } impl Default for TPMU_SIGNATURE { @@ -5768,32 +4684,22 @@ fn bindgen_test_layout_TPMT_SIGNATURE() { assert_eq!( ::std::mem::size_of::(), 518usize, - concat!("Size of: ", stringify!(TPMT_SIGNATURE)) + "Size of TPMT_SIGNATURE" ); assert_eq!( ::std::mem::align_of::(), 2usize, - concat!("Alignment of ", stringify!(TPMT_SIGNATURE)) + "Alignment of TPMT_SIGNATURE" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).sigAlg) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMT_SIGNATURE), - "::", - stringify!(sigAlg) - ) + "Offset of field: TPMT_SIGNATURE::sigAlg" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).signature) as usize - ptr as usize }, 2usize, - concat!( - "Offset of field: ", - stringify!(TPMT_SIGNATURE), - "::", - stringify!(signature) - ) + "Offset of field: TPMT_SIGNATURE::signature" ); } impl Default for TPMT_SIGNATURE { @@ -5821,52 +4727,32 @@ fn bindgen_test_layout_TPMU_ENCRYPTED_SECRET() { assert_eq!( ::std::mem::size_of::(), 512usize, - concat!("Size of: ", stringify!(TPMU_ENCRYPTED_SECRET)) + "Size of TPMU_ENCRYPTED_SECRET" ); assert_eq!( ::std::mem::align_of::(), 1usize, - concat!("Alignment of ", stringify!(TPMU_ENCRYPTED_SECRET)) + "Alignment of TPMU_ENCRYPTED_SECRET" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).ecc) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_ENCRYPTED_SECRET), - "::", - stringify!(ecc) - ) + "Offset of field: TPMU_ENCRYPTED_SECRET::ecc" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).rsa) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_ENCRYPTED_SECRET), - "::", - stringify!(rsa) - ) + "Offset of field: TPMU_ENCRYPTED_SECRET::rsa" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).symmetric) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_ENCRYPTED_SECRET), - "::", - stringify!(symmetric) - ) + "Offset of field: TPMU_ENCRYPTED_SECRET::symmetric" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).keyedHash) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_ENCRYPTED_SECRET), - "::", - stringify!(keyedHash) - ) + "Offset of field: TPMU_ENCRYPTED_SECRET::keyedHash" ); } impl Default for TPMU_ENCRYPTED_SECRET { @@ -5892,32 +4778,22 @@ fn bindgen_test_layout_TPM2B_ENCRYPTED_SECRET() { assert_eq!( ::std::mem::size_of::(), 514usize, - concat!("Size of: ", stringify!(TPM2B_ENCRYPTED_SECRET)) + "Size of TPM2B_ENCRYPTED_SECRET" ); assert_eq!( ::std::mem::align_of::(), 2usize, - concat!("Alignment of ", stringify!(TPM2B_ENCRYPTED_SECRET)) + "Alignment of TPM2B_ENCRYPTED_SECRET" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).size) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPM2B_ENCRYPTED_SECRET), - "::", - stringify!(size) - ) + "Offset of field: TPM2B_ENCRYPTED_SECRET::size" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).secret) as usize - ptr as usize }, 2usize, - concat!( - "Offset of field: ", - stringify!(TPM2B_ENCRYPTED_SECRET), - "::", - stringify!(secret) - ) + "Offset of field: TPM2B_ENCRYPTED_SECRET::secret" ); } impl Default for TPM2B_ENCRYPTED_SECRET { @@ -5937,6 +4813,7 @@ pub union TPMU_PUBLIC_ID { pub sym: TPM2B_DIGEST, pub rsa: TPM2B_PUBLIC_KEY_RSA, pub ecc: TPMS_ECC_POINT, + pub derive: TPMS_DERIVE, } #[test] fn bindgen_test_layout_TPMU_PUBLIC_ID() { @@ -5945,52 +4822,37 @@ fn bindgen_test_layout_TPMU_PUBLIC_ID() { assert_eq!( ::std::mem::size_of::(), 514usize, - concat!("Size of: ", stringify!(TPMU_PUBLIC_ID)) + "Size of TPMU_PUBLIC_ID" ); assert_eq!( ::std::mem::align_of::(), 2usize, - concat!("Alignment of ", stringify!(TPMU_PUBLIC_ID)) + "Alignment of TPMU_PUBLIC_ID" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).keyedHash) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_PUBLIC_ID), - "::", - stringify!(keyedHash) - ) + "Offset of field: TPMU_PUBLIC_ID::keyedHash" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).sym) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_PUBLIC_ID), - "::", - stringify!(sym) - ) + "Offset of field: TPMU_PUBLIC_ID::sym" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).rsa) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_PUBLIC_ID), - "::", - stringify!(rsa) - ) + "Offset of field: TPMU_PUBLIC_ID::rsa" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).ecc) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_PUBLIC_ID), - "::", - stringify!(ecc) - ) + "Offset of field: TPMU_PUBLIC_ID::ecc" + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).derive) as usize - ptr as usize }, + 0usize, + "Offset of field: TPMU_PUBLIC_ID::derive" ); } impl Default for TPMU_PUBLIC_ID { @@ -6014,22 +4876,17 @@ fn bindgen_test_layout_TPMS_KEYEDHASH_PARMS() { assert_eq!( ::std::mem::size_of::(), 6usize, - concat!("Size of: ", stringify!(TPMS_KEYEDHASH_PARMS)) + "Size of TPMS_KEYEDHASH_PARMS" ); assert_eq!( ::std::mem::align_of::(), 2usize, - concat!("Alignment of ", stringify!(TPMS_KEYEDHASH_PARMS)) + "Alignment of TPMS_KEYEDHASH_PARMS" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).scheme) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMS_KEYEDHASH_PARMS), - "::", - stringify!(scheme) - ) + "Offset of field: TPMS_KEYEDHASH_PARMS::scheme" ); } impl Default for TPMS_KEYEDHASH_PARMS { @@ -6054,32 +4911,22 @@ fn bindgen_test_layout_TPMS_ASYM_PARMS() { assert_eq!( ::std::mem::size_of::(), 12usize, - concat!("Size of: ", stringify!(TPMS_ASYM_PARMS)) + "Size of TPMS_ASYM_PARMS" ); assert_eq!( ::std::mem::align_of::(), 2usize, - concat!("Alignment of ", stringify!(TPMS_ASYM_PARMS)) + "Alignment of TPMS_ASYM_PARMS" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).symmetric) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMS_ASYM_PARMS), - "::", - stringify!(symmetric) - ) + "Offset of field: TPMS_ASYM_PARMS::symmetric" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).scheme) as usize - ptr as usize }, 6usize, - concat!( - "Offset of field: ", - stringify!(TPMS_ASYM_PARMS), - "::", - stringify!(scheme) - ) + "Offset of field: TPMS_ASYM_PARMS::scheme" ); } impl Default for TPMS_ASYM_PARMS { @@ -6106,52 +4953,32 @@ fn bindgen_test_layout_TPMS_RSA_PARMS() { assert_eq!( ::std::mem::size_of::(), 20usize, - concat!("Size of: ", stringify!(TPMS_RSA_PARMS)) + "Size of TPMS_RSA_PARMS" ); assert_eq!( ::std::mem::align_of::(), 4usize, - concat!("Alignment of ", stringify!(TPMS_RSA_PARMS)) + "Alignment of TPMS_RSA_PARMS" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).symmetric) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMS_RSA_PARMS), - "::", - stringify!(symmetric) - ) + "Offset of field: TPMS_RSA_PARMS::symmetric" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).scheme) as usize - ptr as usize }, 6usize, - concat!( - "Offset of field: ", - stringify!(TPMS_RSA_PARMS), - "::", - stringify!(scheme) - ) + "Offset of field: TPMS_RSA_PARMS::scheme" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).keyBits) as usize - ptr as usize }, 12usize, - concat!( - "Offset of field: ", - stringify!(TPMS_RSA_PARMS), - "::", - stringify!(keyBits) - ) + "Offset of field: TPMS_RSA_PARMS::keyBits" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).exponent) as usize - ptr as usize }, 16usize, - concat!( - "Offset of field: ", - stringify!(TPMS_RSA_PARMS), - "::", - stringify!(exponent) - ) + "Offset of field: TPMS_RSA_PARMS::exponent" ); } impl Default for TPMS_RSA_PARMS { @@ -6178,52 +5005,32 @@ fn bindgen_test_layout_TPMS_ECC_PARMS() { assert_eq!( ::std::mem::size_of::(), 18usize, - concat!("Size of: ", stringify!(TPMS_ECC_PARMS)) + "Size of TPMS_ECC_PARMS" ); assert_eq!( ::std::mem::align_of::(), 2usize, - concat!("Alignment of ", stringify!(TPMS_ECC_PARMS)) + "Alignment of TPMS_ECC_PARMS" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).symmetric) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMS_ECC_PARMS), - "::", - stringify!(symmetric) - ) + "Offset of field: TPMS_ECC_PARMS::symmetric" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).scheme) as usize - ptr as usize }, 6usize, - concat!( - "Offset of field: ", - stringify!(TPMS_ECC_PARMS), - "::", - stringify!(scheme) - ) + "Offset of field: TPMS_ECC_PARMS::scheme" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).curveID) as usize - ptr as usize }, 12usize, - concat!( - "Offset of field: ", - stringify!(TPMS_ECC_PARMS), - "::", - stringify!(curveID) - ) + "Offset of field: TPMS_ECC_PARMS::curveID" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).kdf) as usize - ptr as usize }, 14usize, - concat!( - "Offset of field: ", - stringify!(TPMS_ECC_PARMS), - "::", - stringify!(kdf) - ) + "Offset of field: TPMS_ECC_PARMS::kdf" ); } impl Default for TPMS_ECC_PARMS { @@ -6251,62 +5058,37 @@ fn bindgen_test_layout_TPMU_PUBLIC_PARMS() { assert_eq!( ::std::mem::size_of::(), 20usize, - concat!("Size of: ", stringify!(TPMU_PUBLIC_PARMS)) + "Size of TPMU_PUBLIC_PARMS" ); assert_eq!( ::std::mem::align_of::(), 4usize, - concat!("Alignment of ", stringify!(TPMU_PUBLIC_PARMS)) + "Alignment of TPMU_PUBLIC_PARMS" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).keyedHashDetail) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_PUBLIC_PARMS), - "::", - stringify!(keyedHashDetail) - ) + "Offset of field: TPMU_PUBLIC_PARMS::keyedHashDetail" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).symDetail) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_PUBLIC_PARMS), - "::", - stringify!(symDetail) - ) + "Offset of field: TPMU_PUBLIC_PARMS::symDetail" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).rsaDetail) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_PUBLIC_PARMS), - "::", - stringify!(rsaDetail) - ) + "Offset of field: TPMU_PUBLIC_PARMS::rsaDetail" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).eccDetail) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_PUBLIC_PARMS), - "::", - stringify!(eccDetail) - ) + "Offset of field: TPMU_PUBLIC_PARMS::eccDetail" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).asymDetail) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_PUBLIC_PARMS), - "::", - stringify!(asymDetail) - ) + "Offset of field: TPMU_PUBLIC_PARMS::asymDetail" ); } impl Default for TPMU_PUBLIC_PARMS { @@ -6331,32 +5113,22 @@ fn bindgen_test_layout_TPMT_PUBLIC_PARMS() { assert_eq!( ::std::mem::size_of::(), 24usize, - concat!("Size of: ", stringify!(TPMT_PUBLIC_PARMS)) + "Size of TPMT_PUBLIC_PARMS" ); assert_eq!( ::std::mem::align_of::(), 4usize, - concat!("Alignment of ", stringify!(TPMT_PUBLIC_PARMS)) + "Alignment of TPMT_PUBLIC_PARMS" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).type_) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMT_PUBLIC_PARMS), - "::", - stringify!(type_) - ) + "Offset of field: TPMT_PUBLIC_PARMS::type_" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).parameters) as usize - ptr as usize }, 4usize, - concat!( - "Offset of field: ", - stringify!(TPMT_PUBLIC_PARMS), - "::", - stringify!(parameters) - ) + "Offset of field: TPMT_PUBLIC_PARMS::parameters" ); } impl Default for TPMT_PUBLIC_PARMS { @@ -6385,72 +5157,42 @@ fn bindgen_test_layout_TPMT_PUBLIC() { assert_eq!( ::std::mem::size_of::(), 612usize, - concat!("Size of: ", stringify!(TPMT_PUBLIC)) + "Size of TPMT_PUBLIC" ); assert_eq!( ::std::mem::align_of::(), 4usize, - concat!("Alignment of ", stringify!(TPMT_PUBLIC)) + "Alignment of TPMT_PUBLIC" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).type_) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMT_PUBLIC), - "::", - stringify!(type_) - ) + "Offset of field: TPMT_PUBLIC::type_" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).nameAlg) as usize - ptr as usize }, 2usize, - concat!( - "Offset of field: ", - stringify!(TPMT_PUBLIC), - "::", - stringify!(nameAlg) - ) + "Offset of field: TPMT_PUBLIC::nameAlg" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).objectAttributes) as usize - ptr as usize }, 4usize, - concat!( - "Offset of field: ", - stringify!(TPMT_PUBLIC), - "::", - stringify!(objectAttributes) - ) + "Offset of field: TPMT_PUBLIC::objectAttributes" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).authPolicy) as usize - ptr as usize }, 8usize, - concat!( - "Offset of field: ", - stringify!(TPMT_PUBLIC), - "::", - stringify!(authPolicy) - ) + "Offset of field: TPMT_PUBLIC::authPolicy" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).parameters) as usize - ptr as usize }, 76usize, - concat!( - "Offset of field: ", - stringify!(TPMT_PUBLIC), - "::", - stringify!(parameters) - ) + "Offset of field: TPMT_PUBLIC::parameters" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).unique) as usize - ptr as usize }, 96usize, - concat!( - "Offset of field: ", - stringify!(TPMT_PUBLIC), - "::", - stringify!(unique) - ) + "Offset of field: TPMT_PUBLIC::unique" ); } impl Default for TPMT_PUBLIC { @@ -6475,32 +5217,22 @@ fn bindgen_test_layout_TPM2B_PUBLIC() { assert_eq!( ::std::mem::size_of::(), 616usize, - concat!("Size of: ", stringify!(TPM2B_PUBLIC)) + "Size of TPM2B_PUBLIC" ); assert_eq!( ::std::mem::align_of::(), 4usize, - concat!("Alignment of ", stringify!(TPM2B_PUBLIC)) + "Alignment of TPM2B_PUBLIC" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).size) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPM2B_PUBLIC), - "::", - stringify!(size) - ) + "Offset of field: TPM2B_PUBLIC::size" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).publicArea) as usize - ptr as usize }, 4usize, - concat!( - "Offset of field: ", - stringify!(TPM2B_PUBLIC), - "::", - stringify!(publicArea) - ) + "Offset of field: TPM2B_PUBLIC::publicArea" ); } impl Default for TPM2B_PUBLIC { @@ -6525,32 +5257,22 @@ fn bindgen_test_layout_TPM2B_TEMPLATE() { assert_eq!( ::std::mem::size_of::(), 614usize, - concat!("Size of: ", stringify!(TPM2B_TEMPLATE)) + "Size of TPM2B_TEMPLATE" ); assert_eq!( ::std::mem::align_of::(), 2usize, - concat!("Alignment of ", stringify!(TPM2B_TEMPLATE)) + "Alignment of TPM2B_TEMPLATE" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).size) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPM2B_TEMPLATE), - "::", - stringify!(size) - ) + "Offset of field: TPM2B_TEMPLATE::size" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).buffer) as usize - ptr as usize }, 2usize, - concat!( - "Offset of field: ", - stringify!(TPM2B_TEMPLATE), - "::", - stringify!(buffer) - ) + "Offset of field: TPM2B_TEMPLATE::buffer" ); } impl Default for TPM2B_TEMPLATE { @@ -6576,32 +5298,22 @@ fn bindgen_test_layout_TPM2B_PRIVATE_VENDOR_SPECIFIC() { assert_eq!( ::std::mem::size_of::(), 1282usize, - concat!("Size of: ", stringify!(TPM2B_PRIVATE_VENDOR_SPECIFIC)) + "Size of TPM2B_PRIVATE_VENDOR_SPECIFIC" ); assert_eq!( ::std::mem::align_of::(), 2usize, - concat!("Alignment of ", stringify!(TPM2B_PRIVATE_VENDOR_SPECIFIC)) + "Alignment of TPM2B_PRIVATE_VENDOR_SPECIFIC" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).size) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPM2B_PRIVATE_VENDOR_SPECIFIC), - "::", - stringify!(size) - ) + "Offset of field: TPM2B_PRIVATE_VENDOR_SPECIFIC::size" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).buffer) as usize - ptr as usize }, 2usize, - concat!( - "Offset of field: ", - stringify!(TPM2B_PRIVATE_VENDOR_SPECIFIC), - "::", - stringify!(buffer) - ) + "Offset of field: TPM2B_PRIVATE_VENDOR_SPECIFIC::buffer" ); } impl Default for TPM2B_PRIVATE_VENDOR_SPECIFIC { @@ -6630,62 +5342,37 @@ fn bindgen_test_layout_TPMU_SENSITIVE_COMPOSITE() { assert_eq!( ::std::mem::size_of::(), 1282usize, - concat!("Size of: ", stringify!(TPMU_SENSITIVE_COMPOSITE)) + "Size of TPMU_SENSITIVE_COMPOSITE" ); assert_eq!( ::std::mem::align_of::(), 2usize, - concat!("Alignment of ", stringify!(TPMU_SENSITIVE_COMPOSITE)) + "Alignment of TPMU_SENSITIVE_COMPOSITE" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).rsa) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_SENSITIVE_COMPOSITE), - "::", - stringify!(rsa) - ) + "Offset of field: TPMU_SENSITIVE_COMPOSITE::rsa" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).ecc) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_SENSITIVE_COMPOSITE), - "::", - stringify!(ecc) - ) + "Offset of field: TPMU_SENSITIVE_COMPOSITE::ecc" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).bits) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_SENSITIVE_COMPOSITE), - "::", - stringify!(bits) - ) + "Offset of field: TPMU_SENSITIVE_COMPOSITE::bits" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).sym) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_SENSITIVE_COMPOSITE), - "::", - stringify!(sym) - ) + "Offset of field: TPMU_SENSITIVE_COMPOSITE::sym" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).any) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMU_SENSITIVE_COMPOSITE), - "::", - stringify!(any) - ) + "Offset of field: TPMU_SENSITIVE_COMPOSITE::any" ); } impl Default for TPMU_SENSITIVE_COMPOSITE { @@ -6712,52 +5399,32 @@ fn bindgen_test_layout_TPMT_SENSITIVE() { assert_eq!( ::std::mem::size_of::(), 1416usize, - concat!("Size of: ", stringify!(TPMT_SENSITIVE)) + "Size of TPMT_SENSITIVE" ); assert_eq!( ::std::mem::align_of::(), 2usize, - concat!("Alignment of ", stringify!(TPMT_SENSITIVE)) + "Alignment of TPMT_SENSITIVE" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).sensitiveType) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMT_SENSITIVE), - "::", - stringify!(sensitiveType) - ) + "Offset of field: TPMT_SENSITIVE::sensitiveType" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).authValue) as usize - ptr as usize }, 2usize, - concat!( - "Offset of field: ", - stringify!(TPMT_SENSITIVE), - "::", - stringify!(authValue) - ) + "Offset of field: TPMT_SENSITIVE::authValue" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).seedValue) as usize - ptr as usize }, 68usize, - concat!( - "Offset of field: ", - stringify!(TPMT_SENSITIVE), - "::", - stringify!(seedValue) - ) + "Offset of field: TPMT_SENSITIVE::seedValue" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).sensitive) as usize - ptr as usize }, 134usize, - concat!( - "Offset of field: ", - stringify!(TPMT_SENSITIVE), - "::", - stringify!(sensitive) - ) + "Offset of field: TPMT_SENSITIVE::sensitive" ); } impl Default for TPMT_SENSITIVE { @@ -6782,32 +5449,22 @@ fn bindgen_test_layout_TPM2B_SENSITIVE() { assert_eq!( ::std::mem::size_of::(), 1418usize, - concat!("Size of: ", stringify!(TPM2B_SENSITIVE)) + "Size of TPM2B_SENSITIVE" ); assert_eq!( ::std::mem::align_of::(), 2usize, - concat!("Alignment of ", stringify!(TPM2B_SENSITIVE)) + "Alignment of TPM2B_SENSITIVE" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).size) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPM2B_SENSITIVE), - "::", - stringify!(size) - ) + "Offset of field: TPM2B_SENSITIVE::size" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).sensitiveArea) as usize - ptr as usize }, 2usize, - concat!( - "Offset of field: ", - stringify!(TPM2B_SENSITIVE), - "::", - stringify!(sensitiveArea) - ) + "Offset of field: TPM2B_SENSITIVE::sensitiveArea" ); } impl Default for TPM2B_SENSITIVE { @@ -6833,42 +5490,27 @@ fn bindgen_test_layout__PRIVATE() { assert_eq!( ::std::mem::size_of::<_PRIVATE>(), 1550usize, - concat!("Size of: ", stringify!(_PRIVATE)) + "Size of _PRIVATE" ); assert_eq!( ::std::mem::align_of::<_PRIVATE>(), 2usize, - concat!("Alignment of ", stringify!(_PRIVATE)) + "Alignment of _PRIVATE" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).integrityOuter) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(_PRIVATE), - "::", - stringify!(integrityOuter) - ) + "Offset of field: _PRIVATE::integrityOuter" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).integrityInner) as usize - ptr as usize }, 66usize, - concat!( - "Offset of field: ", - stringify!(_PRIVATE), - "::", - stringify!(integrityInner) - ) + "Offset of field: _PRIVATE::integrityInner" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).sensitive) as usize - ptr as usize }, 132usize, - concat!( - "Offset of field: ", - stringify!(_PRIVATE), - "::", - stringify!(sensitive) - ) + "Offset of field: _PRIVATE::sensitive" ); } impl Default for _PRIVATE { @@ -6893,32 +5535,22 @@ fn bindgen_test_layout_TPM2B_PRIVATE() { assert_eq!( ::std::mem::size_of::(), 1552usize, - concat!("Size of: ", stringify!(TPM2B_PRIVATE)) + "Size of TPM2B_PRIVATE" ); assert_eq!( ::std::mem::align_of::(), 2usize, - concat!("Alignment of ", stringify!(TPM2B_PRIVATE)) + "Alignment of TPM2B_PRIVATE" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).size) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPM2B_PRIVATE), - "::", - stringify!(size) - ) + "Offset of field: TPM2B_PRIVATE::size" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).buffer) as usize - ptr as usize }, 2usize, - concat!( - "Offset of field: ", - stringify!(TPM2B_PRIVATE), - "::", - stringify!(buffer) - ) + "Offset of field: TPM2B_PRIVATE::buffer" ); } impl Default for TPM2B_PRIVATE { @@ -6943,32 +5575,22 @@ fn bindgen_test_layout_TPMS_ID_OBJECT() { assert_eq!( ::std::mem::size_of::(), 132usize, - concat!("Size of: ", stringify!(TPMS_ID_OBJECT)) + "Size of TPMS_ID_OBJECT" ); assert_eq!( ::std::mem::align_of::(), 2usize, - concat!("Alignment of ", stringify!(TPMS_ID_OBJECT)) + "Alignment of TPMS_ID_OBJECT" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).integrityHMAC) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMS_ID_OBJECT), - "::", - stringify!(integrityHMAC) - ) + "Offset of field: TPMS_ID_OBJECT::integrityHMAC" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).encIdentity) as usize - ptr as usize }, 66usize, - concat!( - "Offset of field: ", - stringify!(TPMS_ID_OBJECT), - "::", - stringify!(encIdentity) - ) + "Offset of field: TPMS_ID_OBJECT::encIdentity" ); } impl Default for TPMS_ID_OBJECT { @@ -6993,32 +5615,22 @@ fn bindgen_test_layout_TPM2B_ID_OBJECT() { assert_eq!( ::std::mem::size_of::(), 134usize, - concat!("Size of: ", stringify!(TPM2B_ID_OBJECT)) + "Size of TPM2B_ID_OBJECT" ); assert_eq!( ::std::mem::align_of::(), 2usize, - concat!("Alignment of ", stringify!(TPM2B_ID_OBJECT)) + "Alignment of TPM2B_ID_OBJECT" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).size) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPM2B_ID_OBJECT), - "::", - stringify!(size) - ) + "Offset of field: TPM2B_ID_OBJECT::size" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).credential) as usize - ptr as usize }, 2usize, - concat!( - "Offset of field: ", - stringify!(TPM2B_ID_OBJECT), - "::", - stringify!(credential) - ) + "Offset of field: TPM2B_ID_OBJECT::credential" ); } impl Default for TPM2B_ID_OBJECT { @@ -7046,32 +5658,22 @@ fn bindgen_test_layout_TPMS_NV_PIN_COUNTER_PARAMETERS() { assert_eq!( ::std::mem::size_of::(), 8usize, - concat!("Size of: ", stringify!(TPMS_NV_PIN_COUNTER_PARAMETERS)) + "Size of TPMS_NV_PIN_COUNTER_PARAMETERS" ); assert_eq!( ::std::mem::align_of::(), 4usize, - concat!("Alignment of ", stringify!(TPMS_NV_PIN_COUNTER_PARAMETERS)) + "Alignment of TPMS_NV_PIN_COUNTER_PARAMETERS" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).pinCount) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMS_NV_PIN_COUNTER_PARAMETERS), - "::", - stringify!(pinCount) - ) + "Offset of field: TPMS_NV_PIN_COUNTER_PARAMETERS::pinCount" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).pinLimit) as usize - ptr as usize }, 4usize, - concat!( - "Offset of field: ", - stringify!(TPMS_NV_PIN_COUNTER_PARAMETERS), - "::", - stringify!(pinLimit) - ) + "Offset of field: TPMS_NV_PIN_COUNTER_PARAMETERS::pinLimit" ); } pub type TPMA_NV = u32; @@ -7091,62 +5693,37 @@ fn bindgen_test_layout_TPMS_NV_PUBLIC() { assert_eq!( ::std::mem::size_of::(), 80usize, - concat!("Size of: ", stringify!(TPMS_NV_PUBLIC)) + "Size of TPMS_NV_PUBLIC" ); assert_eq!( ::std::mem::align_of::(), 4usize, - concat!("Alignment of ", stringify!(TPMS_NV_PUBLIC)) + "Alignment of TPMS_NV_PUBLIC" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).nvIndex) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMS_NV_PUBLIC), - "::", - stringify!(nvIndex) - ) + "Offset of field: TPMS_NV_PUBLIC::nvIndex" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).nameAlg) as usize - ptr as usize }, 4usize, - concat!( - "Offset of field: ", - stringify!(TPMS_NV_PUBLIC), - "::", - stringify!(nameAlg) - ) + "Offset of field: TPMS_NV_PUBLIC::nameAlg" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).attributes) as usize - ptr as usize }, 8usize, - concat!( - "Offset of field: ", - stringify!(TPMS_NV_PUBLIC), - "::", - stringify!(attributes) - ) + "Offset of field: TPMS_NV_PUBLIC::attributes" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).authPolicy) as usize - ptr as usize }, 12usize, - concat!( - "Offset of field: ", - stringify!(TPMS_NV_PUBLIC), - "::", - stringify!(authPolicy) - ) + "Offset of field: TPMS_NV_PUBLIC::authPolicy" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).dataSize) as usize - ptr as usize }, 78usize, - concat!( - "Offset of field: ", - stringify!(TPMS_NV_PUBLIC), - "::", - stringify!(dataSize) - ) + "Offset of field: TPMS_NV_PUBLIC::dataSize" ); } impl Default for TPMS_NV_PUBLIC { @@ -7171,32 +5748,22 @@ fn bindgen_test_layout_TPM2B_NV_PUBLIC() { assert_eq!( ::std::mem::size_of::(), 84usize, - concat!("Size of: ", stringify!(TPM2B_NV_PUBLIC)) + "Size of TPM2B_NV_PUBLIC" ); assert_eq!( ::std::mem::align_of::(), 4usize, - concat!("Alignment of ", stringify!(TPM2B_NV_PUBLIC)) + "Alignment of TPM2B_NV_PUBLIC" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).size) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPM2B_NV_PUBLIC), - "::", - stringify!(size) - ) + "Offset of field: TPM2B_NV_PUBLIC::size" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).nvPublic) as usize - ptr as usize }, 4usize, - concat!( - "Offset of field: ", - stringify!(TPM2B_NV_PUBLIC), - "::", - stringify!(nvPublic) - ) + "Offset of field: TPM2B_NV_PUBLIC::nvPublic" ); } impl Default for TPM2B_NV_PUBLIC { @@ -7222,32 +5789,22 @@ fn bindgen_test_layout_TPM2B_CONTEXT_SENSITIVE() { assert_eq!( ::std::mem::size_of::(), 5122usize, - concat!("Size of: ", stringify!(TPM2B_CONTEXT_SENSITIVE)) + "Size of TPM2B_CONTEXT_SENSITIVE" ); assert_eq!( ::std::mem::align_of::(), 2usize, - concat!("Alignment of ", stringify!(TPM2B_CONTEXT_SENSITIVE)) + "Alignment of TPM2B_CONTEXT_SENSITIVE" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).size) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPM2B_CONTEXT_SENSITIVE), - "::", - stringify!(size) - ) + "Offset of field: TPM2B_CONTEXT_SENSITIVE::size" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).buffer) as usize - ptr as usize }, 2usize, - concat!( - "Offset of field: ", - stringify!(TPM2B_CONTEXT_SENSITIVE), - "::", - stringify!(buffer) - ) + "Offset of field: TPM2B_CONTEXT_SENSITIVE::buffer" ); } impl Default for TPM2B_CONTEXT_SENSITIVE { @@ -7272,32 +5829,22 @@ fn bindgen_test_layout_TPMS_CONTEXT_DATA() { assert_eq!( ::std::mem::size_of::(), 5188usize, - concat!("Size of: ", stringify!(TPMS_CONTEXT_DATA)) + "Size of TPMS_CONTEXT_DATA" ); assert_eq!( ::std::mem::align_of::(), 2usize, - concat!("Alignment of ", stringify!(TPMS_CONTEXT_DATA)) + "Alignment of TPMS_CONTEXT_DATA" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).integrity) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMS_CONTEXT_DATA), - "::", - stringify!(integrity) - ) + "Offset of field: TPMS_CONTEXT_DATA::integrity" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).encrypted) as usize - ptr as usize }, 66usize, - concat!( - "Offset of field: ", - stringify!(TPMS_CONTEXT_DATA), - "::", - stringify!(encrypted) - ) + "Offset of field: TPMS_CONTEXT_DATA::encrypted" ); } impl Default for TPMS_CONTEXT_DATA { @@ -7322,32 +5869,22 @@ fn bindgen_test_layout_TPM2B_CONTEXT_DATA() { assert_eq!( ::std::mem::size_of::(), 5190usize, - concat!("Size of: ", stringify!(TPM2B_CONTEXT_DATA)) + "Size of TPM2B_CONTEXT_DATA" ); assert_eq!( ::std::mem::align_of::(), 2usize, - concat!("Alignment of ", stringify!(TPM2B_CONTEXT_DATA)) + "Alignment of TPM2B_CONTEXT_DATA" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).size) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPM2B_CONTEXT_DATA), - "::", - stringify!(size) - ) + "Offset of field: TPM2B_CONTEXT_DATA::size" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).buffer) as usize - ptr as usize }, 2usize, - concat!( - "Offset of field: ", - stringify!(TPM2B_CONTEXT_DATA), - "::", - stringify!(buffer) - ) + "Offset of field: TPM2B_CONTEXT_DATA::buffer" ); } impl Default for TPM2B_CONTEXT_DATA { @@ -7374,52 +5911,32 @@ fn bindgen_test_layout_TPMS_CONTEXT() { assert_eq!( ::std::mem::size_of::(), 5208usize, - concat!("Size of: ", stringify!(TPMS_CONTEXT)) + "Size of TPMS_CONTEXT" ); assert_eq!( ::std::mem::align_of::(), 8usize, - concat!("Alignment of ", stringify!(TPMS_CONTEXT)) + "Alignment of TPMS_CONTEXT" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).sequence) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMS_CONTEXT), - "::", - stringify!(sequence) - ) + "Offset of field: TPMS_CONTEXT::sequence" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).savedHandle) as usize - ptr as usize }, 8usize, - concat!( - "Offset of field: ", - stringify!(TPMS_CONTEXT), - "::", - stringify!(savedHandle) - ) + "Offset of field: TPMS_CONTEXT::savedHandle" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).hierarchy) as usize - ptr as usize }, 12usize, - concat!( - "Offset of field: ", - stringify!(TPMS_CONTEXT), - "::", - stringify!(hierarchy) - ) + "Offset of field: TPMS_CONTEXT::hierarchy" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).contextBlob) as usize - ptr as usize }, 16usize, - concat!( - "Offset of field: ", - stringify!(TPMS_CONTEXT), - "::", - stringify!(contextBlob) - ) + "Offset of field: TPMS_CONTEXT::contextBlob" ); } impl Default for TPMS_CONTEXT { @@ -7449,82 +5966,47 @@ fn bindgen_test_layout_TPMS_CREATION_DATA() { assert_eq!( ::std::mem::size_of::(), 408usize, - concat!("Size of: ", stringify!(TPMS_CREATION_DATA)) + "Size of TPMS_CREATION_DATA" ); assert_eq!( ::std::mem::align_of::(), 4usize, - concat!("Alignment of ", stringify!(TPMS_CREATION_DATA)) + "Alignment of TPMS_CREATION_DATA" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).pcrSelect) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMS_CREATION_DATA), - "::", - stringify!(pcrSelect) - ) + "Offset of field: TPMS_CREATION_DATA::pcrSelect" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).pcrDigest) as usize - ptr as usize }, 132usize, - concat!( - "Offset of field: ", - stringify!(TPMS_CREATION_DATA), - "::", - stringify!(pcrDigest) - ) + "Offset of field: TPMS_CREATION_DATA::pcrDigest" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).locality) as usize - ptr as usize }, 198usize, - concat!( - "Offset of field: ", - stringify!(TPMS_CREATION_DATA), - "::", - stringify!(locality) - ) + "Offset of field: TPMS_CREATION_DATA::locality" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).parentNameAlg) as usize - ptr as usize }, 200usize, - concat!( - "Offset of field: ", - stringify!(TPMS_CREATION_DATA), - "::", - stringify!(parentNameAlg) - ) + "Offset of field: TPMS_CREATION_DATA::parentNameAlg" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).parentName) as usize - ptr as usize }, 202usize, - concat!( - "Offset of field: ", - stringify!(TPMS_CREATION_DATA), - "::", - stringify!(parentName) - ) + "Offset of field: TPMS_CREATION_DATA::parentName" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).parentQualifiedName) as usize - ptr as usize }, 272usize, - concat!( - "Offset of field: ", - stringify!(TPMS_CREATION_DATA), - "::", - stringify!(parentQualifiedName) - ) + "Offset of field: TPMS_CREATION_DATA::parentQualifiedName" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).outsideInfo) as usize - ptr as usize }, 342usize, - concat!( - "Offset of field: ", - stringify!(TPMS_CREATION_DATA), - "::", - stringify!(outsideInfo) - ) + "Offset of field: TPMS_CREATION_DATA::outsideInfo" ); } impl Default for TPMS_CREATION_DATA { @@ -7549,32 +6031,22 @@ fn bindgen_test_layout_TPM2B_CREATION_DATA() { assert_eq!( ::std::mem::size_of::(), 412usize, - concat!("Size of: ", stringify!(TPM2B_CREATION_DATA)) + "Size of TPM2B_CREATION_DATA" ); assert_eq!( ::std::mem::align_of::(), 4usize, - concat!("Alignment of ", stringify!(TPM2B_CREATION_DATA)) + "Alignment of TPM2B_CREATION_DATA" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).size) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPM2B_CREATION_DATA), - "::", - stringify!(size) - ) + "Offset of field: TPM2B_CREATION_DATA::size" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).creationData) as usize - ptr as usize }, 4usize, - concat!( - "Offset of field: ", - stringify!(TPM2B_CREATION_DATA), - "::", - stringify!(creationData) - ) + "Offset of field: TPM2B_CREATION_DATA::creationData" ); } impl Default for TPM2B_CREATION_DATA { @@ -7601,32 +6073,22 @@ fn bindgen_test_layout_TPMS_AC_OUTPUT() { assert_eq!( ::std::mem::size_of::(), 8usize, - concat!("Size of: ", stringify!(TPMS_AC_OUTPUT)) + "Size of TPMS_AC_OUTPUT" ); assert_eq!( ::std::mem::align_of::(), 4usize, - concat!("Alignment of ", stringify!(TPMS_AC_OUTPUT)) + "Alignment of TPMS_AC_OUTPUT" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).tag) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPMS_AC_OUTPUT), - "::", - stringify!(tag) - ) + "Offset of field: TPMS_AC_OUTPUT::tag" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).data) as usize - ptr as usize }, 4usize, - concat!( - "Offset of field: ", - stringify!(TPMS_AC_OUTPUT), - "::", - stringify!(data) - ) + "Offset of field: TPMS_AC_OUTPUT::data" ); } #[repr(C)] @@ -7642,32 +6104,22 @@ fn bindgen_test_layout_TPML_AC_CAPABILITIES() { assert_eq!( ::std::mem::size_of::(), 1028usize, - concat!("Size of: ", stringify!(TPML_AC_CAPABILITIES)) + "Size of TPML_AC_CAPABILITIES" ); assert_eq!( ::std::mem::align_of::(), 4usize, - concat!("Alignment of ", stringify!(TPML_AC_CAPABILITIES)) + "Alignment of TPML_AC_CAPABILITIES" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).count) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TPML_AC_CAPABILITIES), - "::", - stringify!(count) - ) + "Offset of field: TPML_AC_CAPABILITIES::count" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).acCapabilities) as usize - ptr as usize }, 4usize, - concat!( - "Offset of field: ", - stringify!(TPML_AC_CAPABILITIES), - "::", - stringify!(acCapabilities) - ) + "Offset of field: TPML_AC_CAPABILITIES::acCapabilities" ); } impl Default for TPML_AC_CAPABILITIES { @@ -7679,6 +6131,47 @@ impl Default for TPML_AC_CAPABILITIES { } } } +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct TPML_INTEL_PTT_PROPERTY { + pub count: UINT32, + pub property: [UINT32; 256usize], +} +#[test] +fn bindgen_test_layout_TPML_INTEL_PTT_PROPERTY() { + const UNINIT: ::std::mem::MaybeUninit = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 1028usize, + "Size of TPML_INTEL_PTT_PROPERTY" + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + "Alignment of TPML_INTEL_PTT_PROPERTY" + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).count) as usize - ptr as usize }, + 0usize, + "Offset of field: TPML_INTEL_PTT_PROPERTY::count" + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).property) as usize - ptr as usize }, + 4usize, + "Offset of field: TPML_INTEL_PTT_PROPERTY::property" + ); +} +impl Default for TPML_INTEL_PTT_PROPERTY { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} pub type nfds_t = ::std::os::raw::c_ulong; #[repr(C)] #[derive(Debug, Default, Copy, Clone)] @@ -7691,45 +6184,26 @@ pub struct pollfd { fn bindgen_test_layout_pollfd() { const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 8usize, - concat!("Size of: ", stringify!(pollfd)) - ); + assert_eq!(::std::mem::size_of::(), 8usize, "Size of pollfd"); assert_eq!( ::std::mem::align_of::(), 4usize, - concat!("Alignment of ", stringify!(pollfd)) + "Alignment of pollfd" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).fd) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(pollfd), - "::", - stringify!(fd) - ) + "Offset of field: pollfd::fd" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).events) as usize - ptr as usize }, 4usize, - concat!( - "Offset of field: ", - stringify!(pollfd), - "::", - stringify!(events) - ) + "Offset of field: pollfd::events" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).revents) as usize - ptr as usize }, 6usize, - concat!( - "Offset of field: ", - stringify!(pollfd), - "::", - stringify!(revents) - ) + "Offset of field: pollfd::revents" ); } extern "C" { @@ -7809,92 +6283,52 @@ fn bindgen_test_layout_TSS2_TCTI_CONTEXT_COMMON_V1() { assert_eq!( ::std::mem::size_of::(), 64usize, - concat!("Size of: ", stringify!(TSS2_TCTI_CONTEXT_COMMON_V1)) + "Size of TSS2_TCTI_CONTEXT_COMMON_V1" ); assert_eq!( ::std::mem::align_of::(), 8usize, - concat!("Alignment of ", stringify!(TSS2_TCTI_CONTEXT_COMMON_V1)) + "Alignment of TSS2_TCTI_CONTEXT_COMMON_V1" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).magic) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TSS2_TCTI_CONTEXT_COMMON_V1), - "::", - stringify!(magic) - ) + "Offset of field: TSS2_TCTI_CONTEXT_COMMON_V1::magic" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).version) as usize - ptr as usize }, 8usize, - concat!( - "Offset of field: ", - stringify!(TSS2_TCTI_CONTEXT_COMMON_V1), - "::", - stringify!(version) - ) + "Offset of field: TSS2_TCTI_CONTEXT_COMMON_V1::version" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).transmit) as usize - ptr as usize }, 16usize, - concat!( - "Offset of field: ", - stringify!(TSS2_TCTI_CONTEXT_COMMON_V1), - "::", - stringify!(transmit) - ) + "Offset of field: TSS2_TCTI_CONTEXT_COMMON_V1::transmit" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).receive) as usize - ptr as usize }, 24usize, - concat!( - "Offset of field: ", - stringify!(TSS2_TCTI_CONTEXT_COMMON_V1), - "::", - stringify!(receive) - ) + "Offset of field: TSS2_TCTI_CONTEXT_COMMON_V1::receive" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).finalize) as usize - ptr as usize }, 32usize, - concat!( - "Offset of field: ", - stringify!(TSS2_TCTI_CONTEXT_COMMON_V1), - "::", - stringify!(finalize) - ) + "Offset of field: TSS2_TCTI_CONTEXT_COMMON_V1::finalize" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).cancel) as usize - ptr as usize }, 40usize, - concat!( - "Offset of field: ", - stringify!(TSS2_TCTI_CONTEXT_COMMON_V1), - "::", - stringify!(cancel) - ) + "Offset of field: TSS2_TCTI_CONTEXT_COMMON_V1::cancel" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).getPollHandles) as usize - ptr as usize }, 48usize, - concat!( - "Offset of field: ", - stringify!(TSS2_TCTI_CONTEXT_COMMON_V1), - "::", - stringify!(getPollHandles) - ) + "Offset of field: TSS2_TCTI_CONTEXT_COMMON_V1::getPollHandles" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).setLocality) as usize - ptr as usize }, 56usize, - concat!( - "Offset of field: ", - stringify!(TSS2_TCTI_CONTEXT_COMMON_V1), - "::", - stringify!(setLocality) - ) + "Offset of field: TSS2_TCTI_CONTEXT_COMMON_V1::setLocality" ); } #[repr(C)] @@ -7911,32 +6345,22 @@ fn bindgen_test_layout_TSS2_TCTI_CONTEXT_COMMON_V2() { assert_eq!( ::std::mem::size_of::(), 72usize, - concat!("Size of: ", stringify!(TSS2_TCTI_CONTEXT_COMMON_V2)) + "Size of TSS2_TCTI_CONTEXT_COMMON_V2" ); assert_eq!( ::std::mem::align_of::(), 8usize, - concat!("Alignment of ", stringify!(TSS2_TCTI_CONTEXT_COMMON_V2)) + "Alignment of TSS2_TCTI_CONTEXT_COMMON_V2" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).v1) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TSS2_TCTI_CONTEXT_COMMON_V2), - "::", - stringify!(v1) - ) + "Offset of field: TSS2_TCTI_CONTEXT_COMMON_V2::v1" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).makeSticky) as usize - ptr as usize }, 64usize, - concat!( - "Offset of field: ", - stringify!(TSS2_TCTI_CONTEXT_COMMON_V2), - "::", - stringify!(makeSticky) - ) + "Offset of field: TSS2_TCTI_CONTEXT_COMMON_V2::makeSticky" ); } pub type TSS2_TCTI_CONTEXT_COMMON_CURRENT = TSS2_TCTI_CONTEXT_COMMON_V2; @@ -7956,62 +6380,37 @@ fn bindgen_test_layout_TSS2_TCTI_INFO() { assert_eq!( ::std::mem::size_of::(), 40usize, - concat!("Size of: ", stringify!(TSS2_TCTI_INFO)) + "Size of TSS2_TCTI_INFO" ); assert_eq!( ::std::mem::align_of::(), 8usize, - concat!("Alignment of ", stringify!(TSS2_TCTI_INFO)) + "Alignment of TSS2_TCTI_INFO" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).version) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TSS2_TCTI_INFO), - "::", - stringify!(version) - ) + "Offset of field: TSS2_TCTI_INFO::version" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).name) as usize - ptr as usize }, 8usize, - concat!( - "Offset of field: ", - stringify!(TSS2_TCTI_INFO), - "::", - stringify!(name) - ) + "Offset of field: TSS2_TCTI_INFO::name" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).description) as usize - ptr as usize }, 16usize, - concat!( - "Offset of field: ", - stringify!(TSS2_TCTI_INFO), - "::", - stringify!(description) - ) + "Offset of field: TSS2_TCTI_INFO::description" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).config_help) as usize - ptr as usize }, 24usize, - concat!( - "Offset of field: ", - stringify!(TSS2_TCTI_INFO), - "::", - stringify!(config_help) - ) + "Offset of field: TSS2_TCTI_INFO::config_help" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).init) as usize - ptr as usize }, 32usize, - concat!( - "Offset of field: ", - stringify!(TSS2_TCTI_INFO), - "::", - stringify!(init) - ) + "Offset of field: TSS2_TCTI_INFO::init" ); } impl Default for TSS2_TCTI_INFO { @@ -8045,32 +6444,22 @@ fn bindgen_test_layout_TSS2L_SYS_AUTH_COMMAND() { assert_eq!( ::std::mem::size_of::(), 424usize, - concat!("Size of: ", stringify!(TSS2L_SYS_AUTH_COMMAND)) + "Size of TSS2L_SYS_AUTH_COMMAND" ); assert_eq!( ::std::mem::align_of::(), 4usize, - concat!("Alignment of ", stringify!(TSS2L_SYS_AUTH_COMMAND)) + "Alignment of TSS2L_SYS_AUTH_COMMAND" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).count) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TSS2L_SYS_AUTH_COMMAND), - "::", - stringify!(count) - ) + "Offset of field: TSS2L_SYS_AUTH_COMMAND::count" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).auths) as usize - ptr as usize }, 4usize, - concat!( - "Offset of field: ", - stringify!(TSS2L_SYS_AUTH_COMMAND), - "::", - stringify!(auths) - ) + "Offset of field: TSS2L_SYS_AUTH_COMMAND::auths" ); } impl Default for TSS2L_SYS_AUTH_COMMAND { @@ -8096,32 +6485,22 @@ fn bindgen_test_layout_TSS2L_SYS_AUTH_RESPONSE() { assert_eq!( ::std::mem::size_of::(), 404usize, - concat!("Size of: ", stringify!(TSS2L_SYS_AUTH_RESPONSE)) + "Size of TSS2L_SYS_AUTH_RESPONSE" ); assert_eq!( ::std::mem::align_of::(), 2usize, - concat!("Alignment of ", stringify!(TSS2L_SYS_AUTH_RESPONSE)) + "Alignment of TSS2L_SYS_AUTH_RESPONSE" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).count) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(TSS2L_SYS_AUTH_RESPONSE), - "::", - stringify!(count) - ) + "Offset of field: TSS2L_SYS_AUTH_RESPONSE::count" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).auths) as usize - ptr as usize }, 2usize, - concat!( - "Offset of field: ", - stringify!(TSS2L_SYS_AUTH_RESPONSE), - "::", - stringify!(auths) - ) + "Offset of field: TSS2L_SYS_AUTH_RESPONSE::auths" ); } impl Default for TSS2L_SYS_AUTH_RESPONSE { @@ -8935,6 +7314,31 @@ extern "C" { rspAuthsArray: *mut TSS2L_SYS_AUTH_RESPONSE, ) -> TSS2_RC; } +extern "C" { + pub fn Tss2_Sys_MAC_Prepare( + sysContext: *mut TSS2_SYS_CONTEXT, + handle: TPMI_DH_OBJECT, + buffer: *const TPM2B_MAX_BUFFER, + inScheme: TPMI_ALG_MAC_SCHEME, + ) -> TSS2_RC; +} +extern "C" { + pub fn Tss2_Sys_MAC_Complete( + sysContext: *mut TSS2_SYS_CONTEXT, + outMAC: *mut TPM2B_DIGEST, + ) -> TSS2_RC; +} +extern "C" { + pub fn Tss2_Sys_MAC( + sysContext: *mut TSS2_SYS_CONTEXT, + handle: TPMI_DH_OBJECT, + cmdAuths: *const TSS2L_SYS_AUTH_COMMAND, + buffer: *const TPM2B_MAX_BUFFER, + inScheme: TPMI_ALG_MAC_SCHEME, + outMAC: *mut TPM2B_DIGEST, + rspAuths: *mut TSS2L_SYS_AUTH_RESPONSE, + ) -> TSS2_RC; +} extern "C" { pub fn Tss2_Sys_GetRandom_Prepare( sysContext: *mut TSS2_SYS_CONTEXT, @@ -8998,6 +7402,31 @@ extern "C" { rspAuthsArray: *mut TSS2L_SYS_AUTH_RESPONSE, ) -> TSS2_RC; } +extern "C" { + pub fn Tss2_Sys_MAC_Start_Prepare( + sysContext: *mut TSS2_SYS_CONTEXT, + handle: TPMI_DH_OBJECT, + auth: *const TPM2B_AUTH, + inScheme: TPMI_ALG_MAC_SCHEME, + ) -> TSS2_RC; +} +extern "C" { + pub fn Tss2_Sys_MAC_Start_Complete( + sysContext: *mut TSS2_SYS_CONTEXT, + sequenceHandle: *mut TPMI_DH_OBJECT, + ) -> TSS2_RC; +} +extern "C" { + pub fn Tss2_Sys_MAC_Start( + sysContext: *mut TSS2_SYS_CONTEXT, + handle: TPMI_DH_OBJECT, + cmdAuths: *const TSS2L_SYS_AUTH_COMMAND, + auth: *const TPM2B_AUTH, + inScheme: TPMI_ALG_MAC_SCHEME, + sequenceHandle: *mut TPMI_DH_OBJECT, + rspAuthsArray: *mut TSS2L_SYS_AUTH_RESPONSE, + ) -> TSS2_RC; +} extern "C" { pub fn Tss2_Sys_HashSequenceStart_Prepare( sysContext: *mut TSS2_SYS_CONTEXT, @@ -10985,8 +9414,248 @@ pub type ESYS_TR = u32; pub struct ESYS_CONTEXT { _unused: [u8; 0], } -extern "C" { - pub fn Esys_Initialize( +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct ESYS_CRYPTO_CONTEXT_BLOB { + _unused: [u8; 0], +} +pub type ESYS_CRYPTO_HASH_START_FNP = ::std::option::Option< + unsafe extern "C" fn( + context: *mut *mut ESYS_CRYPTO_CONTEXT_BLOB, + hashAlg: TPM2_ALG_ID, + userdata: *mut ::std::os::raw::c_void, + ) -> TSS2_RC, +>; +pub type ESYS_CRYPTO_HASH_UPDATE_FNP = ::std::option::Option< + unsafe extern "C" fn( + context: *mut ESYS_CRYPTO_CONTEXT_BLOB, + buffer: *const u8, + size: size_t, + userdata: *mut ::std::os::raw::c_void, + ) -> TSS2_RC, +>; +pub type ESYS_CRYPTO_HASH_FINISH_FNP = ::std::option::Option< + unsafe extern "C" fn( + context: *mut *mut ESYS_CRYPTO_CONTEXT_BLOB, + buffer: *mut u8, + size: *mut size_t, + userdata: *mut ::std::os::raw::c_void, + ) -> TSS2_RC, +>; +pub type ESYS_CRYPTO_HASH_ABORT_FNP = ::std::option::Option< + unsafe extern "C" fn( + context: *mut *mut ESYS_CRYPTO_CONTEXT_BLOB, + userdata: *mut ::std::os::raw::c_void, + ), +>; +pub type ESYS_CRYPTO_HMAC_START_FNP = ::std::option::Option< + unsafe extern "C" fn( + context: *mut *mut ESYS_CRYPTO_CONTEXT_BLOB, + hashAlg: TPM2_ALG_ID, + key: *const u8, + size: size_t, + userdata: *mut ::std::os::raw::c_void, + ) -> TSS2_RC, +>; +pub type ESYS_CRYPTO_HMAC_UPDATE_FNP = ::std::option::Option< + unsafe extern "C" fn( + context: *mut ESYS_CRYPTO_CONTEXT_BLOB, + buffer: *const u8, + size: size_t, + userdata: *mut ::std::os::raw::c_void, + ) -> TSS2_RC, +>; +pub type ESYS_CRYPTO_HMAC_FINISH_FNP = ::std::option::Option< + unsafe extern "C" fn( + context: *mut *mut ESYS_CRYPTO_CONTEXT_BLOB, + buffer: *mut u8, + size: *mut size_t, + userdata: *mut ::std::os::raw::c_void, + ) -> TSS2_RC, +>; +pub type ESYS_CRYPTO_HMAC_ABORT_FNP = ::std::option::Option< + unsafe extern "C" fn( + context: *mut *mut ESYS_CRYPTO_CONTEXT_BLOB, + userdata: *mut ::std::os::raw::c_void, + ), +>; +pub type ESYS_CRYPTO_GET_RANDOM2B_FNP = ::std::option::Option< + unsafe extern "C" fn( + nonce: *mut TPM2B_NONCE, + num_bytes: size_t, + userdata: *mut ::std::os::raw::c_void, + ) -> TSS2_RC, +>; +pub type ESYS_CRYPTO_GET_ECDH_POINT_FNP = ::std::option::Option< + unsafe extern "C" fn( + key: *mut TPM2B_PUBLIC, + max_out_size: size_t, + Z: *mut TPM2B_ECC_PARAMETER, + Q: *mut TPMS_ECC_POINT, + out_buffer: *mut BYTE, + out_size: *mut size_t, + userdata: *mut ::std::os::raw::c_void, + ) -> TSS2_RC, +>; +pub type ESYS_CRYPTO_AES_ENCRYPT_FNP = ::std::option::Option< + unsafe extern "C" fn( + key: *mut u8, + tpm_sym_alg: TPM2_ALG_ID, + key_bits: TPMI_AES_KEY_BITS, + tpm_mode: TPM2_ALG_ID, + buffer: *mut u8, + buffer_size: size_t, + iv: *mut u8, + userdata: *mut ::std::os::raw::c_void, + ) -> TSS2_RC, +>; +pub type ESYS_CRYPTO_AES_DECRYPT_FNP = ::std::option::Option< + unsafe extern "C" fn( + key: *mut u8, + tpm_sym_alg: TPM2_ALG_ID, + key_bits: TPMI_AES_KEY_BITS, + tpm_mode: TPM2_ALG_ID, + buffer: *mut u8, + buffer_size: size_t, + iv: *mut u8, + userdata: *mut ::std::os::raw::c_void, + ) -> TSS2_RC, +>; +pub type ESYS_CRYPTO_PK_RSA_ENCRYPT_FNP = ::std::option::Option< + unsafe extern "C" fn( + pub_tpm_key: *mut TPM2B_PUBLIC, + in_size: size_t, + in_buffer: *mut BYTE, + max_out_size: size_t, + out_buffer: *mut BYTE, + out_size: *mut size_t, + label: *const ::std::os::raw::c_char, + userdata: *mut ::std::os::raw::c_void, + ) -> TSS2_RC, +>; +pub type ESYS_CRYPTO_INIT_FNP = + ::std::option::Option TSS2_RC>; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct ESYS_CRYPTO_CALLBACKS { + pub rsa_pk_encrypt: ESYS_CRYPTO_PK_RSA_ENCRYPT_FNP, + pub hash_start: ESYS_CRYPTO_HASH_START_FNP, + pub hash_update: ESYS_CRYPTO_HASH_UPDATE_FNP, + pub hash_finish: ESYS_CRYPTO_HASH_FINISH_FNP, + pub hash_abort: ESYS_CRYPTO_HASH_ABORT_FNP, + pub hmac_start: ESYS_CRYPTO_HMAC_START_FNP, + pub hmac_update: ESYS_CRYPTO_HMAC_UPDATE_FNP, + pub hmac_finish: ESYS_CRYPTO_HMAC_FINISH_FNP, + pub hmac_abort: ESYS_CRYPTO_HMAC_ABORT_FNP, + pub get_random2b: ESYS_CRYPTO_GET_RANDOM2B_FNP, + pub get_ecdh_point: ESYS_CRYPTO_GET_ECDH_POINT_FNP, + pub aes_encrypt: ESYS_CRYPTO_AES_ENCRYPT_FNP, + pub aes_decrypt: ESYS_CRYPTO_AES_DECRYPT_FNP, + pub init: ESYS_CRYPTO_INIT_FNP, + pub userdata: *mut ::std::os::raw::c_void, +} +#[test] +fn bindgen_test_layout_ESYS_CRYPTO_CALLBACKS() { + const UNINIT: ::std::mem::MaybeUninit = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 120usize, + "Size of ESYS_CRYPTO_CALLBACKS" + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + "Alignment of ESYS_CRYPTO_CALLBACKS" + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).rsa_pk_encrypt) as usize - ptr as usize }, + 0usize, + "Offset of field: ESYS_CRYPTO_CALLBACKS::rsa_pk_encrypt" + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).hash_start) as usize - ptr as usize }, + 8usize, + "Offset of field: ESYS_CRYPTO_CALLBACKS::hash_start" + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).hash_update) as usize - ptr as usize }, + 16usize, + "Offset of field: ESYS_CRYPTO_CALLBACKS::hash_update" + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).hash_finish) as usize - ptr as usize }, + 24usize, + "Offset of field: ESYS_CRYPTO_CALLBACKS::hash_finish" + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).hash_abort) as usize - ptr as usize }, + 32usize, + "Offset of field: ESYS_CRYPTO_CALLBACKS::hash_abort" + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).hmac_start) as usize - ptr as usize }, + 40usize, + "Offset of field: ESYS_CRYPTO_CALLBACKS::hmac_start" + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).hmac_update) as usize - ptr as usize }, + 48usize, + "Offset of field: ESYS_CRYPTO_CALLBACKS::hmac_update" + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).hmac_finish) as usize - ptr as usize }, + 56usize, + "Offset of field: ESYS_CRYPTO_CALLBACKS::hmac_finish" + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).hmac_abort) as usize - ptr as usize }, + 64usize, + "Offset of field: ESYS_CRYPTO_CALLBACKS::hmac_abort" + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).get_random2b) as usize - ptr as usize }, + 72usize, + "Offset of field: ESYS_CRYPTO_CALLBACKS::get_random2b" + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).get_ecdh_point) as usize - ptr as usize }, + 80usize, + "Offset of field: ESYS_CRYPTO_CALLBACKS::get_ecdh_point" + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).aes_encrypt) as usize - ptr as usize }, + 88usize, + "Offset of field: ESYS_CRYPTO_CALLBACKS::aes_encrypt" + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).aes_decrypt) as usize - ptr as usize }, + 96usize, + "Offset of field: ESYS_CRYPTO_CALLBACKS::aes_decrypt" + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).init) as usize - ptr as usize }, + 104usize, + "Offset of field: ESYS_CRYPTO_CALLBACKS::init" + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).userdata) as usize - ptr as usize }, + 112usize, + "Offset of field: ESYS_CRYPTO_CALLBACKS::userdata" + ); +} +impl Default for ESYS_CRYPTO_CALLBACKS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +extern "C" { + pub fn Esys_Initialize( esys_context: *mut *mut ESYS_CONTEXT, tcti: *mut TSS2_TCTI_CONTEXT, abiVersion: *mut TSS2_ABI_VERSION, @@ -11441,6 +10110,95 @@ extern "C" { extern "C" { pub fn Esys_ACT_SetTimeout_Finish(esysContext: *mut ESYS_CONTEXT) -> TSS2_RC; } +extern "C" { + pub fn Esys_AC_GetCapability_Async( + esysContext: *mut ESYS_CONTEXT, + optionalSession1: ESYS_TR, + optionalSession2: ESYS_TR, + optionalSession3: ESYS_TR, + ac: ESYS_TR, + capability: TPM_AT, + count: UINT32, + ) -> TSS2_RC; +} +extern "C" { + pub fn Esys_AC_GetCapability_Finish( + esysContext: *mut ESYS_CONTEXT, + moreData: *mut TPMI_YES_NO, + capabilityData: *mut *mut TPML_AC_CAPABILITIES, + ) -> TSS2_RC; +} +extern "C" { + pub fn Esys_AC_GetCapability( + esysContext: *mut ESYS_CONTEXT, + optionalSession1: ESYS_TR, + optionalSession2: ESYS_TR, + optionalSession3: ESYS_TR, + ac: ESYS_TR, + capability: TPM_AT, + count: UINT32, + moreData: *mut TPMI_YES_NO, + capabilityData: *mut *mut TPML_AC_CAPABILITIES, + ) -> TSS2_RC; +} +extern "C" { + pub fn Esys_AC_Send_Async( + esysContext: *mut ESYS_CONTEXT, + sendObject: ESYS_TR, + nvAuthHandle: ESYS_TR, + optionalSession1: ESYS_TR, + optionalSession2: ESYS_TR, + optionalSession3: ESYS_TR, + ac: ESYS_TR, + acDataIn: *mut TPM2B_MAX_BUFFER, + ) -> TSS2_RC; +} +extern "C" { + pub fn Esys_AC_Send_Finish( + esysContext: *mut ESYS_CONTEXT, + acDataOut: *mut *mut TPMS_AC_OUTPUT, + ) -> TSS2_RC; +} +extern "C" { + pub fn Esys_AC_Send( + esysContext: *mut ESYS_CONTEXT, + sendObject: ESYS_TR, + nvAuthHandle: ESYS_TR, + optionalSession1: ESYS_TR, + optionalSession2: ESYS_TR, + optionalSession3: ESYS_TR, + ac: ESYS_TR, + acDataIn: *mut TPM2B_MAX_BUFFER, + acDataOut: *mut *mut TPMS_AC_OUTPUT, + ) -> TSS2_RC; +} +extern "C" { + pub fn Esys_Policy_AC_SendSelect_Async( + esysContext: *mut ESYS_CONTEXT, + policySession1: ESYS_TR, + optionalSession2: ESYS_TR, + optionalSession3: ESYS_TR, + objectName: *mut TPM2B_NAME, + authHandleName: *mut TPM2B_NAME, + acName: *mut TPM2B_NAME, + includeObject: TPMI_YES_NO, + ) -> TSS2_RC; +} +extern "C" { + pub fn Esys_Policy_AC_SendSelect_Finish(esysContext: *mut ESYS_CONTEXT) -> TSS2_RC; +} +extern "C" { + pub fn Esys_Policy_AC_SendSelect( + esysContext: *mut ESYS_CONTEXT, + policySession1: ESYS_TR, + optionalSession2: ESYS_TR, + optionalSession3: ESYS_TR, + objectName: *mut TPM2B_NAME, + authHandleName: *mut TPM2B_NAME, + acName: *mut TPM2B_NAME, + includeObject: TPMI_YES_NO, + ) -> TSS2_RC; +} extern "C" { pub fn Esys_MakeCredential( esysContext: *mut ESYS_CONTEXT, @@ -11970,6 +10728,35 @@ extern "C" { outHMAC: *mut *mut TPM2B_DIGEST, ) -> TSS2_RC; } +extern "C" { + pub fn Esys_MAC_Async( + esysContext: *mut ESYS_CONTEXT, + handle: ESYS_TR, + handleSession1: ESYS_TR, + optionalSession2: ESYS_TR, + optionalSession3: ESYS_TR, + buffer: *const TPM2B_MAX_BUFFER, + inScheme: TPMI_ALG_MAC_SCHEME, + ) -> TSS2_RC; +} +extern "C" { + pub fn Esys_MAC_Finish( + esysContext: *mut ESYS_CONTEXT, + outMAC: *mut *mut TPM2B_DIGEST, + ) -> TSS2_RC; +} +extern "C" { + pub fn Esys_MAC( + esysContext: *mut ESYS_CONTEXT, + handle: ESYS_TR, + handleSession1: ESYS_TR, + optionalSession2: ESYS_TR, + optionalSession3: ESYS_TR, + buffer: *const TPM2B_MAX_BUFFER, + inScheme: TPMI_ALG_MAC_SCHEME, + outMAC: *mut *mut TPM2B_DIGEST, + ) -> TSS2_RC; +} extern "C" { pub fn Esys_GetRandom( esysContext: *mut ESYS_CONTEXT, @@ -12045,6 +10832,35 @@ extern "C" { sequenceHandle: *mut ESYS_TR, ) -> TSS2_RC; } +extern "C" { + pub fn Esys_MAC_Start( + esysContext: *mut ESYS_CONTEXT, + handle: ESYS_TR, + handleSession1: ESYS_TR, + optionalSession2: ESYS_TR, + optionalSession3: ESYS_TR, + auth: *const TPM2B_AUTH, + inScheme: TPMI_ALG_MAC_SCHEME, + sequenceHandle: *mut ESYS_TR, + ) -> TSS2_RC; +} +extern "C" { + pub fn Esys_MAC_Start_Async( + esysContext: *mut ESYS_CONTEXT, + handle: ESYS_TR, + handleSession1: ESYS_TR, + optionalSession2: ESYS_TR, + optionalSession3: ESYS_TR, + auth: *const TPM2B_AUTH, + inScheme: TPMI_ALG_MAC_SCHEME, + ) -> TSS2_RC; +} +extern "C" { + pub fn Esys_MAC_Start_Finish( + esysContext: *mut ESYS_CONTEXT, + sequenceHandle: *mut ESYS_TR, + ) -> TSS2_RC; +} extern "C" { pub fn Esys_HashSequenceStart( esysContext: *mut ESYS_CONTEXT, @@ -14216,6 +13032,12 @@ extern "C" { sys_context: *mut *mut TSS2_SYS_CONTEXT, ) -> TSS2_RC; } +extern "C" { + pub fn Esys_SetCryptoCallbacks( + esysContext: *mut ESYS_CONTEXT, + callbacks: *mut ESYS_CRYPTO_CALLBACKS, + ) -> TSS2_RC; +} pub type __gwchar_t = ::std::os::raw::c_int; #[repr(C)] #[derive(Debug, Default, Copy, Clone)] @@ -14230,32 +13052,22 @@ fn bindgen_test_layout_imaxdiv_t() { assert_eq!( ::std::mem::size_of::(), 16usize, - concat!("Size of: ", stringify!(imaxdiv_t)) + "Size of imaxdiv_t" ); assert_eq!( ::std::mem::align_of::(), 8usize, - concat!("Alignment of ", stringify!(imaxdiv_t)) + "Alignment of imaxdiv_t" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).quot) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(imaxdiv_t), - "::", - stringify!(quot) - ) + "Offset of field: imaxdiv_t::quot" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).rem) as usize - ptr as usize }, 8usize, - concat!( - "Offset of field: ", - stringify!(imaxdiv_t), - "::", - stringify!(rem) - ) + "Offset of field: imaxdiv_t::rem" ); } extern "C" { @@ -14306,35 +13118,21 @@ pub struct div_t { fn bindgen_test_layout_div_t() { const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 8usize, - concat!("Size of: ", stringify!(div_t)) - ); + assert_eq!(::std::mem::size_of::(), 8usize, "Size of div_t"); assert_eq!( ::std::mem::align_of::(), 4usize, - concat!("Alignment of ", stringify!(div_t)) + "Alignment of div_t" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).quot) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(div_t), - "::", - stringify!(quot) - ) + "Offset of field: div_t::quot" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).rem) as usize - ptr as usize }, 4usize, - concat!( - "Offset of field: ", - stringify!(div_t), - "::", - stringify!(rem) - ) + "Offset of field: div_t::rem" ); } #[repr(C)] @@ -14347,35 +13145,21 @@ pub struct ldiv_t { fn bindgen_test_layout_ldiv_t() { const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 16usize, - concat!("Size of: ", stringify!(ldiv_t)) - ); + assert_eq!(::std::mem::size_of::(), 16usize, "Size of ldiv_t"); assert_eq!( ::std::mem::align_of::(), 8usize, - concat!("Alignment of ", stringify!(ldiv_t)) + "Alignment of ldiv_t" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).quot) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(ldiv_t), - "::", - stringify!(quot) - ) + "Offset of field: ldiv_t::quot" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).rem) as usize - ptr as usize }, 8usize, - concat!( - "Offset of field: ", - stringify!(ldiv_t), - "::", - stringify!(rem) - ) + "Offset of field: ldiv_t::rem" ); } #[repr(C)] @@ -14388,35 +13172,21 @@ pub struct lldiv_t { fn bindgen_test_layout_lldiv_t() { const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 16usize, - concat!("Size of: ", stringify!(lldiv_t)) - ); + assert_eq!(::std::mem::size_of::(), 16usize, "Size of lldiv_t"); assert_eq!( ::std::mem::align_of::(), 8usize, - concat!("Alignment of ", stringify!(lldiv_t)) + "Alignment of lldiv_t" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).quot) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(lldiv_t), - "::", - stringify!(quot) - ) + "Offset of field: lldiv_t::quot" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).rem) as usize - ptr as usize }, 8usize, - concat!( - "Offset of field: ", - stringify!(lldiv_t), - "::", - stringify!(rem) - ) + "Offset of field: lldiv_t::rem" ); } extern "C" { @@ -14545,22 +13315,17 @@ fn bindgen_test_layout___sigset_t() { assert_eq!( ::std::mem::size_of::<__sigset_t>(), 128usize, - concat!("Size of: ", stringify!(__sigset_t)) + "Size of __sigset_t" ); assert_eq!( ::std::mem::align_of::<__sigset_t>(), 8usize, - concat!("Alignment of ", stringify!(__sigset_t)) + "Alignment of __sigset_t" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__val) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(__sigset_t), - "::", - stringify!(__val) - ) + "Offset of field: __sigset_t::__val" ); } pub type sigset_t = __sigset_t; @@ -14574,35 +13339,21 @@ pub struct timeval { fn bindgen_test_layout_timeval() { const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 16usize, - concat!("Size of: ", stringify!(timeval)) - ); + assert_eq!(::std::mem::size_of::(), 16usize, "Size of timeval"); assert_eq!( ::std::mem::align_of::(), 8usize, - concat!("Alignment of ", stringify!(timeval)) + "Alignment of timeval" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).tv_sec) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(timeval), - "::", - stringify!(tv_sec) - ) + "Offset of field: timeval::tv_sec" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).tv_usec) as usize - ptr as usize }, 8usize, - concat!( - "Offset of field: ", - stringify!(timeval), - "::", - stringify!(tv_usec) - ) + "Offset of field: timeval::tv_usec" ); } #[repr(C)] @@ -14618,32 +13369,22 @@ fn bindgen_test_layout_timespec() { assert_eq!( ::std::mem::size_of::(), 16usize, - concat!("Size of: ", stringify!(timespec)) + "Size of timespec" ); assert_eq!( ::std::mem::align_of::(), 8usize, - concat!("Alignment of ", stringify!(timespec)) + "Alignment of timespec" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).tv_sec) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(timespec), - "::", - stringify!(tv_sec) - ) + "Offset of field: timespec::tv_sec" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).tv_nsec) as usize - ptr as usize }, 8usize, - concat!( - "Offset of field: ", - stringify!(timespec), - "::", - stringify!(tv_nsec) - ) + "Offset of field: timespec::tv_nsec" ); } pub type suseconds_t = __suseconds_t; @@ -14657,25 +13398,16 @@ pub struct fd_set { fn bindgen_test_layout_fd_set() { const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 128usize, - concat!("Size of: ", stringify!(fd_set)) - ); + assert_eq!(::std::mem::size_of::(), 128usize, "Size of fd_set"); assert_eq!( ::std::mem::align_of::(), 8usize, - concat!("Alignment of ", stringify!(fd_set)) + "Alignment of fd_set" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__fds_bits) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(fd_set), - "::", - stringify!(__fds_bits) - ) + "Offset of field: fd_set::__fds_bits" ); } pub type fd_mask = __fd_mask; @@ -14722,35 +13454,22 @@ fn bindgen_test_layout___atomic_wide_counter__bindgen_ty_1() { assert_eq!( ::std::mem::size_of::<__atomic_wide_counter__bindgen_ty_1>(), 8usize, - concat!("Size of: ", stringify!(__atomic_wide_counter__bindgen_ty_1)) + "Size of __atomic_wide_counter__bindgen_ty_1" ); assert_eq!( ::std::mem::align_of::<__atomic_wide_counter__bindgen_ty_1>(), 4usize, - concat!( - "Alignment of ", - stringify!(__atomic_wide_counter__bindgen_ty_1) - ) + "Alignment of __atomic_wide_counter__bindgen_ty_1" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__low) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(__atomic_wide_counter__bindgen_ty_1), - "::", - stringify!(__low) - ) + "Offset of field: __atomic_wide_counter__bindgen_ty_1::__low" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__high) as usize - ptr as usize }, 4usize, - concat!( - "Offset of field: ", - stringify!(__atomic_wide_counter__bindgen_ty_1), - "::", - stringify!(__high) - ) + "Offset of field: __atomic_wide_counter__bindgen_ty_1::__high" ); } #[test] @@ -14761,32 +13480,22 @@ fn bindgen_test_layout___atomic_wide_counter() { assert_eq!( ::std::mem::size_of::<__atomic_wide_counter>(), 8usize, - concat!("Size of: ", stringify!(__atomic_wide_counter)) + "Size of __atomic_wide_counter" ); assert_eq!( ::std::mem::align_of::<__atomic_wide_counter>(), 8usize, - concat!("Alignment of ", stringify!(__atomic_wide_counter)) + "Alignment of __atomic_wide_counter" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__value64) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(__atomic_wide_counter), - "::", - stringify!(__value64) - ) + "Offset of field: __atomic_wide_counter::__value64" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__value32) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(__atomic_wide_counter), - "::", - stringify!(__value32) - ) + "Offset of field: __atomic_wide_counter::__value32" ); } impl Default for __atomic_wide_counter { @@ -14812,32 +13521,22 @@ fn bindgen_test_layout___pthread_internal_list() { assert_eq!( ::std::mem::size_of::<__pthread_internal_list>(), 16usize, - concat!("Size of: ", stringify!(__pthread_internal_list)) + "Size of __pthread_internal_list" ); assert_eq!( ::std::mem::align_of::<__pthread_internal_list>(), 8usize, - concat!("Alignment of ", stringify!(__pthread_internal_list)) + "Alignment of __pthread_internal_list" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__prev) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(__pthread_internal_list), - "::", - stringify!(__prev) - ) + "Offset of field: __pthread_internal_list::__prev" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__next) as usize - ptr as usize }, 8usize, - concat!( - "Offset of field: ", - stringify!(__pthread_internal_list), - "::", - stringify!(__next) - ) + "Offset of field: __pthread_internal_list::__next" ); } impl Default for __pthread_internal_list { @@ -14863,22 +13562,17 @@ fn bindgen_test_layout___pthread_internal_slist() { assert_eq!( ::std::mem::size_of::<__pthread_internal_slist>(), 8usize, - concat!("Size of: ", stringify!(__pthread_internal_slist)) + "Size of __pthread_internal_slist" ); assert_eq!( ::std::mem::align_of::<__pthread_internal_slist>(), 8usize, - concat!("Alignment of ", stringify!(__pthread_internal_slist)) + "Alignment of __pthread_internal_slist" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__next) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(__pthread_internal_slist), - "::", - stringify!(__next) - ) + "Offset of field: __pthread_internal_slist::__next" ); } impl Default for __pthread_internal_slist { @@ -14910,92 +13604,52 @@ fn bindgen_test_layout___pthread_mutex_s() { assert_eq!( ::std::mem::size_of::<__pthread_mutex_s>(), 40usize, - concat!("Size of: ", stringify!(__pthread_mutex_s)) + "Size of __pthread_mutex_s" ); assert_eq!( ::std::mem::align_of::<__pthread_mutex_s>(), 8usize, - concat!("Alignment of ", stringify!(__pthread_mutex_s)) + "Alignment of __pthread_mutex_s" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__lock) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(__pthread_mutex_s), - "::", - stringify!(__lock) - ) + "Offset of field: __pthread_mutex_s::__lock" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__count) as usize - ptr as usize }, 4usize, - concat!( - "Offset of field: ", - stringify!(__pthread_mutex_s), - "::", - stringify!(__count) - ) + "Offset of field: __pthread_mutex_s::__count" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__owner) as usize - ptr as usize }, 8usize, - concat!( - "Offset of field: ", - stringify!(__pthread_mutex_s), - "::", - stringify!(__owner) - ) + "Offset of field: __pthread_mutex_s::__owner" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__nusers) as usize - ptr as usize }, 12usize, - concat!( - "Offset of field: ", - stringify!(__pthread_mutex_s), - "::", - stringify!(__nusers) - ) + "Offset of field: __pthread_mutex_s::__nusers" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__kind) as usize - ptr as usize }, 16usize, - concat!( - "Offset of field: ", - stringify!(__pthread_mutex_s), - "::", - stringify!(__kind) - ) + "Offset of field: __pthread_mutex_s::__kind" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__spins) as usize - ptr as usize }, 20usize, - concat!( - "Offset of field: ", - stringify!(__pthread_mutex_s), - "::", - stringify!(__spins) - ) + "Offset of field: __pthread_mutex_s::__spins" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__elision) as usize - ptr as usize }, 22usize, - concat!( - "Offset of field: ", - stringify!(__pthread_mutex_s), - "::", - stringify!(__elision) - ) + "Offset of field: __pthread_mutex_s::__elision" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__list) as usize - ptr as usize }, 24usize, - concat!( - "Offset of field: ", - stringify!(__pthread_mutex_s), - "::", - stringify!(__list) - ) + "Offset of field: __pthread_mutex_s::__list" ); } impl Default for __pthread_mutex_s { @@ -15031,132 +13685,72 @@ fn bindgen_test_layout___pthread_rwlock_arch_t() { assert_eq!( ::std::mem::size_of::<__pthread_rwlock_arch_t>(), 56usize, - concat!("Size of: ", stringify!(__pthread_rwlock_arch_t)) + "Size of __pthread_rwlock_arch_t" ); assert_eq!( ::std::mem::align_of::<__pthread_rwlock_arch_t>(), 8usize, - concat!("Alignment of ", stringify!(__pthread_rwlock_arch_t)) + "Alignment of __pthread_rwlock_arch_t" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__readers) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(__pthread_rwlock_arch_t), - "::", - stringify!(__readers) - ) + "Offset of field: __pthread_rwlock_arch_t::__readers" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__writers) as usize - ptr as usize }, 4usize, - concat!( - "Offset of field: ", - stringify!(__pthread_rwlock_arch_t), - "::", - stringify!(__writers) - ) + "Offset of field: __pthread_rwlock_arch_t::__writers" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__wrphase_futex) as usize - ptr as usize }, 8usize, - concat!( - "Offset of field: ", - stringify!(__pthread_rwlock_arch_t), - "::", - stringify!(__wrphase_futex) - ) + "Offset of field: __pthread_rwlock_arch_t::__wrphase_futex" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__writers_futex) as usize - ptr as usize }, 12usize, - concat!( - "Offset of field: ", - stringify!(__pthread_rwlock_arch_t), - "::", - stringify!(__writers_futex) - ) + "Offset of field: __pthread_rwlock_arch_t::__writers_futex" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__pad3) as usize - ptr as usize }, 16usize, - concat!( - "Offset of field: ", - stringify!(__pthread_rwlock_arch_t), - "::", - stringify!(__pad3) - ) + "Offset of field: __pthread_rwlock_arch_t::__pad3" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__pad4) as usize - ptr as usize }, 20usize, - concat!( - "Offset of field: ", - stringify!(__pthread_rwlock_arch_t), - "::", - stringify!(__pad4) - ) + "Offset of field: __pthread_rwlock_arch_t::__pad4" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__cur_writer) as usize - ptr as usize }, 24usize, - concat!( - "Offset of field: ", - stringify!(__pthread_rwlock_arch_t), - "::", - stringify!(__cur_writer) - ) + "Offset of field: __pthread_rwlock_arch_t::__cur_writer" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__shared) as usize - ptr as usize }, 28usize, - concat!( - "Offset of field: ", - stringify!(__pthread_rwlock_arch_t), - "::", - stringify!(__shared) - ) + "Offset of field: __pthread_rwlock_arch_t::__shared" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__rwelision) as usize - ptr as usize }, 32usize, - concat!( - "Offset of field: ", - stringify!(__pthread_rwlock_arch_t), - "::", - stringify!(__rwelision) - ) + "Offset of field: __pthread_rwlock_arch_t::__rwelision" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__pad1) as usize - ptr as usize }, 33usize, - concat!( - "Offset of field: ", - stringify!(__pthread_rwlock_arch_t), - "::", - stringify!(__pad1) - ) + "Offset of field: __pthread_rwlock_arch_t::__pad1" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__pad2) as usize - ptr as usize }, 40usize, - concat!( - "Offset of field: ", - stringify!(__pthread_rwlock_arch_t), - "::", - stringify!(__pad2) - ) + "Offset of field: __pthread_rwlock_arch_t::__pad2" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__flags) as usize - ptr as usize }, 48usize, - concat!( - "Offset of field: ", - stringify!(__pthread_rwlock_arch_t), - "::", - stringify!(__flags) - ) + "Offset of field: __pthread_rwlock_arch_t::__flags" ); } #[repr(C)] @@ -15177,82 +13771,47 @@ fn bindgen_test_layout___pthread_cond_s() { assert_eq!( ::std::mem::size_of::<__pthread_cond_s>(), 48usize, - concat!("Size of: ", stringify!(__pthread_cond_s)) + "Size of __pthread_cond_s" ); assert_eq!( ::std::mem::align_of::<__pthread_cond_s>(), 8usize, - concat!("Alignment of ", stringify!(__pthread_cond_s)) + "Alignment of __pthread_cond_s" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__wseq) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(__pthread_cond_s), - "::", - stringify!(__wseq) - ) + "Offset of field: __pthread_cond_s::__wseq" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__g1_start) as usize - ptr as usize }, 8usize, - concat!( - "Offset of field: ", - stringify!(__pthread_cond_s), - "::", - stringify!(__g1_start) - ) + "Offset of field: __pthread_cond_s::__g1_start" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__g_refs) as usize - ptr as usize }, 16usize, - concat!( - "Offset of field: ", - stringify!(__pthread_cond_s), - "::", - stringify!(__g_refs) - ) + "Offset of field: __pthread_cond_s::__g_refs" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__g_size) as usize - ptr as usize }, 24usize, - concat!( - "Offset of field: ", - stringify!(__pthread_cond_s), - "::", - stringify!(__g_size) - ) + "Offset of field: __pthread_cond_s::__g_size" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__g1_orig_size) as usize - ptr as usize }, 32usize, - concat!( - "Offset of field: ", - stringify!(__pthread_cond_s), - "::", - stringify!(__g1_orig_size) - ) + "Offset of field: __pthread_cond_s::__g1_orig_size" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__wrefs) as usize - ptr as usize }, 36usize, - concat!( - "Offset of field: ", - stringify!(__pthread_cond_s), - "::", - stringify!(__wrefs) - ) + "Offset of field: __pthread_cond_s::__wrefs" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__g_signals) as usize - ptr as usize }, 40usize, - concat!( - "Offset of field: ", - stringify!(__pthread_cond_s), - "::", - stringify!(__g_signals) - ) + "Offset of field: __pthread_cond_s::__g_signals" ); } impl Default for __pthread_cond_s { @@ -15278,22 +13837,17 @@ fn bindgen_test_layout___once_flag() { assert_eq!( ::std::mem::size_of::<__once_flag>(), 4usize, - concat!("Size of: ", stringify!(__once_flag)) + "Size of __once_flag" ); assert_eq!( ::std::mem::align_of::<__once_flag>(), 4usize, - concat!("Alignment of ", stringify!(__once_flag)) + "Alignment of __once_flag" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__data) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(__once_flag), - "::", - stringify!(__data) - ) + "Offset of field: __once_flag::__data" ); } pub type pthread_t = ::std::os::raw::c_ulong; @@ -15310,32 +13864,22 @@ fn bindgen_test_layout_pthread_mutexattr_t() { assert_eq!( ::std::mem::size_of::(), 4usize, - concat!("Size of: ", stringify!(pthread_mutexattr_t)) + "Size of pthread_mutexattr_t" ); assert_eq!( ::std::mem::align_of::(), 4usize, - concat!("Alignment of ", stringify!(pthread_mutexattr_t)) + "Alignment of pthread_mutexattr_t" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__size) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(pthread_mutexattr_t), - "::", - stringify!(__size) - ) + "Offset of field: pthread_mutexattr_t::__size" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__align) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(pthread_mutexattr_t), - "::", - stringify!(__align) - ) + "Offset of field: pthread_mutexattr_t::__align" ); } impl Default for pthread_mutexattr_t { @@ -15360,32 +13904,22 @@ fn bindgen_test_layout_pthread_condattr_t() { assert_eq!( ::std::mem::size_of::(), 4usize, - concat!("Size of: ", stringify!(pthread_condattr_t)) + "Size of pthread_condattr_t" ); assert_eq!( ::std::mem::align_of::(), 4usize, - concat!("Alignment of ", stringify!(pthread_condattr_t)) + "Alignment of pthread_condattr_t" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__size) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(pthread_condattr_t), - "::", - stringify!(__size) - ) + "Offset of field: pthread_condattr_t::__size" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__align) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(pthread_condattr_t), - "::", - stringify!(__align) - ) + "Offset of field: pthread_condattr_t::__align" ); } impl Default for pthread_condattr_t { @@ -15412,32 +13946,22 @@ fn bindgen_test_layout_pthread_attr_t() { assert_eq!( ::std::mem::size_of::(), 56usize, - concat!("Size of: ", stringify!(pthread_attr_t)) + "Size of pthread_attr_t" ); assert_eq!( ::std::mem::align_of::(), 8usize, - concat!("Alignment of ", stringify!(pthread_attr_t)) + "Alignment of pthread_attr_t" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__size) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(pthread_attr_t), - "::", - stringify!(__size) - ) + "Offset of field: pthread_attr_t::__size" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__align) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(pthread_attr_t), - "::", - stringify!(__align) - ) + "Offset of field: pthread_attr_t::__align" ); } impl Default for pthread_attr_t { @@ -15463,42 +13987,27 @@ fn bindgen_test_layout_pthread_mutex_t() { assert_eq!( ::std::mem::size_of::(), 40usize, - concat!("Size of: ", stringify!(pthread_mutex_t)) + "Size of pthread_mutex_t" ); assert_eq!( ::std::mem::align_of::(), 8usize, - concat!("Alignment of ", stringify!(pthread_mutex_t)) + "Alignment of pthread_mutex_t" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__data) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(pthread_mutex_t), - "::", - stringify!(__data) - ) + "Offset of field: pthread_mutex_t::__data" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__size) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(pthread_mutex_t), - "::", - stringify!(__size) - ) + "Offset of field: pthread_mutex_t::__size" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__align) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(pthread_mutex_t), - "::", - stringify!(__align) - ) + "Offset of field: pthread_mutex_t::__align" ); } impl Default for pthread_mutex_t { @@ -15524,42 +14033,27 @@ fn bindgen_test_layout_pthread_cond_t() { assert_eq!( ::std::mem::size_of::(), 48usize, - concat!("Size of: ", stringify!(pthread_cond_t)) + "Size of pthread_cond_t" ); assert_eq!( ::std::mem::align_of::(), 8usize, - concat!("Alignment of ", stringify!(pthread_cond_t)) + "Alignment of pthread_cond_t" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__data) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(pthread_cond_t), - "::", - stringify!(__data) - ) + "Offset of field: pthread_cond_t::__data" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__size) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(pthread_cond_t), - "::", - stringify!(__size) - ) + "Offset of field: pthread_cond_t::__size" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__align) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(pthread_cond_t), - "::", - stringify!(__align) - ) + "Offset of field: pthread_cond_t::__align" ); } impl Default for pthread_cond_t { @@ -15585,42 +14079,27 @@ fn bindgen_test_layout_pthread_rwlock_t() { assert_eq!( ::std::mem::size_of::(), 56usize, - concat!("Size of: ", stringify!(pthread_rwlock_t)) + "Size of pthread_rwlock_t" ); assert_eq!( ::std::mem::align_of::(), 8usize, - concat!("Alignment of ", stringify!(pthread_rwlock_t)) + "Alignment of pthread_rwlock_t" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__data) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(pthread_rwlock_t), - "::", - stringify!(__data) - ) + "Offset of field: pthread_rwlock_t::__data" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__size) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(pthread_rwlock_t), - "::", - stringify!(__size) - ) + "Offset of field: pthread_rwlock_t::__size" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__align) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(pthread_rwlock_t), - "::", - stringify!(__align) - ) + "Offset of field: pthread_rwlock_t::__align" ); } impl Default for pthread_rwlock_t { @@ -15645,32 +14124,22 @@ fn bindgen_test_layout_pthread_rwlockattr_t() { assert_eq!( ::std::mem::size_of::(), 8usize, - concat!("Size of: ", stringify!(pthread_rwlockattr_t)) + "Size of pthread_rwlockattr_t" ); assert_eq!( ::std::mem::align_of::(), 8usize, - concat!("Alignment of ", stringify!(pthread_rwlockattr_t)) + "Alignment of pthread_rwlockattr_t" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__size) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(pthread_rwlockattr_t), - "::", - stringify!(__size) - ) + "Offset of field: pthread_rwlockattr_t::__size" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__align) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(pthread_rwlockattr_t), - "::", - stringify!(__align) - ) + "Offset of field: pthread_rwlockattr_t::__align" ); } impl Default for pthread_rwlockattr_t { @@ -15696,32 +14165,22 @@ fn bindgen_test_layout_pthread_barrier_t() { assert_eq!( ::std::mem::size_of::(), 32usize, - concat!("Size of: ", stringify!(pthread_barrier_t)) + "Size of pthread_barrier_t" ); assert_eq!( ::std::mem::align_of::(), 8usize, - concat!("Alignment of ", stringify!(pthread_barrier_t)) + "Alignment of pthread_barrier_t" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__size) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(pthread_barrier_t), - "::", - stringify!(__size) - ) + "Offset of field: pthread_barrier_t::__size" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__align) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(pthread_barrier_t), - "::", - stringify!(__align) - ) + "Offset of field: pthread_barrier_t::__align" ); } impl Default for pthread_barrier_t { @@ -15747,32 +14206,22 @@ fn bindgen_test_layout_pthread_barrierattr_t() { assert_eq!( ::std::mem::size_of::(), 4usize, - concat!("Size of: ", stringify!(pthread_barrierattr_t)) + "Size of pthread_barrierattr_t" ); assert_eq!( ::std::mem::align_of::(), 4usize, - concat!("Alignment of ", stringify!(pthread_barrierattr_t)) + "Alignment of pthread_barrierattr_t" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__size) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(pthread_barrierattr_t), - "::", - stringify!(__size) - ) + "Offset of field: pthread_barrierattr_t::__size" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__align) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(pthread_barrierattr_t), - "::", - stringify!(__align) - ) + "Offset of field: pthread_barrierattr_t::__align" ); } impl Default for pthread_barrierattr_t { @@ -15818,82 +14267,47 @@ fn bindgen_test_layout_random_data() { assert_eq!( ::std::mem::size_of::(), 48usize, - concat!("Size of: ", stringify!(random_data)) + "Size of random_data" ); assert_eq!( ::std::mem::align_of::(), 8usize, - concat!("Alignment of ", stringify!(random_data)) + "Alignment of random_data" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).fptr) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(random_data), - "::", - stringify!(fptr) - ) + "Offset of field: random_data::fptr" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).rptr) as usize - ptr as usize }, 8usize, - concat!( - "Offset of field: ", - stringify!(random_data), - "::", - stringify!(rptr) - ) + "Offset of field: random_data::rptr" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).state) as usize - ptr as usize }, 16usize, - concat!( - "Offset of field: ", - stringify!(random_data), - "::", - stringify!(state) - ) + "Offset of field: random_data::state" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).rand_type) as usize - ptr as usize }, 24usize, - concat!( - "Offset of field: ", - stringify!(random_data), - "::", - stringify!(rand_type) - ) + "Offset of field: random_data::rand_type" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).rand_deg) as usize - ptr as usize }, 28usize, - concat!( - "Offset of field: ", - stringify!(random_data), - "::", - stringify!(rand_deg) - ) + "Offset of field: random_data::rand_deg" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).rand_sep) as usize - ptr as usize }, 32usize, - concat!( - "Offset of field: ", - stringify!(random_data), - "::", - stringify!(rand_sep) - ) + "Offset of field: random_data::rand_sep" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).end_ptr) as usize - ptr as usize }, 40usize, - concat!( - "Offset of field: ", - stringify!(random_data), - "::", - stringify!(end_ptr) - ) + "Offset of field: random_data::end_ptr" ); } impl Default for random_data { @@ -15980,62 +14394,37 @@ fn bindgen_test_layout_drand48_data() { assert_eq!( ::std::mem::size_of::(), 24usize, - concat!("Size of: ", stringify!(drand48_data)) + "Size of drand48_data" ); assert_eq!( ::std::mem::align_of::(), 8usize, - concat!("Alignment of ", stringify!(drand48_data)) + "Alignment of drand48_data" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__x) as usize - ptr as usize }, 0usize, - concat!( - "Offset of field: ", - stringify!(drand48_data), - "::", - stringify!(__x) - ) + "Offset of field: drand48_data::__x" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__old_x) as usize - ptr as usize }, 6usize, - concat!( - "Offset of field: ", - stringify!(drand48_data), - "::", - stringify!(__old_x) - ) + "Offset of field: drand48_data::__old_x" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__c) as usize - ptr as usize }, 12usize, - concat!( - "Offset of field: ", - stringify!(drand48_data), - "::", - stringify!(__c) - ) + "Offset of field: drand48_data::__c" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__init) as usize - ptr as usize }, 14usize, - concat!( - "Offset of field: ", - stringify!(drand48_data), - "::", - stringify!(__init) - ) + "Offset of field: drand48_data::__init" ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).__a) as usize - ptr as usize }, 16usize, - concat!( - "Offset of field: ", - stringify!(drand48_data), - "::", - stringify!(__a) - ) + "Offset of field: drand48_data::__a" ); } extern "C" { @@ -17238,22 +15627,6 @@ extern "C" { dest: *mut TPMS_ALG_PROPERTY, ) -> TSS2_RC; } -extern "C" { - pub fn Tss2_MU_TPMS_ALGORITHM_DESCRIPTION_Marshal( - src: *const TPMS_ALGORITHM_DESCRIPTION, - buffer: *mut u8, - buffer_size: size_t, - offset: *mut size_t, - ) -> TSS2_RC; -} -extern "C" { - pub fn Tss2_MU_TPMS_ALGORITHM_DESCRIPTION_Unmarshal( - buffer: *const u8, - buffer_size: size_t, - offset: *mut size_t, - dest: *mut TPMS_ALGORITHM_DESCRIPTION, - ) -> TSS2_RC; -} extern "C" { pub fn Tss2_MU_TPMS_TAGGED_PROPERTY_Marshal( src: *const TPMS_TAGGED_PROPERTY, @@ -17990,22 +16363,6 @@ extern "C" { dest: *mut TPML_TAGGED_TPM_PROPERTY, ) -> TSS2_RC; } -extern "C" { - pub fn Tss2_MU_TPML_INTEL_PTT_PROPERTY_Marshal( - src: *const TPML_INTEL_PTT_PROPERTY, - buffer: *mut u8, - buffer_size: size_t, - offset: *mut size_t, - ) -> TSS2_RC; -} -extern "C" { - pub fn Tss2_MU_TPML_INTEL_PTT_PROPERTY_Unmarshal( - buffer: *const u8, - buffer_size: size_t, - offset: *mut size_t, - dest: *mut TPML_INTEL_PTT_PROPERTY, - ) -> TSS2_RC; -} extern "C" { pub fn Tss2_MU_TPML_AC_CAPABILITIES_Marshal( src: *const TPML_AC_CAPABILITIES, @@ -18708,3 +17065,35 @@ extern "C" { out: *mut TPMS_EMPTY, ) -> TSS2_RC; } +extern "C" { + pub fn Tss2_MU_TPM2B_MAX_CAP_BUFFER_Marshal( + src: *const TPM2B_MAX_CAP_BUFFER, + buffer: *mut u8, + buffer_size: size_t, + offset: *mut size_t, + ) -> TSS2_RC; +} +extern "C" { + pub fn Tss2_MU_TPM2B_MAX_CAP_BUFFER_Unmarshal( + buffer: *const u8, + buffer_size: size_t, + offset: *mut size_t, + dest: *mut TPM2B_MAX_CAP_BUFFER, + ) -> TSS2_RC; +} +extern "C" { + pub fn Tss2_MU_TPML_INTEL_PTT_PROPERTY_Marshal( + src: *const TPML_INTEL_PTT_PROPERTY, + buffer: *mut u8, + buffer_size: size_t, + offset: *mut size_t, + ) -> TSS2_RC; +} +extern "C" { + pub fn Tss2_MU_TPML_INTEL_PTT_PROPERTY_Unmarshal( + buffer: *const u8, + buffer_size: size_t, + offset: *mut size_t, + dest: *mut TPML_INTEL_PTT_PROPERTY, + ) -> TSS2_RC; +} diff --git a/tss-esapi/Cargo.toml b/tss-esapi/Cargo.toml index f5d26495..893b755a 100644 --- a/tss-esapi/Cargo.toml +++ b/tss-esapi/Cargo.toml @@ -2,7 +2,7 @@ name = "tss-esapi" version = "8.0.0-alpha" authors = ["Parsec Project Contributors"] -edition = "2018" # TODO Update edition to 2021 - Remove the disabled lints that are due to using old edition. +edition = "2021" description = "Rust-native wrapper around TSS 2.0 Enhanced System API" readme = "README.md" keywords = ["tpm", "tss", "esys", "esapi"] @@ -10,7 +10,7 @@ categories = ["api-bindings", "external-ffi-bindings", "cryptography"] license = "Apache-2.0" repository = "https://github.com/parallaxsecond/rust-tss-esapi" documentation = "https://docs.rs/crate/tss-esapi" -rust-version = "1.66.0" +rust-version = "1.74.0" [[example]] name = "hmac" @@ -20,30 +20,30 @@ name = "certify" required-features = ["abstraction"] [dependencies] -bitfield = "0.14" +bitfield = "0.17.0" serde = { version = "1.0.115", features = [ "derive", ], optional = true, default-features = false } malloced = "1.3.1" log = "0.4.11" enumflags2 = "0.7.7" -num-derive = "0.3.2" +num-derive = "0.4.2" num-traits = "0.2.12" hostname-validator = "1.1.0" regex = "1.3.9" zeroize = { version = "1.5.7", features = ["zeroize_derive"] } tss-esapi-sys = { path = "../tss-esapi-sys", version = "0.5.0" } oid = { version = "0.2.1", optional = true } -picky-asn1 = { version = "0.8.0", optional = true } -picky-asn1-x509 = { version = "0.12.0", optional = true } +picky-asn1 = { version = "0.9.0", optional = true } +picky-asn1-x509 = { version = "0.13.0", optional = true } cfg-if = "1.0.0" -strum = { version = "0.25.0", optional = true } -strum_macros = { version = "0.25.0", optional = true } +strum = { version = "0.26.3", optional = true } +strum_macros = { version = "0.26.4", optional = true } paste = "1.0.14" getrandom = "0.2.11" [dev-dependencies] -env_logger = "0.9.0" +env_logger = "0.11.5" sha2 = "0.10.1" serde_json = "^1.0.108" tss-esapi = { path = ".", features = [ diff --git a/tss-esapi/src/context/tpm_commands/attestation_commands.rs b/tss-esapi/src/context/tpm_commands/attestation_commands.rs index 9afab587..e9bd965d 100644 --- a/tss-esapi/src/context/tpm_commands/attestation_commands.rs +++ b/tss-esapi/src/context/tpm_commands/attestation_commands.rs @@ -249,8 +249,6 @@ impl Context { signing_scheme: SignatureScheme, creation_ticket: CreationTicket, ) -> Result<(Attest, Signature)> { - use std::convert::TryInto; - let mut certify_info_ptr = null_mut(); let mut signature_ptr = null_mut(); ReturnCode::ensure_success( diff --git a/tss-esapi/src/lib.rs b/tss-esapi/src/lib.rs index 365f2173..0c17936f 100644 --- a/tss-esapi/src/lib.rs +++ b/tss-esapi/src/lib.rs @@ -29,10 +29,7 @@ missing_copy_implementations, rustdoc::broken_intra_doc_links, )] -// This comes from Zeroize they changed version of Syn used -// when zeroize_derive was updated to Rust Edition 2021. -// TODO: Remove this when updating Rust Edition. -#![allow(clippy::multiple_crate_versions)] + //! # TSS 2.0 Rust Wrapper over Enhanced System API //! This crate exposes the functionality of the TCG Software Stack Enhanced System API to //! Rust developers, both directly through FFI bindings and through more Rust-tailored interfaces @@ -63,7 +60,7 @@ //! are at most one level away from root. //! //! Minimum supported Rust version (MSRV): -//! We currently check with version 1.66.0 of the Rust compiler during CI builds. +//! We currently check with version 1.74.0 of the Rust compiler during CI builds. //! //! # Notes on code safety: //! * thread safety is ensured by the required mutability of the `Context` structure within the @@ -95,6 +92,7 @@ //! controlled through environment variables as explained //! [here](https://github.com/tpm2-software/tpm2-tss/blob/main/doc/logging.md#runtime-log-level). //! + mod context; pub mod error; diff --git a/tss-esapi/tests/Cargo.lock.frozen b/tss-esapi/tests/Cargo.lock.frozen index 094d607f..0176ff37 100644 --- a/tss-esapi/tests/Cargo.lock.frozen +++ b/tss-esapi/tests/Cargo.lock.frozen @@ -4,22 +4,60 @@ version = 3 [[package]] name = "aho-corasick" -version = "1.1.1" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea5d730647d4fadd988536d06fecce94b7b4f2a7efdae548f1cf4b63205518ab" +checksum = "b2969dcb958b36655471fc61f7e416fa76033bdd4bfed0678d8fee1e2d07a1f0" dependencies = [ "memchr", ] [[package]] -name = "atty" -version = "0.2.14" +name = "anstream" +version = "0.6.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" +checksum = "64e15c1ab1f89faffbf04a634d5e1962e9074f2741eef6d97f3c4e322426d526" dependencies = [ - "hermit-abi", - "libc", - "winapi", + "anstyle", + "anstyle-parse", + "anstyle-query", + "anstyle-wincon", + "colorchoice", + "is_terminal_polyfill", + "utf8parse", +] + +[[package]] +name = "anstyle" +version = "1.0.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bec1de6f59aedf83baf9ff929c98f2ad654b97c9510f4e70cf6f661d49fd5b1" + +[[package]] +name = "anstyle-parse" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eb47de1e80c2b463c735db5b217a0ddc39d612e7ac9e2e96a5aed1f57616c1cb" +dependencies = [ + "utf8parse", +] + +[[package]] +name = "anstyle-query" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d36fc52c7f6c869915e99412912f22093507da8d9e942ceaf66fe4b7c14422a" +dependencies = [ + "windows-sys 0.52.0", +] + +[[package]] +name = "anstyle-wincon" +version = "3.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5bf74e1b6e971609db8ca7a9ce79fd5768ab6ae46441c572e46cf596f59e57f8" +dependencies = [ + "anstyle", + "windows-sys 0.52.0", ] [[package]] @@ -30,44 +68,41 @@ checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" [[package]] name = "base64" -version = "0.21.4" +version = "0.22.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ba43ea6f343b788c8764558649e08df62f86c6ef251fdaeb1ffd010a9ae50a2" +checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" [[package]] name = "bindgen" -version = "0.66.1" +version = "0.70.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2b84e06fc203107bfbad243f4aba2af864eb7db3b1cf46ea0a023b0b433d2a7" +checksum = "f49d8fed880d473ea71efb9bf597651e77201bdd4893efe54c9e5d65ae04ce6f" dependencies = [ "bitflags", "cexpr", "clang-sys", - "lazy_static", - "lazycell", + "itertools", "log", - "peeking_take_while", "prettyplease", "proc-macro2", "quote", "regex", "rustc-hash", "shlex", - "syn 2.0.49", - "which", + "syn", ] [[package]] name = "bitfield" -version = "0.14.0" +version = "0.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d7e60934ceec538daadb9d8432424ed043a904d8e0243f3c6446bce549a46ac" +checksum = "f798d2d157e547aa99aab0967df39edd0b70307312b6f8bd2848e6abe40896e0" [[package]] name = "bitflags" -version = "2.4.0" +version = "2.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4682ae6287fcf752ecaabbfcc7b6f9b72aa33933dc23a554d853aea8eea8635" +checksum = "ed570934406eb16438a4e976b1b4500774099c13b8cb96eec99f620f05090ddf" [[package]] name = "block-buffer" @@ -78,15 +113,6 @@ dependencies = [ "generic-array", ] -[[package]] -name = "cc" -version = "1.0.83" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" -dependencies = [ - "libc", -] - [[package]] name = "cexpr" version = "0.6.0" @@ -104,20 +130,26 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "clang-sys" -version = "1.6.1" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c688fc74432808e3eb684cae8830a86be1d66a2bd58e1f248ed0960a590baf6f" +checksum = "67523a3b4be3ce1989d607a828d036249522dd9c1c8de7f4dd2dae43a37369d1" dependencies = [ "glob", "libc", "libloading", ] +[[package]] +name = "colorchoice" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3fd119d74b830634cea2a0f58bbd0d54540518a14397557951e79340abc28c0" + [[package]] name = "cpufeatures" -version = "0.2.9" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a17b76ff3a4162b0b27f354a0c87015ddad39d35f9c0c36607a3bdd175dde1f1" +checksum = "53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504" dependencies = [ "libc", ] @@ -144,62 +176,51 @@ dependencies = [ [[package]] name = "either" -version = "1.9.0" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" +checksum = "11157ac094ffbdde99aa67b23417ebdd801842852b500e395a45a9c0aac03e4a" [[package]] name = "enumflags2" -version = "0.7.8" +version = "0.7.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5998b4f30320c9d93aed72f63af821bfdac50465b75428fce77b48ec482c3939" +checksum = "3278c9d5fb675e0a51dabcf4c0d355f692b064171535ba72361be1528a9d8e8d" dependencies = [ "enumflags2_derive", ] [[package]] name = "enumflags2_derive" -version = "0.7.8" +version = "0.7.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f95e2801cd355d4a1a3e3953ce6ee5ae9603a5c833455343a8bfe3f44d418246" +checksum = "5c785274071b1b420972453b306eeca06acf4633829db4223b58a2a8c5953bc4" dependencies = [ "proc-macro2", "quote", - "syn 2.0.49", + "syn", ] [[package]] -name = "env_logger" -version = "0.9.3" +name = "env_filter" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a12e6657c4c97ebab115a42dcee77225f7f482cdd841cf7088c657a42e9e00e7" +checksum = "4f2c92ceda6ceec50f43169f9ee8424fe2db276791afde7b2cd8bc084cb376ab" dependencies = [ - "atty", - "humantime", "log", "regex", - "termcolor", -] - -[[package]] -name = "errno" -version = "0.3.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "add4f07d43996f76ef320709726a556a9d4f965d9410d8d0271132d2f8293480" -dependencies = [ - "errno-dragonfly", - "libc", - "windows-sys", ] [[package]] -name = "errno-dragonfly" -version = "0.1.2" +name = "env_logger" +version = "0.11.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa68f1b12764fab894d2755d2518754e71b4fd80ecfb822714a1206c2aab39bf" +checksum = "e13fa619b91fb2381732789fc5de83b45675e882f66623b7d8cb4f643017018d" dependencies = [ - "cc", - "libc", + "anstream", + "anstyle", + "env_filter", + "humantime", + "log", ] [[package]] @@ -212,6 +233,17 @@ dependencies = [ "version_check", ] +[[package]] +name = "getrandom" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94b22e06ecb0110981051723910cbf0b5f5e09a2062dd7663334ee79a9d1286c" +dependencies = [ + "cfg-if", + "libc", + "wasi", +] + [[package]] name = "glob" version = "0.3.1" @@ -220,27 +252,9 @@ checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" [[package]] name = "heck" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" - -[[package]] -name = "hermit-abi" -version = "0.1.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" -dependencies = [ - "libc", -] - -[[package]] -name = "home" -version = "0.5.5" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5444c27eef6923071f7ebcc33e3444508466a76f7a2b93da00ed6e19f30c1ddb" -dependencies = [ - "windows-sys", -] +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" [[package]] name = "hostname-validator" @@ -255,50 +269,47 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" [[package]] -name = "itoa" -version = "1.0.10" +name = "is_terminal_polyfill" +version = "1.70.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" +checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf" [[package]] -name = "lazy_static" -version = "1.4.0" +name = "itertools" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" +checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186" +dependencies = [ + "either", +] [[package]] -name = "lazycell" -version = "1.3.0" +name = "itoa" +version = "1.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" +checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" [[package]] name = "libc" -version = "0.2.148" +version = "0.2.153" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9cdc71e17332e86d2e1d38c1f99edcb6288ee11b815fb1a4b049eaa2114d369b" +checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd" [[package]] name = "libloading" -version = "0.7.4" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b67380fd3b2fbe7527a606e18729d21c6f3951633d0500574c4dc22d2d638b9f" +checksum = "c571b676ddfc9a8c12f1f3d3085a7b163966a8fd8098a90640953ce5f6170161" dependencies = [ "cfg-if", - "winapi", + "windows-sys 0.48.0", ] -[[package]] -name = "linux-raw-sys" -version = "0.4.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3852614a3bd9ca9804678ba6be5e3b8ce76dfc902cae004e3e0c44051b6e88db" - [[package]] name = "log" -version = "0.4.20" +version = "0.4.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" +checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" [[package]] name = "malloced" @@ -308,9 +319,9 @@ checksum = "6dfebb2f9e0b39509c62eead6ec7ae0c0ed45bb61d12bbcf4e976c566c5400ec" [[package]] name = "memchr" -version = "2.6.4" +version = "2.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f665ee40bc4a3c5590afb1e9677db74a508659dfd71e126420da8274909a0167" +checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149" [[package]] name = "minimal-lexical" @@ -330,20 +341,20 @@ dependencies = [ [[package]] name = "num-derive" -version = "0.3.3" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "876a53fff98e03a936a674b29568b0e605f06b29372c2489ff4de23f1949743d" +checksum = "ed3955f1a9c7c0c15e092f9c887db08b1fc683305fdf6eb6684f22555355e202" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn", ] [[package]] name = "num-traits" -version = "0.2.16" +version = "0.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f30b0abd723be7e2ffca1272140fac1a2f084c77ec3e123c192b66af1ee9e6c2" +checksum = "da0df0e5185db44f69b44f26786fe401b6c293d1907744beaa7fa62b2e5a517a" dependencies = [ "autocfg", ] @@ -357,29 +368,17 @@ dependencies = [ "serde", ] -[[package]] -name = "once_cell" -version = "1.18.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" - [[package]] name = "paste" version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c" -[[package]] -name = "peeking_take_while" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19b17cddbe7ec3f8bc800887bab5e717348c95ea2ca0b1bf0837fb964dc67099" - [[package]] name = "picky-asn1" -version = "0.8.0" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "295eea0f33c16be21e2a98b908fdd4d73c04dd48c8480991b76dbcf0cb58b212" +checksum = "360019b238b11b8c0e88cd9db3a6677f1af122e3422d0a26a2b576f084d9be36" dependencies = [ "oid", "serde", @@ -388,9 +387,9 @@ dependencies = [ [[package]] name = "picky-asn1-der" -version = "0.4.1" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5df7873a9e36d42dadb393bea5e211fe83d793c172afad5fb4ec846ec582793f" +checksum = "04784987e157b5a8f832ce68b3364915dc6ef4bed94a6e10e241fa1bae3db2e3" dependencies = [ "picky-asn1", "serde", @@ -399,9 +398,9 @@ dependencies = [ [[package]] name = "picky-asn1-x509" -version = "0.12.0" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c5f20f71a68499ff32310f418a6fad8816eac1a2859ed3f0c5c741389dd6208" +checksum = "f3384ff768b1c4a04532916be77935f634a4738d3b2138da98798e90352fadf4" dependencies = [ "base64", "oid", @@ -412,43 +411,43 @@ dependencies = [ [[package]] name = "pkg-config" -version = "0.3.27" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26072860ba924cbfa98ea39c8c19b4dd6a4a25423dbdf219c1eca91aa0cf6964" +checksum = "2900ede94e305130c13ddd391e0ab7cbaeb783945ae07a279c268cb05109c6cb" [[package]] name = "prettyplease" -version = "0.2.16" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a41cf62165e97c7f814d2221421dbb9afcbcdb0a88068e5ea206e19951c2cbb5" +checksum = "ae005bd773ab59b4725093fd7df83fd7892f7d8eafb48dbd7de6e024e4215f9d" dependencies = [ "proc-macro2", - "syn 2.0.49", + "syn", ] [[package]] name = "proc-macro2" -version = "1.0.78" +version = "1.0.65" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2422ad645d89c99f8f3e6b88a9fdeca7fabeac836b1002371c4367c8f984aae" +checksum = "92de25114670a878b1261c79c9f8f729fb97e95bac93f6312f583c60dd6a1dfe" dependencies = [ "unicode-ident", ] [[package]] name = "quote" -version = "1.0.35" +version = "1.0.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" +checksum = "5907a1b7c277254a8b15170f6e7c97cfa60ee7872a3217663bb81151e48184bb" dependencies = [ "proc-macro2", ] [[package]] name = "regex" -version = "1.9.6" +version = "1.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebee201405406dbf528b8b672104ae6d6d63e6d118cb10e4d51abbc7b58044ff" +checksum = "b62dbe01f0b06f9d8dc7d49e05a0785f153b00b2c227856282f671e0318c9b15" dependencies = [ "aho-corasick", "memchr", @@ -458,9 +457,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.3.9" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59b23e92ee4318893fa3fe3e6fb365258efbfe6ac6ab30f090cdcbb7aa37efa9" +checksum = "5bb987efffd3c6d0d8f5f89510bb458559eab11e4f869acb20bf845e016259cd" dependencies = [ "aho-corasick", "memchr", @@ -469,9 +468,9 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.7.5" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbb5fb1acd8a1a18b3dd5be62d25485eb770e05afb408a9627d14d451bae12da" +checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" [[package]] name = "rustc-hash" @@ -479,19 +478,6 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" -[[package]] -name = "rustix" -version = "0.38.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2f9da0cbd88f9f09e7814e388301c8414c51c62aa6ce1e4b5c551d49d96e531" -dependencies = [ - "bitflags", - "errno", - "libc", - "linux-raw-sys", - "windows-sys", -] - [[package]] name = "rustversion" version = "1.0.14" @@ -506,44 +492,44 @@ checksum = "f98d2aa92eebf49b69786be48e4477826b256916e84a57ff2a4f21923b48eb4c" [[package]] name = "semver" -version = "1.0.19" +version = "1.0.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad977052201c6de01a8ef2aa3378c4bd23217a056337d1d6da40468d267a4fb0" +checksum = "b97ed7a9823b74f99c7742f5336af7be5ecd3eeafcb1507d1fa93347b1d589b0" [[package]] name = "serde" -version = "1.0.196" +version = "1.0.193" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "870026e60fa08c69f064aa766c10f10b1d62db9ccd4d0abb206472bee0ce3b32" +checksum = "25dd9975e68d0cb5aa1120c288333fc98731bd1dd12f561e468ea4728c042b89" dependencies = [ "serde_derive", ] [[package]] name = "serde_bytes" -version = "0.11.12" +version = "0.11.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab33ec92f677585af6d88c65593ae2375adde54efdbf16d597f2cbc7a6d368ff" +checksum = "8b8497c313fd43ab992087548117643f6fcd935cbf36f176ffda0aacf9591734" dependencies = [ "serde", ] [[package]] name = "serde_derive" -version = "1.0.196" +version = "1.0.193" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33c85360c95e7d137454dc81d9a4ed2b8efd8fbe19cee57357b32b9771fccb67" +checksum = "43576ca501357b9b071ac53cdc7da8ef0cbd9493d8df094cd821777ea6e894d3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.49", + "syn", ] [[package]] name = "serde_json" -version = "1.0.113" +version = "1.0.109" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69801b70b1c3dac963ecb03a364ba0ceda9cf60c71cfe475e99864759c8b8a79" +checksum = "cb0652c533506ad7a2e353cce269330d6afd8bdfb6d75e0ace5b35aacbd7b9e9" dependencies = [ "itoa", "ryu", @@ -563,45 +549,34 @@ dependencies = [ [[package]] name = "shlex" -version = "1.2.0" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7cee0529a6d40f580e7a5e6c495c8fbfe21b7b52795ed4bb5e62cdf92bc6380" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" [[package]] name = "strum" -version = "0.25.0" +version = "0.26.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "290d54ea6f91c969195bdbcd7442c8c2a2ba87da8bf60a7ee86a235d4bc1e125" +checksum = "8fec0f0aef304996cf250b31b5a10dee7980c85da9d759361292b8bca5a18f06" [[package]] name = "strum_macros" -version = "0.25.2" +version = "0.26.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad8d03b598d3d0fff69bf533ee3ef19b8eeb342729596df84bcc7e1f96ec4059" +checksum = "4c6bee85a5a24955dc440386795aa378cd9cf82acd5f764469152d2270e581be" dependencies = [ "heck", "proc-macro2", "quote", "rustversion", - "syn 2.0.49", + "syn", ] [[package]] name = "syn" -version = "1.0.109" +version = "2.0.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "syn" -version = "2.0.49" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "915aea9e586f80826ee59f8453c1101f9d1c4b3964cd2460185ee8e299ada496" +checksum = "239814284fd6f1a4ffe4ca893952cdd93c224b6a1571c9a9eadd670295c0c9e2" dependencies = [ "proc-macro2", "quote", @@ -610,18 +585,9 @@ dependencies = [ [[package]] name = "target-lexicon" -version = "0.12.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d0e916b1148c8e263850e1ebcbd046f333e0683c724876bb0da63ea4373dc8a" - -[[package]] -name = "termcolor" -version = "1.3.0" +version = "0.12.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6093bad37da69aab9d123a8091e4be0aa4a03e4d601ec641c327398315f62b64" -dependencies = [ - "winapi-util", -] +checksum = "69758bda2e78f098e4ccb393021a0963bb3442eac05f135c30f61b7370bbafae" [[package]] name = "tss-esapi" @@ -631,6 +597,7 @@ dependencies = [ "cfg-if", "enumflags2", "env_logger", + "getrandom", "hostname-validator", "log", "malloced", @@ -647,6 +614,7 @@ dependencies = [ "sha2", "strum", "strum_macros", + "tss-esapi", "tss-esapi-sys", "zeroize", ] @@ -656,7 +624,9 @@ name = "tss-esapi-sys" version = "0.5.0" dependencies = [ "bindgen", + "cfg-if", "pkg-config", + "semver", "target-lexicon", ] @@ -673,61 +643,39 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" [[package]] -name = "version_check" -version = "0.9.4" +name = "utf8parse" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" +checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" [[package]] -name = "which" -version = "4.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87ba24419a2078cd2b0f2ede2691b6c66d8e47836da3b6db8265ebad47afbfc7" -dependencies = [ - "either", - "home", - "once_cell", - "rustix", -] - -[[package]] -name = "winapi" -version = "0.3.9" +name = "version_check" +version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" -dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", -] +checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" [[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] -name = "winapi-util" -version = "0.1.6" +name = "windows-sys" +version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f29e6f9198ba0d26b4c9f07dbe6f9ed633e1f3d5b8b414090084349e46a52596" +checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" dependencies = [ - "winapi", + "windows-targets 0.48.5", ] -[[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" - [[package]] name = "windows-sys" -version = "0.48.0" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ - "windows-targets", + "windows-targets 0.52.6", ] [[package]] @@ -736,13 +684,29 @@ version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" dependencies = [ - "windows_aarch64_gnullvm", - "windows_aarch64_msvc", - "windows_i686_gnu", - "windows_i686_msvc", - "windows_x86_64_gnu", - "windows_x86_64_gnullvm", - "windows_x86_64_msvc", + "windows_aarch64_gnullvm 0.48.5", + "windows_aarch64_msvc 0.48.5", + "windows_i686_gnu 0.48.5", + "windows_i686_msvc 0.48.5", + "windows_x86_64_gnu 0.48.5", + "windows_x86_64_gnullvm 0.48.5", + "windows_x86_64_msvc 0.48.5", +] + +[[package]] +name = "windows-targets" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" +dependencies = [ + "windows_aarch64_gnullvm 0.52.6", + "windows_aarch64_msvc 0.52.6", + "windows_i686_gnu 0.52.6", + "windows_i686_gnullvm", + "windows_i686_msvc 0.52.6", + "windows_x86_64_gnu 0.52.6", + "windows_x86_64_gnullvm 0.52.6", + "windows_x86_64_msvc 0.52.6", ] [[package]] @@ -751,47 +715,95 @@ version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" + [[package]] name = "windows_aarch64_msvc" version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" + [[package]] name = "windows_i686_gnu" version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" +[[package]] +name = "windows_i686_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" + [[package]] name = "windows_i686_msvc" version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" +[[package]] +name = "windows_i686_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" + [[package]] name = "windows_x86_64_gnu" version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" + [[package]] name = "windows_x86_64_gnullvm" version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" + [[package]] name = "windows_x86_64_msvc" version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" + [[package]] name = "zeroize" -version = "1.6.0" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a0956f1ba7c7909bfb66c2e9e4124ab6f6482560f6628b5aaeba39207c9aad9" +checksum = "525b4ec142c6b68a2d10f01f7bbf6755599ca3f81ea53b8431b7dd348f5fdb2d" dependencies = [ "zeroize_derive", ] @@ -804,5 +816,5 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.49", + "syn", ] diff --git a/tss-esapi/tests/Dockerfile-fedora b/tss-esapi/tests/Dockerfile-fedora index 79a9cf0a..cafbe04e 100644 --- a/tss-esapi/tests/Dockerfile-fedora +++ b/tss-esapi/tests/Dockerfile-fedora @@ -1,4 +1,4 @@ -FROM fedora:36 +FROM fedora:38 RUN dnf install -y \ tpm2-tss-devel tpm2-abrmd tpm2-tools \ diff --git a/tss-esapi/tests/Dockerfile-ubuntu b/tss-esapi/tests/Dockerfile-ubuntu index 1541e05e..b94bbc64 100644 --- a/tss-esapi/tests/Dockerfile-ubuntu +++ b/tss-esapi/tests/Dockerfile-ubuntu @@ -1,4 +1,4 @@ -FROM ghcr.io/tpm2-software/ubuntu-18.04:latest AS base +FROM ghcr.io/tpm2-software/ubuntu-20.04:latest AS base FROM base AS rust-toolchain # Install Rust toolchain @@ -7,10 +7,11 @@ ENV PATH="/root/.cargo/bin:${PATH}" FROM rust-toolchain AS tpm2-tss # Download and install the TSS library -ENV TPM2_TSS_BINDINGS_VERSION=3.2.2 +ENV TPM2_TSS_BINDINGS_VERSION=4.0.1 ARG TPM2_TSS_VERSION=$TPM2_TSS_BINDINGS_VERSION ENV TPM2_TSS_VERSION=$TPM2_TSS_VERSION -ENV PKG_CONFIG_PATH /usr/local/lib/pkgconfig +ENV PKG_CONFIG_PATH=/usr/local/lib/pkgconfig + RUN git clone https://github.com/tpm2-software/tpm2-tss.git --branch $TPM2_TSS_VERSION RUN cd tpm2-tss \ && ./bootstrap \ diff --git a/tss-esapi/tests/create_frozen_cargo_lock b/tss-esapi/tests/create_frozen_cargo_lock new file mode 100755 index 00000000..5209f127 --- /dev/null +++ b/tss-esapi/tests/create_frozen_cargo_lock @@ -0,0 +1,16 @@ +#!/usr/bin/env bash + +# Copyright 2024 Contributors to the Parsec project. +# SPDX-License-Identifier: Apache-2.0 + +export MSRV=1.74.0 +export EXEC_DIR="tss-esapi" + +if [[ "$(basename `pwd`)" != "$EXEC_DIR" ]]; then + echo "Script should be run from ./$EXEC_DIR ." + exit 1 +fi + +rustup toolchain install $MSRV +cargo +$MSRV build +cp ../Cargo.lock tests/Cargo.lock.frozen \ No newline at end of file diff --git a/tss-esapi/tests/cross-compile.sh b/tss-esapi/tests/cross-compile.sh index 43517339..d76f42f7 100755 --- a/tss-esapi/tests/cross-compile.sh +++ b/tss-esapi/tests/cross-compile.sh @@ -11,7 +11,7 @@ set -euf -o pipefail OPENSSL_GIT="https://github.com/openssl/openssl.git" OPENSSL_VERSION="OpenSSL_1_1_1j" TPM2_TSS_GIT="https://github.com/tpm2-software/tpm2-tss.git" -TPM2_TSS_VERSION="3.2.2" +TPM2_TSS_VERSION="4.0.1" export SYSROOT="/tmp/sysroot" @@ -48,7 +48,7 @@ cross-compile-openssl() { cross-compile-tpm2-tss() { pushd /tmp/tpm2-tss [ ! -f configure ] && ./bootstrap - ./configure --enable-fapi=no --prefix=/ --build=x86_64-pc-linux-gnu --host=$1 --target=$1 CC=$1-gcc + ./configure --disable-fapi --disable-policy --prefix=/ --build=x86_64-pc-linux-gnu --host=$1 --target=$1 CC=$1-gcc make clean make -j$(nproc) make DESTDIR="$SYSROOT" install diff --git a/tss-esapi/tests/valgrind.sh b/tss-esapi/tests/valgrind.sh index 1936ddda..d8034d9a 100755 --- a/tss-esapi/tests/valgrind.sh +++ b/tss-esapi/tests/valgrind.sh @@ -18,6 +18,7 @@ tpm2_startup -c -T mssim ########################## # Install cargo-valgrind # ########################## +apt update apt install -y valgrind cargo install cargo-valgrind