From 0d4d892701abe85b77e7adb3d17a83a200dffcee Mon Sep 17 00:00:00 2001 From: Brandon Weeks Date: Tue, 4 Feb 2025 12:09:12 -0800 Subject: [PATCH] Regenerate pkcs11_windows.rs using bindgen 0.71.1 (#400) --- pkcs11-sys/pkcs11.h | 4 +- pkcs11-sys/src/pkcs11_windows.rs | 9609 ++++++------------------------ pkcs11-sys/third_party | 1 - 3 files changed, 1869 insertions(+), 7745 deletions(-) delete mode 120000 pkcs11-sys/third_party diff --git a/pkcs11-sys/pkcs11.h b/pkcs11-sys/pkcs11.h index b4c9795c..5839964f 100644 --- a/pkcs11-sys/pkcs11.h +++ b/pkcs11-sys/pkcs11.h @@ -36,8 +36,8 @@ #if defined(_WIN32) || defined(CRYPTOKI_FORCE_WIN32) #endif -#include "third_party/pkcs11/pkcs11.h" +#include "../third_party/pkcs11/pkcs11.h" #if defined(_WIN32) || defined(CRYPTOKI_FORCE_WIN32) #pragma pack(pop, cryptoki) -#endif \ No newline at end of file +#endif diff --git a/pkcs11-sys/src/pkcs11_windows.rs b/pkcs11-sys/src/pkcs11_windows.rs index b8c62e88..13418bb7 100644 --- a/pkcs11-sys/src/pkcs11_windows.rs +++ b/pkcs11-sys/src/pkcs11_windows.rs @@ -1,4 +1,4 @@ -/* automatically generated by rust-bindgen 0.63.0 */ +/* automatically generated by rust-bindgen 0.71.1 */ // Copyright 2022 Google LLC // @@ -969,41 +969,13 @@ pub struct CK_VERSION { pub major: CK_BYTE, pub minor: CK_BYTE, } -#[test] -fn bindgen_test_layout_CK_VERSION() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 2usize, - concat!("Size of: ", stringify!(CK_VERSION)) - ); - assert_eq!( - ::std::mem::align_of::(), - 1usize, - concat!("Alignment of ", stringify!(CK_VERSION)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).major) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(CK_VERSION), - "::", - stringify!(major) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).minor) as usize - ptr as usize }, - 1usize, - concat!( - "Offset of field: ", - stringify!(CK_VERSION), - "::", - stringify!(minor) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of CK_VERSION"][::std::mem::size_of::() - 2usize]; + ["Alignment of CK_VERSION"][::std::mem::align_of::() - 1usize]; + ["Offset of field: CK_VERSION::major"][::std::mem::offset_of!(CK_VERSION, major) - 0usize]; + ["Offset of field: CK_VERSION::minor"][::std::mem::offset_of!(CK_VERSION, minor) - 1usize]; +}; pub type CK_VERSION_PTR = *mut CK_VERSION; #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone)] @@ -1014,71 +986,20 @@ pub struct CK_INFO { pub libraryDescription: [CK_UTF8CHAR; 32usize], pub libraryVersion: CK_VERSION, } -#[test] -fn bindgen_test_layout_CK_INFO() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 72usize, - concat!("Size of: ", stringify!(CK_INFO)) - ); - assert_eq!( - ::std::mem::align_of::(), - 1usize, - concat!("Alignment of ", stringify!(CK_INFO)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).cryptokiVersion) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(CK_INFO), - "::", - stringify!(cryptokiVersion) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).manufacturerID) as usize - ptr as usize }, - 2usize, - concat!( - "Offset of field: ", - stringify!(CK_INFO), - "::", - stringify!(manufacturerID) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).flags) as usize - ptr as usize }, - 34usize, - concat!( - "Offset of field: ", - stringify!(CK_INFO), - "::", - stringify!(flags) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).libraryDescription) as usize - ptr as usize }, - 38usize, - concat!( - "Offset of field: ", - stringify!(CK_INFO), - "::", - stringify!(libraryDescription) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).libraryVersion) as usize - ptr as usize }, - 70usize, - concat!( - "Offset of field: ", - stringify!(CK_INFO), - "::", - stringify!(libraryVersion) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of CK_INFO"][::std::mem::size_of::() - 72usize]; + ["Alignment of CK_INFO"][::std::mem::align_of::() - 1usize]; + ["Offset of field: CK_INFO::cryptokiVersion"] + [::std::mem::offset_of!(CK_INFO, cryptokiVersion) - 0usize]; + ["Offset of field: CK_INFO::manufacturerID"] + [::std::mem::offset_of!(CK_INFO, manufacturerID) - 2usize]; + ["Offset of field: CK_INFO::flags"][::std::mem::offset_of!(CK_INFO, flags) - 34usize]; + ["Offset of field: CK_INFO::libraryDescription"] + [::std::mem::offset_of!(CK_INFO, libraryDescription) - 38usize]; + ["Offset of field: CK_INFO::libraryVersion"] + [::std::mem::offset_of!(CK_INFO, libraryVersion) - 70usize]; +}; pub type CK_INFO_PTR = *mut CK_INFO; pub type CK_NOTIFICATION = CK_ULONG; pub type CK_SLOT_ID = CK_ULONG; @@ -1092,71 +1013,20 @@ pub struct CK_SLOT_INFO { pub hardwareVersion: CK_VERSION, pub firmwareVersion: CK_VERSION, } -#[test] -fn bindgen_test_layout_CK_SLOT_INFO() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 104usize, - concat!("Size of: ", stringify!(CK_SLOT_INFO)) - ); - assert_eq!( - ::std::mem::align_of::(), - 1usize, - concat!("Alignment of ", stringify!(CK_SLOT_INFO)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).slotDescription) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(CK_SLOT_INFO), - "::", - stringify!(slotDescription) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).manufacturerID) as usize - ptr as usize }, - 64usize, - concat!( - "Offset of field: ", - stringify!(CK_SLOT_INFO), - "::", - stringify!(manufacturerID) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).flags) as usize - ptr as usize }, - 96usize, - concat!( - "Offset of field: ", - stringify!(CK_SLOT_INFO), - "::", - stringify!(flags) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).hardwareVersion) as usize - ptr as usize }, - 100usize, - concat!( - "Offset of field: ", - stringify!(CK_SLOT_INFO), - "::", - stringify!(hardwareVersion) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).firmwareVersion) as usize - ptr as usize }, - 102usize, - concat!( - "Offset of field: ", - stringify!(CK_SLOT_INFO), - "::", - stringify!(firmwareVersion) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of CK_SLOT_INFO"][::std::mem::size_of::() - 104usize]; + ["Alignment of CK_SLOT_INFO"][::std::mem::align_of::() - 1usize]; + ["Offset of field: CK_SLOT_INFO::slotDescription"] + [::std::mem::offset_of!(CK_SLOT_INFO, slotDescription) - 0usize]; + ["Offset of field: CK_SLOT_INFO::manufacturerID"] + [::std::mem::offset_of!(CK_SLOT_INFO, manufacturerID) - 64usize]; + ["Offset of field: CK_SLOT_INFO::flags"][::std::mem::offset_of!(CK_SLOT_INFO, flags) - 96usize]; + ["Offset of field: CK_SLOT_INFO::hardwareVersion"] + [::std::mem::offset_of!(CK_SLOT_INFO, hardwareVersion) - 100usize]; + ["Offset of field: CK_SLOT_INFO::firmwareVersion"] + [::std::mem::offset_of!(CK_SLOT_INFO, firmwareVersion) - 102usize]; +}; impl Default for CK_SLOT_INFO { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); @@ -1189,201 +1059,47 @@ pub struct CK_TOKEN_INFO { pub firmwareVersion: CK_VERSION, pub utcTime: [CK_CHAR; 16usize], } -#[test] -fn bindgen_test_layout_CK_TOKEN_INFO() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 160usize, - concat!("Size of: ", stringify!(CK_TOKEN_INFO)) - ); - assert_eq!( - ::std::mem::align_of::(), - 1usize, - concat!("Alignment of ", stringify!(CK_TOKEN_INFO)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).label) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(CK_TOKEN_INFO), - "::", - stringify!(label) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).manufacturerID) as usize - ptr as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(CK_TOKEN_INFO), - "::", - stringify!(manufacturerID) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).model) as usize - ptr as usize }, - 64usize, - concat!( - "Offset of field: ", - stringify!(CK_TOKEN_INFO), - "::", - stringify!(model) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).serialNumber) as usize - ptr as usize }, - 80usize, - concat!( - "Offset of field: ", - stringify!(CK_TOKEN_INFO), - "::", - stringify!(serialNumber) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).flags) as usize - ptr as usize }, - 96usize, - concat!( - "Offset of field: ", - stringify!(CK_TOKEN_INFO), - "::", - stringify!(flags) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulMaxSessionCount) as usize - ptr as usize }, - 100usize, - concat!( - "Offset of field: ", - stringify!(CK_TOKEN_INFO), - "::", - stringify!(ulMaxSessionCount) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulSessionCount) as usize - ptr as usize }, - 104usize, - concat!( - "Offset of field: ", - stringify!(CK_TOKEN_INFO), - "::", - stringify!(ulSessionCount) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulMaxRwSessionCount) as usize - ptr as usize }, - 108usize, - concat!( - "Offset of field: ", - stringify!(CK_TOKEN_INFO), - "::", - stringify!(ulMaxRwSessionCount) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulRwSessionCount) as usize - ptr as usize }, - 112usize, - concat!( - "Offset of field: ", - stringify!(CK_TOKEN_INFO), - "::", - stringify!(ulRwSessionCount) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulMaxPinLen) as usize - ptr as usize }, - 116usize, - concat!( - "Offset of field: ", - stringify!(CK_TOKEN_INFO), - "::", - stringify!(ulMaxPinLen) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulMinPinLen) as usize - ptr as usize }, - 120usize, - concat!( - "Offset of field: ", - stringify!(CK_TOKEN_INFO), - "::", - stringify!(ulMinPinLen) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulTotalPublicMemory) as usize - ptr as usize }, - 124usize, - concat!( - "Offset of field: ", - stringify!(CK_TOKEN_INFO), - "::", - stringify!(ulTotalPublicMemory) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulFreePublicMemory) as usize - ptr as usize }, - 128usize, - concat!( - "Offset of field: ", - stringify!(CK_TOKEN_INFO), - "::", - stringify!(ulFreePublicMemory) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulTotalPrivateMemory) as usize - ptr as usize }, - 132usize, - concat!( - "Offset of field: ", - stringify!(CK_TOKEN_INFO), - "::", - stringify!(ulTotalPrivateMemory) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulFreePrivateMemory) as usize - ptr as usize }, - 136usize, - concat!( - "Offset of field: ", - stringify!(CK_TOKEN_INFO), - "::", - stringify!(ulFreePrivateMemory) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).hardwareVersion) as usize - ptr as usize }, - 140usize, - concat!( - "Offset of field: ", - stringify!(CK_TOKEN_INFO), - "::", - stringify!(hardwareVersion) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).firmwareVersion) as usize - ptr as usize }, - 142usize, - concat!( - "Offset of field: ", - stringify!(CK_TOKEN_INFO), - "::", - stringify!(firmwareVersion) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).utcTime) as usize - ptr as usize }, - 144usize, - concat!( - "Offset of field: ", - stringify!(CK_TOKEN_INFO), - "::", - stringify!(utcTime) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of CK_TOKEN_INFO"][::std::mem::size_of::() - 160usize]; + ["Alignment of CK_TOKEN_INFO"][::std::mem::align_of::() - 1usize]; + ["Offset of field: CK_TOKEN_INFO::label"] + [::std::mem::offset_of!(CK_TOKEN_INFO, label) - 0usize]; + ["Offset of field: CK_TOKEN_INFO::manufacturerID"] + [::std::mem::offset_of!(CK_TOKEN_INFO, manufacturerID) - 32usize]; + ["Offset of field: CK_TOKEN_INFO::model"] + [::std::mem::offset_of!(CK_TOKEN_INFO, model) - 64usize]; + ["Offset of field: CK_TOKEN_INFO::serialNumber"] + [::std::mem::offset_of!(CK_TOKEN_INFO, serialNumber) - 80usize]; + ["Offset of field: CK_TOKEN_INFO::flags"] + [::std::mem::offset_of!(CK_TOKEN_INFO, flags) - 96usize]; + ["Offset of field: CK_TOKEN_INFO::ulMaxSessionCount"] + [::std::mem::offset_of!(CK_TOKEN_INFO, ulMaxSessionCount) - 100usize]; + ["Offset of field: CK_TOKEN_INFO::ulSessionCount"] + [::std::mem::offset_of!(CK_TOKEN_INFO, ulSessionCount) - 104usize]; + ["Offset of field: CK_TOKEN_INFO::ulMaxRwSessionCount"] + [::std::mem::offset_of!(CK_TOKEN_INFO, ulMaxRwSessionCount) - 108usize]; + ["Offset of field: CK_TOKEN_INFO::ulRwSessionCount"] + [::std::mem::offset_of!(CK_TOKEN_INFO, ulRwSessionCount) - 112usize]; + ["Offset of field: CK_TOKEN_INFO::ulMaxPinLen"] + [::std::mem::offset_of!(CK_TOKEN_INFO, ulMaxPinLen) - 116usize]; + ["Offset of field: CK_TOKEN_INFO::ulMinPinLen"] + [::std::mem::offset_of!(CK_TOKEN_INFO, ulMinPinLen) - 120usize]; + ["Offset of field: CK_TOKEN_INFO::ulTotalPublicMemory"] + [::std::mem::offset_of!(CK_TOKEN_INFO, ulTotalPublicMemory) - 124usize]; + ["Offset of field: CK_TOKEN_INFO::ulFreePublicMemory"] + [::std::mem::offset_of!(CK_TOKEN_INFO, ulFreePublicMemory) - 128usize]; + ["Offset of field: CK_TOKEN_INFO::ulTotalPrivateMemory"] + [::std::mem::offset_of!(CK_TOKEN_INFO, ulTotalPrivateMemory) - 132usize]; + ["Offset of field: CK_TOKEN_INFO::ulFreePrivateMemory"] + [::std::mem::offset_of!(CK_TOKEN_INFO, ulFreePrivateMemory) - 136usize]; + ["Offset of field: CK_TOKEN_INFO::hardwareVersion"] + [::std::mem::offset_of!(CK_TOKEN_INFO, hardwareVersion) - 140usize]; + ["Offset of field: CK_TOKEN_INFO::firmwareVersion"] + [::std::mem::offset_of!(CK_TOKEN_INFO, firmwareVersion) - 142usize]; + ["Offset of field: CK_TOKEN_INFO::utcTime"] + [::std::mem::offset_of!(CK_TOKEN_INFO, utcTime) - 144usize]; +}; pub type CK_TOKEN_INFO_PTR = *mut CK_TOKEN_INFO; pub type CK_SESSION_HANDLE = CK_ULONG; pub type CK_SESSION_HANDLE_PTR = *mut CK_SESSION_HANDLE; @@ -1397,61 +1113,19 @@ pub struct CK_SESSION_INFO { pub flags: CK_FLAGS, pub ulDeviceError: CK_ULONG, } -#[test] -fn bindgen_test_layout_CK_SESSION_INFO() { - 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!(CK_SESSION_INFO)) - ); - assert_eq!( - ::std::mem::align_of::(), - 1usize, - concat!("Alignment of ", stringify!(CK_SESSION_INFO)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).slotID) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(CK_SESSION_INFO), - "::", - stringify!(slotID) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).state) as usize - ptr as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(CK_SESSION_INFO), - "::", - stringify!(state) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).flags) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(CK_SESSION_INFO), - "::", - stringify!(flags) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulDeviceError) as usize - ptr as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(CK_SESSION_INFO), - "::", - stringify!(ulDeviceError) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of CK_SESSION_INFO"][::std::mem::size_of::() - 16usize]; + ["Alignment of CK_SESSION_INFO"][::std::mem::align_of::() - 1usize]; + ["Offset of field: CK_SESSION_INFO::slotID"] + [::std::mem::offset_of!(CK_SESSION_INFO, slotID) - 0usize]; + ["Offset of field: CK_SESSION_INFO::state"] + [::std::mem::offset_of!(CK_SESSION_INFO, state) - 4usize]; + ["Offset of field: CK_SESSION_INFO::flags"] + [::std::mem::offset_of!(CK_SESSION_INFO, flags) - 8usize]; + ["Offset of field: CK_SESSION_INFO::ulDeviceError"] + [::std::mem::offset_of!(CK_SESSION_INFO, ulDeviceError) - 12usize]; +}; pub type CK_SESSION_INFO_PTR = *mut CK_SESSION_INFO; pub type CK_OBJECT_HANDLE = CK_ULONG; pub type CK_OBJECT_HANDLE_PTR = *mut CK_OBJECT_HANDLE; @@ -1468,51 +1142,16 @@ pub struct CK_ATTRIBUTE { pub pValue: CK_VOID_PTR, pub ulValueLen: CK_ULONG, } -#[test] -fn bindgen_test_layout_CK_ATTRIBUTE() { - 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!(CK_ATTRIBUTE)) - ); - assert_eq!( - ::std::mem::align_of::(), - 1usize, - concat!("Alignment of ", stringify!(CK_ATTRIBUTE)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).type_) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(CK_ATTRIBUTE), - "::", - stringify!(type_) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pValue) as usize - ptr as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(CK_ATTRIBUTE), - "::", - stringify!(pValue) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulValueLen) as usize - ptr as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(CK_ATTRIBUTE), - "::", - stringify!(ulValueLen) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of CK_ATTRIBUTE"][::std::mem::size_of::() - 16usize]; + ["Alignment of CK_ATTRIBUTE"][::std::mem::align_of::() - 1usize]; + ["Offset of field: CK_ATTRIBUTE::type_"][::std::mem::offset_of!(CK_ATTRIBUTE, type_) - 0usize]; + ["Offset of field: CK_ATTRIBUTE::pValue"] + [::std::mem::offset_of!(CK_ATTRIBUTE, pValue) - 4usize]; + ["Offset of field: CK_ATTRIBUTE::ulValueLen"] + [::std::mem::offset_of!(CK_ATTRIBUTE, ulValueLen) - 12usize]; +}; impl Default for CK_ATTRIBUTE { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); @@ -1530,51 +1169,14 @@ pub struct CK_DATE { pub month: [CK_CHAR; 2usize], pub day: [CK_CHAR; 2usize], } -#[test] -fn bindgen_test_layout_CK_DATE() { - 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!(CK_DATE)) - ); - assert_eq!( - ::std::mem::align_of::(), - 1usize, - concat!("Alignment of ", stringify!(CK_DATE)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).year) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(CK_DATE), - "::", - stringify!(year) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).month) as usize - ptr as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(CK_DATE), - "::", - stringify!(month) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).day) as usize - ptr as usize }, - 6usize, - concat!( - "Offset of field: ", - stringify!(CK_DATE), - "::", - stringify!(day) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of CK_DATE"][::std::mem::size_of::() - 8usize]; + ["Alignment of CK_DATE"][::std::mem::align_of::() - 1usize]; + ["Offset of field: CK_DATE::year"][::std::mem::offset_of!(CK_DATE, year) - 0usize]; + ["Offset of field: CK_DATE::month"][::std::mem::offset_of!(CK_DATE, month) - 4usize]; + ["Offset of field: CK_DATE::day"][::std::mem::offset_of!(CK_DATE, day) - 6usize]; +}; pub type CK_MECHANISM_TYPE = CK_ULONG; pub type CK_MECHANISM_TYPE_PTR = *mut CK_MECHANISM_TYPE; #[repr(C, packed)] @@ -1584,51 +1186,17 @@ pub struct CK_MECHANISM { pub pParameter: CK_VOID_PTR, pub ulParameterLen: CK_ULONG, } -#[test] -fn bindgen_test_layout_CK_MECHANISM() { - 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!(CK_MECHANISM)) - ); - assert_eq!( - ::std::mem::align_of::(), - 1usize, - concat!("Alignment of ", stringify!(CK_MECHANISM)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).mechanism) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(CK_MECHANISM), - "::", - stringify!(mechanism) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pParameter) as usize - ptr as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(CK_MECHANISM), - "::", - stringify!(pParameter) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulParameterLen) as usize - ptr as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(CK_MECHANISM), - "::", - stringify!(ulParameterLen) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of CK_MECHANISM"][::std::mem::size_of::() - 16usize]; + ["Alignment of CK_MECHANISM"][::std::mem::align_of::() - 1usize]; + ["Offset of field: CK_MECHANISM::mechanism"] + [::std::mem::offset_of!(CK_MECHANISM, mechanism) - 0usize]; + ["Offset of field: CK_MECHANISM::pParameter"] + [::std::mem::offset_of!(CK_MECHANISM, pParameter) - 4usize]; + ["Offset of field: CK_MECHANISM::ulParameterLen"] + [::std::mem::offset_of!(CK_MECHANISM, ulParameterLen) - 12usize]; +}; impl Default for CK_MECHANISM { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); @@ -1646,51 +1214,17 @@ pub struct CK_MECHANISM_INFO { pub ulMaxKeySize: CK_ULONG, pub flags: CK_FLAGS, } -#[test] -fn bindgen_test_layout_CK_MECHANISM_INFO() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 12usize, - concat!("Size of: ", stringify!(CK_MECHANISM_INFO)) - ); - assert_eq!( - ::std::mem::align_of::(), - 1usize, - concat!("Alignment of ", stringify!(CK_MECHANISM_INFO)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulMinKeySize) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(CK_MECHANISM_INFO), - "::", - stringify!(ulMinKeySize) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulMaxKeySize) as usize - ptr as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(CK_MECHANISM_INFO), - "::", - stringify!(ulMaxKeySize) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).flags) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(CK_MECHANISM_INFO), - "::", - stringify!(flags) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of CK_MECHANISM_INFO"][::std::mem::size_of::() - 12usize]; + ["Alignment of CK_MECHANISM_INFO"][::std::mem::align_of::() - 1usize]; + ["Offset of field: CK_MECHANISM_INFO::ulMinKeySize"] + [::std::mem::offset_of!(CK_MECHANISM_INFO, ulMinKeySize) - 0usize]; + ["Offset of field: CK_MECHANISM_INFO::ulMaxKeySize"] + [::std::mem::offset_of!(CK_MECHANISM_INFO, ulMaxKeySize) - 4usize]; + ["Offset of field: CK_MECHANISM_INFO::flags"] + [::std::mem::offset_of!(CK_MECHANISM_INFO, flags) - 8usize]; +}; pub type CK_MECHANISM_INFO_PTR = *mut CK_MECHANISM_INFO; pub type CK_RV = CK_ULONG; pub type CK_NOTIFY = ::std::option::Option< @@ -1711,51 +1245,16 @@ pub struct CK_INTERFACE { pub pFunctionList: CK_VOID_PTR, pub flags: CK_FLAGS, } -#[test] -fn bindgen_test_layout_CK_INTERFACE() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 20usize, - concat!("Size of: ", stringify!(CK_INTERFACE)) - ); - assert_eq!( - ::std::mem::align_of::(), - 1usize, - concat!("Alignment of ", stringify!(CK_INTERFACE)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pInterfaceName) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(CK_INTERFACE), - "::", - stringify!(pInterfaceName) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pFunctionList) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(CK_INTERFACE), - "::", - stringify!(pFunctionList) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).flags) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(CK_INTERFACE), - "::", - stringify!(flags) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of CK_INTERFACE"][::std::mem::size_of::() - 20usize]; + ["Alignment of CK_INTERFACE"][::std::mem::align_of::() - 1usize]; + ["Offset of field: CK_INTERFACE::pInterfaceName"] + [::std::mem::offset_of!(CK_INTERFACE, pInterfaceName) - 0usize]; + ["Offset of field: CK_INTERFACE::pFunctionList"] + [::std::mem::offset_of!(CK_INTERFACE, pFunctionList) - 8usize]; + ["Offset of field: CK_INTERFACE::flags"][::std::mem::offset_of!(CK_INTERFACE, flags) - 16usize]; +}; impl Default for CK_INTERFACE { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); @@ -1783,81 +1282,23 @@ pub struct CK_C_INITIALIZE_ARGS { pub flags: CK_FLAGS, pub pReserved: CK_VOID_PTR, } -#[test] -fn bindgen_test_layout_CK_C_INITIALIZE_ARGS() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 44usize, - concat!("Size of: ", stringify!(CK_C_INITIALIZE_ARGS)) - ); - assert_eq!( - ::std::mem::align_of::(), - 1usize, - concat!("Alignment of ", stringify!(CK_C_INITIALIZE_ARGS)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).CreateMutex) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(CK_C_INITIALIZE_ARGS), - "::", - stringify!(CreateMutex) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).DestroyMutex) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(CK_C_INITIALIZE_ARGS), - "::", - stringify!(DestroyMutex) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).LockMutex) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(CK_C_INITIALIZE_ARGS), - "::", - stringify!(LockMutex) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).UnlockMutex) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(CK_C_INITIALIZE_ARGS), - "::", - stringify!(UnlockMutex) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).flags) as usize - ptr as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(CK_C_INITIALIZE_ARGS), - "::", - stringify!(flags) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pReserved) as usize - ptr as usize }, - 36usize, - concat!( - "Offset of field: ", - stringify!(CK_C_INITIALIZE_ARGS), - "::", - stringify!(pReserved) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of CK_C_INITIALIZE_ARGS"][::std::mem::size_of::() - 44usize]; + ["Alignment of CK_C_INITIALIZE_ARGS"][::std::mem::align_of::() - 1usize]; + ["Offset of field: CK_C_INITIALIZE_ARGS::CreateMutex"] + [::std::mem::offset_of!(CK_C_INITIALIZE_ARGS, CreateMutex) - 0usize]; + ["Offset of field: CK_C_INITIALIZE_ARGS::DestroyMutex"] + [::std::mem::offset_of!(CK_C_INITIALIZE_ARGS, DestroyMutex) - 8usize]; + ["Offset of field: CK_C_INITIALIZE_ARGS::LockMutex"] + [::std::mem::offset_of!(CK_C_INITIALIZE_ARGS, LockMutex) - 16usize]; + ["Offset of field: CK_C_INITIALIZE_ARGS::UnlockMutex"] + [::std::mem::offset_of!(CK_C_INITIALIZE_ARGS, UnlockMutex) - 24usize]; + ["Offset of field: CK_C_INITIALIZE_ARGS::flags"] + [::std::mem::offset_of!(CK_C_INITIALIZE_ARGS, flags) - 32usize]; + ["Offset of field: CK_C_INITIALIZE_ARGS::pReserved"] + [::std::mem::offset_of!(CK_C_INITIALIZE_ARGS, pReserved) - 36usize]; +}; impl Default for CK_C_INITIALIZE_ARGS { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); @@ -1881,72 +1322,22 @@ pub struct CK_RSA_PKCS_OAEP_PARAMS { pub pSourceData: CK_VOID_PTR, pub ulSourceDataLen: CK_ULONG, } -#[test] -fn bindgen_test_layout_CK_RSA_PKCS_OAEP_PARAMS() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 24usize, - concat!("Size of: ", stringify!(CK_RSA_PKCS_OAEP_PARAMS)) - ); - assert_eq!( - ::std::mem::align_of::(), - 1usize, - concat!("Alignment of ", stringify!(CK_RSA_PKCS_OAEP_PARAMS)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).hashAlg) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(CK_RSA_PKCS_OAEP_PARAMS), - "::", - stringify!(hashAlg) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).mgf) as usize - ptr as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(CK_RSA_PKCS_OAEP_PARAMS), - "::", - stringify!(mgf) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).source) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(CK_RSA_PKCS_OAEP_PARAMS), - "::", - stringify!(source) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pSourceData) as usize - ptr as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(CK_RSA_PKCS_OAEP_PARAMS), - "::", - stringify!(pSourceData) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulSourceDataLen) as usize - ptr as usize }, - 20usize, - concat!( - "Offset of field: ", - stringify!(CK_RSA_PKCS_OAEP_PARAMS), - "::", - stringify!(ulSourceDataLen) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of CK_RSA_PKCS_OAEP_PARAMS"][::std::mem::size_of::() - 24usize]; + ["Alignment of CK_RSA_PKCS_OAEP_PARAMS"] + [::std::mem::align_of::() - 1usize]; + ["Offset of field: CK_RSA_PKCS_OAEP_PARAMS::hashAlg"] + [::std::mem::offset_of!(CK_RSA_PKCS_OAEP_PARAMS, hashAlg) - 0usize]; + ["Offset of field: CK_RSA_PKCS_OAEP_PARAMS::mgf"] + [::std::mem::offset_of!(CK_RSA_PKCS_OAEP_PARAMS, mgf) - 4usize]; + ["Offset of field: CK_RSA_PKCS_OAEP_PARAMS::source"] + [::std::mem::offset_of!(CK_RSA_PKCS_OAEP_PARAMS, source) - 8usize]; + ["Offset of field: CK_RSA_PKCS_OAEP_PARAMS::pSourceData"] + [::std::mem::offset_of!(CK_RSA_PKCS_OAEP_PARAMS, pSourceData) - 12usize]; + ["Offset of field: CK_RSA_PKCS_OAEP_PARAMS::ulSourceDataLen"] + [::std::mem::offset_of!(CK_RSA_PKCS_OAEP_PARAMS, ulSourceDataLen) - 20usize]; +}; impl Default for CK_RSA_PKCS_OAEP_PARAMS { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); @@ -1964,52 +1355,18 @@ pub struct CK_RSA_PKCS_PSS_PARAMS { pub mgf: CK_RSA_PKCS_MGF_TYPE, pub sLen: CK_ULONG, } -#[test] -fn bindgen_test_layout_CK_RSA_PKCS_PSS_PARAMS() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 12usize, - concat!("Size of: ", stringify!(CK_RSA_PKCS_PSS_PARAMS)) - ); - assert_eq!( - ::std::mem::align_of::(), - 1usize, - concat!("Alignment of ", stringify!(CK_RSA_PKCS_PSS_PARAMS)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).hashAlg) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(CK_RSA_PKCS_PSS_PARAMS), - "::", - stringify!(hashAlg) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).mgf) as usize - ptr as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(CK_RSA_PKCS_PSS_PARAMS), - "::", - stringify!(mgf) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).sLen) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(CK_RSA_PKCS_PSS_PARAMS), - "::", - stringify!(sLen) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of CK_RSA_PKCS_PSS_PARAMS"][::std::mem::size_of::() - 12usize]; + ["Alignment of CK_RSA_PKCS_PSS_PARAMS"] + [::std::mem::align_of::() - 1usize]; + ["Offset of field: CK_RSA_PKCS_PSS_PARAMS::hashAlg"] + [::std::mem::offset_of!(CK_RSA_PKCS_PSS_PARAMS, hashAlg) - 0usize]; + ["Offset of field: CK_RSA_PKCS_PSS_PARAMS::mgf"] + [::std::mem::offset_of!(CK_RSA_PKCS_PSS_PARAMS, mgf) - 4usize]; + ["Offset of field: CK_RSA_PKCS_PSS_PARAMS::sLen"] + [::std::mem::offset_of!(CK_RSA_PKCS_PSS_PARAMS, sLen) - 8usize]; +}; pub type CK_RSA_PKCS_PSS_PARAMS_PTR = *mut CK_RSA_PKCS_PSS_PARAMS; pub type CK_EC_KDF_TYPE = CK_ULONG; pub type CK_EC_KDF_TYPE_PTR = *mut CK_EC_KDF_TYPE; @@ -2022,72 +1379,22 @@ pub struct CK_ECDH1_DERIVE_PARAMS { pub ulPublicDataLen: CK_ULONG, pub pPublicData: CK_BYTE_PTR, } -#[test] -fn bindgen_test_layout_CK_ECDH1_DERIVE_PARAMS() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 28usize, - concat!("Size of: ", stringify!(CK_ECDH1_DERIVE_PARAMS)) - ); - assert_eq!( - ::std::mem::align_of::(), - 1usize, - concat!("Alignment of ", stringify!(CK_ECDH1_DERIVE_PARAMS)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).kdf) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(CK_ECDH1_DERIVE_PARAMS), - "::", - stringify!(kdf) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulSharedDataLen) as usize - ptr as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(CK_ECDH1_DERIVE_PARAMS), - "::", - stringify!(ulSharedDataLen) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pSharedData) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(CK_ECDH1_DERIVE_PARAMS), - "::", - stringify!(pSharedData) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulPublicDataLen) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(CK_ECDH1_DERIVE_PARAMS), - "::", - stringify!(ulPublicDataLen) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pPublicData) as usize - ptr as usize }, - 20usize, - concat!( - "Offset of field: ", - stringify!(CK_ECDH1_DERIVE_PARAMS), - "::", - stringify!(pPublicData) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of CK_ECDH1_DERIVE_PARAMS"][::std::mem::size_of::() - 28usize]; + ["Alignment of CK_ECDH1_DERIVE_PARAMS"] + [::std::mem::align_of::() - 1usize]; + ["Offset of field: CK_ECDH1_DERIVE_PARAMS::kdf"] + [::std::mem::offset_of!(CK_ECDH1_DERIVE_PARAMS, kdf) - 0usize]; + ["Offset of field: CK_ECDH1_DERIVE_PARAMS::ulSharedDataLen"] + [::std::mem::offset_of!(CK_ECDH1_DERIVE_PARAMS, ulSharedDataLen) - 4usize]; + ["Offset of field: CK_ECDH1_DERIVE_PARAMS::pSharedData"] + [::std::mem::offset_of!(CK_ECDH1_DERIVE_PARAMS, pSharedData) - 8usize]; + ["Offset of field: CK_ECDH1_DERIVE_PARAMS::ulPublicDataLen"] + [::std::mem::offset_of!(CK_ECDH1_DERIVE_PARAMS, ulPublicDataLen) - 16usize]; + ["Offset of field: CK_ECDH1_DERIVE_PARAMS::pPublicData"] + [::std::mem::offset_of!(CK_ECDH1_DERIVE_PARAMS, pPublicData) - 20usize]; +}; impl Default for CK_ECDH1_DERIVE_PARAMS { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); @@ -2111,112 +1418,30 @@ pub struct CK_ECDH2_DERIVE_PARAMS { pub ulPublicDataLen2: CK_ULONG, pub pPublicData2: CK_BYTE_PTR, } -#[test] -fn bindgen_test_layout_CK_ECDH2_DERIVE_PARAMS() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 48usize, - concat!("Size of: ", stringify!(CK_ECDH2_DERIVE_PARAMS)) - ); - assert_eq!( - ::std::mem::align_of::(), - 1usize, - concat!("Alignment of ", stringify!(CK_ECDH2_DERIVE_PARAMS)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).kdf) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(CK_ECDH2_DERIVE_PARAMS), - "::", - stringify!(kdf) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulSharedDataLen) as usize - ptr as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(CK_ECDH2_DERIVE_PARAMS), - "::", - stringify!(ulSharedDataLen) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pSharedData) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(CK_ECDH2_DERIVE_PARAMS), - "::", - stringify!(pSharedData) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulPublicDataLen) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(CK_ECDH2_DERIVE_PARAMS), - "::", - stringify!(ulPublicDataLen) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pPublicData) as usize - ptr as usize }, - 20usize, - concat!( - "Offset of field: ", - stringify!(CK_ECDH2_DERIVE_PARAMS), - "::", - stringify!(pPublicData) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulPrivateDataLen) as usize - ptr as usize }, - 28usize, - concat!( - "Offset of field: ", - stringify!(CK_ECDH2_DERIVE_PARAMS), - "::", - stringify!(ulPrivateDataLen) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).hPrivateData) as usize - ptr as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(CK_ECDH2_DERIVE_PARAMS), - "::", - stringify!(hPrivateData) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulPublicDataLen2) as usize - ptr as usize }, - 36usize, - concat!( - "Offset of field: ", - stringify!(CK_ECDH2_DERIVE_PARAMS), - "::", - stringify!(ulPublicDataLen2) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pPublicData2) as usize - ptr as usize }, - 40usize, - concat!( - "Offset of field: ", - stringify!(CK_ECDH2_DERIVE_PARAMS), - "::", - stringify!(pPublicData2) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of CK_ECDH2_DERIVE_PARAMS"][::std::mem::size_of::() - 48usize]; + ["Alignment of CK_ECDH2_DERIVE_PARAMS"] + [::std::mem::align_of::() - 1usize]; + ["Offset of field: CK_ECDH2_DERIVE_PARAMS::kdf"] + [::std::mem::offset_of!(CK_ECDH2_DERIVE_PARAMS, kdf) - 0usize]; + ["Offset of field: CK_ECDH2_DERIVE_PARAMS::ulSharedDataLen"] + [::std::mem::offset_of!(CK_ECDH2_DERIVE_PARAMS, ulSharedDataLen) - 4usize]; + ["Offset of field: CK_ECDH2_DERIVE_PARAMS::pSharedData"] + [::std::mem::offset_of!(CK_ECDH2_DERIVE_PARAMS, pSharedData) - 8usize]; + ["Offset of field: CK_ECDH2_DERIVE_PARAMS::ulPublicDataLen"] + [::std::mem::offset_of!(CK_ECDH2_DERIVE_PARAMS, ulPublicDataLen) - 16usize]; + ["Offset of field: CK_ECDH2_DERIVE_PARAMS::pPublicData"] + [::std::mem::offset_of!(CK_ECDH2_DERIVE_PARAMS, pPublicData) - 20usize]; + ["Offset of field: CK_ECDH2_DERIVE_PARAMS::ulPrivateDataLen"] + [::std::mem::offset_of!(CK_ECDH2_DERIVE_PARAMS, ulPrivateDataLen) - 28usize]; + ["Offset of field: CK_ECDH2_DERIVE_PARAMS::hPrivateData"] + [::std::mem::offset_of!(CK_ECDH2_DERIVE_PARAMS, hPrivateData) - 32usize]; + ["Offset of field: CK_ECDH2_DERIVE_PARAMS::ulPublicDataLen2"] + [::std::mem::offset_of!(CK_ECDH2_DERIVE_PARAMS, ulPublicDataLen2) - 36usize]; + ["Offset of field: CK_ECDH2_DERIVE_PARAMS::pPublicData2"] + [::std::mem::offset_of!(CK_ECDH2_DERIVE_PARAMS, pPublicData2) - 40usize]; +}; impl Default for CK_ECDH2_DERIVE_PARAMS { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); @@ -2241,122 +1466,32 @@ pub struct CK_ECMQV_DERIVE_PARAMS { pub pPublicData2: CK_BYTE_PTR, pub publicKey: CK_OBJECT_HANDLE, } -#[test] -fn bindgen_test_layout_CK_ECMQV_DERIVE_PARAMS() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 52usize, - concat!("Size of: ", stringify!(CK_ECMQV_DERIVE_PARAMS)) - ); - assert_eq!( - ::std::mem::align_of::(), - 1usize, - concat!("Alignment of ", stringify!(CK_ECMQV_DERIVE_PARAMS)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).kdf) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(CK_ECMQV_DERIVE_PARAMS), - "::", - stringify!(kdf) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulSharedDataLen) as usize - ptr as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(CK_ECMQV_DERIVE_PARAMS), - "::", - stringify!(ulSharedDataLen) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pSharedData) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(CK_ECMQV_DERIVE_PARAMS), - "::", - stringify!(pSharedData) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulPublicDataLen) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(CK_ECMQV_DERIVE_PARAMS), - "::", - stringify!(ulPublicDataLen) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pPublicData) as usize - ptr as usize }, - 20usize, - concat!( - "Offset of field: ", - stringify!(CK_ECMQV_DERIVE_PARAMS), - "::", - stringify!(pPublicData) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulPrivateDataLen) as usize - ptr as usize }, - 28usize, - concat!( - "Offset of field: ", - stringify!(CK_ECMQV_DERIVE_PARAMS), - "::", - stringify!(ulPrivateDataLen) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).hPrivateData) as usize - ptr as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(CK_ECMQV_DERIVE_PARAMS), - "::", - stringify!(hPrivateData) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulPublicDataLen2) as usize - ptr as usize }, - 36usize, - concat!( - "Offset of field: ", - stringify!(CK_ECMQV_DERIVE_PARAMS), - "::", - stringify!(ulPublicDataLen2) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pPublicData2) as usize - ptr as usize }, - 40usize, - concat!( - "Offset of field: ", - stringify!(CK_ECMQV_DERIVE_PARAMS), - "::", - stringify!(pPublicData2) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).publicKey) as usize - ptr as usize }, - 48usize, - concat!( - "Offset of field: ", - stringify!(CK_ECMQV_DERIVE_PARAMS), - "::", - stringify!(publicKey) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of CK_ECMQV_DERIVE_PARAMS"][::std::mem::size_of::() - 52usize]; + ["Alignment of CK_ECMQV_DERIVE_PARAMS"] + [::std::mem::align_of::() - 1usize]; + ["Offset of field: CK_ECMQV_DERIVE_PARAMS::kdf"] + [::std::mem::offset_of!(CK_ECMQV_DERIVE_PARAMS, kdf) - 0usize]; + ["Offset of field: CK_ECMQV_DERIVE_PARAMS::ulSharedDataLen"] + [::std::mem::offset_of!(CK_ECMQV_DERIVE_PARAMS, ulSharedDataLen) - 4usize]; + ["Offset of field: CK_ECMQV_DERIVE_PARAMS::pSharedData"] + [::std::mem::offset_of!(CK_ECMQV_DERIVE_PARAMS, pSharedData) - 8usize]; + ["Offset of field: CK_ECMQV_DERIVE_PARAMS::ulPublicDataLen"] + [::std::mem::offset_of!(CK_ECMQV_DERIVE_PARAMS, ulPublicDataLen) - 16usize]; + ["Offset of field: CK_ECMQV_DERIVE_PARAMS::pPublicData"] + [::std::mem::offset_of!(CK_ECMQV_DERIVE_PARAMS, pPublicData) - 20usize]; + ["Offset of field: CK_ECMQV_DERIVE_PARAMS::ulPrivateDataLen"] + [::std::mem::offset_of!(CK_ECMQV_DERIVE_PARAMS, ulPrivateDataLen) - 28usize]; + ["Offset of field: CK_ECMQV_DERIVE_PARAMS::hPrivateData"] + [::std::mem::offset_of!(CK_ECMQV_DERIVE_PARAMS, hPrivateData) - 32usize]; + ["Offset of field: CK_ECMQV_DERIVE_PARAMS::ulPublicDataLen2"] + [::std::mem::offset_of!(CK_ECMQV_DERIVE_PARAMS, ulPublicDataLen2) - 36usize]; + ["Offset of field: CK_ECMQV_DERIVE_PARAMS::pPublicData2"] + [::std::mem::offset_of!(CK_ECMQV_DERIVE_PARAMS, pPublicData2) - 40usize]; + ["Offset of field: CK_ECMQV_DERIVE_PARAMS::publicKey"] + [::std::mem::offset_of!(CK_ECMQV_DERIVE_PARAMS, publicKey) - 48usize]; +}; impl Default for CK_ECMQV_DERIVE_PARAMS { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); @@ -2378,72 +1513,23 @@ pub struct CK_X9_42_DH1_DERIVE_PARAMS { pub ulPublicDataLen: CK_ULONG, pub pPublicData: CK_BYTE_PTR, } -#[test] -fn bindgen_test_layout_CK_X9_42_DH1_DERIVE_PARAMS() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 28usize, - concat!("Size of: ", stringify!(CK_X9_42_DH1_DERIVE_PARAMS)) - ); - assert_eq!( - ::std::mem::align_of::(), - 1usize, - concat!("Alignment of ", stringify!(CK_X9_42_DH1_DERIVE_PARAMS)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).kdf) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(CK_X9_42_DH1_DERIVE_PARAMS), - "::", - stringify!(kdf) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulOtherInfoLen) as usize - ptr as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(CK_X9_42_DH1_DERIVE_PARAMS), - "::", - stringify!(ulOtherInfoLen) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pOtherInfo) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(CK_X9_42_DH1_DERIVE_PARAMS), - "::", - stringify!(pOtherInfo) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulPublicDataLen) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(CK_X9_42_DH1_DERIVE_PARAMS), - "::", - stringify!(ulPublicDataLen) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pPublicData) as usize - ptr as usize }, - 20usize, - concat!( - "Offset of field: ", - stringify!(CK_X9_42_DH1_DERIVE_PARAMS), - "::", - stringify!(pPublicData) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of CK_X9_42_DH1_DERIVE_PARAMS"] + [::std::mem::size_of::() - 28usize]; + ["Alignment of CK_X9_42_DH1_DERIVE_PARAMS"] + [::std::mem::align_of::() - 1usize]; + ["Offset of field: CK_X9_42_DH1_DERIVE_PARAMS::kdf"] + [::std::mem::offset_of!(CK_X9_42_DH1_DERIVE_PARAMS, kdf) - 0usize]; + ["Offset of field: CK_X9_42_DH1_DERIVE_PARAMS::ulOtherInfoLen"] + [::std::mem::offset_of!(CK_X9_42_DH1_DERIVE_PARAMS, ulOtherInfoLen) - 4usize]; + ["Offset of field: CK_X9_42_DH1_DERIVE_PARAMS::pOtherInfo"] + [::std::mem::offset_of!(CK_X9_42_DH1_DERIVE_PARAMS, pOtherInfo) - 8usize]; + ["Offset of field: CK_X9_42_DH1_DERIVE_PARAMS::ulPublicDataLen"] + [::std::mem::offset_of!(CK_X9_42_DH1_DERIVE_PARAMS, ulPublicDataLen) - 16usize]; + ["Offset of field: CK_X9_42_DH1_DERIVE_PARAMS::pPublicData"] + [::std::mem::offset_of!(CK_X9_42_DH1_DERIVE_PARAMS, pPublicData) - 20usize]; +}; impl Default for CK_X9_42_DH1_DERIVE_PARAMS { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); @@ -2467,112 +1553,31 @@ pub struct CK_X9_42_DH2_DERIVE_PARAMS { pub ulPublicDataLen2: CK_ULONG, pub pPublicData2: CK_BYTE_PTR, } -#[test] -fn bindgen_test_layout_CK_X9_42_DH2_DERIVE_PARAMS() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 48usize, - concat!("Size of: ", stringify!(CK_X9_42_DH2_DERIVE_PARAMS)) - ); - assert_eq!( - ::std::mem::align_of::(), - 1usize, - concat!("Alignment of ", stringify!(CK_X9_42_DH2_DERIVE_PARAMS)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).kdf) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(CK_X9_42_DH2_DERIVE_PARAMS), - "::", - stringify!(kdf) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulOtherInfoLen) as usize - ptr as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(CK_X9_42_DH2_DERIVE_PARAMS), - "::", - stringify!(ulOtherInfoLen) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pOtherInfo) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(CK_X9_42_DH2_DERIVE_PARAMS), - "::", - stringify!(pOtherInfo) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulPublicDataLen) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(CK_X9_42_DH2_DERIVE_PARAMS), - "::", - stringify!(ulPublicDataLen) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pPublicData) as usize - ptr as usize }, - 20usize, - concat!( - "Offset of field: ", - stringify!(CK_X9_42_DH2_DERIVE_PARAMS), - "::", - stringify!(pPublicData) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulPrivateDataLen) as usize - ptr as usize }, - 28usize, - concat!( - "Offset of field: ", - stringify!(CK_X9_42_DH2_DERIVE_PARAMS), - "::", - stringify!(ulPrivateDataLen) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).hPrivateData) as usize - ptr as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(CK_X9_42_DH2_DERIVE_PARAMS), - "::", - stringify!(hPrivateData) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulPublicDataLen2) as usize - ptr as usize }, - 36usize, - concat!( - "Offset of field: ", - stringify!(CK_X9_42_DH2_DERIVE_PARAMS), - "::", - stringify!(ulPublicDataLen2) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pPublicData2) as usize - ptr as usize }, - 40usize, - concat!( - "Offset of field: ", - stringify!(CK_X9_42_DH2_DERIVE_PARAMS), - "::", - stringify!(pPublicData2) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of CK_X9_42_DH2_DERIVE_PARAMS"] + [::std::mem::size_of::() - 48usize]; + ["Alignment of CK_X9_42_DH2_DERIVE_PARAMS"] + [::std::mem::align_of::() - 1usize]; + ["Offset of field: CK_X9_42_DH2_DERIVE_PARAMS::kdf"] + [::std::mem::offset_of!(CK_X9_42_DH2_DERIVE_PARAMS, kdf) - 0usize]; + ["Offset of field: CK_X9_42_DH2_DERIVE_PARAMS::ulOtherInfoLen"] + [::std::mem::offset_of!(CK_X9_42_DH2_DERIVE_PARAMS, ulOtherInfoLen) - 4usize]; + ["Offset of field: CK_X9_42_DH2_DERIVE_PARAMS::pOtherInfo"] + [::std::mem::offset_of!(CK_X9_42_DH2_DERIVE_PARAMS, pOtherInfo) - 8usize]; + ["Offset of field: CK_X9_42_DH2_DERIVE_PARAMS::ulPublicDataLen"] + [::std::mem::offset_of!(CK_X9_42_DH2_DERIVE_PARAMS, ulPublicDataLen) - 16usize]; + ["Offset of field: CK_X9_42_DH2_DERIVE_PARAMS::pPublicData"] + [::std::mem::offset_of!(CK_X9_42_DH2_DERIVE_PARAMS, pPublicData) - 20usize]; + ["Offset of field: CK_X9_42_DH2_DERIVE_PARAMS::ulPrivateDataLen"] + [::std::mem::offset_of!(CK_X9_42_DH2_DERIVE_PARAMS, ulPrivateDataLen) - 28usize]; + ["Offset of field: CK_X9_42_DH2_DERIVE_PARAMS::hPrivateData"] + [::std::mem::offset_of!(CK_X9_42_DH2_DERIVE_PARAMS, hPrivateData) - 32usize]; + ["Offset of field: CK_X9_42_DH2_DERIVE_PARAMS::ulPublicDataLen2"] + [::std::mem::offset_of!(CK_X9_42_DH2_DERIVE_PARAMS, ulPublicDataLen2) - 36usize]; + ["Offset of field: CK_X9_42_DH2_DERIVE_PARAMS::pPublicData2"] + [::std::mem::offset_of!(CK_X9_42_DH2_DERIVE_PARAMS, pPublicData2) - 40usize]; +}; impl Default for CK_X9_42_DH2_DERIVE_PARAMS { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); @@ -2597,122 +1602,33 @@ pub struct CK_X9_42_MQV_DERIVE_PARAMS { pub pPublicData2: CK_BYTE_PTR, pub publicKey: CK_OBJECT_HANDLE, } -#[test] -fn bindgen_test_layout_CK_X9_42_MQV_DERIVE_PARAMS() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 52usize, - concat!("Size of: ", stringify!(CK_X9_42_MQV_DERIVE_PARAMS)) - ); - assert_eq!( - ::std::mem::align_of::(), - 1usize, - concat!("Alignment of ", stringify!(CK_X9_42_MQV_DERIVE_PARAMS)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).kdf) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(CK_X9_42_MQV_DERIVE_PARAMS), - "::", - stringify!(kdf) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulOtherInfoLen) as usize - ptr as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(CK_X9_42_MQV_DERIVE_PARAMS), - "::", - stringify!(ulOtherInfoLen) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pOtherInfo) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(CK_X9_42_MQV_DERIVE_PARAMS), - "::", - stringify!(pOtherInfo) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulPublicDataLen) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(CK_X9_42_MQV_DERIVE_PARAMS), - "::", - stringify!(ulPublicDataLen) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pPublicData) as usize - ptr as usize }, - 20usize, - concat!( - "Offset of field: ", - stringify!(CK_X9_42_MQV_DERIVE_PARAMS), - "::", - stringify!(pPublicData) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulPrivateDataLen) as usize - ptr as usize }, - 28usize, - concat!( - "Offset of field: ", - stringify!(CK_X9_42_MQV_DERIVE_PARAMS), - "::", - stringify!(ulPrivateDataLen) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).hPrivateData) as usize - ptr as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(CK_X9_42_MQV_DERIVE_PARAMS), - "::", - stringify!(hPrivateData) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulPublicDataLen2) as usize - ptr as usize }, - 36usize, - concat!( - "Offset of field: ", - stringify!(CK_X9_42_MQV_DERIVE_PARAMS), - "::", - stringify!(ulPublicDataLen2) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pPublicData2) as usize - ptr as usize }, - 40usize, - concat!( - "Offset of field: ", - stringify!(CK_X9_42_MQV_DERIVE_PARAMS), - "::", - stringify!(pPublicData2) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).publicKey) as usize - ptr as usize }, - 48usize, - concat!( - "Offset of field: ", - stringify!(CK_X9_42_MQV_DERIVE_PARAMS), - "::", - stringify!(publicKey) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of CK_X9_42_MQV_DERIVE_PARAMS"] + [::std::mem::size_of::() - 52usize]; + ["Alignment of CK_X9_42_MQV_DERIVE_PARAMS"] + [::std::mem::align_of::() - 1usize]; + ["Offset of field: CK_X9_42_MQV_DERIVE_PARAMS::kdf"] + [::std::mem::offset_of!(CK_X9_42_MQV_DERIVE_PARAMS, kdf) - 0usize]; + ["Offset of field: CK_X9_42_MQV_DERIVE_PARAMS::ulOtherInfoLen"] + [::std::mem::offset_of!(CK_X9_42_MQV_DERIVE_PARAMS, ulOtherInfoLen) - 4usize]; + ["Offset of field: CK_X9_42_MQV_DERIVE_PARAMS::pOtherInfo"] + [::std::mem::offset_of!(CK_X9_42_MQV_DERIVE_PARAMS, pOtherInfo) - 8usize]; + ["Offset of field: CK_X9_42_MQV_DERIVE_PARAMS::ulPublicDataLen"] + [::std::mem::offset_of!(CK_X9_42_MQV_DERIVE_PARAMS, ulPublicDataLen) - 16usize]; + ["Offset of field: CK_X9_42_MQV_DERIVE_PARAMS::pPublicData"] + [::std::mem::offset_of!(CK_X9_42_MQV_DERIVE_PARAMS, pPublicData) - 20usize]; + ["Offset of field: CK_X9_42_MQV_DERIVE_PARAMS::ulPrivateDataLen"] + [::std::mem::offset_of!(CK_X9_42_MQV_DERIVE_PARAMS, ulPrivateDataLen) - 28usize]; + ["Offset of field: CK_X9_42_MQV_DERIVE_PARAMS::hPrivateData"] + [::std::mem::offset_of!(CK_X9_42_MQV_DERIVE_PARAMS, hPrivateData) - 32usize]; + ["Offset of field: CK_X9_42_MQV_DERIVE_PARAMS::ulPublicDataLen2"] + [::std::mem::offset_of!(CK_X9_42_MQV_DERIVE_PARAMS, ulPublicDataLen2) - 36usize]; + ["Offset of field: CK_X9_42_MQV_DERIVE_PARAMS::pPublicData2"] + [::std::mem::offset_of!(CK_X9_42_MQV_DERIVE_PARAMS, pPublicData2) - 40usize]; + ["Offset of field: CK_X9_42_MQV_DERIVE_PARAMS::publicKey"] + [::std::mem::offset_of!(CK_X9_42_MQV_DERIVE_PARAMS, publicKey) - 48usize]; +}; impl Default for CK_X9_42_MQV_DERIVE_PARAMS { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); @@ -2733,81 +1649,23 @@ pub struct CK_KEA_DERIVE_PARAMS { pub ulPublicDataLen: CK_ULONG, pub pPublicData: CK_BYTE_PTR, } -#[test] -fn bindgen_test_layout_CK_KEA_DERIVE_PARAMS() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 33usize, - concat!("Size of: ", stringify!(CK_KEA_DERIVE_PARAMS)) - ); - assert_eq!( - ::std::mem::align_of::(), - 1usize, - concat!("Alignment of ", stringify!(CK_KEA_DERIVE_PARAMS)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).isSender) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(CK_KEA_DERIVE_PARAMS), - "::", - stringify!(isSender) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulRandomLen) as usize - ptr as usize }, - 1usize, - concat!( - "Offset of field: ", - stringify!(CK_KEA_DERIVE_PARAMS), - "::", - stringify!(ulRandomLen) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pRandomA) as usize - ptr as usize }, - 5usize, - concat!( - "Offset of field: ", - stringify!(CK_KEA_DERIVE_PARAMS), - "::", - stringify!(pRandomA) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pRandomB) as usize - ptr as usize }, - 13usize, - concat!( - "Offset of field: ", - stringify!(CK_KEA_DERIVE_PARAMS), - "::", - stringify!(pRandomB) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulPublicDataLen) as usize - ptr as usize }, - 21usize, - concat!( - "Offset of field: ", - stringify!(CK_KEA_DERIVE_PARAMS), - "::", - stringify!(ulPublicDataLen) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pPublicData) as usize - ptr as usize }, - 25usize, - concat!( - "Offset of field: ", - stringify!(CK_KEA_DERIVE_PARAMS), - "::", - stringify!(pPublicData) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of CK_KEA_DERIVE_PARAMS"][::std::mem::size_of::() - 33usize]; + ["Alignment of CK_KEA_DERIVE_PARAMS"][::std::mem::align_of::() - 1usize]; + ["Offset of field: CK_KEA_DERIVE_PARAMS::isSender"] + [::std::mem::offset_of!(CK_KEA_DERIVE_PARAMS, isSender) - 0usize]; + ["Offset of field: CK_KEA_DERIVE_PARAMS::ulRandomLen"] + [::std::mem::offset_of!(CK_KEA_DERIVE_PARAMS, ulRandomLen) - 1usize]; + ["Offset of field: CK_KEA_DERIVE_PARAMS::pRandomA"] + [::std::mem::offset_of!(CK_KEA_DERIVE_PARAMS, pRandomA) - 5usize]; + ["Offset of field: CK_KEA_DERIVE_PARAMS::pRandomB"] + [::std::mem::offset_of!(CK_KEA_DERIVE_PARAMS, pRandomB) - 13usize]; + ["Offset of field: CK_KEA_DERIVE_PARAMS::ulPublicDataLen"] + [::std::mem::offset_of!(CK_KEA_DERIVE_PARAMS, ulPublicDataLen) - 21usize]; + ["Offset of field: CK_KEA_DERIVE_PARAMS::pPublicData"] + [::std::mem::offset_of!(CK_KEA_DERIVE_PARAMS, pPublicData) - 25usize]; +}; impl Default for CK_KEA_DERIVE_PARAMS { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); @@ -2826,41 +1684,15 @@ pub struct CK_RC2_CBC_PARAMS { pub ulEffectiveBits: CK_ULONG, pub iv: [CK_BYTE; 8usize], } -#[test] -fn bindgen_test_layout_CK_RC2_CBC_PARAMS() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 12usize, - concat!("Size of: ", stringify!(CK_RC2_CBC_PARAMS)) - ); - assert_eq!( - ::std::mem::align_of::(), - 1usize, - concat!("Alignment of ", stringify!(CK_RC2_CBC_PARAMS)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulEffectiveBits) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(CK_RC2_CBC_PARAMS), - "::", - stringify!(ulEffectiveBits) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).iv) as usize - ptr as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(CK_RC2_CBC_PARAMS), - "::", - stringify!(iv) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of CK_RC2_CBC_PARAMS"][::std::mem::size_of::() - 12usize]; + ["Alignment of CK_RC2_CBC_PARAMS"][::std::mem::align_of::() - 1usize]; + ["Offset of field: CK_RC2_CBC_PARAMS::ulEffectiveBits"] + [::std::mem::offset_of!(CK_RC2_CBC_PARAMS, ulEffectiveBits) - 0usize]; + ["Offset of field: CK_RC2_CBC_PARAMS::iv"] + [::std::mem::offset_of!(CK_RC2_CBC_PARAMS, iv) - 4usize]; +}; pub type CK_RC2_CBC_PARAMS_PTR = *mut CK_RC2_CBC_PARAMS; #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone)] @@ -2868,42 +1700,17 @@ pub struct CK_RC2_MAC_GENERAL_PARAMS { pub ulEffectiveBits: CK_ULONG, pub ulMacLength: CK_ULONG, } -#[test] -fn bindgen_test_layout_CK_RC2_MAC_GENERAL_PARAMS() { - 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!(CK_RC2_MAC_GENERAL_PARAMS)) - ); - assert_eq!( - ::std::mem::align_of::(), - 1usize, - concat!("Alignment of ", stringify!(CK_RC2_MAC_GENERAL_PARAMS)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulEffectiveBits) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(CK_RC2_MAC_GENERAL_PARAMS), - "::", - stringify!(ulEffectiveBits) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulMacLength) as usize - ptr as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(CK_RC2_MAC_GENERAL_PARAMS), - "::", - stringify!(ulMacLength) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of CK_RC2_MAC_GENERAL_PARAMS"] + [::std::mem::size_of::() - 8usize]; + ["Alignment of CK_RC2_MAC_GENERAL_PARAMS"] + [::std::mem::align_of::() - 1usize]; + ["Offset of field: CK_RC2_MAC_GENERAL_PARAMS::ulEffectiveBits"] + [::std::mem::offset_of!(CK_RC2_MAC_GENERAL_PARAMS, ulEffectiveBits) - 0usize]; + ["Offset of field: CK_RC2_MAC_GENERAL_PARAMS::ulMacLength"] + [::std::mem::offset_of!(CK_RC2_MAC_GENERAL_PARAMS, ulMacLength) - 4usize]; +}; pub type CK_RC2_MAC_GENERAL_PARAMS_PTR = *mut CK_RC2_MAC_GENERAL_PARAMS; #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone)] @@ -2911,41 +1718,15 @@ pub struct CK_RC5_PARAMS { pub ulWordsize: CK_ULONG, pub ulRounds: CK_ULONG, } -#[test] -fn bindgen_test_layout_CK_RC5_PARAMS() { - 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!(CK_RC5_PARAMS)) - ); - assert_eq!( - ::std::mem::align_of::(), - 1usize, - concat!("Alignment of ", stringify!(CK_RC5_PARAMS)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulWordsize) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(CK_RC5_PARAMS), - "::", - stringify!(ulWordsize) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulRounds) as usize - ptr as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(CK_RC5_PARAMS), - "::", - stringify!(ulRounds) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of CK_RC5_PARAMS"][::std::mem::size_of::() - 8usize]; + ["Alignment of CK_RC5_PARAMS"][::std::mem::align_of::() - 1usize]; + ["Offset of field: CK_RC5_PARAMS::ulWordsize"] + [::std::mem::offset_of!(CK_RC5_PARAMS, ulWordsize) - 0usize]; + ["Offset of field: CK_RC5_PARAMS::ulRounds"] + [::std::mem::offset_of!(CK_RC5_PARAMS, ulRounds) - 4usize]; +}; pub type CK_RC5_PARAMS_PTR = *mut CK_RC5_PARAMS; #[repr(C, packed)] #[derive(Debug, Copy, Clone)] @@ -2955,61 +1736,19 @@ pub struct CK_RC5_CBC_PARAMS { pub pIv: CK_BYTE_PTR, pub ulIvLen: CK_ULONG, } -#[test] -fn bindgen_test_layout_CK_RC5_CBC_PARAMS() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 20usize, - concat!("Size of: ", stringify!(CK_RC5_CBC_PARAMS)) - ); - assert_eq!( - ::std::mem::align_of::(), - 1usize, - concat!("Alignment of ", stringify!(CK_RC5_CBC_PARAMS)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulWordsize) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(CK_RC5_CBC_PARAMS), - "::", - stringify!(ulWordsize) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulRounds) as usize - ptr as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(CK_RC5_CBC_PARAMS), - "::", - stringify!(ulRounds) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pIv) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(CK_RC5_CBC_PARAMS), - "::", - stringify!(pIv) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulIvLen) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(CK_RC5_CBC_PARAMS), - "::", - stringify!(ulIvLen) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of CK_RC5_CBC_PARAMS"][::std::mem::size_of::() - 20usize]; + ["Alignment of CK_RC5_CBC_PARAMS"][::std::mem::align_of::() - 1usize]; + ["Offset of field: CK_RC5_CBC_PARAMS::ulWordsize"] + [::std::mem::offset_of!(CK_RC5_CBC_PARAMS, ulWordsize) - 0usize]; + ["Offset of field: CK_RC5_CBC_PARAMS::ulRounds"] + [::std::mem::offset_of!(CK_RC5_CBC_PARAMS, ulRounds) - 4usize]; + ["Offset of field: CK_RC5_CBC_PARAMS::pIv"] + [::std::mem::offset_of!(CK_RC5_CBC_PARAMS, pIv) - 8usize]; + ["Offset of field: CK_RC5_CBC_PARAMS::ulIvLen"] + [::std::mem::offset_of!(CK_RC5_CBC_PARAMS, ulIvLen) - 16usize]; +}; impl Default for CK_RC5_CBC_PARAMS { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); @@ -3027,52 +1766,19 @@ pub struct CK_RC5_MAC_GENERAL_PARAMS { pub ulRounds: CK_ULONG, pub ulMacLength: CK_ULONG, } -#[test] -fn bindgen_test_layout_CK_RC5_MAC_GENERAL_PARAMS() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 12usize, - concat!("Size of: ", stringify!(CK_RC5_MAC_GENERAL_PARAMS)) - ); - assert_eq!( - ::std::mem::align_of::(), - 1usize, - concat!("Alignment of ", stringify!(CK_RC5_MAC_GENERAL_PARAMS)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulWordsize) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(CK_RC5_MAC_GENERAL_PARAMS), - "::", - stringify!(ulWordsize) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulRounds) as usize - ptr as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(CK_RC5_MAC_GENERAL_PARAMS), - "::", - stringify!(ulRounds) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulMacLength) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(CK_RC5_MAC_GENERAL_PARAMS), - "::", - stringify!(ulMacLength) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of CK_RC5_MAC_GENERAL_PARAMS"] + [::std::mem::size_of::() - 12usize]; + ["Alignment of CK_RC5_MAC_GENERAL_PARAMS"] + [::std::mem::align_of::() - 1usize]; + ["Offset of field: CK_RC5_MAC_GENERAL_PARAMS::ulWordsize"] + [::std::mem::offset_of!(CK_RC5_MAC_GENERAL_PARAMS, ulWordsize) - 0usize]; + ["Offset of field: CK_RC5_MAC_GENERAL_PARAMS::ulRounds"] + [::std::mem::offset_of!(CK_RC5_MAC_GENERAL_PARAMS, ulRounds) - 4usize]; + ["Offset of field: CK_RC5_MAC_GENERAL_PARAMS::ulMacLength"] + [::std::mem::offset_of!(CK_RC5_MAC_GENERAL_PARAMS, ulMacLength) - 8usize]; +}; pub type CK_RC5_MAC_GENERAL_PARAMS_PTR = *mut CK_RC5_MAC_GENERAL_PARAMS; pub type CK_MAC_GENERAL_PARAMS = CK_ULONG; pub type CK_MAC_GENERAL_PARAMS_PTR = *mut CK_MAC_GENERAL_PARAMS; @@ -3083,52 +1789,19 @@ pub struct CK_DES_CBC_ENCRYPT_DATA_PARAMS { pub pData: CK_BYTE_PTR, pub length: CK_ULONG, } -#[test] -fn bindgen_test_layout_CK_DES_CBC_ENCRYPT_DATA_PARAMS() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 20usize, - concat!("Size of: ", stringify!(CK_DES_CBC_ENCRYPT_DATA_PARAMS)) - ); - assert_eq!( - ::std::mem::align_of::(), - 1usize, - concat!("Alignment of ", stringify!(CK_DES_CBC_ENCRYPT_DATA_PARAMS)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).iv) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(CK_DES_CBC_ENCRYPT_DATA_PARAMS), - "::", - stringify!(iv) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pData) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(CK_DES_CBC_ENCRYPT_DATA_PARAMS), - "::", - stringify!(pData) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).length) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(CK_DES_CBC_ENCRYPT_DATA_PARAMS), - "::", - stringify!(length) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of CK_DES_CBC_ENCRYPT_DATA_PARAMS"] + [::std::mem::size_of::() - 20usize]; + ["Alignment of CK_DES_CBC_ENCRYPT_DATA_PARAMS"] + [::std::mem::align_of::() - 1usize]; + ["Offset of field: CK_DES_CBC_ENCRYPT_DATA_PARAMS::iv"] + [::std::mem::offset_of!(CK_DES_CBC_ENCRYPT_DATA_PARAMS, iv) - 0usize]; + ["Offset of field: CK_DES_CBC_ENCRYPT_DATA_PARAMS::pData"] + [::std::mem::offset_of!(CK_DES_CBC_ENCRYPT_DATA_PARAMS, pData) - 8usize]; + ["Offset of field: CK_DES_CBC_ENCRYPT_DATA_PARAMS::length"] + [::std::mem::offset_of!(CK_DES_CBC_ENCRYPT_DATA_PARAMS, length) - 16usize]; +}; impl Default for CK_DES_CBC_ENCRYPT_DATA_PARAMS { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); @@ -3146,52 +1819,19 @@ pub struct CK_AES_CBC_ENCRYPT_DATA_PARAMS { pub pData: CK_BYTE_PTR, pub length: CK_ULONG, } -#[test] -fn bindgen_test_layout_CK_AES_CBC_ENCRYPT_DATA_PARAMS() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 28usize, - concat!("Size of: ", stringify!(CK_AES_CBC_ENCRYPT_DATA_PARAMS)) - ); - assert_eq!( - ::std::mem::align_of::(), - 1usize, - concat!("Alignment of ", stringify!(CK_AES_CBC_ENCRYPT_DATA_PARAMS)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).iv) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(CK_AES_CBC_ENCRYPT_DATA_PARAMS), - "::", - stringify!(iv) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pData) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(CK_AES_CBC_ENCRYPT_DATA_PARAMS), - "::", - stringify!(pData) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).length) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(CK_AES_CBC_ENCRYPT_DATA_PARAMS), - "::", - stringify!(length) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of CK_AES_CBC_ENCRYPT_DATA_PARAMS"] + [::std::mem::size_of::() - 28usize]; + ["Alignment of CK_AES_CBC_ENCRYPT_DATA_PARAMS"] + [::std::mem::align_of::() - 1usize]; + ["Offset of field: CK_AES_CBC_ENCRYPT_DATA_PARAMS::iv"] + [::std::mem::offset_of!(CK_AES_CBC_ENCRYPT_DATA_PARAMS, iv) - 0usize]; + ["Offset of field: CK_AES_CBC_ENCRYPT_DATA_PARAMS::pData"] + [::std::mem::offset_of!(CK_AES_CBC_ENCRYPT_DATA_PARAMS, pData) - 16usize]; + ["Offset of field: CK_AES_CBC_ENCRYPT_DATA_PARAMS::length"] + [::std::mem::offset_of!(CK_AES_CBC_ENCRYPT_DATA_PARAMS, length) - 24usize]; +}; impl Default for CK_AES_CBC_ENCRYPT_DATA_PARAMS { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); @@ -3217,132 +1857,35 @@ pub struct CK_SKIPJACK_PRIVATE_WRAP_PARAMS { pub pBaseG: CK_BYTE_PTR, pub pSubprimeQ: CK_BYTE_PTR, } -#[test] -fn bindgen_test_layout_CK_SKIPJACK_PRIVATE_WRAP_PARAMS() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 68usize, - concat!("Size of: ", stringify!(CK_SKIPJACK_PRIVATE_WRAP_PARAMS)) - ); - assert_eq!( - ::std::mem::align_of::(), - 1usize, - concat!("Alignment of ", stringify!(CK_SKIPJACK_PRIVATE_WRAP_PARAMS)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulPasswordLen) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(CK_SKIPJACK_PRIVATE_WRAP_PARAMS), - "::", - stringify!(ulPasswordLen) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pPassword) as usize - ptr as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(CK_SKIPJACK_PRIVATE_WRAP_PARAMS), - "::", - stringify!(pPassword) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulPublicDataLen) as usize - ptr as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(CK_SKIPJACK_PRIVATE_WRAP_PARAMS), - "::", - stringify!(ulPublicDataLen) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pPublicData) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(CK_SKIPJACK_PRIVATE_WRAP_PARAMS), - "::", - stringify!(pPublicData) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulPAndGLen) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(CK_SKIPJACK_PRIVATE_WRAP_PARAMS), - "::", - stringify!(ulPAndGLen) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulQLen) as usize - ptr as usize }, - 28usize, - concat!( - "Offset of field: ", - stringify!(CK_SKIPJACK_PRIVATE_WRAP_PARAMS), - "::", - stringify!(ulQLen) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulRandomLen) as usize - ptr as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(CK_SKIPJACK_PRIVATE_WRAP_PARAMS), - "::", - stringify!(ulRandomLen) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pRandomA) as usize - ptr as usize }, - 36usize, - concat!( - "Offset of field: ", - stringify!(CK_SKIPJACK_PRIVATE_WRAP_PARAMS), - "::", - stringify!(pRandomA) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pPrimeP) as usize - ptr as usize }, - 44usize, - concat!( - "Offset of field: ", - stringify!(CK_SKIPJACK_PRIVATE_WRAP_PARAMS), - "::", - stringify!(pPrimeP) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pBaseG) as usize - ptr as usize }, - 52usize, - concat!( - "Offset of field: ", - stringify!(CK_SKIPJACK_PRIVATE_WRAP_PARAMS), - "::", - stringify!(pBaseG) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pSubprimeQ) as usize - ptr as usize }, - 60usize, - concat!( - "Offset of field: ", - stringify!(CK_SKIPJACK_PRIVATE_WRAP_PARAMS), - "::", - stringify!(pSubprimeQ) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of CK_SKIPJACK_PRIVATE_WRAP_PARAMS"] + [::std::mem::size_of::() - 68usize]; + ["Alignment of CK_SKIPJACK_PRIVATE_WRAP_PARAMS"] + [::std::mem::align_of::() - 1usize]; + ["Offset of field: CK_SKIPJACK_PRIVATE_WRAP_PARAMS::ulPasswordLen"] + [::std::mem::offset_of!(CK_SKIPJACK_PRIVATE_WRAP_PARAMS, ulPasswordLen) - 0usize]; + ["Offset of field: CK_SKIPJACK_PRIVATE_WRAP_PARAMS::pPassword"] + [::std::mem::offset_of!(CK_SKIPJACK_PRIVATE_WRAP_PARAMS, pPassword) - 4usize]; + ["Offset of field: CK_SKIPJACK_PRIVATE_WRAP_PARAMS::ulPublicDataLen"] + [::std::mem::offset_of!(CK_SKIPJACK_PRIVATE_WRAP_PARAMS, ulPublicDataLen) - 12usize]; + ["Offset of field: CK_SKIPJACK_PRIVATE_WRAP_PARAMS::pPublicData"] + [::std::mem::offset_of!(CK_SKIPJACK_PRIVATE_WRAP_PARAMS, pPublicData) - 16usize]; + ["Offset of field: CK_SKIPJACK_PRIVATE_WRAP_PARAMS::ulPAndGLen"] + [::std::mem::offset_of!(CK_SKIPJACK_PRIVATE_WRAP_PARAMS, ulPAndGLen) - 24usize]; + ["Offset of field: CK_SKIPJACK_PRIVATE_WRAP_PARAMS::ulQLen"] + [::std::mem::offset_of!(CK_SKIPJACK_PRIVATE_WRAP_PARAMS, ulQLen) - 28usize]; + ["Offset of field: CK_SKIPJACK_PRIVATE_WRAP_PARAMS::ulRandomLen"] + [::std::mem::offset_of!(CK_SKIPJACK_PRIVATE_WRAP_PARAMS, ulRandomLen) - 32usize]; + ["Offset of field: CK_SKIPJACK_PRIVATE_WRAP_PARAMS::pRandomA"] + [::std::mem::offset_of!(CK_SKIPJACK_PRIVATE_WRAP_PARAMS, pRandomA) - 36usize]; + ["Offset of field: CK_SKIPJACK_PRIVATE_WRAP_PARAMS::pPrimeP"] + [::std::mem::offset_of!(CK_SKIPJACK_PRIVATE_WRAP_PARAMS, pPrimeP) - 44usize]; + ["Offset of field: CK_SKIPJACK_PRIVATE_WRAP_PARAMS::pBaseG"] + [::std::mem::offset_of!(CK_SKIPJACK_PRIVATE_WRAP_PARAMS, pBaseG) - 52usize]; + ["Offset of field: CK_SKIPJACK_PRIVATE_WRAP_PARAMS::pSubprimeQ"] + [::std::mem::offset_of!(CK_SKIPJACK_PRIVATE_WRAP_PARAMS, pSubprimeQ) - 60usize]; +}; impl Default for CK_SKIPJACK_PRIVATE_WRAP_PARAMS { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); @@ -3371,162 +1914,41 @@ pub struct CK_SKIPJACK_RELAYX_PARAMS { pub ulNewRandomLen: CK_ULONG, pub pNewRandomA: CK_BYTE_PTR, } -#[test] -fn bindgen_test_layout_CK_SKIPJACK_RELAYX_PARAMS() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 84usize, - concat!("Size of: ", stringify!(CK_SKIPJACK_RELAYX_PARAMS)) - ); - assert_eq!( - ::std::mem::align_of::(), - 1usize, - concat!("Alignment of ", stringify!(CK_SKIPJACK_RELAYX_PARAMS)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulOldWrappedXLen) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(CK_SKIPJACK_RELAYX_PARAMS), - "::", - stringify!(ulOldWrappedXLen) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pOldWrappedX) as usize - ptr as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(CK_SKIPJACK_RELAYX_PARAMS), - "::", - stringify!(pOldWrappedX) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulOldPasswordLen) as usize - ptr as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(CK_SKIPJACK_RELAYX_PARAMS), - "::", - stringify!(ulOldPasswordLen) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pOldPassword) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(CK_SKIPJACK_RELAYX_PARAMS), - "::", - stringify!(pOldPassword) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulOldPublicDataLen) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(CK_SKIPJACK_RELAYX_PARAMS), - "::", - stringify!(ulOldPublicDataLen) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pOldPublicData) as usize - ptr as usize }, - 28usize, - concat!( - "Offset of field: ", - stringify!(CK_SKIPJACK_RELAYX_PARAMS), - "::", - stringify!(pOldPublicData) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulOldRandomLen) as usize - ptr as usize }, - 36usize, - concat!( - "Offset of field: ", - stringify!(CK_SKIPJACK_RELAYX_PARAMS), - "::", - stringify!(ulOldRandomLen) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pOldRandomA) as usize - ptr as usize }, - 40usize, - concat!( - "Offset of field: ", - stringify!(CK_SKIPJACK_RELAYX_PARAMS), - "::", - stringify!(pOldRandomA) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulNewPasswordLen) as usize - ptr as usize }, - 48usize, - concat!( - "Offset of field: ", - stringify!(CK_SKIPJACK_RELAYX_PARAMS), - "::", - stringify!(ulNewPasswordLen) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pNewPassword) as usize - ptr as usize }, - 52usize, - concat!( - "Offset of field: ", - stringify!(CK_SKIPJACK_RELAYX_PARAMS), - "::", - stringify!(pNewPassword) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulNewPublicDataLen) as usize - ptr as usize }, - 60usize, - concat!( - "Offset of field: ", - stringify!(CK_SKIPJACK_RELAYX_PARAMS), - "::", - stringify!(ulNewPublicDataLen) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pNewPublicData) as usize - ptr as usize }, - 64usize, - concat!( - "Offset of field: ", - stringify!(CK_SKIPJACK_RELAYX_PARAMS), - "::", - stringify!(pNewPublicData) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulNewRandomLen) as usize - ptr as usize }, - 72usize, - concat!( - "Offset of field: ", - stringify!(CK_SKIPJACK_RELAYX_PARAMS), - "::", - stringify!(ulNewRandomLen) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pNewRandomA) as usize - ptr as usize }, - 76usize, - concat!( - "Offset of field: ", - stringify!(CK_SKIPJACK_RELAYX_PARAMS), - "::", - stringify!(pNewRandomA) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of CK_SKIPJACK_RELAYX_PARAMS"] + [::std::mem::size_of::() - 84usize]; + ["Alignment of CK_SKIPJACK_RELAYX_PARAMS"] + [::std::mem::align_of::() - 1usize]; + ["Offset of field: CK_SKIPJACK_RELAYX_PARAMS::ulOldWrappedXLen"] + [::std::mem::offset_of!(CK_SKIPJACK_RELAYX_PARAMS, ulOldWrappedXLen) - 0usize]; + ["Offset of field: CK_SKIPJACK_RELAYX_PARAMS::pOldWrappedX"] + [::std::mem::offset_of!(CK_SKIPJACK_RELAYX_PARAMS, pOldWrappedX) - 4usize]; + ["Offset of field: CK_SKIPJACK_RELAYX_PARAMS::ulOldPasswordLen"] + [::std::mem::offset_of!(CK_SKIPJACK_RELAYX_PARAMS, ulOldPasswordLen) - 12usize]; + ["Offset of field: CK_SKIPJACK_RELAYX_PARAMS::pOldPassword"] + [::std::mem::offset_of!(CK_SKIPJACK_RELAYX_PARAMS, pOldPassword) - 16usize]; + ["Offset of field: CK_SKIPJACK_RELAYX_PARAMS::ulOldPublicDataLen"] + [::std::mem::offset_of!(CK_SKIPJACK_RELAYX_PARAMS, ulOldPublicDataLen) - 24usize]; + ["Offset of field: CK_SKIPJACK_RELAYX_PARAMS::pOldPublicData"] + [::std::mem::offset_of!(CK_SKIPJACK_RELAYX_PARAMS, pOldPublicData) - 28usize]; + ["Offset of field: CK_SKIPJACK_RELAYX_PARAMS::ulOldRandomLen"] + [::std::mem::offset_of!(CK_SKIPJACK_RELAYX_PARAMS, ulOldRandomLen) - 36usize]; + ["Offset of field: CK_SKIPJACK_RELAYX_PARAMS::pOldRandomA"] + [::std::mem::offset_of!(CK_SKIPJACK_RELAYX_PARAMS, pOldRandomA) - 40usize]; + ["Offset of field: CK_SKIPJACK_RELAYX_PARAMS::ulNewPasswordLen"] + [::std::mem::offset_of!(CK_SKIPJACK_RELAYX_PARAMS, ulNewPasswordLen) - 48usize]; + ["Offset of field: CK_SKIPJACK_RELAYX_PARAMS::pNewPassword"] + [::std::mem::offset_of!(CK_SKIPJACK_RELAYX_PARAMS, pNewPassword) - 52usize]; + ["Offset of field: CK_SKIPJACK_RELAYX_PARAMS::ulNewPublicDataLen"] + [::std::mem::offset_of!(CK_SKIPJACK_RELAYX_PARAMS, ulNewPublicDataLen) - 60usize]; + ["Offset of field: CK_SKIPJACK_RELAYX_PARAMS::pNewPublicData"] + [::std::mem::offset_of!(CK_SKIPJACK_RELAYX_PARAMS, pNewPublicData) - 64usize]; + ["Offset of field: CK_SKIPJACK_RELAYX_PARAMS::ulNewRandomLen"] + [::std::mem::offset_of!(CK_SKIPJACK_RELAYX_PARAMS, ulNewRandomLen) - 72usize]; + ["Offset of field: CK_SKIPJACK_RELAYX_PARAMS::pNewRandomA"] + [::std::mem::offset_of!(CK_SKIPJACK_RELAYX_PARAMS, pNewRandomA) - 76usize]; +}; impl Default for CK_SKIPJACK_RELAYX_PARAMS { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); @@ -3547,81 +1969,23 @@ pub struct CK_PBE_PARAMS { pub ulSaltLen: CK_ULONG, pub ulIteration: CK_ULONG, } -#[test] -fn bindgen_test_layout_CK_PBE_PARAMS() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 36usize, - concat!("Size of: ", stringify!(CK_PBE_PARAMS)) - ); - assert_eq!( - ::std::mem::align_of::(), - 1usize, - concat!("Alignment of ", stringify!(CK_PBE_PARAMS)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pInitVector) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(CK_PBE_PARAMS), - "::", - stringify!(pInitVector) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pPassword) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(CK_PBE_PARAMS), - "::", - stringify!(pPassword) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulPasswordLen) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(CK_PBE_PARAMS), - "::", - stringify!(ulPasswordLen) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pSalt) as usize - ptr as usize }, - 20usize, - concat!( - "Offset of field: ", - stringify!(CK_PBE_PARAMS), - "::", - stringify!(pSalt) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulSaltLen) as usize - ptr as usize }, - 28usize, - concat!( - "Offset of field: ", - stringify!(CK_PBE_PARAMS), - "::", - stringify!(ulSaltLen) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulIteration) as usize - ptr as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(CK_PBE_PARAMS), - "::", - stringify!(ulIteration) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of CK_PBE_PARAMS"][::std::mem::size_of::() - 36usize]; + ["Alignment of CK_PBE_PARAMS"][::std::mem::align_of::() - 1usize]; + ["Offset of field: CK_PBE_PARAMS::pInitVector"] + [::std::mem::offset_of!(CK_PBE_PARAMS, pInitVector) - 0usize]; + ["Offset of field: CK_PBE_PARAMS::pPassword"] + [::std::mem::offset_of!(CK_PBE_PARAMS, pPassword) - 8usize]; + ["Offset of field: CK_PBE_PARAMS::ulPasswordLen"] + [::std::mem::offset_of!(CK_PBE_PARAMS, ulPasswordLen) - 16usize]; + ["Offset of field: CK_PBE_PARAMS::pSalt"] + [::std::mem::offset_of!(CK_PBE_PARAMS, pSalt) - 20usize]; + ["Offset of field: CK_PBE_PARAMS::ulSaltLen"] + [::std::mem::offset_of!(CK_PBE_PARAMS, ulSaltLen) - 28usize]; + ["Offset of field: CK_PBE_PARAMS::ulIteration"] + [::std::mem::offset_of!(CK_PBE_PARAMS, ulIteration) - 32usize]; +}; impl Default for CK_PBE_PARAMS { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); @@ -3639,52 +2003,19 @@ pub struct CK_KEY_WRAP_SET_OAEP_PARAMS { pub pX: CK_BYTE_PTR, pub ulXLen: CK_ULONG, } -#[test] -fn bindgen_test_layout_CK_KEY_WRAP_SET_OAEP_PARAMS() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 13usize, - concat!("Size of: ", stringify!(CK_KEY_WRAP_SET_OAEP_PARAMS)) - ); - assert_eq!( - ::std::mem::align_of::(), - 1usize, - concat!("Alignment of ", stringify!(CK_KEY_WRAP_SET_OAEP_PARAMS)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).bBC) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(CK_KEY_WRAP_SET_OAEP_PARAMS), - "::", - stringify!(bBC) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pX) as usize - ptr as usize }, - 1usize, - concat!( - "Offset of field: ", - stringify!(CK_KEY_WRAP_SET_OAEP_PARAMS), - "::", - stringify!(pX) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulXLen) as usize - ptr as usize }, - 9usize, - concat!( - "Offset of field: ", - stringify!(CK_KEY_WRAP_SET_OAEP_PARAMS), - "::", - stringify!(ulXLen) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of CK_KEY_WRAP_SET_OAEP_PARAMS"] + [::std::mem::size_of::() - 13usize]; + ["Alignment of CK_KEY_WRAP_SET_OAEP_PARAMS"] + [::std::mem::align_of::() - 1usize]; + ["Offset of field: CK_KEY_WRAP_SET_OAEP_PARAMS::bBC"] + [::std::mem::offset_of!(CK_KEY_WRAP_SET_OAEP_PARAMS, bBC) - 0usize]; + ["Offset of field: CK_KEY_WRAP_SET_OAEP_PARAMS::pX"] + [::std::mem::offset_of!(CK_KEY_WRAP_SET_OAEP_PARAMS, pX) - 1usize]; + ["Offset of field: CK_KEY_WRAP_SET_OAEP_PARAMS::ulXLen"] + [::std::mem::offset_of!(CK_KEY_WRAP_SET_OAEP_PARAMS, ulXLen) - 9usize]; +}; impl Default for CK_KEY_WRAP_SET_OAEP_PARAMS { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); @@ -3703,61 +2034,19 @@ pub struct CK_SSL3_RANDOM_DATA { pub pServerRandom: CK_BYTE_PTR, pub ulServerRandomLen: CK_ULONG, } -#[test] -fn bindgen_test_layout_CK_SSL3_RANDOM_DATA() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 24usize, - concat!("Size of: ", stringify!(CK_SSL3_RANDOM_DATA)) - ); - assert_eq!( - ::std::mem::align_of::(), - 1usize, - concat!("Alignment of ", stringify!(CK_SSL3_RANDOM_DATA)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pClientRandom) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(CK_SSL3_RANDOM_DATA), - "::", - stringify!(pClientRandom) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulClientRandomLen) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(CK_SSL3_RANDOM_DATA), - "::", - stringify!(ulClientRandomLen) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pServerRandom) as usize - ptr as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(CK_SSL3_RANDOM_DATA), - "::", - stringify!(pServerRandom) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulServerRandomLen) as usize - ptr as usize }, - 20usize, - concat!( - "Offset of field: ", - stringify!(CK_SSL3_RANDOM_DATA), - "::", - stringify!(ulServerRandomLen) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of CK_SSL3_RANDOM_DATA"][::std::mem::size_of::() - 24usize]; + ["Alignment of CK_SSL3_RANDOM_DATA"][::std::mem::align_of::() - 1usize]; + ["Offset of field: CK_SSL3_RANDOM_DATA::pClientRandom"] + [::std::mem::offset_of!(CK_SSL3_RANDOM_DATA, pClientRandom) - 0usize]; + ["Offset of field: CK_SSL3_RANDOM_DATA::ulClientRandomLen"] + [::std::mem::offset_of!(CK_SSL3_RANDOM_DATA, ulClientRandomLen) - 8usize]; + ["Offset of field: CK_SSL3_RANDOM_DATA::pServerRandom"] + [::std::mem::offset_of!(CK_SSL3_RANDOM_DATA, pServerRandom) - 12usize]; + ["Offset of field: CK_SSL3_RANDOM_DATA::ulServerRandomLen"] + [::std::mem::offset_of!(CK_SSL3_RANDOM_DATA, ulServerRandomLen) - 20usize]; +}; impl Default for CK_SSL3_RANDOM_DATA { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); @@ -3773,45 +2062,17 @@ pub struct CK_SSL3_MASTER_KEY_DERIVE_PARAMS { pub RandomInfo: CK_SSL3_RANDOM_DATA, pub pVersion: CK_VERSION_PTR, } -#[test] -fn bindgen_test_layout_CK_SSL3_MASTER_KEY_DERIVE_PARAMS() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 32usize, - concat!("Size of: ", stringify!(CK_SSL3_MASTER_KEY_DERIVE_PARAMS)) - ); - assert_eq!( - ::std::mem::align_of::(), - 1usize, - concat!( - "Alignment of ", - stringify!(CK_SSL3_MASTER_KEY_DERIVE_PARAMS) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).RandomInfo) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(CK_SSL3_MASTER_KEY_DERIVE_PARAMS), - "::", - stringify!(RandomInfo) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pVersion) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(CK_SSL3_MASTER_KEY_DERIVE_PARAMS), - "::", - stringify!(pVersion) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of CK_SSL3_MASTER_KEY_DERIVE_PARAMS"] + [::std::mem::size_of::() - 32usize]; + ["Alignment of CK_SSL3_MASTER_KEY_DERIVE_PARAMS"] + [::std::mem::align_of::() - 1usize]; + ["Offset of field: CK_SSL3_MASTER_KEY_DERIVE_PARAMS::RandomInfo"] + [::std::mem::offset_of!(CK_SSL3_MASTER_KEY_DERIVE_PARAMS, RandomInfo) - 0usize]; + ["Offset of field: CK_SSL3_MASTER_KEY_DERIVE_PARAMS::pVersion"] + [::std::mem::offset_of!(CK_SSL3_MASTER_KEY_DERIVE_PARAMS, pVersion) - 24usize]; +}; impl Default for CK_SSL3_MASTER_KEY_DERIVE_PARAMS { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); @@ -3832,81 +2093,23 @@ pub struct CK_SSL3_KEY_MAT_OUT { pub pIVClient: CK_BYTE_PTR, pub pIVServer: CK_BYTE_PTR, } -#[test] -fn bindgen_test_layout_CK_SSL3_KEY_MAT_OUT() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 32usize, - concat!("Size of: ", stringify!(CK_SSL3_KEY_MAT_OUT)) - ); - assert_eq!( - ::std::mem::align_of::(), - 1usize, - concat!("Alignment of ", stringify!(CK_SSL3_KEY_MAT_OUT)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).hClientMacSecret) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(CK_SSL3_KEY_MAT_OUT), - "::", - stringify!(hClientMacSecret) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).hServerMacSecret) as usize - ptr as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(CK_SSL3_KEY_MAT_OUT), - "::", - stringify!(hServerMacSecret) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).hClientKey) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(CK_SSL3_KEY_MAT_OUT), - "::", - stringify!(hClientKey) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).hServerKey) as usize - ptr as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(CK_SSL3_KEY_MAT_OUT), - "::", - stringify!(hServerKey) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pIVClient) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(CK_SSL3_KEY_MAT_OUT), - "::", - stringify!(pIVClient) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pIVServer) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(CK_SSL3_KEY_MAT_OUT), - "::", - stringify!(pIVServer) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of CK_SSL3_KEY_MAT_OUT"][::std::mem::size_of::() - 32usize]; + ["Alignment of CK_SSL3_KEY_MAT_OUT"][::std::mem::align_of::() - 1usize]; + ["Offset of field: CK_SSL3_KEY_MAT_OUT::hClientMacSecret"] + [::std::mem::offset_of!(CK_SSL3_KEY_MAT_OUT, hClientMacSecret) - 0usize]; + ["Offset of field: CK_SSL3_KEY_MAT_OUT::hServerMacSecret"] + [::std::mem::offset_of!(CK_SSL3_KEY_MAT_OUT, hServerMacSecret) - 4usize]; + ["Offset of field: CK_SSL3_KEY_MAT_OUT::hClientKey"] + [::std::mem::offset_of!(CK_SSL3_KEY_MAT_OUT, hClientKey) - 8usize]; + ["Offset of field: CK_SSL3_KEY_MAT_OUT::hServerKey"] + [::std::mem::offset_of!(CK_SSL3_KEY_MAT_OUT, hServerKey) - 12usize]; + ["Offset of field: CK_SSL3_KEY_MAT_OUT::pIVClient"] + [::std::mem::offset_of!(CK_SSL3_KEY_MAT_OUT, pIVClient) - 16usize]; + ["Offset of field: CK_SSL3_KEY_MAT_OUT::pIVServer"] + [::std::mem::offset_of!(CK_SSL3_KEY_MAT_OUT, pIVServer) - 24usize]; +}; impl Default for CK_SSL3_KEY_MAT_OUT { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); @@ -3927,82 +2130,24 @@ pub struct CK_SSL3_KEY_MAT_PARAMS { pub RandomInfo: CK_SSL3_RANDOM_DATA, pub pReturnedKeyMaterial: CK_SSL3_KEY_MAT_OUT_PTR, } -#[test] -fn bindgen_test_layout_CK_SSL3_KEY_MAT_PARAMS() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 45usize, - concat!("Size of: ", stringify!(CK_SSL3_KEY_MAT_PARAMS)) - ); - assert_eq!( - ::std::mem::align_of::(), - 1usize, - concat!("Alignment of ", stringify!(CK_SSL3_KEY_MAT_PARAMS)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulMacSizeInBits) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(CK_SSL3_KEY_MAT_PARAMS), - "::", - stringify!(ulMacSizeInBits) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulKeySizeInBits) as usize - ptr as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(CK_SSL3_KEY_MAT_PARAMS), - "::", - stringify!(ulKeySizeInBits) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulIVSizeInBits) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(CK_SSL3_KEY_MAT_PARAMS), - "::", - stringify!(ulIVSizeInBits) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).bIsExport) as usize - ptr as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(CK_SSL3_KEY_MAT_PARAMS), - "::", - stringify!(bIsExport) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).RandomInfo) as usize - ptr as usize }, - 13usize, - concat!( - "Offset of field: ", - stringify!(CK_SSL3_KEY_MAT_PARAMS), - "::", - stringify!(RandomInfo) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pReturnedKeyMaterial) as usize - ptr as usize }, - 37usize, - concat!( - "Offset of field: ", - stringify!(CK_SSL3_KEY_MAT_PARAMS), - "::", - stringify!(pReturnedKeyMaterial) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of CK_SSL3_KEY_MAT_PARAMS"][::std::mem::size_of::() - 45usize]; + ["Alignment of CK_SSL3_KEY_MAT_PARAMS"] + [::std::mem::align_of::() - 1usize]; + ["Offset of field: CK_SSL3_KEY_MAT_PARAMS::ulMacSizeInBits"] + [::std::mem::offset_of!(CK_SSL3_KEY_MAT_PARAMS, ulMacSizeInBits) - 0usize]; + ["Offset of field: CK_SSL3_KEY_MAT_PARAMS::ulKeySizeInBits"] + [::std::mem::offset_of!(CK_SSL3_KEY_MAT_PARAMS, ulKeySizeInBits) - 4usize]; + ["Offset of field: CK_SSL3_KEY_MAT_PARAMS::ulIVSizeInBits"] + [::std::mem::offset_of!(CK_SSL3_KEY_MAT_PARAMS, ulIVSizeInBits) - 8usize]; + ["Offset of field: CK_SSL3_KEY_MAT_PARAMS::bIsExport"] + [::std::mem::offset_of!(CK_SSL3_KEY_MAT_PARAMS, bIsExport) - 12usize]; + ["Offset of field: CK_SSL3_KEY_MAT_PARAMS::RandomInfo"] + [::std::mem::offset_of!(CK_SSL3_KEY_MAT_PARAMS, RandomInfo) - 13usize]; + ["Offset of field: CK_SSL3_KEY_MAT_PARAMS::pReturnedKeyMaterial"] + [::std::mem::offset_of!(CK_SSL3_KEY_MAT_PARAMS, pReturnedKeyMaterial) - 37usize]; +}; impl Default for CK_SSL3_KEY_MAT_PARAMS { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); @@ -4023,81 +2168,23 @@ pub struct CK_TLS_PRF_PARAMS { pub pOutput: CK_BYTE_PTR, pub pulOutputLen: CK_ULONG_PTR, } -#[test] -fn bindgen_test_layout_CK_TLS_PRF_PARAMS() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 40usize, - concat!("Size of: ", stringify!(CK_TLS_PRF_PARAMS)) - ); - assert_eq!( - ::std::mem::align_of::(), - 1usize, - concat!("Alignment of ", stringify!(CK_TLS_PRF_PARAMS)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pSeed) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(CK_TLS_PRF_PARAMS), - "::", - stringify!(pSeed) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulSeedLen) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(CK_TLS_PRF_PARAMS), - "::", - stringify!(ulSeedLen) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pLabel) as usize - ptr as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(CK_TLS_PRF_PARAMS), - "::", - stringify!(pLabel) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulLabelLen) as usize - ptr as usize }, - 20usize, - concat!( - "Offset of field: ", - stringify!(CK_TLS_PRF_PARAMS), - "::", - stringify!(ulLabelLen) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pOutput) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(CK_TLS_PRF_PARAMS), - "::", - stringify!(pOutput) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pulOutputLen) as usize - ptr as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(CK_TLS_PRF_PARAMS), - "::", - stringify!(pulOutputLen) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of CK_TLS_PRF_PARAMS"][::std::mem::size_of::() - 40usize]; + ["Alignment of CK_TLS_PRF_PARAMS"][::std::mem::align_of::() - 1usize]; + ["Offset of field: CK_TLS_PRF_PARAMS::pSeed"] + [::std::mem::offset_of!(CK_TLS_PRF_PARAMS, pSeed) - 0usize]; + ["Offset of field: CK_TLS_PRF_PARAMS::ulSeedLen"] + [::std::mem::offset_of!(CK_TLS_PRF_PARAMS, ulSeedLen) - 8usize]; + ["Offset of field: CK_TLS_PRF_PARAMS::pLabel"] + [::std::mem::offset_of!(CK_TLS_PRF_PARAMS, pLabel) - 12usize]; + ["Offset of field: CK_TLS_PRF_PARAMS::ulLabelLen"] + [::std::mem::offset_of!(CK_TLS_PRF_PARAMS, ulLabelLen) - 20usize]; + ["Offset of field: CK_TLS_PRF_PARAMS::pOutput"] + [::std::mem::offset_of!(CK_TLS_PRF_PARAMS, pOutput) - 24usize]; + ["Offset of field: CK_TLS_PRF_PARAMS::pulOutputLen"] + [::std::mem::offset_of!(CK_TLS_PRF_PARAMS, pulOutputLen) - 32usize]; +}; impl Default for CK_TLS_PRF_PARAMS { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); @@ -4116,61 +2203,19 @@ pub struct CK_WTLS_RANDOM_DATA { pub pServerRandom: CK_BYTE_PTR, pub ulServerRandomLen: CK_ULONG, } -#[test] -fn bindgen_test_layout_CK_WTLS_RANDOM_DATA() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 24usize, - concat!("Size of: ", stringify!(CK_WTLS_RANDOM_DATA)) - ); - assert_eq!( - ::std::mem::align_of::(), - 1usize, - concat!("Alignment of ", stringify!(CK_WTLS_RANDOM_DATA)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pClientRandom) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(CK_WTLS_RANDOM_DATA), - "::", - stringify!(pClientRandom) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulClientRandomLen) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(CK_WTLS_RANDOM_DATA), - "::", - stringify!(ulClientRandomLen) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pServerRandom) as usize - ptr as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(CK_WTLS_RANDOM_DATA), - "::", - stringify!(pServerRandom) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulServerRandomLen) as usize - ptr as usize }, - 20usize, - concat!( - "Offset of field: ", - stringify!(CK_WTLS_RANDOM_DATA), - "::", - stringify!(ulServerRandomLen) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of CK_WTLS_RANDOM_DATA"][::std::mem::size_of::() - 24usize]; + ["Alignment of CK_WTLS_RANDOM_DATA"][::std::mem::align_of::() - 1usize]; + ["Offset of field: CK_WTLS_RANDOM_DATA::pClientRandom"] + [::std::mem::offset_of!(CK_WTLS_RANDOM_DATA, pClientRandom) - 0usize]; + ["Offset of field: CK_WTLS_RANDOM_DATA::ulClientRandomLen"] + [::std::mem::offset_of!(CK_WTLS_RANDOM_DATA, ulClientRandomLen) - 8usize]; + ["Offset of field: CK_WTLS_RANDOM_DATA::pServerRandom"] + [::std::mem::offset_of!(CK_WTLS_RANDOM_DATA, pServerRandom) - 12usize]; + ["Offset of field: CK_WTLS_RANDOM_DATA::ulServerRandomLen"] + [::std::mem::offset_of!(CK_WTLS_RANDOM_DATA, ulServerRandomLen) - 20usize]; +}; impl Default for CK_WTLS_RANDOM_DATA { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); @@ -4188,55 +2233,19 @@ pub struct CK_WTLS_MASTER_KEY_DERIVE_PARAMS { pub RandomInfo: CK_WTLS_RANDOM_DATA, pub pVersion: CK_BYTE_PTR, } -#[test] -fn bindgen_test_layout_CK_WTLS_MASTER_KEY_DERIVE_PARAMS() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 36usize, - concat!("Size of: ", stringify!(CK_WTLS_MASTER_KEY_DERIVE_PARAMS)) - ); - assert_eq!( - ::std::mem::align_of::(), - 1usize, - concat!( - "Alignment of ", - stringify!(CK_WTLS_MASTER_KEY_DERIVE_PARAMS) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).DigestMechanism) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(CK_WTLS_MASTER_KEY_DERIVE_PARAMS), - "::", - stringify!(DigestMechanism) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).RandomInfo) as usize - ptr as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(CK_WTLS_MASTER_KEY_DERIVE_PARAMS), - "::", - stringify!(RandomInfo) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pVersion) as usize - ptr as usize }, - 28usize, - concat!( - "Offset of field: ", - stringify!(CK_WTLS_MASTER_KEY_DERIVE_PARAMS), - "::", - stringify!(pVersion) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of CK_WTLS_MASTER_KEY_DERIVE_PARAMS"] + [::std::mem::size_of::() - 36usize]; + ["Alignment of CK_WTLS_MASTER_KEY_DERIVE_PARAMS"] + [::std::mem::align_of::() - 1usize]; + ["Offset of field: CK_WTLS_MASTER_KEY_DERIVE_PARAMS::DigestMechanism"] + [::std::mem::offset_of!(CK_WTLS_MASTER_KEY_DERIVE_PARAMS, DigestMechanism) - 0usize]; + ["Offset of field: CK_WTLS_MASTER_KEY_DERIVE_PARAMS::RandomInfo"] + [::std::mem::offset_of!(CK_WTLS_MASTER_KEY_DERIVE_PARAMS, RandomInfo) - 4usize]; + ["Offset of field: CK_WTLS_MASTER_KEY_DERIVE_PARAMS::pVersion"] + [::std::mem::offset_of!(CK_WTLS_MASTER_KEY_DERIVE_PARAMS, pVersion) - 28usize]; +}; impl Default for CK_WTLS_MASTER_KEY_DERIVE_PARAMS { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); @@ -4258,91 +2267,25 @@ pub struct CK_WTLS_PRF_PARAMS { pub pOutput: CK_BYTE_PTR, pub pulOutputLen: CK_ULONG_PTR, } -#[test] -fn bindgen_test_layout_CK_WTLS_PRF_PARAMS() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 44usize, - concat!("Size of: ", stringify!(CK_WTLS_PRF_PARAMS)) - ); - assert_eq!( - ::std::mem::align_of::(), - 1usize, - concat!("Alignment of ", stringify!(CK_WTLS_PRF_PARAMS)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).DigestMechanism) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(CK_WTLS_PRF_PARAMS), - "::", - stringify!(DigestMechanism) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pSeed) as usize - ptr as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(CK_WTLS_PRF_PARAMS), - "::", - stringify!(pSeed) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulSeedLen) as usize - ptr as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(CK_WTLS_PRF_PARAMS), - "::", - stringify!(ulSeedLen) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pLabel) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(CK_WTLS_PRF_PARAMS), - "::", - stringify!(pLabel) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulLabelLen) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(CK_WTLS_PRF_PARAMS), - "::", - stringify!(ulLabelLen) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pOutput) as usize - ptr as usize }, - 28usize, - concat!( - "Offset of field: ", - stringify!(CK_WTLS_PRF_PARAMS), - "::", - stringify!(pOutput) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pulOutputLen) as usize - ptr as usize }, - 36usize, - concat!( - "Offset of field: ", - stringify!(CK_WTLS_PRF_PARAMS), - "::", - stringify!(pulOutputLen) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of CK_WTLS_PRF_PARAMS"][::std::mem::size_of::() - 44usize]; + ["Alignment of CK_WTLS_PRF_PARAMS"][::std::mem::align_of::() - 1usize]; + ["Offset of field: CK_WTLS_PRF_PARAMS::DigestMechanism"] + [::std::mem::offset_of!(CK_WTLS_PRF_PARAMS, DigestMechanism) - 0usize]; + ["Offset of field: CK_WTLS_PRF_PARAMS::pSeed"] + [::std::mem::offset_of!(CK_WTLS_PRF_PARAMS, pSeed) - 4usize]; + ["Offset of field: CK_WTLS_PRF_PARAMS::ulSeedLen"] + [::std::mem::offset_of!(CK_WTLS_PRF_PARAMS, ulSeedLen) - 12usize]; + ["Offset of field: CK_WTLS_PRF_PARAMS::pLabel"] + [::std::mem::offset_of!(CK_WTLS_PRF_PARAMS, pLabel) - 16usize]; + ["Offset of field: CK_WTLS_PRF_PARAMS::ulLabelLen"] + [::std::mem::offset_of!(CK_WTLS_PRF_PARAMS, ulLabelLen) - 24usize]; + ["Offset of field: CK_WTLS_PRF_PARAMS::pOutput"] + [::std::mem::offset_of!(CK_WTLS_PRF_PARAMS, pOutput) - 28usize]; + ["Offset of field: CK_WTLS_PRF_PARAMS::pulOutputLen"] + [::std::mem::offset_of!(CK_WTLS_PRF_PARAMS, pulOutputLen) - 36usize]; +}; impl Default for CK_WTLS_PRF_PARAMS { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); @@ -4360,51 +2303,17 @@ pub struct CK_WTLS_KEY_MAT_OUT { pub hKey: CK_OBJECT_HANDLE, pub pIV: CK_BYTE_PTR, } -#[test] -fn bindgen_test_layout_CK_WTLS_KEY_MAT_OUT() { - 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!(CK_WTLS_KEY_MAT_OUT)) - ); - assert_eq!( - ::std::mem::align_of::(), - 1usize, - concat!("Alignment of ", stringify!(CK_WTLS_KEY_MAT_OUT)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).hMacSecret) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(CK_WTLS_KEY_MAT_OUT), - "::", - stringify!(hMacSecret) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).hKey) as usize - ptr as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(CK_WTLS_KEY_MAT_OUT), - "::", - stringify!(hKey) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pIV) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(CK_WTLS_KEY_MAT_OUT), - "::", - stringify!(pIV) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of CK_WTLS_KEY_MAT_OUT"][::std::mem::size_of::() - 16usize]; + ["Alignment of CK_WTLS_KEY_MAT_OUT"][::std::mem::align_of::() - 1usize]; + ["Offset of field: CK_WTLS_KEY_MAT_OUT::hMacSecret"] + [::std::mem::offset_of!(CK_WTLS_KEY_MAT_OUT, hMacSecret) - 0usize]; + ["Offset of field: CK_WTLS_KEY_MAT_OUT::hKey"] + [::std::mem::offset_of!(CK_WTLS_KEY_MAT_OUT, hKey) - 4usize]; + ["Offset of field: CK_WTLS_KEY_MAT_OUT::pIV"] + [::std::mem::offset_of!(CK_WTLS_KEY_MAT_OUT, pIV) - 8usize]; +}; impl Default for CK_WTLS_KEY_MAT_OUT { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); @@ -4427,102 +2336,28 @@ pub struct CK_WTLS_KEY_MAT_PARAMS { pub RandomInfo: CK_WTLS_RANDOM_DATA, pub pReturnedKeyMaterial: CK_WTLS_KEY_MAT_OUT_PTR, } -#[test] -fn bindgen_test_layout_CK_WTLS_KEY_MAT_PARAMS() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 53usize, - concat!("Size of: ", stringify!(CK_WTLS_KEY_MAT_PARAMS)) - ); - assert_eq!( - ::std::mem::align_of::(), - 1usize, - concat!("Alignment of ", stringify!(CK_WTLS_KEY_MAT_PARAMS)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).DigestMechanism) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(CK_WTLS_KEY_MAT_PARAMS), - "::", - stringify!(DigestMechanism) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulMacSizeInBits) as usize - ptr as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(CK_WTLS_KEY_MAT_PARAMS), - "::", - stringify!(ulMacSizeInBits) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulKeySizeInBits) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(CK_WTLS_KEY_MAT_PARAMS), - "::", - stringify!(ulKeySizeInBits) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulIVSizeInBits) as usize - ptr as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(CK_WTLS_KEY_MAT_PARAMS), - "::", - stringify!(ulIVSizeInBits) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulSequenceNumber) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(CK_WTLS_KEY_MAT_PARAMS), - "::", - stringify!(ulSequenceNumber) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).bIsExport) as usize - ptr as usize }, - 20usize, - concat!( - "Offset of field: ", - stringify!(CK_WTLS_KEY_MAT_PARAMS), - "::", - stringify!(bIsExport) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).RandomInfo) as usize - ptr as usize }, - 21usize, - concat!( - "Offset of field: ", - stringify!(CK_WTLS_KEY_MAT_PARAMS), - "::", - stringify!(RandomInfo) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pReturnedKeyMaterial) as usize - ptr as usize }, - 45usize, - concat!( - "Offset of field: ", - stringify!(CK_WTLS_KEY_MAT_PARAMS), - "::", - stringify!(pReturnedKeyMaterial) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of CK_WTLS_KEY_MAT_PARAMS"][::std::mem::size_of::() - 53usize]; + ["Alignment of CK_WTLS_KEY_MAT_PARAMS"] + [::std::mem::align_of::() - 1usize]; + ["Offset of field: CK_WTLS_KEY_MAT_PARAMS::DigestMechanism"] + [::std::mem::offset_of!(CK_WTLS_KEY_MAT_PARAMS, DigestMechanism) - 0usize]; + ["Offset of field: CK_WTLS_KEY_MAT_PARAMS::ulMacSizeInBits"] + [::std::mem::offset_of!(CK_WTLS_KEY_MAT_PARAMS, ulMacSizeInBits) - 4usize]; + ["Offset of field: CK_WTLS_KEY_MAT_PARAMS::ulKeySizeInBits"] + [::std::mem::offset_of!(CK_WTLS_KEY_MAT_PARAMS, ulKeySizeInBits) - 8usize]; + ["Offset of field: CK_WTLS_KEY_MAT_PARAMS::ulIVSizeInBits"] + [::std::mem::offset_of!(CK_WTLS_KEY_MAT_PARAMS, ulIVSizeInBits) - 12usize]; + ["Offset of field: CK_WTLS_KEY_MAT_PARAMS::ulSequenceNumber"] + [::std::mem::offset_of!(CK_WTLS_KEY_MAT_PARAMS, ulSequenceNumber) - 16usize]; + ["Offset of field: CK_WTLS_KEY_MAT_PARAMS::bIsExport"] + [::std::mem::offset_of!(CK_WTLS_KEY_MAT_PARAMS, bIsExport) - 20usize]; + ["Offset of field: CK_WTLS_KEY_MAT_PARAMS::RandomInfo"] + [::std::mem::offset_of!(CK_WTLS_KEY_MAT_PARAMS, RandomInfo) - 21usize]; + ["Offset of field: CK_WTLS_KEY_MAT_PARAMS::pReturnedKeyMaterial"] + [::std::mem::offset_of!(CK_WTLS_KEY_MAT_PARAMS, pReturnedKeyMaterial) - 45usize]; +}; impl Default for CK_WTLS_KEY_MAT_PARAMS { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); @@ -4545,101 +2380,27 @@ pub struct CK_CMS_SIG_PARAMS { pub pRequiredAttributes: CK_BYTE_PTR, pub ulRequiredAttributesLen: CK_ULONG, } -#[test] -fn bindgen_test_layout_CK_CMS_SIG_PARAMS() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 52usize, - concat!("Size of: ", stringify!(CK_CMS_SIG_PARAMS)) - ); - assert_eq!( - ::std::mem::align_of::(), - 1usize, - concat!("Alignment of ", stringify!(CK_CMS_SIG_PARAMS)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).certificateHandle) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(CK_CMS_SIG_PARAMS), - "::", - stringify!(certificateHandle) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pSigningMechanism) as usize - ptr as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(CK_CMS_SIG_PARAMS), - "::", - stringify!(pSigningMechanism) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pDigestMechanism) as usize - ptr as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(CK_CMS_SIG_PARAMS), - "::", - stringify!(pDigestMechanism) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pContentType) as usize - ptr as usize }, - 20usize, - concat!( - "Offset of field: ", - stringify!(CK_CMS_SIG_PARAMS), - "::", - stringify!(pContentType) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pRequestedAttributes) as usize - ptr as usize }, - 28usize, - concat!( - "Offset of field: ", - stringify!(CK_CMS_SIG_PARAMS), - "::", - stringify!(pRequestedAttributes) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulRequestedAttributesLen) as usize - ptr as usize }, - 36usize, - concat!( - "Offset of field: ", - stringify!(CK_CMS_SIG_PARAMS), - "::", - stringify!(ulRequestedAttributesLen) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pRequiredAttributes) as usize - ptr as usize }, - 40usize, - concat!( - "Offset of field: ", - stringify!(CK_CMS_SIG_PARAMS), - "::", - stringify!(pRequiredAttributes) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulRequiredAttributesLen) as usize - ptr as usize }, - 48usize, - concat!( - "Offset of field: ", - stringify!(CK_CMS_SIG_PARAMS), - "::", - stringify!(ulRequiredAttributesLen) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of CK_CMS_SIG_PARAMS"][::std::mem::size_of::() - 52usize]; + ["Alignment of CK_CMS_SIG_PARAMS"][::std::mem::align_of::() - 1usize]; + ["Offset of field: CK_CMS_SIG_PARAMS::certificateHandle"] + [::std::mem::offset_of!(CK_CMS_SIG_PARAMS, certificateHandle) - 0usize]; + ["Offset of field: CK_CMS_SIG_PARAMS::pSigningMechanism"] + [::std::mem::offset_of!(CK_CMS_SIG_PARAMS, pSigningMechanism) - 4usize]; + ["Offset of field: CK_CMS_SIG_PARAMS::pDigestMechanism"] + [::std::mem::offset_of!(CK_CMS_SIG_PARAMS, pDigestMechanism) - 12usize]; + ["Offset of field: CK_CMS_SIG_PARAMS::pContentType"] + [::std::mem::offset_of!(CK_CMS_SIG_PARAMS, pContentType) - 20usize]; + ["Offset of field: CK_CMS_SIG_PARAMS::pRequestedAttributes"] + [::std::mem::offset_of!(CK_CMS_SIG_PARAMS, pRequestedAttributes) - 28usize]; + ["Offset of field: CK_CMS_SIG_PARAMS::ulRequestedAttributesLen"] + [::std::mem::offset_of!(CK_CMS_SIG_PARAMS, ulRequestedAttributesLen) - 36usize]; + ["Offset of field: CK_CMS_SIG_PARAMS::pRequiredAttributes"] + [::std::mem::offset_of!(CK_CMS_SIG_PARAMS, pRequiredAttributes) - 40usize]; + ["Offset of field: CK_CMS_SIG_PARAMS::ulRequiredAttributesLen"] + [::std::mem::offset_of!(CK_CMS_SIG_PARAMS, ulRequiredAttributesLen) - 48usize]; +}; impl Default for CK_CMS_SIG_PARAMS { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); @@ -4656,42 +2417,17 @@ pub struct CK_KEY_DERIVATION_STRING_DATA { pub pData: CK_BYTE_PTR, pub ulLen: CK_ULONG, } -#[test] -fn bindgen_test_layout_CK_KEY_DERIVATION_STRING_DATA() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 12usize, - concat!("Size of: ", stringify!(CK_KEY_DERIVATION_STRING_DATA)) - ); - assert_eq!( - ::std::mem::align_of::(), - 1usize, - concat!("Alignment of ", stringify!(CK_KEY_DERIVATION_STRING_DATA)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pData) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(CK_KEY_DERIVATION_STRING_DATA), - "::", - stringify!(pData) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulLen) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(CK_KEY_DERIVATION_STRING_DATA), - "::", - stringify!(ulLen) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of CK_KEY_DERIVATION_STRING_DATA"] + [::std::mem::size_of::() - 12usize]; + ["Alignment of CK_KEY_DERIVATION_STRING_DATA"] + [::std::mem::align_of::() - 1usize]; + ["Offset of field: CK_KEY_DERIVATION_STRING_DATA::pData"] + [::std::mem::offset_of!(CK_KEY_DERIVATION_STRING_DATA, pData) - 0usize]; + ["Offset of field: CK_KEY_DERIVATION_STRING_DATA::ulLen"] + [::std::mem::offset_of!(CK_KEY_DERIVATION_STRING_DATA, ulLen) - 8usize]; +}; impl Default for CK_KEY_DERIVATION_STRING_DATA { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); @@ -4722,112 +2458,30 @@ pub struct CK_PKCS5_PBKD2_PARAMS { pub pPassword: CK_UTF8CHAR_PTR, pub ulPasswordLen: CK_ULONG_PTR, } -#[test] -fn bindgen_test_layout_CK_PKCS5_PBKD2_PARAMS() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 52usize, - concat!("Size of: ", stringify!(CK_PKCS5_PBKD2_PARAMS)) - ); - assert_eq!( - ::std::mem::align_of::(), - 1usize, - concat!("Alignment of ", stringify!(CK_PKCS5_PBKD2_PARAMS)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).saltSource) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(CK_PKCS5_PBKD2_PARAMS), - "::", - stringify!(saltSource) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pSaltSourceData) as usize - ptr as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(CK_PKCS5_PBKD2_PARAMS), - "::", - stringify!(pSaltSourceData) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulSaltSourceDataLen) as usize - ptr as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(CK_PKCS5_PBKD2_PARAMS), - "::", - stringify!(ulSaltSourceDataLen) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).iterations) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(CK_PKCS5_PBKD2_PARAMS), - "::", - stringify!(iterations) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).prf) as usize - ptr as usize }, - 20usize, - concat!( - "Offset of field: ", - stringify!(CK_PKCS5_PBKD2_PARAMS), - "::", - stringify!(prf) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pPrfData) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(CK_PKCS5_PBKD2_PARAMS), - "::", - stringify!(pPrfData) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulPrfDataLen) as usize - ptr as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(CK_PKCS5_PBKD2_PARAMS), - "::", - stringify!(ulPrfDataLen) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pPassword) as usize - ptr as usize }, - 36usize, - concat!( - "Offset of field: ", - stringify!(CK_PKCS5_PBKD2_PARAMS), - "::", - stringify!(pPassword) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulPasswordLen) as usize - ptr as usize }, - 44usize, - concat!( - "Offset of field: ", - stringify!(CK_PKCS5_PBKD2_PARAMS), - "::", - stringify!(ulPasswordLen) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of CK_PKCS5_PBKD2_PARAMS"][::std::mem::size_of::() - 52usize]; + ["Alignment of CK_PKCS5_PBKD2_PARAMS"] + [::std::mem::align_of::() - 1usize]; + ["Offset of field: CK_PKCS5_PBKD2_PARAMS::saltSource"] + [::std::mem::offset_of!(CK_PKCS5_PBKD2_PARAMS, saltSource) - 0usize]; + ["Offset of field: CK_PKCS5_PBKD2_PARAMS::pSaltSourceData"] + [::std::mem::offset_of!(CK_PKCS5_PBKD2_PARAMS, pSaltSourceData) - 4usize]; + ["Offset of field: CK_PKCS5_PBKD2_PARAMS::ulSaltSourceDataLen"] + [::std::mem::offset_of!(CK_PKCS5_PBKD2_PARAMS, ulSaltSourceDataLen) - 12usize]; + ["Offset of field: CK_PKCS5_PBKD2_PARAMS::iterations"] + [::std::mem::offset_of!(CK_PKCS5_PBKD2_PARAMS, iterations) - 16usize]; + ["Offset of field: CK_PKCS5_PBKD2_PARAMS::prf"] + [::std::mem::offset_of!(CK_PKCS5_PBKD2_PARAMS, prf) - 20usize]; + ["Offset of field: CK_PKCS5_PBKD2_PARAMS::pPrfData"] + [::std::mem::offset_of!(CK_PKCS5_PBKD2_PARAMS, pPrfData) - 24usize]; + ["Offset of field: CK_PKCS5_PBKD2_PARAMS::ulPrfDataLen"] + [::std::mem::offset_of!(CK_PKCS5_PBKD2_PARAMS, ulPrfDataLen) - 32usize]; + ["Offset of field: CK_PKCS5_PBKD2_PARAMS::pPassword"] + [::std::mem::offset_of!(CK_PKCS5_PBKD2_PARAMS, pPassword) - 36usize]; + ["Offset of field: CK_PKCS5_PBKD2_PARAMS::ulPasswordLen"] + [::std::mem::offset_of!(CK_PKCS5_PBKD2_PARAMS, ulPasswordLen) - 44usize]; +}; impl Default for CK_PKCS5_PBKD2_PARAMS { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); @@ -4851,112 +2505,30 @@ pub struct CK_PKCS5_PBKD2_PARAMS2 { pub pPassword: CK_UTF8CHAR_PTR, pub ulPasswordLen: CK_ULONG, } -#[test] -fn bindgen_test_layout_CK_PKCS5_PBKD2_PARAMS2() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 48usize, - concat!("Size of: ", stringify!(CK_PKCS5_PBKD2_PARAMS2)) - ); - assert_eq!( - ::std::mem::align_of::(), - 1usize, - concat!("Alignment of ", stringify!(CK_PKCS5_PBKD2_PARAMS2)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).saltSource) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(CK_PKCS5_PBKD2_PARAMS2), - "::", - stringify!(saltSource) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pSaltSourceData) as usize - ptr as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(CK_PKCS5_PBKD2_PARAMS2), - "::", - stringify!(pSaltSourceData) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulSaltSourceDataLen) as usize - ptr as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(CK_PKCS5_PBKD2_PARAMS2), - "::", - stringify!(ulSaltSourceDataLen) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).iterations) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(CK_PKCS5_PBKD2_PARAMS2), - "::", - stringify!(iterations) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).prf) as usize - ptr as usize }, - 20usize, - concat!( - "Offset of field: ", - stringify!(CK_PKCS5_PBKD2_PARAMS2), - "::", - stringify!(prf) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pPrfData) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(CK_PKCS5_PBKD2_PARAMS2), - "::", - stringify!(pPrfData) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulPrfDataLen) as usize - ptr as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(CK_PKCS5_PBKD2_PARAMS2), - "::", - stringify!(ulPrfDataLen) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pPassword) as usize - ptr as usize }, - 36usize, - concat!( - "Offset of field: ", - stringify!(CK_PKCS5_PBKD2_PARAMS2), - "::", - stringify!(pPassword) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulPasswordLen) as usize - ptr as usize }, - 44usize, - concat!( - "Offset of field: ", - stringify!(CK_PKCS5_PBKD2_PARAMS2), - "::", - stringify!(ulPasswordLen) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of CK_PKCS5_PBKD2_PARAMS2"][::std::mem::size_of::() - 48usize]; + ["Alignment of CK_PKCS5_PBKD2_PARAMS2"] + [::std::mem::align_of::() - 1usize]; + ["Offset of field: CK_PKCS5_PBKD2_PARAMS2::saltSource"] + [::std::mem::offset_of!(CK_PKCS5_PBKD2_PARAMS2, saltSource) - 0usize]; + ["Offset of field: CK_PKCS5_PBKD2_PARAMS2::pSaltSourceData"] + [::std::mem::offset_of!(CK_PKCS5_PBKD2_PARAMS2, pSaltSourceData) - 4usize]; + ["Offset of field: CK_PKCS5_PBKD2_PARAMS2::ulSaltSourceDataLen"] + [::std::mem::offset_of!(CK_PKCS5_PBKD2_PARAMS2, ulSaltSourceDataLen) - 12usize]; + ["Offset of field: CK_PKCS5_PBKD2_PARAMS2::iterations"] + [::std::mem::offset_of!(CK_PKCS5_PBKD2_PARAMS2, iterations) - 16usize]; + ["Offset of field: CK_PKCS5_PBKD2_PARAMS2::prf"] + [::std::mem::offset_of!(CK_PKCS5_PBKD2_PARAMS2, prf) - 20usize]; + ["Offset of field: CK_PKCS5_PBKD2_PARAMS2::pPrfData"] + [::std::mem::offset_of!(CK_PKCS5_PBKD2_PARAMS2, pPrfData) - 24usize]; + ["Offset of field: CK_PKCS5_PBKD2_PARAMS2::ulPrfDataLen"] + [::std::mem::offset_of!(CK_PKCS5_PBKD2_PARAMS2, ulPrfDataLen) - 32usize]; + ["Offset of field: CK_PKCS5_PBKD2_PARAMS2::pPassword"] + [::std::mem::offset_of!(CK_PKCS5_PBKD2_PARAMS2, pPassword) - 36usize]; + ["Offset of field: CK_PKCS5_PBKD2_PARAMS2::ulPasswordLen"] + [::std::mem::offset_of!(CK_PKCS5_PBKD2_PARAMS2, ulPasswordLen) - 44usize]; +}; impl Default for CK_PKCS5_PBKD2_PARAMS2 { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); @@ -4976,51 +2548,16 @@ pub struct CK_OTP_PARAM { pub pValue: CK_VOID_PTR, pub ulValueLen: CK_ULONG, } -#[test] -fn bindgen_test_layout_CK_OTP_PARAM() { - 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!(CK_OTP_PARAM)) - ); - assert_eq!( - ::std::mem::align_of::(), - 1usize, - concat!("Alignment of ", stringify!(CK_OTP_PARAM)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).type_) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(CK_OTP_PARAM), - "::", - stringify!(type_) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pValue) as usize - ptr as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(CK_OTP_PARAM), - "::", - stringify!(pValue) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulValueLen) as usize - ptr as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(CK_OTP_PARAM), - "::", - stringify!(ulValueLen) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of CK_OTP_PARAM"][::std::mem::size_of::() - 16usize]; + ["Alignment of CK_OTP_PARAM"][::std::mem::align_of::() - 1usize]; + ["Offset of field: CK_OTP_PARAM::type_"][::std::mem::offset_of!(CK_OTP_PARAM, type_) - 0usize]; + ["Offset of field: CK_OTP_PARAM::pValue"] + [::std::mem::offset_of!(CK_OTP_PARAM, pValue) - 4usize]; + ["Offset of field: CK_OTP_PARAM::ulValueLen"] + [::std::mem::offset_of!(CK_OTP_PARAM, ulValueLen) - 12usize]; +}; impl Default for CK_OTP_PARAM { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); @@ -5037,41 +2574,15 @@ pub struct CK_OTP_PARAMS { pub pParams: CK_OTP_PARAM_PTR, pub ulCount: CK_ULONG, } -#[test] -fn bindgen_test_layout_CK_OTP_PARAMS() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 12usize, - concat!("Size of: ", stringify!(CK_OTP_PARAMS)) - ); - assert_eq!( - ::std::mem::align_of::(), - 1usize, - concat!("Alignment of ", stringify!(CK_OTP_PARAMS)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pParams) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(CK_OTP_PARAMS), - "::", - stringify!(pParams) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulCount) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(CK_OTP_PARAMS), - "::", - stringify!(ulCount) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of CK_OTP_PARAMS"][::std::mem::size_of::() - 12usize]; + ["Alignment of CK_OTP_PARAMS"][::std::mem::align_of::() - 1usize]; + ["Offset of field: CK_OTP_PARAMS::pParams"] + [::std::mem::offset_of!(CK_OTP_PARAMS, pParams) - 0usize]; + ["Offset of field: CK_OTP_PARAMS::ulCount"] + [::std::mem::offset_of!(CK_OTP_PARAMS, ulCount) - 8usize]; +}; impl Default for CK_OTP_PARAMS { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); @@ -5088,42 +2599,16 @@ pub struct CK_OTP_SIGNATURE_INFO { pub pParams: CK_OTP_PARAM_PTR, pub ulCount: CK_ULONG, } -#[test] -fn bindgen_test_layout_CK_OTP_SIGNATURE_INFO() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 12usize, - concat!("Size of: ", stringify!(CK_OTP_SIGNATURE_INFO)) - ); - assert_eq!( - ::std::mem::align_of::(), - 1usize, - concat!("Alignment of ", stringify!(CK_OTP_SIGNATURE_INFO)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pParams) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(CK_OTP_SIGNATURE_INFO), - "::", - stringify!(pParams) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulCount) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(CK_OTP_SIGNATURE_INFO), - "::", - stringify!(ulCount) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of CK_OTP_SIGNATURE_INFO"][::std::mem::size_of::() - 12usize]; + ["Alignment of CK_OTP_SIGNATURE_INFO"] + [::std::mem::align_of::() - 1usize]; + ["Offset of field: CK_OTP_SIGNATURE_INFO::pParams"] + [::std::mem::offset_of!(CK_OTP_SIGNATURE_INFO, pParams) - 0usize]; + ["Offset of field: CK_OTP_SIGNATURE_INFO::ulCount"] + [::std::mem::offset_of!(CK_OTP_SIGNATURE_INFO, ulCount) - 8usize]; +}; impl Default for CK_OTP_SIGNATURE_INFO { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); @@ -5142,61 +2627,18 @@ pub struct CK_KIP_PARAMS { pub pSeed: CK_BYTE_PTR, pub ulSeedLen: CK_ULONG, } -#[test] -fn bindgen_test_layout_CK_KIP_PARAMS() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 24usize, - concat!("Size of: ", stringify!(CK_KIP_PARAMS)) - ); - assert_eq!( - ::std::mem::align_of::(), - 1usize, - concat!("Alignment of ", stringify!(CK_KIP_PARAMS)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pMechanism) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(CK_KIP_PARAMS), - "::", - stringify!(pMechanism) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).hKey) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(CK_KIP_PARAMS), - "::", - stringify!(hKey) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pSeed) as usize - ptr as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(CK_KIP_PARAMS), - "::", - stringify!(pSeed) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulSeedLen) as usize - ptr as usize }, - 20usize, - concat!( - "Offset of field: ", - stringify!(CK_KIP_PARAMS), - "::", - stringify!(ulSeedLen) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of CK_KIP_PARAMS"][::std::mem::size_of::() - 24usize]; + ["Alignment of CK_KIP_PARAMS"][::std::mem::align_of::() - 1usize]; + ["Offset of field: CK_KIP_PARAMS::pMechanism"] + [::std::mem::offset_of!(CK_KIP_PARAMS, pMechanism) - 0usize]; + ["Offset of field: CK_KIP_PARAMS::hKey"][::std::mem::offset_of!(CK_KIP_PARAMS, hKey) - 8usize]; + ["Offset of field: CK_KIP_PARAMS::pSeed"] + [::std::mem::offset_of!(CK_KIP_PARAMS, pSeed) - 12usize]; + ["Offset of field: CK_KIP_PARAMS::ulSeedLen"] + [::std::mem::offset_of!(CK_KIP_PARAMS, ulSeedLen) - 20usize]; +}; impl Default for CK_KIP_PARAMS { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); @@ -5213,41 +2655,15 @@ pub struct CK_AES_CTR_PARAMS { pub ulCounterBits: CK_ULONG, pub cb: [CK_BYTE; 16usize], } -#[test] -fn bindgen_test_layout_CK_AES_CTR_PARAMS() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 20usize, - concat!("Size of: ", stringify!(CK_AES_CTR_PARAMS)) - ); - assert_eq!( - ::std::mem::align_of::(), - 1usize, - concat!("Alignment of ", stringify!(CK_AES_CTR_PARAMS)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulCounterBits) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(CK_AES_CTR_PARAMS), - "::", - stringify!(ulCounterBits) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).cb) as usize - ptr as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(CK_AES_CTR_PARAMS), - "::", - stringify!(cb) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of CK_AES_CTR_PARAMS"][::std::mem::size_of::() - 20usize]; + ["Alignment of CK_AES_CTR_PARAMS"][::std::mem::align_of::() - 1usize]; + ["Offset of field: CK_AES_CTR_PARAMS::ulCounterBits"] + [::std::mem::offset_of!(CK_AES_CTR_PARAMS, ulCounterBits) - 0usize]; + ["Offset of field: CK_AES_CTR_PARAMS::cb"] + [::std::mem::offset_of!(CK_AES_CTR_PARAMS, cb) - 4usize]; +}; pub type CK_AES_CTR_PARAMS_PTR = *mut CK_AES_CTR_PARAMS; #[repr(C, packed)] #[derive(Debug, Copy, Clone)] @@ -5259,81 +2675,21 @@ pub struct CK_GCM_PARAMS { pub ulAADLen: CK_ULONG, pub ulTagBits: CK_ULONG, } -#[test] -fn bindgen_test_layout_CK_GCM_PARAMS() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 32usize, - concat!("Size of: ", stringify!(CK_GCM_PARAMS)) - ); - assert_eq!( - ::std::mem::align_of::(), - 1usize, - concat!("Alignment of ", stringify!(CK_GCM_PARAMS)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pIv) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(CK_GCM_PARAMS), - "::", - stringify!(pIv) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulIvLen) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(CK_GCM_PARAMS), - "::", - stringify!(ulIvLen) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulIvBits) as usize - ptr as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(CK_GCM_PARAMS), - "::", - stringify!(ulIvBits) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pAAD) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(CK_GCM_PARAMS), - "::", - stringify!(pAAD) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulAADLen) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(CK_GCM_PARAMS), - "::", - stringify!(ulAADLen) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulTagBits) as usize - ptr as usize }, - 28usize, - concat!( - "Offset of field: ", - stringify!(CK_GCM_PARAMS), - "::", - stringify!(ulTagBits) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of CK_GCM_PARAMS"][::std::mem::size_of::() - 32usize]; + ["Alignment of CK_GCM_PARAMS"][::std::mem::align_of::() - 1usize]; + ["Offset of field: CK_GCM_PARAMS::pIv"][::std::mem::offset_of!(CK_GCM_PARAMS, pIv) - 0usize]; + ["Offset of field: CK_GCM_PARAMS::ulIvLen"] + [::std::mem::offset_of!(CK_GCM_PARAMS, ulIvLen) - 8usize]; + ["Offset of field: CK_GCM_PARAMS::ulIvBits"] + [::std::mem::offset_of!(CK_GCM_PARAMS, ulIvBits) - 12usize]; + ["Offset of field: CK_GCM_PARAMS::pAAD"][::std::mem::offset_of!(CK_GCM_PARAMS, pAAD) - 16usize]; + ["Offset of field: CK_GCM_PARAMS::ulAADLen"] + [::std::mem::offset_of!(CK_GCM_PARAMS, ulAADLen) - 24usize]; + ["Offset of field: CK_GCM_PARAMS::ulTagBits"] + [::std::mem::offset_of!(CK_GCM_PARAMS, ulTagBits) - 28usize]; +}; impl Default for CK_GCM_PARAMS { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); @@ -5355,82 +2711,24 @@ pub struct CK_GCM_MESSAGE_PARAMS { pub pTag: CK_BYTE_PTR, pub ulTagBits: CK_ULONG, } -#[test] -fn bindgen_test_layout_CK_GCM_MESSAGE_PARAMS() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 32usize, - concat!("Size of: ", stringify!(CK_GCM_MESSAGE_PARAMS)) - ); - assert_eq!( - ::std::mem::align_of::(), - 1usize, - concat!("Alignment of ", stringify!(CK_GCM_MESSAGE_PARAMS)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pIv) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(CK_GCM_MESSAGE_PARAMS), - "::", - stringify!(pIv) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulIvLen) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(CK_GCM_MESSAGE_PARAMS), - "::", - stringify!(ulIvLen) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulIvFixedBits) as usize - ptr as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(CK_GCM_MESSAGE_PARAMS), - "::", - stringify!(ulIvFixedBits) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ivGenerator) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(CK_GCM_MESSAGE_PARAMS), - "::", - stringify!(ivGenerator) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pTag) as usize - ptr as usize }, - 20usize, - concat!( - "Offset of field: ", - stringify!(CK_GCM_MESSAGE_PARAMS), - "::", - stringify!(pTag) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulTagBits) as usize - ptr as usize }, - 28usize, - concat!( - "Offset of field: ", - stringify!(CK_GCM_MESSAGE_PARAMS), - "::", - stringify!(ulTagBits) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of CK_GCM_MESSAGE_PARAMS"][::std::mem::size_of::() - 32usize]; + ["Alignment of CK_GCM_MESSAGE_PARAMS"] + [::std::mem::align_of::() - 1usize]; + ["Offset of field: CK_GCM_MESSAGE_PARAMS::pIv"] + [::std::mem::offset_of!(CK_GCM_MESSAGE_PARAMS, pIv) - 0usize]; + ["Offset of field: CK_GCM_MESSAGE_PARAMS::ulIvLen"] + [::std::mem::offset_of!(CK_GCM_MESSAGE_PARAMS, ulIvLen) - 8usize]; + ["Offset of field: CK_GCM_MESSAGE_PARAMS::ulIvFixedBits"] + [::std::mem::offset_of!(CK_GCM_MESSAGE_PARAMS, ulIvFixedBits) - 12usize]; + ["Offset of field: CK_GCM_MESSAGE_PARAMS::ivGenerator"] + [::std::mem::offset_of!(CK_GCM_MESSAGE_PARAMS, ivGenerator) - 16usize]; + ["Offset of field: CK_GCM_MESSAGE_PARAMS::pTag"] + [::std::mem::offset_of!(CK_GCM_MESSAGE_PARAMS, pTag) - 20usize]; + ["Offset of field: CK_GCM_MESSAGE_PARAMS::ulTagBits"] + [::std::mem::offset_of!(CK_GCM_MESSAGE_PARAMS, ulTagBits) - 28usize]; +}; impl Default for CK_GCM_MESSAGE_PARAMS { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); @@ -5451,81 +2749,22 @@ pub struct CK_CCM_PARAMS { pub ulAADLen: CK_ULONG, pub ulMACLen: CK_ULONG, } -#[test] -fn bindgen_test_layout_CK_CCM_PARAMS() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 32usize, - concat!("Size of: ", stringify!(CK_CCM_PARAMS)) - ); - assert_eq!( - ::std::mem::align_of::(), - 1usize, - concat!("Alignment of ", stringify!(CK_CCM_PARAMS)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulDataLen) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(CK_CCM_PARAMS), - "::", - stringify!(ulDataLen) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pNonce) as usize - ptr as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(CK_CCM_PARAMS), - "::", - stringify!(pNonce) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulNonceLen) as usize - ptr as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(CK_CCM_PARAMS), - "::", - stringify!(ulNonceLen) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pAAD) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(CK_CCM_PARAMS), - "::", - stringify!(pAAD) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulAADLen) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(CK_CCM_PARAMS), - "::", - stringify!(ulAADLen) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulMACLen) as usize - ptr as usize }, - 28usize, - concat!( - "Offset of field: ", - stringify!(CK_CCM_PARAMS), - "::", - stringify!(ulMACLen) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of CK_CCM_PARAMS"][::std::mem::size_of::() - 32usize]; + ["Alignment of CK_CCM_PARAMS"][::std::mem::align_of::() - 1usize]; + ["Offset of field: CK_CCM_PARAMS::ulDataLen"] + [::std::mem::offset_of!(CK_CCM_PARAMS, ulDataLen) - 0usize]; + ["Offset of field: CK_CCM_PARAMS::pNonce"] + [::std::mem::offset_of!(CK_CCM_PARAMS, pNonce) - 4usize]; + ["Offset of field: CK_CCM_PARAMS::ulNonceLen"] + [::std::mem::offset_of!(CK_CCM_PARAMS, ulNonceLen) - 12usize]; + ["Offset of field: CK_CCM_PARAMS::pAAD"][::std::mem::offset_of!(CK_CCM_PARAMS, pAAD) - 16usize]; + ["Offset of field: CK_CCM_PARAMS::ulAADLen"] + [::std::mem::offset_of!(CK_CCM_PARAMS, ulAADLen) - 24usize]; + ["Offset of field: CK_CCM_PARAMS::ulMACLen"] + [::std::mem::offset_of!(CK_CCM_PARAMS, ulMACLen) - 28usize]; +}; impl Default for CK_CCM_PARAMS { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); @@ -5547,92 +2786,26 @@ pub struct CK_CCM_MESSAGE_PARAMS { pub pMAC: CK_BYTE_PTR, pub ulMACLen: CK_ULONG, } -#[test] -fn bindgen_test_layout_CK_CCM_MESSAGE_PARAMS() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 36usize, - concat!("Size of: ", stringify!(CK_CCM_MESSAGE_PARAMS)) - ); - assert_eq!( - ::std::mem::align_of::(), - 1usize, - concat!("Alignment of ", stringify!(CK_CCM_MESSAGE_PARAMS)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulDataLen) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(CK_CCM_MESSAGE_PARAMS), - "::", - stringify!(ulDataLen) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pNonce) as usize - ptr as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(CK_CCM_MESSAGE_PARAMS), - "::", - stringify!(pNonce) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulNonceLen) as usize - ptr as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(CK_CCM_MESSAGE_PARAMS), - "::", - stringify!(ulNonceLen) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulNonceFixedBits) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(CK_CCM_MESSAGE_PARAMS), - "::", - stringify!(ulNonceFixedBits) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).nonceGenerator) as usize - ptr as usize }, - 20usize, - concat!( - "Offset of field: ", - stringify!(CK_CCM_MESSAGE_PARAMS), - "::", - stringify!(nonceGenerator) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pMAC) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(CK_CCM_MESSAGE_PARAMS), - "::", - stringify!(pMAC) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulMACLen) as usize - ptr as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(CK_CCM_MESSAGE_PARAMS), - "::", - stringify!(ulMACLen) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of CK_CCM_MESSAGE_PARAMS"][::std::mem::size_of::() - 36usize]; + ["Alignment of CK_CCM_MESSAGE_PARAMS"] + [::std::mem::align_of::() - 1usize]; + ["Offset of field: CK_CCM_MESSAGE_PARAMS::ulDataLen"] + [::std::mem::offset_of!(CK_CCM_MESSAGE_PARAMS, ulDataLen) - 0usize]; + ["Offset of field: CK_CCM_MESSAGE_PARAMS::pNonce"] + [::std::mem::offset_of!(CK_CCM_MESSAGE_PARAMS, pNonce) - 4usize]; + ["Offset of field: CK_CCM_MESSAGE_PARAMS::ulNonceLen"] + [::std::mem::offset_of!(CK_CCM_MESSAGE_PARAMS, ulNonceLen) - 12usize]; + ["Offset of field: CK_CCM_MESSAGE_PARAMS::ulNonceFixedBits"] + [::std::mem::offset_of!(CK_CCM_MESSAGE_PARAMS, ulNonceFixedBits) - 16usize]; + ["Offset of field: CK_CCM_MESSAGE_PARAMS::nonceGenerator"] + [::std::mem::offset_of!(CK_CCM_MESSAGE_PARAMS, nonceGenerator) - 20usize]; + ["Offset of field: CK_CCM_MESSAGE_PARAMS::pMAC"] + [::std::mem::offset_of!(CK_CCM_MESSAGE_PARAMS, pMAC) - 24usize]; + ["Offset of field: CK_CCM_MESSAGE_PARAMS::ulMACLen"] + [::std::mem::offset_of!(CK_CCM_MESSAGE_PARAMS, ulMACLen) - 32usize]; +}; impl Default for CK_CCM_MESSAGE_PARAMS { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); @@ -5653,81 +2826,23 @@ pub struct CK_AES_GCM_PARAMS { pub ulAADLen: CK_ULONG, pub ulTagBits: CK_ULONG, } -#[test] -fn bindgen_test_layout_CK_AES_GCM_PARAMS() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 32usize, - concat!("Size of: ", stringify!(CK_AES_GCM_PARAMS)) - ); - assert_eq!( - ::std::mem::align_of::(), - 1usize, - concat!("Alignment of ", stringify!(CK_AES_GCM_PARAMS)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pIv) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(CK_AES_GCM_PARAMS), - "::", - stringify!(pIv) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulIvLen) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(CK_AES_GCM_PARAMS), - "::", - stringify!(ulIvLen) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulIvBits) as usize - ptr as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(CK_AES_GCM_PARAMS), - "::", - stringify!(ulIvBits) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pAAD) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(CK_AES_GCM_PARAMS), - "::", - stringify!(pAAD) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulAADLen) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(CK_AES_GCM_PARAMS), - "::", - stringify!(ulAADLen) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulTagBits) as usize - ptr as usize }, - 28usize, - concat!( - "Offset of field: ", - stringify!(CK_AES_GCM_PARAMS), - "::", - stringify!(ulTagBits) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of CK_AES_GCM_PARAMS"][::std::mem::size_of::() - 32usize]; + ["Alignment of CK_AES_GCM_PARAMS"][::std::mem::align_of::() - 1usize]; + ["Offset of field: CK_AES_GCM_PARAMS::pIv"] + [::std::mem::offset_of!(CK_AES_GCM_PARAMS, pIv) - 0usize]; + ["Offset of field: CK_AES_GCM_PARAMS::ulIvLen"] + [::std::mem::offset_of!(CK_AES_GCM_PARAMS, ulIvLen) - 8usize]; + ["Offset of field: CK_AES_GCM_PARAMS::ulIvBits"] + [::std::mem::offset_of!(CK_AES_GCM_PARAMS, ulIvBits) - 12usize]; + ["Offset of field: CK_AES_GCM_PARAMS::pAAD"] + [::std::mem::offset_of!(CK_AES_GCM_PARAMS, pAAD) - 16usize]; + ["Offset of field: CK_AES_GCM_PARAMS::ulAADLen"] + [::std::mem::offset_of!(CK_AES_GCM_PARAMS, ulAADLen) - 24usize]; + ["Offset of field: CK_AES_GCM_PARAMS::ulTagBits"] + [::std::mem::offset_of!(CK_AES_GCM_PARAMS, ulTagBits) - 28usize]; +}; impl Default for CK_AES_GCM_PARAMS { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); @@ -5748,81 +2863,23 @@ pub struct CK_AES_CCM_PARAMS { pub ulAADLen: CK_ULONG, pub ulMACLen: CK_ULONG, } -#[test] -fn bindgen_test_layout_CK_AES_CCM_PARAMS() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 32usize, - concat!("Size of: ", stringify!(CK_AES_CCM_PARAMS)) - ); - assert_eq!( - ::std::mem::align_of::(), - 1usize, - concat!("Alignment of ", stringify!(CK_AES_CCM_PARAMS)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulDataLen) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(CK_AES_CCM_PARAMS), - "::", - stringify!(ulDataLen) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pNonce) as usize - ptr as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(CK_AES_CCM_PARAMS), - "::", - stringify!(pNonce) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulNonceLen) as usize - ptr as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(CK_AES_CCM_PARAMS), - "::", - stringify!(ulNonceLen) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pAAD) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(CK_AES_CCM_PARAMS), - "::", - stringify!(pAAD) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulAADLen) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(CK_AES_CCM_PARAMS), - "::", - stringify!(ulAADLen) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulMACLen) as usize - ptr as usize }, - 28usize, - concat!( - "Offset of field: ", - stringify!(CK_AES_CCM_PARAMS), - "::", - stringify!(ulMACLen) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of CK_AES_CCM_PARAMS"][::std::mem::size_of::() - 32usize]; + ["Alignment of CK_AES_CCM_PARAMS"][::std::mem::align_of::() - 1usize]; + ["Offset of field: CK_AES_CCM_PARAMS::ulDataLen"] + [::std::mem::offset_of!(CK_AES_CCM_PARAMS, ulDataLen) - 0usize]; + ["Offset of field: CK_AES_CCM_PARAMS::pNonce"] + [::std::mem::offset_of!(CK_AES_CCM_PARAMS, pNonce) - 4usize]; + ["Offset of field: CK_AES_CCM_PARAMS::ulNonceLen"] + [::std::mem::offset_of!(CK_AES_CCM_PARAMS, ulNonceLen) - 12usize]; + ["Offset of field: CK_AES_CCM_PARAMS::pAAD"] + [::std::mem::offset_of!(CK_AES_CCM_PARAMS, pAAD) - 16usize]; + ["Offset of field: CK_AES_CCM_PARAMS::ulAADLen"] + [::std::mem::offset_of!(CK_AES_CCM_PARAMS, ulAADLen) - 24usize]; + ["Offset of field: CK_AES_CCM_PARAMS::ulMACLen"] + [::std::mem::offset_of!(CK_AES_CCM_PARAMS, ulMACLen) - 28usize]; +}; impl Default for CK_AES_CCM_PARAMS { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); @@ -5839,42 +2896,16 @@ pub struct CK_CAMELLIA_CTR_PARAMS { pub ulCounterBits: CK_ULONG, pub cb: [CK_BYTE; 16usize], } -#[test] -fn bindgen_test_layout_CK_CAMELLIA_CTR_PARAMS() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 20usize, - concat!("Size of: ", stringify!(CK_CAMELLIA_CTR_PARAMS)) - ); - assert_eq!( - ::std::mem::align_of::(), - 1usize, - concat!("Alignment of ", stringify!(CK_CAMELLIA_CTR_PARAMS)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulCounterBits) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(CK_CAMELLIA_CTR_PARAMS), - "::", - stringify!(ulCounterBits) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).cb) as usize - ptr as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(CK_CAMELLIA_CTR_PARAMS), - "::", - stringify!(cb) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of CK_CAMELLIA_CTR_PARAMS"][::std::mem::size_of::() - 20usize]; + ["Alignment of CK_CAMELLIA_CTR_PARAMS"] + [::std::mem::align_of::() - 1usize]; + ["Offset of field: CK_CAMELLIA_CTR_PARAMS::ulCounterBits"] + [::std::mem::offset_of!(CK_CAMELLIA_CTR_PARAMS, ulCounterBits) - 0usize]; + ["Offset of field: CK_CAMELLIA_CTR_PARAMS::cb"] + [::std::mem::offset_of!(CK_CAMELLIA_CTR_PARAMS, cb) - 4usize]; +}; pub type CK_CAMELLIA_CTR_PARAMS_PTR = *mut CK_CAMELLIA_CTR_PARAMS; #[repr(C, packed)] #[derive(Debug, Copy, Clone)] @@ -5883,55 +2914,19 @@ pub struct CK_CAMELLIA_CBC_ENCRYPT_DATA_PARAMS { pub pData: CK_BYTE_PTR, pub length: CK_ULONG, } -#[test] -fn bindgen_test_layout_CK_CAMELLIA_CBC_ENCRYPT_DATA_PARAMS() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 28usize, - concat!("Size of: ", stringify!(CK_CAMELLIA_CBC_ENCRYPT_DATA_PARAMS)) - ); - assert_eq!( - ::std::mem::align_of::(), - 1usize, - concat!( - "Alignment of ", - stringify!(CK_CAMELLIA_CBC_ENCRYPT_DATA_PARAMS) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).iv) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(CK_CAMELLIA_CBC_ENCRYPT_DATA_PARAMS), - "::", - stringify!(iv) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pData) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(CK_CAMELLIA_CBC_ENCRYPT_DATA_PARAMS), - "::", - stringify!(pData) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).length) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(CK_CAMELLIA_CBC_ENCRYPT_DATA_PARAMS), - "::", - stringify!(length) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of CK_CAMELLIA_CBC_ENCRYPT_DATA_PARAMS"] + [::std::mem::size_of::() - 28usize]; + ["Alignment of CK_CAMELLIA_CBC_ENCRYPT_DATA_PARAMS"] + [::std::mem::align_of::() - 1usize]; + ["Offset of field: CK_CAMELLIA_CBC_ENCRYPT_DATA_PARAMS::iv"] + [::std::mem::offset_of!(CK_CAMELLIA_CBC_ENCRYPT_DATA_PARAMS, iv) - 0usize]; + ["Offset of field: CK_CAMELLIA_CBC_ENCRYPT_DATA_PARAMS::pData"] + [::std::mem::offset_of!(CK_CAMELLIA_CBC_ENCRYPT_DATA_PARAMS, pData) - 16usize]; + ["Offset of field: CK_CAMELLIA_CBC_ENCRYPT_DATA_PARAMS::length"] + [::std::mem::offset_of!(CK_CAMELLIA_CBC_ENCRYPT_DATA_PARAMS, length) - 24usize]; +}; impl Default for CK_CAMELLIA_CBC_ENCRYPT_DATA_PARAMS { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); @@ -5949,52 +2944,19 @@ pub struct CK_ARIA_CBC_ENCRYPT_DATA_PARAMS { pub pData: CK_BYTE_PTR, pub length: CK_ULONG, } -#[test] -fn bindgen_test_layout_CK_ARIA_CBC_ENCRYPT_DATA_PARAMS() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 28usize, - concat!("Size of: ", stringify!(CK_ARIA_CBC_ENCRYPT_DATA_PARAMS)) - ); - assert_eq!( - ::std::mem::align_of::(), - 1usize, - concat!("Alignment of ", stringify!(CK_ARIA_CBC_ENCRYPT_DATA_PARAMS)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).iv) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(CK_ARIA_CBC_ENCRYPT_DATA_PARAMS), - "::", - stringify!(iv) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pData) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(CK_ARIA_CBC_ENCRYPT_DATA_PARAMS), - "::", - stringify!(pData) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).length) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(CK_ARIA_CBC_ENCRYPT_DATA_PARAMS), - "::", - stringify!(length) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of CK_ARIA_CBC_ENCRYPT_DATA_PARAMS"] + [::std::mem::size_of::() - 28usize]; + ["Alignment of CK_ARIA_CBC_ENCRYPT_DATA_PARAMS"] + [::std::mem::align_of::() - 1usize]; + ["Offset of field: CK_ARIA_CBC_ENCRYPT_DATA_PARAMS::iv"] + [::std::mem::offset_of!(CK_ARIA_CBC_ENCRYPT_DATA_PARAMS, iv) - 0usize]; + ["Offset of field: CK_ARIA_CBC_ENCRYPT_DATA_PARAMS::pData"] + [::std::mem::offset_of!(CK_ARIA_CBC_ENCRYPT_DATA_PARAMS, pData) - 16usize]; + ["Offset of field: CK_ARIA_CBC_ENCRYPT_DATA_PARAMS::length"] + [::std::mem::offset_of!(CK_ARIA_CBC_ENCRYPT_DATA_PARAMS, length) - 24usize]; +}; impl Default for CK_ARIA_CBC_ENCRYPT_DATA_PARAMS { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); @@ -6013,62 +2975,21 @@ pub struct CK_DSA_PARAMETER_GEN_PARAM { pub ulSeedLen: CK_ULONG, pub ulIndex: CK_ULONG, } -#[test] -fn bindgen_test_layout_CK_DSA_PARAMETER_GEN_PARAM() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 20usize, - concat!("Size of: ", stringify!(CK_DSA_PARAMETER_GEN_PARAM)) - ); - assert_eq!( - ::std::mem::align_of::(), - 1usize, - concat!("Alignment of ", stringify!(CK_DSA_PARAMETER_GEN_PARAM)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).hash) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(CK_DSA_PARAMETER_GEN_PARAM), - "::", - stringify!(hash) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pSeed) as usize - ptr as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(CK_DSA_PARAMETER_GEN_PARAM), - "::", - stringify!(pSeed) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulSeedLen) as usize - ptr as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(CK_DSA_PARAMETER_GEN_PARAM), - "::", - stringify!(ulSeedLen) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulIndex) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(CK_DSA_PARAMETER_GEN_PARAM), - "::", - stringify!(ulIndex) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of CK_DSA_PARAMETER_GEN_PARAM"] + [::std::mem::size_of::() - 20usize]; + ["Alignment of CK_DSA_PARAMETER_GEN_PARAM"] + [::std::mem::align_of::() - 1usize]; + ["Offset of field: CK_DSA_PARAMETER_GEN_PARAM::hash"] + [::std::mem::offset_of!(CK_DSA_PARAMETER_GEN_PARAM, hash) - 0usize]; + ["Offset of field: CK_DSA_PARAMETER_GEN_PARAM::pSeed"] + [::std::mem::offset_of!(CK_DSA_PARAMETER_GEN_PARAM, pSeed) - 4usize]; + ["Offset of field: CK_DSA_PARAMETER_GEN_PARAM::ulSeedLen"] + [::std::mem::offset_of!(CK_DSA_PARAMETER_GEN_PARAM, ulSeedLen) - 12usize]; + ["Offset of field: CK_DSA_PARAMETER_GEN_PARAM::ulIndex"] + [::std::mem::offset_of!(CK_DSA_PARAMETER_GEN_PARAM, ulIndex) - 16usize]; +}; impl Default for CK_DSA_PARAMETER_GEN_PARAM { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); @@ -6087,62 +3008,21 @@ pub struct CK_ECDH_AES_KEY_WRAP_PARAMS { pub ulSharedDataLen: CK_ULONG, pub pSharedData: CK_BYTE_PTR, } -#[test] -fn bindgen_test_layout_CK_ECDH_AES_KEY_WRAP_PARAMS() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 20usize, - concat!("Size of: ", stringify!(CK_ECDH_AES_KEY_WRAP_PARAMS)) - ); - assert_eq!( - ::std::mem::align_of::(), - 1usize, - concat!("Alignment of ", stringify!(CK_ECDH_AES_KEY_WRAP_PARAMS)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulAESKeyBits) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(CK_ECDH_AES_KEY_WRAP_PARAMS), - "::", - stringify!(ulAESKeyBits) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).kdf) as usize - ptr as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(CK_ECDH_AES_KEY_WRAP_PARAMS), - "::", - stringify!(kdf) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulSharedDataLen) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(CK_ECDH_AES_KEY_WRAP_PARAMS), - "::", - stringify!(ulSharedDataLen) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pSharedData) as usize - ptr as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(CK_ECDH_AES_KEY_WRAP_PARAMS), - "::", - stringify!(pSharedData) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of CK_ECDH_AES_KEY_WRAP_PARAMS"] + [::std::mem::size_of::() - 20usize]; + ["Alignment of CK_ECDH_AES_KEY_WRAP_PARAMS"] + [::std::mem::align_of::() - 1usize]; + ["Offset of field: CK_ECDH_AES_KEY_WRAP_PARAMS::ulAESKeyBits"] + [::std::mem::offset_of!(CK_ECDH_AES_KEY_WRAP_PARAMS, ulAESKeyBits) - 0usize]; + ["Offset of field: CK_ECDH_AES_KEY_WRAP_PARAMS::kdf"] + [::std::mem::offset_of!(CK_ECDH_AES_KEY_WRAP_PARAMS, kdf) - 4usize]; + ["Offset of field: CK_ECDH_AES_KEY_WRAP_PARAMS::ulSharedDataLen"] + [::std::mem::offset_of!(CK_ECDH_AES_KEY_WRAP_PARAMS, ulSharedDataLen) - 8usize]; + ["Offset of field: CK_ECDH_AES_KEY_WRAP_PARAMS::pSharedData"] + [::std::mem::offset_of!(CK_ECDH_AES_KEY_WRAP_PARAMS, pSharedData) - 12usize]; +}; impl Default for CK_ECDH_AES_KEY_WRAP_PARAMS { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); @@ -6161,42 +3041,17 @@ pub struct CK_RSA_AES_KEY_WRAP_PARAMS { pub ulAESKeyBits: CK_ULONG, pub pOAEPParams: CK_RSA_PKCS_OAEP_PARAMS_PTR, } -#[test] -fn bindgen_test_layout_CK_RSA_AES_KEY_WRAP_PARAMS() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 12usize, - concat!("Size of: ", stringify!(CK_RSA_AES_KEY_WRAP_PARAMS)) - ); - assert_eq!( - ::std::mem::align_of::(), - 1usize, - concat!("Alignment of ", stringify!(CK_RSA_AES_KEY_WRAP_PARAMS)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulAESKeyBits) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(CK_RSA_AES_KEY_WRAP_PARAMS), - "::", - stringify!(ulAESKeyBits) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pOAEPParams) as usize - ptr as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(CK_RSA_AES_KEY_WRAP_PARAMS), - "::", - stringify!(pOAEPParams) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of CK_RSA_AES_KEY_WRAP_PARAMS"] + [::std::mem::size_of::() - 12usize]; + ["Alignment of CK_RSA_AES_KEY_WRAP_PARAMS"] + [::std::mem::align_of::() - 1usize]; + ["Offset of field: CK_RSA_AES_KEY_WRAP_PARAMS::ulAESKeyBits"] + [::std::mem::offset_of!(CK_RSA_AES_KEY_WRAP_PARAMS, ulAESKeyBits) - 0usize]; + ["Offset of field: CK_RSA_AES_KEY_WRAP_PARAMS::pOAEPParams"] + [::std::mem::offset_of!(CK_RSA_AES_KEY_WRAP_PARAMS, pOAEPParams) - 4usize]; +}; impl Default for CK_RSA_AES_KEY_WRAP_PARAMS { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); @@ -6214,55 +3069,19 @@ pub struct CK_TLS12_MASTER_KEY_DERIVE_PARAMS { pub pVersion: CK_VERSION_PTR, pub prfHashMechanism: CK_MECHANISM_TYPE, } -#[test] -fn bindgen_test_layout_CK_TLS12_MASTER_KEY_DERIVE_PARAMS() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 36usize, - concat!("Size of: ", stringify!(CK_TLS12_MASTER_KEY_DERIVE_PARAMS)) - ); - assert_eq!( - ::std::mem::align_of::(), - 1usize, - concat!( - "Alignment of ", - stringify!(CK_TLS12_MASTER_KEY_DERIVE_PARAMS) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).RandomInfo) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(CK_TLS12_MASTER_KEY_DERIVE_PARAMS), - "::", - stringify!(RandomInfo) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pVersion) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(CK_TLS12_MASTER_KEY_DERIVE_PARAMS), - "::", - stringify!(pVersion) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).prfHashMechanism) as usize - ptr as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(CK_TLS12_MASTER_KEY_DERIVE_PARAMS), - "::", - stringify!(prfHashMechanism) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of CK_TLS12_MASTER_KEY_DERIVE_PARAMS"] + [::std::mem::size_of::() - 36usize]; + ["Alignment of CK_TLS12_MASTER_KEY_DERIVE_PARAMS"] + [::std::mem::align_of::() - 1usize]; + ["Offset of field: CK_TLS12_MASTER_KEY_DERIVE_PARAMS::RandomInfo"] + [::std::mem::offset_of!(CK_TLS12_MASTER_KEY_DERIVE_PARAMS, RandomInfo) - 0usize]; + ["Offset of field: CK_TLS12_MASTER_KEY_DERIVE_PARAMS::pVersion"] + [::std::mem::offset_of!(CK_TLS12_MASTER_KEY_DERIVE_PARAMS, pVersion) - 24usize]; + ["Offset of field: CK_TLS12_MASTER_KEY_DERIVE_PARAMS::prfHashMechanism"] + [::std::mem::offset_of!(CK_TLS12_MASTER_KEY_DERIVE_PARAMS, prfHashMechanism) - 32usize]; +}; impl Default for CK_TLS12_MASTER_KEY_DERIVE_PARAMS { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); @@ -6284,92 +3103,26 @@ pub struct CK_TLS12_KEY_MAT_PARAMS { pub pReturnedKeyMaterial: CK_SSL3_KEY_MAT_OUT_PTR, pub prfHashMechanism: CK_MECHANISM_TYPE, } -#[test] -fn bindgen_test_layout_CK_TLS12_KEY_MAT_PARAMS() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 49usize, - concat!("Size of: ", stringify!(CK_TLS12_KEY_MAT_PARAMS)) - ); - assert_eq!( - ::std::mem::align_of::(), - 1usize, - concat!("Alignment of ", stringify!(CK_TLS12_KEY_MAT_PARAMS)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulMacSizeInBits) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(CK_TLS12_KEY_MAT_PARAMS), - "::", - stringify!(ulMacSizeInBits) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulKeySizeInBits) as usize - ptr as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(CK_TLS12_KEY_MAT_PARAMS), - "::", - stringify!(ulKeySizeInBits) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulIVSizeInBits) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(CK_TLS12_KEY_MAT_PARAMS), - "::", - stringify!(ulIVSizeInBits) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).bIsExport) as usize - ptr as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(CK_TLS12_KEY_MAT_PARAMS), - "::", - stringify!(bIsExport) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).RandomInfo) as usize - ptr as usize }, - 13usize, - concat!( - "Offset of field: ", - stringify!(CK_TLS12_KEY_MAT_PARAMS), - "::", - stringify!(RandomInfo) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pReturnedKeyMaterial) as usize - ptr as usize }, - 37usize, - concat!( - "Offset of field: ", - stringify!(CK_TLS12_KEY_MAT_PARAMS), - "::", - stringify!(pReturnedKeyMaterial) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).prfHashMechanism) as usize - ptr as usize }, - 45usize, - concat!( - "Offset of field: ", - stringify!(CK_TLS12_KEY_MAT_PARAMS), - "::", - stringify!(prfHashMechanism) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of CK_TLS12_KEY_MAT_PARAMS"][::std::mem::size_of::() - 49usize]; + ["Alignment of CK_TLS12_KEY_MAT_PARAMS"] + [::std::mem::align_of::() - 1usize]; + ["Offset of field: CK_TLS12_KEY_MAT_PARAMS::ulMacSizeInBits"] + [::std::mem::offset_of!(CK_TLS12_KEY_MAT_PARAMS, ulMacSizeInBits) - 0usize]; + ["Offset of field: CK_TLS12_KEY_MAT_PARAMS::ulKeySizeInBits"] + [::std::mem::offset_of!(CK_TLS12_KEY_MAT_PARAMS, ulKeySizeInBits) - 4usize]; + ["Offset of field: CK_TLS12_KEY_MAT_PARAMS::ulIVSizeInBits"] + [::std::mem::offset_of!(CK_TLS12_KEY_MAT_PARAMS, ulIVSizeInBits) - 8usize]; + ["Offset of field: CK_TLS12_KEY_MAT_PARAMS::bIsExport"] + [::std::mem::offset_of!(CK_TLS12_KEY_MAT_PARAMS, bIsExport) - 12usize]; + ["Offset of field: CK_TLS12_KEY_MAT_PARAMS::RandomInfo"] + [::std::mem::offset_of!(CK_TLS12_KEY_MAT_PARAMS, RandomInfo) - 13usize]; + ["Offset of field: CK_TLS12_KEY_MAT_PARAMS::pReturnedKeyMaterial"] + [::std::mem::offset_of!(CK_TLS12_KEY_MAT_PARAMS, pReturnedKeyMaterial) - 37usize]; + ["Offset of field: CK_TLS12_KEY_MAT_PARAMS::prfHashMechanism"] + [::std::mem::offset_of!(CK_TLS12_KEY_MAT_PARAMS, prfHashMechanism) - 45usize]; +}; impl Default for CK_TLS12_KEY_MAT_PARAMS { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); @@ -6390,81 +3143,23 @@ pub struct CK_TLS_KDF_PARAMS { pub pContextData: CK_BYTE_PTR, pub ulContextDataLength: CK_ULONG, } -#[test] -fn bindgen_test_layout_CK_TLS_KDF_PARAMS() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 52usize, - concat!("Size of: ", stringify!(CK_TLS_KDF_PARAMS)) - ); - assert_eq!( - ::std::mem::align_of::(), - 1usize, - concat!("Alignment of ", stringify!(CK_TLS_KDF_PARAMS)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).prfMechanism) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(CK_TLS_KDF_PARAMS), - "::", - stringify!(prfMechanism) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pLabel) as usize - ptr as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(CK_TLS_KDF_PARAMS), - "::", - stringify!(pLabel) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulLabelLength) as usize - ptr as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(CK_TLS_KDF_PARAMS), - "::", - stringify!(ulLabelLength) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).RandomInfo) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(CK_TLS_KDF_PARAMS), - "::", - stringify!(RandomInfo) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pContextData) as usize - ptr as usize }, - 40usize, - concat!( - "Offset of field: ", - stringify!(CK_TLS_KDF_PARAMS), - "::", - stringify!(pContextData) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulContextDataLength) as usize - ptr as usize }, - 48usize, - concat!( - "Offset of field: ", - stringify!(CK_TLS_KDF_PARAMS), - "::", - stringify!(ulContextDataLength) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of CK_TLS_KDF_PARAMS"][::std::mem::size_of::() - 52usize]; + ["Alignment of CK_TLS_KDF_PARAMS"][::std::mem::align_of::() - 1usize]; + ["Offset of field: CK_TLS_KDF_PARAMS::prfMechanism"] + [::std::mem::offset_of!(CK_TLS_KDF_PARAMS, prfMechanism) - 0usize]; + ["Offset of field: CK_TLS_KDF_PARAMS::pLabel"] + [::std::mem::offset_of!(CK_TLS_KDF_PARAMS, pLabel) - 4usize]; + ["Offset of field: CK_TLS_KDF_PARAMS::ulLabelLength"] + [::std::mem::offset_of!(CK_TLS_KDF_PARAMS, ulLabelLength) - 12usize]; + ["Offset of field: CK_TLS_KDF_PARAMS::RandomInfo"] + [::std::mem::offset_of!(CK_TLS_KDF_PARAMS, RandomInfo) - 16usize]; + ["Offset of field: CK_TLS_KDF_PARAMS::pContextData"] + [::std::mem::offset_of!(CK_TLS_KDF_PARAMS, pContextData) - 40usize]; + ["Offset of field: CK_TLS_KDF_PARAMS::ulContextDataLength"] + [::std::mem::offset_of!(CK_TLS_KDF_PARAMS, ulContextDataLength) - 48usize]; +}; impl Default for CK_TLS_KDF_PARAMS { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); @@ -6482,51 +3177,17 @@ pub struct CK_TLS_MAC_PARAMS { pub ulMacLength: CK_ULONG, pub ulServerOrClient: CK_ULONG, } -#[test] -fn bindgen_test_layout_CK_TLS_MAC_PARAMS() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 12usize, - concat!("Size of: ", stringify!(CK_TLS_MAC_PARAMS)) - ); - assert_eq!( - ::std::mem::align_of::(), - 1usize, - concat!("Alignment of ", stringify!(CK_TLS_MAC_PARAMS)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).prfHashMechanism) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(CK_TLS_MAC_PARAMS), - "::", - stringify!(prfHashMechanism) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulMacLength) as usize - ptr as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(CK_TLS_MAC_PARAMS), - "::", - stringify!(ulMacLength) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulServerOrClient) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(CK_TLS_MAC_PARAMS), - "::", - stringify!(ulServerOrClient) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of CK_TLS_MAC_PARAMS"][::std::mem::size_of::() - 12usize]; + ["Alignment of CK_TLS_MAC_PARAMS"][::std::mem::align_of::() - 1usize]; + ["Offset of field: CK_TLS_MAC_PARAMS::prfHashMechanism"] + [::std::mem::offset_of!(CK_TLS_MAC_PARAMS, prfHashMechanism) - 0usize]; + ["Offset of field: CK_TLS_MAC_PARAMS::ulMacLength"] + [::std::mem::offset_of!(CK_TLS_MAC_PARAMS, ulMacLength) - 4usize]; + ["Offset of field: CK_TLS_MAC_PARAMS::ulServerOrClient"] + [::std::mem::offset_of!(CK_TLS_MAC_PARAMS, ulServerOrClient) - 8usize]; +}; pub type CK_TLS_MAC_PARAMS_PTR = *mut CK_TLS_MAC_PARAMS; #[repr(C, packed)] #[derive(Debug, Copy, Clone)] @@ -6537,72 +3198,23 @@ pub struct CK_GOSTR3410_DERIVE_PARAMS { pub pUKM: CK_BYTE_PTR, pub ulUKMLen: CK_ULONG, } -#[test] -fn bindgen_test_layout_CK_GOSTR3410_DERIVE_PARAMS() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 28usize, - concat!("Size of: ", stringify!(CK_GOSTR3410_DERIVE_PARAMS)) - ); - assert_eq!( - ::std::mem::align_of::(), - 1usize, - concat!("Alignment of ", stringify!(CK_GOSTR3410_DERIVE_PARAMS)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).kdf) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(CK_GOSTR3410_DERIVE_PARAMS), - "::", - stringify!(kdf) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pPublicData) as usize - ptr as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(CK_GOSTR3410_DERIVE_PARAMS), - "::", - stringify!(pPublicData) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulPublicDataLen) as usize - ptr as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(CK_GOSTR3410_DERIVE_PARAMS), - "::", - stringify!(ulPublicDataLen) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pUKM) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(CK_GOSTR3410_DERIVE_PARAMS), - "::", - stringify!(pUKM) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulUKMLen) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(CK_GOSTR3410_DERIVE_PARAMS), - "::", - stringify!(ulUKMLen) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of CK_GOSTR3410_DERIVE_PARAMS"] + [::std::mem::size_of::() - 28usize]; + ["Alignment of CK_GOSTR3410_DERIVE_PARAMS"] + [::std::mem::align_of::() - 1usize]; + ["Offset of field: CK_GOSTR3410_DERIVE_PARAMS::kdf"] + [::std::mem::offset_of!(CK_GOSTR3410_DERIVE_PARAMS, kdf) - 0usize]; + ["Offset of field: CK_GOSTR3410_DERIVE_PARAMS::pPublicData"] + [::std::mem::offset_of!(CK_GOSTR3410_DERIVE_PARAMS, pPublicData) - 4usize]; + ["Offset of field: CK_GOSTR3410_DERIVE_PARAMS::ulPublicDataLen"] + [::std::mem::offset_of!(CK_GOSTR3410_DERIVE_PARAMS, ulPublicDataLen) - 12usize]; + ["Offset of field: CK_GOSTR3410_DERIVE_PARAMS::pUKM"] + [::std::mem::offset_of!(CK_GOSTR3410_DERIVE_PARAMS, pUKM) - 16usize]; + ["Offset of field: CK_GOSTR3410_DERIVE_PARAMS::ulUKMLen"] + [::std::mem::offset_of!(CK_GOSTR3410_DERIVE_PARAMS, ulUKMLen) - 24usize]; +}; impl Default for CK_GOSTR3410_DERIVE_PARAMS { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); @@ -6622,72 +3234,23 @@ pub struct CK_GOSTR3410_KEY_WRAP_PARAMS { pub ulUKMLen: CK_ULONG, pub hKey: CK_OBJECT_HANDLE, } -#[test] -fn bindgen_test_layout_CK_GOSTR3410_KEY_WRAP_PARAMS() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 28usize, - concat!("Size of: ", stringify!(CK_GOSTR3410_KEY_WRAP_PARAMS)) - ); - assert_eq!( - ::std::mem::align_of::(), - 1usize, - concat!("Alignment of ", stringify!(CK_GOSTR3410_KEY_WRAP_PARAMS)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pWrapOID) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(CK_GOSTR3410_KEY_WRAP_PARAMS), - "::", - stringify!(pWrapOID) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulWrapOIDLen) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(CK_GOSTR3410_KEY_WRAP_PARAMS), - "::", - stringify!(ulWrapOIDLen) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pUKM) as usize - ptr as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(CK_GOSTR3410_KEY_WRAP_PARAMS), - "::", - stringify!(pUKM) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulUKMLen) as usize - ptr as usize }, - 20usize, - concat!( - "Offset of field: ", - stringify!(CK_GOSTR3410_KEY_WRAP_PARAMS), - "::", - stringify!(ulUKMLen) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).hKey) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(CK_GOSTR3410_KEY_WRAP_PARAMS), - "::", - stringify!(hKey) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of CK_GOSTR3410_KEY_WRAP_PARAMS"] + [::std::mem::size_of::() - 28usize]; + ["Alignment of CK_GOSTR3410_KEY_WRAP_PARAMS"] + [::std::mem::align_of::() - 1usize]; + ["Offset of field: CK_GOSTR3410_KEY_WRAP_PARAMS::pWrapOID"] + [::std::mem::offset_of!(CK_GOSTR3410_KEY_WRAP_PARAMS, pWrapOID) - 0usize]; + ["Offset of field: CK_GOSTR3410_KEY_WRAP_PARAMS::ulWrapOIDLen"] + [::std::mem::offset_of!(CK_GOSTR3410_KEY_WRAP_PARAMS, ulWrapOIDLen) - 8usize]; + ["Offset of field: CK_GOSTR3410_KEY_WRAP_PARAMS::pUKM"] + [::std::mem::offset_of!(CK_GOSTR3410_KEY_WRAP_PARAMS, pUKM) - 12usize]; + ["Offset of field: CK_GOSTR3410_KEY_WRAP_PARAMS::ulUKMLen"] + [::std::mem::offset_of!(CK_GOSTR3410_KEY_WRAP_PARAMS, ulUKMLen) - 20usize]; + ["Offset of field: CK_GOSTR3410_KEY_WRAP_PARAMS::hKey"] + [::std::mem::offset_of!(CK_GOSTR3410_KEY_WRAP_PARAMS, hKey) - 24usize]; +}; impl Default for CK_GOSTR3410_KEY_WRAP_PARAMS { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); @@ -6705,52 +3268,19 @@ pub struct CK_SEED_CBC_ENCRYPT_DATA_PARAMS { pub pData: CK_BYTE_PTR, pub length: CK_ULONG, } -#[test] -fn bindgen_test_layout_CK_SEED_CBC_ENCRYPT_DATA_PARAMS() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 28usize, - concat!("Size of: ", stringify!(CK_SEED_CBC_ENCRYPT_DATA_PARAMS)) - ); - assert_eq!( - ::std::mem::align_of::(), - 1usize, - concat!("Alignment of ", stringify!(CK_SEED_CBC_ENCRYPT_DATA_PARAMS)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).iv) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(CK_SEED_CBC_ENCRYPT_DATA_PARAMS), - "::", - stringify!(iv) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pData) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(CK_SEED_CBC_ENCRYPT_DATA_PARAMS), - "::", - stringify!(pData) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).length) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(CK_SEED_CBC_ENCRYPT_DATA_PARAMS), - "::", - stringify!(length) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of CK_SEED_CBC_ENCRYPT_DATA_PARAMS"] + [::std::mem::size_of::() - 28usize]; + ["Alignment of CK_SEED_CBC_ENCRYPT_DATA_PARAMS"] + [::std::mem::align_of::() - 1usize]; + ["Offset of field: CK_SEED_CBC_ENCRYPT_DATA_PARAMS::iv"] + [::std::mem::offset_of!(CK_SEED_CBC_ENCRYPT_DATA_PARAMS, iv) - 0usize]; + ["Offset of field: CK_SEED_CBC_ENCRYPT_DATA_PARAMS::pData"] + [::std::mem::offset_of!(CK_SEED_CBC_ENCRYPT_DATA_PARAMS, pData) - 16usize]; + ["Offset of field: CK_SEED_CBC_ENCRYPT_DATA_PARAMS::length"] + [::std::mem::offset_of!(CK_SEED_CBC_ENCRYPT_DATA_PARAMS, length) - 24usize]; +}; impl Default for CK_SEED_CBC_ENCRYPT_DATA_PARAMS { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); @@ -6772,51 +3302,17 @@ pub struct CK_PRF_DATA_PARAM { pub pValue: CK_VOID_PTR, pub ulValueLen: CK_ULONG, } -#[test] -fn bindgen_test_layout_CK_PRF_DATA_PARAM() { - 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!(CK_PRF_DATA_PARAM)) - ); - assert_eq!( - ::std::mem::align_of::(), - 1usize, - concat!("Alignment of ", stringify!(CK_PRF_DATA_PARAM)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).type_) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(CK_PRF_DATA_PARAM), - "::", - stringify!(type_) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pValue) as usize - ptr as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(CK_PRF_DATA_PARAM), - "::", - stringify!(pValue) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulValueLen) as usize - ptr as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(CK_PRF_DATA_PARAM), - "::", - stringify!(ulValueLen) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of CK_PRF_DATA_PARAM"][::std::mem::size_of::() - 16usize]; + ["Alignment of CK_PRF_DATA_PARAM"][::std::mem::align_of::() - 1usize]; + ["Offset of field: CK_PRF_DATA_PARAM::type_"] + [::std::mem::offset_of!(CK_PRF_DATA_PARAM, type_) - 0usize]; + ["Offset of field: CK_PRF_DATA_PARAM::pValue"] + [::std::mem::offset_of!(CK_PRF_DATA_PARAM, pValue) - 4usize]; + ["Offset of field: CK_PRF_DATA_PARAM::ulValueLen"] + [::std::mem::offset_of!(CK_PRF_DATA_PARAM, ulValueLen) - 12usize]; +}; impl Default for CK_PRF_DATA_PARAM { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); @@ -6833,42 +3329,17 @@ pub struct CK_SP800_108_COUNTER_FORMAT { pub bLittleEndian: CK_BBOOL, pub ulWidthInBits: CK_ULONG, } -#[test] -fn bindgen_test_layout_CK_SP800_108_COUNTER_FORMAT() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 5usize, - concat!("Size of: ", stringify!(CK_SP800_108_COUNTER_FORMAT)) - ); - assert_eq!( - ::std::mem::align_of::(), - 1usize, - concat!("Alignment of ", stringify!(CK_SP800_108_COUNTER_FORMAT)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).bLittleEndian) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(CK_SP800_108_COUNTER_FORMAT), - "::", - stringify!(bLittleEndian) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulWidthInBits) as usize - ptr as usize }, - 1usize, - concat!( - "Offset of field: ", - stringify!(CK_SP800_108_COUNTER_FORMAT), - "::", - stringify!(ulWidthInBits) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of CK_SP800_108_COUNTER_FORMAT"] + [::std::mem::size_of::() - 5usize]; + ["Alignment of CK_SP800_108_COUNTER_FORMAT"] + [::std::mem::align_of::() - 1usize]; + ["Offset of field: CK_SP800_108_COUNTER_FORMAT::bLittleEndian"] + [::std::mem::offset_of!(CK_SP800_108_COUNTER_FORMAT, bLittleEndian) - 0usize]; + ["Offset of field: CK_SP800_108_COUNTER_FORMAT::ulWidthInBits"] + [::std::mem::offset_of!(CK_SP800_108_COUNTER_FORMAT, ulWidthInBits) - 1usize]; +}; pub type CK_SP800_108_COUNTER_FORMAT_PTR = *mut CK_SP800_108_COUNTER_FORMAT; pub type CK_SP800_108_DKM_LENGTH_METHOD = CK_ULONG; #[repr(C, packed)] @@ -6878,52 +3349,19 @@ pub struct CK_SP800_108_DKM_LENGTH_FORMAT { pub bLittleEndian: CK_BBOOL, pub ulWidthInBits: CK_ULONG, } -#[test] -fn bindgen_test_layout_CK_SP800_108_DKM_LENGTH_FORMAT() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 9usize, - concat!("Size of: ", stringify!(CK_SP800_108_DKM_LENGTH_FORMAT)) - ); - assert_eq!( - ::std::mem::align_of::(), - 1usize, - concat!("Alignment of ", stringify!(CK_SP800_108_DKM_LENGTH_FORMAT)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).dkmLengthMethod) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(CK_SP800_108_DKM_LENGTH_FORMAT), - "::", - stringify!(dkmLengthMethod) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).bLittleEndian) as usize - ptr as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(CK_SP800_108_DKM_LENGTH_FORMAT), - "::", - stringify!(bLittleEndian) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulWidthInBits) as usize - ptr as usize }, - 5usize, - concat!( - "Offset of field: ", - stringify!(CK_SP800_108_DKM_LENGTH_FORMAT), - "::", - stringify!(ulWidthInBits) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of CK_SP800_108_DKM_LENGTH_FORMAT"] + [::std::mem::size_of::() - 9usize]; + ["Alignment of CK_SP800_108_DKM_LENGTH_FORMAT"] + [::std::mem::align_of::() - 1usize]; + ["Offset of field: CK_SP800_108_DKM_LENGTH_FORMAT::dkmLengthMethod"] + [::std::mem::offset_of!(CK_SP800_108_DKM_LENGTH_FORMAT, dkmLengthMethod) - 0usize]; + ["Offset of field: CK_SP800_108_DKM_LENGTH_FORMAT::bLittleEndian"] + [::std::mem::offset_of!(CK_SP800_108_DKM_LENGTH_FORMAT, bLittleEndian) - 4usize]; + ["Offset of field: CK_SP800_108_DKM_LENGTH_FORMAT::ulWidthInBits"] + [::std::mem::offset_of!(CK_SP800_108_DKM_LENGTH_FORMAT, ulWidthInBits) - 5usize]; +}; pub type CK_SP800_108_DKM_LENGTH_FORMAT_PTR = *mut CK_SP800_108_DKM_LENGTH_FORMAT; #[repr(C, packed)] #[derive(Debug, Copy, Clone)] @@ -6932,51 +3370,17 @@ pub struct CK_DERIVED_KEY { pub ulAttributeCount: CK_ULONG, pub phKey: CK_OBJECT_HANDLE_PTR, } -#[test] -fn bindgen_test_layout_CK_DERIVED_KEY() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 20usize, - concat!("Size of: ", stringify!(CK_DERIVED_KEY)) - ); - assert_eq!( - ::std::mem::align_of::(), - 1usize, - concat!("Alignment of ", stringify!(CK_DERIVED_KEY)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pTemplate) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(CK_DERIVED_KEY), - "::", - stringify!(pTemplate) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulAttributeCount) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(CK_DERIVED_KEY), - "::", - stringify!(ulAttributeCount) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).phKey) as usize - ptr as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(CK_DERIVED_KEY), - "::", - stringify!(phKey) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of CK_DERIVED_KEY"][::std::mem::size_of::() - 20usize]; + ["Alignment of CK_DERIVED_KEY"][::std::mem::align_of::() - 1usize]; + ["Offset of field: CK_DERIVED_KEY::pTemplate"] + [::std::mem::offset_of!(CK_DERIVED_KEY, pTemplate) - 0usize]; + ["Offset of field: CK_DERIVED_KEY::ulAttributeCount"] + [::std::mem::offset_of!(CK_DERIVED_KEY, ulAttributeCount) - 8usize]; + ["Offset of field: CK_DERIVED_KEY::phKey"] + [::std::mem::offset_of!(CK_DERIVED_KEY, phKey) - 12usize]; +}; impl Default for CK_DERIVED_KEY { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); @@ -6996,72 +3400,22 @@ pub struct CK_SP800_108_KDF_PARAMS { pub ulAdditionalDerivedKeys: CK_ULONG, pub pAdditionalDerivedKeys: CK_DERIVED_KEY_PTR, } -#[test] -fn bindgen_test_layout_CK_SP800_108_KDF_PARAMS() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 28usize, - concat!("Size of: ", stringify!(CK_SP800_108_KDF_PARAMS)) - ); - assert_eq!( - ::std::mem::align_of::(), - 1usize, - concat!("Alignment of ", stringify!(CK_SP800_108_KDF_PARAMS)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).prfType) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(CK_SP800_108_KDF_PARAMS), - "::", - stringify!(prfType) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulNumberOfDataParams) as usize - ptr as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(CK_SP800_108_KDF_PARAMS), - "::", - stringify!(ulNumberOfDataParams) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pDataParams) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(CK_SP800_108_KDF_PARAMS), - "::", - stringify!(pDataParams) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulAdditionalDerivedKeys) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(CK_SP800_108_KDF_PARAMS), - "::", - stringify!(ulAdditionalDerivedKeys) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pAdditionalDerivedKeys) as usize - ptr as usize }, - 20usize, - concat!( - "Offset of field: ", - stringify!(CK_SP800_108_KDF_PARAMS), - "::", - stringify!(pAdditionalDerivedKeys) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of CK_SP800_108_KDF_PARAMS"][::std::mem::size_of::() - 28usize]; + ["Alignment of CK_SP800_108_KDF_PARAMS"] + [::std::mem::align_of::() - 1usize]; + ["Offset of field: CK_SP800_108_KDF_PARAMS::prfType"] + [::std::mem::offset_of!(CK_SP800_108_KDF_PARAMS, prfType) - 0usize]; + ["Offset of field: CK_SP800_108_KDF_PARAMS::ulNumberOfDataParams"] + [::std::mem::offset_of!(CK_SP800_108_KDF_PARAMS, ulNumberOfDataParams) - 4usize]; + ["Offset of field: CK_SP800_108_KDF_PARAMS::pDataParams"] + [::std::mem::offset_of!(CK_SP800_108_KDF_PARAMS, pDataParams) - 8usize]; + ["Offset of field: CK_SP800_108_KDF_PARAMS::ulAdditionalDerivedKeys"] + [::std::mem::offset_of!(CK_SP800_108_KDF_PARAMS, ulAdditionalDerivedKeys) - 16usize]; + ["Offset of field: CK_SP800_108_KDF_PARAMS::pAdditionalDerivedKeys"] + [::std::mem::offset_of!(CK_SP800_108_KDF_PARAMS, pAdditionalDerivedKeys) - 20usize]; +}; impl Default for CK_SP800_108_KDF_PARAMS { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); @@ -7083,95 +3437,31 @@ pub struct CK_SP800_108_FEEDBACK_KDF_PARAMS { pub ulAdditionalDerivedKeys: CK_ULONG, pub pAdditionalDerivedKeys: CK_DERIVED_KEY_PTR, } -#[test] -fn bindgen_test_layout_CK_SP800_108_FEEDBACK_KDF_PARAMS() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 40usize, - concat!("Size of: ", stringify!(CK_SP800_108_FEEDBACK_KDF_PARAMS)) - ); - assert_eq!( - ::std::mem::align_of::(), - 1usize, - concat!( - "Alignment of ", - stringify!(CK_SP800_108_FEEDBACK_KDF_PARAMS) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).prfType) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(CK_SP800_108_FEEDBACK_KDF_PARAMS), - "::", - stringify!(prfType) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulNumberOfDataParams) as usize - ptr as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(CK_SP800_108_FEEDBACK_KDF_PARAMS), - "::", - stringify!(ulNumberOfDataParams) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pDataParams) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(CK_SP800_108_FEEDBACK_KDF_PARAMS), - "::", - stringify!(pDataParams) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulIVLen) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(CK_SP800_108_FEEDBACK_KDF_PARAMS), - "::", - stringify!(ulIVLen) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pIV) as usize - ptr as usize }, - 20usize, - concat!( - "Offset of field: ", - stringify!(CK_SP800_108_FEEDBACK_KDF_PARAMS), - "::", - stringify!(pIV) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulAdditionalDerivedKeys) as usize - ptr as usize }, - 28usize, - concat!( - "Offset of field: ", - stringify!(CK_SP800_108_FEEDBACK_KDF_PARAMS), - "::", - stringify!(ulAdditionalDerivedKeys) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pAdditionalDerivedKeys) as usize - ptr as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(CK_SP800_108_FEEDBACK_KDF_PARAMS), - "::", - stringify!(pAdditionalDerivedKeys) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of CK_SP800_108_FEEDBACK_KDF_PARAMS"] + [::std::mem::size_of::() - 40usize]; + ["Alignment of CK_SP800_108_FEEDBACK_KDF_PARAMS"] + [::std::mem::align_of::() - 1usize]; + ["Offset of field: CK_SP800_108_FEEDBACK_KDF_PARAMS::prfType"] + [::std::mem::offset_of!(CK_SP800_108_FEEDBACK_KDF_PARAMS, prfType) - 0usize]; + ["Offset of field: CK_SP800_108_FEEDBACK_KDF_PARAMS::ulNumberOfDataParams"] + [::std::mem::offset_of!(CK_SP800_108_FEEDBACK_KDF_PARAMS, ulNumberOfDataParams) - 4usize]; + ["Offset of field: CK_SP800_108_FEEDBACK_KDF_PARAMS::pDataParams"] + [::std::mem::offset_of!(CK_SP800_108_FEEDBACK_KDF_PARAMS, pDataParams) - 8usize]; + ["Offset of field: CK_SP800_108_FEEDBACK_KDF_PARAMS::ulIVLen"] + [::std::mem::offset_of!(CK_SP800_108_FEEDBACK_KDF_PARAMS, ulIVLen) - 16usize]; + ["Offset of field: CK_SP800_108_FEEDBACK_KDF_PARAMS::pIV"] + [::std::mem::offset_of!(CK_SP800_108_FEEDBACK_KDF_PARAMS, pIV) - 20usize]; + ["Offset of field: CK_SP800_108_FEEDBACK_KDF_PARAMS::ulAdditionalDerivedKeys"][::std::mem::offset_of!( + CK_SP800_108_FEEDBACK_KDF_PARAMS, + ulAdditionalDerivedKeys + ) - 28usize]; + ["Offset of field: CK_SP800_108_FEEDBACK_KDF_PARAMS::pAdditionalDerivedKeys"][::std::mem::offset_of!( + CK_SP800_108_FEEDBACK_KDF_PARAMS, + pAdditionalDerivedKeys + ) - 32usize]; +}; impl Default for CK_SP800_108_FEEDBACK_KDF_PARAMS { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); @@ -7189,51 +3479,17 @@ pub struct CK_EDDSA_PARAMS { pub ulContextDataLen: CK_ULONG, pub pContextData: CK_BYTE_PTR, } -#[test] -fn bindgen_test_layout_CK_EDDSA_PARAMS() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 13usize, - concat!("Size of: ", stringify!(CK_EDDSA_PARAMS)) - ); - assert_eq!( - ::std::mem::align_of::(), - 1usize, - concat!("Alignment of ", stringify!(CK_EDDSA_PARAMS)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).phFlag) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(CK_EDDSA_PARAMS), - "::", - stringify!(phFlag) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulContextDataLen) as usize - ptr as usize }, - 1usize, - concat!( - "Offset of field: ", - stringify!(CK_EDDSA_PARAMS), - "::", - stringify!(ulContextDataLen) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pContextData) as usize - ptr as usize }, - 5usize, - concat!( - "Offset of field: ", - stringify!(CK_EDDSA_PARAMS), - "::", - stringify!(pContextData) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of CK_EDDSA_PARAMS"][::std::mem::size_of::() - 13usize]; + ["Alignment of CK_EDDSA_PARAMS"][::std::mem::align_of::() - 1usize]; + ["Offset of field: CK_EDDSA_PARAMS::phFlag"] + [::std::mem::offset_of!(CK_EDDSA_PARAMS, phFlag) - 0usize]; + ["Offset of field: CK_EDDSA_PARAMS::ulContextDataLen"] + [::std::mem::offset_of!(CK_EDDSA_PARAMS, ulContextDataLen) - 1usize]; + ["Offset of field: CK_EDDSA_PARAMS::pContextData"] + [::std::mem::offset_of!(CK_EDDSA_PARAMS, pContextData) - 5usize]; +}; impl Default for CK_EDDSA_PARAMS { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); @@ -7252,61 +3508,19 @@ pub struct CK_CHACHA20_PARAMS { pub pNonce: CK_BYTE_PTR, pub ulNonceBits: CK_ULONG, } -#[test] -fn bindgen_test_layout_CK_CHACHA20_PARAMS() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 24usize, - concat!("Size of: ", stringify!(CK_CHACHA20_PARAMS)) - ); - assert_eq!( - ::std::mem::align_of::(), - 1usize, - concat!("Alignment of ", stringify!(CK_CHACHA20_PARAMS)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pBlockCounter) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(CK_CHACHA20_PARAMS), - "::", - stringify!(pBlockCounter) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).blockCounterBits) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(CK_CHACHA20_PARAMS), - "::", - stringify!(blockCounterBits) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pNonce) as usize - ptr as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(CK_CHACHA20_PARAMS), - "::", - stringify!(pNonce) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulNonceBits) as usize - ptr as usize }, - 20usize, - concat!( - "Offset of field: ", - stringify!(CK_CHACHA20_PARAMS), - "::", - stringify!(ulNonceBits) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of CK_CHACHA20_PARAMS"][::std::mem::size_of::() - 24usize]; + ["Alignment of CK_CHACHA20_PARAMS"][::std::mem::align_of::() - 1usize]; + ["Offset of field: CK_CHACHA20_PARAMS::pBlockCounter"] + [::std::mem::offset_of!(CK_CHACHA20_PARAMS, pBlockCounter) - 0usize]; + ["Offset of field: CK_CHACHA20_PARAMS::blockCounterBits"] + [::std::mem::offset_of!(CK_CHACHA20_PARAMS, blockCounterBits) - 8usize]; + ["Offset of field: CK_CHACHA20_PARAMS::pNonce"] + [::std::mem::offset_of!(CK_CHACHA20_PARAMS, pNonce) - 12usize]; + ["Offset of field: CK_CHACHA20_PARAMS::ulNonceBits"] + [::std::mem::offset_of!(CK_CHACHA20_PARAMS, ulNonceBits) - 20usize]; +}; impl Default for CK_CHACHA20_PARAMS { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); @@ -7324,51 +3538,17 @@ pub struct CK_SALSA20_PARAMS { pub pNonce: CK_BYTE_PTR, pub ulNonceBits: CK_ULONG, } -#[test] -fn bindgen_test_layout_CK_SALSA20_PARAMS() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 20usize, - concat!("Size of: ", stringify!(CK_SALSA20_PARAMS)) - ); - assert_eq!( - ::std::mem::align_of::(), - 1usize, - concat!("Alignment of ", stringify!(CK_SALSA20_PARAMS)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pBlockCounter) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(CK_SALSA20_PARAMS), - "::", - stringify!(pBlockCounter) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pNonce) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(CK_SALSA20_PARAMS), - "::", - stringify!(pNonce) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulNonceBits) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(CK_SALSA20_PARAMS), - "::", - stringify!(ulNonceBits) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of CK_SALSA20_PARAMS"][::std::mem::size_of::() - 20usize]; + ["Alignment of CK_SALSA20_PARAMS"][::std::mem::align_of::() - 1usize]; + ["Offset of field: CK_SALSA20_PARAMS::pBlockCounter"] + [::std::mem::offset_of!(CK_SALSA20_PARAMS, pBlockCounter) - 0usize]; + ["Offset of field: CK_SALSA20_PARAMS::pNonce"] + [::std::mem::offset_of!(CK_SALSA20_PARAMS, pNonce) - 8usize]; + ["Offset of field: CK_SALSA20_PARAMS::ulNonceBits"] + [::std::mem::offset_of!(CK_SALSA20_PARAMS, ulNonceBits) - 16usize]; +}; impl Default for CK_SALSA20_PARAMS { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); @@ -7387,65 +3567,21 @@ pub struct CK_SALSA20_CHACHA20_POLY1305_PARAMS { pub pAAD: CK_BYTE_PTR, pub ulAADLen: CK_ULONG, } -#[test] -fn bindgen_test_layout_CK_SALSA20_CHACHA20_POLY1305_PARAMS() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 24usize, - concat!("Size of: ", stringify!(CK_SALSA20_CHACHA20_POLY1305_PARAMS)) - ); - assert_eq!( - ::std::mem::align_of::(), - 1usize, - concat!( - "Alignment of ", - stringify!(CK_SALSA20_CHACHA20_POLY1305_PARAMS) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pNonce) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(CK_SALSA20_CHACHA20_POLY1305_PARAMS), - "::", - stringify!(pNonce) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulNonceLen) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(CK_SALSA20_CHACHA20_POLY1305_PARAMS), - "::", - stringify!(ulNonceLen) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pAAD) as usize - ptr as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(CK_SALSA20_CHACHA20_POLY1305_PARAMS), - "::", - stringify!(pAAD) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulAADLen) as usize - ptr as usize }, - 20usize, - concat!( - "Offset of field: ", - stringify!(CK_SALSA20_CHACHA20_POLY1305_PARAMS), - "::", - stringify!(ulAADLen) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of CK_SALSA20_CHACHA20_POLY1305_PARAMS"] + [::std::mem::size_of::() - 24usize]; + ["Alignment of CK_SALSA20_CHACHA20_POLY1305_PARAMS"] + [::std::mem::align_of::() - 1usize]; + ["Offset of field: CK_SALSA20_CHACHA20_POLY1305_PARAMS::pNonce"] + [::std::mem::offset_of!(CK_SALSA20_CHACHA20_POLY1305_PARAMS, pNonce) - 0usize]; + ["Offset of field: CK_SALSA20_CHACHA20_POLY1305_PARAMS::ulNonceLen"] + [::std::mem::offset_of!(CK_SALSA20_CHACHA20_POLY1305_PARAMS, ulNonceLen) - 8usize]; + ["Offset of field: CK_SALSA20_CHACHA20_POLY1305_PARAMS::pAAD"] + [::std::mem::offset_of!(CK_SALSA20_CHACHA20_POLY1305_PARAMS, pAAD) - 12usize]; + ["Offset of field: CK_SALSA20_CHACHA20_POLY1305_PARAMS::ulAADLen"] + [::std::mem::offset_of!(CK_SALSA20_CHACHA20_POLY1305_PARAMS, ulAADLen) - 20usize]; +}; impl Default for CK_SALSA20_CHACHA20_POLY1305_PARAMS { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); @@ -7463,58 +3599,19 @@ pub struct CK_SALSA20_CHACHA20_POLY1305_MSG_PARAMS { pub ulNonceLen: CK_ULONG, pub pTag: CK_BYTE_PTR, } -#[test] -fn bindgen_test_layout_CK_SALSA20_CHACHA20_POLY1305_MSG_PARAMS() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 20usize, - concat!( - "Size of: ", - stringify!(CK_SALSA20_CHACHA20_POLY1305_MSG_PARAMS) - ) - ); - assert_eq!( - ::std::mem::align_of::(), - 1usize, - concat!( - "Alignment of ", - stringify!(CK_SALSA20_CHACHA20_POLY1305_MSG_PARAMS) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pNonce) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(CK_SALSA20_CHACHA20_POLY1305_MSG_PARAMS), - "::", - stringify!(pNonce) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulNonceLen) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(CK_SALSA20_CHACHA20_POLY1305_MSG_PARAMS), - "::", - stringify!(ulNonceLen) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pTag) as usize - ptr as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(CK_SALSA20_CHACHA20_POLY1305_MSG_PARAMS), - "::", - stringify!(pTag) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of CK_SALSA20_CHACHA20_POLY1305_MSG_PARAMS"] + [::std::mem::size_of::() - 20usize]; + ["Alignment of CK_SALSA20_CHACHA20_POLY1305_MSG_PARAMS"] + [::std::mem::align_of::() - 1usize]; + ["Offset of field: CK_SALSA20_CHACHA20_POLY1305_MSG_PARAMS::pNonce"] + [::std::mem::offset_of!(CK_SALSA20_CHACHA20_POLY1305_MSG_PARAMS, pNonce) - 0usize]; + ["Offset of field: CK_SALSA20_CHACHA20_POLY1305_MSG_PARAMS::ulNonceLen"] + [::std::mem::offset_of!(CK_SALSA20_CHACHA20_POLY1305_MSG_PARAMS, ulNonceLen) - 8usize]; + ["Offset of field: CK_SALSA20_CHACHA20_POLY1305_MSG_PARAMS::pTag"] + [::std::mem::offset_of!(CK_SALSA20_CHACHA20_POLY1305_MSG_PARAMS, pTag) - 12usize]; +}; impl Default for CK_SALSA20_CHACHA20_POLY1305_MSG_PARAMS { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); @@ -7538,92 +3635,26 @@ pub struct CK_X3DH_INITIATE_PARAMS { pub pOwn_identity: CK_OBJECT_HANDLE, pub pOwn_ephemeral: CK_OBJECT_HANDLE, } -#[test] -fn bindgen_test_layout_CK_X3DH_INITIATE_PARAMS() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 36usize, - concat!("Size of: ", stringify!(CK_X3DH_INITIATE_PARAMS)) - ); - assert_eq!( - ::std::mem::align_of::(), - 1usize, - concat!("Alignment of ", stringify!(CK_X3DH_INITIATE_PARAMS)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).kdf) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(CK_X3DH_INITIATE_PARAMS), - "::", - stringify!(kdf) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pPeer_identity) as usize - ptr as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(CK_X3DH_INITIATE_PARAMS), - "::", - stringify!(pPeer_identity) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pPeer_prekey) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(CK_X3DH_INITIATE_PARAMS), - "::", - stringify!(pPeer_prekey) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pPrekey_signature) as usize - ptr as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(CK_X3DH_INITIATE_PARAMS), - "::", - stringify!(pPrekey_signature) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pOnetime_key) as usize - ptr as usize }, - 20usize, - concat!( - "Offset of field: ", - stringify!(CK_X3DH_INITIATE_PARAMS), - "::", - stringify!(pOnetime_key) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pOwn_identity) as usize - ptr as usize }, - 28usize, - concat!( - "Offset of field: ", - stringify!(CK_X3DH_INITIATE_PARAMS), - "::", - stringify!(pOwn_identity) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pOwn_ephemeral) as usize - ptr as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(CK_X3DH_INITIATE_PARAMS), - "::", - stringify!(pOwn_ephemeral) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of CK_X3DH_INITIATE_PARAMS"][::std::mem::size_of::() - 36usize]; + ["Alignment of CK_X3DH_INITIATE_PARAMS"] + [::std::mem::align_of::() - 1usize]; + ["Offset of field: CK_X3DH_INITIATE_PARAMS::kdf"] + [::std::mem::offset_of!(CK_X3DH_INITIATE_PARAMS, kdf) - 0usize]; + ["Offset of field: CK_X3DH_INITIATE_PARAMS::pPeer_identity"] + [::std::mem::offset_of!(CK_X3DH_INITIATE_PARAMS, pPeer_identity) - 4usize]; + ["Offset of field: CK_X3DH_INITIATE_PARAMS::pPeer_prekey"] + [::std::mem::offset_of!(CK_X3DH_INITIATE_PARAMS, pPeer_prekey) - 8usize]; + ["Offset of field: CK_X3DH_INITIATE_PARAMS::pPrekey_signature"] + [::std::mem::offset_of!(CK_X3DH_INITIATE_PARAMS, pPrekey_signature) - 12usize]; + ["Offset of field: CK_X3DH_INITIATE_PARAMS::pOnetime_key"] + [::std::mem::offset_of!(CK_X3DH_INITIATE_PARAMS, pOnetime_key) - 20usize]; + ["Offset of field: CK_X3DH_INITIATE_PARAMS::pOwn_identity"] + [::std::mem::offset_of!(CK_X3DH_INITIATE_PARAMS, pOwn_identity) - 28usize]; + ["Offset of field: CK_X3DH_INITIATE_PARAMS::pOwn_ephemeral"] + [::std::mem::offset_of!(CK_X3DH_INITIATE_PARAMS, pOwn_ephemeral) - 32usize]; +}; impl Default for CK_X3DH_INITIATE_PARAMS { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); @@ -7643,82 +3674,24 @@ pub struct CK_X3DH_RESPOND_PARAMS { pub pInitiator_identity: CK_OBJECT_HANDLE, pub pInitiator_ephemeral: CK_BYTE_PTR, } -#[test] -fn bindgen_test_layout_CK_X3DH_RESPOND_PARAMS() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 40usize, - concat!("Size of: ", stringify!(CK_X3DH_RESPOND_PARAMS)) - ); - assert_eq!( - ::std::mem::align_of::(), - 1usize, - concat!("Alignment of ", stringify!(CK_X3DH_RESPOND_PARAMS)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).kdf) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(CK_X3DH_RESPOND_PARAMS), - "::", - stringify!(kdf) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pIdentity_id) as usize - ptr as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(CK_X3DH_RESPOND_PARAMS), - "::", - stringify!(pIdentity_id) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pPrekey_id) as usize - ptr as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(CK_X3DH_RESPOND_PARAMS), - "::", - stringify!(pPrekey_id) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pOnetime_id) as usize - ptr as usize }, - 20usize, - concat!( - "Offset of field: ", - stringify!(CK_X3DH_RESPOND_PARAMS), - "::", - stringify!(pOnetime_id) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pInitiator_identity) as usize - ptr as usize }, - 28usize, - concat!( - "Offset of field: ", - stringify!(CK_X3DH_RESPOND_PARAMS), - "::", - stringify!(pInitiator_identity) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pInitiator_ephemeral) as usize - ptr as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(CK_X3DH_RESPOND_PARAMS), - "::", - stringify!(pInitiator_ephemeral) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of CK_X3DH_RESPOND_PARAMS"][::std::mem::size_of::() - 40usize]; + ["Alignment of CK_X3DH_RESPOND_PARAMS"] + [::std::mem::align_of::() - 1usize]; + ["Offset of field: CK_X3DH_RESPOND_PARAMS::kdf"] + [::std::mem::offset_of!(CK_X3DH_RESPOND_PARAMS, kdf) - 0usize]; + ["Offset of field: CK_X3DH_RESPOND_PARAMS::pIdentity_id"] + [::std::mem::offset_of!(CK_X3DH_RESPOND_PARAMS, pIdentity_id) - 4usize]; + ["Offset of field: CK_X3DH_RESPOND_PARAMS::pPrekey_id"] + [::std::mem::offset_of!(CK_X3DH_RESPOND_PARAMS, pPrekey_id) - 12usize]; + ["Offset of field: CK_X3DH_RESPOND_PARAMS::pOnetime_id"] + [::std::mem::offset_of!(CK_X3DH_RESPOND_PARAMS, pOnetime_id) - 20usize]; + ["Offset of field: CK_X3DH_RESPOND_PARAMS::pInitiator_identity"] + [::std::mem::offset_of!(CK_X3DH_RESPOND_PARAMS, pInitiator_identity) - 28usize]; + ["Offset of field: CK_X3DH_RESPOND_PARAMS::pInitiator_ephemeral"] + [::std::mem::offset_of!(CK_X3DH_RESPOND_PARAMS, pInitiator_ephemeral) - 32usize]; +}; impl Default for CK_X3DH_RESPOND_PARAMS { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); @@ -7742,102 +3715,29 @@ pub struct CK_X2RATCHET_INITIALIZE_PARAMS { pub aeadMechanism: CK_MECHANISM_TYPE, pub kdfMechanism: CK_X2RATCHET_KDF_TYPE, } -#[test] -fn bindgen_test_layout_CK_X2RATCHET_INITIALIZE_PARAMS() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 33usize, - concat!("Size of: ", stringify!(CK_X2RATCHET_INITIALIZE_PARAMS)) - ); - assert_eq!( - ::std::mem::align_of::(), - 1usize, - concat!("Alignment of ", stringify!(CK_X2RATCHET_INITIALIZE_PARAMS)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).sk) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(CK_X2RATCHET_INITIALIZE_PARAMS), - "::", - stringify!(sk) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).peer_public_prekey) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(CK_X2RATCHET_INITIALIZE_PARAMS), - "::", - stringify!(peer_public_prekey) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).peer_public_identity) as usize - ptr as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(CK_X2RATCHET_INITIALIZE_PARAMS), - "::", - stringify!(peer_public_identity) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).own_public_identity) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(CK_X2RATCHET_INITIALIZE_PARAMS), - "::", - stringify!(own_public_identity) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).bEncryptedHeader) as usize - ptr as usize }, - 20usize, - concat!( - "Offset of field: ", - stringify!(CK_X2RATCHET_INITIALIZE_PARAMS), - "::", - stringify!(bEncryptedHeader) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).eCurve) as usize - ptr as usize }, - 21usize, - concat!( - "Offset of field: ", - stringify!(CK_X2RATCHET_INITIALIZE_PARAMS), - "::", - stringify!(eCurve) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).aeadMechanism) as usize - ptr as usize }, - 25usize, - concat!( - "Offset of field: ", - stringify!(CK_X2RATCHET_INITIALIZE_PARAMS), - "::", - stringify!(aeadMechanism) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).kdfMechanism) as usize - ptr as usize }, - 29usize, - concat!( - "Offset of field: ", - stringify!(CK_X2RATCHET_INITIALIZE_PARAMS), - "::", - stringify!(kdfMechanism) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of CK_X2RATCHET_INITIALIZE_PARAMS"] + [::std::mem::size_of::() - 33usize]; + ["Alignment of CK_X2RATCHET_INITIALIZE_PARAMS"] + [::std::mem::align_of::() - 1usize]; + ["Offset of field: CK_X2RATCHET_INITIALIZE_PARAMS::sk"] + [::std::mem::offset_of!(CK_X2RATCHET_INITIALIZE_PARAMS, sk) - 0usize]; + ["Offset of field: CK_X2RATCHET_INITIALIZE_PARAMS::peer_public_prekey"] + [::std::mem::offset_of!(CK_X2RATCHET_INITIALIZE_PARAMS, peer_public_prekey) - 8usize]; + ["Offset of field: CK_X2RATCHET_INITIALIZE_PARAMS::peer_public_identity"] + [::std::mem::offset_of!(CK_X2RATCHET_INITIALIZE_PARAMS, peer_public_identity) - 12usize]; + ["Offset of field: CK_X2RATCHET_INITIALIZE_PARAMS::own_public_identity"] + [::std::mem::offset_of!(CK_X2RATCHET_INITIALIZE_PARAMS, own_public_identity) - 16usize]; + ["Offset of field: CK_X2RATCHET_INITIALIZE_PARAMS::bEncryptedHeader"] + [::std::mem::offset_of!(CK_X2RATCHET_INITIALIZE_PARAMS, bEncryptedHeader) - 20usize]; + ["Offset of field: CK_X2RATCHET_INITIALIZE_PARAMS::eCurve"] + [::std::mem::offset_of!(CK_X2RATCHET_INITIALIZE_PARAMS, eCurve) - 21usize]; + ["Offset of field: CK_X2RATCHET_INITIALIZE_PARAMS::aeadMechanism"] + [::std::mem::offset_of!(CK_X2RATCHET_INITIALIZE_PARAMS, aeadMechanism) - 25usize]; + ["Offset of field: CK_X2RATCHET_INITIALIZE_PARAMS::kdfMechanism"] + [::std::mem::offset_of!(CK_X2RATCHET_INITIALIZE_PARAMS, kdfMechanism) - 29usize]; +}; impl Default for CK_X2RATCHET_INITIALIZE_PARAMS { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); @@ -7860,102 +3760,29 @@ pub struct CK_X2RATCHET_RESPOND_PARAMS { pub aeadMechanism: CK_MECHANISM_TYPE, pub kdfMechanism: CK_X2RATCHET_KDF_TYPE, } -#[test] -fn bindgen_test_layout_CK_X2RATCHET_RESPOND_PARAMS() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 33usize, - concat!("Size of: ", stringify!(CK_X2RATCHET_RESPOND_PARAMS)) - ); - assert_eq!( - ::std::mem::align_of::(), - 1usize, - concat!("Alignment of ", stringify!(CK_X2RATCHET_RESPOND_PARAMS)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).sk) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(CK_X2RATCHET_RESPOND_PARAMS), - "::", - stringify!(sk) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).own_prekey) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(CK_X2RATCHET_RESPOND_PARAMS), - "::", - stringify!(own_prekey) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).initiator_identity) as usize - ptr as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(CK_X2RATCHET_RESPOND_PARAMS), - "::", - stringify!(initiator_identity) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).own_public_identity) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(CK_X2RATCHET_RESPOND_PARAMS), - "::", - stringify!(own_public_identity) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).bEncryptedHeader) as usize - ptr as usize }, - 20usize, - concat!( - "Offset of field: ", - stringify!(CK_X2RATCHET_RESPOND_PARAMS), - "::", - stringify!(bEncryptedHeader) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).eCurve) as usize - ptr as usize }, - 21usize, - concat!( - "Offset of field: ", - stringify!(CK_X2RATCHET_RESPOND_PARAMS), - "::", - stringify!(eCurve) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).aeadMechanism) as usize - ptr as usize }, - 25usize, - concat!( - "Offset of field: ", - stringify!(CK_X2RATCHET_RESPOND_PARAMS), - "::", - stringify!(aeadMechanism) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).kdfMechanism) as usize - ptr as usize }, - 29usize, - concat!( - "Offset of field: ", - stringify!(CK_X2RATCHET_RESPOND_PARAMS), - "::", - stringify!(kdfMechanism) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of CK_X2RATCHET_RESPOND_PARAMS"] + [::std::mem::size_of::() - 33usize]; + ["Alignment of CK_X2RATCHET_RESPOND_PARAMS"] + [::std::mem::align_of::() - 1usize]; + ["Offset of field: CK_X2RATCHET_RESPOND_PARAMS::sk"] + [::std::mem::offset_of!(CK_X2RATCHET_RESPOND_PARAMS, sk) - 0usize]; + ["Offset of field: CK_X2RATCHET_RESPOND_PARAMS::own_prekey"] + [::std::mem::offset_of!(CK_X2RATCHET_RESPOND_PARAMS, own_prekey) - 8usize]; + ["Offset of field: CK_X2RATCHET_RESPOND_PARAMS::initiator_identity"] + [::std::mem::offset_of!(CK_X2RATCHET_RESPOND_PARAMS, initiator_identity) - 12usize]; + ["Offset of field: CK_X2RATCHET_RESPOND_PARAMS::own_public_identity"] + [::std::mem::offset_of!(CK_X2RATCHET_RESPOND_PARAMS, own_public_identity) - 16usize]; + ["Offset of field: CK_X2RATCHET_RESPOND_PARAMS::bEncryptedHeader"] + [::std::mem::offset_of!(CK_X2RATCHET_RESPOND_PARAMS, bEncryptedHeader) - 20usize]; + ["Offset of field: CK_X2RATCHET_RESPOND_PARAMS::eCurve"] + [::std::mem::offset_of!(CK_X2RATCHET_RESPOND_PARAMS, eCurve) - 21usize]; + ["Offset of field: CK_X2RATCHET_RESPOND_PARAMS::aeadMechanism"] + [::std::mem::offset_of!(CK_X2RATCHET_RESPOND_PARAMS, aeadMechanism) - 25usize]; + ["Offset of field: CK_X2RATCHET_RESPOND_PARAMS::kdfMechanism"] + [::std::mem::offset_of!(CK_X2RATCHET_RESPOND_PARAMS, kdfMechanism) - 29usize]; +}; impl Default for CK_X2RATCHET_RESPOND_PARAMS { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); @@ -7973,31 +3800,13 @@ pub type CK_XEDDSA_HASH_TYPE_PTR = *mut CK_XEDDSA_HASH_TYPE; pub struct CK_XEDDSA_PARAMS { pub hash: CK_XEDDSA_HASH_TYPE, } -#[test] -fn bindgen_test_layout_CK_XEDDSA_PARAMS() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 4usize, - concat!("Size of: ", stringify!(CK_XEDDSA_PARAMS)) - ); - assert_eq!( - ::std::mem::align_of::(), - 1usize, - concat!("Alignment of ", stringify!(CK_XEDDSA_PARAMS)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).hash) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(CK_XEDDSA_PARAMS), - "::", - stringify!(hash) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of CK_XEDDSA_PARAMS"][::std::mem::size_of::() - 4usize]; + ["Alignment of CK_XEDDSA_PARAMS"][::std::mem::align_of::() - 1usize]; + ["Offset of field: CK_XEDDSA_PARAMS::hash"] + [::std::mem::offset_of!(CK_XEDDSA_PARAMS, hash) - 0usize]; +}; pub type CK_XEDDSA_PARAMS_PTR = *mut CK_XEDDSA_PARAMS; #[repr(C, packed)] #[derive(Debug, Copy, Clone)] @@ -8012,111 +3821,29 @@ pub struct CK_HKDF_PARAMS { pub pInfo: CK_BYTE_PTR, pub ulInfoLen: CK_ULONG, } -#[test] -fn bindgen_test_layout_CK_HKDF_PARAMS() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 38usize, - concat!("Size of: ", stringify!(CK_HKDF_PARAMS)) - ); - assert_eq!( - ::std::mem::align_of::(), - 1usize, - concat!("Alignment of ", stringify!(CK_HKDF_PARAMS)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).bExtract) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(CK_HKDF_PARAMS), - "::", - stringify!(bExtract) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).bExpand) as usize - ptr as usize }, - 1usize, - concat!( - "Offset of field: ", - stringify!(CK_HKDF_PARAMS), - "::", - stringify!(bExpand) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).prfHashMechanism) as usize - ptr as usize }, - 2usize, - concat!( - "Offset of field: ", - stringify!(CK_HKDF_PARAMS), - "::", - stringify!(prfHashMechanism) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulSaltType) as usize - ptr as usize }, - 6usize, - concat!( - "Offset of field: ", - stringify!(CK_HKDF_PARAMS), - "::", - stringify!(ulSaltType) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pSalt) as usize - ptr as usize }, - 10usize, - concat!( - "Offset of field: ", - stringify!(CK_HKDF_PARAMS), - "::", - stringify!(pSalt) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulSaltLen) as usize - ptr as usize }, - 18usize, - concat!( - "Offset of field: ", - stringify!(CK_HKDF_PARAMS), - "::", - stringify!(ulSaltLen) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).hSaltKey) as usize - ptr as usize }, - 22usize, - concat!( - "Offset of field: ", - stringify!(CK_HKDF_PARAMS), - "::", - stringify!(hSaltKey) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pInfo) as usize - ptr as usize }, - 26usize, - concat!( - "Offset of field: ", - stringify!(CK_HKDF_PARAMS), - "::", - stringify!(pInfo) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulInfoLen) as usize - ptr as usize }, - 34usize, - concat!( - "Offset of field: ", - stringify!(CK_HKDF_PARAMS), - "::", - stringify!(ulInfoLen) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of CK_HKDF_PARAMS"][::std::mem::size_of::() - 38usize]; + ["Alignment of CK_HKDF_PARAMS"][::std::mem::align_of::() - 1usize]; + ["Offset of field: CK_HKDF_PARAMS::bExtract"] + [::std::mem::offset_of!(CK_HKDF_PARAMS, bExtract) - 0usize]; + ["Offset of field: CK_HKDF_PARAMS::bExpand"] + [::std::mem::offset_of!(CK_HKDF_PARAMS, bExpand) - 1usize]; + ["Offset of field: CK_HKDF_PARAMS::prfHashMechanism"] + [::std::mem::offset_of!(CK_HKDF_PARAMS, prfHashMechanism) - 2usize]; + ["Offset of field: CK_HKDF_PARAMS::ulSaltType"] + [::std::mem::offset_of!(CK_HKDF_PARAMS, ulSaltType) - 6usize]; + ["Offset of field: CK_HKDF_PARAMS::pSalt"] + [::std::mem::offset_of!(CK_HKDF_PARAMS, pSalt) - 10usize]; + ["Offset of field: CK_HKDF_PARAMS::ulSaltLen"] + [::std::mem::offset_of!(CK_HKDF_PARAMS, ulSaltLen) - 18usize]; + ["Offset of field: CK_HKDF_PARAMS::hSaltKey"] + [::std::mem::offset_of!(CK_HKDF_PARAMS, hSaltKey) - 22usize]; + ["Offset of field: CK_HKDF_PARAMS::pInfo"] + [::std::mem::offset_of!(CK_HKDF_PARAMS, pInfo) - 26usize]; + ["Offset of field: CK_HKDF_PARAMS::ulInfoLen"] + [::std::mem::offset_of!(CK_HKDF_PARAMS, ulInfoLen) - 34usize]; +}; impl Default for CK_HKDF_PARAMS { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); @@ -8137,51 +3864,17 @@ pub struct specifiedParams { pub lm_type: [CK_LMS_TYPE; 8usize], pub lm_ots_type: [CK_LMOTS_TYPE; 8usize], } -#[test] -fn bindgen_test_layout_specifiedParams() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 68usize, - concat!("Size of: ", stringify!(specifiedParams)) - ); - assert_eq!( - ::std::mem::align_of::(), - 1usize, - concat!("Alignment of ", stringify!(specifiedParams)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).levels) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(specifiedParams), - "::", - stringify!(levels) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).lm_type) as usize - ptr as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(specifiedParams), - "::", - stringify!(lm_type) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).lm_ots_type) as usize - ptr as usize }, - 36usize, - concat!( - "Offset of field: ", - stringify!(specifiedParams), - "::", - stringify!(lm_ots_type) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of specifiedParams"][::std::mem::size_of::() - 68usize]; + ["Alignment of specifiedParams"][::std::mem::align_of::() - 1usize]; + ["Offset of field: specifiedParams::levels"] + [::std::mem::offset_of!(specifiedParams, levels) - 0usize]; + ["Offset of field: specifiedParams::lm_type"] + [::std::mem::offset_of!(specifiedParams, lm_type) - 4usize]; + ["Offset of field: specifiedParams::lm_ots_type"] + [::std::mem::offset_of!(specifiedParams, lm_ots_type) - 36usize]; +}; #[repr(C, packed)] #[derive(Debug, Copy, Clone)] pub struct CK_IKE2_PRF_PLUS_DERIVE_PARAMS { @@ -8191,72 +3884,23 @@ pub struct CK_IKE2_PRF_PLUS_DERIVE_PARAMS { pub pSeedData: CK_BYTE_PTR, pub ulSeedDataLen: CK_ULONG, } -#[test] -fn bindgen_test_layout_CK_IKE2_PRF_PLUS_DERIVE_PARAMS() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 21usize, - concat!("Size of: ", stringify!(CK_IKE2_PRF_PLUS_DERIVE_PARAMS)) - ); - assert_eq!( - ::std::mem::align_of::(), - 1usize, - concat!("Alignment of ", stringify!(CK_IKE2_PRF_PLUS_DERIVE_PARAMS)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).prfMechanism) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(CK_IKE2_PRF_PLUS_DERIVE_PARAMS), - "::", - stringify!(prfMechanism) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).bHasSeedKey) as usize - ptr as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(CK_IKE2_PRF_PLUS_DERIVE_PARAMS), - "::", - stringify!(bHasSeedKey) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).hSeedKey) as usize - ptr as usize }, - 5usize, - concat!( - "Offset of field: ", - stringify!(CK_IKE2_PRF_PLUS_DERIVE_PARAMS), - "::", - stringify!(hSeedKey) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pSeedData) as usize - ptr as usize }, - 9usize, - concat!( - "Offset of field: ", - stringify!(CK_IKE2_PRF_PLUS_DERIVE_PARAMS), - "::", - stringify!(pSeedData) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulSeedDataLen) as usize - ptr as usize }, - 17usize, - concat!( - "Offset of field: ", - stringify!(CK_IKE2_PRF_PLUS_DERIVE_PARAMS), - "::", - stringify!(ulSeedDataLen) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of CK_IKE2_PRF_PLUS_DERIVE_PARAMS"] + [::std::mem::size_of::() - 21usize]; + ["Alignment of CK_IKE2_PRF_PLUS_DERIVE_PARAMS"] + [::std::mem::align_of::() - 1usize]; + ["Offset of field: CK_IKE2_PRF_PLUS_DERIVE_PARAMS::prfMechanism"] + [::std::mem::offset_of!(CK_IKE2_PRF_PLUS_DERIVE_PARAMS, prfMechanism) - 0usize]; + ["Offset of field: CK_IKE2_PRF_PLUS_DERIVE_PARAMS::bHasSeedKey"] + [::std::mem::offset_of!(CK_IKE2_PRF_PLUS_DERIVE_PARAMS, bHasSeedKey) - 4usize]; + ["Offset of field: CK_IKE2_PRF_PLUS_DERIVE_PARAMS::hSeedKey"] + [::std::mem::offset_of!(CK_IKE2_PRF_PLUS_DERIVE_PARAMS, hSeedKey) - 5usize]; + ["Offset of field: CK_IKE2_PRF_PLUS_DERIVE_PARAMS::pSeedData"] + [::std::mem::offset_of!(CK_IKE2_PRF_PLUS_DERIVE_PARAMS, pSeedData) - 9usize]; + ["Offset of field: CK_IKE2_PRF_PLUS_DERIVE_PARAMS::ulSeedDataLen"] + [::std::mem::offset_of!(CK_IKE2_PRF_PLUS_DERIVE_PARAMS, ulSeedDataLen) - 17usize]; +}; impl Default for CK_IKE2_PRF_PLUS_DERIVE_PARAMS { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); @@ -8279,102 +3923,29 @@ pub struct CK_IKE_PRF_DERIVE_PARAMS { pub ulNrLen: CK_ULONG, pub hNewKey: CK_OBJECT_HANDLE, } -#[test] -fn bindgen_test_layout_CK_IKE_PRF_DERIVE_PARAMS() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 34usize, - concat!("Size of: ", stringify!(CK_IKE_PRF_DERIVE_PARAMS)) - ); - assert_eq!( - ::std::mem::align_of::(), - 1usize, - concat!("Alignment of ", stringify!(CK_IKE_PRF_DERIVE_PARAMS)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).prfMechanism) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(CK_IKE_PRF_DERIVE_PARAMS), - "::", - stringify!(prfMechanism) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).bDataAsKey) as usize - ptr as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(CK_IKE_PRF_DERIVE_PARAMS), - "::", - stringify!(bDataAsKey) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).bRekey) as usize - ptr as usize }, - 5usize, - concat!( - "Offset of field: ", - stringify!(CK_IKE_PRF_DERIVE_PARAMS), - "::", - stringify!(bRekey) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pNi) as usize - ptr as usize }, - 6usize, - concat!( - "Offset of field: ", - stringify!(CK_IKE_PRF_DERIVE_PARAMS), - "::", - stringify!(pNi) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulNiLen) as usize - ptr as usize }, - 14usize, - concat!( - "Offset of field: ", - stringify!(CK_IKE_PRF_DERIVE_PARAMS), - "::", - stringify!(ulNiLen) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pNr) as usize - ptr as usize }, - 18usize, - concat!( - "Offset of field: ", - stringify!(CK_IKE_PRF_DERIVE_PARAMS), - "::", - stringify!(pNr) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulNrLen) as usize - ptr as usize }, - 26usize, - concat!( - "Offset of field: ", - stringify!(CK_IKE_PRF_DERIVE_PARAMS), - "::", - stringify!(ulNrLen) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).hNewKey) as usize - ptr as usize }, - 30usize, - concat!( - "Offset of field: ", - stringify!(CK_IKE_PRF_DERIVE_PARAMS), - "::", - stringify!(hNewKey) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of CK_IKE_PRF_DERIVE_PARAMS"] + [::std::mem::size_of::() - 34usize]; + ["Alignment of CK_IKE_PRF_DERIVE_PARAMS"] + [::std::mem::align_of::() - 1usize]; + ["Offset of field: CK_IKE_PRF_DERIVE_PARAMS::prfMechanism"] + [::std::mem::offset_of!(CK_IKE_PRF_DERIVE_PARAMS, prfMechanism) - 0usize]; + ["Offset of field: CK_IKE_PRF_DERIVE_PARAMS::bDataAsKey"] + [::std::mem::offset_of!(CK_IKE_PRF_DERIVE_PARAMS, bDataAsKey) - 4usize]; + ["Offset of field: CK_IKE_PRF_DERIVE_PARAMS::bRekey"] + [::std::mem::offset_of!(CK_IKE_PRF_DERIVE_PARAMS, bRekey) - 5usize]; + ["Offset of field: CK_IKE_PRF_DERIVE_PARAMS::pNi"] + [::std::mem::offset_of!(CK_IKE_PRF_DERIVE_PARAMS, pNi) - 6usize]; + ["Offset of field: CK_IKE_PRF_DERIVE_PARAMS::ulNiLen"] + [::std::mem::offset_of!(CK_IKE_PRF_DERIVE_PARAMS, ulNiLen) - 14usize]; + ["Offset of field: CK_IKE_PRF_DERIVE_PARAMS::pNr"] + [::std::mem::offset_of!(CK_IKE_PRF_DERIVE_PARAMS, pNr) - 18usize]; + ["Offset of field: CK_IKE_PRF_DERIVE_PARAMS::ulNrLen"] + [::std::mem::offset_of!(CK_IKE_PRF_DERIVE_PARAMS, ulNrLen) - 26usize]; + ["Offset of field: CK_IKE_PRF_DERIVE_PARAMS::hNewKey"] + [::std::mem::offset_of!(CK_IKE_PRF_DERIVE_PARAMS, hNewKey) - 30usize]; +}; impl Default for CK_IKE_PRF_DERIVE_PARAMS { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); @@ -8398,112 +3969,31 @@ pub struct CK_IKE1_PRF_DERIVE_PARAMS { pub ulCKYrLen: CK_ULONG, pub keyNumber: CK_BYTE, } -#[test] -fn bindgen_test_layout_CK_IKE1_PRF_DERIVE_PARAMS() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 38usize, - concat!("Size of: ", stringify!(CK_IKE1_PRF_DERIVE_PARAMS)) - ); - assert_eq!( - ::std::mem::align_of::(), - 1usize, - concat!("Alignment of ", stringify!(CK_IKE1_PRF_DERIVE_PARAMS)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).prfMechanism) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(CK_IKE1_PRF_DERIVE_PARAMS), - "::", - stringify!(prfMechanism) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).bHasPrevKey) as usize - ptr as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(CK_IKE1_PRF_DERIVE_PARAMS), - "::", - stringify!(bHasPrevKey) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).hKeygxy) as usize - ptr as usize }, - 5usize, - concat!( - "Offset of field: ", - stringify!(CK_IKE1_PRF_DERIVE_PARAMS), - "::", - stringify!(hKeygxy) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).hPrevKey) as usize - ptr as usize }, - 9usize, - concat!( - "Offset of field: ", - stringify!(CK_IKE1_PRF_DERIVE_PARAMS), - "::", - stringify!(hPrevKey) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pCKYi) as usize - ptr as usize }, - 13usize, - concat!( - "Offset of field: ", - stringify!(CK_IKE1_PRF_DERIVE_PARAMS), - "::", - stringify!(pCKYi) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulCKYiLen) as usize - ptr as usize }, - 21usize, - concat!( - "Offset of field: ", - stringify!(CK_IKE1_PRF_DERIVE_PARAMS), - "::", - stringify!(ulCKYiLen) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pCKYr) as usize - ptr as usize }, - 25usize, - concat!( - "Offset of field: ", - stringify!(CK_IKE1_PRF_DERIVE_PARAMS), - "::", - stringify!(pCKYr) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulCKYrLen) as usize - ptr as usize }, - 33usize, - concat!( - "Offset of field: ", - stringify!(CK_IKE1_PRF_DERIVE_PARAMS), - "::", - stringify!(ulCKYrLen) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).keyNumber) as usize - ptr as usize }, - 37usize, - concat!( - "Offset of field: ", - stringify!(CK_IKE1_PRF_DERIVE_PARAMS), - "::", - stringify!(keyNumber) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of CK_IKE1_PRF_DERIVE_PARAMS"] + [::std::mem::size_of::() - 38usize]; + ["Alignment of CK_IKE1_PRF_DERIVE_PARAMS"] + [::std::mem::align_of::() - 1usize]; + ["Offset of field: CK_IKE1_PRF_DERIVE_PARAMS::prfMechanism"] + [::std::mem::offset_of!(CK_IKE1_PRF_DERIVE_PARAMS, prfMechanism) - 0usize]; + ["Offset of field: CK_IKE1_PRF_DERIVE_PARAMS::bHasPrevKey"] + [::std::mem::offset_of!(CK_IKE1_PRF_DERIVE_PARAMS, bHasPrevKey) - 4usize]; + ["Offset of field: CK_IKE1_PRF_DERIVE_PARAMS::hKeygxy"] + [::std::mem::offset_of!(CK_IKE1_PRF_DERIVE_PARAMS, hKeygxy) - 5usize]; + ["Offset of field: CK_IKE1_PRF_DERIVE_PARAMS::hPrevKey"] + [::std::mem::offset_of!(CK_IKE1_PRF_DERIVE_PARAMS, hPrevKey) - 9usize]; + ["Offset of field: CK_IKE1_PRF_DERIVE_PARAMS::pCKYi"] + [::std::mem::offset_of!(CK_IKE1_PRF_DERIVE_PARAMS, pCKYi) - 13usize]; + ["Offset of field: CK_IKE1_PRF_DERIVE_PARAMS::ulCKYiLen"] + [::std::mem::offset_of!(CK_IKE1_PRF_DERIVE_PARAMS, ulCKYiLen) - 21usize]; + ["Offset of field: CK_IKE1_PRF_DERIVE_PARAMS::pCKYr"] + [::std::mem::offset_of!(CK_IKE1_PRF_DERIVE_PARAMS, pCKYr) - 25usize]; + ["Offset of field: CK_IKE1_PRF_DERIVE_PARAMS::ulCKYrLen"] + [::std::mem::offset_of!(CK_IKE1_PRF_DERIVE_PARAMS, ulCKYrLen) - 33usize]; + ["Offset of field: CK_IKE1_PRF_DERIVE_PARAMS::keyNumber"] + [::std::mem::offset_of!(CK_IKE1_PRF_DERIVE_PARAMS, keyNumber) - 37usize]; +}; impl Default for CK_IKE1_PRF_DERIVE_PARAMS { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); @@ -8523,72 +4013,23 @@ pub struct CK_IKE1_EXTENDED_DERIVE_PARAMS { pub pExtraData: CK_BYTE_PTR, pub ulExtraDataLen: CK_ULONG, } -#[test] -fn bindgen_test_layout_CK_IKE1_EXTENDED_DERIVE_PARAMS() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 21usize, - concat!("Size of: ", stringify!(CK_IKE1_EXTENDED_DERIVE_PARAMS)) - ); - assert_eq!( - ::std::mem::align_of::(), - 1usize, - concat!("Alignment of ", stringify!(CK_IKE1_EXTENDED_DERIVE_PARAMS)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).prfMechanism) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(CK_IKE1_EXTENDED_DERIVE_PARAMS), - "::", - stringify!(prfMechanism) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).bHasKeygxy) as usize - ptr as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(CK_IKE1_EXTENDED_DERIVE_PARAMS), - "::", - stringify!(bHasKeygxy) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).hKeygxy) as usize - ptr as usize }, - 5usize, - concat!( - "Offset of field: ", - stringify!(CK_IKE1_EXTENDED_DERIVE_PARAMS), - "::", - stringify!(hKeygxy) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pExtraData) as usize - ptr as usize }, - 9usize, - concat!( - "Offset of field: ", - stringify!(CK_IKE1_EXTENDED_DERIVE_PARAMS), - "::", - stringify!(pExtraData) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulExtraDataLen) as usize - ptr as usize }, - 17usize, - concat!( - "Offset of field: ", - stringify!(CK_IKE1_EXTENDED_DERIVE_PARAMS), - "::", - stringify!(ulExtraDataLen) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of CK_IKE1_EXTENDED_DERIVE_PARAMS"] + [::std::mem::size_of::() - 21usize]; + ["Alignment of CK_IKE1_EXTENDED_DERIVE_PARAMS"] + [::std::mem::align_of::() - 1usize]; + ["Offset of field: CK_IKE1_EXTENDED_DERIVE_PARAMS::prfMechanism"] + [::std::mem::offset_of!(CK_IKE1_EXTENDED_DERIVE_PARAMS, prfMechanism) - 0usize]; + ["Offset of field: CK_IKE1_EXTENDED_DERIVE_PARAMS::bHasKeygxy"] + [::std::mem::offset_of!(CK_IKE1_EXTENDED_DERIVE_PARAMS, bHasKeygxy) - 4usize]; + ["Offset of field: CK_IKE1_EXTENDED_DERIVE_PARAMS::hKeygxy"] + [::std::mem::offset_of!(CK_IKE1_EXTENDED_DERIVE_PARAMS, hKeygxy) - 5usize]; + ["Offset of field: CK_IKE1_EXTENDED_DERIVE_PARAMS::pExtraData"] + [::std::mem::offset_of!(CK_IKE1_EXTENDED_DERIVE_PARAMS, pExtraData) - 9usize]; + ["Offset of field: CK_IKE1_EXTENDED_DERIVE_PARAMS::ulExtraDataLen"] + [::std::mem::offset_of!(CK_IKE1_EXTENDED_DERIVE_PARAMS, ulExtraDataLen) - 17usize]; +}; impl Default for CK_IKE1_EXTENDED_DERIVE_PARAMS { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); @@ -8599,46 +4040,46 @@ impl Default for CK_IKE1_EXTENDED_DERIVE_PARAMS { } } pub type CK_IKE1_EXTENDED_DERIVE_PARAMS_PTR = *mut CK_IKE1_EXTENDED_DERIVE_PARAMS; -extern "C" { +unsafe extern "C" { pub fn C_Initialize(pInitArgs: CK_VOID_PTR) -> CK_RV; } -extern "C" { +unsafe extern "C" { pub fn C_Finalize(pReserved: CK_VOID_PTR) -> CK_RV; } -extern "C" { +unsafe extern "C" { pub fn C_GetInfo(pInfo: CK_INFO_PTR) -> CK_RV; } -extern "C" { +unsafe extern "C" { pub fn C_GetFunctionList(ppFunctionList: CK_FUNCTION_LIST_PTR_PTR) -> CK_RV; } -extern "C" { +unsafe extern "C" { pub fn C_GetSlotList( tokenPresent: CK_BBOOL, pSlotList: CK_SLOT_ID_PTR, pulCount: CK_ULONG_PTR, ) -> CK_RV; } -extern "C" { +unsafe extern "C" { pub fn C_GetSlotInfo(slotID: CK_SLOT_ID, pInfo: CK_SLOT_INFO_PTR) -> CK_RV; } -extern "C" { +unsafe extern "C" { pub fn C_GetTokenInfo(slotID: CK_SLOT_ID, pInfo: CK_TOKEN_INFO_PTR) -> CK_RV; } -extern "C" { +unsafe extern "C" { pub fn C_GetMechanismList( slotID: CK_SLOT_ID, pMechanismList: CK_MECHANISM_TYPE_PTR, pulCount: CK_ULONG_PTR, ) -> CK_RV; } -extern "C" { +unsafe extern "C" { pub fn C_GetMechanismInfo( slotID: CK_SLOT_ID, type_: CK_MECHANISM_TYPE, pInfo: CK_MECHANISM_INFO_PTR, ) -> CK_RV; } -extern "C" { +unsafe extern "C" { pub fn C_InitToken( slotID: CK_SLOT_ID, pPin: CK_UTF8CHAR_PTR, @@ -8646,14 +4087,14 @@ extern "C" { pLabel: CK_UTF8CHAR_PTR, ) -> CK_RV; } -extern "C" { +unsafe extern "C" { pub fn C_InitPIN( hSession: CK_SESSION_HANDLE, pPin: CK_UTF8CHAR_PTR, ulPinLen: CK_ULONG, ) -> CK_RV; } -extern "C" { +unsafe extern "C" { pub fn C_SetPIN( hSession: CK_SESSION_HANDLE, pOldPin: CK_UTF8CHAR_PTR, @@ -8662,7 +4103,7 @@ extern "C" { ulNewLen: CK_ULONG, ) -> CK_RV; } -extern "C" { +unsafe extern "C" { pub fn C_OpenSession( slotID: CK_SLOT_ID, flags: CK_FLAGS, @@ -8671,23 +4112,23 @@ extern "C" { phSession: CK_SESSION_HANDLE_PTR, ) -> CK_RV; } -extern "C" { +unsafe extern "C" { pub fn C_CloseSession(hSession: CK_SESSION_HANDLE) -> CK_RV; } -extern "C" { +unsafe extern "C" { pub fn C_CloseAllSessions(slotID: CK_SLOT_ID) -> CK_RV; } -extern "C" { +unsafe extern "C" { pub fn C_GetSessionInfo(hSession: CK_SESSION_HANDLE, pInfo: CK_SESSION_INFO_PTR) -> CK_RV; } -extern "C" { +unsafe extern "C" { pub fn C_GetOperationState( hSession: CK_SESSION_HANDLE, pOperationState: CK_BYTE_PTR, pulOperationStateLen: CK_ULONG_PTR, ) -> CK_RV; } -extern "C" { +unsafe extern "C" { pub fn C_SetOperationState( hSession: CK_SESSION_HANDLE, pOperationState: CK_BYTE_PTR, @@ -8696,7 +4137,7 @@ extern "C" { hAuthenticationKey: CK_OBJECT_HANDLE, ) -> CK_RV; } -extern "C" { +unsafe extern "C" { pub fn C_Login( hSession: CK_SESSION_HANDLE, userType: CK_USER_TYPE, @@ -8704,10 +4145,10 @@ extern "C" { ulPinLen: CK_ULONG, ) -> CK_RV; } -extern "C" { +unsafe extern "C" { pub fn C_Logout(hSession: CK_SESSION_HANDLE) -> CK_RV; } -extern "C" { +unsafe extern "C" { pub fn C_CreateObject( hSession: CK_SESSION_HANDLE, pTemplate: CK_ATTRIBUTE_PTR, @@ -8715,7 +4156,7 @@ extern "C" { phObject: CK_OBJECT_HANDLE_PTR, ) -> CK_RV; } -extern "C" { +unsafe extern "C" { pub fn C_CopyObject( hSession: CK_SESSION_HANDLE, hObject: CK_OBJECT_HANDLE, @@ -8724,17 +4165,17 @@ extern "C" { phNewObject: CK_OBJECT_HANDLE_PTR, ) -> CK_RV; } -extern "C" { +unsafe extern "C" { pub fn C_DestroyObject(hSession: CK_SESSION_HANDLE, hObject: CK_OBJECT_HANDLE) -> CK_RV; } -extern "C" { +unsafe extern "C" { pub fn C_GetObjectSize( hSession: CK_SESSION_HANDLE, hObject: CK_OBJECT_HANDLE, pulSize: CK_ULONG_PTR, ) -> CK_RV; } -extern "C" { +unsafe extern "C" { pub fn C_GetAttributeValue( hSession: CK_SESSION_HANDLE, hObject: CK_OBJECT_HANDLE, @@ -8742,7 +4183,7 @@ extern "C" { ulCount: CK_ULONG, ) -> CK_RV; } -extern "C" { +unsafe extern "C" { pub fn C_SetAttributeValue( hSession: CK_SESSION_HANDLE, hObject: CK_OBJECT_HANDLE, @@ -8750,14 +4191,14 @@ extern "C" { ulCount: CK_ULONG, ) -> CK_RV; } -extern "C" { +unsafe extern "C" { pub fn C_FindObjectsInit( hSession: CK_SESSION_HANDLE, pTemplate: CK_ATTRIBUTE_PTR, ulCount: CK_ULONG, ) -> CK_RV; } -extern "C" { +unsafe extern "C" { pub fn C_FindObjects( hSession: CK_SESSION_HANDLE, phObject: CK_OBJECT_HANDLE_PTR, @@ -8765,17 +4206,17 @@ extern "C" { pulObjectCount: CK_ULONG_PTR, ) -> CK_RV; } -extern "C" { +unsafe extern "C" { pub fn C_FindObjectsFinal(hSession: CK_SESSION_HANDLE) -> CK_RV; } -extern "C" { +unsafe extern "C" { pub fn C_EncryptInit( hSession: CK_SESSION_HANDLE, pMechanism: CK_MECHANISM_PTR, hKey: CK_OBJECT_HANDLE, ) -> CK_RV; } -extern "C" { +unsafe extern "C" { pub fn C_Encrypt( hSession: CK_SESSION_HANDLE, pData: CK_BYTE_PTR, @@ -8784,7 +4225,7 @@ extern "C" { pulEncryptedDataLen: CK_ULONG_PTR, ) -> CK_RV; } -extern "C" { +unsafe extern "C" { pub fn C_EncryptUpdate( hSession: CK_SESSION_HANDLE, pPart: CK_BYTE_PTR, @@ -8793,21 +4234,21 @@ extern "C" { pulEncryptedPartLen: CK_ULONG_PTR, ) -> CK_RV; } -extern "C" { +unsafe extern "C" { pub fn C_EncryptFinal( hSession: CK_SESSION_HANDLE, pLastEncryptedPart: CK_BYTE_PTR, pulLastEncryptedPartLen: CK_ULONG_PTR, ) -> CK_RV; } -extern "C" { +unsafe extern "C" { pub fn C_DecryptInit( hSession: CK_SESSION_HANDLE, pMechanism: CK_MECHANISM_PTR, hKey: CK_OBJECT_HANDLE, ) -> CK_RV; } -extern "C" { +unsafe extern "C" { pub fn C_Decrypt( hSession: CK_SESSION_HANDLE, pEncryptedData: CK_BYTE_PTR, @@ -8816,7 +4257,7 @@ extern "C" { pulDataLen: CK_ULONG_PTR, ) -> CK_RV; } -extern "C" { +unsafe extern "C" { pub fn C_DecryptUpdate( hSession: CK_SESSION_HANDLE, pEncryptedPart: CK_BYTE_PTR, @@ -8825,17 +4266,17 @@ extern "C" { pulPartLen: CK_ULONG_PTR, ) -> CK_RV; } -extern "C" { +unsafe extern "C" { pub fn C_DecryptFinal( hSession: CK_SESSION_HANDLE, pLastPart: CK_BYTE_PTR, pulLastPartLen: CK_ULONG_PTR, ) -> CK_RV; } -extern "C" { +unsafe extern "C" { pub fn C_DigestInit(hSession: CK_SESSION_HANDLE, pMechanism: CK_MECHANISM_PTR) -> CK_RV; } -extern "C" { +unsafe extern "C" { pub fn C_Digest( hSession: CK_SESSION_HANDLE, pData: CK_BYTE_PTR, @@ -8844,31 +4285,31 @@ extern "C" { pulDigestLen: CK_ULONG_PTR, ) -> CK_RV; } -extern "C" { +unsafe extern "C" { pub fn C_DigestUpdate( hSession: CK_SESSION_HANDLE, pPart: CK_BYTE_PTR, ulPartLen: CK_ULONG, ) -> CK_RV; } -extern "C" { +unsafe extern "C" { pub fn C_DigestKey(hSession: CK_SESSION_HANDLE, hKey: CK_OBJECT_HANDLE) -> CK_RV; } -extern "C" { +unsafe extern "C" { pub fn C_DigestFinal( hSession: CK_SESSION_HANDLE, pDigest: CK_BYTE_PTR, pulDigestLen: CK_ULONG_PTR, ) -> CK_RV; } -extern "C" { +unsafe extern "C" { pub fn C_SignInit( hSession: CK_SESSION_HANDLE, pMechanism: CK_MECHANISM_PTR, hKey: CK_OBJECT_HANDLE, ) -> CK_RV; } -extern "C" { +unsafe extern "C" { pub fn C_Sign( hSession: CK_SESSION_HANDLE, pData: CK_BYTE_PTR, @@ -8877,28 +4318,28 @@ extern "C" { pulSignatureLen: CK_ULONG_PTR, ) -> CK_RV; } -extern "C" { +unsafe extern "C" { pub fn C_SignUpdate( hSession: CK_SESSION_HANDLE, pPart: CK_BYTE_PTR, ulPartLen: CK_ULONG, ) -> CK_RV; } -extern "C" { +unsafe extern "C" { pub fn C_SignFinal( hSession: CK_SESSION_HANDLE, pSignature: CK_BYTE_PTR, pulSignatureLen: CK_ULONG_PTR, ) -> CK_RV; } -extern "C" { +unsafe extern "C" { pub fn C_SignRecoverInit( hSession: CK_SESSION_HANDLE, pMechanism: CK_MECHANISM_PTR, hKey: CK_OBJECT_HANDLE, ) -> CK_RV; } -extern "C" { +unsafe extern "C" { pub fn C_SignRecover( hSession: CK_SESSION_HANDLE, pData: CK_BYTE_PTR, @@ -8907,14 +4348,14 @@ extern "C" { pulSignatureLen: CK_ULONG_PTR, ) -> CK_RV; } -extern "C" { +unsafe extern "C" { pub fn C_VerifyInit( hSession: CK_SESSION_HANDLE, pMechanism: CK_MECHANISM_PTR, hKey: CK_OBJECT_HANDLE, ) -> CK_RV; } -extern "C" { +unsafe extern "C" { pub fn C_Verify( hSession: CK_SESSION_HANDLE, pData: CK_BYTE_PTR, @@ -8923,28 +4364,28 @@ extern "C" { ulSignatureLen: CK_ULONG, ) -> CK_RV; } -extern "C" { +unsafe extern "C" { pub fn C_VerifyUpdate( hSession: CK_SESSION_HANDLE, pPart: CK_BYTE_PTR, ulPartLen: CK_ULONG, ) -> CK_RV; } -extern "C" { +unsafe extern "C" { pub fn C_VerifyFinal( hSession: CK_SESSION_HANDLE, pSignature: CK_BYTE_PTR, ulSignatureLen: CK_ULONG, ) -> CK_RV; } -extern "C" { +unsafe extern "C" { pub fn C_VerifyRecoverInit( hSession: CK_SESSION_HANDLE, pMechanism: CK_MECHANISM_PTR, hKey: CK_OBJECT_HANDLE, ) -> CK_RV; } -extern "C" { +unsafe extern "C" { pub fn C_VerifyRecover( hSession: CK_SESSION_HANDLE, pSignature: CK_BYTE_PTR, @@ -8953,7 +4394,7 @@ extern "C" { pulDataLen: CK_ULONG_PTR, ) -> CK_RV; } -extern "C" { +unsafe extern "C" { pub fn C_DigestEncryptUpdate( hSession: CK_SESSION_HANDLE, pPart: CK_BYTE_PTR, @@ -8962,7 +4403,7 @@ extern "C" { pulEncryptedPartLen: CK_ULONG_PTR, ) -> CK_RV; } -extern "C" { +unsafe extern "C" { pub fn C_DecryptDigestUpdate( hSession: CK_SESSION_HANDLE, pEncryptedPart: CK_BYTE_PTR, @@ -8971,7 +4412,7 @@ extern "C" { pulPartLen: CK_ULONG_PTR, ) -> CK_RV; } -extern "C" { +unsafe extern "C" { pub fn C_SignEncryptUpdate( hSession: CK_SESSION_HANDLE, pPart: CK_BYTE_PTR, @@ -8980,7 +4421,7 @@ extern "C" { pulEncryptedPartLen: CK_ULONG_PTR, ) -> CK_RV; } -extern "C" { +unsafe extern "C" { pub fn C_DecryptVerifyUpdate( hSession: CK_SESSION_HANDLE, pEncryptedPart: CK_BYTE_PTR, @@ -8989,7 +4430,7 @@ extern "C" { pulPartLen: CK_ULONG_PTR, ) -> CK_RV; } -extern "C" { +unsafe extern "C" { pub fn C_GenerateKey( hSession: CK_SESSION_HANDLE, pMechanism: CK_MECHANISM_PTR, @@ -8998,7 +4439,7 @@ extern "C" { phKey: CK_OBJECT_HANDLE_PTR, ) -> CK_RV; } -extern "C" { +unsafe extern "C" { pub fn C_GenerateKeyPair( hSession: CK_SESSION_HANDLE, pMechanism: CK_MECHANISM_PTR, @@ -9010,7 +4451,7 @@ extern "C" { phPrivateKey: CK_OBJECT_HANDLE_PTR, ) -> CK_RV; } -extern "C" { +unsafe extern "C" { pub fn C_WrapKey( hSession: CK_SESSION_HANDLE, pMechanism: CK_MECHANISM_PTR, @@ -9020,7 +4461,7 @@ extern "C" { pulWrappedKeyLen: CK_ULONG_PTR, ) -> CK_RV; } -extern "C" { +unsafe extern "C" { pub fn C_UnwrapKey( hSession: CK_SESSION_HANDLE, pMechanism: CK_MECHANISM_PTR, @@ -9032,7 +4473,7 @@ extern "C" { phKey: CK_OBJECT_HANDLE_PTR, ) -> CK_RV; } -extern "C" { +unsafe extern "C" { pub fn C_DeriveKey( hSession: CK_SESSION_HANDLE, pMechanism: CK_MECHANISM_PTR, @@ -9042,37 +4483,37 @@ extern "C" { phKey: CK_OBJECT_HANDLE_PTR, ) -> CK_RV; } -extern "C" { +unsafe extern "C" { pub fn C_SeedRandom( hSession: CK_SESSION_HANDLE, pSeed: CK_BYTE_PTR, ulSeedLen: CK_ULONG, ) -> CK_RV; } -extern "C" { +unsafe extern "C" { pub fn C_GenerateRandom( hSession: CK_SESSION_HANDLE, RandomData: CK_BYTE_PTR, ulRandomLen: CK_ULONG, ) -> CK_RV; } -extern "C" { +unsafe extern "C" { pub fn C_GetFunctionStatus(hSession: CK_SESSION_HANDLE) -> CK_RV; } -extern "C" { +unsafe extern "C" { pub fn C_CancelFunction(hSession: CK_SESSION_HANDLE) -> CK_RV; } -extern "C" { +unsafe extern "C" { pub fn C_WaitForSlotEvent( flags: CK_FLAGS, pSlot: CK_SLOT_ID_PTR, pRserved: CK_VOID_PTR, ) -> CK_RV; } -extern "C" { +unsafe extern "C" { pub fn C_GetInterfaceList(pInterfacesList: CK_INTERFACE_PTR, pulCount: CK_ULONG_PTR) -> CK_RV; } -extern "C" { +unsafe extern "C" { pub fn C_GetInterface( pInterfaceName: CK_UTF8CHAR_PTR, pVersion: CK_VERSION_PTR, @@ -9080,7 +4521,7 @@ extern "C" { flags: CK_FLAGS, ) -> CK_RV; } -extern "C" { +unsafe extern "C" { pub fn C_LoginUser( hSession: CK_SESSION_HANDLE, userType: CK_USER_TYPE, @@ -9090,17 +4531,17 @@ extern "C" { ulUsernameLen: CK_ULONG, ) -> CK_RV; } -extern "C" { +unsafe extern "C" { pub fn C_SessionCancel(hSession: CK_SESSION_HANDLE, flags: CK_FLAGS) -> CK_RV; } -extern "C" { +unsafe extern "C" { pub fn C_MessageEncryptInit( hSession: CK_SESSION_HANDLE, pMechanism: CK_MECHANISM_PTR, hKey: CK_OBJECT_HANDLE, ) -> CK_RV; } -extern "C" { +unsafe extern "C" { pub fn C_EncryptMessage( hSession: CK_SESSION_HANDLE, pParameter: CK_VOID_PTR, @@ -9113,7 +4554,7 @@ extern "C" { pulCiphertextLen: CK_ULONG_PTR, ) -> CK_RV; } -extern "C" { +unsafe extern "C" { pub fn C_EncryptMessageBegin( hSession: CK_SESSION_HANDLE, pParameter: CK_VOID_PTR, @@ -9122,7 +4563,7 @@ extern "C" { ulAssociatedDataLen: CK_ULONG, ) -> CK_RV; } -extern "C" { +unsafe extern "C" { pub fn C_EncryptMessageNext( hSession: CK_SESSION_HANDLE, pParameter: CK_VOID_PTR, @@ -9134,17 +4575,17 @@ extern "C" { flags: CK_FLAGS, ) -> CK_RV; } -extern "C" { +unsafe extern "C" { pub fn C_MessageEncryptFinal(hSession: CK_SESSION_HANDLE) -> CK_RV; } -extern "C" { +unsafe extern "C" { pub fn C_MessageDecryptInit( hSession: CK_SESSION_HANDLE, pMechanism: CK_MECHANISM_PTR, hKey: CK_OBJECT_HANDLE, ) -> CK_RV; } -extern "C" { +unsafe extern "C" { pub fn C_DecryptMessage( hSession: CK_SESSION_HANDLE, pParameter: CK_VOID_PTR, @@ -9157,7 +4598,7 @@ extern "C" { pulPlaintextLen: CK_ULONG_PTR, ) -> CK_RV; } -extern "C" { +unsafe extern "C" { pub fn C_DecryptMessageBegin( hSession: CK_SESSION_HANDLE, pParameter: CK_VOID_PTR, @@ -9166,7 +4607,7 @@ extern "C" { ulAssociatedDataLen: CK_ULONG, ) -> CK_RV; } -extern "C" { +unsafe extern "C" { pub fn C_DecryptMessageNext( hSession: CK_SESSION_HANDLE, pParameter: CK_VOID_PTR, @@ -9178,17 +4619,17 @@ extern "C" { flags: CK_FLAGS, ) -> CK_RV; } -extern "C" { +unsafe extern "C" { pub fn C_MessageDecryptFinal(hSession: CK_SESSION_HANDLE) -> CK_RV; } -extern "C" { +unsafe extern "C" { pub fn C_MessageSignInit( hSession: CK_SESSION_HANDLE, pMechanism: CK_MECHANISM_PTR, hKey: CK_OBJECT_HANDLE, ) -> CK_RV; } -extern "C" { +unsafe extern "C" { pub fn C_SignMessage( hSession: CK_SESSION_HANDLE, pParameter: CK_VOID_PTR, @@ -9199,14 +4640,14 @@ extern "C" { pulSignatureLen: CK_ULONG_PTR, ) -> CK_RV; } -extern "C" { +unsafe extern "C" { pub fn C_SignMessageBegin( hSession: CK_SESSION_HANDLE, pParameter: CK_VOID_PTR, ulParameterLen: CK_ULONG, ) -> CK_RV; } -extern "C" { +unsafe extern "C" { pub fn C_SignMessageNext( hSession: CK_SESSION_HANDLE, pParameter: CK_VOID_PTR, @@ -9217,17 +4658,17 @@ extern "C" { pulSignatureLen: CK_ULONG_PTR, ) -> CK_RV; } -extern "C" { +unsafe extern "C" { pub fn C_MessageSignFinal(hSession: CK_SESSION_HANDLE) -> CK_RV; } -extern "C" { +unsafe extern "C" { pub fn C_MessageVerifyInit( hSession: CK_SESSION_HANDLE, pMechanism: CK_MECHANISM_PTR, hKey: CK_OBJECT_HANDLE, ) -> CK_RV; } -extern "C" { +unsafe extern "C" { pub fn C_VerifyMessage( hSession: CK_SESSION_HANDLE, pParameter: CK_VOID_PTR, @@ -9238,14 +4679,14 @@ extern "C" { ulSignatureLen: CK_ULONG, ) -> CK_RV; } -extern "C" { +unsafe extern "C" { pub fn C_VerifyMessageBegin( hSession: CK_SESSION_HANDLE, pParameter: CK_VOID_PTR, ulParameterLen: CK_ULONG, ) -> CK_RV; } -extern "C" { +unsafe extern "C" { pub fn C_VerifyMessageNext( hSession: CK_SESSION_HANDLE, pParameter: CK_VOID_PTR, @@ -9256,7 +4697,7 @@ extern "C" { ulSignatureLen: CK_ULONG, ) -> CK_RV; } -extern "C" { +unsafe extern "C" { pub fn C_MessageVerifyFinal(hSession: CK_SESSION_HANDLE) -> CK_RV; } pub type CK_C_Initialize = @@ -9997,951 +5438,197 @@ pub struct CK_FUNCTION_LIST_3_0 { pub C_VerifyMessageNext: CK_C_VerifyMessageNext, pub C_MessageVerifyFinal: CK_C_MessageVerifyFinal, } -#[test] -fn bindgen_test_layout_CK_FUNCTION_LIST_3_0() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 738usize, - concat!("Size of: ", stringify!(CK_FUNCTION_LIST_3_0)) - ); - assert_eq!( - ::std::mem::align_of::(), - 1usize, - concat!("Alignment of ", stringify!(CK_FUNCTION_LIST_3_0)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).version) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(CK_FUNCTION_LIST_3_0), - "::", - stringify!(version) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).C_Initialize) as usize - ptr as usize }, - 2usize, - concat!( - "Offset of field: ", - stringify!(CK_FUNCTION_LIST_3_0), - "::", - stringify!(C_Initialize) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).C_Finalize) as usize - ptr as usize }, - 10usize, - concat!( - "Offset of field: ", - stringify!(CK_FUNCTION_LIST_3_0), - "::", - stringify!(C_Finalize) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).C_GetInfo) as usize - ptr as usize }, - 18usize, - concat!( - "Offset of field: ", - stringify!(CK_FUNCTION_LIST_3_0), - "::", - stringify!(C_GetInfo) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).C_GetFunctionList) as usize - ptr as usize }, - 26usize, - concat!( - "Offset of field: ", - stringify!(CK_FUNCTION_LIST_3_0), - "::", - stringify!(C_GetFunctionList) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).C_GetSlotList) as usize - ptr as usize }, - 34usize, - concat!( - "Offset of field: ", - stringify!(CK_FUNCTION_LIST_3_0), - "::", - stringify!(C_GetSlotList) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).C_GetSlotInfo) as usize - ptr as usize }, - 42usize, - concat!( - "Offset of field: ", - stringify!(CK_FUNCTION_LIST_3_0), - "::", - stringify!(C_GetSlotInfo) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).C_GetTokenInfo) as usize - ptr as usize }, - 50usize, - concat!( - "Offset of field: ", - stringify!(CK_FUNCTION_LIST_3_0), - "::", - stringify!(C_GetTokenInfo) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).C_GetMechanismList) as usize - ptr as usize }, - 58usize, - concat!( - "Offset of field: ", - stringify!(CK_FUNCTION_LIST_3_0), - "::", - stringify!(C_GetMechanismList) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).C_GetMechanismInfo) as usize - ptr as usize }, - 66usize, - concat!( - "Offset of field: ", - stringify!(CK_FUNCTION_LIST_3_0), - "::", - stringify!(C_GetMechanismInfo) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).C_InitToken) as usize - ptr as usize }, - 74usize, - concat!( - "Offset of field: ", - stringify!(CK_FUNCTION_LIST_3_0), - "::", - stringify!(C_InitToken) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).C_InitPIN) as usize - ptr as usize }, - 82usize, - concat!( - "Offset of field: ", - stringify!(CK_FUNCTION_LIST_3_0), - "::", - stringify!(C_InitPIN) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).C_SetPIN) as usize - ptr as usize }, - 90usize, - concat!( - "Offset of field: ", - stringify!(CK_FUNCTION_LIST_3_0), - "::", - stringify!(C_SetPIN) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).C_OpenSession) as usize - ptr as usize }, - 98usize, - concat!( - "Offset of field: ", - stringify!(CK_FUNCTION_LIST_3_0), - "::", - stringify!(C_OpenSession) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).C_CloseSession) as usize - ptr as usize }, - 106usize, - concat!( - "Offset of field: ", - stringify!(CK_FUNCTION_LIST_3_0), - "::", - stringify!(C_CloseSession) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).C_CloseAllSessions) as usize - ptr as usize }, - 114usize, - concat!( - "Offset of field: ", - stringify!(CK_FUNCTION_LIST_3_0), - "::", - stringify!(C_CloseAllSessions) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).C_GetSessionInfo) as usize - ptr as usize }, - 122usize, - concat!( - "Offset of field: ", - stringify!(CK_FUNCTION_LIST_3_0), - "::", - stringify!(C_GetSessionInfo) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).C_GetOperationState) as usize - ptr as usize }, - 130usize, - concat!( - "Offset of field: ", - stringify!(CK_FUNCTION_LIST_3_0), - "::", - stringify!(C_GetOperationState) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).C_SetOperationState) as usize - ptr as usize }, - 138usize, - concat!( - "Offset of field: ", - stringify!(CK_FUNCTION_LIST_3_0), - "::", - stringify!(C_SetOperationState) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).C_Login) as usize - ptr as usize }, - 146usize, - concat!( - "Offset of field: ", - stringify!(CK_FUNCTION_LIST_3_0), - "::", - stringify!(C_Login) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).C_Logout) as usize - ptr as usize }, - 154usize, - concat!( - "Offset of field: ", - stringify!(CK_FUNCTION_LIST_3_0), - "::", - stringify!(C_Logout) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).C_CreateObject) as usize - ptr as usize }, - 162usize, - concat!( - "Offset of field: ", - stringify!(CK_FUNCTION_LIST_3_0), - "::", - stringify!(C_CreateObject) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).C_CopyObject) as usize - ptr as usize }, - 170usize, - concat!( - "Offset of field: ", - stringify!(CK_FUNCTION_LIST_3_0), - "::", - stringify!(C_CopyObject) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).C_DestroyObject) as usize - ptr as usize }, - 178usize, - concat!( - "Offset of field: ", - stringify!(CK_FUNCTION_LIST_3_0), - "::", - stringify!(C_DestroyObject) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).C_GetObjectSize) as usize - ptr as usize }, - 186usize, - concat!( - "Offset of field: ", - stringify!(CK_FUNCTION_LIST_3_0), - "::", - stringify!(C_GetObjectSize) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).C_GetAttributeValue) as usize - ptr as usize }, - 194usize, - concat!( - "Offset of field: ", - stringify!(CK_FUNCTION_LIST_3_0), - "::", - stringify!(C_GetAttributeValue) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).C_SetAttributeValue) as usize - ptr as usize }, - 202usize, - concat!( - "Offset of field: ", - stringify!(CK_FUNCTION_LIST_3_0), - "::", - stringify!(C_SetAttributeValue) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).C_FindObjectsInit) as usize - ptr as usize }, - 210usize, - concat!( - "Offset of field: ", - stringify!(CK_FUNCTION_LIST_3_0), - "::", - stringify!(C_FindObjectsInit) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).C_FindObjects) as usize - ptr as usize }, - 218usize, - concat!( - "Offset of field: ", - stringify!(CK_FUNCTION_LIST_3_0), - "::", - stringify!(C_FindObjects) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).C_FindObjectsFinal) as usize - ptr as usize }, - 226usize, - concat!( - "Offset of field: ", - stringify!(CK_FUNCTION_LIST_3_0), - "::", - stringify!(C_FindObjectsFinal) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).C_EncryptInit) as usize - ptr as usize }, - 234usize, - concat!( - "Offset of field: ", - stringify!(CK_FUNCTION_LIST_3_0), - "::", - stringify!(C_EncryptInit) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).C_Encrypt) as usize - ptr as usize }, - 242usize, - concat!( - "Offset of field: ", - stringify!(CK_FUNCTION_LIST_3_0), - "::", - stringify!(C_Encrypt) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).C_EncryptUpdate) as usize - ptr as usize }, - 250usize, - concat!( - "Offset of field: ", - stringify!(CK_FUNCTION_LIST_3_0), - "::", - stringify!(C_EncryptUpdate) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).C_EncryptFinal) as usize - ptr as usize }, - 258usize, - concat!( - "Offset of field: ", - stringify!(CK_FUNCTION_LIST_3_0), - "::", - stringify!(C_EncryptFinal) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).C_DecryptInit) as usize - ptr as usize }, - 266usize, - concat!( - "Offset of field: ", - stringify!(CK_FUNCTION_LIST_3_0), - "::", - stringify!(C_DecryptInit) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).C_Decrypt) as usize - ptr as usize }, - 274usize, - concat!( - "Offset of field: ", - stringify!(CK_FUNCTION_LIST_3_0), - "::", - stringify!(C_Decrypt) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).C_DecryptUpdate) as usize - ptr as usize }, - 282usize, - concat!( - "Offset of field: ", - stringify!(CK_FUNCTION_LIST_3_0), - "::", - stringify!(C_DecryptUpdate) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).C_DecryptFinal) as usize - ptr as usize }, - 290usize, - concat!( - "Offset of field: ", - stringify!(CK_FUNCTION_LIST_3_0), - "::", - stringify!(C_DecryptFinal) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).C_DigestInit) as usize - ptr as usize }, - 298usize, - concat!( - "Offset of field: ", - stringify!(CK_FUNCTION_LIST_3_0), - "::", - stringify!(C_DigestInit) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).C_Digest) as usize - ptr as usize }, - 306usize, - concat!( - "Offset of field: ", - stringify!(CK_FUNCTION_LIST_3_0), - "::", - stringify!(C_Digest) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).C_DigestUpdate) as usize - ptr as usize }, - 314usize, - concat!( - "Offset of field: ", - stringify!(CK_FUNCTION_LIST_3_0), - "::", - stringify!(C_DigestUpdate) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).C_DigestKey) as usize - ptr as usize }, - 322usize, - concat!( - "Offset of field: ", - stringify!(CK_FUNCTION_LIST_3_0), - "::", - stringify!(C_DigestKey) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).C_DigestFinal) as usize - ptr as usize }, - 330usize, - concat!( - "Offset of field: ", - stringify!(CK_FUNCTION_LIST_3_0), - "::", - stringify!(C_DigestFinal) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).C_SignInit) as usize - ptr as usize }, - 338usize, - concat!( - "Offset of field: ", - stringify!(CK_FUNCTION_LIST_3_0), - "::", - stringify!(C_SignInit) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).C_Sign) as usize - ptr as usize }, - 346usize, - concat!( - "Offset of field: ", - stringify!(CK_FUNCTION_LIST_3_0), - "::", - stringify!(C_Sign) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).C_SignUpdate) as usize - ptr as usize }, - 354usize, - concat!( - "Offset of field: ", - stringify!(CK_FUNCTION_LIST_3_0), - "::", - stringify!(C_SignUpdate) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).C_SignFinal) as usize - ptr as usize }, - 362usize, - concat!( - "Offset of field: ", - stringify!(CK_FUNCTION_LIST_3_0), - "::", - stringify!(C_SignFinal) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).C_SignRecoverInit) as usize - ptr as usize }, - 370usize, - concat!( - "Offset of field: ", - stringify!(CK_FUNCTION_LIST_3_0), - "::", - stringify!(C_SignRecoverInit) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).C_SignRecover) as usize - ptr as usize }, - 378usize, - concat!( - "Offset of field: ", - stringify!(CK_FUNCTION_LIST_3_0), - "::", - stringify!(C_SignRecover) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).C_VerifyInit) as usize - ptr as usize }, - 386usize, - concat!( - "Offset of field: ", - stringify!(CK_FUNCTION_LIST_3_0), - "::", - stringify!(C_VerifyInit) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).C_Verify) as usize - ptr as usize }, - 394usize, - concat!( - "Offset of field: ", - stringify!(CK_FUNCTION_LIST_3_0), - "::", - stringify!(C_Verify) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).C_VerifyUpdate) as usize - ptr as usize }, - 402usize, - concat!( - "Offset of field: ", - stringify!(CK_FUNCTION_LIST_3_0), - "::", - stringify!(C_VerifyUpdate) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).C_VerifyFinal) as usize - ptr as usize }, - 410usize, - concat!( - "Offset of field: ", - stringify!(CK_FUNCTION_LIST_3_0), - "::", - stringify!(C_VerifyFinal) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).C_VerifyRecoverInit) as usize - ptr as usize }, - 418usize, - concat!( - "Offset of field: ", - stringify!(CK_FUNCTION_LIST_3_0), - "::", - stringify!(C_VerifyRecoverInit) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).C_VerifyRecover) as usize - ptr as usize }, - 426usize, - concat!( - "Offset of field: ", - stringify!(CK_FUNCTION_LIST_3_0), - "::", - stringify!(C_VerifyRecover) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).C_DigestEncryptUpdate) as usize - ptr as usize }, - 434usize, - concat!( - "Offset of field: ", - stringify!(CK_FUNCTION_LIST_3_0), - "::", - stringify!(C_DigestEncryptUpdate) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).C_DecryptDigestUpdate) as usize - ptr as usize }, - 442usize, - concat!( - "Offset of field: ", - stringify!(CK_FUNCTION_LIST_3_0), - "::", - stringify!(C_DecryptDigestUpdate) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).C_SignEncryptUpdate) as usize - ptr as usize }, - 450usize, - concat!( - "Offset of field: ", - stringify!(CK_FUNCTION_LIST_3_0), - "::", - stringify!(C_SignEncryptUpdate) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).C_DecryptVerifyUpdate) as usize - ptr as usize }, - 458usize, - concat!( - "Offset of field: ", - stringify!(CK_FUNCTION_LIST_3_0), - "::", - stringify!(C_DecryptVerifyUpdate) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).C_GenerateKey) as usize - ptr as usize }, - 466usize, - concat!( - "Offset of field: ", - stringify!(CK_FUNCTION_LIST_3_0), - "::", - stringify!(C_GenerateKey) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).C_GenerateKeyPair) as usize - ptr as usize }, - 474usize, - concat!( - "Offset of field: ", - stringify!(CK_FUNCTION_LIST_3_0), - "::", - stringify!(C_GenerateKeyPair) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).C_WrapKey) as usize - ptr as usize }, - 482usize, - concat!( - "Offset of field: ", - stringify!(CK_FUNCTION_LIST_3_0), - "::", - stringify!(C_WrapKey) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).C_UnwrapKey) as usize - ptr as usize }, - 490usize, - concat!( - "Offset of field: ", - stringify!(CK_FUNCTION_LIST_3_0), - "::", - stringify!(C_UnwrapKey) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).C_DeriveKey) as usize - ptr as usize }, - 498usize, - concat!( - "Offset of field: ", - stringify!(CK_FUNCTION_LIST_3_0), - "::", - stringify!(C_DeriveKey) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).C_SeedRandom) as usize - ptr as usize }, - 506usize, - concat!( - "Offset of field: ", - stringify!(CK_FUNCTION_LIST_3_0), - "::", - stringify!(C_SeedRandom) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).C_GenerateRandom) as usize - ptr as usize }, - 514usize, - concat!( - "Offset of field: ", - stringify!(CK_FUNCTION_LIST_3_0), - "::", - stringify!(C_GenerateRandom) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).C_GetFunctionStatus) as usize - ptr as usize }, - 522usize, - concat!( - "Offset of field: ", - stringify!(CK_FUNCTION_LIST_3_0), - "::", - stringify!(C_GetFunctionStatus) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).C_CancelFunction) as usize - ptr as usize }, - 530usize, - concat!( - "Offset of field: ", - stringify!(CK_FUNCTION_LIST_3_0), - "::", - stringify!(C_CancelFunction) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).C_WaitForSlotEvent) as usize - ptr as usize }, - 538usize, - concat!( - "Offset of field: ", - stringify!(CK_FUNCTION_LIST_3_0), - "::", - stringify!(C_WaitForSlotEvent) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).C_GetInterfaceList) as usize - ptr as usize }, - 546usize, - concat!( - "Offset of field: ", - stringify!(CK_FUNCTION_LIST_3_0), - "::", - stringify!(C_GetInterfaceList) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).C_GetInterface) as usize - ptr as usize }, - 554usize, - concat!( - "Offset of field: ", - stringify!(CK_FUNCTION_LIST_3_0), - "::", - stringify!(C_GetInterface) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).C_LoginUser) as usize - ptr as usize }, - 562usize, - concat!( - "Offset of field: ", - stringify!(CK_FUNCTION_LIST_3_0), - "::", - stringify!(C_LoginUser) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).C_SessionCancel) as usize - ptr as usize }, - 570usize, - concat!( - "Offset of field: ", - stringify!(CK_FUNCTION_LIST_3_0), - "::", - stringify!(C_SessionCancel) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).C_MessageEncryptInit) as usize - ptr as usize }, - 578usize, - concat!( - "Offset of field: ", - stringify!(CK_FUNCTION_LIST_3_0), - "::", - stringify!(C_MessageEncryptInit) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).C_EncryptMessage) as usize - ptr as usize }, - 586usize, - concat!( - "Offset of field: ", - stringify!(CK_FUNCTION_LIST_3_0), - "::", - stringify!(C_EncryptMessage) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).C_EncryptMessageBegin) as usize - ptr as usize }, - 594usize, - concat!( - "Offset of field: ", - stringify!(CK_FUNCTION_LIST_3_0), - "::", - stringify!(C_EncryptMessageBegin) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).C_EncryptMessageNext) as usize - ptr as usize }, - 602usize, - concat!( - "Offset of field: ", - stringify!(CK_FUNCTION_LIST_3_0), - "::", - stringify!(C_EncryptMessageNext) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).C_MessageEncryptFinal) as usize - ptr as usize }, - 610usize, - concat!( - "Offset of field: ", - stringify!(CK_FUNCTION_LIST_3_0), - "::", - stringify!(C_MessageEncryptFinal) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).C_MessageDecryptInit) as usize - ptr as usize }, - 618usize, - concat!( - "Offset of field: ", - stringify!(CK_FUNCTION_LIST_3_0), - "::", - stringify!(C_MessageDecryptInit) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).C_DecryptMessage) as usize - ptr as usize }, - 626usize, - concat!( - "Offset of field: ", - stringify!(CK_FUNCTION_LIST_3_0), - "::", - stringify!(C_DecryptMessage) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).C_DecryptMessageBegin) as usize - ptr as usize }, - 634usize, - concat!( - "Offset of field: ", - stringify!(CK_FUNCTION_LIST_3_0), - "::", - stringify!(C_DecryptMessageBegin) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).C_DecryptMessageNext) as usize - ptr as usize }, - 642usize, - concat!( - "Offset of field: ", - stringify!(CK_FUNCTION_LIST_3_0), - "::", - stringify!(C_DecryptMessageNext) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).C_MessageDecryptFinal) as usize - ptr as usize }, - 650usize, - concat!( - "Offset of field: ", - stringify!(CK_FUNCTION_LIST_3_0), - "::", - stringify!(C_MessageDecryptFinal) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).C_MessageSignInit) as usize - ptr as usize }, - 658usize, - concat!( - "Offset of field: ", - stringify!(CK_FUNCTION_LIST_3_0), - "::", - stringify!(C_MessageSignInit) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).C_SignMessage) as usize - ptr as usize }, - 666usize, - concat!( - "Offset of field: ", - stringify!(CK_FUNCTION_LIST_3_0), - "::", - stringify!(C_SignMessage) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).C_SignMessageBegin) as usize - ptr as usize }, - 674usize, - concat!( - "Offset of field: ", - stringify!(CK_FUNCTION_LIST_3_0), - "::", - stringify!(C_SignMessageBegin) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).C_SignMessageNext) as usize - ptr as usize }, - 682usize, - concat!( - "Offset of field: ", - stringify!(CK_FUNCTION_LIST_3_0), - "::", - stringify!(C_SignMessageNext) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).C_MessageSignFinal) as usize - ptr as usize }, - 690usize, - concat!( - "Offset of field: ", - stringify!(CK_FUNCTION_LIST_3_0), - "::", - stringify!(C_MessageSignFinal) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).C_MessageVerifyInit) as usize - ptr as usize }, - 698usize, - concat!( - "Offset of field: ", - stringify!(CK_FUNCTION_LIST_3_0), - "::", - stringify!(C_MessageVerifyInit) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).C_VerifyMessage) as usize - ptr as usize }, - 706usize, - concat!( - "Offset of field: ", - stringify!(CK_FUNCTION_LIST_3_0), - "::", - stringify!(C_VerifyMessage) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).C_VerifyMessageBegin) as usize - ptr as usize }, - 714usize, - concat!( - "Offset of field: ", - stringify!(CK_FUNCTION_LIST_3_0), - "::", - stringify!(C_VerifyMessageBegin) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).C_VerifyMessageNext) as usize - ptr as usize }, - 722usize, - concat!( - "Offset of field: ", - stringify!(CK_FUNCTION_LIST_3_0), - "::", - stringify!(C_VerifyMessageNext) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).C_MessageVerifyFinal) as usize - ptr as usize }, - 730usize, - concat!( - "Offset of field: ", - stringify!(CK_FUNCTION_LIST_3_0), - "::", - stringify!(C_MessageVerifyFinal) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of CK_FUNCTION_LIST_3_0"][::std::mem::size_of::() - 738usize]; + ["Alignment of CK_FUNCTION_LIST_3_0"][::std::mem::align_of::() - 1usize]; + ["Offset of field: CK_FUNCTION_LIST_3_0::version"] + [::std::mem::offset_of!(CK_FUNCTION_LIST_3_0, version) - 0usize]; + ["Offset of field: CK_FUNCTION_LIST_3_0::C_Initialize"] + [::std::mem::offset_of!(CK_FUNCTION_LIST_3_0, C_Initialize) - 2usize]; + ["Offset of field: CK_FUNCTION_LIST_3_0::C_Finalize"] + [::std::mem::offset_of!(CK_FUNCTION_LIST_3_0, C_Finalize) - 10usize]; + ["Offset of field: CK_FUNCTION_LIST_3_0::C_GetInfo"] + [::std::mem::offset_of!(CK_FUNCTION_LIST_3_0, C_GetInfo) - 18usize]; + ["Offset of field: CK_FUNCTION_LIST_3_0::C_GetFunctionList"] + [::std::mem::offset_of!(CK_FUNCTION_LIST_3_0, C_GetFunctionList) - 26usize]; + ["Offset of field: CK_FUNCTION_LIST_3_0::C_GetSlotList"] + [::std::mem::offset_of!(CK_FUNCTION_LIST_3_0, C_GetSlotList) - 34usize]; + ["Offset of field: CK_FUNCTION_LIST_3_0::C_GetSlotInfo"] + [::std::mem::offset_of!(CK_FUNCTION_LIST_3_0, C_GetSlotInfo) - 42usize]; + ["Offset of field: CK_FUNCTION_LIST_3_0::C_GetTokenInfo"] + [::std::mem::offset_of!(CK_FUNCTION_LIST_3_0, C_GetTokenInfo) - 50usize]; + ["Offset of field: CK_FUNCTION_LIST_3_0::C_GetMechanismList"] + [::std::mem::offset_of!(CK_FUNCTION_LIST_3_0, C_GetMechanismList) - 58usize]; + ["Offset of field: CK_FUNCTION_LIST_3_0::C_GetMechanismInfo"] + [::std::mem::offset_of!(CK_FUNCTION_LIST_3_0, C_GetMechanismInfo) - 66usize]; + ["Offset of field: CK_FUNCTION_LIST_3_0::C_InitToken"] + [::std::mem::offset_of!(CK_FUNCTION_LIST_3_0, C_InitToken) - 74usize]; + ["Offset of field: CK_FUNCTION_LIST_3_0::C_InitPIN"] + [::std::mem::offset_of!(CK_FUNCTION_LIST_3_0, C_InitPIN) - 82usize]; + ["Offset of field: CK_FUNCTION_LIST_3_0::C_SetPIN"] + [::std::mem::offset_of!(CK_FUNCTION_LIST_3_0, C_SetPIN) - 90usize]; + ["Offset of field: CK_FUNCTION_LIST_3_0::C_OpenSession"] + [::std::mem::offset_of!(CK_FUNCTION_LIST_3_0, C_OpenSession) - 98usize]; + ["Offset of field: CK_FUNCTION_LIST_3_0::C_CloseSession"] + [::std::mem::offset_of!(CK_FUNCTION_LIST_3_0, C_CloseSession) - 106usize]; + ["Offset of field: CK_FUNCTION_LIST_3_0::C_CloseAllSessions"] + [::std::mem::offset_of!(CK_FUNCTION_LIST_3_0, C_CloseAllSessions) - 114usize]; + ["Offset of field: CK_FUNCTION_LIST_3_0::C_GetSessionInfo"] + [::std::mem::offset_of!(CK_FUNCTION_LIST_3_0, C_GetSessionInfo) - 122usize]; + ["Offset of field: CK_FUNCTION_LIST_3_0::C_GetOperationState"] + [::std::mem::offset_of!(CK_FUNCTION_LIST_3_0, C_GetOperationState) - 130usize]; + ["Offset of field: CK_FUNCTION_LIST_3_0::C_SetOperationState"] + [::std::mem::offset_of!(CK_FUNCTION_LIST_3_0, C_SetOperationState) - 138usize]; + ["Offset of field: CK_FUNCTION_LIST_3_0::C_Login"] + [::std::mem::offset_of!(CK_FUNCTION_LIST_3_0, C_Login) - 146usize]; + ["Offset of field: CK_FUNCTION_LIST_3_0::C_Logout"] + [::std::mem::offset_of!(CK_FUNCTION_LIST_3_0, C_Logout) - 154usize]; + ["Offset of field: CK_FUNCTION_LIST_3_0::C_CreateObject"] + [::std::mem::offset_of!(CK_FUNCTION_LIST_3_0, C_CreateObject) - 162usize]; + ["Offset of field: CK_FUNCTION_LIST_3_0::C_CopyObject"] + [::std::mem::offset_of!(CK_FUNCTION_LIST_3_0, C_CopyObject) - 170usize]; + ["Offset of field: CK_FUNCTION_LIST_3_0::C_DestroyObject"] + [::std::mem::offset_of!(CK_FUNCTION_LIST_3_0, C_DestroyObject) - 178usize]; + ["Offset of field: CK_FUNCTION_LIST_3_0::C_GetObjectSize"] + [::std::mem::offset_of!(CK_FUNCTION_LIST_3_0, C_GetObjectSize) - 186usize]; + ["Offset of field: CK_FUNCTION_LIST_3_0::C_GetAttributeValue"] + [::std::mem::offset_of!(CK_FUNCTION_LIST_3_0, C_GetAttributeValue) - 194usize]; + ["Offset of field: CK_FUNCTION_LIST_3_0::C_SetAttributeValue"] + [::std::mem::offset_of!(CK_FUNCTION_LIST_3_0, C_SetAttributeValue) - 202usize]; + ["Offset of field: CK_FUNCTION_LIST_3_0::C_FindObjectsInit"] + [::std::mem::offset_of!(CK_FUNCTION_LIST_3_0, C_FindObjectsInit) - 210usize]; + ["Offset of field: CK_FUNCTION_LIST_3_0::C_FindObjects"] + [::std::mem::offset_of!(CK_FUNCTION_LIST_3_0, C_FindObjects) - 218usize]; + ["Offset of field: CK_FUNCTION_LIST_3_0::C_FindObjectsFinal"] + [::std::mem::offset_of!(CK_FUNCTION_LIST_3_0, C_FindObjectsFinal) - 226usize]; + ["Offset of field: CK_FUNCTION_LIST_3_0::C_EncryptInit"] + [::std::mem::offset_of!(CK_FUNCTION_LIST_3_0, C_EncryptInit) - 234usize]; + ["Offset of field: CK_FUNCTION_LIST_3_0::C_Encrypt"] + [::std::mem::offset_of!(CK_FUNCTION_LIST_3_0, C_Encrypt) - 242usize]; + ["Offset of field: CK_FUNCTION_LIST_3_0::C_EncryptUpdate"] + [::std::mem::offset_of!(CK_FUNCTION_LIST_3_0, C_EncryptUpdate) - 250usize]; + ["Offset of field: CK_FUNCTION_LIST_3_0::C_EncryptFinal"] + [::std::mem::offset_of!(CK_FUNCTION_LIST_3_0, C_EncryptFinal) - 258usize]; + ["Offset of field: CK_FUNCTION_LIST_3_0::C_DecryptInit"] + [::std::mem::offset_of!(CK_FUNCTION_LIST_3_0, C_DecryptInit) - 266usize]; + ["Offset of field: CK_FUNCTION_LIST_3_0::C_Decrypt"] + [::std::mem::offset_of!(CK_FUNCTION_LIST_3_0, C_Decrypt) - 274usize]; + ["Offset of field: CK_FUNCTION_LIST_3_0::C_DecryptUpdate"] + [::std::mem::offset_of!(CK_FUNCTION_LIST_3_0, C_DecryptUpdate) - 282usize]; + ["Offset of field: CK_FUNCTION_LIST_3_0::C_DecryptFinal"] + [::std::mem::offset_of!(CK_FUNCTION_LIST_3_0, C_DecryptFinal) - 290usize]; + ["Offset of field: CK_FUNCTION_LIST_3_0::C_DigestInit"] + [::std::mem::offset_of!(CK_FUNCTION_LIST_3_0, C_DigestInit) - 298usize]; + ["Offset of field: CK_FUNCTION_LIST_3_0::C_Digest"] + [::std::mem::offset_of!(CK_FUNCTION_LIST_3_0, C_Digest) - 306usize]; + ["Offset of field: CK_FUNCTION_LIST_3_0::C_DigestUpdate"] + [::std::mem::offset_of!(CK_FUNCTION_LIST_3_0, C_DigestUpdate) - 314usize]; + ["Offset of field: CK_FUNCTION_LIST_3_0::C_DigestKey"] + [::std::mem::offset_of!(CK_FUNCTION_LIST_3_0, C_DigestKey) - 322usize]; + ["Offset of field: CK_FUNCTION_LIST_3_0::C_DigestFinal"] + [::std::mem::offset_of!(CK_FUNCTION_LIST_3_0, C_DigestFinal) - 330usize]; + ["Offset of field: CK_FUNCTION_LIST_3_0::C_SignInit"] + [::std::mem::offset_of!(CK_FUNCTION_LIST_3_0, C_SignInit) - 338usize]; + ["Offset of field: CK_FUNCTION_LIST_3_0::C_Sign"] + [::std::mem::offset_of!(CK_FUNCTION_LIST_3_0, C_Sign) - 346usize]; + ["Offset of field: CK_FUNCTION_LIST_3_0::C_SignUpdate"] + [::std::mem::offset_of!(CK_FUNCTION_LIST_3_0, C_SignUpdate) - 354usize]; + ["Offset of field: CK_FUNCTION_LIST_3_0::C_SignFinal"] + [::std::mem::offset_of!(CK_FUNCTION_LIST_3_0, C_SignFinal) - 362usize]; + ["Offset of field: CK_FUNCTION_LIST_3_0::C_SignRecoverInit"] + [::std::mem::offset_of!(CK_FUNCTION_LIST_3_0, C_SignRecoverInit) - 370usize]; + ["Offset of field: CK_FUNCTION_LIST_3_0::C_SignRecover"] + [::std::mem::offset_of!(CK_FUNCTION_LIST_3_0, C_SignRecover) - 378usize]; + ["Offset of field: CK_FUNCTION_LIST_3_0::C_VerifyInit"] + [::std::mem::offset_of!(CK_FUNCTION_LIST_3_0, C_VerifyInit) - 386usize]; + ["Offset of field: CK_FUNCTION_LIST_3_0::C_Verify"] + [::std::mem::offset_of!(CK_FUNCTION_LIST_3_0, C_Verify) - 394usize]; + ["Offset of field: CK_FUNCTION_LIST_3_0::C_VerifyUpdate"] + [::std::mem::offset_of!(CK_FUNCTION_LIST_3_0, C_VerifyUpdate) - 402usize]; + ["Offset of field: CK_FUNCTION_LIST_3_0::C_VerifyFinal"] + [::std::mem::offset_of!(CK_FUNCTION_LIST_3_0, C_VerifyFinal) - 410usize]; + ["Offset of field: CK_FUNCTION_LIST_3_0::C_VerifyRecoverInit"] + [::std::mem::offset_of!(CK_FUNCTION_LIST_3_0, C_VerifyRecoverInit) - 418usize]; + ["Offset of field: CK_FUNCTION_LIST_3_0::C_VerifyRecover"] + [::std::mem::offset_of!(CK_FUNCTION_LIST_3_0, C_VerifyRecover) - 426usize]; + ["Offset of field: CK_FUNCTION_LIST_3_0::C_DigestEncryptUpdate"] + [::std::mem::offset_of!(CK_FUNCTION_LIST_3_0, C_DigestEncryptUpdate) - 434usize]; + ["Offset of field: CK_FUNCTION_LIST_3_0::C_DecryptDigestUpdate"] + [::std::mem::offset_of!(CK_FUNCTION_LIST_3_0, C_DecryptDigestUpdate) - 442usize]; + ["Offset of field: CK_FUNCTION_LIST_3_0::C_SignEncryptUpdate"] + [::std::mem::offset_of!(CK_FUNCTION_LIST_3_0, C_SignEncryptUpdate) - 450usize]; + ["Offset of field: CK_FUNCTION_LIST_3_0::C_DecryptVerifyUpdate"] + [::std::mem::offset_of!(CK_FUNCTION_LIST_3_0, C_DecryptVerifyUpdate) - 458usize]; + ["Offset of field: CK_FUNCTION_LIST_3_0::C_GenerateKey"] + [::std::mem::offset_of!(CK_FUNCTION_LIST_3_0, C_GenerateKey) - 466usize]; + ["Offset of field: CK_FUNCTION_LIST_3_0::C_GenerateKeyPair"] + [::std::mem::offset_of!(CK_FUNCTION_LIST_3_0, C_GenerateKeyPair) - 474usize]; + ["Offset of field: CK_FUNCTION_LIST_3_0::C_WrapKey"] + [::std::mem::offset_of!(CK_FUNCTION_LIST_3_0, C_WrapKey) - 482usize]; + ["Offset of field: CK_FUNCTION_LIST_3_0::C_UnwrapKey"] + [::std::mem::offset_of!(CK_FUNCTION_LIST_3_0, C_UnwrapKey) - 490usize]; + ["Offset of field: CK_FUNCTION_LIST_3_0::C_DeriveKey"] + [::std::mem::offset_of!(CK_FUNCTION_LIST_3_0, C_DeriveKey) - 498usize]; + ["Offset of field: CK_FUNCTION_LIST_3_0::C_SeedRandom"] + [::std::mem::offset_of!(CK_FUNCTION_LIST_3_0, C_SeedRandom) - 506usize]; + ["Offset of field: CK_FUNCTION_LIST_3_0::C_GenerateRandom"] + [::std::mem::offset_of!(CK_FUNCTION_LIST_3_0, C_GenerateRandom) - 514usize]; + ["Offset of field: CK_FUNCTION_LIST_3_0::C_GetFunctionStatus"] + [::std::mem::offset_of!(CK_FUNCTION_LIST_3_0, C_GetFunctionStatus) - 522usize]; + ["Offset of field: CK_FUNCTION_LIST_3_0::C_CancelFunction"] + [::std::mem::offset_of!(CK_FUNCTION_LIST_3_0, C_CancelFunction) - 530usize]; + ["Offset of field: CK_FUNCTION_LIST_3_0::C_WaitForSlotEvent"] + [::std::mem::offset_of!(CK_FUNCTION_LIST_3_0, C_WaitForSlotEvent) - 538usize]; + ["Offset of field: CK_FUNCTION_LIST_3_0::C_GetInterfaceList"] + [::std::mem::offset_of!(CK_FUNCTION_LIST_3_0, C_GetInterfaceList) - 546usize]; + ["Offset of field: CK_FUNCTION_LIST_3_0::C_GetInterface"] + [::std::mem::offset_of!(CK_FUNCTION_LIST_3_0, C_GetInterface) - 554usize]; + ["Offset of field: CK_FUNCTION_LIST_3_0::C_LoginUser"] + [::std::mem::offset_of!(CK_FUNCTION_LIST_3_0, C_LoginUser) - 562usize]; + ["Offset of field: CK_FUNCTION_LIST_3_0::C_SessionCancel"] + [::std::mem::offset_of!(CK_FUNCTION_LIST_3_0, C_SessionCancel) - 570usize]; + ["Offset of field: CK_FUNCTION_LIST_3_0::C_MessageEncryptInit"] + [::std::mem::offset_of!(CK_FUNCTION_LIST_3_0, C_MessageEncryptInit) - 578usize]; + ["Offset of field: CK_FUNCTION_LIST_3_0::C_EncryptMessage"] + [::std::mem::offset_of!(CK_FUNCTION_LIST_3_0, C_EncryptMessage) - 586usize]; + ["Offset of field: CK_FUNCTION_LIST_3_0::C_EncryptMessageBegin"] + [::std::mem::offset_of!(CK_FUNCTION_LIST_3_0, C_EncryptMessageBegin) - 594usize]; + ["Offset of field: CK_FUNCTION_LIST_3_0::C_EncryptMessageNext"] + [::std::mem::offset_of!(CK_FUNCTION_LIST_3_0, C_EncryptMessageNext) - 602usize]; + ["Offset of field: CK_FUNCTION_LIST_3_0::C_MessageEncryptFinal"] + [::std::mem::offset_of!(CK_FUNCTION_LIST_3_0, C_MessageEncryptFinal) - 610usize]; + ["Offset of field: CK_FUNCTION_LIST_3_0::C_MessageDecryptInit"] + [::std::mem::offset_of!(CK_FUNCTION_LIST_3_0, C_MessageDecryptInit) - 618usize]; + ["Offset of field: CK_FUNCTION_LIST_3_0::C_DecryptMessage"] + [::std::mem::offset_of!(CK_FUNCTION_LIST_3_0, C_DecryptMessage) - 626usize]; + ["Offset of field: CK_FUNCTION_LIST_3_0::C_DecryptMessageBegin"] + [::std::mem::offset_of!(CK_FUNCTION_LIST_3_0, C_DecryptMessageBegin) - 634usize]; + ["Offset of field: CK_FUNCTION_LIST_3_0::C_DecryptMessageNext"] + [::std::mem::offset_of!(CK_FUNCTION_LIST_3_0, C_DecryptMessageNext) - 642usize]; + ["Offset of field: CK_FUNCTION_LIST_3_0::C_MessageDecryptFinal"] + [::std::mem::offset_of!(CK_FUNCTION_LIST_3_0, C_MessageDecryptFinal) - 650usize]; + ["Offset of field: CK_FUNCTION_LIST_3_0::C_MessageSignInit"] + [::std::mem::offset_of!(CK_FUNCTION_LIST_3_0, C_MessageSignInit) - 658usize]; + ["Offset of field: CK_FUNCTION_LIST_3_0::C_SignMessage"] + [::std::mem::offset_of!(CK_FUNCTION_LIST_3_0, C_SignMessage) - 666usize]; + ["Offset of field: CK_FUNCTION_LIST_3_0::C_SignMessageBegin"] + [::std::mem::offset_of!(CK_FUNCTION_LIST_3_0, C_SignMessageBegin) - 674usize]; + ["Offset of field: CK_FUNCTION_LIST_3_0::C_SignMessageNext"] + [::std::mem::offset_of!(CK_FUNCTION_LIST_3_0, C_SignMessageNext) - 682usize]; + ["Offset of field: CK_FUNCTION_LIST_3_0::C_MessageSignFinal"] + [::std::mem::offset_of!(CK_FUNCTION_LIST_3_0, C_MessageSignFinal) - 690usize]; + ["Offset of field: CK_FUNCTION_LIST_3_0::C_MessageVerifyInit"] + [::std::mem::offset_of!(CK_FUNCTION_LIST_3_0, C_MessageVerifyInit) - 698usize]; + ["Offset of field: CK_FUNCTION_LIST_3_0::C_VerifyMessage"] + [::std::mem::offset_of!(CK_FUNCTION_LIST_3_0, C_VerifyMessage) - 706usize]; + ["Offset of field: CK_FUNCTION_LIST_3_0::C_VerifyMessageBegin"] + [::std::mem::offset_of!(CK_FUNCTION_LIST_3_0, C_VerifyMessageBegin) - 714usize]; + ["Offset of field: CK_FUNCTION_LIST_3_0::C_VerifyMessageNext"] + [::std::mem::offset_of!(CK_FUNCTION_LIST_3_0, C_VerifyMessageNext) - 722usize]; + ["Offset of field: CK_FUNCTION_LIST_3_0::C_MessageVerifyFinal"] + [::std::mem::offset_of!(CK_FUNCTION_LIST_3_0, C_MessageVerifyFinal) - 730usize]; +}; #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone)] pub struct CK_FUNCTION_LIST { @@ -11015,708 +5702,146 @@ pub struct CK_FUNCTION_LIST { pub C_CancelFunction: CK_C_CancelFunction, pub C_WaitForSlotEvent: CK_C_WaitForSlotEvent, } -#[test] -fn bindgen_test_layout_CK_FUNCTION_LIST() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 546usize, - concat!("Size of: ", stringify!(CK_FUNCTION_LIST)) - ); - assert_eq!( - ::std::mem::align_of::(), - 1usize, - concat!("Alignment of ", stringify!(CK_FUNCTION_LIST)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).version) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(CK_FUNCTION_LIST), - "::", - stringify!(version) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).C_Initialize) as usize - ptr as usize }, - 2usize, - concat!( - "Offset of field: ", - stringify!(CK_FUNCTION_LIST), - "::", - stringify!(C_Initialize) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).C_Finalize) as usize - ptr as usize }, - 10usize, - concat!( - "Offset of field: ", - stringify!(CK_FUNCTION_LIST), - "::", - stringify!(C_Finalize) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).C_GetInfo) as usize - ptr as usize }, - 18usize, - concat!( - "Offset of field: ", - stringify!(CK_FUNCTION_LIST), - "::", - stringify!(C_GetInfo) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).C_GetFunctionList) as usize - ptr as usize }, - 26usize, - concat!( - "Offset of field: ", - stringify!(CK_FUNCTION_LIST), - "::", - stringify!(C_GetFunctionList) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).C_GetSlotList) as usize - ptr as usize }, - 34usize, - concat!( - "Offset of field: ", - stringify!(CK_FUNCTION_LIST), - "::", - stringify!(C_GetSlotList) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).C_GetSlotInfo) as usize - ptr as usize }, - 42usize, - concat!( - "Offset of field: ", - stringify!(CK_FUNCTION_LIST), - "::", - stringify!(C_GetSlotInfo) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).C_GetTokenInfo) as usize - ptr as usize }, - 50usize, - concat!( - "Offset of field: ", - stringify!(CK_FUNCTION_LIST), - "::", - stringify!(C_GetTokenInfo) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).C_GetMechanismList) as usize - ptr as usize }, - 58usize, - concat!( - "Offset of field: ", - stringify!(CK_FUNCTION_LIST), - "::", - stringify!(C_GetMechanismList) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).C_GetMechanismInfo) as usize - ptr as usize }, - 66usize, - concat!( - "Offset of field: ", - stringify!(CK_FUNCTION_LIST), - "::", - stringify!(C_GetMechanismInfo) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).C_InitToken) as usize - ptr as usize }, - 74usize, - concat!( - "Offset of field: ", - stringify!(CK_FUNCTION_LIST), - "::", - stringify!(C_InitToken) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).C_InitPIN) as usize - ptr as usize }, - 82usize, - concat!( - "Offset of field: ", - stringify!(CK_FUNCTION_LIST), - "::", - stringify!(C_InitPIN) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).C_SetPIN) as usize - ptr as usize }, - 90usize, - concat!( - "Offset of field: ", - stringify!(CK_FUNCTION_LIST), - "::", - stringify!(C_SetPIN) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).C_OpenSession) as usize - ptr as usize }, - 98usize, - concat!( - "Offset of field: ", - stringify!(CK_FUNCTION_LIST), - "::", - stringify!(C_OpenSession) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).C_CloseSession) as usize - ptr as usize }, - 106usize, - concat!( - "Offset of field: ", - stringify!(CK_FUNCTION_LIST), - "::", - stringify!(C_CloseSession) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).C_CloseAllSessions) as usize - ptr as usize }, - 114usize, - concat!( - "Offset of field: ", - stringify!(CK_FUNCTION_LIST), - "::", - stringify!(C_CloseAllSessions) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).C_GetSessionInfo) as usize - ptr as usize }, - 122usize, - concat!( - "Offset of field: ", - stringify!(CK_FUNCTION_LIST), - "::", - stringify!(C_GetSessionInfo) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).C_GetOperationState) as usize - ptr as usize }, - 130usize, - concat!( - "Offset of field: ", - stringify!(CK_FUNCTION_LIST), - "::", - stringify!(C_GetOperationState) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).C_SetOperationState) as usize - ptr as usize }, - 138usize, - concat!( - "Offset of field: ", - stringify!(CK_FUNCTION_LIST), - "::", - stringify!(C_SetOperationState) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).C_Login) as usize - ptr as usize }, - 146usize, - concat!( - "Offset of field: ", - stringify!(CK_FUNCTION_LIST), - "::", - stringify!(C_Login) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).C_Logout) as usize - ptr as usize }, - 154usize, - concat!( - "Offset of field: ", - stringify!(CK_FUNCTION_LIST), - "::", - stringify!(C_Logout) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).C_CreateObject) as usize - ptr as usize }, - 162usize, - concat!( - "Offset of field: ", - stringify!(CK_FUNCTION_LIST), - "::", - stringify!(C_CreateObject) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).C_CopyObject) as usize - ptr as usize }, - 170usize, - concat!( - "Offset of field: ", - stringify!(CK_FUNCTION_LIST), - "::", - stringify!(C_CopyObject) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).C_DestroyObject) as usize - ptr as usize }, - 178usize, - concat!( - "Offset of field: ", - stringify!(CK_FUNCTION_LIST), - "::", - stringify!(C_DestroyObject) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).C_GetObjectSize) as usize - ptr as usize }, - 186usize, - concat!( - "Offset of field: ", - stringify!(CK_FUNCTION_LIST), - "::", - stringify!(C_GetObjectSize) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).C_GetAttributeValue) as usize - ptr as usize }, - 194usize, - concat!( - "Offset of field: ", - stringify!(CK_FUNCTION_LIST), - "::", - stringify!(C_GetAttributeValue) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).C_SetAttributeValue) as usize - ptr as usize }, - 202usize, - concat!( - "Offset of field: ", - stringify!(CK_FUNCTION_LIST), - "::", - stringify!(C_SetAttributeValue) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).C_FindObjectsInit) as usize - ptr as usize }, - 210usize, - concat!( - "Offset of field: ", - stringify!(CK_FUNCTION_LIST), - "::", - stringify!(C_FindObjectsInit) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).C_FindObjects) as usize - ptr as usize }, - 218usize, - concat!( - "Offset of field: ", - stringify!(CK_FUNCTION_LIST), - "::", - stringify!(C_FindObjects) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).C_FindObjectsFinal) as usize - ptr as usize }, - 226usize, - concat!( - "Offset of field: ", - stringify!(CK_FUNCTION_LIST), - "::", - stringify!(C_FindObjectsFinal) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).C_EncryptInit) as usize - ptr as usize }, - 234usize, - concat!( - "Offset of field: ", - stringify!(CK_FUNCTION_LIST), - "::", - stringify!(C_EncryptInit) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).C_Encrypt) as usize - ptr as usize }, - 242usize, - concat!( - "Offset of field: ", - stringify!(CK_FUNCTION_LIST), - "::", - stringify!(C_Encrypt) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).C_EncryptUpdate) as usize - ptr as usize }, - 250usize, - concat!( - "Offset of field: ", - stringify!(CK_FUNCTION_LIST), - "::", - stringify!(C_EncryptUpdate) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).C_EncryptFinal) as usize - ptr as usize }, - 258usize, - concat!( - "Offset of field: ", - stringify!(CK_FUNCTION_LIST), - "::", - stringify!(C_EncryptFinal) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).C_DecryptInit) as usize - ptr as usize }, - 266usize, - concat!( - "Offset of field: ", - stringify!(CK_FUNCTION_LIST), - "::", - stringify!(C_DecryptInit) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).C_Decrypt) as usize - ptr as usize }, - 274usize, - concat!( - "Offset of field: ", - stringify!(CK_FUNCTION_LIST), - "::", - stringify!(C_Decrypt) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).C_DecryptUpdate) as usize - ptr as usize }, - 282usize, - concat!( - "Offset of field: ", - stringify!(CK_FUNCTION_LIST), - "::", - stringify!(C_DecryptUpdate) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).C_DecryptFinal) as usize - ptr as usize }, - 290usize, - concat!( - "Offset of field: ", - stringify!(CK_FUNCTION_LIST), - "::", - stringify!(C_DecryptFinal) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).C_DigestInit) as usize - ptr as usize }, - 298usize, - concat!( - "Offset of field: ", - stringify!(CK_FUNCTION_LIST), - "::", - stringify!(C_DigestInit) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).C_Digest) as usize - ptr as usize }, - 306usize, - concat!( - "Offset of field: ", - stringify!(CK_FUNCTION_LIST), - "::", - stringify!(C_Digest) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).C_DigestUpdate) as usize - ptr as usize }, - 314usize, - concat!( - "Offset of field: ", - stringify!(CK_FUNCTION_LIST), - "::", - stringify!(C_DigestUpdate) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).C_DigestKey) as usize - ptr as usize }, - 322usize, - concat!( - "Offset of field: ", - stringify!(CK_FUNCTION_LIST), - "::", - stringify!(C_DigestKey) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).C_DigestFinal) as usize - ptr as usize }, - 330usize, - concat!( - "Offset of field: ", - stringify!(CK_FUNCTION_LIST), - "::", - stringify!(C_DigestFinal) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).C_SignInit) as usize - ptr as usize }, - 338usize, - concat!( - "Offset of field: ", - stringify!(CK_FUNCTION_LIST), - "::", - stringify!(C_SignInit) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).C_Sign) as usize - ptr as usize }, - 346usize, - concat!( - "Offset of field: ", - stringify!(CK_FUNCTION_LIST), - "::", - stringify!(C_Sign) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).C_SignUpdate) as usize - ptr as usize }, - 354usize, - concat!( - "Offset of field: ", - stringify!(CK_FUNCTION_LIST), - "::", - stringify!(C_SignUpdate) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).C_SignFinal) as usize - ptr as usize }, - 362usize, - concat!( - "Offset of field: ", - stringify!(CK_FUNCTION_LIST), - "::", - stringify!(C_SignFinal) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).C_SignRecoverInit) as usize - ptr as usize }, - 370usize, - concat!( - "Offset of field: ", - stringify!(CK_FUNCTION_LIST), - "::", - stringify!(C_SignRecoverInit) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).C_SignRecover) as usize - ptr as usize }, - 378usize, - concat!( - "Offset of field: ", - stringify!(CK_FUNCTION_LIST), - "::", - stringify!(C_SignRecover) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).C_VerifyInit) as usize - ptr as usize }, - 386usize, - concat!( - "Offset of field: ", - stringify!(CK_FUNCTION_LIST), - "::", - stringify!(C_VerifyInit) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).C_Verify) as usize - ptr as usize }, - 394usize, - concat!( - "Offset of field: ", - stringify!(CK_FUNCTION_LIST), - "::", - stringify!(C_Verify) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).C_VerifyUpdate) as usize - ptr as usize }, - 402usize, - concat!( - "Offset of field: ", - stringify!(CK_FUNCTION_LIST), - "::", - stringify!(C_VerifyUpdate) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).C_VerifyFinal) as usize - ptr as usize }, - 410usize, - concat!( - "Offset of field: ", - stringify!(CK_FUNCTION_LIST), - "::", - stringify!(C_VerifyFinal) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).C_VerifyRecoverInit) as usize - ptr as usize }, - 418usize, - concat!( - "Offset of field: ", - stringify!(CK_FUNCTION_LIST), - "::", - stringify!(C_VerifyRecoverInit) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).C_VerifyRecover) as usize - ptr as usize }, - 426usize, - concat!( - "Offset of field: ", - stringify!(CK_FUNCTION_LIST), - "::", - stringify!(C_VerifyRecover) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).C_DigestEncryptUpdate) as usize - ptr as usize }, - 434usize, - concat!( - "Offset of field: ", - stringify!(CK_FUNCTION_LIST), - "::", - stringify!(C_DigestEncryptUpdate) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).C_DecryptDigestUpdate) as usize - ptr as usize }, - 442usize, - concat!( - "Offset of field: ", - stringify!(CK_FUNCTION_LIST), - "::", - stringify!(C_DecryptDigestUpdate) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).C_SignEncryptUpdate) as usize - ptr as usize }, - 450usize, - concat!( - "Offset of field: ", - stringify!(CK_FUNCTION_LIST), - "::", - stringify!(C_SignEncryptUpdate) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).C_DecryptVerifyUpdate) as usize - ptr as usize }, - 458usize, - concat!( - "Offset of field: ", - stringify!(CK_FUNCTION_LIST), - "::", - stringify!(C_DecryptVerifyUpdate) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).C_GenerateKey) as usize - ptr as usize }, - 466usize, - concat!( - "Offset of field: ", - stringify!(CK_FUNCTION_LIST), - "::", - stringify!(C_GenerateKey) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).C_GenerateKeyPair) as usize - ptr as usize }, - 474usize, - concat!( - "Offset of field: ", - stringify!(CK_FUNCTION_LIST), - "::", - stringify!(C_GenerateKeyPair) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).C_WrapKey) as usize - ptr as usize }, - 482usize, - concat!( - "Offset of field: ", - stringify!(CK_FUNCTION_LIST), - "::", - stringify!(C_WrapKey) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).C_UnwrapKey) as usize - ptr as usize }, - 490usize, - concat!( - "Offset of field: ", - stringify!(CK_FUNCTION_LIST), - "::", - stringify!(C_UnwrapKey) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).C_DeriveKey) as usize - ptr as usize }, - 498usize, - concat!( - "Offset of field: ", - stringify!(CK_FUNCTION_LIST), - "::", - stringify!(C_DeriveKey) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).C_SeedRandom) as usize - ptr as usize }, - 506usize, - concat!( - "Offset of field: ", - stringify!(CK_FUNCTION_LIST), - "::", - stringify!(C_SeedRandom) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).C_GenerateRandom) as usize - ptr as usize }, - 514usize, - concat!( - "Offset of field: ", - stringify!(CK_FUNCTION_LIST), - "::", - stringify!(C_GenerateRandom) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).C_GetFunctionStatus) as usize - ptr as usize }, - 522usize, - concat!( - "Offset of field: ", - stringify!(CK_FUNCTION_LIST), - "::", - stringify!(C_GetFunctionStatus) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).C_CancelFunction) as usize - ptr as usize }, - 530usize, - concat!( - "Offset of field: ", - stringify!(CK_FUNCTION_LIST), - "::", - stringify!(C_CancelFunction) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).C_WaitForSlotEvent) as usize - ptr as usize }, - 538usize, - concat!( - "Offset of field: ", - stringify!(CK_FUNCTION_LIST), - "::", - stringify!(C_WaitForSlotEvent) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of CK_FUNCTION_LIST"][::std::mem::size_of::() - 546usize]; + ["Alignment of CK_FUNCTION_LIST"][::std::mem::align_of::() - 1usize]; + ["Offset of field: CK_FUNCTION_LIST::version"] + [::std::mem::offset_of!(CK_FUNCTION_LIST, version) - 0usize]; + ["Offset of field: CK_FUNCTION_LIST::C_Initialize"] + [::std::mem::offset_of!(CK_FUNCTION_LIST, C_Initialize) - 2usize]; + ["Offset of field: CK_FUNCTION_LIST::C_Finalize"] + [::std::mem::offset_of!(CK_FUNCTION_LIST, C_Finalize) - 10usize]; + ["Offset of field: CK_FUNCTION_LIST::C_GetInfo"] + [::std::mem::offset_of!(CK_FUNCTION_LIST, C_GetInfo) - 18usize]; + ["Offset of field: CK_FUNCTION_LIST::C_GetFunctionList"] + [::std::mem::offset_of!(CK_FUNCTION_LIST, C_GetFunctionList) - 26usize]; + ["Offset of field: CK_FUNCTION_LIST::C_GetSlotList"] + [::std::mem::offset_of!(CK_FUNCTION_LIST, C_GetSlotList) - 34usize]; + ["Offset of field: CK_FUNCTION_LIST::C_GetSlotInfo"] + [::std::mem::offset_of!(CK_FUNCTION_LIST, C_GetSlotInfo) - 42usize]; + ["Offset of field: CK_FUNCTION_LIST::C_GetTokenInfo"] + [::std::mem::offset_of!(CK_FUNCTION_LIST, C_GetTokenInfo) - 50usize]; + ["Offset of field: CK_FUNCTION_LIST::C_GetMechanismList"] + [::std::mem::offset_of!(CK_FUNCTION_LIST, C_GetMechanismList) - 58usize]; + ["Offset of field: CK_FUNCTION_LIST::C_GetMechanismInfo"] + [::std::mem::offset_of!(CK_FUNCTION_LIST, C_GetMechanismInfo) - 66usize]; + ["Offset of field: CK_FUNCTION_LIST::C_InitToken"] + [::std::mem::offset_of!(CK_FUNCTION_LIST, C_InitToken) - 74usize]; + ["Offset of field: CK_FUNCTION_LIST::C_InitPIN"] + [::std::mem::offset_of!(CK_FUNCTION_LIST, C_InitPIN) - 82usize]; + ["Offset of field: CK_FUNCTION_LIST::C_SetPIN"] + [::std::mem::offset_of!(CK_FUNCTION_LIST, C_SetPIN) - 90usize]; + ["Offset of field: CK_FUNCTION_LIST::C_OpenSession"] + [::std::mem::offset_of!(CK_FUNCTION_LIST, C_OpenSession) - 98usize]; + ["Offset of field: CK_FUNCTION_LIST::C_CloseSession"] + [::std::mem::offset_of!(CK_FUNCTION_LIST, C_CloseSession) - 106usize]; + ["Offset of field: CK_FUNCTION_LIST::C_CloseAllSessions"] + [::std::mem::offset_of!(CK_FUNCTION_LIST, C_CloseAllSessions) - 114usize]; + ["Offset of field: CK_FUNCTION_LIST::C_GetSessionInfo"] + [::std::mem::offset_of!(CK_FUNCTION_LIST, C_GetSessionInfo) - 122usize]; + ["Offset of field: CK_FUNCTION_LIST::C_GetOperationState"] + [::std::mem::offset_of!(CK_FUNCTION_LIST, C_GetOperationState) - 130usize]; + ["Offset of field: CK_FUNCTION_LIST::C_SetOperationState"] + [::std::mem::offset_of!(CK_FUNCTION_LIST, C_SetOperationState) - 138usize]; + ["Offset of field: CK_FUNCTION_LIST::C_Login"] + [::std::mem::offset_of!(CK_FUNCTION_LIST, C_Login) - 146usize]; + ["Offset of field: CK_FUNCTION_LIST::C_Logout"] + [::std::mem::offset_of!(CK_FUNCTION_LIST, C_Logout) - 154usize]; + ["Offset of field: CK_FUNCTION_LIST::C_CreateObject"] + [::std::mem::offset_of!(CK_FUNCTION_LIST, C_CreateObject) - 162usize]; + ["Offset of field: CK_FUNCTION_LIST::C_CopyObject"] + [::std::mem::offset_of!(CK_FUNCTION_LIST, C_CopyObject) - 170usize]; + ["Offset of field: CK_FUNCTION_LIST::C_DestroyObject"] + [::std::mem::offset_of!(CK_FUNCTION_LIST, C_DestroyObject) - 178usize]; + ["Offset of field: CK_FUNCTION_LIST::C_GetObjectSize"] + [::std::mem::offset_of!(CK_FUNCTION_LIST, C_GetObjectSize) - 186usize]; + ["Offset of field: CK_FUNCTION_LIST::C_GetAttributeValue"] + [::std::mem::offset_of!(CK_FUNCTION_LIST, C_GetAttributeValue) - 194usize]; + ["Offset of field: CK_FUNCTION_LIST::C_SetAttributeValue"] + [::std::mem::offset_of!(CK_FUNCTION_LIST, C_SetAttributeValue) - 202usize]; + ["Offset of field: CK_FUNCTION_LIST::C_FindObjectsInit"] + [::std::mem::offset_of!(CK_FUNCTION_LIST, C_FindObjectsInit) - 210usize]; + ["Offset of field: CK_FUNCTION_LIST::C_FindObjects"] + [::std::mem::offset_of!(CK_FUNCTION_LIST, C_FindObjects) - 218usize]; + ["Offset of field: CK_FUNCTION_LIST::C_FindObjectsFinal"] + [::std::mem::offset_of!(CK_FUNCTION_LIST, C_FindObjectsFinal) - 226usize]; + ["Offset of field: CK_FUNCTION_LIST::C_EncryptInit"] + [::std::mem::offset_of!(CK_FUNCTION_LIST, C_EncryptInit) - 234usize]; + ["Offset of field: CK_FUNCTION_LIST::C_Encrypt"] + [::std::mem::offset_of!(CK_FUNCTION_LIST, C_Encrypt) - 242usize]; + ["Offset of field: CK_FUNCTION_LIST::C_EncryptUpdate"] + [::std::mem::offset_of!(CK_FUNCTION_LIST, C_EncryptUpdate) - 250usize]; + ["Offset of field: CK_FUNCTION_LIST::C_EncryptFinal"] + [::std::mem::offset_of!(CK_FUNCTION_LIST, C_EncryptFinal) - 258usize]; + ["Offset of field: CK_FUNCTION_LIST::C_DecryptInit"] + [::std::mem::offset_of!(CK_FUNCTION_LIST, C_DecryptInit) - 266usize]; + ["Offset of field: CK_FUNCTION_LIST::C_Decrypt"] + [::std::mem::offset_of!(CK_FUNCTION_LIST, C_Decrypt) - 274usize]; + ["Offset of field: CK_FUNCTION_LIST::C_DecryptUpdate"] + [::std::mem::offset_of!(CK_FUNCTION_LIST, C_DecryptUpdate) - 282usize]; + ["Offset of field: CK_FUNCTION_LIST::C_DecryptFinal"] + [::std::mem::offset_of!(CK_FUNCTION_LIST, C_DecryptFinal) - 290usize]; + ["Offset of field: CK_FUNCTION_LIST::C_DigestInit"] + [::std::mem::offset_of!(CK_FUNCTION_LIST, C_DigestInit) - 298usize]; + ["Offset of field: CK_FUNCTION_LIST::C_Digest"] + [::std::mem::offset_of!(CK_FUNCTION_LIST, C_Digest) - 306usize]; + ["Offset of field: CK_FUNCTION_LIST::C_DigestUpdate"] + [::std::mem::offset_of!(CK_FUNCTION_LIST, C_DigestUpdate) - 314usize]; + ["Offset of field: CK_FUNCTION_LIST::C_DigestKey"] + [::std::mem::offset_of!(CK_FUNCTION_LIST, C_DigestKey) - 322usize]; + ["Offset of field: CK_FUNCTION_LIST::C_DigestFinal"] + [::std::mem::offset_of!(CK_FUNCTION_LIST, C_DigestFinal) - 330usize]; + ["Offset of field: CK_FUNCTION_LIST::C_SignInit"] + [::std::mem::offset_of!(CK_FUNCTION_LIST, C_SignInit) - 338usize]; + ["Offset of field: CK_FUNCTION_LIST::C_Sign"] + [::std::mem::offset_of!(CK_FUNCTION_LIST, C_Sign) - 346usize]; + ["Offset of field: CK_FUNCTION_LIST::C_SignUpdate"] + [::std::mem::offset_of!(CK_FUNCTION_LIST, C_SignUpdate) - 354usize]; + ["Offset of field: CK_FUNCTION_LIST::C_SignFinal"] + [::std::mem::offset_of!(CK_FUNCTION_LIST, C_SignFinal) - 362usize]; + ["Offset of field: CK_FUNCTION_LIST::C_SignRecoverInit"] + [::std::mem::offset_of!(CK_FUNCTION_LIST, C_SignRecoverInit) - 370usize]; + ["Offset of field: CK_FUNCTION_LIST::C_SignRecover"] + [::std::mem::offset_of!(CK_FUNCTION_LIST, C_SignRecover) - 378usize]; + ["Offset of field: CK_FUNCTION_LIST::C_VerifyInit"] + [::std::mem::offset_of!(CK_FUNCTION_LIST, C_VerifyInit) - 386usize]; + ["Offset of field: CK_FUNCTION_LIST::C_Verify"] + [::std::mem::offset_of!(CK_FUNCTION_LIST, C_Verify) - 394usize]; + ["Offset of field: CK_FUNCTION_LIST::C_VerifyUpdate"] + [::std::mem::offset_of!(CK_FUNCTION_LIST, C_VerifyUpdate) - 402usize]; + ["Offset of field: CK_FUNCTION_LIST::C_VerifyFinal"] + [::std::mem::offset_of!(CK_FUNCTION_LIST, C_VerifyFinal) - 410usize]; + ["Offset of field: CK_FUNCTION_LIST::C_VerifyRecoverInit"] + [::std::mem::offset_of!(CK_FUNCTION_LIST, C_VerifyRecoverInit) - 418usize]; + ["Offset of field: CK_FUNCTION_LIST::C_VerifyRecover"] + [::std::mem::offset_of!(CK_FUNCTION_LIST, C_VerifyRecover) - 426usize]; + ["Offset of field: CK_FUNCTION_LIST::C_DigestEncryptUpdate"] + [::std::mem::offset_of!(CK_FUNCTION_LIST, C_DigestEncryptUpdate) - 434usize]; + ["Offset of field: CK_FUNCTION_LIST::C_DecryptDigestUpdate"] + [::std::mem::offset_of!(CK_FUNCTION_LIST, C_DecryptDigestUpdate) - 442usize]; + ["Offset of field: CK_FUNCTION_LIST::C_SignEncryptUpdate"] + [::std::mem::offset_of!(CK_FUNCTION_LIST, C_SignEncryptUpdate) - 450usize]; + ["Offset of field: CK_FUNCTION_LIST::C_DecryptVerifyUpdate"] + [::std::mem::offset_of!(CK_FUNCTION_LIST, C_DecryptVerifyUpdate) - 458usize]; + ["Offset of field: CK_FUNCTION_LIST::C_GenerateKey"] + [::std::mem::offset_of!(CK_FUNCTION_LIST, C_GenerateKey) - 466usize]; + ["Offset of field: CK_FUNCTION_LIST::C_GenerateKeyPair"] + [::std::mem::offset_of!(CK_FUNCTION_LIST, C_GenerateKeyPair) - 474usize]; + ["Offset of field: CK_FUNCTION_LIST::C_WrapKey"] + [::std::mem::offset_of!(CK_FUNCTION_LIST, C_WrapKey) - 482usize]; + ["Offset of field: CK_FUNCTION_LIST::C_UnwrapKey"] + [::std::mem::offset_of!(CK_FUNCTION_LIST, C_UnwrapKey) - 490usize]; + ["Offset of field: CK_FUNCTION_LIST::C_DeriveKey"] + [::std::mem::offset_of!(CK_FUNCTION_LIST, C_DeriveKey) - 498usize]; + ["Offset of field: CK_FUNCTION_LIST::C_SeedRandom"] + [::std::mem::offset_of!(CK_FUNCTION_LIST, C_SeedRandom) - 506usize]; + ["Offset of field: CK_FUNCTION_LIST::C_GenerateRandom"] + [::std::mem::offset_of!(CK_FUNCTION_LIST, C_GenerateRandom) - 514usize]; + ["Offset of field: CK_FUNCTION_LIST::C_GetFunctionStatus"] + [::std::mem::offset_of!(CK_FUNCTION_LIST, C_GetFunctionStatus) - 522usize]; + ["Offset of field: CK_FUNCTION_LIST::C_CancelFunction"] + [::std::mem::offset_of!(CK_FUNCTION_LIST, C_CancelFunction) - 530usize]; + ["Offset of field: CK_FUNCTION_LIST::C_WaitForSlotEvent"] + [::std::mem::offset_of!(CK_FUNCTION_LIST, C_WaitForSlotEvent) - 538usize]; +}; diff --git a/pkcs11-sys/third_party b/pkcs11-sys/third_party deleted file mode 120000 index d838c05a..00000000 --- a/pkcs11-sys/third_party +++ /dev/null @@ -1 +0,0 @@ -../third_party \ No newline at end of file