diff --git a/.codespellrc b/.codespellrc index d838d23f..e8d19a0a 100644 --- a/.codespellrc +++ b/.codespellrc @@ -1,3 +1,3 @@ [codespell] -skip = .git,target,Cargo.lock +skip = .git,target,Cargo.lock,vendor ignore-words-list = crate,keypair diff --git a/cryptoki-sys/build.rs b/cryptoki-sys/build.rs index 47fb3946..48495df9 100644 --- a/cryptoki-sys/build.rs +++ b/cryptoki-sys/build.rs @@ -5,30 +5,6 @@ fn main() { { generate::generate_bindings(); } - - #[cfg(not(feature = "generate-bindings"))] - { - use std::str::FromStr; - use target_lexicon::{Architecture, OperatingSystem, Triple}; - - let target = Triple::from_str(&std::env::var("TARGET").unwrap()) - .expect("Failed to parse target triple"); - match (target.architecture, target.operating_system) { - (Architecture::Arm(_), OperatingSystem::Linux) => {} - (Architecture::Aarch64(_), OperatingSystem::Linux) => {} - (Architecture::X86_64, OperatingSystem::Linux) => {} - (Architecture::X86_32(_), OperatingSystem::Linux) => {} - (Architecture::Powerpc64, OperatingSystem::Linux) => {} - (Architecture::Powerpc64le, OperatingSystem::Linux) => {} - (Architecture::X86_64, OperatingSystem::Darwin) => {} - (Architecture::Aarch64(_), OperatingSystem::Darwin) => {} - (Architecture::X86_64, OperatingSystem::Windows) => {} - (Architecture::X86_64, OperatingSystem::Freebsd) => {} - (arch, os) => { - panic!("Compilation target (architecture, OS) tuple ({}, {}) is not part of the supported tuples. Please compile with the \"generate-bindings\" feature or add support for your platform :)", arch, os); - } - } - } } // Only on a specific feature @@ -81,31 +57,40 @@ mod generate { } pub fn generate_bindings() { - let bindings = bindgen::Builder::default() - .header("pkcs11.h") + let make_generic: bool = std::env::var_os("MAKE_GENERIC_BINDINGS").is_some(); + let mut builder = bindgen::Builder::default(); + if make_generic { + // only WIN32 bindings are "packed". It's easier to "unpack" for other architectures + const GENERIC_PRELUDE: &str = "#define CRYPTOKI_FORCE_WIN32 1\n"; + builder = builder + // layout tests are not generic + .layout_tests(false) + .header_contents("generic-prelude.h", GENERIC_PRELUDE) + } + + builder = builder + .header("platform.h") .dynamic_library_name("Pkcs11") - // The PKCS11 library works in a slightly different way to most shared libraries. We have - // to call `C_GetFunctionList`, which returns a list of pointers to the _actual_ library - // functions. This is the only function we need to create a binding for. - .allowlist_function("C_GetFunctionList") - // This is needed because no types will be generated if `allowlist_function` is used. - // Unsure if this is a bug. - .allowlist_type("*") - .allowlist_file("pkcs11.h") - // See this issue: https://github.com/parallaxsecond/rust-cryptoki/issues/12 - .blocklist_type("max_align_t") + // ~1 is not converted properly + .blocklist_item("CK_UNAVAILABLE_INFORMATION") // Derive the `Debug` trait for the generated structs where possible. .derive_debug(true) // Derive the `Default` trait for the generated structs where possible. .derive_default(true) - .parse_callbacks(Box::new(CargoCallbacks)) - .generate() - .expect("Unable to generate bindings"); + .parse_callbacks(Box::new(CargoCallbacks)); + + let bindings = builder.generate().expect("Unable to generate bindings"); + + let mut data = bindings.to_string(); + if make_generic { + const PACK_ALWAYS: &str = "#[repr(C, packed)]"; + const PACK_WINDOWS: &str = "#[repr(C)]\n#[cfg_attr(windows, repr(packed))]"; + data = data.replace(PACK_ALWAYS, PACK_WINDOWS); + } // Write the bindings to the $OUT_DIR/pkcs11_bindings.rs file. let out_path = std::path::PathBuf::from(std::env::var("OUT_DIR").unwrap()); - bindings - .write_to_file(out_path.join("pkcs11_bindings.rs")) + std::fs::write(out_path.join("pkcs11_bindings.rs"), data) .expect("Couldn't write bindings!"); } } diff --git a/cryptoki-sys/pkcs11.h b/cryptoki-sys/pkcs11.h deleted file mode 100644 index 3d531134..00000000 --- a/cryptoki-sys/pkcs11.h +++ /dev/null @@ -1,1752 +0,0 @@ -/* pkcs11.h - Copyright 2006, 2007 g10 Code GmbH - Copyright 2006 Andreas Jellinghaus - Copyright 2017 Red Hat, Inc. - - This file is free software; as a special exception the author gives - unlimited permission to copy and/or distribute it, with or without - modifications, as long as this notice is preserved. - - This file is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY, to the extent permitted by law; without even - the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - PURPOSE. */ - -/* Please submit any changes back to the p11-kit project at - https://github.com/p11-glue/p11-kit/, so that - they can be picked up by other projects from there as well. */ - -/* This file is a modified implementation of the PKCS #11 standard by - OASIS group. It is mostly a drop-in replacement, with the - following change: - - This header file does not require any macro definitions by the user - (like CK_DEFINE_FUNCTION etc). In fact, it defines those macros - for you (if useful, some are missing, let me know if you need - more). - - There is an additional API available that does comply better to the - GNU coding standard. It can be switched on by defining - CRYPTOKI_GNU before including this header file. For this, the - following changes are made to the specification: - - All structure types are changed to a "struct ck_foo" where CK_FOO - is the type name in PKCS #11. - - All non-structure types are changed to ck_foo_t where CK_FOO is the - lowercase version of the type name in PKCS #11. The basic types - (CK_ULONG et al.) are removed without substitute. - - All members of structures are modified in the following way: Type - indication prefixes are removed, and underscore characters are - inserted before words. Then the result is lowercased. - - Note that function names are still in the original case, as they - need for ABI compatibility. - - CK_FALSE, CK_TRUE and NULL_PTR are removed without substitute. Use - . - - If CRYPTOKI_COMPAT is defined before including this header file, - then none of the API changes above take place, and the API is the - one defined by the PKCS #11 standard. */ - -#ifndef PKCS11_H -#define PKCS11_H 1 - -#if defined(__cplusplus) -extern "C" { -#endif - - -/* The version of cryptoki we implement. The revision is changed with - each modification of this file. */ -#define CRYPTOKI_VERSION_MAJOR 2 -#define CRYPTOKI_VERSION_MINOR 40 -#define P11_KIT_CRYPTOKI_VERSION_REVISION 0 - - -/* Compatibility interface is default, unless CRYPTOKI_GNU is - given. */ -#ifndef CRYPTOKI_GNU -#ifndef CRYPTOKI_COMPAT -#define CRYPTOKI_COMPAT 1 -#endif -#endif - -/* System dependencies. */ - -#if defined(_WIN32) || defined(CRYPTOKI_FORCE_WIN32) - -/* There is a matching pop below. */ -#pragma pack(push, cryptoki, 1) - -#ifdef CRYPTOKI_EXPORTS -#define CK_SPEC __declspec(dllexport) -#else -#define CK_SPEC __declspec(dllimport) -#endif - -#else - -#define CK_SPEC - -#endif - - -#ifdef CRYPTOKI_COMPAT - /* If we are in compatibility mode, switch all exposed names to the - PKCS #11 variant. There are corresponding #undefs below. */ - -#define ck_flags_t CK_FLAGS -#define ck_version _CK_VERSION - -#define ck_info _CK_INFO -#define cryptoki_version cryptokiVersion -#define manufacturer_id manufacturerID -#define library_description libraryDescription -#define library_version libraryVersion - -#define ck_notification_t CK_NOTIFICATION -#define ck_slot_id_t CK_SLOT_ID - -#define ck_slot_info _CK_SLOT_INFO -#define slot_description slotDescription -#define hardware_version hardwareVersion -#define firmware_version firmwareVersion - -#define ck_token_info _CK_TOKEN_INFO -#define serial_number serialNumber -#define max_session_count ulMaxSessionCount -#define session_count ulSessionCount -#define max_rw_session_count ulMaxRwSessionCount -#define rw_session_count ulRwSessionCount -#define max_pin_len ulMaxPinLen -#define min_pin_len ulMinPinLen -#define total_public_memory ulTotalPublicMemory -#define free_public_memory ulFreePublicMemory -#define total_private_memory ulTotalPrivateMemory -#define free_private_memory ulFreePrivateMemory -#define utc_time utcTime - -#define ck_session_handle_t CK_SESSION_HANDLE -#define ck_user_type_t CK_USER_TYPE -#define ck_state_t CK_STATE - -#define ck_session_info _CK_SESSION_INFO -#define slot_id slotID -#define device_error ulDeviceError - -#define ck_object_handle_t CK_OBJECT_HANDLE -#define ck_object_class_t CK_OBJECT_CLASS -#define ck_hw_feature_type_t CK_HW_FEATURE_TYPE -#define ck_key_type_t CK_KEY_TYPE -#define ck_certificate_type_t CK_CERTIFICATE_TYPE -#define ck_attribute_type_t CK_ATTRIBUTE_TYPE - -#define ck_attribute _CK_ATTRIBUTE -#define value pValue -#define value_len ulValueLen - -#define count ulCount - -#define ck_date _CK_DATE - -#define ck_mechanism_type_t CK_MECHANISM_TYPE - -#define ck_mechanism _CK_MECHANISM -#define parameter pParameter -#define parameter_len ulParameterLen - -#define params pParams - -#define ck_mechanism_info _CK_MECHANISM_INFO -#define min_key_size ulMinKeySize -#define max_key_size ulMaxKeySize - -#define ck_param_type CK_PARAM_TYPE -#define ck_otp_param CK_OTP_PARAM -#define ck_otp_params CK_OTP_PARAMS -#define ck_otp_signature_info CK_OTP_SIGNATURE_INFO - -#define ck_rv_t CK_RV -#define ck_notify_t CK_NOTIFY - -#define ck_function_list _CK_FUNCTION_LIST - -#define ck_createmutex_t CK_CREATEMUTEX -#define ck_destroymutex_t CK_DESTROYMUTEX -#define ck_lockmutex_t CK_LOCKMUTEX -#define ck_unlockmutex_t CK_UNLOCKMUTEX - -#define ck_c_initialize_args _CK_C_INITIALIZE_ARGS -#define create_mutex CreateMutex -#define destroy_mutex DestroyMutex -#define lock_mutex LockMutex -#define unlock_mutex UnlockMutex -#define reserved pReserved - -#define ck_rsa_pkcs_mgf_type_t CK_RSA_PKCS_MGF_TYPE -#define ck_rsa_pkcs_oaep_source_type_t CK_RSA_PKCS_OAEP_SOURCE_TYPE -#define hash_alg hashAlg -#define s_len sLen -#define source_data pSourceData -#define source_data_len ulSourceDataLen - -#define counter_bits ulCounterBits -#define iv_ptr pIv -#define iv_len ulIvLen -#define iv_bits ulIvBits -#define aad_ptr pAAD -#define aad_len ulAADLen -#define tag_bits ulTagBits -#define shared_data_len ulSharedDataLen -#define shared_data pSharedData -#define public_data_len ulPublicDataLen -#define public_data pPublicData -#define string_data pData -#define string_data_len ulLen -#define data_params pData -#endif /* CRYPTOKI_COMPAT */ - - - -typedef unsigned long ck_flags_t; - -struct ck_version -{ - unsigned char major; - unsigned char minor; -}; - - -struct ck_info -{ - struct ck_version cryptoki_version; - unsigned char manufacturer_id[32]; - ck_flags_t flags; - unsigned char library_description[32]; - struct ck_version library_version; -}; - - -typedef unsigned long ck_notification_t; - -const unsigned long CKN_SURRENDER = 0UL; - - -typedef unsigned long ck_slot_id_t; - - -struct ck_slot_info -{ - unsigned char slot_description[64]; - unsigned char manufacturer_id[32]; - ck_flags_t flags; - struct ck_version hardware_version; - struct ck_version firmware_version; -}; - -const unsigned long CKF_TOKEN_PRESENT = 1UL << 0; -const unsigned long CKF_REMOVABLE_DEVICE = 1UL << 1; -const unsigned long CKF_HW_SLOT = 1UL << 2; -const unsigned long CKF_ARRAY_ATTRIBUTE = 1UL << 30; - -struct ck_token_info -{ - unsigned char label[32]; - unsigned char manufacturer_id[32]; - unsigned char model[16]; - unsigned char serial_number[16]; - ck_flags_t flags; - unsigned long max_session_count; - unsigned long session_count; - unsigned long max_rw_session_count; - unsigned long rw_session_count; - unsigned long max_pin_len; - unsigned long min_pin_len; - unsigned long total_public_memory; - unsigned long free_public_memory; - unsigned long total_private_memory; - unsigned long free_private_memory; - struct ck_version hardware_version; - struct ck_version firmware_version; - unsigned char utc_time[16]; -}; - - -#define CKF_RNG (1UL << 0) -#define CKF_WRITE_PROTECTED (1UL << 1) -#define CKF_LOGIN_REQUIRED (1UL << 2) -#define CKF_USER_PIN_INITIALIZED (1UL << 3) -#define CKF_RESTORE_KEY_NOT_NEEDED (1UL << 5) -#define CKF_CLOCK_ON_TOKEN (1UL << 6) -#define CKF_PROTECTED_AUTHENTICATION_PATH (1UL << 8) -#define CKF_DUAL_CRYPTO_OPERATIONS (1UL << 9) -#define CKF_TOKEN_INITIALIZED (1UL << 10) -#define CKF_SECONDARY_AUTHENTICATION (1UL << 11) -#define CKF_USER_PIN_COUNT_LOW (1UL << 16) -#define CKF_USER_PIN_FINAL_TRY (1UL << 17) -#define CKF_USER_PIN_LOCKED (1UL << 18) -#define CKF_USER_PIN_TO_BE_CHANGED (1UL << 19) -#define CKF_SO_PIN_COUNT_LOW (1UL << 20) -#define CKF_SO_PIN_FINAL_TRY (1UL << 21) -#define CKF_SO_PIN_LOCKED (1UL << 22) -#define CKF_SO_PIN_TO_BE_CHANGED (1UL << 23) -#define CKF_ERROR_STATE (1UL << 24) - -#define CK_UNAVAILABLE_INFORMATION ((unsigned long)-1L) -#define CK_EFFECTIVELY_INFINITE (0UL) - - -typedef unsigned long ck_session_handle_t; - -#define CK_INVALID_HANDLE (0UL) - - -typedef unsigned long ck_user_type_t; - -#define CKU_SO (0UL) -#define CKU_USER (1UL) -#define CKU_CONTEXT_SPECIFIC (2UL) - - -typedef unsigned long ck_state_t; - -#define CKS_RO_PUBLIC_SESSION (0UL) -#define CKS_RO_USER_FUNCTIONS (1UL) -#define CKS_RW_PUBLIC_SESSION (2UL) -#define CKS_RW_USER_FUNCTIONS (3UL) -#define CKS_RW_SO_FUNCTIONS (4UL) - - -struct ck_session_info -{ - ck_slot_id_t slot_id; - ck_state_t state; - ck_flags_t flags; - unsigned long device_error; -}; - -#define CKF_RW_SESSION (1UL << 1) -#define CKF_SERIAL_SESSION (1UL << 2) - - -typedef unsigned long ck_object_handle_t; - - -typedef unsigned long ck_object_class_t; - -#define CKO_DATA (0UL) -#define CKO_CERTIFICATE (1UL) -#define CKO_PUBLIC_KEY (2UL) -#define CKO_PRIVATE_KEY (3UL) -#define CKO_SECRET_KEY (4UL) -#define CKO_HW_FEATURE (5UL) -#define CKO_DOMAIN_PARAMETERS (6UL) -#define CKO_MECHANISM (7UL) -#define CKO_OTP_KEY (8UL) -#define CKO_VENDOR_DEFINED ((unsigned long) (1UL << 31)) - - -typedef unsigned long ck_hw_feature_type_t; - -#define CKH_MONOTONIC_COUNTER (1UL) -#define CKH_CLOCK (2UL) -#define CKH_USER_INTERFACE (3UL) -#define CKH_VENDOR_DEFINED ((unsigned long) (1UL << 31)) - - -typedef unsigned long ck_key_type_t; - -#define CKK_RSA (0UL) -#define CKK_DSA (1UL) -#define CKK_DH (2UL) -#define CKK_ECDSA (3UL) -#define CKK_EC (3UL) -#define CKK_X9_42_DH (4UL) -#define CKK_KEA (5UL) -#define CKK_GENERIC_SECRET (0x10UL) -#define CKK_RC2 (0x11UL) -#define CKK_RC4 (0x12UL) -#define CKK_DES (0x13UL) -#define CKK_DES2 (0x14UL) -#define CKK_DES3 (0x15UL) -#define CKK_CAST (0x16UL) -#define CKK_CAST3 (0x17UL) -#define CKK_CAST128 (0x18UL) -#define CKK_RC5 (0x19UL) -#define CKK_IDEA (0x1aUL) -#define CKK_SKIPJACK (0x1bUL) -#define CKK_BATON (0x1cUL) -#define CKK_JUNIPER (0x1dUL) -#define CKK_CDMF (0x1eUL) -#define CKK_AES (0x1fUL) -#define CKK_BLOWFISH (0x20UL) -#define CKK_TWOFISH (0x21UL) -#define CKK_SECURID (0x22UL) -#define CKK_HOTP (0x23UL) -#define CKK_ACTI (0x24UL) -#define CKK_CAMELLIA (0x25UL) -#define CKK_ARIA (0x26UL) -#define CKK_MD5_HMAC (0x27UL) -#define CKK_SHA_1_HMAC (0x28UL) -#define CKK_RIPEMD128_HMAC (0x29UL) -#define CKK_RIPEMD160_HMAC (0x2aUL) -#define CKK_SHA256_HMAC (0x2bUL) -#define CKK_SHA384_HMAC (0x2cUL) -#define CKK_SHA512_HMAC (0x2dUL) -#define CKK_SHA224_HMAC (0x2eUL) -#define CKK_SEED (0x2fUL) -#define CKK_GOSTR3410 (0x30UL) -#define CKK_GOSTR3411 (0x31UL) -#define CKK_GOST28147 (0x32UL) -#define CKK_EC_EDWARDS (0x40UL) -#define CKK_VENDOR_DEFINED ((unsigned long) (1UL << 31)) - - -typedef unsigned long ck_certificate_type_t; - -#define CKC_X_509 (0UL) -#define CKC_X_509_ATTR_CERT (1UL) -#define CKC_WTLS (2UL) -#define CKC_VENDOR_DEFINED ((unsigned long) (1UL << 31)) - -#define CKC_OPENPGP (CKC_VENDOR_DEFINED|0x504750UL) - -typedef unsigned long ck_attribute_type_t; - -#define CKA_CLASS (0UL) -#define CKA_TOKEN (1UL) -#define CKA_PRIVATE (2UL) -#define CKA_LABEL (3UL) -#define CKA_APPLICATION (0x10UL) -#define CKA_VALUE (0x11UL) -#define CKA_OBJECT_ID (0x12UL) -#define CKA_CERTIFICATE_TYPE (0x80UL) -#define CKA_ISSUER (0x81UL) -#define CKA_SERIAL_NUMBER (0x82UL) -#define CKA_AC_ISSUER (0x83UL) -#define CKA_OWNER (0x84UL) -#define CKA_ATTR_TYPES (0x85UL) -#define CKA_TRUSTED (0x86UL) -#define CKA_CERTIFICATE_CATEGORY (0x87UL) -#define CKA_JAVA_MIDP_SECURITY_DOMAIN (0x88UL) -#define CKA_URL (0x89UL) -#define CKA_HASH_OF_SUBJECT_PUBLIC_KEY (0x8aUL) -#define CKA_HASH_OF_ISSUER_PUBLIC_KEY (0x8bUL) -#define CKA_NAME_HASH_ALGORITHM (0x8cUL) -#define CKA_CHECK_VALUE (0x90UL) -#define CKA_KEY_TYPE (0x100UL) -#define CKA_SUBJECT (0x101UL) -#define CKA_ID (0x102UL) -#define CKA_SENSITIVE (0x103UL) -#define CKA_ENCRYPT (0x104UL) -#define CKA_DECRYPT (0x105UL) -#define CKA_WRAP (0x106UL) -#define CKA_UNWRAP (0x107UL) -#define CKA_SIGN (0x108UL) -#define CKA_SIGN_RECOVER (0x109UL) -#define CKA_VERIFY (0x10aUL) -#define CKA_VERIFY_RECOVER (0x10bUL) -#define CKA_DERIVE (0x10cUL) -#define CKA_START_DATE (0x110UL) -#define CKA_END_DATE (0x111UL) -#define CKA_MODULUS (0x120UL) -#define CKA_MODULUS_BITS (0x121UL) -#define CKA_PUBLIC_EXPONENT (0x122UL) -#define CKA_PRIVATE_EXPONENT (0x123UL) -#define CKA_PRIME_1 (0x124UL) -#define CKA_PRIME_2 (0x125UL) -#define CKA_EXPONENT_1 (0x126UL) -#define CKA_EXPONENT_2 (0x127UL) -#define CKA_COEFFICIENT (0x128UL) -#define CKA_PUBLIC_KEY_INFO (0x129UL) -#define CKA_PRIME (0x130UL) -#define CKA_SUBPRIME (0x131UL) -#define CKA_BASE (0x132UL) -#define CKA_PRIME_BITS (0x133UL) -#define CKA_SUB_PRIME_BITS (0x134UL) -#define CKA_VALUE_BITS (0x160UL) -#define CKA_VALUE_LEN (0x161UL) -#define CKA_EXTRACTABLE (0x162UL) -#define CKA_LOCAL (0x163UL) -#define CKA_NEVER_EXTRACTABLE (0x164UL) -#define CKA_ALWAYS_SENSITIVE (0x165UL) -#define CKA_KEY_GEN_MECHANISM (0x166UL) -#define CKA_MODIFIABLE (0x170UL) -#define CKA_COPYABLE (0x171UL) -#define CKA_DESTROYABLE (0x172UL) -#define CKA_ECDSA_PARAMS (0x180UL) -#define CKA_EC_PARAMS (0x180UL) -#define CKA_EC_POINT (0x181UL) -#define CKA_SECONDARY_AUTH (0x200UL) -#define CKA_AUTH_PIN_FLAGS (0x201UL) -#define CKA_ALWAYS_AUTHENTICATE (0x202UL) -#define CKA_WRAP_WITH_TRUSTED (0x210UL) -#define CKA_OTP_FORMAT (0x220UL) -#define CKA_OTP_LENGTH (0x221UL) -#define CKA_OTP_TIME_INTERVAL (0x222UL) -#define CKA_OTP_USER_FRIENDLY_MODE (0x223UL) -#define CKA_OTP_CHALLENGE_REQUIREMENT (0x224UL) -#define CKA_OTP_TIME_REQUIREMENT (0x225UL) -#define CKA_OTP_COUNTER_REQUIREMENT (0x226UL) -#define CKA_OTP_PIN_REQUIREMENT (0x227UL) -#define CKA_OTP_USER_IDENTIFIER (0x22AUL) -#define CKA_OTP_SERVICE_IDENTIFIER (0x22BUL) -#define CKA_OTP_SERVICE_LOGO (0x22CUL) -#define CKA_OTP_SERVICE_LOGO_TYPE (0x22DUL) -#define CKA_OTP_COUNTER (0x22EUL) -#define CKA_OTP_TIME (0x22FUL) -#define CKA_GOSTR3410_PARAMS (0x250UL) -#define CKA_GOSTR3411_PARAMS (0x251UL) -#define CKA_GOST28147_PARAMS (0x252UL) -#define CKA_HW_FEATURE_TYPE (0x300UL) -#define CKA_RESET_ON_INIT (0x301UL) -#define CKA_HAS_RESET (0x302UL) -#define CKA_PIXEL_X (0x400UL) -#define CKA_PIXEL_Y (0x401UL) -#define CKA_RESOLUTION (0x402UL) -#define CKA_CHAR_ROWS (0x403UL) -#define CKA_CHAR_COLUMNS (0x404UL) -#define CKA_COLOR (0x405UL) -#define CKA_BITS_PER_PIXEL (0x406UL) -#define CKA_CHAR_SETS (0x480UL) -#define CKA_ENCODING_METHODS (0x481UL) -#define CKA_MIME_TYPES (0x482UL) -#define CKA_MECHANISM_TYPE (0x500UL) -#define CKA_REQUIRED_CMS_ATTRIBUTES (0x501UL) -#define CKA_DEFAULT_CMS_ATTRIBUTES (0x502UL) -#define CKA_SUPPORTED_CMS_ATTRIBUTES (0x503UL) -#define CKA_WRAP_TEMPLATE (CKF_ARRAY_ATTRIBUTE | 0x211UL) -#define CKA_UNWRAP_TEMPLATE (CKF_ARRAY_ATTRIBUTE | 0x212UL) -#define CKA_DERIVE_TEMPLATE (CKF_ARRAY_ATTRIBUTE | 0x213UL) -#define CKA_ALLOWED_MECHANISMS (CKF_ARRAY_ATTRIBUTE | 0x600UL) -#define CKA_VENDOR_DEFINED ((unsigned long) (1UL << 31)) - - -struct ck_attribute -{ - ck_attribute_type_t type; - void *value; - unsigned long value_len; -}; - - -struct ck_date -{ - unsigned char year[4]; - unsigned char month[2]; - unsigned char day[2]; -}; - - -typedef unsigned long ck_mechanism_type_t; - -#define CKM_RSA_PKCS_KEY_PAIR_GEN (0UL) -#define CKM_RSA_PKCS (1UL) -#define CKM_RSA_9796 (2UL) -#define CKM_RSA_X_509 (3UL) -#define CKM_MD2_RSA_PKCS (4UL) -#define CKM_MD5_RSA_PKCS (5UL) -#define CKM_SHA1_RSA_PKCS (6UL) -#define CKM_RIPEMD128_RSA_PKCS (7UL) -#define CKM_RIPEMD160_RSA_PKCS (8UL) -#define CKM_RSA_PKCS_OAEP (9UL) -#define CKM_RSA_X9_31_KEY_PAIR_GEN (0xaUL) -#define CKM_RSA_X9_31 (0xbUL) -#define CKM_SHA1_RSA_X9_31 (0xcUL) -#define CKM_RSA_PKCS_PSS (0xdUL) -#define CKM_SHA1_RSA_PKCS_PSS (0xeUL) -#define CKM_DSA_KEY_PAIR_GEN (0x10UL) -#define CKM_DSA (0x11UL) -#define CKM_DSA_SHA1 (0x12UL) -#define CKM_DSA_SHA224 (0x13UL) -#define CKM_DSA_SHA256 (0x14UL) -#define CKM_DSA_SHA384 (0x15UL) -#define CKM_DSA_SHA512 (0x16UL) -#define CKM_DH_PKCS_KEY_PAIR_GEN (0x20UL) -#define CKM_DH_PKCS_DERIVE (0x21UL) -#define CKM_X9_42_DH_KEY_PAIR_GEN (0x30UL) -#define CKM_X9_42_DH_DERIVE (0x31UL) -#define CKM_X9_42_DH_HYBRID_DERIVE (0x32UL) -#define CKM_X9_42_MQV_DERIVE (0x33UL) -#define CKM_SHA256_RSA_PKCS (0x40UL) -#define CKM_SHA384_RSA_PKCS (0x41UL) -#define CKM_SHA512_RSA_PKCS (0x42UL) -#define CKM_SHA256_RSA_PKCS_PSS (0x43UL) -#define CKM_SHA384_RSA_PKCS_PSS (0x44UL) -#define CKM_SHA512_RSA_PKCS_PSS (0x45UL) -#define CKM_SHA512_224 (0x48UL) -#define CKM_SHA512_224_HMAC (0x49UL) -#define CKM_SHA512_224_HMAC_GENERAL (0x4aUL) -#define CKM_SHA512_224_KEY_DERIVATION (0x4bUL) -#define CKM_SHA512_256 (0x4cUL) -#define CKM_SHA512_256_HMAC (0x4dUL) -#define CKM_SHA512_256_HMAC_GENERAL (0x4eUL) -#define CKM_SHA512_256_KEY_DERIVATION (0x4fUL) -#define CKM_SHA512_T (0x50UL) -#define CKM_SHA512_T_HMAC (0x51UL) -#define CKM_SHA512_T_HMAC_GENERAL (0x52UL) -#define CKM_SHA512_T_KEY_DERIVATION (0x53UL) -#define CKM_RC2_KEY_GEN (0x100UL) -#define CKM_RC2_ECB (0x101UL) -#define CKM_RC2_CBC (0x102UL) -#define CKM_RC2_MAC (0x103UL) -#define CKM_RC2_MAC_GENERAL (0x104UL) -#define CKM_RC2_CBC_PAD (0x105UL) -#define CKM_RC4_KEY_GEN (0x110UL) -#define CKM_RC4 (0x111UL) -#define CKM_DES_KEY_GEN (0x120UL) -#define CKM_DES_ECB (0x121UL) -#define CKM_DES_CBC (0x122UL) -#define CKM_DES_MAC (0x123UL) -#define CKM_DES_MAC_GENERAL (0x124UL) -#define CKM_DES_CBC_PAD (0x125UL) -#define CKM_DES2_KEY_GEN (0x130UL) -#define CKM_DES3_KEY_GEN (0x131UL) -#define CKM_DES3_ECB (0x132UL) -#define CKM_DES3_CBC (0x133UL) -#define CKM_DES3_MAC (0x134UL) -#define CKM_DES3_MAC_GENERAL (0x135UL) -#define CKM_DES3_CBC_PAD (0x136UL) -#define CKM_DES3_CMAC_GENERAL (0x137UL) -#define CKM_DES3_CMAC (0x138UL) -#define CKM_CDMF_KEY_GEN (0x140UL) -#define CKM_CDMF_ECB (0x141UL) -#define CKM_CDMF_CBC (0x142UL) -#define CKM_CDMF_MAC (0x143UL) -#define CKM_CDMF_MAC_GENERAL (0x144UL) -#define CKM_CDMF_CBC_PAD (0x145UL) -#define CKM_DES_OFB64 (0x150UL) -#define CKM_DES_OFB8 (0x151UL) -#define CKM_DES_CFB64 (0x152UL) -#define CKM_DES_CFB8 (0x153UL) -#define CKM_MD2 (0x200UL) -#define CKM_MD2_HMAC (0x201UL) -#define CKM_MD2_HMAC_GENERAL (0x202UL) -#define CKM_MD5 (0x210UL) -#define CKM_MD5_HMAC (0x211UL) -#define CKM_MD5_HMAC_GENERAL (0x212UL) -#define CKM_SHA_1 (0x220UL) -#define CKM_SHA_1_HMAC (0x221UL) -#define CKM_SHA_1_HMAC_GENERAL (0x222UL) -#define CKM_RIPEMD128 (0x230UL) -#define CKM_RIPEMD128_HMAC (0x231UL) -#define CKM_RIPEMD128_HMAC_GENERAL (0x232UL) -#define CKM_RIPEMD160 (0x240UL) -#define CKM_RIPEMD160_HMAC (0x241UL) -#define CKM_RIPEMD160_HMAC_GENERAL (0x242UL) -#define CKM_SHA256 (0x250UL) -#define CKM_SHA256_HMAC (0x251UL) -#define CKM_SHA256_HMAC_GENERAL (0x252UL) -#define CKM_SHA384 (0x260UL) -#define CKM_SHA384_HMAC (0x261UL) -#define CKM_SHA384_HMAC_GENERAL (0x262UL) -#define CKM_SHA512 (0x270UL) -#define CKM_SHA512_HMAC (0x271UL) -#define CKM_SHA512_HMAC_GENERAL (0x272UL) -#define CKM_SECURID_KEY_GEN (0x280UL) -#define CKM_SECURID (0x282UL) -#define CKM_HOTP_KEY_GEN (0x290UL) -#define CKM_HOTP (0x291UL) -#define CKM_ACTI (0x2a0UL) -#define CKM_ACTI_KEY_GEN (0x2a1UL) -#define CKM_CAST_KEY_GEN (0x300UL) -#define CKM_CAST_ECB (0x301UL) -#define CKM_CAST_CBC (0x302UL) -#define CKM_CAST_MAC (0x303UL) -#define CKM_CAST_MAC_GENERAL (0x304UL) -#define CKM_CAST_CBC_PAD (0x305UL) -#define CKM_CAST3_KEY_GEN (0x310UL) -#define CKM_CAST3_ECB (0x311UL) -#define CKM_CAST3_CBC (0x312UL) -#define CKM_CAST3_MAC (0x313UL) -#define CKM_CAST3_MAC_GENERAL (0x314UL) -#define CKM_CAST3_CBC_PAD (0x315UL) -#define CKM_CAST5_KEY_GEN (0x320UL) -#define CKM_CAST128_KEY_GEN (0x320UL) -#define CKM_CAST5_ECB (0x321UL) -#define CKM_CAST128_ECB (0x321UL) -#define CKM_CAST5_CBC (0x322UL) -#define CKM_CAST128_CBC (0x322UL) -#define CKM_CAST5_MAC (0x323UL) -#define CKM_CAST128_MAC (0x323UL) -#define CKM_CAST5_MAC_GENERAL (0x324UL) -#define CKM_CAST128_MAC_GENERAL (0x324UL) -#define CKM_CAST5_CBC_PAD (0x325UL) -#define CKM_CAST128_CBC_PAD (0x325UL) -#define CKM_RC5_KEY_GEN (0x330UL) -#define CKM_RC5_ECB (0x331UL) -#define CKM_RC5_CBC (0x332UL) -#define CKM_RC5_MAC (0x333UL) -#define CKM_RC5_MAC_GENERAL (0x334UL) -#define CKM_RC5_CBC_PAD (0x335UL) -#define CKM_IDEA_KEY_GEN (0x340UL) -#define CKM_IDEA_ECB (0x341UL) -#define CKM_IDEA_CBC (0x342UL) -#define CKM_IDEA_MAC (0x343UL) -#define CKM_IDEA_MAC_GENERAL (0x344UL) -#define CKM_IDEA_CBC_PAD (0x345UL) -#define CKM_GENERIC_SECRET_KEY_GEN (0x350UL) -#define CKM_CONCATENATE_BASE_AND_KEY (0x360UL) -#define CKM_CONCATENATE_BASE_AND_DATA (0x362UL) -#define CKM_CONCATENATE_DATA_AND_BASE (0x363UL) -#define CKM_XOR_BASE_AND_DATA (0x364UL) -#define CKM_EXTRACT_KEY_FROM_KEY (0x365UL) -#define CKM_SSL3_PRE_MASTER_KEY_GEN (0x370UL) -#define CKM_SSL3_MASTER_KEY_DERIVE (0x371UL) -#define CKM_SSL3_KEY_AND_MAC_DERIVE (0x372UL) -#define CKM_SSL3_MASTER_KEY_DERIVE_DH (0x373UL) -#define CKM_TLS_PRE_MASTER_KEY_GEN (0x374UL) -#define CKM_TLS_MASTER_KEY_DERIVE (0x375UL) -#define CKM_TLS_KEY_AND_MAC_DERIVE (0x376UL) -#define CKM_TLS_MASTER_KEY_DERIVE_DH (0x377UL) -#define CKM_TLS_PRF (0x378UL) -#define CKM_SSL3_MD5_MAC (0x380UL) -#define CKM_SSL3_SHA1_MAC (0x381UL) -#define CKM_MD5_KEY_DERIVATION (0x390UL) -#define CKM_MD2_KEY_DERIVATION (0x391UL) -#define CKM_SHA1_KEY_DERIVATION (0x392UL) -#define CKM_SHA256_KEY_DERIVATION (0x393UL) -#define CKM_SHA384_KEY_DERIVATION (0x394UL) -#define CKM_SHA512_KEY_DERIVATION (0x395UL) -#define CKM_PBE_MD2_DES_CBC (0x3a0UL) -#define CKM_PBE_MD5_DES_CBC (0x3a1UL) -#define CKM_PBE_MD5_CAST_CBC (0x3a2UL) -#define CKM_PBE_MD5_CAST3_CBC (0x3a3UL) -#define CKM_PBE_MD5_CAST5_CBC (0x3a4UL) -#define CKM_PBE_MD5_CAST128_CBC (0x3a4UL) -#define CKM_PBE_SHA1_CAST5_CBC (0x3a5UL) -#define CKM_PBE_SHA1_CAST128_CBC (0x3a5UL) -#define CKM_PBE_SHA1_RC4_128 (0x3a6UL) -#define CKM_PBE_SHA1_RC4_40 (0x3a7UL) -#define CKM_PBE_SHA1_DES3_EDE_CBC (0x3a8UL) -#define CKM_PBE_SHA1_DES2_EDE_CBC (0x3a9UL) -#define CKM_PBE_SHA1_RC2_128_CBC (0x3aaUL) -#define CKM_PBE_SHA1_RC2_40_CBC (0x3abUL) -#define CKM_PKCS5_PBKD2 (0x3b0UL) -#define CKM_PBA_SHA1_WITH_SHA1_HMAC (0x3c0UL) -#define CKM_WTLS_PRE_MASTER_KEY_GEN (0x3d0UL) -#define CKM_WTLS_MASTER_KEY_DERIVE (0x3d1UL) -#define CKM_WTLS_MASTER_KEY_DERIVE_DH_ECC (0x3d2UL) -#define CKM_WTLS_PRF (0x3d3UL) -#define CKM_WTLS_SERVER_KEY_AND_MAC_DERIVE (0x3d4UL) -#define CKM_WTLS_CLIENT_KEY_AND_MAC_DERIVE (0x3d5UL) -#define CKM_TLS10_MAC_SERVER (0x3d6UL) -#define CKM_TLS10_MAC_CLIENT (0x3d7UL) -#define CKM_TLS12_MAC (0x3d8UL) -#define CKM_TLS12_KDF (0x3d9UL) -#define CKM_TLS12_MASTER_KEY_DERIVE (0x3e0UL) -#define CKM_TLS12_KEY_AND_MAC_DERIVE (0x3e1UL) -#define CKM_TLS12_MASTER_KEY_DERIVE_DH (0x3e2UL) -#define CKM_TLS12_KEY_SAFE_DERIVE (0x3e3UL) -#define CKM_TLS_MAC (0x3e4UL) -#define CKM_TLS_KDF (0x3e5UL) -#define CKM_KEY_WRAP_LYNKS (0x400UL) -#define CKM_KEY_WRAP_SET_OAEP (0x401UL) -#define CKM_CMS_SIG (0x500UL) -#define CKM_KIP_DERIVE (0x510UL) -#define CKM_KIP_WRAP (0x511UL) -#define CKM_KIP_MAC (0x512UL) -#define CKM_CAMELLIA_KEY_GEN (0x550UL) -#define CKM_CAMELLIA_CTR (0x558UL) -#define CKM_ARIA_KEY_GEN (0x560UL) -#define CKM_ARIA_ECB (0x561UL) -#define CKM_ARIA_CBC (0x562UL) -#define CKM_ARIA_MAC (0x563UL) -#define CKM_ARIA_MAC_GENERAL (0x564UL) -#define CKM_ARIA_CBC_PAD (0x565UL) -#define CKM_ARIA_ECB_ENCRYPT_DATA (0x566UL) -#define CKM_ARIA_CBC_ENCRYPT_DATA (0x567UL) -#define CKM_SEED_KEY_GEN (0x650UL) -#define CKM_SEED_ECB (0x651UL) -#define CKM_SEED_CBC (0x652UL) -#define CKM_SEED_MAC (0x653UL) -#define CKM_SEED_MAC_GENERAL (0x654UL) -#define CKM_SEED_CBC_PAD (0x655UL) -#define CKM_SEED_ECB_ENCRYPT_DATA (0x656UL) -#define CKM_SEED_CBC_ENCRYPT_DATA (0x657UL) -#define CKM_SKIPJACK_KEY_GEN (0x1000UL) -#define CKM_SKIPJACK_ECB64 (0x1001UL) -#define CKM_SKIPJACK_CBC64 (0x1002UL) -#define CKM_SKIPJACK_OFB64 (0x1003UL) -#define CKM_SKIPJACK_CFB64 (0x1004UL) -#define CKM_SKIPJACK_CFB32 (0x1005UL) -#define CKM_SKIPJACK_CFB16 (0x1006UL) -#define CKM_SKIPJACK_CFB8 (0x1007UL) -#define CKM_SKIPJACK_WRAP (0x1008UL) -#define CKM_SKIPJACK_PRIVATE_WRAP (0x1009UL) -#define CKM_SKIPJACK_RELAYX (0x100aUL) -#define CKM_KEA_KEY_PAIR_GEN (0x1010UL) -#define CKM_KEA_KEY_DERIVE (0x1011UL) -#define CKM_FORTEZZA_TIMESTAMP (0x1020UL) -#define CKM_BATON_KEY_GEN (0x1030UL) -#define CKM_BATON_ECB128 (0x1031UL) -#define CKM_BATON_ECB96 (0x1032UL) -#define CKM_BATON_CBC128 (0x1033UL) -#define CKM_BATON_COUNTER (0x1034UL) -#define CKM_BATON_SHUFFLE (0x1035UL) -#define CKM_BATON_WRAP (0x1036UL) -#define CKM_ECDSA_KEY_PAIR_GEN (0x1040UL) -#define CKM_EC_KEY_PAIR_GEN (0x1040UL) -#define CKM_ECDSA (0x1041UL) -#define CKM_ECDSA_SHA1 (0x1042UL) -#define CKM_ECDSA_SHA224 (0x1043UL) -#define CKM_ECDSA_SHA256 (0x1044UL) -#define CKM_ECDSA_SHA384 (0x1045UL) -#define CKM_ECDSA_SHA512 (0x1046UL) -#define CKM_ECDH1_DERIVE (0x1050UL) -#define CKM_ECDH1_COFACTOR_DERIVE (0x1051UL) -#define CKM_ECMQV_DERIVE (0x1052UL) -#define CKM_ECDH_AES_KEY_WRAP (0x1053UL) -#define CKM_RSA_AES_KEY_WRAP (0x1054UL) -#define CKM_JUNIPER_KEY_GEN (0x1060UL) -#define CKM_JUNIPER_ECB128 (0x1061UL) -#define CKM_JUNIPER_CBC128 (0x1062UL) -#define CKM_JUNIPER_COUNTER (0x1063UL) -#define CKM_JUNIPER_SHUFFLE (0x1064UL) -#define CKM_JUNIPER_WRAP (0x1065UL) -#define CKM_FASTHASH (0x1070UL) -#define CKM_AES_KEY_GEN (0x1080UL) -#define CKM_AES_ECB (0x1081UL) -#define CKM_AES_CBC (0x1082UL) -#define CKM_AES_MAC (0x1083UL) -#define CKM_AES_MAC_GENERAL (0x1084UL) -#define CKM_AES_CBC_PAD (0x1085UL) -#define CKM_AES_CTR (0x1086UL) -#define CKM_AES_GCM (0x1087UL) -#define CKM_AES_CCM (0x1088UL) -#define CKM_AES_CTS (0x1089UL) -#define CKM_AES_CMAC (0x108aUL) -#define CKM_AES_CMAC_GENERAL (0x108bUL) -#define CKM_AES_XCBC_MAC (0x108cUL) -#define CKM_AES_XCBC_MAC_96 (0x108dUL) -#define CKM_AES_GMAC (0x108eUL) -#define CKM_BLOWFISH_KEY_GEN (0x1090UL) -#define CKM_BLOWFISH_CBC (0x1091UL) -#define CKM_TWOFISH_KEY_GEN (0x1092UL) -#define CKM_TWOFISH_CBC (0x1093UL) -#define CKM_BLOWFISH_CBC_PAD (0x1094UL) -#define CKM_TWOFISH_CBC_PAD (0x1095UL) -#define CKM_DES_ECB_ENCRYPT_DATA (0x1100UL) -#define CKM_DES_CBC_ENCRYPT_DATA (0x1101UL) -#define CKM_DES3_ECB_ENCRYPT_DATA (0x1102UL) -#define CKM_DES3_CBC_ENCRYPT_DATA (0x1103UL) -#define CKM_AES_ECB_ENCRYPT_DATA (0x1104UL) -#define CKM_AES_CBC_ENCRYPT_DATA (0x1105UL) -#define CKM_GOSTR3410_KEY_PAIR_GEN (0x1200UL) -#define CKM_GOSTR3410 (0x1201UL) -#define CKM_GOSTR3410_WITH_GOSTR3411 (0x1202UL) -#define CKM_GOSTR3410_KEY_WRAP (0x1203UL) -#define CKM_GOSTR3410_DERIVE (0x1204UL) -#define CKM_GOSTR3411 (0x1210UL) -#define CKM_GOSTR3411_HMAC (0x1211UL) -#define CKM_GOST28147_KEY_GEN (0x1220UL) -#define CKM_GOST28147_ECB (0x1221UL) -#define CKM_GOST28147 (0x1222UL) -#define CKM_GOST28147_MAC (0x1223UL) -#define CKM_GOST28147_KEY_WRAP (0x1224UL) -#define CKM_DSA_PARAMETER_GEN (0x2000UL) -#define CKM_DH_PKCS_PARAMETER_GEN (0x2001UL) -#define CKM_X9_42_DH_PARAMETER_GEN (0x2002UL) -#define CKM_DSA_PROBABLISTIC_PARAMETER_GEN (0x2003UL) -#define CKM_DSA_SHAWE_TAYLOR_PARAMETER_GEN (0x2004UL) -#define CKM_AES_OFB (0x2104UL) -#define CKM_AES_CFB64 (0x2105UL) -#define CKM_AES_CFB8 (0x2106UL) -#define CKM_AES_CFB128 (0x2107UL) -#define CKM_AES_CFB1 (0x2108UL) - -#define CKM_VENDOR_DEFINED ((unsigned long) (1UL << 31)) - -/* Amendments */ -#define CKM_SHA224 (0x255UL) -#define CKM_SHA224_HMAC (0x256UL) -#define CKM_SHA224_HMAC_GENERAL (0x257UL) -#define CKM_SHA224_RSA_PKCS (0x46UL) -#define CKM_SHA224_RSA_PKCS_PSS (0x47UL) -#define CKM_SHA224_KEY_DERIVATION (0x396UL) - -#define CKM_CAMELLIA_KEY_GEN (0x550UL) -#define CKM_CAMELLIA_ECB (0x551UL) -#define CKM_CAMELLIA_CBC (0x552UL) -#define CKM_CAMELLIA_MAC (0x553UL) -#define CKM_CAMELLIA_MAC_GENERAL (0x554UL) -#define CKM_CAMELLIA_CBC_PAD (0x555UL) -#define CKM_CAMELLIA_ECB_ENCRYPT_DATA (0x556UL) -#define CKM_CAMELLIA_CBC_ENCRYPT_DATA (0x557UL) - -#define CKM_AES_KEY_WRAP (0x2109UL) -#define CKM_AES_KEY_WRAP_PAD (0x210aUL) - -#define CKM_RSA_PKCS_TPM_1_1 (0x4001UL) -#define CKM_RSA_PKCS_OAEP_TPM_1_1 (0x4002UL) - -/* From version 3.0 */ -#define CKM_EC_EDWARDS_KEY_PAIR_GEN (0x1055UL) -#define CKM_EC_MONTGOMERY_KEY_PAIR_GEN (0x1056UL) -#define CKM_EDDSA (0x1057UL) - -/* Attribute and other constants related to OTP */ -#define CK_OTP_FORMAT_DECIMAL (0UL) -#define CK_OTP_FORMAT_HEXADECIMAL (1UL) -#define CK_OTP_FORMAT_ALPHANUMERIC (2UL) -#define CK_OTP_FORMAT_BINARY (3UL) -#define CK_OTP_PARAM_IGNORED (0UL) -#define CK_OTP_PARAM_OPTIONAL (1UL) -#define CK_OTP_PARAM_MANDATORY (2UL) - -#define CK_OTP_VALUE (0UL) -#define CK_OTP_PIN (1UL) -#define CK_OTP_CHALLENGE (2UL) -#define CK_OTP_TIME (3UL) -#define CK_OTP_COUNTER (4UL) -#define CK_OTP_FLAGS (5UL) -#define CK_OTP_OUTPUT_LENGTH (6UL) -#define CK_OTP_FORMAT (7UL) - -/* OTP mechanism flags */ -#define CKF_NEXT_OTP (0x01UL) -#define CKF_EXCLUDE_TIME (0x02UL) -#define CKF_EXCLUDE_COUNTER (0x04UL) -#define CKF_EXCLUDE_CHALLENGE (0x08UL) -#define CKF_EXCLUDE_PIN (0x10UL) -#define CKF_USER_FRIENDLY_OTP (0x20UL) - -#define CKN_OTP_CHANGED (0x01UL) - -struct ck_mechanism -{ - ck_mechanism_type_t mechanism; - void *parameter; - unsigned long parameter_len; -}; - - -struct ck_mechanism_info -{ - unsigned long min_key_size; - unsigned long max_key_size; - ck_flags_t flags; -}; - -typedef unsigned long ck_param_type; - -typedef struct ck_otp_param { - ck_param_type type; - void *value; - unsigned long value_len; -} ck_otp_param; - -typedef struct ck_otp_params { - struct ck_otp_param *params; - unsigned long count; -} ck_otp_params; - -typedef struct ck_otp_signature_info -{ - struct ck_otp_param *params; - unsigned long count; -} ck_otp_signature_info; - -#define CKG_MGF1_SHA1 0x00000001UL -#define CKG_MGF1_SHA224 0x00000005UL -#define CKG_MGF1_SHA256 0x00000002UL -#define CKG_MGF1_SHA384 0x00000003UL -#define CKG_MGF1_SHA512 0x00000004UL - -typedef unsigned long ck_rsa_pkcs_mgf_type_t; - -struct ck_rsa_pkcs_pss_params { - ck_mechanism_type_t hash_alg; - ck_rsa_pkcs_mgf_type_t mgf; - unsigned long s_len; -}; - -typedef unsigned long ck_rsa_pkcs_oaep_source_type_t; - -struct ck_rsa_pkcs_oaep_params { - ck_mechanism_type_t hash_alg; - ck_rsa_pkcs_mgf_type_t mgf; - ck_rsa_pkcs_oaep_source_type_t source; - void *source_data; - unsigned long source_data_len; -}; - -struct ck_aes_ctr_params { - unsigned long counter_bits; - unsigned char cb[16]; -}; - -struct ck_gcm_params { - unsigned char *iv_ptr; - unsigned long iv_len; - unsigned long iv_bits; - unsigned char *aad_ptr; - unsigned long aad_len; - unsigned long tag_bits; -}; - - -/* The following EC Key Derivation Functions are defined */ -#define CKD_NULL (0x01UL) -#define CKD_SHA1_KDF (0x02UL) - -/* The following X9.42 DH key derivation functions are defined */ -#define CKD_SHA1_KDF_ASN1 (0x03UL) -#define CKD_SHA1_KDF_CONCATENATE (0x04UL) -#define CKD_SHA224_KDF (0x05UL) -#define CKD_SHA256_KDF (0x06UL) -#define CKD_SHA384_KDF (0x07UL) -#define CKD_SHA512_KDF (0x08UL) -#define CKD_CPDIVERSIFY_KDF (0x09UL) - -typedef unsigned long ck_ec_kdf_t; - -struct ck_ecdh1_derive_params { - ck_ec_kdf_t kdf; - unsigned long shared_data_len; - unsigned char *shared_data; - unsigned long public_data_len; - unsigned char *public_data; -}; - -struct ck_key_derivation_string_data { - unsigned char *string_data; - unsigned long string_data_len; -}; - -struct ck_des_cbc_encrypt_data_params { - unsigned char iv[8]; - unsigned char *data_params; - unsigned long length; -}; - -struct ck_aes_cbc_encrypt_data_params { - unsigned char iv[16]; - unsigned char *data_params; - unsigned long length; -}; - -#define CKF_HW (1UL << 0) -#define CKF_ENCRYPT (1UL << 8) -#define CKF_DECRYPT (1UL << 9) -#define CKF_DIGEST (1UL << 10) -#define CKF_SIGN (1UL << 11) -#define CKF_SIGN_RECOVER (1UL << 12) -#define CKF_VERIFY (1UL << 13) -#define CKF_VERIFY_RECOVER (1UL << 14) -#define CKF_GENERATE (1UL << 15) -#define CKF_GENERATE_KEY_PAIR (1UL << 16) -#define CKF_WRAP (1UL << 17) -#define CKF_UNWRAP (1UL << 18) -#define CKF_DERIVE (1UL << 19) -#define CKF_EXTENSION ((unsigned long) (1UL << 31)) - -#define CKF_EC_F_P (1UL << 20) -#define CKF_EC_F_2M (1UL << 21) -#define CKF_EC_ECPARAMETERS (1UL << 22) -#define CKF_EC_NAMEDCURVE (1UL << 23) -#define CKF_EC_UNCOMPRESS (1UL << 24) -#define CKF_EC_COMPRESS (1UL << 25) - - -/* Flags for C_WaitForSlotEvent. */ -#define CKF_DONT_BLOCK (1UL) - - -typedef unsigned long ck_rv_t; - - -typedef ck_rv_t (*ck_notify_t) (ck_session_handle_t session, - ck_notification_t event, void *application); - -/* Forward reference. */ -struct ck_function_list; - -#define _CK_DECLARE_FUNCTION(name, args) \ -typedef ck_rv_t (*CK_ ## name) args; \ -ck_rv_t CK_SPEC name args - -_CK_DECLARE_FUNCTION (C_Initialize, (void *init_args)); -_CK_DECLARE_FUNCTION (C_Finalize, (void *reserved)); -_CK_DECLARE_FUNCTION (C_GetInfo, (struct ck_info *info)); -_CK_DECLARE_FUNCTION (C_GetFunctionList, - (struct ck_function_list **function_list)); - -_CK_DECLARE_FUNCTION (C_GetSlotList, - (unsigned char token_present, ck_slot_id_t *slot_list, - unsigned long *count)); -_CK_DECLARE_FUNCTION (C_GetSlotInfo, - (ck_slot_id_t slot_id, struct ck_slot_info *info)); -_CK_DECLARE_FUNCTION (C_GetTokenInfo, - (ck_slot_id_t slot_id, struct ck_token_info *info)); -_CK_DECLARE_FUNCTION (C_WaitForSlotEvent, - (ck_flags_t flags, ck_slot_id_t *slot, void *reserved)); -_CK_DECLARE_FUNCTION (C_GetMechanismList, - (ck_slot_id_t slot_id, - ck_mechanism_type_t *mechanism_list, - unsigned long *count)); -_CK_DECLARE_FUNCTION (C_GetMechanismInfo, - (ck_slot_id_t slot_id, ck_mechanism_type_t type, - struct ck_mechanism_info *info)); -_CK_DECLARE_FUNCTION (C_InitToken, - (ck_slot_id_t slot_id, unsigned char *pin, - unsigned long pin_len, unsigned char *label)); -_CK_DECLARE_FUNCTION (C_InitPIN, - (ck_session_handle_t session, unsigned char *pin, - unsigned long pin_len)); -_CK_DECLARE_FUNCTION (C_SetPIN, - (ck_session_handle_t session, unsigned char *old_pin, - unsigned long old_len, unsigned char *new_pin, - unsigned long new_len)); - -_CK_DECLARE_FUNCTION (C_OpenSession, - (ck_slot_id_t slot_id, ck_flags_t flags, - void *application, ck_notify_t notify, - ck_session_handle_t *session)); -_CK_DECLARE_FUNCTION (C_CloseSession, (ck_session_handle_t session)); -_CK_DECLARE_FUNCTION (C_CloseAllSessions, (ck_slot_id_t slot_id)); -_CK_DECLARE_FUNCTION (C_GetSessionInfo, - (ck_session_handle_t session, - struct ck_session_info *info)); -_CK_DECLARE_FUNCTION (C_GetOperationState, - (ck_session_handle_t session, - unsigned char *operation_state, - unsigned long *operation_state_len)); -_CK_DECLARE_FUNCTION (C_SetOperationState, - (ck_session_handle_t session, - unsigned char *operation_state, - unsigned long operation_state_len, - ck_object_handle_t encryption_key, - ck_object_handle_t authentiation_key)); -_CK_DECLARE_FUNCTION (C_Login, - (ck_session_handle_t session, ck_user_type_t user_type, - unsigned char *pin, unsigned long pin_len)); -_CK_DECLARE_FUNCTION (C_Logout, (ck_session_handle_t session)); - -_CK_DECLARE_FUNCTION (C_CreateObject, - (ck_session_handle_t session, - struct ck_attribute *templ, - unsigned long count, ck_object_handle_t *object)); -_CK_DECLARE_FUNCTION (C_CopyObject, - (ck_session_handle_t session, ck_object_handle_t object, - struct ck_attribute *templ, unsigned long count, - ck_object_handle_t *new_object)); -_CK_DECLARE_FUNCTION (C_DestroyObject, - (ck_session_handle_t session, - ck_object_handle_t object)); -_CK_DECLARE_FUNCTION (C_GetObjectSize, - (ck_session_handle_t session, - ck_object_handle_t object, - unsigned long *size)); -_CK_DECLARE_FUNCTION (C_GetAttributeValue, - (ck_session_handle_t session, - ck_object_handle_t object, - struct ck_attribute *templ, - unsigned long count)); -_CK_DECLARE_FUNCTION (C_SetAttributeValue, - (ck_session_handle_t session, - ck_object_handle_t object, - struct ck_attribute *templ, - unsigned long count)); -_CK_DECLARE_FUNCTION (C_FindObjectsInit, - (ck_session_handle_t session, - struct ck_attribute *templ, - unsigned long count)); -_CK_DECLARE_FUNCTION (C_FindObjects, - (ck_session_handle_t session, - ck_object_handle_t *object, - unsigned long max_object_count, - unsigned long *object_count)); -_CK_DECLARE_FUNCTION (C_FindObjectsFinal, - (ck_session_handle_t session)); - -_CK_DECLARE_FUNCTION (C_EncryptInit, - (ck_session_handle_t session, - struct ck_mechanism *mechanism, - ck_object_handle_t key)); -_CK_DECLARE_FUNCTION (C_Encrypt, - (ck_session_handle_t session, - unsigned char *data, unsigned long data_len, - unsigned char *encrypted_data, - unsigned long *encrypted_data_len)); -_CK_DECLARE_FUNCTION (C_EncryptUpdate, - (ck_session_handle_t session, - unsigned char *part, unsigned long part_len, - unsigned char *encrypted_part, - unsigned long *encrypted_part_len)); -_CK_DECLARE_FUNCTION (C_EncryptFinal, - (ck_session_handle_t session, - unsigned char *last_encrypted_part, - unsigned long *last_encrypted_part_len)); - -_CK_DECLARE_FUNCTION (C_DecryptInit, - (ck_session_handle_t session, - struct ck_mechanism *mechanism, - ck_object_handle_t key)); -_CK_DECLARE_FUNCTION (C_Decrypt, - (ck_session_handle_t session, - unsigned char *encrypted_data, - unsigned long encrypted_data_len, - unsigned char *data, unsigned long *data_len)); -_CK_DECLARE_FUNCTION (C_DecryptUpdate, - (ck_session_handle_t session, - unsigned char *encrypted_part, - unsigned long encrypted_part_len, - unsigned char *part, unsigned long *part_len)); -_CK_DECLARE_FUNCTION (C_DecryptFinal, - (ck_session_handle_t session, - unsigned char *last_part, - unsigned long *last_part_len)); - -_CK_DECLARE_FUNCTION (C_DigestInit, - (ck_session_handle_t session, - struct ck_mechanism *mechanism)); -_CK_DECLARE_FUNCTION (C_Digest, - (ck_session_handle_t session, - unsigned char *data, unsigned long data_len, - unsigned char *digest, - unsigned long *digest_len)); -_CK_DECLARE_FUNCTION (C_DigestUpdate, - (ck_session_handle_t session, - unsigned char *part, unsigned long part_len)); -_CK_DECLARE_FUNCTION (C_DigestKey, - (ck_session_handle_t session, ck_object_handle_t key)); -_CK_DECLARE_FUNCTION (C_DigestFinal, - (ck_session_handle_t session, - unsigned char *digest, - unsigned long *digest_len)); - -_CK_DECLARE_FUNCTION (C_SignInit, - (ck_session_handle_t session, - struct ck_mechanism *mechanism, - ck_object_handle_t key)); -_CK_DECLARE_FUNCTION (C_Sign, - (ck_session_handle_t session, - unsigned char *data, unsigned long data_len, - unsigned char *signature, - unsigned long *signature_len)); -_CK_DECLARE_FUNCTION (C_SignUpdate, - (ck_session_handle_t session, - unsigned char *part, unsigned long part_len)); -_CK_DECLARE_FUNCTION (C_SignFinal, - (ck_session_handle_t session, - unsigned char *signature, - unsigned long *signature_len)); -_CK_DECLARE_FUNCTION (C_SignRecoverInit, - (ck_session_handle_t session, - struct ck_mechanism *mechanism, - ck_object_handle_t key)); -_CK_DECLARE_FUNCTION (C_SignRecover, - (ck_session_handle_t session, - unsigned char *data, unsigned long data_len, - unsigned char *signature, - unsigned long *signature_len)); - -_CK_DECLARE_FUNCTION (C_VerifyInit, - (ck_session_handle_t session, - struct ck_mechanism *mechanism, - ck_object_handle_t key)); -_CK_DECLARE_FUNCTION (C_Verify, - (ck_session_handle_t session, - unsigned char *data, unsigned long data_len, - unsigned char *signature, - unsigned long signature_len)); -_CK_DECLARE_FUNCTION (C_VerifyUpdate, - (ck_session_handle_t session, - unsigned char *part, unsigned long part_len)); -_CK_DECLARE_FUNCTION (C_VerifyFinal, - (ck_session_handle_t session, - unsigned char *signature, - unsigned long signature_len)); -_CK_DECLARE_FUNCTION (C_VerifyRecoverInit, - (ck_session_handle_t session, - struct ck_mechanism *mechanism, - ck_object_handle_t key)); -_CK_DECLARE_FUNCTION (C_VerifyRecover, - (ck_session_handle_t session, - unsigned char *signature, - unsigned long signature_len, - unsigned char *data, - unsigned long *data_len)); - -_CK_DECLARE_FUNCTION (C_DigestEncryptUpdate, - (ck_session_handle_t session, - unsigned char *part, unsigned long part_len, - unsigned char *encrypted_part, - unsigned long *encrypted_part_len)); -_CK_DECLARE_FUNCTION (C_DecryptDigestUpdate, - (ck_session_handle_t session, - unsigned char *encrypted_part, - unsigned long encrypted_part_len, - unsigned char *part, - unsigned long *part_len)); -_CK_DECLARE_FUNCTION (C_SignEncryptUpdate, - (ck_session_handle_t session, - unsigned char *part, unsigned long part_len, - unsigned char *encrypted_part, - unsigned long *encrypted_part_len)); -_CK_DECLARE_FUNCTION (C_DecryptVerifyUpdate, - (ck_session_handle_t session, - unsigned char *encrypted_part, - unsigned long encrypted_part_len, - unsigned char *part, - unsigned long *part_len)); - -_CK_DECLARE_FUNCTION (C_GenerateKey, - (ck_session_handle_t session, - struct ck_mechanism *mechanism, - struct ck_attribute *templ, - unsigned long count, - ck_object_handle_t *key)); -_CK_DECLARE_FUNCTION (C_GenerateKeyPair, - (ck_session_handle_t session, - struct ck_mechanism *mechanism, - struct ck_attribute *public_key_template, - unsigned long public_key_attribute_count, - struct ck_attribute *private_key_template, - unsigned long private_key_attribute_count, - ck_object_handle_t *public_key, - ck_object_handle_t *private_key)); -_CK_DECLARE_FUNCTION (C_WrapKey, - (ck_session_handle_t session, - struct ck_mechanism *mechanism, - ck_object_handle_t wrapping_key, - ck_object_handle_t key, - unsigned char *wrapped_key, - unsigned long *wrapped_key_len)); -_CK_DECLARE_FUNCTION (C_UnwrapKey, - (ck_session_handle_t session, - struct ck_mechanism *mechanism, - ck_object_handle_t unwrapping_key, - unsigned char *wrapped_key, - unsigned long wrapped_key_len, - struct ck_attribute *templ, - unsigned long attribute_count, - ck_object_handle_t *key)); -_CK_DECLARE_FUNCTION (C_DeriveKey, - (ck_session_handle_t session, - struct ck_mechanism *mechanism, - ck_object_handle_t base_key, - struct ck_attribute *templ, - unsigned long attribute_count, - ck_object_handle_t *key)); - -_CK_DECLARE_FUNCTION (C_SeedRandom, - (ck_session_handle_t session, unsigned char *seed, - unsigned long seed_len)); -_CK_DECLARE_FUNCTION (C_GenerateRandom, - (ck_session_handle_t session, - unsigned char *random_data, - unsigned long random_len)); - -_CK_DECLARE_FUNCTION (C_GetFunctionStatus, (ck_session_handle_t session)); -_CK_DECLARE_FUNCTION (C_CancelFunction, (ck_session_handle_t session)); - - -struct ck_function_list -{ - struct ck_version version; - CK_C_Initialize C_Initialize; - CK_C_Finalize C_Finalize; - CK_C_GetInfo C_GetInfo; - CK_C_GetFunctionList C_GetFunctionList; - CK_C_GetSlotList C_GetSlotList; - CK_C_GetSlotInfo C_GetSlotInfo; - CK_C_GetTokenInfo C_GetTokenInfo; - CK_C_GetMechanismList C_GetMechanismList; - CK_C_GetMechanismInfo C_GetMechanismInfo; - CK_C_InitToken C_InitToken; - CK_C_InitPIN C_InitPIN; - CK_C_SetPIN C_SetPIN; - CK_C_OpenSession C_OpenSession; - CK_C_CloseSession C_CloseSession; - CK_C_CloseAllSessions C_CloseAllSessions; - CK_C_GetSessionInfo C_GetSessionInfo; - CK_C_GetOperationState C_GetOperationState; - CK_C_SetOperationState C_SetOperationState; - CK_C_Login C_Login; - CK_C_Logout C_Logout; - CK_C_CreateObject C_CreateObject; - CK_C_CopyObject C_CopyObject; - CK_C_DestroyObject C_DestroyObject; - CK_C_GetObjectSize C_GetObjectSize; - CK_C_GetAttributeValue C_GetAttributeValue; - CK_C_SetAttributeValue C_SetAttributeValue; - CK_C_FindObjectsInit C_FindObjectsInit; - CK_C_FindObjects C_FindObjects; - CK_C_FindObjectsFinal C_FindObjectsFinal; - CK_C_EncryptInit C_EncryptInit; - CK_C_Encrypt C_Encrypt; - CK_C_EncryptUpdate C_EncryptUpdate; - CK_C_EncryptFinal C_EncryptFinal; - CK_C_DecryptInit C_DecryptInit; - CK_C_Decrypt C_Decrypt; - CK_C_DecryptUpdate C_DecryptUpdate; - CK_C_DecryptFinal C_DecryptFinal; - CK_C_DigestInit C_DigestInit; - CK_C_Digest C_Digest; - CK_C_DigestUpdate C_DigestUpdate; - CK_C_DigestKey C_DigestKey; - CK_C_DigestFinal C_DigestFinal; - CK_C_SignInit C_SignInit; - CK_C_Sign C_Sign; - CK_C_SignUpdate C_SignUpdate; - CK_C_SignFinal C_SignFinal; - CK_C_SignRecoverInit C_SignRecoverInit; - CK_C_SignRecover C_SignRecover; - CK_C_VerifyInit C_VerifyInit; - CK_C_Verify C_Verify; - CK_C_VerifyUpdate C_VerifyUpdate; - CK_C_VerifyFinal C_VerifyFinal; - CK_C_VerifyRecoverInit C_VerifyRecoverInit; - CK_C_VerifyRecover C_VerifyRecover; - CK_C_DigestEncryptUpdate C_DigestEncryptUpdate; - CK_C_DecryptDigestUpdate C_DecryptDigestUpdate; - CK_C_SignEncryptUpdate C_SignEncryptUpdate; - CK_C_DecryptVerifyUpdate C_DecryptVerifyUpdate; - CK_C_GenerateKey C_GenerateKey; - CK_C_GenerateKeyPair C_GenerateKeyPair; - CK_C_WrapKey C_WrapKey; - CK_C_UnwrapKey C_UnwrapKey; - CK_C_DeriveKey C_DeriveKey; - CK_C_SeedRandom C_SeedRandom; - CK_C_GenerateRandom C_GenerateRandom; - CK_C_GetFunctionStatus C_GetFunctionStatus; - CK_C_CancelFunction C_CancelFunction; - CK_C_WaitForSlotEvent C_WaitForSlotEvent; -}; - - -typedef ck_rv_t (*ck_createmutex_t) (void **mutex); -typedef ck_rv_t (*ck_destroymutex_t) (void *mutex); -typedef ck_rv_t (*ck_lockmutex_t) (void *mutex); -typedef ck_rv_t (*ck_unlockmutex_t) (void *mutex); - - -struct ck_c_initialize_args -{ - ck_createmutex_t create_mutex; - ck_destroymutex_t destroy_mutex; - ck_lockmutex_t lock_mutex; - ck_unlockmutex_t unlock_mutex; - ck_flags_t flags; - void *reserved; -}; - - -#define CKF_LIBRARY_CANT_CREATE_OS_THREADS (1UL << 0) -#define CKF_OS_LOCKING_OK (1UL << 1) - -#define CKR_OK (0UL) -#define CKR_CANCEL (1UL) -#define CKR_HOST_MEMORY (2UL) -#define CKR_SLOT_ID_INVALID (3UL) -#define CKR_GENERAL_ERROR (5UL) -#define CKR_FUNCTION_FAILED (6UL) -#define CKR_ARGUMENTS_BAD (7UL) -#define CKR_NO_EVENT (8UL) -#define CKR_NEED_TO_CREATE_THREADS (9UL) -#define CKR_CANT_LOCK (0xaUL) -#define CKR_ATTRIBUTE_READ_ONLY (0x10UL) -#define CKR_ATTRIBUTE_SENSITIVE (0x11UL) -#define CKR_ATTRIBUTE_TYPE_INVALID (0x12UL) -#define CKR_ATTRIBUTE_VALUE_INVALID (0x13UL) -#define CKR_ACTION_PROHIBITED (0x1BUL) -#define CKR_DATA_INVALID (0x20UL) -#define CKR_DATA_LEN_RANGE (0x21UL) -#define CKR_DEVICE_ERROR (0x30UL) -#define CKR_DEVICE_MEMORY (0x31UL) -#define CKR_DEVICE_REMOVED (0x32UL) -#define CKR_ENCRYPTED_DATA_INVALID (0x40UL) -#define CKR_ENCRYPTED_DATA_LEN_RANGE (0x41UL) -#define CKR_FUNCTION_CANCELED (0x50UL) -#define CKR_FUNCTION_NOT_PARALLEL (0x51UL) -#define CKR_FUNCTION_NOT_SUPPORTED (0x54UL) -#define CKR_KEY_HANDLE_INVALID (0x60UL) -#define CKR_KEY_SIZE_RANGE (0x62UL) -#define CKR_KEY_TYPE_INCONSISTENT (0x63UL) -#define CKR_KEY_NOT_NEEDED (0x64UL) -#define CKR_KEY_CHANGED (0x65UL) -#define CKR_KEY_NEEDED (0x66UL) -#define CKR_KEY_INDIGESTIBLE (0x67UL) -#define CKR_KEY_FUNCTION_NOT_PERMITTED (0x68UL) -#define CKR_KEY_NOT_WRAPPABLE (0x69UL) -#define CKR_KEY_UNEXTRACTABLE (0x6aUL) -#define CKR_MECHANISM_INVALID (0x70UL) -#define CKR_MECHANISM_PARAM_INVALID (0x71UL) -#define CKR_OBJECT_HANDLE_INVALID (0x82UL) -#define CKR_OPERATION_ACTIVE (0x90UL) -#define CKR_OPERATION_NOT_INITIALIZED (0x91UL) -#define CKR_PIN_INCORRECT (0xa0UL) -#define CKR_PIN_INVALID (0xa1UL) -#define CKR_PIN_LEN_RANGE (0xa2UL) -#define CKR_PIN_EXPIRED (0xa3UL) -#define CKR_PIN_LOCKED (0xa4UL) -#define CKR_SESSION_CLOSED (0xb0UL) -#define CKR_SESSION_COUNT (0xb1UL) -#define CKR_SESSION_HANDLE_INVALID (0xb3UL) -#define CKR_SESSION_PARALLEL_NOT_SUPPORTED (0xb4UL) -#define CKR_SESSION_READ_ONLY (0xb5UL) -#define CKR_SESSION_EXISTS (0xb6UL) -#define CKR_SESSION_READ_ONLY_EXISTS (0xb7UL) -#define CKR_SESSION_READ_WRITE_SO_EXISTS (0xb8UL) -#define CKR_SIGNATURE_INVALID (0xc0UL) -#define CKR_SIGNATURE_LEN_RANGE (0xc1UL) -#define CKR_TEMPLATE_INCOMPLETE (0xd0UL) -#define CKR_TEMPLATE_INCONSISTENT (0xd1UL) -#define CKR_TOKEN_NOT_PRESENT (0xe0UL) -#define CKR_TOKEN_NOT_RECOGNIZED (0xe1UL) -#define CKR_TOKEN_WRITE_PROTECTED (0xe2UL) -#define CKR_UNWRAPPING_KEY_HANDLE_INVALID (0xf0UL) -#define CKR_UNWRAPPING_KEY_SIZE_RANGE (0xf1UL) -#define CKR_UNWRAPPING_KEY_TYPE_INCONSISTENT (0xf2UL) -#define CKR_USER_ALREADY_LOGGED_IN (0x100UL) -#define CKR_USER_NOT_LOGGED_IN (0x101UL) -#define CKR_USER_PIN_NOT_INITIALIZED (0x102UL) -#define CKR_USER_TYPE_INVALID (0x103UL) -#define CKR_USER_ANOTHER_ALREADY_LOGGED_IN (0x104UL) -#define CKR_USER_TOO_MANY_TYPES (0x105UL) -#define CKR_WRAPPED_KEY_INVALID (0x110UL) -#define CKR_WRAPPED_KEY_LEN_RANGE (0x112UL) -#define CKR_WRAPPING_KEY_HANDLE_INVALID (0x113UL) -#define CKR_WRAPPING_KEY_SIZE_RANGE (0x114UL) -#define CKR_WRAPPING_KEY_TYPE_INCONSISTENT (0x115UL) -#define CKR_RANDOM_SEED_NOT_SUPPORTED (0x120UL) -#define CKR_RANDOM_NO_RNG (0x121UL) -#define CKR_DOMAIN_PARAMS_INVALID (0x130UL) -#define CKR_BUFFER_TOO_SMALL (0x150UL) -#define CKR_SAVED_STATE_INVALID (0x160UL) -#define CKR_INFORMATION_SENSITIVE (0x170UL) -#define CKR_STATE_UNSAVEABLE (0x180UL) -#define CKR_CRYPTOKI_NOT_INITIALIZED (0x190UL) -#define CKR_CRYPTOKI_ALREADY_INITIALIZED (0x191UL) -#define CKR_MUTEX_BAD (0x1a0UL) -#define CKR_MUTEX_NOT_LOCKED (0x1a1UL) -#define CKR_NEW_PIN_MODE (0x1b0UL) -#define CKR_NEXT_OTP (0x1b1UL) -#define CKR_EXCEEDED_MAX_ITERATIONS (0x1c0UL) -#define CKR_FIPS_SELF_TEST_FAILED (0x1c1UL) -#define CKR_LIBRARY_LOAD_FAILED (0x1c2UL) -#define CKR_PIN_TOO_WEAK (0x1c3UL) -#define CKR_PUBLIC_KEY_INVALID (0x1c4UL) -#define CKR_FUNCTION_REJECTED (0x200UL) -#define CKR_VENDOR_DEFINED ((unsigned long) (1UL << 31)) - - -#define CKZ_DATA_SPECIFIED (0x01UL) - - - -/* Compatibility layer. */ - -#ifdef CRYPTOKI_COMPAT - -#undef CK_DEFINE_FUNCTION -#define CK_DEFINE_FUNCTION(retval, name) retval CK_SPEC name - -/* For NULL. */ -#include - -typedef unsigned char CK_BYTE; -typedef unsigned char CK_CHAR; -typedef unsigned char CK_UTF8CHAR; -typedef unsigned char CK_BBOOL; -typedef unsigned long int CK_ULONG; -typedef long int CK_LONG; -typedef CK_BYTE *CK_BYTE_PTR; -typedef CK_CHAR *CK_CHAR_PTR; -typedef CK_UTF8CHAR *CK_UTF8CHAR_PTR; -typedef CK_ULONG *CK_ULONG_PTR; -typedef void *CK_VOID_PTR; -typedef void **CK_VOID_PTR_PTR; -#define CK_FALSE 0 -#define CK_TRUE 1 -#ifndef CK_DISABLE_TRUE_FALSE -#ifndef FALSE -#define FALSE 0 -#endif -#ifndef TRUE -#define TRUE 1 -#endif -#endif - -typedef struct ck_version CK_VERSION; -typedef struct ck_version *CK_VERSION_PTR; - -typedef struct ck_info CK_INFO; -typedef struct ck_info *CK_INFO_PTR; - -typedef ck_slot_id_t *CK_SLOT_ID_PTR; - -typedef struct ck_slot_info CK_SLOT_INFO; -typedef struct ck_slot_info *CK_SLOT_INFO_PTR; - -typedef struct ck_token_info CK_TOKEN_INFO; -typedef struct ck_token_info *CK_TOKEN_INFO_PTR; - -typedef ck_session_handle_t *CK_SESSION_HANDLE_PTR; - -typedef struct ck_session_info CK_SESSION_INFO; -typedef struct ck_session_info *CK_SESSION_INFO_PTR; - -typedef ck_object_handle_t *CK_OBJECT_HANDLE_PTR; - -typedef ck_object_class_t *CK_OBJECT_CLASS_PTR; - -typedef struct ck_attribute CK_ATTRIBUTE; -typedef struct ck_attribute *CK_ATTRIBUTE_PTR; - -typedef struct ck_date CK_DATE; -typedef struct ck_date *CK_DATE_PTR; - -typedef ck_mechanism_type_t *CK_MECHANISM_TYPE_PTR; - -typedef struct ck_mechanism CK_MECHANISM; -typedef struct ck_mechanism *CK_MECHANISM_PTR; - -typedef struct ck_mechanism_info CK_MECHANISM_INFO; -typedef struct ck_mechanism_info *CK_MECHANISM_INFO_PTR; - -typedef struct ck_otp_mechanism_info CK_OTP_MECHANISM_INFO; -typedef struct ck_otp_mechanism_info *CK_OTP_MECHANISM_INFO_PTR; - -typedef struct ck_function_list CK_FUNCTION_LIST; -typedef struct ck_function_list *CK_FUNCTION_LIST_PTR; -typedef struct ck_function_list **CK_FUNCTION_LIST_PTR_PTR; - -typedef struct ck_c_initialize_args CK_C_INITIALIZE_ARGS; -typedef struct ck_c_initialize_args *CK_C_INITIALIZE_ARGS_PTR; - -typedef struct ck_rsa_pkcs_pss_params CK_RSA_PKCS_PSS_PARAMS; -typedef struct ck_rsa_pkcs_pss_params *CK_RSA_PKCS_PSS_PARAMS_PTR; - -typedef struct ck_rsa_pkcs_oaep_params CK_RSA_PKCS_OAEP_PARAMS; -typedef struct ck_rsa_pkcs_oaep_params *CK_RSA_PKCS_OAEP_PARAMS_PTR; - -typedef struct ck_aes_ctr_params CK_AES_CTR_PARAMS; -typedef struct ck_aes_ctr_params *CK_AES_CTR_PARAMS_PTR; - -typedef struct ck_gcm_params CK_GCM_PARAMS; -typedef struct ck_gcm_params *CK_GCM_PARAMS_PTR; - -typedef struct ck_ecdh1_derive_params CK_ECDH1_DERIVE_PARAMS; -typedef struct ck_ecdh1_derive_params *CK_ECDH1_DERIVE_PARAMS_PTR; - -typedef struct ck_key_derivation_string_data CK_KEY_DERIVATION_STRING_DATA; -typedef struct ck_key_derivation_string_data *CK_KEY_DERIVATION_STRING_DATA_PTR; - -typedef struct ck_des_cbc_encrypt_data_params CK_DES_CBC_ENCRYPT_DATA_PARAMS; -typedef struct ck_des_cbc_encrypt_data_params *CK_DES_CBC_ENCRYPT_DATA_PARAMS_PTR; - -typedef struct ck_aes_cbc_encrypt_data_params CK_AES_CBC_ENCRYPT_DATA_PARAMS; -typedef struct ck_aes_cbc_encrypt_data_params *CK_AES_CBC_ENCRYPT_DATA_PARAMS_PTR; - -#ifndef NULL_PTR -#define NULL_PTR NULL -#endif - -/* Delete the helper macros defined at the top of the file. */ -#undef ck_flags_t -#undef ck_version - -#undef ck_info -#undef cryptoki_version -#undef manufacturer_id -#undef library_description -#undef library_version - -#undef ck_notification_t -#undef ck_slot_id_t - -#undef ck_slot_info -#undef slot_description -#undef hardware_version -#undef firmware_version - -#undef ck_token_info -#undef serial_number -#undef max_session_count -#undef session_count -#undef max_rw_session_count -#undef rw_session_count -#undef max_pin_len -#undef min_pin_len -#undef total_public_memory -#undef free_public_memory -#undef total_private_memory -#undef free_private_memory -#undef utc_time - -#undef ck_session_handle_t -#undef ck_user_type_t -#undef ck_state_t - -#undef ck_session_info -#undef slot_id -#undef device_error - -#undef ck_object_handle_t -#undef ck_object_class_t -#undef ck_hw_feature_type_t -#undef ck_key_type_t -#undef ck_certificate_type_t -#undef ck_attribute_type_t - -#undef ck_attribute -#undef value -#undef value_len - -#undef params -#undef count - -#undef ck_date - -#undef ck_mechanism_type_t - -#undef ck_mechanism -#undef parameter -#undef parameter_len - -#undef ck_mechanism_info - -#undef ck_param_type -#undef ck_otp_param -#undef ck_otp_params -#undef ck_otp_signature_info - -#undef min_key_size -#undef max_key_size - -#undef ck_rv_t -#undef ck_notify_t - -#undef ck_function_list - -#undef ck_createmutex_t -#undef ck_destroymutex_t -#undef ck_lockmutex_t -#undef ck_unlockmutex_t - -#undef ck_c_initialize_args -#undef create_mutex -#undef destroy_mutex -#undef lock_mutex -#undef unlock_mutex -#undef reserved - -#endif /* CRYPTOKI_COMPAT */ - - -/* System dependencies. */ -#if defined(_WIN32) || defined(CRYPTOKI_FORCE_WIN32) -#pragma pack(pop, cryptoki) -#endif - -#if defined(__cplusplus) -} -#endif - -#endif /* PKCS11_H */ diff --git a/cryptoki-sys/platform.h b/cryptoki-sys/platform.h new file mode 100644 index 00000000..0b2c185f --- /dev/null +++ b/cryptoki-sys/platform.h @@ -0,0 +1,19 @@ +#if defined(_WIN32) || defined(CRYPTOKI_FORCE_WIN32) +#pragma pack(push, cryptoki, 1) +#endif + +#define CK_PTR * +#define CK_DECLARE_FUNCTION(returnType, name) returnType name +#define CK_DECLARE_FUNCTION_POINTER(returnType, name) returnType(*name) +#define CK_CALLBACK_FUNCTION(returnType, name) returnType(*name) +#define NULL_PTR 0 + +// bugs? +#define CK_BOOL CK_BBOOL +#define CK_HANDLE CK_ULONG + +#include "vendor/pkcs11.h" + +#if defined(_WIN32) || defined(CRYPTOKI_FORCE_WIN32) +#pragma pack(pop, cryptoki, 1) +#endif diff --git a/cryptoki-sys/regenerate_bindings.sh b/cryptoki-sys/regenerate_bindings.sh index afc8d468..d90c5267 100755 --- a/cryptoki-sys/regenerate_bindings.sh +++ b/cryptoki-sys/regenerate_bindings.sh @@ -5,6 +5,10 @@ set -xeuf -o pipefail +find ../target/ -name "pkcs11_bindings.rs" -delete +MAKE_GENERIC_BINDINGS=1 cargo build --features generate-bindings +find ../target/ -name "pkcs11_bindings.rs" | xargs -I '{}' cp '{}' src/bindings/generic.rs + targets="aarch64-unknown-linux-gnu arm-unknown-linux-gnueabi x86_64-pc-windows-msvc i686-unknown-linux-gnu powerpc64-unknown-linux-gnu x86_64-unknown-linux-gnu x86_64-apple-darwin aarch64-apple-darwin x86_64-unknown-freebsd" TARGET_INSTALLED= diff --git a/cryptoki-sys/src/bindings/aarch64-apple-darwin.rs b/cryptoki-sys/src/bindings/aarch64-apple-darwin.rs index 6800365c..c4200fb4 100644 --- a/cryptoki-sys/src/bindings/aarch64-apple-darwin.rs +++ b/cryptoki-sys/src/bindings/aarch64-apple-darwin.rs @@ -1,10 +1,22 @@ /* automatically generated by rust-bindgen 0.63.0 */ -pub const PKCS11_H: u32 = 1; -pub const CRYPTOKI_VERSION_MAJOR: CK_BYTE = 2; -pub const CRYPTOKI_VERSION_MINOR: CK_BYTE = 40; -pub const P11_KIT_CRYPTOKI_VERSION_REVISION: u32 = 0; -pub const CRYPTOKI_COMPAT: u32 = 1; +pub const NULL_PTR: u32 = 0; +pub const _PKCS11_H_: u32 = 1; +pub const _PKCS11T_H_: u32 = 1; +pub const CRYPTOKI_VERSION_MAJOR: CK_BYTE = 3; +pub const CRYPTOKI_VERSION_MINOR: CK_BYTE = 0; +pub const CRYPTOKI_VERSION_AMENDMENT: CK_BYTE = 0; +pub const CK_TRUE: CK_BBOOL = 1; +pub const CK_FALSE: CK_BBOOL = 0; +pub const FALSE: u32 = 0; +pub const TRUE: u32 = 1; +pub const CK_EFFECTIVELY_INFINITE: CK_ULONG = 0; +pub const CK_INVALID_HANDLE: CK_ULONG = 0; +pub const CKN_SURRENDER: CK_NOTIFICATION = 0; +pub const CKN_OTP_CHANGED: CK_NOTIFICATION = 1; +pub const CKF_TOKEN_PRESENT: CK_FLAGS = 1; +pub const CKF_REMOVABLE_DEVICE: CK_FLAGS = 2; +pub const CKF_HW_SLOT: CK_FLAGS = 4; pub const CKF_RNG: CK_FLAGS = 1; pub const CKF_WRITE_PROTECTED: CK_FLAGS = 2; pub const CKF_LOGIN_REQUIRED: CK_FLAGS = 4; @@ -24,8 +36,6 @@ pub const CKF_SO_PIN_FINAL_TRY: CK_FLAGS = 2097152; pub const CKF_SO_PIN_LOCKED: CK_FLAGS = 4194304; pub const CKF_SO_PIN_TO_BE_CHANGED: CK_FLAGS = 8388608; pub const CKF_ERROR_STATE: CK_FLAGS = 16777216; -pub const CK_EFFECTIVELY_INFINITE: CK_ULONG = 0; -pub const CK_INVALID_HANDLE: CK_ULONG = 0; pub const CKU_SO: CK_USER_TYPE = 0; pub const CKU_USER: CK_USER_TYPE = 1; pub const CKU_CONTEXT_SPECIFIC: CK_USER_TYPE = 2; @@ -45,9 +55,18 @@ pub const CKO_HW_FEATURE: CK_OBJECT_CLASS = 5; pub const CKO_DOMAIN_PARAMETERS: CK_OBJECT_CLASS = 6; pub const CKO_MECHANISM: CK_OBJECT_CLASS = 7; pub const CKO_OTP_KEY: CK_OBJECT_CLASS = 8; +pub const CKO_PROFILE: CK_OBJECT_CLASS = 9; +pub const CKO_VENDOR_DEFINED: CK_OBJECT_CLASS = 2147483648; +pub const CKP_INVALID_ID: CK_PROFILE_ID = 0; +pub const CKP_BASELINE_PROVIDER: CK_PROFILE_ID = 1; +pub const CKP_EXTENDED_PROVIDER: CK_PROFILE_ID = 2; +pub const CKP_AUTHENTICATION_TOKEN: CK_PROFILE_ID = 3; +pub const CKP_PUBLIC_CERTIFICATES_TOKEN: CK_PROFILE_ID = 4; +pub const CKP_VENDOR_DEFINED: CK_PROFILE_ID = 2147483648; pub const CKH_MONOTONIC_COUNTER: CK_HW_FEATURE_TYPE = 1; pub const CKH_CLOCK: CK_HW_FEATURE_TYPE = 2; pub const CKH_USER_INTERFACE: CK_HW_FEATURE_TYPE = 3; +pub const CKH_VENDOR_DEFINED: CK_HW_FEATURE_TYPE = 2147483648; pub const CKK_RSA: CK_KEY_TYPE = 0; pub const CKK_DSA: CK_KEY_TYPE = 1; pub const CKK_DH: CK_KEY_TYPE = 2; @@ -63,6 +82,7 @@ pub const CKK_DES2: CK_KEY_TYPE = 20; pub const CKK_DES3: CK_KEY_TYPE = 21; pub const CKK_CAST: CK_KEY_TYPE = 22; pub const CKK_CAST3: CK_KEY_TYPE = 23; +pub const CKK_CAST5: CK_KEY_TYPE = 24; pub const CKK_CAST128: CK_KEY_TYPE = 24; pub const CKK_RC5: CK_KEY_TYPE = 25; pub const CKK_IDEA: CK_KEY_TYPE = 26; @@ -90,14 +110,48 @@ pub const CKK_SEED: CK_KEY_TYPE = 47; pub const CKK_GOSTR3410: CK_KEY_TYPE = 48; pub const CKK_GOSTR3411: CK_KEY_TYPE = 49; pub const CKK_GOST28147: CK_KEY_TYPE = 50; +pub const CKK_CHACHA20: CK_KEY_TYPE = 51; +pub const CKK_POLY1305: CK_KEY_TYPE = 52; +pub const CKK_AES_XTS: CK_KEY_TYPE = 53; +pub const CKK_SHA3_224_HMAC: CK_KEY_TYPE = 54; +pub const CKK_SHA3_256_HMAC: CK_KEY_TYPE = 55; +pub const CKK_SHA3_384_HMAC: CK_KEY_TYPE = 56; +pub const CKK_SHA3_512_HMAC: CK_KEY_TYPE = 57; +pub const CKK_BLAKE2B_160_HMAC: CK_KEY_TYPE = 58; +pub const CKK_BLAKE2B_256_HMAC: CK_KEY_TYPE = 59; +pub const CKK_BLAKE2B_384_HMAC: CK_KEY_TYPE = 60; +pub const CKK_BLAKE2B_512_HMAC: CK_KEY_TYPE = 61; +pub const CKK_SALSA20: CK_KEY_TYPE = 62; +pub const CKK_X2RATCHET: CK_KEY_TYPE = 63; pub const CKK_EC_EDWARDS: CK_KEY_TYPE = 64; +pub const CKK_EC_MONTGOMERY: CK_KEY_TYPE = 65; +pub const CKK_HKDF: CK_KEY_TYPE = 66; +pub const CKK_VENDOR_DEFINED: CK_KEY_TYPE = 2147483648; +pub const CK_CERTIFICATE_CATEGORY_UNSPECIFIED: CK_ULONG = 0; +pub const CK_CERTIFICATE_CATEGORY_TOKEN_USER: CK_ULONG = 1; +pub const CK_CERTIFICATE_CATEGORY_AUTHORITY: CK_ULONG = 2; +pub const CK_CERTIFICATE_CATEGORY_OTHER_ENTITY: CK_ULONG = 3; +pub const CK_SECURITY_DOMAIN_UNSPECIFIED: CK_ULONG = 0; +pub const CK_SECURITY_DOMAIN_MANUFACTURER: CK_ULONG = 1; +pub const CK_SECURITY_DOMAIN_OPERATOR: CK_ULONG = 2; +pub const CK_SECURITY_DOMAIN_THIRD_PARTY: CK_ULONG = 3; pub const CKC_X_509: CK_CERTIFICATE_TYPE = 0; pub const CKC_X_509_ATTR_CERT: CK_CERTIFICATE_TYPE = 1; pub const CKC_WTLS: CK_CERTIFICATE_TYPE = 2; +pub const CKC_VENDOR_DEFINED: CK_CERTIFICATE_TYPE = 2147483648; +pub const CKF_ARRAY_ATTRIBUTE: CK_FLAGS = 1073741824; +pub const CK_OTP_FORMAT_DECIMAL: CK_ULONG = 0; +pub const CK_OTP_FORMAT_HEXADECIMAL: CK_ULONG = 1; +pub const CK_OTP_FORMAT_ALPHANUMERIC: CK_ULONG = 2; +pub const CK_OTP_FORMAT_BINARY: CK_ULONG = 3; +pub const CK_OTP_PARAM_IGNORED: CK_ULONG = 0; +pub const CK_OTP_PARAM_OPTIONAL: CK_ULONG = 1; +pub const CK_OTP_PARAM_MANDATORY: CK_ULONG = 2; pub const CKA_CLASS: CK_ATTRIBUTE_TYPE = 0; pub const CKA_TOKEN: CK_ATTRIBUTE_TYPE = 1; pub const CKA_PRIVATE: CK_ATTRIBUTE_TYPE = 2; pub const CKA_LABEL: CK_ATTRIBUTE_TYPE = 3; +pub const CKA_UNIQUE_ID: CK_ATTRIBUTE_TYPE = 4; pub const CKA_APPLICATION: CK_ATTRIBUTE_TYPE = 16; pub const CKA_VALUE: CK_ATTRIBUTE_TYPE = 17; pub const CKA_OBJECT_ID: CK_ATTRIBUTE_TYPE = 18; @@ -144,6 +198,7 @@ pub const CKA_PRIME: CK_ATTRIBUTE_TYPE = 304; pub const CKA_SUBPRIME: CK_ATTRIBUTE_TYPE = 305; pub const CKA_BASE: CK_ATTRIBUTE_TYPE = 306; pub const CKA_PRIME_BITS: CK_ATTRIBUTE_TYPE = 307; +pub const CKA_SUBPRIME_BITS: CK_ATTRIBUTE_TYPE = 308; pub const CKA_SUB_PRIME_BITS: CK_ATTRIBUTE_TYPE = 308; pub const CKA_VALUE_BITS: CK_ATTRIBUTE_TYPE = 352; pub const CKA_VALUE_LEN: CK_ATTRIBUTE_TYPE = 353; @@ -162,6 +217,9 @@ pub const CKA_SECONDARY_AUTH: CK_ATTRIBUTE_TYPE = 512; pub const CKA_AUTH_PIN_FLAGS: CK_ATTRIBUTE_TYPE = 513; pub const CKA_ALWAYS_AUTHENTICATE: CK_ATTRIBUTE_TYPE = 514; pub const CKA_WRAP_WITH_TRUSTED: CK_ATTRIBUTE_TYPE = 528; +pub const CKA_WRAP_TEMPLATE: CK_ATTRIBUTE_TYPE = 1073742353; +pub const CKA_UNWRAP_TEMPLATE: CK_ATTRIBUTE_TYPE = 1073742354; +pub const CKA_DERIVE_TEMPLATE: CK_ATTRIBUTE_TYPE = 1073742355; pub const CKA_OTP_FORMAT: CK_ATTRIBUTE_TYPE = 544; pub const CKA_OTP_LENGTH: CK_ATTRIBUTE_TYPE = 545; pub const CKA_OTP_TIME_INTERVAL: CK_ATTRIBUTE_TYPE = 546; @@ -170,12 +228,12 @@ pub const CKA_OTP_CHALLENGE_REQUIREMENT: CK_ATTRIBUTE_TYPE = 548; pub const CKA_OTP_TIME_REQUIREMENT: CK_ATTRIBUTE_TYPE = 549; pub const CKA_OTP_COUNTER_REQUIREMENT: CK_ATTRIBUTE_TYPE = 550; pub const CKA_OTP_PIN_REQUIREMENT: CK_ATTRIBUTE_TYPE = 551; +pub const CKA_OTP_COUNTER: CK_ATTRIBUTE_TYPE = 558; +pub const CKA_OTP_TIME: CK_ATTRIBUTE_TYPE = 559; pub const CKA_OTP_USER_IDENTIFIER: CK_ATTRIBUTE_TYPE = 554; pub const CKA_OTP_SERVICE_IDENTIFIER: CK_ATTRIBUTE_TYPE = 555; pub const CKA_OTP_SERVICE_LOGO: CK_ATTRIBUTE_TYPE = 556; pub const CKA_OTP_SERVICE_LOGO_TYPE: CK_ATTRIBUTE_TYPE = 557; -pub const CKA_OTP_COUNTER: CK_ATTRIBUTE_TYPE = 558; -pub const CKA_OTP_TIME: CK_ATTRIBUTE_TYPE = 559; pub const CKA_GOSTR3410_PARAMS: CK_ATTRIBUTE_TYPE = 592; pub const CKA_GOSTR3411_PARAMS: CK_ATTRIBUTE_TYPE = 593; pub const CKA_GOST28147_PARAMS: CK_ATTRIBUTE_TYPE = 594; @@ -196,6 +254,9 @@ pub const CKA_MECHANISM_TYPE: CK_ATTRIBUTE_TYPE = 1280; pub const CKA_REQUIRED_CMS_ATTRIBUTES: CK_ATTRIBUTE_TYPE = 1281; pub const CKA_DEFAULT_CMS_ATTRIBUTES: CK_ATTRIBUTE_TYPE = 1282; pub const CKA_SUPPORTED_CMS_ATTRIBUTES: CK_ATTRIBUTE_TYPE = 1283; +pub const CKA_ALLOWED_MECHANISMS: CK_ATTRIBUTE_TYPE = 1073743360; +pub const CKA_PROFILE_ID: CK_ATTRIBUTE_TYPE = 1537; +pub const CKA_VENDOR_DEFINED: CK_ATTRIBUTE_TYPE = 2147483648; pub const CKM_RSA_PKCS_KEY_PAIR_GEN: CK_MECHANISM_TYPE = 0; pub const CKM_RSA_PKCS: CK_MECHANISM_TYPE = 1; pub const CKM_RSA_9796: CK_MECHANISM_TYPE = 2; @@ -218,6 +279,10 @@ pub const CKM_DSA_SHA224: CK_MECHANISM_TYPE = 19; pub const CKM_DSA_SHA256: CK_MECHANISM_TYPE = 20; pub const CKM_DSA_SHA384: CK_MECHANISM_TYPE = 21; pub const CKM_DSA_SHA512: CK_MECHANISM_TYPE = 22; +pub const CKM_DSA_SHA3_224: CK_MECHANISM_TYPE = 24; +pub const CKM_DSA_SHA3_256: CK_MECHANISM_TYPE = 25; +pub const CKM_DSA_SHA3_384: CK_MECHANISM_TYPE = 26; +pub const CKM_DSA_SHA3_512: CK_MECHANISM_TYPE = 27; pub const CKM_DH_PKCS_KEY_PAIR_GEN: CK_MECHANISM_TYPE = 32; pub const CKM_DH_PKCS_DERIVE: CK_MECHANISM_TYPE = 33; pub const CKM_X9_42_DH_KEY_PAIR_GEN: CK_MECHANISM_TYPE = 48; @@ -230,6 +295,8 @@ pub const CKM_SHA512_RSA_PKCS: CK_MECHANISM_TYPE = 66; pub const CKM_SHA256_RSA_PKCS_PSS: CK_MECHANISM_TYPE = 67; pub const CKM_SHA384_RSA_PKCS_PSS: CK_MECHANISM_TYPE = 68; pub const CKM_SHA512_RSA_PKCS_PSS: CK_MECHANISM_TYPE = 69; +pub const CKM_SHA224_RSA_PKCS: CK_MECHANISM_TYPE = 70; +pub const CKM_SHA224_RSA_PKCS_PSS: CK_MECHANISM_TYPE = 71; pub const CKM_SHA512_224: CK_MECHANISM_TYPE = 72; pub const CKM_SHA512_224_HMAC: CK_MECHANISM_TYPE = 73; pub const CKM_SHA512_224_HMAC_GENERAL: CK_MECHANISM_TYPE = 74; @@ -242,6 +309,14 @@ pub const CKM_SHA512_T: CK_MECHANISM_TYPE = 80; pub const CKM_SHA512_T_HMAC: CK_MECHANISM_TYPE = 81; pub const CKM_SHA512_T_HMAC_GENERAL: CK_MECHANISM_TYPE = 82; pub const CKM_SHA512_T_KEY_DERIVATION: CK_MECHANISM_TYPE = 83; +pub const CKM_SHA3_256_RSA_PKCS: CK_MECHANISM_TYPE = 96; +pub const CKM_SHA3_384_RSA_PKCS: CK_MECHANISM_TYPE = 97; +pub const CKM_SHA3_512_RSA_PKCS: CK_MECHANISM_TYPE = 98; +pub const CKM_SHA3_256_RSA_PKCS_PSS: CK_MECHANISM_TYPE = 99; +pub const CKM_SHA3_384_RSA_PKCS_PSS: CK_MECHANISM_TYPE = 100; +pub const CKM_SHA3_512_RSA_PKCS_PSS: CK_MECHANISM_TYPE = 101; +pub const CKM_SHA3_224_RSA_PKCS: CK_MECHANISM_TYPE = 102; +pub const CKM_SHA3_224_RSA_PKCS_PSS: CK_MECHANISM_TYPE = 103; pub const CKM_RC2_KEY_GEN: CK_MECHANISM_TYPE = 256; pub const CKM_RC2_ECB: CK_MECHANISM_TYPE = 257; pub const CKM_RC2_CBC: CK_MECHANISM_TYPE = 258; @@ -293,6 +368,9 @@ pub const CKM_RIPEMD160_HMAC_GENERAL: CK_MECHANISM_TYPE = 578; pub const CKM_SHA256: CK_MECHANISM_TYPE = 592; pub const CKM_SHA256_HMAC: CK_MECHANISM_TYPE = 593; pub const CKM_SHA256_HMAC_GENERAL: CK_MECHANISM_TYPE = 594; +pub const CKM_SHA224: CK_MECHANISM_TYPE = 597; +pub const CKM_SHA224_HMAC: CK_MECHANISM_TYPE = 598; +pub const CKM_SHA224_HMAC_GENERAL: CK_MECHANISM_TYPE = 599; pub const CKM_SHA384: CK_MECHANISM_TYPE = 608; pub const CKM_SHA384_HMAC: CK_MECHANISM_TYPE = 609; pub const CKM_SHA384_HMAC_GENERAL: CK_MECHANISM_TYPE = 610; @@ -305,6 +383,22 @@ pub const CKM_HOTP_KEY_GEN: CK_MECHANISM_TYPE = 656; pub const CKM_HOTP: CK_MECHANISM_TYPE = 657; pub const CKM_ACTI: CK_MECHANISM_TYPE = 672; pub const CKM_ACTI_KEY_GEN: CK_MECHANISM_TYPE = 673; +pub const CKM_SHA3_256: CK_MECHANISM_TYPE = 688; +pub const CKM_SHA3_256_HMAC: CK_MECHANISM_TYPE = 689; +pub const CKM_SHA3_256_HMAC_GENERAL: CK_MECHANISM_TYPE = 690; +pub const CKM_SHA3_256_KEY_GEN: CK_MECHANISM_TYPE = 691; +pub const CKM_SHA3_224: CK_MECHANISM_TYPE = 693; +pub const CKM_SHA3_224_HMAC: CK_MECHANISM_TYPE = 694; +pub const CKM_SHA3_224_HMAC_GENERAL: CK_MECHANISM_TYPE = 695; +pub const CKM_SHA3_224_KEY_GEN: CK_MECHANISM_TYPE = 696; +pub const CKM_SHA3_384: CK_MECHANISM_TYPE = 704; +pub const CKM_SHA3_384_HMAC: CK_MECHANISM_TYPE = 705; +pub const CKM_SHA3_384_HMAC_GENERAL: CK_MECHANISM_TYPE = 706; +pub const CKM_SHA3_384_KEY_GEN: CK_MECHANISM_TYPE = 707; +pub const CKM_SHA3_512: CK_MECHANISM_TYPE = 720; +pub const CKM_SHA3_512_HMAC: CK_MECHANISM_TYPE = 721; +pub const CKM_SHA3_512_HMAC_GENERAL: CK_MECHANISM_TYPE = 722; +pub const CKM_SHA3_512_KEY_GEN: CK_MECHANISM_TYPE = 723; pub const CKM_CAST_KEY_GEN: CK_MECHANISM_TYPE = 768; pub const CKM_CAST_ECB: CK_MECHANISM_TYPE = 769; pub const CKM_CAST_CBC: CK_MECHANISM_TYPE = 770; @@ -364,6 +458,13 @@ pub const CKM_SHA1_KEY_DERIVATION: CK_MECHANISM_TYPE = 914; pub const CKM_SHA256_KEY_DERIVATION: CK_MECHANISM_TYPE = 915; pub const CKM_SHA384_KEY_DERIVATION: CK_MECHANISM_TYPE = 916; pub const CKM_SHA512_KEY_DERIVATION: CK_MECHANISM_TYPE = 917; +pub const CKM_SHA224_KEY_DERIVATION: CK_MECHANISM_TYPE = 918; +pub const CKM_SHA3_256_KEY_DERIVE: CK_MECHANISM_TYPE = 919; +pub const CKM_SHA3_224_KEY_DERIVE: CK_MECHANISM_TYPE = 920; +pub const CKM_SHA3_384_KEY_DERIVE: CK_MECHANISM_TYPE = 921; +pub const CKM_SHA3_512_KEY_DERIVE: CK_MECHANISM_TYPE = 922; +pub const CKM_SHAKE_128_KEY_DERIVE: CK_MECHANISM_TYPE = 923; +pub const CKM_SHAKE_256_KEY_DERIVE: CK_MECHANISM_TYPE = 924; pub const CKM_PBE_MD2_DES_CBC: CK_MECHANISM_TYPE = 928; pub const CKM_PBE_MD5_DES_CBC: CK_MECHANISM_TYPE = 929; pub const CKM_PBE_MD5_CAST_CBC: CK_MECHANISM_TYPE = 930; @@ -403,6 +504,13 @@ pub const CKM_KIP_DERIVE: CK_MECHANISM_TYPE = 1296; pub const CKM_KIP_WRAP: CK_MECHANISM_TYPE = 1297; pub const CKM_KIP_MAC: CK_MECHANISM_TYPE = 1298; pub const CKM_CAMELLIA_KEY_GEN: CK_MECHANISM_TYPE = 1360; +pub const CKM_CAMELLIA_ECB: CK_MECHANISM_TYPE = 1361; +pub const CKM_CAMELLIA_CBC: CK_MECHANISM_TYPE = 1362; +pub const CKM_CAMELLIA_MAC: CK_MECHANISM_TYPE = 1363; +pub const CKM_CAMELLIA_MAC_GENERAL: CK_MECHANISM_TYPE = 1364; +pub const CKM_CAMELLIA_CBC_PAD: CK_MECHANISM_TYPE = 1365; +pub const CKM_CAMELLIA_ECB_ENCRYPT_DATA: CK_MECHANISM_TYPE = 1366; +pub const CKM_CAMELLIA_CBC_ENCRYPT_DATA: CK_MECHANISM_TYPE = 1367; pub const CKM_CAMELLIA_CTR: CK_MECHANISM_TYPE = 1368; pub const CKM_ARIA_KEY_GEN: CK_MECHANISM_TYPE = 1376; pub const CKM_ARIA_ECB: CK_MECHANISM_TYPE = 1377; @@ -433,6 +541,7 @@ pub const CKM_SKIPJACK_PRIVATE_WRAP: CK_MECHANISM_TYPE = 4105; pub const CKM_SKIPJACK_RELAYX: CK_MECHANISM_TYPE = 4106; pub const CKM_KEA_KEY_PAIR_GEN: CK_MECHANISM_TYPE = 4112; pub const CKM_KEA_KEY_DERIVE: CK_MECHANISM_TYPE = 4113; +pub const CKM_KEA_DERIVE: CK_MECHANISM_TYPE = 4114; pub const CKM_FORTEZZA_TIMESTAMP: CK_MECHANISM_TYPE = 4128; pub const CKM_BATON_KEY_GEN: CK_MECHANISM_TYPE = 4144; pub const CKM_BATON_ECB128: CK_MECHANISM_TYPE = 4145; @@ -461,6 +570,8 @@ pub const CKM_JUNIPER_COUNTER: CK_MECHANISM_TYPE = 4195; pub const CKM_JUNIPER_SHUFFLE: CK_MECHANISM_TYPE = 4196; pub const CKM_JUNIPER_WRAP: CK_MECHANISM_TYPE = 4197; pub const CKM_FASTHASH: CK_MECHANISM_TYPE = 4208; +pub const CKM_AES_XTS: CK_MECHANISM_TYPE = 4209; +pub const CKM_AES_XTS_KEY_GEN: CK_MECHANISM_TYPE = 4210; pub const CKM_AES_KEY_GEN: CK_MECHANISM_TYPE = 4224; pub const CKM_AES_ECB: CK_MECHANISM_TYPE = 4225; pub const CKM_AES_CBC: CK_MECHANISM_TYPE = 4226; @@ -500,6 +611,10 @@ pub const CKM_GOST28147_ECB: CK_MECHANISM_TYPE = 4641; pub const CKM_GOST28147: CK_MECHANISM_TYPE = 4642; pub const CKM_GOST28147_MAC: CK_MECHANISM_TYPE = 4643; pub const CKM_GOST28147_KEY_WRAP: CK_MECHANISM_TYPE = 4644; +pub const CKM_CHACHA20_KEY_GEN: CK_MECHANISM_TYPE = 4645; +pub const CKM_CHACHA20: CK_MECHANISM_TYPE = 4646; +pub const CKM_POLY1305_KEY_GEN: CK_MECHANISM_TYPE = 4647; +pub const CKM_POLY1305: CK_MECHANISM_TYPE = 4648; pub const CKM_DSA_PARAMETER_GEN: CK_MECHANISM_TYPE = 8192; pub const CKM_DH_PKCS_PARAMETER_GEN: CK_MECHANISM_TYPE = 8193; pub const CKM_X9_42_DH_PARAMETER_GEN: CK_MECHANISM_TYPE = 8194; @@ -510,63 +625,71 @@ pub const CKM_AES_CFB64: CK_MECHANISM_TYPE = 8453; pub const CKM_AES_CFB8: CK_MECHANISM_TYPE = 8454; pub const CKM_AES_CFB128: CK_MECHANISM_TYPE = 8455; pub const CKM_AES_CFB1: CK_MECHANISM_TYPE = 8456; -pub const CKM_SHA224: CK_MECHANISM_TYPE = 597; -pub const CKM_SHA224_HMAC: CK_MECHANISM_TYPE = 598; -pub const CKM_SHA224_HMAC_GENERAL: CK_MECHANISM_TYPE = 599; -pub const CKM_SHA224_RSA_PKCS: CK_MECHANISM_TYPE = 70; -pub const CKM_SHA224_RSA_PKCS_PSS: CK_MECHANISM_TYPE = 71; -pub const CKM_SHA224_KEY_DERIVATION: CK_MECHANISM_TYPE = 918; -pub const CKM_CAMELLIA_ECB: CK_MECHANISM_TYPE = 1361; -pub const CKM_CAMELLIA_CBC: CK_MECHANISM_TYPE = 1362; -pub const CKM_CAMELLIA_MAC: CK_MECHANISM_TYPE = 1363; -pub const CKM_CAMELLIA_MAC_GENERAL: CK_MECHANISM_TYPE = 1364; -pub const CKM_CAMELLIA_CBC_PAD: CK_MECHANISM_TYPE = 1365; -pub const CKM_CAMELLIA_ECB_ENCRYPT_DATA: CK_MECHANISM_TYPE = 1366; -pub const CKM_CAMELLIA_CBC_ENCRYPT_DATA: CK_MECHANISM_TYPE = 1367; pub const CKM_AES_KEY_WRAP: CK_MECHANISM_TYPE = 8457; pub const CKM_AES_KEY_WRAP_PAD: CK_MECHANISM_TYPE = 8458; +pub const CKM_AES_KEY_WRAP_KWP: CK_MECHANISM_TYPE = 8459; pub const CKM_RSA_PKCS_TPM_1_1: CK_MECHANISM_TYPE = 16385; pub const CKM_RSA_PKCS_OAEP_TPM_1_1: CK_MECHANISM_TYPE = 16386; +pub const CKM_SHA_1_KEY_GEN: CK_MECHANISM_TYPE = 16387; +pub const CKM_SHA224_KEY_GEN: CK_MECHANISM_TYPE = 16388; +pub const CKM_SHA256_KEY_GEN: CK_MECHANISM_TYPE = 16389; +pub const CKM_SHA384_KEY_GEN: CK_MECHANISM_TYPE = 16390; +pub const CKM_SHA512_KEY_GEN: CK_MECHANISM_TYPE = 16391; +pub const CKM_SHA512_224_KEY_GEN: CK_MECHANISM_TYPE = 16392; +pub const CKM_SHA512_256_KEY_GEN: CK_MECHANISM_TYPE = 16393; +pub const CKM_SHA512_T_KEY_GEN: CK_MECHANISM_TYPE = 16394; +pub const CKM_NULL: CK_MECHANISM_TYPE = 16395; +pub const CKM_BLAKE2B_160: CK_MECHANISM_TYPE = 16396; +pub const CKM_BLAKE2B_160_HMAC: CK_MECHANISM_TYPE = 16397; +pub const CKM_BLAKE2B_160_HMAC_GENERAL: CK_MECHANISM_TYPE = 16398; +pub const CKM_BLAKE2B_160_KEY_DERIVE: CK_MECHANISM_TYPE = 16399; +pub const CKM_BLAKE2B_160_KEY_GEN: CK_MECHANISM_TYPE = 16400; +pub const CKM_BLAKE2B_256: CK_MECHANISM_TYPE = 16401; +pub const CKM_BLAKE2B_256_HMAC: CK_MECHANISM_TYPE = 16402; +pub const CKM_BLAKE2B_256_HMAC_GENERAL: CK_MECHANISM_TYPE = 16403; +pub const CKM_BLAKE2B_256_KEY_DERIVE: CK_MECHANISM_TYPE = 16404; +pub const CKM_BLAKE2B_256_KEY_GEN: CK_MECHANISM_TYPE = 16405; +pub const CKM_BLAKE2B_384: CK_MECHANISM_TYPE = 16406; +pub const CKM_BLAKE2B_384_HMAC: CK_MECHANISM_TYPE = 16407; +pub const CKM_BLAKE2B_384_HMAC_GENERAL: CK_MECHANISM_TYPE = 16408; +pub const CKM_BLAKE2B_384_KEY_DERIVE: CK_MECHANISM_TYPE = 16409; +pub const CKM_BLAKE2B_384_KEY_GEN: CK_MECHANISM_TYPE = 16410; +pub const CKM_BLAKE2B_512: CK_MECHANISM_TYPE = 16411; +pub const CKM_BLAKE2B_512_HMAC: CK_MECHANISM_TYPE = 16412; +pub const CKM_BLAKE2B_512_HMAC_GENERAL: CK_MECHANISM_TYPE = 16413; +pub const CKM_BLAKE2B_512_KEY_DERIVE: CK_MECHANISM_TYPE = 16414; +pub const CKM_BLAKE2B_512_KEY_GEN: CK_MECHANISM_TYPE = 16415; +pub const CKM_SALSA20: CK_MECHANISM_TYPE = 16416; +pub const CKM_CHACHA20_POLY1305: CK_MECHANISM_TYPE = 16417; +pub const CKM_SALSA20_POLY1305: CK_MECHANISM_TYPE = 16418; +pub const CKM_X3DH_INITIALIZE: CK_MECHANISM_TYPE = 16419; +pub const CKM_X3DH_RESPOND: CK_MECHANISM_TYPE = 16420; +pub const CKM_X2RATCHET_INITIALIZE: CK_MECHANISM_TYPE = 16421; +pub const CKM_X2RATCHET_RESPOND: CK_MECHANISM_TYPE = 16422; +pub const CKM_X2RATCHET_ENCRYPT: CK_MECHANISM_TYPE = 16423; +pub const CKM_X2RATCHET_DECRYPT: CK_MECHANISM_TYPE = 16424; +pub const CKM_XEDDSA: CK_MECHANISM_TYPE = 16425; +pub const CKM_HKDF_DERIVE: CK_MECHANISM_TYPE = 16426; +pub const CKM_HKDF_DATA: CK_MECHANISM_TYPE = 16427; +pub const CKM_HKDF_KEY_GEN: CK_MECHANISM_TYPE = 16428; +pub const CKM_ECDSA_SHA3_224: CK_MECHANISM_TYPE = 4167; +pub const CKM_ECDSA_SHA3_256: CK_MECHANISM_TYPE = 4168; +pub const CKM_ECDSA_SHA3_384: CK_MECHANISM_TYPE = 4169; +pub const CKM_ECDSA_SHA3_512: CK_MECHANISM_TYPE = 4170; pub const CKM_EC_EDWARDS_KEY_PAIR_GEN: CK_MECHANISM_TYPE = 4181; pub const CKM_EC_MONTGOMERY_KEY_PAIR_GEN: CK_MECHANISM_TYPE = 4182; pub const CKM_EDDSA: CK_MECHANISM_TYPE = 4183; -pub const CK_OTP_FORMAT_DECIMAL: CK_ULONG = 0; -pub const CK_OTP_FORMAT_HEXADECIMAL: CK_ULONG = 1; -pub const CK_OTP_FORMAT_ALPHANUMERIC: CK_ULONG = 2; -pub const CK_OTP_FORMAT_BINARY: CK_ULONG = 3; -pub const CK_OTP_PARAM_IGNORED: CK_ULONG = 0; -pub const CK_OTP_PARAM_OPTIONAL: CK_ULONG = 1; -pub const CK_OTP_PARAM_MANDATORY: CK_ULONG = 2; -pub const CK_OTP_VALUE: CK_ULONG = 0; -pub const CK_OTP_PIN: CK_ULONG = 1; -pub const CK_OTP_CHALLENGE: CK_ULONG = 2; -pub const CK_OTP_TIME: CK_ULONG = 3; -pub const CK_OTP_COUNTER: CK_ULONG = 4; -pub const CK_OTP_FLAGS: CK_ULONG = 5; -pub const CK_OTP_OUTPUT_LENGTH: CK_ULONG = 6; -pub const CK_OTP_FORMAT: CK_ULONG = 7; -pub const CKF_NEXT_OTP: CK_FLAGS = 1; -pub const CKF_EXCLUDE_TIME: CK_FLAGS = 2; -pub const CKF_EXCLUDE_COUNTER: CK_FLAGS = 4; -pub const CKF_EXCLUDE_CHALLENGE: CK_FLAGS = 8; -pub const CKF_EXCLUDE_PIN: CK_FLAGS = 16; -pub const CKF_USER_FRIENDLY_OTP: CK_FLAGS = 32; -pub const CKN_OTP_CHANGED: CK_NOTIFICATION = 1; -pub const CKG_MGF1_SHA1: CK_RSA_PKCS_MGF_TYPE = 1; -pub const CKG_MGF1_SHA224: CK_RSA_PKCS_MGF_TYPE = 5; -pub const CKG_MGF1_SHA256: CK_RSA_PKCS_MGF_TYPE = 2; -pub const CKG_MGF1_SHA384: CK_RSA_PKCS_MGF_TYPE = 3; -pub const CKG_MGF1_SHA512: CK_RSA_PKCS_MGF_TYPE = 4; -pub const CKD_NULL: CK_EC_KDF_TYPE = 1; -pub const CKD_SHA1_KDF: CK_EC_KDF_TYPE = 2; -pub const CKD_SHA1_KDF_ASN1: CK_EC_KDF_TYPE = 3; -pub const CKD_SHA1_KDF_CONCATENATE: CK_EC_KDF_TYPE = 4; -pub const CKD_SHA224_KDF: CK_EC_KDF_TYPE = 5; -pub const CKD_SHA256_KDF: CK_EC_KDF_TYPE = 6; -pub const CKD_SHA384_KDF: CK_EC_KDF_TYPE = 7; -pub const CKD_SHA512_KDF: CK_EC_KDF_TYPE = 8; -pub const CKD_CPDIVERSIFY_KDF: CK_EC_KDF_TYPE = 9; +pub const CKM_SP800_108_COUNTER_KDF: CK_MECHANISM_TYPE = 940; +pub const CKM_SP800_108_FEEDBACK_KDF: CK_MECHANISM_TYPE = 941; +pub const CKM_SP800_108_DOUBLE_PIPELINE_KDF: CK_MECHANISM_TYPE = 942; +pub const CKM_VENDOR_DEFINED: CK_MECHANISM_TYPE = 2147483648; pub const CKF_HW: CK_FLAGS = 1; +pub const CKF_MESSAGE_ENCRYPT: CK_FLAGS = 2; +pub const CKF_MESSAGE_DECRYPT: CK_FLAGS = 4; +pub const CKF_MESSAGE_SIGN: CK_FLAGS = 8; +pub const CKF_MESSAGE_VERIFY: CK_FLAGS = 16; +pub const CKF_MULTI_MESSGE: CK_FLAGS = 32; +pub const CKF_FIND_OBJECTS: CK_FLAGS = 64; pub const CKF_ENCRYPT: CK_FLAGS = 256; pub const CKF_DECRYPT: CK_FLAGS = 512; pub const CKF_DIGEST: CK_FLAGS = 1024; @@ -582,12 +705,12 @@ pub const CKF_DERIVE: CK_FLAGS = 524288; pub const CKF_EC_F_P: CK_FLAGS = 1048576; pub const CKF_EC_F_2M: CK_FLAGS = 2097152; pub const CKF_EC_ECPARAMETERS: CK_FLAGS = 4194304; +pub const CKF_EC_OID: CK_FLAGS = 8388608; pub const CKF_EC_NAMEDCURVE: CK_FLAGS = 8388608; pub const CKF_EC_UNCOMPRESS: CK_FLAGS = 16777216; pub const CKF_EC_COMPRESS: CK_FLAGS = 33554432; -pub const CKF_DONT_BLOCK: CK_FLAGS = 1; -pub const CKF_LIBRARY_CANT_CREATE_OS_THREADS: CK_FLAGS = 1; -pub const CKF_OS_LOCKING_OK: CK_FLAGS = 2; +pub const CKF_EC_CURVENAME: CK_FLAGS = 67108864; +pub const CKF_EXTENSION: CK_FLAGS = 2147483648; pub const CKR_OK: CK_RV = 0; pub const CKR_CANCEL: CK_RV = 1; pub const CKR_HOST_MEMORY: CK_RV = 2; @@ -610,6 +733,7 @@ pub const CKR_DEVICE_MEMORY: CK_RV = 49; pub const CKR_DEVICE_REMOVED: CK_RV = 50; pub const CKR_ENCRYPTED_DATA_INVALID: CK_RV = 64; pub const CKR_ENCRYPTED_DATA_LEN_RANGE: CK_RV = 65; +pub const CKR_AEAD_DECRYPT_FAILED: CK_RV = 66; pub const CKR_FUNCTION_CANCELED: CK_RV = 80; pub const CKR_FUNCTION_NOT_PARALLEL: CK_RV = 81; pub const CKR_FUNCTION_NOT_SUPPORTED: CK_RV = 84; @@ -665,6 +789,7 @@ pub const CKR_WRAPPING_KEY_TYPE_INCONSISTENT: CK_RV = 277; pub const CKR_RANDOM_SEED_NOT_SUPPORTED: CK_RV = 288; pub const CKR_RANDOM_NO_RNG: CK_RV = 289; pub const CKR_DOMAIN_PARAMS_INVALID: CK_RV = 304; +pub const CKR_CURVE_NOT_SUPPORTED: CK_RV = 320; pub const CKR_BUFFER_TOO_SMALL: CK_RV = 336; pub const CKR_SAVED_STATE_INVALID: CK_RV = 352; pub const CKR_INFORMATION_SENSITIVE: CK_RV = 368; @@ -675,44 +800,126 @@ pub const CKR_MUTEX_BAD: CK_RV = 416; pub const CKR_MUTEX_NOT_LOCKED: CK_RV = 417; pub const CKR_NEW_PIN_MODE: CK_RV = 432; pub const CKR_NEXT_OTP: CK_RV = 433; -pub const CKR_EXCEEDED_MAX_ITERATIONS: CK_RV = 448; -pub const CKR_FIPS_SELF_TEST_FAILED: CK_RV = 449; -pub const CKR_LIBRARY_LOAD_FAILED: CK_RV = 450; -pub const CKR_PIN_TOO_WEAK: CK_RV = 451; -pub const CKR_PUBLIC_KEY_INVALID: CK_RV = 452; +pub const CKR_EXCEEDED_MAX_ITERATIONS: CK_RV = 437; +pub const CKR_FIPS_SELF_TEST_FAILED: CK_RV = 438; +pub const CKR_LIBRARY_LOAD_FAILED: CK_RV = 439; +pub const CKR_PIN_TOO_WEAK: CK_RV = 440; +pub const CKR_PUBLIC_KEY_INVALID: CK_RV = 441; pub const CKR_FUNCTION_REJECTED: CK_RV = 512; +pub const CKR_TOKEN_RESOURCE_EXCEEDED: CK_RV = 513; +pub const CKR_VENDOR_DEFINED: CK_RV = 2147483648; +pub const CKF_END_OF_MESSAGE: CK_FLAGS = 1; +pub const CKF_INTERFACE_FORK_SAFE: CK_FLAGS = 1; +pub const CKF_LIBRARY_CANT_CREATE_OS_THREADS: CK_FLAGS = 1; +pub const CKF_OS_LOCKING_OK: CK_FLAGS = 2; +pub const CKF_DONT_BLOCK: CK_FLAGS = 1; +pub const CKG_MGF1_SHA1: CK_RSA_PKCS_MGF_TYPE = 1; +pub const CKG_MGF1_SHA256: CK_RSA_PKCS_MGF_TYPE = 2; +pub const CKG_MGF1_SHA384: CK_RSA_PKCS_MGF_TYPE = 3; +pub const CKG_MGF1_SHA512: CK_RSA_PKCS_MGF_TYPE = 4; +pub const CKG_MGF1_SHA224: CK_RSA_PKCS_MGF_TYPE = 5; pub const CKZ_DATA_SPECIFIED: CK_RSA_PKCS_OAEP_SOURCE_TYPE = 1; -pub const CK_FALSE: CK_BBOOL = 0; -pub const CK_TRUE: CK_BBOOL = 1; -pub const FALSE: u32 = 0; -pub const TRUE: u32 = 1; -pub type CK_FLAGS = ::std::os::raw::c_ulong; +pub const CKD_NULL: CK_EC_KDF_TYPE = 1; +pub const CKD_SHA1_KDF: CK_EC_KDF_TYPE = 2; +pub const CKD_SHA1_KDF_ASN1: CK_EC_KDF_TYPE = 3; +pub const CKD_SHA1_KDF_CONCATENATE: CK_EC_KDF_TYPE = 4; +pub const CKD_SHA224_KDF: CK_EC_KDF_TYPE = 5; +pub const CKD_SHA256_KDF: CK_EC_KDF_TYPE = 6; +pub const CKD_SHA384_KDF: CK_EC_KDF_TYPE = 7; +pub const CKD_SHA512_KDF: CK_EC_KDF_TYPE = 8; +pub const CKD_CPDIVERSIFY_KDF: CK_EC_KDF_TYPE = 9; +pub const CKD_SHA3_224_KDF: CK_EC_KDF_TYPE = 10; +pub const CKD_SHA3_256_KDF: CK_EC_KDF_TYPE = 11; +pub const CKD_SHA3_384_KDF: CK_EC_KDF_TYPE = 12; +pub const CKD_SHA3_512_KDF: CK_EC_KDF_TYPE = 13; +pub const CKD_SHA1_KDF_SP800: CK_EC_KDF_TYPE = 14; +pub const CKD_SHA224_KDF_SP800: CK_EC_KDF_TYPE = 15; +pub const CKD_SHA256_KDF_SP800: CK_EC_KDF_TYPE = 16; +pub const CKD_SHA384_KDF_SP800: CK_EC_KDF_TYPE = 17; +pub const CKD_SHA512_KDF_SP800: CK_EC_KDF_TYPE = 18; +pub const CKD_SHA3_224_KDF_SP800: CK_EC_KDF_TYPE = 19; +pub const CKD_SHA3_256_KDF_SP800: CK_EC_KDF_TYPE = 20; +pub const CKD_SHA3_384_KDF_SP800: CK_EC_KDF_TYPE = 21; +pub const CKD_SHA3_512_KDF_SP800: CK_EC_KDF_TYPE = 22; +pub const CKD_BLAKE2B_160_KDF: CK_EC_KDF_TYPE = 23; +pub const CKD_BLAKE2B_256_KDF: CK_EC_KDF_TYPE = 24; +pub const CKD_BLAKE2B_384_KDF: CK_EC_KDF_TYPE = 25; +pub const CKD_BLAKE2B_512_KDF: CK_EC_KDF_TYPE = 26; +pub const CKP_PKCS5_PBKD2_HMAC_SHA1: CK_PROFILE_ID = 1; +pub const CKP_PKCS5_PBKD2_HMAC_GOSTR3411: CK_PROFILE_ID = 2; +pub const CKP_PKCS5_PBKD2_HMAC_SHA224: CK_PROFILE_ID = 3; +pub const CKP_PKCS5_PBKD2_HMAC_SHA256: CK_PROFILE_ID = 4; +pub const CKP_PKCS5_PBKD2_HMAC_SHA384: CK_PROFILE_ID = 5; +pub const CKP_PKCS5_PBKD2_HMAC_SHA512: CK_PROFILE_ID = 6; +pub const CKP_PKCS5_PBKD2_HMAC_SHA512_224: CK_PROFILE_ID = 7; +pub const CKP_PKCS5_PBKD2_HMAC_SHA512_256: CK_PROFILE_ID = 8; +pub const CKZ_SALT_SPECIFIED: CK_RSA_PKCS_OAEP_SOURCE_TYPE = 1; +pub const CK_OTP_VALUE: CK_ULONG = 0; +pub const CK_OTP_PIN: CK_ULONG = 1; +pub const CK_OTP_CHALLENGE: CK_ULONG = 2; +pub const CK_OTP_TIME: CK_ULONG = 3; +pub const CK_OTP_COUNTER: CK_ULONG = 4; +pub const CK_OTP_FLAGS: CK_ULONG = 5; +pub const CK_OTP_OUTPUT_LENGTH: CK_ULONG = 6; +pub const CK_OTP_OUTPUT_FORMAT: CK_ULONG = 7; +pub const CKF_NEXT_OTP: CK_FLAGS = 1; +pub const CKF_EXCLUDE_TIME: CK_FLAGS = 2; +pub const CKF_EXCLUDE_COUNTER: CK_FLAGS = 4; +pub const CKF_EXCLUDE_CHALLENGE: CK_FLAGS = 8; +pub const CKF_EXCLUDE_PIN: CK_FLAGS = 16; +pub const CKF_USER_FRIENDLY_OTP: CK_FLAGS = 32; +pub const CKG_NO_GENERATE: u32 = 0; +pub const CKG_GENERATE: u32 = 1; +pub const CKG_GENERATE_COUNTER: u32 = 2; +pub const CKG_GENERATE_RANDOM: u32 = 3; +pub const CK_SP800_108_ITERATION_VARIABLE: CK_ULONG = 1; +pub const CK_SP800_108_OPTIONAL_COUNTER: CK_ULONG = 2; +pub const CK_SP800_108_DKM_LENGTH: CK_ULONG = 3; +pub const CK_SP800_108_BYTE_ARRAY: CK_ULONG = 4; +pub const CKF_HKDF_SALT_NULL: CK_FLAGS = 1; +pub const CKF_HKDF_SALT_DATA: CK_FLAGS = 2; +pub const CKF_HKDF_SALT_KEY: CK_FLAGS = 4; +pub const CK_NEED_ARG_LIST: CK_ULONG = 1; +pub const CK_PKCS11_2_0_ONLY: CK_ULONG = 1; +pub type CK_BYTE = ::std::os::raw::c_uchar; +pub type CK_CHAR = CK_BYTE; +pub type CK_UTF8CHAR = CK_BYTE; +pub type CK_BBOOL = CK_BYTE; +pub type CK_ULONG = ::std::os::raw::c_ulong; +pub type CK_LONG = ::std::os::raw::c_long; +pub type CK_FLAGS = CK_ULONG; +pub type CK_BYTE_PTR = *mut CK_BYTE; +pub type CK_CHAR_PTR = *mut CK_CHAR; +pub type CK_UTF8CHAR_PTR = *mut CK_UTF8CHAR; +pub type CK_ULONG_PTR = *mut CK_ULONG; +pub type CK_VOID_PTR = *mut ::std::os::raw::c_void; +pub type CK_VOID_PTR_PTR = *mut CK_VOID_PTR; #[repr(C)] #[derive(Debug, Default, Copy, Clone)] -pub struct _CK_VERSION { - pub major: ::std::os::raw::c_uchar, - pub minor: ::std::os::raw::c_uchar, +pub struct CK_VERSION { + pub major: CK_BYTE, + pub minor: CK_BYTE, } #[test] -fn bindgen_test_layout__CK_VERSION() { - const UNINIT: ::std::mem::MaybeUninit<_CK_VERSION> = ::std::mem::MaybeUninit::uninit(); +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::<_CK_VERSION>(), + ::std::mem::size_of::(), 2usize, - concat!("Size of: ", stringify!(_CK_VERSION)) + concat!("Size of: ", stringify!(CK_VERSION)) ); assert_eq!( - ::std::mem::align_of::<_CK_VERSION>(), + ::std::mem::align_of::(), 1usize, - concat!("Alignment of ", stringify!(_CK_VERSION)) + 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!(CK_VERSION), "::", stringify!(major) ) @@ -722,41 +929,42 @@ fn bindgen_test_layout__CK_VERSION() { 1usize, concat!( "Offset of field: ", - stringify!(_CK_VERSION), + stringify!(CK_VERSION), "::", stringify!(minor) ) ); } +pub type CK_VERSION_PTR = *mut CK_VERSION; #[repr(C)] #[derive(Debug, Default, Copy, Clone)] -pub struct _CK_INFO { - pub cryptokiVersion: _CK_VERSION, - pub manufacturerID: [::std::os::raw::c_uchar; 32usize], +pub struct CK_INFO { + pub cryptokiVersion: CK_VERSION, + pub manufacturerID: [CK_UTF8CHAR; 32usize], pub flags: CK_FLAGS, - pub libraryDescription: [::std::os::raw::c_uchar; 32usize], - pub libraryVersion: _CK_VERSION, + pub libraryDescription: [CK_UTF8CHAR; 32usize], + pub libraryVersion: CK_VERSION, } #[test] -fn bindgen_test_layout__CK_INFO() { - const UNINIT: ::std::mem::MaybeUninit<_CK_INFO> = ::std::mem::MaybeUninit::uninit(); +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::<_CK_INFO>(), + ::std::mem::size_of::(), 88usize, - concat!("Size of: ", stringify!(_CK_INFO)) + concat!("Size of: ", stringify!(CK_INFO)) ); assert_eq!( - ::std::mem::align_of::<_CK_INFO>(), + ::std::mem::align_of::(), 8usize, - concat!("Alignment of ", stringify!(_CK_INFO)) + 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!(CK_INFO), "::", stringify!(cryptokiVersion) ) @@ -766,7 +974,7 @@ fn bindgen_test_layout__CK_INFO() { 2usize, concat!( "Offset of field: ", - stringify!(_CK_INFO), + stringify!(CK_INFO), "::", stringify!(manufacturerID) ) @@ -776,7 +984,7 @@ fn bindgen_test_layout__CK_INFO() { 40usize, concat!( "Offset of field: ", - stringify!(_CK_INFO), + stringify!(CK_INFO), "::", stringify!(flags) ) @@ -786,7 +994,7 @@ fn bindgen_test_layout__CK_INFO() { 48usize, concat!( "Offset of field: ", - stringify!(_CK_INFO), + stringify!(CK_INFO), "::", stringify!(libraryDescription) ) @@ -796,44 +1004,45 @@ fn bindgen_test_layout__CK_INFO() { 80usize, concat!( "Offset of field: ", - stringify!(_CK_INFO), + stringify!(CK_INFO), "::", stringify!(libraryVersion) ) ); } -pub type CK_NOTIFICATION = ::std::os::raw::c_ulong; -pub const CKN_SURRENDER: ::std::os::raw::c_ulong = 0; -pub type CK_SLOT_ID = ::std::os::raw::c_ulong; +pub type CK_INFO_PTR = *mut CK_INFO; +pub type CK_NOTIFICATION = CK_ULONG; +pub type CK_SLOT_ID = CK_ULONG; +pub type CK_SLOT_ID_PTR = *mut CK_SLOT_ID; #[repr(C)] #[derive(Debug, Copy, Clone)] -pub struct _CK_SLOT_INFO { - pub slotDescription: [::std::os::raw::c_uchar; 64usize], - pub manufacturerID: [::std::os::raw::c_uchar; 32usize], +pub struct CK_SLOT_INFO { + pub slotDescription: [CK_UTF8CHAR; 64usize], + pub manufacturerID: [CK_UTF8CHAR; 32usize], pub flags: CK_FLAGS, - pub hardwareVersion: _CK_VERSION, - pub firmwareVersion: _CK_VERSION, + pub hardwareVersion: CK_VERSION, + pub firmwareVersion: CK_VERSION, } #[test] -fn bindgen_test_layout__CK_SLOT_INFO() { - const UNINIT: ::std::mem::MaybeUninit<_CK_SLOT_INFO> = ::std::mem::MaybeUninit::uninit(); +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::<_CK_SLOT_INFO>(), + ::std::mem::size_of::(), 112usize, - concat!("Size of: ", stringify!(_CK_SLOT_INFO)) + concat!("Size of: ", stringify!(CK_SLOT_INFO)) ); assert_eq!( - ::std::mem::align_of::<_CK_SLOT_INFO>(), + ::std::mem::align_of::(), 8usize, - concat!("Alignment of ", stringify!(_CK_SLOT_INFO)) + 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!(CK_SLOT_INFO), "::", stringify!(slotDescription) ) @@ -843,7 +1052,7 @@ fn bindgen_test_layout__CK_SLOT_INFO() { 64usize, concat!( "Offset of field: ", - stringify!(_CK_SLOT_INFO), + stringify!(CK_SLOT_INFO), "::", stringify!(manufacturerID) ) @@ -853,7 +1062,7 @@ fn bindgen_test_layout__CK_SLOT_INFO() { 96usize, concat!( "Offset of field: ", - stringify!(_CK_SLOT_INFO), + stringify!(CK_SLOT_INFO), "::", stringify!(flags) ) @@ -863,7 +1072,7 @@ fn bindgen_test_layout__CK_SLOT_INFO() { 104usize, concat!( "Offset of field: ", - stringify!(_CK_SLOT_INFO), + stringify!(CK_SLOT_INFO), "::", stringify!(hardwareVersion) ) @@ -873,13 +1082,13 @@ fn bindgen_test_layout__CK_SLOT_INFO() { 106usize, concat!( "Offset of field: ", - stringify!(_CK_SLOT_INFO), + stringify!(CK_SLOT_INFO), "::", stringify!(firmwareVersion) ) ); } -impl Default for _CK_SLOT_INFO { +impl Default for CK_SLOT_INFO { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { @@ -888,52 +1097,49 @@ impl Default for _CK_SLOT_INFO { } } } -pub const CKF_TOKEN_PRESENT: ::std::os::raw::c_ulong = 1; -pub const CKF_REMOVABLE_DEVICE: ::std::os::raw::c_ulong = 2; -pub const CKF_HW_SLOT: ::std::os::raw::c_ulong = 4; -pub const CKF_ARRAY_ATTRIBUTE: ::std::os::raw::c_ulong = 1073741824; +pub type CK_SLOT_INFO_PTR = *mut CK_SLOT_INFO; #[repr(C)] #[derive(Debug, Default, Copy, Clone)] -pub struct _CK_TOKEN_INFO { - pub label: [::std::os::raw::c_uchar; 32usize], - pub manufacturerID: [::std::os::raw::c_uchar; 32usize], - pub model: [::std::os::raw::c_uchar; 16usize], - pub serialNumber: [::std::os::raw::c_uchar; 16usize], +pub struct CK_TOKEN_INFO { + pub label: [CK_UTF8CHAR; 32usize], + pub manufacturerID: [CK_UTF8CHAR; 32usize], + pub model: [CK_UTF8CHAR; 16usize], + pub serialNumber: [CK_CHAR; 16usize], pub flags: CK_FLAGS, - pub ulMaxSessionCount: ::std::os::raw::c_ulong, - pub ulSessionCount: ::std::os::raw::c_ulong, - pub ulMaxRwSessionCount: ::std::os::raw::c_ulong, - pub ulRwSessionCount: ::std::os::raw::c_ulong, - pub ulMaxPinLen: ::std::os::raw::c_ulong, - pub ulMinPinLen: ::std::os::raw::c_ulong, - pub ulTotalPublicMemory: ::std::os::raw::c_ulong, - pub ulFreePublicMemory: ::std::os::raw::c_ulong, - pub ulTotalPrivateMemory: ::std::os::raw::c_ulong, - pub ulFreePrivateMemory: ::std::os::raw::c_ulong, - pub hardwareVersion: _CK_VERSION, - pub firmwareVersion: _CK_VERSION, - pub utcTime: [::std::os::raw::c_uchar; 16usize], + pub ulMaxSessionCount: CK_ULONG, + pub ulSessionCount: CK_ULONG, + pub ulMaxRwSessionCount: CK_ULONG, + pub ulRwSessionCount: CK_ULONG, + pub ulMaxPinLen: CK_ULONG, + pub ulMinPinLen: CK_ULONG, + pub ulTotalPublicMemory: CK_ULONG, + pub ulFreePublicMemory: CK_ULONG, + pub ulTotalPrivateMemory: CK_ULONG, + pub ulFreePrivateMemory: CK_ULONG, + pub hardwareVersion: CK_VERSION, + pub firmwareVersion: CK_VERSION, + pub utcTime: [CK_CHAR; 16usize], } #[test] -fn bindgen_test_layout__CK_TOKEN_INFO() { - const UNINIT: ::std::mem::MaybeUninit<_CK_TOKEN_INFO> = ::std::mem::MaybeUninit::uninit(); +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::<_CK_TOKEN_INFO>(), + ::std::mem::size_of::(), 208usize, - concat!("Size of: ", stringify!(_CK_TOKEN_INFO)) + concat!("Size of: ", stringify!(CK_TOKEN_INFO)) ); assert_eq!( - ::std::mem::align_of::<_CK_TOKEN_INFO>(), + ::std::mem::align_of::(), 8usize, - concat!("Alignment of ", stringify!(_CK_TOKEN_INFO)) + 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!(CK_TOKEN_INFO), "::", stringify!(label) ) @@ -943,7 +1149,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { 32usize, concat!( "Offset of field: ", - stringify!(_CK_TOKEN_INFO), + stringify!(CK_TOKEN_INFO), "::", stringify!(manufacturerID) ) @@ -953,7 +1159,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { 64usize, concat!( "Offset of field: ", - stringify!(_CK_TOKEN_INFO), + stringify!(CK_TOKEN_INFO), "::", stringify!(model) ) @@ -963,7 +1169,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { 80usize, concat!( "Offset of field: ", - stringify!(_CK_TOKEN_INFO), + stringify!(CK_TOKEN_INFO), "::", stringify!(serialNumber) ) @@ -973,7 +1179,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { 96usize, concat!( "Offset of field: ", - stringify!(_CK_TOKEN_INFO), + stringify!(CK_TOKEN_INFO), "::", stringify!(flags) ) @@ -983,7 +1189,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { 104usize, concat!( "Offset of field: ", - stringify!(_CK_TOKEN_INFO), + stringify!(CK_TOKEN_INFO), "::", stringify!(ulMaxSessionCount) ) @@ -993,7 +1199,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { 112usize, concat!( "Offset of field: ", - stringify!(_CK_TOKEN_INFO), + stringify!(CK_TOKEN_INFO), "::", stringify!(ulSessionCount) ) @@ -1003,7 +1209,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { 120usize, concat!( "Offset of field: ", - stringify!(_CK_TOKEN_INFO), + stringify!(CK_TOKEN_INFO), "::", stringify!(ulMaxRwSessionCount) ) @@ -1013,7 +1219,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { 128usize, concat!( "Offset of field: ", - stringify!(_CK_TOKEN_INFO), + stringify!(CK_TOKEN_INFO), "::", stringify!(ulRwSessionCount) ) @@ -1023,7 +1229,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { 136usize, concat!( "Offset of field: ", - stringify!(_CK_TOKEN_INFO), + stringify!(CK_TOKEN_INFO), "::", stringify!(ulMaxPinLen) ) @@ -1033,7 +1239,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { 144usize, concat!( "Offset of field: ", - stringify!(_CK_TOKEN_INFO), + stringify!(CK_TOKEN_INFO), "::", stringify!(ulMinPinLen) ) @@ -1043,7 +1249,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { 152usize, concat!( "Offset of field: ", - stringify!(_CK_TOKEN_INFO), + stringify!(CK_TOKEN_INFO), "::", stringify!(ulTotalPublicMemory) ) @@ -1053,7 +1259,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { 160usize, concat!( "Offset of field: ", - stringify!(_CK_TOKEN_INFO), + stringify!(CK_TOKEN_INFO), "::", stringify!(ulFreePublicMemory) ) @@ -1063,7 +1269,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { 168usize, concat!( "Offset of field: ", - stringify!(_CK_TOKEN_INFO), + stringify!(CK_TOKEN_INFO), "::", stringify!(ulTotalPrivateMemory) ) @@ -1073,7 +1279,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { 176usize, concat!( "Offset of field: ", - stringify!(_CK_TOKEN_INFO), + stringify!(CK_TOKEN_INFO), "::", stringify!(ulFreePrivateMemory) ) @@ -1083,7 +1289,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { 184usize, concat!( "Offset of field: ", - stringify!(_CK_TOKEN_INFO), + stringify!(CK_TOKEN_INFO), "::", stringify!(hardwareVersion) ) @@ -1093,7 +1299,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { 186usize, concat!( "Offset of field: ", - stringify!(_CK_TOKEN_INFO), + stringify!(CK_TOKEN_INFO), "::", stringify!(firmwareVersion) ) @@ -1103,43 +1309,45 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { 188usize, concat!( "Offset of field: ", - stringify!(_CK_TOKEN_INFO), + stringify!(CK_TOKEN_INFO), "::", stringify!(utcTime) ) ); } -pub type CK_SESSION_HANDLE = ::std::os::raw::c_ulong; -pub type CK_USER_TYPE = ::std::os::raw::c_ulong; -pub type CK_STATE = ::std::os::raw::c_ulong; +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; +pub type CK_USER_TYPE = CK_ULONG; +pub type CK_STATE = CK_ULONG; #[repr(C)] #[derive(Debug, Default, Copy, Clone)] -pub struct _CK_SESSION_INFO { +pub struct CK_SESSION_INFO { pub slotID: CK_SLOT_ID, pub state: CK_STATE, pub flags: CK_FLAGS, - pub ulDeviceError: ::std::os::raw::c_ulong, + pub ulDeviceError: CK_ULONG, } #[test] -fn bindgen_test_layout__CK_SESSION_INFO() { - const UNINIT: ::std::mem::MaybeUninit<_CK_SESSION_INFO> = ::std::mem::MaybeUninit::uninit(); +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::<_CK_SESSION_INFO>(), + ::std::mem::size_of::(), 32usize, - concat!("Size of: ", stringify!(_CK_SESSION_INFO)) + concat!("Size of: ", stringify!(CK_SESSION_INFO)) ); assert_eq!( - ::std::mem::align_of::<_CK_SESSION_INFO>(), + ::std::mem::align_of::(), 8usize, - concat!("Alignment of ", stringify!(_CK_SESSION_INFO)) + 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!(CK_SESSION_INFO), "::", stringify!(slotID) ) @@ -1149,7 +1357,7 @@ fn bindgen_test_layout__CK_SESSION_INFO() { 8usize, concat!( "Offset of field: ", - stringify!(_CK_SESSION_INFO), + stringify!(CK_SESSION_INFO), "::", stringify!(state) ) @@ -1159,7 +1367,7 @@ fn bindgen_test_layout__CK_SESSION_INFO() { 16usize, concat!( "Offset of field: ", - stringify!(_CK_SESSION_INFO), + stringify!(CK_SESSION_INFO), "::", stringify!(flags) ) @@ -1169,45 +1377,48 @@ fn bindgen_test_layout__CK_SESSION_INFO() { 24usize, concat!( "Offset of field: ", - stringify!(_CK_SESSION_INFO), + stringify!(CK_SESSION_INFO), "::", stringify!(ulDeviceError) ) ); } -pub type CK_OBJECT_HANDLE = ::std::os::raw::c_ulong; -pub type CK_OBJECT_CLASS = ::std::os::raw::c_ulong; -pub type CK_HW_FEATURE_TYPE = ::std::os::raw::c_ulong; -pub type CK_KEY_TYPE = ::std::os::raw::c_ulong; -pub type CK_CERTIFICATE_TYPE = ::std::os::raw::c_ulong; -pub type CK_ATTRIBUTE_TYPE = ::std::os::raw::c_ulong; +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; +pub type CK_OBJECT_CLASS = CK_ULONG; +pub type CK_OBJECT_CLASS_PTR = *mut CK_OBJECT_CLASS; +pub type CK_HW_FEATURE_TYPE = CK_ULONG; +pub type CK_KEY_TYPE = CK_ULONG; +pub type CK_CERTIFICATE_TYPE = CK_ULONG; +pub type CK_ATTRIBUTE_TYPE = CK_ULONG; #[repr(C)] #[derive(Debug, Copy, Clone)] -pub struct _CK_ATTRIBUTE { +pub struct CK_ATTRIBUTE { pub type_: CK_ATTRIBUTE_TYPE, - pub pValue: *mut ::std::os::raw::c_void, - pub ulValueLen: ::std::os::raw::c_ulong, + pub pValue: CK_VOID_PTR, + pub ulValueLen: CK_ULONG, } #[test] -fn bindgen_test_layout__CK_ATTRIBUTE() { - const UNINIT: ::std::mem::MaybeUninit<_CK_ATTRIBUTE> = ::std::mem::MaybeUninit::uninit(); +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::<_CK_ATTRIBUTE>(), + ::std::mem::size_of::(), 24usize, - concat!("Size of: ", stringify!(_CK_ATTRIBUTE)) + concat!("Size of: ", stringify!(CK_ATTRIBUTE)) ); assert_eq!( - ::std::mem::align_of::<_CK_ATTRIBUTE>(), + ::std::mem::align_of::(), 8usize, - concat!("Alignment of ", stringify!(_CK_ATTRIBUTE)) + 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!(CK_ATTRIBUTE), "::", stringify!(type_) ) @@ -1217,7 +1428,7 @@ fn bindgen_test_layout__CK_ATTRIBUTE() { 8usize, concat!( "Offset of field: ", - stringify!(_CK_ATTRIBUTE), + stringify!(CK_ATTRIBUTE), "::", stringify!(pValue) ) @@ -1227,13 +1438,13 @@ fn bindgen_test_layout__CK_ATTRIBUTE() { 16usize, concat!( "Offset of field: ", - stringify!(_CK_ATTRIBUTE), + stringify!(CK_ATTRIBUTE), "::", stringify!(ulValueLen) ) ); } -impl Default for _CK_ATTRIBUTE { +impl Default for CK_ATTRIBUTE { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { @@ -1242,33 +1453,34 @@ impl Default for _CK_ATTRIBUTE { } } } +pub type CK_ATTRIBUTE_PTR = *mut CK_ATTRIBUTE; #[repr(C)] #[derive(Debug, Default, Copy, Clone)] -pub struct _CK_DATE { - pub year: [::std::os::raw::c_uchar; 4usize], - pub month: [::std::os::raw::c_uchar; 2usize], - pub day: [::std::os::raw::c_uchar; 2usize], +pub struct CK_DATE { + pub year: [CK_CHAR; 4usize], + pub month: [CK_CHAR; 2usize], + pub day: [CK_CHAR; 2usize], } #[test] -fn bindgen_test_layout__CK_DATE() { - const UNINIT: ::std::mem::MaybeUninit<_CK_DATE> = ::std::mem::MaybeUninit::uninit(); +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::<_CK_DATE>(), + ::std::mem::size_of::(), 8usize, - concat!("Size of: ", stringify!(_CK_DATE)) + concat!("Size of: ", stringify!(CK_DATE)) ); assert_eq!( - ::std::mem::align_of::<_CK_DATE>(), + ::std::mem::align_of::(), 1usize, - concat!("Alignment of ", stringify!(_CK_DATE)) + 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!(CK_DATE), "::", stringify!(year) ) @@ -1278,7 +1490,7 @@ fn bindgen_test_layout__CK_DATE() { 4usize, concat!( "Offset of field: ", - stringify!(_CK_DATE), + stringify!(CK_DATE), "::", stringify!(month) ) @@ -1288,40 +1500,41 @@ fn bindgen_test_layout__CK_DATE() { 6usize, concat!( "Offset of field: ", - stringify!(_CK_DATE), + stringify!(CK_DATE), "::", stringify!(day) ) ); } -pub type CK_MECHANISM_TYPE = ::std::os::raw::c_ulong; +pub type CK_MECHANISM_TYPE = CK_ULONG; +pub type CK_MECHANISM_TYPE_PTR = *mut CK_MECHANISM_TYPE; #[repr(C)] #[derive(Debug, Copy, Clone)] -pub struct _CK_MECHANISM { +pub struct CK_MECHANISM { pub mechanism: CK_MECHANISM_TYPE, - pub pParameter: *mut ::std::os::raw::c_void, - pub ulParameterLen: ::std::os::raw::c_ulong, + pub pParameter: CK_VOID_PTR, + pub ulParameterLen: CK_ULONG, } #[test] -fn bindgen_test_layout__CK_MECHANISM() { - const UNINIT: ::std::mem::MaybeUninit<_CK_MECHANISM> = ::std::mem::MaybeUninit::uninit(); +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::<_CK_MECHANISM>(), + ::std::mem::size_of::(), 24usize, - concat!("Size of: ", stringify!(_CK_MECHANISM)) + concat!("Size of: ", stringify!(CK_MECHANISM)) ); assert_eq!( - ::std::mem::align_of::<_CK_MECHANISM>(), + ::std::mem::align_of::(), 8usize, - concat!("Alignment of ", stringify!(_CK_MECHANISM)) + 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!(CK_MECHANISM), "::", stringify!(mechanism) ) @@ -1331,7 +1544,7 @@ fn bindgen_test_layout__CK_MECHANISM() { 8usize, concat!( "Offset of field: ", - stringify!(_CK_MECHANISM), + stringify!(CK_MECHANISM), "::", stringify!(pParameter) ) @@ -1341,13 +1554,13 @@ fn bindgen_test_layout__CK_MECHANISM() { 16usize, concat!( "Offset of field: ", - stringify!(_CK_MECHANISM), + stringify!(CK_MECHANISM), "::", stringify!(ulParameterLen) ) ); } -impl Default for _CK_MECHANISM { +impl Default for CK_MECHANISM { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { @@ -1356,33 +1569,34 @@ impl Default for _CK_MECHANISM { } } } +pub type CK_MECHANISM_PTR = *mut CK_MECHANISM; #[repr(C)] #[derive(Debug, Default, Copy, Clone)] -pub struct _CK_MECHANISM_INFO { - pub ulMinKeySize: ::std::os::raw::c_ulong, - pub ulMaxKeySize: ::std::os::raw::c_ulong, +pub struct CK_MECHANISM_INFO { + pub ulMinKeySize: CK_ULONG, + pub ulMaxKeySize: CK_ULONG, pub flags: CK_FLAGS, } #[test] -fn bindgen_test_layout__CK_MECHANISM_INFO() { - const UNINIT: ::std::mem::MaybeUninit<_CK_MECHANISM_INFO> = ::std::mem::MaybeUninit::uninit(); +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::<_CK_MECHANISM_INFO>(), + ::std::mem::size_of::(), 24usize, - concat!("Size of: ", stringify!(_CK_MECHANISM_INFO)) + concat!("Size of: ", stringify!(CK_MECHANISM_INFO)) ); assert_eq!( - ::std::mem::align_of::<_CK_MECHANISM_INFO>(), + ::std::mem::align_of::(), 8usize, - concat!("Alignment of ", stringify!(_CK_MECHANISM_INFO)) + 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!(CK_MECHANISM_INFO), "::", stringify!(ulMinKeySize) ) @@ -1392,7 +1606,7 @@ fn bindgen_test_layout__CK_MECHANISM_INFO() { 8usize, concat!( "Offset of field: ", - stringify!(_CK_MECHANISM_INFO), + stringify!(CK_MECHANISM_INFO), "::", stringify!(ulMaxKeySize) ) @@ -1402,66 +1616,78 @@ fn bindgen_test_layout__CK_MECHANISM_INFO() { 16usize, concat!( "Offset of field: ", - stringify!(_CK_MECHANISM_INFO), + stringify!(CK_MECHANISM_INFO), "::", stringify!(flags) ) ); } -pub type CK_PARAM_TYPE = ::std::os::raw::c_ulong; +pub type CK_MECHANISM_INFO_PTR = *mut CK_MECHANISM_INFO; +pub type CK_RV = CK_ULONG; +pub type CK_NOTIFY = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + event: CK_NOTIFICATION, + pApplication: CK_VOID_PTR, + ) -> CK_RV, +>; +pub type CK_FUNCTION_LIST_PTR = *mut CK_FUNCTION_LIST; +pub type CK_FUNCTION_LIST_3_0_PTR = *mut CK_FUNCTION_LIST_3_0; +pub type CK_FUNCTION_LIST_PTR_PTR = *mut CK_FUNCTION_LIST_PTR; +pub type CK_FUNCTION_LIST_3_0_PTR_PTR = *mut CK_FUNCTION_LIST_3_0_PTR; #[repr(C)] #[derive(Debug, Copy, Clone)] -pub struct CK_OTP_PARAM { - pub type_: CK_PARAM_TYPE, - pub pValue: *mut ::std::os::raw::c_void, - pub ulValueLen: ::std::os::raw::c_ulong, +pub struct CK_INTERFACE { + pub pInterfaceName: *mut CK_CHAR, + pub pFunctionList: CK_VOID_PTR, + pub flags: CK_FLAGS, } #[test] -fn bindgen_test_layout_CK_OTP_PARAM() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); +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::(), + ::std::mem::size_of::(), 24usize, - concat!("Size of: ", stringify!(CK_OTP_PARAM)) + concat!("Size of: ", stringify!(CK_INTERFACE)) ); assert_eq!( - ::std::mem::align_of::(), + ::std::mem::align_of::(), 8usize, - concat!("Alignment of ", stringify!(CK_OTP_PARAM)) + concat!("Alignment of ", stringify!(CK_INTERFACE)) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).type_) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).pInterfaceName) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", - stringify!(CK_OTP_PARAM), + stringify!(CK_INTERFACE), "::", - stringify!(type_) + stringify!(pInterfaceName) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pValue) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).pFunctionList) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", - stringify!(CK_OTP_PARAM), + stringify!(CK_INTERFACE), "::", - stringify!(pValue) + stringify!(pFunctionList) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulValueLen) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).flags) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", - stringify!(CK_OTP_PARAM), + stringify!(CK_INTERFACE), "::", - stringify!(ulValueLen) + stringify!(flags) ) ); } -impl Default for CK_OTP_PARAM { +impl Default for CK_INTERFACE { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { @@ -1470,99 +1696,100 @@ impl Default for CK_OTP_PARAM { } } } +pub type CK_INTERFACE_PTR = *mut CK_INTERFACE; +pub type CK_INTERFACE_PTR_PTR = *mut CK_INTERFACE_PTR; +pub type CK_CREATEMUTEX = + ::std::option::Option CK_RV>; +pub type CK_DESTROYMUTEX = + ::std::option::Option CK_RV>; +pub type CK_LOCKMUTEX = ::std::option::Option CK_RV>; +pub type CK_UNLOCKMUTEX = ::std::option::Option CK_RV>; #[repr(C)] #[derive(Debug, Copy, Clone)] -pub struct CK_OTP_PARAMS { - pub pParams: *mut CK_OTP_PARAM, - pub ulCount: ::std::os::raw::c_ulong, +pub struct CK_C_INITIALIZE_ARGS { + pub CreateMutex: CK_CREATEMUTEX, + pub DestroyMutex: CK_DESTROYMUTEX, + pub LockMutex: CK_LOCKMUTEX, + pub UnlockMutex: CK_UNLOCKMUTEX, + pub flags: CK_FLAGS, + pub pReserved: CK_VOID_PTR, } #[test] -fn bindgen_test_layout_CK_OTP_PARAMS() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); +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::(), - 16usize, - concat!("Size of: ", stringify!(CK_OTP_PARAMS)) + ::std::mem::size_of::(), + 48usize, + concat!("Size of: ", stringify!(CK_C_INITIALIZE_ARGS)) ); assert_eq!( - ::std::mem::align_of::(), + ::std::mem::align_of::(), 8usize, - concat!("Alignment of ", stringify!(CK_OTP_PARAMS)) + concat!("Alignment of ", stringify!(CK_C_INITIALIZE_ARGS)) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pParams) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).CreateMutex) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", - stringify!(CK_OTP_PARAMS), + stringify!(CK_C_INITIALIZE_ARGS), "::", - stringify!(pParams) + stringify!(CreateMutex) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulCount) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).DestroyMutex) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", - stringify!(CK_OTP_PARAMS), + stringify!(CK_C_INITIALIZE_ARGS), "::", - stringify!(ulCount) + stringify!(DestroyMutex) ) ); -} -impl Default for CK_OTP_PARAMS { - fn default() -> Self { - let mut s = ::std::mem::MaybeUninit::::uninit(); - unsafe { - ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct CK_OTP_SIGNATURE_INFO { - pub pParams: *mut CK_OTP_PARAM, - pub ulCount: ::std::os::raw::c_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::(), + unsafe { ::std::ptr::addr_of!((*ptr).LockMutex) as usize - ptr as usize }, 16usize, - concat!("Size of: ", stringify!(CK_OTP_SIGNATURE_INFO)) + concat!( + "Offset of field: ", + stringify!(CK_C_INITIALIZE_ARGS), + "::", + stringify!(LockMutex) + ) ); assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(CK_OTP_SIGNATURE_INFO)) + 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).pParams) as usize - ptr as usize }, - 0usize, + unsafe { ::std::ptr::addr_of!((*ptr).flags) as usize - ptr as usize }, + 32usize, concat!( "Offset of field: ", - stringify!(CK_OTP_SIGNATURE_INFO), + stringify!(CK_C_INITIALIZE_ARGS), "::", - stringify!(pParams) + stringify!(flags) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulCount) as usize - ptr as usize }, - 8usize, + unsafe { ::std::ptr::addr_of!((*ptr).pReserved) as usize - ptr as usize }, + 40usize, concat!( "Offset of field: ", - stringify!(CK_OTP_SIGNATURE_INFO), + stringify!(CK_C_INITIALIZE_ARGS), "::", - stringify!(ulCount) + stringify!(pReserved) ) ); } -impl Default for CK_OTP_SIGNATURE_INFO { +impl Default for CK_C_INITIALIZE_ARGS { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { @@ -1571,35 +1798,41 @@ impl Default for CK_OTP_SIGNATURE_INFO { } } } -pub type CK_RSA_PKCS_MGF_TYPE = ::std::os::raw::c_ulong; +pub type CK_C_INITIALIZE_ARGS_PTR = *mut CK_C_INITIALIZE_ARGS; +pub type CK_RSA_PKCS_MGF_TYPE = CK_ULONG; +pub type CK_RSA_PKCS_MGF_TYPE_PTR = *mut CK_RSA_PKCS_MGF_TYPE; +pub type CK_RSA_PKCS_OAEP_SOURCE_TYPE = CK_ULONG; +pub type CK_RSA_PKCS_OAEP_SOURCE_TYPE_PTR = *mut CK_RSA_PKCS_OAEP_SOURCE_TYPE; #[repr(C)] -#[derive(Debug, Default, Copy, Clone)] -pub struct ck_rsa_pkcs_pss_params { +#[derive(Debug, Copy, Clone)] +pub struct CK_RSA_PKCS_OAEP_PARAMS { pub hashAlg: CK_MECHANISM_TYPE, pub mgf: CK_RSA_PKCS_MGF_TYPE, - pub sLen: ::std::os::raw::c_ulong, + pub source: CK_RSA_PKCS_OAEP_SOURCE_TYPE, + pub pSourceData: CK_VOID_PTR, + pub ulSourceDataLen: CK_ULONG, } #[test] -fn bindgen_test_layout_ck_rsa_pkcs_pss_params() { - const UNINIT: ::std::mem::MaybeUninit = +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_pss_params)) + ::std::mem::size_of::(), + 40usize, + concat!("Size of: ", stringify!(CK_RSA_PKCS_OAEP_PARAMS)) ); assert_eq!( - ::std::mem::align_of::(), + ::std::mem::align_of::(), 8usize, - concat!("Alignment of ", stringify!(ck_rsa_pkcs_pss_params)) + 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_pss_params), + stringify!(CK_RSA_PKCS_OAEP_PARAMS), "::", stringify!(hashAlg) ) @@ -1609,75 +1842,19 @@ fn bindgen_test_layout_ck_rsa_pkcs_pss_params() { 8usize, concat!( "Offset of field: ", - stringify!(ck_rsa_pkcs_pss_params), + stringify!(CK_RSA_PKCS_OAEP_PARAMS), "::", stringify!(mgf) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).sLen) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).source) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", - stringify!(ck_rsa_pkcs_pss_params), + stringify!(CK_RSA_PKCS_OAEP_PARAMS), "::", - stringify!(sLen) - ) - ); -} -pub type CK_RSA_PKCS_OAEP_SOURCE_TYPE = ::std::os::raw::c_ulong; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct ck_rsa_pkcs_oaep_params { - pub hashAlg: CK_MECHANISM_TYPE, - pub mgf: CK_RSA_PKCS_MGF_TYPE, - pub source: CK_RSA_PKCS_OAEP_SOURCE_TYPE, - pub pSourceData: *mut ::std::os::raw::c_void, - pub ulSourceDataLen: ::std::os::raw::c_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::(), - 40usize, - concat!("Size of: ", stringify!(ck_rsa_pkcs_oaep_params)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - 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 }, - 8usize, - 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 }, - 16usize, - concat!( - "Offset of field: ", - stringify!(ck_rsa_pkcs_oaep_params), - "::", - stringify!(source) + stringify!(source) ) ); assert_eq!( @@ -1685,7 +1862,7 @@ fn bindgen_test_layout_ck_rsa_pkcs_oaep_params() { 24usize, concat!( "Offset of field: ", - stringify!(ck_rsa_pkcs_oaep_params), + stringify!(CK_RSA_PKCS_OAEP_PARAMS), "::", stringify!(pSourceData) ) @@ -1695,13 +1872,13 @@ fn bindgen_test_layout_ck_rsa_pkcs_oaep_params() { 32usize, concat!( "Offset of field: ", - stringify!(ck_rsa_pkcs_oaep_params), + stringify!(CK_RSA_PKCS_OAEP_PARAMS), "::", stringify!(ulSourceDataLen) ) ); } -impl Default for ck_rsa_pkcs_oaep_params { +impl Default for CK_RSA_PKCS_OAEP_PARAMS { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { @@ -1710,133 +1887,138 @@ impl Default for ck_rsa_pkcs_oaep_params { } } } +pub type CK_RSA_PKCS_OAEP_PARAMS_PTR = *mut CK_RSA_PKCS_OAEP_PARAMS; #[repr(C)] #[derive(Debug, Default, Copy, Clone)] -pub struct ck_aes_ctr_params { - pub ulCounterBits: ::std::os::raw::c_ulong, - pub cb: [::std::os::raw::c_uchar; 16usize], +pub struct CK_RSA_PKCS_PSS_PARAMS { + pub hashAlg: CK_MECHANISM_TYPE, + pub mgf: CK_RSA_PKCS_MGF_TYPE, + pub sLen: CK_ULONG, } #[test] -fn bindgen_test_layout_ck_aes_ctr_params() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); +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::(), + ::std::mem::size_of::(), 24usize, - concat!("Size of: ", stringify!(ck_aes_ctr_params)) + concat!("Size of: ", stringify!(CK_RSA_PKCS_PSS_PARAMS)) ); assert_eq!( - ::std::mem::align_of::(), + ::std::mem::align_of::(), 8usize, - concat!("Alignment of ", stringify!(ck_aes_ctr_params)) + concat!("Alignment of ", stringify!(CK_RSA_PKCS_PSS_PARAMS)) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulCounterBits) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).hashAlg) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", - stringify!(ck_aes_ctr_params), + stringify!(CK_RSA_PKCS_PSS_PARAMS), "::", - stringify!(ulCounterBits) + stringify!(hashAlg) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).cb) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).mgf) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", - stringify!(ck_aes_ctr_params), + stringify!(CK_RSA_PKCS_PSS_PARAMS), "::", - stringify!(cb) + stringify!(mgf) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).sLen) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(CK_RSA_PKCS_PSS_PARAMS), + "::", + stringify!(sLen) ) ); } +pub type CK_RSA_PKCS_PSS_PARAMS_PTR = *mut CK_RSA_PKCS_PSS_PARAMS; +pub type CK_EC_KDF_TYPE = CK_ULONG; #[repr(C)] #[derive(Debug, Copy, Clone)] -pub struct ck_gcm_params { - pub pIv: *mut ::std::os::raw::c_uchar, - pub ulIvLen: ::std::os::raw::c_ulong, - pub ulIvBits: ::std::os::raw::c_ulong, - pub pAAD: *mut ::std::os::raw::c_uchar, - pub ulAADLen: ::std::os::raw::c_ulong, - pub ulTagBits: ::std::os::raw::c_ulong, +pub struct CK_ECDH1_DERIVE_PARAMS { + pub kdf: CK_EC_KDF_TYPE, + pub ulSharedDataLen: CK_ULONG, + pub pSharedData: CK_BYTE_PTR, + pub ulPublicDataLen: CK_ULONG, + pub pPublicData: CK_BYTE_PTR, } #[test] -fn bindgen_test_layout_ck_gcm_params() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); +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::(), - 48usize, - concat!("Size of: ", stringify!(ck_gcm_params)) + ::std::mem::size_of::(), + 40usize, + concat!("Size of: ", stringify!(CK_ECDH1_DERIVE_PARAMS)) ); assert_eq!( - ::std::mem::align_of::(), + ::std::mem::align_of::(), 8usize, - concat!("Alignment of ", stringify!(ck_gcm_params)) + concat!("Alignment of ", stringify!(CK_ECDH1_DERIVE_PARAMS)) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pIv) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).kdf) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", - stringify!(ck_gcm_params), + stringify!(CK_ECDH1_DERIVE_PARAMS), "::", - stringify!(pIv) + stringify!(kdf) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulIvLen) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ulSharedDataLen) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", - stringify!(ck_gcm_params), + stringify!(CK_ECDH1_DERIVE_PARAMS), "::", - stringify!(ulIvLen) + stringify!(ulSharedDataLen) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulIvBits) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).pSharedData) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", - stringify!(ck_gcm_params), + stringify!(CK_ECDH1_DERIVE_PARAMS), "::", - stringify!(ulIvBits) + stringify!(pSharedData) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pAAD) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ulPublicDataLen) as usize - ptr as usize }, 24usize, concat!( "Offset of field: ", - stringify!(ck_gcm_params), + stringify!(CK_ECDH1_DERIVE_PARAMS), "::", - stringify!(pAAD) + stringify!(ulPublicDataLen) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulAADLen) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).pPublicData) as usize - ptr as usize }, 32usize, concat!( "Offset of field: ", - stringify!(ck_gcm_params), - "::", - stringify!(ulAADLen) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulTagBits) as usize - ptr as usize }, - 40usize, - concat!( - "Offset of field: ", - stringify!(ck_gcm_params), + stringify!(CK_ECDH1_DERIVE_PARAMS), "::", - stringify!(ulTagBits) + stringify!(pPublicData) ) ); } -impl Default for ck_gcm_params { +impl Default for CK_ECDH1_DERIVE_PARAMS { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { @@ -1845,37 +2027,41 @@ impl Default for ck_gcm_params { } } } -pub type ck_ec_kdf_t = ::std::os::raw::c_ulong; +pub type CK_ECDH1_DERIVE_PARAMS_PTR = *mut CK_ECDH1_DERIVE_PARAMS; #[repr(C)] #[derive(Debug, Copy, Clone)] -pub struct ck_ecdh1_derive_params { - pub kdf: ck_ec_kdf_t, - pub ulSharedDataLen: ::std::os::raw::c_ulong, - pub pSharedData: *mut ::std::os::raw::c_uchar, - pub ulPublicDataLen: ::std::os::raw::c_ulong, - pub pPublicData: *mut ::std::os::raw::c_uchar, +pub struct CK_ECDH2_DERIVE_PARAMS { + pub kdf: CK_EC_KDF_TYPE, + pub ulSharedDataLen: CK_ULONG, + pub pSharedData: CK_BYTE_PTR, + pub ulPublicDataLen: CK_ULONG, + pub pPublicData: CK_BYTE_PTR, + pub ulPrivateDataLen: CK_ULONG, + pub hPrivateData: CK_OBJECT_HANDLE, + pub ulPublicDataLen2: CK_ULONG, + pub pPublicData2: CK_BYTE_PTR, } #[test] -fn bindgen_test_layout_ck_ecdh1_derive_params() { - const UNINIT: ::std::mem::MaybeUninit = +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::(), - 40usize, - concat!("Size of: ", stringify!(ck_ecdh1_derive_params)) + ::std::mem::size_of::(), + 72usize, + concat!("Size of: ", stringify!(CK_ECDH2_DERIVE_PARAMS)) ); assert_eq!( - ::std::mem::align_of::(), + ::std::mem::align_of::(), 8usize, - concat!("Alignment of ", stringify!(ck_ecdh1_derive_params)) + 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_ecdh1_derive_params), + stringify!(CK_ECDH2_DERIVE_PARAMS), "::", stringify!(kdf) ) @@ -1885,7 +2071,7 @@ fn bindgen_test_layout_ck_ecdh1_derive_params() { 8usize, concat!( "Offset of field: ", - stringify!(ck_ecdh1_derive_params), + stringify!(CK_ECDH2_DERIVE_PARAMS), "::", stringify!(ulSharedDataLen) ) @@ -1895,7 +2081,7 @@ fn bindgen_test_layout_ck_ecdh1_derive_params() { 16usize, concat!( "Offset of field: ", - stringify!(ck_ecdh1_derive_params), + stringify!(CK_ECDH2_DERIVE_PARAMS), "::", stringify!(pSharedData) ) @@ -1905,7 +2091,7 @@ fn bindgen_test_layout_ck_ecdh1_derive_params() { 24usize, concat!( "Offset of field: ", - stringify!(ck_ecdh1_derive_params), + stringify!(CK_ECDH2_DERIVE_PARAMS), "::", stringify!(ulPublicDataLen) ) @@ -1915,13 +2101,53 @@ fn bindgen_test_layout_ck_ecdh1_derive_params() { 32usize, concat!( "Offset of field: ", - stringify!(ck_ecdh1_derive_params), + stringify!(CK_ECDH2_DERIVE_PARAMS), "::", stringify!(pPublicData) ) ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ulPrivateDataLen) as usize - ptr as usize }, + 40usize, + 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 }, + 48usize, + 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 }, + 56usize, + 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 }, + 64usize, + concat!( + "Offset of field: ", + stringify!(CK_ECDH2_DERIVE_PARAMS), + "::", + stringify!(pPublicData2) + ) + ); } -impl Default for ck_ecdh1_derive_params { +impl Default for CK_ECDH2_DERIVE_PARAMS { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { @@ -1930,49 +2156,138 @@ impl Default for ck_ecdh1_derive_params { } } } +pub type CK_ECDH2_DERIVE_PARAMS_PTR = *mut CK_ECDH2_DERIVE_PARAMS; #[repr(C)] #[derive(Debug, Copy, Clone)] -pub struct ck_key_derivation_string_data { - pub pData: *mut ::std::os::raw::c_uchar, - pub ulLen: ::std::os::raw::c_ulong, +pub struct CK_ECMQV_DERIVE_PARAMS { + pub kdf: CK_EC_KDF_TYPE, + pub ulSharedDataLen: CK_ULONG, + pub pSharedData: CK_BYTE_PTR, + pub ulPublicDataLen: CK_ULONG, + pub pPublicData: CK_BYTE_PTR, + pub ulPrivateDataLen: CK_ULONG, + pub hPrivateData: CK_OBJECT_HANDLE, + pub ulPublicDataLen2: CK_ULONG, + pub pPublicData2: CK_BYTE_PTR, + pub publicKey: CK_OBJECT_HANDLE, } #[test] -fn bindgen_test_layout_ck_key_derivation_string_data() { - const UNINIT: ::std::mem::MaybeUninit = +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::(), - 16usize, - concat!("Size of: ", stringify!(ck_key_derivation_string_data)) + ::std::mem::size_of::(), + 80usize, + concat!("Size of: ", stringify!(CK_ECMQV_DERIVE_PARAMS)) ); assert_eq!( - ::std::mem::align_of::(), + ::std::mem::align_of::(), 8usize, - concat!("Alignment of ", stringify!(ck_key_derivation_string_data)) + concat!("Alignment of ", stringify!(CK_ECMQV_DERIVE_PARAMS)) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pData) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).kdf) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", - stringify!(ck_key_derivation_string_data), + stringify!(CK_ECMQV_DERIVE_PARAMS), "::", - stringify!(pData) + stringify!(kdf) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulLen) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ulSharedDataLen) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", - stringify!(ck_key_derivation_string_data), + stringify!(CK_ECMQV_DERIVE_PARAMS), "::", - stringify!(ulLen) + stringify!(ulSharedDataLen) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pSharedData) as usize - ptr as usize }, + 16usize, + 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 }, + 24usize, + 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 }, + 32usize, + 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 }, + 40usize, + 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 }, + 48usize, + 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 }, + 56usize, + 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 }, + 64usize, + 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 }, + 72usize, + concat!( + "Offset of field: ", + stringify!(CK_ECMQV_DERIVE_PARAMS), + "::", + stringify!(publicKey) ) ); } -impl Default for ck_key_derivation_string_data { +impl Default for CK_ECMQV_DERIVE_PARAMS { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { @@ -1981,60 +2296,85 @@ impl Default for ck_key_derivation_string_data { } } } +pub type CK_ECMQV_DERIVE_PARAMS_PTR = *mut CK_ECMQV_DERIVE_PARAMS; +pub type CK_X9_42_DH_KDF_TYPE = CK_ULONG; +pub type CK_X9_42_DH_KDF_TYPE_PTR = *mut CK_X9_42_DH_KDF_TYPE; #[repr(C)] #[derive(Debug, Copy, Clone)] -pub struct ck_des_cbc_encrypt_data_params { - pub iv: [::std::os::raw::c_uchar; 8usize], - pub pData: *mut ::std::os::raw::c_uchar, - pub length: ::std::os::raw::c_ulong, +pub struct CK_X9_42_DH1_DERIVE_PARAMS { + pub kdf: CK_X9_42_DH_KDF_TYPE, + pub ulOtherInfoLen: CK_ULONG, + pub pOtherInfo: CK_BYTE_PTR, + pub ulPublicDataLen: CK_ULONG, + pub pPublicData: CK_BYTE_PTR, } #[test] -fn bindgen_test_layout_ck_des_cbc_encrypt_data_params() { - const UNINIT: ::std::mem::MaybeUninit = +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::(), - 24usize, - concat!("Size of: ", stringify!(ck_des_cbc_encrypt_data_params)) + ::std::mem::size_of::(), + 40usize, + concat!("Size of: ", stringify!(CK_X9_42_DH1_DERIVE_PARAMS)) ); assert_eq!( - ::std::mem::align_of::(), + ::std::mem::align_of::(), 8usize, - concat!("Alignment of ", stringify!(ck_des_cbc_encrypt_data_params)) + concat!("Alignment of ", stringify!(CK_X9_42_DH1_DERIVE_PARAMS)) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).iv) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).kdf) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", - stringify!(ck_des_cbc_encrypt_data_params), + stringify!(CK_X9_42_DH1_DERIVE_PARAMS), "::", - stringify!(iv) + stringify!(kdf) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pData) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ulOtherInfoLen) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", - stringify!(ck_des_cbc_encrypt_data_params), + stringify!(CK_X9_42_DH1_DERIVE_PARAMS), "::", - stringify!(pData) + stringify!(ulOtherInfoLen) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).length) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).pOtherInfo) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", - stringify!(ck_des_cbc_encrypt_data_params), + stringify!(CK_X9_42_DH1_DERIVE_PARAMS), "::", - stringify!(length) + stringify!(pOtherInfo) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ulPublicDataLen) as usize - ptr as usize }, + 24usize, + 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 }, + 32usize, + concat!( + "Offset of field: ", + stringify!(CK_X9_42_DH1_DERIVE_PARAMS), + "::", + stringify!(pPublicData) ) ); } -impl Default for ck_des_cbc_encrypt_data_params { +impl Default for CK_X9_42_DH1_DERIVE_PARAMS { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { @@ -2043,540 +2383,7363 @@ impl Default for ck_des_cbc_encrypt_data_params { } } } +pub type CK_X9_42_DH1_DERIVE_PARAMS_PTR = *mut CK_X9_42_DH1_DERIVE_PARAMS; #[repr(C)] #[derive(Debug, Copy, Clone)] -pub struct ck_aes_cbc_encrypt_data_params { - pub iv: [::std::os::raw::c_uchar; 16usize], - pub pData: *mut ::std::os::raw::c_uchar, - pub length: ::std::os::raw::c_ulong, +pub struct CK_X9_42_DH2_DERIVE_PARAMS { + pub kdf: CK_X9_42_DH_KDF_TYPE, + pub ulOtherInfoLen: CK_ULONG, + pub pOtherInfo: CK_BYTE_PTR, + pub ulPublicDataLen: CK_ULONG, + pub pPublicData: CK_BYTE_PTR, + pub ulPrivateDataLen: CK_ULONG, + pub hPrivateData: CK_OBJECT_HANDLE, + pub ulPublicDataLen2: CK_ULONG, + pub pPublicData2: CK_BYTE_PTR, } #[test] -fn bindgen_test_layout_ck_aes_cbc_encrypt_data_params() { - const UNINIT: ::std::mem::MaybeUninit = +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::(), - 32usize, - concat!("Size of: ", stringify!(ck_aes_cbc_encrypt_data_params)) + ::std::mem::size_of::(), + 72usize, + concat!("Size of: ", stringify!(CK_X9_42_DH2_DERIVE_PARAMS)) ); assert_eq!( - ::std::mem::align_of::(), + ::std::mem::align_of::(), 8usize, - concat!("Alignment of ", stringify!(ck_aes_cbc_encrypt_data_params)) + concat!("Alignment of ", stringify!(CK_X9_42_DH2_DERIVE_PARAMS)) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).iv) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).kdf) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", - stringify!(ck_aes_cbc_encrypt_data_params), + stringify!(CK_X9_42_DH2_DERIVE_PARAMS), "::", - stringify!(iv) + stringify!(kdf) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pData) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ulOtherInfoLen) as usize - ptr as usize }, + 8usize, + 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 }, 16usize, concat!( "Offset of field: ", - stringify!(ck_aes_cbc_encrypt_data_params), + stringify!(CK_X9_42_DH2_DERIVE_PARAMS), "::", - stringify!(pData) + stringify!(pOtherInfo) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).length) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ulPublicDataLen) as usize - ptr as usize }, 24usize, concat!( "Offset of field: ", - stringify!(ck_aes_cbc_encrypt_data_params), + stringify!(CK_X9_42_DH2_DERIVE_PARAMS), "::", - stringify!(length) + stringify!(ulPublicDataLen) ) ); -} -impl Default for ck_aes_cbc_encrypt_data_params { - fn default() -> Self { - let mut s = ::std::mem::MaybeUninit::::uninit(); - unsafe { - ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -pub type CK_RV = ::std::os::raw::c_ulong; -pub type CK_NOTIFY = ::std::option::Option< - unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - event: CK_NOTIFICATION, - application: *mut ::std::os::raw::c_void, - ) -> CK_RV, ->; -pub type CK_C_Initialize = - ::std::option::Option CK_RV>; -pub type CK_C_Finalize = - ::std::option::Option CK_RV>; -pub type CK_C_GetInfo = ::std::option::Option CK_RV>; -pub type CK_C_GetFunctionList = ::std::option::Option< - unsafe extern "C" fn(function_list: *mut *mut _CK_FUNCTION_LIST) -> CK_RV, ->; -pub type CK_C_GetSlotList = ::std::option::Option< - unsafe extern "C" fn( - token_present: ::std::os::raw::c_uchar, - slot_list: *mut CK_SLOT_ID, - ulCount: *mut ::std::os::raw::c_ulong, - ) -> CK_RV, ->; -pub type CK_C_GetSlotInfo = ::std::option::Option< - unsafe extern "C" fn(slotID: CK_SLOT_ID, info: *mut _CK_SLOT_INFO) -> CK_RV, ->; -pub type CK_C_GetTokenInfo = ::std::option::Option< - unsafe extern "C" fn(slotID: CK_SLOT_ID, info: *mut _CK_TOKEN_INFO) -> CK_RV, ->; -pub type CK_C_WaitForSlotEvent = ::std::option::Option< + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pPublicData) as usize - ptr as usize }, + 32usize, + 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 }, + 40usize, + 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 }, + 48usize, + 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 }, + 56usize, + 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 }, + 64usize, + concat!( + "Offset of field: ", + stringify!(CK_X9_42_DH2_DERIVE_PARAMS), + "::", + stringify!(pPublicData2) + ) + ); +} +impl Default for CK_X9_42_DH2_DERIVE_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_X9_42_DH2_DERIVE_PARAMS_PTR = *mut CK_X9_42_DH2_DERIVE_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_X9_42_MQV_DERIVE_PARAMS { + pub kdf: CK_X9_42_DH_KDF_TYPE, + pub ulOtherInfoLen: CK_ULONG, + pub pOtherInfo: CK_BYTE_PTR, + pub ulPublicDataLen: CK_ULONG, + pub pPublicData: CK_BYTE_PTR, + pub ulPrivateDataLen: CK_ULONG, + pub hPrivateData: CK_OBJECT_HANDLE, + pub ulPublicDataLen2: CK_ULONG, + 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::(), + 80usize, + concat!("Size of: ", stringify!(CK_X9_42_MQV_DERIVE_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + 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 }, + 16usize, + 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 }, + 24usize, + 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 }, + 32usize, + 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 }, + 40usize, + 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 }, + 48usize, + 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 }, + 56usize, + 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 }, + 64usize, + 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 }, + 72usize, + concat!( + "Offset of field: ", + stringify!(CK_X9_42_MQV_DERIVE_PARAMS), + "::", + stringify!(publicKey) + ) + ); +} +impl Default for CK_X9_42_MQV_DERIVE_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_X9_42_MQV_DERIVE_PARAMS_PTR = *mut CK_X9_42_MQV_DERIVE_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_KEA_DERIVE_PARAMS { + pub isSender: CK_BBOOL, + pub ulRandomLen: CK_ULONG, + pub pRandomA: CK_BYTE_PTR, + pub pRandomB: CK_BYTE_PTR, + 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::(), + 48usize, + concat!("Size of: ", stringify!(CK_KEA_DERIVE_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + 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 }, + 16usize, + 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 }, + 24usize, + 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 }, + 32usize, + 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 }, + 40usize, + concat!( + "Offset of field: ", + stringify!(CK_KEA_DERIVE_PARAMS), + "::", + stringify!(pPublicData) + ) + ); +} +impl Default for CK_KEA_DERIVE_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_KEA_DERIVE_PARAMS_PTR = *mut CK_KEA_DERIVE_PARAMS; +pub type CK_RC2_PARAMS = CK_ULONG; +pub type CK_RC2_PARAMS_PTR = *mut CK_RC2_PARAMS; +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +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::(), + 16usize, + concat!("Size of: ", stringify!(CK_RC2_CBC_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + concat!( + "Offset of field: ", + stringify!(CK_RC2_CBC_PARAMS), + "::", + stringify!(iv) + ) + ); +} +pub type CK_RC2_CBC_PARAMS_PTR = *mut CK_RC2_CBC_PARAMS; +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +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::(), + 16usize, + concat!("Size of: ", stringify!(CK_RC2_MAC_GENERAL_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + concat!( + "Offset of field: ", + stringify!(CK_RC2_MAC_GENERAL_PARAMS), + "::", + stringify!(ulMacLength) + ) + ); +} +pub type CK_RC2_MAC_GENERAL_PARAMS_PTR = *mut CK_RC2_MAC_GENERAL_PARAMS; +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +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::(), + 16usize, + concat!("Size of: ", stringify!(CK_RC5_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + concat!( + "Offset of field: ", + stringify!(CK_RC5_PARAMS), + "::", + stringify!(ulRounds) + ) + ); +} +pub type CK_RC5_PARAMS_PTR = *mut CK_RC5_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_RC5_CBC_PARAMS { + pub ulWordsize: CK_ULONG, + pub ulRounds: CK_ULONG, + 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::(), + 32usize, + concat!("Size of: ", stringify!(CK_RC5_CBC_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + 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 }, + 16usize, + 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 }, + 24usize, + concat!( + "Offset of field: ", + stringify!(CK_RC5_CBC_PARAMS), + "::", + stringify!(ulIvLen) + ) + ); +} +impl Default for CK_RC5_CBC_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_RC5_CBC_PARAMS_PTR = *mut CK_RC5_CBC_PARAMS; +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct CK_RC5_MAC_GENERAL_PARAMS { + pub ulWordsize: CK_ULONG, + 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::(), + 24usize, + concat!("Size of: ", stringify!(CK_RC5_MAC_GENERAL_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + 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 }, + 16usize, + concat!( + "Offset of field: ", + stringify!(CK_RC5_MAC_GENERAL_PARAMS), + "::", + stringify!(ulMacLength) + ) + ); +} +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; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_DES_CBC_ENCRYPT_DATA_PARAMS { + pub iv: [CK_BYTE; 8usize], + 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::(), + 24usize, + concat!("Size of: ", stringify!(CK_DES_CBC_ENCRYPT_DATA_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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) + ) + ); +} +impl Default for CK_DES_CBC_ENCRYPT_DATA_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_DES_CBC_ENCRYPT_DATA_PARAMS_PTR = *mut CK_DES_CBC_ENCRYPT_DATA_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_AES_CBC_ENCRYPT_DATA_PARAMS { + pub iv: [CK_BYTE; 16usize], + 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::(), + 32usize, + concat!("Size of: ", stringify!(CK_AES_CBC_ENCRYPT_DATA_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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) + ) + ); +} +impl Default for CK_AES_CBC_ENCRYPT_DATA_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_AES_CBC_ENCRYPT_DATA_PARAMS_PTR = *mut CK_AES_CBC_ENCRYPT_DATA_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_SKIPJACK_PRIVATE_WRAP_PARAMS { + pub ulPasswordLen: CK_ULONG, + pub pPassword: CK_BYTE_PTR, + pub ulPublicDataLen: CK_ULONG, + pub pPublicData: CK_BYTE_PTR, + pub ulPAndGLen: CK_ULONG, + pub ulQLen: CK_ULONG, + pub ulRandomLen: CK_ULONG, + pub pRandomA: CK_BYTE_PTR, + pub pPrimeP: CK_BYTE_PTR, + 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::(), + 88usize, + concat!("Size of: ", stringify!(CK_SKIPJACK_PRIVATE_WRAP_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + 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 }, + 16usize, + 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 }, + 24usize, + 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 }, + 32usize, + 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 }, + 40usize, + 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 }, + 48usize, + 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 }, + 56usize, + 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 }, + 64usize, + 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 }, + 72usize, + 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 }, + 80usize, + concat!( + "Offset of field: ", + stringify!(CK_SKIPJACK_PRIVATE_WRAP_PARAMS), + "::", + stringify!(pSubprimeQ) + ) + ); +} +impl Default for CK_SKIPJACK_PRIVATE_WRAP_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_SKIPJACK_PRIVATE_WRAP_PARAMS_PTR = *mut CK_SKIPJACK_PRIVATE_WRAP_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_SKIPJACK_RELAYX_PARAMS { + pub ulOldWrappedXLen: CK_ULONG, + pub pOldWrappedX: CK_BYTE_PTR, + pub ulOldPasswordLen: CK_ULONG, + pub pOldPassword: CK_BYTE_PTR, + pub ulOldPublicDataLen: CK_ULONG, + pub pOldPublicData: CK_BYTE_PTR, + pub ulOldRandomLen: CK_ULONG, + pub pOldRandomA: CK_BYTE_PTR, + pub ulNewPasswordLen: CK_ULONG, + pub pNewPassword: CK_BYTE_PTR, + pub ulNewPublicDataLen: CK_ULONG, + pub pNewPublicData: CK_BYTE_PTR, + 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::(), + 112usize, + concat!("Size of: ", stringify!(CK_SKIPJACK_RELAYX_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + 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 }, + 16usize, + 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 }, + 24usize, + 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 }, + 32usize, + 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 }, + 40usize, + 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 }, + 48usize, + 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 }, + 56usize, + 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 }, + 64usize, + 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 }, + 72usize, + 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 }, + 80usize, + 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 }, + 88usize, + 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 }, + 96usize, + 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 }, + 104usize, + concat!( + "Offset of field: ", + stringify!(CK_SKIPJACK_RELAYX_PARAMS), + "::", + stringify!(pNewRandomA) + ) + ); +} +impl Default for CK_SKIPJACK_RELAYX_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_SKIPJACK_RELAYX_PARAMS_PTR = *mut CK_SKIPJACK_RELAYX_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_PBE_PARAMS { + pub pInitVector: CK_BYTE_PTR, + pub pPassword: CK_UTF8CHAR_PTR, + pub ulPasswordLen: CK_ULONG, + pub pSalt: CK_BYTE_PTR, + 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::(), + 48usize, + concat!("Size of: ", stringify!(CK_PBE_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 24usize, + concat!( + "Offset of field: ", + stringify!(CK_PBE_PARAMS), + "::", + stringify!(pSalt) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ulSaltLen) as usize - ptr as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(CK_PBE_PARAMS), + "::", + stringify!(ulSaltLen) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ulIteration) as usize - ptr as usize }, + 40usize, + concat!( + "Offset of field: ", + stringify!(CK_PBE_PARAMS), + "::", + stringify!(ulIteration) + ) + ); +} +impl Default for CK_PBE_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_PBE_PARAMS_PTR = *mut CK_PBE_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_KEY_WRAP_SET_OAEP_PARAMS { + pub bBC: CK_BYTE, + 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::(), + 24usize, + concat!("Size of: ", stringify!(CK_KEY_WRAP_SET_OAEP_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + 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 }, + 16usize, + concat!( + "Offset of field: ", + stringify!(CK_KEY_WRAP_SET_OAEP_PARAMS), + "::", + stringify!(ulXLen) + ) + ); +} +impl Default for CK_KEY_WRAP_SET_OAEP_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_KEY_WRAP_SET_OAEP_PARAMS_PTR = *mut CK_KEY_WRAP_SET_OAEP_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_SSL3_RANDOM_DATA { + pub pClientRandom: CK_BYTE_PTR, + pub ulClientRandomLen: CK_ULONG, + 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::(), + 32usize, + concat!("Size of: ", stringify!(CK_SSL3_RANDOM_DATA)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 16usize, + 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 }, + 24usize, + concat!( + "Offset of field: ", + stringify!(CK_SSL3_RANDOM_DATA), + "::", + stringify!(ulServerRandomLen) + ) + ); +} +impl Default for CK_SSL3_RANDOM_DATA { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct 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::(), + 40usize, + concat!("Size of: ", stringify!(CK_SSL3_MASTER_KEY_DERIVE_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 32usize, + concat!( + "Offset of field: ", + stringify!(CK_SSL3_MASTER_KEY_DERIVE_PARAMS), + "::", + stringify!(pVersion) + ) + ); +} +impl Default for CK_SSL3_MASTER_KEY_DERIVE_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_SSL3_MASTER_KEY_DERIVE_PARAMS_PTR = *mut CK_SSL3_MASTER_KEY_DERIVE_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_SSL3_KEY_MAT_OUT { + pub hClientMacSecret: CK_OBJECT_HANDLE, + pub hServerMacSecret: CK_OBJECT_HANDLE, + pub hClientKey: CK_OBJECT_HANDLE, + pub hServerKey: CK_OBJECT_HANDLE, + 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::(), + 48usize, + concat!("Size of: ", stringify!(CK_SSL3_KEY_MAT_OUT)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + 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 }, + 16usize, + 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 }, + 24usize, + 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 }, + 32usize, + 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 }, + 40usize, + concat!( + "Offset of field: ", + stringify!(CK_SSL3_KEY_MAT_OUT), + "::", + stringify!(pIVServer) + ) + ); +} +impl Default for CK_SSL3_KEY_MAT_OUT { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_SSL3_KEY_MAT_OUT_PTR = *mut CK_SSL3_KEY_MAT_OUT; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_SSL3_KEY_MAT_PARAMS { + pub ulMacSizeInBits: CK_ULONG, + pub ulKeySizeInBits: CK_ULONG, + pub ulIVSizeInBits: CK_ULONG, + pub bIsExport: CK_BBOOL, + 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::(), + 72usize, + concat!("Size of: ", stringify!(CK_SSL3_KEY_MAT_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + 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 }, + 16usize, + 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 }, + 24usize, + 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 }, + 32usize, + 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 }, + 64usize, + concat!( + "Offset of field: ", + stringify!(CK_SSL3_KEY_MAT_PARAMS), + "::", + stringify!(pReturnedKeyMaterial) + ) + ); +} +impl Default for CK_SSL3_KEY_MAT_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_SSL3_KEY_MAT_PARAMS_PTR = *mut CK_SSL3_KEY_MAT_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_TLS_PRF_PARAMS { + pub pSeed: CK_BYTE_PTR, + pub ulSeedLen: CK_ULONG, + pub pLabel: CK_BYTE_PTR, + pub ulLabelLen: CK_ULONG, + 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::(), + 48usize, + concat!("Size of: ", stringify!(CK_TLS_PRF_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 16usize, + 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 }, + 24usize, + 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 }, + 32usize, + 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 }, + 40usize, + concat!( + "Offset of field: ", + stringify!(CK_TLS_PRF_PARAMS), + "::", + stringify!(pulOutputLen) + ) + ); +} +impl Default for CK_TLS_PRF_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_TLS_PRF_PARAMS_PTR = *mut CK_TLS_PRF_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_WTLS_RANDOM_DATA { + pub pClientRandom: CK_BYTE_PTR, + pub ulClientRandomLen: CK_ULONG, + 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::(), + 32usize, + concat!("Size of: ", stringify!(CK_WTLS_RANDOM_DATA)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 16usize, + 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 }, + 24usize, + concat!( + "Offset of field: ", + stringify!(CK_WTLS_RANDOM_DATA), + "::", + stringify!(ulServerRandomLen) + ) + ); +} +impl Default for CK_WTLS_RANDOM_DATA { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_WTLS_RANDOM_DATA_PTR = *mut CK_WTLS_RANDOM_DATA; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_WTLS_MASTER_KEY_DERIVE_PARAMS { + pub DigestMechanism: CK_MECHANISM_TYPE, + 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::(), + 48usize, + concat!("Size of: ", stringify!(CK_WTLS_MASTER_KEY_DERIVE_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + 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 }, + 40usize, + concat!( + "Offset of field: ", + stringify!(CK_WTLS_MASTER_KEY_DERIVE_PARAMS), + "::", + stringify!(pVersion) + ) + ); +} +impl Default for CK_WTLS_MASTER_KEY_DERIVE_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_WTLS_MASTER_KEY_DERIVE_PARAMS_PTR = *mut CK_WTLS_MASTER_KEY_DERIVE_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_WTLS_PRF_PARAMS { + pub DigestMechanism: CK_MECHANISM_TYPE, + pub pSeed: CK_BYTE_PTR, + pub ulSeedLen: CK_ULONG, + pub pLabel: CK_BYTE_PTR, + pub ulLabelLen: CK_ULONG, + 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::(), + 56usize, + concat!("Size of: ", stringify!(CK_WTLS_PRF_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + 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 }, + 16usize, + 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 }, + 24usize, + 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 }, + 32usize, + 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 }, + 40usize, + 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 }, + 48usize, + concat!( + "Offset of field: ", + stringify!(CK_WTLS_PRF_PARAMS), + "::", + stringify!(pulOutputLen) + ) + ); +} +impl Default for CK_WTLS_PRF_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_WTLS_PRF_PARAMS_PTR = *mut CK_WTLS_PRF_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_WTLS_KEY_MAT_OUT { + pub hMacSecret: CK_OBJECT_HANDLE, + 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::(), + 24usize, + concat!("Size of: ", stringify!(CK_WTLS_KEY_MAT_OUT)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + 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 }, + 16usize, + concat!( + "Offset of field: ", + stringify!(CK_WTLS_KEY_MAT_OUT), + "::", + stringify!(pIV) + ) + ); +} +impl Default for CK_WTLS_KEY_MAT_OUT { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_WTLS_KEY_MAT_OUT_PTR = *mut CK_WTLS_KEY_MAT_OUT; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_WTLS_KEY_MAT_PARAMS { + pub DigestMechanism: CK_MECHANISM_TYPE, + pub ulMacSizeInBits: CK_ULONG, + pub ulKeySizeInBits: CK_ULONG, + pub ulIVSizeInBits: CK_ULONG, + pub ulSequenceNumber: CK_ULONG, + pub bIsExport: CK_BBOOL, + 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::(), + 88usize, + concat!("Size of: ", stringify!(CK_WTLS_KEY_MAT_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + 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 }, + 16usize, + 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 }, + 24usize, + 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 }, + 32usize, + 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 }, + 40usize, + 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 }, + 48usize, + 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 }, + 80usize, + concat!( + "Offset of field: ", + stringify!(CK_WTLS_KEY_MAT_PARAMS), + "::", + stringify!(pReturnedKeyMaterial) + ) + ); +} +impl Default for CK_WTLS_KEY_MAT_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_WTLS_KEY_MAT_PARAMS_PTR = *mut CK_WTLS_KEY_MAT_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_CMS_SIG_PARAMS { + pub certificateHandle: CK_OBJECT_HANDLE, + pub pSigningMechanism: CK_MECHANISM_PTR, + pub pDigestMechanism: CK_MECHANISM_PTR, + pub pContentType: CK_UTF8CHAR_PTR, + pub pRequestedAttributes: CK_BYTE_PTR, + pub ulRequestedAttributesLen: CK_ULONG, + 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::(), + 64usize, + concat!("Size of: ", stringify!(CK_CMS_SIG_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + 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 }, + 16usize, + 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 }, + 24usize, + 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 }, + 32usize, + 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 }, + 40usize, + 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 }, + 48usize, + 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 }, + 56usize, + concat!( + "Offset of field: ", + stringify!(CK_CMS_SIG_PARAMS), + "::", + stringify!(ulRequiredAttributesLen) + ) + ); +} +impl Default for CK_CMS_SIG_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_CMS_SIG_PARAMS_PTR = *mut CK_CMS_SIG_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +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::(), + 16usize, + concat!("Size of: ", stringify!(CK_KEY_DERIVATION_STRING_DATA)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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) + ) + ); +} +impl Default for CK_KEY_DERIVATION_STRING_DATA { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_KEY_DERIVATION_STRING_DATA_PTR = *mut CK_KEY_DERIVATION_STRING_DATA; +pub type CK_EXTRACT_PARAMS = CK_ULONG; +pub type CK_EXTRACT_PARAMS_PTR = *mut CK_EXTRACT_PARAMS; +pub type CK_PKCS5_PBKD2_PSEUDO_RANDOM_FUNCTION_TYPE = CK_ULONG; +pub type CK_PKCS5_PBKD2_PSEUDO_RANDOM_FUNCTION_TYPE_PTR = + *mut CK_PKCS5_PBKD2_PSEUDO_RANDOM_FUNCTION_TYPE; +pub type CK_PKCS5_PBKDF2_SALT_SOURCE_TYPE = CK_ULONG; +pub type CK_PKCS5_PBKDF2_SALT_SOURCE_TYPE_PTR = *mut CK_PKCS5_PBKDF2_SALT_SOURCE_TYPE; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_PKCS5_PBKD2_PARAMS { + pub saltSource: CK_PKCS5_PBKDF2_SALT_SOURCE_TYPE, + pub pSaltSourceData: CK_VOID_PTR, + pub ulSaltSourceDataLen: CK_ULONG, + pub iterations: CK_ULONG, + pub prf: CK_PKCS5_PBKD2_PSEUDO_RANDOM_FUNCTION_TYPE, + pub pPrfData: CK_VOID_PTR, + pub ulPrfDataLen: CK_ULONG, + 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::(), + 72usize, + concat!("Size of: ", stringify!(CK_PKCS5_PBKD2_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + 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 }, + 16usize, + 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 }, + 24usize, + 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 }, + 32usize, + 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 }, + 40usize, + 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 }, + 48usize, + 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 }, + 56usize, + 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 }, + 64usize, + concat!( + "Offset of field: ", + stringify!(CK_PKCS5_PBKD2_PARAMS), + "::", + stringify!(ulPasswordLen) + ) + ); +} +impl Default for CK_PKCS5_PBKD2_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_PKCS5_PBKD2_PARAMS_PTR = *mut CK_PKCS5_PBKD2_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_PKCS5_PBKD2_PARAMS2 { + pub saltSource: CK_PKCS5_PBKDF2_SALT_SOURCE_TYPE, + pub pSaltSourceData: CK_VOID_PTR, + pub ulSaltSourceDataLen: CK_ULONG, + pub iterations: CK_ULONG, + pub prf: CK_PKCS5_PBKD2_PSEUDO_RANDOM_FUNCTION_TYPE, + pub pPrfData: CK_VOID_PTR, + pub ulPrfDataLen: CK_ULONG, + 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::(), + 72usize, + concat!("Size of: ", stringify!(CK_PKCS5_PBKD2_PARAMS2)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + 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 }, + 16usize, + 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 }, + 24usize, + 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 }, + 32usize, + 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 }, + 40usize, + 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 }, + 48usize, + 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 }, + 56usize, + 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 }, + 64usize, + concat!( + "Offset of field: ", + stringify!(CK_PKCS5_PBKD2_PARAMS2), + "::", + stringify!(ulPasswordLen) + ) + ); +} +impl Default for CK_PKCS5_PBKD2_PARAMS2 { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_PKCS5_PBKD2_PARAMS2_PTR = *mut CK_PKCS5_PBKD2_PARAMS2; +pub type CK_OTP_PARAM_TYPE = CK_ULONG; +pub type CK_PARAM_TYPE = CK_OTP_PARAM_TYPE; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_OTP_PARAM { + pub type_: CK_OTP_PARAM_TYPE, + 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::(), + 24usize, + concat!("Size of: ", stringify!(CK_OTP_PARAM)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + concat!( + "Offset of field: ", + stringify!(CK_OTP_PARAM), + "::", + stringify!(pValue) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ulValueLen) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(CK_OTP_PARAM), + "::", + stringify!(ulValueLen) + ) + ); +} +impl Default for CK_OTP_PARAM { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_OTP_PARAM_PTR = *mut CK_OTP_PARAM; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +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::(), + 16usize, + concat!("Size of: ", stringify!(CK_OTP_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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) + ) + ); +} +impl Default for CK_OTP_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_OTP_PARAMS_PTR = *mut CK_OTP_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +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::(), + 16usize, + concat!("Size of: ", stringify!(CK_OTP_SIGNATURE_INFO)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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) + ) + ); +} +impl Default for CK_OTP_SIGNATURE_INFO { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_OTP_SIGNATURE_INFO_PTR = *mut CK_OTP_SIGNATURE_INFO; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_KIP_PARAMS { + pub pMechanism: CK_MECHANISM_PTR, + pub hKey: CK_OBJECT_HANDLE, + 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::(), + 32usize, + concat!("Size of: ", stringify!(CK_KIP_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 16usize, + concat!( + "Offset of field: ", + stringify!(CK_KIP_PARAMS), + "::", + stringify!(pSeed) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ulSeedLen) as usize - ptr as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(CK_KIP_PARAMS), + "::", + stringify!(ulSeedLen) + ) + ); +} +impl Default for CK_KIP_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_KIP_PARAMS_PTR = *mut CK_KIP_PARAMS; +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +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::(), + 24usize, + concat!("Size of: ", stringify!(CK_AES_CTR_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + concat!( + "Offset of field: ", + stringify!(CK_AES_CTR_PARAMS), + "::", + stringify!(cb) + ) + ); +} +pub type CK_AES_CTR_PARAMS_PTR = *mut CK_AES_CTR_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_GCM_PARAMS { + pub pIv: CK_BYTE_PTR, + pub ulIvLen: CK_ULONG, + pub ulIvBits: CK_ULONG, + pub pAAD: CK_BYTE_PTR, + 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::(), + 48usize, + concat!("Size of: ", stringify!(CK_GCM_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 16usize, + concat!( + "Offset of field: ", + stringify!(CK_GCM_PARAMS), + "::", + stringify!(ulIvBits) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pAAD) as usize - ptr as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(CK_GCM_PARAMS), + "::", + stringify!(pAAD) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ulAADLen) as usize - ptr as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(CK_GCM_PARAMS), + "::", + stringify!(ulAADLen) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ulTagBits) as usize - ptr as usize }, + 40usize, + concat!( + "Offset of field: ", + stringify!(CK_GCM_PARAMS), + "::", + stringify!(ulTagBits) + ) + ); +} +impl Default for CK_GCM_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_GCM_PARAMS_PTR = *mut CK_GCM_PARAMS; +pub type CK_GENERATOR_FUNCTION = CK_ULONG; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_GCM_MESSAGE_PARAMS { + pub pIv: CK_BYTE_PTR, + pub ulIvLen: CK_ULONG, + pub ulIvFixedBits: CK_ULONG, + pub ivGenerator: CK_GENERATOR_FUNCTION, + 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::(), + 48usize, + concat!("Size of: ", stringify!(CK_GCM_MESSAGE_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 16usize, + 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 }, + 24usize, + 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 }, + 32usize, + 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 }, + 40usize, + concat!( + "Offset of field: ", + stringify!(CK_GCM_MESSAGE_PARAMS), + "::", + stringify!(ulTagBits) + ) + ); +} +impl Default for CK_GCM_MESSAGE_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_GCM_MESSAGE_PARAMS_PTR = CK_GCM_MESSAGE_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_CCM_PARAMS { + pub ulDataLen: CK_ULONG, + pub pNonce: CK_BYTE_PTR, + pub ulNonceLen: CK_ULONG, + pub pAAD: CK_BYTE_PTR, + 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::(), + 48usize, + concat!("Size of: ", stringify!(CK_CCM_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + concat!( + "Offset of field: ", + stringify!(CK_CCM_PARAMS), + "::", + stringify!(pNonce) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ulNonceLen) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(CK_CCM_PARAMS), + "::", + stringify!(ulNonceLen) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pAAD) as usize - ptr as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(CK_CCM_PARAMS), + "::", + stringify!(pAAD) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ulAADLen) as usize - ptr as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(CK_CCM_PARAMS), + "::", + stringify!(ulAADLen) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ulMACLen) as usize - ptr as usize }, + 40usize, + concat!( + "Offset of field: ", + stringify!(CK_CCM_PARAMS), + "::", + stringify!(ulMACLen) + ) + ); +} +impl Default for CK_CCM_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_CCM_PARAMS_PTR = *mut CK_CCM_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_CCM_MESSAGE_PARAMS { + pub ulDataLen: CK_ULONG, + pub pNonce: CK_BYTE_PTR, + pub ulNonceLen: CK_ULONG, + pub ulNonceFixedBits: CK_ULONG, + pub nonceGenerator: CK_GENERATOR_FUNCTION, + 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::(), + 56usize, + concat!("Size of: ", stringify!(CK_CCM_MESSAGE_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + 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 }, + 16usize, + 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 }, + 24usize, + 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 }, + 32usize, + 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 }, + 40usize, + 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 }, + 48usize, + concat!( + "Offset of field: ", + stringify!(CK_CCM_MESSAGE_PARAMS), + "::", + stringify!(ulMACLen) + ) + ); +} +impl Default for CK_CCM_MESSAGE_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_CCM_MESSAGE_PARAMS_PTR = CK_CCM_MESSAGE_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_AES_GCM_PARAMS { + pub pIv: CK_BYTE_PTR, + pub ulIvLen: CK_ULONG, + pub ulIvBits: CK_ULONG, + pub pAAD: CK_BYTE_PTR, + 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::(), + 48usize, + concat!("Size of: ", stringify!(CK_AES_GCM_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 16usize, + 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 }, + 24usize, + 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 }, + 32usize, + 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 }, + 40usize, + concat!( + "Offset of field: ", + stringify!(CK_AES_GCM_PARAMS), + "::", + stringify!(ulTagBits) + ) + ); +} +impl Default for CK_AES_GCM_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_AES_GCM_PARAMS_PTR = *mut CK_AES_GCM_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_AES_CCM_PARAMS { + pub ulDataLen: CK_ULONG, + pub pNonce: CK_BYTE_PTR, + pub ulNonceLen: CK_ULONG, + pub pAAD: CK_BYTE_PTR, + 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::(), + 48usize, + concat!("Size of: ", stringify!(CK_AES_CCM_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + 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 }, + 16usize, + 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 }, + 24usize, + 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 }, + 32usize, + 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 }, + 40usize, + concat!( + "Offset of field: ", + stringify!(CK_AES_CCM_PARAMS), + "::", + stringify!(ulMACLen) + ) + ); +} +impl Default for CK_AES_CCM_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_AES_CCM_PARAMS_PTR = *mut CK_AES_CCM_PARAMS; +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +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::(), + 24usize, + concat!("Size of: ", stringify!(CK_CAMELLIA_CTR_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + concat!( + "Offset of field: ", + stringify!(CK_CAMELLIA_CTR_PARAMS), + "::", + stringify!(cb) + ) + ); +} +pub type CK_CAMELLIA_CTR_PARAMS_PTR = *mut CK_CAMELLIA_CTR_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_CAMELLIA_CBC_ENCRYPT_DATA_PARAMS { + pub iv: [CK_BYTE; 16usize], + 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::(), + 32usize, + concat!("Size of: ", stringify!(CK_CAMELLIA_CBC_ENCRYPT_DATA_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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) + ) + ); +} +impl Default for CK_CAMELLIA_CBC_ENCRYPT_DATA_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_CAMELLIA_CBC_ENCRYPT_DATA_PARAMS_PTR = *mut CK_CAMELLIA_CBC_ENCRYPT_DATA_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_ARIA_CBC_ENCRYPT_DATA_PARAMS { + pub iv: [CK_BYTE; 16usize], + 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::(), + 32usize, + concat!("Size of: ", stringify!(CK_ARIA_CBC_ENCRYPT_DATA_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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) + ) + ); +} +impl Default for CK_ARIA_CBC_ENCRYPT_DATA_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_ARIA_CBC_ENCRYPT_DATA_PARAMS_PTR = *mut CK_ARIA_CBC_ENCRYPT_DATA_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_DSA_PARAMETER_GEN_PARAM { + pub hash: CK_MECHANISM_TYPE, + pub pSeed: CK_BYTE_PTR, + 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::(), + 32usize, + concat!("Size of: ", stringify!(CK_DSA_PARAMETER_GEN_PARAM)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + 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 }, + 16usize, + 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 }, + 24usize, + concat!( + "Offset of field: ", + stringify!(CK_DSA_PARAMETER_GEN_PARAM), + "::", + stringify!(ulIndex) + ) + ); +} +impl Default for CK_DSA_PARAMETER_GEN_PARAM { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_DSA_PARAMETER_GEN_PARAM_PTR = *mut CK_DSA_PARAMETER_GEN_PARAM; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_ECDH_AES_KEY_WRAP_PARAMS { + pub ulAESKeyBits: CK_ULONG, + pub kdf: CK_EC_KDF_TYPE, + 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::(), + 32usize, + concat!("Size of: ", stringify!(CK_ECDH_AES_KEY_WRAP_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + 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 }, + 16usize, + 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 }, + 24usize, + concat!( + "Offset of field: ", + stringify!(CK_ECDH_AES_KEY_WRAP_PARAMS), + "::", + stringify!(pSharedData) + ) + ); +} +impl Default for CK_ECDH_AES_KEY_WRAP_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_ECDH_AES_KEY_WRAP_PARAMS_PTR = *mut CK_ECDH_AES_KEY_WRAP_PARAMS; +pub type CK_JAVA_MIDP_SECURITY_DOMAIN = CK_ULONG; +pub type CK_CERTIFICATE_CATEGORY = CK_ULONG; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +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::(), + 16usize, + concat!("Size of: ", stringify!(CK_RSA_AES_KEY_WRAP_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + concat!( + "Offset of field: ", + stringify!(CK_RSA_AES_KEY_WRAP_PARAMS), + "::", + stringify!(pOAEPParams) + ) + ); +} +impl Default for CK_RSA_AES_KEY_WRAP_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_RSA_AES_KEY_WRAP_PARAMS_PTR = *mut CK_RSA_AES_KEY_WRAP_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_TLS12_MASTER_KEY_DERIVE_PARAMS { + pub RandomInfo: CK_SSL3_RANDOM_DATA, + 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::(), + 48usize, + concat!("Size of: ", stringify!(CK_TLS12_MASTER_KEY_DERIVE_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 32usize, + 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 }, + 40usize, + concat!( + "Offset of field: ", + stringify!(CK_TLS12_MASTER_KEY_DERIVE_PARAMS), + "::", + stringify!(prfHashMechanism) + ) + ); +} +impl Default for CK_TLS12_MASTER_KEY_DERIVE_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_TLS12_MASTER_KEY_DERIVE_PARAMS_PTR = *mut CK_TLS12_MASTER_KEY_DERIVE_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_TLS12_KEY_MAT_PARAMS { + pub ulMacSizeInBits: CK_ULONG, + pub ulKeySizeInBits: CK_ULONG, + pub ulIVSizeInBits: CK_ULONG, + pub bIsExport: CK_BBOOL, + pub RandomInfo: CK_SSL3_RANDOM_DATA, + 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::(), + 80usize, + concat!("Size of: ", stringify!(CK_TLS12_KEY_MAT_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + 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 }, + 16usize, + 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 }, + 24usize, + 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 }, + 32usize, + 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 }, + 64usize, + 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 }, + 72usize, + concat!( + "Offset of field: ", + stringify!(CK_TLS12_KEY_MAT_PARAMS), + "::", + stringify!(prfHashMechanism) + ) + ); +} +impl Default for CK_TLS12_KEY_MAT_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_TLS12_KEY_MAT_PARAMS_PTR = *mut CK_TLS12_KEY_MAT_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_TLS_KDF_PARAMS { + pub prfMechanism: CK_MECHANISM_TYPE, + pub pLabel: CK_BYTE_PTR, + pub ulLabelLength: CK_ULONG, + pub RandomInfo: CK_SSL3_RANDOM_DATA, + 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::(), + 72usize, + concat!("Size of: ", stringify!(CK_TLS_KDF_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + 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 }, + 16usize, + 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 }, + 24usize, + 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 }, + 56usize, + 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 }, + 64usize, + concat!( + "Offset of field: ", + stringify!(CK_TLS_KDF_PARAMS), + "::", + stringify!(ulContextDataLength) + ) + ); +} +impl Default for CK_TLS_KDF_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_TLS_KDF_PARAMS_PTR = *mut CK_TLS_KDF_PARAMS; +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct CK_TLS_MAC_PARAMS { + pub prfHashMechanism: CK_MECHANISM_TYPE, + 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::(), + 24usize, + concat!("Size of: ", stringify!(CK_TLS_MAC_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + 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 }, + 16usize, + concat!( + "Offset of field: ", + stringify!(CK_TLS_MAC_PARAMS), + "::", + stringify!(ulServerOrClient) + ) + ); +} +pub type CK_TLS_MAC_PARAMS_PTR = *mut CK_TLS_MAC_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_GOSTR3410_DERIVE_PARAMS { + pub kdf: CK_EC_KDF_TYPE, + pub pPublicData: CK_BYTE_PTR, + pub ulPublicDataLen: CK_ULONG, + 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::(), + 40usize, + concat!("Size of: ", stringify!(CK_GOSTR3410_DERIVE_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + 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 }, + 16usize, + 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 }, + 24usize, + 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 }, + 32usize, + concat!( + "Offset of field: ", + stringify!(CK_GOSTR3410_DERIVE_PARAMS), + "::", + stringify!(ulUKMLen) + ) + ); +} +impl Default for CK_GOSTR3410_DERIVE_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_GOSTR3410_DERIVE_PARAMS_PTR = *mut CK_GOSTR3410_DERIVE_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_GOSTR3410_KEY_WRAP_PARAMS { + pub pWrapOID: CK_BYTE_PTR, + pub ulWrapOIDLen: CK_ULONG, + pub pUKM: CK_BYTE_PTR, + 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::(), + 40usize, + concat!("Size of: ", stringify!(CK_GOSTR3410_KEY_WRAP_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 16usize, + 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 }, + 24usize, + 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 }, + 32usize, + concat!( + "Offset of field: ", + stringify!(CK_GOSTR3410_KEY_WRAP_PARAMS), + "::", + stringify!(hKey) + ) + ); +} +impl Default for CK_GOSTR3410_KEY_WRAP_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_GOSTR3410_KEY_WRAP_PARAMS_PTR = *mut CK_GOSTR3410_KEY_WRAP_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_SEED_CBC_ENCRYPT_DATA_PARAMS { + pub iv: [CK_BYTE; 16usize], + 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::(), + 32usize, + concat!("Size of: ", stringify!(CK_SEED_CBC_ENCRYPT_DATA_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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) + ) + ); +} +impl Default for CK_SEED_CBC_ENCRYPT_DATA_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_SEED_CBC_ENCRYPT_DATA_PARAMS_PTR = *mut CK_SEED_CBC_ENCRYPT_DATA_PARAMS; +pub type CK_PROFILE_ID = CK_ULONG; +pub type CK_PRF_DATA_TYPE = CK_ULONG; +pub type CK_SP800_108_PRF_TYPE = CK_MECHANISM_TYPE; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_PRF_DATA_PARAM { + pub type_: CK_PRF_DATA_TYPE, + 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::(), + 24usize, + concat!("Size of: ", stringify!(CK_PRF_DATA_PARAM)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + 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 }, + 16usize, + concat!( + "Offset of field: ", + stringify!(CK_PRF_DATA_PARAM), + "::", + stringify!(ulValueLen) + ) + ); +} +impl Default for CK_PRF_DATA_PARAM { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_PRF_DATA_PARAM_PTR = *mut CK_PRF_DATA_PARAM; +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +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::(), + 16usize, + concat!("Size of: ", stringify!(CK_SP800_108_COUNTER_FORMAT)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + concat!( + "Offset of field: ", + stringify!(CK_SP800_108_COUNTER_FORMAT), + "::", + stringify!(ulWidthInBits) + ) + ); +} +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)] +#[derive(Debug, Default, Copy, Clone)] +pub struct CK_SP800_108_DKM_LENGTH_FORMAT { + pub dkmLengthMethod: CK_SP800_108_DKM_LENGTH_METHOD, + 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::(), + 24usize, + concat!("Size of: ", stringify!(CK_SP800_108_DKM_LENGTH_FORMAT)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + 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 }, + 16usize, + concat!( + "Offset of field: ", + stringify!(CK_SP800_108_DKM_LENGTH_FORMAT), + "::", + stringify!(ulWidthInBits) + ) + ); +} +pub type CK_SP800_108_DKM_LENGTH_FORMAT_PTR = *mut CK_SP800_108_DKM_LENGTH_FORMAT; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_DERIVED_KEY { + pub pTemplate: CK_ATTRIBUTE_PTR, + 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::(), + 24usize, + concat!("Size of: ", stringify!(CK_DERIVED_KEY)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 16usize, + concat!( + "Offset of field: ", + stringify!(CK_DERIVED_KEY), + "::", + stringify!(phKey) + ) + ); +} +impl Default for CK_DERIVED_KEY { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_DERIVED_KEY_PTR = *mut CK_DERIVED_KEY; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_SP800_108_KDF_PARAMS { + pub prfType: CK_SP800_108_PRF_TYPE, + pub ulNumberOfDataParams: CK_ULONG, + pub pDataParams: CK_PRF_DATA_PARAM_PTR, + pub ulAdditionalDerivedKeys: CK_ULONG, + pub pAdditionalDerivedKeys: CK_DERIVED_KEY, +} +#[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::(), + 56usize, + concat!("Size of: ", stringify!(CK_SP800_108_KDF_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + 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 }, + 16usize, + 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 }, + 24usize, + 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 }, + 32usize, + concat!( + "Offset of field: ", + stringify!(CK_SP800_108_KDF_PARAMS), + "::", + stringify!(pAdditionalDerivedKeys) + ) + ); +} +impl Default for CK_SP800_108_KDF_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_SP800_108_KDF_PARAMS_PTR = *mut CK_SP800_108_KDF_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_SP800_108_FEEDBACK_KDF_PARAMS { + pub prfType: CK_SP800_108_PRF_TYPE, + pub ulNumberOfDataParams: CK_ULONG, + pub pDataParams: CK_PRF_DATA_PARAM_PTR, + pub ulIVLen: CK_ULONG, + pub pIV: CK_BYTE_PTR, + pub ulAdditionalDerivedKeys: CK_ULONG, + pub pAdditionalDerivedKeys: CK_DERIVED_KEY, +} +#[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::(), + 72usize, + concat!("Size of: ", stringify!(CK_SP800_108_FEEDBACK_KDF_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + 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 }, + 16usize, + 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 }, + 24usize, + 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 }, + 32usize, + 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 }, + 40usize, + 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 }, + 48usize, + concat!( + "Offset of field: ", + stringify!(CK_SP800_108_FEEDBACK_KDF_PARAMS), + "::", + stringify!(pAdditionalDerivedKeys) + ) + ); +} +impl Default for CK_SP800_108_FEEDBACK_KDF_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_SP800_108_FEEDBACK_KDF_PARAMS_PTR = *mut CK_SP800_108_FEEDBACK_KDF_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_EDDSA_PARAMS { + pub phFlag: CK_BBOOL, + 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::(), + 24usize, + concat!("Size of: ", stringify!(CK_EDDSA_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + concat!( + "Offset of field: ", + stringify!(CK_EDDSA_PARAMS), + "::", + stringify!(ulContextDataLen) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pContextData) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(CK_EDDSA_PARAMS), + "::", + stringify!(pContextData) + ) + ); +} +impl Default for CK_EDDSA_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_EDDSA_PARAMS_PTR = *mut CK_EDDSA_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_CHACHA20_PARAMS { + pub pBlockCounter: CK_BYTE_PTR, + pub blockCounterBits: CK_ULONG, + 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::(), + 32usize, + concat!("Size of: ", stringify!(CK_CHACHA20_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 16usize, + concat!( + "Offset of field: ", + stringify!(CK_CHACHA20_PARAMS), + "::", + stringify!(pNonce) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ulNonceBits) as usize - ptr as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(CK_CHACHA20_PARAMS), + "::", + stringify!(ulNonceBits) + ) + ); +} +impl Default for CK_CHACHA20_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_SALSA20_PARAMS { + pub pBlockCounter: CK_BYTE_PTR, + 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::(), + 24usize, + concat!("Size of: ", stringify!(CK_SALSA20_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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) + ) + ); +} +impl Default for CK_SALSA20_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_SALSA20_CHACHA20_POLY1305_PARAMS { + pub pNonce: CK_BYTE_PTR, + pub ulNonceLen: CK_ULONG, + 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::(), + 32usize, + concat!("Size of: ", stringify!(CK_SALSA20_CHACHA20_POLY1305_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 16usize, + 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 }, + 24usize, + concat!( + "Offset of field: ", + stringify!(CK_SALSA20_CHACHA20_POLY1305_PARAMS), + "::", + stringify!(ulAADLen) + ) + ); +} +impl Default for CK_SALSA20_CHACHA20_POLY1305_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_SALSA20_CHACHA20_POLY1305_PARAMS_PTR = *mut CK_SALSA20_CHACHA20_POLY1305_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_SALSA20_CHACHA20_POLY1305_MSG_PARAMS { + pub pNonce: CK_BYTE_PTR, + 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::(), + 24usize, + concat!( + "Size of: ", + stringify!(CK_SALSA20_CHACHA20_POLY1305_MSG_PARAMS) + ) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 16usize, + concat!( + "Offset of field: ", + stringify!(CK_SALSA20_CHACHA20_POLY1305_MSG_PARAMS), + "::", + stringify!(pTag) + ) + ); +} +impl Default for CK_SALSA20_CHACHA20_POLY1305_MSG_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_SALSA20_CHACHA20_POLY1305_MSG_PARAMS_PTR = *mut CK_SALSA20_CHACHA20_POLY1305_MSG_PARAMS; +pub type CK_X3DH_KDF_TYPE = CK_ULONG; +pub type CK_X3DH_KDF_TYPE_PTR = *mut CK_X3DH_KDF_TYPE; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_X3DH_INITIATE_PARAMS { + pub kdf: CK_X3DH_KDF_TYPE, + pub pPeer_identity: CK_OBJECT_HANDLE, + pub pPeer_prekey: CK_OBJECT_HANDLE, + pub pPrekey_signature: CK_BYTE_PTR, + pub pOnetime_key: CK_BYTE_PTR, + 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::(), + 56usize, + concat!("Size of: ", stringify!(CK_X3DH_INITIATE_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + 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 }, + 16usize, + 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 }, + 24usize, + 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 }, + 32usize, + 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 }, + 40usize, + 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 }, + 48usize, + concat!( + "Offset of field: ", + stringify!(CK_X3DH_INITIATE_PARAMS), + "::", + stringify!(pOwn_ephemeral) + ) + ); +} +impl Default for CK_X3DH_INITIATE_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_X3DH_RESPOND_PARAMS { + pub kdf: CK_X3DH_KDF_TYPE, + pub pIdentity_id: CK_BYTE_PTR, + pub pPrekey_id: CK_BYTE_PTR, + pub pOnetime_id: CK_BYTE_PTR, + 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::(), + 48usize, + concat!("Size of: ", stringify!(CK_X3DH_RESPOND_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + 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 }, + 16usize, + 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 }, + 24usize, + 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 }, + 32usize, + 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 }, + 40usize, + concat!( + "Offset of field: ", + stringify!(CK_X3DH_RESPOND_PARAMS), + "::", + stringify!(pInitiator_ephemeral) + ) + ); +} +impl Default for CK_X3DH_RESPOND_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_X2RATCHET_KDF_TYPE = CK_ULONG; +pub type CK_X2RATCHET_KDF_TYPE_PTR = *mut CK_X2RATCHET_KDF_TYPE; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_X2RATCHET_INITIALIZE_PARAMS { + pub sk: CK_BYTE_PTR, + pub peer_public_prekey: CK_OBJECT_HANDLE, + pub peer_public_identity: CK_OBJECT_HANDLE, + pub own_public_identity: CK_OBJECT_HANDLE, + pub bEncryptedHeader: CK_BBOOL, + pub eCurve: CK_ULONG, + 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::(), + 64usize, + concat!("Size of: ", stringify!(CK_X2RATCHET_INITIALIZE_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 16usize, + 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 }, + 24usize, + 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 }, + 32usize, + 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 }, + 40usize, + 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 }, + 48usize, + 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 }, + 56usize, + concat!( + "Offset of field: ", + stringify!(CK_X2RATCHET_INITIALIZE_PARAMS), + "::", + stringify!(kdfMechanism) + ) + ); +} +impl Default for CK_X2RATCHET_INITIALIZE_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_X2RATCHET_INITIALIZE_PARAMS_PTR = *mut CK_X2RATCHET_INITIALIZE_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_X2RATCHET_RESPOND_PARAMS { + pub sk: CK_BYTE_PTR, + pub own_prekey: CK_OBJECT_HANDLE, + pub initiator_identity: CK_OBJECT_HANDLE, + pub own_public_identity: CK_OBJECT_HANDLE, + pub bEncryptedHeader: CK_BBOOL, + pub eCurve: CK_ULONG, + 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::(), + 64usize, + concat!("Size of: ", stringify!(CK_X2RATCHET_RESPOND_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 16usize, + 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 }, + 24usize, + 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 }, + 32usize, + 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 }, + 40usize, + 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 }, + 48usize, + 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 }, + 56usize, + concat!( + "Offset of field: ", + stringify!(CK_X2RATCHET_RESPOND_PARAMS), + "::", + stringify!(kdfMechanism) + ) + ); +} +impl Default for CK_X2RATCHET_RESPOND_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_X2RATCHET_RESPOND_PARAMS_PTR = *mut CK_X2RATCHET_RESPOND_PARAMS; +pub type CK_XEDDSA_HASH_TYPE = CK_ULONG; +pub type CK_XEDDSA_HASH_TYPE_PTR = *mut CK_XEDDSA_HASH_TYPE; +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +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::(), + 8usize, + concat!("Size of: ", stringify!(CK_XEDDSA_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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) + ) + ); +} +pub type CK_XEDDSA_PARAMS_PTR = *mut CK_XEDDSA_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_HKDF_PARAMS { + pub bExtract: CK_BBOOL, + pub bExpand: CK_BBOOL, + pub prfHashMechanism: CK_MECHANISM_TYPE, + pub ulSaltType: CK_ULONG, + pub pSalt: CK_BYTE_PTR, + pub ulSaltLen: CK_ULONG, + pub hSaltKey: CK_ULONG, + 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::(), + 64usize, + concat!("Size of: ", stringify!(CK_HKDF_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + concat!( + "Offset of field: ", + stringify!(CK_HKDF_PARAMS), + "::", + stringify!(prfHashMechanism) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ulSaltType) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(CK_HKDF_PARAMS), + "::", + stringify!(ulSaltType) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pSalt) as usize - ptr as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(CK_HKDF_PARAMS), + "::", + stringify!(pSalt) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ulSaltLen) as usize - ptr as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(CK_HKDF_PARAMS), + "::", + stringify!(ulSaltLen) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).hSaltKey) as usize - ptr as usize }, + 40usize, + concat!( + "Offset of field: ", + stringify!(CK_HKDF_PARAMS), + "::", + stringify!(hSaltKey) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pInfo) as usize - ptr as usize }, + 48usize, + concat!( + "Offset of field: ", + stringify!(CK_HKDF_PARAMS), + "::", + stringify!(pInfo) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ulInfoLen) as usize - ptr as usize }, + 56usize, + concat!( + "Offset of field: ", + stringify!(CK_HKDF_PARAMS), + "::", + stringify!(ulInfoLen) + ) + ); +} +impl Default for CK_HKDF_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_C_Initialize = + ::std::option::Option CK_RV>; +pub type CK_C_Finalize = + ::std::option::Option CK_RV>; +pub type CK_C_GetInfo = ::std::option::Option CK_RV>; +pub type CK_C_GetFunctionList = + ::std::option::Option CK_RV>; +pub type CK_C_GetSlotList = ::std::option::Option< unsafe extern "C" fn( - flags: CK_FLAGS, - slot: *mut CK_SLOT_ID, - pReserved: *mut ::std::os::raw::c_void, + tokenPresent: CK_BBOOL, + pSlotList: CK_SLOT_ID_PTR, + pulCount: CK_ULONG_PTR, ) -> CK_RV, >; +pub type CK_C_GetSlotInfo = ::std::option::Option< + unsafe extern "C" fn(slotID: CK_SLOT_ID, pInfo: CK_SLOT_INFO_PTR) -> CK_RV, +>; +pub type CK_C_GetTokenInfo = ::std::option::Option< + unsafe extern "C" fn(slotID: CK_SLOT_ID, pInfo: CK_TOKEN_INFO_PTR) -> CK_RV, +>; pub type CK_C_GetMechanismList = ::std::option::Option< unsafe extern "C" fn( slotID: CK_SLOT_ID, - mechanism_list: *mut CK_MECHANISM_TYPE, - ulCount: *mut ::std::os::raw::c_ulong, + pMechanismList: CK_MECHANISM_TYPE_PTR, + pulCount: CK_ULONG_PTR, ) -> CK_RV, >; pub type CK_C_GetMechanismInfo = ::std::option::Option< unsafe extern "C" fn( slotID: CK_SLOT_ID, type_: CK_MECHANISM_TYPE, - info: *mut _CK_MECHANISM_INFO, + pInfo: CK_MECHANISM_INFO_PTR, ) -> CK_RV, >; pub type CK_C_InitToken = ::std::option::Option< unsafe extern "C" fn( slotID: CK_SLOT_ID, - pin: *mut ::std::os::raw::c_uchar, - pin_len: ::std::os::raw::c_ulong, - label: *mut ::std::os::raw::c_uchar, + pPin: CK_UTF8CHAR_PTR, + ulPinLen: CK_ULONG, + pLabel: CK_UTF8CHAR_PTR, ) -> CK_RV, >; pub type CK_C_InitPIN = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - pin: *mut ::std::os::raw::c_uchar, - pin_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pPin: CK_UTF8CHAR_PTR, + ulPinLen: CK_ULONG, ) -> CK_RV, >; pub type CK_C_SetPIN = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - old_pin: *mut ::std::os::raw::c_uchar, - old_len: ::std::os::raw::c_ulong, - new_pin: *mut ::std::os::raw::c_uchar, - new_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pOldPin: CK_UTF8CHAR_PTR, + ulOldLen: CK_ULONG, + pNewPin: CK_UTF8CHAR_PTR, + ulNewLen: CK_ULONG, ) -> CK_RV, >; pub type CK_C_OpenSession = ::std::option::Option< unsafe extern "C" fn( slotID: CK_SLOT_ID, flags: CK_FLAGS, - application: *mut ::std::os::raw::c_void, - notify: CK_NOTIFY, - session: *mut CK_SESSION_HANDLE, + pApplication: CK_VOID_PTR, + Notify: CK_NOTIFY, + phSession: CK_SESSION_HANDLE_PTR, ) -> CK_RV, >; pub type CK_C_CloseSession = - ::std::option::Option CK_RV>; + ::std::option::Option CK_RV>; pub type CK_C_CloseAllSessions = ::std::option::Option CK_RV>; pub type CK_C_GetSessionInfo = ::std::option::Option< - unsafe extern "C" fn(session: CK_SESSION_HANDLE, info: *mut _CK_SESSION_INFO) -> CK_RV, + unsafe extern "C" fn(hSession: CK_SESSION_HANDLE, pInfo: CK_SESSION_INFO_PTR) -> CK_RV, >; pub type CK_C_GetOperationState = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - operation_state: *mut ::std::os::raw::c_uchar, - operation_state_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pOperationState: CK_BYTE_PTR, + pulOperationStateLen: CK_ULONG_PTR, ) -> CK_RV, >; pub type CK_C_SetOperationState = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - operation_state: *mut ::std::os::raw::c_uchar, - operation_state_len: ::std::os::raw::c_ulong, - encryption_key: CK_OBJECT_HANDLE, - authentiation_key: CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pOperationState: CK_BYTE_PTR, + ulOperationStateLen: CK_ULONG, + hEncryptionKey: CK_OBJECT_HANDLE, + hAuthenticationKey: CK_OBJECT_HANDLE, ) -> CK_RV, >; pub type CK_C_Login = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - user_type: CK_USER_TYPE, - pin: *mut ::std::os::raw::c_uchar, - pin_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + userType: CK_USER_TYPE, + pPin: CK_UTF8CHAR_PTR, + ulPinLen: CK_ULONG, ) -> CK_RV, >; pub type CK_C_Logout = - ::std::option::Option CK_RV>; + ::std::option::Option CK_RV>; pub type CK_C_CreateObject = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - templ: *mut _CK_ATTRIBUTE, - ulCount: ::std::os::raw::c_ulong, - object: *mut CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pTemplate: CK_ATTRIBUTE_PTR, + ulCount: CK_ULONG, + phObject: CK_OBJECT_HANDLE_PTR, ) -> CK_RV, >; pub type CK_C_CopyObject = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - object: CK_OBJECT_HANDLE, - templ: *mut _CK_ATTRIBUTE, - ulCount: ::std::os::raw::c_ulong, - new_object: *mut CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + hObject: CK_OBJECT_HANDLE, + pTemplate: CK_ATTRIBUTE_PTR, + ulCount: CK_ULONG, + phNewObject: CK_OBJECT_HANDLE_PTR, ) -> CK_RV, >; pub type CK_C_DestroyObject = ::std::option::Option< - unsafe extern "C" fn(session: CK_SESSION_HANDLE, object: CK_OBJECT_HANDLE) -> CK_RV, + unsafe extern "C" fn(hSession: CK_SESSION_HANDLE, hObject: CK_OBJECT_HANDLE) -> CK_RV, >; pub type CK_C_GetObjectSize = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - object: CK_OBJECT_HANDLE, - size: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + hObject: CK_OBJECT_HANDLE, + pulSize: CK_ULONG_PTR, ) -> CK_RV, >; pub type CK_C_GetAttributeValue = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - object: CK_OBJECT_HANDLE, - templ: *mut _CK_ATTRIBUTE, - ulCount: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + hObject: CK_OBJECT_HANDLE, + pTemplate: CK_ATTRIBUTE_PTR, + ulCount: CK_ULONG, ) -> CK_RV, >; pub type CK_C_SetAttributeValue = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - object: CK_OBJECT_HANDLE, - templ: *mut _CK_ATTRIBUTE, - ulCount: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + hObject: CK_OBJECT_HANDLE, + pTemplate: CK_ATTRIBUTE_PTR, + ulCount: CK_ULONG, ) -> CK_RV, >; pub type CK_C_FindObjectsInit = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - templ: *mut _CK_ATTRIBUTE, - ulCount: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pTemplate: CK_ATTRIBUTE_PTR, + ulCount: CK_ULONG, ) -> CK_RV, >; pub type CK_C_FindObjects = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - object: *mut CK_OBJECT_HANDLE, - max_object_count: ::std::os::raw::c_ulong, - object_count: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + phObject: CK_OBJECT_HANDLE_PTR, + ulMaxObjectCount: CK_ULONG, + pulObjectCount: CK_ULONG_PTR, ) -> CK_RV, >; pub type CK_C_FindObjectsFinal = - ::std::option::Option CK_RV>; + ::std::option::Option CK_RV>; pub type CK_C_EncryptInit = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - key: CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, ) -> CK_RV, >; pub type CK_C_Encrypt = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - data: *mut ::std::os::raw::c_uchar, - data_len: ::std::os::raw::c_ulong, - encrypted_data: *mut ::std::os::raw::c_uchar, - encrypted_data_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pEncryptedData: CK_BYTE_PTR, + pulEncryptedDataLen: CK_ULONG_PTR, ) -> CK_RV, >; pub type CK_C_EncryptUpdate = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - part: *mut ::std::os::raw::c_uchar, - part_len: ::std::os::raw::c_ulong, - encrypted_part: *mut ::std::os::raw::c_uchar, - encrypted_part_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pPart: CK_BYTE_PTR, + ulPartLen: CK_ULONG, + pEncryptedPart: CK_BYTE_PTR, + pulEncryptedPartLen: CK_ULONG_PTR, ) -> CK_RV, >; pub type CK_C_EncryptFinal = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - last_encrypted_part: *mut ::std::os::raw::c_uchar, - last_encrypted_part_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pLastEncryptedPart: CK_BYTE_PTR, + pulLastEncryptedPartLen: CK_ULONG_PTR, ) -> CK_RV, >; pub type CK_C_DecryptInit = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - key: CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, ) -> CK_RV, >; pub type CK_C_Decrypt = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - encrypted_data: *mut ::std::os::raw::c_uchar, - encrypted_data_len: ::std::os::raw::c_ulong, - data: *mut ::std::os::raw::c_uchar, - data_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pEncryptedData: CK_BYTE_PTR, + ulEncryptedDataLen: CK_ULONG, + pData: CK_BYTE_PTR, + pulDataLen: CK_ULONG_PTR, ) -> CK_RV, >; pub type CK_C_DecryptUpdate = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - encrypted_part: *mut ::std::os::raw::c_uchar, - encrypted_part_len: ::std::os::raw::c_ulong, - part: *mut ::std::os::raw::c_uchar, - part_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pEncryptedPart: CK_BYTE_PTR, + ulEncryptedPartLen: CK_ULONG, + pPart: CK_BYTE_PTR, + pulPartLen: CK_ULONG_PTR, ) -> CK_RV, >; pub type CK_C_DecryptFinal = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - last_part: *mut ::std::os::raw::c_uchar, - last_part_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pLastPart: CK_BYTE_PTR, + pulLastPartLen: CK_ULONG_PTR, ) -> CK_RV, >; pub type CK_C_DigestInit = ::std::option::Option< - unsafe extern "C" fn(session: CK_SESSION_HANDLE, mechanism: *mut _CK_MECHANISM) -> CK_RV, + unsafe extern "C" fn(hSession: CK_SESSION_HANDLE, pMechanism: CK_MECHANISM_PTR) -> CK_RV, >; pub type CK_C_Digest = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - data: *mut ::std::os::raw::c_uchar, - data_len: ::std::os::raw::c_ulong, - digest: *mut ::std::os::raw::c_uchar, - digest_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pDigest: CK_BYTE_PTR, + pulDigestLen: CK_ULONG_PTR, ) -> CK_RV, >; pub type CK_C_DigestUpdate = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - part: *mut ::std::os::raw::c_uchar, - part_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pPart: CK_BYTE_PTR, + ulPartLen: CK_ULONG, ) -> CK_RV, >; pub type CK_C_DigestKey = ::std::option::Option< - unsafe extern "C" fn(session: CK_SESSION_HANDLE, key: CK_OBJECT_HANDLE) -> CK_RV, + unsafe extern "C" fn(hSession: CK_SESSION_HANDLE, hKey: CK_OBJECT_HANDLE) -> CK_RV, >; pub type CK_C_DigestFinal = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - digest: *mut ::std::os::raw::c_uchar, - digest_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pDigest: CK_BYTE_PTR, + pulDigestLen: CK_ULONG_PTR, ) -> CK_RV, >; pub type CK_C_SignInit = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - key: CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, ) -> CK_RV, >; pub type CK_C_Sign = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - data: *mut ::std::os::raw::c_uchar, - data_len: ::std::os::raw::c_ulong, - signature: *mut ::std::os::raw::c_uchar, - signature_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + pulSignatureLen: CK_ULONG_PTR, ) -> CK_RV, >; pub type CK_C_SignUpdate = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - part: *mut ::std::os::raw::c_uchar, - part_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pPart: CK_BYTE_PTR, + ulPartLen: CK_ULONG, ) -> CK_RV, >; pub type CK_C_SignFinal = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - signature: *mut ::std::os::raw::c_uchar, - signature_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pSignature: CK_BYTE_PTR, + pulSignatureLen: CK_ULONG_PTR, ) -> CK_RV, >; pub type CK_C_SignRecoverInit = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - key: CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, ) -> CK_RV, >; pub type CK_C_SignRecover = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - data: *mut ::std::os::raw::c_uchar, - data_len: ::std::os::raw::c_ulong, - signature: *mut ::std::os::raw::c_uchar, - signature_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + pulSignatureLen: CK_ULONG_PTR, ) -> CK_RV, >; pub type CK_C_VerifyInit = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - key: CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, ) -> CK_RV, >; pub type CK_C_Verify = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - data: *mut ::std::os::raw::c_uchar, - data_len: ::std::os::raw::c_ulong, - signature: *mut ::std::os::raw::c_uchar, - signature_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + ulSignatureLen: CK_ULONG, ) -> CK_RV, >; pub type CK_C_VerifyUpdate = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - part: *mut ::std::os::raw::c_uchar, - part_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pPart: CK_BYTE_PTR, + ulPartLen: CK_ULONG, ) -> CK_RV, >; pub type CK_C_VerifyFinal = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - signature: *mut ::std::os::raw::c_uchar, - signature_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pSignature: CK_BYTE_PTR, + ulSignatureLen: CK_ULONG, ) -> CK_RV, >; pub type CK_C_VerifyRecoverInit = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - key: CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, ) -> CK_RV, >; pub type CK_C_VerifyRecover = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - signature: *mut ::std::os::raw::c_uchar, - signature_len: ::std::os::raw::c_ulong, - data: *mut ::std::os::raw::c_uchar, - data_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pSignature: CK_BYTE_PTR, + ulSignatureLen: CK_ULONG, + pData: CK_BYTE_PTR, + pulDataLen: CK_ULONG_PTR, ) -> CK_RV, >; pub type CK_C_DigestEncryptUpdate = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - part: *mut ::std::os::raw::c_uchar, - part_len: ::std::os::raw::c_ulong, - encrypted_part: *mut ::std::os::raw::c_uchar, - encrypted_part_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pPart: CK_BYTE_PTR, + ulPartLen: CK_ULONG, + pEncryptedPart: CK_BYTE_PTR, + pulEncryptedPartLen: CK_ULONG_PTR, ) -> CK_RV, >; pub type CK_C_DecryptDigestUpdate = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - encrypted_part: *mut ::std::os::raw::c_uchar, - encrypted_part_len: ::std::os::raw::c_ulong, - part: *mut ::std::os::raw::c_uchar, - part_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pEncryptedPart: CK_BYTE_PTR, + ulEncryptedPartLen: CK_ULONG, + pPart: CK_BYTE_PTR, + pulPartLen: CK_ULONG_PTR, ) -> CK_RV, >; pub type CK_C_SignEncryptUpdate = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - part: *mut ::std::os::raw::c_uchar, - part_len: ::std::os::raw::c_ulong, - encrypted_part: *mut ::std::os::raw::c_uchar, - encrypted_part_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pPart: CK_BYTE_PTR, + ulPartLen: CK_ULONG, + pEncryptedPart: CK_BYTE_PTR, + pulEncryptedPartLen: CK_ULONG_PTR, ) -> CK_RV, >; pub type CK_C_DecryptVerifyUpdate = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - encrypted_part: *mut ::std::os::raw::c_uchar, - encrypted_part_len: ::std::os::raw::c_ulong, - part: *mut ::std::os::raw::c_uchar, - part_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pEncryptedPart: CK_BYTE_PTR, + ulEncryptedPartLen: CK_ULONG, + pPart: CK_BYTE_PTR, + pulPartLen: CK_ULONG_PTR, ) -> CK_RV, >; pub type CK_C_GenerateKey = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - templ: *mut _CK_ATTRIBUTE, - ulCount: ::std::os::raw::c_ulong, - key: *mut CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + pTemplate: CK_ATTRIBUTE_PTR, + ulCount: CK_ULONG, + phKey: CK_OBJECT_HANDLE_PTR, ) -> CK_RV, >; pub type CK_C_GenerateKeyPair = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - public_key_template: *mut _CK_ATTRIBUTE, - public_key_attribute_count: ::std::os::raw::c_ulong, - private_key_template: *mut _CK_ATTRIBUTE, - private_key_attribute_count: ::std::os::raw::c_ulong, - public_key: *mut CK_OBJECT_HANDLE, - private_key: *mut CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + pPublicKeyTemplate: CK_ATTRIBUTE_PTR, + ulPublicKeyAttributeCount: CK_ULONG, + pPrivateKeyTemplate: CK_ATTRIBUTE_PTR, + ulPrivateKeyAttributeCount: CK_ULONG, + phPublicKey: CK_OBJECT_HANDLE_PTR, + phPrivateKey: CK_OBJECT_HANDLE_PTR, ) -> CK_RV, >; pub type CK_C_WrapKey = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - wrapping_key: CK_OBJECT_HANDLE, - key: CK_OBJECT_HANDLE, - wrapped_key: *mut ::std::os::raw::c_uchar, - wrapped_key_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hWrappingKey: CK_OBJECT_HANDLE, + hKey: CK_OBJECT_HANDLE, + pWrappedKey: CK_BYTE_PTR, + pulWrappedKeyLen: CK_ULONG_PTR, ) -> CK_RV, >; pub type CK_C_UnwrapKey = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - unwrapping_key: CK_OBJECT_HANDLE, - wrapped_key: *mut ::std::os::raw::c_uchar, - wrapped_key_len: ::std::os::raw::c_ulong, - templ: *mut _CK_ATTRIBUTE, - attribute_count: ::std::os::raw::c_ulong, - key: *mut CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hUnwrappingKey: CK_OBJECT_HANDLE, + pWrappedKey: CK_BYTE_PTR, + ulWrappedKeyLen: CK_ULONG, + pTemplate: CK_ATTRIBUTE_PTR, + ulAttributeCount: CK_ULONG, + phKey: CK_OBJECT_HANDLE_PTR, ) -> CK_RV, >; pub type CK_C_DeriveKey = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - base_key: CK_OBJECT_HANDLE, - templ: *mut _CK_ATTRIBUTE, - attribute_count: ::std::os::raw::c_ulong, - key: *mut CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hBaseKey: CK_OBJECT_HANDLE, + pTemplate: CK_ATTRIBUTE_PTR, + ulAttributeCount: CK_ULONG, + phKey: CK_OBJECT_HANDLE_PTR, ) -> CK_RV, >; pub type CK_C_SeedRandom = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - seed: *mut ::std::os::raw::c_uchar, - seed_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pSeed: CK_BYTE_PTR, + ulSeedLen: CK_ULONG, ) -> CK_RV, >; pub type CK_C_GenerateRandom = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - random_data: *mut ::std::os::raw::c_uchar, - random_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + RandomData: CK_BYTE_PTR, + ulRandomLen: CK_ULONG, ) -> CK_RV, >; pub type CK_C_GetFunctionStatus = - ::std::option::Option CK_RV>; + ::std::option::Option CK_RV>; pub type CK_C_CancelFunction = - ::std::option::Option CK_RV>; + ::std::option::Option CK_RV>; +pub type CK_C_WaitForSlotEvent = ::std::option::Option< + unsafe extern "C" fn(flags: CK_FLAGS, pSlot: CK_SLOT_ID_PTR, pRserved: CK_VOID_PTR) -> CK_RV, +>; +pub type CK_C_GetInterfaceList = ::std::option::Option< + unsafe extern "C" fn(pInterfacesList: CK_INTERFACE_PTR, pulCount: CK_ULONG_PTR) -> CK_RV, +>; +pub type CK_C_GetInterface = ::std::option::Option< + unsafe extern "C" fn( + pInterfaceName: CK_UTF8CHAR_PTR, + pVersion: CK_VERSION_PTR, + ppInterface: CK_INTERFACE_PTR_PTR, + flags: CK_FLAGS, + ) -> CK_RV, +>; +pub type CK_C_LoginUser = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + userType: CK_USER_TYPE, + pPin: CK_UTF8CHAR_PTR, + ulPinLen: CK_ULONG, + pUsername: CK_UTF8CHAR_PTR, + ulUsernameLen: CK_ULONG, + ) -> CK_RV, +>; +pub type CK_C_SessionCancel = ::std::option::Option< + unsafe extern "C" fn(hSession: CK_SESSION_HANDLE, flags: CK_FLAGS) -> CK_RV, +>; +pub type CK_C_MessageEncryptInit = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, + ) -> CK_RV, +>; +pub type CK_C_EncryptMessage = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pAssociatedData: CK_BYTE_PTR, + ulAssociatedDataLen: CK_ULONG, + pPlaintext: CK_BYTE_PTR, + ulPlaintextLen: CK_ULONG, + pCiphertext: CK_BYTE_PTR, + pulCiphertextLen: CK_ULONG_PTR, + ) -> CK_RV, +>; +pub type CK_C_EncryptMessageBegin = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pAssociatedData: CK_BYTE_PTR, + ulAssociatedDataLen: CK_ULONG, + ) -> CK_RV, +>; +pub type CK_C_EncryptMessageNext = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pPlaintextPart: CK_BYTE_PTR, + ulPlaintextPartLen: CK_ULONG, + pCiphertextPart: CK_BYTE_PTR, + pulCiphertextPartLen: CK_ULONG_PTR, + flags: CK_FLAGS, + ) -> CK_RV, +>; +pub type CK_C_MessageEncryptFinal = + ::std::option::Option CK_RV>; +pub type CK_C_MessageDecryptInit = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, + ) -> CK_RV, +>; +pub type CK_C_DecryptMessage = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pAssociatedData: CK_BYTE_PTR, + ulAssociatedDataLen: CK_ULONG, + pCiphertext: CK_BYTE_PTR, + ulCiphertextLen: CK_ULONG, + pPlaintext: CK_BYTE_PTR, + pulPlaintextLen: CK_ULONG_PTR, + ) -> CK_RV, +>; +pub type CK_C_DecryptMessageBegin = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pAssociatedData: CK_BYTE_PTR, + ulAssociatedDataLen: CK_ULONG, + ) -> CK_RV, +>; +pub type CK_C_DecryptMessageNext = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pCiphertext: CK_BYTE_PTR, + ulCiphertextLen: CK_ULONG, + pPlaintext: CK_BYTE_PTR, + pulPlaintextLen: CK_ULONG_PTR, + flags: CK_FLAGS, + ) -> CK_RV, +>; +pub type CK_C_MessageDecryptFinal = + ::std::option::Option CK_RV>; +pub type CK_C_MessageSignInit = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, + ) -> CK_RV, +>; +pub type CK_C_SignMessage = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + pulSignatureLen: CK_ULONG_PTR, + ) -> CK_RV, +>; +pub type CK_C_SignMessageBegin = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + ) -> CK_RV, +>; +pub type CK_C_SignMessageNext = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + pulSignatureLen: CK_ULONG_PTR, + ) -> CK_RV, +>; +pub type CK_C_MessageSignFinal = + ::std::option::Option CK_RV>; +pub type CK_C_MessageVerifyInit = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, + ) -> CK_RV, +>; +pub type CK_C_VerifyMessage = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + ulSignatureLen: CK_ULONG, + ) -> CK_RV, +>; +pub type CK_C_VerifyMessageBegin = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + ) -> CK_RV, +>; +pub type CK_C_VerifyMessageNext = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + ulSignatureLen: CK_ULONG, + ) -> CK_RV, +>; +pub type CK_C_MessageVerifyFinal = + ::std::option::Option CK_RV>; +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct CK_FUNCTION_LIST_3_0 { + pub version: CK_VERSION, + pub C_Initialize: CK_C_Initialize, + pub C_Finalize: CK_C_Finalize, + pub C_GetInfo: CK_C_GetInfo, + pub C_GetFunctionList: CK_C_GetFunctionList, + pub C_GetSlotList: CK_C_GetSlotList, + pub C_GetSlotInfo: CK_C_GetSlotInfo, + pub C_GetTokenInfo: CK_C_GetTokenInfo, + pub C_GetMechanismList: CK_C_GetMechanismList, + pub C_GetMechanismInfo: CK_C_GetMechanismInfo, + pub C_InitToken: CK_C_InitToken, + pub C_InitPIN: CK_C_InitPIN, + pub C_SetPIN: CK_C_SetPIN, + pub C_OpenSession: CK_C_OpenSession, + pub C_CloseSession: CK_C_CloseSession, + pub C_CloseAllSessions: CK_C_CloseAllSessions, + pub C_GetSessionInfo: CK_C_GetSessionInfo, + pub C_GetOperationState: CK_C_GetOperationState, + pub C_SetOperationState: CK_C_SetOperationState, + pub C_Login: CK_C_Login, + pub C_Logout: CK_C_Logout, + pub C_CreateObject: CK_C_CreateObject, + pub C_CopyObject: CK_C_CopyObject, + pub C_DestroyObject: CK_C_DestroyObject, + pub C_GetObjectSize: CK_C_GetObjectSize, + pub C_GetAttributeValue: CK_C_GetAttributeValue, + pub C_SetAttributeValue: CK_C_SetAttributeValue, + pub C_FindObjectsInit: CK_C_FindObjectsInit, + pub C_FindObjects: CK_C_FindObjects, + pub C_FindObjectsFinal: CK_C_FindObjectsFinal, + pub C_EncryptInit: CK_C_EncryptInit, + pub C_Encrypt: CK_C_Encrypt, + pub C_EncryptUpdate: CK_C_EncryptUpdate, + pub C_EncryptFinal: CK_C_EncryptFinal, + pub C_DecryptInit: CK_C_DecryptInit, + pub C_Decrypt: CK_C_Decrypt, + pub C_DecryptUpdate: CK_C_DecryptUpdate, + pub C_DecryptFinal: CK_C_DecryptFinal, + pub C_DigestInit: CK_C_DigestInit, + pub C_Digest: CK_C_Digest, + pub C_DigestUpdate: CK_C_DigestUpdate, + pub C_DigestKey: CK_C_DigestKey, + pub C_DigestFinal: CK_C_DigestFinal, + pub C_SignInit: CK_C_SignInit, + pub C_Sign: CK_C_Sign, + pub C_SignUpdate: CK_C_SignUpdate, + pub C_SignFinal: CK_C_SignFinal, + pub C_SignRecoverInit: CK_C_SignRecoverInit, + pub C_SignRecover: CK_C_SignRecover, + pub C_VerifyInit: CK_C_VerifyInit, + pub C_Verify: CK_C_Verify, + pub C_VerifyUpdate: CK_C_VerifyUpdate, + pub C_VerifyFinal: CK_C_VerifyFinal, + pub C_VerifyRecoverInit: CK_C_VerifyRecoverInit, + pub C_VerifyRecover: CK_C_VerifyRecover, + pub C_DigestEncryptUpdate: CK_C_DigestEncryptUpdate, + pub C_DecryptDigestUpdate: CK_C_DecryptDigestUpdate, + pub C_SignEncryptUpdate: CK_C_SignEncryptUpdate, + pub C_DecryptVerifyUpdate: CK_C_DecryptVerifyUpdate, + pub C_GenerateKey: CK_C_GenerateKey, + pub C_GenerateKeyPair: CK_C_GenerateKeyPair, + pub C_WrapKey: CK_C_WrapKey, + pub C_UnwrapKey: CK_C_UnwrapKey, + pub C_DeriveKey: CK_C_DeriveKey, + pub C_SeedRandom: CK_C_SeedRandom, + pub C_GenerateRandom: CK_C_GenerateRandom, + pub C_GetFunctionStatus: CK_C_GetFunctionStatus, + pub C_CancelFunction: CK_C_CancelFunction, + pub C_WaitForSlotEvent: CK_C_WaitForSlotEvent, + pub C_GetInterfaceList: CK_C_GetInterfaceList, + pub C_GetInterface: CK_C_GetInterface, + pub C_LoginUser: CK_C_LoginUser, + pub C_SessionCancel: CK_C_SessionCancel, + pub C_MessageEncryptInit: CK_C_MessageEncryptInit, + pub C_EncryptMessage: CK_C_EncryptMessage, + pub C_EncryptMessageBegin: CK_C_EncryptMessageBegin, + pub C_EncryptMessageNext: CK_C_EncryptMessageNext, + pub C_MessageEncryptFinal: CK_C_MessageEncryptFinal, + pub C_MessageDecryptInit: CK_C_MessageDecryptInit, + pub C_DecryptMessage: CK_C_DecryptMessage, + pub C_DecryptMessageBegin: CK_C_DecryptMessageBegin, + pub C_DecryptMessageNext: CK_C_DecryptMessageNext, + pub C_MessageDecryptFinal: CK_C_MessageDecryptFinal, + pub C_MessageSignInit: CK_C_MessageSignInit, + pub C_SignMessage: CK_C_SignMessage, + pub C_SignMessageBegin: CK_C_SignMessageBegin, + pub C_SignMessageNext: CK_C_SignMessageNext, + pub C_MessageSignFinal: CK_C_MessageSignFinal, + pub C_MessageVerifyInit: CK_C_MessageVerifyInit, + pub C_VerifyMessage: CK_C_VerifyMessage, + pub C_VerifyMessageBegin: CK_C_VerifyMessageBegin, + 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::(), + 744usize, + concat!("Size of: ", stringify!(CK_FUNCTION_LIST_3_0)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + 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 }, + 16usize, + 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 }, + 24usize, + 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 }, + 32usize, + 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 }, + 40usize, + 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 }, + 48usize, + 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 }, + 56usize, + 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 }, + 64usize, + 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 }, + 72usize, + 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 }, + 80usize, + 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 }, + 88usize, + 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 }, + 96usize, + 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 }, + 104usize, + 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 }, + 112usize, + 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 }, + 120usize, + 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 }, + 128usize, + 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 }, + 136usize, + 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 }, + 144usize, + 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 }, + 152usize, + 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 }, + 160usize, + 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 }, + 168usize, + 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 }, + 176usize, + 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 }, + 184usize, + 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 }, + 192usize, + 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 }, + 200usize, + 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 }, + 208usize, + 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 }, + 216usize, + 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 }, + 224usize, + 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 }, + 232usize, + 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 }, + 240usize, + 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 }, + 248usize, + 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 }, + 256usize, + 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 }, + 264usize, + 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 }, + 272usize, + 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 }, + 280usize, + 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 }, + 288usize, + 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 }, + 296usize, + 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 }, + 304usize, + 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 }, + 312usize, + 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 }, + 320usize, + 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 }, + 328usize, + 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 }, + 336usize, + 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 }, + 344usize, + 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 }, + 352usize, + 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 }, + 360usize, + 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 }, + 368usize, + 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 }, + 376usize, + 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 }, + 384usize, + 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 }, + 392usize, + 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 }, + 400usize, + 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 }, + 408usize, + 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 }, + 416usize, + 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 }, + 424usize, + 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 }, + 432usize, + 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 }, + 440usize, + 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 }, + 448usize, + 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 }, + 456usize, + 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 }, + 464usize, + 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 }, + 472usize, + 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 }, + 480usize, + 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 }, + 488usize, + 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 }, + 496usize, + 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 }, + 504usize, + 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 }, + 512usize, + 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 }, + 520usize, + 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 }, + 528usize, + 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 }, + 536usize, + 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 }, + 544usize, + 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 }, + 552usize, + 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 }, + 560usize, + 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 }, + 568usize, + 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 }, + 576usize, + 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 }, + 584usize, + 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 }, + 592usize, + 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 }, + 600usize, + 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 }, + 608usize, + 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 }, + 616usize, + 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 }, + 624usize, + 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 }, + 632usize, + 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 }, + 640usize, + 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 }, + 648usize, + 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 }, + 656usize, + 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 }, + 664usize, + 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 }, + 672usize, + 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 }, + 680usize, + 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 }, + 688usize, + 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 }, + 696usize, + 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 }, + 704usize, + 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 }, + 712usize, + 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 }, + 720usize, + 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 }, + 728usize, + 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 }, + 736usize, + concat!( + "Offset of field: ", + stringify!(CK_FUNCTION_LIST_3_0), + "::", + stringify!(C_MessageVerifyFinal) + ) + ); +} #[repr(C)] #[derive(Debug, Default, Copy, Clone)] -pub struct _CK_FUNCTION_LIST { - pub version: _CK_VERSION, +pub struct CK_FUNCTION_LIST { + pub version: CK_VERSION, pub C_Initialize: CK_C_Initialize, pub C_Finalize: CK_C_Finalize, pub C_GetInfo: CK_C_GetInfo, @@ -2647,25 +9810,25 @@ pub struct _CK_FUNCTION_LIST { pub C_WaitForSlotEvent: CK_C_WaitForSlotEvent, } #[test] -fn bindgen_test_layout__CK_FUNCTION_LIST() { - const UNINIT: ::std::mem::MaybeUninit<_CK_FUNCTION_LIST> = ::std::mem::MaybeUninit::uninit(); +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::<_CK_FUNCTION_LIST>(), + ::std::mem::size_of::(), 552usize, - concat!("Size of: ", stringify!(_CK_FUNCTION_LIST)) + concat!("Size of: ", stringify!(CK_FUNCTION_LIST)) ); assert_eq!( - ::std::mem::align_of::<_CK_FUNCTION_LIST>(), + ::std::mem::align_of::(), 8usize, - concat!("Alignment of ", stringify!(_CK_FUNCTION_LIST)) + 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!(CK_FUNCTION_LIST), "::", stringify!(version) ) @@ -2675,7 +9838,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 8usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_Initialize) ) @@ -2685,7 +9848,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 16usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_Finalize) ) @@ -2695,7 +9858,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 24usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_GetInfo) ) @@ -2705,7 +9868,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 32usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_GetFunctionList) ) @@ -2715,7 +9878,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 40usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_GetSlotList) ) @@ -2725,7 +9888,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 48usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_GetSlotInfo) ) @@ -2735,7 +9898,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 56usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_GetTokenInfo) ) @@ -2745,7 +9908,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 64usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_GetMechanismList) ) @@ -2755,7 +9918,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 72usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_GetMechanismInfo) ) @@ -2765,7 +9928,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 80usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_InitToken) ) @@ -2775,7 +9938,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 88usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_InitPIN) ) @@ -2785,7 +9948,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 96usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_SetPIN) ) @@ -2795,7 +9958,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 104usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_OpenSession) ) @@ -2805,7 +9968,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 112usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_CloseSession) ) @@ -2815,7 +9978,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 120usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_CloseAllSessions) ) @@ -2825,7 +9988,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 128usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_GetSessionInfo) ) @@ -2835,7 +9998,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 136usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_GetOperationState) ) @@ -2845,7 +10008,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 144usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_SetOperationState) ) @@ -2855,7 +10018,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 152usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_Login) ) @@ -2865,7 +10028,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 160usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_Logout) ) @@ -2875,7 +10038,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 168usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_CreateObject) ) @@ -2885,7 +10048,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 176usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_CopyObject) ) @@ -2895,7 +10058,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 184usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_DestroyObject) ) @@ -2905,7 +10068,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 192usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_GetObjectSize) ) @@ -2915,7 +10078,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 200usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_GetAttributeValue) ) @@ -2925,7 +10088,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 208usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_SetAttributeValue) ) @@ -2935,7 +10098,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 216usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_FindObjectsInit) ) @@ -2945,7 +10108,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 224usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_FindObjects) ) @@ -2955,7 +10118,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 232usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_FindObjectsFinal) ) @@ -2965,7 +10128,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 240usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_EncryptInit) ) @@ -2975,7 +10138,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 248usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_Encrypt) ) @@ -2985,7 +10148,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 256usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_EncryptUpdate) ) @@ -2995,7 +10158,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 264usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_EncryptFinal) ) @@ -3005,7 +10168,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 272usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_DecryptInit) ) @@ -3015,7 +10178,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 280usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_Decrypt) ) @@ -3025,7 +10188,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 288usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_DecryptUpdate) ) @@ -3035,7 +10198,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 296usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_DecryptFinal) ) @@ -3045,7 +10208,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 304usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_DigestInit) ) @@ -3055,7 +10218,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 312usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_Digest) ) @@ -3065,7 +10228,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 320usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_DigestUpdate) ) @@ -3075,7 +10238,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 328usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_DigestKey) ) @@ -3085,7 +10248,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 336usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_DigestFinal) ) @@ -3095,7 +10258,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 344usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_SignInit) ) @@ -3105,7 +10268,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 352usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_Sign) ) @@ -3115,7 +10278,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 360usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_SignUpdate) ) @@ -3125,7 +10288,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 368usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_SignFinal) ) @@ -3135,7 +10298,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 376usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_SignRecoverInit) ) @@ -3145,7 +10308,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 384usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_SignRecover) ) @@ -3155,7 +10318,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 392usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_VerifyInit) ) @@ -3165,7 +10328,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 400usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_Verify) ) @@ -3175,7 +10338,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 408usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_VerifyUpdate) ) @@ -3185,7 +10348,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 416usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_VerifyFinal) ) @@ -3195,7 +10358,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 424usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_VerifyRecoverInit) ) @@ -3205,7 +10368,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 432usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_VerifyRecover) ) @@ -3215,7 +10378,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 440usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_DigestEncryptUpdate) ) @@ -3225,7 +10388,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 448usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_DecryptDigestUpdate) ) @@ -3235,7 +10398,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 456usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_SignEncryptUpdate) ) @@ -3245,7 +10408,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 464usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_DecryptVerifyUpdate) ) @@ -3255,7 +10418,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 472usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_GenerateKey) ) @@ -3265,7 +10428,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 480usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_GenerateKeyPair) ) @@ -3275,7 +10438,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 488usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_WrapKey) ) @@ -3285,7 +10448,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 496usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_UnwrapKey) ) @@ -3295,7 +10458,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 504usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_DeriveKey) ) @@ -3305,7 +10468,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 512usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_SeedRandom) ) @@ -3315,7 +10478,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 520usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_GenerateRandom) ) @@ -3325,7 +10488,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 528usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_GetFunctionStatus) ) @@ -3335,7 +10498,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 536usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_CancelFunction) ) @@ -3345,223 +10508,45 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 544usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), - "::", - stringify!(C_WaitForSlotEvent) - ) - ); -} -pub type CK_CREATEMUTEX = - ::std::option::Option CK_RV>; -pub type CK_DESTROYMUTEX = - ::std::option::Option CK_RV>; -pub type CK_LOCKMUTEX = - ::std::option::Option CK_RV>; -pub type CK_UNLOCKMUTEX = - ::std::option::Option CK_RV>; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct _CK_C_INITIALIZE_ARGS { - pub CreateMutex: CK_CREATEMUTEX, - pub DestroyMutex: CK_DESTROYMUTEX, - pub LockMutex: CK_LOCKMUTEX, - pub UnlockMutex: CK_UNLOCKMUTEX, - pub flags: CK_FLAGS, - pub pReserved: *mut ::std::os::raw::c_void, -} -#[test] -fn bindgen_test_layout__CK_C_INITIALIZE_ARGS() { - const UNINIT: ::std::mem::MaybeUninit<_CK_C_INITIALIZE_ARGS> = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<_CK_C_INITIALIZE_ARGS>(), - 48usize, - concat!("Size of: ", stringify!(_CK_C_INITIALIZE_ARGS)) - ); - assert_eq!( - ::std::mem::align_of::<_CK_C_INITIALIZE_ARGS>(), - 8usize, - 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 }, - 40usize, - concat!( - "Offset of field: ", - stringify!(_CK_C_INITIALIZE_ARGS), + stringify!(CK_FUNCTION_LIST), "::", - stringify!(pReserved) - ) - ); -} -impl Default for _CK_C_INITIALIZE_ARGS { - fn default() -> Self { - let mut s = ::std::mem::MaybeUninit::::uninit(); - unsafe { - ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -pub type CK_BYTE = ::std::os::raw::c_uchar; -pub type CK_CHAR = ::std::os::raw::c_uchar; -pub type CK_UTF8CHAR = ::std::os::raw::c_uchar; -pub type CK_BBOOL = ::std::os::raw::c_uchar; -pub type CK_ULONG = ::std::os::raw::c_ulong; -pub type CK_LONG = ::std::os::raw::c_long; -pub type CK_BYTE_PTR = *mut CK_BYTE; -pub type CK_CHAR_PTR = *mut CK_CHAR; -pub type CK_UTF8CHAR_PTR = *mut CK_UTF8CHAR; -pub type CK_ULONG_PTR = *mut CK_ULONG; -pub type CK_VOID_PTR = *mut ::std::os::raw::c_void; -pub type CK_VOID_PTR_PTR = *mut *mut ::std::os::raw::c_void; -pub type CK_VERSION = _CK_VERSION; -pub type CK_VERSION_PTR = *mut _CK_VERSION; -pub type CK_INFO = _CK_INFO; -pub type CK_INFO_PTR = *mut _CK_INFO; -pub type CK_SLOT_ID_PTR = *mut CK_SLOT_ID; -pub type CK_SLOT_INFO = _CK_SLOT_INFO; -pub type CK_SLOT_INFO_PTR = *mut _CK_SLOT_INFO; -pub type CK_TOKEN_INFO = _CK_TOKEN_INFO; -pub type CK_TOKEN_INFO_PTR = *mut _CK_TOKEN_INFO; -pub type CK_SESSION_HANDLE_PTR = *mut CK_SESSION_HANDLE; -pub type CK_SESSION_INFO = _CK_SESSION_INFO; -pub type CK_SESSION_INFO_PTR = *mut _CK_SESSION_INFO; -pub type CK_OBJECT_HANDLE_PTR = *mut CK_OBJECT_HANDLE; -pub type CK_OBJECT_CLASS_PTR = *mut CK_OBJECT_CLASS; -pub type CK_ATTRIBUTE = _CK_ATTRIBUTE; -pub type CK_ATTRIBUTE_PTR = *mut _CK_ATTRIBUTE; -pub type CK_DATE = _CK_DATE; -pub type CK_DATE_PTR = *mut _CK_DATE; -pub type CK_MECHANISM_TYPE_PTR = *mut CK_MECHANISM_TYPE; -pub type CK_MECHANISM = _CK_MECHANISM; -pub type CK_MECHANISM_PTR = *mut _CK_MECHANISM; -pub type CK_MECHANISM_INFO = _CK_MECHANISM_INFO; -pub type CK_MECHANISM_INFO_PTR = *mut _CK_MECHANISM_INFO; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct ck_otp_mechanism_info { - _unused: [u8; 0], -} -pub type CK_OTP_MECHANISM_INFO = ck_otp_mechanism_info; -pub type CK_OTP_MECHANISM_INFO_PTR = *mut ck_otp_mechanism_info; -pub type CK_FUNCTION_LIST = _CK_FUNCTION_LIST; -pub type CK_FUNCTION_LIST_PTR = *mut _CK_FUNCTION_LIST; -pub type CK_FUNCTION_LIST_PTR_PTR = *mut *mut _CK_FUNCTION_LIST; -pub type CK_C_INITIALIZE_ARGS = _CK_C_INITIALIZE_ARGS; -pub type CK_C_INITIALIZE_ARGS_PTR = *mut _CK_C_INITIALIZE_ARGS; -pub type CK_RSA_PKCS_PSS_PARAMS = ck_rsa_pkcs_pss_params; -pub type CK_RSA_PKCS_PSS_PARAMS_PTR = *mut ck_rsa_pkcs_pss_params; -pub type CK_RSA_PKCS_OAEP_PARAMS = ck_rsa_pkcs_oaep_params; -pub type CK_RSA_PKCS_OAEP_PARAMS_PTR = *mut ck_rsa_pkcs_oaep_params; -pub type CK_AES_CTR_PARAMS = ck_aes_ctr_params; -pub type CK_AES_CTR_PARAMS_PTR = *mut ck_aes_ctr_params; -pub type CK_GCM_PARAMS = ck_gcm_params; -pub type CK_GCM_PARAMS_PTR = *mut ck_gcm_params; -pub type CK_ECDH1_DERIVE_PARAMS = ck_ecdh1_derive_params; -pub type CK_ECDH1_DERIVE_PARAMS_PTR = *mut ck_ecdh1_derive_params; -pub type CK_KEY_DERIVATION_STRING_DATA = ck_key_derivation_string_data; -pub type CK_KEY_DERIVATION_STRING_DATA_PTR = *mut ck_key_derivation_string_data; -pub type CK_DES_CBC_ENCRYPT_DATA_PARAMS = ck_des_cbc_encrypt_data_params; -pub type CK_DES_CBC_ENCRYPT_DATA_PARAMS_PTR = *mut ck_des_cbc_encrypt_data_params; -pub type CK_AES_CBC_ENCRYPT_DATA_PARAMS = ck_aes_cbc_encrypt_data_params; -pub type CK_AES_CBC_ENCRYPT_DATA_PARAMS_PTR = *mut ck_aes_cbc_encrypt_data_params; + stringify!(C_WaitForSlotEvent) + ) + ); +} extern crate libloading; pub struct Pkcs11 { __library: ::libloading::Library, - pub C_Initialize: Result< - unsafe extern "C" fn(init_args: *mut ::std::os::raw::c_void) -> CK_RV, - ::libloading::Error, - >, - pub C_Finalize: Result< - unsafe extern "C" fn(pReserved: *mut ::std::os::raw::c_void) -> CK_RV, - ::libloading::Error, - >, - pub C_GetInfo: Result CK_RV, ::libloading::Error>, + pub C_Initialize: + Result CK_RV, ::libloading::Error>, + pub C_Finalize: + Result CK_RV, ::libloading::Error>, + pub C_GetInfo: Result CK_RV, ::libloading::Error>, pub C_GetFunctionList: Result< - unsafe extern "C" fn(function_list: *mut *mut _CK_FUNCTION_LIST) -> CK_RV, + unsafe extern "C" fn(ppFunctionList: CK_FUNCTION_LIST_PTR_PTR) -> CK_RV, ::libloading::Error, >, pub C_GetSlotList: Result< unsafe extern "C" fn( - token_present: ::std::os::raw::c_uchar, - slot_list: *mut CK_SLOT_ID, - ulCount: *mut ::std::os::raw::c_ulong, + tokenPresent: CK_BBOOL, + pSlotList: CK_SLOT_ID_PTR, + pulCount: CK_ULONG_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_GetSlotInfo: Result< - unsafe extern "C" fn(slotID: CK_SLOT_ID, info: *mut _CK_SLOT_INFO) -> CK_RV, + unsafe extern "C" fn(slotID: CK_SLOT_ID, pInfo: CK_SLOT_INFO_PTR) -> CK_RV, ::libloading::Error, >, pub C_GetTokenInfo: Result< - unsafe extern "C" fn(slotID: CK_SLOT_ID, info: *mut _CK_TOKEN_INFO) -> CK_RV, - ::libloading::Error, - >, - pub C_WaitForSlotEvent: Result< - unsafe extern "C" fn( - flags: CK_FLAGS, - slot: *mut CK_SLOT_ID, - pReserved: *mut ::std::os::raw::c_void, - ) -> CK_RV, + unsafe extern "C" fn(slotID: CK_SLOT_ID, pInfo: CK_TOKEN_INFO_PTR) -> CK_RV, ::libloading::Error, >, pub C_GetMechanismList: Result< unsafe extern "C" fn( slotID: CK_SLOT_ID, - mechanism_list: *mut CK_MECHANISM_TYPE, - ulCount: *mut ::std::os::raw::c_ulong, + pMechanismList: CK_MECHANISM_TYPE_PTR, + pulCount: CK_ULONG_PTR, ) -> CK_RV, ::libloading::Error, >, @@ -3569,34 +10554,34 @@ pub struct Pkcs11 { unsafe extern "C" fn( slotID: CK_SLOT_ID, type_: CK_MECHANISM_TYPE, - info: *mut _CK_MECHANISM_INFO, + pInfo: CK_MECHANISM_INFO_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_InitToken: Result< unsafe extern "C" fn( slotID: CK_SLOT_ID, - pin: *mut ::std::os::raw::c_uchar, - pin_len: ::std::os::raw::c_ulong, - label: *mut ::std::os::raw::c_uchar, + pPin: CK_UTF8CHAR_PTR, + ulPinLen: CK_ULONG, + pLabel: CK_UTF8CHAR_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_InitPIN: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - pin: *mut ::std::os::raw::c_uchar, - pin_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pPin: CK_UTF8CHAR_PTR, + ulPinLen: CK_ULONG, ) -> CK_RV, ::libloading::Error, >, pub C_SetPIN: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - old_pin: *mut ::std::os::raw::c_uchar, - old_len: ::std::os::raw::c_ulong, - new_pin: *mut ::std::os::raw::c_uchar, - new_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pOldPin: CK_UTF8CHAR_PTR, + ulOldLen: CK_ULONG, + pNewPin: CK_UTF8CHAR_PTR, + ulNewLen: CK_ULONG, ) -> CK_RV, ::libloading::Error, >, @@ -3604,445 +10589,659 @@ pub struct Pkcs11 { unsafe extern "C" fn( slotID: CK_SLOT_ID, flags: CK_FLAGS, - application: *mut ::std::os::raw::c_void, - notify: CK_NOTIFY, - session: *mut CK_SESSION_HANDLE, + pApplication: CK_VOID_PTR, + Notify: CK_NOTIFY, + phSession: CK_SESSION_HANDLE_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_CloseSession: - Result CK_RV, ::libloading::Error>, + Result CK_RV, ::libloading::Error>, pub C_CloseAllSessions: Result CK_RV, ::libloading::Error>, pub C_GetSessionInfo: Result< - unsafe extern "C" fn(session: CK_SESSION_HANDLE, info: *mut _CK_SESSION_INFO) -> CK_RV, + unsafe extern "C" fn(hSession: CK_SESSION_HANDLE, pInfo: CK_SESSION_INFO_PTR) -> CK_RV, ::libloading::Error, >, pub C_GetOperationState: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - operation_state: *mut ::std::os::raw::c_uchar, - operation_state_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pOperationState: CK_BYTE_PTR, + pulOperationStateLen: CK_ULONG_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_SetOperationState: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - operation_state: *mut ::std::os::raw::c_uchar, - operation_state_len: ::std::os::raw::c_ulong, - encryption_key: CK_OBJECT_HANDLE, - authentiation_key: CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pOperationState: CK_BYTE_PTR, + ulOperationStateLen: CK_ULONG, + hEncryptionKey: CK_OBJECT_HANDLE, + hAuthenticationKey: CK_OBJECT_HANDLE, ) -> CK_RV, ::libloading::Error, >, pub C_Login: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - user_type: CK_USER_TYPE, - pin: *mut ::std::os::raw::c_uchar, - pin_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + userType: CK_USER_TYPE, + pPin: CK_UTF8CHAR_PTR, + ulPinLen: CK_ULONG, ) -> CK_RV, ::libloading::Error, >, pub C_Logout: - Result CK_RV, ::libloading::Error>, + Result CK_RV, ::libloading::Error>, pub C_CreateObject: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - templ: *mut _CK_ATTRIBUTE, - ulCount: ::std::os::raw::c_ulong, - object: *mut CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pTemplate: CK_ATTRIBUTE_PTR, + ulCount: CK_ULONG, + phObject: CK_OBJECT_HANDLE_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_CopyObject: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - object: CK_OBJECT_HANDLE, - templ: *mut _CK_ATTRIBUTE, - ulCount: ::std::os::raw::c_ulong, - new_object: *mut CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + hObject: CK_OBJECT_HANDLE, + pTemplate: CK_ATTRIBUTE_PTR, + ulCount: CK_ULONG, + phNewObject: CK_OBJECT_HANDLE_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_DestroyObject: Result< - unsafe extern "C" fn(session: CK_SESSION_HANDLE, object: CK_OBJECT_HANDLE) -> CK_RV, + unsafe extern "C" fn(hSession: CK_SESSION_HANDLE, hObject: CK_OBJECT_HANDLE) -> CK_RV, ::libloading::Error, >, pub C_GetObjectSize: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - object: CK_OBJECT_HANDLE, - size: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + hObject: CK_OBJECT_HANDLE, + pulSize: CK_ULONG_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_GetAttributeValue: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - object: CK_OBJECT_HANDLE, - templ: *mut _CK_ATTRIBUTE, - ulCount: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + hObject: CK_OBJECT_HANDLE, + pTemplate: CK_ATTRIBUTE_PTR, + ulCount: CK_ULONG, ) -> CK_RV, ::libloading::Error, >, pub C_SetAttributeValue: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - object: CK_OBJECT_HANDLE, - templ: *mut _CK_ATTRIBUTE, - ulCount: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + hObject: CK_OBJECT_HANDLE, + pTemplate: CK_ATTRIBUTE_PTR, + ulCount: CK_ULONG, ) -> CK_RV, ::libloading::Error, >, pub C_FindObjectsInit: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - templ: *mut _CK_ATTRIBUTE, - ulCount: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pTemplate: CK_ATTRIBUTE_PTR, + ulCount: CK_ULONG, ) -> CK_RV, ::libloading::Error, >, pub C_FindObjects: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - object: *mut CK_OBJECT_HANDLE, - max_object_count: ::std::os::raw::c_ulong, - object_count: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + phObject: CK_OBJECT_HANDLE_PTR, + ulMaxObjectCount: CK_ULONG, + pulObjectCount: CK_ULONG_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_FindObjectsFinal: - Result CK_RV, ::libloading::Error>, + Result CK_RV, ::libloading::Error>, pub C_EncryptInit: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - key: CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, ) -> CK_RV, ::libloading::Error, >, pub C_Encrypt: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - data: *mut ::std::os::raw::c_uchar, - data_len: ::std::os::raw::c_ulong, - encrypted_data: *mut ::std::os::raw::c_uchar, - encrypted_data_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pEncryptedData: CK_BYTE_PTR, + pulEncryptedDataLen: CK_ULONG_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_EncryptUpdate: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - part: *mut ::std::os::raw::c_uchar, - part_len: ::std::os::raw::c_ulong, - encrypted_part: *mut ::std::os::raw::c_uchar, - encrypted_part_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pPart: CK_BYTE_PTR, + ulPartLen: CK_ULONG, + pEncryptedPart: CK_BYTE_PTR, + pulEncryptedPartLen: CK_ULONG_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_EncryptFinal: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - last_encrypted_part: *mut ::std::os::raw::c_uchar, - last_encrypted_part_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pLastEncryptedPart: CK_BYTE_PTR, + pulLastEncryptedPartLen: CK_ULONG_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_DecryptInit: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - key: CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, ) -> CK_RV, ::libloading::Error, >, pub C_Decrypt: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - encrypted_data: *mut ::std::os::raw::c_uchar, - encrypted_data_len: ::std::os::raw::c_ulong, - data: *mut ::std::os::raw::c_uchar, - data_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pEncryptedData: CK_BYTE_PTR, + ulEncryptedDataLen: CK_ULONG, + pData: CK_BYTE_PTR, + pulDataLen: CK_ULONG_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_DecryptUpdate: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - encrypted_part: *mut ::std::os::raw::c_uchar, - encrypted_part_len: ::std::os::raw::c_ulong, - part: *mut ::std::os::raw::c_uchar, - part_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pEncryptedPart: CK_BYTE_PTR, + ulEncryptedPartLen: CK_ULONG, + pPart: CK_BYTE_PTR, + pulPartLen: CK_ULONG_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_DecryptFinal: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - last_part: *mut ::std::os::raw::c_uchar, - last_part_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pLastPart: CK_BYTE_PTR, + pulLastPartLen: CK_ULONG_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_DigestInit: Result< - unsafe extern "C" fn(session: CK_SESSION_HANDLE, mechanism: *mut _CK_MECHANISM) -> CK_RV, + unsafe extern "C" fn(hSession: CK_SESSION_HANDLE, pMechanism: CK_MECHANISM_PTR) -> CK_RV, ::libloading::Error, >, pub C_Digest: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - data: *mut ::std::os::raw::c_uchar, - data_len: ::std::os::raw::c_ulong, - digest: *mut ::std::os::raw::c_uchar, - digest_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pDigest: CK_BYTE_PTR, + pulDigestLen: CK_ULONG_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_DigestUpdate: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - part: *mut ::std::os::raw::c_uchar, - part_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pPart: CK_BYTE_PTR, + ulPartLen: CK_ULONG, ) -> CK_RV, ::libloading::Error, >, pub C_DigestKey: Result< - unsafe extern "C" fn(session: CK_SESSION_HANDLE, key: CK_OBJECT_HANDLE) -> CK_RV, + unsafe extern "C" fn(hSession: CK_SESSION_HANDLE, hKey: CK_OBJECT_HANDLE) -> CK_RV, ::libloading::Error, >, pub C_DigestFinal: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - digest: *mut ::std::os::raw::c_uchar, - digest_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pDigest: CK_BYTE_PTR, + pulDigestLen: CK_ULONG_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_SignInit: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - key: CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, ) -> CK_RV, ::libloading::Error, >, pub C_Sign: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - data: *mut ::std::os::raw::c_uchar, - data_len: ::std::os::raw::c_ulong, - signature: *mut ::std::os::raw::c_uchar, - signature_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + pulSignatureLen: CK_ULONG_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_SignUpdate: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - part: *mut ::std::os::raw::c_uchar, - part_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pPart: CK_BYTE_PTR, + ulPartLen: CK_ULONG, ) -> CK_RV, ::libloading::Error, >, pub C_SignFinal: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - signature: *mut ::std::os::raw::c_uchar, - signature_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pSignature: CK_BYTE_PTR, + pulSignatureLen: CK_ULONG_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_SignRecoverInit: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - key: CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, ) -> CK_RV, ::libloading::Error, >, pub C_SignRecover: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - data: *mut ::std::os::raw::c_uchar, - data_len: ::std::os::raw::c_ulong, - signature: *mut ::std::os::raw::c_uchar, - signature_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + pulSignatureLen: CK_ULONG_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_VerifyInit: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - key: CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, ) -> CK_RV, ::libloading::Error, >, pub C_Verify: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - data: *mut ::std::os::raw::c_uchar, - data_len: ::std::os::raw::c_ulong, - signature: *mut ::std::os::raw::c_uchar, - signature_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + ulSignatureLen: CK_ULONG, ) -> CK_RV, ::libloading::Error, >, pub C_VerifyUpdate: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - part: *mut ::std::os::raw::c_uchar, - part_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pPart: CK_BYTE_PTR, + ulPartLen: CK_ULONG, ) -> CK_RV, ::libloading::Error, >, pub C_VerifyFinal: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - signature: *mut ::std::os::raw::c_uchar, - signature_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pSignature: CK_BYTE_PTR, + ulSignatureLen: CK_ULONG, ) -> CK_RV, ::libloading::Error, >, pub C_VerifyRecoverInit: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - key: CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, ) -> CK_RV, ::libloading::Error, >, pub C_VerifyRecover: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - signature: *mut ::std::os::raw::c_uchar, - signature_len: ::std::os::raw::c_ulong, - data: *mut ::std::os::raw::c_uchar, - data_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pSignature: CK_BYTE_PTR, + ulSignatureLen: CK_ULONG, + pData: CK_BYTE_PTR, + pulDataLen: CK_ULONG_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_DigestEncryptUpdate: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - part: *mut ::std::os::raw::c_uchar, - part_len: ::std::os::raw::c_ulong, - encrypted_part: *mut ::std::os::raw::c_uchar, - encrypted_part_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pPart: CK_BYTE_PTR, + ulPartLen: CK_ULONG, + pEncryptedPart: CK_BYTE_PTR, + pulEncryptedPartLen: CK_ULONG_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_DecryptDigestUpdate: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - encrypted_part: *mut ::std::os::raw::c_uchar, - encrypted_part_len: ::std::os::raw::c_ulong, - part: *mut ::std::os::raw::c_uchar, - part_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pEncryptedPart: CK_BYTE_PTR, + ulEncryptedPartLen: CK_ULONG, + pPart: CK_BYTE_PTR, + pulPartLen: CK_ULONG_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_SignEncryptUpdate: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - part: *mut ::std::os::raw::c_uchar, - part_len: ::std::os::raw::c_ulong, - encrypted_part: *mut ::std::os::raw::c_uchar, - encrypted_part_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pPart: CK_BYTE_PTR, + ulPartLen: CK_ULONG, + pEncryptedPart: CK_BYTE_PTR, + pulEncryptedPartLen: CK_ULONG_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_DecryptVerifyUpdate: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - encrypted_part: *mut ::std::os::raw::c_uchar, - encrypted_part_len: ::std::os::raw::c_ulong, - part: *mut ::std::os::raw::c_uchar, - part_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pEncryptedPart: CK_BYTE_PTR, + ulEncryptedPartLen: CK_ULONG, + pPart: CK_BYTE_PTR, + pulPartLen: CK_ULONG_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_GenerateKey: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - templ: *mut _CK_ATTRIBUTE, - ulCount: ::std::os::raw::c_ulong, - key: *mut CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + pTemplate: CK_ATTRIBUTE_PTR, + ulCount: CK_ULONG, + phKey: CK_OBJECT_HANDLE_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_GenerateKeyPair: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - public_key_template: *mut _CK_ATTRIBUTE, - public_key_attribute_count: ::std::os::raw::c_ulong, - private_key_template: *mut _CK_ATTRIBUTE, - private_key_attribute_count: ::std::os::raw::c_ulong, - public_key: *mut CK_OBJECT_HANDLE, - private_key: *mut CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + pPublicKeyTemplate: CK_ATTRIBUTE_PTR, + ulPublicKeyAttributeCount: CK_ULONG, + pPrivateKeyTemplate: CK_ATTRIBUTE_PTR, + ulPrivateKeyAttributeCount: CK_ULONG, + phPublicKey: CK_OBJECT_HANDLE_PTR, + phPrivateKey: CK_OBJECT_HANDLE_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_WrapKey: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - wrapping_key: CK_OBJECT_HANDLE, - key: CK_OBJECT_HANDLE, - wrapped_key: *mut ::std::os::raw::c_uchar, - wrapped_key_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hWrappingKey: CK_OBJECT_HANDLE, + hKey: CK_OBJECT_HANDLE, + pWrappedKey: CK_BYTE_PTR, + pulWrappedKeyLen: CK_ULONG_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_UnwrapKey: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - unwrapping_key: CK_OBJECT_HANDLE, - wrapped_key: *mut ::std::os::raw::c_uchar, - wrapped_key_len: ::std::os::raw::c_ulong, - templ: *mut _CK_ATTRIBUTE, - attribute_count: ::std::os::raw::c_ulong, - key: *mut CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hUnwrappingKey: CK_OBJECT_HANDLE, + pWrappedKey: CK_BYTE_PTR, + ulWrappedKeyLen: CK_ULONG, + pTemplate: CK_ATTRIBUTE_PTR, + ulAttributeCount: CK_ULONG, + phKey: CK_OBJECT_HANDLE_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_DeriveKey: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - base_key: CK_OBJECT_HANDLE, - templ: *mut _CK_ATTRIBUTE, - attribute_count: ::std::os::raw::c_ulong, - key: *mut CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hBaseKey: CK_OBJECT_HANDLE, + pTemplate: CK_ATTRIBUTE_PTR, + ulAttributeCount: CK_ULONG, + phKey: CK_OBJECT_HANDLE_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_SeedRandom: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - seed: *mut ::std::os::raw::c_uchar, - seed_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pSeed: CK_BYTE_PTR, + ulSeedLen: CK_ULONG, ) -> CK_RV, ::libloading::Error, >, pub C_GenerateRandom: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - random_data: *mut ::std::os::raw::c_uchar, - random_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + RandomData: CK_BYTE_PTR, + ulRandomLen: CK_ULONG, ) -> CK_RV, ::libloading::Error, >, pub C_GetFunctionStatus: - Result CK_RV, ::libloading::Error>, + Result CK_RV, ::libloading::Error>, pub C_CancelFunction: - Result CK_RV, ::libloading::Error>, + Result CK_RV, ::libloading::Error>, + pub C_WaitForSlotEvent: Result< + unsafe extern "C" fn( + flags: CK_FLAGS, + pSlot: CK_SLOT_ID_PTR, + pRserved: CK_VOID_PTR, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_GetInterfaceList: Result< + unsafe extern "C" fn(pInterfacesList: CK_INTERFACE_PTR, pulCount: CK_ULONG_PTR) -> CK_RV, + ::libloading::Error, + >, + pub C_GetInterface: Result< + unsafe extern "C" fn( + pInterfaceName: CK_UTF8CHAR_PTR, + pVersion: CK_VERSION_PTR, + ppInterface: CK_INTERFACE_PTR_PTR, + flags: CK_FLAGS, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_LoginUser: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + userType: CK_USER_TYPE, + pPin: CK_UTF8CHAR_PTR, + ulPinLen: CK_ULONG, + pUsername: CK_UTF8CHAR_PTR, + ulUsernameLen: CK_ULONG, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_SessionCancel: Result< + unsafe extern "C" fn(hSession: CK_SESSION_HANDLE, flags: CK_FLAGS) -> CK_RV, + ::libloading::Error, + >, + pub C_MessageEncryptInit: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_EncryptMessage: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pAssociatedData: CK_BYTE_PTR, + ulAssociatedDataLen: CK_ULONG, + pPlaintext: CK_BYTE_PTR, + ulPlaintextLen: CK_ULONG, + pCiphertext: CK_BYTE_PTR, + pulCiphertextLen: CK_ULONG_PTR, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_EncryptMessageBegin: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pAssociatedData: CK_BYTE_PTR, + ulAssociatedDataLen: CK_ULONG, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_EncryptMessageNext: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pPlaintextPart: CK_BYTE_PTR, + ulPlaintextPartLen: CK_ULONG, + pCiphertextPart: CK_BYTE_PTR, + pulCiphertextPartLen: CK_ULONG_PTR, + flags: CK_FLAGS, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_MessageEncryptFinal: + Result CK_RV, ::libloading::Error>, + pub C_MessageDecryptInit: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_DecryptMessage: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pAssociatedData: CK_BYTE_PTR, + ulAssociatedDataLen: CK_ULONG, + pCiphertext: CK_BYTE_PTR, + ulCiphertextLen: CK_ULONG, + pPlaintext: CK_BYTE_PTR, + pulPlaintextLen: CK_ULONG_PTR, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_DecryptMessageBegin: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pAssociatedData: CK_BYTE_PTR, + ulAssociatedDataLen: CK_ULONG, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_DecryptMessageNext: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pCiphertext: CK_BYTE_PTR, + ulCiphertextLen: CK_ULONG, + pPlaintext: CK_BYTE_PTR, + pulPlaintextLen: CK_ULONG_PTR, + flags: CK_FLAGS, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_MessageDecryptFinal: + Result CK_RV, ::libloading::Error>, + pub C_MessageSignInit: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_SignMessage: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + pulSignatureLen: CK_ULONG_PTR, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_SignMessageBegin: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_SignMessageNext: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + pulSignatureLen: CK_ULONG_PTR, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_MessageSignFinal: + Result CK_RV, ::libloading::Error>, + pub C_MessageVerifyInit: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_VerifyMessage: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + ulSignatureLen: CK_ULONG, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_VerifyMessageBegin: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_VerifyMessageNext: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + ulSignatureLen: CK_ULONG, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_MessageVerifyFinal: + Result CK_RV, ::libloading::Error>, } impl Pkcs11 { pub unsafe fn new

(path: P) -> Result @@ -4064,7 +11263,6 @@ impl Pkcs11 { let C_GetSlotList = __library.get(b"C_GetSlotList\0").map(|sym| *sym); let C_GetSlotInfo = __library.get(b"C_GetSlotInfo\0").map(|sym| *sym); let C_GetTokenInfo = __library.get(b"C_GetTokenInfo\0").map(|sym| *sym); - let C_WaitForSlotEvent = __library.get(b"C_WaitForSlotEvent\0").map(|sym| *sym); let C_GetMechanismList = __library.get(b"C_GetMechanismList\0").map(|sym| *sym); let C_GetMechanismInfo = __library.get(b"C_GetMechanismInfo\0").map(|sym| *sym); let C_InitToken = __library.get(b"C_InitToken\0").map(|sym| *sym); @@ -4125,6 +11323,31 @@ impl Pkcs11 { let C_GenerateRandom = __library.get(b"C_GenerateRandom\0").map(|sym| *sym); let C_GetFunctionStatus = __library.get(b"C_GetFunctionStatus\0").map(|sym| *sym); let C_CancelFunction = __library.get(b"C_CancelFunction\0").map(|sym| *sym); + let C_WaitForSlotEvent = __library.get(b"C_WaitForSlotEvent\0").map(|sym| *sym); + let C_GetInterfaceList = __library.get(b"C_GetInterfaceList\0").map(|sym| *sym); + let C_GetInterface = __library.get(b"C_GetInterface\0").map(|sym| *sym); + let C_LoginUser = __library.get(b"C_LoginUser\0").map(|sym| *sym); + let C_SessionCancel = __library.get(b"C_SessionCancel\0").map(|sym| *sym); + let C_MessageEncryptInit = __library.get(b"C_MessageEncryptInit\0").map(|sym| *sym); + let C_EncryptMessage = __library.get(b"C_EncryptMessage\0").map(|sym| *sym); + let C_EncryptMessageBegin = __library.get(b"C_EncryptMessageBegin\0").map(|sym| *sym); + let C_EncryptMessageNext = __library.get(b"C_EncryptMessageNext\0").map(|sym| *sym); + let C_MessageEncryptFinal = __library.get(b"C_MessageEncryptFinal\0").map(|sym| *sym); + let C_MessageDecryptInit = __library.get(b"C_MessageDecryptInit\0").map(|sym| *sym); + let C_DecryptMessage = __library.get(b"C_DecryptMessage\0").map(|sym| *sym); + let C_DecryptMessageBegin = __library.get(b"C_DecryptMessageBegin\0").map(|sym| *sym); + let C_DecryptMessageNext = __library.get(b"C_DecryptMessageNext\0").map(|sym| *sym); + let C_MessageDecryptFinal = __library.get(b"C_MessageDecryptFinal\0").map(|sym| *sym); + let C_MessageSignInit = __library.get(b"C_MessageSignInit\0").map(|sym| *sym); + let C_SignMessage = __library.get(b"C_SignMessage\0").map(|sym| *sym); + let C_SignMessageBegin = __library.get(b"C_SignMessageBegin\0").map(|sym| *sym); + let C_SignMessageNext = __library.get(b"C_SignMessageNext\0").map(|sym| *sym); + let C_MessageSignFinal = __library.get(b"C_MessageSignFinal\0").map(|sym| *sym); + let C_MessageVerifyInit = __library.get(b"C_MessageVerifyInit\0").map(|sym| *sym); + let C_VerifyMessage = __library.get(b"C_VerifyMessage\0").map(|sym| *sym); + let C_VerifyMessageBegin = __library.get(b"C_VerifyMessageBegin\0").map(|sym| *sym); + let C_VerifyMessageNext = __library.get(b"C_VerifyMessageNext\0").map(|sym| *sym); + let C_MessageVerifyFinal = __library.get(b"C_MessageVerifyFinal\0").map(|sym| *sym); Ok(Pkcs11 { __library, C_Initialize, @@ -4134,7 +11357,6 @@ impl Pkcs11 { C_GetSlotList, C_GetSlotInfo, C_GetTokenInfo, - C_WaitForSlotEvent, C_GetMechanismList, C_GetMechanismInfo, C_InitToken, @@ -4195,146 +11417,164 @@ impl Pkcs11 { C_GenerateRandom, C_GetFunctionStatus, C_CancelFunction, + C_WaitForSlotEvent, + C_GetInterfaceList, + C_GetInterface, + C_LoginUser, + C_SessionCancel, + C_MessageEncryptInit, + C_EncryptMessage, + C_EncryptMessageBegin, + C_EncryptMessageNext, + C_MessageEncryptFinal, + C_MessageDecryptInit, + C_DecryptMessage, + C_DecryptMessageBegin, + C_DecryptMessageNext, + C_MessageDecryptFinal, + C_MessageSignInit, + C_SignMessage, + C_SignMessageBegin, + C_SignMessageNext, + C_MessageSignFinal, + C_MessageVerifyInit, + C_VerifyMessage, + C_VerifyMessageBegin, + C_VerifyMessageNext, + C_MessageVerifyFinal, }) } - pub unsafe fn C_Initialize(&self, init_args: *mut ::std::os::raw::c_void) -> CK_RV { + pub unsafe fn C_Initialize(&self, pInitArgs: CK_VOID_PTR) -> CK_RV { (self .C_Initialize .as_ref() - .expect("Expected function, got error."))(init_args) + .expect("Expected function, got error."))(pInitArgs) } - pub unsafe fn C_Finalize(&self, pReserved: *mut ::std::os::raw::c_void) -> CK_RV { + pub unsafe fn C_Finalize(&self, pReserved: CK_VOID_PTR) -> CK_RV { (self .C_Finalize .as_ref() .expect("Expected function, got error."))(pReserved) } - pub unsafe fn C_GetInfo(&self, info: *mut _CK_INFO) -> CK_RV { + pub unsafe fn C_GetInfo(&self, pInfo: CK_INFO_PTR) -> CK_RV { (self .C_GetInfo .as_ref() - .expect("Expected function, got error."))(info) + .expect("Expected function, got error."))(pInfo) } - pub unsafe fn C_GetFunctionList(&self, function_list: *mut *mut _CK_FUNCTION_LIST) -> CK_RV { + pub unsafe fn C_GetFunctionList(&self, ppFunctionList: CK_FUNCTION_LIST_PTR_PTR) -> CK_RV { (self .C_GetFunctionList .as_ref() - .expect("Expected function, got error."))(function_list) + .expect("Expected function, got error."))(ppFunctionList) } pub unsafe fn C_GetSlotList( &self, - token_present: ::std::os::raw::c_uchar, - slot_list: *mut CK_SLOT_ID, - ulCount: *mut ::std::os::raw::c_ulong, + tokenPresent: CK_BBOOL, + pSlotList: CK_SLOT_ID_PTR, + pulCount: CK_ULONG_PTR, ) -> CK_RV { (self .C_GetSlotList .as_ref() - .expect("Expected function, got error."))(token_present, slot_list, ulCount) + .expect("Expected function, got error."))(tokenPresent, pSlotList, pulCount) } - pub unsafe fn C_GetSlotInfo(&self, slotID: CK_SLOT_ID, info: *mut _CK_SLOT_INFO) -> CK_RV { + pub unsafe fn C_GetSlotInfo(&self, slotID: CK_SLOT_ID, pInfo: CK_SLOT_INFO_PTR) -> CK_RV { (self .C_GetSlotInfo .as_ref() - .expect("Expected function, got error."))(slotID, info) + .expect("Expected function, got error."))(slotID, pInfo) } - pub unsafe fn C_GetTokenInfo(&self, slotID: CK_SLOT_ID, info: *mut _CK_TOKEN_INFO) -> CK_RV { + pub unsafe fn C_GetTokenInfo(&self, slotID: CK_SLOT_ID, pInfo: CK_TOKEN_INFO_PTR) -> CK_RV { (self .C_GetTokenInfo .as_ref() - .expect("Expected function, got error."))(slotID, info) - } - pub unsafe fn C_WaitForSlotEvent( - &self, - flags: CK_FLAGS, - slot: *mut CK_SLOT_ID, - pReserved: *mut ::std::os::raw::c_void, - ) -> CK_RV { - (self - .C_WaitForSlotEvent - .as_ref() - .expect("Expected function, got error."))(flags, slot, pReserved) + .expect("Expected function, got error."))(slotID, pInfo) } pub unsafe fn C_GetMechanismList( &self, slotID: CK_SLOT_ID, - mechanism_list: *mut CK_MECHANISM_TYPE, - ulCount: *mut ::std::os::raw::c_ulong, + pMechanismList: CK_MECHANISM_TYPE_PTR, + pulCount: CK_ULONG_PTR, ) -> CK_RV { (self .C_GetMechanismList .as_ref() - .expect("Expected function, got error."))(slotID, mechanism_list, ulCount) + .expect("Expected function, got error."))(slotID, pMechanismList, pulCount) } pub unsafe fn C_GetMechanismInfo( &self, slotID: CK_SLOT_ID, type_: CK_MECHANISM_TYPE, - info: *mut _CK_MECHANISM_INFO, + pInfo: CK_MECHANISM_INFO_PTR, ) -> CK_RV { (self .C_GetMechanismInfo .as_ref() - .expect("Expected function, got error."))(slotID, type_, info) + .expect("Expected function, got error."))(slotID, type_, pInfo) } pub unsafe fn C_InitToken( &self, slotID: CK_SLOT_ID, - pin: *mut ::std::os::raw::c_uchar, - pin_len: ::std::os::raw::c_ulong, - label: *mut ::std::os::raw::c_uchar, + pPin: CK_UTF8CHAR_PTR, + ulPinLen: CK_ULONG, + pLabel: CK_UTF8CHAR_PTR, ) -> CK_RV { (self .C_InitToken .as_ref() - .expect("Expected function, got error."))(slotID, pin, pin_len, label) + .expect("Expected function, got error."))(slotID, pPin, ulPinLen, pLabel) } pub unsafe fn C_InitPIN( &self, - session: CK_SESSION_HANDLE, - pin: *mut ::std::os::raw::c_uchar, - pin_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pPin: CK_UTF8CHAR_PTR, + ulPinLen: CK_ULONG, ) -> CK_RV { (self .C_InitPIN .as_ref() - .expect("Expected function, got error."))(session, pin, pin_len) + .expect("Expected function, got error."))(hSession, pPin, ulPinLen) } pub unsafe fn C_SetPIN( &self, - session: CK_SESSION_HANDLE, - old_pin: *mut ::std::os::raw::c_uchar, - old_len: ::std::os::raw::c_ulong, - new_pin: *mut ::std::os::raw::c_uchar, - new_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pOldPin: CK_UTF8CHAR_PTR, + ulOldLen: CK_ULONG, + pNewPin: CK_UTF8CHAR_PTR, + ulNewLen: CK_ULONG, ) -> CK_RV { (self .C_SetPIN .as_ref() .expect("Expected function, got error."))( - session, old_pin, old_len, new_pin, new_len + hSession, pOldPin, ulOldLen, pNewPin, ulNewLen, ) } pub unsafe fn C_OpenSession( &self, slotID: CK_SLOT_ID, flags: CK_FLAGS, - application: *mut ::std::os::raw::c_void, - notify: CK_NOTIFY, - session: *mut CK_SESSION_HANDLE, + pApplication: CK_VOID_PTR, + Notify: CK_NOTIFY, + phSession: CK_SESSION_HANDLE_PTR, ) -> CK_RV { (self .C_OpenSession .as_ref() .expect("Expected function, got error."))( - slotID, flags, application, notify, session + slotID, + flags, + pApplication, + Notify, + phSession, ) } - pub unsafe fn C_CloseSession(&self, session: CK_SESSION_HANDLE) -> CK_RV { + pub unsafe fn C_CloseSession(&self, hSession: CK_SESSION_HANDLE) -> CK_RV { (self .C_CloseSession .as_ref() - .expect("Expected function, got error."))(session) + .expect("Expected function, got error."))(hSession) } pub unsafe fn C_CloseAllSessions(&self, slotID: CK_SLOT_ID) -> CK_RV { (self @@ -4344,723 +11584,1119 @@ impl Pkcs11 { } pub unsafe fn C_GetSessionInfo( &self, - session: CK_SESSION_HANDLE, - info: *mut _CK_SESSION_INFO, + hSession: CK_SESSION_HANDLE, + pInfo: CK_SESSION_INFO_PTR, ) -> CK_RV { (self .C_GetSessionInfo .as_ref() - .expect("Expected function, got error."))(session, info) + .expect("Expected function, got error."))(hSession, pInfo) } pub unsafe fn C_GetOperationState( &self, - session: CK_SESSION_HANDLE, - operation_state: *mut ::std::os::raw::c_uchar, - operation_state_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pOperationState: CK_BYTE_PTR, + pulOperationStateLen: CK_ULONG_PTR, ) -> CK_RV { (self .C_GetOperationState .as_ref() .expect("Expected function, got error."))( - session, operation_state, operation_state_len + hSession, + pOperationState, + pulOperationStateLen, ) } pub unsafe fn C_SetOperationState( &self, - session: CK_SESSION_HANDLE, - operation_state: *mut ::std::os::raw::c_uchar, - operation_state_len: ::std::os::raw::c_ulong, - encryption_key: CK_OBJECT_HANDLE, - authentiation_key: CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pOperationState: CK_BYTE_PTR, + ulOperationStateLen: CK_ULONG, + hEncryptionKey: CK_OBJECT_HANDLE, + hAuthenticationKey: CK_OBJECT_HANDLE, ) -> CK_RV { (self .C_SetOperationState .as_ref() .expect("Expected function, got error."))( - session, - operation_state, - operation_state_len, - encryption_key, - authentiation_key, + hSession, + pOperationState, + ulOperationStateLen, + hEncryptionKey, + hAuthenticationKey, ) } pub unsafe fn C_Login( &self, - session: CK_SESSION_HANDLE, - user_type: CK_USER_TYPE, - pin: *mut ::std::os::raw::c_uchar, - pin_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + userType: CK_USER_TYPE, + pPin: CK_UTF8CHAR_PTR, + ulPinLen: CK_ULONG, ) -> CK_RV { (self .C_Login .as_ref() - .expect("Expected function, got error."))(session, user_type, pin, pin_len) + .expect("Expected function, got error."))(hSession, userType, pPin, ulPinLen) } - pub unsafe fn C_Logout(&self, session: CK_SESSION_HANDLE) -> CK_RV { + pub unsafe fn C_Logout(&self, hSession: CK_SESSION_HANDLE) -> CK_RV { (self .C_Logout .as_ref() - .expect("Expected function, got error."))(session) + .expect("Expected function, got error."))(hSession) } pub unsafe fn C_CreateObject( &self, - session: CK_SESSION_HANDLE, - templ: *mut _CK_ATTRIBUTE, - ulCount: ::std::os::raw::c_ulong, - object: *mut CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pTemplate: CK_ATTRIBUTE_PTR, + ulCount: CK_ULONG, + phObject: CK_OBJECT_HANDLE_PTR, ) -> CK_RV { (self .C_CreateObject .as_ref() - .expect("Expected function, got error."))(session, templ, ulCount, object) + .expect("Expected function, got error."))(hSession, pTemplate, ulCount, phObject) } pub unsafe fn C_CopyObject( &self, - session: CK_SESSION_HANDLE, - object: CK_OBJECT_HANDLE, - templ: *mut _CK_ATTRIBUTE, - ulCount: ::std::os::raw::c_ulong, - new_object: *mut CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + hObject: CK_OBJECT_HANDLE, + pTemplate: CK_ATTRIBUTE_PTR, + ulCount: CK_ULONG, + phNewObject: CK_OBJECT_HANDLE_PTR, ) -> CK_RV { (self .C_CopyObject .as_ref() .expect("Expected function, got error."))( - session, object, templ, ulCount, new_object + hSession, + hObject, + pTemplate, + ulCount, + phNewObject, ) } pub unsafe fn C_DestroyObject( &self, - session: CK_SESSION_HANDLE, - object: CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + hObject: CK_OBJECT_HANDLE, ) -> CK_RV { (self .C_DestroyObject .as_ref() - .expect("Expected function, got error."))(session, object) + .expect("Expected function, got error."))(hSession, hObject) } pub unsafe fn C_GetObjectSize( &self, - session: CK_SESSION_HANDLE, - object: CK_OBJECT_HANDLE, - size: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + hObject: CK_OBJECT_HANDLE, + pulSize: CK_ULONG_PTR, ) -> CK_RV { (self .C_GetObjectSize .as_ref() - .expect("Expected function, got error."))(session, object, size) + .expect("Expected function, got error."))(hSession, hObject, pulSize) } pub unsafe fn C_GetAttributeValue( &self, - session: CK_SESSION_HANDLE, - object: CK_OBJECT_HANDLE, - templ: *mut _CK_ATTRIBUTE, - ulCount: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + hObject: CK_OBJECT_HANDLE, + pTemplate: CK_ATTRIBUTE_PTR, + ulCount: CK_ULONG, ) -> CK_RV { (self .C_GetAttributeValue .as_ref() - .expect("Expected function, got error."))(session, object, templ, ulCount) + .expect("Expected function, got error."))(hSession, hObject, pTemplate, ulCount) } pub unsafe fn C_SetAttributeValue( &self, - session: CK_SESSION_HANDLE, - object: CK_OBJECT_HANDLE, - templ: *mut _CK_ATTRIBUTE, - ulCount: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + hObject: CK_OBJECT_HANDLE, + pTemplate: CK_ATTRIBUTE_PTR, + ulCount: CK_ULONG, ) -> CK_RV { (self .C_SetAttributeValue .as_ref() - .expect("Expected function, got error."))(session, object, templ, ulCount) + .expect("Expected function, got error."))(hSession, hObject, pTemplate, ulCount) } pub unsafe fn C_FindObjectsInit( &self, - session: CK_SESSION_HANDLE, - templ: *mut _CK_ATTRIBUTE, - ulCount: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pTemplate: CK_ATTRIBUTE_PTR, + ulCount: CK_ULONG, ) -> CK_RV { (self .C_FindObjectsInit .as_ref() - .expect("Expected function, got error."))(session, templ, ulCount) + .expect("Expected function, got error."))(hSession, pTemplate, ulCount) } pub unsafe fn C_FindObjects( &self, - session: CK_SESSION_HANDLE, - object: *mut CK_OBJECT_HANDLE, - max_object_count: ::std::os::raw::c_ulong, - object_count: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + phObject: CK_OBJECT_HANDLE_PTR, + ulMaxObjectCount: CK_ULONG, + pulObjectCount: CK_ULONG_PTR, ) -> CK_RV { (self .C_FindObjects .as_ref() .expect("Expected function, got error."))( - session, - object, - max_object_count, - object_count, + hSession, + phObject, + ulMaxObjectCount, + pulObjectCount, ) } - pub unsafe fn C_FindObjectsFinal(&self, session: CK_SESSION_HANDLE) -> CK_RV { + pub unsafe fn C_FindObjectsFinal(&self, hSession: CK_SESSION_HANDLE) -> CK_RV { (self .C_FindObjectsFinal .as_ref() - .expect("Expected function, got error."))(session) + .expect("Expected function, got error."))(hSession) } pub unsafe fn C_EncryptInit( &self, - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - key: CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, ) -> CK_RV { (self .C_EncryptInit .as_ref() - .expect("Expected function, got error."))(session, mechanism, key) + .expect("Expected function, got error."))(hSession, pMechanism, hKey) } pub unsafe fn C_Encrypt( &self, - session: CK_SESSION_HANDLE, - data: *mut ::std::os::raw::c_uchar, - data_len: ::std::os::raw::c_ulong, - encrypted_data: *mut ::std::os::raw::c_uchar, - encrypted_data_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pEncryptedData: CK_BYTE_PTR, + pulEncryptedDataLen: CK_ULONG_PTR, ) -> CK_RV { (self .C_Encrypt .as_ref() .expect("Expected function, got error."))( - session, - data, - data_len, - encrypted_data, - encrypted_data_len, + hSession, + pData, + ulDataLen, + pEncryptedData, + pulEncryptedDataLen, ) } pub unsafe fn C_EncryptUpdate( &self, - session: CK_SESSION_HANDLE, - part: *mut ::std::os::raw::c_uchar, - part_len: ::std::os::raw::c_ulong, - encrypted_part: *mut ::std::os::raw::c_uchar, - encrypted_part_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pPart: CK_BYTE_PTR, + ulPartLen: CK_ULONG, + pEncryptedPart: CK_BYTE_PTR, + pulEncryptedPartLen: CK_ULONG_PTR, ) -> CK_RV { (self .C_EncryptUpdate .as_ref() .expect("Expected function, got error."))( - session, - part, - part_len, - encrypted_part, - encrypted_part_len, + hSession, + pPart, + ulPartLen, + pEncryptedPart, + pulEncryptedPartLen, ) } pub unsafe fn C_EncryptFinal( &self, - session: CK_SESSION_HANDLE, - last_encrypted_part: *mut ::std::os::raw::c_uchar, - last_encrypted_part_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pLastEncryptedPart: CK_BYTE_PTR, + pulLastEncryptedPartLen: CK_ULONG_PTR, ) -> CK_RV { (self .C_EncryptFinal .as_ref() .expect("Expected function, got error."))( - session, - last_encrypted_part, - last_encrypted_part_len, + hSession, + pLastEncryptedPart, + pulLastEncryptedPartLen, ) } pub unsafe fn C_DecryptInit( &self, - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - key: CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, ) -> CK_RV { (self .C_DecryptInit .as_ref() - .expect("Expected function, got error."))(session, mechanism, key) + .expect("Expected function, got error."))(hSession, pMechanism, hKey) } pub unsafe fn C_Decrypt( &self, - session: CK_SESSION_HANDLE, - encrypted_data: *mut ::std::os::raw::c_uchar, - encrypted_data_len: ::std::os::raw::c_ulong, - data: *mut ::std::os::raw::c_uchar, - data_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pEncryptedData: CK_BYTE_PTR, + ulEncryptedDataLen: CK_ULONG, + pData: CK_BYTE_PTR, + pulDataLen: CK_ULONG_PTR, ) -> CK_RV { (self .C_Decrypt .as_ref() .expect("Expected function, got error."))( - session, - encrypted_data, - encrypted_data_len, - data, - data_len, + hSession, + pEncryptedData, + ulEncryptedDataLen, + pData, + pulDataLen, ) } pub unsafe fn C_DecryptUpdate( &self, - session: CK_SESSION_HANDLE, - encrypted_part: *mut ::std::os::raw::c_uchar, - encrypted_part_len: ::std::os::raw::c_ulong, - part: *mut ::std::os::raw::c_uchar, - part_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pEncryptedPart: CK_BYTE_PTR, + ulEncryptedPartLen: CK_ULONG, + pPart: CK_BYTE_PTR, + pulPartLen: CK_ULONG_PTR, ) -> CK_RV { (self .C_DecryptUpdate .as_ref() .expect("Expected function, got error."))( - session, - encrypted_part, - encrypted_part_len, - part, - part_len, + hSession, + pEncryptedPart, + ulEncryptedPartLen, + pPart, + pulPartLen, ) } pub unsafe fn C_DecryptFinal( &self, - session: CK_SESSION_HANDLE, - last_part: *mut ::std::os::raw::c_uchar, - last_part_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pLastPart: CK_BYTE_PTR, + pulLastPartLen: CK_ULONG_PTR, ) -> CK_RV { (self .C_DecryptFinal .as_ref() - .expect("Expected function, got error."))(session, last_part, last_part_len) + .expect("Expected function, got error."))(hSession, pLastPart, pulLastPartLen) } pub unsafe fn C_DigestInit( &self, - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, ) -> CK_RV { (self .C_DigestInit .as_ref() - .expect("Expected function, got error."))(session, mechanism) + .expect("Expected function, got error."))(hSession, pMechanism) } pub unsafe fn C_Digest( &self, - session: CK_SESSION_HANDLE, - data: *mut ::std::os::raw::c_uchar, - data_len: ::std::os::raw::c_ulong, - digest: *mut ::std::os::raw::c_uchar, - digest_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pDigest: CK_BYTE_PTR, + pulDigestLen: CK_ULONG_PTR, ) -> CK_RV { (self .C_Digest .as_ref() .expect("Expected function, got error."))( - session, data, data_len, digest, digest_len + hSession, + pData, + ulDataLen, + pDigest, + pulDigestLen, ) } pub unsafe fn C_DigestUpdate( &self, - session: CK_SESSION_HANDLE, - part: *mut ::std::os::raw::c_uchar, - part_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pPart: CK_BYTE_PTR, + ulPartLen: CK_ULONG, ) -> CK_RV { (self .C_DigestUpdate .as_ref() - .expect("Expected function, got error."))(session, part, part_len) + .expect("Expected function, got error."))(hSession, pPart, ulPartLen) } - pub unsafe fn C_DigestKey(&self, session: CK_SESSION_HANDLE, key: CK_OBJECT_HANDLE) -> CK_RV { + pub unsafe fn C_DigestKey(&self, hSession: CK_SESSION_HANDLE, hKey: CK_OBJECT_HANDLE) -> CK_RV { (self .C_DigestKey .as_ref() - .expect("Expected function, got error."))(session, key) + .expect("Expected function, got error."))(hSession, hKey) } pub unsafe fn C_DigestFinal( &self, - session: CK_SESSION_HANDLE, - digest: *mut ::std::os::raw::c_uchar, - digest_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pDigest: CK_BYTE_PTR, + pulDigestLen: CK_ULONG_PTR, ) -> CK_RV { (self .C_DigestFinal .as_ref() - .expect("Expected function, got error."))(session, digest, digest_len) + .expect("Expected function, got error."))(hSession, pDigest, pulDigestLen) } pub unsafe fn C_SignInit( &self, - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - key: CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, ) -> CK_RV { (self .C_SignInit .as_ref() - .expect("Expected function, got error."))(session, mechanism, key) + .expect("Expected function, got error."))(hSession, pMechanism, hKey) } pub unsafe fn C_Sign( &self, - session: CK_SESSION_HANDLE, - data: *mut ::std::os::raw::c_uchar, - data_len: ::std::os::raw::c_ulong, - signature: *mut ::std::os::raw::c_uchar, - signature_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + pulSignatureLen: CK_ULONG_PTR, ) -> CK_RV { (self.C_Sign.as_ref().expect("Expected function, got error."))( - session, - data, - data_len, - signature, - signature_len, + hSession, + pData, + ulDataLen, + pSignature, + pulSignatureLen, ) } pub unsafe fn C_SignUpdate( &self, - session: CK_SESSION_HANDLE, - part: *mut ::std::os::raw::c_uchar, - part_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pPart: CK_BYTE_PTR, + ulPartLen: CK_ULONG, ) -> CK_RV { (self .C_SignUpdate .as_ref() - .expect("Expected function, got error."))(session, part, part_len) + .expect("Expected function, got error."))(hSession, pPart, ulPartLen) } pub unsafe fn C_SignFinal( &self, - session: CK_SESSION_HANDLE, - signature: *mut ::std::os::raw::c_uchar, - signature_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pSignature: CK_BYTE_PTR, + pulSignatureLen: CK_ULONG_PTR, ) -> CK_RV { (self .C_SignFinal .as_ref() - .expect("Expected function, got error."))(session, signature, signature_len) + .expect("Expected function, got error."))(hSession, pSignature, pulSignatureLen) } pub unsafe fn C_SignRecoverInit( &self, - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - key: CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, ) -> CK_RV { (self .C_SignRecoverInit .as_ref() - .expect("Expected function, got error."))(session, mechanism, key) + .expect("Expected function, got error."))(hSession, pMechanism, hKey) } pub unsafe fn C_SignRecover( &self, - session: CK_SESSION_HANDLE, - data: *mut ::std::os::raw::c_uchar, - data_len: ::std::os::raw::c_ulong, - signature: *mut ::std::os::raw::c_uchar, - signature_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + pulSignatureLen: CK_ULONG_PTR, ) -> CK_RV { (self .C_SignRecover .as_ref() .expect("Expected function, got error."))( - session, - data, - data_len, - signature, - signature_len, + hSession, + pData, + ulDataLen, + pSignature, + pulSignatureLen, ) } pub unsafe fn C_VerifyInit( &self, - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - key: CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, ) -> CK_RV { (self .C_VerifyInit .as_ref() - .expect("Expected function, got error."))(session, mechanism, key) + .expect("Expected function, got error."))(hSession, pMechanism, hKey) } pub unsafe fn C_Verify( &self, - session: CK_SESSION_HANDLE, - data: *mut ::std::os::raw::c_uchar, - data_len: ::std::os::raw::c_ulong, - signature: *mut ::std::os::raw::c_uchar, - signature_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + ulSignatureLen: CK_ULONG, ) -> CK_RV { (self .C_Verify .as_ref() .expect("Expected function, got error."))( - session, - data, - data_len, - signature, - signature_len, + hSession, + pData, + ulDataLen, + pSignature, + ulSignatureLen, ) } pub unsafe fn C_VerifyUpdate( &self, - session: CK_SESSION_HANDLE, - part: *mut ::std::os::raw::c_uchar, - part_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pPart: CK_BYTE_PTR, + ulPartLen: CK_ULONG, ) -> CK_RV { (self .C_VerifyUpdate .as_ref() - .expect("Expected function, got error."))(session, part, part_len) + .expect("Expected function, got error."))(hSession, pPart, ulPartLen) } pub unsafe fn C_VerifyFinal( &self, - session: CK_SESSION_HANDLE, - signature: *mut ::std::os::raw::c_uchar, - signature_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pSignature: CK_BYTE_PTR, + ulSignatureLen: CK_ULONG, ) -> CK_RV { (self .C_VerifyFinal .as_ref() - .expect("Expected function, got error."))(session, signature, signature_len) + .expect("Expected function, got error."))(hSession, pSignature, ulSignatureLen) } pub unsafe fn C_VerifyRecoverInit( &self, - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - key: CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, ) -> CK_RV { (self .C_VerifyRecoverInit .as_ref() - .expect("Expected function, got error."))(session, mechanism, key) + .expect("Expected function, got error."))(hSession, pMechanism, hKey) } pub unsafe fn C_VerifyRecover( &self, - session: CK_SESSION_HANDLE, - signature: *mut ::std::os::raw::c_uchar, - signature_len: ::std::os::raw::c_ulong, - data: *mut ::std::os::raw::c_uchar, - data_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pSignature: CK_BYTE_PTR, + ulSignatureLen: CK_ULONG, + pData: CK_BYTE_PTR, + pulDataLen: CK_ULONG_PTR, ) -> CK_RV { (self .C_VerifyRecover .as_ref() .expect("Expected function, got error."))( - session, - signature, - signature_len, - data, - data_len, + hSession, + pSignature, + ulSignatureLen, + pData, + pulDataLen, ) } pub unsafe fn C_DigestEncryptUpdate( &self, - session: CK_SESSION_HANDLE, - part: *mut ::std::os::raw::c_uchar, - part_len: ::std::os::raw::c_ulong, - encrypted_part: *mut ::std::os::raw::c_uchar, - encrypted_part_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pPart: CK_BYTE_PTR, + ulPartLen: CK_ULONG, + pEncryptedPart: CK_BYTE_PTR, + pulEncryptedPartLen: CK_ULONG_PTR, ) -> CK_RV { (self .C_DigestEncryptUpdate .as_ref() .expect("Expected function, got error."))( - session, - part, - part_len, - encrypted_part, - encrypted_part_len, + hSession, + pPart, + ulPartLen, + pEncryptedPart, + pulEncryptedPartLen, ) } pub unsafe fn C_DecryptDigestUpdate( &self, - session: CK_SESSION_HANDLE, - encrypted_part: *mut ::std::os::raw::c_uchar, - encrypted_part_len: ::std::os::raw::c_ulong, - part: *mut ::std::os::raw::c_uchar, - part_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pEncryptedPart: CK_BYTE_PTR, + ulEncryptedPartLen: CK_ULONG, + pPart: CK_BYTE_PTR, + pulPartLen: CK_ULONG_PTR, ) -> CK_RV { (self .C_DecryptDigestUpdate .as_ref() .expect("Expected function, got error."))( - session, - encrypted_part, - encrypted_part_len, - part, - part_len, + hSession, + pEncryptedPart, + ulEncryptedPartLen, + pPart, + pulPartLen, ) } pub unsafe fn C_SignEncryptUpdate( &self, - session: CK_SESSION_HANDLE, - part: *mut ::std::os::raw::c_uchar, - part_len: ::std::os::raw::c_ulong, - encrypted_part: *mut ::std::os::raw::c_uchar, - encrypted_part_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pPart: CK_BYTE_PTR, + ulPartLen: CK_ULONG, + pEncryptedPart: CK_BYTE_PTR, + pulEncryptedPartLen: CK_ULONG_PTR, ) -> CK_RV { (self .C_SignEncryptUpdate .as_ref() .expect("Expected function, got error."))( - session, - part, - part_len, - encrypted_part, - encrypted_part_len, + hSession, + pPart, + ulPartLen, + pEncryptedPart, + pulEncryptedPartLen, ) } pub unsafe fn C_DecryptVerifyUpdate( &self, - session: CK_SESSION_HANDLE, - encrypted_part: *mut ::std::os::raw::c_uchar, - encrypted_part_len: ::std::os::raw::c_ulong, - part: *mut ::std::os::raw::c_uchar, - part_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pEncryptedPart: CK_BYTE_PTR, + ulEncryptedPartLen: CK_ULONG, + pPart: CK_BYTE_PTR, + pulPartLen: CK_ULONG_PTR, ) -> CK_RV { (self .C_DecryptVerifyUpdate .as_ref() .expect("Expected function, got error."))( - session, - encrypted_part, - encrypted_part_len, - part, - part_len, + hSession, + pEncryptedPart, + ulEncryptedPartLen, + pPart, + pulPartLen, ) } pub unsafe fn C_GenerateKey( &self, - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - templ: *mut _CK_ATTRIBUTE, - ulCount: ::std::os::raw::c_ulong, - key: *mut CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + pTemplate: CK_ATTRIBUTE_PTR, + ulCount: CK_ULONG, + phKey: CK_OBJECT_HANDLE_PTR, ) -> CK_RV { (self .C_GenerateKey .as_ref() .expect("Expected function, got error."))( - session, mechanism, templ, ulCount, key + hSession, pMechanism, pTemplate, ulCount, phKey, ) } pub unsafe fn C_GenerateKeyPair( &self, - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - public_key_template: *mut _CK_ATTRIBUTE, - public_key_attribute_count: ::std::os::raw::c_ulong, - private_key_template: *mut _CK_ATTRIBUTE, - private_key_attribute_count: ::std::os::raw::c_ulong, - public_key: *mut CK_OBJECT_HANDLE, - private_key: *mut CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + pPublicKeyTemplate: CK_ATTRIBUTE_PTR, + ulPublicKeyAttributeCount: CK_ULONG, + pPrivateKeyTemplate: CK_ATTRIBUTE_PTR, + ulPrivateKeyAttributeCount: CK_ULONG, + phPublicKey: CK_OBJECT_HANDLE_PTR, + phPrivateKey: CK_OBJECT_HANDLE_PTR, ) -> CK_RV { (self .C_GenerateKeyPair .as_ref() .expect("Expected function, got error."))( - session, - mechanism, - public_key_template, - public_key_attribute_count, - private_key_template, - private_key_attribute_count, - public_key, - private_key, + hSession, + pMechanism, + pPublicKeyTemplate, + ulPublicKeyAttributeCount, + pPrivateKeyTemplate, + ulPrivateKeyAttributeCount, + phPublicKey, + phPrivateKey, ) } pub unsafe fn C_WrapKey( &self, - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - wrapping_key: CK_OBJECT_HANDLE, - key: CK_OBJECT_HANDLE, - wrapped_key: *mut ::std::os::raw::c_uchar, - wrapped_key_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hWrappingKey: CK_OBJECT_HANDLE, + hKey: CK_OBJECT_HANDLE, + pWrappedKey: CK_BYTE_PTR, + pulWrappedKeyLen: CK_ULONG_PTR, ) -> CK_RV { (self .C_WrapKey .as_ref() .expect("Expected function, got error."))( - session, - mechanism, - wrapping_key, - key, - wrapped_key, - wrapped_key_len, + hSession, + pMechanism, + hWrappingKey, + hKey, + pWrappedKey, + pulWrappedKeyLen, ) } pub unsafe fn C_UnwrapKey( &self, - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - unwrapping_key: CK_OBJECT_HANDLE, - wrapped_key: *mut ::std::os::raw::c_uchar, - wrapped_key_len: ::std::os::raw::c_ulong, - templ: *mut _CK_ATTRIBUTE, - attribute_count: ::std::os::raw::c_ulong, - key: *mut CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hUnwrappingKey: CK_OBJECT_HANDLE, + pWrappedKey: CK_BYTE_PTR, + ulWrappedKeyLen: CK_ULONG, + pTemplate: CK_ATTRIBUTE_PTR, + ulAttributeCount: CK_ULONG, + phKey: CK_OBJECT_HANDLE_PTR, ) -> CK_RV { (self .C_UnwrapKey .as_ref() .expect("Expected function, got error."))( - session, - mechanism, - unwrapping_key, - wrapped_key, - wrapped_key_len, - templ, - attribute_count, - key, + hSession, + pMechanism, + hUnwrappingKey, + pWrappedKey, + ulWrappedKeyLen, + pTemplate, + ulAttributeCount, + phKey, ) } pub unsafe fn C_DeriveKey( &self, - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - base_key: CK_OBJECT_HANDLE, - templ: *mut _CK_ATTRIBUTE, - attribute_count: ::std::os::raw::c_ulong, - key: *mut CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hBaseKey: CK_OBJECT_HANDLE, + pTemplate: CK_ATTRIBUTE_PTR, + ulAttributeCount: CK_ULONG, + phKey: CK_OBJECT_HANDLE_PTR, ) -> CK_RV { (self .C_DeriveKey .as_ref() .expect("Expected function, got error."))( - session, - mechanism, - base_key, - templ, - attribute_count, - key, + hSession, + pMechanism, + hBaseKey, + pTemplate, + ulAttributeCount, + phKey, ) } pub unsafe fn C_SeedRandom( &self, - session: CK_SESSION_HANDLE, - seed: *mut ::std::os::raw::c_uchar, - seed_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pSeed: CK_BYTE_PTR, + ulSeedLen: CK_ULONG, ) -> CK_RV { (self .C_SeedRandom .as_ref() - .expect("Expected function, got error."))(session, seed, seed_len) + .expect("Expected function, got error."))(hSession, pSeed, ulSeedLen) } pub unsafe fn C_GenerateRandom( &self, - session: CK_SESSION_HANDLE, - random_data: *mut ::std::os::raw::c_uchar, - random_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + RandomData: CK_BYTE_PTR, + ulRandomLen: CK_ULONG, ) -> CK_RV { (self .C_GenerateRandom .as_ref() - .expect("Expected function, got error."))(session, random_data, random_len) + .expect("Expected function, got error."))(hSession, RandomData, ulRandomLen) } - pub unsafe fn C_GetFunctionStatus(&self, session: CK_SESSION_HANDLE) -> CK_RV { + pub unsafe fn C_GetFunctionStatus(&self, hSession: CK_SESSION_HANDLE) -> CK_RV { (self .C_GetFunctionStatus .as_ref() - .expect("Expected function, got error."))(session) + .expect("Expected function, got error."))(hSession) } - pub unsafe fn C_CancelFunction(&self, session: CK_SESSION_HANDLE) -> CK_RV { + pub unsafe fn C_CancelFunction(&self, hSession: CK_SESSION_HANDLE) -> CK_RV { (self .C_CancelFunction .as_ref() - .expect("Expected function, got error."))(session) + .expect("Expected function, got error."))(hSession) + } + pub unsafe fn C_WaitForSlotEvent( + &self, + flags: CK_FLAGS, + pSlot: CK_SLOT_ID_PTR, + pRserved: CK_VOID_PTR, + ) -> CK_RV { + (self + .C_WaitForSlotEvent + .as_ref() + .expect("Expected function, got error."))(flags, pSlot, pRserved) + } + pub unsafe fn C_GetInterfaceList( + &self, + pInterfacesList: CK_INTERFACE_PTR, + pulCount: CK_ULONG_PTR, + ) -> CK_RV { + (self + .C_GetInterfaceList + .as_ref() + .expect("Expected function, got error."))(pInterfacesList, pulCount) + } + pub unsafe fn C_GetInterface( + &self, + pInterfaceName: CK_UTF8CHAR_PTR, + pVersion: CK_VERSION_PTR, + ppInterface: CK_INTERFACE_PTR_PTR, + flags: CK_FLAGS, + ) -> CK_RV { + (self + .C_GetInterface + .as_ref() + .expect("Expected function, got error."))( + pInterfaceName, pVersion, ppInterface, flags + ) + } + pub unsafe fn C_LoginUser( + &self, + hSession: CK_SESSION_HANDLE, + userType: CK_USER_TYPE, + pPin: CK_UTF8CHAR_PTR, + ulPinLen: CK_ULONG, + pUsername: CK_UTF8CHAR_PTR, + ulUsernameLen: CK_ULONG, + ) -> CK_RV { + (self + .C_LoginUser + .as_ref() + .expect("Expected function, got error."))( + hSession, + userType, + pPin, + ulPinLen, + pUsername, + ulUsernameLen, + ) + } + pub unsafe fn C_SessionCancel(&self, hSession: CK_SESSION_HANDLE, flags: CK_FLAGS) -> CK_RV { + (self + .C_SessionCancel + .as_ref() + .expect("Expected function, got error."))(hSession, flags) + } + pub unsafe fn C_MessageEncryptInit( + &self, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, + ) -> CK_RV { + (self + .C_MessageEncryptInit + .as_ref() + .expect("Expected function, got error."))(hSession, pMechanism, hKey) + } + pub unsafe fn C_EncryptMessage( + &self, + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pAssociatedData: CK_BYTE_PTR, + ulAssociatedDataLen: CK_ULONG, + pPlaintext: CK_BYTE_PTR, + ulPlaintextLen: CK_ULONG, + pCiphertext: CK_BYTE_PTR, + pulCiphertextLen: CK_ULONG_PTR, + ) -> CK_RV { + (self + .C_EncryptMessage + .as_ref() + .expect("Expected function, got error."))( + hSession, + pParameter, + ulParameterLen, + pAssociatedData, + ulAssociatedDataLen, + pPlaintext, + ulPlaintextLen, + pCiphertext, + pulCiphertextLen, + ) + } + pub unsafe fn C_EncryptMessageBegin( + &self, + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pAssociatedData: CK_BYTE_PTR, + ulAssociatedDataLen: CK_ULONG, + ) -> CK_RV { + (self + .C_EncryptMessageBegin + .as_ref() + .expect("Expected function, got error."))( + hSession, + pParameter, + ulParameterLen, + pAssociatedData, + ulAssociatedDataLen, + ) + } + pub unsafe fn C_EncryptMessageNext( + &self, + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pPlaintextPart: CK_BYTE_PTR, + ulPlaintextPartLen: CK_ULONG, + pCiphertextPart: CK_BYTE_PTR, + pulCiphertextPartLen: CK_ULONG_PTR, + flags: CK_FLAGS, + ) -> CK_RV { + (self + .C_EncryptMessageNext + .as_ref() + .expect("Expected function, got error."))( + hSession, + pParameter, + ulParameterLen, + pPlaintextPart, + ulPlaintextPartLen, + pCiphertextPart, + pulCiphertextPartLen, + flags, + ) + } + pub unsafe fn C_MessageEncryptFinal(&self, hSession: CK_SESSION_HANDLE) -> CK_RV { + (self + .C_MessageEncryptFinal + .as_ref() + .expect("Expected function, got error."))(hSession) + } + pub unsafe fn C_MessageDecryptInit( + &self, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, + ) -> CK_RV { + (self + .C_MessageDecryptInit + .as_ref() + .expect("Expected function, got error."))(hSession, pMechanism, hKey) + } + pub unsafe fn C_DecryptMessage( + &self, + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pAssociatedData: CK_BYTE_PTR, + ulAssociatedDataLen: CK_ULONG, + pCiphertext: CK_BYTE_PTR, + ulCiphertextLen: CK_ULONG, + pPlaintext: CK_BYTE_PTR, + pulPlaintextLen: CK_ULONG_PTR, + ) -> CK_RV { + (self + .C_DecryptMessage + .as_ref() + .expect("Expected function, got error."))( + hSession, + pParameter, + ulParameterLen, + pAssociatedData, + ulAssociatedDataLen, + pCiphertext, + ulCiphertextLen, + pPlaintext, + pulPlaintextLen, + ) + } + pub unsafe fn C_DecryptMessageBegin( + &self, + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pAssociatedData: CK_BYTE_PTR, + ulAssociatedDataLen: CK_ULONG, + ) -> CK_RV { + (self + .C_DecryptMessageBegin + .as_ref() + .expect("Expected function, got error."))( + hSession, + pParameter, + ulParameterLen, + pAssociatedData, + ulAssociatedDataLen, + ) + } + pub unsafe fn C_DecryptMessageNext( + &self, + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pCiphertext: CK_BYTE_PTR, + ulCiphertextLen: CK_ULONG, + pPlaintext: CK_BYTE_PTR, + pulPlaintextLen: CK_ULONG_PTR, + flags: CK_FLAGS, + ) -> CK_RV { + (self + .C_DecryptMessageNext + .as_ref() + .expect("Expected function, got error."))( + hSession, + pParameter, + ulParameterLen, + pCiphertext, + ulCiphertextLen, + pPlaintext, + pulPlaintextLen, + flags, + ) + } + pub unsafe fn C_MessageDecryptFinal(&self, hSession: CK_SESSION_HANDLE) -> CK_RV { + (self + .C_MessageDecryptFinal + .as_ref() + .expect("Expected function, got error."))(hSession) + } + pub unsafe fn C_MessageSignInit( + &self, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, + ) -> CK_RV { + (self + .C_MessageSignInit + .as_ref() + .expect("Expected function, got error."))(hSession, pMechanism, hKey) + } + pub unsafe fn C_SignMessage( + &self, + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + pulSignatureLen: CK_ULONG_PTR, + ) -> CK_RV { + (self + .C_SignMessage + .as_ref() + .expect("Expected function, got error."))( + hSession, + pParameter, + ulParameterLen, + pData, + ulDataLen, + pSignature, + pulSignatureLen, + ) + } + pub unsafe fn C_SignMessageBegin( + &self, + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + ) -> CK_RV { + (self + .C_SignMessageBegin + .as_ref() + .expect("Expected function, got error."))(hSession, pParameter, ulParameterLen) + } + pub unsafe fn C_SignMessageNext( + &self, + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + pulSignatureLen: CK_ULONG_PTR, + ) -> CK_RV { + (self + .C_SignMessageNext + .as_ref() + .expect("Expected function, got error."))( + hSession, + pParameter, + ulParameterLen, + pData, + ulDataLen, + pSignature, + pulSignatureLen, + ) + } + pub unsafe fn C_MessageSignFinal(&self, hSession: CK_SESSION_HANDLE) -> CK_RV { + (self + .C_MessageSignFinal + .as_ref() + .expect("Expected function, got error."))(hSession) + } + pub unsafe fn C_MessageVerifyInit( + &self, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, + ) -> CK_RV { + (self + .C_MessageVerifyInit + .as_ref() + .expect("Expected function, got error."))(hSession, pMechanism, hKey) + } + pub unsafe fn C_VerifyMessage( + &self, + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + ulSignatureLen: CK_ULONG, + ) -> CK_RV { + (self + .C_VerifyMessage + .as_ref() + .expect("Expected function, got error."))( + hSession, + pParameter, + ulParameterLen, + pData, + ulDataLen, + pSignature, + ulSignatureLen, + ) + } + pub unsafe fn C_VerifyMessageBegin( + &self, + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + ) -> CK_RV { + (self + .C_VerifyMessageBegin + .as_ref() + .expect("Expected function, got error."))(hSession, pParameter, ulParameterLen) + } + pub unsafe fn C_VerifyMessageNext( + &self, + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + ulSignatureLen: CK_ULONG, + ) -> CK_RV { + (self + .C_VerifyMessageNext + .as_ref() + .expect("Expected function, got error."))( + hSession, + pParameter, + ulParameterLen, + pData, + ulDataLen, + pSignature, + ulSignatureLen, + ) + } + pub unsafe fn C_MessageVerifyFinal(&self, hSession: CK_SESSION_HANDLE) -> CK_RV { + (self + .C_MessageVerifyFinal + .as_ref() + .expect("Expected function, got error."))(hSession) } } diff --git a/cryptoki-sys/src/bindings/aarch64-unknown-linux-gnu.rs b/cryptoki-sys/src/bindings/aarch64-unknown-linux-gnu.rs index 6800365c..c4200fb4 100644 --- a/cryptoki-sys/src/bindings/aarch64-unknown-linux-gnu.rs +++ b/cryptoki-sys/src/bindings/aarch64-unknown-linux-gnu.rs @@ -1,10 +1,22 @@ /* automatically generated by rust-bindgen 0.63.0 */ -pub const PKCS11_H: u32 = 1; -pub const CRYPTOKI_VERSION_MAJOR: CK_BYTE = 2; -pub const CRYPTOKI_VERSION_MINOR: CK_BYTE = 40; -pub const P11_KIT_CRYPTOKI_VERSION_REVISION: u32 = 0; -pub const CRYPTOKI_COMPAT: u32 = 1; +pub const NULL_PTR: u32 = 0; +pub const _PKCS11_H_: u32 = 1; +pub const _PKCS11T_H_: u32 = 1; +pub const CRYPTOKI_VERSION_MAJOR: CK_BYTE = 3; +pub const CRYPTOKI_VERSION_MINOR: CK_BYTE = 0; +pub const CRYPTOKI_VERSION_AMENDMENT: CK_BYTE = 0; +pub const CK_TRUE: CK_BBOOL = 1; +pub const CK_FALSE: CK_BBOOL = 0; +pub const FALSE: u32 = 0; +pub const TRUE: u32 = 1; +pub const CK_EFFECTIVELY_INFINITE: CK_ULONG = 0; +pub const CK_INVALID_HANDLE: CK_ULONG = 0; +pub const CKN_SURRENDER: CK_NOTIFICATION = 0; +pub const CKN_OTP_CHANGED: CK_NOTIFICATION = 1; +pub const CKF_TOKEN_PRESENT: CK_FLAGS = 1; +pub const CKF_REMOVABLE_DEVICE: CK_FLAGS = 2; +pub const CKF_HW_SLOT: CK_FLAGS = 4; pub const CKF_RNG: CK_FLAGS = 1; pub const CKF_WRITE_PROTECTED: CK_FLAGS = 2; pub const CKF_LOGIN_REQUIRED: CK_FLAGS = 4; @@ -24,8 +36,6 @@ pub const CKF_SO_PIN_FINAL_TRY: CK_FLAGS = 2097152; pub const CKF_SO_PIN_LOCKED: CK_FLAGS = 4194304; pub const CKF_SO_PIN_TO_BE_CHANGED: CK_FLAGS = 8388608; pub const CKF_ERROR_STATE: CK_FLAGS = 16777216; -pub const CK_EFFECTIVELY_INFINITE: CK_ULONG = 0; -pub const CK_INVALID_HANDLE: CK_ULONG = 0; pub const CKU_SO: CK_USER_TYPE = 0; pub const CKU_USER: CK_USER_TYPE = 1; pub const CKU_CONTEXT_SPECIFIC: CK_USER_TYPE = 2; @@ -45,9 +55,18 @@ pub const CKO_HW_FEATURE: CK_OBJECT_CLASS = 5; pub const CKO_DOMAIN_PARAMETERS: CK_OBJECT_CLASS = 6; pub const CKO_MECHANISM: CK_OBJECT_CLASS = 7; pub const CKO_OTP_KEY: CK_OBJECT_CLASS = 8; +pub const CKO_PROFILE: CK_OBJECT_CLASS = 9; +pub const CKO_VENDOR_DEFINED: CK_OBJECT_CLASS = 2147483648; +pub const CKP_INVALID_ID: CK_PROFILE_ID = 0; +pub const CKP_BASELINE_PROVIDER: CK_PROFILE_ID = 1; +pub const CKP_EXTENDED_PROVIDER: CK_PROFILE_ID = 2; +pub const CKP_AUTHENTICATION_TOKEN: CK_PROFILE_ID = 3; +pub const CKP_PUBLIC_CERTIFICATES_TOKEN: CK_PROFILE_ID = 4; +pub const CKP_VENDOR_DEFINED: CK_PROFILE_ID = 2147483648; pub const CKH_MONOTONIC_COUNTER: CK_HW_FEATURE_TYPE = 1; pub const CKH_CLOCK: CK_HW_FEATURE_TYPE = 2; pub const CKH_USER_INTERFACE: CK_HW_FEATURE_TYPE = 3; +pub const CKH_VENDOR_DEFINED: CK_HW_FEATURE_TYPE = 2147483648; pub const CKK_RSA: CK_KEY_TYPE = 0; pub const CKK_DSA: CK_KEY_TYPE = 1; pub const CKK_DH: CK_KEY_TYPE = 2; @@ -63,6 +82,7 @@ pub const CKK_DES2: CK_KEY_TYPE = 20; pub const CKK_DES3: CK_KEY_TYPE = 21; pub const CKK_CAST: CK_KEY_TYPE = 22; pub const CKK_CAST3: CK_KEY_TYPE = 23; +pub const CKK_CAST5: CK_KEY_TYPE = 24; pub const CKK_CAST128: CK_KEY_TYPE = 24; pub const CKK_RC5: CK_KEY_TYPE = 25; pub const CKK_IDEA: CK_KEY_TYPE = 26; @@ -90,14 +110,48 @@ pub const CKK_SEED: CK_KEY_TYPE = 47; pub const CKK_GOSTR3410: CK_KEY_TYPE = 48; pub const CKK_GOSTR3411: CK_KEY_TYPE = 49; pub const CKK_GOST28147: CK_KEY_TYPE = 50; +pub const CKK_CHACHA20: CK_KEY_TYPE = 51; +pub const CKK_POLY1305: CK_KEY_TYPE = 52; +pub const CKK_AES_XTS: CK_KEY_TYPE = 53; +pub const CKK_SHA3_224_HMAC: CK_KEY_TYPE = 54; +pub const CKK_SHA3_256_HMAC: CK_KEY_TYPE = 55; +pub const CKK_SHA3_384_HMAC: CK_KEY_TYPE = 56; +pub const CKK_SHA3_512_HMAC: CK_KEY_TYPE = 57; +pub const CKK_BLAKE2B_160_HMAC: CK_KEY_TYPE = 58; +pub const CKK_BLAKE2B_256_HMAC: CK_KEY_TYPE = 59; +pub const CKK_BLAKE2B_384_HMAC: CK_KEY_TYPE = 60; +pub const CKK_BLAKE2B_512_HMAC: CK_KEY_TYPE = 61; +pub const CKK_SALSA20: CK_KEY_TYPE = 62; +pub const CKK_X2RATCHET: CK_KEY_TYPE = 63; pub const CKK_EC_EDWARDS: CK_KEY_TYPE = 64; +pub const CKK_EC_MONTGOMERY: CK_KEY_TYPE = 65; +pub const CKK_HKDF: CK_KEY_TYPE = 66; +pub const CKK_VENDOR_DEFINED: CK_KEY_TYPE = 2147483648; +pub const CK_CERTIFICATE_CATEGORY_UNSPECIFIED: CK_ULONG = 0; +pub const CK_CERTIFICATE_CATEGORY_TOKEN_USER: CK_ULONG = 1; +pub const CK_CERTIFICATE_CATEGORY_AUTHORITY: CK_ULONG = 2; +pub const CK_CERTIFICATE_CATEGORY_OTHER_ENTITY: CK_ULONG = 3; +pub const CK_SECURITY_DOMAIN_UNSPECIFIED: CK_ULONG = 0; +pub const CK_SECURITY_DOMAIN_MANUFACTURER: CK_ULONG = 1; +pub const CK_SECURITY_DOMAIN_OPERATOR: CK_ULONG = 2; +pub const CK_SECURITY_DOMAIN_THIRD_PARTY: CK_ULONG = 3; pub const CKC_X_509: CK_CERTIFICATE_TYPE = 0; pub const CKC_X_509_ATTR_CERT: CK_CERTIFICATE_TYPE = 1; pub const CKC_WTLS: CK_CERTIFICATE_TYPE = 2; +pub const CKC_VENDOR_DEFINED: CK_CERTIFICATE_TYPE = 2147483648; +pub const CKF_ARRAY_ATTRIBUTE: CK_FLAGS = 1073741824; +pub const CK_OTP_FORMAT_DECIMAL: CK_ULONG = 0; +pub const CK_OTP_FORMAT_HEXADECIMAL: CK_ULONG = 1; +pub const CK_OTP_FORMAT_ALPHANUMERIC: CK_ULONG = 2; +pub const CK_OTP_FORMAT_BINARY: CK_ULONG = 3; +pub const CK_OTP_PARAM_IGNORED: CK_ULONG = 0; +pub const CK_OTP_PARAM_OPTIONAL: CK_ULONG = 1; +pub const CK_OTP_PARAM_MANDATORY: CK_ULONG = 2; pub const CKA_CLASS: CK_ATTRIBUTE_TYPE = 0; pub const CKA_TOKEN: CK_ATTRIBUTE_TYPE = 1; pub const CKA_PRIVATE: CK_ATTRIBUTE_TYPE = 2; pub const CKA_LABEL: CK_ATTRIBUTE_TYPE = 3; +pub const CKA_UNIQUE_ID: CK_ATTRIBUTE_TYPE = 4; pub const CKA_APPLICATION: CK_ATTRIBUTE_TYPE = 16; pub const CKA_VALUE: CK_ATTRIBUTE_TYPE = 17; pub const CKA_OBJECT_ID: CK_ATTRIBUTE_TYPE = 18; @@ -144,6 +198,7 @@ pub const CKA_PRIME: CK_ATTRIBUTE_TYPE = 304; pub const CKA_SUBPRIME: CK_ATTRIBUTE_TYPE = 305; pub const CKA_BASE: CK_ATTRIBUTE_TYPE = 306; pub const CKA_PRIME_BITS: CK_ATTRIBUTE_TYPE = 307; +pub const CKA_SUBPRIME_BITS: CK_ATTRIBUTE_TYPE = 308; pub const CKA_SUB_PRIME_BITS: CK_ATTRIBUTE_TYPE = 308; pub const CKA_VALUE_BITS: CK_ATTRIBUTE_TYPE = 352; pub const CKA_VALUE_LEN: CK_ATTRIBUTE_TYPE = 353; @@ -162,6 +217,9 @@ pub const CKA_SECONDARY_AUTH: CK_ATTRIBUTE_TYPE = 512; pub const CKA_AUTH_PIN_FLAGS: CK_ATTRIBUTE_TYPE = 513; pub const CKA_ALWAYS_AUTHENTICATE: CK_ATTRIBUTE_TYPE = 514; pub const CKA_WRAP_WITH_TRUSTED: CK_ATTRIBUTE_TYPE = 528; +pub const CKA_WRAP_TEMPLATE: CK_ATTRIBUTE_TYPE = 1073742353; +pub const CKA_UNWRAP_TEMPLATE: CK_ATTRIBUTE_TYPE = 1073742354; +pub const CKA_DERIVE_TEMPLATE: CK_ATTRIBUTE_TYPE = 1073742355; pub const CKA_OTP_FORMAT: CK_ATTRIBUTE_TYPE = 544; pub const CKA_OTP_LENGTH: CK_ATTRIBUTE_TYPE = 545; pub const CKA_OTP_TIME_INTERVAL: CK_ATTRIBUTE_TYPE = 546; @@ -170,12 +228,12 @@ pub const CKA_OTP_CHALLENGE_REQUIREMENT: CK_ATTRIBUTE_TYPE = 548; pub const CKA_OTP_TIME_REQUIREMENT: CK_ATTRIBUTE_TYPE = 549; pub const CKA_OTP_COUNTER_REQUIREMENT: CK_ATTRIBUTE_TYPE = 550; pub const CKA_OTP_PIN_REQUIREMENT: CK_ATTRIBUTE_TYPE = 551; +pub const CKA_OTP_COUNTER: CK_ATTRIBUTE_TYPE = 558; +pub const CKA_OTP_TIME: CK_ATTRIBUTE_TYPE = 559; pub const CKA_OTP_USER_IDENTIFIER: CK_ATTRIBUTE_TYPE = 554; pub const CKA_OTP_SERVICE_IDENTIFIER: CK_ATTRIBUTE_TYPE = 555; pub const CKA_OTP_SERVICE_LOGO: CK_ATTRIBUTE_TYPE = 556; pub const CKA_OTP_SERVICE_LOGO_TYPE: CK_ATTRIBUTE_TYPE = 557; -pub const CKA_OTP_COUNTER: CK_ATTRIBUTE_TYPE = 558; -pub const CKA_OTP_TIME: CK_ATTRIBUTE_TYPE = 559; pub const CKA_GOSTR3410_PARAMS: CK_ATTRIBUTE_TYPE = 592; pub const CKA_GOSTR3411_PARAMS: CK_ATTRIBUTE_TYPE = 593; pub const CKA_GOST28147_PARAMS: CK_ATTRIBUTE_TYPE = 594; @@ -196,6 +254,9 @@ pub const CKA_MECHANISM_TYPE: CK_ATTRIBUTE_TYPE = 1280; pub const CKA_REQUIRED_CMS_ATTRIBUTES: CK_ATTRIBUTE_TYPE = 1281; pub const CKA_DEFAULT_CMS_ATTRIBUTES: CK_ATTRIBUTE_TYPE = 1282; pub const CKA_SUPPORTED_CMS_ATTRIBUTES: CK_ATTRIBUTE_TYPE = 1283; +pub const CKA_ALLOWED_MECHANISMS: CK_ATTRIBUTE_TYPE = 1073743360; +pub const CKA_PROFILE_ID: CK_ATTRIBUTE_TYPE = 1537; +pub const CKA_VENDOR_DEFINED: CK_ATTRIBUTE_TYPE = 2147483648; pub const CKM_RSA_PKCS_KEY_PAIR_GEN: CK_MECHANISM_TYPE = 0; pub const CKM_RSA_PKCS: CK_MECHANISM_TYPE = 1; pub const CKM_RSA_9796: CK_MECHANISM_TYPE = 2; @@ -218,6 +279,10 @@ pub const CKM_DSA_SHA224: CK_MECHANISM_TYPE = 19; pub const CKM_DSA_SHA256: CK_MECHANISM_TYPE = 20; pub const CKM_DSA_SHA384: CK_MECHANISM_TYPE = 21; pub const CKM_DSA_SHA512: CK_MECHANISM_TYPE = 22; +pub const CKM_DSA_SHA3_224: CK_MECHANISM_TYPE = 24; +pub const CKM_DSA_SHA3_256: CK_MECHANISM_TYPE = 25; +pub const CKM_DSA_SHA3_384: CK_MECHANISM_TYPE = 26; +pub const CKM_DSA_SHA3_512: CK_MECHANISM_TYPE = 27; pub const CKM_DH_PKCS_KEY_PAIR_GEN: CK_MECHANISM_TYPE = 32; pub const CKM_DH_PKCS_DERIVE: CK_MECHANISM_TYPE = 33; pub const CKM_X9_42_DH_KEY_PAIR_GEN: CK_MECHANISM_TYPE = 48; @@ -230,6 +295,8 @@ pub const CKM_SHA512_RSA_PKCS: CK_MECHANISM_TYPE = 66; pub const CKM_SHA256_RSA_PKCS_PSS: CK_MECHANISM_TYPE = 67; pub const CKM_SHA384_RSA_PKCS_PSS: CK_MECHANISM_TYPE = 68; pub const CKM_SHA512_RSA_PKCS_PSS: CK_MECHANISM_TYPE = 69; +pub const CKM_SHA224_RSA_PKCS: CK_MECHANISM_TYPE = 70; +pub const CKM_SHA224_RSA_PKCS_PSS: CK_MECHANISM_TYPE = 71; pub const CKM_SHA512_224: CK_MECHANISM_TYPE = 72; pub const CKM_SHA512_224_HMAC: CK_MECHANISM_TYPE = 73; pub const CKM_SHA512_224_HMAC_GENERAL: CK_MECHANISM_TYPE = 74; @@ -242,6 +309,14 @@ pub const CKM_SHA512_T: CK_MECHANISM_TYPE = 80; pub const CKM_SHA512_T_HMAC: CK_MECHANISM_TYPE = 81; pub const CKM_SHA512_T_HMAC_GENERAL: CK_MECHANISM_TYPE = 82; pub const CKM_SHA512_T_KEY_DERIVATION: CK_MECHANISM_TYPE = 83; +pub const CKM_SHA3_256_RSA_PKCS: CK_MECHANISM_TYPE = 96; +pub const CKM_SHA3_384_RSA_PKCS: CK_MECHANISM_TYPE = 97; +pub const CKM_SHA3_512_RSA_PKCS: CK_MECHANISM_TYPE = 98; +pub const CKM_SHA3_256_RSA_PKCS_PSS: CK_MECHANISM_TYPE = 99; +pub const CKM_SHA3_384_RSA_PKCS_PSS: CK_MECHANISM_TYPE = 100; +pub const CKM_SHA3_512_RSA_PKCS_PSS: CK_MECHANISM_TYPE = 101; +pub const CKM_SHA3_224_RSA_PKCS: CK_MECHANISM_TYPE = 102; +pub const CKM_SHA3_224_RSA_PKCS_PSS: CK_MECHANISM_TYPE = 103; pub const CKM_RC2_KEY_GEN: CK_MECHANISM_TYPE = 256; pub const CKM_RC2_ECB: CK_MECHANISM_TYPE = 257; pub const CKM_RC2_CBC: CK_MECHANISM_TYPE = 258; @@ -293,6 +368,9 @@ pub const CKM_RIPEMD160_HMAC_GENERAL: CK_MECHANISM_TYPE = 578; pub const CKM_SHA256: CK_MECHANISM_TYPE = 592; pub const CKM_SHA256_HMAC: CK_MECHANISM_TYPE = 593; pub const CKM_SHA256_HMAC_GENERAL: CK_MECHANISM_TYPE = 594; +pub const CKM_SHA224: CK_MECHANISM_TYPE = 597; +pub const CKM_SHA224_HMAC: CK_MECHANISM_TYPE = 598; +pub const CKM_SHA224_HMAC_GENERAL: CK_MECHANISM_TYPE = 599; pub const CKM_SHA384: CK_MECHANISM_TYPE = 608; pub const CKM_SHA384_HMAC: CK_MECHANISM_TYPE = 609; pub const CKM_SHA384_HMAC_GENERAL: CK_MECHANISM_TYPE = 610; @@ -305,6 +383,22 @@ pub const CKM_HOTP_KEY_GEN: CK_MECHANISM_TYPE = 656; pub const CKM_HOTP: CK_MECHANISM_TYPE = 657; pub const CKM_ACTI: CK_MECHANISM_TYPE = 672; pub const CKM_ACTI_KEY_GEN: CK_MECHANISM_TYPE = 673; +pub const CKM_SHA3_256: CK_MECHANISM_TYPE = 688; +pub const CKM_SHA3_256_HMAC: CK_MECHANISM_TYPE = 689; +pub const CKM_SHA3_256_HMAC_GENERAL: CK_MECHANISM_TYPE = 690; +pub const CKM_SHA3_256_KEY_GEN: CK_MECHANISM_TYPE = 691; +pub const CKM_SHA3_224: CK_MECHANISM_TYPE = 693; +pub const CKM_SHA3_224_HMAC: CK_MECHANISM_TYPE = 694; +pub const CKM_SHA3_224_HMAC_GENERAL: CK_MECHANISM_TYPE = 695; +pub const CKM_SHA3_224_KEY_GEN: CK_MECHANISM_TYPE = 696; +pub const CKM_SHA3_384: CK_MECHANISM_TYPE = 704; +pub const CKM_SHA3_384_HMAC: CK_MECHANISM_TYPE = 705; +pub const CKM_SHA3_384_HMAC_GENERAL: CK_MECHANISM_TYPE = 706; +pub const CKM_SHA3_384_KEY_GEN: CK_MECHANISM_TYPE = 707; +pub const CKM_SHA3_512: CK_MECHANISM_TYPE = 720; +pub const CKM_SHA3_512_HMAC: CK_MECHANISM_TYPE = 721; +pub const CKM_SHA3_512_HMAC_GENERAL: CK_MECHANISM_TYPE = 722; +pub const CKM_SHA3_512_KEY_GEN: CK_MECHANISM_TYPE = 723; pub const CKM_CAST_KEY_GEN: CK_MECHANISM_TYPE = 768; pub const CKM_CAST_ECB: CK_MECHANISM_TYPE = 769; pub const CKM_CAST_CBC: CK_MECHANISM_TYPE = 770; @@ -364,6 +458,13 @@ pub const CKM_SHA1_KEY_DERIVATION: CK_MECHANISM_TYPE = 914; pub const CKM_SHA256_KEY_DERIVATION: CK_MECHANISM_TYPE = 915; pub const CKM_SHA384_KEY_DERIVATION: CK_MECHANISM_TYPE = 916; pub const CKM_SHA512_KEY_DERIVATION: CK_MECHANISM_TYPE = 917; +pub const CKM_SHA224_KEY_DERIVATION: CK_MECHANISM_TYPE = 918; +pub const CKM_SHA3_256_KEY_DERIVE: CK_MECHANISM_TYPE = 919; +pub const CKM_SHA3_224_KEY_DERIVE: CK_MECHANISM_TYPE = 920; +pub const CKM_SHA3_384_KEY_DERIVE: CK_MECHANISM_TYPE = 921; +pub const CKM_SHA3_512_KEY_DERIVE: CK_MECHANISM_TYPE = 922; +pub const CKM_SHAKE_128_KEY_DERIVE: CK_MECHANISM_TYPE = 923; +pub const CKM_SHAKE_256_KEY_DERIVE: CK_MECHANISM_TYPE = 924; pub const CKM_PBE_MD2_DES_CBC: CK_MECHANISM_TYPE = 928; pub const CKM_PBE_MD5_DES_CBC: CK_MECHANISM_TYPE = 929; pub const CKM_PBE_MD5_CAST_CBC: CK_MECHANISM_TYPE = 930; @@ -403,6 +504,13 @@ pub const CKM_KIP_DERIVE: CK_MECHANISM_TYPE = 1296; pub const CKM_KIP_WRAP: CK_MECHANISM_TYPE = 1297; pub const CKM_KIP_MAC: CK_MECHANISM_TYPE = 1298; pub const CKM_CAMELLIA_KEY_GEN: CK_MECHANISM_TYPE = 1360; +pub const CKM_CAMELLIA_ECB: CK_MECHANISM_TYPE = 1361; +pub const CKM_CAMELLIA_CBC: CK_MECHANISM_TYPE = 1362; +pub const CKM_CAMELLIA_MAC: CK_MECHANISM_TYPE = 1363; +pub const CKM_CAMELLIA_MAC_GENERAL: CK_MECHANISM_TYPE = 1364; +pub const CKM_CAMELLIA_CBC_PAD: CK_MECHANISM_TYPE = 1365; +pub const CKM_CAMELLIA_ECB_ENCRYPT_DATA: CK_MECHANISM_TYPE = 1366; +pub const CKM_CAMELLIA_CBC_ENCRYPT_DATA: CK_MECHANISM_TYPE = 1367; pub const CKM_CAMELLIA_CTR: CK_MECHANISM_TYPE = 1368; pub const CKM_ARIA_KEY_GEN: CK_MECHANISM_TYPE = 1376; pub const CKM_ARIA_ECB: CK_MECHANISM_TYPE = 1377; @@ -433,6 +541,7 @@ pub const CKM_SKIPJACK_PRIVATE_WRAP: CK_MECHANISM_TYPE = 4105; pub const CKM_SKIPJACK_RELAYX: CK_MECHANISM_TYPE = 4106; pub const CKM_KEA_KEY_PAIR_GEN: CK_MECHANISM_TYPE = 4112; pub const CKM_KEA_KEY_DERIVE: CK_MECHANISM_TYPE = 4113; +pub const CKM_KEA_DERIVE: CK_MECHANISM_TYPE = 4114; pub const CKM_FORTEZZA_TIMESTAMP: CK_MECHANISM_TYPE = 4128; pub const CKM_BATON_KEY_GEN: CK_MECHANISM_TYPE = 4144; pub const CKM_BATON_ECB128: CK_MECHANISM_TYPE = 4145; @@ -461,6 +570,8 @@ pub const CKM_JUNIPER_COUNTER: CK_MECHANISM_TYPE = 4195; pub const CKM_JUNIPER_SHUFFLE: CK_MECHANISM_TYPE = 4196; pub const CKM_JUNIPER_WRAP: CK_MECHANISM_TYPE = 4197; pub const CKM_FASTHASH: CK_MECHANISM_TYPE = 4208; +pub const CKM_AES_XTS: CK_MECHANISM_TYPE = 4209; +pub const CKM_AES_XTS_KEY_GEN: CK_MECHANISM_TYPE = 4210; pub const CKM_AES_KEY_GEN: CK_MECHANISM_TYPE = 4224; pub const CKM_AES_ECB: CK_MECHANISM_TYPE = 4225; pub const CKM_AES_CBC: CK_MECHANISM_TYPE = 4226; @@ -500,6 +611,10 @@ pub const CKM_GOST28147_ECB: CK_MECHANISM_TYPE = 4641; pub const CKM_GOST28147: CK_MECHANISM_TYPE = 4642; pub const CKM_GOST28147_MAC: CK_MECHANISM_TYPE = 4643; pub const CKM_GOST28147_KEY_WRAP: CK_MECHANISM_TYPE = 4644; +pub const CKM_CHACHA20_KEY_GEN: CK_MECHANISM_TYPE = 4645; +pub const CKM_CHACHA20: CK_MECHANISM_TYPE = 4646; +pub const CKM_POLY1305_KEY_GEN: CK_MECHANISM_TYPE = 4647; +pub const CKM_POLY1305: CK_MECHANISM_TYPE = 4648; pub const CKM_DSA_PARAMETER_GEN: CK_MECHANISM_TYPE = 8192; pub const CKM_DH_PKCS_PARAMETER_GEN: CK_MECHANISM_TYPE = 8193; pub const CKM_X9_42_DH_PARAMETER_GEN: CK_MECHANISM_TYPE = 8194; @@ -510,63 +625,71 @@ pub const CKM_AES_CFB64: CK_MECHANISM_TYPE = 8453; pub const CKM_AES_CFB8: CK_MECHANISM_TYPE = 8454; pub const CKM_AES_CFB128: CK_MECHANISM_TYPE = 8455; pub const CKM_AES_CFB1: CK_MECHANISM_TYPE = 8456; -pub const CKM_SHA224: CK_MECHANISM_TYPE = 597; -pub const CKM_SHA224_HMAC: CK_MECHANISM_TYPE = 598; -pub const CKM_SHA224_HMAC_GENERAL: CK_MECHANISM_TYPE = 599; -pub const CKM_SHA224_RSA_PKCS: CK_MECHANISM_TYPE = 70; -pub const CKM_SHA224_RSA_PKCS_PSS: CK_MECHANISM_TYPE = 71; -pub const CKM_SHA224_KEY_DERIVATION: CK_MECHANISM_TYPE = 918; -pub const CKM_CAMELLIA_ECB: CK_MECHANISM_TYPE = 1361; -pub const CKM_CAMELLIA_CBC: CK_MECHANISM_TYPE = 1362; -pub const CKM_CAMELLIA_MAC: CK_MECHANISM_TYPE = 1363; -pub const CKM_CAMELLIA_MAC_GENERAL: CK_MECHANISM_TYPE = 1364; -pub const CKM_CAMELLIA_CBC_PAD: CK_MECHANISM_TYPE = 1365; -pub const CKM_CAMELLIA_ECB_ENCRYPT_DATA: CK_MECHANISM_TYPE = 1366; -pub const CKM_CAMELLIA_CBC_ENCRYPT_DATA: CK_MECHANISM_TYPE = 1367; pub const CKM_AES_KEY_WRAP: CK_MECHANISM_TYPE = 8457; pub const CKM_AES_KEY_WRAP_PAD: CK_MECHANISM_TYPE = 8458; +pub const CKM_AES_KEY_WRAP_KWP: CK_MECHANISM_TYPE = 8459; pub const CKM_RSA_PKCS_TPM_1_1: CK_MECHANISM_TYPE = 16385; pub const CKM_RSA_PKCS_OAEP_TPM_1_1: CK_MECHANISM_TYPE = 16386; +pub const CKM_SHA_1_KEY_GEN: CK_MECHANISM_TYPE = 16387; +pub const CKM_SHA224_KEY_GEN: CK_MECHANISM_TYPE = 16388; +pub const CKM_SHA256_KEY_GEN: CK_MECHANISM_TYPE = 16389; +pub const CKM_SHA384_KEY_GEN: CK_MECHANISM_TYPE = 16390; +pub const CKM_SHA512_KEY_GEN: CK_MECHANISM_TYPE = 16391; +pub const CKM_SHA512_224_KEY_GEN: CK_MECHANISM_TYPE = 16392; +pub const CKM_SHA512_256_KEY_GEN: CK_MECHANISM_TYPE = 16393; +pub const CKM_SHA512_T_KEY_GEN: CK_MECHANISM_TYPE = 16394; +pub const CKM_NULL: CK_MECHANISM_TYPE = 16395; +pub const CKM_BLAKE2B_160: CK_MECHANISM_TYPE = 16396; +pub const CKM_BLAKE2B_160_HMAC: CK_MECHANISM_TYPE = 16397; +pub const CKM_BLAKE2B_160_HMAC_GENERAL: CK_MECHANISM_TYPE = 16398; +pub const CKM_BLAKE2B_160_KEY_DERIVE: CK_MECHANISM_TYPE = 16399; +pub const CKM_BLAKE2B_160_KEY_GEN: CK_MECHANISM_TYPE = 16400; +pub const CKM_BLAKE2B_256: CK_MECHANISM_TYPE = 16401; +pub const CKM_BLAKE2B_256_HMAC: CK_MECHANISM_TYPE = 16402; +pub const CKM_BLAKE2B_256_HMAC_GENERAL: CK_MECHANISM_TYPE = 16403; +pub const CKM_BLAKE2B_256_KEY_DERIVE: CK_MECHANISM_TYPE = 16404; +pub const CKM_BLAKE2B_256_KEY_GEN: CK_MECHANISM_TYPE = 16405; +pub const CKM_BLAKE2B_384: CK_MECHANISM_TYPE = 16406; +pub const CKM_BLAKE2B_384_HMAC: CK_MECHANISM_TYPE = 16407; +pub const CKM_BLAKE2B_384_HMAC_GENERAL: CK_MECHANISM_TYPE = 16408; +pub const CKM_BLAKE2B_384_KEY_DERIVE: CK_MECHANISM_TYPE = 16409; +pub const CKM_BLAKE2B_384_KEY_GEN: CK_MECHANISM_TYPE = 16410; +pub const CKM_BLAKE2B_512: CK_MECHANISM_TYPE = 16411; +pub const CKM_BLAKE2B_512_HMAC: CK_MECHANISM_TYPE = 16412; +pub const CKM_BLAKE2B_512_HMAC_GENERAL: CK_MECHANISM_TYPE = 16413; +pub const CKM_BLAKE2B_512_KEY_DERIVE: CK_MECHANISM_TYPE = 16414; +pub const CKM_BLAKE2B_512_KEY_GEN: CK_MECHANISM_TYPE = 16415; +pub const CKM_SALSA20: CK_MECHANISM_TYPE = 16416; +pub const CKM_CHACHA20_POLY1305: CK_MECHANISM_TYPE = 16417; +pub const CKM_SALSA20_POLY1305: CK_MECHANISM_TYPE = 16418; +pub const CKM_X3DH_INITIALIZE: CK_MECHANISM_TYPE = 16419; +pub const CKM_X3DH_RESPOND: CK_MECHANISM_TYPE = 16420; +pub const CKM_X2RATCHET_INITIALIZE: CK_MECHANISM_TYPE = 16421; +pub const CKM_X2RATCHET_RESPOND: CK_MECHANISM_TYPE = 16422; +pub const CKM_X2RATCHET_ENCRYPT: CK_MECHANISM_TYPE = 16423; +pub const CKM_X2RATCHET_DECRYPT: CK_MECHANISM_TYPE = 16424; +pub const CKM_XEDDSA: CK_MECHANISM_TYPE = 16425; +pub const CKM_HKDF_DERIVE: CK_MECHANISM_TYPE = 16426; +pub const CKM_HKDF_DATA: CK_MECHANISM_TYPE = 16427; +pub const CKM_HKDF_KEY_GEN: CK_MECHANISM_TYPE = 16428; +pub const CKM_ECDSA_SHA3_224: CK_MECHANISM_TYPE = 4167; +pub const CKM_ECDSA_SHA3_256: CK_MECHANISM_TYPE = 4168; +pub const CKM_ECDSA_SHA3_384: CK_MECHANISM_TYPE = 4169; +pub const CKM_ECDSA_SHA3_512: CK_MECHANISM_TYPE = 4170; pub const CKM_EC_EDWARDS_KEY_PAIR_GEN: CK_MECHANISM_TYPE = 4181; pub const CKM_EC_MONTGOMERY_KEY_PAIR_GEN: CK_MECHANISM_TYPE = 4182; pub const CKM_EDDSA: CK_MECHANISM_TYPE = 4183; -pub const CK_OTP_FORMAT_DECIMAL: CK_ULONG = 0; -pub const CK_OTP_FORMAT_HEXADECIMAL: CK_ULONG = 1; -pub const CK_OTP_FORMAT_ALPHANUMERIC: CK_ULONG = 2; -pub const CK_OTP_FORMAT_BINARY: CK_ULONG = 3; -pub const CK_OTP_PARAM_IGNORED: CK_ULONG = 0; -pub const CK_OTP_PARAM_OPTIONAL: CK_ULONG = 1; -pub const CK_OTP_PARAM_MANDATORY: CK_ULONG = 2; -pub const CK_OTP_VALUE: CK_ULONG = 0; -pub const CK_OTP_PIN: CK_ULONG = 1; -pub const CK_OTP_CHALLENGE: CK_ULONG = 2; -pub const CK_OTP_TIME: CK_ULONG = 3; -pub const CK_OTP_COUNTER: CK_ULONG = 4; -pub const CK_OTP_FLAGS: CK_ULONG = 5; -pub const CK_OTP_OUTPUT_LENGTH: CK_ULONG = 6; -pub const CK_OTP_FORMAT: CK_ULONG = 7; -pub const CKF_NEXT_OTP: CK_FLAGS = 1; -pub const CKF_EXCLUDE_TIME: CK_FLAGS = 2; -pub const CKF_EXCLUDE_COUNTER: CK_FLAGS = 4; -pub const CKF_EXCLUDE_CHALLENGE: CK_FLAGS = 8; -pub const CKF_EXCLUDE_PIN: CK_FLAGS = 16; -pub const CKF_USER_FRIENDLY_OTP: CK_FLAGS = 32; -pub const CKN_OTP_CHANGED: CK_NOTIFICATION = 1; -pub const CKG_MGF1_SHA1: CK_RSA_PKCS_MGF_TYPE = 1; -pub const CKG_MGF1_SHA224: CK_RSA_PKCS_MGF_TYPE = 5; -pub const CKG_MGF1_SHA256: CK_RSA_PKCS_MGF_TYPE = 2; -pub const CKG_MGF1_SHA384: CK_RSA_PKCS_MGF_TYPE = 3; -pub const CKG_MGF1_SHA512: CK_RSA_PKCS_MGF_TYPE = 4; -pub const CKD_NULL: CK_EC_KDF_TYPE = 1; -pub const CKD_SHA1_KDF: CK_EC_KDF_TYPE = 2; -pub const CKD_SHA1_KDF_ASN1: CK_EC_KDF_TYPE = 3; -pub const CKD_SHA1_KDF_CONCATENATE: CK_EC_KDF_TYPE = 4; -pub const CKD_SHA224_KDF: CK_EC_KDF_TYPE = 5; -pub const CKD_SHA256_KDF: CK_EC_KDF_TYPE = 6; -pub const CKD_SHA384_KDF: CK_EC_KDF_TYPE = 7; -pub const CKD_SHA512_KDF: CK_EC_KDF_TYPE = 8; -pub const CKD_CPDIVERSIFY_KDF: CK_EC_KDF_TYPE = 9; +pub const CKM_SP800_108_COUNTER_KDF: CK_MECHANISM_TYPE = 940; +pub const CKM_SP800_108_FEEDBACK_KDF: CK_MECHANISM_TYPE = 941; +pub const CKM_SP800_108_DOUBLE_PIPELINE_KDF: CK_MECHANISM_TYPE = 942; +pub const CKM_VENDOR_DEFINED: CK_MECHANISM_TYPE = 2147483648; pub const CKF_HW: CK_FLAGS = 1; +pub const CKF_MESSAGE_ENCRYPT: CK_FLAGS = 2; +pub const CKF_MESSAGE_DECRYPT: CK_FLAGS = 4; +pub const CKF_MESSAGE_SIGN: CK_FLAGS = 8; +pub const CKF_MESSAGE_VERIFY: CK_FLAGS = 16; +pub const CKF_MULTI_MESSGE: CK_FLAGS = 32; +pub const CKF_FIND_OBJECTS: CK_FLAGS = 64; pub const CKF_ENCRYPT: CK_FLAGS = 256; pub const CKF_DECRYPT: CK_FLAGS = 512; pub const CKF_DIGEST: CK_FLAGS = 1024; @@ -582,12 +705,12 @@ pub const CKF_DERIVE: CK_FLAGS = 524288; pub const CKF_EC_F_P: CK_FLAGS = 1048576; pub const CKF_EC_F_2M: CK_FLAGS = 2097152; pub const CKF_EC_ECPARAMETERS: CK_FLAGS = 4194304; +pub const CKF_EC_OID: CK_FLAGS = 8388608; pub const CKF_EC_NAMEDCURVE: CK_FLAGS = 8388608; pub const CKF_EC_UNCOMPRESS: CK_FLAGS = 16777216; pub const CKF_EC_COMPRESS: CK_FLAGS = 33554432; -pub const CKF_DONT_BLOCK: CK_FLAGS = 1; -pub const CKF_LIBRARY_CANT_CREATE_OS_THREADS: CK_FLAGS = 1; -pub const CKF_OS_LOCKING_OK: CK_FLAGS = 2; +pub const CKF_EC_CURVENAME: CK_FLAGS = 67108864; +pub const CKF_EXTENSION: CK_FLAGS = 2147483648; pub const CKR_OK: CK_RV = 0; pub const CKR_CANCEL: CK_RV = 1; pub const CKR_HOST_MEMORY: CK_RV = 2; @@ -610,6 +733,7 @@ pub const CKR_DEVICE_MEMORY: CK_RV = 49; pub const CKR_DEVICE_REMOVED: CK_RV = 50; pub const CKR_ENCRYPTED_DATA_INVALID: CK_RV = 64; pub const CKR_ENCRYPTED_DATA_LEN_RANGE: CK_RV = 65; +pub const CKR_AEAD_DECRYPT_FAILED: CK_RV = 66; pub const CKR_FUNCTION_CANCELED: CK_RV = 80; pub const CKR_FUNCTION_NOT_PARALLEL: CK_RV = 81; pub const CKR_FUNCTION_NOT_SUPPORTED: CK_RV = 84; @@ -665,6 +789,7 @@ pub const CKR_WRAPPING_KEY_TYPE_INCONSISTENT: CK_RV = 277; pub const CKR_RANDOM_SEED_NOT_SUPPORTED: CK_RV = 288; pub const CKR_RANDOM_NO_RNG: CK_RV = 289; pub const CKR_DOMAIN_PARAMS_INVALID: CK_RV = 304; +pub const CKR_CURVE_NOT_SUPPORTED: CK_RV = 320; pub const CKR_BUFFER_TOO_SMALL: CK_RV = 336; pub const CKR_SAVED_STATE_INVALID: CK_RV = 352; pub const CKR_INFORMATION_SENSITIVE: CK_RV = 368; @@ -675,44 +800,126 @@ pub const CKR_MUTEX_BAD: CK_RV = 416; pub const CKR_MUTEX_NOT_LOCKED: CK_RV = 417; pub const CKR_NEW_PIN_MODE: CK_RV = 432; pub const CKR_NEXT_OTP: CK_RV = 433; -pub const CKR_EXCEEDED_MAX_ITERATIONS: CK_RV = 448; -pub const CKR_FIPS_SELF_TEST_FAILED: CK_RV = 449; -pub const CKR_LIBRARY_LOAD_FAILED: CK_RV = 450; -pub const CKR_PIN_TOO_WEAK: CK_RV = 451; -pub const CKR_PUBLIC_KEY_INVALID: CK_RV = 452; +pub const CKR_EXCEEDED_MAX_ITERATIONS: CK_RV = 437; +pub const CKR_FIPS_SELF_TEST_FAILED: CK_RV = 438; +pub const CKR_LIBRARY_LOAD_FAILED: CK_RV = 439; +pub const CKR_PIN_TOO_WEAK: CK_RV = 440; +pub const CKR_PUBLIC_KEY_INVALID: CK_RV = 441; pub const CKR_FUNCTION_REJECTED: CK_RV = 512; +pub const CKR_TOKEN_RESOURCE_EXCEEDED: CK_RV = 513; +pub const CKR_VENDOR_DEFINED: CK_RV = 2147483648; +pub const CKF_END_OF_MESSAGE: CK_FLAGS = 1; +pub const CKF_INTERFACE_FORK_SAFE: CK_FLAGS = 1; +pub const CKF_LIBRARY_CANT_CREATE_OS_THREADS: CK_FLAGS = 1; +pub const CKF_OS_LOCKING_OK: CK_FLAGS = 2; +pub const CKF_DONT_BLOCK: CK_FLAGS = 1; +pub const CKG_MGF1_SHA1: CK_RSA_PKCS_MGF_TYPE = 1; +pub const CKG_MGF1_SHA256: CK_RSA_PKCS_MGF_TYPE = 2; +pub const CKG_MGF1_SHA384: CK_RSA_PKCS_MGF_TYPE = 3; +pub const CKG_MGF1_SHA512: CK_RSA_PKCS_MGF_TYPE = 4; +pub const CKG_MGF1_SHA224: CK_RSA_PKCS_MGF_TYPE = 5; pub const CKZ_DATA_SPECIFIED: CK_RSA_PKCS_OAEP_SOURCE_TYPE = 1; -pub const CK_FALSE: CK_BBOOL = 0; -pub const CK_TRUE: CK_BBOOL = 1; -pub const FALSE: u32 = 0; -pub const TRUE: u32 = 1; -pub type CK_FLAGS = ::std::os::raw::c_ulong; +pub const CKD_NULL: CK_EC_KDF_TYPE = 1; +pub const CKD_SHA1_KDF: CK_EC_KDF_TYPE = 2; +pub const CKD_SHA1_KDF_ASN1: CK_EC_KDF_TYPE = 3; +pub const CKD_SHA1_KDF_CONCATENATE: CK_EC_KDF_TYPE = 4; +pub const CKD_SHA224_KDF: CK_EC_KDF_TYPE = 5; +pub const CKD_SHA256_KDF: CK_EC_KDF_TYPE = 6; +pub const CKD_SHA384_KDF: CK_EC_KDF_TYPE = 7; +pub const CKD_SHA512_KDF: CK_EC_KDF_TYPE = 8; +pub const CKD_CPDIVERSIFY_KDF: CK_EC_KDF_TYPE = 9; +pub const CKD_SHA3_224_KDF: CK_EC_KDF_TYPE = 10; +pub const CKD_SHA3_256_KDF: CK_EC_KDF_TYPE = 11; +pub const CKD_SHA3_384_KDF: CK_EC_KDF_TYPE = 12; +pub const CKD_SHA3_512_KDF: CK_EC_KDF_TYPE = 13; +pub const CKD_SHA1_KDF_SP800: CK_EC_KDF_TYPE = 14; +pub const CKD_SHA224_KDF_SP800: CK_EC_KDF_TYPE = 15; +pub const CKD_SHA256_KDF_SP800: CK_EC_KDF_TYPE = 16; +pub const CKD_SHA384_KDF_SP800: CK_EC_KDF_TYPE = 17; +pub const CKD_SHA512_KDF_SP800: CK_EC_KDF_TYPE = 18; +pub const CKD_SHA3_224_KDF_SP800: CK_EC_KDF_TYPE = 19; +pub const CKD_SHA3_256_KDF_SP800: CK_EC_KDF_TYPE = 20; +pub const CKD_SHA3_384_KDF_SP800: CK_EC_KDF_TYPE = 21; +pub const CKD_SHA3_512_KDF_SP800: CK_EC_KDF_TYPE = 22; +pub const CKD_BLAKE2B_160_KDF: CK_EC_KDF_TYPE = 23; +pub const CKD_BLAKE2B_256_KDF: CK_EC_KDF_TYPE = 24; +pub const CKD_BLAKE2B_384_KDF: CK_EC_KDF_TYPE = 25; +pub const CKD_BLAKE2B_512_KDF: CK_EC_KDF_TYPE = 26; +pub const CKP_PKCS5_PBKD2_HMAC_SHA1: CK_PROFILE_ID = 1; +pub const CKP_PKCS5_PBKD2_HMAC_GOSTR3411: CK_PROFILE_ID = 2; +pub const CKP_PKCS5_PBKD2_HMAC_SHA224: CK_PROFILE_ID = 3; +pub const CKP_PKCS5_PBKD2_HMAC_SHA256: CK_PROFILE_ID = 4; +pub const CKP_PKCS5_PBKD2_HMAC_SHA384: CK_PROFILE_ID = 5; +pub const CKP_PKCS5_PBKD2_HMAC_SHA512: CK_PROFILE_ID = 6; +pub const CKP_PKCS5_PBKD2_HMAC_SHA512_224: CK_PROFILE_ID = 7; +pub const CKP_PKCS5_PBKD2_HMAC_SHA512_256: CK_PROFILE_ID = 8; +pub const CKZ_SALT_SPECIFIED: CK_RSA_PKCS_OAEP_SOURCE_TYPE = 1; +pub const CK_OTP_VALUE: CK_ULONG = 0; +pub const CK_OTP_PIN: CK_ULONG = 1; +pub const CK_OTP_CHALLENGE: CK_ULONG = 2; +pub const CK_OTP_TIME: CK_ULONG = 3; +pub const CK_OTP_COUNTER: CK_ULONG = 4; +pub const CK_OTP_FLAGS: CK_ULONG = 5; +pub const CK_OTP_OUTPUT_LENGTH: CK_ULONG = 6; +pub const CK_OTP_OUTPUT_FORMAT: CK_ULONG = 7; +pub const CKF_NEXT_OTP: CK_FLAGS = 1; +pub const CKF_EXCLUDE_TIME: CK_FLAGS = 2; +pub const CKF_EXCLUDE_COUNTER: CK_FLAGS = 4; +pub const CKF_EXCLUDE_CHALLENGE: CK_FLAGS = 8; +pub const CKF_EXCLUDE_PIN: CK_FLAGS = 16; +pub const CKF_USER_FRIENDLY_OTP: CK_FLAGS = 32; +pub const CKG_NO_GENERATE: u32 = 0; +pub const CKG_GENERATE: u32 = 1; +pub const CKG_GENERATE_COUNTER: u32 = 2; +pub const CKG_GENERATE_RANDOM: u32 = 3; +pub const CK_SP800_108_ITERATION_VARIABLE: CK_ULONG = 1; +pub const CK_SP800_108_OPTIONAL_COUNTER: CK_ULONG = 2; +pub const CK_SP800_108_DKM_LENGTH: CK_ULONG = 3; +pub const CK_SP800_108_BYTE_ARRAY: CK_ULONG = 4; +pub const CKF_HKDF_SALT_NULL: CK_FLAGS = 1; +pub const CKF_HKDF_SALT_DATA: CK_FLAGS = 2; +pub const CKF_HKDF_SALT_KEY: CK_FLAGS = 4; +pub const CK_NEED_ARG_LIST: CK_ULONG = 1; +pub const CK_PKCS11_2_0_ONLY: CK_ULONG = 1; +pub type CK_BYTE = ::std::os::raw::c_uchar; +pub type CK_CHAR = CK_BYTE; +pub type CK_UTF8CHAR = CK_BYTE; +pub type CK_BBOOL = CK_BYTE; +pub type CK_ULONG = ::std::os::raw::c_ulong; +pub type CK_LONG = ::std::os::raw::c_long; +pub type CK_FLAGS = CK_ULONG; +pub type CK_BYTE_PTR = *mut CK_BYTE; +pub type CK_CHAR_PTR = *mut CK_CHAR; +pub type CK_UTF8CHAR_PTR = *mut CK_UTF8CHAR; +pub type CK_ULONG_PTR = *mut CK_ULONG; +pub type CK_VOID_PTR = *mut ::std::os::raw::c_void; +pub type CK_VOID_PTR_PTR = *mut CK_VOID_PTR; #[repr(C)] #[derive(Debug, Default, Copy, Clone)] -pub struct _CK_VERSION { - pub major: ::std::os::raw::c_uchar, - pub minor: ::std::os::raw::c_uchar, +pub struct CK_VERSION { + pub major: CK_BYTE, + pub minor: CK_BYTE, } #[test] -fn bindgen_test_layout__CK_VERSION() { - const UNINIT: ::std::mem::MaybeUninit<_CK_VERSION> = ::std::mem::MaybeUninit::uninit(); +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::<_CK_VERSION>(), + ::std::mem::size_of::(), 2usize, - concat!("Size of: ", stringify!(_CK_VERSION)) + concat!("Size of: ", stringify!(CK_VERSION)) ); assert_eq!( - ::std::mem::align_of::<_CK_VERSION>(), + ::std::mem::align_of::(), 1usize, - concat!("Alignment of ", stringify!(_CK_VERSION)) + 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!(CK_VERSION), "::", stringify!(major) ) @@ -722,41 +929,42 @@ fn bindgen_test_layout__CK_VERSION() { 1usize, concat!( "Offset of field: ", - stringify!(_CK_VERSION), + stringify!(CK_VERSION), "::", stringify!(minor) ) ); } +pub type CK_VERSION_PTR = *mut CK_VERSION; #[repr(C)] #[derive(Debug, Default, Copy, Clone)] -pub struct _CK_INFO { - pub cryptokiVersion: _CK_VERSION, - pub manufacturerID: [::std::os::raw::c_uchar; 32usize], +pub struct CK_INFO { + pub cryptokiVersion: CK_VERSION, + pub manufacturerID: [CK_UTF8CHAR; 32usize], pub flags: CK_FLAGS, - pub libraryDescription: [::std::os::raw::c_uchar; 32usize], - pub libraryVersion: _CK_VERSION, + pub libraryDescription: [CK_UTF8CHAR; 32usize], + pub libraryVersion: CK_VERSION, } #[test] -fn bindgen_test_layout__CK_INFO() { - const UNINIT: ::std::mem::MaybeUninit<_CK_INFO> = ::std::mem::MaybeUninit::uninit(); +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::<_CK_INFO>(), + ::std::mem::size_of::(), 88usize, - concat!("Size of: ", stringify!(_CK_INFO)) + concat!("Size of: ", stringify!(CK_INFO)) ); assert_eq!( - ::std::mem::align_of::<_CK_INFO>(), + ::std::mem::align_of::(), 8usize, - concat!("Alignment of ", stringify!(_CK_INFO)) + 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!(CK_INFO), "::", stringify!(cryptokiVersion) ) @@ -766,7 +974,7 @@ fn bindgen_test_layout__CK_INFO() { 2usize, concat!( "Offset of field: ", - stringify!(_CK_INFO), + stringify!(CK_INFO), "::", stringify!(manufacturerID) ) @@ -776,7 +984,7 @@ fn bindgen_test_layout__CK_INFO() { 40usize, concat!( "Offset of field: ", - stringify!(_CK_INFO), + stringify!(CK_INFO), "::", stringify!(flags) ) @@ -786,7 +994,7 @@ fn bindgen_test_layout__CK_INFO() { 48usize, concat!( "Offset of field: ", - stringify!(_CK_INFO), + stringify!(CK_INFO), "::", stringify!(libraryDescription) ) @@ -796,44 +1004,45 @@ fn bindgen_test_layout__CK_INFO() { 80usize, concat!( "Offset of field: ", - stringify!(_CK_INFO), + stringify!(CK_INFO), "::", stringify!(libraryVersion) ) ); } -pub type CK_NOTIFICATION = ::std::os::raw::c_ulong; -pub const CKN_SURRENDER: ::std::os::raw::c_ulong = 0; -pub type CK_SLOT_ID = ::std::os::raw::c_ulong; +pub type CK_INFO_PTR = *mut CK_INFO; +pub type CK_NOTIFICATION = CK_ULONG; +pub type CK_SLOT_ID = CK_ULONG; +pub type CK_SLOT_ID_PTR = *mut CK_SLOT_ID; #[repr(C)] #[derive(Debug, Copy, Clone)] -pub struct _CK_SLOT_INFO { - pub slotDescription: [::std::os::raw::c_uchar; 64usize], - pub manufacturerID: [::std::os::raw::c_uchar; 32usize], +pub struct CK_SLOT_INFO { + pub slotDescription: [CK_UTF8CHAR; 64usize], + pub manufacturerID: [CK_UTF8CHAR; 32usize], pub flags: CK_FLAGS, - pub hardwareVersion: _CK_VERSION, - pub firmwareVersion: _CK_VERSION, + pub hardwareVersion: CK_VERSION, + pub firmwareVersion: CK_VERSION, } #[test] -fn bindgen_test_layout__CK_SLOT_INFO() { - const UNINIT: ::std::mem::MaybeUninit<_CK_SLOT_INFO> = ::std::mem::MaybeUninit::uninit(); +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::<_CK_SLOT_INFO>(), + ::std::mem::size_of::(), 112usize, - concat!("Size of: ", stringify!(_CK_SLOT_INFO)) + concat!("Size of: ", stringify!(CK_SLOT_INFO)) ); assert_eq!( - ::std::mem::align_of::<_CK_SLOT_INFO>(), + ::std::mem::align_of::(), 8usize, - concat!("Alignment of ", stringify!(_CK_SLOT_INFO)) + 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!(CK_SLOT_INFO), "::", stringify!(slotDescription) ) @@ -843,7 +1052,7 @@ fn bindgen_test_layout__CK_SLOT_INFO() { 64usize, concat!( "Offset of field: ", - stringify!(_CK_SLOT_INFO), + stringify!(CK_SLOT_INFO), "::", stringify!(manufacturerID) ) @@ -853,7 +1062,7 @@ fn bindgen_test_layout__CK_SLOT_INFO() { 96usize, concat!( "Offset of field: ", - stringify!(_CK_SLOT_INFO), + stringify!(CK_SLOT_INFO), "::", stringify!(flags) ) @@ -863,7 +1072,7 @@ fn bindgen_test_layout__CK_SLOT_INFO() { 104usize, concat!( "Offset of field: ", - stringify!(_CK_SLOT_INFO), + stringify!(CK_SLOT_INFO), "::", stringify!(hardwareVersion) ) @@ -873,13 +1082,13 @@ fn bindgen_test_layout__CK_SLOT_INFO() { 106usize, concat!( "Offset of field: ", - stringify!(_CK_SLOT_INFO), + stringify!(CK_SLOT_INFO), "::", stringify!(firmwareVersion) ) ); } -impl Default for _CK_SLOT_INFO { +impl Default for CK_SLOT_INFO { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { @@ -888,52 +1097,49 @@ impl Default for _CK_SLOT_INFO { } } } -pub const CKF_TOKEN_PRESENT: ::std::os::raw::c_ulong = 1; -pub const CKF_REMOVABLE_DEVICE: ::std::os::raw::c_ulong = 2; -pub const CKF_HW_SLOT: ::std::os::raw::c_ulong = 4; -pub const CKF_ARRAY_ATTRIBUTE: ::std::os::raw::c_ulong = 1073741824; +pub type CK_SLOT_INFO_PTR = *mut CK_SLOT_INFO; #[repr(C)] #[derive(Debug, Default, Copy, Clone)] -pub struct _CK_TOKEN_INFO { - pub label: [::std::os::raw::c_uchar; 32usize], - pub manufacturerID: [::std::os::raw::c_uchar; 32usize], - pub model: [::std::os::raw::c_uchar; 16usize], - pub serialNumber: [::std::os::raw::c_uchar; 16usize], +pub struct CK_TOKEN_INFO { + pub label: [CK_UTF8CHAR; 32usize], + pub manufacturerID: [CK_UTF8CHAR; 32usize], + pub model: [CK_UTF8CHAR; 16usize], + pub serialNumber: [CK_CHAR; 16usize], pub flags: CK_FLAGS, - pub ulMaxSessionCount: ::std::os::raw::c_ulong, - pub ulSessionCount: ::std::os::raw::c_ulong, - pub ulMaxRwSessionCount: ::std::os::raw::c_ulong, - pub ulRwSessionCount: ::std::os::raw::c_ulong, - pub ulMaxPinLen: ::std::os::raw::c_ulong, - pub ulMinPinLen: ::std::os::raw::c_ulong, - pub ulTotalPublicMemory: ::std::os::raw::c_ulong, - pub ulFreePublicMemory: ::std::os::raw::c_ulong, - pub ulTotalPrivateMemory: ::std::os::raw::c_ulong, - pub ulFreePrivateMemory: ::std::os::raw::c_ulong, - pub hardwareVersion: _CK_VERSION, - pub firmwareVersion: _CK_VERSION, - pub utcTime: [::std::os::raw::c_uchar; 16usize], + pub ulMaxSessionCount: CK_ULONG, + pub ulSessionCount: CK_ULONG, + pub ulMaxRwSessionCount: CK_ULONG, + pub ulRwSessionCount: CK_ULONG, + pub ulMaxPinLen: CK_ULONG, + pub ulMinPinLen: CK_ULONG, + pub ulTotalPublicMemory: CK_ULONG, + pub ulFreePublicMemory: CK_ULONG, + pub ulTotalPrivateMemory: CK_ULONG, + pub ulFreePrivateMemory: CK_ULONG, + pub hardwareVersion: CK_VERSION, + pub firmwareVersion: CK_VERSION, + pub utcTime: [CK_CHAR; 16usize], } #[test] -fn bindgen_test_layout__CK_TOKEN_INFO() { - const UNINIT: ::std::mem::MaybeUninit<_CK_TOKEN_INFO> = ::std::mem::MaybeUninit::uninit(); +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::<_CK_TOKEN_INFO>(), + ::std::mem::size_of::(), 208usize, - concat!("Size of: ", stringify!(_CK_TOKEN_INFO)) + concat!("Size of: ", stringify!(CK_TOKEN_INFO)) ); assert_eq!( - ::std::mem::align_of::<_CK_TOKEN_INFO>(), + ::std::mem::align_of::(), 8usize, - concat!("Alignment of ", stringify!(_CK_TOKEN_INFO)) + 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!(CK_TOKEN_INFO), "::", stringify!(label) ) @@ -943,7 +1149,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { 32usize, concat!( "Offset of field: ", - stringify!(_CK_TOKEN_INFO), + stringify!(CK_TOKEN_INFO), "::", stringify!(manufacturerID) ) @@ -953,7 +1159,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { 64usize, concat!( "Offset of field: ", - stringify!(_CK_TOKEN_INFO), + stringify!(CK_TOKEN_INFO), "::", stringify!(model) ) @@ -963,7 +1169,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { 80usize, concat!( "Offset of field: ", - stringify!(_CK_TOKEN_INFO), + stringify!(CK_TOKEN_INFO), "::", stringify!(serialNumber) ) @@ -973,7 +1179,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { 96usize, concat!( "Offset of field: ", - stringify!(_CK_TOKEN_INFO), + stringify!(CK_TOKEN_INFO), "::", stringify!(flags) ) @@ -983,7 +1189,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { 104usize, concat!( "Offset of field: ", - stringify!(_CK_TOKEN_INFO), + stringify!(CK_TOKEN_INFO), "::", stringify!(ulMaxSessionCount) ) @@ -993,7 +1199,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { 112usize, concat!( "Offset of field: ", - stringify!(_CK_TOKEN_INFO), + stringify!(CK_TOKEN_INFO), "::", stringify!(ulSessionCount) ) @@ -1003,7 +1209,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { 120usize, concat!( "Offset of field: ", - stringify!(_CK_TOKEN_INFO), + stringify!(CK_TOKEN_INFO), "::", stringify!(ulMaxRwSessionCount) ) @@ -1013,7 +1219,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { 128usize, concat!( "Offset of field: ", - stringify!(_CK_TOKEN_INFO), + stringify!(CK_TOKEN_INFO), "::", stringify!(ulRwSessionCount) ) @@ -1023,7 +1229,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { 136usize, concat!( "Offset of field: ", - stringify!(_CK_TOKEN_INFO), + stringify!(CK_TOKEN_INFO), "::", stringify!(ulMaxPinLen) ) @@ -1033,7 +1239,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { 144usize, concat!( "Offset of field: ", - stringify!(_CK_TOKEN_INFO), + stringify!(CK_TOKEN_INFO), "::", stringify!(ulMinPinLen) ) @@ -1043,7 +1249,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { 152usize, concat!( "Offset of field: ", - stringify!(_CK_TOKEN_INFO), + stringify!(CK_TOKEN_INFO), "::", stringify!(ulTotalPublicMemory) ) @@ -1053,7 +1259,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { 160usize, concat!( "Offset of field: ", - stringify!(_CK_TOKEN_INFO), + stringify!(CK_TOKEN_INFO), "::", stringify!(ulFreePublicMemory) ) @@ -1063,7 +1269,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { 168usize, concat!( "Offset of field: ", - stringify!(_CK_TOKEN_INFO), + stringify!(CK_TOKEN_INFO), "::", stringify!(ulTotalPrivateMemory) ) @@ -1073,7 +1279,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { 176usize, concat!( "Offset of field: ", - stringify!(_CK_TOKEN_INFO), + stringify!(CK_TOKEN_INFO), "::", stringify!(ulFreePrivateMemory) ) @@ -1083,7 +1289,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { 184usize, concat!( "Offset of field: ", - stringify!(_CK_TOKEN_INFO), + stringify!(CK_TOKEN_INFO), "::", stringify!(hardwareVersion) ) @@ -1093,7 +1299,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { 186usize, concat!( "Offset of field: ", - stringify!(_CK_TOKEN_INFO), + stringify!(CK_TOKEN_INFO), "::", stringify!(firmwareVersion) ) @@ -1103,43 +1309,45 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { 188usize, concat!( "Offset of field: ", - stringify!(_CK_TOKEN_INFO), + stringify!(CK_TOKEN_INFO), "::", stringify!(utcTime) ) ); } -pub type CK_SESSION_HANDLE = ::std::os::raw::c_ulong; -pub type CK_USER_TYPE = ::std::os::raw::c_ulong; -pub type CK_STATE = ::std::os::raw::c_ulong; +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; +pub type CK_USER_TYPE = CK_ULONG; +pub type CK_STATE = CK_ULONG; #[repr(C)] #[derive(Debug, Default, Copy, Clone)] -pub struct _CK_SESSION_INFO { +pub struct CK_SESSION_INFO { pub slotID: CK_SLOT_ID, pub state: CK_STATE, pub flags: CK_FLAGS, - pub ulDeviceError: ::std::os::raw::c_ulong, + pub ulDeviceError: CK_ULONG, } #[test] -fn bindgen_test_layout__CK_SESSION_INFO() { - const UNINIT: ::std::mem::MaybeUninit<_CK_SESSION_INFO> = ::std::mem::MaybeUninit::uninit(); +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::<_CK_SESSION_INFO>(), + ::std::mem::size_of::(), 32usize, - concat!("Size of: ", stringify!(_CK_SESSION_INFO)) + concat!("Size of: ", stringify!(CK_SESSION_INFO)) ); assert_eq!( - ::std::mem::align_of::<_CK_SESSION_INFO>(), + ::std::mem::align_of::(), 8usize, - concat!("Alignment of ", stringify!(_CK_SESSION_INFO)) + 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!(CK_SESSION_INFO), "::", stringify!(slotID) ) @@ -1149,7 +1357,7 @@ fn bindgen_test_layout__CK_SESSION_INFO() { 8usize, concat!( "Offset of field: ", - stringify!(_CK_SESSION_INFO), + stringify!(CK_SESSION_INFO), "::", stringify!(state) ) @@ -1159,7 +1367,7 @@ fn bindgen_test_layout__CK_SESSION_INFO() { 16usize, concat!( "Offset of field: ", - stringify!(_CK_SESSION_INFO), + stringify!(CK_SESSION_INFO), "::", stringify!(flags) ) @@ -1169,45 +1377,48 @@ fn bindgen_test_layout__CK_SESSION_INFO() { 24usize, concat!( "Offset of field: ", - stringify!(_CK_SESSION_INFO), + stringify!(CK_SESSION_INFO), "::", stringify!(ulDeviceError) ) ); } -pub type CK_OBJECT_HANDLE = ::std::os::raw::c_ulong; -pub type CK_OBJECT_CLASS = ::std::os::raw::c_ulong; -pub type CK_HW_FEATURE_TYPE = ::std::os::raw::c_ulong; -pub type CK_KEY_TYPE = ::std::os::raw::c_ulong; -pub type CK_CERTIFICATE_TYPE = ::std::os::raw::c_ulong; -pub type CK_ATTRIBUTE_TYPE = ::std::os::raw::c_ulong; +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; +pub type CK_OBJECT_CLASS = CK_ULONG; +pub type CK_OBJECT_CLASS_PTR = *mut CK_OBJECT_CLASS; +pub type CK_HW_FEATURE_TYPE = CK_ULONG; +pub type CK_KEY_TYPE = CK_ULONG; +pub type CK_CERTIFICATE_TYPE = CK_ULONG; +pub type CK_ATTRIBUTE_TYPE = CK_ULONG; #[repr(C)] #[derive(Debug, Copy, Clone)] -pub struct _CK_ATTRIBUTE { +pub struct CK_ATTRIBUTE { pub type_: CK_ATTRIBUTE_TYPE, - pub pValue: *mut ::std::os::raw::c_void, - pub ulValueLen: ::std::os::raw::c_ulong, + pub pValue: CK_VOID_PTR, + pub ulValueLen: CK_ULONG, } #[test] -fn bindgen_test_layout__CK_ATTRIBUTE() { - const UNINIT: ::std::mem::MaybeUninit<_CK_ATTRIBUTE> = ::std::mem::MaybeUninit::uninit(); +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::<_CK_ATTRIBUTE>(), + ::std::mem::size_of::(), 24usize, - concat!("Size of: ", stringify!(_CK_ATTRIBUTE)) + concat!("Size of: ", stringify!(CK_ATTRIBUTE)) ); assert_eq!( - ::std::mem::align_of::<_CK_ATTRIBUTE>(), + ::std::mem::align_of::(), 8usize, - concat!("Alignment of ", stringify!(_CK_ATTRIBUTE)) + 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!(CK_ATTRIBUTE), "::", stringify!(type_) ) @@ -1217,7 +1428,7 @@ fn bindgen_test_layout__CK_ATTRIBUTE() { 8usize, concat!( "Offset of field: ", - stringify!(_CK_ATTRIBUTE), + stringify!(CK_ATTRIBUTE), "::", stringify!(pValue) ) @@ -1227,13 +1438,13 @@ fn bindgen_test_layout__CK_ATTRIBUTE() { 16usize, concat!( "Offset of field: ", - stringify!(_CK_ATTRIBUTE), + stringify!(CK_ATTRIBUTE), "::", stringify!(ulValueLen) ) ); } -impl Default for _CK_ATTRIBUTE { +impl Default for CK_ATTRIBUTE { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { @@ -1242,33 +1453,34 @@ impl Default for _CK_ATTRIBUTE { } } } +pub type CK_ATTRIBUTE_PTR = *mut CK_ATTRIBUTE; #[repr(C)] #[derive(Debug, Default, Copy, Clone)] -pub struct _CK_DATE { - pub year: [::std::os::raw::c_uchar; 4usize], - pub month: [::std::os::raw::c_uchar; 2usize], - pub day: [::std::os::raw::c_uchar; 2usize], +pub struct CK_DATE { + pub year: [CK_CHAR; 4usize], + pub month: [CK_CHAR; 2usize], + pub day: [CK_CHAR; 2usize], } #[test] -fn bindgen_test_layout__CK_DATE() { - const UNINIT: ::std::mem::MaybeUninit<_CK_DATE> = ::std::mem::MaybeUninit::uninit(); +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::<_CK_DATE>(), + ::std::mem::size_of::(), 8usize, - concat!("Size of: ", stringify!(_CK_DATE)) + concat!("Size of: ", stringify!(CK_DATE)) ); assert_eq!( - ::std::mem::align_of::<_CK_DATE>(), + ::std::mem::align_of::(), 1usize, - concat!("Alignment of ", stringify!(_CK_DATE)) + 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!(CK_DATE), "::", stringify!(year) ) @@ -1278,7 +1490,7 @@ fn bindgen_test_layout__CK_DATE() { 4usize, concat!( "Offset of field: ", - stringify!(_CK_DATE), + stringify!(CK_DATE), "::", stringify!(month) ) @@ -1288,40 +1500,41 @@ fn bindgen_test_layout__CK_DATE() { 6usize, concat!( "Offset of field: ", - stringify!(_CK_DATE), + stringify!(CK_DATE), "::", stringify!(day) ) ); } -pub type CK_MECHANISM_TYPE = ::std::os::raw::c_ulong; +pub type CK_MECHANISM_TYPE = CK_ULONG; +pub type CK_MECHANISM_TYPE_PTR = *mut CK_MECHANISM_TYPE; #[repr(C)] #[derive(Debug, Copy, Clone)] -pub struct _CK_MECHANISM { +pub struct CK_MECHANISM { pub mechanism: CK_MECHANISM_TYPE, - pub pParameter: *mut ::std::os::raw::c_void, - pub ulParameterLen: ::std::os::raw::c_ulong, + pub pParameter: CK_VOID_PTR, + pub ulParameterLen: CK_ULONG, } #[test] -fn bindgen_test_layout__CK_MECHANISM() { - const UNINIT: ::std::mem::MaybeUninit<_CK_MECHANISM> = ::std::mem::MaybeUninit::uninit(); +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::<_CK_MECHANISM>(), + ::std::mem::size_of::(), 24usize, - concat!("Size of: ", stringify!(_CK_MECHANISM)) + concat!("Size of: ", stringify!(CK_MECHANISM)) ); assert_eq!( - ::std::mem::align_of::<_CK_MECHANISM>(), + ::std::mem::align_of::(), 8usize, - concat!("Alignment of ", stringify!(_CK_MECHANISM)) + 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!(CK_MECHANISM), "::", stringify!(mechanism) ) @@ -1331,7 +1544,7 @@ fn bindgen_test_layout__CK_MECHANISM() { 8usize, concat!( "Offset of field: ", - stringify!(_CK_MECHANISM), + stringify!(CK_MECHANISM), "::", stringify!(pParameter) ) @@ -1341,13 +1554,13 @@ fn bindgen_test_layout__CK_MECHANISM() { 16usize, concat!( "Offset of field: ", - stringify!(_CK_MECHANISM), + stringify!(CK_MECHANISM), "::", stringify!(ulParameterLen) ) ); } -impl Default for _CK_MECHANISM { +impl Default for CK_MECHANISM { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { @@ -1356,33 +1569,34 @@ impl Default for _CK_MECHANISM { } } } +pub type CK_MECHANISM_PTR = *mut CK_MECHANISM; #[repr(C)] #[derive(Debug, Default, Copy, Clone)] -pub struct _CK_MECHANISM_INFO { - pub ulMinKeySize: ::std::os::raw::c_ulong, - pub ulMaxKeySize: ::std::os::raw::c_ulong, +pub struct CK_MECHANISM_INFO { + pub ulMinKeySize: CK_ULONG, + pub ulMaxKeySize: CK_ULONG, pub flags: CK_FLAGS, } #[test] -fn bindgen_test_layout__CK_MECHANISM_INFO() { - const UNINIT: ::std::mem::MaybeUninit<_CK_MECHANISM_INFO> = ::std::mem::MaybeUninit::uninit(); +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::<_CK_MECHANISM_INFO>(), + ::std::mem::size_of::(), 24usize, - concat!("Size of: ", stringify!(_CK_MECHANISM_INFO)) + concat!("Size of: ", stringify!(CK_MECHANISM_INFO)) ); assert_eq!( - ::std::mem::align_of::<_CK_MECHANISM_INFO>(), + ::std::mem::align_of::(), 8usize, - concat!("Alignment of ", stringify!(_CK_MECHANISM_INFO)) + 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!(CK_MECHANISM_INFO), "::", stringify!(ulMinKeySize) ) @@ -1392,7 +1606,7 @@ fn bindgen_test_layout__CK_MECHANISM_INFO() { 8usize, concat!( "Offset of field: ", - stringify!(_CK_MECHANISM_INFO), + stringify!(CK_MECHANISM_INFO), "::", stringify!(ulMaxKeySize) ) @@ -1402,66 +1616,78 @@ fn bindgen_test_layout__CK_MECHANISM_INFO() { 16usize, concat!( "Offset of field: ", - stringify!(_CK_MECHANISM_INFO), + stringify!(CK_MECHANISM_INFO), "::", stringify!(flags) ) ); } -pub type CK_PARAM_TYPE = ::std::os::raw::c_ulong; +pub type CK_MECHANISM_INFO_PTR = *mut CK_MECHANISM_INFO; +pub type CK_RV = CK_ULONG; +pub type CK_NOTIFY = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + event: CK_NOTIFICATION, + pApplication: CK_VOID_PTR, + ) -> CK_RV, +>; +pub type CK_FUNCTION_LIST_PTR = *mut CK_FUNCTION_LIST; +pub type CK_FUNCTION_LIST_3_0_PTR = *mut CK_FUNCTION_LIST_3_0; +pub type CK_FUNCTION_LIST_PTR_PTR = *mut CK_FUNCTION_LIST_PTR; +pub type CK_FUNCTION_LIST_3_0_PTR_PTR = *mut CK_FUNCTION_LIST_3_0_PTR; #[repr(C)] #[derive(Debug, Copy, Clone)] -pub struct CK_OTP_PARAM { - pub type_: CK_PARAM_TYPE, - pub pValue: *mut ::std::os::raw::c_void, - pub ulValueLen: ::std::os::raw::c_ulong, +pub struct CK_INTERFACE { + pub pInterfaceName: *mut CK_CHAR, + pub pFunctionList: CK_VOID_PTR, + pub flags: CK_FLAGS, } #[test] -fn bindgen_test_layout_CK_OTP_PARAM() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); +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::(), + ::std::mem::size_of::(), 24usize, - concat!("Size of: ", stringify!(CK_OTP_PARAM)) + concat!("Size of: ", stringify!(CK_INTERFACE)) ); assert_eq!( - ::std::mem::align_of::(), + ::std::mem::align_of::(), 8usize, - concat!("Alignment of ", stringify!(CK_OTP_PARAM)) + concat!("Alignment of ", stringify!(CK_INTERFACE)) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).type_) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).pInterfaceName) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", - stringify!(CK_OTP_PARAM), + stringify!(CK_INTERFACE), "::", - stringify!(type_) + stringify!(pInterfaceName) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pValue) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).pFunctionList) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", - stringify!(CK_OTP_PARAM), + stringify!(CK_INTERFACE), "::", - stringify!(pValue) + stringify!(pFunctionList) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulValueLen) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).flags) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", - stringify!(CK_OTP_PARAM), + stringify!(CK_INTERFACE), "::", - stringify!(ulValueLen) + stringify!(flags) ) ); } -impl Default for CK_OTP_PARAM { +impl Default for CK_INTERFACE { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { @@ -1470,99 +1696,100 @@ impl Default for CK_OTP_PARAM { } } } +pub type CK_INTERFACE_PTR = *mut CK_INTERFACE; +pub type CK_INTERFACE_PTR_PTR = *mut CK_INTERFACE_PTR; +pub type CK_CREATEMUTEX = + ::std::option::Option CK_RV>; +pub type CK_DESTROYMUTEX = + ::std::option::Option CK_RV>; +pub type CK_LOCKMUTEX = ::std::option::Option CK_RV>; +pub type CK_UNLOCKMUTEX = ::std::option::Option CK_RV>; #[repr(C)] #[derive(Debug, Copy, Clone)] -pub struct CK_OTP_PARAMS { - pub pParams: *mut CK_OTP_PARAM, - pub ulCount: ::std::os::raw::c_ulong, +pub struct CK_C_INITIALIZE_ARGS { + pub CreateMutex: CK_CREATEMUTEX, + pub DestroyMutex: CK_DESTROYMUTEX, + pub LockMutex: CK_LOCKMUTEX, + pub UnlockMutex: CK_UNLOCKMUTEX, + pub flags: CK_FLAGS, + pub pReserved: CK_VOID_PTR, } #[test] -fn bindgen_test_layout_CK_OTP_PARAMS() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); +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::(), - 16usize, - concat!("Size of: ", stringify!(CK_OTP_PARAMS)) + ::std::mem::size_of::(), + 48usize, + concat!("Size of: ", stringify!(CK_C_INITIALIZE_ARGS)) ); assert_eq!( - ::std::mem::align_of::(), + ::std::mem::align_of::(), 8usize, - concat!("Alignment of ", stringify!(CK_OTP_PARAMS)) + concat!("Alignment of ", stringify!(CK_C_INITIALIZE_ARGS)) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pParams) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).CreateMutex) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", - stringify!(CK_OTP_PARAMS), + stringify!(CK_C_INITIALIZE_ARGS), "::", - stringify!(pParams) + stringify!(CreateMutex) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulCount) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).DestroyMutex) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", - stringify!(CK_OTP_PARAMS), + stringify!(CK_C_INITIALIZE_ARGS), "::", - stringify!(ulCount) + stringify!(DestroyMutex) ) ); -} -impl Default for CK_OTP_PARAMS { - fn default() -> Self { - let mut s = ::std::mem::MaybeUninit::::uninit(); - unsafe { - ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct CK_OTP_SIGNATURE_INFO { - pub pParams: *mut CK_OTP_PARAM, - pub ulCount: ::std::os::raw::c_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::(), + unsafe { ::std::ptr::addr_of!((*ptr).LockMutex) as usize - ptr as usize }, 16usize, - concat!("Size of: ", stringify!(CK_OTP_SIGNATURE_INFO)) + concat!( + "Offset of field: ", + stringify!(CK_C_INITIALIZE_ARGS), + "::", + stringify!(LockMutex) + ) ); assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(CK_OTP_SIGNATURE_INFO)) + 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).pParams) as usize - ptr as usize }, - 0usize, + unsafe { ::std::ptr::addr_of!((*ptr).flags) as usize - ptr as usize }, + 32usize, concat!( "Offset of field: ", - stringify!(CK_OTP_SIGNATURE_INFO), + stringify!(CK_C_INITIALIZE_ARGS), "::", - stringify!(pParams) + stringify!(flags) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulCount) as usize - ptr as usize }, - 8usize, + unsafe { ::std::ptr::addr_of!((*ptr).pReserved) as usize - ptr as usize }, + 40usize, concat!( "Offset of field: ", - stringify!(CK_OTP_SIGNATURE_INFO), + stringify!(CK_C_INITIALIZE_ARGS), "::", - stringify!(ulCount) + stringify!(pReserved) ) ); } -impl Default for CK_OTP_SIGNATURE_INFO { +impl Default for CK_C_INITIALIZE_ARGS { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { @@ -1571,35 +1798,41 @@ impl Default for CK_OTP_SIGNATURE_INFO { } } } -pub type CK_RSA_PKCS_MGF_TYPE = ::std::os::raw::c_ulong; +pub type CK_C_INITIALIZE_ARGS_PTR = *mut CK_C_INITIALIZE_ARGS; +pub type CK_RSA_PKCS_MGF_TYPE = CK_ULONG; +pub type CK_RSA_PKCS_MGF_TYPE_PTR = *mut CK_RSA_PKCS_MGF_TYPE; +pub type CK_RSA_PKCS_OAEP_SOURCE_TYPE = CK_ULONG; +pub type CK_RSA_PKCS_OAEP_SOURCE_TYPE_PTR = *mut CK_RSA_PKCS_OAEP_SOURCE_TYPE; #[repr(C)] -#[derive(Debug, Default, Copy, Clone)] -pub struct ck_rsa_pkcs_pss_params { +#[derive(Debug, Copy, Clone)] +pub struct CK_RSA_PKCS_OAEP_PARAMS { pub hashAlg: CK_MECHANISM_TYPE, pub mgf: CK_RSA_PKCS_MGF_TYPE, - pub sLen: ::std::os::raw::c_ulong, + pub source: CK_RSA_PKCS_OAEP_SOURCE_TYPE, + pub pSourceData: CK_VOID_PTR, + pub ulSourceDataLen: CK_ULONG, } #[test] -fn bindgen_test_layout_ck_rsa_pkcs_pss_params() { - const UNINIT: ::std::mem::MaybeUninit = +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_pss_params)) + ::std::mem::size_of::(), + 40usize, + concat!("Size of: ", stringify!(CK_RSA_PKCS_OAEP_PARAMS)) ); assert_eq!( - ::std::mem::align_of::(), + ::std::mem::align_of::(), 8usize, - concat!("Alignment of ", stringify!(ck_rsa_pkcs_pss_params)) + 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_pss_params), + stringify!(CK_RSA_PKCS_OAEP_PARAMS), "::", stringify!(hashAlg) ) @@ -1609,75 +1842,19 @@ fn bindgen_test_layout_ck_rsa_pkcs_pss_params() { 8usize, concat!( "Offset of field: ", - stringify!(ck_rsa_pkcs_pss_params), + stringify!(CK_RSA_PKCS_OAEP_PARAMS), "::", stringify!(mgf) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).sLen) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).source) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", - stringify!(ck_rsa_pkcs_pss_params), + stringify!(CK_RSA_PKCS_OAEP_PARAMS), "::", - stringify!(sLen) - ) - ); -} -pub type CK_RSA_PKCS_OAEP_SOURCE_TYPE = ::std::os::raw::c_ulong; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct ck_rsa_pkcs_oaep_params { - pub hashAlg: CK_MECHANISM_TYPE, - pub mgf: CK_RSA_PKCS_MGF_TYPE, - pub source: CK_RSA_PKCS_OAEP_SOURCE_TYPE, - pub pSourceData: *mut ::std::os::raw::c_void, - pub ulSourceDataLen: ::std::os::raw::c_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::(), - 40usize, - concat!("Size of: ", stringify!(ck_rsa_pkcs_oaep_params)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - 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 }, - 8usize, - 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 }, - 16usize, - concat!( - "Offset of field: ", - stringify!(ck_rsa_pkcs_oaep_params), - "::", - stringify!(source) + stringify!(source) ) ); assert_eq!( @@ -1685,7 +1862,7 @@ fn bindgen_test_layout_ck_rsa_pkcs_oaep_params() { 24usize, concat!( "Offset of field: ", - stringify!(ck_rsa_pkcs_oaep_params), + stringify!(CK_RSA_PKCS_OAEP_PARAMS), "::", stringify!(pSourceData) ) @@ -1695,13 +1872,13 @@ fn bindgen_test_layout_ck_rsa_pkcs_oaep_params() { 32usize, concat!( "Offset of field: ", - stringify!(ck_rsa_pkcs_oaep_params), + stringify!(CK_RSA_PKCS_OAEP_PARAMS), "::", stringify!(ulSourceDataLen) ) ); } -impl Default for ck_rsa_pkcs_oaep_params { +impl Default for CK_RSA_PKCS_OAEP_PARAMS { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { @@ -1710,133 +1887,138 @@ impl Default for ck_rsa_pkcs_oaep_params { } } } +pub type CK_RSA_PKCS_OAEP_PARAMS_PTR = *mut CK_RSA_PKCS_OAEP_PARAMS; #[repr(C)] #[derive(Debug, Default, Copy, Clone)] -pub struct ck_aes_ctr_params { - pub ulCounterBits: ::std::os::raw::c_ulong, - pub cb: [::std::os::raw::c_uchar; 16usize], +pub struct CK_RSA_PKCS_PSS_PARAMS { + pub hashAlg: CK_MECHANISM_TYPE, + pub mgf: CK_RSA_PKCS_MGF_TYPE, + pub sLen: CK_ULONG, } #[test] -fn bindgen_test_layout_ck_aes_ctr_params() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); +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::(), + ::std::mem::size_of::(), 24usize, - concat!("Size of: ", stringify!(ck_aes_ctr_params)) + concat!("Size of: ", stringify!(CK_RSA_PKCS_PSS_PARAMS)) ); assert_eq!( - ::std::mem::align_of::(), + ::std::mem::align_of::(), 8usize, - concat!("Alignment of ", stringify!(ck_aes_ctr_params)) + concat!("Alignment of ", stringify!(CK_RSA_PKCS_PSS_PARAMS)) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulCounterBits) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).hashAlg) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", - stringify!(ck_aes_ctr_params), + stringify!(CK_RSA_PKCS_PSS_PARAMS), "::", - stringify!(ulCounterBits) + stringify!(hashAlg) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).cb) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).mgf) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", - stringify!(ck_aes_ctr_params), + stringify!(CK_RSA_PKCS_PSS_PARAMS), "::", - stringify!(cb) + stringify!(mgf) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).sLen) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(CK_RSA_PKCS_PSS_PARAMS), + "::", + stringify!(sLen) ) ); } +pub type CK_RSA_PKCS_PSS_PARAMS_PTR = *mut CK_RSA_PKCS_PSS_PARAMS; +pub type CK_EC_KDF_TYPE = CK_ULONG; #[repr(C)] #[derive(Debug, Copy, Clone)] -pub struct ck_gcm_params { - pub pIv: *mut ::std::os::raw::c_uchar, - pub ulIvLen: ::std::os::raw::c_ulong, - pub ulIvBits: ::std::os::raw::c_ulong, - pub pAAD: *mut ::std::os::raw::c_uchar, - pub ulAADLen: ::std::os::raw::c_ulong, - pub ulTagBits: ::std::os::raw::c_ulong, +pub struct CK_ECDH1_DERIVE_PARAMS { + pub kdf: CK_EC_KDF_TYPE, + pub ulSharedDataLen: CK_ULONG, + pub pSharedData: CK_BYTE_PTR, + pub ulPublicDataLen: CK_ULONG, + pub pPublicData: CK_BYTE_PTR, } #[test] -fn bindgen_test_layout_ck_gcm_params() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); +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::(), - 48usize, - concat!("Size of: ", stringify!(ck_gcm_params)) + ::std::mem::size_of::(), + 40usize, + concat!("Size of: ", stringify!(CK_ECDH1_DERIVE_PARAMS)) ); assert_eq!( - ::std::mem::align_of::(), + ::std::mem::align_of::(), 8usize, - concat!("Alignment of ", stringify!(ck_gcm_params)) + concat!("Alignment of ", stringify!(CK_ECDH1_DERIVE_PARAMS)) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pIv) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).kdf) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", - stringify!(ck_gcm_params), + stringify!(CK_ECDH1_DERIVE_PARAMS), "::", - stringify!(pIv) + stringify!(kdf) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulIvLen) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ulSharedDataLen) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", - stringify!(ck_gcm_params), + stringify!(CK_ECDH1_DERIVE_PARAMS), "::", - stringify!(ulIvLen) + stringify!(ulSharedDataLen) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulIvBits) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).pSharedData) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", - stringify!(ck_gcm_params), + stringify!(CK_ECDH1_DERIVE_PARAMS), "::", - stringify!(ulIvBits) + stringify!(pSharedData) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pAAD) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ulPublicDataLen) as usize - ptr as usize }, 24usize, concat!( "Offset of field: ", - stringify!(ck_gcm_params), + stringify!(CK_ECDH1_DERIVE_PARAMS), "::", - stringify!(pAAD) + stringify!(ulPublicDataLen) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulAADLen) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).pPublicData) as usize - ptr as usize }, 32usize, concat!( "Offset of field: ", - stringify!(ck_gcm_params), - "::", - stringify!(ulAADLen) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulTagBits) as usize - ptr as usize }, - 40usize, - concat!( - "Offset of field: ", - stringify!(ck_gcm_params), + stringify!(CK_ECDH1_DERIVE_PARAMS), "::", - stringify!(ulTagBits) + stringify!(pPublicData) ) ); } -impl Default for ck_gcm_params { +impl Default for CK_ECDH1_DERIVE_PARAMS { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { @@ -1845,37 +2027,41 @@ impl Default for ck_gcm_params { } } } -pub type ck_ec_kdf_t = ::std::os::raw::c_ulong; +pub type CK_ECDH1_DERIVE_PARAMS_PTR = *mut CK_ECDH1_DERIVE_PARAMS; #[repr(C)] #[derive(Debug, Copy, Clone)] -pub struct ck_ecdh1_derive_params { - pub kdf: ck_ec_kdf_t, - pub ulSharedDataLen: ::std::os::raw::c_ulong, - pub pSharedData: *mut ::std::os::raw::c_uchar, - pub ulPublicDataLen: ::std::os::raw::c_ulong, - pub pPublicData: *mut ::std::os::raw::c_uchar, +pub struct CK_ECDH2_DERIVE_PARAMS { + pub kdf: CK_EC_KDF_TYPE, + pub ulSharedDataLen: CK_ULONG, + pub pSharedData: CK_BYTE_PTR, + pub ulPublicDataLen: CK_ULONG, + pub pPublicData: CK_BYTE_PTR, + pub ulPrivateDataLen: CK_ULONG, + pub hPrivateData: CK_OBJECT_HANDLE, + pub ulPublicDataLen2: CK_ULONG, + pub pPublicData2: CK_BYTE_PTR, } #[test] -fn bindgen_test_layout_ck_ecdh1_derive_params() { - const UNINIT: ::std::mem::MaybeUninit = +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::(), - 40usize, - concat!("Size of: ", stringify!(ck_ecdh1_derive_params)) + ::std::mem::size_of::(), + 72usize, + concat!("Size of: ", stringify!(CK_ECDH2_DERIVE_PARAMS)) ); assert_eq!( - ::std::mem::align_of::(), + ::std::mem::align_of::(), 8usize, - concat!("Alignment of ", stringify!(ck_ecdh1_derive_params)) + 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_ecdh1_derive_params), + stringify!(CK_ECDH2_DERIVE_PARAMS), "::", stringify!(kdf) ) @@ -1885,7 +2071,7 @@ fn bindgen_test_layout_ck_ecdh1_derive_params() { 8usize, concat!( "Offset of field: ", - stringify!(ck_ecdh1_derive_params), + stringify!(CK_ECDH2_DERIVE_PARAMS), "::", stringify!(ulSharedDataLen) ) @@ -1895,7 +2081,7 @@ fn bindgen_test_layout_ck_ecdh1_derive_params() { 16usize, concat!( "Offset of field: ", - stringify!(ck_ecdh1_derive_params), + stringify!(CK_ECDH2_DERIVE_PARAMS), "::", stringify!(pSharedData) ) @@ -1905,7 +2091,7 @@ fn bindgen_test_layout_ck_ecdh1_derive_params() { 24usize, concat!( "Offset of field: ", - stringify!(ck_ecdh1_derive_params), + stringify!(CK_ECDH2_DERIVE_PARAMS), "::", stringify!(ulPublicDataLen) ) @@ -1915,13 +2101,53 @@ fn bindgen_test_layout_ck_ecdh1_derive_params() { 32usize, concat!( "Offset of field: ", - stringify!(ck_ecdh1_derive_params), + stringify!(CK_ECDH2_DERIVE_PARAMS), "::", stringify!(pPublicData) ) ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ulPrivateDataLen) as usize - ptr as usize }, + 40usize, + 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 }, + 48usize, + 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 }, + 56usize, + 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 }, + 64usize, + concat!( + "Offset of field: ", + stringify!(CK_ECDH2_DERIVE_PARAMS), + "::", + stringify!(pPublicData2) + ) + ); } -impl Default for ck_ecdh1_derive_params { +impl Default for CK_ECDH2_DERIVE_PARAMS { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { @@ -1930,49 +2156,138 @@ impl Default for ck_ecdh1_derive_params { } } } +pub type CK_ECDH2_DERIVE_PARAMS_PTR = *mut CK_ECDH2_DERIVE_PARAMS; #[repr(C)] #[derive(Debug, Copy, Clone)] -pub struct ck_key_derivation_string_data { - pub pData: *mut ::std::os::raw::c_uchar, - pub ulLen: ::std::os::raw::c_ulong, +pub struct CK_ECMQV_DERIVE_PARAMS { + pub kdf: CK_EC_KDF_TYPE, + pub ulSharedDataLen: CK_ULONG, + pub pSharedData: CK_BYTE_PTR, + pub ulPublicDataLen: CK_ULONG, + pub pPublicData: CK_BYTE_PTR, + pub ulPrivateDataLen: CK_ULONG, + pub hPrivateData: CK_OBJECT_HANDLE, + pub ulPublicDataLen2: CK_ULONG, + pub pPublicData2: CK_BYTE_PTR, + pub publicKey: CK_OBJECT_HANDLE, } #[test] -fn bindgen_test_layout_ck_key_derivation_string_data() { - const UNINIT: ::std::mem::MaybeUninit = +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::(), - 16usize, - concat!("Size of: ", stringify!(ck_key_derivation_string_data)) + ::std::mem::size_of::(), + 80usize, + concat!("Size of: ", stringify!(CK_ECMQV_DERIVE_PARAMS)) ); assert_eq!( - ::std::mem::align_of::(), + ::std::mem::align_of::(), 8usize, - concat!("Alignment of ", stringify!(ck_key_derivation_string_data)) + concat!("Alignment of ", stringify!(CK_ECMQV_DERIVE_PARAMS)) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pData) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).kdf) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", - stringify!(ck_key_derivation_string_data), + stringify!(CK_ECMQV_DERIVE_PARAMS), "::", - stringify!(pData) + stringify!(kdf) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulLen) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ulSharedDataLen) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", - stringify!(ck_key_derivation_string_data), + stringify!(CK_ECMQV_DERIVE_PARAMS), "::", - stringify!(ulLen) + stringify!(ulSharedDataLen) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pSharedData) as usize - ptr as usize }, + 16usize, + 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 }, + 24usize, + 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 }, + 32usize, + 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 }, + 40usize, + 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 }, + 48usize, + 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 }, + 56usize, + 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 }, + 64usize, + 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 }, + 72usize, + concat!( + "Offset of field: ", + stringify!(CK_ECMQV_DERIVE_PARAMS), + "::", + stringify!(publicKey) ) ); } -impl Default for ck_key_derivation_string_data { +impl Default for CK_ECMQV_DERIVE_PARAMS { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { @@ -1981,60 +2296,85 @@ impl Default for ck_key_derivation_string_data { } } } +pub type CK_ECMQV_DERIVE_PARAMS_PTR = *mut CK_ECMQV_DERIVE_PARAMS; +pub type CK_X9_42_DH_KDF_TYPE = CK_ULONG; +pub type CK_X9_42_DH_KDF_TYPE_PTR = *mut CK_X9_42_DH_KDF_TYPE; #[repr(C)] #[derive(Debug, Copy, Clone)] -pub struct ck_des_cbc_encrypt_data_params { - pub iv: [::std::os::raw::c_uchar; 8usize], - pub pData: *mut ::std::os::raw::c_uchar, - pub length: ::std::os::raw::c_ulong, +pub struct CK_X9_42_DH1_DERIVE_PARAMS { + pub kdf: CK_X9_42_DH_KDF_TYPE, + pub ulOtherInfoLen: CK_ULONG, + pub pOtherInfo: CK_BYTE_PTR, + pub ulPublicDataLen: CK_ULONG, + pub pPublicData: CK_BYTE_PTR, } #[test] -fn bindgen_test_layout_ck_des_cbc_encrypt_data_params() { - const UNINIT: ::std::mem::MaybeUninit = +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::(), - 24usize, - concat!("Size of: ", stringify!(ck_des_cbc_encrypt_data_params)) + ::std::mem::size_of::(), + 40usize, + concat!("Size of: ", stringify!(CK_X9_42_DH1_DERIVE_PARAMS)) ); assert_eq!( - ::std::mem::align_of::(), + ::std::mem::align_of::(), 8usize, - concat!("Alignment of ", stringify!(ck_des_cbc_encrypt_data_params)) + concat!("Alignment of ", stringify!(CK_X9_42_DH1_DERIVE_PARAMS)) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).iv) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).kdf) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", - stringify!(ck_des_cbc_encrypt_data_params), + stringify!(CK_X9_42_DH1_DERIVE_PARAMS), "::", - stringify!(iv) + stringify!(kdf) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pData) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ulOtherInfoLen) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", - stringify!(ck_des_cbc_encrypt_data_params), + stringify!(CK_X9_42_DH1_DERIVE_PARAMS), "::", - stringify!(pData) + stringify!(ulOtherInfoLen) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).length) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).pOtherInfo) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", - stringify!(ck_des_cbc_encrypt_data_params), + stringify!(CK_X9_42_DH1_DERIVE_PARAMS), "::", - stringify!(length) + stringify!(pOtherInfo) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ulPublicDataLen) as usize - ptr as usize }, + 24usize, + 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 }, + 32usize, + concat!( + "Offset of field: ", + stringify!(CK_X9_42_DH1_DERIVE_PARAMS), + "::", + stringify!(pPublicData) ) ); } -impl Default for ck_des_cbc_encrypt_data_params { +impl Default for CK_X9_42_DH1_DERIVE_PARAMS { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { @@ -2043,540 +2383,7363 @@ impl Default for ck_des_cbc_encrypt_data_params { } } } +pub type CK_X9_42_DH1_DERIVE_PARAMS_PTR = *mut CK_X9_42_DH1_DERIVE_PARAMS; #[repr(C)] #[derive(Debug, Copy, Clone)] -pub struct ck_aes_cbc_encrypt_data_params { - pub iv: [::std::os::raw::c_uchar; 16usize], - pub pData: *mut ::std::os::raw::c_uchar, - pub length: ::std::os::raw::c_ulong, +pub struct CK_X9_42_DH2_DERIVE_PARAMS { + pub kdf: CK_X9_42_DH_KDF_TYPE, + pub ulOtherInfoLen: CK_ULONG, + pub pOtherInfo: CK_BYTE_PTR, + pub ulPublicDataLen: CK_ULONG, + pub pPublicData: CK_BYTE_PTR, + pub ulPrivateDataLen: CK_ULONG, + pub hPrivateData: CK_OBJECT_HANDLE, + pub ulPublicDataLen2: CK_ULONG, + pub pPublicData2: CK_BYTE_PTR, } #[test] -fn bindgen_test_layout_ck_aes_cbc_encrypt_data_params() { - const UNINIT: ::std::mem::MaybeUninit = +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::(), - 32usize, - concat!("Size of: ", stringify!(ck_aes_cbc_encrypt_data_params)) + ::std::mem::size_of::(), + 72usize, + concat!("Size of: ", stringify!(CK_X9_42_DH2_DERIVE_PARAMS)) ); assert_eq!( - ::std::mem::align_of::(), + ::std::mem::align_of::(), 8usize, - concat!("Alignment of ", stringify!(ck_aes_cbc_encrypt_data_params)) + concat!("Alignment of ", stringify!(CK_X9_42_DH2_DERIVE_PARAMS)) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).iv) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).kdf) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", - stringify!(ck_aes_cbc_encrypt_data_params), + stringify!(CK_X9_42_DH2_DERIVE_PARAMS), "::", - stringify!(iv) + stringify!(kdf) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pData) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ulOtherInfoLen) as usize - ptr as usize }, + 8usize, + 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 }, 16usize, concat!( "Offset of field: ", - stringify!(ck_aes_cbc_encrypt_data_params), + stringify!(CK_X9_42_DH2_DERIVE_PARAMS), "::", - stringify!(pData) + stringify!(pOtherInfo) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).length) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ulPublicDataLen) as usize - ptr as usize }, 24usize, concat!( "Offset of field: ", - stringify!(ck_aes_cbc_encrypt_data_params), + stringify!(CK_X9_42_DH2_DERIVE_PARAMS), "::", - stringify!(length) + stringify!(ulPublicDataLen) ) ); -} -impl Default for ck_aes_cbc_encrypt_data_params { - fn default() -> Self { - let mut s = ::std::mem::MaybeUninit::::uninit(); - unsafe { - ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -pub type CK_RV = ::std::os::raw::c_ulong; -pub type CK_NOTIFY = ::std::option::Option< - unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - event: CK_NOTIFICATION, - application: *mut ::std::os::raw::c_void, - ) -> CK_RV, ->; -pub type CK_C_Initialize = - ::std::option::Option CK_RV>; -pub type CK_C_Finalize = - ::std::option::Option CK_RV>; -pub type CK_C_GetInfo = ::std::option::Option CK_RV>; -pub type CK_C_GetFunctionList = ::std::option::Option< - unsafe extern "C" fn(function_list: *mut *mut _CK_FUNCTION_LIST) -> CK_RV, ->; -pub type CK_C_GetSlotList = ::std::option::Option< - unsafe extern "C" fn( - token_present: ::std::os::raw::c_uchar, - slot_list: *mut CK_SLOT_ID, - ulCount: *mut ::std::os::raw::c_ulong, - ) -> CK_RV, ->; -pub type CK_C_GetSlotInfo = ::std::option::Option< - unsafe extern "C" fn(slotID: CK_SLOT_ID, info: *mut _CK_SLOT_INFO) -> CK_RV, ->; -pub type CK_C_GetTokenInfo = ::std::option::Option< - unsafe extern "C" fn(slotID: CK_SLOT_ID, info: *mut _CK_TOKEN_INFO) -> CK_RV, ->; -pub type CK_C_WaitForSlotEvent = ::std::option::Option< + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pPublicData) as usize - ptr as usize }, + 32usize, + 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 }, + 40usize, + 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 }, + 48usize, + 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 }, + 56usize, + 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 }, + 64usize, + concat!( + "Offset of field: ", + stringify!(CK_X9_42_DH2_DERIVE_PARAMS), + "::", + stringify!(pPublicData2) + ) + ); +} +impl Default for CK_X9_42_DH2_DERIVE_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_X9_42_DH2_DERIVE_PARAMS_PTR = *mut CK_X9_42_DH2_DERIVE_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_X9_42_MQV_DERIVE_PARAMS { + pub kdf: CK_X9_42_DH_KDF_TYPE, + pub ulOtherInfoLen: CK_ULONG, + pub pOtherInfo: CK_BYTE_PTR, + pub ulPublicDataLen: CK_ULONG, + pub pPublicData: CK_BYTE_PTR, + pub ulPrivateDataLen: CK_ULONG, + pub hPrivateData: CK_OBJECT_HANDLE, + pub ulPublicDataLen2: CK_ULONG, + 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::(), + 80usize, + concat!("Size of: ", stringify!(CK_X9_42_MQV_DERIVE_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + 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 }, + 16usize, + 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 }, + 24usize, + 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 }, + 32usize, + 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 }, + 40usize, + 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 }, + 48usize, + 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 }, + 56usize, + 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 }, + 64usize, + 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 }, + 72usize, + concat!( + "Offset of field: ", + stringify!(CK_X9_42_MQV_DERIVE_PARAMS), + "::", + stringify!(publicKey) + ) + ); +} +impl Default for CK_X9_42_MQV_DERIVE_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_X9_42_MQV_DERIVE_PARAMS_PTR = *mut CK_X9_42_MQV_DERIVE_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_KEA_DERIVE_PARAMS { + pub isSender: CK_BBOOL, + pub ulRandomLen: CK_ULONG, + pub pRandomA: CK_BYTE_PTR, + pub pRandomB: CK_BYTE_PTR, + 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::(), + 48usize, + concat!("Size of: ", stringify!(CK_KEA_DERIVE_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + 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 }, + 16usize, + 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 }, + 24usize, + 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 }, + 32usize, + 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 }, + 40usize, + concat!( + "Offset of field: ", + stringify!(CK_KEA_DERIVE_PARAMS), + "::", + stringify!(pPublicData) + ) + ); +} +impl Default for CK_KEA_DERIVE_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_KEA_DERIVE_PARAMS_PTR = *mut CK_KEA_DERIVE_PARAMS; +pub type CK_RC2_PARAMS = CK_ULONG; +pub type CK_RC2_PARAMS_PTR = *mut CK_RC2_PARAMS; +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +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::(), + 16usize, + concat!("Size of: ", stringify!(CK_RC2_CBC_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + concat!( + "Offset of field: ", + stringify!(CK_RC2_CBC_PARAMS), + "::", + stringify!(iv) + ) + ); +} +pub type CK_RC2_CBC_PARAMS_PTR = *mut CK_RC2_CBC_PARAMS; +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +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::(), + 16usize, + concat!("Size of: ", stringify!(CK_RC2_MAC_GENERAL_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + concat!( + "Offset of field: ", + stringify!(CK_RC2_MAC_GENERAL_PARAMS), + "::", + stringify!(ulMacLength) + ) + ); +} +pub type CK_RC2_MAC_GENERAL_PARAMS_PTR = *mut CK_RC2_MAC_GENERAL_PARAMS; +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +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::(), + 16usize, + concat!("Size of: ", stringify!(CK_RC5_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + concat!( + "Offset of field: ", + stringify!(CK_RC5_PARAMS), + "::", + stringify!(ulRounds) + ) + ); +} +pub type CK_RC5_PARAMS_PTR = *mut CK_RC5_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_RC5_CBC_PARAMS { + pub ulWordsize: CK_ULONG, + pub ulRounds: CK_ULONG, + 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::(), + 32usize, + concat!("Size of: ", stringify!(CK_RC5_CBC_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + 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 }, + 16usize, + 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 }, + 24usize, + concat!( + "Offset of field: ", + stringify!(CK_RC5_CBC_PARAMS), + "::", + stringify!(ulIvLen) + ) + ); +} +impl Default for CK_RC5_CBC_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_RC5_CBC_PARAMS_PTR = *mut CK_RC5_CBC_PARAMS; +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct CK_RC5_MAC_GENERAL_PARAMS { + pub ulWordsize: CK_ULONG, + 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::(), + 24usize, + concat!("Size of: ", stringify!(CK_RC5_MAC_GENERAL_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + 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 }, + 16usize, + concat!( + "Offset of field: ", + stringify!(CK_RC5_MAC_GENERAL_PARAMS), + "::", + stringify!(ulMacLength) + ) + ); +} +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; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_DES_CBC_ENCRYPT_DATA_PARAMS { + pub iv: [CK_BYTE; 8usize], + 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::(), + 24usize, + concat!("Size of: ", stringify!(CK_DES_CBC_ENCRYPT_DATA_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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) + ) + ); +} +impl Default for CK_DES_CBC_ENCRYPT_DATA_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_DES_CBC_ENCRYPT_DATA_PARAMS_PTR = *mut CK_DES_CBC_ENCRYPT_DATA_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_AES_CBC_ENCRYPT_DATA_PARAMS { + pub iv: [CK_BYTE; 16usize], + 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::(), + 32usize, + concat!("Size of: ", stringify!(CK_AES_CBC_ENCRYPT_DATA_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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) + ) + ); +} +impl Default for CK_AES_CBC_ENCRYPT_DATA_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_AES_CBC_ENCRYPT_DATA_PARAMS_PTR = *mut CK_AES_CBC_ENCRYPT_DATA_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_SKIPJACK_PRIVATE_WRAP_PARAMS { + pub ulPasswordLen: CK_ULONG, + pub pPassword: CK_BYTE_PTR, + pub ulPublicDataLen: CK_ULONG, + pub pPublicData: CK_BYTE_PTR, + pub ulPAndGLen: CK_ULONG, + pub ulQLen: CK_ULONG, + pub ulRandomLen: CK_ULONG, + pub pRandomA: CK_BYTE_PTR, + pub pPrimeP: CK_BYTE_PTR, + 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::(), + 88usize, + concat!("Size of: ", stringify!(CK_SKIPJACK_PRIVATE_WRAP_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + 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 }, + 16usize, + 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 }, + 24usize, + 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 }, + 32usize, + 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 }, + 40usize, + 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 }, + 48usize, + 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 }, + 56usize, + 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 }, + 64usize, + 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 }, + 72usize, + 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 }, + 80usize, + concat!( + "Offset of field: ", + stringify!(CK_SKIPJACK_PRIVATE_WRAP_PARAMS), + "::", + stringify!(pSubprimeQ) + ) + ); +} +impl Default for CK_SKIPJACK_PRIVATE_WRAP_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_SKIPJACK_PRIVATE_WRAP_PARAMS_PTR = *mut CK_SKIPJACK_PRIVATE_WRAP_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_SKIPJACK_RELAYX_PARAMS { + pub ulOldWrappedXLen: CK_ULONG, + pub pOldWrappedX: CK_BYTE_PTR, + pub ulOldPasswordLen: CK_ULONG, + pub pOldPassword: CK_BYTE_PTR, + pub ulOldPublicDataLen: CK_ULONG, + pub pOldPublicData: CK_BYTE_PTR, + pub ulOldRandomLen: CK_ULONG, + pub pOldRandomA: CK_BYTE_PTR, + pub ulNewPasswordLen: CK_ULONG, + pub pNewPassword: CK_BYTE_PTR, + pub ulNewPublicDataLen: CK_ULONG, + pub pNewPublicData: CK_BYTE_PTR, + 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::(), + 112usize, + concat!("Size of: ", stringify!(CK_SKIPJACK_RELAYX_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + 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 }, + 16usize, + 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 }, + 24usize, + 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 }, + 32usize, + 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 }, + 40usize, + 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 }, + 48usize, + 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 }, + 56usize, + 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 }, + 64usize, + 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 }, + 72usize, + 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 }, + 80usize, + 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 }, + 88usize, + 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 }, + 96usize, + 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 }, + 104usize, + concat!( + "Offset of field: ", + stringify!(CK_SKIPJACK_RELAYX_PARAMS), + "::", + stringify!(pNewRandomA) + ) + ); +} +impl Default for CK_SKIPJACK_RELAYX_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_SKIPJACK_RELAYX_PARAMS_PTR = *mut CK_SKIPJACK_RELAYX_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_PBE_PARAMS { + pub pInitVector: CK_BYTE_PTR, + pub pPassword: CK_UTF8CHAR_PTR, + pub ulPasswordLen: CK_ULONG, + pub pSalt: CK_BYTE_PTR, + 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::(), + 48usize, + concat!("Size of: ", stringify!(CK_PBE_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 24usize, + concat!( + "Offset of field: ", + stringify!(CK_PBE_PARAMS), + "::", + stringify!(pSalt) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ulSaltLen) as usize - ptr as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(CK_PBE_PARAMS), + "::", + stringify!(ulSaltLen) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ulIteration) as usize - ptr as usize }, + 40usize, + concat!( + "Offset of field: ", + stringify!(CK_PBE_PARAMS), + "::", + stringify!(ulIteration) + ) + ); +} +impl Default for CK_PBE_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_PBE_PARAMS_PTR = *mut CK_PBE_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_KEY_WRAP_SET_OAEP_PARAMS { + pub bBC: CK_BYTE, + 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::(), + 24usize, + concat!("Size of: ", stringify!(CK_KEY_WRAP_SET_OAEP_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + 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 }, + 16usize, + concat!( + "Offset of field: ", + stringify!(CK_KEY_WRAP_SET_OAEP_PARAMS), + "::", + stringify!(ulXLen) + ) + ); +} +impl Default for CK_KEY_WRAP_SET_OAEP_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_KEY_WRAP_SET_OAEP_PARAMS_PTR = *mut CK_KEY_WRAP_SET_OAEP_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_SSL3_RANDOM_DATA { + pub pClientRandom: CK_BYTE_PTR, + pub ulClientRandomLen: CK_ULONG, + 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::(), + 32usize, + concat!("Size of: ", stringify!(CK_SSL3_RANDOM_DATA)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 16usize, + 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 }, + 24usize, + concat!( + "Offset of field: ", + stringify!(CK_SSL3_RANDOM_DATA), + "::", + stringify!(ulServerRandomLen) + ) + ); +} +impl Default for CK_SSL3_RANDOM_DATA { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct 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::(), + 40usize, + concat!("Size of: ", stringify!(CK_SSL3_MASTER_KEY_DERIVE_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 32usize, + concat!( + "Offset of field: ", + stringify!(CK_SSL3_MASTER_KEY_DERIVE_PARAMS), + "::", + stringify!(pVersion) + ) + ); +} +impl Default for CK_SSL3_MASTER_KEY_DERIVE_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_SSL3_MASTER_KEY_DERIVE_PARAMS_PTR = *mut CK_SSL3_MASTER_KEY_DERIVE_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_SSL3_KEY_MAT_OUT { + pub hClientMacSecret: CK_OBJECT_HANDLE, + pub hServerMacSecret: CK_OBJECT_HANDLE, + pub hClientKey: CK_OBJECT_HANDLE, + pub hServerKey: CK_OBJECT_HANDLE, + 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::(), + 48usize, + concat!("Size of: ", stringify!(CK_SSL3_KEY_MAT_OUT)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + 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 }, + 16usize, + 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 }, + 24usize, + 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 }, + 32usize, + 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 }, + 40usize, + concat!( + "Offset of field: ", + stringify!(CK_SSL3_KEY_MAT_OUT), + "::", + stringify!(pIVServer) + ) + ); +} +impl Default for CK_SSL3_KEY_MAT_OUT { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_SSL3_KEY_MAT_OUT_PTR = *mut CK_SSL3_KEY_MAT_OUT; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_SSL3_KEY_MAT_PARAMS { + pub ulMacSizeInBits: CK_ULONG, + pub ulKeySizeInBits: CK_ULONG, + pub ulIVSizeInBits: CK_ULONG, + pub bIsExport: CK_BBOOL, + 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::(), + 72usize, + concat!("Size of: ", stringify!(CK_SSL3_KEY_MAT_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + 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 }, + 16usize, + 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 }, + 24usize, + 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 }, + 32usize, + 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 }, + 64usize, + concat!( + "Offset of field: ", + stringify!(CK_SSL3_KEY_MAT_PARAMS), + "::", + stringify!(pReturnedKeyMaterial) + ) + ); +} +impl Default for CK_SSL3_KEY_MAT_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_SSL3_KEY_MAT_PARAMS_PTR = *mut CK_SSL3_KEY_MAT_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_TLS_PRF_PARAMS { + pub pSeed: CK_BYTE_PTR, + pub ulSeedLen: CK_ULONG, + pub pLabel: CK_BYTE_PTR, + pub ulLabelLen: CK_ULONG, + 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::(), + 48usize, + concat!("Size of: ", stringify!(CK_TLS_PRF_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 16usize, + 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 }, + 24usize, + 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 }, + 32usize, + 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 }, + 40usize, + concat!( + "Offset of field: ", + stringify!(CK_TLS_PRF_PARAMS), + "::", + stringify!(pulOutputLen) + ) + ); +} +impl Default for CK_TLS_PRF_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_TLS_PRF_PARAMS_PTR = *mut CK_TLS_PRF_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_WTLS_RANDOM_DATA { + pub pClientRandom: CK_BYTE_PTR, + pub ulClientRandomLen: CK_ULONG, + 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::(), + 32usize, + concat!("Size of: ", stringify!(CK_WTLS_RANDOM_DATA)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 16usize, + 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 }, + 24usize, + concat!( + "Offset of field: ", + stringify!(CK_WTLS_RANDOM_DATA), + "::", + stringify!(ulServerRandomLen) + ) + ); +} +impl Default for CK_WTLS_RANDOM_DATA { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_WTLS_RANDOM_DATA_PTR = *mut CK_WTLS_RANDOM_DATA; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_WTLS_MASTER_KEY_DERIVE_PARAMS { + pub DigestMechanism: CK_MECHANISM_TYPE, + 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::(), + 48usize, + concat!("Size of: ", stringify!(CK_WTLS_MASTER_KEY_DERIVE_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + 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 }, + 40usize, + concat!( + "Offset of field: ", + stringify!(CK_WTLS_MASTER_KEY_DERIVE_PARAMS), + "::", + stringify!(pVersion) + ) + ); +} +impl Default for CK_WTLS_MASTER_KEY_DERIVE_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_WTLS_MASTER_KEY_DERIVE_PARAMS_PTR = *mut CK_WTLS_MASTER_KEY_DERIVE_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_WTLS_PRF_PARAMS { + pub DigestMechanism: CK_MECHANISM_TYPE, + pub pSeed: CK_BYTE_PTR, + pub ulSeedLen: CK_ULONG, + pub pLabel: CK_BYTE_PTR, + pub ulLabelLen: CK_ULONG, + 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::(), + 56usize, + concat!("Size of: ", stringify!(CK_WTLS_PRF_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + 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 }, + 16usize, + 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 }, + 24usize, + 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 }, + 32usize, + 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 }, + 40usize, + 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 }, + 48usize, + concat!( + "Offset of field: ", + stringify!(CK_WTLS_PRF_PARAMS), + "::", + stringify!(pulOutputLen) + ) + ); +} +impl Default for CK_WTLS_PRF_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_WTLS_PRF_PARAMS_PTR = *mut CK_WTLS_PRF_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_WTLS_KEY_MAT_OUT { + pub hMacSecret: CK_OBJECT_HANDLE, + 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::(), + 24usize, + concat!("Size of: ", stringify!(CK_WTLS_KEY_MAT_OUT)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + 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 }, + 16usize, + concat!( + "Offset of field: ", + stringify!(CK_WTLS_KEY_MAT_OUT), + "::", + stringify!(pIV) + ) + ); +} +impl Default for CK_WTLS_KEY_MAT_OUT { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_WTLS_KEY_MAT_OUT_PTR = *mut CK_WTLS_KEY_MAT_OUT; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_WTLS_KEY_MAT_PARAMS { + pub DigestMechanism: CK_MECHANISM_TYPE, + pub ulMacSizeInBits: CK_ULONG, + pub ulKeySizeInBits: CK_ULONG, + pub ulIVSizeInBits: CK_ULONG, + pub ulSequenceNumber: CK_ULONG, + pub bIsExport: CK_BBOOL, + 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::(), + 88usize, + concat!("Size of: ", stringify!(CK_WTLS_KEY_MAT_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + 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 }, + 16usize, + 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 }, + 24usize, + 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 }, + 32usize, + 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 }, + 40usize, + 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 }, + 48usize, + 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 }, + 80usize, + concat!( + "Offset of field: ", + stringify!(CK_WTLS_KEY_MAT_PARAMS), + "::", + stringify!(pReturnedKeyMaterial) + ) + ); +} +impl Default for CK_WTLS_KEY_MAT_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_WTLS_KEY_MAT_PARAMS_PTR = *mut CK_WTLS_KEY_MAT_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_CMS_SIG_PARAMS { + pub certificateHandle: CK_OBJECT_HANDLE, + pub pSigningMechanism: CK_MECHANISM_PTR, + pub pDigestMechanism: CK_MECHANISM_PTR, + pub pContentType: CK_UTF8CHAR_PTR, + pub pRequestedAttributes: CK_BYTE_PTR, + pub ulRequestedAttributesLen: CK_ULONG, + 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::(), + 64usize, + concat!("Size of: ", stringify!(CK_CMS_SIG_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + 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 }, + 16usize, + 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 }, + 24usize, + 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 }, + 32usize, + 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 }, + 40usize, + 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 }, + 48usize, + 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 }, + 56usize, + concat!( + "Offset of field: ", + stringify!(CK_CMS_SIG_PARAMS), + "::", + stringify!(ulRequiredAttributesLen) + ) + ); +} +impl Default for CK_CMS_SIG_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_CMS_SIG_PARAMS_PTR = *mut CK_CMS_SIG_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +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::(), + 16usize, + concat!("Size of: ", stringify!(CK_KEY_DERIVATION_STRING_DATA)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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) + ) + ); +} +impl Default for CK_KEY_DERIVATION_STRING_DATA { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_KEY_DERIVATION_STRING_DATA_PTR = *mut CK_KEY_DERIVATION_STRING_DATA; +pub type CK_EXTRACT_PARAMS = CK_ULONG; +pub type CK_EXTRACT_PARAMS_PTR = *mut CK_EXTRACT_PARAMS; +pub type CK_PKCS5_PBKD2_PSEUDO_RANDOM_FUNCTION_TYPE = CK_ULONG; +pub type CK_PKCS5_PBKD2_PSEUDO_RANDOM_FUNCTION_TYPE_PTR = + *mut CK_PKCS5_PBKD2_PSEUDO_RANDOM_FUNCTION_TYPE; +pub type CK_PKCS5_PBKDF2_SALT_SOURCE_TYPE = CK_ULONG; +pub type CK_PKCS5_PBKDF2_SALT_SOURCE_TYPE_PTR = *mut CK_PKCS5_PBKDF2_SALT_SOURCE_TYPE; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_PKCS5_PBKD2_PARAMS { + pub saltSource: CK_PKCS5_PBKDF2_SALT_SOURCE_TYPE, + pub pSaltSourceData: CK_VOID_PTR, + pub ulSaltSourceDataLen: CK_ULONG, + pub iterations: CK_ULONG, + pub prf: CK_PKCS5_PBKD2_PSEUDO_RANDOM_FUNCTION_TYPE, + pub pPrfData: CK_VOID_PTR, + pub ulPrfDataLen: CK_ULONG, + 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::(), + 72usize, + concat!("Size of: ", stringify!(CK_PKCS5_PBKD2_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + 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 }, + 16usize, + 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 }, + 24usize, + 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 }, + 32usize, + 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 }, + 40usize, + 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 }, + 48usize, + 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 }, + 56usize, + 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 }, + 64usize, + concat!( + "Offset of field: ", + stringify!(CK_PKCS5_PBKD2_PARAMS), + "::", + stringify!(ulPasswordLen) + ) + ); +} +impl Default for CK_PKCS5_PBKD2_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_PKCS5_PBKD2_PARAMS_PTR = *mut CK_PKCS5_PBKD2_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_PKCS5_PBKD2_PARAMS2 { + pub saltSource: CK_PKCS5_PBKDF2_SALT_SOURCE_TYPE, + pub pSaltSourceData: CK_VOID_PTR, + pub ulSaltSourceDataLen: CK_ULONG, + pub iterations: CK_ULONG, + pub prf: CK_PKCS5_PBKD2_PSEUDO_RANDOM_FUNCTION_TYPE, + pub pPrfData: CK_VOID_PTR, + pub ulPrfDataLen: CK_ULONG, + 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::(), + 72usize, + concat!("Size of: ", stringify!(CK_PKCS5_PBKD2_PARAMS2)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + 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 }, + 16usize, + 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 }, + 24usize, + 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 }, + 32usize, + 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 }, + 40usize, + 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 }, + 48usize, + 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 }, + 56usize, + 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 }, + 64usize, + concat!( + "Offset of field: ", + stringify!(CK_PKCS5_PBKD2_PARAMS2), + "::", + stringify!(ulPasswordLen) + ) + ); +} +impl Default for CK_PKCS5_PBKD2_PARAMS2 { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_PKCS5_PBKD2_PARAMS2_PTR = *mut CK_PKCS5_PBKD2_PARAMS2; +pub type CK_OTP_PARAM_TYPE = CK_ULONG; +pub type CK_PARAM_TYPE = CK_OTP_PARAM_TYPE; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_OTP_PARAM { + pub type_: CK_OTP_PARAM_TYPE, + 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::(), + 24usize, + concat!("Size of: ", stringify!(CK_OTP_PARAM)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + concat!( + "Offset of field: ", + stringify!(CK_OTP_PARAM), + "::", + stringify!(pValue) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ulValueLen) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(CK_OTP_PARAM), + "::", + stringify!(ulValueLen) + ) + ); +} +impl Default for CK_OTP_PARAM { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_OTP_PARAM_PTR = *mut CK_OTP_PARAM; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +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::(), + 16usize, + concat!("Size of: ", stringify!(CK_OTP_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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) + ) + ); +} +impl Default for CK_OTP_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_OTP_PARAMS_PTR = *mut CK_OTP_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +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::(), + 16usize, + concat!("Size of: ", stringify!(CK_OTP_SIGNATURE_INFO)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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) + ) + ); +} +impl Default for CK_OTP_SIGNATURE_INFO { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_OTP_SIGNATURE_INFO_PTR = *mut CK_OTP_SIGNATURE_INFO; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_KIP_PARAMS { + pub pMechanism: CK_MECHANISM_PTR, + pub hKey: CK_OBJECT_HANDLE, + 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::(), + 32usize, + concat!("Size of: ", stringify!(CK_KIP_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 16usize, + concat!( + "Offset of field: ", + stringify!(CK_KIP_PARAMS), + "::", + stringify!(pSeed) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ulSeedLen) as usize - ptr as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(CK_KIP_PARAMS), + "::", + stringify!(ulSeedLen) + ) + ); +} +impl Default for CK_KIP_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_KIP_PARAMS_PTR = *mut CK_KIP_PARAMS; +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +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::(), + 24usize, + concat!("Size of: ", stringify!(CK_AES_CTR_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + concat!( + "Offset of field: ", + stringify!(CK_AES_CTR_PARAMS), + "::", + stringify!(cb) + ) + ); +} +pub type CK_AES_CTR_PARAMS_PTR = *mut CK_AES_CTR_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_GCM_PARAMS { + pub pIv: CK_BYTE_PTR, + pub ulIvLen: CK_ULONG, + pub ulIvBits: CK_ULONG, + pub pAAD: CK_BYTE_PTR, + 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::(), + 48usize, + concat!("Size of: ", stringify!(CK_GCM_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 16usize, + concat!( + "Offset of field: ", + stringify!(CK_GCM_PARAMS), + "::", + stringify!(ulIvBits) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pAAD) as usize - ptr as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(CK_GCM_PARAMS), + "::", + stringify!(pAAD) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ulAADLen) as usize - ptr as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(CK_GCM_PARAMS), + "::", + stringify!(ulAADLen) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ulTagBits) as usize - ptr as usize }, + 40usize, + concat!( + "Offset of field: ", + stringify!(CK_GCM_PARAMS), + "::", + stringify!(ulTagBits) + ) + ); +} +impl Default for CK_GCM_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_GCM_PARAMS_PTR = *mut CK_GCM_PARAMS; +pub type CK_GENERATOR_FUNCTION = CK_ULONG; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_GCM_MESSAGE_PARAMS { + pub pIv: CK_BYTE_PTR, + pub ulIvLen: CK_ULONG, + pub ulIvFixedBits: CK_ULONG, + pub ivGenerator: CK_GENERATOR_FUNCTION, + 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::(), + 48usize, + concat!("Size of: ", stringify!(CK_GCM_MESSAGE_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 16usize, + 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 }, + 24usize, + 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 }, + 32usize, + 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 }, + 40usize, + concat!( + "Offset of field: ", + stringify!(CK_GCM_MESSAGE_PARAMS), + "::", + stringify!(ulTagBits) + ) + ); +} +impl Default for CK_GCM_MESSAGE_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_GCM_MESSAGE_PARAMS_PTR = CK_GCM_MESSAGE_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_CCM_PARAMS { + pub ulDataLen: CK_ULONG, + pub pNonce: CK_BYTE_PTR, + pub ulNonceLen: CK_ULONG, + pub pAAD: CK_BYTE_PTR, + 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::(), + 48usize, + concat!("Size of: ", stringify!(CK_CCM_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + concat!( + "Offset of field: ", + stringify!(CK_CCM_PARAMS), + "::", + stringify!(pNonce) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ulNonceLen) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(CK_CCM_PARAMS), + "::", + stringify!(ulNonceLen) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pAAD) as usize - ptr as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(CK_CCM_PARAMS), + "::", + stringify!(pAAD) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ulAADLen) as usize - ptr as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(CK_CCM_PARAMS), + "::", + stringify!(ulAADLen) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ulMACLen) as usize - ptr as usize }, + 40usize, + concat!( + "Offset of field: ", + stringify!(CK_CCM_PARAMS), + "::", + stringify!(ulMACLen) + ) + ); +} +impl Default for CK_CCM_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_CCM_PARAMS_PTR = *mut CK_CCM_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_CCM_MESSAGE_PARAMS { + pub ulDataLen: CK_ULONG, + pub pNonce: CK_BYTE_PTR, + pub ulNonceLen: CK_ULONG, + pub ulNonceFixedBits: CK_ULONG, + pub nonceGenerator: CK_GENERATOR_FUNCTION, + 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::(), + 56usize, + concat!("Size of: ", stringify!(CK_CCM_MESSAGE_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + 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 }, + 16usize, + 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 }, + 24usize, + 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 }, + 32usize, + 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 }, + 40usize, + 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 }, + 48usize, + concat!( + "Offset of field: ", + stringify!(CK_CCM_MESSAGE_PARAMS), + "::", + stringify!(ulMACLen) + ) + ); +} +impl Default for CK_CCM_MESSAGE_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_CCM_MESSAGE_PARAMS_PTR = CK_CCM_MESSAGE_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_AES_GCM_PARAMS { + pub pIv: CK_BYTE_PTR, + pub ulIvLen: CK_ULONG, + pub ulIvBits: CK_ULONG, + pub pAAD: CK_BYTE_PTR, + 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::(), + 48usize, + concat!("Size of: ", stringify!(CK_AES_GCM_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 16usize, + 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 }, + 24usize, + 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 }, + 32usize, + 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 }, + 40usize, + concat!( + "Offset of field: ", + stringify!(CK_AES_GCM_PARAMS), + "::", + stringify!(ulTagBits) + ) + ); +} +impl Default for CK_AES_GCM_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_AES_GCM_PARAMS_PTR = *mut CK_AES_GCM_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_AES_CCM_PARAMS { + pub ulDataLen: CK_ULONG, + pub pNonce: CK_BYTE_PTR, + pub ulNonceLen: CK_ULONG, + pub pAAD: CK_BYTE_PTR, + 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::(), + 48usize, + concat!("Size of: ", stringify!(CK_AES_CCM_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + 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 }, + 16usize, + 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 }, + 24usize, + 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 }, + 32usize, + 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 }, + 40usize, + concat!( + "Offset of field: ", + stringify!(CK_AES_CCM_PARAMS), + "::", + stringify!(ulMACLen) + ) + ); +} +impl Default for CK_AES_CCM_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_AES_CCM_PARAMS_PTR = *mut CK_AES_CCM_PARAMS; +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +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::(), + 24usize, + concat!("Size of: ", stringify!(CK_CAMELLIA_CTR_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + concat!( + "Offset of field: ", + stringify!(CK_CAMELLIA_CTR_PARAMS), + "::", + stringify!(cb) + ) + ); +} +pub type CK_CAMELLIA_CTR_PARAMS_PTR = *mut CK_CAMELLIA_CTR_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_CAMELLIA_CBC_ENCRYPT_DATA_PARAMS { + pub iv: [CK_BYTE; 16usize], + 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::(), + 32usize, + concat!("Size of: ", stringify!(CK_CAMELLIA_CBC_ENCRYPT_DATA_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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) + ) + ); +} +impl Default for CK_CAMELLIA_CBC_ENCRYPT_DATA_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_CAMELLIA_CBC_ENCRYPT_DATA_PARAMS_PTR = *mut CK_CAMELLIA_CBC_ENCRYPT_DATA_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_ARIA_CBC_ENCRYPT_DATA_PARAMS { + pub iv: [CK_BYTE; 16usize], + 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::(), + 32usize, + concat!("Size of: ", stringify!(CK_ARIA_CBC_ENCRYPT_DATA_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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) + ) + ); +} +impl Default for CK_ARIA_CBC_ENCRYPT_DATA_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_ARIA_CBC_ENCRYPT_DATA_PARAMS_PTR = *mut CK_ARIA_CBC_ENCRYPT_DATA_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_DSA_PARAMETER_GEN_PARAM { + pub hash: CK_MECHANISM_TYPE, + pub pSeed: CK_BYTE_PTR, + 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::(), + 32usize, + concat!("Size of: ", stringify!(CK_DSA_PARAMETER_GEN_PARAM)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + 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 }, + 16usize, + 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 }, + 24usize, + concat!( + "Offset of field: ", + stringify!(CK_DSA_PARAMETER_GEN_PARAM), + "::", + stringify!(ulIndex) + ) + ); +} +impl Default for CK_DSA_PARAMETER_GEN_PARAM { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_DSA_PARAMETER_GEN_PARAM_PTR = *mut CK_DSA_PARAMETER_GEN_PARAM; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_ECDH_AES_KEY_WRAP_PARAMS { + pub ulAESKeyBits: CK_ULONG, + pub kdf: CK_EC_KDF_TYPE, + 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::(), + 32usize, + concat!("Size of: ", stringify!(CK_ECDH_AES_KEY_WRAP_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + 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 }, + 16usize, + 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 }, + 24usize, + concat!( + "Offset of field: ", + stringify!(CK_ECDH_AES_KEY_WRAP_PARAMS), + "::", + stringify!(pSharedData) + ) + ); +} +impl Default for CK_ECDH_AES_KEY_WRAP_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_ECDH_AES_KEY_WRAP_PARAMS_PTR = *mut CK_ECDH_AES_KEY_WRAP_PARAMS; +pub type CK_JAVA_MIDP_SECURITY_DOMAIN = CK_ULONG; +pub type CK_CERTIFICATE_CATEGORY = CK_ULONG; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +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::(), + 16usize, + concat!("Size of: ", stringify!(CK_RSA_AES_KEY_WRAP_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + concat!( + "Offset of field: ", + stringify!(CK_RSA_AES_KEY_WRAP_PARAMS), + "::", + stringify!(pOAEPParams) + ) + ); +} +impl Default for CK_RSA_AES_KEY_WRAP_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_RSA_AES_KEY_WRAP_PARAMS_PTR = *mut CK_RSA_AES_KEY_WRAP_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_TLS12_MASTER_KEY_DERIVE_PARAMS { + pub RandomInfo: CK_SSL3_RANDOM_DATA, + 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::(), + 48usize, + concat!("Size of: ", stringify!(CK_TLS12_MASTER_KEY_DERIVE_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 32usize, + 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 }, + 40usize, + concat!( + "Offset of field: ", + stringify!(CK_TLS12_MASTER_KEY_DERIVE_PARAMS), + "::", + stringify!(prfHashMechanism) + ) + ); +} +impl Default for CK_TLS12_MASTER_KEY_DERIVE_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_TLS12_MASTER_KEY_DERIVE_PARAMS_PTR = *mut CK_TLS12_MASTER_KEY_DERIVE_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_TLS12_KEY_MAT_PARAMS { + pub ulMacSizeInBits: CK_ULONG, + pub ulKeySizeInBits: CK_ULONG, + pub ulIVSizeInBits: CK_ULONG, + pub bIsExport: CK_BBOOL, + pub RandomInfo: CK_SSL3_RANDOM_DATA, + 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::(), + 80usize, + concat!("Size of: ", stringify!(CK_TLS12_KEY_MAT_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + 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 }, + 16usize, + 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 }, + 24usize, + 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 }, + 32usize, + 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 }, + 64usize, + 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 }, + 72usize, + concat!( + "Offset of field: ", + stringify!(CK_TLS12_KEY_MAT_PARAMS), + "::", + stringify!(prfHashMechanism) + ) + ); +} +impl Default for CK_TLS12_KEY_MAT_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_TLS12_KEY_MAT_PARAMS_PTR = *mut CK_TLS12_KEY_MAT_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_TLS_KDF_PARAMS { + pub prfMechanism: CK_MECHANISM_TYPE, + pub pLabel: CK_BYTE_PTR, + pub ulLabelLength: CK_ULONG, + pub RandomInfo: CK_SSL3_RANDOM_DATA, + 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::(), + 72usize, + concat!("Size of: ", stringify!(CK_TLS_KDF_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + 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 }, + 16usize, + 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 }, + 24usize, + 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 }, + 56usize, + 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 }, + 64usize, + concat!( + "Offset of field: ", + stringify!(CK_TLS_KDF_PARAMS), + "::", + stringify!(ulContextDataLength) + ) + ); +} +impl Default for CK_TLS_KDF_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_TLS_KDF_PARAMS_PTR = *mut CK_TLS_KDF_PARAMS; +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct CK_TLS_MAC_PARAMS { + pub prfHashMechanism: CK_MECHANISM_TYPE, + 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::(), + 24usize, + concat!("Size of: ", stringify!(CK_TLS_MAC_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + 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 }, + 16usize, + concat!( + "Offset of field: ", + stringify!(CK_TLS_MAC_PARAMS), + "::", + stringify!(ulServerOrClient) + ) + ); +} +pub type CK_TLS_MAC_PARAMS_PTR = *mut CK_TLS_MAC_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_GOSTR3410_DERIVE_PARAMS { + pub kdf: CK_EC_KDF_TYPE, + pub pPublicData: CK_BYTE_PTR, + pub ulPublicDataLen: CK_ULONG, + 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::(), + 40usize, + concat!("Size of: ", stringify!(CK_GOSTR3410_DERIVE_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + 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 }, + 16usize, + 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 }, + 24usize, + 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 }, + 32usize, + concat!( + "Offset of field: ", + stringify!(CK_GOSTR3410_DERIVE_PARAMS), + "::", + stringify!(ulUKMLen) + ) + ); +} +impl Default for CK_GOSTR3410_DERIVE_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_GOSTR3410_DERIVE_PARAMS_PTR = *mut CK_GOSTR3410_DERIVE_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_GOSTR3410_KEY_WRAP_PARAMS { + pub pWrapOID: CK_BYTE_PTR, + pub ulWrapOIDLen: CK_ULONG, + pub pUKM: CK_BYTE_PTR, + 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::(), + 40usize, + concat!("Size of: ", stringify!(CK_GOSTR3410_KEY_WRAP_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 16usize, + 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 }, + 24usize, + 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 }, + 32usize, + concat!( + "Offset of field: ", + stringify!(CK_GOSTR3410_KEY_WRAP_PARAMS), + "::", + stringify!(hKey) + ) + ); +} +impl Default for CK_GOSTR3410_KEY_WRAP_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_GOSTR3410_KEY_WRAP_PARAMS_PTR = *mut CK_GOSTR3410_KEY_WRAP_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_SEED_CBC_ENCRYPT_DATA_PARAMS { + pub iv: [CK_BYTE; 16usize], + 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::(), + 32usize, + concat!("Size of: ", stringify!(CK_SEED_CBC_ENCRYPT_DATA_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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) + ) + ); +} +impl Default for CK_SEED_CBC_ENCRYPT_DATA_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_SEED_CBC_ENCRYPT_DATA_PARAMS_PTR = *mut CK_SEED_CBC_ENCRYPT_DATA_PARAMS; +pub type CK_PROFILE_ID = CK_ULONG; +pub type CK_PRF_DATA_TYPE = CK_ULONG; +pub type CK_SP800_108_PRF_TYPE = CK_MECHANISM_TYPE; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_PRF_DATA_PARAM { + pub type_: CK_PRF_DATA_TYPE, + 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::(), + 24usize, + concat!("Size of: ", stringify!(CK_PRF_DATA_PARAM)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + 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 }, + 16usize, + concat!( + "Offset of field: ", + stringify!(CK_PRF_DATA_PARAM), + "::", + stringify!(ulValueLen) + ) + ); +} +impl Default for CK_PRF_DATA_PARAM { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_PRF_DATA_PARAM_PTR = *mut CK_PRF_DATA_PARAM; +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +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::(), + 16usize, + concat!("Size of: ", stringify!(CK_SP800_108_COUNTER_FORMAT)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + concat!( + "Offset of field: ", + stringify!(CK_SP800_108_COUNTER_FORMAT), + "::", + stringify!(ulWidthInBits) + ) + ); +} +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)] +#[derive(Debug, Default, Copy, Clone)] +pub struct CK_SP800_108_DKM_LENGTH_FORMAT { + pub dkmLengthMethod: CK_SP800_108_DKM_LENGTH_METHOD, + 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::(), + 24usize, + concat!("Size of: ", stringify!(CK_SP800_108_DKM_LENGTH_FORMAT)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + 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 }, + 16usize, + concat!( + "Offset of field: ", + stringify!(CK_SP800_108_DKM_LENGTH_FORMAT), + "::", + stringify!(ulWidthInBits) + ) + ); +} +pub type CK_SP800_108_DKM_LENGTH_FORMAT_PTR = *mut CK_SP800_108_DKM_LENGTH_FORMAT; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_DERIVED_KEY { + pub pTemplate: CK_ATTRIBUTE_PTR, + 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::(), + 24usize, + concat!("Size of: ", stringify!(CK_DERIVED_KEY)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 16usize, + concat!( + "Offset of field: ", + stringify!(CK_DERIVED_KEY), + "::", + stringify!(phKey) + ) + ); +} +impl Default for CK_DERIVED_KEY { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_DERIVED_KEY_PTR = *mut CK_DERIVED_KEY; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_SP800_108_KDF_PARAMS { + pub prfType: CK_SP800_108_PRF_TYPE, + pub ulNumberOfDataParams: CK_ULONG, + pub pDataParams: CK_PRF_DATA_PARAM_PTR, + pub ulAdditionalDerivedKeys: CK_ULONG, + pub pAdditionalDerivedKeys: CK_DERIVED_KEY, +} +#[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::(), + 56usize, + concat!("Size of: ", stringify!(CK_SP800_108_KDF_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + 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 }, + 16usize, + 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 }, + 24usize, + 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 }, + 32usize, + concat!( + "Offset of field: ", + stringify!(CK_SP800_108_KDF_PARAMS), + "::", + stringify!(pAdditionalDerivedKeys) + ) + ); +} +impl Default for CK_SP800_108_KDF_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_SP800_108_KDF_PARAMS_PTR = *mut CK_SP800_108_KDF_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_SP800_108_FEEDBACK_KDF_PARAMS { + pub prfType: CK_SP800_108_PRF_TYPE, + pub ulNumberOfDataParams: CK_ULONG, + pub pDataParams: CK_PRF_DATA_PARAM_PTR, + pub ulIVLen: CK_ULONG, + pub pIV: CK_BYTE_PTR, + pub ulAdditionalDerivedKeys: CK_ULONG, + pub pAdditionalDerivedKeys: CK_DERIVED_KEY, +} +#[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::(), + 72usize, + concat!("Size of: ", stringify!(CK_SP800_108_FEEDBACK_KDF_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + 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 }, + 16usize, + 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 }, + 24usize, + 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 }, + 32usize, + 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 }, + 40usize, + 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 }, + 48usize, + concat!( + "Offset of field: ", + stringify!(CK_SP800_108_FEEDBACK_KDF_PARAMS), + "::", + stringify!(pAdditionalDerivedKeys) + ) + ); +} +impl Default for CK_SP800_108_FEEDBACK_KDF_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_SP800_108_FEEDBACK_KDF_PARAMS_PTR = *mut CK_SP800_108_FEEDBACK_KDF_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_EDDSA_PARAMS { + pub phFlag: CK_BBOOL, + 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::(), + 24usize, + concat!("Size of: ", stringify!(CK_EDDSA_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + concat!( + "Offset of field: ", + stringify!(CK_EDDSA_PARAMS), + "::", + stringify!(ulContextDataLen) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pContextData) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(CK_EDDSA_PARAMS), + "::", + stringify!(pContextData) + ) + ); +} +impl Default for CK_EDDSA_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_EDDSA_PARAMS_PTR = *mut CK_EDDSA_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_CHACHA20_PARAMS { + pub pBlockCounter: CK_BYTE_PTR, + pub blockCounterBits: CK_ULONG, + 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::(), + 32usize, + concat!("Size of: ", stringify!(CK_CHACHA20_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 16usize, + concat!( + "Offset of field: ", + stringify!(CK_CHACHA20_PARAMS), + "::", + stringify!(pNonce) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ulNonceBits) as usize - ptr as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(CK_CHACHA20_PARAMS), + "::", + stringify!(ulNonceBits) + ) + ); +} +impl Default for CK_CHACHA20_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_SALSA20_PARAMS { + pub pBlockCounter: CK_BYTE_PTR, + 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::(), + 24usize, + concat!("Size of: ", stringify!(CK_SALSA20_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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) + ) + ); +} +impl Default for CK_SALSA20_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_SALSA20_CHACHA20_POLY1305_PARAMS { + pub pNonce: CK_BYTE_PTR, + pub ulNonceLen: CK_ULONG, + 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::(), + 32usize, + concat!("Size of: ", stringify!(CK_SALSA20_CHACHA20_POLY1305_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 16usize, + 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 }, + 24usize, + concat!( + "Offset of field: ", + stringify!(CK_SALSA20_CHACHA20_POLY1305_PARAMS), + "::", + stringify!(ulAADLen) + ) + ); +} +impl Default for CK_SALSA20_CHACHA20_POLY1305_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_SALSA20_CHACHA20_POLY1305_PARAMS_PTR = *mut CK_SALSA20_CHACHA20_POLY1305_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_SALSA20_CHACHA20_POLY1305_MSG_PARAMS { + pub pNonce: CK_BYTE_PTR, + 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::(), + 24usize, + concat!( + "Size of: ", + stringify!(CK_SALSA20_CHACHA20_POLY1305_MSG_PARAMS) + ) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 16usize, + concat!( + "Offset of field: ", + stringify!(CK_SALSA20_CHACHA20_POLY1305_MSG_PARAMS), + "::", + stringify!(pTag) + ) + ); +} +impl Default for CK_SALSA20_CHACHA20_POLY1305_MSG_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_SALSA20_CHACHA20_POLY1305_MSG_PARAMS_PTR = *mut CK_SALSA20_CHACHA20_POLY1305_MSG_PARAMS; +pub type CK_X3DH_KDF_TYPE = CK_ULONG; +pub type CK_X3DH_KDF_TYPE_PTR = *mut CK_X3DH_KDF_TYPE; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_X3DH_INITIATE_PARAMS { + pub kdf: CK_X3DH_KDF_TYPE, + pub pPeer_identity: CK_OBJECT_HANDLE, + pub pPeer_prekey: CK_OBJECT_HANDLE, + pub pPrekey_signature: CK_BYTE_PTR, + pub pOnetime_key: CK_BYTE_PTR, + 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::(), + 56usize, + concat!("Size of: ", stringify!(CK_X3DH_INITIATE_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + 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 }, + 16usize, + 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 }, + 24usize, + 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 }, + 32usize, + 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 }, + 40usize, + 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 }, + 48usize, + concat!( + "Offset of field: ", + stringify!(CK_X3DH_INITIATE_PARAMS), + "::", + stringify!(pOwn_ephemeral) + ) + ); +} +impl Default for CK_X3DH_INITIATE_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_X3DH_RESPOND_PARAMS { + pub kdf: CK_X3DH_KDF_TYPE, + pub pIdentity_id: CK_BYTE_PTR, + pub pPrekey_id: CK_BYTE_PTR, + pub pOnetime_id: CK_BYTE_PTR, + 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::(), + 48usize, + concat!("Size of: ", stringify!(CK_X3DH_RESPOND_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + 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 }, + 16usize, + 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 }, + 24usize, + 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 }, + 32usize, + 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 }, + 40usize, + concat!( + "Offset of field: ", + stringify!(CK_X3DH_RESPOND_PARAMS), + "::", + stringify!(pInitiator_ephemeral) + ) + ); +} +impl Default for CK_X3DH_RESPOND_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_X2RATCHET_KDF_TYPE = CK_ULONG; +pub type CK_X2RATCHET_KDF_TYPE_PTR = *mut CK_X2RATCHET_KDF_TYPE; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_X2RATCHET_INITIALIZE_PARAMS { + pub sk: CK_BYTE_PTR, + pub peer_public_prekey: CK_OBJECT_HANDLE, + pub peer_public_identity: CK_OBJECT_HANDLE, + pub own_public_identity: CK_OBJECT_HANDLE, + pub bEncryptedHeader: CK_BBOOL, + pub eCurve: CK_ULONG, + 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::(), + 64usize, + concat!("Size of: ", stringify!(CK_X2RATCHET_INITIALIZE_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 16usize, + 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 }, + 24usize, + 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 }, + 32usize, + 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 }, + 40usize, + 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 }, + 48usize, + 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 }, + 56usize, + concat!( + "Offset of field: ", + stringify!(CK_X2RATCHET_INITIALIZE_PARAMS), + "::", + stringify!(kdfMechanism) + ) + ); +} +impl Default for CK_X2RATCHET_INITIALIZE_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_X2RATCHET_INITIALIZE_PARAMS_PTR = *mut CK_X2RATCHET_INITIALIZE_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_X2RATCHET_RESPOND_PARAMS { + pub sk: CK_BYTE_PTR, + pub own_prekey: CK_OBJECT_HANDLE, + pub initiator_identity: CK_OBJECT_HANDLE, + pub own_public_identity: CK_OBJECT_HANDLE, + pub bEncryptedHeader: CK_BBOOL, + pub eCurve: CK_ULONG, + 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::(), + 64usize, + concat!("Size of: ", stringify!(CK_X2RATCHET_RESPOND_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 16usize, + 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 }, + 24usize, + 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 }, + 32usize, + 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 }, + 40usize, + 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 }, + 48usize, + 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 }, + 56usize, + concat!( + "Offset of field: ", + stringify!(CK_X2RATCHET_RESPOND_PARAMS), + "::", + stringify!(kdfMechanism) + ) + ); +} +impl Default for CK_X2RATCHET_RESPOND_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_X2RATCHET_RESPOND_PARAMS_PTR = *mut CK_X2RATCHET_RESPOND_PARAMS; +pub type CK_XEDDSA_HASH_TYPE = CK_ULONG; +pub type CK_XEDDSA_HASH_TYPE_PTR = *mut CK_XEDDSA_HASH_TYPE; +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +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::(), + 8usize, + concat!("Size of: ", stringify!(CK_XEDDSA_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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) + ) + ); +} +pub type CK_XEDDSA_PARAMS_PTR = *mut CK_XEDDSA_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_HKDF_PARAMS { + pub bExtract: CK_BBOOL, + pub bExpand: CK_BBOOL, + pub prfHashMechanism: CK_MECHANISM_TYPE, + pub ulSaltType: CK_ULONG, + pub pSalt: CK_BYTE_PTR, + pub ulSaltLen: CK_ULONG, + pub hSaltKey: CK_ULONG, + 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::(), + 64usize, + concat!("Size of: ", stringify!(CK_HKDF_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + concat!( + "Offset of field: ", + stringify!(CK_HKDF_PARAMS), + "::", + stringify!(prfHashMechanism) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ulSaltType) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(CK_HKDF_PARAMS), + "::", + stringify!(ulSaltType) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pSalt) as usize - ptr as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(CK_HKDF_PARAMS), + "::", + stringify!(pSalt) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ulSaltLen) as usize - ptr as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(CK_HKDF_PARAMS), + "::", + stringify!(ulSaltLen) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).hSaltKey) as usize - ptr as usize }, + 40usize, + concat!( + "Offset of field: ", + stringify!(CK_HKDF_PARAMS), + "::", + stringify!(hSaltKey) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pInfo) as usize - ptr as usize }, + 48usize, + concat!( + "Offset of field: ", + stringify!(CK_HKDF_PARAMS), + "::", + stringify!(pInfo) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ulInfoLen) as usize - ptr as usize }, + 56usize, + concat!( + "Offset of field: ", + stringify!(CK_HKDF_PARAMS), + "::", + stringify!(ulInfoLen) + ) + ); +} +impl Default for CK_HKDF_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_C_Initialize = + ::std::option::Option CK_RV>; +pub type CK_C_Finalize = + ::std::option::Option CK_RV>; +pub type CK_C_GetInfo = ::std::option::Option CK_RV>; +pub type CK_C_GetFunctionList = + ::std::option::Option CK_RV>; +pub type CK_C_GetSlotList = ::std::option::Option< unsafe extern "C" fn( - flags: CK_FLAGS, - slot: *mut CK_SLOT_ID, - pReserved: *mut ::std::os::raw::c_void, + tokenPresent: CK_BBOOL, + pSlotList: CK_SLOT_ID_PTR, + pulCount: CK_ULONG_PTR, ) -> CK_RV, >; +pub type CK_C_GetSlotInfo = ::std::option::Option< + unsafe extern "C" fn(slotID: CK_SLOT_ID, pInfo: CK_SLOT_INFO_PTR) -> CK_RV, +>; +pub type CK_C_GetTokenInfo = ::std::option::Option< + unsafe extern "C" fn(slotID: CK_SLOT_ID, pInfo: CK_TOKEN_INFO_PTR) -> CK_RV, +>; pub type CK_C_GetMechanismList = ::std::option::Option< unsafe extern "C" fn( slotID: CK_SLOT_ID, - mechanism_list: *mut CK_MECHANISM_TYPE, - ulCount: *mut ::std::os::raw::c_ulong, + pMechanismList: CK_MECHANISM_TYPE_PTR, + pulCount: CK_ULONG_PTR, ) -> CK_RV, >; pub type CK_C_GetMechanismInfo = ::std::option::Option< unsafe extern "C" fn( slotID: CK_SLOT_ID, type_: CK_MECHANISM_TYPE, - info: *mut _CK_MECHANISM_INFO, + pInfo: CK_MECHANISM_INFO_PTR, ) -> CK_RV, >; pub type CK_C_InitToken = ::std::option::Option< unsafe extern "C" fn( slotID: CK_SLOT_ID, - pin: *mut ::std::os::raw::c_uchar, - pin_len: ::std::os::raw::c_ulong, - label: *mut ::std::os::raw::c_uchar, + pPin: CK_UTF8CHAR_PTR, + ulPinLen: CK_ULONG, + pLabel: CK_UTF8CHAR_PTR, ) -> CK_RV, >; pub type CK_C_InitPIN = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - pin: *mut ::std::os::raw::c_uchar, - pin_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pPin: CK_UTF8CHAR_PTR, + ulPinLen: CK_ULONG, ) -> CK_RV, >; pub type CK_C_SetPIN = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - old_pin: *mut ::std::os::raw::c_uchar, - old_len: ::std::os::raw::c_ulong, - new_pin: *mut ::std::os::raw::c_uchar, - new_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pOldPin: CK_UTF8CHAR_PTR, + ulOldLen: CK_ULONG, + pNewPin: CK_UTF8CHAR_PTR, + ulNewLen: CK_ULONG, ) -> CK_RV, >; pub type CK_C_OpenSession = ::std::option::Option< unsafe extern "C" fn( slotID: CK_SLOT_ID, flags: CK_FLAGS, - application: *mut ::std::os::raw::c_void, - notify: CK_NOTIFY, - session: *mut CK_SESSION_HANDLE, + pApplication: CK_VOID_PTR, + Notify: CK_NOTIFY, + phSession: CK_SESSION_HANDLE_PTR, ) -> CK_RV, >; pub type CK_C_CloseSession = - ::std::option::Option CK_RV>; + ::std::option::Option CK_RV>; pub type CK_C_CloseAllSessions = ::std::option::Option CK_RV>; pub type CK_C_GetSessionInfo = ::std::option::Option< - unsafe extern "C" fn(session: CK_SESSION_HANDLE, info: *mut _CK_SESSION_INFO) -> CK_RV, + unsafe extern "C" fn(hSession: CK_SESSION_HANDLE, pInfo: CK_SESSION_INFO_PTR) -> CK_RV, >; pub type CK_C_GetOperationState = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - operation_state: *mut ::std::os::raw::c_uchar, - operation_state_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pOperationState: CK_BYTE_PTR, + pulOperationStateLen: CK_ULONG_PTR, ) -> CK_RV, >; pub type CK_C_SetOperationState = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - operation_state: *mut ::std::os::raw::c_uchar, - operation_state_len: ::std::os::raw::c_ulong, - encryption_key: CK_OBJECT_HANDLE, - authentiation_key: CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pOperationState: CK_BYTE_PTR, + ulOperationStateLen: CK_ULONG, + hEncryptionKey: CK_OBJECT_HANDLE, + hAuthenticationKey: CK_OBJECT_HANDLE, ) -> CK_RV, >; pub type CK_C_Login = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - user_type: CK_USER_TYPE, - pin: *mut ::std::os::raw::c_uchar, - pin_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + userType: CK_USER_TYPE, + pPin: CK_UTF8CHAR_PTR, + ulPinLen: CK_ULONG, ) -> CK_RV, >; pub type CK_C_Logout = - ::std::option::Option CK_RV>; + ::std::option::Option CK_RV>; pub type CK_C_CreateObject = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - templ: *mut _CK_ATTRIBUTE, - ulCount: ::std::os::raw::c_ulong, - object: *mut CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pTemplate: CK_ATTRIBUTE_PTR, + ulCount: CK_ULONG, + phObject: CK_OBJECT_HANDLE_PTR, ) -> CK_RV, >; pub type CK_C_CopyObject = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - object: CK_OBJECT_HANDLE, - templ: *mut _CK_ATTRIBUTE, - ulCount: ::std::os::raw::c_ulong, - new_object: *mut CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + hObject: CK_OBJECT_HANDLE, + pTemplate: CK_ATTRIBUTE_PTR, + ulCount: CK_ULONG, + phNewObject: CK_OBJECT_HANDLE_PTR, ) -> CK_RV, >; pub type CK_C_DestroyObject = ::std::option::Option< - unsafe extern "C" fn(session: CK_SESSION_HANDLE, object: CK_OBJECT_HANDLE) -> CK_RV, + unsafe extern "C" fn(hSession: CK_SESSION_HANDLE, hObject: CK_OBJECT_HANDLE) -> CK_RV, >; pub type CK_C_GetObjectSize = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - object: CK_OBJECT_HANDLE, - size: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + hObject: CK_OBJECT_HANDLE, + pulSize: CK_ULONG_PTR, ) -> CK_RV, >; pub type CK_C_GetAttributeValue = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - object: CK_OBJECT_HANDLE, - templ: *mut _CK_ATTRIBUTE, - ulCount: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + hObject: CK_OBJECT_HANDLE, + pTemplate: CK_ATTRIBUTE_PTR, + ulCount: CK_ULONG, ) -> CK_RV, >; pub type CK_C_SetAttributeValue = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - object: CK_OBJECT_HANDLE, - templ: *mut _CK_ATTRIBUTE, - ulCount: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + hObject: CK_OBJECT_HANDLE, + pTemplate: CK_ATTRIBUTE_PTR, + ulCount: CK_ULONG, ) -> CK_RV, >; pub type CK_C_FindObjectsInit = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - templ: *mut _CK_ATTRIBUTE, - ulCount: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pTemplate: CK_ATTRIBUTE_PTR, + ulCount: CK_ULONG, ) -> CK_RV, >; pub type CK_C_FindObjects = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - object: *mut CK_OBJECT_HANDLE, - max_object_count: ::std::os::raw::c_ulong, - object_count: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + phObject: CK_OBJECT_HANDLE_PTR, + ulMaxObjectCount: CK_ULONG, + pulObjectCount: CK_ULONG_PTR, ) -> CK_RV, >; pub type CK_C_FindObjectsFinal = - ::std::option::Option CK_RV>; + ::std::option::Option CK_RV>; pub type CK_C_EncryptInit = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - key: CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, ) -> CK_RV, >; pub type CK_C_Encrypt = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - data: *mut ::std::os::raw::c_uchar, - data_len: ::std::os::raw::c_ulong, - encrypted_data: *mut ::std::os::raw::c_uchar, - encrypted_data_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pEncryptedData: CK_BYTE_PTR, + pulEncryptedDataLen: CK_ULONG_PTR, ) -> CK_RV, >; pub type CK_C_EncryptUpdate = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - part: *mut ::std::os::raw::c_uchar, - part_len: ::std::os::raw::c_ulong, - encrypted_part: *mut ::std::os::raw::c_uchar, - encrypted_part_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pPart: CK_BYTE_PTR, + ulPartLen: CK_ULONG, + pEncryptedPart: CK_BYTE_PTR, + pulEncryptedPartLen: CK_ULONG_PTR, ) -> CK_RV, >; pub type CK_C_EncryptFinal = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - last_encrypted_part: *mut ::std::os::raw::c_uchar, - last_encrypted_part_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pLastEncryptedPart: CK_BYTE_PTR, + pulLastEncryptedPartLen: CK_ULONG_PTR, ) -> CK_RV, >; pub type CK_C_DecryptInit = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - key: CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, ) -> CK_RV, >; pub type CK_C_Decrypt = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - encrypted_data: *mut ::std::os::raw::c_uchar, - encrypted_data_len: ::std::os::raw::c_ulong, - data: *mut ::std::os::raw::c_uchar, - data_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pEncryptedData: CK_BYTE_PTR, + ulEncryptedDataLen: CK_ULONG, + pData: CK_BYTE_PTR, + pulDataLen: CK_ULONG_PTR, ) -> CK_RV, >; pub type CK_C_DecryptUpdate = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - encrypted_part: *mut ::std::os::raw::c_uchar, - encrypted_part_len: ::std::os::raw::c_ulong, - part: *mut ::std::os::raw::c_uchar, - part_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pEncryptedPart: CK_BYTE_PTR, + ulEncryptedPartLen: CK_ULONG, + pPart: CK_BYTE_PTR, + pulPartLen: CK_ULONG_PTR, ) -> CK_RV, >; pub type CK_C_DecryptFinal = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - last_part: *mut ::std::os::raw::c_uchar, - last_part_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pLastPart: CK_BYTE_PTR, + pulLastPartLen: CK_ULONG_PTR, ) -> CK_RV, >; pub type CK_C_DigestInit = ::std::option::Option< - unsafe extern "C" fn(session: CK_SESSION_HANDLE, mechanism: *mut _CK_MECHANISM) -> CK_RV, + unsafe extern "C" fn(hSession: CK_SESSION_HANDLE, pMechanism: CK_MECHANISM_PTR) -> CK_RV, >; pub type CK_C_Digest = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - data: *mut ::std::os::raw::c_uchar, - data_len: ::std::os::raw::c_ulong, - digest: *mut ::std::os::raw::c_uchar, - digest_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pDigest: CK_BYTE_PTR, + pulDigestLen: CK_ULONG_PTR, ) -> CK_RV, >; pub type CK_C_DigestUpdate = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - part: *mut ::std::os::raw::c_uchar, - part_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pPart: CK_BYTE_PTR, + ulPartLen: CK_ULONG, ) -> CK_RV, >; pub type CK_C_DigestKey = ::std::option::Option< - unsafe extern "C" fn(session: CK_SESSION_HANDLE, key: CK_OBJECT_HANDLE) -> CK_RV, + unsafe extern "C" fn(hSession: CK_SESSION_HANDLE, hKey: CK_OBJECT_HANDLE) -> CK_RV, >; pub type CK_C_DigestFinal = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - digest: *mut ::std::os::raw::c_uchar, - digest_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pDigest: CK_BYTE_PTR, + pulDigestLen: CK_ULONG_PTR, ) -> CK_RV, >; pub type CK_C_SignInit = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - key: CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, ) -> CK_RV, >; pub type CK_C_Sign = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - data: *mut ::std::os::raw::c_uchar, - data_len: ::std::os::raw::c_ulong, - signature: *mut ::std::os::raw::c_uchar, - signature_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + pulSignatureLen: CK_ULONG_PTR, ) -> CK_RV, >; pub type CK_C_SignUpdate = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - part: *mut ::std::os::raw::c_uchar, - part_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pPart: CK_BYTE_PTR, + ulPartLen: CK_ULONG, ) -> CK_RV, >; pub type CK_C_SignFinal = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - signature: *mut ::std::os::raw::c_uchar, - signature_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pSignature: CK_BYTE_PTR, + pulSignatureLen: CK_ULONG_PTR, ) -> CK_RV, >; pub type CK_C_SignRecoverInit = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - key: CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, ) -> CK_RV, >; pub type CK_C_SignRecover = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - data: *mut ::std::os::raw::c_uchar, - data_len: ::std::os::raw::c_ulong, - signature: *mut ::std::os::raw::c_uchar, - signature_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + pulSignatureLen: CK_ULONG_PTR, ) -> CK_RV, >; pub type CK_C_VerifyInit = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - key: CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, ) -> CK_RV, >; pub type CK_C_Verify = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - data: *mut ::std::os::raw::c_uchar, - data_len: ::std::os::raw::c_ulong, - signature: *mut ::std::os::raw::c_uchar, - signature_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + ulSignatureLen: CK_ULONG, ) -> CK_RV, >; pub type CK_C_VerifyUpdate = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - part: *mut ::std::os::raw::c_uchar, - part_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pPart: CK_BYTE_PTR, + ulPartLen: CK_ULONG, ) -> CK_RV, >; pub type CK_C_VerifyFinal = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - signature: *mut ::std::os::raw::c_uchar, - signature_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pSignature: CK_BYTE_PTR, + ulSignatureLen: CK_ULONG, ) -> CK_RV, >; pub type CK_C_VerifyRecoverInit = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - key: CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, ) -> CK_RV, >; pub type CK_C_VerifyRecover = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - signature: *mut ::std::os::raw::c_uchar, - signature_len: ::std::os::raw::c_ulong, - data: *mut ::std::os::raw::c_uchar, - data_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pSignature: CK_BYTE_PTR, + ulSignatureLen: CK_ULONG, + pData: CK_BYTE_PTR, + pulDataLen: CK_ULONG_PTR, ) -> CK_RV, >; pub type CK_C_DigestEncryptUpdate = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - part: *mut ::std::os::raw::c_uchar, - part_len: ::std::os::raw::c_ulong, - encrypted_part: *mut ::std::os::raw::c_uchar, - encrypted_part_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pPart: CK_BYTE_PTR, + ulPartLen: CK_ULONG, + pEncryptedPart: CK_BYTE_PTR, + pulEncryptedPartLen: CK_ULONG_PTR, ) -> CK_RV, >; pub type CK_C_DecryptDigestUpdate = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - encrypted_part: *mut ::std::os::raw::c_uchar, - encrypted_part_len: ::std::os::raw::c_ulong, - part: *mut ::std::os::raw::c_uchar, - part_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pEncryptedPart: CK_BYTE_PTR, + ulEncryptedPartLen: CK_ULONG, + pPart: CK_BYTE_PTR, + pulPartLen: CK_ULONG_PTR, ) -> CK_RV, >; pub type CK_C_SignEncryptUpdate = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - part: *mut ::std::os::raw::c_uchar, - part_len: ::std::os::raw::c_ulong, - encrypted_part: *mut ::std::os::raw::c_uchar, - encrypted_part_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pPart: CK_BYTE_PTR, + ulPartLen: CK_ULONG, + pEncryptedPart: CK_BYTE_PTR, + pulEncryptedPartLen: CK_ULONG_PTR, ) -> CK_RV, >; pub type CK_C_DecryptVerifyUpdate = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - encrypted_part: *mut ::std::os::raw::c_uchar, - encrypted_part_len: ::std::os::raw::c_ulong, - part: *mut ::std::os::raw::c_uchar, - part_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pEncryptedPart: CK_BYTE_PTR, + ulEncryptedPartLen: CK_ULONG, + pPart: CK_BYTE_PTR, + pulPartLen: CK_ULONG_PTR, ) -> CK_RV, >; pub type CK_C_GenerateKey = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - templ: *mut _CK_ATTRIBUTE, - ulCount: ::std::os::raw::c_ulong, - key: *mut CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + pTemplate: CK_ATTRIBUTE_PTR, + ulCount: CK_ULONG, + phKey: CK_OBJECT_HANDLE_PTR, ) -> CK_RV, >; pub type CK_C_GenerateKeyPair = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - public_key_template: *mut _CK_ATTRIBUTE, - public_key_attribute_count: ::std::os::raw::c_ulong, - private_key_template: *mut _CK_ATTRIBUTE, - private_key_attribute_count: ::std::os::raw::c_ulong, - public_key: *mut CK_OBJECT_HANDLE, - private_key: *mut CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + pPublicKeyTemplate: CK_ATTRIBUTE_PTR, + ulPublicKeyAttributeCount: CK_ULONG, + pPrivateKeyTemplate: CK_ATTRIBUTE_PTR, + ulPrivateKeyAttributeCount: CK_ULONG, + phPublicKey: CK_OBJECT_HANDLE_PTR, + phPrivateKey: CK_OBJECT_HANDLE_PTR, ) -> CK_RV, >; pub type CK_C_WrapKey = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - wrapping_key: CK_OBJECT_HANDLE, - key: CK_OBJECT_HANDLE, - wrapped_key: *mut ::std::os::raw::c_uchar, - wrapped_key_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hWrappingKey: CK_OBJECT_HANDLE, + hKey: CK_OBJECT_HANDLE, + pWrappedKey: CK_BYTE_PTR, + pulWrappedKeyLen: CK_ULONG_PTR, ) -> CK_RV, >; pub type CK_C_UnwrapKey = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - unwrapping_key: CK_OBJECT_HANDLE, - wrapped_key: *mut ::std::os::raw::c_uchar, - wrapped_key_len: ::std::os::raw::c_ulong, - templ: *mut _CK_ATTRIBUTE, - attribute_count: ::std::os::raw::c_ulong, - key: *mut CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hUnwrappingKey: CK_OBJECT_HANDLE, + pWrappedKey: CK_BYTE_PTR, + ulWrappedKeyLen: CK_ULONG, + pTemplate: CK_ATTRIBUTE_PTR, + ulAttributeCount: CK_ULONG, + phKey: CK_OBJECT_HANDLE_PTR, ) -> CK_RV, >; pub type CK_C_DeriveKey = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - base_key: CK_OBJECT_HANDLE, - templ: *mut _CK_ATTRIBUTE, - attribute_count: ::std::os::raw::c_ulong, - key: *mut CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hBaseKey: CK_OBJECT_HANDLE, + pTemplate: CK_ATTRIBUTE_PTR, + ulAttributeCount: CK_ULONG, + phKey: CK_OBJECT_HANDLE_PTR, ) -> CK_RV, >; pub type CK_C_SeedRandom = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - seed: *mut ::std::os::raw::c_uchar, - seed_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pSeed: CK_BYTE_PTR, + ulSeedLen: CK_ULONG, ) -> CK_RV, >; pub type CK_C_GenerateRandom = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - random_data: *mut ::std::os::raw::c_uchar, - random_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + RandomData: CK_BYTE_PTR, + ulRandomLen: CK_ULONG, ) -> CK_RV, >; pub type CK_C_GetFunctionStatus = - ::std::option::Option CK_RV>; + ::std::option::Option CK_RV>; pub type CK_C_CancelFunction = - ::std::option::Option CK_RV>; + ::std::option::Option CK_RV>; +pub type CK_C_WaitForSlotEvent = ::std::option::Option< + unsafe extern "C" fn(flags: CK_FLAGS, pSlot: CK_SLOT_ID_PTR, pRserved: CK_VOID_PTR) -> CK_RV, +>; +pub type CK_C_GetInterfaceList = ::std::option::Option< + unsafe extern "C" fn(pInterfacesList: CK_INTERFACE_PTR, pulCount: CK_ULONG_PTR) -> CK_RV, +>; +pub type CK_C_GetInterface = ::std::option::Option< + unsafe extern "C" fn( + pInterfaceName: CK_UTF8CHAR_PTR, + pVersion: CK_VERSION_PTR, + ppInterface: CK_INTERFACE_PTR_PTR, + flags: CK_FLAGS, + ) -> CK_RV, +>; +pub type CK_C_LoginUser = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + userType: CK_USER_TYPE, + pPin: CK_UTF8CHAR_PTR, + ulPinLen: CK_ULONG, + pUsername: CK_UTF8CHAR_PTR, + ulUsernameLen: CK_ULONG, + ) -> CK_RV, +>; +pub type CK_C_SessionCancel = ::std::option::Option< + unsafe extern "C" fn(hSession: CK_SESSION_HANDLE, flags: CK_FLAGS) -> CK_RV, +>; +pub type CK_C_MessageEncryptInit = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, + ) -> CK_RV, +>; +pub type CK_C_EncryptMessage = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pAssociatedData: CK_BYTE_PTR, + ulAssociatedDataLen: CK_ULONG, + pPlaintext: CK_BYTE_PTR, + ulPlaintextLen: CK_ULONG, + pCiphertext: CK_BYTE_PTR, + pulCiphertextLen: CK_ULONG_PTR, + ) -> CK_RV, +>; +pub type CK_C_EncryptMessageBegin = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pAssociatedData: CK_BYTE_PTR, + ulAssociatedDataLen: CK_ULONG, + ) -> CK_RV, +>; +pub type CK_C_EncryptMessageNext = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pPlaintextPart: CK_BYTE_PTR, + ulPlaintextPartLen: CK_ULONG, + pCiphertextPart: CK_BYTE_PTR, + pulCiphertextPartLen: CK_ULONG_PTR, + flags: CK_FLAGS, + ) -> CK_RV, +>; +pub type CK_C_MessageEncryptFinal = + ::std::option::Option CK_RV>; +pub type CK_C_MessageDecryptInit = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, + ) -> CK_RV, +>; +pub type CK_C_DecryptMessage = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pAssociatedData: CK_BYTE_PTR, + ulAssociatedDataLen: CK_ULONG, + pCiphertext: CK_BYTE_PTR, + ulCiphertextLen: CK_ULONG, + pPlaintext: CK_BYTE_PTR, + pulPlaintextLen: CK_ULONG_PTR, + ) -> CK_RV, +>; +pub type CK_C_DecryptMessageBegin = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pAssociatedData: CK_BYTE_PTR, + ulAssociatedDataLen: CK_ULONG, + ) -> CK_RV, +>; +pub type CK_C_DecryptMessageNext = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pCiphertext: CK_BYTE_PTR, + ulCiphertextLen: CK_ULONG, + pPlaintext: CK_BYTE_PTR, + pulPlaintextLen: CK_ULONG_PTR, + flags: CK_FLAGS, + ) -> CK_RV, +>; +pub type CK_C_MessageDecryptFinal = + ::std::option::Option CK_RV>; +pub type CK_C_MessageSignInit = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, + ) -> CK_RV, +>; +pub type CK_C_SignMessage = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + pulSignatureLen: CK_ULONG_PTR, + ) -> CK_RV, +>; +pub type CK_C_SignMessageBegin = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + ) -> CK_RV, +>; +pub type CK_C_SignMessageNext = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + pulSignatureLen: CK_ULONG_PTR, + ) -> CK_RV, +>; +pub type CK_C_MessageSignFinal = + ::std::option::Option CK_RV>; +pub type CK_C_MessageVerifyInit = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, + ) -> CK_RV, +>; +pub type CK_C_VerifyMessage = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + ulSignatureLen: CK_ULONG, + ) -> CK_RV, +>; +pub type CK_C_VerifyMessageBegin = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + ) -> CK_RV, +>; +pub type CK_C_VerifyMessageNext = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + ulSignatureLen: CK_ULONG, + ) -> CK_RV, +>; +pub type CK_C_MessageVerifyFinal = + ::std::option::Option CK_RV>; +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct CK_FUNCTION_LIST_3_0 { + pub version: CK_VERSION, + pub C_Initialize: CK_C_Initialize, + pub C_Finalize: CK_C_Finalize, + pub C_GetInfo: CK_C_GetInfo, + pub C_GetFunctionList: CK_C_GetFunctionList, + pub C_GetSlotList: CK_C_GetSlotList, + pub C_GetSlotInfo: CK_C_GetSlotInfo, + pub C_GetTokenInfo: CK_C_GetTokenInfo, + pub C_GetMechanismList: CK_C_GetMechanismList, + pub C_GetMechanismInfo: CK_C_GetMechanismInfo, + pub C_InitToken: CK_C_InitToken, + pub C_InitPIN: CK_C_InitPIN, + pub C_SetPIN: CK_C_SetPIN, + pub C_OpenSession: CK_C_OpenSession, + pub C_CloseSession: CK_C_CloseSession, + pub C_CloseAllSessions: CK_C_CloseAllSessions, + pub C_GetSessionInfo: CK_C_GetSessionInfo, + pub C_GetOperationState: CK_C_GetOperationState, + pub C_SetOperationState: CK_C_SetOperationState, + pub C_Login: CK_C_Login, + pub C_Logout: CK_C_Logout, + pub C_CreateObject: CK_C_CreateObject, + pub C_CopyObject: CK_C_CopyObject, + pub C_DestroyObject: CK_C_DestroyObject, + pub C_GetObjectSize: CK_C_GetObjectSize, + pub C_GetAttributeValue: CK_C_GetAttributeValue, + pub C_SetAttributeValue: CK_C_SetAttributeValue, + pub C_FindObjectsInit: CK_C_FindObjectsInit, + pub C_FindObjects: CK_C_FindObjects, + pub C_FindObjectsFinal: CK_C_FindObjectsFinal, + pub C_EncryptInit: CK_C_EncryptInit, + pub C_Encrypt: CK_C_Encrypt, + pub C_EncryptUpdate: CK_C_EncryptUpdate, + pub C_EncryptFinal: CK_C_EncryptFinal, + pub C_DecryptInit: CK_C_DecryptInit, + pub C_Decrypt: CK_C_Decrypt, + pub C_DecryptUpdate: CK_C_DecryptUpdate, + pub C_DecryptFinal: CK_C_DecryptFinal, + pub C_DigestInit: CK_C_DigestInit, + pub C_Digest: CK_C_Digest, + pub C_DigestUpdate: CK_C_DigestUpdate, + pub C_DigestKey: CK_C_DigestKey, + pub C_DigestFinal: CK_C_DigestFinal, + pub C_SignInit: CK_C_SignInit, + pub C_Sign: CK_C_Sign, + pub C_SignUpdate: CK_C_SignUpdate, + pub C_SignFinal: CK_C_SignFinal, + pub C_SignRecoverInit: CK_C_SignRecoverInit, + pub C_SignRecover: CK_C_SignRecover, + pub C_VerifyInit: CK_C_VerifyInit, + pub C_Verify: CK_C_Verify, + pub C_VerifyUpdate: CK_C_VerifyUpdate, + pub C_VerifyFinal: CK_C_VerifyFinal, + pub C_VerifyRecoverInit: CK_C_VerifyRecoverInit, + pub C_VerifyRecover: CK_C_VerifyRecover, + pub C_DigestEncryptUpdate: CK_C_DigestEncryptUpdate, + pub C_DecryptDigestUpdate: CK_C_DecryptDigestUpdate, + pub C_SignEncryptUpdate: CK_C_SignEncryptUpdate, + pub C_DecryptVerifyUpdate: CK_C_DecryptVerifyUpdate, + pub C_GenerateKey: CK_C_GenerateKey, + pub C_GenerateKeyPair: CK_C_GenerateKeyPair, + pub C_WrapKey: CK_C_WrapKey, + pub C_UnwrapKey: CK_C_UnwrapKey, + pub C_DeriveKey: CK_C_DeriveKey, + pub C_SeedRandom: CK_C_SeedRandom, + pub C_GenerateRandom: CK_C_GenerateRandom, + pub C_GetFunctionStatus: CK_C_GetFunctionStatus, + pub C_CancelFunction: CK_C_CancelFunction, + pub C_WaitForSlotEvent: CK_C_WaitForSlotEvent, + pub C_GetInterfaceList: CK_C_GetInterfaceList, + pub C_GetInterface: CK_C_GetInterface, + pub C_LoginUser: CK_C_LoginUser, + pub C_SessionCancel: CK_C_SessionCancel, + pub C_MessageEncryptInit: CK_C_MessageEncryptInit, + pub C_EncryptMessage: CK_C_EncryptMessage, + pub C_EncryptMessageBegin: CK_C_EncryptMessageBegin, + pub C_EncryptMessageNext: CK_C_EncryptMessageNext, + pub C_MessageEncryptFinal: CK_C_MessageEncryptFinal, + pub C_MessageDecryptInit: CK_C_MessageDecryptInit, + pub C_DecryptMessage: CK_C_DecryptMessage, + pub C_DecryptMessageBegin: CK_C_DecryptMessageBegin, + pub C_DecryptMessageNext: CK_C_DecryptMessageNext, + pub C_MessageDecryptFinal: CK_C_MessageDecryptFinal, + pub C_MessageSignInit: CK_C_MessageSignInit, + pub C_SignMessage: CK_C_SignMessage, + pub C_SignMessageBegin: CK_C_SignMessageBegin, + pub C_SignMessageNext: CK_C_SignMessageNext, + pub C_MessageSignFinal: CK_C_MessageSignFinal, + pub C_MessageVerifyInit: CK_C_MessageVerifyInit, + pub C_VerifyMessage: CK_C_VerifyMessage, + pub C_VerifyMessageBegin: CK_C_VerifyMessageBegin, + 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::(), + 744usize, + concat!("Size of: ", stringify!(CK_FUNCTION_LIST_3_0)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + 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 }, + 16usize, + 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 }, + 24usize, + 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 }, + 32usize, + 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 }, + 40usize, + 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 }, + 48usize, + 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 }, + 56usize, + 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 }, + 64usize, + 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 }, + 72usize, + 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 }, + 80usize, + 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 }, + 88usize, + 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 }, + 96usize, + 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 }, + 104usize, + 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 }, + 112usize, + 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 }, + 120usize, + 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 }, + 128usize, + 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 }, + 136usize, + 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 }, + 144usize, + 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 }, + 152usize, + 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 }, + 160usize, + 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 }, + 168usize, + 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 }, + 176usize, + 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 }, + 184usize, + 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 }, + 192usize, + 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 }, + 200usize, + 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 }, + 208usize, + 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 }, + 216usize, + 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 }, + 224usize, + 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 }, + 232usize, + 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 }, + 240usize, + 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 }, + 248usize, + 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 }, + 256usize, + 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 }, + 264usize, + 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 }, + 272usize, + 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 }, + 280usize, + 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 }, + 288usize, + 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 }, + 296usize, + 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 }, + 304usize, + 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 }, + 312usize, + 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 }, + 320usize, + 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 }, + 328usize, + 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 }, + 336usize, + 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 }, + 344usize, + 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 }, + 352usize, + 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 }, + 360usize, + 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 }, + 368usize, + 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 }, + 376usize, + 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 }, + 384usize, + 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 }, + 392usize, + 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 }, + 400usize, + 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 }, + 408usize, + 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 }, + 416usize, + 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 }, + 424usize, + 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 }, + 432usize, + 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 }, + 440usize, + 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 }, + 448usize, + 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 }, + 456usize, + 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 }, + 464usize, + 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 }, + 472usize, + 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 }, + 480usize, + 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 }, + 488usize, + 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 }, + 496usize, + 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 }, + 504usize, + 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 }, + 512usize, + 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 }, + 520usize, + 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 }, + 528usize, + 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 }, + 536usize, + 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 }, + 544usize, + 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 }, + 552usize, + 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 }, + 560usize, + 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 }, + 568usize, + 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 }, + 576usize, + 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 }, + 584usize, + 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 }, + 592usize, + 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 }, + 600usize, + 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 }, + 608usize, + 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 }, + 616usize, + 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 }, + 624usize, + 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 }, + 632usize, + 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 }, + 640usize, + 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 }, + 648usize, + 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 }, + 656usize, + 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 }, + 664usize, + 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 }, + 672usize, + 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 }, + 680usize, + 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 }, + 688usize, + 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 }, + 696usize, + 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 }, + 704usize, + 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 }, + 712usize, + 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 }, + 720usize, + 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 }, + 728usize, + 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 }, + 736usize, + concat!( + "Offset of field: ", + stringify!(CK_FUNCTION_LIST_3_0), + "::", + stringify!(C_MessageVerifyFinal) + ) + ); +} #[repr(C)] #[derive(Debug, Default, Copy, Clone)] -pub struct _CK_FUNCTION_LIST { - pub version: _CK_VERSION, +pub struct CK_FUNCTION_LIST { + pub version: CK_VERSION, pub C_Initialize: CK_C_Initialize, pub C_Finalize: CK_C_Finalize, pub C_GetInfo: CK_C_GetInfo, @@ -2647,25 +9810,25 @@ pub struct _CK_FUNCTION_LIST { pub C_WaitForSlotEvent: CK_C_WaitForSlotEvent, } #[test] -fn bindgen_test_layout__CK_FUNCTION_LIST() { - const UNINIT: ::std::mem::MaybeUninit<_CK_FUNCTION_LIST> = ::std::mem::MaybeUninit::uninit(); +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::<_CK_FUNCTION_LIST>(), + ::std::mem::size_of::(), 552usize, - concat!("Size of: ", stringify!(_CK_FUNCTION_LIST)) + concat!("Size of: ", stringify!(CK_FUNCTION_LIST)) ); assert_eq!( - ::std::mem::align_of::<_CK_FUNCTION_LIST>(), + ::std::mem::align_of::(), 8usize, - concat!("Alignment of ", stringify!(_CK_FUNCTION_LIST)) + 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!(CK_FUNCTION_LIST), "::", stringify!(version) ) @@ -2675,7 +9838,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 8usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_Initialize) ) @@ -2685,7 +9848,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 16usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_Finalize) ) @@ -2695,7 +9858,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 24usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_GetInfo) ) @@ -2705,7 +9868,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 32usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_GetFunctionList) ) @@ -2715,7 +9878,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 40usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_GetSlotList) ) @@ -2725,7 +9888,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 48usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_GetSlotInfo) ) @@ -2735,7 +9898,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 56usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_GetTokenInfo) ) @@ -2745,7 +9908,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 64usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_GetMechanismList) ) @@ -2755,7 +9918,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 72usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_GetMechanismInfo) ) @@ -2765,7 +9928,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 80usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_InitToken) ) @@ -2775,7 +9938,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 88usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_InitPIN) ) @@ -2785,7 +9948,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 96usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_SetPIN) ) @@ -2795,7 +9958,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 104usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_OpenSession) ) @@ -2805,7 +9968,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 112usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_CloseSession) ) @@ -2815,7 +9978,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 120usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_CloseAllSessions) ) @@ -2825,7 +9988,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 128usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_GetSessionInfo) ) @@ -2835,7 +9998,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 136usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_GetOperationState) ) @@ -2845,7 +10008,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 144usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_SetOperationState) ) @@ -2855,7 +10018,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 152usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_Login) ) @@ -2865,7 +10028,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 160usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_Logout) ) @@ -2875,7 +10038,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 168usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_CreateObject) ) @@ -2885,7 +10048,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 176usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_CopyObject) ) @@ -2895,7 +10058,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 184usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_DestroyObject) ) @@ -2905,7 +10068,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 192usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_GetObjectSize) ) @@ -2915,7 +10078,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 200usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_GetAttributeValue) ) @@ -2925,7 +10088,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 208usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_SetAttributeValue) ) @@ -2935,7 +10098,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 216usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_FindObjectsInit) ) @@ -2945,7 +10108,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 224usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_FindObjects) ) @@ -2955,7 +10118,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 232usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_FindObjectsFinal) ) @@ -2965,7 +10128,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 240usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_EncryptInit) ) @@ -2975,7 +10138,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 248usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_Encrypt) ) @@ -2985,7 +10148,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 256usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_EncryptUpdate) ) @@ -2995,7 +10158,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 264usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_EncryptFinal) ) @@ -3005,7 +10168,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 272usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_DecryptInit) ) @@ -3015,7 +10178,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 280usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_Decrypt) ) @@ -3025,7 +10188,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 288usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_DecryptUpdate) ) @@ -3035,7 +10198,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 296usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_DecryptFinal) ) @@ -3045,7 +10208,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 304usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_DigestInit) ) @@ -3055,7 +10218,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 312usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_Digest) ) @@ -3065,7 +10228,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 320usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_DigestUpdate) ) @@ -3075,7 +10238,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 328usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_DigestKey) ) @@ -3085,7 +10248,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 336usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_DigestFinal) ) @@ -3095,7 +10258,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 344usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_SignInit) ) @@ -3105,7 +10268,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 352usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_Sign) ) @@ -3115,7 +10278,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 360usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_SignUpdate) ) @@ -3125,7 +10288,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 368usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_SignFinal) ) @@ -3135,7 +10298,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 376usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_SignRecoverInit) ) @@ -3145,7 +10308,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 384usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_SignRecover) ) @@ -3155,7 +10318,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 392usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_VerifyInit) ) @@ -3165,7 +10328,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 400usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_Verify) ) @@ -3175,7 +10338,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 408usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_VerifyUpdate) ) @@ -3185,7 +10348,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 416usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_VerifyFinal) ) @@ -3195,7 +10358,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 424usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_VerifyRecoverInit) ) @@ -3205,7 +10368,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 432usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_VerifyRecover) ) @@ -3215,7 +10378,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 440usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_DigestEncryptUpdate) ) @@ -3225,7 +10388,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 448usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_DecryptDigestUpdate) ) @@ -3235,7 +10398,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 456usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_SignEncryptUpdate) ) @@ -3245,7 +10408,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 464usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_DecryptVerifyUpdate) ) @@ -3255,7 +10418,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 472usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_GenerateKey) ) @@ -3265,7 +10428,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 480usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_GenerateKeyPair) ) @@ -3275,7 +10438,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 488usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_WrapKey) ) @@ -3285,7 +10448,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 496usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_UnwrapKey) ) @@ -3295,7 +10458,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 504usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_DeriveKey) ) @@ -3305,7 +10468,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 512usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_SeedRandom) ) @@ -3315,7 +10478,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 520usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_GenerateRandom) ) @@ -3325,7 +10488,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 528usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_GetFunctionStatus) ) @@ -3335,7 +10498,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 536usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_CancelFunction) ) @@ -3345,223 +10508,45 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 544usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), - "::", - stringify!(C_WaitForSlotEvent) - ) - ); -} -pub type CK_CREATEMUTEX = - ::std::option::Option CK_RV>; -pub type CK_DESTROYMUTEX = - ::std::option::Option CK_RV>; -pub type CK_LOCKMUTEX = - ::std::option::Option CK_RV>; -pub type CK_UNLOCKMUTEX = - ::std::option::Option CK_RV>; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct _CK_C_INITIALIZE_ARGS { - pub CreateMutex: CK_CREATEMUTEX, - pub DestroyMutex: CK_DESTROYMUTEX, - pub LockMutex: CK_LOCKMUTEX, - pub UnlockMutex: CK_UNLOCKMUTEX, - pub flags: CK_FLAGS, - pub pReserved: *mut ::std::os::raw::c_void, -} -#[test] -fn bindgen_test_layout__CK_C_INITIALIZE_ARGS() { - const UNINIT: ::std::mem::MaybeUninit<_CK_C_INITIALIZE_ARGS> = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<_CK_C_INITIALIZE_ARGS>(), - 48usize, - concat!("Size of: ", stringify!(_CK_C_INITIALIZE_ARGS)) - ); - assert_eq!( - ::std::mem::align_of::<_CK_C_INITIALIZE_ARGS>(), - 8usize, - 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 }, - 40usize, - concat!( - "Offset of field: ", - stringify!(_CK_C_INITIALIZE_ARGS), + stringify!(CK_FUNCTION_LIST), "::", - stringify!(pReserved) - ) - ); -} -impl Default for _CK_C_INITIALIZE_ARGS { - fn default() -> Self { - let mut s = ::std::mem::MaybeUninit::::uninit(); - unsafe { - ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -pub type CK_BYTE = ::std::os::raw::c_uchar; -pub type CK_CHAR = ::std::os::raw::c_uchar; -pub type CK_UTF8CHAR = ::std::os::raw::c_uchar; -pub type CK_BBOOL = ::std::os::raw::c_uchar; -pub type CK_ULONG = ::std::os::raw::c_ulong; -pub type CK_LONG = ::std::os::raw::c_long; -pub type CK_BYTE_PTR = *mut CK_BYTE; -pub type CK_CHAR_PTR = *mut CK_CHAR; -pub type CK_UTF8CHAR_PTR = *mut CK_UTF8CHAR; -pub type CK_ULONG_PTR = *mut CK_ULONG; -pub type CK_VOID_PTR = *mut ::std::os::raw::c_void; -pub type CK_VOID_PTR_PTR = *mut *mut ::std::os::raw::c_void; -pub type CK_VERSION = _CK_VERSION; -pub type CK_VERSION_PTR = *mut _CK_VERSION; -pub type CK_INFO = _CK_INFO; -pub type CK_INFO_PTR = *mut _CK_INFO; -pub type CK_SLOT_ID_PTR = *mut CK_SLOT_ID; -pub type CK_SLOT_INFO = _CK_SLOT_INFO; -pub type CK_SLOT_INFO_PTR = *mut _CK_SLOT_INFO; -pub type CK_TOKEN_INFO = _CK_TOKEN_INFO; -pub type CK_TOKEN_INFO_PTR = *mut _CK_TOKEN_INFO; -pub type CK_SESSION_HANDLE_PTR = *mut CK_SESSION_HANDLE; -pub type CK_SESSION_INFO = _CK_SESSION_INFO; -pub type CK_SESSION_INFO_PTR = *mut _CK_SESSION_INFO; -pub type CK_OBJECT_HANDLE_PTR = *mut CK_OBJECT_HANDLE; -pub type CK_OBJECT_CLASS_PTR = *mut CK_OBJECT_CLASS; -pub type CK_ATTRIBUTE = _CK_ATTRIBUTE; -pub type CK_ATTRIBUTE_PTR = *mut _CK_ATTRIBUTE; -pub type CK_DATE = _CK_DATE; -pub type CK_DATE_PTR = *mut _CK_DATE; -pub type CK_MECHANISM_TYPE_PTR = *mut CK_MECHANISM_TYPE; -pub type CK_MECHANISM = _CK_MECHANISM; -pub type CK_MECHANISM_PTR = *mut _CK_MECHANISM; -pub type CK_MECHANISM_INFO = _CK_MECHANISM_INFO; -pub type CK_MECHANISM_INFO_PTR = *mut _CK_MECHANISM_INFO; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct ck_otp_mechanism_info { - _unused: [u8; 0], -} -pub type CK_OTP_MECHANISM_INFO = ck_otp_mechanism_info; -pub type CK_OTP_MECHANISM_INFO_PTR = *mut ck_otp_mechanism_info; -pub type CK_FUNCTION_LIST = _CK_FUNCTION_LIST; -pub type CK_FUNCTION_LIST_PTR = *mut _CK_FUNCTION_LIST; -pub type CK_FUNCTION_LIST_PTR_PTR = *mut *mut _CK_FUNCTION_LIST; -pub type CK_C_INITIALIZE_ARGS = _CK_C_INITIALIZE_ARGS; -pub type CK_C_INITIALIZE_ARGS_PTR = *mut _CK_C_INITIALIZE_ARGS; -pub type CK_RSA_PKCS_PSS_PARAMS = ck_rsa_pkcs_pss_params; -pub type CK_RSA_PKCS_PSS_PARAMS_PTR = *mut ck_rsa_pkcs_pss_params; -pub type CK_RSA_PKCS_OAEP_PARAMS = ck_rsa_pkcs_oaep_params; -pub type CK_RSA_PKCS_OAEP_PARAMS_PTR = *mut ck_rsa_pkcs_oaep_params; -pub type CK_AES_CTR_PARAMS = ck_aes_ctr_params; -pub type CK_AES_CTR_PARAMS_PTR = *mut ck_aes_ctr_params; -pub type CK_GCM_PARAMS = ck_gcm_params; -pub type CK_GCM_PARAMS_PTR = *mut ck_gcm_params; -pub type CK_ECDH1_DERIVE_PARAMS = ck_ecdh1_derive_params; -pub type CK_ECDH1_DERIVE_PARAMS_PTR = *mut ck_ecdh1_derive_params; -pub type CK_KEY_DERIVATION_STRING_DATA = ck_key_derivation_string_data; -pub type CK_KEY_DERIVATION_STRING_DATA_PTR = *mut ck_key_derivation_string_data; -pub type CK_DES_CBC_ENCRYPT_DATA_PARAMS = ck_des_cbc_encrypt_data_params; -pub type CK_DES_CBC_ENCRYPT_DATA_PARAMS_PTR = *mut ck_des_cbc_encrypt_data_params; -pub type CK_AES_CBC_ENCRYPT_DATA_PARAMS = ck_aes_cbc_encrypt_data_params; -pub type CK_AES_CBC_ENCRYPT_DATA_PARAMS_PTR = *mut ck_aes_cbc_encrypt_data_params; + stringify!(C_WaitForSlotEvent) + ) + ); +} extern crate libloading; pub struct Pkcs11 { __library: ::libloading::Library, - pub C_Initialize: Result< - unsafe extern "C" fn(init_args: *mut ::std::os::raw::c_void) -> CK_RV, - ::libloading::Error, - >, - pub C_Finalize: Result< - unsafe extern "C" fn(pReserved: *mut ::std::os::raw::c_void) -> CK_RV, - ::libloading::Error, - >, - pub C_GetInfo: Result CK_RV, ::libloading::Error>, + pub C_Initialize: + Result CK_RV, ::libloading::Error>, + pub C_Finalize: + Result CK_RV, ::libloading::Error>, + pub C_GetInfo: Result CK_RV, ::libloading::Error>, pub C_GetFunctionList: Result< - unsafe extern "C" fn(function_list: *mut *mut _CK_FUNCTION_LIST) -> CK_RV, + unsafe extern "C" fn(ppFunctionList: CK_FUNCTION_LIST_PTR_PTR) -> CK_RV, ::libloading::Error, >, pub C_GetSlotList: Result< unsafe extern "C" fn( - token_present: ::std::os::raw::c_uchar, - slot_list: *mut CK_SLOT_ID, - ulCount: *mut ::std::os::raw::c_ulong, + tokenPresent: CK_BBOOL, + pSlotList: CK_SLOT_ID_PTR, + pulCount: CK_ULONG_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_GetSlotInfo: Result< - unsafe extern "C" fn(slotID: CK_SLOT_ID, info: *mut _CK_SLOT_INFO) -> CK_RV, + unsafe extern "C" fn(slotID: CK_SLOT_ID, pInfo: CK_SLOT_INFO_PTR) -> CK_RV, ::libloading::Error, >, pub C_GetTokenInfo: Result< - unsafe extern "C" fn(slotID: CK_SLOT_ID, info: *mut _CK_TOKEN_INFO) -> CK_RV, - ::libloading::Error, - >, - pub C_WaitForSlotEvent: Result< - unsafe extern "C" fn( - flags: CK_FLAGS, - slot: *mut CK_SLOT_ID, - pReserved: *mut ::std::os::raw::c_void, - ) -> CK_RV, + unsafe extern "C" fn(slotID: CK_SLOT_ID, pInfo: CK_TOKEN_INFO_PTR) -> CK_RV, ::libloading::Error, >, pub C_GetMechanismList: Result< unsafe extern "C" fn( slotID: CK_SLOT_ID, - mechanism_list: *mut CK_MECHANISM_TYPE, - ulCount: *mut ::std::os::raw::c_ulong, + pMechanismList: CK_MECHANISM_TYPE_PTR, + pulCount: CK_ULONG_PTR, ) -> CK_RV, ::libloading::Error, >, @@ -3569,34 +10554,34 @@ pub struct Pkcs11 { unsafe extern "C" fn( slotID: CK_SLOT_ID, type_: CK_MECHANISM_TYPE, - info: *mut _CK_MECHANISM_INFO, + pInfo: CK_MECHANISM_INFO_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_InitToken: Result< unsafe extern "C" fn( slotID: CK_SLOT_ID, - pin: *mut ::std::os::raw::c_uchar, - pin_len: ::std::os::raw::c_ulong, - label: *mut ::std::os::raw::c_uchar, + pPin: CK_UTF8CHAR_PTR, + ulPinLen: CK_ULONG, + pLabel: CK_UTF8CHAR_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_InitPIN: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - pin: *mut ::std::os::raw::c_uchar, - pin_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pPin: CK_UTF8CHAR_PTR, + ulPinLen: CK_ULONG, ) -> CK_RV, ::libloading::Error, >, pub C_SetPIN: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - old_pin: *mut ::std::os::raw::c_uchar, - old_len: ::std::os::raw::c_ulong, - new_pin: *mut ::std::os::raw::c_uchar, - new_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pOldPin: CK_UTF8CHAR_PTR, + ulOldLen: CK_ULONG, + pNewPin: CK_UTF8CHAR_PTR, + ulNewLen: CK_ULONG, ) -> CK_RV, ::libloading::Error, >, @@ -3604,445 +10589,659 @@ pub struct Pkcs11 { unsafe extern "C" fn( slotID: CK_SLOT_ID, flags: CK_FLAGS, - application: *mut ::std::os::raw::c_void, - notify: CK_NOTIFY, - session: *mut CK_SESSION_HANDLE, + pApplication: CK_VOID_PTR, + Notify: CK_NOTIFY, + phSession: CK_SESSION_HANDLE_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_CloseSession: - Result CK_RV, ::libloading::Error>, + Result CK_RV, ::libloading::Error>, pub C_CloseAllSessions: Result CK_RV, ::libloading::Error>, pub C_GetSessionInfo: Result< - unsafe extern "C" fn(session: CK_SESSION_HANDLE, info: *mut _CK_SESSION_INFO) -> CK_RV, + unsafe extern "C" fn(hSession: CK_SESSION_HANDLE, pInfo: CK_SESSION_INFO_PTR) -> CK_RV, ::libloading::Error, >, pub C_GetOperationState: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - operation_state: *mut ::std::os::raw::c_uchar, - operation_state_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pOperationState: CK_BYTE_PTR, + pulOperationStateLen: CK_ULONG_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_SetOperationState: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - operation_state: *mut ::std::os::raw::c_uchar, - operation_state_len: ::std::os::raw::c_ulong, - encryption_key: CK_OBJECT_HANDLE, - authentiation_key: CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pOperationState: CK_BYTE_PTR, + ulOperationStateLen: CK_ULONG, + hEncryptionKey: CK_OBJECT_HANDLE, + hAuthenticationKey: CK_OBJECT_HANDLE, ) -> CK_RV, ::libloading::Error, >, pub C_Login: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - user_type: CK_USER_TYPE, - pin: *mut ::std::os::raw::c_uchar, - pin_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + userType: CK_USER_TYPE, + pPin: CK_UTF8CHAR_PTR, + ulPinLen: CK_ULONG, ) -> CK_RV, ::libloading::Error, >, pub C_Logout: - Result CK_RV, ::libloading::Error>, + Result CK_RV, ::libloading::Error>, pub C_CreateObject: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - templ: *mut _CK_ATTRIBUTE, - ulCount: ::std::os::raw::c_ulong, - object: *mut CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pTemplate: CK_ATTRIBUTE_PTR, + ulCount: CK_ULONG, + phObject: CK_OBJECT_HANDLE_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_CopyObject: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - object: CK_OBJECT_HANDLE, - templ: *mut _CK_ATTRIBUTE, - ulCount: ::std::os::raw::c_ulong, - new_object: *mut CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + hObject: CK_OBJECT_HANDLE, + pTemplate: CK_ATTRIBUTE_PTR, + ulCount: CK_ULONG, + phNewObject: CK_OBJECT_HANDLE_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_DestroyObject: Result< - unsafe extern "C" fn(session: CK_SESSION_HANDLE, object: CK_OBJECT_HANDLE) -> CK_RV, + unsafe extern "C" fn(hSession: CK_SESSION_HANDLE, hObject: CK_OBJECT_HANDLE) -> CK_RV, ::libloading::Error, >, pub C_GetObjectSize: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - object: CK_OBJECT_HANDLE, - size: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + hObject: CK_OBJECT_HANDLE, + pulSize: CK_ULONG_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_GetAttributeValue: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - object: CK_OBJECT_HANDLE, - templ: *mut _CK_ATTRIBUTE, - ulCount: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + hObject: CK_OBJECT_HANDLE, + pTemplate: CK_ATTRIBUTE_PTR, + ulCount: CK_ULONG, ) -> CK_RV, ::libloading::Error, >, pub C_SetAttributeValue: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - object: CK_OBJECT_HANDLE, - templ: *mut _CK_ATTRIBUTE, - ulCount: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + hObject: CK_OBJECT_HANDLE, + pTemplate: CK_ATTRIBUTE_PTR, + ulCount: CK_ULONG, ) -> CK_RV, ::libloading::Error, >, pub C_FindObjectsInit: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - templ: *mut _CK_ATTRIBUTE, - ulCount: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pTemplate: CK_ATTRIBUTE_PTR, + ulCount: CK_ULONG, ) -> CK_RV, ::libloading::Error, >, pub C_FindObjects: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - object: *mut CK_OBJECT_HANDLE, - max_object_count: ::std::os::raw::c_ulong, - object_count: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + phObject: CK_OBJECT_HANDLE_PTR, + ulMaxObjectCount: CK_ULONG, + pulObjectCount: CK_ULONG_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_FindObjectsFinal: - Result CK_RV, ::libloading::Error>, + Result CK_RV, ::libloading::Error>, pub C_EncryptInit: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - key: CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, ) -> CK_RV, ::libloading::Error, >, pub C_Encrypt: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - data: *mut ::std::os::raw::c_uchar, - data_len: ::std::os::raw::c_ulong, - encrypted_data: *mut ::std::os::raw::c_uchar, - encrypted_data_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pEncryptedData: CK_BYTE_PTR, + pulEncryptedDataLen: CK_ULONG_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_EncryptUpdate: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - part: *mut ::std::os::raw::c_uchar, - part_len: ::std::os::raw::c_ulong, - encrypted_part: *mut ::std::os::raw::c_uchar, - encrypted_part_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pPart: CK_BYTE_PTR, + ulPartLen: CK_ULONG, + pEncryptedPart: CK_BYTE_PTR, + pulEncryptedPartLen: CK_ULONG_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_EncryptFinal: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - last_encrypted_part: *mut ::std::os::raw::c_uchar, - last_encrypted_part_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pLastEncryptedPart: CK_BYTE_PTR, + pulLastEncryptedPartLen: CK_ULONG_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_DecryptInit: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - key: CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, ) -> CK_RV, ::libloading::Error, >, pub C_Decrypt: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - encrypted_data: *mut ::std::os::raw::c_uchar, - encrypted_data_len: ::std::os::raw::c_ulong, - data: *mut ::std::os::raw::c_uchar, - data_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pEncryptedData: CK_BYTE_PTR, + ulEncryptedDataLen: CK_ULONG, + pData: CK_BYTE_PTR, + pulDataLen: CK_ULONG_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_DecryptUpdate: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - encrypted_part: *mut ::std::os::raw::c_uchar, - encrypted_part_len: ::std::os::raw::c_ulong, - part: *mut ::std::os::raw::c_uchar, - part_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pEncryptedPart: CK_BYTE_PTR, + ulEncryptedPartLen: CK_ULONG, + pPart: CK_BYTE_PTR, + pulPartLen: CK_ULONG_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_DecryptFinal: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - last_part: *mut ::std::os::raw::c_uchar, - last_part_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pLastPart: CK_BYTE_PTR, + pulLastPartLen: CK_ULONG_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_DigestInit: Result< - unsafe extern "C" fn(session: CK_SESSION_HANDLE, mechanism: *mut _CK_MECHANISM) -> CK_RV, + unsafe extern "C" fn(hSession: CK_SESSION_HANDLE, pMechanism: CK_MECHANISM_PTR) -> CK_RV, ::libloading::Error, >, pub C_Digest: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - data: *mut ::std::os::raw::c_uchar, - data_len: ::std::os::raw::c_ulong, - digest: *mut ::std::os::raw::c_uchar, - digest_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pDigest: CK_BYTE_PTR, + pulDigestLen: CK_ULONG_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_DigestUpdate: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - part: *mut ::std::os::raw::c_uchar, - part_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pPart: CK_BYTE_PTR, + ulPartLen: CK_ULONG, ) -> CK_RV, ::libloading::Error, >, pub C_DigestKey: Result< - unsafe extern "C" fn(session: CK_SESSION_HANDLE, key: CK_OBJECT_HANDLE) -> CK_RV, + unsafe extern "C" fn(hSession: CK_SESSION_HANDLE, hKey: CK_OBJECT_HANDLE) -> CK_RV, ::libloading::Error, >, pub C_DigestFinal: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - digest: *mut ::std::os::raw::c_uchar, - digest_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pDigest: CK_BYTE_PTR, + pulDigestLen: CK_ULONG_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_SignInit: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - key: CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, ) -> CK_RV, ::libloading::Error, >, pub C_Sign: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - data: *mut ::std::os::raw::c_uchar, - data_len: ::std::os::raw::c_ulong, - signature: *mut ::std::os::raw::c_uchar, - signature_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + pulSignatureLen: CK_ULONG_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_SignUpdate: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - part: *mut ::std::os::raw::c_uchar, - part_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pPart: CK_BYTE_PTR, + ulPartLen: CK_ULONG, ) -> CK_RV, ::libloading::Error, >, pub C_SignFinal: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - signature: *mut ::std::os::raw::c_uchar, - signature_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pSignature: CK_BYTE_PTR, + pulSignatureLen: CK_ULONG_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_SignRecoverInit: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - key: CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, ) -> CK_RV, ::libloading::Error, >, pub C_SignRecover: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - data: *mut ::std::os::raw::c_uchar, - data_len: ::std::os::raw::c_ulong, - signature: *mut ::std::os::raw::c_uchar, - signature_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + pulSignatureLen: CK_ULONG_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_VerifyInit: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - key: CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, ) -> CK_RV, ::libloading::Error, >, pub C_Verify: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - data: *mut ::std::os::raw::c_uchar, - data_len: ::std::os::raw::c_ulong, - signature: *mut ::std::os::raw::c_uchar, - signature_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + ulSignatureLen: CK_ULONG, ) -> CK_RV, ::libloading::Error, >, pub C_VerifyUpdate: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - part: *mut ::std::os::raw::c_uchar, - part_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pPart: CK_BYTE_PTR, + ulPartLen: CK_ULONG, ) -> CK_RV, ::libloading::Error, >, pub C_VerifyFinal: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - signature: *mut ::std::os::raw::c_uchar, - signature_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pSignature: CK_BYTE_PTR, + ulSignatureLen: CK_ULONG, ) -> CK_RV, ::libloading::Error, >, pub C_VerifyRecoverInit: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - key: CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, ) -> CK_RV, ::libloading::Error, >, pub C_VerifyRecover: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - signature: *mut ::std::os::raw::c_uchar, - signature_len: ::std::os::raw::c_ulong, - data: *mut ::std::os::raw::c_uchar, - data_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pSignature: CK_BYTE_PTR, + ulSignatureLen: CK_ULONG, + pData: CK_BYTE_PTR, + pulDataLen: CK_ULONG_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_DigestEncryptUpdate: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - part: *mut ::std::os::raw::c_uchar, - part_len: ::std::os::raw::c_ulong, - encrypted_part: *mut ::std::os::raw::c_uchar, - encrypted_part_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pPart: CK_BYTE_PTR, + ulPartLen: CK_ULONG, + pEncryptedPart: CK_BYTE_PTR, + pulEncryptedPartLen: CK_ULONG_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_DecryptDigestUpdate: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - encrypted_part: *mut ::std::os::raw::c_uchar, - encrypted_part_len: ::std::os::raw::c_ulong, - part: *mut ::std::os::raw::c_uchar, - part_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pEncryptedPart: CK_BYTE_PTR, + ulEncryptedPartLen: CK_ULONG, + pPart: CK_BYTE_PTR, + pulPartLen: CK_ULONG_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_SignEncryptUpdate: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - part: *mut ::std::os::raw::c_uchar, - part_len: ::std::os::raw::c_ulong, - encrypted_part: *mut ::std::os::raw::c_uchar, - encrypted_part_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pPart: CK_BYTE_PTR, + ulPartLen: CK_ULONG, + pEncryptedPart: CK_BYTE_PTR, + pulEncryptedPartLen: CK_ULONG_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_DecryptVerifyUpdate: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - encrypted_part: *mut ::std::os::raw::c_uchar, - encrypted_part_len: ::std::os::raw::c_ulong, - part: *mut ::std::os::raw::c_uchar, - part_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pEncryptedPart: CK_BYTE_PTR, + ulEncryptedPartLen: CK_ULONG, + pPart: CK_BYTE_PTR, + pulPartLen: CK_ULONG_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_GenerateKey: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - templ: *mut _CK_ATTRIBUTE, - ulCount: ::std::os::raw::c_ulong, - key: *mut CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + pTemplate: CK_ATTRIBUTE_PTR, + ulCount: CK_ULONG, + phKey: CK_OBJECT_HANDLE_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_GenerateKeyPair: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - public_key_template: *mut _CK_ATTRIBUTE, - public_key_attribute_count: ::std::os::raw::c_ulong, - private_key_template: *mut _CK_ATTRIBUTE, - private_key_attribute_count: ::std::os::raw::c_ulong, - public_key: *mut CK_OBJECT_HANDLE, - private_key: *mut CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + pPublicKeyTemplate: CK_ATTRIBUTE_PTR, + ulPublicKeyAttributeCount: CK_ULONG, + pPrivateKeyTemplate: CK_ATTRIBUTE_PTR, + ulPrivateKeyAttributeCount: CK_ULONG, + phPublicKey: CK_OBJECT_HANDLE_PTR, + phPrivateKey: CK_OBJECT_HANDLE_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_WrapKey: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - wrapping_key: CK_OBJECT_HANDLE, - key: CK_OBJECT_HANDLE, - wrapped_key: *mut ::std::os::raw::c_uchar, - wrapped_key_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hWrappingKey: CK_OBJECT_HANDLE, + hKey: CK_OBJECT_HANDLE, + pWrappedKey: CK_BYTE_PTR, + pulWrappedKeyLen: CK_ULONG_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_UnwrapKey: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - unwrapping_key: CK_OBJECT_HANDLE, - wrapped_key: *mut ::std::os::raw::c_uchar, - wrapped_key_len: ::std::os::raw::c_ulong, - templ: *mut _CK_ATTRIBUTE, - attribute_count: ::std::os::raw::c_ulong, - key: *mut CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hUnwrappingKey: CK_OBJECT_HANDLE, + pWrappedKey: CK_BYTE_PTR, + ulWrappedKeyLen: CK_ULONG, + pTemplate: CK_ATTRIBUTE_PTR, + ulAttributeCount: CK_ULONG, + phKey: CK_OBJECT_HANDLE_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_DeriveKey: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - base_key: CK_OBJECT_HANDLE, - templ: *mut _CK_ATTRIBUTE, - attribute_count: ::std::os::raw::c_ulong, - key: *mut CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hBaseKey: CK_OBJECT_HANDLE, + pTemplate: CK_ATTRIBUTE_PTR, + ulAttributeCount: CK_ULONG, + phKey: CK_OBJECT_HANDLE_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_SeedRandom: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - seed: *mut ::std::os::raw::c_uchar, - seed_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pSeed: CK_BYTE_PTR, + ulSeedLen: CK_ULONG, ) -> CK_RV, ::libloading::Error, >, pub C_GenerateRandom: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - random_data: *mut ::std::os::raw::c_uchar, - random_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + RandomData: CK_BYTE_PTR, + ulRandomLen: CK_ULONG, ) -> CK_RV, ::libloading::Error, >, pub C_GetFunctionStatus: - Result CK_RV, ::libloading::Error>, + Result CK_RV, ::libloading::Error>, pub C_CancelFunction: - Result CK_RV, ::libloading::Error>, + Result CK_RV, ::libloading::Error>, + pub C_WaitForSlotEvent: Result< + unsafe extern "C" fn( + flags: CK_FLAGS, + pSlot: CK_SLOT_ID_PTR, + pRserved: CK_VOID_PTR, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_GetInterfaceList: Result< + unsafe extern "C" fn(pInterfacesList: CK_INTERFACE_PTR, pulCount: CK_ULONG_PTR) -> CK_RV, + ::libloading::Error, + >, + pub C_GetInterface: Result< + unsafe extern "C" fn( + pInterfaceName: CK_UTF8CHAR_PTR, + pVersion: CK_VERSION_PTR, + ppInterface: CK_INTERFACE_PTR_PTR, + flags: CK_FLAGS, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_LoginUser: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + userType: CK_USER_TYPE, + pPin: CK_UTF8CHAR_PTR, + ulPinLen: CK_ULONG, + pUsername: CK_UTF8CHAR_PTR, + ulUsernameLen: CK_ULONG, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_SessionCancel: Result< + unsafe extern "C" fn(hSession: CK_SESSION_HANDLE, flags: CK_FLAGS) -> CK_RV, + ::libloading::Error, + >, + pub C_MessageEncryptInit: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_EncryptMessage: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pAssociatedData: CK_BYTE_PTR, + ulAssociatedDataLen: CK_ULONG, + pPlaintext: CK_BYTE_PTR, + ulPlaintextLen: CK_ULONG, + pCiphertext: CK_BYTE_PTR, + pulCiphertextLen: CK_ULONG_PTR, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_EncryptMessageBegin: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pAssociatedData: CK_BYTE_PTR, + ulAssociatedDataLen: CK_ULONG, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_EncryptMessageNext: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pPlaintextPart: CK_BYTE_PTR, + ulPlaintextPartLen: CK_ULONG, + pCiphertextPart: CK_BYTE_PTR, + pulCiphertextPartLen: CK_ULONG_PTR, + flags: CK_FLAGS, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_MessageEncryptFinal: + Result CK_RV, ::libloading::Error>, + pub C_MessageDecryptInit: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_DecryptMessage: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pAssociatedData: CK_BYTE_PTR, + ulAssociatedDataLen: CK_ULONG, + pCiphertext: CK_BYTE_PTR, + ulCiphertextLen: CK_ULONG, + pPlaintext: CK_BYTE_PTR, + pulPlaintextLen: CK_ULONG_PTR, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_DecryptMessageBegin: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pAssociatedData: CK_BYTE_PTR, + ulAssociatedDataLen: CK_ULONG, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_DecryptMessageNext: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pCiphertext: CK_BYTE_PTR, + ulCiphertextLen: CK_ULONG, + pPlaintext: CK_BYTE_PTR, + pulPlaintextLen: CK_ULONG_PTR, + flags: CK_FLAGS, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_MessageDecryptFinal: + Result CK_RV, ::libloading::Error>, + pub C_MessageSignInit: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_SignMessage: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + pulSignatureLen: CK_ULONG_PTR, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_SignMessageBegin: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_SignMessageNext: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + pulSignatureLen: CK_ULONG_PTR, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_MessageSignFinal: + Result CK_RV, ::libloading::Error>, + pub C_MessageVerifyInit: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_VerifyMessage: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + ulSignatureLen: CK_ULONG, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_VerifyMessageBegin: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_VerifyMessageNext: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + ulSignatureLen: CK_ULONG, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_MessageVerifyFinal: + Result CK_RV, ::libloading::Error>, } impl Pkcs11 { pub unsafe fn new

(path: P) -> Result @@ -4064,7 +11263,6 @@ impl Pkcs11 { let C_GetSlotList = __library.get(b"C_GetSlotList\0").map(|sym| *sym); let C_GetSlotInfo = __library.get(b"C_GetSlotInfo\0").map(|sym| *sym); let C_GetTokenInfo = __library.get(b"C_GetTokenInfo\0").map(|sym| *sym); - let C_WaitForSlotEvent = __library.get(b"C_WaitForSlotEvent\0").map(|sym| *sym); let C_GetMechanismList = __library.get(b"C_GetMechanismList\0").map(|sym| *sym); let C_GetMechanismInfo = __library.get(b"C_GetMechanismInfo\0").map(|sym| *sym); let C_InitToken = __library.get(b"C_InitToken\0").map(|sym| *sym); @@ -4125,6 +11323,31 @@ impl Pkcs11 { let C_GenerateRandom = __library.get(b"C_GenerateRandom\0").map(|sym| *sym); let C_GetFunctionStatus = __library.get(b"C_GetFunctionStatus\0").map(|sym| *sym); let C_CancelFunction = __library.get(b"C_CancelFunction\0").map(|sym| *sym); + let C_WaitForSlotEvent = __library.get(b"C_WaitForSlotEvent\0").map(|sym| *sym); + let C_GetInterfaceList = __library.get(b"C_GetInterfaceList\0").map(|sym| *sym); + let C_GetInterface = __library.get(b"C_GetInterface\0").map(|sym| *sym); + let C_LoginUser = __library.get(b"C_LoginUser\0").map(|sym| *sym); + let C_SessionCancel = __library.get(b"C_SessionCancel\0").map(|sym| *sym); + let C_MessageEncryptInit = __library.get(b"C_MessageEncryptInit\0").map(|sym| *sym); + let C_EncryptMessage = __library.get(b"C_EncryptMessage\0").map(|sym| *sym); + let C_EncryptMessageBegin = __library.get(b"C_EncryptMessageBegin\0").map(|sym| *sym); + let C_EncryptMessageNext = __library.get(b"C_EncryptMessageNext\0").map(|sym| *sym); + let C_MessageEncryptFinal = __library.get(b"C_MessageEncryptFinal\0").map(|sym| *sym); + let C_MessageDecryptInit = __library.get(b"C_MessageDecryptInit\0").map(|sym| *sym); + let C_DecryptMessage = __library.get(b"C_DecryptMessage\0").map(|sym| *sym); + let C_DecryptMessageBegin = __library.get(b"C_DecryptMessageBegin\0").map(|sym| *sym); + let C_DecryptMessageNext = __library.get(b"C_DecryptMessageNext\0").map(|sym| *sym); + let C_MessageDecryptFinal = __library.get(b"C_MessageDecryptFinal\0").map(|sym| *sym); + let C_MessageSignInit = __library.get(b"C_MessageSignInit\0").map(|sym| *sym); + let C_SignMessage = __library.get(b"C_SignMessage\0").map(|sym| *sym); + let C_SignMessageBegin = __library.get(b"C_SignMessageBegin\0").map(|sym| *sym); + let C_SignMessageNext = __library.get(b"C_SignMessageNext\0").map(|sym| *sym); + let C_MessageSignFinal = __library.get(b"C_MessageSignFinal\0").map(|sym| *sym); + let C_MessageVerifyInit = __library.get(b"C_MessageVerifyInit\0").map(|sym| *sym); + let C_VerifyMessage = __library.get(b"C_VerifyMessage\0").map(|sym| *sym); + let C_VerifyMessageBegin = __library.get(b"C_VerifyMessageBegin\0").map(|sym| *sym); + let C_VerifyMessageNext = __library.get(b"C_VerifyMessageNext\0").map(|sym| *sym); + let C_MessageVerifyFinal = __library.get(b"C_MessageVerifyFinal\0").map(|sym| *sym); Ok(Pkcs11 { __library, C_Initialize, @@ -4134,7 +11357,6 @@ impl Pkcs11 { C_GetSlotList, C_GetSlotInfo, C_GetTokenInfo, - C_WaitForSlotEvent, C_GetMechanismList, C_GetMechanismInfo, C_InitToken, @@ -4195,146 +11417,164 @@ impl Pkcs11 { C_GenerateRandom, C_GetFunctionStatus, C_CancelFunction, + C_WaitForSlotEvent, + C_GetInterfaceList, + C_GetInterface, + C_LoginUser, + C_SessionCancel, + C_MessageEncryptInit, + C_EncryptMessage, + C_EncryptMessageBegin, + C_EncryptMessageNext, + C_MessageEncryptFinal, + C_MessageDecryptInit, + C_DecryptMessage, + C_DecryptMessageBegin, + C_DecryptMessageNext, + C_MessageDecryptFinal, + C_MessageSignInit, + C_SignMessage, + C_SignMessageBegin, + C_SignMessageNext, + C_MessageSignFinal, + C_MessageVerifyInit, + C_VerifyMessage, + C_VerifyMessageBegin, + C_VerifyMessageNext, + C_MessageVerifyFinal, }) } - pub unsafe fn C_Initialize(&self, init_args: *mut ::std::os::raw::c_void) -> CK_RV { + pub unsafe fn C_Initialize(&self, pInitArgs: CK_VOID_PTR) -> CK_RV { (self .C_Initialize .as_ref() - .expect("Expected function, got error."))(init_args) + .expect("Expected function, got error."))(pInitArgs) } - pub unsafe fn C_Finalize(&self, pReserved: *mut ::std::os::raw::c_void) -> CK_RV { + pub unsafe fn C_Finalize(&self, pReserved: CK_VOID_PTR) -> CK_RV { (self .C_Finalize .as_ref() .expect("Expected function, got error."))(pReserved) } - pub unsafe fn C_GetInfo(&self, info: *mut _CK_INFO) -> CK_RV { + pub unsafe fn C_GetInfo(&self, pInfo: CK_INFO_PTR) -> CK_RV { (self .C_GetInfo .as_ref() - .expect("Expected function, got error."))(info) + .expect("Expected function, got error."))(pInfo) } - pub unsafe fn C_GetFunctionList(&self, function_list: *mut *mut _CK_FUNCTION_LIST) -> CK_RV { + pub unsafe fn C_GetFunctionList(&self, ppFunctionList: CK_FUNCTION_LIST_PTR_PTR) -> CK_RV { (self .C_GetFunctionList .as_ref() - .expect("Expected function, got error."))(function_list) + .expect("Expected function, got error."))(ppFunctionList) } pub unsafe fn C_GetSlotList( &self, - token_present: ::std::os::raw::c_uchar, - slot_list: *mut CK_SLOT_ID, - ulCount: *mut ::std::os::raw::c_ulong, + tokenPresent: CK_BBOOL, + pSlotList: CK_SLOT_ID_PTR, + pulCount: CK_ULONG_PTR, ) -> CK_RV { (self .C_GetSlotList .as_ref() - .expect("Expected function, got error."))(token_present, slot_list, ulCount) + .expect("Expected function, got error."))(tokenPresent, pSlotList, pulCount) } - pub unsafe fn C_GetSlotInfo(&self, slotID: CK_SLOT_ID, info: *mut _CK_SLOT_INFO) -> CK_RV { + pub unsafe fn C_GetSlotInfo(&self, slotID: CK_SLOT_ID, pInfo: CK_SLOT_INFO_PTR) -> CK_RV { (self .C_GetSlotInfo .as_ref() - .expect("Expected function, got error."))(slotID, info) + .expect("Expected function, got error."))(slotID, pInfo) } - pub unsafe fn C_GetTokenInfo(&self, slotID: CK_SLOT_ID, info: *mut _CK_TOKEN_INFO) -> CK_RV { + pub unsafe fn C_GetTokenInfo(&self, slotID: CK_SLOT_ID, pInfo: CK_TOKEN_INFO_PTR) -> CK_RV { (self .C_GetTokenInfo .as_ref() - .expect("Expected function, got error."))(slotID, info) - } - pub unsafe fn C_WaitForSlotEvent( - &self, - flags: CK_FLAGS, - slot: *mut CK_SLOT_ID, - pReserved: *mut ::std::os::raw::c_void, - ) -> CK_RV { - (self - .C_WaitForSlotEvent - .as_ref() - .expect("Expected function, got error."))(flags, slot, pReserved) + .expect("Expected function, got error."))(slotID, pInfo) } pub unsafe fn C_GetMechanismList( &self, slotID: CK_SLOT_ID, - mechanism_list: *mut CK_MECHANISM_TYPE, - ulCount: *mut ::std::os::raw::c_ulong, + pMechanismList: CK_MECHANISM_TYPE_PTR, + pulCount: CK_ULONG_PTR, ) -> CK_RV { (self .C_GetMechanismList .as_ref() - .expect("Expected function, got error."))(slotID, mechanism_list, ulCount) + .expect("Expected function, got error."))(slotID, pMechanismList, pulCount) } pub unsafe fn C_GetMechanismInfo( &self, slotID: CK_SLOT_ID, type_: CK_MECHANISM_TYPE, - info: *mut _CK_MECHANISM_INFO, + pInfo: CK_MECHANISM_INFO_PTR, ) -> CK_RV { (self .C_GetMechanismInfo .as_ref() - .expect("Expected function, got error."))(slotID, type_, info) + .expect("Expected function, got error."))(slotID, type_, pInfo) } pub unsafe fn C_InitToken( &self, slotID: CK_SLOT_ID, - pin: *mut ::std::os::raw::c_uchar, - pin_len: ::std::os::raw::c_ulong, - label: *mut ::std::os::raw::c_uchar, + pPin: CK_UTF8CHAR_PTR, + ulPinLen: CK_ULONG, + pLabel: CK_UTF8CHAR_PTR, ) -> CK_RV { (self .C_InitToken .as_ref() - .expect("Expected function, got error."))(slotID, pin, pin_len, label) + .expect("Expected function, got error."))(slotID, pPin, ulPinLen, pLabel) } pub unsafe fn C_InitPIN( &self, - session: CK_SESSION_HANDLE, - pin: *mut ::std::os::raw::c_uchar, - pin_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pPin: CK_UTF8CHAR_PTR, + ulPinLen: CK_ULONG, ) -> CK_RV { (self .C_InitPIN .as_ref() - .expect("Expected function, got error."))(session, pin, pin_len) + .expect("Expected function, got error."))(hSession, pPin, ulPinLen) } pub unsafe fn C_SetPIN( &self, - session: CK_SESSION_HANDLE, - old_pin: *mut ::std::os::raw::c_uchar, - old_len: ::std::os::raw::c_ulong, - new_pin: *mut ::std::os::raw::c_uchar, - new_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pOldPin: CK_UTF8CHAR_PTR, + ulOldLen: CK_ULONG, + pNewPin: CK_UTF8CHAR_PTR, + ulNewLen: CK_ULONG, ) -> CK_RV { (self .C_SetPIN .as_ref() .expect("Expected function, got error."))( - session, old_pin, old_len, new_pin, new_len + hSession, pOldPin, ulOldLen, pNewPin, ulNewLen, ) } pub unsafe fn C_OpenSession( &self, slotID: CK_SLOT_ID, flags: CK_FLAGS, - application: *mut ::std::os::raw::c_void, - notify: CK_NOTIFY, - session: *mut CK_SESSION_HANDLE, + pApplication: CK_VOID_PTR, + Notify: CK_NOTIFY, + phSession: CK_SESSION_HANDLE_PTR, ) -> CK_RV { (self .C_OpenSession .as_ref() .expect("Expected function, got error."))( - slotID, flags, application, notify, session + slotID, + flags, + pApplication, + Notify, + phSession, ) } - pub unsafe fn C_CloseSession(&self, session: CK_SESSION_HANDLE) -> CK_RV { + pub unsafe fn C_CloseSession(&self, hSession: CK_SESSION_HANDLE) -> CK_RV { (self .C_CloseSession .as_ref() - .expect("Expected function, got error."))(session) + .expect("Expected function, got error."))(hSession) } pub unsafe fn C_CloseAllSessions(&self, slotID: CK_SLOT_ID) -> CK_RV { (self @@ -4344,723 +11584,1119 @@ impl Pkcs11 { } pub unsafe fn C_GetSessionInfo( &self, - session: CK_SESSION_HANDLE, - info: *mut _CK_SESSION_INFO, + hSession: CK_SESSION_HANDLE, + pInfo: CK_SESSION_INFO_PTR, ) -> CK_RV { (self .C_GetSessionInfo .as_ref() - .expect("Expected function, got error."))(session, info) + .expect("Expected function, got error."))(hSession, pInfo) } pub unsafe fn C_GetOperationState( &self, - session: CK_SESSION_HANDLE, - operation_state: *mut ::std::os::raw::c_uchar, - operation_state_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pOperationState: CK_BYTE_PTR, + pulOperationStateLen: CK_ULONG_PTR, ) -> CK_RV { (self .C_GetOperationState .as_ref() .expect("Expected function, got error."))( - session, operation_state, operation_state_len + hSession, + pOperationState, + pulOperationStateLen, ) } pub unsafe fn C_SetOperationState( &self, - session: CK_SESSION_HANDLE, - operation_state: *mut ::std::os::raw::c_uchar, - operation_state_len: ::std::os::raw::c_ulong, - encryption_key: CK_OBJECT_HANDLE, - authentiation_key: CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pOperationState: CK_BYTE_PTR, + ulOperationStateLen: CK_ULONG, + hEncryptionKey: CK_OBJECT_HANDLE, + hAuthenticationKey: CK_OBJECT_HANDLE, ) -> CK_RV { (self .C_SetOperationState .as_ref() .expect("Expected function, got error."))( - session, - operation_state, - operation_state_len, - encryption_key, - authentiation_key, + hSession, + pOperationState, + ulOperationStateLen, + hEncryptionKey, + hAuthenticationKey, ) } pub unsafe fn C_Login( &self, - session: CK_SESSION_HANDLE, - user_type: CK_USER_TYPE, - pin: *mut ::std::os::raw::c_uchar, - pin_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + userType: CK_USER_TYPE, + pPin: CK_UTF8CHAR_PTR, + ulPinLen: CK_ULONG, ) -> CK_RV { (self .C_Login .as_ref() - .expect("Expected function, got error."))(session, user_type, pin, pin_len) + .expect("Expected function, got error."))(hSession, userType, pPin, ulPinLen) } - pub unsafe fn C_Logout(&self, session: CK_SESSION_HANDLE) -> CK_RV { + pub unsafe fn C_Logout(&self, hSession: CK_SESSION_HANDLE) -> CK_RV { (self .C_Logout .as_ref() - .expect("Expected function, got error."))(session) + .expect("Expected function, got error."))(hSession) } pub unsafe fn C_CreateObject( &self, - session: CK_SESSION_HANDLE, - templ: *mut _CK_ATTRIBUTE, - ulCount: ::std::os::raw::c_ulong, - object: *mut CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pTemplate: CK_ATTRIBUTE_PTR, + ulCount: CK_ULONG, + phObject: CK_OBJECT_HANDLE_PTR, ) -> CK_RV { (self .C_CreateObject .as_ref() - .expect("Expected function, got error."))(session, templ, ulCount, object) + .expect("Expected function, got error."))(hSession, pTemplate, ulCount, phObject) } pub unsafe fn C_CopyObject( &self, - session: CK_SESSION_HANDLE, - object: CK_OBJECT_HANDLE, - templ: *mut _CK_ATTRIBUTE, - ulCount: ::std::os::raw::c_ulong, - new_object: *mut CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + hObject: CK_OBJECT_HANDLE, + pTemplate: CK_ATTRIBUTE_PTR, + ulCount: CK_ULONG, + phNewObject: CK_OBJECT_HANDLE_PTR, ) -> CK_RV { (self .C_CopyObject .as_ref() .expect("Expected function, got error."))( - session, object, templ, ulCount, new_object + hSession, + hObject, + pTemplate, + ulCount, + phNewObject, ) } pub unsafe fn C_DestroyObject( &self, - session: CK_SESSION_HANDLE, - object: CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + hObject: CK_OBJECT_HANDLE, ) -> CK_RV { (self .C_DestroyObject .as_ref() - .expect("Expected function, got error."))(session, object) + .expect("Expected function, got error."))(hSession, hObject) } pub unsafe fn C_GetObjectSize( &self, - session: CK_SESSION_HANDLE, - object: CK_OBJECT_HANDLE, - size: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + hObject: CK_OBJECT_HANDLE, + pulSize: CK_ULONG_PTR, ) -> CK_RV { (self .C_GetObjectSize .as_ref() - .expect("Expected function, got error."))(session, object, size) + .expect("Expected function, got error."))(hSession, hObject, pulSize) } pub unsafe fn C_GetAttributeValue( &self, - session: CK_SESSION_HANDLE, - object: CK_OBJECT_HANDLE, - templ: *mut _CK_ATTRIBUTE, - ulCount: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + hObject: CK_OBJECT_HANDLE, + pTemplate: CK_ATTRIBUTE_PTR, + ulCount: CK_ULONG, ) -> CK_RV { (self .C_GetAttributeValue .as_ref() - .expect("Expected function, got error."))(session, object, templ, ulCount) + .expect("Expected function, got error."))(hSession, hObject, pTemplate, ulCount) } pub unsafe fn C_SetAttributeValue( &self, - session: CK_SESSION_HANDLE, - object: CK_OBJECT_HANDLE, - templ: *mut _CK_ATTRIBUTE, - ulCount: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + hObject: CK_OBJECT_HANDLE, + pTemplate: CK_ATTRIBUTE_PTR, + ulCount: CK_ULONG, ) -> CK_RV { (self .C_SetAttributeValue .as_ref() - .expect("Expected function, got error."))(session, object, templ, ulCount) + .expect("Expected function, got error."))(hSession, hObject, pTemplate, ulCount) } pub unsafe fn C_FindObjectsInit( &self, - session: CK_SESSION_HANDLE, - templ: *mut _CK_ATTRIBUTE, - ulCount: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pTemplate: CK_ATTRIBUTE_PTR, + ulCount: CK_ULONG, ) -> CK_RV { (self .C_FindObjectsInit .as_ref() - .expect("Expected function, got error."))(session, templ, ulCount) + .expect("Expected function, got error."))(hSession, pTemplate, ulCount) } pub unsafe fn C_FindObjects( &self, - session: CK_SESSION_HANDLE, - object: *mut CK_OBJECT_HANDLE, - max_object_count: ::std::os::raw::c_ulong, - object_count: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + phObject: CK_OBJECT_HANDLE_PTR, + ulMaxObjectCount: CK_ULONG, + pulObjectCount: CK_ULONG_PTR, ) -> CK_RV { (self .C_FindObjects .as_ref() .expect("Expected function, got error."))( - session, - object, - max_object_count, - object_count, + hSession, + phObject, + ulMaxObjectCount, + pulObjectCount, ) } - pub unsafe fn C_FindObjectsFinal(&self, session: CK_SESSION_HANDLE) -> CK_RV { + pub unsafe fn C_FindObjectsFinal(&self, hSession: CK_SESSION_HANDLE) -> CK_RV { (self .C_FindObjectsFinal .as_ref() - .expect("Expected function, got error."))(session) + .expect("Expected function, got error."))(hSession) } pub unsafe fn C_EncryptInit( &self, - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - key: CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, ) -> CK_RV { (self .C_EncryptInit .as_ref() - .expect("Expected function, got error."))(session, mechanism, key) + .expect("Expected function, got error."))(hSession, pMechanism, hKey) } pub unsafe fn C_Encrypt( &self, - session: CK_SESSION_HANDLE, - data: *mut ::std::os::raw::c_uchar, - data_len: ::std::os::raw::c_ulong, - encrypted_data: *mut ::std::os::raw::c_uchar, - encrypted_data_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pEncryptedData: CK_BYTE_PTR, + pulEncryptedDataLen: CK_ULONG_PTR, ) -> CK_RV { (self .C_Encrypt .as_ref() .expect("Expected function, got error."))( - session, - data, - data_len, - encrypted_data, - encrypted_data_len, + hSession, + pData, + ulDataLen, + pEncryptedData, + pulEncryptedDataLen, ) } pub unsafe fn C_EncryptUpdate( &self, - session: CK_SESSION_HANDLE, - part: *mut ::std::os::raw::c_uchar, - part_len: ::std::os::raw::c_ulong, - encrypted_part: *mut ::std::os::raw::c_uchar, - encrypted_part_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pPart: CK_BYTE_PTR, + ulPartLen: CK_ULONG, + pEncryptedPart: CK_BYTE_PTR, + pulEncryptedPartLen: CK_ULONG_PTR, ) -> CK_RV { (self .C_EncryptUpdate .as_ref() .expect("Expected function, got error."))( - session, - part, - part_len, - encrypted_part, - encrypted_part_len, + hSession, + pPart, + ulPartLen, + pEncryptedPart, + pulEncryptedPartLen, ) } pub unsafe fn C_EncryptFinal( &self, - session: CK_SESSION_HANDLE, - last_encrypted_part: *mut ::std::os::raw::c_uchar, - last_encrypted_part_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pLastEncryptedPart: CK_BYTE_PTR, + pulLastEncryptedPartLen: CK_ULONG_PTR, ) -> CK_RV { (self .C_EncryptFinal .as_ref() .expect("Expected function, got error."))( - session, - last_encrypted_part, - last_encrypted_part_len, + hSession, + pLastEncryptedPart, + pulLastEncryptedPartLen, ) } pub unsafe fn C_DecryptInit( &self, - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - key: CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, ) -> CK_RV { (self .C_DecryptInit .as_ref() - .expect("Expected function, got error."))(session, mechanism, key) + .expect("Expected function, got error."))(hSession, pMechanism, hKey) } pub unsafe fn C_Decrypt( &self, - session: CK_SESSION_HANDLE, - encrypted_data: *mut ::std::os::raw::c_uchar, - encrypted_data_len: ::std::os::raw::c_ulong, - data: *mut ::std::os::raw::c_uchar, - data_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pEncryptedData: CK_BYTE_PTR, + ulEncryptedDataLen: CK_ULONG, + pData: CK_BYTE_PTR, + pulDataLen: CK_ULONG_PTR, ) -> CK_RV { (self .C_Decrypt .as_ref() .expect("Expected function, got error."))( - session, - encrypted_data, - encrypted_data_len, - data, - data_len, + hSession, + pEncryptedData, + ulEncryptedDataLen, + pData, + pulDataLen, ) } pub unsafe fn C_DecryptUpdate( &self, - session: CK_SESSION_HANDLE, - encrypted_part: *mut ::std::os::raw::c_uchar, - encrypted_part_len: ::std::os::raw::c_ulong, - part: *mut ::std::os::raw::c_uchar, - part_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pEncryptedPart: CK_BYTE_PTR, + ulEncryptedPartLen: CK_ULONG, + pPart: CK_BYTE_PTR, + pulPartLen: CK_ULONG_PTR, ) -> CK_RV { (self .C_DecryptUpdate .as_ref() .expect("Expected function, got error."))( - session, - encrypted_part, - encrypted_part_len, - part, - part_len, + hSession, + pEncryptedPart, + ulEncryptedPartLen, + pPart, + pulPartLen, ) } pub unsafe fn C_DecryptFinal( &self, - session: CK_SESSION_HANDLE, - last_part: *mut ::std::os::raw::c_uchar, - last_part_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pLastPart: CK_BYTE_PTR, + pulLastPartLen: CK_ULONG_PTR, ) -> CK_RV { (self .C_DecryptFinal .as_ref() - .expect("Expected function, got error."))(session, last_part, last_part_len) + .expect("Expected function, got error."))(hSession, pLastPart, pulLastPartLen) } pub unsafe fn C_DigestInit( &self, - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, ) -> CK_RV { (self .C_DigestInit .as_ref() - .expect("Expected function, got error."))(session, mechanism) + .expect("Expected function, got error."))(hSession, pMechanism) } pub unsafe fn C_Digest( &self, - session: CK_SESSION_HANDLE, - data: *mut ::std::os::raw::c_uchar, - data_len: ::std::os::raw::c_ulong, - digest: *mut ::std::os::raw::c_uchar, - digest_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pDigest: CK_BYTE_PTR, + pulDigestLen: CK_ULONG_PTR, ) -> CK_RV { (self .C_Digest .as_ref() .expect("Expected function, got error."))( - session, data, data_len, digest, digest_len + hSession, + pData, + ulDataLen, + pDigest, + pulDigestLen, ) } pub unsafe fn C_DigestUpdate( &self, - session: CK_SESSION_HANDLE, - part: *mut ::std::os::raw::c_uchar, - part_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pPart: CK_BYTE_PTR, + ulPartLen: CK_ULONG, ) -> CK_RV { (self .C_DigestUpdate .as_ref() - .expect("Expected function, got error."))(session, part, part_len) + .expect("Expected function, got error."))(hSession, pPart, ulPartLen) } - pub unsafe fn C_DigestKey(&self, session: CK_SESSION_HANDLE, key: CK_OBJECT_HANDLE) -> CK_RV { + pub unsafe fn C_DigestKey(&self, hSession: CK_SESSION_HANDLE, hKey: CK_OBJECT_HANDLE) -> CK_RV { (self .C_DigestKey .as_ref() - .expect("Expected function, got error."))(session, key) + .expect("Expected function, got error."))(hSession, hKey) } pub unsafe fn C_DigestFinal( &self, - session: CK_SESSION_HANDLE, - digest: *mut ::std::os::raw::c_uchar, - digest_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pDigest: CK_BYTE_PTR, + pulDigestLen: CK_ULONG_PTR, ) -> CK_RV { (self .C_DigestFinal .as_ref() - .expect("Expected function, got error."))(session, digest, digest_len) + .expect("Expected function, got error."))(hSession, pDigest, pulDigestLen) } pub unsafe fn C_SignInit( &self, - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - key: CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, ) -> CK_RV { (self .C_SignInit .as_ref() - .expect("Expected function, got error."))(session, mechanism, key) + .expect("Expected function, got error."))(hSession, pMechanism, hKey) } pub unsafe fn C_Sign( &self, - session: CK_SESSION_HANDLE, - data: *mut ::std::os::raw::c_uchar, - data_len: ::std::os::raw::c_ulong, - signature: *mut ::std::os::raw::c_uchar, - signature_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + pulSignatureLen: CK_ULONG_PTR, ) -> CK_RV { (self.C_Sign.as_ref().expect("Expected function, got error."))( - session, - data, - data_len, - signature, - signature_len, + hSession, + pData, + ulDataLen, + pSignature, + pulSignatureLen, ) } pub unsafe fn C_SignUpdate( &self, - session: CK_SESSION_HANDLE, - part: *mut ::std::os::raw::c_uchar, - part_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pPart: CK_BYTE_PTR, + ulPartLen: CK_ULONG, ) -> CK_RV { (self .C_SignUpdate .as_ref() - .expect("Expected function, got error."))(session, part, part_len) + .expect("Expected function, got error."))(hSession, pPart, ulPartLen) } pub unsafe fn C_SignFinal( &self, - session: CK_SESSION_HANDLE, - signature: *mut ::std::os::raw::c_uchar, - signature_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pSignature: CK_BYTE_PTR, + pulSignatureLen: CK_ULONG_PTR, ) -> CK_RV { (self .C_SignFinal .as_ref() - .expect("Expected function, got error."))(session, signature, signature_len) + .expect("Expected function, got error."))(hSession, pSignature, pulSignatureLen) } pub unsafe fn C_SignRecoverInit( &self, - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - key: CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, ) -> CK_RV { (self .C_SignRecoverInit .as_ref() - .expect("Expected function, got error."))(session, mechanism, key) + .expect("Expected function, got error."))(hSession, pMechanism, hKey) } pub unsafe fn C_SignRecover( &self, - session: CK_SESSION_HANDLE, - data: *mut ::std::os::raw::c_uchar, - data_len: ::std::os::raw::c_ulong, - signature: *mut ::std::os::raw::c_uchar, - signature_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + pulSignatureLen: CK_ULONG_PTR, ) -> CK_RV { (self .C_SignRecover .as_ref() .expect("Expected function, got error."))( - session, - data, - data_len, - signature, - signature_len, + hSession, + pData, + ulDataLen, + pSignature, + pulSignatureLen, ) } pub unsafe fn C_VerifyInit( &self, - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - key: CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, ) -> CK_RV { (self .C_VerifyInit .as_ref() - .expect("Expected function, got error."))(session, mechanism, key) + .expect("Expected function, got error."))(hSession, pMechanism, hKey) } pub unsafe fn C_Verify( &self, - session: CK_SESSION_HANDLE, - data: *mut ::std::os::raw::c_uchar, - data_len: ::std::os::raw::c_ulong, - signature: *mut ::std::os::raw::c_uchar, - signature_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + ulSignatureLen: CK_ULONG, ) -> CK_RV { (self .C_Verify .as_ref() .expect("Expected function, got error."))( - session, - data, - data_len, - signature, - signature_len, + hSession, + pData, + ulDataLen, + pSignature, + ulSignatureLen, ) } pub unsafe fn C_VerifyUpdate( &self, - session: CK_SESSION_HANDLE, - part: *mut ::std::os::raw::c_uchar, - part_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pPart: CK_BYTE_PTR, + ulPartLen: CK_ULONG, ) -> CK_RV { (self .C_VerifyUpdate .as_ref() - .expect("Expected function, got error."))(session, part, part_len) + .expect("Expected function, got error."))(hSession, pPart, ulPartLen) } pub unsafe fn C_VerifyFinal( &self, - session: CK_SESSION_HANDLE, - signature: *mut ::std::os::raw::c_uchar, - signature_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pSignature: CK_BYTE_PTR, + ulSignatureLen: CK_ULONG, ) -> CK_RV { (self .C_VerifyFinal .as_ref() - .expect("Expected function, got error."))(session, signature, signature_len) + .expect("Expected function, got error."))(hSession, pSignature, ulSignatureLen) } pub unsafe fn C_VerifyRecoverInit( &self, - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - key: CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, ) -> CK_RV { (self .C_VerifyRecoverInit .as_ref() - .expect("Expected function, got error."))(session, mechanism, key) + .expect("Expected function, got error."))(hSession, pMechanism, hKey) } pub unsafe fn C_VerifyRecover( &self, - session: CK_SESSION_HANDLE, - signature: *mut ::std::os::raw::c_uchar, - signature_len: ::std::os::raw::c_ulong, - data: *mut ::std::os::raw::c_uchar, - data_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pSignature: CK_BYTE_PTR, + ulSignatureLen: CK_ULONG, + pData: CK_BYTE_PTR, + pulDataLen: CK_ULONG_PTR, ) -> CK_RV { (self .C_VerifyRecover .as_ref() .expect("Expected function, got error."))( - session, - signature, - signature_len, - data, - data_len, + hSession, + pSignature, + ulSignatureLen, + pData, + pulDataLen, ) } pub unsafe fn C_DigestEncryptUpdate( &self, - session: CK_SESSION_HANDLE, - part: *mut ::std::os::raw::c_uchar, - part_len: ::std::os::raw::c_ulong, - encrypted_part: *mut ::std::os::raw::c_uchar, - encrypted_part_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pPart: CK_BYTE_PTR, + ulPartLen: CK_ULONG, + pEncryptedPart: CK_BYTE_PTR, + pulEncryptedPartLen: CK_ULONG_PTR, ) -> CK_RV { (self .C_DigestEncryptUpdate .as_ref() .expect("Expected function, got error."))( - session, - part, - part_len, - encrypted_part, - encrypted_part_len, + hSession, + pPart, + ulPartLen, + pEncryptedPart, + pulEncryptedPartLen, ) } pub unsafe fn C_DecryptDigestUpdate( &self, - session: CK_SESSION_HANDLE, - encrypted_part: *mut ::std::os::raw::c_uchar, - encrypted_part_len: ::std::os::raw::c_ulong, - part: *mut ::std::os::raw::c_uchar, - part_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pEncryptedPart: CK_BYTE_PTR, + ulEncryptedPartLen: CK_ULONG, + pPart: CK_BYTE_PTR, + pulPartLen: CK_ULONG_PTR, ) -> CK_RV { (self .C_DecryptDigestUpdate .as_ref() .expect("Expected function, got error."))( - session, - encrypted_part, - encrypted_part_len, - part, - part_len, + hSession, + pEncryptedPart, + ulEncryptedPartLen, + pPart, + pulPartLen, ) } pub unsafe fn C_SignEncryptUpdate( &self, - session: CK_SESSION_HANDLE, - part: *mut ::std::os::raw::c_uchar, - part_len: ::std::os::raw::c_ulong, - encrypted_part: *mut ::std::os::raw::c_uchar, - encrypted_part_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pPart: CK_BYTE_PTR, + ulPartLen: CK_ULONG, + pEncryptedPart: CK_BYTE_PTR, + pulEncryptedPartLen: CK_ULONG_PTR, ) -> CK_RV { (self .C_SignEncryptUpdate .as_ref() .expect("Expected function, got error."))( - session, - part, - part_len, - encrypted_part, - encrypted_part_len, + hSession, + pPart, + ulPartLen, + pEncryptedPart, + pulEncryptedPartLen, ) } pub unsafe fn C_DecryptVerifyUpdate( &self, - session: CK_SESSION_HANDLE, - encrypted_part: *mut ::std::os::raw::c_uchar, - encrypted_part_len: ::std::os::raw::c_ulong, - part: *mut ::std::os::raw::c_uchar, - part_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pEncryptedPart: CK_BYTE_PTR, + ulEncryptedPartLen: CK_ULONG, + pPart: CK_BYTE_PTR, + pulPartLen: CK_ULONG_PTR, ) -> CK_RV { (self .C_DecryptVerifyUpdate .as_ref() .expect("Expected function, got error."))( - session, - encrypted_part, - encrypted_part_len, - part, - part_len, + hSession, + pEncryptedPart, + ulEncryptedPartLen, + pPart, + pulPartLen, ) } pub unsafe fn C_GenerateKey( &self, - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - templ: *mut _CK_ATTRIBUTE, - ulCount: ::std::os::raw::c_ulong, - key: *mut CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + pTemplate: CK_ATTRIBUTE_PTR, + ulCount: CK_ULONG, + phKey: CK_OBJECT_HANDLE_PTR, ) -> CK_RV { (self .C_GenerateKey .as_ref() .expect("Expected function, got error."))( - session, mechanism, templ, ulCount, key + hSession, pMechanism, pTemplate, ulCount, phKey, ) } pub unsafe fn C_GenerateKeyPair( &self, - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - public_key_template: *mut _CK_ATTRIBUTE, - public_key_attribute_count: ::std::os::raw::c_ulong, - private_key_template: *mut _CK_ATTRIBUTE, - private_key_attribute_count: ::std::os::raw::c_ulong, - public_key: *mut CK_OBJECT_HANDLE, - private_key: *mut CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + pPublicKeyTemplate: CK_ATTRIBUTE_PTR, + ulPublicKeyAttributeCount: CK_ULONG, + pPrivateKeyTemplate: CK_ATTRIBUTE_PTR, + ulPrivateKeyAttributeCount: CK_ULONG, + phPublicKey: CK_OBJECT_HANDLE_PTR, + phPrivateKey: CK_OBJECT_HANDLE_PTR, ) -> CK_RV { (self .C_GenerateKeyPair .as_ref() .expect("Expected function, got error."))( - session, - mechanism, - public_key_template, - public_key_attribute_count, - private_key_template, - private_key_attribute_count, - public_key, - private_key, + hSession, + pMechanism, + pPublicKeyTemplate, + ulPublicKeyAttributeCount, + pPrivateKeyTemplate, + ulPrivateKeyAttributeCount, + phPublicKey, + phPrivateKey, ) } pub unsafe fn C_WrapKey( &self, - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - wrapping_key: CK_OBJECT_HANDLE, - key: CK_OBJECT_HANDLE, - wrapped_key: *mut ::std::os::raw::c_uchar, - wrapped_key_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hWrappingKey: CK_OBJECT_HANDLE, + hKey: CK_OBJECT_HANDLE, + pWrappedKey: CK_BYTE_PTR, + pulWrappedKeyLen: CK_ULONG_PTR, ) -> CK_RV { (self .C_WrapKey .as_ref() .expect("Expected function, got error."))( - session, - mechanism, - wrapping_key, - key, - wrapped_key, - wrapped_key_len, + hSession, + pMechanism, + hWrappingKey, + hKey, + pWrappedKey, + pulWrappedKeyLen, ) } pub unsafe fn C_UnwrapKey( &self, - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - unwrapping_key: CK_OBJECT_HANDLE, - wrapped_key: *mut ::std::os::raw::c_uchar, - wrapped_key_len: ::std::os::raw::c_ulong, - templ: *mut _CK_ATTRIBUTE, - attribute_count: ::std::os::raw::c_ulong, - key: *mut CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hUnwrappingKey: CK_OBJECT_HANDLE, + pWrappedKey: CK_BYTE_PTR, + ulWrappedKeyLen: CK_ULONG, + pTemplate: CK_ATTRIBUTE_PTR, + ulAttributeCount: CK_ULONG, + phKey: CK_OBJECT_HANDLE_PTR, ) -> CK_RV { (self .C_UnwrapKey .as_ref() .expect("Expected function, got error."))( - session, - mechanism, - unwrapping_key, - wrapped_key, - wrapped_key_len, - templ, - attribute_count, - key, + hSession, + pMechanism, + hUnwrappingKey, + pWrappedKey, + ulWrappedKeyLen, + pTemplate, + ulAttributeCount, + phKey, ) } pub unsafe fn C_DeriveKey( &self, - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - base_key: CK_OBJECT_HANDLE, - templ: *mut _CK_ATTRIBUTE, - attribute_count: ::std::os::raw::c_ulong, - key: *mut CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hBaseKey: CK_OBJECT_HANDLE, + pTemplate: CK_ATTRIBUTE_PTR, + ulAttributeCount: CK_ULONG, + phKey: CK_OBJECT_HANDLE_PTR, ) -> CK_RV { (self .C_DeriveKey .as_ref() .expect("Expected function, got error."))( - session, - mechanism, - base_key, - templ, - attribute_count, - key, + hSession, + pMechanism, + hBaseKey, + pTemplate, + ulAttributeCount, + phKey, ) } pub unsafe fn C_SeedRandom( &self, - session: CK_SESSION_HANDLE, - seed: *mut ::std::os::raw::c_uchar, - seed_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pSeed: CK_BYTE_PTR, + ulSeedLen: CK_ULONG, ) -> CK_RV { (self .C_SeedRandom .as_ref() - .expect("Expected function, got error."))(session, seed, seed_len) + .expect("Expected function, got error."))(hSession, pSeed, ulSeedLen) } pub unsafe fn C_GenerateRandom( &self, - session: CK_SESSION_HANDLE, - random_data: *mut ::std::os::raw::c_uchar, - random_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + RandomData: CK_BYTE_PTR, + ulRandomLen: CK_ULONG, ) -> CK_RV { (self .C_GenerateRandom .as_ref() - .expect("Expected function, got error."))(session, random_data, random_len) + .expect("Expected function, got error."))(hSession, RandomData, ulRandomLen) } - pub unsafe fn C_GetFunctionStatus(&self, session: CK_SESSION_HANDLE) -> CK_RV { + pub unsafe fn C_GetFunctionStatus(&self, hSession: CK_SESSION_HANDLE) -> CK_RV { (self .C_GetFunctionStatus .as_ref() - .expect("Expected function, got error."))(session) + .expect("Expected function, got error."))(hSession) } - pub unsafe fn C_CancelFunction(&self, session: CK_SESSION_HANDLE) -> CK_RV { + pub unsafe fn C_CancelFunction(&self, hSession: CK_SESSION_HANDLE) -> CK_RV { (self .C_CancelFunction .as_ref() - .expect("Expected function, got error."))(session) + .expect("Expected function, got error."))(hSession) + } + pub unsafe fn C_WaitForSlotEvent( + &self, + flags: CK_FLAGS, + pSlot: CK_SLOT_ID_PTR, + pRserved: CK_VOID_PTR, + ) -> CK_RV { + (self + .C_WaitForSlotEvent + .as_ref() + .expect("Expected function, got error."))(flags, pSlot, pRserved) + } + pub unsafe fn C_GetInterfaceList( + &self, + pInterfacesList: CK_INTERFACE_PTR, + pulCount: CK_ULONG_PTR, + ) -> CK_RV { + (self + .C_GetInterfaceList + .as_ref() + .expect("Expected function, got error."))(pInterfacesList, pulCount) + } + pub unsafe fn C_GetInterface( + &self, + pInterfaceName: CK_UTF8CHAR_PTR, + pVersion: CK_VERSION_PTR, + ppInterface: CK_INTERFACE_PTR_PTR, + flags: CK_FLAGS, + ) -> CK_RV { + (self + .C_GetInterface + .as_ref() + .expect("Expected function, got error."))( + pInterfaceName, pVersion, ppInterface, flags + ) + } + pub unsafe fn C_LoginUser( + &self, + hSession: CK_SESSION_HANDLE, + userType: CK_USER_TYPE, + pPin: CK_UTF8CHAR_PTR, + ulPinLen: CK_ULONG, + pUsername: CK_UTF8CHAR_PTR, + ulUsernameLen: CK_ULONG, + ) -> CK_RV { + (self + .C_LoginUser + .as_ref() + .expect("Expected function, got error."))( + hSession, + userType, + pPin, + ulPinLen, + pUsername, + ulUsernameLen, + ) + } + pub unsafe fn C_SessionCancel(&self, hSession: CK_SESSION_HANDLE, flags: CK_FLAGS) -> CK_RV { + (self + .C_SessionCancel + .as_ref() + .expect("Expected function, got error."))(hSession, flags) + } + pub unsafe fn C_MessageEncryptInit( + &self, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, + ) -> CK_RV { + (self + .C_MessageEncryptInit + .as_ref() + .expect("Expected function, got error."))(hSession, pMechanism, hKey) + } + pub unsafe fn C_EncryptMessage( + &self, + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pAssociatedData: CK_BYTE_PTR, + ulAssociatedDataLen: CK_ULONG, + pPlaintext: CK_BYTE_PTR, + ulPlaintextLen: CK_ULONG, + pCiphertext: CK_BYTE_PTR, + pulCiphertextLen: CK_ULONG_PTR, + ) -> CK_RV { + (self + .C_EncryptMessage + .as_ref() + .expect("Expected function, got error."))( + hSession, + pParameter, + ulParameterLen, + pAssociatedData, + ulAssociatedDataLen, + pPlaintext, + ulPlaintextLen, + pCiphertext, + pulCiphertextLen, + ) + } + pub unsafe fn C_EncryptMessageBegin( + &self, + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pAssociatedData: CK_BYTE_PTR, + ulAssociatedDataLen: CK_ULONG, + ) -> CK_RV { + (self + .C_EncryptMessageBegin + .as_ref() + .expect("Expected function, got error."))( + hSession, + pParameter, + ulParameterLen, + pAssociatedData, + ulAssociatedDataLen, + ) + } + pub unsafe fn C_EncryptMessageNext( + &self, + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pPlaintextPart: CK_BYTE_PTR, + ulPlaintextPartLen: CK_ULONG, + pCiphertextPart: CK_BYTE_PTR, + pulCiphertextPartLen: CK_ULONG_PTR, + flags: CK_FLAGS, + ) -> CK_RV { + (self + .C_EncryptMessageNext + .as_ref() + .expect("Expected function, got error."))( + hSession, + pParameter, + ulParameterLen, + pPlaintextPart, + ulPlaintextPartLen, + pCiphertextPart, + pulCiphertextPartLen, + flags, + ) + } + pub unsafe fn C_MessageEncryptFinal(&self, hSession: CK_SESSION_HANDLE) -> CK_RV { + (self + .C_MessageEncryptFinal + .as_ref() + .expect("Expected function, got error."))(hSession) + } + pub unsafe fn C_MessageDecryptInit( + &self, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, + ) -> CK_RV { + (self + .C_MessageDecryptInit + .as_ref() + .expect("Expected function, got error."))(hSession, pMechanism, hKey) + } + pub unsafe fn C_DecryptMessage( + &self, + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pAssociatedData: CK_BYTE_PTR, + ulAssociatedDataLen: CK_ULONG, + pCiphertext: CK_BYTE_PTR, + ulCiphertextLen: CK_ULONG, + pPlaintext: CK_BYTE_PTR, + pulPlaintextLen: CK_ULONG_PTR, + ) -> CK_RV { + (self + .C_DecryptMessage + .as_ref() + .expect("Expected function, got error."))( + hSession, + pParameter, + ulParameterLen, + pAssociatedData, + ulAssociatedDataLen, + pCiphertext, + ulCiphertextLen, + pPlaintext, + pulPlaintextLen, + ) + } + pub unsafe fn C_DecryptMessageBegin( + &self, + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pAssociatedData: CK_BYTE_PTR, + ulAssociatedDataLen: CK_ULONG, + ) -> CK_RV { + (self + .C_DecryptMessageBegin + .as_ref() + .expect("Expected function, got error."))( + hSession, + pParameter, + ulParameterLen, + pAssociatedData, + ulAssociatedDataLen, + ) + } + pub unsafe fn C_DecryptMessageNext( + &self, + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pCiphertext: CK_BYTE_PTR, + ulCiphertextLen: CK_ULONG, + pPlaintext: CK_BYTE_PTR, + pulPlaintextLen: CK_ULONG_PTR, + flags: CK_FLAGS, + ) -> CK_RV { + (self + .C_DecryptMessageNext + .as_ref() + .expect("Expected function, got error."))( + hSession, + pParameter, + ulParameterLen, + pCiphertext, + ulCiphertextLen, + pPlaintext, + pulPlaintextLen, + flags, + ) + } + pub unsafe fn C_MessageDecryptFinal(&self, hSession: CK_SESSION_HANDLE) -> CK_RV { + (self + .C_MessageDecryptFinal + .as_ref() + .expect("Expected function, got error."))(hSession) + } + pub unsafe fn C_MessageSignInit( + &self, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, + ) -> CK_RV { + (self + .C_MessageSignInit + .as_ref() + .expect("Expected function, got error."))(hSession, pMechanism, hKey) + } + pub unsafe fn C_SignMessage( + &self, + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + pulSignatureLen: CK_ULONG_PTR, + ) -> CK_RV { + (self + .C_SignMessage + .as_ref() + .expect("Expected function, got error."))( + hSession, + pParameter, + ulParameterLen, + pData, + ulDataLen, + pSignature, + pulSignatureLen, + ) + } + pub unsafe fn C_SignMessageBegin( + &self, + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + ) -> CK_RV { + (self + .C_SignMessageBegin + .as_ref() + .expect("Expected function, got error."))(hSession, pParameter, ulParameterLen) + } + pub unsafe fn C_SignMessageNext( + &self, + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + pulSignatureLen: CK_ULONG_PTR, + ) -> CK_RV { + (self + .C_SignMessageNext + .as_ref() + .expect("Expected function, got error."))( + hSession, + pParameter, + ulParameterLen, + pData, + ulDataLen, + pSignature, + pulSignatureLen, + ) + } + pub unsafe fn C_MessageSignFinal(&self, hSession: CK_SESSION_HANDLE) -> CK_RV { + (self + .C_MessageSignFinal + .as_ref() + .expect("Expected function, got error."))(hSession) + } + pub unsafe fn C_MessageVerifyInit( + &self, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, + ) -> CK_RV { + (self + .C_MessageVerifyInit + .as_ref() + .expect("Expected function, got error."))(hSession, pMechanism, hKey) + } + pub unsafe fn C_VerifyMessage( + &self, + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + ulSignatureLen: CK_ULONG, + ) -> CK_RV { + (self + .C_VerifyMessage + .as_ref() + .expect("Expected function, got error."))( + hSession, + pParameter, + ulParameterLen, + pData, + ulDataLen, + pSignature, + ulSignatureLen, + ) + } + pub unsafe fn C_VerifyMessageBegin( + &self, + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + ) -> CK_RV { + (self + .C_VerifyMessageBegin + .as_ref() + .expect("Expected function, got error."))(hSession, pParameter, ulParameterLen) + } + pub unsafe fn C_VerifyMessageNext( + &self, + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + ulSignatureLen: CK_ULONG, + ) -> CK_RV { + (self + .C_VerifyMessageNext + .as_ref() + .expect("Expected function, got error."))( + hSession, + pParameter, + ulParameterLen, + pData, + ulDataLen, + pSignature, + ulSignatureLen, + ) + } + pub unsafe fn C_MessageVerifyFinal(&self, hSession: CK_SESSION_HANDLE) -> CK_RV { + (self + .C_MessageVerifyFinal + .as_ref() + .expect("Expected function, got error."))(hSession) } } diff --git a/cryptoki-sys/src/bindings/arm-unknown-linux-gnueabi.rs b/cryptoki-sys/src/bindings/arm-unknown-linux-gnueabi.rs index df429e9c..df6e4948 100644 --- a/cryptoki-sys/src/bindings/arm-unknown-linux-gnueabi.rs +++ b/cryptoki-sys/src/bindings/arm-unknown-linux-gnueabi.rs @@ -1,10 +1,22 @@ /* automatically generated by rust-bindgen 0.63.0 */ -pub const PKCS11_H: u32 = 1; -pub const CRYPTOKI_VERSION_MAJOR: CK_BYTE = 2; -pub const CRYPTOKI_VERSION_MINOR: CK_BYTE = 40; -pub const P11_KIT_CRYPTOKI_VERSION_REVISION: u32 = 0; -pub const CRYPTOKI_COMPAT: u32 = 1; +pub const NULL_PTR: u32 = 0; +pub const _PKCS11_H_: u32 = 1; +pub const _PKCS11T_H_: u32 = 1; +pub const CRYPTOKI_VERSION_MAJOR: CK_BYTE = 3; +pub const CRYPTOKI_VERSION_MINOR: CK_BYTE = 0; +pub const CRYPTOKI_VERSION_AMENDMENT: CK_BYTE = 0; +pub const CK_TRUE: CK_BBOOL = 1; +pub const CK_FALSE: CK_BBOOL = 0; +pub const FALSE: u32 = 0; +pub const TRUE: u32 = 1; +pub const CK_EFFECTIVELY_INFINITE: CK_ULONG = 0; +pub const CK_INVALID_HANDLE: CK_ULONG = 0; +pub const CKN_SURRENDER: CK_NOTIFICATION = 0; +pub const CKN_OTP_CHANGED: CK_NOTIFICATION = 1; +pub const CKF_TOKEN_PRESENT: CK_FLAGS = 1; +pub const CKF_REMOVABLE_DEVICE: CK_FLAGS = 2; +pub const CKF_HW_SLOT: CK_FLAGS = 4; pub const CKF_RNG: CK_FLAGS = 1; pub const CKF_WRITE_PROTECTED: CK_FLAGS = 2; pub const CKF_LOGIN_REQUIRED: CK_FLAGS = 4; @@ -24,8 +36,6 @@ pub const CKF_SO_PIN_FINAL_TRY: CK_FLAGS = 2097152; pub const CKF_SO_PIN_LOCKED: CK_FLAGS = 4194304; pub const CKF_SO_PIN_TO_BE_CHANGED: CK_FLAGS = 8388608; pub const CKF_ERROR_STATE: CK_FLAGS = 16777216; -pub const CK_EFFECTIVELY_INFINITE: CK_ULONG = 0; -pub const CK_INVALID_HANDLE: CK_ULONG = 0; pub const CKU_SO: CK_USER_TYPE = 0; pub const CKU_USER: CK_USER_TYPE = 1; pub const CKU_CONTEXT_SPECIFIC: CK_USER_TYPE = 2; @@ -45,9 +55,18 @@ pub const CKO_HW_FEATURE: CK_OBJECT_CLASS = 5; pub const CKO_DOMAIN_PARAMETERS: CK_OBJECT_CLASS = 6; pub const CKO_MECHANISM: CK_OBJECT_CLASS = 7; pub const CKO_OTP_KEY: CK_OBJECT_CLASS = 8; +pub const CKO_PROFILE: CK_OBJECT_CLASS = 9; +pub const CKO_VENDOR_DEFINED: CK_OBJECT_CLASS = 2147483648; +pub const CKP_INVALID_ID: CK_PROFILE_ID = 0; +pub const CKP_BASELINE_PROVIDER: CK_PROFILE_ID = 1; +pub const CKP_EXTENDED_PROVIDER: CK_PROFILE_ID = 2; +pub const CKP_AUTHENTICATION_TOKEN: CK_PROFILE_ID = 3; +pub const CKP_PUBLIC_CERTIFICATES_TOKEN: CK_PROFILE_ID = 4; +pub const CKP_VENDOR_DEFINED: CK_PROFILE_ID = 2147483648; pub const CKH_MONOTONIC_COUNTER: CK_HW_FEATURE_TYPE = 1; pub const CKH_CLOCK: CK_HW_FEATURE_TYPE = 2; pub const CKH_USER_INTERFACE: CK_HW_FEATURE_TYPE = 3; +pub const CKH_VENDOR_DEFINED: CK_HW_FEATURE_TYPE = 2147483648; pub const CKK_RSA: CK_KEY_TYPE = 0; pub const CKK_DSA: CK_KEY_TYPE = 1; pub const CKK_DH: CK_KEY_TYPE = 2; @@ -63,6 +82,7 @@ pub const CKK_DES2: CK_KEY_TYPE = 20; pub const CKK_DES3: CK_KEY_TYPE = 21; pub const CKK_CAST: CK_KEY_TYPE = 22; pub const CKK_CAST3: CK_KEY_TYPE = 23; +pub const CKK_CAST5: CK_KEY_TYPE = 24; pub const CKK_CAST128: CK_KEY_TYPE = 24; pub const CKK_RC5: CK_KEY_TYPE = 25; pub const CKK_IDEA: CK_KEY_TYPE = 26; @@ -90,14 +110,48 @@ pub const CKK_SEED: CK_KEY_TYPE = 47; pub const CKK_GOSTR3410: CK_KEY_TYPE = 48; pub const CKK_GOSTR3411: CK_KEY_TYPE = 49; pub const CKK_GOST28147: CK_KEY_TYPE = 50; +pub const CKK_CHACHA20: CK_KEY_TYPE = 51; +pub const CKK_POLY1305: CK_KEY_TYPE = 52; +pub const CKK_AES_XTS: CK_KEY_TYPE = 53; +pub const CKK_SHA3_224_HMAC: CK_KEY_TYPE = 54; +pub const CKK_SHA3_256_HMAC: CK_KEY_TYPE = 55; +pub const CKK_SHA3_384_HMAC: CK_KEY_TYPE = 56; +pub const CKK_SHA3_512_HMAC: CK_KEY_TYPE = 57; +pub const CKK_BLAKE2B_160_HMAC: CK_KEY_TYPE = 58; +pub const CKK_BLAKE2B_256_HMAC: CK_KEY_TYPE = 59; +pub const CKK_BLAKE2B_384_HMAC: CK_KEY_TYPE = 60; +pub const CKK_BLAKE2B_512_HMAC: CK_KEY_TYPE = 61; +pub const CKK_SALSA20: CK_KEY_TYPE = 62; +pub const CKK_X2RATCHET: CK_KEY_TYPE = 63; pub const CKK_EC_EDWARDS: CK_KEY_TYPE = 64; +pub const CKK_EC_MONTGOMERY: CK_KEY_TYPE = 65; +pub const CKK_HKDF: CK_KEY_TYPE = 66; +pub const CKK_VENDOR_DEFINED: CK_KEY_TYPE = 2147483648; +pub const CK_CERTIFICATE_CATEGORY_UNSPECIFIED: CK_ULONG = 0; +pub const CK_CERTIFICATE_CATEGORY_TOKEN_USER: CK_ULONG = 1; +pub const CK_CERTIFICATE_CATEGORY_AUTHORITY: CK_ULONG = 2; +pub const CK_CERTIFICATE_CATEGORY_OTHER_ENTITY: CK_ULONG = 3; +pub const CK_SECURITY_DOMAIN_UNSPECIFIED: CK_ULONG = 0; +pub const CK_SECURITY_DOMAIN_MANUFACTURER: CK_ULONG = 1; +pub const CK_SECURITY_DOMAIN_OPERATOR: CK_ULONG = 2; +pub const CK_SECURITY_DOMAIN_THIRD_PARTY: CK_ULONG = 3; pub const CKC_X_509: CK_CERTIFICATE_TYPE = 0; pub const CKC_X_509_ATTR_CERT: CK_CERTIFICATE_TYPE = 1; pub const CKC_WTLS: CK_CERTIFICATE_TYPE = 2; +pub const CKC_VENDOR_DEFINED: CK_CERTIFICATE_TYPE = 2147483648; +pub const CKF_ARRAY_ATTRIBUTE: CK_FLAGS = 1073741824; +pub const CK_OTP_FORMAT_DECIMAL: CK_ULONG = 0; +pub const CK_OTP_FORMAT_HEXADECIMAL: CK_ULONG = 1; +pub const CK_OTP_FORMAT_ALPHANUMERIC: CK_ULONG = 2; +pub const CK_OTP_FORMAT_BINARY: CK_ULONG = 3; +pub const CK_OTP_PARAM_IGNORED: CK_ULONG = 0; +pub const CK_OTP_PARAM_OPTIONAL: CK_ULONG = 1; +pub const CK_OTP_PARAM_MANDATORY: CK_ULONG = 2; pub const CKA_CLASS: CK_ATTRIBUTE_TYPE = 0; pub const CKA_TOKEN: CK_ATTRIBUTE_TYPE = 1; pub const CKA_PRIVATE: CK_ATTRIBUTE_TYPE = 2; pub const CKA_LABEL: CK_ATTRIBUTE_TYPE = 3; +pub const CKA_UNIQUE_ID: CK_ATTRIBUTE_TYPE = 4; pub const CKA_APPLICATION: CK_ATTRIBUTE_TYPE = 16; pub const CKA_VALUE: CK_ATTRIBUTE_TYPE = 17; pub const CKA_OBJECT_ID: CK_ATTRIBUTE_TYPE = 18; @@ -144,6 +198,7 @@ pub const CKA_PRIME: CK_ATTRIBUTE_TYPE = 304; pub const CKA_SUBPRIME: CK_ATTRIBUTE_TYPE = 305; pub const CKA_BASE: CK_ATTRIBUTE_TYPE = 306; pub const CKA_PRIME_BITS: CK_ATTRIBUTE_TYPE = 307; +pub const CKA_SUBPRIME_BITS: CK_ATTRIBUTE_TYPE = 308; pub const CKA_SUB_PRIME_BITS: CK_ATTRIBUTE_TYPE = 308; pub const CKA_VALUE_BITS: CK_ATTRIBUTE_TYPE = 352; pub const CKA_VALUE_LEN: CK_ATTRIBUTE_TYPE = 353; @@ -162,6 +217,9 @@ pub const CKA_SECONDARY_AUTH: CK_ATTRIBUTE_TYPE = 512; pub const CKA_AUTH_PIN_FLAGS: CK_ATTRIBUTE_TYPE = 513; pub const CKA_ALWAYS_AUTHENTICATE: CK_ATTRIBUTE_TYPE = 514; pub const CKA_WRAP_WITH_TRUSTED: CK_ATTRIBUTE_TYPE = 528; +pub const CKA_WRAP_TEMPLATE: CK_ATTRIBUTE_TYPE = 1073742353; +pub const CKA_UNWRAP_TEMPLATE: CK_ATTRIBUTE_TYPE = 1073742354; +pub const CKA_DERIVE_TEMPLATE: CK_ATTRIBUTE_TYPE = 1073742355; pub const CKA_OTP_FORMAT: CK_ATTRIBUTE_TYPE = 544; pub const CKA_OTP_LENGTH: CK_ATTRIBUTE_TYPE = 545; pub const CKA_OTP_TIME_INTERVAL: CK_ATTRIBUTE_TYPE = 546; @@ -170,12 +228,12 @@ pub const CKA_OTP_CHALLENGE_REQUIREMENT: CK_ATTRIBUTE_TYPE = 548; pub const CKA_OTP_TIME_REQUIREMENT: CK_ATTRIBUTE_TYPE = 549; pub const CKA_OTP_COUNTER_REQUIREMENT: CK_ATTRIBUTE_TYPE = 550; pub const CKA_OTP_PIN_REQUIREMENT: CK_ATTRIBUTE_TYPE = 551; +pub const CKA_OTP_COUNTER: CK_ATTRIBUTE_TYPE = 558; +pub const CKA_OTP_TIME: CK_ATTRIBUTE_TYPE = 559; pub const CKA_OTP_USER_IDENTIFIER: CK_ATTRIBUTE_TYPE = 554; pub const CKA_OTP_SERVICE_IDENTIFIER: CK_ATTRIBUTE_TYPE = 555; pub const CKA_OTP_SERVICE_LOGO: CK_ATTRIBUTE_TYPE = 556; pub const CKA_OTP_SERVICE_LOGO_TYPE: CK_ATTRIBUTE_TYPE = 557; -pub const CKA_OTP_COUNTER: CK_ATTRIBUTE_TYPE = 558; -pub const CKA_OTP_TIME: CK_ATTRIBUTE_TYPE = 559; pub const CKA_GOSTR3410_PARAMS: CK_ATTRIBUTE_TYPE = 592; pub const CKA_GOSTR3411_PARAMS: CK_ATTRIBUTE_TYPE = 593; pub const CKA_GOST28147_PARAMS: CK_ATTRIBUTE_TYPE = 594; @@ -196,6 +254,9 @@ pub const CKA_MECHANISM_TYPE: CK_ATTRIBUTE_TYPE = 1280; pub const CKA_REQUIRED_CMS_ATTRIBUTES: CK_ATTRIBUTE_TYPE = 1281; pub const CKA_DEFAULT_CMS_ATTRIBUTES: CK_ATTRIBUTE_TYPE = 1282; pub const CKA_SUPPORTED_CMS_ATTRIBUTES: CK_ATTRIBUTE_TYPE = 1283; +pub const CKA_ALLOWED_MECHANISMS: CK_ATTRIBUTE_TYPE = 1073743360; +pub const CKA_PROFILE_ID: CK_ATTRIBUTE_TYPE = 1537; +pub const CKA_VENDOR_DEFINED: CK_ATTRIBUTE_TYPE = 2147483648; pub const CKM_RSA_PKCS_KEY_PAIR_GEN: CK_MECHANISM_TYPE = 0; pub const CKM_RSA_PKCS: CK_MECHANISM_TYPE = 1; pub const CKM_RSA_9796: CK_MECHANISM_TYPE = 2; @@ -218,6 +279,10 @@ pub const CKM_DSA_SHA224: CK_MECHANISM_TYPE = 19; pub const CKM_DSA_SHA256: CK_MECHANISM_TYPE = 20; pub const CKM_DSA_SHA384: CK_MECHANISM_TYPE = 21; pub const CKM_DSA_SHA512: CK_MECHANISM_TYPE = 22; +pub const CKM_DSA_SHA3_224: CK_MECHANISM_TYPE = 24; +pub const CKM_DSA_SHA3_256: CK_MECHANISM_TYPE = 25; +pub const CKM_DSA_SHA3_384: CK_MECHANISM_TYPE = 26; +pub const CKM_DSA_SHA3_512: CK_MECHANISM_TYPE = 27; pub const CKM_DH_PKCS_KEY_PAIR_GEN: CK_MECHANISM_TYPE = 32; pub const CKM_DH_PKCS_DERIVE: CK_MECHANISM_TYPE = 33; pub const CKM_X9_42_DH_KEY_PAIR_GEN: CK_MECHANISM_TYPE = 48; @@ -230,6 +295,8 @@ pub const CKM_SHA512_RSA_PKCS: CK_MECHANISM_TYPE = 66; pub const CKM_SHA256_RSA_PKCS_PSS: CK_MECHANISM_TYPE = 67; pub const CKM_SHA384_RSA_PKCS_PSS: CK_MECHANISM_TYPE = 68; pub const CKM_SHA512_RSA_PKCS_PSS: CK_MECHANISM_TYPE = 69; +pub const CKM_SHA224_RSA_PKCS: CK_MECHANISM_TYPE = 70; +pub const CKM_SHA224_RSA_PKCS_PSS: CK_MECHANISM_TYPE = 71; pub const CKM_SHA512_224: CK_MECHANISM_TYPE = 72; pub const CKM_SHA512_224_HMAC: CK_MECHANISM_TYPE = 73; pub const CKM_SHA512_224_HMAC_GENERAL: CK_MECHANISM_TYPE = 74; @@ -242,6 +309,14 @@ pub const CKM_SHA512_T: CK_MECHANISM_TYPE = 80; pub const CKM_SHA512_T_HMAC: CK_MECHANISM_TYPE = 81; pub const CKM_SHA512_T_HMAC_GENERAL: CK_MECHANISM_TYPE = 82; pub const CKM_SHA512_T_KEY_DERIVATION: CK_MECHANISM_TYPE = 83; +pub const CKM_SHA3_256_RSA_PKCS: CK_MECHANISM_TYPE = 96; +pub const CKM_SHA3_384_RSA_PKCS: CK_MECHANISM_TYPE = 97; +pub const CKM_SHA3_512_RSA_PKCS: CK_MECHANISM_TYPE = 98; +pub const CKM_SHA3_256_RSA_PKCS_PSS: CK_MECHANISM_TYPE = 99; +pub const CKM_SHA3_384_RSA_PKCS_PSS: CK_MECHANISM_TYPE = 100; +pub const CKM_SHA3_512_RSA_PKCS_PSS: CK_MECHANISM_TYPE = 101; +pub const CKM_SHA3_224_RSA_PKCS: CK_MECHANISM_TYPE = 102; +pub const CKM_SHA3_224_RSA_PKCS_PSS: CK_MECHANISM_TYPE = 103; pub const CKM_RC2_KEY_GEN: CK_MECHANISM_TYPE = 256; pub const CKM_RC2_ECB: CK_MECHANISM_TYPE = 257; pub const CKM_RC2_CBC: CK_MECHANISM_TYPE = 258; @@ -293,6 +368,9 @@ pub const CKM_RIPEMD160_HMAC_GENERAL: CK_MECHANISM_TYPE = 578; pub const CKM_SHA256: CK_MECHANISM_TYPE = 592; pub const CKM_SHA256_HMAC: CK_MECHANISM_TYPE = 593; pub const CKM_SHA256_HMAC_GENERAL: CK_MECHANISM_TYPE = 594; +pub const CKM_SHA224: CK_MECHANISM_TYPE = 597; +pub const CKM_SHA224_HMAC: CK_MECHANISM_TYPE = 598; +pub const CKM_SHA224_HMAC_GENERAL: CK_MECHANISM_TYPE = 599; pub const CKM_SHA384: CK_MECHANISM_TYPE = 608; pub const CKM_SHA384_HMAC: CK_MECHANISM_TYPE = 609; pub const CKM_SHA384_HMAC_GENERAL: CK_MECHANISM_TYPE = 610; @@ -305,6 +383,22 @@ pub const CKM_HOTP_KEY_GEN: CK_MECHANISM_TYPE = 656; pub const CKM_HOTP: CK_MECHANISM_TYPE = 657; pub const CKM_ACTI: CK_MECHANISM_TYPE = 672; pub const CKM_ACTI_KEY_GEN: CK_MECHANISM_TYPE = 673; +pub const CKM_SHA3_256: CK_MECHANISM_TYPE = 688; +pub const CKM_SHA3_256_HMAC: CK_MECHANISM_TYPE = 689; +pub const CKM_SHA3_256_HMAC_GENERAL: CK_MECHANISM_TYPE = 690; +pub const CKM_SHA3_256_KEY_GEN: CK_MECHANISM_TYPE = 691; +pub const CKM_SHA3_224: CK_MECHANISM_TYPE = 693; +pub const CKM_SHA3_224_HMAC: CK_MECHANISM_TYPE = 694; +pub const CKM_SHA3_224_HMAC_GENERAL: CK_MECHANISM_TYPE = 695; +pub const CKM_SHA3_224_KEY_GEN: CK_MECHANISM_TYPE = 696; +pub const CKM_SHA3_384: CK_MECHANISM_TYPE = 704; +pub const CKM_SHA3_384_HMAC: CK_MECHANISM_TYPE = 705; +pub const CKM_SHA3_384_HMAC_GENERAL: CK_MECHANISM_TYPE = 706; +pub const CKM_SHA3_384_KEY_GEN: CK_MECHANISM_TYPE = 707; +pub const CKM_SHA3_512: CK_MECHANISM_TYPE = 720; +pub const CKM_SHA3_512_HMAC: CK_MECHANISM_TYPE = 721; +pub const CKM_SHA3_512_HMAC_GENERAL: CK_MECHANISM_TYPE = 722; +pub const CKM_SHA3_512_KEY_GEN: CK_MECHANISM_TYPE = 723; pub const CKM_CAST_KEY_GEN: CK_MECHANISM_TYPE = 768; pub const CKM_CAST_ECB: CK_MECHANISM_TYPE = 769; pub const CKM_CAST_CBC: CK_MECHANISM_TYPE = 770; @@ -364,6 +458,13 @@ pub const CKM_SHA1_KEY_DERIVATION: CK_MECHANISM_TYPE = 914; pub const CKM_SHA256_KEY_DERIVATION: CK_MECHANISM_TYPE = 915; pub const CKM_SHA384_KEY_DERIVATION: CK_MECHANISM_TYPE = 916; pub const CKM_SHA512_KEY_DERIVATION: CK_MECHANISM_TYPE = 917; +pub const CKM_SHA224_KEY_DERIVATION: CK_MECHANISM_TYPE = 918; +pub const CKM_SHA3_256_KEY_DERIVE: CK_MECHANISM_TYPE = 919; +pub const CKM_SHA3_224_KEY_DERIVE: CK_MECHANISM_TYPE = 920; +pub const CKM_SHA3_384_KEY_DERIVE: CK_MECHANISM_TYPE = 921; +pub const CKM_SHA3_512_KEY_DERIVE: CK_MECHANISM_TYPE = 922; +pub const CKM_SHAKE_128_KEY_DERIVE: CK_MECHANISM_TYPE = 923; +pub const CKM_SHAKE_256_KEY_DERIVE: CK_MECHANISM_TYPE = 924; pub const CKM_PBE_MD2_DES_CBC: CK_MECHANISM_TYPE = 928; pub const CKM_PBE_MD5_DES_CBC: CK_MECHANISM_TYPE = 929; pub const CKM_PBE_MD5_CAST_CBC: CK_MECHANISM_TYPE = 930; @@ -403,6 +504,13 @@ pub const CKM_KIP_DERIVE: CK_MECHANISM_TYPE = 1296; pub const CKM_KIP_WRAP: CK_MECHANISM_TYPE = 1297; pub const CKM_KIP_MAC: CK_MECHANISM_TYPE = 1298; pub const CKM_CAMELLIA_KEY_GEN: CK_MECHANISM_TYPE = 1360; +pub const CKM_CAMELLIA_ECB: CK_MECHANISM_TYPE = 1361; +pub const CKM_CAMELLIA_CBC: CK_MECHANISM_TYPE = 1362; +pub const CKM_CAMELLIA_MAC: CK_MECHANISM_TYPE = 1363; +pub const CKM_CAMELLIA_MAC_GENERAL: CK_MECHANISM_TYPE = 1364; +pub const CKM_CAMELLIA_CBC_PAD: CK_MECHANISM_TYPE = 1365; +pub const CKM_CAMELLIA_ECB_ENCRYPT_DATA: CK_MECHANISM_TYPE = 1366; +pub const CKM_CAMELLIA_CBC_ENCRYPT_DATA: CK_MECHANISM_TYPE = 1367; pub const CKM_CAMELLIA_CTR: CK_MECHANISM_TYPE = 1368; pub const CKM_ARIA_KEY_GEN: CK_MECHANISM_TYPE = 1376; pub const CKM_ARIA_ECB: CK_MECHANISM_TYPE = 1377; @@ -433,6 +541,7 @@ pub const CKM_SKIPJACK_PRIVATE_WRAP: CK_MECHANISM_TYPE = 4105; pub const CKM_SKIPJACK_RELAYX: CK_MECHANISM_TYPE = 4106; pub const CKM_KEA_KEY_PAIR_GEN: CK_MECHANISM_TYPE = 4112; pub const CKM_KEA_KEY_DERIVE: CK_MECHANISM_TYPE = 4113; +pub const CKM_KEA_DERIVE: CK_MECHANISM_TYPE = 4114; pub const CKM_FORTEZZA_TIMESTAMP: CK_MECHANISM_TYPE = 4128; pub const CKM_BATON_KEY_GEN: CK_MECHANISM_TYPE = 4144; pub const CKM_BATON_ECB128: CK_MECHANISM_TYPE = 4145; @@ -461,6 +570,8 @@ pub const CKM_JUNIPER_COUNTER: CK_MECHANISM_TYPE = 4195; pub const CKM_JUNIPER_SHUFFLE: CK_MECHANISM_TYPE = 4196; pub const CKM_JUNIPER_WRAP: CK_MECHANISM_TYPE = 4197; pub const CKM_FASTHASH: CK_MECHANISM_TYPE = 4208; +pub const CKM_AES_XTS: CK_MECHANISM_TYPE = 4209; +pub const CKM_AES_XTS_KEY_GEN: CK_MECHANISM_TYPE = 4210; pub const CKM_AES_KEY_GEN: CK_MECHANISM_TYPE = 4224; pub const CKM_AES_ECB: CK_MECHANISM_TYPE = 4225; pub const CKM_AES_CBC: CK_MECHANISM_TYPE = 4226; @@ -500,6 +611,10 @@ pub const CKM_GOST28147_ECB: CK_MECHANISM_TYPE = 4641; pub const CKM_GOST28147: CK_MECHANISM_TYPE = 4642; pub const CKM_GOST28147_MAC: CK_MECHANISM_TYPE = 4643; pub const CKM_GOST28147_KEY_WRAP: CK_MECHANISM_TYPE = 4644; +pub const CKM_CHACHA20_KEY_GEN: CK_MECHANISM_TYPE = 4645; +pub const CKM_CHACHA20: CK_MECHANISM_TYPE = 4646; +pub const CKM_POLY1305_KEY_GEN: CK_MECHANISM_TYPE = 4647; +pub const CKM_POLY1305: CK_MECHANISM_TYPE = 4648; pub const CKM_DSA_PARAMETER_GEN: CK_MECHANISM_TYPE = 8192; pub const CKM_DH_PKCS_PARAMETER_GEN: CK_MECHANISM_TYPE = 8193; pub const CKM_X9_42_DH_PARAMETER_GEN: CK_MECHANISM_TYPE = 8194; @@ -510,63 +625,71 @@ pub const CKM_AES_CFB64: CK_MECHANISM_TYPE = 8453; pub const CKM_AES_CFB8: CK_MECHANISM_TYPE = 8454; pub const CKM_AES_CFB128: CK_MECHANISM_TYPE = 8455; pub const CKM_AES_CFB1: CK_MECHANISM_TYPE = 8456; -pub const CKM_SHA224: CK_MECHANISM_TYPE = 597; -pub const CKM_SHA224_HMAC: CK_MECHANISM_TYPE = 598; -pub const CKM_SHA224_HMAC_GENERAL: CK_MECHANISM_TYPE = 599; -pub const CKM_SHA224_RSA_PKCS: CK_MECHANISM_TYPE = 70; -pub const CKM_SHA224_RSA_PKCS_PSS: CK_MECHANISM_TYPE = 71; -pub const CKM_SHA224_KEY_DERIVATION: CK_MECHANISM_TYPE = 918; -pub const CKM_CAMELLIA_ECB: CK_MECHANISM_TYPE = 1361; -pub const CKM_CAMELLIA_CBC: CK_MECHANISM_TYPE = 1362; -pub const CKM_CAMELLIA_MAC: CK_MECHANISM_TYPE = 1363; -pub const CKM_CAMELLIA_MAC_GENERAL: CK_MECHANISM_TYPE = 1364; -pub const CKM_CAMELLIA_CBC_PAD: CK_MECHANISM_TYPE = 1365; -pub const CKM_CAMELLIA_ECB_ENCRYPT_DATA: CK_MECHANISM_TYPE = 1366; -pub const CKM_CAMELLIA_CBC_ENCRYPT_DATA: CK_MECHANISM_TYPE = 1367; pub const CKM_AES_KEY_WRAP: CK_MECHANISM_TYPE = 8457; pub const CKM_AES_KEY_WRAP_PAD: CK_MECHANISM_TYPE = 8458; +pub const CKM_AES_KEY_WRAP_KWP: CK_MECHANISM_TYPE = 8459; pub const CKM_RSA_PKCS_TPM_1_1: CK_MECHANISM_TYPE = 16385; pub const CKM_RSA_PKCS_OAEP_TPM_1_1: CK_MECHANISM_TYPE = 16386; +pub const CKM_SHA_1_KEY_GEN: CK_MECHANISM_TYPE = 16387; +pub const CKM_SHA224_KEY_GEN: CK_MECHANISM_TYPE = 16388; +pub const CKM_SHA256_KEY_GEN: CK_MECHANISM_TYPE = 16389; +pub const CKM_SHA384_KEY_GEN: CK_MECHANISM_TYPE = 16390; +pub const CKM_SHA512_KEY_GEN: CK_MECHANISM_TYPE = 16391; +pub const CKM_SHA512_224_KEY_GEN: CK_MECHANISM_TYPE = 16392; +pub const CKM_SHA512_256_KEY_GEN: CK_MECHANISM_TYPE = 16393; +pub const CKM_SHA512_T_KEY_GEN: CK_MECHANISM_TYPE = 16394; +pub const CKM_NULL: CK_MECHANISM_TYPE = 16395; +pub const CKM_BLAKE2B_160: CK_MECHANISM_TYPE = 16396; +pub const CKM_BLAKE2B_160_HMAC: CK_MECHANISM_TYPE = 16397; +pub const CKM_BLAKE2B_160_HMAC_GENERAL: CK_MECHANISM_TYPE = 16398; +pub const CKM_BLAKE2B_160_KEY_DERIVE: CK_MECHANISM_TYPE = 16399; +pub const CKM_BLAKE2B_160_KEY_GEN: CK_MECHANISM_TYPE = 16400; +pub const CKM_BLAKE2B_256: CK_MECHANISM_TYPE = 16401; +pub const CKM_BLAKE2B_256_HMAC: CK_MECHANISM_TYPE = 16402; +pub const CKM_BLAKE2B_256_HMAC_GENERAL: CK_MECHANISM_TYPE = 16403; +pub const CKM_BLAKE2B_256_KEY_DERIVE: CK_MECHANISM_TYPE = 16404; +pub const CKM_BLAKE2B_256_KEY_GEN: CK_MECHANISM_TYPE = 16405; +pub const CKM_BLAKE2B_384: CK_MECHANISM_TYPE = 16406; +pub const CKM_BLAKE2B_384_HMAC: CK_MECHANISM_TYPE = 16407; +pub const CKM_BLAKE2B_384_HMAC_GENERAL: CK_MECHANISM_TYPE = 16408; +pub const CKM_BLAKE2B_384_KEY_DERIVE: CK_MECHANISM_TYPE = 16409; +pub const CKM_BLAKE2B_384_KEY_GEN: CK_MECHANISM_TYPE = 16410; +pub const CKM_BLAKE2B_512: CK_MECHANISM_TYPE = 16411; +pub const CKM_BLAKE2B_512_HMAC: CK_MECHANISM_TYPE = 16412; +pub const CKM_BLAKE2B_512_HMAC_GENERAL: CK_MECHANISM_TYPE = 16413; +pub const CKM_BLAKE2B_512_KEY_DERIVE: CK_MECHANISM_TYPE = 16414; +pub const CKM_BLAKE2B_512_KEY_GEN: CK_MECHANISM_TYPE = 16415; +pub const CKM_SALSA20: CK_MECHANISM_TYPE = 16416; +pub const CKM_CHACHA20_POLY1305: CK_MECHANISM_TYPE = 16417; +pub const CKM_SALSA20_POLY1305: CK_MECHANISM_TYPE = 16418; +pub const CKM_X3DH_INITIALIZE: CK_MECHANISM_TYPE = 16419; +pub const CKM_X3DH_RESPOND: CK_MECHANISM_TYPE = 16420; +pub const CKM_X2RATCHET_INITIALIZE: CK_MECHANISM_TYPE = 16421; +pub const CKM_X2RATCHET_RESPOND: CK_MECHANISM_TYPE = 16422; +pub const CKM_X2RATCHET_ENCRYPT: CK_MECHANISM_TYPE = 16423; +pub const CKM_X2RATCHET_DECRYPT: CK_MECHANISM_TYPE = 16424; +pub const CKM_XEDDSA: CK_MECHANISM_TYPE = 16425; +pub const CKM_HKDF_DERIVE: CK_MECHANISM_TYPE = 16426; +pub const CKM_HKDF_DATA: CK_MECHANISM_TYPE = 16427; +pub const CKM_HKDF_KEY_GEN: CK_MECHANISM_TYPE = 16428; +pub const CKM_ECDSA_SHA3_224: CK_MECHANISM_TYPE = 4167; +pub const CKM_ECDSA_SHA3_256: CK_MECHANISM_TYPE = 4168; +pub const CKM_ECDSA_SHA3_384: CK_MECHANISM_TYPE = 4169; +pub const CKM_ECDSA_SHA3_512: CK_MECHANISM_TYPE = 4170; pub const CKM_EC_EDWARDS_KEY_PAIR_GEN: CK_MECHANISM_TYPE = 4181; pub const CKM_EC_MONTGOMERY_KEY_PAIR_GEN: CK_MECHANISM_TYPE = 4182; pub const CKM_EDDSA: CK_MECHANISM_TYPE = 4183; -pub const CK_OTP_FORMAT_DECIMAL: CK_ULONG = 0; -pub const CK_OTP_FORMAT_HEXADECIMAL: CK_ULONG = 1; -pub const CK_OTP_FORMAT_ALPHANUMERIC: CK_ULONG = 2; -pub const CK_OTP_FORMAT_BINARY: CK_ULONG = 3; -pub const CK_OTP_PARAM_IGNORED: CK_ULONG = 0; -pub const CK_OTP_PARAM_OPTIONAL: CK_ULONG = 1; -pub const CK_OTP_PARAM_MANDATORY: CK_ULONG = 2; -pub const CK_OTP_VALUE: CK_ULONG = 0; -pub const CK_OTP_PIN: CK_ULONG = 1; -pub const CK_OTP_CHALLENGE: CK_ULONG = 2; -pub const CK_OTP_TIME: CK_ULONG = 3; -pub const CK_OTP_COUNTER: CK_ULONG = 4; -pub const CK_OTP_FLAGS: CK_ULONG = 5; -pub const CK_OTP_OUTPUT_LENGTH: CK_ULONG = 6; -pub const CK_OTP_FORMAT: CK_ULONG = 7; -pub const CKF_NEXT_OTP: CK_FLAGS = 1; -pub const CKF_EXCLUDE_TIME: CK_FLAGS = 2; -pub const CKF_EXCLUDE_COUNTER: CK_FLAGS = 4; -pub const CKF_EXCLUDE_CHALLENGE: CK_FLAGS = 8; -pub const CKF_EXCLUDE_PIN: CK_FLAGS = 16; -pub const CKF_USER_FRIENDLY_OTP: CK_FLAGS = 32; -pub const CKN_OTP_CHANGED: CK_NOTIFICATION = 1; -pub const CKG_MGF1_SHA1: CK_RSA_PKCS_MGF_TYPE = 1; -pub const CKG_MGF1_SHA224: CK_RSA_PKCS_MGF_TYPE = 5; -pub const CKG_MGF1_SHA256: CK_RSA_PKCS_MGF_TYPE = 2; -pub const CKG_MGF1_SHA384: CK_RSA_PKCS_MGF_TYPE = 3; -pub const CKG_MGF1_SHA512: CK_RSA_PKCS_MGF_TYPE = 4; -pub const CKD_NULL: CK_EC_KDF_TYPE = 1; -pub const CKD_SHA1_KDF: CK_EC_KDF_TYPE = 2; -pub const CKD_SHA1_KDF_ASN1: CK_EC_KDF_TYPE = 3; -pub const CKD_SHA1_KDF_CONCATENATE: CK_EC_KDF_TYPE = 4; -pub const CKD_SHA224_KDF: CK_EC_KDF_TYPE = 5; -pub const CKD_SHA256_KDF: CK_EC_KDF_TYPE = 6; -pub const CKD_SHA384_KDF: CK_EC_KDF_TYPE = 7; -pub const CKD_SHA512_KDF: CK_EC_KDF_TYPE = 8; -pub const CKD_CPDIVERSIFY_KDF: CK_EC_KDF_TYPE = 9; +pub const CKM_SP800_108_COUNTER_KDF: CK_MECHANISM_TYPE = 940; +pub const CKM_SP800_108_FEEDBACK_KDF: CK_MECHANISM_TYPE = 941; +pub const CKM_SP800_108_DOUBLE_PIPELINE_KDF: CK_MECHANISM_TYPE = 942; +pub const CKM_VENDOR_DEFINED: CK_MECHANISM_TYPE = 2147483648; pub const CKF_HW: CK_FLAGS = 1; +pub const CKF_MESSAGE_ENCRYPT: CK_FLAGS = 2; +pub const CKF_MESSAGE_DECRYPT: CK_FLAGS = 4; +pub const CKF_MESSAGE_SIGN: CK_FLAGS = 8; +pub const CKF_MESSAGE_VERIFY: CK_FLAGS = 16; +pub const CKF_MULTI_MESSGE: CK_FLAGS = 32; +pub const CKF_FIND_OBJECTS: CK_FLAGS = 64; pub const CKF_ENCRYPT: CK_FLAGS = 256; pub const CKF_DECRYPT: CK_FLAGS = 512; pub const CKF_DIGEST: CK_FLAGS = 1024; @@ -582,12 +705,12 @@ pub const CKF_DERIVE: CK_FLAGS = 524288; pub const CKF_EC_F_P: CK_FLAGS = 1048576; pub const CKF_EC_F_2M: CK_FLAGS = 2097152; pub const CKF_EC_ECPARAMETERS: CK_FLAGS = 4194304; +pub const CKF_EC_OID: CK_FLAGS = 8388608; pub const CKF_EC_NAMEDCURVE: CK_FLAGS = 8388608; pub const CKF_EC_UNCOMPRESS: CK_FLAGS = 16777216; pub const CKF_EC_COMPRESS: CK_FLAGS = 33554432; -pub const CKF_DONT_BLOCK: CK_FLAGS = 1; -pub const CKF_LIBRARY_CANT_CREATE_OS_THREADS: CK_FLAGS = 1; -pub const CKF_OS_LOCKING_OK: CK_FLAGS = 2; +pub const CKF_EC_CURVENAME: CK_FLAGS = 67108864; +pub const CKF_EXTENSION: CK_FLAGS = 2147483648; pub const CKR_OK: CK_RV = 0; pub const CKR_CANCEL: CK_RV = 1; pub const CKR_HOST_MEMORY: CK_RV = 2; @@ -610,6 +733,7 @@ pub const CKR_DEVICE_MEMORY: CK_RV = 49; pub const CKR_DEVICE_REMOVED: CK_RV = 50; pub const CKR_ENCRYPTED_DATA_INVALID: CK_RV = 64; pub const CKR_ENCRYPTED_DATA_LEN_RANGE: CK_RV = 65; +pub const CKR_AEAD_DECRYPT_FAILED: CK_RV = 66; pub const CKR_FUNCTION_CANCELED: CK_RV = 80; pub const CKR_FUNCTION_NOT_PARALLEL: CK_RV = 81; pub const CKR_FUNCTION_NOT_SUPPORTED: CK_RV = 84; @@ -665,6 +789,7 @@ pub const CKR_WRAPPING_KEY_TYPE_INCONSISTENT: CK_RV = 277; pub const CKR_RANDOM_SEED_NOT_SUPPORTED: CK_RV = 288; pub const CKR_RANDOM_NO_RNG: CK_RV = 289; pub const CKR_DOMAIN_PARAMS_INVALID: CK_RV = 304; +pub const CKR_CURVE_NOT_SUPPORTED: CK_RV = 320; pub const CKR_BUFFER_TOO_SMALL: CK_RV = 336; pub const CKR_SAVED_STATE_INVALID: CK_RV = 352; pub const CKR_INFORMATION_SENSITIVE: CK_RV = 368; @@ -675,44 +800,126 @@ pub const CKR_MUTEX_BAD: CK_RV = 416; pub const CKR_MUTEX_NOT_LOCKED: CK_RV = 417; pub const CKR_NEW_PIN_MODE: CK_RV = 432; pub const CKR_NEXT_OTP: CK_RV = 433; -pub const CKR_EXCEEDED_MAX_ITERATIONS: CK_RV = 448; -pub const CKR_FIPS_SELF_TEST_FAILED: CK_RV = 449; -pub const CKR_LIBRARY_LOAD_FAILED: CK_RV = 450; -pub const CKR_PIN_TOO_WEAK: CK_RV = 451; -pub const CKR_PUBLIC_KEY_INVALID: CK_RV = 452; +pub const CKR_EXCEEDED_MAX_ITERATIONS: CK_RV = 437; +pub const CKR_FIPS_SELF_TEST_FAILED: CK_RV = 438; +pub const CKR_LIBRARY_LOAD_FAILED: CK_RV = 439; +pub const CKR_PIN_TOO_WEAK: CK_RV = 440; +pub const CKR_PUBLIC_KEY_INVALID: CK_RV = 441; pub const CKR_FUNCTION_REJECTED: CK_RV = 512; +pub const CKR_TOKEN_RESOURCE_EXCEEDED: CK_RV = 513; +pub const CKR_VENDOR_DEFINED: CK_RV = 2147483648; +pub const CKF_END_OF_MESSAGE: CK_FLAGS = 1; +pub const CKF_INTERFACE_FORK_SAFE: CK_FLAGS = 1; +pub const CKF_LIBRARY_CANT_CREATE_OS_THREADS: CK_FLAGS = 1; +pub const CKF_OS_LOCKING_OK: CK_FLAGS = 2; +pub const CKF_DONT_BLOCK: CK_FLAGS = 1; +pub const CKG_MGF1_SHA1: CK_RSA_PKCS_MGF_TYPE = 1; +pub const CKG_MGF1_SHA256: CK_RSA_PKCS_MGF_TYPE = 2; +pub const CKG_MGF1_SHA384: CK_RSA_PKCS_MGF_TYPE = 3; +pub const CKG_MGF1_SHA512: CK_RSA_PKCS_MGF_TYPE = 4; +pub const CKG_MGF1_SHA224: CK_RSA_PKCS_MGF_TYPE = 5; pub const CKZ_DATA_SPECIFIED: CK_RSA_PKCS_OAEP_SOURCE_TYPE = 1; -pub const CK_FALSE: CK_BBOOL = 0; -pub const CK_TRUE: CK_BBOOL = 1; -pub const FALSE: u32 = 0; -pub const TRUE: u32 = 1; -pub type CK_FLAGS = ::std::os::raw::c_ulong; +pub const CKD_NULL: CK_EC_KDF_TYPE = 1; +pub const CKD_SHA1_KDF: CK_EC_KDF_TYPE = 2; +pub const CKD_SHA1_KDF_ASN1: CK_EC_KDF_TYPE = 3; +pub const CKD_SHA1_KDF_CONCATENATE: CK_EC_KDF_TYPE = 4; +pub const CKD_SHA224_KDF: CK_EC_KDF_TYPE = 5; +pub const CKD_SHA256_KDF: CK_EC_KDF_TYPE = 6; +pub const CKD_SHA384_KDF: CK_EC_KDF_TYPE = 7; +pub const CKD_SHA512_KDF: CK_EC_KDF_TYPE = 8; +pub const CKD_CPDIVERSIFY_KDF: CK_EC_KDF_TYPE = 9; +pub const CKD_SHA3_224_KDF: CK_EC_KDF_TYPE = 10; +pub const CKD_SHA3_256_KDF: CK_EC_KDF_TYPE = 11; +pub const CKD_SHA3_384_KDF: CK_EC_KDF_TYPE = 12; +pub const CKD_SHA3_512_KDF: CK_EC_KDF_TYPE = 13; +pub const CKD_SHA1_KDF_SP800: CK_EC_KDF_TYPE = 14; +pub const CKD_SHA224_KDF_SP800: CK_EC_KDF_TYPE = 15; +pub const CKD_SHA256_KDF_SP800: CK_EC_KDF_TYPE = 16; +pub const CKD_SHA384_KDF_SP800: CK_EC_KDF_TYPE = 17; +pub const CKD_SHA512_KDF_SP800: CK_EC_KDF_TYPE = 18; +pub const CKD_SHA3_224_KDF_SP800: CK_EC_KDF_TYPE = 19; +pub const CKD_SHA3_256_KDF_SP800: CK_EC_KDF_TYPE = 20; +pub const CKD_SHA3_384_KDF_SP800: CK_EC_KDF_TYPE = 21; +pub const CKD_SHA3_512_KDF_SP800: CK_EC_KDF_TYPE = 22; +pub const CKD_BLAKE2B_160_KDF: CK_EC_KDF_TYPE = 23; +pub const CKD_BLAKE2B_256_KDF: CK_EC_KDF_TYPE = 24; +pub const CKD_BLAKE2B_384_KDF: CK_EC_KDF_TYPE = 25; +pub const CKD_BLAKE2B_512_KDF: CK_EC_KDF_TYPE = 26; +pub const CKP_PKCS5_PBKD2_HMAC_SHA1: CK_PROFILE_ID = 1; +pub const CKP_PKCS5_PBKD2_HMAC_GOSTR3411: CK_PROFILE_ID = 2; +pub const CKP_PKCS5_PBKD2_HMAC_SHA224: CK_PROFILE_ID = 3; +pub const CKP_PKCS5_PBKD2_HMAC_SHA256: CK_PROFILE_ID = 4; +pub const CKP_PKCS5_PBKD2_HMAC_SHA384: CK_PROFILE_ID = 5; +pub const CKP_PKCS5_PBKD2_HMAC_SHA512: CK_PROFILE_ID = 6; +pub const CKP_PKCS5_PBKD2_HMAC_SHA512_224: CK_PROFILE_ID = 7; +pub const CKP_PKCS5_PBKD2_HMAC_SHA512_256: CK_PROFILE_ID = 8; +pub const CKZ_SALT_SPECIFIED: CK_RSA_PKCS_OAEP_SOURCE_TYPE = 1; +pub const CK_OTP_VALUE: CK_ULONG = 0; +pub const CK_OTP_PIN: CK_ULONG = 1; +pub const CK_OTP_CHALLENGE: CK_ULONG = 2; +pub const CK_OTP_TIME: CK_ULONG = 3; +pub const CK_OTP_COUNTER: CK_ULONG = 4; +pub const CK_OTP_FLAGS: CK_ULONG = 5; +pub const CK_OTP_OUTPUT_LENGTH: CK_ULONG = 6; +pub const CK_OTP_OUTPUT_FORMAT: CK_ULONG = 7; +pub const CKF_NEXT_OTP: CK_FLAGS = 1; +pub const CKF_EXCLUDE_TIME: CK_FLAGS = 2; +pub const CKF_EXCLUDE_COUNTER: CK_FLAGS = 4; +pub const CKF_EXCLUDE_CHALLENGE: CK_FLAGS = 8; +pub const CKF_EXCLUDE_PIN: CK_FLAGS = 16; +pub const CKF_USER_FRIENDLY_OTP: CK_FLAGS = 32; +pub const CKG_NO_GENERATE: u32 = 0; +pub const CKG_GENERATE: u32 = 1; +pub const CKG_GENERATE_COUNTER: u32 = 2; +pub const CKG_GENERATE_RANDOM: u32 = 3; +pub const CK_SP800_108_ITERATION_VARIABLE: CK_ULONG = 1; +pub const CK_SP800_108_OPTIONAL_COUNTER: CK_ULONG = 2; +pub const CK_SP800_108_DKM_LENGTH: CK_ULONG = 3; +pub const CK_SP800_108_BYTE_ARRAY: CK_ULONG = 4; +pub const CKF_HKDF_SALT_NULL: CK_FLAGS = 1; +pub const CKF_HKDF_SALT_DATA: CK_FLAGS = 2; +pub const CKF_HKDF_SALT_KEY: CK_FLAGS = 4; +pub const CK_NEED_ARG_LIST: CK_ULONG = 1; +pub const CK_PKCS11_2_0_ONLY: CK_ULONG = 1; +pub type CK_BYTE = ::std::os::raw::c_uchar; +pub type CK_CHAR = CK_BYTE; +pub type CK_UTF8CHAR = CK_BYTE; +pub type CK_BBOOL = CK_BYTE; +pub type CK_ULONG = ::std::os::raw::c_ulong; +pub type CK_LONG = ::std::os::raw::c_long; +pub type CK_FLAGS = CK_ULONG; +pub type CK_BYTE_PTR = *mut CK_BYTE; +pub type CK_CHAR_PTR = *mut CK_CHAR; +pub type CK_UTF8CHAR_PTR = *mut CK_UTF8CHAR; +pub type CK_ULONG_PTR = *mut CK_ULONG; +pub type CK_VOID_PTR = *mut ::std::os::raw::c_void; +pub type CK_VOID_PTR_PTR = *mut CK_VOID_PTR; #[repr(C)] #[derive(Debug, Default, Copy, Clone)] -pub struct _CK_VERSION { - pub major: ::std::os::raw::c_uchar, - pub minor: ::std::os::raw::c_uchar, +pub struct CK_VERSION { + pub major: CK_BYTE, + pub minor: CK_BYTE, } #[test] -fn bindgen_test_layout__CK_VERSION() { - const UNINIT: ::std::mem::MaybeUninit<_CK_VERSION> = ::std::mem::MaybeUninit::uninit(); +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::<_CK_VERSION>(), + ::std::mem::size_of::(), 2usize, - concat!("Size of: ", stringify!(_CK_VERSION)) + concat!("Size of: ", stringify!(CK_VERSION)) ); assert_eq!( - ::std::mem::align_of::<_CK_VERSION>(), + ::std::mem::align_of::(), 1usize, - concat!("Alignment of ", stringify!(_CK_VERSION)) + 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!(CK_VERSION), "::", stringify!(major) ) @@ -722,41 +929,42 @@ fn bindgen_test_layout__CK_VERSION() { 1usize, concat!( "Offset of field: ", - stringify!(_CK_VERSION), + stringify!(CK_VERSION), "::", stringify!(minor) ) ); } +pub type CK_VERSION_PTR = *mut CK_VERSION; #[repr(C)] #[derive(Debug, Default, Copy, Clone)] -pub struct _CK_INFO { - pub cryptokiVersion: _CK_VERSION, - pub manufacturerID: [::std::os::raw::c_uchar; 32usize], +pub struct CK_INFO { + pub cryptokiVersion: CK_VERSION, + pub manufacturerID: [CK_UTF8CHAR; 32usize], pub flags: CK_FLAGS, - pub libraryDescription: [::std::os::raw::c_uchar; 32usize], - pub libraryVersion: _CK_VERSION, + pub libraryDescription: [CK_UTF8CHAR; 32usize], + pub libraryVersion: CK_VERSION, } #[test] -fn bindgen_test_layout__CK_INFO() { - const UNINIT: ::std::mem::MaybeUninit<_CK_INFO> = ::std::mem::MaybeUninit::uninit(); +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::<_CK_INFO>(), + ::std::mem::size_of::(), 76usize, - concat!("Size of: ", stringify!(_CK_INFO)) + concat!("Size of: ", stringify!(CK_INFO)) ); assert_eq!( - ::std::mem::align_of::<_CK_INFO>(), + ::std::mem::align_of::(), 4usize, - concat!("Alignment of ", stringify!(_CK_INFO)) + 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!(CK_INFO), "::", stringify!(cryptokiVersion) ) @@ -766,7 +974,7 @@ fn bindgen_test_layout__CK_INFO() { 2usize, concat!( "Offset of field: ", - stringify!(_CK_INFO), + stringify!(CK_INFO), "::", stringify!(manufacturerID) ) @@ -776,7 +984,7 @@ fn bindgen_test_layout__CK_INFO() { 36usize, concat!( "Offset of field: ", - stringify!(_CK_INFO), + stringify!(CK_INFO), "::", stringify!(flags) ) @@ -786,7 +994,7 @@ fn bindgen_test_layout__CK_INFO() { 40usize, concat!( "Offset of field: ", - stringify!(_CK_INFO), + stringify!(CK_INFO), "::", stringify!(libraryDescription) ) @@ -796,44 +1004,45 @@ fn bindgen_test_layout__CK_INFO() { 72usize, concat!( "Offset of field: ", - stringify!(_CK_INFO), + stringify!(CK_INFO), "::", stringify!(libraryVersion) ) ); } -pub type CK_NOTIFICATION = ::std::os::raw::c_ulong; -pub const CKN_SURRENDER: ::std::os::raw::c_ulong = 0; -pub type CK_SLOT_ID = ::std::os::raw::c_ulong; +pub type CK_INFO_PTR = *mut CK_INFO; +pub type CK_NOTIFICATION = CK_ULONG; +pub type CK_SLOT_ID = CK_ULONG; +pub type CK_SLOT_ID_PTR = *mut CK_SLOT_ID; #[repr(C)] #[derive(Debug, Copy, Clone)] -pub struct _CK_SLOT_INFO { - pub slotDescription: [::std::os::raw::c_uchar; 64usize], - pub manufacturerID: [::std::os::raw::c_uchar; 32usize], +pub struct CK_SLOT_INFO { + pub slotDescription: [CK_UTF8CHAR; 64usize], + pub manufacturerID: [CK_UTF8CHAR; 32usize], pub flags: CK_FLAGS, - pub hardwareVersion: _CK_VERSION, - pub firmwareVersion: _CK_VERSION, + pub hardwareVersion: CK_VERSION, + pub firmwareVersion: CK_VERSION, } #[test] -fn bindgen_test_layout__CK_SLOT_INFO() { - const UNINIT: ::std::mem::MaybeUninit<_CK_SLOT_INFO> = ::std::mem::MaybeUninit::uninit(); +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::<_CK_SLOT_INFO>(), + ::std::mem::size_of::(), 104usize, - concat!("Size of: ", stringify!(_CK_SLOT_INFO)) + concat!("Size of: ", stringify!(CK_SLOT_INFO)) ); assert_eq!( - ::std::mem::align_of::<_CK_SLOT_INFO>(), + ::std::mem::align_of::(), 4usize, - concat!("Alignment of ", stringify!(_CK_SLOT_INFO)) + 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!(CK_SLOT_INFO), "::", stringify!(slotDescription) ) @@ -843,7 +1052,7 @@ fn bindgen_test_layout__CK_SLOT_INFO() { 64usize, concat!( "Offset of field: ", - stringify!(_CK_SLOT_INFO), + stringify!(CK_SLOT_INFO), "::", stringify!(manufacturerID) ) @@ -853,7 +1062,7 @@ fn bindgen_test_layout__CK_SLOT_INFO() { 96usize, concat!( "Offset of field: ", - stringify!(_CK_SLOT_INFO), + stringify!(CK_SLOT_INFO), "::", stringify!(flags) ) @@ -863,7 +1072,7 @@ fn bindgen_test_layout__CK_SLOT_INFO() { 100usize, concat!( "Offset of field: ", - stringify!(_CK_SLOT_INFO), + stringify!(CK_SLOT_INFO), "::", stringify!(hardwareVersion) ) @@ -873,13 +1082,13 @@ fn bindgen_test_layout__CK_SLOT_INFO() { 102usize, concat!( "Offset of field: ", - stringify!(_CK_SLOT_INFO), + stringify!(CK_SLOT_INFO), "::", stringify!(firmwareVersion) ) ); } -impl Default for _CK_SLOT_INFO { +impl Default for CK_SLOT_INFO { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { @@ -888,52 +1097,49 @@ impl Default for _CK_SLOT_INFO { } } } -pub const CKF_TOKEN_PRESENT: ::std::os::raw::c_ulong = 1; -pub const CKF_REMOVABLE_DEVICE: ::std::os::raw::c_ulong = 2; -pub const CKF_HW_SLOT: ::std::os::raw::c_ulong = 4; -pub const CKF_ARRAY_ATTRIBUTE: ::std::os::raw::c_ulong = 1073741824; +pub type CK_SLOT_INFO_PTR = *mut CK_SLOT_INFO; #[repr(C)] #[derive(Debug, Default, Copy, Clone)] -pub struct _CK_TOKEN_INFO { - pub label: [::std::os::raw::c_uchar; 32usize], - pub manufacturerID: [::std::os::raw::c_uchar; 32usize], - pub model: [::std::os::raw::c_uchar; 16usize], - pub serialNumber: [::std::os::raw::c_uchar; 16usize], +pub struct CK_TOKEN_INFO { + pub label: [CK_UTF8CHAR; 32usize], + pub manufacturerID: [CK_UTF8CHAR; 32usize], + pub model: [CK_UTF8CHAR; 16usize], + pub serialNumber: [CK_CHAR; 16usize], pub flags: CK_FLAGS, - pub ulMaxSessionCount: ::std::os::raw::c_ulong, - pub ulSessionCount: ::std::os::raw::c_ulong, - pub ulMaxRwSessionCount: ::std::os::raw::c_ulong, - pub ulRwSessionCount: ::std::os::raw::c_ulong, - pub ulMaxPinLen: ::std::os::raw::c_ulong, - pub ulMinPinLen: ::std::os::raw::c_ulong, - pub ulTotalPublicMemory: ::std::os::raw::c_ulong, - pub ulFreePublicMemory: ::std::os::raw::c_ulong, - pub ulTotalPrivateMemory: ::std::os::raw::c_ulong, - pub ulFreePrivateMemory: ::std::os::raw::c_ulong, - pub hardwareVersion: _CK_VERSION, - pub firmwareVersion: _CK_VERSION, - pub utcTime: [::std::os::raw::c_uchar; 16usize], + pub ulMaxSessionCount: CK_ULONG, + pub ulSessionCount: CK_ULONG, + pub ulMaxRwSessionCount: CK_ULONG, + pub ulRwSessionCount: CK_ULONG, + pub ulMaxPinLen: CK_ULONG, + pub ulMinPinLen: CK_ULONG, + pub ulTotalPublicMemory: CK_ULONG, + pub ulFreePublicMemory: CK_ULONG, + pub ulTotalPrivateMemory: CK_ULONG, + pub ulFreePrivateMemory: CK_ULONG, + pub hardwareVersion: CK_VERSION, + pub firmwareVersion: CK_VERSION, + pub utcTime: [CK_CHAR; 16usize], } #[test] -fn bindgen_test_layout__CK_TOKEN_INFO() { - const UNINIT: ::std::mem::MaybeUninit<_CK_TOKEN_INFO> = ::std::mem::MaybeUninit::uninit(); +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::<_CK_TOKEN_INFO>(), + ::std::mem::size_of::(), 160usize, - concat!("Size of: ", stringify!(_CK_TOKEN_INFO)) + concat!("Size of: ", stringify!(CK_TOKEN_INFO)) ); assert_eq!( - ::std::mem::align_of::<_CK_TOKEN_INFO>(), + ::std::mem::align_of::(), 4usize, - concat!("Alignment of ", stringify!(_CK_TOKEN_INFO)) + 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!(CK_TOKEN_INFO), "::", stringify!(label) ) @@ -943,7 +1149,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { 32usize, concat!( "Offset of field: ", - stringify!(_CK_TOKEN_INFO), + stringify!(CK_TOKEN_INFO), "::", stringify!(manufacturerID) ) @@ -953,7 +1159,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { 64usize, concat!( "Offset of field: ", - stringify!(_CK_TOKEN_INFO), + stringify!(CK_TOKEN_INFO), "::", stringify!(model) ) @@ -963,7 +1169,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { 80usize, concat!( "Offset of field: ", - stringify!(_CK_TOKEN_INFO), + stringify!(CK_TOKEN_INFO), "::", stringify!(serialNumber) ) @@ -973,7 +1179,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { 96usize, concat!( "Offset of field: ", - stringify!(_CK_TOKEN_INFO), + stringify!(CK_TOKEN_INFO), "::", stringify!(flags) ) @@ -983,7 +1189,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { 100usize, concat!( "Offset of field: ", - stringify!(_CK_TOKEN_INFO), + stringify!(CK_TOKEN_INFO), "::", stringify!(ulMaxSessionCount) ) @@ -993,7 +1199,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { 104usize, concat!( "Offset of field: ", - stringify!(_CK_TOKEN_INFO), + stringify!(CK_TOKEN_INFO), "::", stringify!(ulSessionCount) ) @@ -1003,7 +1209,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { 108usize, concat!( "Offset of field: ", - stringify!(_CK_TOKEN_INFO), + stringify!(CK_TOKEN_INFO), "::", stringify!(ulMaxRwSessionCount) ) @@ -1013,7 +1219,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { 112usize, concat!( "Offset of field: ", - stringify!(_CK_TOKEN_INFO), + stringify!(CK_TOKEN_INFO), "::", stringify!(ulRwSessionCount) ) @@ -1023,7 +1229,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { 116usize, concat!( "Offset of field: ", - stringify!(_CK_TOKEN_INFO), + stringify!(CK_TOKEN_INFO), "::", stringify!(ulMaxPinLen) ) @@ -1033,7 +1239,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { 120usize, concat!( "Offset of field: ", - stringify!(_CK_TOKEN_INFO), + stringify!(CK_TOKEN_INFO), "::", stringify!(ulMinPinLen) ) @@ -1043,7 +1249,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { 124usize, concat!( "Offset of field: ", - stringify!(_CK_TOKEN_INFO), + stringify!(CK_TOKEN_INFO), "::", stringify!(ulTotalPublicMemory) ) @@ -1053,7 +1259,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { 128usize, concat!( "Offset of field: ", - stringify!(_CK_TOKEN_INFO), + stringify!(CK_TOKEN_INFO), "::", stringify!(ulFreePublicMemory) ) @@ -1063,7 +1269,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { 132usize, concat!( "Offset of field: ", - stringify!(_CK_TOKEN_INFO), + stringify!(CK_TOKEN_INFO), "::", stringify!(ulTotalPrivateMemory) ) @@ -1073,7 +1279,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { 136usize, concat!( "Offset of field: ", - stringify!(_CK_TOKEN_INFO), + stringify!(CK_TOKEN_INFO), "::", stringify!(ulFreePrivateMemory) ) @@ -1083,7 +1289,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { 140usize, concat!( "Offset of field: ", - stringify!(_CK_TOKEN_INFO), + stringify!(CK_TOKEN_INFO), "::", stringify!(hardwareVersion) ) @@ -1093,7 +1299,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { 142usize, concat!( "Offset of field: ", - stringify!(_CK_TOKEN_INFO), + stringify!(CK_TOKEN_INFO), "::", stringify!(firmwareVersion) ) @@ -1103,43 +1309,45 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { 144usize, concat!( "Offset of field: ", - stringify!(_CK_TOKEN_INFO), + stringify!(CK_TOKEN_INFO), "::", stringify!(utcTime) ) ); } -pub type CK_SESSION_HANDLE = ::std::os::raw::c_ulong; -pub type CK_USER_TYPE = ::std::os::raw::c_ulong; -pub type CK_STATE = ::std::os::raw::c_ulong; +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; +pub type CK_USER_TYPE = CK_ULONG; +pub type CK_STATE = CK_ULONG; #[repr(C)] #[derive(Debug, Default, Copy, Clone)] -pub struct _CK_SESSION_INFO { +pub struct CK_SESSION_INFO { pub slotID: CK_SLOT_ID, pub state: CK_STATE, pub flags: CK_FLAGS, - pub ulDeviceError: ::std::os::raw::c_ulong, + pub ulDeviceError: CK_ULONG, } #[test] -fn bindgen_test_layout__CK_SESSION_INFO() { - const UNINIT: ::std::mem::MaybeUninit<_CK_SESSION_INFO> = ::std::mem::MaybeUninit::uninit(); +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::<_CK_SESSION_INFO>(), + ::std::mem::size_of::(), 16usize, - concat!("Size of: ", stringify!(_CK_SESSION_INFO)) + concat!("Size of: ", stringify!(CK_SESSION_INFO)) ); assert_eq!( - ::std::mem::align_of::<_CK_SESSION_INFO>(), + ::std::mem::align_of::(), 4usize, - concat!("Alignment of ", stringify!(_CK_SESSION_INFO)) + 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!(CK_SESSION_INFO), "::", stringify!(slotID) ) @@ -1149,7 +1357,7 @@ fn bindgen_test_layout__CK_SESSION_INFO() { 4usize, concat!( "Offset of field: ", - stringify!(_CK_SESSION_INFO), + stringify!(CK_SESSION_INFO), "::", stringify!(state) ) @@ -1159,7 +1367,7 @@ fn bindgen_test_layout__CK_SESSION_INFO() { 8usize, concat!( "Offset of field: ", - stringify!(_CK_SESSION_INFO), + stringify!(CK_SESSION_INFO), "::", stringify!(flags) ) @@ -1169,45 +1377,48 @@ fn bindgen_test_layout__CK_SESSION_INFO() { 12usize, concat!( "Offset of field: ", - stringify!(_CK_SESSION_INFO), + stringify!(CK_SESSION_INFO), "::", stringify!(ulDeviceError) ) ); } -pub type CK_OBJECT_HANDLE = ::std::os::raw::c_ulong; -pub type CK_OBJECT_CLASS = ::std::os::raw::c_ulong; -pub type CK_HW_FEATURE_TYPE = ::std::os::raw::c_ulong; -pub type CK_KEY_TYPE = ::std::os::raw::c_ulong; -pub type CK_CERTIFICATE_TYPE = ::std::os::raw::c_ulong; -pub type CK_ATTRIBUTE_TYPE = ::std::os::raw::c_ulong; +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; +pub type CK_OBJECT_CLASS = CK_ULONG; +pub type CK_OBJECT_CLASS_PTR = *mut CK_OBJECT_CLASS; +pub type CK_HW_FEATURE_TYPE = CK_ULONG; +pub type CK_KEY_TYPE = CK_ULONG; +pub type CK_CERTIFICATE_TYPE = CK_ULONG; +pub type CK_ATTRIBUTE_TYPE = CK_ULONG; #[repr(C)] #[derive(Debug, Copy, Clone)] -pub struct _CK_ATTRIBUTE { +pub struct CK_ATTRIBUTE { pub type_: CK_ATTRIBUTE_TYPE, - pub pValue: *mut ::std::os::raw::c_void, - pub ulValueLen: ::std::os::raw::c_ulong, + pub pValue: CK_VOID_PTR, + pub ulValueLen: CK_ULONG, } #[test] -fn bindgen_test_layout__CK_ATTRIBUTE() { - const UNINIT: ::std::mem::MaybeUninit<_CK_ATTRIBUTE> = ::std::mem::MaybeUninit::uninit(); +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::<_CK_ATTRIBUTE>(), + ::std::mem::size_of::(), 12usize, - concat!("Size of: ", stringify!(_CK_ATTRIBUTE)) + concat!("Size of: ", stringify!(CK_ATTRIBUTE)) ); assert_eq!( - ::std::mem::align_of::<_CK_ATTRIBUTE>(), + ::std::mem::align_of::(), 4usize, - concat!("Alignment of ", stringify!(_CK_ATTRIBUTE)) + 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!(CK_ATTRIBUTE), "::", stringify!(type_) ) @@ -1217,7 +1428,7 @@ fn bindgen_test_layout__CK_ATTRIBUTE() { 4usize, concat!( "Offset of field: ", - stringify!(_CK_ATTRIBUTE), + stringify!(CK_ATTRIBUTE), "::", stringify!(pValue) ) @@ -1227,13 +1438,13 @@ fn bindgen_test_layout__CK_ATTRIBUTE() { 8usize, concat!( "Offset of field: ", - stringify!(_CK_ATTRIBUTE), + stringify!(CK_ATTRIBUTE), "::", stringify!(ulValueLen) ) ); } -impl Default for _CK_ATTRIBUTE { +impl Default for CK_ATTRIBUTE { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { @@ -1242,33 +1453,34 @@ impl Default for _CK_ATTRIBUTE { } } } +pub type CK_ATTRIBUTE_PTR = *mut CK_ATTRIBUTE; #[repr(C)] #[derive(Debug, Default, Copy, Clone)] -pub struct _CK_DATE { - pub year: [::std::os::raw::c_uchar; 4usize], - pub month: [::std::os::raw::c_uchar; 2usize], - pub day: [::std::os::raw::c_uchar; 2usize], +pub struct CK_DATE { + pub year: [CK_CHAR; 4usize], + pub month: [CK_CHAR; 2usize], + pub day: [CK_CHAR; 2usize], } #[test] -fn bindgen_test_layout__CK_DATE() { - const UNINIT: ::std::mem::MaybeUninit<_CK_DATE> = ::std::mem::MaybeUninit::uninit(); +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::<_CK_DATE>(), + ::std::mem::size_of::(), 8usize, - concat!("Size of: ", stringify!(_CK_DATE)) + concat!("Size of: ", stringify!(CK_DATE)) ); assert_eq!( - ::std::mem::align_of::<_CK_DATE>(), + ::std::mem::align_of::(), 1usize, - concat!("Alignment of ", stringify!(_CK_DATE)) + 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!(CK_DATE), "::", stringify!(year) ) @@ -1278,7 +1490,7 @@ fn bindgen_test_layout__CK_DATE() { 4usize, concat!( "Offset of field: ", - stringify!(_CK_DATE), + stringify!(CK_DATE), "::", stringify!(month) ) @@ -1288,40 +1500,41 @@ fn bindgen_test_layout__CK_DATE() { 6usize, concat!( "Offset of field: ", - stringify!(_CK_DATE), + stringify!(CK_DATE), "::", stringify!(day) ) ); } -pub type CK_MECHANISM_TYPE = ::std::os::raw::c_ulong; +pub type CK_MECHANISM_TYPE = CK_ULONG; +pub type CK_MECHANISM_TYPE_PTR = *mut CK_MECHANISM_TYPE; #[repr(C)] #[derive(Debug, Copy, Clone)] -pub struct _CK_MECHANISM { +pub struct CK_MECHANISM { pub mechanism: CK_MECHANISM_TYPE, - pub pParameter: *mut ::std::os::raw::c_void, - pub ulParameterLen: ::std::os::raw::c_ulong, + pub pParameter: CK_VOID_PTR, + pub ulParameterLen: CK_ULONG, } #[test] -fn bindgen_test_layout__CK_MECHANISM() { - const UNINIT: ::std::mem::MaybeUninit<_CK_MECHANISM> = ::std::mem::MaybeUninit::uninit(); +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::<_CK_MECHANISM>(), + ::std::mem::size_of::(), 12usize, - concat!("Size of: ", stringify!(_CK_MECHANISM)) + concat!("Size of: ", stringify!(CK_MECHANISM)) ); assert_eq!( - ::std::mem::align_of::<_CK_MECHANISM>(), + ::std::mem::align_of::(), 4usize, - concat!("Alignment of ", stringify!(_CK_MECHANISM)) + 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!(CK_MECHANISM), "::", stringify!(mechanism) ) @@ -1331,7 +1544,7 @@ fn bindgen_test_layout__CK_MECHANISM() { 4usize, concat!( "Offset of field: ", - stringify!(_CK_MECHANISM), + stringify!(CK_MECHANISM), "::", stringify!(pParameter) ) @@ -1341,13 +1554,13 @@ fn bindgen_test_layout__CK_MECHANISM() { 8usize, concat!( "Offset of field: ", - stringify!(_CK_MECHANISM), + stringify!(CK_MECHANISM), "::", stringify!(ulParameterLen) ) ); } -impl Default for _CK_MECHANISM { +impl Default for CK_MECHANISM { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { @@ -1356,33 +1569,34 @@ impl Default for _CK_MECHANISM { } } } +pub type CK_MECHANISM_PTR = *mut CK_MECHANISM; #[repr(C)] #[derive(Debug, Default, Copy, Clone)] -pub struct _CK_MECHANISM_INFO { - pub ulMinKeySize: ::std::os::raw::c_ulong, - pub ulMaxKeySize: ::std::os::raw::c_ulong, +pub struct CK_MECHANISM_INFO { + pub ulMinKeySize: CK_ULONG, + pub ulMaxKeySize: CK_ULONG, pub flags: CK_FLAGS, } #[test] -fn bindgen_test_layout__CK_MECHANISM_INFO() { - const UNINIT: ::std::mem::MaybeUninit<_CK_MECHANISM_INFO> = ::std::mem::MaybeUninit::uninit(); +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::<_CK_MECHANISM_INFO>(), + ::std::mem::size_of::(), 12usize, - concat!("Size of: ", stringify!(_CK_MECHANISM_INFO)) + concat!("Size of: ", stringify!(CK_MECHANISM_INFO)) ); assert_eq!( - ::std::mem::align_of::<_CK_MECHANISM_INFO>(), + ::std::mem::align_of::(), 4usize, - concat!("Alignment of ", stringify!(_CK_MECHANISM_INFO)) + 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!(CK_MECHANISM_INFO), "::", stringify!(ulMinKeySize) ) @@ -1392,7 +1606,7 @@ fn bindgen_test_layout__CK_MECHANISM_INFO() { 4usize, concat!( "Offset of field: ", - stringify!(_CK_MECHANISM_INFO), + stringify!(CK_MECHANISM_INFO), "::", stringify!(ulMaxKeySize) ) @@ -1402,66 +1616,78 @@ fn bindgen_test_layout__CK_MECHANISM_INFO() { 8usize, concat!( "Offset of field: ", - stringify!(_CK_MECHANISM_INFO), + stringify!(CK_MECHANISM_INFO), "::", stringify!(flags) ) ); } -pub type CK_PARAM_TYPE = ::std::os::raw::c_ulong; +pub type CK_MECHANISM_INFO_PTR = *mut CK_MECHANISM_INFO; +pub type CK_RV = CK_ULONG; +pub type CK_NOTIFY = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + event: CK_NOTIFICATION, + pApplication: CK_VOID_PTR, + ) -> CK_RV, +>; +pub type CK_FUNCTION_LIST_PTR = *mut CK_FUNCTION_LIST; +pub type CK_FUNCTION_LIST_3_0_PTR = *mut CK_FUNCTION_LIST_3_0; +pub type CK_FUNCTION_LIST_PTR_PTR = *mut CK_FUNCTION_LIST_PTR; +pub type CK_FUNCTION_LIST_3_0_PTR_PTR = *mut CK_FUNCTION_LIST_3_0_PTR; #[repr(C)] #[derive(Debug, Copy, Clone)] -pub struct CK_OTP_PARAM { - pub type_: CK_PARAM_TYPE, - pub pValue: *mut ::std::os::raw::c_void, - pub ulValueLen: ::std::os::raw::c_ulong, +pub struct CK_INTERFACE { + pub pInterfaceName: *mut CK_CHAR, + pub pFunctionList: CK_VOID_PTR, + pub flags: CK_FLAGS, } #[test] -fn bindgen_test_layout_CK_OTP_PARAM() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); +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::(), + ::std::mem::size_of::(), 12usize, - concat!("Size of: ", stringify!(CK_OTP_PARAM)) + concat!("Size of: ", stringify!(CK_INTERFACE)) ); assert_eq!( - ::std::mem::align_of::(), + ::std::mem::align_of::(), 4usize, - concat!("Alignment of ", stringify!(CK_OTP_PARAM)) + concat!("Alignment of ", stringify!(CK_INTERFACE)) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).type_) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).pInterfaceName) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", - stringify!(CK_OTP_PARAM), + stringify!(CK_INTERFACE), "::", - stringify!(type_) + stringify!(pInterfaceName) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pValue) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).pFunctionList) as usize - ptr as usize }, 4usize, concat!( "Offset of field: ", - stringify!(CK_OTP_PARAM), + stringify!(CK_INTERFACE), "::", - stringify!(pValue) + stringify!(pFunctionList) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulValueLen) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).flags) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", - stringify!(CK_OTP_PARAM), + stringify!(CK_INTERFACE), "::", - stringify!(ulValueLen) + stringify!(flags) ) ); } -impl Default for CK_OTP_PARAM { +impl Default for CK_INTERFACE { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { @@ -1470,99 +1696,100 @@ impl Default for CK_OTP_PARAM { } } } +pub type CK_INTERFACE_PTR = *mut CK_INTERFACE; +pub type CK_INTERFACE_PTR_PTR = *mut CK_INTERFACE_PTR; +pub type CK_CREATEMUTEX = + ::std::option::Option CK_RV>; +pub type CK_DESTROYMUTEX = + ::std::option::Option CK_RV>; +pub type CK_LOCKMUTEX = ::std::option::Option CK_RV>; +pub type CK_UNLOCKMUTEX = ::std::option::Option CK_RV>; #[repr(C)] #[derive(Debug, Copy, Clone)] -pub struct CK_OTP_PARAMS { - pub pParams: *mut CK_OTP_PARAM, - pub ulCount: ::std::os::raw::c_ulong, +pub struct CK_C_INITIALIZE_ARGS { + pub CreateMutex: CK_CREATEMUTEX, + pub DestroyMutex: CK_DESTROYMUTEX, + pub LockMutex: CK_LOCKMUTEX, + pub UnlockMutex: CK_UNLOCKMUTEX, + pub flags: CK_FLAGS, + pub pReserved: CK_VOID_PTR, } #[test] -fn bindgen_test_layout_CK_OTP_PARAMS() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); +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::(), - 8usize, - concat!("Size of: ", stringify!(CK_OTP_PARAMS)) + ::std::mem::size_of::(), + 24usize, + concat!("Size of: ", stringify!(CK_C_INITIALIZE_ARGS)) ); assert_eq!( - ::std::mem::align_of::(), + ::std::mem::align_of::(), 4usize, - concat!("Alignment of ", stringify!(CK_OTP_PARAMS)) + concat!("Alignment of ", stringify!(CK_C_INITIALIZE_ARGS)) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pParams) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).CreateMutex) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", - stringify!(CK_OTP_PARAMS), + stringify!(CK_C_INITIALIZE_ARGS), "::", - stringify!(pParams) + stringify!(CreateMutex) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulCount) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).DestroyMutex) as usize - ptr as usize }, 4usize, concat!( "Offset of field: ", - stringify!(CK_OTP_PARAMS), + stringify!(CK_C_INITIALIZE_ARGS), "::", - stringify!(ulCount) + stringify!(DestroyMutex) ) ); -} -impl Default for CK_OTP_PARAMS { - fn default() -> Self { - let mut s = ::std::mem::MaybeUninit::::uninit(); - unsafe { - ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct CK_OTP_SIGNATURE_INFO { - pub pParams: *mut CK_OTP_PARAM, - pub ulCount: ::std::os::raw::c_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::(), + unsafe { ::std::ptr::addr_of!((*ptr).LockMutex) as usize - ptr as usize }, 8usize, - concat!("Size of: ", stringify!(CK_OTP_SIGNATURE_INFO)) + concat!( + "Offset of field: ", + stringify!(CK_C_INITIALIZE_ARGS), + "::", + stringify!(LockMutex) + ) ); assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(CK_OTP_SIGNATURE_INFO)) + unsafe { ::std::ptr::addr_of!((*ptr).UnlockMutex) as usize - ptr as usize }, + 12usize, + concat!( + "Offset of field: ", + stringify!(CK_C_INITIALIZE_ARGS), + "::", + stringify!(UnlockMutex) + ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pParams) as usize - ptr as usize }, - 0usize, + unsafe { ::std::ptr::addr_of!((*ptr).flags) as usize - ptr as usize }, + 16usize, concat!( "Offset of field: ", - stringify!(CK_OTP_SIGNATURE_INFO), + stringify!(CK_C_INITIALIZE_ARGS), "::", - stringify!(pParams) + stringify!(flags) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulCount) as usize - ptr as usize }, - 4usize, + unsafe { ::std::ptr::addr_of!((*ptr).pReserved) as usize - ptr as usize }, + 20usize, concat!( "Offset of field: ", - stringify!(CK_OTP_SIGNATURE_INFO), + stringify!(CK_C_INITIALIZE_ARGS), "::", - stringify!(ulCount) + stringify!(pReserved) ) ); } -impl Default for CK_OTP_SIGNATURE_INFO { +impl Default for CK_C_INITIALIZE_ARGS { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { @@ -1571,35 +1798,41 @@ impl Default for CK_OTP_SIGNATURE_INFO { } } } -pub type CK_RSA_PKCS_MGF_TYPE = ::std::os::raw::c_ulong; +pub type CK_C_INITIALIZE_ARGS_PTR = *mut CK_C_INITIALIZE_ARGS; +pub type CK_RSA_PKCS_MGF_TYPE = CK_ULONG; +pub type CK_RSA_PKCS_MGF_TYPE_PTR = *mut CK_RSA_PKCS_MGF_TYPE; +pub type CK_RSA_PKCS_OAEP_SOURCE_TYPE = CK_ULONG; +pub type CK_RSA_PKCS_OAEP_SOURCE_TYPE_PTR = *mut CK_RSA_PKCS_OAEP_SOURCE_TYPE; #[repr(C)] -#[derive(Debug, Default, Copy, Clone)] -pub struct ck_rsa_pkcs_pss_params { +#[derive(Debug, Copy, Clone)] +pub struct CK_RSA_PKCS_OAEP_PARAMS { pub hashAlg: CK_MECHANISM_TYPE, pub mgf: CK_RSA_PKCS_MGF_TYPE, - pub sLen: ::std::os::raw::c_ulong, + pub source: CK_RSA_PKCS_OAEP_SOURCE_TYPE, + pub pSourceData: CK_VOID_PTR, + pub ulSourceDataLen: CK_ULONG, } #[test] -fn bindgen_test_layout_ck_rsa_pkcs_pss_params() { - const UNINIT: ::std::mem::MaybeUninit = +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::(), - 12usize, - concat!("Size of: ", stringify!(ck_rsa_pkcs_pss_params)) + ::std::mem::size_of::(), + 20usize, + concat!("Size of: ", stringify!(CK_RSA_PKCS_OAEP_PARAMS)) ); assert_eq!( - ::std::mem::align_of::(), + ::std::mem::align_of::(), 4usize, - concat!("Alignment of ", stringify!(ck_rsa_pkcs_pss_params)) + 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_pss_params), + stringify!(CK_RSA_PKCS_OAEP_PARAMS), "::", stringify!(hashAlg) ) @@ -1609,75 +1842,19 @@ fn bindgen_test_layout_ck_rsa_pkcs_pss_params() { 4usize, concat!( "Offset of field: ", - stringify!(ck_rsa_pkcs_pss_params), + stringify!(CK_RSA_PKCS_OAEP_PARAMS), "::", stringify!(mgf) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).sLen) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).source) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", - stringify!(ck_rsa_pkcs_pss_params), + stringify!(CK_RSA_PKCS_OAEP_PARAMS), "::", - stringify!(sLen) - ) - ); -} -pub type CK_RSA_PKCS_OAEP_SOURCE_TYPE = ::std::os::raw::c_ulong; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct ck_rsa_pkcs_oaep_params { - pub hashAlg: CK_MECHANISM_TYPE, - pub mgf: CK_RSA_PKCS_MGF_TYPE, - pub source: CK_RSA_PKCS_OAEP_SOURCE_TYPE, - pub pSourceData: *mut ::std::os::raw::c_void, - pub ulSourceDataLen: ::std::os::raw::c_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::(), - 20usize, - concat!("Size of: ", stringify!(ck_rsa_pkcs_oaep_params)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - 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) + stringify!(source) ) ); assert_eq!( @@ -1685,7 +1862,7 @@ fn bindgen_test_layout_ck_rsa_pkcs_oaep_params() { 12usize, concat!( "Offset of field: ", - stringify!(ck_rsa_pkcs_oaep_params), + stringify!(CK_RSA_PKCS_OAEP_PARAMS), "::", stringify!(pSourceData) ) @@ -1695,13 +1872,13 @@ fn bindgen_test_layout_ck_rsa_pkcs_oaep_params() { 16usize, concat!( "Offset of field: ", - stringify!(ck_rsa_pkcs_oaep_params), + stringify!(CK_RSA_PKCS_OAEP_PARAMS), "::", stringify!(ulSourceDataLen) ) ); } -impl Default for ck_rsa_pkcs_oaep_params { +impl Default for CK_RSA_PKCS_OAEP_PARAMS { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { @@ -1710,133 +1887,138 @@ impl Default for ck_rsa_pkcs_oaep_params { } } } +pub type CK_RSA_PKCS_OAEP_PARAMS_PTR = *mut CK_RSA_PKCS_OAEP_PARAMS; #[repr(C)] #[derive(Debug, Default, Copy, Clone)] -pub struct ck_aes_ctr_params { - pub ulCounterBits: ::std::os::raw::c_ulong, - pub cb: [::std::os::raw::c_uchar; 16usize], +pub struct CK_RSA_PKCS_PSS_PARAMS { + pub hashAlg: CK_MECHANISM_TYPE, + pub mgf: CK_RSA_PKCS_MGF_TYPE, + pub sLen: CK_ULONG, } #[test] -fn bindgen_test_layout_ck_aes_ctr_params() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); +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::(), - 20usize, - concat!("Size of: ", stringify!(ck_aes_ctr_params)) + ::std::mem::size_of::(), + 12usize, + concat!("Size of: ", stringify!(CK_RSA_PKCS_PSS_PARAMS)) ); assert_eq!( - ::std::mem::align_of::(), + ::std::mem::align_of::(), 4usize, - concat!("Alignment of ", stringify!(ck_aes_ctr_params)) + concat!("Alignment of ", stringify!(CK_RSA_PKCS_PSS_PARAMS)) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulCounterBits) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).hashAlg) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", - stringify!(ck_aes_ctr_params), + stringify!(CK_RSA_PKCS_PSS_PARAMS), "::", - stringify!(ulCounterBits) + stringify!(hashAlg) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).cb) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).mgf) as usize - ptr as usize }, 4usize, concat!( "Offset of field: ", - stringify!(ck_aes_ctr_params), + stringify!(CK_RSA_PKCS_PSS_PARAMS), "::", - stringify!(cb) + 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) ) ); } +pub type CK_RSA_PKCS_PSS_PARAMS_PTR = *mut CK_RSA_PKCS_PSS_PARAMS; +pub type CK_EC_KDF_TYPE = CK_ULONG; #[repr(C)] #[derive(Debug, Copy, Clone)] -pub struct ck_gcm_params { - pub pIv: *mut ::std::os::raw::c_uchar, - pub ulIvLen: ::std::os::raw::c_ulong, - pub ulIvBits: ::std::os::raw::c_ulong, - pub pAAD: *mut ::std::os::raw::c_uchar, - pub ulAADLen: ::std::os::raw::c_ulong, - pub ulTagBits: ::std::os::raw::c_ulong, +pub struct CK_ECDH1_DERIVE_PARAMS { + pub kdf: CK_EC_KDF_TYPE, + pub ulSharedDataLen: CK_ULONG, + pub pSharedData: CK_BYTE_PTR, + pub ulPublicDataLen: CK_ULONG, + pub pPublicData: CK_BYTE_PTR, } #[test] -fn bindgen_test_layout_ck_gcm_params() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); +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::(), - 24usize, - concat!("Size of: ", stringify!(ck_gcm_params)) + ::std::mem::size_of::(), + 20usize, + concat!("Size of: ", stringify!(CK_ECDH1_DERIVE_PARAMS)) ); assert_eq!( - ::std::mem::align_of::(), + ::std::mem::align_of::(), 4usize, - concat!("Alignment of ", stringify!(ck_gcm_params)) + concat!("Alignment of ", stringify!(CK_ECDH1_DERIVE_PARAMS)) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pIv) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).kdf) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", - stringify!(ck_gcm_params), + stringify!(CK_ECDH1_DERIVE_PARAMS), "::", - stringify!(pIv) + stringify!(kdf) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulIvLen) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ulSharedDataLen) as usize - ptr as usize }, 4usize, concat!( "Offset of field: ", - stringify!(ck_gcm_params), + stringify!(CK_ECDH1_DERIVE_PARAMS), "::", - stringify!(ulIvLen) + stringify!(ulSharedDataLen) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulIvBits) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).pSharedData) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", - stringify!(ck_gcm_params), + stringify!(CK_ECDH1_DERIVE_PARAMS), "::", - stringify!(ulIvBits) + stringify!(pSharedData) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pAAD) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ulPublicDataLen) as usize - ptr as usize }, 12usize, concat!( "Offset of field: ", - stringify!(ck_gcm_params), + stringify!(CK_ECDH1_DERIVE_PARAMS), "::", - stringify!(pAAD) + stringify!(ulPublicDataLen) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulAADLen) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).pPublicData) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", - stringify!(ck_gcm_params), - "::", - stringify!(ulAADLen) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulTagBits) as usize - ptr as usize }, - 20usize, - concat!( - "Offset of field: ", - stringify!(ck_gcm_params), + stringify!(CK_ECDH1_DERIVE_PARAMS), "::", - stringify!(ulTagBits) + stringify!(pPublicData) ) ); } -impl Default for ck_gcm_params { +impl Default for CK_ECDH1_DERIVE_PARAMS { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { @@ -1845,37 +2027,41 @@ impl Default for ck_gcm_params { } } } -pub type ck_ec_kdf_t = ::std::os::raw::c_ulong; +pub type CK_ECDH1_DERIVE_PARAMS_PTR = *mut CK_ECDH1_DERIVE_PARAMS; #[repr(C)] #[derive(Debug, Copy, Clone)] -pub struct ck_ecdh1_derive_params { - pub kdf: ck_ec_kdf_t, - pub ulSharedDataLen: ::std::os::raw::c_ulong, - pub pSharedData: *mut ::std::os::raw::c_uchar, - pub ulPublicDataLen: ::std::os::raw::c_ulong, - pub pPublicData: *mut ::std::os::raw::c_uchar, +pub struct CK_ECDH2_DERIVE_PARAMS { + pub kdf: CK_EC_KDF_TYPE, + pub ulSharedDataLen: CK_ULONG, + pub pSharedData: CK_BYTE_PTR, + pub ulPublicDataLen: CK_ULONG, + pub pPublicData: CK_BYTE_PTR, + pub ulPrivateDataLen: CK_ULONG, + pub hPrivateData: CK_OBJECT_HANDLE, + pub ulPublicDataLen2: CK_ULONG, + pub pPublicData2: CK_BYTE_PTR, } #[test] -fn bindgen_test_layout_ck_ecdh1_derive_params() { - const UNINIT: ::std::mem::MaybeUninit = +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::(), - 20usize, - concat!("Size of: ", stringify!(ck_ecdh1_derive_params)) + ::std::mem::size_of::(), + 36usize, + concat!("Size of: ", stringify!(CK_ECDH2_DERIVE_PARAMS)) ); assert_eq!( - ::std::mem::align_of::(), + ::std::mem::align_of::(), 4usize, - concat!("Alignment of ", stringify!(ck_ecdh1_derive_params)) + 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_ecdh1_derive_params), + stringify!(CK_ECDH2_DERIVE_PARAMS), "::", stringify!(kdf) ) @@ -1885,7 +2071,7 @@ fn bindgen_test_layout_ck_ecdh1_derive_params() { 4usize, concat!( "Offset of field: ", - stringify!(ck_ecdh1_derive_params), + stringify!(CK_ECDH2_DERIVE_PARAMS), "::", stringify!(ulSharedDataLen) ) @@ -1895,7 +2081,7 @@ fn bindgen_test_layout_ck_ecdh1_derive_params() { 8usize, concat!( "Offset of field: ", - stringify!(ck_ecdh1_derive_params), + stringify!(CK_ECDH2_DERIVE_PARAMS), "::", stringify!(pSharedData) ) @@ -1905,7 +2091,7 @@ fn bindgen_test_layout_ck_ecdh1_derive_params() { 12usize, concat!( "Offset of field: ", - stringify!(ck_ecdh1_derive_params), + stringify!(CK_ECDH2_DERIVE_PARAMS), "::", stringify!(ulPublicDataLen) ) @@ -1915,13 +2101,53 @@ fn bindgen_test_layout_ck_ecdh1_derive_params() { 16usize, concat!( "Offset of field: ", - stringify!(ck_ecdh1_derive_params), + stringify!(CK_ECDH2_DERIVE_PARAMS), "::", stringify!(pPublicData) ) ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ulPrivateDataLen) as usize - ptr as usize }, + 20usize, + 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 }, + 24usize, + 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 }, + 28usize, + 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 }, + 32usize, + concat!( + "Offset of field: ", + stringify!(CK_ECDH2_DERIVE_PARAMS), + "::", + stringify!(pPublicData2) + ) + ); } -impl Default for ck_ecdh1_derive_params { +impl Default for CK_ECDH2_DERIVE_PARAMS { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { @@ -1930,49 +2156,138 @@ impl Default for ck_ecdh1_derive_params { } } } +pub type CK_ECDH2_DERIVE_PARAMS_PTR = *mut CK_ECDH2_DERIVE_PARAMS; #[repr(C)] #[derive(Debug, Copy, Clone)] -pub struct ck_key_derivation_string_data { - pub pData: *mut ::std::os::raw::c_uchar, - pub ulLen: ::std::os::raw::c_ulong, +pub struct CK_ECMQV_DERIVE_PARAMS { + pub kdf: CK_EC_KDF_TYPE, + pub ulSharedDataLen: CK_ULONG, + pub pSharedData: CK_BYTE_PTR, + pub ulPublicDataLen: CK_ULONG, + pub pPublicData: CK_BYTE_PTR, + pub ulPrivateDataLen: CK_ULONG, + pub hPrivateData: CK_OBJECT_HANDLE, + pub ulPublicDataLen2: CK_ULONG, + pub pPublicData2: CK_BYTE_PTR, + pub publicKey: CK_OBJECT_HANDLE, } #[test] -fn bindgen_test_layout_ck_key_derivation_string_data() { - const UNINIT: ::std::mem::MaybeUninit = +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::(), - 8usize, - concat!("Size of: ", stringify!(ck_key_derivation_string_data)) + ::std::mem::size_of::(), + 40usize, + concat!("Size of: ", stringify!(CK_ECMQV_DERIVE_PARAMS)) ); assert_eq!( - ::std::mem::align_of::(), + ::std::mem::align_of::(), 4usize, - concat!("Alignment of ", stringify!(ck_key_derivation_string_data)) + concat!("Alignment of ", stringify!(CK_ECMQV_DERIVE_PARAMS)) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pData) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).kdf) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", - stringify!(ck_key_derivation_string_data), + stringify!(CK_ECMQV_DERIVE_PARAMS), "::", - stringify!(pData) + stringify!(kdf) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulLen) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ulSharedDataLen) as usize - ptr as usize }, 4usize, concat!( "Offset of field: ", - stringify!(ck_key_derivation_string_data), + stringify!(CK_ECMQV_DERIVE_PARAMS), "::", - stringify!(ulLen) + 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 }, + 12usize, + 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 }, + 16usize, + 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 }, + 20usize, + 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 }, + 24usize, + 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 }, + 28usize, + 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 }, + 32usize, + 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 }, + 36usize, + concat!( + "Offset of field: ", + stringify!(CK_ECMQV_DERIVE_PARAMS), + "::", + stringify!(publicKey) ) ); } -impl Default for ck_key_derivation_string_data { +impl Default for CK_ECMQV_DERIVE_PARAMS { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { @@ -1981,60 +2296,85 @@ impl Default for ck_key_derivation_string_data { } } } +pub type CK_ECMQV_DERIVE_PARAMS_PTR = *mut CK_ECMQV_DERIVE_PARAMS; +pub type CK_X9_42_DH_KDF_TYPE = CK_ULONG; +pub type CK_X9_42_DH_KDF_TYPE_PTR = *mut CK_X9_42_DH_KDF_TYPE; #[repr(C)] #[derive(Debug, Copy, Clone)] -pub struct ck_des_cbc_encrypt_data_params { - pub iv: [::std::os::raw::c_uchar; 8usize], - pub pData: *mut ::std::os::raw::c_uchar, - pub length: ::std::os::raw::c_ulong, +pub struct CK_X9_42_DH1_DERIVE_PARAMS { + pub kdf: CK_X9_42_DH_KDF_TYPE, + pub ulOtherInfoLen: CK_ULONG, + pub pOtherInfo: CK_BYTE_PTR, + pub ulPublicDataLen: CK_ULONG, + pub pPublicData: CK_BYTE_PTR, } #[test] -fn bindgen_test_layout_ck_des_cbc_encrypt_data_params() { - const UNINIT: ::std::mem::MaybeUninit = +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::(), - 16usize, - concat!("Size of: ", stringify!(ck_des_cbc_encrypt_data_params)) + ::std::mem::size_of::(), + 20usize, + concat!("Size of: ", stringify!(CK_X9_42_DH1_DERIVE_PARAMS)) ); assert_eq!( - ::std::mem::align_of::(), + ::std::mem::align_of::(), 4usize, - concat!("Alignment of ", stringify!(ck_des_cbc_encrypt_data_params)) + concat!("Alignment of ", stringify!(CK_X9_42_DH1_DERIVE_PARAMS)) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).iv) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).kdf) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", - stringify!(ck_des_cbc_encrypt_data_params), + stringify!(CK_X9_42_DH1_DERIVE_PARAMS), "::", - stringify!(iv) + stringify!(kdf) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pData) as usize - ptr as usize }, + 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_des_cbc_encrypt_data_params), + stringify!(CK_X9_42_DH1_DERIVE_PARAMS), "::", - stringify!(pData) + stringify!(pOtherInfo) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).length) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ulPublicDataLen) as usize - ptr as usize }, 12usize, concat!( "Offset of field: ", - stringify!(ck_des_cbc_encrypt_data_params), + stringify!(CK_X9_42_DH1_DERIVE_PARAMS), "::", - stringify!(length) + stringify!(ulPublicDataLen) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pPublicData) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(CK_X9_42_DH1_DERIVE_PARAMS), + "::", + stringify!(pPublicData) ) ); } -impl Default for ck_des_cbc_encrypt_data_params { +impl Default for CK_X9_42_DH1_DERIVE_PARAMS { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { @@ -2043,540 +2383,7363 @@ impl Default for ck_des_cbc_encrypt_data_params { } } } +pub type CK_X9_42_DH1_DERIVE_PARAMS_PTR = *mut CK_X9_42_DH1_DERIVE_PARAMS; #[repr(C)] #[derive(Debug, Copy, Clone)] -pub struct ck_aes_cbc_encrypt_data_params { - pub iv: [::std::os::raw::c_uchar; 16usize], - pub pData: *mut ::std::os::raw::c_uchar, - pub length: ::std::os::raw::c_ulong, +pub struct CK_X9_42_DH2_DERIVE_PARAMS { + pub kdf: CK_X9_42_DH_KDF_TYPE, + pub ulOtherInfoLen: CK_ULONG, + pub pOtherInfo: CK_BYTE_PTR, + pub ulPublicDataLen: CK_ULONG, + pub pPublicData: CK_BYTE_PTR, + pub ulPrivateDataLen: CK_ULONG, + pub hPrivateData: CK_OBJECT_HANDLE, + pub ulPublicDataLen2: CK_ULONG, + pub pPublicData2: CK_BYTE_PTR, } #[test] -fn bindgen_test_layout_ck_aes_cbc_encrypt_data_params() { - const UNINIT: ::std::mem::MaybeUninit = +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::(), - 24usize, - concat!("Size of: ", stringify!(ck_aes_cbc_encrypt_data_params)) + ::std::mem::size_of::(), + 36usize, + concat!("Size of: ", stringify!(CK_X9_42_DH2_DERIVE_PARAMS)) ); assert_eq!( - ::std::mem::align_of::(), + ::std::mem::align_of::(), 4usize, - concat!("Alignment of ", stringify!(ck_aes_cbc_encrypt_data_params)) + concat!("Alignment of ", stringify!(CK_X9_42_DH2_DERIVE_PARAMS)) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).iv) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).kdf) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", - stringify!(ck_aes_cbc_encrypt_data_params), + stringify!(CK_X9_42_DH2_DERIVE_PARAMS), "::", - stringify!(iv) + stringify!(kdf) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pData) as usize - ptr as usize }, + 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 }, + 12usize, + 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 }, 16usize, concat!( "Offset of field: ", - stringify!(ck_aes_cbc_encrypt_data_params), + stringify!(CK_X9_42_DH2_DERIVE_PARAMS), "::", - stringify!(pData) + stringify!(pPublicData) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).length) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ulPrivateDataLen) as usize - ptr as usize }, 20usize, concat!( "Offset of field: ", - stringify!(ck_aes_cbc_encrypt_data_params), + stringify!(CK_X9_42_DH2_DERIVE_PARAMS), "::", - stringify!(length) + stringify!(ulPrivateDataLen) ) ); -} -impl Default for ck_aes_cbc_encrypt_data_params { - fn default() -> Self { - let mut s = ::std::mem::MaybeUninit::::uninit(); - unsafe { - ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).hPrivateData) as usize - ptr as usize }, + 24usize, + 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 }, + 28usize, + 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 }, + 32usize, + concat!( + "Offset of field: ", + stringify!(CK_X9_42_DH2_DERIVE_PARAMS), + "::", + stringify!(pPublicData2) + ) + ); +} +impl Default for CK_X9_42_DH2_DERIVE_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } } } -pub type CK_RV = ::std::os::raw::c_ulong; -pub type CK_NOTIFY = ::std::option::Option< - unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - event: CK_NOTIFICATION, - application: *mut ::std::os::raw::c_void, - ) -> CK_RV, ->; -pub type CK_C_Initialize = - ::std::option::Option CK_RV>; -pub type CK_C_Finalize = - ::std::option::Option CK_RV>; -pub type CK_C_GetInfo = ::std::option::Option CK_RV>; -pub type CK_C_GetFunctionList = ::std::option::Option< - unsafe extern "C" fn(function_list: *mut *mut _CK_FUNCTION_LIST) -> CK_RV, ->; -pub type CK_C_GetSlotList = ::std::option::Option< - unsafe extern "C" fn( - token_present: ::std::os::raw::c_uchar, - slot_list: *mut CK_SLOT_ID, - ulCount: *mut ::std::os::raw::c_ulong, - ) -> CK_RV, ->; -pub type CK_C_GetSlotInfo = ::std::option::Option< - unsafe extern "C" fn(slotID: CK_SLOT_ID, info: *mut _CK_SLOT_INFO) -> CK_RV, ->; -pub type CK_C_GetTokenInfo = ::std::option::Option< - unsafe extern "C" fn(slotID: CK_SLOT_ID, info: *mut _CK_TOKEN_INFO) -> CK_RV, ->; -pub type CK_C_WaitForSlotEvent = ::std::option::Option< - unsafe extern "C" fn( - flags: CK_FLAGS, - slot: *mut CK_SLOT_ID, - pReserved: *mut ::std::os::raw::c_void, - ) -> CK_RV, ->; -pub type CK_C_GetMechanismList = ::std::option::Option< - unsafe extern "C" fn( - slotID: CK_SLOT_ID, - mechanism_list: *mut CK_MECHANISM_TYPE, - ulCount: *mut ::std::os::raw::c_ulong, - ) -> CK_RV, ->; -pub type CK_C_GetMechanismInfo = ::std::option::Option< - unsafe extern "C" fn( - slotID: CK_SLOT_ID, - type_: CK_MECHANISM_TYPE, - info: *mut _CK_MECHANISM_INFO, - ) -> CK_RV, ->; -pub type CK_C_InitToken = ::std::option::Option< - unsafe extern "C" fn( - slotID: CK_SLOT_ID, - pin: *mut ::std::os::raw::c_uchar, - pin_len: ::std::os::raw::c_ulong, - label: *mut ::std::os::raw::c_uchar, - ) -> CK_RV, ->; -pub type CK_C_InitPIN = ::std::option::Option< - unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - pin: *mut ::std::os::raw::c_uchar, - pin_len: ::std::os::raw::c_ulong, - ) -> CK_RV, ->; -pub type CK_C_SetPIN = ::std::option::Option< - unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - old_pin: *mut ::std::os::raw::c_uchar, - old_len: ::std::os::raw::c_ulong, - new_pin: *mut ::std::os::raw::c_uchar, - new_len: ::std::os::raw::c_ulong, - ) -> CK_RV, ->; -pub type CK_C_OpenSession = ::std::option::Option< - unsafe extern "C" fn( - slotID: CK_SLOT_ID, - flags: CK_FLAGS, - application: *mut ::std::os::raw::c_void, - notify: CK_NOTIFY, - session: *mut CK_SESSION_HANDLE, - ) -> CK_RV, ->; -pub type CK_C_CloseSession = - ::std::option::Option CK_RV>; -pub type CK_C_CloseAllSessions = - ::std::option::Option CK_RV>; -pub type CK_C_GetSessionInfo = ::std::option::Option< - unsafe extern "C" fn(session: CK_SESSION_HANDLE, info: *mut _CK_SESSION_INFO) -> CK_RV, ->; -pub type CK_C_GetOperationState = ::std::option::Option< - unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - operation_state: *mut ::std::os::raw::c_uchar, - operation_state_len: *mut ::std::os::raw::c_ulong, - ) -> CK_RV, ->; -pub type CK_C_SetOperationState = ::std::option::Option< - unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - operation_state: *mut ::std::os::raw::c_uchar, - operation_state_len: ::std::os::raw::c_ulong, - encryption_key: CK_OBJECT_HANDLE, - authentiation_key: CK_OBJECT_HANDLE, - ) -> CK_RV, ->; -pub type CK_C_Login = ::std::option::Option< - unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - user_type: CK_USER_TYPE, - pin: *mut ::std::os::raw::c_uchar, - pin_len: ::std::os::raw::c_ulong, - ) -> CK_RV, ->; -pub type CK_C_Logout = - ::std::option::Option CK_RV>; -pub type CK_C_CreateObject = ::std::option::Option< - unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - templ: *mut _CK_ATTRIBUTE, - ulCount: ::std::os::raw::c_ulong, - object: *mut CK_OBJECT_HANDLE, - ) -> CK_RV, ->; -pub type CK_C_CopyObject = ::std::option::Option< - unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - object: CK_OBJECT_HANDLE, - templ: *mut _CK_ATTRIBUTE, - ulCount: ::std::os::raw::c_ulong, - new_object: *mut CK_OBJECT_HANDLE, - ) -> CK_RV, ->; -pub type CK_C_DestroyObject = ::std::option::Option< - unsafe extern "C" fn(session: CK_SESSION_HANDLE, object: CK_OBJECT_HANDLE) -> CK_RV, ->; -pub type CK_C_GetObjectSize = ::std::option::Option< - unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - object: CK_OBJECT_HANDLE, - size: *mut ::std::os::raw::c_ulong, - ) -> CK_RV, ->; -pub type CK_C_GetAttributeValue = ::std::option::Option< - unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - object: CK_OBJECT_HANDLE, - templ: *mut _CK_ATTRIBUTE, - ulCount: ::std::os::raw::c_ulong, - ) -> CK_RV, ->; -pub type CK_C_SetAttributeValue = ::std::option::Option< - unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - object: CK_OBJECT_HANDLE, - templ: *mut _CK_ATTRIBUTE, - ulCount: ::std::os::raw::c_ulong, - ) -> CK_RV, ->; -pub type CK_C_FindObjectsInit = ::std::option::Option< - unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - templ: *mut _CK_ATTRIBUTE, - ulCount: ::std::os::raw::c_ulong, - ) -> CK_RV, ->; -pub type CK_C_FindObjects = ::std::option::Option< - unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - object: *mut CK_OBJECT_HANDLE, - max_object_count: ::std::os::raw::c_ulong, - object_count: *mut ::std::os::raw::c_ulong, - ) -> CK_RV, ->; -pub type CK_C_FindObjectsFinal = - ::std::option::Option CK_RV>; -pub type CK_C_EncryptInit = ::std::option::Option< - unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - key: CK_OBJECT_HANDLE, - ) -> CK_RV, ->; -pub type CK_C_Encrypt = ::std::option::Option< - unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - data: *mut ::std::os::raw::c_uchar, - data_len: ::std::os::raw::c_ulong, - encrypted_data: *mut ::std::os::raw::c_uchar, - encrypted_data_len: *mut ::std::os::raw::c_ulong, - ) -> CK_RV, ->; -pub type CK_C_EncryptUpdate = ::std::option::Option< - unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - part: *mut ::std::os::raw::c_uchar, - part_len: ::std::os::raw::c_ulong, - encrypted_part: *mut ::std::os::raw::c_uchar, - encrypted_part_len: *mut ::std::os::raw::c_ulong, - ) -> CK_RV, ->; -pub type CK_C_EncryptFinal = ::std::option::Option< - unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - last_encrypted_part: *mut ::std::os::raw::c_uchar, - last_encrypted_part_len: *mut ::std::os::raw::c_ulong, - ) -> CK_RV, ->; -pub type CK_C_DecryptInit = ::std::option::Option< - unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - key: CK_OBJECT_HANDLE, - ) -> CK_RV, ->; -pub type CK_C_Decrypt = ::std::option::Option< - unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - encrypted_data: *mut ::std::os::raw::c_uchar, - encrypted_data_len: ::std::os::raw::c_ulong, - data: *mut ::std::os::raw::c_uchar, - data_len: *mut ::std::os::raw::c_ulong, - ) -> CK_RV, ->; -pub type CK_C_DecryptUpdate = ::std::option::Option< - unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - encrypted_part: *mut ::std::os::raw::c_uchar, - encrypted_part_len: ::std::os::raw::c_ulong, - part: *mut ::std::os::raw::c_uchar, - part_len: *mut ::std::os::raw::c_ulong, - ) -> CK_RV, ->; -pub type CK_C_DecryptFinal = ::std::option::Option< - unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - last_part: *mut ::std::os::raw::c_uchar, - last_part_len: *mut ::std::os::raw::c_ulong, - ) -> CK_RV, ->; -pub type CK_C_DigestInit = ::std::option::Option< - unsafe extern "C" fn(session: CK_SESSION_HANDLE, mechanism: *mut _CK_MECHANISM) -> CK_RV, ->; -pub type CK_C_Digest = ::std::option::Option< - unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - data: *mut ::std::os::raw::c_uchar, - data_len: ::std::os::raw::c_ulong, - digest: *mut ::std::os::raw::c_uchar, - digest_len: *mut ::std::os::raw::c_ulong, - ) -> CK_RV, ->; -pub type CK_C_DigestUpdate = ::std::option::Option< - unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - part: *mut ::std::os::raw::c_uchar, - part_len: ::std::os::raw::c_ulong, - ) -> CK_RV, ->; -pub type CK_C_DigestKey = ::std::option::Option< - unsafe extern "C" fn(session: CK_SESSION_HANDLE, key: CK_OBJECT_HANDLE) -> CK_RV, ->; -pub type CK_C_DigestFinal = ::std::option::Option< - unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - digest: *mut ::std::os::raw::c_uchar, - digest_len: *mut ::std::os::raw::c_ulong, - ) -> CK_RV, ->; -pub type CK_C_SignInit = ::std::option::Option< - unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - key: CK_OBJECT_HANDLE, - ) -> CK_RV, ->; -pub type CK_C_Sign = ::std::option::Option< - unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - data: *mut ::std::os::raw::c_uchar, - data_len: ::std::os::raw::c_ulong, - signature: *mut ::std::os::raw::c_uchar, - signature_len: *mut ::std::os::raw::c_ulong, - ) -> CK_RV, ->; -pub type CK_C_SignUpdate = ::std::option::Option< - unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - part: *mut ::std::os::raw::c_uchar, - part_len: ::std::os::raw::c_ulong, - ) -> CK_RV, ->; -pub type CK_C_SignFinal = ::std::option::Option< - unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - signature: *mut ::std::os::raw::c_uchar, - signature_len: *mut ::std::os::raw::c_ulong, - ) -> CK_RV, ->; -pub type CK_C_SignRecoverInit = ::std::option::Option< - unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - key: CK_OBJECT_HANDLE, - ) -> CK_RV, ->; -pub type CK_C_SignRecover = ::std::option::Option< - unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - data: *mut ::std::os::raw::c_uchar, - data_len: ::std::os::raw::c_ulong, - signature: *mut ::std::os::raw::c_uchar, - signature_len: *mut ::std::os::raw::c_ulong, - ) -> CK_RV, ->; -pub type CK_C_VerifyInit = ::std::option::Option< - unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - key: CK_OBJECT_HANDLE, - ) -> CK_RV, ->; -pub type CK_C_Verify = ::std::option::Option< - unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - data: *mut ::std::os::raw::c_uchar, - data_len: ::std::os::raw::c_ulong, - signature: *mut ::std::os::raw::c_uchar, - signature_len: ::std::os::raw::c_ulong, - ) -> CK_RV, ->; -pub type CK_C_VerifyUpdate = ::std::option::Option< - unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - part: *mut ::std::os::raw::c_uchar, - part_len: ::std::os::raw::c_ulong, - ) -> CK_RV, ->; -pub type CK_C_VerifyFinal = ::std::option::Option< - unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - signature: *mut ::std::os::raw::c_uchar, - signature_len: ::std::os::raw::c_ulong, - ) -> CK_RV, ->; -pub type CK_C_VerifyRecoverInit = ::std::option::Option< - unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - key: CK_OBJECT_HANDLE, - ) -> CK_RV, ->; -pub type CK_C_VerifyRecover = ::std::option::Option< - unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - signature: *mut ::std::os::raw::c_uchar, - signature_len: ::std::os::raw::c_ulong, - data: *mut ::std::os::raw::c_uchar, - data_len: *mut ::std::os::raw::c_ulong, - ) -> CK_RV, ->; -pub type CK_C_DigestEncryptUpdate = ::std::option::Option< - unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - part: *mut ::std::os::raw::c_uchar, - part_len: ::std::os::raw::c_ulong, - encrypted_part: *mut ::std::os::raw::c_uchar, - encrypted_part_len: *mut ::std::os::raw::c_ulong, - ) -> CK_RV, ->; -pub type CK_C_DecryptDigestUpdate = ::std::option::Option< - unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - encrypted_part: *mut ::std::os::raw::c_uchar, - encrypted_part_len: ::std::os::raw::c_ulong, - part: *mut ::std::os::raw::c_uchar, - part_len: *mut ::std::os::raw::c_ulong, - ) -> CK_RV, ->; -pub type CK_C_SignEncryptUpdate = ::std::option::Option< - unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - part: *mut ::std::os::raw::c_uchar, - part_len: ::std::os::raw::c_ulong, - encrypted_part: *mut ::std::os::raw::c_uchar, - encrypted_part_len: *mut ::std::os::raw::c_ulong, - ) -> CK_RV, ->; -pub type CK_C_DecryptVerifyUpdate = ::std::option::Option< - unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - encrypted_part: *mut ::std::os::raw::c_uchar, - encrypted_part_len: ::std::os::raw::c_ulong, - part: *mut ::std::os::raw::c_uchar, - part_len: *mut ::std::os::raw::c_ulong, - ) -> CK_RV, ->; -pub type CK_C_GenerateKey = ::std::option::Option< - unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - templ: *mut _CK_ATTRIBUTE, - ulCount: ::std::os::raw::c_ulong, - key: *mut CK_OBJECT_HANDLE, - ) -> CK_RV, ->; -pub type CK_C_GenerateKeyPair = ::std::option::Option< - unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - public_key_template: *mut _CK_ATTRIBUTE, - public_key_attribute_count: ::std::os::raw::c_ulong, - private_key_template: *mut _CK_ATTRIBUTE, - private_key_attribute_count: ::std::os::raw::c_ulong, - public_key: *mut CK_OBJECT_HANDLE, - private_key: *mut CK_OBJECT_HANDLE, - ) -> CK_RV, ->; -pub type CK_C_WrapKey = ::std::option::Option< - unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - wrapping_key: CK_OBJECT_HANDLE, - key: CK_OBJECT_HANDLE, - wrapped_key: *mut ::std::os::raw::c_uchar, - wrapped_key_len: *mut ::std::os::raw::c_ulong, - ) -> CK_RV, ->; -pub type CK_C_UnwrapKey = ::std::option::Option< - unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - unwrapping_key: CK_OBJECT_HANDLE, - wrapped_key: *mut ::std::os::raw::c_uchar, - wrapped_key_len: ::std::os::raw::c_ulong, - templ: *mut _CK_ATTRIBUTE, - attribute_count: ::std::os::raw::c_ulong, - key: *mut CK_OBJECT_HANDLE, - ) -> CK_RV, ->; +pub type CK_X9_42_DH2_DERIVE_PARAMS_PTR = *mut CK_X9_42_DH2_DERIVE_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_X9_42_MQV_DERIVE_PARAMS { + pub kdf: CK_X9_42_DH_KDF_TYPE, + pub ulOtherInfoLen: CK_ULONG, + pub pOtherInfo: CK_BYTE_PTR, + pub ulPublicDataLen: CK_ULONG, + pub pPublicData: CK_BYTE_PTR, + pub ulPrivateDataLen: CK_ULONG, + pub hPrivateData: CK_OBJECT_HANDLE, + pub ulPublicDataLen2: CK_ULONG, + 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::(), + 40usize, + concat!("Size of: ", stringify!(CK_X9_42_MQV_DERIVE_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + 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 }, + 12usize, + 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 }, + 16usize, + 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 }, + 20usize, + 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 }, + 24usize, + 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 }, + 28usize, + 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 }, + 32usize, + 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 }, + 36usize, + concat!( + "Offset of field: ", + stringify!(CK_X9_42_MQV_DERIVE_PARAMS), + "::", + stringify!(publicKey) + ) + ); +} +impl Default for CK_X9_42_MQV_DERIVE_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_X9_42_MQV_DERIVE_PARAMS_PTR = *mut CK_X9_42_MQV_DERIVE_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_KEA_DERIVE_PARAMS { + pub isSender: CK_BBOOL, + pub ulRandomLen: CK_ULONG, + pub pRandomA: CK_BYTE_PTR, + pub pRandomB: CK_BYTE_PTR, + 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::(), + 24usize, + concat!("Size of: ", stringify!(CK_KEA_DERIVE_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + 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 }, + 4usize, + 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 }, + 8usize, + 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 }, + 12usize, + 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 }, + 16usize, + 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 }, + 20usize, + concat!( + "Offset of field: ", + stringify!(CK_KEA_DERIVE_PARAMS), + "::", + stringify!(pPublicData) + ) + ); +} +impl Default for CK_KEA_DERIVE_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_KEA_DERIVE_PARAMS_PTR = *mut CK_KEA_DERIVE_PARAMS; +pub type CK_RC2_PARAMS = CK_ULONG; +pub type CK_RC2_PARAMS_PTR = *mut CK_RC2_PARAMS; +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +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::(), + 4usize, + 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) + ) + ); +} +pub type CK_RC2_CBC_PARAMS_PTR = *mut CK_RC2_CBC_PARAMS; +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +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::(), + 4usize, + 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) + ) + ); +} +pub type CK_RC2_MAC_GENERAL_PARAMS_PTR = *mut CK_RC2_MAC_GENERAL_PARAMS; +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +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::(), + 4usize, + 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) + ) + ); +} +pub type CK_RC5_PARAMS_PTR = *mut CK_RC5_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_RC5_CBC_PARAMS { + pub ulWordsize: CK_ULONG, + pub ulRounds: CK_ULONG, + 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::(), + 16usize, + concat!("Size of: ", stringify!(CK_RC5_CBC_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + 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 }, + 12usize, + concat!( + "Offset of field: ", + stringify!(CK_RC5_CBC_PARAMS), + "::", + stringify!(ulIvLen) + ) + ); +} +impl Default for CK_RC5_CBC_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_RC5_CBC_PARAMS_PTR = *mut CK_RC5_CBC_PARAMS; +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct CK_RC5_MAC_GENERAL_PARAMS { + pub ulWordsize: CK_ULONG, + 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::(), + 4usize, + 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) + ) + ); +} +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; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_DES_CBC_ENCRYPT_DATA_PARAMS { + pub iv: [CK_BYTE; 8usize], + 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::(), + 16usize, + concat!("Size of: ", stringify!(CK_DES_CBC_ENCRYPT_DATA_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + 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 }, + 12usize, + concat!( + "Offset of field: ", + stringify!(CK_DES_CBC_ENCRYPT_DATA_PARAMS), + "::", + stringify!(length) + ) + ); +} +impl Default for CK_DES_CBC_ENCRYPT_DATA_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_DES_CBC_ENCRYPT_DATA_PARAMS_PTR = *mut CK_DES_CBC_ENCRYPT_DATA_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_AES_CBC_ENCRYPT_DATA_PARAMS { + pub iv: [CK_BYTE; 16usize], + 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::(), + 24usize, + concat!("Size of: ", stringify!(CK_AES_CBC_ENCRYPT_DATA_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + 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 }, + 20usize, + concat!( + "Offset of field: ", + stringify!(CK_AES_CBC_ENCRYPT_DATA_PARAMS), + "::", + stringify!(length) + ) + ); +} +impl Default for CK_AES_CBC_ENCRYPT_DATA_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_AES_CBC_ENCRYPT_DATA_PARAMS_PTR = *mut CK_AES_CBC_ENCRYPT_DATA_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_SKIPJACK_PRIVATE_WRAP_PARAMS { + pub ulPasswordLen: CK_ULONG, + pub pPassword: CK_BYTE_PTR, + pub ulPublicDataLen: CK_ULONG, + pub pPublicData: CK_BYTE_PTR, + pub ulPAndGLen: CK_ULONG, + pub ulQLen: CK_ULONG, + pub ulRandomLen: CK_ULONG, + pub pRandomA: CK_BYTE_PTR, + pub pPrimeP: CK_BYTE_PTR, + 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::(), + 44usize, + concat!("Size of: ", stringify!(CK_SKIPJACK_PRIVATE_WRAP_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + 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 }, + 8usize, + 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 }, + 12usize, + 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 }, + 16usize, + 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 }, + 20usize, + 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 }, + 24usize, + 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 }, + 28usize, + 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 }, + 32usize, + 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 }, + 36usize, + 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 }, + 40usize, + concat!( + "Offset of field: ", + stringify!(CK_SKIPJACK_PRIVATE_WRAP_PARAMS), + "::", + stringify!(pSubprimeQ) + ) + ); +} +impl Default for CK_SKIPJACK_PRIVATE_WRAP_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_SKIPJACK_PRIVATE_WRAP_PARAMS_PTR = *mut CK_SKIPJACK_PRIVATE_WRAP_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_SKIPJACK_RELAYX_PARAMS { + pub ulOldWrappedXLen: CK_ULONG, + pub pOldWrappedX: CK_BYTE_PTR, + pub ulOldPasswordLen: CK_ULONG, + pub pOldPassword: CK_BYTE_PTR, + pub ulOldPublicDataLen: CK_ULONG, + pub pOldPublicData: CK_BYTE_PTR, + pub ulOldRandomLen: CK_ULONG, + pub pOldRandomA: CK_BYTE_PTR, + pub ulNewPasswordLen: CK_ULONG, + pub pNewPassword: CK_BYTE_PTR, + pub ulNewPublicDataLen: CK_ULONG, + pub pNewPublicData: CK_BYTE_PTR, + 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::(), + 56usize, + concat!("Size of: ", stringify!(CK_SKIPJACK_RELAYX_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + 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 }, + 8usize, + 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 }, + 12usize, + 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 }, + 16usize, + 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 }, + 20usize, + 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 }, + 24usize, + 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 }, + 28usize, + 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 }, + 32usize, + 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 }, + 36usize, + 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 }, + 40usize, + 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 }, + 44usize, + 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 }, + 48usize, + 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 }, + 52usize, + concat!( + "Offset of field: ", + stringify!(CK_SKIPJACK_RELAYX_PARAMS), + "::", + stringify!(pNewRandomA) + ) + ); +} +impl Default for CK_SKIPJACK_RELAYX_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_SKIPJACK_RELAYX_PARAMS_PTR = *mut CK_SKIPJACK_RELAYX_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_PBE_PARAMS { + pub pInitVector: CK_BYTE_PTR, + pub pPassword: CK_UTF8CHAR_PTR, + pub ulPasswordLen: CK_ULONG, + pub pSalt: CK_BYTE_PTR, + 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::(), + 24usize, + concat!("Size of: ", stringify!(CK_PBE_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + 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 }, + 4usize, + concat!( + "Offset of field: ", + stringify!(CK_PBE_PARAMS), + "::", + stringify!(pPassword) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ulPasswordLen) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(CK_PBE_PARAMS), + "::", + stringify!(ulPasswordLen) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pSalt) as usize - ptr as usize }, + 12usize, + concat!( + "Offset of field: ", + stringify!(CK_PBE_PARAMS), + "::", + stringify!(pSalt) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ulSaltLen) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(CK_PBE_PARAMS), + "::", + stringify!(ulSaltLen) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ulIteration) as usize - ptr as usize }, + 20usize, + concat!( + "Offset of field: ", + stringify!(CK_PBE_PARAMS), + "::", + stringify!(ulIteration) + ) + ); +} +impl Default for CK_PBE_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_PBE_PARAMS_PTR = *mut CK_PBE_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_KEY_WRAP_SET_OAEP_PARAMS { + pub bBC: CK_BYTE, + 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::(), + 12usize, + concat!("Size of: ", stringify!(CK_KEY_WRAP_SET_OAEP_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + 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 }, + 4usize, + 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 }, + 8usize, + concat!( + "Offset of field: ", + stringify!(CK_KEY_WRAP_SET_OAEP_PARAMS), + "::", + stringify!(ulXLen) + ) + ); +} +impl Default for CK_KEY_WRAP_SET_OAEP_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_KEY_WRAP_SET_OAEP_PARAMS_PTR = *mut CK_KEY_WRAP_SET_OAEP_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_SSL3_RANDOM_DATA { + pub pClientRandom: CK_BYTE_PTR, + pub ulClientRandomLen: CK_ULONG, + 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::(), + 16usize, + concat!("Size of: ", stringify!(CK_SSL3_RANDOM_DATA)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + 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 }, + 4usize, + 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 }, + 8usize, + 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 }, + 12usize, + concat!( + "Offset of field: ", + stringify!(CK_SSL3_RANDOM_DATA), + "::", + stringify!(ulServerRandomLen) + ) + ); +} +impl Default for CK_SSL3_RANDOM_DATA { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct 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::(), + 20usize, + concat!("Size of: ", stringify!(CK_SSL3_MASTER_KEY_DERIVE_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + 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 }, + 16usize, + concat!( + "Offset of field: ", + stringify!(CK_SSL3_MASTER_KEY_DERIVE_PARAMS), + "::", + stringify!(pVersion) + ) + ); +} +impl Default for CK_SSL3_MASTER_KEY_DERIVE_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_SSL3_MASTER_KEY_DERIVE_PARAMS_PTR = *mut CK_SSL3_MASTER_KEY_DERIVE_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_SSL3_KEY_MAT_OUT { + pub hClientMacSecret: CK_OBJECT_HANDLE, + pub hServerMacSecret: CK_OBJECT_HANDLE, + pub hClientKey: CK_OBJECT_HANDLE, + pub hServerKey: CK_OBJECT_HANDLE, + 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::(), + 24usize, + concat!("Size of: ", stringify!(CK_SSL3_KEY_MAT_OUT)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + 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 }, + 20usize, + concat!( + "Offset of field: ", + stringify!(CK_SSL3_KEY_MAT_OUT), + "::", + stringify!(pIVServer) + ) + ); +} +impl Default for CK_SSL3_KEY_MAT_OUT { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_SSL3_KEY_MAT_OUT_PTR = *mut CK_SSL3_KEY_MAT_OUT; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_SSL3_KEY_MAT_PARAMS { + pub ulMacSizeInBits: CK_ULONG, + pub ulKeySizeInBits: CK_ULONG, + pub ulIVSizeInBits: CK_ULONG, + pub bIsExport: CK_BBOOL, + 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::(), + 36usize, + concat!("Size of: ", stringify!(CK_SSL3_KEY_MAT_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + 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 }, + 16usize, + 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 }, + 32usize, + concat!( + "Offset of field: ", + stringify!(CK_SSL3_KEY_MAT_PARAMS), + "::", + stringify!(pReturnedKeyMaterial) + ) + ); +} +impl Default for CK_SSL3_KEY_MAT_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_SSL3_KEY_MAT_PARAMS_PTR = *mut CK_SSL3_KEY_MAT_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_TLS_PRF_PARAMS { + pub pSeed: CK_BYTE_PTR, + pub ulSeedLen: CK_ULONG, + pub pLabel: CK_BYTE_PTR, + pub ulLabelLen: CK_ULONG, + 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::(), + 24usize, + concat!("Size of: ", stringify!(CK_TLS_PRF_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + 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 }, + 4usize, + 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 }, + 8usize, + 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 }, + 12usize, + 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 }, + 16usize, + 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 }, + 20usize, + concat!( + "Offset of field: ", + stringify!(CK_TLS_PRF_PARAMS), + "::", + stringify!(pulOutputLen) + ) + ); +} +impl Default for CK_TLS_PRF_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_TLS_PRF_PARAMS_PTR = *mut CK_TLS_PRF_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_WTLS_RANDOM_DATA { + pub pClientRandom: CK_BYTE_PTR, + pub ulClientRandomLen: CK_ULONG, + 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::(), + 16usize, + concat!("Size of: ", stringify!(CK_WTLS_RANDOM_DATA)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + 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 }, + 4usize, + 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 }, + 8usize, + 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 }, + 12usize, + concat!( + "Offset of field: ", + stringify!(CK_WTLS_RANDOM_DATA), + "::", + stringify!(ulServerRandomLen) + ) + ); +} +impl Default for CK_WTLS_RANDOM_DATA { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_WTLS_RANDOM_DATA_PTR = *mut CK_WTLS_RANDOM_DATA; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_WTLS_MASTER_KEY_DERIVE_PARAMS { + pub DigestMechanism: CK_MECHANISM_TYPE, + 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::(), + 24usize, + concat!("Size of: ", stringify!(CK_WTLS_MASTER_KEY_DERIVE_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + 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 }, + 20usize, + concat!( + "Offset of field: ", + stringify!(CK_WTLS_MASTER_KEY_DERIVE_PARAMS), + "::", + stringify!(pVersion) + ) + ); +} +impl Default for CK_WTLS_MASTER_KEY_DERIVE_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_WTLS_MASTER_KEY_DERIVE_PARAMS_PTR = *mut CK_WTLS_MASTER_KEY_DERIVE_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_WTLS_PRF_PARAMS { + pub DigestMechanism: CK_MECHANISM_TYPE, + pub pSeed: CK_BYTE_PTR, + pub ulSeedLen: CK_ULONG, + pub pLabel: CK_BYTE_PTR, + pub ulLabelLen: CK_ULONG, + 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::(), + 28usize, + concat!("Size of: ", stringify!(CK_WTLS_PRF_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + 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 }, + 8usize, + 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 }, + 12usize, + 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 }, + 16usize, + 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 }, + 20usize, + 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 }, + 24usize, + concat!( + "Offset of field: ", + stringify!(CK_WTLS_PRF_PARAMS), + "::", + stringify!(pulOutputLen) + ) + ); +} +impl Default for CK_WTLS_PRF_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_WTLS_PRF_PARAMS_PTR = *mut CK_WTLS_PRF_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_WTLS_KEY_MAT_OUT { + pub hMacSecret: CK_OBJECT_HANDLE, + 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::(), + 12usize, + concat!("Size of: ", stringify!(CK_WTLS_KEY_MAT_OUT)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + 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) + ) + ); +} +impl Default for CK_WTLS_KEY_MAT_OUT { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_WTLS_KEY_MAT_OUT_PTR = *mut CK_WTLS_KEY_MAT_OUT; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_WTLS_KEY_MAT_PARAMS { + pub DigestMechanism: CK_MECHANISM_TYPE, + pub ulMacSizeInBits: CK_ULONG, + pub ulKeySizeInBits: CK_ULONG, + pub ulIVSizeInBits: CK_ULONG, + pub ulSequenceNumber: CK_ULONG, + pub bIsExport: CK_BBOOL, + 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::(), + 44usize, + concat!("Size of: ", stringify!(CK_WTLS_KEY_MAT_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + 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 }, + 24usize, + 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 }, + 40usize, + concat!( + "Offset of field: ", + stringify!(CK_WTLS_KEY_MAT_PARAMS), + "::", + stringify!(pReturnedKeyMaterial) + ) + ); +} +impl Default for CK_WTLS_KEY_MAT_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_WTLS_KEY_MAT_PARAMS_PTR = *mut CK_WTLS_KEY_MAT_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_CMS_SIG_PARAMS { + pub certificateHandle: CK_OBJECT_HANDLE, + pub pSigningMechanism: CK_MECHANISM_PTR, + pub pDigestMechanism: CK_MECHANISM_PTR, + pub pContentType: CK_UTF8CHAR_PTR, + pub pRequestedAttributes: CK_BYTE_PTR, + pub ulRequestedAttributesLen: CK_ULONG, + 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::(), + 32usize, + concat!("Size of: ", stringify!(CK_CMS_SIG_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + 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 }, + 8usize, + 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 }, + 12usize, + 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 }, + 16usize, + 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 }, + 20usize, + 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 }, + 24usize, + 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 }, + 28usize, + concat!( + "Offset of field: ", + stringify!(CK_CMS_SIG_PARAMS), + "::", + stringify!(ulRequiredAttributesLen) + ) + ); +} +impl Default for CK_CMS_SIG_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_CMS_SIG_PARAMS_PTR = *mut CK_CMS_SIG_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +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::(), + 8usize, + concat!("Size of: ", stringify!(CK_KEY_DERIVATION_STRING_DATA)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + 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 }, + 4usize, + concat!( + "Offset of field: ", + stringify!(CK_KEY_DERIVATION_STRING_DATA), + "::", + stringify!(ulLen) + ) + ); +} +impl Default for CK_KEY_DERIVATION_STRING_DATA { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_KEY_DERIVATION_STRING_DATA_PTR = *mut CK_KEY_DERIVATION_STRING_DATA; +pub type CK_EXTRACT_PARAMS = CK_ULONG; +pub type CK_EXTRACT_PARAMS_PTR = *mut CK_EXTRACT_PARAMS; +pub type CK_PKCS5_PBKD2_PSEUDO_RANDOM_FUNCTION_TYPE = CK_ULONG; +pub type CK_PKCS5_PBKD2_PSEUDO_RANDOM_FUNCTION_TYPE_PTR = + *mut CK_PKCS5_PBKD2_PSEUDO_RANDOM_FUNCTION_TYPE; +pub type CK_PKCS5_PBKDF2_SALT_SOURCE_TYPE = CK_ULONG; +pub type CK_PKCS5_PBKDF2_SALT_SOURCE_TYPE_PTR = *mut CK_PKCS5_PBKDF2_SALT_SOURCE_TYPE; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_PKCS5_PBKD2_PARAMS { + pub saltSource: CK_PKCS5_PBKDF2_SALT_SOURCE_TYPE, + pub pSaltSourceData: CK_VOID_PTR, + pub ulSaltSourceDataLen: CK_ULONG, + pub iterations: CK_ULONG, + pub prf: CK_PKCS5_PBKD2_PSEUDO_RANDOM_FUNCTION_TYPE, + pub pPrfData: CK_VOID_PTR, + pub ulPrfDataLen: CK_ULONG, + 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::(), + 36usize, + concat!("Size of: ", stringify!(CK_PKCS5_PBKD2_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + 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 }, + 8usize, + 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 }, + 12usize, + 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 }, + 16usize, + 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 }, + 20usize, + 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 }, + 24usize, + 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 }, + 28usize, + 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 }, + 32usize, + concat!( + "Offset of field: ", + stringify!(CK_PKCS5_PBKD2_PARAMS), + "::", + stringify!(ulPasswordLen) + ) + ); +} +impl Default for CK_PKCS5_PBKD2_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_PKCS5_PBKD2_PARAMS_PTR = *mut CK_PKCS5_PBKD2_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_PKCS5_PBKD2_PARAMS2 { + pub saltSource: CK_PKCS5_PBKDF2_SALT_SOURCE_TYPE, + pub pSaltSourceData: CK_VOID_PTR, + pub ulSaltSourceDataLen: CK_ULONG, + pub iterations: CK_ULONG, + pub prf: CK_PKCS5_PBKD2_PSEUDO_RANDOM_FUNCTION_TYPE, + pub pPrfData: CK_VOID_PTR, + pub ulPrfDataLen: CK_ULONG, + 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::(), + 36usize, + concat!("Size of: ", stringify!(CK_PKCS5_PBKD2_PARAMS2)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + 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 }, + 8usize, + 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 }, + 12usize, + 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 }, + 16usize, + 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 }, + 20usize, + 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 }, + 24usize, + 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 }, + 28usize, + 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 }, + 32usize, + concat!( + "Offset of field: ", + stringify!(CK_PKCS5_PBKD2_PARAMS2), + "::", + stringify!(ulPasswordLen) + ) + ); +} +impl Default for CK_PKCS5_PBKD2_PARAMS2 { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_PKCS5_PBKD2_PARAMS2_PTR = *mut CK_PKCS5_PBKD2_PARAMS2; +pub type CK_OTP_PARAM_TYPE = CK_ULONG; +pub type CK_PARAM_TYPE = CK_OTP_PARAM_TYPE; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_OTP_PARAM { + pub type_: CK_OTP_PARAM_TYPE, + 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::(), + 12usize, + concat!("Size of: ", stringify!(CK_OTP_PARAM)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + 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 }, + 8usize, + concat!( + "Offset of field: ", + stringify!(CK_OTP_PARAM), + "::", + stringify!(ulValueLen) + ) + ); +} +impl Default for CK_OTP_PARAM { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_OTP_PARAM_PTR = *mut CK_OTP_PARAM; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +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::(), + 8usize, + concat!("Size of: ", stringify!(CK_OTP_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + 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 }, + 4usize, + concat!( + "Offset of field: ", + stringify!(CK_OTP_PARAMS), + "::", + stringify!(ulCount) + ) + ); +} +impl Default for CK_OTP_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_OTP_PARAMS_PTR = *mut CK_OTP_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +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::(), + 8usize, + concat!("Size of: ", stringify!(CK_OTP_SIGNATURE_INFO)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + 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 }, + 4usize, + concat!( + "Offset of field: ", + stringify!(CK_OTP_SIGNATURE_INFO), + "::", + stringify!(ulCount) + ) + ); +} +impl Default for CK_OTP_SIGNATURE_INFO { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_OTP_SIGNATURE_INFO_PTR = *mut CK_OTP_SIGNATURE_INFO; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_KIP_PARAMS { + pub pMechanism: CK_MECHANISM_PTR, + pub hKey: CK_OBJECT_HANDLE, + 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::(), + 16usize, + concat!("Size of: ", stringify!(CK_KIP_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + 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 }, + 4usize, + concat!( + "Offset of field: ", + stringify!(CK_KIP_PARAMS), + "::", + stringify!(hKey) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pSeed) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(CK_KIP_PARAMS), + "::", + stringify!(pSeed) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ulSeedLen) as usize - ptr as usize }, + 12usize, + concat!( + "Offset of field: ", + stringify!(CK_KIP_PARAMS), + "::", + stringify!(ulSeedLen) + ) + ); +} +impl Default for CK_KIP_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_KIP_PARAMS_PTR = *mut CK_KIP_PARAMS; +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +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::(), + 4usize, + 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) + ) + ); +} +pub type CK_AES_CTR_PARAMS_PTR = *mut CK_AES_CTR_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_GCM_PARAMS { + pub pIv: CK_BYTE_PTR, + pub ulIvLen: CK_ULONG, + pub ulIvBits: CK_ULONG, + pub pAAD: CK_BYTE_PTR, + 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::(), + 24usize, + concat!("Size of: ", stringify!(CK_GCM_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + 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 }, + 4usize, + concat!( + "Offset of field: ", + stringify!(CK_GCM_PARAMS), + "::", + stringify!(ulIvLen) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ulIvBits) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(CK_GCM_PARAMS), + "::", + stringify!(ulIvBits) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pAAD) as usize - ptr as usize }, + 12usize, + concat!( + "Offset of field: ", + stringify!(CK_GCM_PARAMS), + "::", + stringify!(pAAD) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ulAADLen) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(CK_GCM_PARAMS), + "::", + stringify!(ulAADLen) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ulTagBits) as usize - ptr as usize }, + 20usize, + concat!( + "Offset of field: ", + stringify!(CK_GCM_PARAMS), + "::", + stringify!(ulTagBits) + ) + ); +} +impl Default for CK_GCM_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_GCM_PARAMS_PTR = *mut CK_GCM_PARAMS; +pub type CK_GENERATOR_FUNCTION = CK_ULONG; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_GCM_MESSAGE_PARAMS { + pub pIv: CK_BYTE_PTR, + pub ulIvLen: CK_ULONG, + pub ulIvFixedBits: CK_ULONG, + pub ivGenerator: CK_GENERATOR_FUNCTION, + 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::(), + 24usize, + concat!("Size of: ", stringify!(CK_GCM_MESSAGE_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + 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 }, + 4usize, + 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 }, + 8usize, + 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 }, + 12usize, + 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 }, + 16usize, + 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 }, + 20usize, + concat!( + "Offset of field: ", + stringify!(CK_GCM_MESSAGE_PARAMS), + "::", + stringify!(ulTagBits) + ) + ); +} +impl Default for CK_GCM_MESSAGE_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_GCM_MESSAGE_PARAMS_PTR = CK_GCM_MESSAGE_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_CCM_PARAMS { + pub ulDataLen: CK_ULONG, + pub pNonce: CK_BYTE_PTR, + pub ulNonceLen: CK_ULONG, + pub pAAD: CK_BYTE_PTR, + 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::(), + 24usize, + concat!("Size of: ", stringify!(CK_CCM_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + 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 }, + 8usize, + concat!( + "Offset of field: ", + stringify!(CK_CCM_PARAMS), + "::", + stringify!(ulNonceLen) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pAAD) as usize - ptr as usize }, + 12usize, + concat!( + "Offset of field: ", + stringify!(CK_CCM_PARAMS), + "::", + stringify!(pAAD) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ulAADLen) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(CK_CCM_PARAMS), + "::", + stringify!(ulAADLen) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ulMACLen) as usize - ptr as usize }, + 20usize, + concat!( + "Offset of field: ", + stringify!(CK_CCM_PARAMS), + "::", + stringify!(ulMACLen) + ) + ); +} +impl Default for CK_CCM_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_CCM_PARAMS_PTR = *mut CK_CCM_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_CCM_MESSAGE_PARAMS { + pub ulDataLen: CK_ULONG, + pub pNonce: CK_BYTE_PTR, + pub ulNonceLen: CK_ULONG, + pub ulNonceFixedBits: CK_ULONG, + pub nonceGenerator: CK_GENERATOR_FUNCTION, + 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::(), + 28usize, + concat!("Size of: ", stringify!(CK_CCM_MESSAGE_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + 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 }, + 8usize, + 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 }, + 12usize, + 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 }, + 16usize, + 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 }, + 20usize, + 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 }, + 24usize, + concat!( + "Offset of field: ", + stringify!(CK_CCM_MESSAGE_PARAMS), + "::", + stringify!(ulMACLen) + ) + ); +} +impl Default for CK_CCM_MESSAGE_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_CCM_MESSAGE_PARAMS_PTR = CK_CCM_MESSAGE_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_AES_GCM_PARAMS { + pub pIv: CK_BYTE_PTR, + pub ulIvLen: CK_ULONG, + pub ulIvBits: CK_ULONG, + pub pAAD: CK_BYTE_PTR, + 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::(), + 24usize, + concat!("Size of: ", stringify!(CK_AES_GCM_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + 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 }, + 4usize, + 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 }, + 8usize, + 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 }, + 12usize, + 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 }, + 16usize, + 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 }, + 20usize, + concat!( + "Offset of field: ", + stringify!(CK_AES_GCM_PARAMS), + "::", + stringify!(ulTagBits) + ) + ); +} +impl Default for CK_AES_GCM_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_AES_GCM_PARAMS_PTR = *mut CK_AES_GCM_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_AES_CCM_PARAMS { + pub ulDataLen: CK_ULONG, + pub pNonce: CK_BYTE_PTR, + pub ulNonceLen: CK_ULONG, + pub pAAD: CK_BYTE_PTR, + 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::(), + 24usize, + concat!("Size of: ", stringify!(CK_AES_CCM_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + 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 }, + 8usize, + 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 }, + 12usize, + 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 }, + 16usize, + 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 }, + 20usize, + concat!( + "Offset of field: ", + stringify!(CK_AES_CCM_PARAMS), + "::", + stringify!(ulMACLen) + ) + ); +} +impl Default for CK_AES_CCM_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_AES_CCM_PARAMS_PTR = *mut CK_AES_CCM_PARAMS; +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +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::(), + 4usize, + 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) + ) + ); +} +pub type CK_CAMELLIA_CTR_PARAMS_PTR = *mut CK_CAMELLIA_CTR_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_CAMELLIA_CBC_ENCRYPT_DATA_PARAMS { + pub iv: [CK_BYTE; 16usize], + 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::(), + 24usize, + concat!("Size of: ", stringify!(CK_CAMELLIA_CBC_ENCRYPT_DATA_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + 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 }, + 20usize, + concat!( + "Offset of field: ", + stringify!(CK_CAMELLIA_CBC_ENCRYPT_DATA_PARAMS), + "::", + stringify!(length) + ) + ); +} +impl Default for CK_CAMELLIA_CBC_ENCRYPT_DATA_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_CAMELLIA_CBC_ENCRYPT_DATA_PARAMS_PTR = *mut CK_CAMELLIA_CBC_ENCRYPT_DATA_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_ARIA_CBC_ENCRYPT_DATA_PARAMS { + pub iv: [CK_BYTE; 16usize], + 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::(), + 24usize, + concat!("Size of: ", stringify!(CK_ARIA_CBC_ENCRYPT_DATA_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + 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 }, + 20usize, + concat!( + "Offset of field: ", + stringify!(CK_ARIA_CBC_ENCRYPT_DATA_PARAMS), + "::", + stringify!(length) + ) + ); +} +impl Default for CK_ARIA_CBC_ENCRYPT_DATA_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_ARIA_CBC_ENCRYPT_DATA_PARAMS_PTR = *mut CK_ARIA_CBC_ENCRYPT_DATA_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_DSA_PARAMETER_GEN_PARAM { + pub hash: CK_MECHANISM_TYPE, + pub pSeed: CK_BYTE_PTR, + 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::(), + 16usize, + concat!("Size of: ", stringify!(CK_DSA_PARAMETER_GEN_PARAM)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + 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 }, + 8usize, + 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 }, + 12usize, + concat!( + "Offset of field: ", + stringify!(CK_DSA_PARAMETER_GEN_PARAM), + "::", + stringify!(ulIndex) + ) + ); +} +impl Default for CK_DSA_PARAMETER_GEN_PARAM { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_DSA_PARAMETER_GEN_PARAM_PTR = *mut CK_DSA_PARAMETER_GEN_PARAM; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_ECDH_AES_KEY_WRAP_PARAMS { + pub ulAESKeyBits: CK_ULONG, + pub kdf: CK_EC_KDF_TYPE, + 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::(), + 16usize, + concat!("Size of: ", stringify!(CK_ECDH_AES_KEY_WRAP_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + 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) + ) + ); +} +impl Default for CK_ECDH_AES_KEY_WRAP_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_ECDH_AES_KEY_WRAP_PARAMS_PTR = *mut CK_ECDH_AES_KEY_WRAP_PARAMS; +pub type CK_JAVA_MIDP_SECURITY_DOMAIN = CK_ULONG; +pub type CK_CERTIFICATE_CATEGORY = CK_ULONG; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +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::(), + 8usize, + concat!("Size of: ", stringify!(CK_RSA_AES_KEY_WRAP_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + 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) + ) + ); +} +impl Default for CK_RSA_AES_KEY_WRAP_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_RSA_AES_KEY_WRAP_PARAMS_PTR = *mut CK_RSA_AES_KEY_WRAP_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_TLS12_MASTER_KEY_DERIVE_PARAMS { + pub RandomInfo: CK_SSL3_RANDOM_DATA, + 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::(), + 24usize, + concat!("Size of: ", stringify!(CK_TLS12_MASTER_KEY_DERIVE_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + 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 }, + 16usize, + 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 }, + 20usize, + concat!( + "Offset of field: ", + stringify!(CK_TLS12_MASTER_KEY_DERIVE_PARAMS), + "::", + stringify!(prfHashMechanism) + ) + ); +} +impl Default for CK_TLS12_MASTER_KEY_DERIVE_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_TLS12_MASTER_KEY_DERIVE_PARAMS_PTR = *mut CK_TLS12_MASTER_KEY_DERIVE_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_TLS12_KEY_MAT_PARAMS { + pub ulMacSizeInBits: CK_ULONG, + pub ulKeySizeInBits: CK_ULONG, + pub ulIVSizeInBits: CK_ULONG, + pub bIsExport: CK_BBOOL, + pub RandomInfo: CK_SSL3_RANDOM_DATA, + 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::(), + 40usize, + concat!("Size of: ", stringify!(CK_TLS12_KEY_MAT_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + 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 }, + 16usize, + 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 }, + 32usize, + 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 }, + 36usize, + concat!( + "Offset of field: ", + stringify!(CK_TLS12_KEY_MAT_PARAMS), + "::", + stringify!(prfHashMechanism) + ) + ); +} +impl Default for CK_TLS12_KEY_MAT_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_TLS12_KEY_MAT_PARAMS_PTR = *mut CK_TLS12_KEY_MAT_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_TLS_KDF_PARAMS { + pub prfMechanism: CK_MECHANISM_TYPE, + pub pLabel: CK_BYTE_PTR, + pub ulLabelLength: CK_ULONG, + pub RandomInfo: CK_SSL3_RANDOM_DATA, + 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::(), + 36usize, + concat!("Size of: ", stringify!(CK_TLS_KDF_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + 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 }, + 8usize, + 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 }, + 12usize, + 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 }, + 28usize, + 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 }, + 32usize, + concat!( + "Offset of field: ", + stringify!(CK_TLS_KDF_PARAMS), + "::", + stringify!(ulContextDataLength) + ) + ); +} +impl Default for CK_TLS_KDF_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_TLS_KDF_PARAMS_PTR = *mut CK_TLS_KDF_PARAMS; +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct CK_TLS_MAC_PARAMS { + pub prfHashMechanism: CK_MECHANISM_TYPE, + 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::(), + 4usize, + 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) + ) + ); +} +pub type CK_TLS_MAC_PARAMS_PTR = *mut CK_TLS_MAC_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_GOSTR3410_DERIVE_PARAMS { + pub kdf: CK_EC_KDF_TYPE, + pub pPublicData: CK_BYTE_PTR, + pub ulPublicDataLen: CK_ULONG, + 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::(), + 20usize, + concat!("Size of: ", stringify!(CK_GOSTR3410_DERIVE_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + 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 }, + 8usize, + 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 }, + 12usize, + 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 }, + 16usize, + concat!( + "Offset of field: ", + stringify!(CK_GOSTR3410_DERIVE_PARAMS), + "::", + stringify!(ulUKMLen) + ) + ); +} +impl Default for CK_GOSTR3410_DERIVE_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_GOSTR3410_DERIVE_PARAMS_PTR = *mut CK_GOSTR3410_DERIVE_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_GOSTR3410_KEY_WRAP_PARAMS { + pub pWrapOID: CK_BYTE_PTR, + pub ulWrapOIDLen: CK_ULONG, + pub pUKM: CK_BYTE_PTR, + 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::(), + 20usize, + concat!("Size of: ", stringify!(CK_GOSTR3410_KEY_WRAP_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + 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 }, + 4usize, + 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 }, + 8usize, + 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 }, + 12usize, + 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 }, + 16usize, + concat!( + "Offset of field: ", + stringify!(CK_GOSTR3410_KEY_WRAP_PARAMS), + "::", + stringify!(hKey) + ) + ); +} +impl Default for CK_GOSTR3410_KEY_WRAP_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_GOSTR3410_KEY_WRAP_PARAMS_PTR = *mut CK_GOSTR3410_KEY_WRAP_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_SEED_CBC_ENCRYPT_DATA_PARAMS { + pub iv: [CK_BYTE; 16usize], + 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::(), + 24usize, + concat!("Size of: ", stringify!(CK_SEED_CBC_ENCRYPT_DATA_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + 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 }, + 20usize, + concat!( + "Offset of field: ", + stringify!(CK_SEED_CBC_ENCRYPT_DATA_PARAMS), + "::", + stringify!(length) + ) + ); +} +impl Default for CK_SEED_CBC_ENCRYPT_DATA_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_SEED_CBC_ENCRYPT_DATA_PARAMS_PTR = *mut CK_SEED_CBC_ENCRYPT_DATA_PARAMS; +pub type CK_PROFILE_ID = CK_ULONG; +pub type CK_PRF_DATA_TYPE = CK_ULONG; +pub type CK_SP800_108_PRF_TYPE = CK_MECHANISM_TYPE; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_PRF_DATA_PARAM { + pub type_: CK_PRF_DATA_TYPE, + 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::(), + 12usize, + concat!("Size of: ", stringify!(CK_PRF_DATA_PARAM)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + 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 }, + 8usize, + concat!( + "Offset of field: ", + stringify!(CK_PRF_DATA_PARAM), + "::", + stringify!(ulValueLen) + ) + ); +} +impl Default for CK_PRF_DATA_PARAM { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_PRF_DATA_PARAM_PTR = *mut CK_PRF_DATA_PARAM; +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +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::(), + 8usize, + concat!("Size of: ", stringify!(CK_SP800_108_COUNTER_FORMAT)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + 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 }, + 4usize, + concat!( + "Offset of field: ", + stringify!(CK_SP800_108_COUNTER_FORMAT), + "::", + stringify!(ulWidthInBits) + ) + ); +} +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)] +#[derive(Debug, Default, Copy, Clone)] +pub struct CK_SP800_108_DKM_LENGTH_FORMAT { + pub dkmLengthMethod: CK_SP800_108_DKM_LENGTH_METHOD, + 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::(), + 12usize, + concat!("Size of: ", stringify!(CK_SP800_108_DKM_LENGTH_FORMAT)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + 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 }, + 8usize, + concat!( + "Offset of field: ", + stringify!(CK_SP800_108_DKM_LENGTH_FORMAT), + "::", + stringify!(ulWidthInBits) + ) + ); +} +pub type CK_SP800_108_DKM_LENGTH_FORMAT_PTR = *mut CK_SP800_108_DKM_LENGTH_FORMAT; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_DERIVED_KEY { + pub pTemplate: CK_ATTRIBUTE_PTR, + 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::(), + 12usize, + concat!("Size of: ", stringify!(CK_DERIVED_KEY)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + 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 }, + 4usize, + concat!( + "Offset of field: ", + stringify!(CK_DERIVED_KEY), + "::", + stringify!(ulAttributeCount) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).phKey) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(CK_DERIVED_KEY), + "::", + stringify!(phKey) + ) + ); +} +impl Default for CK_DERIVED_KEY { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_DERIVED_KEY_PTR = *mut CK_DERIVED_KEY; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_SP800_108_KDF_PARAMS { + pub prfType: CK_SP800_108_PRF_TYPE, + pub ulNumberOfDataParams: CK_ULONG, + pub pDataParams: CK_PRF_DATA_PARAM_PTR, + pub ulAdditionalDerivedKeys: CK_ULONG, + pub pAdditionalDerivedKeys: CK_DERIVED_KEY, +} +#[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::(), + 4usize, + 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 }, + 12usize, + 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 }, + 16usize, + concat!( + "Offset of field: ", + stringify!(CK_SP800_108_KDF_PARAMS), + "::", + stringify!(pAdditionalDerivedKeys) + ) + ); +} +impl Default for CK_SP800_108_KDF_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_SP800_108_KDF_PARAMS_PTR = *mut CK_SP800_108_KDF_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_SP800_108_FEEDBACK_KDF_PARAMS { + pub prfType: CK_SP800_108_PRF_TYPE, + pub ulNumberOfDataParams: CK_ULONG, + pub pDataParams: CK_PRF_DATA_PARAM_PTR, + pub ulIVLen: CK_ULONG, + pub pIV: CK_BYTE_PTR, + pub ulAdditionalDerivedKeys: CK_ULONG, + pub pAdditionalDerivedKeys: CK_DERIVED_KEY, +} +#[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::(), + 36usize, + concat!("Size of: ", stringify!(CK_SP800_108_FEEDBACK_KDF_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + 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 }, + 12usize, + 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 }, + 16usize, + 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 }, + 20usize, + 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 }, + 24usize, + concat!( + "Offset of field: ", + stringify!(CK_SP800_108_FEEDBACK_KDF_PARAMS), + "::", + stringify!(pAdditionalDerivedKeys) + ) + ); +} +impl Default for CK_SP800_108_FEEDBACK_KDF_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_SP800_108_FEEDBACK_KDF_PARAMS_PTR = *mut CK_SP800_108_FEEDBACK_KDF_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_EDDSA_PARAMS { + pub phFlag: CK_BBOOL, + 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::(), + 12usize, + concat!("Size of: ", stringify!(CK_EDDSA_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + 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 }, + 4usize, + concat!( + "Offset of field: ", + stringify!(CK_EDDSA_PARAMS), + "::", + stringify!(ulContextDataLen) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pContextData) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(CK_EDDSA_PARAMS), + "::", + stringify!(pContextData) + ) + ); +} +impl Default for CK_EDDSA_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_EDDSA_PARAMS_PTR = *mut CK_EDDSA_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_CHACHA20_PARAMS { + pub pBlockCounter: CK_BYTE_PTR, + pub blockCounterBits: CK_ULONG, + 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::(), + 16usize, + concat!("Size of: ", stringify!(CK_CHACHA20_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + 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 }, + 4usize, + concat!( + "Offset of field: ", + stringify!(CK_CHACHA20_PARAMS), + "::", + stringify!(blockCounterBits) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pNonce) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(CK_CHACHA20_PARAMS), + "::", + stringify!(pNonce) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ulNonceBits) as usize - ptr as usize }, + 12usize, + concat!( + "Offset of field: ", + stringify!(CK_CHACHA20_PARAMS), + "::", + stringify!(ulNonceBits) + ) + ); +} +impl Default for CK_CHACHA20_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_SALSA20_PARAMS { + pub pBlockCounter: CK_BYTE_PTR, + 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::(), + 12usize, + concat!("Size of: ", stringify!(CK_SALSA20_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + 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 }, + 4usize, + concat!( + "Offset of field: ", + stringify!(CK_SALSA20_PARAMS), + "::", + stringify!(pNonce) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ulNonceBits) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(CK_SALSA20_PARAMS), + "::", + stringify!(ulNonceBits) + ) + ); +} +impl Default for CK_SALSA20_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_SALSA20_CHACHA20_POLY1305_PARAMS { + pub pNonce: CK_BYTE_PTR, + pub ulNonceLen: CK_ULONG, + 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::(), + 16usize, + concat!("Size of: ", stringify!(CK_SALSA20_CHACHA20_POLY1305_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + 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 }, + 4usize, + 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 }, + 8usize, + 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 }, + 12usize, + concat!( + "Offset of field: ", + stringify!(CK_SALSA20_CHACHA20_POLY1305_PARAMS), + "::", + stringify!(ulAADLen) + ) + ); +} +impl Default for CK_SALSA20_CHACHA20_POLY1305_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_SALSA20_CHACHA20_POLY1305_PARAMS_PTR = *mut CK_SALSA20_CHACHA20_POLY1305_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_SALSA20_CHACHA20_POLY1305_MSG_PARAMS { + pub pNonce: CK_BYTE_PTR, + 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::(), + 12usize, + concat!( + "Size of: ", + stringify!(CK_SALSA20_CHACHA20_POLY1305_MSG_PARAMS) + ) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + 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 }, + 4usize, + 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 }, + 8usize, + concat!( + "Offset of field: ", + stringify!(CK_SALSA20_CHACHA20_POLY1305_MSG_PARAMS), + "::", + stringify!(pTag) + ) + ); +} +impl Default for CK_SALSA20_CHACHA20_POLY1305_MSG_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_SALSA20_CHACHA20_POLY1305_MSG_PARAMS_PTR = *mut CK_SALSA20_CHACHA20_POLY1305_MSG_PARAMS; +pub type CK_X3DH_KDF_TYPE = CK_ULONG; +pub type CK_X3DH_KDF_TYPE_PTR = *mut CK_X3DH_KDF_TYPE; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_X3DH_INITIATE_PARAMS { + pub kdf: CK_X3DH_KDF_TYPE, + pub pPeer_identity: CK_OBJECT_HANDLE, + pub pPeer_prekey: CK_OBJECT_HANDLE, + pub pPrekey_signature: CK_BYTE_PTR, + pub pOnetime_key: CK_BYTE_PTR, + 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::(), + 28usize, + concat!("Size of: ", stringify!(CK_X3DH_INITIATE_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + 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 }, + 16usize, + 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 }, + 20usize, + 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 }, + 24usize, + concat!( + "Offset of field: ", + stringify!(CK_X3DH_INITIATE_PARAMS), + "::", + stringify!(pOwn_ephemeral) + ) + ); +} +impl Default for CK_X3DH_INITIATE_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_X3DH_RESPOND_PARAMS { + pub kdf: CK_X3DH_KDF_TYPE, + pub pIdentity_id: CK_BYTE_PTR, + pub pPrekey_id: CK_BYTE_PTR, + pub pOnetime_id: CK_BYTE_PTR, + 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::(), + 24usize, + concat!("Size of: ", stringify!(CK_X3DH_RESPOND_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + 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 }, + 8usize, + 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 }, + 12usize, + 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 }, + 16usize, + 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 }, + 20usize, + concat!( + "Offset of field: ", + stringify!(CK_X3DH_RESPOND_PARAMS), + "::", + stringify!(pInitiator_ephemeral) + ) + ); +} +impl Default for CK_X3DH_RESPOND_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_X2RATCHET_KDF_TYPE = CK_ULONG; +pub type CK_X2RATCHET_KDF_TYPE_PTR = *mut CK_X2RATCHET_KDF_TYPE; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_X2RATCHET_INITIALIZE_PARAMS { + pub sk: CK_BYTE_PTR, + pub peer_public_prekey: CK_OBJECT_HANDLE, + pub peer_public_identity: CK_OBJECT_HANDLE, + pub own_public_identity: CK_OBJECT_HANDLE, + pub bEncryptedHeader: CK_BBOOL, + pub eCurve: CK_ULONG, + 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::(), + 32usize, + concat!("Size of: ", stringify!(CK_X2RATCHET_INITIALIZE_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + 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 }, + 4usize, + 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 }, + 8usize, + 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 }, + 12usize, + 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 }, + 16usize, + 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 }, + 20usize, + 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 }, + 24usize, + 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 }, + 28usize, + concat!( + "Offset of field: ", + stringify!(CK_X2RATCHET_INITIALIZE_PARAMS), + "::", + stringify!(kdfMechanism) + ) + ); +} +impl Default for CK_X2RATCHET_INITIALIZE_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_X2RATCHET_INITIALIZE_PARAMS_PTR = *mut CK_X2RATCHET_INITIALIZE_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_X2RATCHET_RESPOND_PARAMS { + pub sk: CK_BYTE_PTR, + pub own_prekey: CK_OBJECT_HANDLE, + pub initiator_identity: CK_OBJECT_HANDLE, + pub own_public_identity: CK_OBJECT_HANDLE, + pub bEncryptedHeader: CK_BBOOL, + pub eCurve: CK_ULONG, + 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::(), + 32usize, + concat!("Size of: ", stringify!(CK_X2RATCHET_RESPOND_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + 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 }, + 4usize, + 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 }, + 8usize, + 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 }, + 12usize, + 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 }, + 16usize, + 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 }, + 20usize, + 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 }, + 24usize, + 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 }, + 28usize, + concat!( + "Offset of field: ", + stringify!(CK_X2RATCHET_RESPOND_PARAMS), + "::", + stringify!(kdfMechanism) + ) + ); +} +impl Default for CK_X2RATCHET_RESPOND_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_X2RATCHET_RESPOND_PARAMS_PTR = *mut CK_X2RATCHET_RESPOND_PARAMS; +pub type CK_XEDDSA_HASH_TYPE = CK_ULONG; +pub type CK_XEDDSA_HASH_TYPE_PTR = *mut CK_XEDDSA_HASH_TYPE; +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +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::(), + 4usize, + 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) + ) + ); +} +pub type CK_XEDDSA_PARAMS_PTR = *mut CK_XEDDSA_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_HKDF_PARAMS { + pub bExtract: CK_BBOOL, + pub bExpand: CK_BBOOL, + pub prfHashMechanism: CK_MECHANISM_TYPE, + pub ulSaltType: CK_ULONG, + pub pSalt: CK_BYTE_PTR, + pub ulSaltLen: CK_ULONG, + pub hSaltKey: CK_ULONG, + 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::(), + 32usize, + concat!("Size of: ", stringify!(CK_HKDF_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + 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 }, + 4usize, + concat!( + "Offset of field: ", + stringify!(CK_HKDF_PARAMS), + "::", + stringify!(prfHashMechanism) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ulSaltType) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(CK_HKDF_PARAMS), + "::", + stringify!(ulSaltType) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pSalt) as usize - ptr as usize }, + 12usize, + concat!( + "Offset of field: ", + stringify!(CK_HKDF_PARAMS), + "::", + stringify!(pSalt) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ulSaltLen) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(CK_HKDF_PARAMS), + "::", + stringify!(ulSaltLen) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).hSaltKey) as usize - ptr as usize }, + 20usize, + concat!( + "Offset of field: ", + stringify!(CK_HKDF_PARAMS), + "::", + stringify!(hSaltKey) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pInfo) as usize - ptr as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(CK_HKDF_PARAMS), + "::", + stringify!(pInfo) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ulInfoLen) as usize - ptr as usize }, + 28usize, + concat!( + "Offset of field: ", + stringify!(CK_HKDF_PARAMS), + "::", + stringify!(ulInfoLen) + ) + ); +} +impl Default for CK_HKDF_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_C_Initialize = + ::std::option::Option CK_RV>; +pub type CK_C_Finalize = + ::std::option::Option CK_RV>; +pub type CK_C_GetInfo = ::std::option::Option CK_RV>; +pub type CK_C_GetFunctionList = + ::std::option::Option CK_RV>; +pub type CK_C_GetSlotList = ::std::option::Option< + unsafe extern "C" fn( + tokenPresent: CK_BBOOL, + pSlotList: CK_SLOT_ID_PTR, + pulCount: CK_ULONG_PTR, + ) -> CK_RV, +>; +pub type CK_C_GetSlotInfo = ::std::option::Option< + unsafe extern "C" fn(slotID: CK_SLOT_ID, pInfo: CK_SLOT_INFO_PTR) -> CK_RV, +>; +pub type CK_C_GetTokenInfo = ::std::option::Option< + unsafe extern "C" fn(slotID: CK_SLOT_ID, pInfo: CK_TOKEN_INFO_PTR) -> CK_RV, +>; +pub type CK_C_GetMechanismList = ::std::option::Option< + unsafe extern "C" fn( + slotID: CK_SLOT_ID, + pMechanismList: CK_MECHANISM_TYPE_PTR, + pulCount: CK_ULONG_PTR, + ) -> CK_RV, +>; +pub type CK_C_GetMechanismInfo = ::std::option::Option< + unsafe extern "C" fn( + slotID: CK_SLOT_ID, + type_: CK_MECHANISM_TYPE, + pInfo: CK_MECHANISM_INFO_PTR, + ) -> CK_RV, +>; +pub type CK_C_InitToken = ::std::option::Option< + unsafe extern "C" fn( + slotID: CK_SLOT_ID, + pPin: CK_UTF8CHAR_PTR, + ulPinLen: CK_ULONG, + pLabel: CK_UTF8CHAR_PTR, + ) -> CK_RV, +>; +pub type CK_C_InitPIN = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pPin: CK_UTF8CHAR_PTR, + ulPinLen: CK_ULONG, + ) -> CK_RV, +>; +pub type CK_C_SetPIN = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pOldPin: CK_UTF8CHAR_PTR, + ulOldLen: CK_ULONG, + pNewPin: CK_UTF8CHAR_PTR, + ulNewLen: CK_ULONG, + ) -> CK_RV, +>; +pub type CK_C_OpenSession = ::std::option::Option< + unsafe extern "C" fn( + slotID: CK_SLOT_ID, + flags: CK_FLAGS, + pApplication: CK_VOID_PTR, + Notify: CK_NOTIFY, + phSession: CK_SESSION_HANDLE_PTR, + ) -> CK_RV, +>; +pub type CK_C_CloseSession = + ::std::option::Option CK_RV>; +pub type CK_C_CloseAllSessions = + ::std::option::Option CK_RV>; +pub type CK_C_GetSessionInfo = ::std::option::Option< + unsafe extern "C" fn(hSession: CK_SESSION_HANDLE, pInfo: CK_SESSION_INFO_PTR) -> CK_RV, +>; +pub type CK_C_GetOperationState = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pOperationState: CK_BYTE_PTR, + pulOperationStateLen: CK_ULONG_PTR, + ) -> CK_RV, +>; +pub type CK_C_SetOperationState = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pOperationState: CK_BYTE_PTR, + ulOperationStateLen: CK_ULONG, + hEncryptionKey: CK_OBJECT_HANDLE, + hAuthenticationKey: CK_OBJECT_HANDLE, + ) -> CK_RV, +>; +pub type CK_C_Login = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + userType: CK_USER_TYPE, + pPin: CK_UTF8CHAR_PTR, + ulPinLen: CK_ULONG, + ) -> CK_RV, +>; +pub type CK_C_Logout = + ::std::option::Option CK_RV>; +pub type CK_C_CreateObject = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pTemplate: CK_ATTRIBUTE_PTR, + ulCount: CK_ULONG, + phObject: CK_OBJECT_HANDLE_PTR, + ) -> CK_RV, +>; +pub type CK_C_CopyObject = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + hObject: CK_OBJECT_HANDLE, + pTemplate: CK_ATTRIBUTE_PTR, + ulCount: CK_ULONG, + phNewObject: CK_OBJECT_HANDLE_PTR, + ) -> CK_RV, +>; +pub type CK_C_DestroyObject = ::std::option::Option< + unsafe extern "C" fn(hSession: CK_SESSION_HANDLE, hObject: CK_OBJECT_HANDLE) -> CK_RV, +>; +pub type CK_C_GetObjectSize = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + hObject: CK_OBJECT_HANDLE, + pulSize: CK_ULONG_PTR, + ) -> CK_RV, +>; +pub type CK_C_GetAttributeValue = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + hObject: CK_OBJECT_HANDLE, + pTemplate: CK_ATTRIBUTE_PTR, + ulCount: CK_ULONG, + ) -> CK_RV, +>; +pub type CK_C_SetAttributeValue = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + hObject: CK_OBJECT_HANDLE, + pTemplate: CK_ATTRIBUTE_PTR, + ulCount: CK_ULONG, + ) -> CK_RV, +>; +pub type CK_C_FindObjectsInit = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pTemplate: CK_ATTRIBUTE_PTR, + ulCount: CK_ULONG, + ) -> CK_RV, +>; +pub type CK_C_FindObjects = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + phObject: CK_OBJECT_HANDLE_PTR, + ulMaxObjectCount: CK_ULONG, + pulObjectCount: CK_ULONG_PTR, + ) -> CK_RV, +>; +pub type CK_C_FindObjectsFinal = + ::std::option::Option CK_RV>; +pub type CK_C_EncryptInit = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, + ) -> CK_RV, +>; +pub type CK_C_Encrypt = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pEncryptedData: CK_BYTE_PTR, + pulEncryptedDataLen: CK_ULONG_PTR, + ) -> CK_RV, +>; +pub type CK_C_EncryptUpdate = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pPart: CK_BYTE_PTR, + ulPartLen: CK_ULONG, + pEncryptedPart: CK_BYTE_PTR, + pulEncryptedPartLen: CK_ULONG_PTR, + ) -> CK_RV, +>; +pub type CK_C_EncryptFinal = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pLastEncryptedPart: CK_BYTE_PTR, + pulLastEncryptedPartLen: CK_ULONG_PTR, + ) -> CK_RV, +>; +pub type CK_C_DecryptInit = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, + ) -> CK_RV, +>; +pub type CK_C_Decrypt = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pEncryptedData: CK_BYTE_PTR, + ulEncryptedDataLen: CK_ULONG, + pData: CK_BYTE_PTR, + pulDataLen: CK_ULONG_PTR, + ) -> CK_RV, +>; +pub type CK_C_DecryptUpdate = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pEncryptedPart: CK_BYTE_PTR, + ulEncryptedPartLen: CK_ULONG, + pPart: CK_BYTE_PTR, + pulPartLen: CK_ULONG_PTR, + ) -> CK_RV, +>; +pub type CK_C_DecryptFinal = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pLastPart: CK_BYTE_PTR, + pulLastPartLen: CK_ULONG_PTR, + ) -> CK_RV, +>; +pub type CK_C_DigestInit = ::std::option::Option< + unsafe extern "C" fn(hSession: CK_SESSION_HANDLE, pMechanism: CK_MECHANISM_PTR) -> CK_RV, +>; +pub type CK_C_Digest = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pDigest: CK_BYTE_PTR, + pulDigestLen: CK_ULONG_PTR, + ) -> CK_RV, +>; +pub type CK_C_DigestUpdate = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pPart: CK_BYTE_PTR, + ulPartLen: CK_ULONG, + ) -> CK_RV, +>; +pub type CK_C_DigestKey = ::std::option::Option< + unsafe extern "C" fn(hSession: CK_SESSION_HANDLE, hKey: CK_OBJECT_HANDLE) -> CK_RV, +>; +pub type CK_C_DigestFinal = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pDigest: CK_BYTE_PTR, + pulDigestLen: CK_ULONG_PTR, + ) -> CK_RV, +>; +pub type CK_C_SignInit = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, + ) -> CK_RV, +>; +pub type CK_C_Sign = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + pulSignatureLen: CK_ULONG_PTR, + ) -> CK_RV, +>; +pub type CK_C_SignUpdate = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pPart: CK_BYTE_PTR, + ulPartLen: CK_ULONG, + ) -> CK_RV, +>; +pub type CK_C_SignFinal = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pSignature: CK_BYTE_PTR, + pulSignatureLen: CK_ULONG_PTR, + ) -> CK_RV, +>; +pub type CK_C_SignRecoverInit = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, + ) -> CK_RV, +>; +pub type CK_C_SignRecover = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + pulSignatureLen: CK_ULONG_PTR, + ) -> CK_RV, +>; +pub type CK_C_VerifyInit = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, + ) -> CK_RV, +>; +pub type CK_C_Verify = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + ulSignatureLen: CK_ULONG, + ) -> CK_RV, +>; +pub type CK_C_VerifyUpdate = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pPart: CK_BYTE_PTR, + ulPartLen: CK_ULONG, + ) -> CK_RV, +>; +pub type CK_C_VerifyFinal = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pSignature: CK_BYTE_PTR, + ulSignatureLen: CK_ULONG, + ) -> CK_RV, +>; +pub type CK_C_VerifyRecoverInit = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, + ) -> CK_RV, +>; +pub type CK_C_VerifyRecover = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pSignature: CK_BYTE_PTR, + ulSignatureLen: CK_ULONG, + pData: CK_BYTE_PTR, + pulDataLen: CK_ULONG_PTR, + ) -> CK_RV, +>; +pub type CK_C_DigestEncryptUpdate = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pPart: CK_BYTE_PTR, + ulPartLen: CK_ULONG, + pEncryptedPart: CK_BYTE_PTR, + pulEncryptedPartLen: CK_ULONG_PTR, + ) -> CK_RV, +>; +pub type CK_C_DecryptDigestUpdate = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pEncryptedPart: CK_BYTE_PTR, + ulEncryptedPartLen: CK_ULONG, + pPart: CK_BYTE_PTR, + pulPartLen: CK_ULONG_PTR, + ) -> CK_RV, +>; +pub type CK_C_SignEncryptUpdate = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pPart: CK_BYTE_PTR, + ulPartLen: CK_ULONG, + pEncryptedPart: CK_BYTE_PTR, + pulEncryptedPartLen: CK_ULONG_PTR, + ) -> CK_RV, +>; +pub type CK_C_DecryptVerifyUpdate = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pEncryptedPart: CK_BYTE_PTR, + ulEncryptedPartLen: CK_ULONG, + pPart: CK_BYTE_PTR, + pulPartLen: CK_ULONG_PTR, + ) -> CK_RV, +>; +pub type CK_C_GenerateKey = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + pTemplate: CK_ATTRIBUTE_PTR, + ulCount: CK_ULONG, + phKey: CK_OBJECT_HANDLE_PTR, + ) -> CK_RV, +>; +pub type CK_C_GenerateKeyPair = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + pPublicKeyTemplate: CK_ATTRIBUTE_PTR, + ulPublicKeyAttributeCount: CK_ULONG, + pPrivateKeyTemplate: CK_ATTRIBUTE_PTR, + ulPrivateKeyAttributeCount: CK_ULONG, + phPublicKey: CK_OBJECT_HANDLE_PTR, + phPrivateKey: CK_OBJECT_HANDLE_PTR, + ) -> CK_RV, +>; +pub type CK_C_WrapKey = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hWrappingKey: CK_OBJECT_HANDLE, + hKey: CK_OBJECT_HANDLE, + pWrappedKey: CK_BYTE_PTR, + pulWrappedKeyLen: CK_ULONG_PTR, + ) -> CK_RV, +>; +pub type CK_C_UnwrapKey = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hUnwrappingKey: CK_OBJECT_HANDLE, + pWrappedKey: CK_BYTE_PTR, + ulWrappedKeyLen: CK_ULONG, + pTemplate: CK_ATTRIBUTE_PTR, + ulAttributeCount: CK_ULONG, + phKey: CK_OBJECT_HANDLE_PTR, + ) -> CK_RV, +>; pub type CK_C_DeriveKey = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - base_key: CK_OBJECT_HANDLE, - templ: *mut _CK_ATTRIBUTE, - attribute_count: ::std::os::raw::c_ulong, - key: *mut CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hBaseKey: CK_OBJECT_HANDLE, + pTemplate: CK_ATTRIBUTE_PTR, + ulAttributeCount: CK_ULONG, + phKey: CK_OBJECT_HANDLE_PTR, ) -> CK_RV, >; pub type CK_C_SeedRandom = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - seed: *mut ::std::os::raw::c_uchar, - seed_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pSeed: CK_BYTE_PTR, + ulSeedLen: CK_ULONG, ) -> CK_RV, >; pub type CK_C_GenerateRandom = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - random_data: *mut ::std::os::raw::c_uchar, - random_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + RandomData: CK_BYTE_PTR, + ulRandomLen: CK_ULONG, ) -> CK_RV, >; pub type CK_C_GetFunctionStatus = - ::std::option::Option CK_RV>; + ::std::option::Option CK_RV>; pub type CK_C_CancelFunction = - ::std::option::Option CK_RV>; + ::std::option::Option CK_RV>; +pub type CK_C_WaitForSlotEvent = ::std::option::Option< + unsafe extern "C" fn(flags: CK_FLAGS, pSlot: CK_SLOT_ID_PTR, pRserved: CK_VOID_PTR) -> CK_RV, +>; +pub type CK_C_GetInterfaceList = ::std::option::Option< + unsafe extern "C" fn(pInterfacesList: CK_INTERFACE_PTR, pulCount: CK_ULONG_PTR) -> CK_RV, +>; +pub type CK_C_GetInterface = ::std::option::Option< + unsafe extern "C" fn( + pInterfaceName: CK_UTF8CHAR_PTR, + pVersion: CK_VERSION_PTR, + ppInterface: CK_INTERFACE_PTR_PTR, + flags: CK_FLAGS, + ) -> CK_RV, +>; +pub type CK_C_LoginUser = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + userType: CK_USER_TYPE, + pPin: CK_UTF8CHAR_PTR, + ulPinLen: CK_ULONG, + pUsername: CK_UTF8CHAR_PTR, + ulUsernameLen: CK_ULONG, + ) -> CK_RV, +>; +pub type CK_C_SessionCancel = ::std::option::Option< + unsafe extern "C" fn(hSession: CK_SESSION_HANDLE, flags: CK_FLAGS) -> CK_RV, +>; +pub type CK_C_MessageEncryptInit = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, + ) -> CK_RV, +>; +pub type CK_C_EncryptMessage = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pAssociatedData: CK_BYTE_PTR, + ulAssociatedDataLen: CK_ULONG, + pPlaintext: CK_BYTE_PTR, + ulPlaintextLen: CK_ULONG, + pCiphertext: CK_BYTE_PTR, + pulCiphertextLen: CK_ULONG_PTR, + ) -> CK_RV, +>; +pub type CK_C_EncryptMessageBegin = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pAssociatedData: CK_BYTE_PTR, + ulAssociatedDataLen: CK_ULONG, + ) -> CK_RV, +>; +pub type CK_C_EncryptMessageNext = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pPlaintextPart: CK_BYTE_PTR, + ulPlaintextPartLen: CK_ULONG, + pCiphertextPart: CK_BYTE_PTR, + pulCiphertextPartLen: CK_ULONG_PTR, + flags: CK_FLAGS, + ) -> CK_RV, +>; +pub type CK_C_MessageEncryptFinal = + ::std::option::Option CK_RV>; +pub type CK_C_MessageDecryptInit = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, + ) -> CK_RV, +>; +pub type CK_C_DecryptMessage = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pAssociatedData: CK_BYTE_PTR, + ulAssociatedDataLen: CK_ULONG, + pCiphertext: CK_BYTE_PTR, + ulCiphertextLen: CK_ULONG, + pPlaintext: CK_BYTE_PTR, + pulPlaintextLen: CK_ULONG_PTR, + ) -> CK_RV, +>; +pub type CK_C_DecryptMessageBegin = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pAssociatedData: CK_BYTE_PTR, + ulAssociatedDataLen: CK_ULONG, + ) -> CK_RV, +>; +pub type CK_C_DecryptMessageNext = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pCiphertext: CK_BYTE_PTR, + ulCiphertextLen: CK_ULONG, + pPlaintext: CK_BYTE_PTR, + pulPlaintextLen: CK_ULONG_PTR, + flags: CK_FLAGS, + ) -> CK_RV, +>; +pub type CK_C_MessageDecryptFinal = + ::std::option::Option CK_RV>; +pub type CK_C_MessageSignInit = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, + ) -> CK_RV, +>; +pub type CK_C_SignMessage = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + pulSignatureLen: CK_ULONG_PTR, + ) -> CK_RV, +>; +pub type CK_C_SignMessageBegin = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + ) -> CK_RV, +>; +pub type CK_C_SignMessageNext = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + pulSignatureLen: CK_ULONG_PTR, + ) -> CK_RV, +>; +pub type CK_C_MessageSignFinal = + ::std::option::Option CK_RV>; +pub type CK_C_MessageVerifyInit = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, + ) -> CK_RV, +>; +pub type CK_C_VerifyMessage = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + ulSignatureLen: CK_ULONG, + ) -> CK_RV, +>; +pub type CK_C_VerifyMessageBegin = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + ) -> CK_RV, +>; +pub type CK_C_VerifyMessageNext = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + ulSignatureLen: CK_ULONG, + ) -> CK_RV, +>; +pub type CK_C_MessageVerifyFinal = + ::std::option::Option CK_RV>; +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct CK_FUNCTION_LIST_3_0 { + pub version: CK_VERSION, + pub C_Initialize: CK_C_Initialize, + pub C_Finalize: CK_C_Finalize, + pub C_GetInfo: CK_C_GetInfo, + pub C_GetFunctionList: CK_C_GetFunctionList, + pub C_GetSlotList: CK_C_GetSlotList, + pub C_GetSlotInfo: CK_C_GetSlotInfo, + pub C_GetTokenInfo: CK_C_GetTokenInfo, + pub C_GetMechanismList: CK_C_GetMechanismList, + pub C_GetMechanismInfo: CK_C_GetMechanismInfo, + pub C_InitToken: CK_C_InitToken, + pub C_InitPIN: CK_C_InitPIN, + pub C_SetPIN: CK_C_SetPIN, + pub C_OpenSession: CK_C_OpenSession, + pub C_CloseSession: CK_C_CloseSession, + pub C_CloseAllSessions: CK_C_CloseAllSessions, + pub C_GetSessionInfo: CK_C_GetSessionInfo, + pub C_GetOperationState: CK_C_GetOperationState, + pub C_SetOperationState: CK_C_SetOperationState, + pub C_Login: CK_C_Login, + pub C_Logout: CK_C_Logout, + pub C_CreateObject: CK_C_CreateObject, + pub C_CopyObject: CK_C_CopyObject, + pub C_DestroyObject: CK_C_DestroyObject, + pub C_GetObjectSize: CK_C_GetObjectSize, + pub C_GetAttributeValue: CK_C_GetAttributeValue, + pub C_SetAttributeValue: CK_C_SetAttributeValue, + pub C_FindObjectsInit: CK_C_FindObjectsInit, + pub C_FindObjects: CK_C_FindObjects, + pub C_FindObjectsFinal: CK_C_FindObjectsFinal, + pub C_EncryptInit: CK_C_EncryptInit, + pub C_Encrypt: CK_C_Encrypt, + pub C_EncryptUpdate: CK_C_EncryptUpdate, + pub C_EncryptFinal: CK_C_EncryptFinal, + pub C_DecryptInit: CK_C_DecryptInit, + pub C_Decrypt: CK_C_Decrypt, + pub C_DecryptUpdate: CK_C_DecryptUpdate, + pub C_DecryptFinal: CK_C_DecryptFinal, + pub C_DigestInit: CK_C_DigestInit, + pub C_Digest: CK_C_Digest, + pub C_DigestUpdate: CK_C_DigestUpdate, + pub C_DigestKey: CK_C_DigestKey, + pub C_DigestFinal: CK_C_DigestFinal, + pub C_SignInit: CK_C_SignInit, + pub C_Sign: CK_C_Sign, + pub C_SignUpdate: CK_C_SignUpdate, + pub C_SignFinal: CK_C_SignFinal, + pub C_SignRecoverInit: CK_C_SignRecoverInit, + pub C_SignRecover: CK_C_SignRecover, + pub C_VerifyInit: CK_C_VerifyInit, + pub C_Verify: CK_C_Verify, + pub C_VerifyUpdate: CK_C_VerifyUpdate, + pub C_VerifyFinal: CK_C_VerifyFinal, + pub C_VerifyRecoverInit: CK_C_VerifyRecoverInit, + pub C_VerifyRecover: CK_C_VerifyRecover, + pub C_DigestEncryptUpdate: CK_C_DigestEncryptUpdate, + pub C_DecryptDigestUpdate: CK_C_DecryptDigestUpdate, + pub C_SignEncryptUpdate: CK_C_SignEncryptUpdate, + pub C_DecryptVerifyUpdate: CK_C_DecryptVerifyUpdate, + pub C_GenerateKey: CK_C_GenerateKey, + pub C_GenerateKeyPair: CK_C_GenerateKeyPair, + pub C_WrapKey: CK_C_WrapKey, + pub C_UnwrapKey: CK_C_UnwrapKey, + pub C_DeriveKey: CK_C_DeriveKey, + pub C_SeedRandom: CK_C_SeedRandom, + pub C_GenerateRandom: CK_C_GenerateRandom, + pub C_GetFunctionStatus: CK_C_GetFunctionStatus, + pub C_CancelFunction: CK_C_CancelFunction, + pub C_WaitForSlotEvent: CK_C_WaitForSlotEvent, + pub C_GetInterfaceList: CK_C_GetInterfaceList, + pub C_GetInterface: CK_C_GetInterface, + pub C_LoginUser: CK_C_LoginUser, + pub C_SessionCancel: CK_C_SessionCancel, + pub C_MessageEncryptInit: CK_C_MessageEncryptInit, + pub C_EncryptMessage: CK_C_EncryptMessage, + pub C_EncryptMessageBegin: CK_C_EncryptMessageBegin, + pub C_EncryptMessageNext: CK_C_EncryptMessageNext, + pub C_MessageEncryptFinal: CK_C_MessageEncryptFinal, + pub C_MessageDecryptInit: CK_C_MessageDecryptInit, + pub C_DecryptMessage: CK_C_DecryptMessage, + pub C_DecryptMessageBegin: CK_C_DecryptMessageBegin, + pub C_DecryptMessageNext: CK_C_DecryptMessageNext, + pub C_MessageDecryptFinal: CK_C_MessageDecryptFinal, + pub C_MessageSignInit: CK_C_MessageSignInit, + pub C_SignMessage: CK_C_SignMessage, + pub C_SignMessageBegin: CK_C_SignMessageBegin, + pub C_SignMessageNext: CK_C_SignMessageNext, + pub C_MessageSignFinal: CK_C_MessageSignFinal, + pub C_MessageVerifyInit: CK_C_MessageVerifyInit, + pub C_VerifyMessage: CK_C_VerifyMessage, + pub C_VerifyMessageBegin: CK_C_VerifyMessageBegin, + 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::(), + 372usize, + concat!("Size of: ", stringify!(CK_FUNCTION_LIST_3_0)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + 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 }, + 4usize, + 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 }, + 8usize, + 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 }, + 12usize, + 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 }, + 16usize, + 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 }, + 20usize, + 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 }, + 24usize, + 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 }, + 28usize, + 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 }, + 32usize, + 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 }, + 36usize, + 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 }, + 40usize, + 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 }, + 44usize, + 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 }, + 48usize, + 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 }, + 52usize, + 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 }, + 56usize, + 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 }, + 60usize, + 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 }, + 64usize, + 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 }, + 68usize, + 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 }, + 72usize, + 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 }, + 76usize, + 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 }, + 80usize, + 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 }, + 84usize, + 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 }, + 88usize, + 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 }, + 92usize, + 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 }, + 96usize, + 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 }, + 100usize, + 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 }, + 104usize, + 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 }, + 108usize, + 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 }, + 112usize, + 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 }, + 116usize, + 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 }, + 120usize, + 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 }, + 124usize, + 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 }, + 128usize, + 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 }, + 132usize, + 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 }, + 136usize, + 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 }, + 140usize, + 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 }, + 144usize, + 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 }, + 148usize, + 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 }, + 152usize, + 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 }, + 156usize, + 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 }, + 160usize, + 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 }, + 164usize, + 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 }, + 168usize, + 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 }, + 172usize, + 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 }, + 176usize, + 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 }, + 180usize, + 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 }, + 184usize, + 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 }, + 188usize, + 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 }, + 192usize, + 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 }, + 196usize, + 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 }, + 200usize, + 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 }, + 204usize, + 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 }, + 208usize, + 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 }, + 212usize, + 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 }, + 216usize, + 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 }, + 220usize, + 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 }, + 224usize, + 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 }, + 228usize, + 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 }, + 232usize, + 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 }, + 236usize, + 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 }, + 240usize, + 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 }, + 244usize, + 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 }, + 248usize, + 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 }, + 252usize, + 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 }, + 256usize, + 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 }, + 260usize, + 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 }, + 264usize, + 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 }, + 268usize, + 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 }, + 272usize, + 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 }, + 276usize, + 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 }, + 280usize, + 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 }, + 284usize, + 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 }, + 288usize, + 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 }, + 292usize, + 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 }, + 296usize, + 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 }, + 300usize, + 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 }, + 304usize, + 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 }, + 308usize, + 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 }, + 312usize, + 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 }, + 316usize, + 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 }, + 320usize, + 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 }, + 324usize, + 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 }, + 328usize, + 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 }, + 332usize, + 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 }, + 336usize, + 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 }, + 340usize, + 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 }, + 344usize, + 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 }, + 348usize, + 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 }, + 352usize, + 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 }, + 356usize, + 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 }, + 360usize, + 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 }, + 364usize, + 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 }, + 368usize, + concat!( + "Offset of field: ", + stringify!(CK_FUNCTION_LIST_3_0), + "::", + stringify!(C_MessageVerifyFinal) + ) + ); +} #[repr(C)] #[derive(Debug, Default, Copy, Clone)] -pub struct _CK_FUNCTION_LIST { - pub version: _CK_VERSION, +pub struct CK_FUNCTION_LIST { + pub version: CK_VERSION, pub C_Initialize: CK_C_Initialize, pub C_Finalize: CK_C_Finalize, pub C_GetInfo: CK_C_GetInfo, @@ -2647,25 +9810,25 @@ pub struct _CK_FUNCTION_LIST { pub C_WaitForSlotEvent: CK_C_WaitForSlotEvent, } #[test] -fn bindgen_test_layout__CK_FUNCTION_LIST() { - const UNINIT: ::std::mem::MaybeUninit<_CK_FUNCTION_LIST> = ::std::mem::MaybeUninit::uninit(); +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::<_CK_FUNCTION_LIST>(), + ::std::mem::size_of::(), 276usize, - concat!("Size of: ", stringify!(_CK_FUNCTION_LIST)) + concat!("Size of: ", stringify!(CK_FUNCTION_LIST)) ); assert_eq!( - ::std::mem::align_of::<_CK_FUNCTION_LIST>(), + ::std::mem::align_of::(), 4usize, - concat!("Alignment of ", stringify!(_CK_FUNCTION_LIST)) + 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!(CK_FUNCTION_LIST), "::", stringify!(version) ) @@ -2675,7 +9838,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 4usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_Initialize) ) @@ -2685,7 +9848,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 8usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_Finalize) ) @@ -2695,7 +9858,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 12usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_GetInfo) ) @@ -2705,7 +9868,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 16usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_GetFunctionList) ) @@ -2715,7 +9878,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 20usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_GetSlotList) ) @@ -2725,7 +9888,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 24usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_GetSlotInfo) ) @@ -2735,7 +9898,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 28usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_GetTokenInfo) ) @@ -2745,7 +9908,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 32usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_GetMechanismList) ) @@ -2755,7 +9918,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 36usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_GetMechanismInfo) ) @@ -2765,7 +9928,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 40usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_InitToken) ) @@ -2775,7 +9938,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 44usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_InitPIN) ) @@ -2785,7 +9948,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 48usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_SetPIN) ) @@ -2795,7 +9958,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 52usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_OpenSession) ) @@ -2805,7 +9968,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 56usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_CloseSession) ) @@ -2815,7 +9978,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 60usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_CloseAllSessions) ) @@ -2825,7 +9988,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 64usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_GetSessionInfo) ) @@ -2835,7 +9998,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 68usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_GetOperationState) ) @@ -2845,7 +10008,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 72usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_SetOperationState) ) @@ -2855,7 +10018,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 76usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_Login) ) @@ -2865,7 +10028,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 80usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_Logout) ) @@ -2875,7 +10038,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 84usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_CreateObject) ) @@ -2885,7 +10048,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 88usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_CopyObject) ) @@ -2895,7 +10058,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 92usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_DestroyObject) ) @@ -2905,7 +10068,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 96usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_GetObjectSize) ) @@ -2915,7 +10078,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 100usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_GetAttributeValue) ) @@ -2925,7 +10088,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 104usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_SetAttributeValue) ) @@ -2935,7 +10098,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 108usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_FindObjectsInit) ) @@ -2945,7 +10108,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 112usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_FindObjects) ) @@ -2955,7 +10118,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 116usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_FindObjectsFinal) ) @@ -2965,7 +10128,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 120usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_EncryptInit) ) @@ -2975,7 +10138,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 124usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_Encrypt) ) @@ -2985,7 +10148,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 128usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_EncryptUpdate) ) @@ -2995,7 +10158,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 132usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_EncryptFinal) ) @@ -3005,7 +10168,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 136usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_DecryptInit) ) @@ -3015,7 +10178,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 140usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_Decrypt) ) @@ -3025,7 +10188,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 144usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_DecryptUpdate) ) @@ -3035,7 +10198,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 148usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_DecryptFinal) ) @@ -3045,7 +10208,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 152usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_DigestInit) ) @@ -3055,7 +10218,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 156usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_Digest) ) @@ -3065,7 +10228,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 160usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_DigestUpdate) ) @@ -3075,7 +10238,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 164usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_DigestKey) ) @@ -3085,7 +10248,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 168usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_DigestFinal) ) @@ -3095,7 +10258,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 172usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_SignInit) ) @@ -3105,7 +10268,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 176usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_Sign) ) @@ -3115,7 +10278,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 180usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_SignUpdate) ) @@ -3125,7 +10288,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 184usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_SignFinal) ) @@ -3135,7 +10298,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 188usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_SignRecoverInit) ) @@ -3145,7 +10308,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 192usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_SignRecover) ) @@ -3155,7 +10318,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 196usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_VerifyInit) ) @@ -3165,7 +10328,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 200usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_Verify) ) @@ -3175,7 +10338,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 204usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_VerifyUpdate) ) @@ -3185,7 +10348,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 208usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_VerifyFinal) ) @@ -3195,7 +10358,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 212usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_VerifyRecoverInit) ) @@ -3205,7 +10368,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 216usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_VerifyRecover) ) @@ -3215,7 +10378,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 220usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_DigestEncryptUpdate) ) @@ -3225,7 +10388,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 224usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_DecryptDigestUpdate) ) @@ -3235,7 +10398,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 228usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_SignEncryptUpdate) ) @@ -3245,7 +10408,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 232usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_DecryptVerifyUpdate) ) @@ -3255,7 +10418,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 236usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_GenerateKey) ) @@ -3265,7 +10428,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 240usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_GenerateKeyPair) ) @@ -3275,7 +10438,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 244usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_WrapKey) ) @@ -3285,7 +10448,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 248usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_UnwrapKey) ) @@ -3295,7 +10458,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 252usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_DeriveKey) ) @@ -3305,7 +10468,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 256usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_SeedRandom) ) @@ -3315,7 +10478,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 260usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_GenerateRandom) ) @@ -3325,7 +10488,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 264usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_GetFunctionStatus) ) @@ -3335,7 +10498,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 268usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_CancelFunction) ) @@ -3345,223 +10508,45 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 272usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), - "::", - stringify!(C_WaitForSlotEvent) - ) - ); -} -pub type CK_CREATEMUTEX = - ::std::option::Option CK_RV>; -pub type CK_DESTROYMUTEX = - ::std::option::Option CK_RV>; -pub type CK_LOCKMUTEX = - ::std::option::Option CK_RV>; -pub type CK_UNLOCKMUTEX = - ::std::option::Option CK_RV>; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct _CK_C_INITIALIZE_ARGS { - pub CreateMutex: CK_CREATEMUTEX, - pub DestroyMutex: CK_DESTROYMUTEX, - pub LockMutex: CK_LOCKMUTEX, - pub UnlockMutex: CK_UNLOCKMUTEX, - pub flags: CK_FLAGS, - pub pReserved: *mut ::std::os::raw::c_void, -} -#[test] -fn bindgen_test_layout__CK_C_INITIALIZE_ARGS() { - const UNINIT: ::std::mem::MaybeUninit<_CK_C_INITIALIZE_ARGS> = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<_CK_C_INITIALIZE_ARGS>(), - 24usize, - concat!("Size of: ", stringify!(_CK_C_INITIALIZE_ARGS)) - ); - assert_eq!( - ::std::mem::align_of::<_CK_C_INITIALIZE_ARGS>(), - 4usize, - 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 }, - 4usize, - 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 }, - 8usize, - 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 }, - 12usize, - 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 }, - 16usize, - 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 }, - 20usize, - concat!( - "Offset of field: ", - stringify!(_CK_C_INITIALIZE_ARGS), + stringify!(CK_FUNCTION_LIST), "::", - stringify!(pReserved) - ) - ); -} -impl Default for _CK_C_INITIALIZE_ARGS { - fn default() -> Self { - let mut s = ::std::mem::MaybeUninit::::uninit(); - unsafe { - ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -pub type CK_BYTE = ::std::os::raw::c_uchar; -pub type CK_CHAR = ::std::os::raw::c_uchar; -pub type CK_UTF8CHAR = ::std::os::raw::c_uchar; -pub type CK_BBOOL = ::std::os::raw::c_uchar; -pub type CK_ULONG = ::std::os::raw::c_ulong; -pub type CK_LONG = ::std::os::raw::c_long; -pub type CK_BYTE_PTR = *mut CK_BYTE; -pub type CK_CHAR_PTR = *mut CK_CHAR; -pub type CK_UTF8CHAR_PTR = *mut CK_UTF8CHAR; -pub type CK_ULONG_PTR = *mut CK_ULONG; -pub type CK_VOID_PTR = *mut ::std::os::raw::c_void; -pub type CK_VOID_PTR_PTR = *mut *mut ::std::os::raw::c_void; -pub type CK_VERSION = _CK_VERSION; -pub type CK_VERSION_PTR = *mut _CK_VERSION; -pub type CK_INFO = _CK_INFO; -pub type CK_INFO_PTR = *mut _CK_INFO; -pub type CK_SLOT_ID_PTR = *mut CK_SLOT_ID; -pub type CK_SLOT_INFO = _CK_SLOT_INFO; -pub type CK_SLOT_INFO_PTR = *mut _CK_SLOT_INFO; -pub type CK_TOKEN_INFO = _CK_TOKEN_INFO; -pub type CK_TOKEN_INFO_PTR = *mut _CK_TOKEN_INFO; -pub type CK_SESSION_HANDLE_PTR = *mut CK_SESSION_HANDLE; -pub type CK_SESSION_INFO = _CK_SESSION_INFO; -pub type CK_SESSION_INFO_PTR = *mut _CK_SESSION_INFO; -pub type CK_OBJECT_HANDLE_PTR = *mut CK_OBJECT_HANDLE; -pub type CK_OBJECT_CLASS_PTR = *mut CK_OBJECT_CLASS; -pub type CK_ATTRIBUTE = _CK_ATTRIBUTE; -pub type CK_ATTRIBUTE_PTR = *mut _CK_ATTRIBUTE; -pub type CK_DATE = _CK_DATE; -pub type CK_DATE_PTR = *mut _CK_DATE; -pub type CK_MECHANISM_TYPE_PTR = *mut CK_MECHANISM_TYPE; -pub type CK_MECHANISM = _CK_MECHANISM; -pub type CK_MECHANISM_PTR = *mut _CK_MECHANISM; -pub type CK_MECHANISM_INFO = _CK_MECHANISM_INFO; -pub type CK_MECHANISM_INFO_PTR = *mut _CK_MECHANISM_INFO; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct ck_otp_mechanism_info { - _unused: [u8; 0], -} -pub type CK_OTP_MECHANISM_INFO = ck_otp_mechanism_info; -pub type CK_OTP_MECHANISM_INFO_PTR = *mut ck_otp_mechanism_info; -pub type CK_FUNCTION_LIST = _CK_FUNCTION_LIST; -pub type CK_FUNCTION_LIST_PTR = *mut _CK_FUNCTION_LIST; -pub type CK_FUNCTION_LIST_PTR_PTR = *mut *mut _CK_FUNCTION_LIST; -pub type CK_C_INITIALIZE_ARGS = _CK_C_INITIALIZE_ARGS; -pub type CK_C_INITIALIZE_ARGS_PTR = *mut _CK_C_INITIALIZE_ARGS; -pub type CK_RSA_PKCS_PSS_PARAMS = ck_rsa_pkcs_pss_params; -pub type CK_RSA_PKCS_PSS_PARAMS_PTR = *mut ck_rsa_pkcs_pss_params; -pub type CK_RSA_PKCS_OAEP_PARAMS = ck_rsa_pkcs_oaep_params; -pub type CK_RSA_PKCS_OAEP_PARAMS_PTR = *mut ck_rsa_pkcs_oaep_params; -pub type CK_AES_CTR_PARAMS = ck_aes_ctr_params; -pub type CK_AES_CTR_PARAMS_PTR = *mut ck_aes_ctr_params; -pub type CK_GCM_PARAMS = ck_gcm_params; -pub type CK_GCM_PARAMS_PTR = *mut ck_gcm_params; -pub type CK_ECDH1_DERIVE_PARAMS = ck_ecdh1_derive_params; -pub type CK_ECDH1_DERIVE_PARAMS_PTR = *mut ck_ecdh1_derive_params; -pub type CK_KEY_DERIVATION_STRING_DATA = ck_key_derivation_string_data; -pub type CK_KEY_DERIVATION_STRING_DATA_PTR = *mut ck_key_derivation_string_data; -pub type CK_DES_CBC_ENCRYPT_DATA_PARAMS = ck_des_cbc_encrypt_data_params; -pub type CK_DES_CBC_ENCRYPT_DATA_PARAMS_PTR = *mut ck_des_cbc_encrypt_data_params; -pub type CK_AES_CBC_ENCRYPT_DATA_PARAMS = ck_aes_cbc_encrypt_data_params; -pub type CK_AES_CBC_ENCRYPT_DATA_PARAMS_PTR = *mut ck_aes_cbc_encrypt_data_params; + stringify!(C_WaitForSlotEvent) + ) + ); +} extern crate libloading; pub struct Pkcs11 { __library: ::libloading::Library, - pub C_Initialize: Result< - unsafe extern "C" fn(init_args: *mut ::std::os::raw::c_void) -> CK_RV, - ::libloading::Error, - >, - pub C_Finalize: Result< - unsafe extern "C" fn(pReserved: *mut ::std::os::raw::c_void) -> CK_RV, - ::libloading::Error, - >, - pub C_GetInfo: Result CK_RV, ::libloading::Error>, + pub C_Initialize: + Result CK_RV, ::libloading::Error>, + pub C_Finalize: + Result CK_RV, ::libloading::Error>, + pub C_GetInfo: Result CK_RV, ::libloading::Error>, pub C_GetFunctionList: Result< - unsafe extern "C" fn(function_list: *mut *mut _CK_FUNCTION_LIST) -> CK_RV, + unsafe extern "C" fn(ppFunctionList: CK_FUNCTION_LIST_PTR_PTR) -> CK_RV, ::libloading::Error, >, pub C_GetSlotList: Result< unsafe extern "C" fn( - token_present: ::std::os::raw::c_uchar, - slot_list: *mut CK_SLOT_ID, - ulCount: *mut ::std::os::raw::c_ulong, + tokenPresent: CK_BBOOL, + pSlotList: CK_SLOT_ID_PTR, + pulCount: CK_ULONG_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_GetSlotInfo: Result< - unsafe extern "C" fn(slotID: CK_SLOT_ID, info: *mut _CK_SLOT_INFO) -> CK_RV, + unsafe extern "C" fn(slotID: CK_SLOT_ID, pInfo: CK_SLOT_INFO_PTR) -> CK_RV, ::libloading::Error, >, pub C_GetTokenInfo: Result< - unsafe extern "C" fn(slotID: CK_SLOT_ID, info: *mut _CK_TOKEN_INFO) -> CK_RV, - ::libloading::Error, - >, - pub C_WaitForSlotEvent: Result< - unsafe extern "C" fn( - flags: CK_FLAGS, - slot: *mut CK_SLOT_ID, - pReserved: *mut ::std::os::raw::c_void, - ) -> CK_RV, + unsafe extern "C" fn(slotID: CK_SLOT_ID, pInfo: CK_TOKEN_INFO_PTR) -> CK_RV, ::libloading::Error, >, pub C_GetMechanismList: Result< unsafe extern "C" fn( slotID: CK_SLOT_ID, - mechanism_list: *mut CK_MECHANISM_TYPE, - ulCount: *mut ::std::os::raw::c_ulong, + pMechanismList: CK_MECHANISM_TYPE_PTR, + pulCount: CK_ULONG_PTR, ) -> CK_RV, ::libloading::Error, >, @@ -3569,34 +10554,34 @@ pub struct Pkcs11 { unsafe extern "C" fn( slotID: CK_SLOT_ID, type_: CK_MECHANISM_TYPE, - info: *mut _CK_MECHANISM_INFO, + pInfo: CK_MECHANISM_INFO_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_InitToken: Result< unsafe extern "C" fn( slotID: CK_SLOT_ID, - pin: *mut ::std::os::raw::c_uchar, - pin_len: ::std::os::raw::c_ulong, - label: *mut ::std::os::raw::c_uchar, + pPin: CK_UTF8CHAR_PTR, + ulPinLen: CK_ULONG, + pLabel: CK_UTF8CHAR_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_InitPIN: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - pin: *mut ::std::os::raw::c_uchar, - pin_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pPin: CK_UTF8CHAR_PTR, + ulPinLen: CK_ULONG, ) -> CK_RV, ::libloading::Error, >, pub C_SetPIN: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - old_pin: *mut ::std::os::raw::c_uchar, - old_len: ::std::os::raw::c_ulong, - new_pin: *mut ::std::os::raw::c_uchar, - new_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pOldPin: CK_UTF8CHAR_PTR, + ulOldLen: CK_ULONG, + pNewPin: CK_UTF8CHAR_PTR, + ulNewLen: CK_ULONG, ) -> CK_RV, ::libloading::Error, >, @@ -3604,445 +10589,659 @@ pub struct Pkcs11 { unsafe extern "C" fn( slotID: CK_SLOT_ID, flags: CK_FLAGS, - application: *mut ::std::os::raw::c_void, - notify: CK_NOTIFY, - session: *mut CK_SESSION_HANDLE, + pApplication: CK_VOID_PTR, + Notify: CK_NOTIFY, + phSession: CK_SESSION_HANDLE_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_CloseSession: - Result CK_RV, ::libloading::Error>, + Result CK_RV, ::libloading::Error>, pub C_CloseAllSessions: Result CK_RV, ::libloading::Error>, pub C_GetSessionInfo: Result< - unsafe extern "C" fn(session: CK_SESSION_HANDLE, info: *mut _CK_SESSION_INFO) -> CK_RV, + unsafe extern "C" fn(hSession: CK_SESSION_HANDLE, pInfo: CK_SESSION_INFO_PTR) -> CK_RV, ::libloading::Error, >, pub C_GetOperationState: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - operation_state: *mut ::std::os::raw::c_uchar, - operation_state_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pOperationState: CK_BYTE_PTR, + pulOperationStateLen: CK_ULONG_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_SetOperationState: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - operation_state: *mut ::std::os::raw::c_uchar, - operation_state_len: ::std::os::raw::c_ulong, - encryption_key: CK_OBJECT_HANDLE, - authentiation_key: CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pOperationState: CK_BYTE_PTR, + ulOperationStateLen: CK_ULONG, + hEncryptionKey: CK_OBJECT_HANDLE, + hAuthenticationKey: CK_OBJECT_HANDLE, ) -> CK_RV, ::libloading::Error, >, pub C_Login: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - user_type: CK_USER_TYPE, - pin: *mut ::std::os::raw::c_uchar, - pin_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + userType: CK_USER_TYPE, + pPin: CK_UTF8CHAR_PTR, + ulPinLen: CK_ULONG, ) -> CK_RV, ::libloading::Error, >, pub C_Logout: - Result CK_RV, ::libloading::Error>, + Result CK_RV, ::libloading::Error>, pub C_CreateObject: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - templ: *mut _CK_ATTRIBUTE, - ulCount: ::std::os::raw::c_ulong, - object: *mut CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pTemplate: CK_ATTRIBUTE_PTR, + ulCount: CK_ULONG, + phObject: CK_OBJECT_HANDLE_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_CopyObject: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - object: CK_OBJECT_HANDLE, - templ: *mut _CK_ATTRIBUTE, - ulCount: ::std::os::raw::c_ulong, - new_object: *mut CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + hObject: CK_OBJECT_HANDLE, + pTemplate: CK_ATTRIBUTE_PTR, + ulCount: CK_ULONG, + phNewObject: CK_OBJECT_HANDLE_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_DestroyObject: Result< - unsafe extern "C" fn(session: CK_SESSION_HANDLE, object: CK_OBJECT_HANDLE) -> CK_RV, + unsafe extern "C" fn(hSession: CK_SESSION_HANDLE, hObject: CK_OBJECT_HANDLE) -> CK_RV, ::libloading::Error, >, pub C_GetObjectSize: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - object: CK_OBJECT_HANDLE, - size: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + hObject: CK_OBJECT_HANDLE, + pulSize: CK_ULONG_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_GetAttributeValue: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - object: CK_OBJECT_HANDLE, - templ: *mut _CK_ATTRIBUTE, - ulCount: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + hObject: CK_OBJECT_HANDLE, + pTemplate: CK_ATTRIBUTE_PTR, + ulCount: CK_ULONG, ) -> CK_RV, ::libloading::Error, >, pub C_SetAttributeValue: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - object: CK_OBJECT_HANDLE, - templ: *mut _CK_ATTRIBUTE, - ulCount: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + hObject: CK_OBJECT_HANDLE, + pTemplate: CK_ATTRIBUTE_PTR, + ulCount: CK_ULONG, ) -> CK_RV, ::libloading::Error, >, pub C_FindObjectsInit: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - templ: *mut _CK_ATTRIBUTE, - ulCount: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pTemplate: CK_ATTRIBUTE_PTR, + ulCount: CK_ULONG, ) -> CK_RV, ::libloading::Error, >, pub C_FindObjects: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - object: *mut CK_OBJECT_HANDLE, - max_object_count: ::std::os::raw::c_ulong, - object_count: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + phObject: CK_OBJECT_HANDLE_PTR, + ulMaxObjectCount: CK_ULONG, + pulObjectCount: CK_ULONG_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_FindObjectsFinal: - Result CK_RV, ::libloading::Error>, + Result CK_RV, ::libloading::Error>, pub C_EncryptInit: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - key: CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, ) -> CK_RV, ::libloading::Error, >, pub C_Encrypt: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - data: *mut ::std::os::raw::c_uchar, - data_len: ::std::os::raw::c_ulong, - encrypted_data: *mut ::std::os::raw::c_uchar, - encrypted_data_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pEncryptedData: CK_BYTE_PTR, + pulEncryptedDataLen: CK_ULONG_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_EncryptUpdate: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - part: *mut ::std::os::raw::c_uchar, - part_len: ::std::os::raw::c_ulong, - encrypted_part: *mut ::std::os::raw::c_uchar, - encrypted_part_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pPart: CK_BYTE_PTR, + ulPartLen: CK_ULONG, + pEncryptedPart: CK_BYTE_PTR, + pulEncryptedPartLen: CK_ULONG_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_EncryptFinal: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - last_encrypted_part: *mut ::std::os::raw::c_uchar, - last_encrypted_part_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pLastEncryptedPart: CK_BYTE_PTR, + pulLastEncryptedPartLen: CK_ULONG_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_DecryptInit: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - key: CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, ) -> CK_RV, ::libloading::Error, >, pub C_Decrypt: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - encrypted_data: *mut ::std::os::raw::c_uchar, - encrypted_data_len: ::std::os::raw::c_ulong, - data: *mut ::std::os::raw::c_uchar, - data_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pEncryptedData: CK_BYTE_PTR, + ulEncryptedDataLen: CK_ULONG, + pData: CK_BYTE_PTR, + pulDataLen: CK_ULONG_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_DecryptUpdate: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - encrypted_part: *mut ::std::os::raw::c_uchar, - encrypted_part_len: ::std::os::raw::c_ulong, - part: *mut ::std::os::raw::c_uchar, - part_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pEncryptedPart: CK_BYTE_PTR, + ulEncryptedPartLen: CK_ULONG, + pPart: CK_BYTE_PTR, + pulPartLen: CK_ULONG_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_DecryptFinal: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - last_part: *mut ::std::os::raw::c_uchar, - last_part_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pLastPart: CK_BYTE_PTR, + pulLastPartLen: CK_ULONG_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_DigestInit: Result< - unsafe extern "C" fn(session: CK_SESSION_HANDLE, mechanism: *mut _CK_MECHANISM) -> CK_RV, + unsafe extern "C" fn(hSession: CK_SESSION_HANDLE, pMechanism: CK_MECHANISM_PTR) -> CK_RV, ::libloading::Error, >, pub C_Digest: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - data: *mut ::std::os::raw::c_uchar, - data_len: ::std::os::raw::c_ulong, - digest: *mut ::std::os::raw::c_uchar, - digest_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pDigest: CK_BYTE_PTR, + pulDigestLen: CK_ULONG_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_DigestUpdate: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - part: *mut ::std::os::raw::c_uchar, - part_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pPart: CK_BYTE_PTR, + ulPartLen: CK_ULONG, ) -> CK_RV, ::libloading::Error, >, pub C_DigestKey: Result< - unsafe extern "C" fn(session: CK_SESSION_HANDLE, key: CK_OBJECT_HANDLE) -> CK_RV, + unsafe extern "C" fn(hSession: CK_SESSION_HANDLE, hKey: CK_OBJECT_HANDLE) -> CK_RV, ::libloading::Error, >, pub C_DigestFinal: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - digest: *mut ::std::os::raw::c_uchar, - digest_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pDigest: CK_BYTE_PTR, + pulDigestLen: CK_ULONG_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_SignInit: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - key: CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, ) -> CK_RV, ::libloading::Error, >, pub C_Sign: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - data: *mut ::std::os::raw::c_uchar, - data_len: ::std::os::raw::c_ulong, - signature: *mut ::std::os::raw::c_uchar, - signature_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + pulSignatureLen: CK_ULONG_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_SignUpdate: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - part: *mut ::std::os::raw::c_uchar, - part_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pPart: CK_BYTE_PTR, + ulPartLen: CK_ULONG, ) -> CK_RV, ::libloading::Error, >, pub C_SignFinal: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - signature: *mut ::std::os::raw::c_uchar, - signature_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pSignature: CK_BYTE_PTR, + pulSignatureLen: CK_ULONG_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_SignRecoverInit: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - key: CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, ) -> CK_RV, ::libloading::Error, >, pub C_SignRecover: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - data: *mut ::std::os::raw::c_uchar, - data_len: ::std::os::raw::c_ulong, - signature: *mut ::std::os::raw::c_uchar, - signature_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + pulSignatureLen: CK_ULONG_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_VerifyInit: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - key: CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, ) -> CK_RV, ::libloading::Error, >, pub C_Verify: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - data: *mut ::std::os::raw::c_uchar, - data_len: ::std::os::raw::c_ulong, - signature: *mut ::std::os::raw::c_uchar, - signature_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + ulSignatureLen: CK_ULONG, ) -> CK_RV, ::libloading::Error, >, pub C_VerifyUpdate: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - part: *mut ::std::os::raw::c_uchar, - part_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pPart: CK_BYTE_PTR, + ulPartLen: CK_ULONG, ) -> CK_RV, ::libloading::Error, >, pub C_VerifyFinal: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - signature: *mut ::std::os::raw::c_uchar, - signature_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pSignature: CK_BYTE_PTR, + ulSignatureLen: CK_ULONG, ) -> CK_RV, ::libloading::Error, >, pub C_VerifyRecoverInit: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - key: CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, ) -> CK_RV, ::libloading::Error, >, pub C_VerifyRecover: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - signature: *mut ::std::os::raw::c_uchar, - signature_len: ::std::os::raw::c_ulong, - data: *mut ::std::os::raw::c_uchar, - data_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pSignature: CK_BYTE_PTR, + ulSignatureLen: CK_ULONG, + pData: CK_BYTE_PTR, + pulDataLen: CK_ULONG_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_DigestEncryptUpdate: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - part: *mut ::std::os::raw::c_uchar, - part_len: ::std::os::raw::c_ulong, - encrypted_part: *mut ::std::os::raw::c_uchar, - encrypted_part_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pPart: CK_BYTE_PTR, + ulPartLen: CK_ULONG, + pEncryptedPart: CK_BYTE_PTR, + pulEncryptedPartLen: CK_ULONG_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_DecryptDigestUpdate: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - encrypted_part: *mut ::std::os::raw::c_uchar, - encrypted_part_len: ::std::os::raw::c_ulong, - part: *mut ::std::os::raw::c_uchar, - part_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pEncryptedPart: CK_BYTE_PTR, + ulEncryptedPartLen: CK_ULONG, + pPart: CK_BYTE_PTR, + pulPartLen: CK_ULONG_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_SignEncryptUpdate: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - part: *mut ::std::os::raw::c_uchar, - part_len: ::std::os::raw::c_ulong, - encrypted_part: *mut ::std::os::raw::c_uchar, - encrypted_part_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pPart: CK_BYTE_PTR, + ulPartLen: CK_ULONG, + pEncryptedPart: CK_BYTE_PTR, + pulEncryptedPartLen: CK_ULONG_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_DecryptVerifyUpdate: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - encrypted_part: *mut ::std::os::raw::c_uchar, - encrypted_part_len: ::std::os::raw::c_ulong, - part: *mut ::std::os::raw::c_uchar, - part_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pEncryptedPart: CK_BYTE_PTR, + ulEncryptedPartLen: CK_ULONG, + pPart: CK_BYTE_PTR, + pulPartLen: CK_ULONG_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_GenerateKey: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - templ: *mut _CK_ATTRIBUTE, - ulCount: ::std::os::raw::c_ulong, - key: *mut CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + pTemplate: CK_ATTRIBUTE_PTR, + ulCount: CK_ULONG, + phKey: CK_OBJECT_HANDLE_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_GenerateKeyPair: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - public_key_template: *mut _CK_ATTRIBUTE, - public_key_attribute_count: ::std::os::raw::c_ulong, - private_key_template: *mut _CK_ATTRIBUTE, - private_key_attribute_count: ::std::os::raw::c_ulong, - public_key: *mut CK_OBJECT_HANDLE, - private_key: *mut CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + pPublicKeyTemplate: CK_ATTRIBUTE_PTR, + ulPublicKeyAttributeCount: CK_ULONG, + pPrivateKeyTemplate: CK_ATTRIBUTE_PTR, + ulPrivateKeyAttributeCount: CK_ULONG, + phPublicKey: CK_OBJECT_HANDLE_PTR, + phPrivateKey: CK_OBJECT_HANDLE_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_WrapKey: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - wrapping_key: CK_OBJECT_HANDLE, - key: CK_OBJECT_HANDLE, - wrapped_key: *mut ::std::os::raw::c_uchar, - wrapped_key_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hWrappingKey: CK_OBJECT_HANDLE, + hKey: CK_OBJECT_HANDLE, + pWrappedKey: CK_BYTE_PTR, + pulWrappedKeyLen: CK_ULONG_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_UnwrapKey: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - unwrapping_key: CK_OBJECT_HANDLE, - wrapped_key: *mut ::std::os::raw::c_uchar, - wrapped_key_len: ::std::os::raw::c_ulong, - templ: *mut _CK_ATTRIBUTE, - attribute_count: ::std::os::raw::c_ulong, - key: *mut CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hUnwrappingKey: CK_OBJECT_HANDLE, + pWrappedKey: CK_BYTE_PTR, + ulWrappedKeyLen: CK_ULONG, + pTemplate: CK_ATTRIBUTE_PTR, + ulAttributeCount: CK_ULONG, + phKey: CK_OBJECT_HANDLE_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_DeriveKey: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - base_key: CK_OBJECT_HANDLE, - templ: *mut _CK_ATTRIBUTE, - attribute_count: ::std::os::raw::c_ulong, - key: *mut CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hBaseKey: CK_OBJECT_HANDLE, + pTemplate: CK_ATTRIBUTE_PTR, + ulAttributeCount: CK_ULONG, + phKey: CK_OBJECT_HANDLE_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_SeedRandom: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - seed: *mut ::std::os::raw::c_uchar, - seed_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pSeed: CK_BYTE_PTR, + ulSeedLen: CK_ULONG, ) -> CK_RV, ::libloading::Error, >, pub C_GenerateRandom: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - random_data: *mut ::std::os::raw::c_uchar, - random_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + RandomData: CK_BYTE_PTR, + ulRandomLen: CK_ULONG, ) -> CK_RV, ::libloading::Error, >, pub C_GetFunctionStatus: - Result CK_RV, ::libloading::Error>, + Result CK_RV, ::libloading::Error>, pub C_CancelFunction: - Result CK_RV, ::libloading::Error>, + Result CK_RV, ::libloading::Error>, + pub C_WaitForSlotEvent: Result< + unsafe extern "C" fn( + flags: CK_FLAGS, + pSlot: CK_SLOT_ID_PTR, + pRserved: CK_VOID_PTR, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_GetInterfaceList: Result< + unsafe extern "C" fn(pInterfacesList: CK_INTERFACE_PTR, pulCount: CK_ULONG_PTR) -> CK_RV, + ::libloading::Error, + >, + pub C_GetInterface: Result< + unsafe extern "C" fn( + pInterfaceName: CK_UTF8CHAR_PTR, + pVersion: CK_VERSION_PTR, + ppInterface: CK_INTERFACE_PTR_PTR, + flags: CK_FLAGS, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_LoginUser: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + userType: CK_USER_TYPE, + pPin: CK_UTF8CHAR_PTR, + ulPinLen: CK_ULONG, + pUsername: CK_UTF8CHAR_PTR, + ulUsernameLen: CK_ULONG, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_SessionCancel: Result< + unsafe extern "C" fn(hSession: CK_SESSION_HANDLE, flags: CK_FLAGS) -> CK_RV, + ::libloading::Error, + >, + pub C_MessageEncryptInit: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_EncryptMessage: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pAssociatedData: CK_BYTE_PTR, + ulAssociatedDataLen: CK_ULONG, + pPlaintext: CK_BYTE_PTR, + ulPlaintextLen: CK_ULONG, + pCiphertext: CK_BYTE_PTR, + pulCiphertextLen: CK_ULONG_PTR, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_EncryptMessageBegin: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pAssociatedData: CK_BYTE_PTR, + ulAssociatedDataLen: CK_ULONG, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_EncryptMessageNext: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pPlaintextPart: CK_BYTE_PTR, + ulPlaintextPartLen: CK_ULONG, + pCiphertextPart: CK_BYTE_PTR, + pulCiphertextPartLen: CK_ULONG_PTR, + flags: CK_FLAGS, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_MessageEncryptFinal: + Result CK_RV, ::libloading::Error>, + pub C_MessageDecryptInit: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_DecryptMessage: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pAssociatedData: CK_BYTE_PTR, + ulAssociatedDataLen: CK_ULONG, + pCiphertext: CK_BYTE_PTR, + ulCiphertextLen: CK_ULONG, + pPlaintext: CK_BYTE_PTR, + pulPlaintextLen: CK_ULONG_PTR, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_DecryptMessageBegin: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pAssociatedData: CK_BYTE_PTR, + ulAssociatedDataLen: CK_ULONG, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_DecryptMessageNext: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pCiphertext: CK_BYTE_PTR, + ulCiphertextLen: CK_ULONG, + pPlaintext: CK_BYTE_PTR, + pulPlaintextLen: CK_ULONG_PTR, + flags: CK_FLAGS, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_MessageDecryptFinal: + Result CK_RV, ::libloading::Error>, + pub C_MessageSignInit: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_SignMessage: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + pulSignatureLen: CK_ULONG_PTR, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_SignMessageBegin: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_SignMessageNext: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + pulSignatureLen: CK_ULONG_PTR, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_MessageSignFinal: + Result CK_RV, ::libloading::Error>, + pub C_MessageVerifyInit: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_VerifyMessage: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + ulSignatureLen: CK_ULONG, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_VerifyMessageBegin: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_VerifyMessageNext: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + ulSignatureLen: CK_ULONG, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_MessageVerifyFinal: + Result CK_RV, ::libloading::Error>, } impl Pkcs11 { pub unsafe fn new

(path: P) -> Result @@ -4064,7 +11263,6 @@ impl Pkcs11 { let C_GetSlotList = __library.get(b"C_GetSlotList\0").map(|sym| *sym); let C_GetSlotInfo = __library.get(b"C_GetSlotInfo\0").map(|sym| *sym); let C_GetTokenInfo = __library.get(b"C_GetTokenInfo\0").map(|sym| *sym); - let C_WaitForSlotEvent = __library.get(b"C_WaitForSlotEvent\0").map(|sym| *sym); let C_GetMechanismList = __library.get(b"C_GetMechanismList\0").map(|sym| *sym); let C_GetMechanismInfo = __library.get(b"C_GetMechanismInfo\0").map(|sym| *sym); let C_InitToken = __library.get(b"C_InitToken\0").map(|sym| *sym); @@ -4125,6 +11323,31 @@ impl Pkcs11 { let C_GenerateRandom = __library.get(b"C_GenerateRandom\0").map(|sym| *sym); let C_GetFunctionStatus = __library.get(b"C_GetFunctionStatus\0").map(|sym| *sym); let C_CancelFunction = __library.get(b"C_CancelFunction\0").map(|sym| *sym); + let C_WaitForSlotEvent = __library.get(b"C_WaitForSlotEvent\0").map(|sym| *sym); + let C_GetInterfaceList = __library.get(b"C_GetInterfaceList\0").map(|sym| *sym); + let C_GetInterface = __library.get(b"C_GetInterface\0").map(|sym| *sym); + let C_LoginUser = __library.get(b"C_LoginUser\0").map(|sym| *sym); + let C_SessionCancel = __library.get(b"C_SessionCancel\0").map(|sym| *sym); + let C_MessageEncryptInit = __library.get(b"C_MessageEncryptInit\0").map(|sym| *sym); + let C_EncryptMessage = __library.get(b"C_EncryptMessage\0").map(|sym| *sym); + let C_EncryptMessageBegin = __library.get(b"C_EncryptMessageBegin\0").map(|sym| *sym); + let C_EncryptMessageNext = __library.get(b"C_EncryptMessageNext\0").map(|sym| *sym); + let C_MessageEncryptFinal = __library.get(b"C_MessageEncryptFinal\0").map(|sym| *sym); + let C_MessageDecryptInit = __library.get(b"C_MessageDecryptInit\0").map(|sym| *sym); + let C_DecryptMessage = __library.get(b"C_DecryptMessage\0").map(|sym| *sym); + let C_DecryptMessageBegin = __library.get(b"C_DecryptMessageBegin\0").map(|sym| *sym); + let C_DecryptMessageNext = __library.get(b"C_DecryptMessageNext\0").map(|sym| *sym); + let C_MessageDecryptFinal = __library.get(b"C_MessageDecryptFinal\0").map(|sym| *sym); + let C_MessageSignInit = __library.get(b"C_MessageSignInit\0").map(|sym| *sym); + let C_SignMessage = __library.get(b"C_SignMessage\0").map(|sym| *sym); + let C_SignMessageBegin = __library.get(b"C_SignMessageBegin\0").map(|sym| *sym); + let C_SignMessageNext = __library.get(b"C_SignMessageNext\0").map(|sym| *sym); + let C_MessageSignFinal = __library.get(b"C_MessageSignFinal\0").map(|sym| *sym); + let C_MessageVerifyInit = __library.get(b"C_MessageVerifyInit\0").map(|sym| *sym); + let C_VerifyMessage = __library.get(b"C_VerifyMessage\0").map(|sym| *sym); + let C_VerifyMessageBegin = __library.get(b"C_VerifyMessageBegin\0").map(|sym| *sym); + let C_VerifyMessageNext = __library.get(b"C_VerifyMessageNext\0").map(|sym| *sym); + let C_MessageVerifyFinal = __library.get(b"C_MessageVerifyFinal\0").map(|sym| *sym); Ok(Pkcs11 { __library, C_Initialize, @@ -4134,7 +11357,6 @@ impl Pkcs11 { C_GetSlotList, C_GetSlotInfo, C_GetTokenInfo, - C_WaitForSlotEvent, C_GetMechanismList, C_GetMechanismInfo, C_InitToken, @@ -4195,146 +11417,164 @@ impl Pkcs11 { C_GenerateRandom, C_GetFunctionStatus, C_CancelFunction, + C_WaitForSlotEvent, + C_GetInterfaceList, + C_GetInterface, + C_LoginUser, + C_SessionCancel, + C_MessageEncryptInit, + C_EncryptMessage, + C_EncryptMessageBegin, + C_EncryptMessageNext, + C_MessageEncryptFinal, + C_MessageDecryptInit, + C_DecryptMessage, + C_DecryptMessageBegin, + C_DecryptMessageNext, + C_MessageDecryptFinal, + C_MessageSignInit, + C_SignMessage, + C_SignMessageBegin, + C_SignMessageNext, + C_MessageSignFinal, + C_MessageVerifyInit, + C_VerifyMessage, + C_VerifyMessageBegin, + C_VerifyMessageNext, + C_MessageVerifyFinal, }) } - pub unsafe fn C_Initialize(&self, init_args: *mut ::std::os::raw::c_void) -> CK_RV { + pub unsafe fn C_Initialize(&self, pInitArgs: CK_VOID_PTR) -> CK_RV { (self .C_Initialize .as_ref() - .expect("Expected function, got error."))(init_args) + .expect("Expected function, got error."))(pInitArgs) } - pub unsafe fn C_Finalize(&self, pReserved: *mut ::std::os::raw::c_void) -> CK_RV { + pub unsafe fn C_Finalize(&self, pReserved: CK_VOID_PTR) -> CK_RV { (self .C_Finalize .as_ref() .expect("Expected function, got error."))(pReserved) } - pub unsafe fn C_GetInfo(&self, info: *mut _CK_INFO) -> CK_RV { + pub unsafe fn C_GetInfo(&self, pInfo: CK_INFO_PTR) -> CK_RV { (self .C_GetInfo .as_ref() - .expect("Expected function, got error."))(info) + .expect("Expected function, got error."))(pInfo) } - pub unsafe fn C_GetFunctionList(&self, function_list: *mut *mut _CK_FUNCTION_LIST) -> CK_RV { + pub unsafe fn C_GetFunctionList(&self, ppFunctionList: CK_FUNCTION_LIST_PTR_PTR) -> CK_RV { (self .C_GetFunctionList .as_ref() - .expect("Expected function, got error."))(function_list) + .expect("Expected function, got error."))(ppFunctionList) } pub unsafe fn C_GetSlotList( &self, - token_present: ::std::os::raw::c_uchar, - slot_list: *mut CK_SLOT_ID, - ulCount: *mut ::std::os::raw::c_ulong, + tokenPresent: CK_BBOOL, + pSlotList: CK_SLOT_ID_PTR, + pulCount: CK_ULONG_PTR, ) -> CK_RV { (self .C_GetSlotList .as_ref() - .expect("Expected function, got error."))(token_present, slot_list, ulCount) + .expect("Expected function, got error."))(tokenPresent, pSlotList, pulCount) } - pub unsafe fn C_GetSlotInfo(&self, slotID: CK_SLOT_ID, info: *mut _CK_SLOT_INFO) -> CK_RV { + pub unsafe fn C_GetSlotInfo(&self, slotID: CK_SLOT_ID, pInfo: CK_SLOT_INFO_PTR) -> CK_RV { (self .C_GetSlotInfo .as_ref() - .expect("Expected function, got error."))(slotID, info) + .expect("Expected function, got error."))(slotID, pInfo) } - pub unsafe fn C_GetTokenInfo(&self, slotID: CK_SLOT_ID, info: *mut _CK_TOKEN_INFO) -> CK_RV { + pub unsafe fn C_GetTokenInfo(&self, slotID: CK_SLOT_ID, pInfo: CK_TOKEN_INFO_PTR) -> CK_RV { (self .C_GetTokenInfo .as_ref() - .expect("Expected function, got error."))(slotID, info) - } - pub unsafe fn C_WaitForSlotEvent( - &self, - flags: CK_FLAGS, - slot: *mut CK_SLOT_ID, - pReserved: *mut ::std::os::raw::c_void, - ) -> CK_RV { - (self - .C_WaitForSlotEvent - .as_ref() - .expect("Expected function, got error."))(flags, slot, pReserved) + .expect("Expected function, got error."))(slotID, pInfo) } pub unsafe fn C_GetMechanismList( &self, slotID: CK_SLOT_ID, - mechanism_list: *mut CK_MECHANISM_TYPE, - ulCount: *mut ::std::os::raw::c_ulong, + pMechanismList: CK_MECHANISM_TYPE_PTR, + pulCount: CK_ULONG_PTR, ) -> CK_RV { (self .C_GetMechanismList .as_ref() - .expect("Expected function, got error."))(slotID, mechanism_list, ulCount) + .expect("Expected function, got error."))(slotID, pMechanismList, pulCount) } pub unsafe fn C_GetMechanismInfo( &self, slotID: CK_SLOT_ID, type_: CK_MECHANISM_TYPE, - info: *mut _CK_MECHANISM_INFO, + pInfo: CK_MECHANISM_INFO_PTR, ) -> CK_RV { (self .C_GetMechanismInfo .as_ref() - .expect("Expected function, got error."))(slotID, type_, info) + .expect("Expected function, got error."))(slotID, type_, pInfo) } pub unsafe fn C_InitToken( &self, slotID: CK_SLOT_ID, - pin: *mut ::std::os::raw::c_uchar, - pin_len: ::std::os::raw::c_ulong, - label: *mut ::std::os::raw::c_uchar, + pPin: CK_UTF8CHAR_PTR, + ulPinLen: CK_ULONG, + pLabel: CK_UTF8CHAR_PTR, ) -> CK_RV { (self .C_InitToken .as_ref() - .expect("Expected function, got error."))(slotID, pin, pin_len, label) + .expect("Expected function, got error."))(slotID, pPin, ulPinLen, pLabel) } pub unsafe fn C_InitPIN( &self, - session: CK_SESSION_HANDLE, - pin: *mut ::std::os::raw::c_uchar, - pin_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pPin: CK_UTF8CHAR_PTR, + ulPinLen: CK_ULONG, ) -> CK_RV { (self .C_InitPIN .as_ref() - .expect("Expected function, got error."))(session, pin, pin_len) + .expect("Expected function, got error."))(hSession, pPin, ulPinLen) } pub unsafe fn C_SetPIN( &self, - session: CK_SESSION_HANDLE, - old_pin: *mut ::std::os::raw::c_uchar, - old_len: ::std::os::raw::c_ulong, - new_pin: *mut ::std::os::raw::c_uchar, - new_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pOldPin: CK_UTF8CHAR_PTR, + ulOldLen: CK_ULONG, + pNewPin: CK_UTF8CHAR_PTR, + ulNewLen: CK_ULONG, ) -> CK_RV { (self .C_SetPIN .as_ref() .expect("Expected function, got error."))( - session, old_pin, old_len, new_pin, new_len + hSession, pOldPin, ulOldLen, pNewPin, ulNewLen, ) } pub unsafe fn C_OpenSession( &self, slotID: CK_SLOT_ID, flags: CK_FLAGS, - application: *mut ::std::os::raw::c_void, - notify: CK_NOTIFY, - session: *mut CK_SESSION_HANDLE, + pApplication: CK_VOID_PTR, + Notify: CK_NOTIFY, + phSession: CK_SESSION_HANDLE_PTR, ) -> CK_RV { (self .C_OpenSession .as_ref() .expect("Expected function, got error."))( - slotID, flags, application, notify, session + slotID, + flags, + pApplication, + Notify, + phSession, ) } - pub unsafe fn C_CloseSession(&self, session: CK_SESSION_HANDLE) -> CK_RV { + pub unsafe fn C_CloseSession(&self, hSession: CK_SESSION_HANDLE) -> CK_RV { (self .C_CloseSession .as_ref() - .expect("Expected function, got error."))(session) + .expect("Expected function, got error."))(hSession) } pub unsafe fn C_CloseAllSessions(&self, slotID: CK_SLOT_ID) -> CK_RV { (self @@ -4344,723 +11584,1119 @@ impl Pkcs11 { } pub unsafe fn C_GetSessionInfo( &self, - session: CK_SESSION_HANDLE, - info: *mut _CK_SESSION_INFO, + hSession: CK_SESSION_HANDLE, + pInfo: CK_SESSION_INFO_PTR, ) -> CK_RV { (self .C_GetSessionInfo .as_ref() - .expect("Expected function, got error."))(session, info) + .expect("Expected function, got error."))(hSession, pInfo) } pub unsafe fn C_GetOperationState( &self, - session: CK_SESSION_HANDLE, - operation_state: *mut ::std::os::raw::c_uchar, - operation_state_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pOperationState: CK_BYTE_PTR, + pulOperationStateLen: CK_ULONG_PTR, ) -> CK_RV { (self .C_GetOperationState .as_ref() .expect("Expected function, got error."))( - session, operation_state, operation_state_len + hSession, + pOperationState, + pulOperationStateLen, ) } pub unsafe fn C_SetOperationState( &self, - session: CK_SESSION_HANDLE, - operation_state: *mut ::std::os::raw::c_uchar, - operation_state_len: ::std::os::raw::c_ulong, - encryption_key: CK_OBJECT_HANDLE, - authentiation_key: CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pOperationState: CK_BYTE_PTR, + ulOperationStateLen: CK_ULONG, + hEncryptionKey: CK_OBJECT_HANDLE, + hAuthenticationKey: CK_OBJECT_HANDLE, ) -> CK_RV { (self .C_SetOperationState .as_ref() .expect("Expected function, got error."))( - session, - operation_state, - operation_state_len, - encryption_key, - authentiation_key, + hSession, + pOperationState, + ulOperationStateLen, + hEncryptionKey, + hAuthenticationKey, ) } pub unsafe fn C_Login( &self, - session: CK_SESSION_HANDLE, - user_type: CK_USER_TYPE, - pin: *mut ::std::os::raw::c_uchar, - pin_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + userType: CK_USER_TYPE, + pPin: CK_UTF8CHAR_PTR, + ulPinLen: CK_ULONG, ) -> CK_RV { (self .C_Login .as_ref() - .expect("Expected function, got error."))(session, user_type, pin, pin_len) + .expect("Expected function, got error."))(hSession, userType, pPin, ulPinLen) } - pub unsafe fn C_Logout(&self, session: CK_SESSION_HANDLE) -> CK_RV { + pub unsafe fn C_Logout(&self, hSession: CK_SESSION_HANDLE) -> CK_RV { (self .C_Logout .as_ref() - .expect("Expected function, got error."))(session) + .expect("Expected function, got error."))(hSession) } pub unsafe fn C_CreateObject( &self, - session: CK_SESSION_HANDLE, - templ: *mut _CK_ATTRIBUTE, - ulCount: ::std::os::raw::c_ulong, - object: *mut CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pTemplate: CK_ATTRIBUTE_PTR, + ulCount: CK_ULONG, + phObject: CK_OBJECT_HANDLE_PTR, ) -> CK_RV { (self .C_CreateObject .as_ref() - .expect("Expected function, got error."))(session, templ, ulCount, object) + .expect("Expected function, got error."))(hSession, pTemplate, ulCount, phObject) } pub unsafe fn C_CopyObject( &self, - session: CK_SESSION_HANDLE, - object: CK_OBJECT_HANDLE, - templ: *mut _CK_ATTRIBUTE, - ulCount: ::std::os::raw::c_ulong, - new_object: *mut CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + hObject: CK_OBJECT_HANDLE, + pTemplate: CK_ATTRIBUTE_PTR, + ulCount: CK_ULONG, + phNewObject: CK_OBJECT_HANDLE_PTR, ) -> CK_RV { (self .C_CopyObject .as_ref() .expect("Expected function, got error."))( - session, object, templ, ulCount, new_object + hSession, + hObject, + pTemplate, + ulCount, + phNewObject, ) } pub unsafe fn C_DestroyObject( &self, - session: CK_SESSION_HANDLE, - object: CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + hObject: CK_OBJECT_HANDLE, ) -> CK_RV { (self .C_DestroyObject .as_ref() - .expect("Expected function, got error."))(session, object) + .expect("Expected function, got error."))(hSession, hObject) } pub unsafe fn C_GetObjectSize( &self, - session: CK_SESSION_HANDLE, - object: CK_OBJECT_HANDLE, - size: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + hObject: CK_OBJECT_HANDLE, + pulSize: CK_ULONG_PTR, ) -> CK_RV { (self .C_GetObjectSize .as_ref() - .expect("Expected function, got error."))(session, object, size) + .expect("Expected function, got error."))(hSession, hObject, pulSize) } pub unsafe fn C_GetAttributeValue( &self, - session: CK_SESSION_HANDLE, - object: CK_OBJECT_HANDLE, - templ: *mut _CK_ATTRIBUTE, - ulCount: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + hObject: CK_OBJECT_HANDLE, + pTemplate: CK_ATTRIBUTE_PTR, + ulCount: CK_ULONG, ) -> CK_RV { (self .C_GetAttributeValue .as_ref() - .expect("Expected function, got error."))(session, object, templ, ulCount) + .expect("Expected function, got error."))(hSession, hObject, pTemplate, ulCount) } pub unsafe fn C_SetAttributeValue( &self, - session: CK_SESSION_HANDLE, - object: CK_OBJECT_HANDLE, - templ: *mut _CK_ATTRIBUTE, - ulCount: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + hObject: CK_OBJECT_HANDLE, + pTemplate: CK_ATTRIBUTE_PTR, + ulCount: CK_ULONG, ) -> CK_RV { (self .C_SetAttributeValue .as_ref() - .expect("Expected function, got error."))(session, object, templ, ulCount) + .expect("Expected function, got error."))(hSession, hObject, pTemplate, ulCount) } pub unsafe fn C_FindObjectsInit( &self, - session: CK_SESSION_HANDLE, - templ: *mut _CK_ATTRIBUTE, - ulCount: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pTemplate: CK_ATTRIBUTE_PTR, + ulCount: CK_ULONG, ) -> CK_RV { (self .C_FindObjectsInit .as_ref() - .expect("Expected function, got error."))(session, templ, ulCount) + .expect("Expected function, got error."))(hSession, pTemplate, ulCount) } pub unsafe fn C_FindObjects( &self, - session: CK_SESSION_HANDLE, - object: *mut CK_OBJECT_HANDLE, - max_object_count: ::std::os::raw::c_ulong, - object_count: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + phObject: CK_OBJECT_HANDLE_PTR, + ulMaxObjectCount: CK_ULONG, + pulObjectCount: CK_ULONG_PTR, ) -> CK_RV { (self .C_FindObjects .as_ref() .expect("Expected function, got error."))( - session, - object, - max_object_count, - object_count, + hSession, + phObject, + ulMaxObjectCount, + pulObjectCount, ) } - pub unsafe fn C_FindObjectsFinal(&self, session: CK_SESSION_HANDLE) -> CK_RV { + pub unsafe fn C_FindObjectsFinal(&self, hSession: CK_SESSION_HANDLE) -> CK_RV { (self .C_FindObjectsFinal .as_ref() - .expect("Expected function, got error."))(session) + .expect("Expected function, got error."))(hSession) } pub unsafe fn C_EncryptInit( &self, - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - key: CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, ) -> CK_RV { (self .C_EncryptInit .as_ref() - .expect("Expected function, got error."))(session, mechanism, key) + .expect("Expected function, got error."))(hSession, pMechanism, hKey) } pub unsafe fn C_Encrypt( &self, - session: CK_SESSION_HANDLE, - data: *mut ::std::os::raw::c_uchar, - data_len: ::std::os::raw::c_ulong, - encrypted_data: *mut ::std::os::raw::c_uchar, - encrypted_data_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pEncryptedData: CK_BYTE_PTR, + pulEncryptedDataLen: CK_ULONG_PTR, ) -> CK_RV { (self .C_Encrypt .as_ref() .expect("Expected function, got error."))( - session, - data, - data_len, - encrypted_data, - encrypted_data_len, + hSession, + pData, + ulDataLen, + pEncryptedData, + pulEncryptedDataLen, ) } pub unsafe fn C_EncryptUpdate( &self, - session: CK_SESSION_HANDLE, - part: *mut ::std::os::raw::c_uchar, - part_len: ::std::os::raw::c_ulong, - encrypted_part: *mut ::std::os::raw::c_uchar, - encrypted_part_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pPart: CK_BYTE_PTR, + ulPartLen: CK_ULONG, + pEncryptedPart: CK_BYTE_PTR, + pulEncryptedPartLen: CK_ULONG_PTR, ) -> CK_RV { (self .C_EncryptUpdate .as_ref() .expect("Expected function, got error."))( - session, - part, - part_len, - encrypted_part, - encrypted_part_len, + hSession, + pPart, + ulPartLen, + pEncryptedPart, + pulEncryptedPartLen, ) } pub unsafe fn C_EncryptFinal( &self, - session: CK_SESSION_HANDLE, - last_encrypted_part: *mut ::std::os::raw::c_uchar, - last_encrypted_part_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pLastEncryptedPart: CK_BYTE_PTR, + pulLastEncryptedPartLen: CK_ULONG_PTR, ) -> CK_RV { (self .C_EncryptFinal .as_ref() .expect("Expected function, got error."))( - session, - last_encrypted_part, - last_encrypted_part_len, + hSession, + pLastEncryptedPart, + pulLastEncryptedPartLen, ) } pub unsafe fn C_DecryptInit( &self, - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - key: CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, ) -> CK_RV { (self .C_DecryptInit .as_ref() - .expect("Expected function, got error."))(session, mechanism, key) + .expect("Expected function, got error."))(hSession, pMechanism, hKey) } pub unsafe fn C_Decrypt( &self, - session: CK_SESSION_HANDLE, - encrypted_data: *mut ::std::os::raw::c_uchar, - encrypted_data_len: ::std::os::raw::c_ulong, - data: *mut ::std::os::raw::c_uchar, - data_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pEncryptedData: CK_BYTE_PTR, + ulEncryptedDataLen: CK_ULONG, + pData: CK_BYTE_PTR, + pulDataLen: CK_ULONG_PTR, ) -> CK_RV { (self .C_Decrypt .as_ref() .expect("Expected function, got error."))( - session, - encrypted_data, - encrypted_data_len, - data, - data_len, + hSession, + pEncryptedData, + ulEncryptedDataLen, + pData, + pulDataLen, ) } pub unsafe fn C_DecryptUpdate( &self, - session: CK_SESSION_HANDLE, - encrypted_part: *mut ::std::os::raw::c_uchar, - encrypted_part_len: ::std::os::raw::c_ulong, - part: *mut ::std::os::raw::c_uchar, - part_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pEncryptedPart: CK_BYTE_PTR, + ulEncryptedPartLen: CK_ULONG, + pPart: CK_BYTE_PTR, + pulPartLen: CK_ULONG_PTR, ) -> CK_RV { (self .C_DecryptUpdate .as_ref() .expect("Expected function, got error."))( - session, - encrypted_part, - encrypted_part_len, - part, - part_len, + hSession, + pEncryptedPart, + ulEncryptedPartLen, + pPart, + pulPartLen, ) } pub unsafe fn C_DecryptFinal( &self, - session: CK_SESSION_HANDLE, - last_part: *mut ::std::os::raw::c_uchar, - last_part_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pLastPart: CK_BYTE_PTR, + pulLastPartLen: CK_ULONG_PTR, ) -> CK_RV { (self .C_DecryptFinal .as_ref() - .expect("Expected function, got error."))(session, last_part, last_part_len) + .expect("Expected function, got error."))(hSession, pLastPart, pulLastPartLen) } pub unsafe fn C_DigestInit( &self, - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, ) -> CK_RV { (self .C_DigestInit .as_ref() - .expect("Expected function, got error."))(session, mechanism) + .expect("Expected function, got error."))(hSession, pMechanism) } pub unsafe fn C_Digest( &self, - session: CK_SESSION_HANDLE, - data: *mut ::std::os::raw::c_uchar, - data_len: ::std::os::raw::c_ulong, - digest: *mut ::std::os::raw::c_uchar, - digest_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pDigest: CK_BYTE_PTR, + pulDigestLen: CK_ULONG_PTR, ) -> CK_RV { (self .C_Digest .as_ref() .expect("Expected function, got error."))( - session, data, data_len, digest, digest_len + hSession, + pData, + ulDataLen, + pDigest, + pulDigestLen, ) } pub unsafe fn C_DigestUpdate( &self, - session: CK_SESSION_HANDLE, - part: *mut ::std::os::raw::c_uchar, - part_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pPart: CK_BYTE_PTR, + ulPartLen: CK_ULONG, ) -> CK_RV { (self .C_DigestUpdate .as_ref() - .expect("Expected function, got error."))(session, part, part_len) + .expect("Expected function, got error."))(hSession, pPart, ulPartLen) } - pub unsafe fn C_DigestKey(&self, session: CK_SESSION_HANDLE, key: CK_OBJECT_HANDLE) -> CK_RV { + pub unsafe fn C_DigestKey(&self, hSession: CK_SESSION_HANDLE, hKey: CK_OBJECT_HANDLE) -> CK_RV { (self .C_DigestKey .as_ref() - .expect("Expected function, got error."))(session, key) + .expect("Expected function, got error."))(hSession, hKey) } pub unsafe fn C_DigestFinal( &self, - session: CK_SESSION_HANDLE, - digest: *mut ::std::os::raw::c_uchar, - digest_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pDigest: CK_BYTE_PTR, + pulDigestLen: CK_ULONG_PTR, ) -> CK_RV { (self .C_DigestFinal .as_ref() - .expect("Expected function, got error."))(session, digest, digest_len) + .expect("Expected function, got error."))(hSession, pDigest, pulDigestLen) } pub unsafe fn C_SignInit( &self, - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - key: CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, ) -> CK_RV { (self .C_SignInit .as_ref() - .expect("Expected function, got error."))(session, mechanism, key) + .expect("Expected function, got error."))(hSession, pMechanism, hKey) } pub unsafe fn C_Sign( &self, - session: CK_SESSION_HANDLE, - data: *mut ::std::os::raw::c_uchar, - data_len: ::std::os::raw::c_ulong, - signature: *mut ::std::os::raw::c_uchar, - signature_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + pulSignatureLen: CK_ULONG_PTR, ) -> CK_RV { (self.C_Sign.as_ref().expect("Expected function, got error."))( - session, - data, - data_len, - signature, - signature_len, + hSession, + pData, + ulDataLen, + pSignature, + pulSignatureLen, ) } pub unsafe fn C_SignUpdate( &self, - session: CK_SESSION_HANDLE, - part: *mut ::std::os::raw::c_uchar, - part_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pPart: CK_BYTE_PTR, + ulPartLen: CK_ULONG, ) -> CK_RV { (self .C_SignUpdate .as_ref() - .expect("Expected function, got error."))(session, part, part_len) + .expect("Expected function, got error."))(hSession, pPart, ulPartLen) } pub unsafe fn C_SignFinal( &self, - session: CK_SESSION_HANDLE, - signature: *mut ::std::os::raw::c_uchar, - signature_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pSignature: CK_BYTE_PTR, + pulSignatureLen: CK_ULONG_PTR, ) -> CK_RV { (self .C_SignFinal .as_ref() - .expect("Expected function, got error."))(session, signature, signature_len) + .expect("Expected function, got error."))(hSession, pSignature, pulSignatureLen) } pub unsafe fn C_SignRecoverInit( &self, - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - key: CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, ) -> CK_RV { (self .C_SignRecoverInit .as_ref() - .expect("Expected function, got error."))(session, mechanism, key) + .expect("Expected function, got error."))(hSession, pMechanism, hKey) } pub unsafe fn C_SignRecover( &self, - session: CK_SESSION_HANDLE, - data: *mut ::std::os::raw::c_uchar, - data_len: ::std::os::raw::c_ulong, - signature: *mut ::std::os::raw::c_uchar, - signature_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + pulSignatureLen: CK_ULONG_PTR, ) -> CK_RV { (self .C_SignRecover .as_ref() .expect("Expected function, got error."))( - session, - data, - data_len, - signature, - signature_len, + hSession, + pData, + ulDataLen, + pSignature, + pulSignatureLen, ) } pub unsafe fn C_VerifyInit( &self, - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - key: CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, ) -> CK_RV { (self .C_VerifyInit .as_ref() - .expect("Expected function, got error."))(session, mechanism, key) + .expect("Expected function, got error."))(hSession, pMechanism, hKey) } pub unsafe fn C_Verify( &self, - session: CK_SESSION_HANDLE, - data: *mut ::std::os::raw::c_uchar, - data_len: ::std::os::raw::c_ulong, - signature: *mut ::std::os::raw::c_uchar, - signature_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + ulSignatureLen: CK_ULONG, ) -> CK_RV { (self .C_Verify .as_ref() .expect("Expected function, got error."))( - session, - data, - data_len, - signature, - signature_len, + hSession, + pData, + ulDataLen, + pSignature, + ulSignatureLen, ) } pub unsafe fn C_VerifyUpdate( &self, - session: CK_SESSION_HANDLE, - part: *mut ::std::os::raw::c_uchar, - part_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pPart: CK_BYTE_PTR, + ulPartLen: CK_ULONG, ) -> CK_RV { (self .C_VerifyUpdate .as_ref() - .expect("Expected function, got error."))(session, part, part_len) + .expect("Expected function, got error."))(hSession, pPart, ulPartLen) } pub unsafe fn C_VerifyFinal( &self, - session: CK_SESSION_HANDLE, - signature: *mut ::std::os::raw::c_uchar, - signature_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pSignature: CK_BYTE_PTR, + ulSignatureLen: CK_ULONG, ) -> CK_RV { (self .C_VerifyFinal .as_ref() - .expect("Expected function, got error."))(session, signature, signature_len) + .expect("Expected function, got error."))(hSession, pSignature, ulSignatureLen) } pub unsafe fn C_VerifyRecoverInit( &self, - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - key: CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, ) -> CK_RV { (self .C_VerifyRecoverInit .as_ref() - .expect("Expected function, got error."))(session, mechanism, key) + .expect("Expected function, got error."))(hSession, pMechanism, hKey) } pub unsafe fn C_VerifyRecover( &self, - session: CK_SESSION_HANDLE, - signature: *mut ::std::os::raw::c_uchar, - signature_len: ::std::os::raw::c_ulong, - data: *mut ::std::os::raw::c_uchar, - data_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pSignature: CK_BYTE_PTR, + ulSignatureLen: CK_ULONG, + pData: CK_BYTE_PTR, + pulDataLen: CK_ULONG_PTR, ) -> CK_RV { (self .C_VerifyRecover .as_ref() .expect("Expected function, got error."))( - session, - signature, - signature_len, - data, - data_len, + hSession, + pSignature, + ulSignatureLen, + pData, + pulDataLen, ) } pub unsafe fn C_DigestEncryptUpdate( &self, - session: CK_SESSION_HANDLE, - part: *mut ::std::os::raw::c_uchar, - part_len: ::std::os::raw::c_ulong, - encrypted_part: *mut ::std::os::raw::c_uchar, - encrypted_part_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pPart: CK_BYTE_PTR, + ulPartLen: CK_ULONG, + pEncryptedPart: CK_BYTE_PTR, + pulEncryptedPartLen: CK_ULONG_PTR, ) -> CK_RV { (self .C_DigestEncryptUpdate .as_ref() .expect("Expected function, got error."))( - session, - part, - part_len, - encrypted_part, - encrypted_part_len, + hSession, + pPart, + ulPartLen, + pEncryptedPart, + pulEncryptedPartLen, ) } pub unsafe fn C_DecryptDigestUpdate( &self, - session: CK_SESSION_HANDLE, - encrypted_part: *mut ::std::os::raw::c_uchar, - encrypted_part_len: ::std::os::raw::c_ulong, - part: *mut ::std::os::raw::c_uchar, - part_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pEncryptedPart: CK_BYTE_PTR, + ulEncryptedPartLen: CK_ULONG, + pPart: CK_BYTE_PTR, + pulPartLen: CK_ULONG_PTR, ) -> CK_RV { (self .C_DecryptDigestUpdate .as_ref() .expect("Expected function, got error."))( - session, - encrypted_part, - encrypted_part_len, - part, - part_len, + hSession, + pEncryptedPart, + ulEncryptedPartLen, + pPart, + pulPartLen, ) } pub unsafe fn C_SignEncryptUpdate( &self, - session: CK_SESSION_HANDLE, - part: *mut ::std::os::raw::c_uchar, - part_len: ::std::os::raw::c_ulong, - encrypted_part: *mut ::std::os::raw::c_uchar, - encrypted_part_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pPart: CK_BYTE_PTR, + ulPartLen: CK_ULONG, + pEncryptedPart: CK_BYTE_PTR, + pulEncryptedPartLen: CK_ULONG_PTR, ) -> CK_RV { (self .C_SignEncryptUpdate .as_ref() .expect("Expected function, got error."))( - session, - part, - part_len, - encrypted_part, - encrypted_part_len, + hSession, + pPart, + ulPartLen, + pEncryptedPart, + pulEncryptedPartLen, ) } pub unsafe fn C_DecryptVerifyUpdate( &self, - session: CK_SESSION_HANDLE, - encrypted_part: *mut ::std::os::raw::c_uchar, - encrypted_part_len: ::std::os::raw::c_ulong, - part: *mut ::std::os::raw::c_uchar, - part_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pEncryptedPart: CK_BYTE_PTR, + ulEncryptedPartLen: CK_ULONG, + pPart: CK_BYTE_PTR, + pulPartLen: CK_ULONG_PTR, ) -> CK_RV { (self .C_DecryptVerifyUpdate .as_ref() .expect("Expected function, got error."))( - session, - encrypted_part, - encrypted_part_len, - part, - part_len, + hSession, + pEncryptedPart, + ulEncryptedPartLen, + pPart, + pulPartLen, ) } pub unsafe fn C_GenerateKey( &self, - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - templ: *mut _CK_ATTRIBUTE, - ulCount: ::std::os::raw::c_ulong, - key: *mut CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + pTemplate: CK_ATTRIBUTE_PTR, + ulCount: CK_ULONG, + phKey: CK_OBJECT_HANDLE_PTR, ) -> CK_RV { (self .C_GenerateKey .as_ref() .expect("Expected function, got error."))( - session, mechanism, templ, ulCount, key + hSession, pMechanism, pTemplate, ulCount, phKey, ) } pub unsafe fn C_GenerateKeyPair( &self, - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - public_key_template: *mut _CK_ATTRIBUTE, - public_key_attribute_count: ::std::os::raw::c_ulong, - private_key_template: *mut _CK_ATTRIBUTE, - private_key_attribute_count: ::std::os::raw::c_ulong, - public_key: *mut CK_OBJECT_HANDLE, - private_key: *mut CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + pPublicKeyTemplate: CK_ATTRIBUTE_PTR, + ulPublicKeyAttributeCount: CK_ULONG, + pPrivateKeyTemplate: CK_ATTRIBUTE_PTR, + ulPrivateKeyAttributeCount: CK_ULONG, + phPublicKey: CK_OBJECT_HANDLE_PTR, + phPrivateKey: CK_OBJECT_HANDLE_PTR, ) -> CK_RV { (self .C_GenerateKeyPair .as_ref() .expect("Expected function, got error."))( - session, - mechanism, - public_key_template, - public_key_attribute_count, - private_key_template, - private_key_attribute_count, - public_key, - private_key, + hSession, + pMechanism, + pPublicKeyTemplate, + ulPublicKeyAttributeCount, + pPrivateKeyTemplate, + ulPrivateKeyAttributeCount, + phPublicKey, + phPrivateKey, ) } pub unsafe fn C_WrapKey( &self, - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - wrapping_key: CK_OBJECT_HANDLE, - key: CK_OBJECT_HANDLE, - wrapped_key: *mut ::std::os::raw::c_uchar, - wrapped_key_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hWrappingKey: CK_OBJECT_HANDLE, + hKey: CK_OBJECT_HANDLE, + pWrappedKey: CK_BYTE_PTR, + pulWrappedKeyLen: CK_ULONG_PTR, ) -> CK_RV { (self .C_WrapKey .as_ref() .expect("Expected function, got error."))( - session, - mechanism, - wrapping_key, - key, - wrapped_key, - wrapped_key_len, + hSession, + pMechanism, + hWrappingKey, + hKey, + pWrappedKey, + pulWrappedKeyLen, ) } pub unsafe fn C_UnwrapKey( &self, - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - unwrapping_key: CK_OBJECT_HANDLE, - wrapped_key: *mut ::std::os::raw::c_uchar, - wrapped_key_len: ::std::os::raw::c_ulong, - templ: *mut _CK_ATTRIBUTE, - attribute_count: ::std::os::raw::c_ulong, - key: *mut CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hUnwrappingKey: CK_OBJECT_HANDLE, + pWrappedKey: CK_BYTE_PTR, + ulWrappedKeyLen: CK_ULONG, + pTemplate: CK_ATTRIBUTE_PTR, + ulAttributeCount: CK_ULONG, + phKey: CK_OBJECT_HANDLE_PTR, ) -> CK_RV { (self .C_UnwrapKey .as_ref() .expect("Expected function, got error."))( - session, - mechanism, - unwrapping_key, - wrapped_key, - wrapped_key_len, - templ, - attribute_count, - key, + hSession, + pMechanism, + hUnwrappingKey, + pWrappedKey, + ulWrappedKeyLen, + pTemplate, + ulAttributeCount, + phKey, ) } pub unsafe fn C_DeriveKey( &self, - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - base_key: CK_OBJECT_HANDLE, - templ: *mut _CK_ATTRIBUTE, - attribute_count: ::std::os::raw::c_ulong, - key: *mut CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hBaseKey: CK_OBJECT_HANDLE, + pTemplate: CK_ATTRIBUTE_PTR, + ulAttributeCount: CK_ULONG, + phKey: CK_OBJECT_HANDLE_PTR, ) -> CK_RV { (self .C_DeriveKey .as_ref() .expect("Expected function, got error."))( - session, - mechanism, - base_key, - templ, - attribute_count, - key, + hSession, + pMechanism, + hBaseKey, + pTemplate, + ulAttributeCount, + phKey, ) } pub unsafe fn C_SeedRandom( &self, - session: CK_SESSION_HANDLE, - seed: *mut ::std::os::raw::c_uchar, - seed_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pSeed: CK_BYTE_PTR, + ulSeedLen: CK_ULONG, ) -> CK_RV { (self .C_SeedRandom .as_ref() - .expect("Expected function, got error."))(session, seed, seed_len) + .expect("Expected function, got error."))(hSession, pSeed, ulSeedLen) } pub unsafe fn C_GenerateRandom( &self, - session: CK_SESSION_HANDLE, - random_data: *mut ::std::os::raw::c_uchar, - random_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + RandomData: CK_BYTE_PTR, + ulRandomLen: CK_ULONG, ) -> CK_RV { (self .C_GenerateRandom .as_ref() - .expect("Expected function, got error."))(session, random_data, random_len) + .expect("Expected function, got error."))(hSession, RandomData, ulRandomLen) } - pub unsafe fn C_GetFunctionStatus(&self, session: CK_SESSION_HANDLE) -> CK_RV { + pub unsafe fn C_GetFunctionStatus(&self, hSession: CK_SESSION_HANDLE) -> CK_RV { (self .C_GetFunctionStatus .as_ref() - .expect("Expected function, got error."))(session) + .expect("Expected function, got error."))(hSession) } - pub unsafe fn C_CancelFunction(&self, session: CK_SESSION_HANDLE) -> CK_RV { + pub unsafe fn C_CancelFunction(&self, hSession: CK_SESSION_HANDLE) -> CK_RV { (self .C_CancelFunction .as_ref() - .expect("Expected function, got error."))(session) + .expect("Expected function, got error."))(hSession) + } + pub unsafe fn C_WaitForSlotEvent( + &self, + flags: CK_FLAGS, + pSlot: CK_SLOT_ID_PTR, + pRserved: CK_VOID_PTR, + ) -> CK_RV { + (self + .C_WaitForSlotEvent + .as_ref() + .expect("Expected function, got error."))(flags, pSlot, pRserved) + } + pub unsafe fn C_GetInterfaceList( + &self, + pInterfacesList: CK_INTERFACE_PTR, + pulCount: CK_ULONG_PTR, + ) -> CK_RV { + (self + .C_GetInterfaceList + .as_ref() + .expect("Expected function, got error."))(pInterfacesList, pulCount) + } + pub unsafe fn C_GetInterface( + &self, + pInterfaceName: CK_UTF8CHAR_PTR, + pVersion: CK_VERSION_PTR, + ppInterface: CK_INTERFACE_PTR_PTR, + flags: CK_FLAGS, + ) -> CK_RV { + (self + .C_GetInterface + .as_ref() + .expect("Expected function, got error."))( + pInterfaceName, pVersion, ppInterface, flags + ) + } + pub unsafe fn C_LoginUser( + &self, + hSession: CK_SESSION_HANDLE, + userType: CK_USER_TYPE, + pPin: CK_UTF8CHAR_PTR, + ulPinLen: CK_ULONG, + pUsername: CK_UTF8CHAR_PTR, + ulUsernameLen: CK_ULONG, + ) -> CK_RV { + (self + .C_LoginUser + .as_ref() + .expect("Expected function, got error."))( + hSession, + userType, + pPin, + ulPinLen, + pUsername, + ulUsernameLen, + ) + } + pub unsafe fn C_SessionCancel(&self, hSession: CK_SESSION_HANDLE, flags: CK_FLAGS) -> CK_RV { + (self + .C_SessionCancel + .as_ref() + .expect("Expected function, got error."))(hSession, flags) + } + pub unsafe fn C_MessageEncryptInit( + &self, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, + ) -> CK_RV { + (self + .C_MessageEncryptInit + .as_ref() + .expect("Expected function, got error."))(hSession, pMechanism, hKey) + } + pub unsafe fn C_EncryptMessage( + &self, + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pAssociatedData: CK_BYTE_PTR, + ulAssociatedDataLen: CK_ULONG, + pPlaintext: CK_BYTE_PTR, + ulPlaintextLen: CK_ULONG, + pCiphertext: CK_BYTE_PTR, + pulCiphertextLen: CK_ULONG_PTR, + ) -> CK_RV { + (self + .C_EncryptMessage + .as_ref() + .expect("Expected function, got error."))( + hSession, + pParameter, + ulParameterLen, + pAssociatedData, + ulAssociatedDataLen, + pPlaintext, + ulPlaintextLen, + pCiphertext, + pulCiphertextLen, + ) + } + pub unsafe fn C_EncryptMessageBegin( + &self, + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pAssociatedData: CK_BYTE_PTR, + ulAssociatedDataLen: CK_ULONG, + ) -> CK_RV { + (self + .C_EncryptMessageBegin + .as_ref() + .expect("Expected function, got error."))( + hSession, + pParameter, + ulParameterLen, + pAssociatedData, + ulAssociatedDataLen, + ) + } + pub unsafe fn C_EncryptMessageNext( + &self, + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pPlaintextPart: CK_BYTE_PTR, + ulPlaintextPartLen: CK_ULONG, + pCiphertextPart: CK_BYTE_PTR, + pulCiphertextPartLen: CK_ULONG_PTR, + flags: CK_FLAGS, + ) -> CK_RV { + (self + .C_EncryptMessageNext + .as_ref() + .expect("Expected function, got error."))( + hSession, + pParameter, + ulParameterLen, + pPlaintextPart, + ulPlaintextPartLen, + pCiphertextPart, + pulCiphertextPartLen, + flags, + ) + } + pub unsafe fn C_MessageEncryptFinal(&self, hSession: CK_SESSION_HANDLE) -> CK_RV { + (self + .C_MessageEncryptFinal + .as_ref() + .expect("Expected function, got error."))(hSession) + } + pub unsafe fn C_MessageDecryptInit( + &self, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, + ) -> CK_RV { + (self + .C_MessageDecryptInit + .as_ref() + .expect("Expected function, got error."))(hSession, pMechanism, hKey) + } + pub unsafe fn C_DecryptMessage( + &self, + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pAssociatedData: CK_BYTE_PTR, + ulAssociatedDataLen: CK_ULONG, + pCiphertext: CK_BYTE_PTR, + ulCiphertextLen: CK_ULONG, + pPlaintext: CK_BYTE_PTR, + pulPlaintextLen: CK_ULONG_PTR, + ) -> CK_RV { + (self + .C_DecryptMessage + .as_ref() + .expect("Expected function, got error."))( + hSession, + pParameter, + ulParameterLen, + pAssociatedData, + ulAssociatedDataLen, + pCiphertext, + ulCiphertextLen, + pPlaintext, + pulPlaintextLen, + ) + } + pub unsafe fn C_DecryptMessageBegin( + &self, + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pAssociatedData: CK_BYTE_PTR, + ulAssociatedDataLen: CK_ULONG, + ) -> CK_RV { + (self + .C_DecryptMessageBegin + .as_ref() + .expect("Expected function, got error."))( + hSession, + pParameter, + ulParameterLen, + pAssociatedData, + ulAssociatedDataLen, + ) + } + pub unsafe fn C_DecryptMessageNext( + &self, + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pCiphertext: CK_BYTE_PTR, + ulCiphertextLen: CK_ULONG, + pPlaintext: CK_BYTE_PTR, + pulPlaintextLen: CK_ULONG_PTR, + flags: CK_FLAGS, + ) -> CK_RV { + (self + .C_DecryptMessageNext + .as_ref() + .expect("Expected function, got error."))( + hSession, + pParameter, + ulParameterLen, + pCiphertext, + ulCiphertextLen, + pPlaintext, + pulPlaintextLen, + flags, + ) + } + pub unsafe fn C_MessageDecryptFinal(&self, hSession: CK_SESSION_HANDLE) -> CK_RV { + (self + .C_MessageDecryptFinal + .as_ref() + .expect("Expected function, got error."))(hSession) + } + pub unsafe fn C_MessageSignInit( + &self, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, + ) -> CK_RV { + (self + .C_MessageSignInit + .as_ref() + .expect("Expected function, got error."))(hSession, pMechanism, hKey) + } + pub unsafe fn C_SignMessage( + &self, + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + pulSignatureLen: CK_ULONG_PTR, + ) -> CK_RV { + (self + .C_SignMessage + .as_ref() + .expect("Expected function, got error."))( + hSession, + pParameter, + ulParameterLen, + pData, + ulDataLen, + pSignature, + pulSignatureLen, + ) + } + pub unsafe fn C_SignMessageBegin( + &self, + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + ) -> CK_RV { + (self + .C_SignMessageBegin + .as_ref() + .expect("Expected function, got error."))(hSession, pParameter, ulParameterLen) + } + pub unsafe fn C_SignMessageNext( + &self, + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + pulSignatureLen: CK_ULONG_PTR, + ) -> CK_RV { + (self + .C_SignMessageNext + .as_ref() + .expect("Expected function, got error."))( + hSession, + pParameter, + ulParameterLen, + pData, + ulDataLen, + pSignature, + pulSignatureLen, + ) + } + pub unsafe fn C_MessageSignFinal(&self, hSession: CK_SESSION_HANDLE) -> CK_RV { + (self + .C_MessageSignFinal + .as_ref() + .expect("Expected function, got error."))(hSession) + } + pub unsafe fn C_MessageVerifyInit( + &self, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, + ) -> CK_RV { + (self + .C_MessageVerifyInit + .as_ref() + .expect("Expected function, got error."))(hSession, pMechanism, hKey) + } + pub unsafe fn C_VerifyMessage( + &self, + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + ulSignatureLen: CK_ULONG, + ) -> CK_RV { + (self + .C_VerifyMessage + .as_ref() + .expect("Expected function, got error."))( + hSession, + pParameter, + ulParameterLen, + pData, + ulDataLen, + pSignature, + ulSignatureLen, + ) + } + pub unsafe fn C_VerifyMessageBegin( + &self, + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + ) -> CK_RV { + (self + .C_VerifyMessageBegin + .as_ref() + .expect("Expected function, got error."))(hSession, pParameter, ulParameterLen) + } + pub unsafe fn C_VerifyMessageNext( + &self, + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + ulSignatureLen: CK_ULONG, + ) -> CK_RV { + (self + .C_VerifyMessageNext + .as_ref() + .expect("Expected function, got error."))( + hSession, + pParameter, + ulParameterLen, + pData, + ulDataLen, + pSignature, + ulSignatureLen, + ) + } + pub unsafe fn C_MessageVerifyFinal(&self, hSession: CK_SESSION_HANDLE) -> CK_RV { + (self + .C_MessageVerifyFinal + .as_ref() + .expect("Expected function, got error."))(hSession) } } diff --git a/cryptoki-sys/src/bindings/generic.rs b/cryptoki-sys/src/bindings/generic.rs new file mode 100644 index 00000000..0d908cb8 --- /dev/null +++ b/cryptoki-sys/src/bindings/generic.rs @@ -0,0 +1,5519 @@ +/* automatically generated by rust-bindgen 0.63.0 */ + +pub const CRYPTOKI_FORCE_WIN32: u32 = 1; +pub const NULL_PTR: u32 = 0; +pub const _PKCS11_H_: u32 = 1; +pub const _PKCS11T_H_: u32 = 1; +pub const CRYPTOKI_VERSION_MAJOR: CK_BYTE = 3; +pub const CRYPTOKI_VERSION_MINOR: CK_BYTE = 0; +pub const CRYPTOKI_VERSION_AMENDMENT: CK_BYTE = 0; +pub const CK_TRUE: CK_BBOOL = 1; +pub const CK_FALSE: CK_BBOOL = 0; +pub const FALSE: u32 = 0; +pub const TRUE: u32 = 1; +pub const CK_EFFECTIVELY_INFINITE: CK_ULONG = 0; +pub const CK_INVALID_HANDLE: CK_ULONG = 0; +pub const CKN_SURRENDER: CK_NOTIFICATION = 0; +pub const CKN_OTP_CHANGED: CK_NOTIFICATION = 1; +pub const CKF_TOKEN_PRESENT: CK_FLAGS = 1; +pub const CKF_REMOVABLE_DEVICE: CK_FLAGS = 2; +pub const CKF_HW_SLOT: CK_FLAGS = 4; +pub const CKF_RNG: CK_FLAGS = 1; +pub const CKF_WRITE_PROTECTED: CK_FLAGS = 2; +pub const CKF_LOGIN_REQUIRED: CK_FLAGS = 4; +pub const CKF_USER_PIN_INITIALIZED: CK_FLAGS = 8; +pub const CKF_RESTORE_KEY_NOT_NEEDED: CK_FLAGS = 32; +pub const CKF_CLOCK_ON_TOKEN: CK_FLAGS = 64; +pub const CKF_PROTECTED_AUTHENTICATION_PATH: CK_FLAGS = 256; +pub const CKF_DUAL_CRYPTO_OPERATIONS: CK_FLAGS = 512; +pub const CKF_TOKEN_INITIALIZED: CK_FLAGS = 1024; +pub const CKF_SECONDARY_AUTHENTICATION: CK_FLAGS = 2048; +pub const CKF_USER_PIN_COUNT_LOW: CK_FLAGS = 65536; +pub const CKF_USER_PIN_FINAL_TRY: CK_FLAGS = 131072; +pub const CKF_USER_PIN_LOCKED: CK_FLAGS = 262144; +pub const CKF_USER_PIN_TO_BE_CHANGED: CK_FLAGS = 524288; +pub const CKF_SO_PIN_COUNT_LOW: CK_FLAGS = 1048576; +pub const CKF_SO_PIN_FINAL_TRY: CK_FLAGS = 2097152; +pub const CKF_SO_PIN_LOCKED: CK_FLAGS = 4194304; +pub const CKF_SO_PIN_TO_BE_CHANGED: CK_FLAGS = 8388608; +pub const CKF_ERROR_STATE: CK_FLAGS = 16777216; +pub const CKU_SO: CK_USER_TYPE = 0; +pub const CKU_USER: CK_USER_TYPE = 1; +pub const CKU_CONTEXT_SPECIFIC: CK_USER_TYPE = 2; +pub const CKS_RO_PUBLIC_SESSION: CK_STATE = 0; +pub const CKS_RO_USER_FUNCTIONS: CK_STATE = 1; +pub const CKS_RW_PUBLIC_SESSION: CK_STATE = 2; +pub const CKS_RW_USER_FUNCTIONS: CK_STATE = 3; +pub const CKS_RW_SO_FUNCTIONS: CK_STATE = 4; +pub const CKF_RW_SESSION: CK_FLAGS = 2; +pub const CKF_SERIAL_SESSION: CK_FLAGS = 4; +pub const CKO_DATA: CK_OBJECT_CLASS = 0; +pub const CKO_CERTIFICATE: CK_OBJECT_CLASS = 1; +pub const CKO_PUBLIC_KEY: CK_OBJECT_CLASS = 2; +pub const CKO_PRIVATE_KEY: CK_OBJECT_CLASS = 3; +pub const CKO_SECRET_KEY: CK_OBJECT_CLASS = 4; +pub const CKO_HW_FEATURE: CK_OBJECT_CLASS = 5; +pub const CKO_DOMAIN_PARAMETERS: CK_OBJECT_CLASS = 6; +pub const CKO_MECHANISM: CK_OBJECT_CLASS = 7; +pub const CKO_OTP_KEY: CK_OBJECT_CLASS = 8; +pub const CKO_PROFILE: CK_OBJECT_CLASS = 9; +pub const CKO_VENDOR_DEFINED: CK_OBJECT_CLASS = 2147483648; +pub const CKP_INVALID_ID: CK_PROFILE_ID = 0; +pub const CKP_BASELINE_PROVIDER: CK_PROFILE_ID = 1; +pub const CKP_EXTENDED_PROVIDER: CK_PROFILE_ID = 2; +pub const CKP_AUTHENTICATION_TOKEN: CK_PROFILE_ID = 3; +pub const CKP_PUBLIC_CERTIFICATES_TOKEN: CK_PROFILE_ID = 4; +pub const CKP_VENDOR_DEFINED: CK_PROFILE_ID = 2147483648; +pub const CKH_MONOTONIC_COUNTER: CK_HW_FEATURE_TYPE = 1; +pub const CKH_CLOCK: CK_HW_FEATURE_TYPE = 2; +pub const CKH_USER_INTERFACE: CK_HW_FEATURE_TYPE = 3; +pub const CKH_VENDOR_DEFINED: CK_HW_FEATURE_TYPE = 2147483648; +pub const CKK_RSA: CK_KEY_TYPE = 0; +pub const CKK_DSA: CK_KEY_TYPE = 1; +pub const CKK_DH: CK_KEY_TYPE = 2; +pub const CKK_ECDSA: CK_KEY_TYPE = 3; +pub const CKK_EC: CK_KEY_TYPE = 3; +pub const CKK_X9_42_DH: CK_KEY_TYPE = 4; +pub const CKK_KEA: CK_KEY_TYPE = 5; +pub const CKK_GENERIC_SECRET: CK_KEY_TYPE = 16; +pub const CKK_RC2: CK_KEY_TYPE = 17; +pub const CKK_RC4: CK_KEY_TYPE = 18; +pub const CKK_DES: CK_KEY_TYPE = 19; +pub const CKK_DES2: CK_KEY_TYPE = 20; +pub const CKK_DES3: CK_KEY_TYPE = 21; +pub const CKK_CAST: CK_KEY_TYPE = 22; +pub const CKK_CAST3: CK_KEY_TYPE = 23; +pub const CKK_CAST5: CK_KEY_TYPE = 24; +pub const CKK_CAST128: CK_KEY_TYPE = 24; +pub const CKK_RC5: CK_KEY_TYPE = 25; +pub const CKK_IDEA: CK_KEY_TYPE = 26; +pub const CKK_SKIPJACK: CK_KEY_TYPE = 27; +pub const CKK_BATON: CK_KEY_TYPE = 28; +pub const CKK_JUNIPER: CK_KEY_TYPE = 29; +pub const CKK_CDMF: CK_KEY_TYPE = 30; +pub const CKK_AES: CK_KEY_TYPE = 31; +pub const CKK_BLOWFISH: CK_KEY_TYPE = 32; +pub const CKK_TWOFISH: CK_KEY_TYPE = 33; +pub const CKK_SECURID: CK_KEY_TYPE = 34; +pub const CKK_HOTP: CK_KEY_TYPE = 35; +pub const CKK_ACTI: CK_KEY_TYPE = 36; +pub const CKK_CAMELLIA: CK_KEY_TYPE = 37; +pub const CKK_ARIA: CK_KEY_TYPE = 38; +pub const CKK_MD5_HMAC: CK_KEY_TYPE = 39; +pub const CKK_SHA_1_HMAC: CK_KEY_TYPE = 40; +pub const CKK_RIPEMD128_HMAC: CK_KEY_TYPE = 41; +pub const CKK_RIPEMD160_HMAC: CK_KEY_TYPE = 42; +pub const CKK_SHA256_HMAC: CK_KEY_TYPE = 43; +pub const CKK_SHA384_HMAC: CK_KEY_TYPE = 44; +pub const CKK_SHA512_HMAC: CK_KEY_TYPE = 45; +pub const CKK_SHA224_HMAC: CK_KEY_TYPE = 46; +pub const CKK_SEED: CK_KEY_TYPE = 47; +pub const CKK_GOSTR3410: CK_KEY_TYPE = 48; +pub const CKK_GOSTR3411: CK_KEY_TYPE = 49; +pub const CKK_GOST28147: CK_KEY_TYPE = 50; +pub const CKK_CHACHA20: CK_KEY_TYPE = 51; +pub const CKK_POLY1305: CK_KEY_TYPE = 52; +pub const CKK_AES_XTS: CK_KEY_TYPE = 53; +pub const CKK_SHA3_224_HMAC: CK_KEY_TYPE = 54; +pub const CKK_SHA3_256_HMAC: CK_KEY_TYPE = 55; +pub const CKK_SHA3_384_HMAC: CK_KEY_TYPE = 56; +pub const CKK_SHA3_512_HMAC: CK_KEY_TYPE = 57; +pub const CKK_BLAKE2B_160_HMAC: CK_KEY_TYPE = 58; +pub const CKK_BLAKE2B_256_HMAC: CK_KEY_TYPE = 59; +pub const CKK_BLAKE2B_384_HMAC: CK_KEY_TYPE = 60; +pub const CKK_BLAKE2B_512_HMAC: CK_KEY_TYPE = 61; +pub const CKK_SALSA20: CK_KEY_TYPE = 62; +pub const CKK_X2RATCHET: CK_KEY_TYPE = 63; +pub const CKK_EC_EDWARDS: CK_KEY_TYPE = 64; +pub const CKK_EC_MONTGOMERY: CK_KEY_TYPE = 65; +pub const CKK_HKDF: CK_KEY_TYPE = 66; +pub const CKK_VENDOR_DEFINED: CK_KEY_TYPE = 2147483648; +pub const CK_CERTIFICATE_CATEGORY_UNSPECIFIED: CK_ULONG = 0; +pub const CK_CERTIFICATE_CATEGORY_TOKEN_USER: CK_ULONG = 1; +pub const CK_CERTIFICATE_CATEGORY_AUTHORITY: CK_ULONG = 2; +pub const CK_CERTIFICATE_CATEGORY_OTHER_ENTITY: CK_ULONG = 3; +pub const CK_SECURITY_DOMAIN_UNSPECIFIED: CK_ULONG = 0; +pub const CK_SECURITY_DOMAIN_MANUFACTURER: CK_ULONG = 1; +pub const CK_SECURITY_DOMAIN_OPERATOR: CK_ULONG = 2; +pub const CK_SECURITY_DOMAIN_THIRD_PARTY: CK_ULONG = 3; +pub const CKC_X_509: CK_CERTIFICATE_TYPE = 0; +pub const CKC_X_509_ATTR_CERT: CK_CERTIFICATE_TYPE = 1; +pub const CKC_WTLS: CK_CERTIFICATE_TYPE = 2; +pub const CKC_VENDOR_DEFINED: CK_CERTIFICATE_TYPE = 2147483648; +pub const CKF_ARRAY_ATTRIBUTE: CK_FLAGS = 1073741824; +pub const CK_OTP_FORMAT_DECIMAL: CK_ULONG = 0; +pub const CK_OTP_FORMAT_HEXADECIMAL: CK_ULONG = 1; +pub const CK_OTP_FORMAT_ALPHANUMERIC: CK_ULONG = 2; +pub const CK_OTP_FORMAT_BINARY: CK_ULONG = 3; +pub const CK_OTP_PARAM_IGNORED: CK_ULONG = 0; +pub const CK_OTP_PARAM_OPTIONAL: CK_ULONG = 1; +pub const CK_OTP_PARAM_MANDATORY: CK_ULONG = 2; +pub const CKA_CLASS: CK_ATTRIBUTE_TYPE = 0; +pub const CKA_TOKEN: CK_ATTRIBUTE_TYPE = 1; +pub const CKA_PRIVATE: CK_ATTRIBUTE_TYPE = 2; +pub const CKA_LABEL: CK_ATTRIBUTE_TYPE = 3; +pub const CKA_UNIQUE_ID: CK_ATTRIBUTE_TYPE = 4; +pub const CKA_APPLICATION: CK_ATTRIBUTE_TYPE = 16; +pub const CKA_VALUE: CK_ATTRIBUTE_TYPE = 17; +pub const CKA_OBJECT_ID: CK_ATTRIBUTE_TYPE = 18; +pub const CKA_CERTIFICATE_TYPE: CK_ATTRIBUTE_TYPE = 128; +pub const CKA_ISSUER: CK_ATTRIBUTE_TYPE = 129; +pub const CKA_SERIAL_NUMBER: CK_ATTRIBUTE_TYPE = 130; +pub const CKA_AC_ISSUER: CK_ATTRIBUTE_TYPE = 131; +pub const CKA_OWNER: CK_ATTRIBUTE_TYPE = 132; +pub const CKA_ATTR_TYPES: CK_ATTRIBUTE_TYPE = 133; +pub const CKA_TRUSTED: CK_ATTRIBUTE_TYPE = 134; +pub const CKA_CERTIFICATE_CATEGORY: CK_ATTRIBUTE_TYPE = 135; +pub const CKA_JAVA_MIDP_SECURITY_DOMAIN: CK_ATTRIBUTE_TYPE = 136; +pub const CKA_URL: CK_ATTRIBUTE_TYPE = 137; +pub const CKA_HASH_OF_SUBJECT_PUBLIC_KEY: CK_ATTRIBUTE_TYPE = 138; +pub const CKA_HASH_OF_ISSUER_PUBLIC_KEY: CK_ATTRIBUTE_TYPE = 139; +pub const CKA_NAME_HASH_ALGORITHM: CK_ATTRIBUTE_TYPE = 140; +pub const CKA_CHECK_VALUE: CK_ATTRIBUTE_TYPE = 144; +pub const CKA_KEY_TYPE: CK_ATTRIBUTE_TYPE = 256; +pub const CKA_SUBJECT: CK_ATTRIBUTE_TYPE = 257; +pub const CKA_ID: CK_ATTRIBUTE_TYPE = 258; +pub const CKA_SENSITIVE: CK_ATTRIBUTE_TYPE = 259; +pub const CKA_ENCRYPT: CK_ATTRIBUTE_TYPE = 260; +pub const CKA_DECRYPT: CK_ATTRIBUTE_TYPE = 261; +pub const CKA_WRAP: CK_ATTRIBUTE_TYPE = 262; +pub const CKA_UNWRAP: CK_ATTRIBUTE_TYPE = 263; +pub const CKA_SIGN: CK_ATTRIBUTE_TYPE = 264; +pub const CKA_SIGN_RECOVER: CK_ATTRIBUTE_TYPE = 265; +pub const CKA_VERIFY: CK_ATTRIBUTE_TYPE = 266; +pub const CKA_VERIFY_RECOVER: CK_ATTRIBUTE_TYPE = 267; +pub const CKA_DERIVE: CK_ATTRIBUTE_TYPE = 268; +pub const CKA_START_DATE: CK_ATTRIBUTE_TYPE = 272; +pub const CKA_END_DATE: CK_ATTRIBUTE_TYPE = 273; +pub const CKA_MODULUS: CK_ATTRIBUTE_TYPE = 288; +pub const CKA_MODULUS_BITS: CK_ATTRIBUTE_TYPE = 289; +pub const CKA_PUBLIC_EXPONENT: CK_ATTRIBUTE_TYPE = 290; +pub const CKA_PRIVATE_EXPONENT: CK_ATTRIBUTE_TYPE = 291; +pub const CKA_PRIME_1: CK_ATTRIBUTE_TYPE = 292; +pub const CKA_PRIME_2: CK_ATTRIBUTE_TYPE = 293; +pub const CKA_EXPONENT_1: CK_ATTRIBUTE_TYPE = 294; +pub const CKA_EXPONENT_2: CK_ATTRIBUTE_TYPE = 295; +pub const CKA_COEFFICIENT: CK_ATTRIBUTE_TYPE = 296; +pub const CKA_PUBLIC_KEY_INFO: CK_ATTRIBUTE_TYPE = 297; +pub const CKA_PRIME: CK_ATTRIBUTE_TYPE = 304; +pub const CKA_SUBPRIME: CK_ATTRIBUTE_TYPE = 305; +pub const CKA_BASE: CK_ATTRIBUTE_TYPE = 306; +pub const CKA_PRIME_BITS: CK_ATTRIBUTE_TYPE = 307; +pub const CKA_SUBPRIME_BITS: CK_ATTRIBUTE_TYPE = 308; +pub const CKA_SUB_PRIME_BITS: CK_ATTRIBUTE_TYPE = 308; +pub const CKA_VALUE_BITS: CK_ATTRIBUTE_TYPE = 352; +pub const CKA_VALUE_LEN: CK_ATTRIBUTE_TYPE = 353; +pub const CKA_EXTRACTABLE: CK_ATTRIBUTE_TYPE = 354; +pub const CKA_LOCAL: CK_ATTRIBUTE_TYPE = 355; +pub const CKA_NEVER_EXTRACTABLE: CK_ATTRIBUTE_TYPE = 356; +pub const CKA_ALWAYS_SENSITIVE: CK_ATTRIBUTE_TYPE = 357; +pub const CKA_KEY_GEN_MECHANISM: CK_ATTRIBUTE_TYPE = 358; +pub const CKA_MODIFIABLE: CK_ATTRIBUTE_TYPE = 368; +pub const CKA_COPYABLE: CK_ATTRIBUTE_TYPE = 369; +pub const CKA_DESTROYABLE: CK_ATTRIBUTE_TYPE = 370; +pub const CKA_ECDSA_PARAMS: CK_ATTRIBUTE_TYPE = 384; +pub const CKA_EC_PARAMS: CK_ATTRIBUTE_TYPE = 384; +pub const CKA_EC_POINT: CK_ATTRIBUTE_TYPE = 385; +pub const CKA_SECONDARY_AUTH: CK_ATTRIBUTE_TYPE = 512; +pub const CKA_AUTH_PIN_FLAGS: CK_ATTRIBUTE_TYPE = 513; +pub const CKA_ALWAYS_AUTHENTICATE: CK_ATTRIBUTE_TYPE = 514; +pub const CKA_WRAP_WITH_TRUSTED: CK_ATTRIBUTE_TYPE = 528; +pub const CKA_WRAP_TEMPLATE: CK_ATTRIBUTE_TYPE = 1073742353; +pub const CKA_UNWRAP_TEMPLATE: CK_ATTRIBUTE_TYPE = 1073742354; +pub const CKA_DERIVE_TEMPLATE: CK_ATTRIBUTE_TYPE = 1073742355; +pub const CKA_OTP_FORMAT: CK_ATTRIBUTE_TYPE = 544; +pub const CKA_OTP_LENGTH: CK_ATTRIBUTE_TYPE = 545; +pub const CKA_OTP_TIME_INTERVAL: CK_ATTRIBUTE_TYPE = 546; +pub const CKA_OTP_USER_FRIENDLY_MODE: CK_ATTRIBUTE_TYPE = 547; +pub const CKA_OTP_CHALLENGE_REQUIREMENT: CK_ATTRIBUTE_TYPE = 548; +pub const CKA_OTP_TIME_REQUIREMENT: CK_ATTRIBUTE_TYPE = 549; +pub const CKA_OTP_COUNTER_REQUIREMENT: CK_ATTRIBUTE_TYPE = 550; +pub const CKA_OTP_PIN_REQUIREMENT: CK_ATTRIBUTE_TYPE = 551; +pub const CKA_OTP_COUNTER: CK_ATTRIBUTE_TYPE = 558; +pub const CKA_OTP_TIME: CK_ATTRIBUTE_TYPE = 559; +pub const CKA_OTP_USER_IDENTIFIER: CK_ATTRIBUTE_TYPE = 554; +pub const CKA_OTP_SERVICE_IDENTIFIER: CK_ATTRIBUTE_TYPE = 555; +pub const CKA_OTP_SERVICE_LOGO: CK_ATTRIBUTE_TYPE = 556; +pub const CKA_OTP_SERVICE_LOGO_TYPE: CK_ATTRIBUTE_TYPE = 557; +pub const CKA_GOSTR3410_PARAMS: CK_ATTRIBUTE_TYPE = 592; +pub const CKA_GOSTR3411_PARAMS: CK_ATTRIBUTE_TYPE = 593; +pub const CKA_GOST28147_PARAMS: CK_ATTRIBUTE_TYPE = 594; +pub const CKA_HW_FEATURE_TYPE: CK_ATTRIBUTE_TYPE = 768; +pub const CKA_RESET_ON_INIT: CK_ATTRIBUTE_TYPE = 769; +pub const CKA_HAS_RESET: CK_ATTRIBUTE_TYPE = 770; +pub const CKA_PIXEL_X: CK_ATTRIBUTE_TYPE = 1024; +pub const CKA_PIXEL_Y: CK_ATTRIBUTE_TYPE = 1025; +pub const CKA_RESOLUTION: CK_ATTRIBUTE_TYPE = 1026; +pub const CKA_CHAR_ROWS: CK_ATTRIBUTE_TYPE = 1027; +pub const CKA_CHAR_COLUMNS: CK_ATTRIBUTE_TYPE = 1028; +pub const CKA_COLOR: CK_ATTRIBUTE_TYPE = 1029; +pub const CKA_BITS_PER_PIXEL: CK_ATTRIBUTE_TYPE = 1030; +pub const CKA_CHAR_SETS: CK_ATTRIBUTE_TYPE = 1152; +pub const CKA_ENCODING_METHODS: CK_ATTRIBUTE_TYPE = 1153; +pub const CKA_MIME_TYPES: CK_ATTRIBUTE_TYPE = 1154; +pub const CKA_MECHANISM_TYPE: CK_ATTRIBUTE_TYPE = 1280; +pub const CKA_REQUIRED_CMS_ATTRIBUTES: CK_ATTRIBUTE_TYPE = 1281; +pub const CKA_DEFAULT_CMS_ATTRIBUTES: CK_ATTRIBUTE_TYPE = 1282; +pub const CKA_SUPPORTED_CMS_ATTRIBUTES: CK_ATTRIBUTE_TYPE = 1283; +pub const CKA_ALLOWED_MECHANISMS: CK_ATTRIBUTE_TYPE = 1073743360; +pub const CKA_PROFILE_ID: CK_ATTRIBUTE_TYPE = 1537; +pub const CKA_VENDOR_DEFINED: CK_ATTRIBUTE_TYPE = 2147483648; +pub const CKM_RSA_PKCS_KEY_PAIR_GEN: CK_MECHANISM_TYPE = 0; +pub const CKM_RSA_PKCS: CK_MECHANISM_TYPE = 1; +pub const CKM_RSA_9796: CK_MECHANISM_TYPE = 2; +pub const CKM_RSA_X_509: CK_MECHANISM_TYPE = 3; +pub const CKM_MD2_RSA_PKCS: CK_MECHANISM_TYPE = 4; +pub const CKM_MD5_RSA_PKCS: CK_MECHANISM_TYPE = 5; +pub const CKM_SHA1_RSA_PKCS: CK_MECHANISM_TYPE = 6; +pub const CKM_RIPEMD128_RSA_PKCS: CK_MECHANISM_TYPE = 7; +pub const CKM_RIPEMD160_RSA_PKCS: CK_MECHANISM_TYPE = 8; +pub const CKM_RSA_PKCS_OAEP: CK_MECHANISM_TYPE = 9; +pub const CKM_RSA_X9_31_KEY_PAIR_GEN: CK_MECHANISM_TYPE = 10; +pub const CKM_RSA_X9_31: CK_MECHANISM_TYPE = 11; +pub const CKM_SHA1_RSA_X9_31: CK_MECHANISM_TYPE = 12; +pub const CKM_RSA_PKCS_PSS: CK_MECHANISM_TYPE = 13; +pub const CKM_SHA1_RSA_PKCS_PSS: CK_MECHANISM_TYPE = 14; +pub const CKM_DSA_KEY_PAIR_GEN: CK_MECHANISM_TYPE = 16; +pub const CKM_DSA: CK_MECHANISM_TYPE = 17; +pub const CKM_DSA_SHA1: CK_MECHANISM_TYPE = 18; +pub const CKM_DSA_SHA224: CK_MECHANISM_TYPE = 19; +pub const CKM_DSA_SHA256: CK_MECHANISM_TYPE = 20; +pub const CKM_DSA_SHA384: CK_MECHANISM_TYPE = 21; +pub const CKM_DSA_SHA512: CK_MECHANISM_TYPE = 22; +pub const CKM_DSA_SHA3_224: CK_MECHANISM_TYPE = 24; +pub const CKM_DSA_SHA3_256: CK_MECHANISM_TYPE = 25; +pub const CKM_DSA_SHA3_384: CK_MECHANISM_TYPE = 26; +pub const CKM_DSA_SHA3_512: CK_MECHANISM_TYPE = 27; +pub const CKM_DH_PKCS_KEY_PAIR_GEN: CK_MECHANISM_TYPE = 32; +pub const CKM_DH_PKCS_DERIVE: CK_MECHANISM_TYPE = 33; +pub const CKM_X9_42_DH_KEY_PAIR_GEN: CK_MECHANISM_TYPE = 48; +pub const CKM_X9_42_DH_DERIVE: CK_MECHANISM_TYPE = 49; +pub const CKM_X9_42_DH_HYBRID_DERIVE: CK_MECHANISM_TYPE = 50; +pub const CKM_X9_42_MQV_DERIVE: CK_MECHANISM_TYPE = 51; +pub const CKM_SHA256_RSA_PKCS: CK_MECHANISM_TYPE = 64; +pub const CKM_SHA384_RSA_PKCS: CK_MECHANISM_TYPE = 65; +pub const CKM_SHA512_RSA_PKCS: CK_MECHANISM_TYPE = 66; +pub const CKM_SHA256_RSA_PKCS_PSS: CK_MECHANISM_TYPE = 67; +pub const CKM_SHA384_RSA_PKCS_PSS: CK_MECHANISM_TYPE = 68; +pub const CKM_SHA512_RSA_PKCS_PSS: CK_MECHANISM_TYPE = 69; +pub const CKM_SHA224_RSA_PKCS: CK_MECHANISM_TYPE = 70; +pub const CKM_SHA224_RSA_PKCS_PSS: CK_MECHANISM_TYPE = 71; +pub const CKM_SHA512_224: CK_MECHANISM_TYPE = 72; +pub const CKM_SHA512_224_HMAC: CK_MECHANISM_TYPE = 73; +pub const CKM_SHA512_224_HMAC_GENERAL: CK_MECHANISM_TYPE = 74; +pub const CKM_SHA512_224_KEY_DERIVATION: CK_MECHANISM_TYPE = 75; +pub const CKM_SHA512_256: CK_MECHANISM_TYPE = 76; +pub const CKM_SHA512_256_HMAC: CK_MECHANISM_TYPE = 77; +pub const CKM_SHA512_256_HMAC_GENERAL: CK_MECHANISM_TYPE = 78; +pub const CKM_SHA512_256_KEY_DERIVATION: CK_MECHANISM_TYPE = 79; +pub const CKM_SHA512_T: CK_MECHANISM_TYPE = 80; +pub const CKM_SHA512_T_HMAC: CK_MECHANISM_TYPE = 81; +pub const CKM_SHA512_T_HMAC_GENERAL: CK_MECHANISM_TYPE = 82; +pub const CKM_SHA512_T_KEY_DERIVATION: CK_MECHANISM_TYPE = 83; +pub const CKM_SHA3_256_RSA_PKCS: CK_MECHANISM_TYPE = 96; +pub const CKM_SHA3_384_RSA_PKCS: CK_MECHANISM_TYPE = 97; +pub const CKM_SHA3_512_RSA_PKCS: CK_MECHANISM_TYPE = 98; +pub const CKM_SHA3_256_RSA_PKCS_PSS: CK_MECHANISM_TYPE = 99; +pub const CKM_SHA3_384_RSA_PKCS_PSS: CK_MECHANISM_TYPE = 100; +pub const CKM_SHA3_512_RSA_PKCS_PSS: CK_MECHANISM_TYPE = 101; +pub const CKM_SHA3_224_RSA_PKCS: CK_MECHANISM_TYPE = 102; +pub const CKM_SHA3_224_RSA_PKCS_PSS: CK_MECHANISM_TYPE = 103; +pub const CKM_RC2_KEY_GEN: CK_MECHANISM_TYPE = 256; +pub const CKM_RC2_ECB: CK_MECHANISM_TYPE = 257; +pub const CKM_RC2_CBC: CK_MECHANISM_TYPE = 258; +pub const CKM_RC2_MAC: CK_MECHANISM_TYPE = 259; +pub const CKM_RC2_MAC_GENERAL: CK_MECHANISM_TYPE = 260; +pub const CKM_RC2_CBC_PAD: CK_MECHANISM_TYPE = 261; +pub const CKM_RC4_KEY_GEN: CK_MECHANISM_TYPE = 272; +pub const CKM_RC4: CK_MECHANISM_TYPE = 273; +pub const CKM_DES_KEY_GEN: CK_MECHANISM_TYPE = 288; +pub const CKM_DES_ECB: CK_MECHANISM_TYPE = 289; +pub const CKM_DES_CBC: CK_MECHANISM_TYPE = 290; +pub const CKM_DES_MAC: CK_MECHANISM_TYPE = 291; +pub const CKM_DES_MAC_GENERAL: CK_MECHANISM_TYPE = 292; +pub const CKM_DES_CBC_PAD: CK_MECHANISM_TYPE = 293; +pub const CKM_DES2_KEY_GEN: CK_MECHANISM_TYPE = 304; +pub const CKM_DES3_KEY_GEN: CK_MECHANISM_TYPE = 305; +pub const CKM_DES3_ECB: CK_MECHANISM_TYPE = 306; +pub const CKM_DES3_CBC: CK_MECHANISM_TYPE = 307; +pub const CKM_DES3_MAC: CK_MECHANISM_TYPE = 308; +pub const CKM_DES3_MAC_GENERAL: CK_MECHANISM_TYPE = 309; +pub const CKM_DES3_CBC_PAD: CK_MECHANISM_TYPE = 310; +pub const CKM_DES3_CMAC_GENERAL: CK_MECHANISM_TYPE = 311; +pub const CKM_DES3_CMAC: CK_MECHANISM_TYPE = 312; +pub const CKM_CDMF_KEY_GEN: CK_MECHANISM_TYPE = 320; +pub const CKM_CDMF_ECB: CK_MECHANISM_TYPE = 321; +pub const CKM_CDMF_CBC: CK_MECHANISM_TYPE = 322; +pub const CKM_CDMF_MAC: CK_MECHANISM_TYPE = 323; +pub const CKM_CDMF_MAC_GENERAL: CK_MECHANISM_TYPE = 324; +pub const CKM_CDMF_CBC_PAD: CK_MECHANISM_TYPE = 325; +pub const CKM_DES_OFB64: CK_MECHANISM_TYPE = 336; +pub const CKM_DES_OFB8: CK_MECHANISM_TYPE = 337; +pub const CKM_DES_CFB64: CK_MECHANISM_TYPE = 338; +pub const CKM_DES_CFB8: CK_MECHANISM_TYPE = 339; +pub const CKM_MD2: CK_MECHANISM_TYPE = 512; +pub const CKM_MD2_HMAC: CK_MECHANISM_TYPE = 513; +pub const CKM_MD2_HMAC_GENERAL: CK_MECHANISM_TYPE = 514; +pub const CKM_MD5: CK_MECHANISM_TYPE = 528; +pub const CKM_MD5_HMAC: CK_MECHANISM_TYPE = 529; +pub const CKM_MD5_HMAC_GENERAL: CK_MECHANISM_TYPE = 530; +pub const CKM_SHA_1: CK_MECHANISM_TYPE = 544; +pub const CKM_SHA_1_HMAC: CK_MECHANISM_TYPE = 545; +pub const CKM_SHA_1_HMAC_GENERAL: CK_MECHANISM_TYPE = 546; +pub const CKM_RIPEMD128: CK_MECHANISM_TYPE = 560; +pub const CKM_RIPEMD128_HMAC: CK_MECHANISM_TYPE = 561; +pub const CKM_RIPEMD128_HMAC_GENERAL: CK_MECHANISM_TYPE = 562; +pub const CKM_RIPEMD160: CK_MECHANISM_TYPE = 576; +pub const CKM_RIPEMD160_HMAC: CK_MECHANISM_TYPE = 577; +pub const CKM_RIPEMD160_HMAC_GENERAL: CK_MECHANISM_TYPE = 578; +pub const CKM_SHA256: CK_MECHANISM_TYPE = 592; +pub const CKM_SHA256_HMAC: CK_MECHANISM_TYPE = 593; +pub const CKM_SHA256_HMAC_GENERAL: CK_MECHANISM_TYPE = 594; +pub const CKM_SHA224: CK_MECHANISM_TYPE = 597; +pub const CKM_SHA224_HMAC: CK_MECHANISM_TYPE = 598; +pub const CKM_SHA224_HMAC_GENERAL: CK_MECHANISM_TYPE = 599; +pub const CKM_SHA384: CK_MECHANISM_TYPE = 608; +pub const CKM_SHA384_HMAC: CK_MECHANISM_TYPE = 609; +pub const CKM_SHA384_HMAC_GENERAL: CK_MECHANISM_TYPE = 610; +pub const CKM_SHA512: CK_MECHANISM_TYPE = 624; +pub const CKM_SHA512_HMAC: CK_MECHANISM_TYPE = 625; +pub const CKM_SHA512_HMAC_GENERAL: CK_MECHANISM_TYPE = 626; +pub const CKM_SECURID_KEY_GEN: CK_MECHANISM_TYPE = 640; +pub const CKM_SECURID: CK_MECHANISM_TYPE = 642; +pub const CKM_HOTP_KEY_GEN: CK_MECHANISM_TYPE = 656; +pub const CKM_HOTP: CK_MECHANISM_TYPE = 657; +pub const CKM_ACTI: CK_MECHANISM_TYPE = 672; +pub const CKM_ACTI_KEY_GEN: CK_MECHANISM_TYPE = 673; +pub const CKM_SHA3_256: CK_MECHANISM_TYPE = 688; +pub const CKM_SHA3_256_HMAC: CK_MECHANISM_TYPE = 689; +pub const CKM_SHA3_256_HMAC_GENERAL: CK_MECHANISM_TYPE = 690; +pub const CKM_SHA3_256_KEY_GEN: CK_MECHANISM_TYPE = 691; +pub const CKM_SHA3_224: CK_MECHANISM_TYPE = 693; +pub const CKM_SHA3_224_HMAC: CK_MECHANISM_TYPE = 694; +pub const CKM_SHA3_224_HMAC_GENERAL: CK_MECHANISM_TYPE = 695; +pub const CKM_SHA3_224_KEY_GEN: CK_MECHANISM_TYPE = 696; +pub const CKM_SHA3_384: CK_MECHANISM_TYPE = 704; +pub const CKM_SHA3_384_HMAC: CK_MECHANISM_TYPE = 705; +pub const CKM_SHA3_384_HMAC_GENERAL: CK_MECHANISM_TYPE = 706; +pub const CKM_SHA3_384_KEY_GEN: CK_MECHANISM_TYPE = 707; +pub const CKM_SHA3_512: CK_MECHANISM_TYPE = 720; +pub const CKM_SHA3_512_HMAC: CK_MECHANISM_TYPE = 721; +pub const CKM_SHA3_512_HMAC_GENERAL: CK_MECHANISM_TYPE = 722; +pub const CKM_SHA3_512_KEY_GEN: CK_MECHANISM_TYPE = 723; +pub const CKM_CAST_KEY_GEN: CK_MECHANISM_TYPE = 768; +pub const CKM_CAST_ECB: CK_MECHANISM_TYPE = 769; +pub const CKM_CAST_CBC: CK_MECHANISM_TYPE = 770; +pub const CKM_CAST_MAC: CK_MECHANISM_TYPE = 771; +pub const CKM_CAST_MAC_GENERAL: CK_MECHANISM_TYPE = 772; +pub const CKM_CAST_CBC_PAD: CK_MECHANISM_TYPE = 773; +pub const CKM_CAST3_KEY_GEN: CK_MECHANISM_TYPE = 784; +pub const CKM_CAST3_ECB: CK_MECHANISM_TYPE = 785; +pub const CKM_CAST3_CBC: CK_MECHANISM_TYPE = 786; +pub const CKM_CAST3_MAC: CK_MECHANISM_TYPE = 787; +pub const CKM_CAST3_MAC_GENERAL: CK_MECHANISM_TYPE = 788; +pub const CKM_CAST3_CBC_PAD: CK_MECHANISM_TYPE = 789; +pub const CKM_CAST5_KEY_GEN: CK_MECHANISM_TYPE = 800; +pub const CKM_CAST128_KEY_GEN: CK_MECHANISM_TYPE = 800; +pub const CKM_CAST5_ECB: CK_MECHANISM_TYPE = 801; +pub const CKM_CAST128_ECB: CK_MECHANISM_TYPE = 801; +pub const CKM_CAST5_CBC: CK_MECHANISM_TYPE = 802; +pub const CKM_CAST128_CBC: CK_MECHANISM_TYPE = 802; +pub const CKM_CAST5_MAC: CK_MECHANISM_TYPE = 803; +pub const CKM_CAST128_MAC: CK_MECHANISM_TYPE = 803; +pub const CKM_CAST5_MAC_GENERAL: CK_MECHANISM_TYPE = 804; +pub const CKM_CAST128_MAC_GENERAL: CK_MECHANISM_TYPE = 804; +pub const CKM_CAST5_CBC_PAD: CK_MECHANISM_TYPE = 805; +pub const CKM_CAST128_CBC_PAD: CK_MECHANISM_TYPE = 805; +pub const CKM_RC5_KEY_GEN: CK_MECHANISM_TYPE = 816; +pub const CKM_RC5_ECB: CK_MECHANISM_TYPE = 817; +pub const CKM_RC5_CBC: CK_MECHANISM_TYPE = 818; +pub const CKM_RC5_MAC: CK_MECHANISM_TYPE = 819; +pub const CKM_RC5_MAC_GENERAL: CK_MECHANISM_TYPE = 820; +pub const CKM_RC5_CBC_PAD: CK_MECHANISM_TYPE = 821; +pub const CKM_IDEA_KEY_GEN: CK_MECHANISM_TYPE = 832; +pub const CKM_IDEA_ECB: CK_MECHANISM_TYPE = 833; +pub const CKM_IDEA_CBC: CK_MECHANISM_TYPE = 834; +pub const CKM_IDEA_MAC: CK_MECHANISM_TYPE = 835; +pub const CKM_IDEA_MAC_GENERAL: CK_MECHANISM_TYPE = 836; +pub const CKM_IDEA_CBC_PAD: CK_MECHANISM_TYPE = 837; +pub const CKM_GENERIC_SECRET_KEY_GEN: CK_MECHANISM_TYPE = 848; +pub const CKM_CONCATENATE_BASE_AND_KEY: CK_MECHANISM_TYPE = 864; +pub const CKM_CONCATENATE_BASE_AND_DATA: CK_MECHANISM_TYPE = 866; +pub const CKM_CONCATENATE_DATA_AND_BASE: CK_MECHANISM_TYPE = 867; +pub const CKM_XOR_BASE_AND_DATA: CK_MECHANISM_TYPE = 868; +pub const CKM_EXTRACT_KEY_FROM_KEY: CK_MECHANISM_TYPE = 869; +pub const CKM_SSL3_PRE_MASTER_KEY_GEN: CK_MECHANISM_TYPE = 880; +pub const CKM_SSL3_MASTER_KEY_DERIVE: CK_MECHANISM_TYPE = 881; +pub const CKM_SSL3_KEY_AND_MAC_DERIVE: CK_MECHANISM_TYPE = 882; +pub const CKM_SSL3_MASTER_KEY_DERIVE_DH: CK_MECHANISM_TYPE = 883; +pub const CKM_TLS_PRE_MASTER_KEY_GEN: CK_MECHANISM_TYPE = 884; +pub const CKM_TLS_MASTER_KEY_DERIVE: CK_MECHANISM_TYPE = 885; +pub const CKM_TLS_KEY_AND_MAC_DERIVE: CK_MECHANISM_TYPE = 886; +pub const CKM_TLS_MASTER_KEY_DERIVE_DH: CK_MECHANISM_TYPE = 887; +pub const CKM_TLS_PRF: CK_MECHANISM_TYPE = 888; +pub const CKM_SSL3_MD5_MAC: CK_MECHANISM_TYPE = 896; +pub const CKM_SSL3_SHA1_MAC: CK_MECHANISM_TYPE = 897; +pub const CKM_MD5_KEY_DERIVATION: CK_MECHANISM_TYPE = 912; +pub const CKM_MD2_KEY_DERIVATION: CK_MECHANISM_TYPE = 913; +pub const CKM_SHA1_KEY_DERIVATION: CK_MECHANISM_TYPE = 914; +pub const CKM_SHA256_KEY_DERIVATION: CK_MECHANISM_TYPE = 915; +pub const CKM_SHA384_KEY_DERIVATION: CK_MECHANISM_TYPE = 916; +pub const CKM_SHA512_KEY_DERIVATION: CK_MECHANISM_TYPE = 917; +pub const CKM_SHA224_KEY_DERIVATION: CK_MECHANISM_TYPE = 918; +pub const CKM_SHA3_256_KEY_DERIVE: CK_MECHANISM_TYPE = 919; +pub const CKM_SHA3_224_KEY_DERIVE: CK_MECHANISM_TYPE = 920; +pub const CKM_SHA3_384_KEY_DERIVE: CK_MECHANISM_TYPE = 921; +pub const CKM_SHA3_512_KEY_DERIVE: CK_MECHANISM_TYPE = 922; +pub const CKM_SHAKE_128_KEY_DERIVE: CK_MECHANISM_TYPE = 923; +pub const CKM_SHAKE_256_KEY_DERIVE: CK_MECHANISM_TYPE = 924; +pub const CKM_PBE_MD2_DES_CBC: CK_MECHANISM_TYPE = 928; +pub const CKM_PBE_MD5_DES_CBC: CK_MECHANISM_TYPE = 929; +pub const CKM_PBE_MD5_CAST_CBC: CK_MECHANISM_TYPE = 930; +pub const CKM_PBE_MD5_CAST3_CBC: CK_MECHANISM_TYPE = 931; +pub const CKM_PBE_MD5_CAST5_CBC: CK_MECHANISM_TYPE = 932; +pub const CKM_PBE_MD5_CAST128_CBC: CK_MECHANISM_TYPE = 932; +pub const CKM_PBE_SHA1_CAST5_CBC: CK_MECHANISM_TYPE = 933; +pub const CKM_PBE_SHA1_CAST128_CBC: CK_MECHANISM_TYPE = 933; +pub const CKM_PBE_SHA1_RC4_128: CK_MECHANISM_TYPE = 934; +pub const CKM_PBE_SHA1_RC4_40: CK_MECHANISM_TYPE = 935; +pub const CKM_PBE_SHA1_DES3_EDE_CBC: CK_MECHANISM_TYPE = 936; +pub const CKM_PBE_SHA1_DES2_EDE_CBC: CK_MECHANISM_TYPE = 937; +pub const CKM_PBE_SHA1_RC2_128_CBC: CK_MECHANISM_TYPE = 938; +pub const CKM_PBE_SHA1_RC2_40_CBC: CK_MECHANISM_TYPE = 939; +pub const CKM_PKCS5_PBKD2: CK_MECHANISM_TYPE = 944; +pub const CKM_PBA_SHA1_WITH_SHA1_HMAC: CK_MECHANISM_TYPE = 960; +pub const CKM_WTLS_PRE_MASTER_KEY_GEN: CK_MECHANISM_TYPE = 976; +pub const CKM_WTLS_MASTER_KEY_DERIVE: CK_MECHANISM_TYPE = 977; +pub const CKM_WTLS_MASTER_KEY_DERIVE_DH_ECC: CK_MECHANISM_TYPE = 978; +pub const CKM_WTLS_PRF: CK_MECHANISM_TYPE = 979; +pub const CKM_WTLS_SERVER_KEY_AND_MAC_DERIVE: CK_MECHANISM_TYPE = 980; +pub const CKM_WTLS_CLIENT_KEY_AND_MAC_DERIVE: CK_MECHANISM_TYPE = 981; +pub const CKM_TLS10_MAC_SERVER: CK_MECHANISM_TYPE = 982; +pub const CKM_TLS10_MAC_CLIENT: CK_MECHANISM_TYPE = 983; +pub const CKM_TLS12_MAC: CK_MECHANISM_TYPE = 984; +pub const CKM_TLS12_KDF: CK_MECHANISM_TYPE = 985; +pub const CKM_TLS12_MASTER_KEY_DERIVE: CK_MECHANISM_TYPE = 992; +pub const CKM_TLS12_KEY_AND_MAC_DERIVE: CK_MECHANISM_TYPE = 993; +pub const CKM_TLS12_MASTER_KEY_DERIVE_DH: CK_MECHANISM_TYPE = 994; +pub const CKM_TLS12_KEY_SAFE_DERIVE: CK_MECHANISM_TYPE = 995; +pub const CKM_TLS_MAC: CK_MECHANISM_TYPE = 996; +pub const CKM_TLS_KDF: CK_MECHANISM_TYPE = 997; +pub const CKM_KEY_WRAP_LYNKS: CK_MECHANISM_TYPE = 1024; +pub const CKM_KEY_WRAP_SET_OAEP: CK_MECHANISM_TYPE = 1025; +pub const CKM_CMS_SIG: CK_MECHANISM_TYPE = 1280; +pub const CKM_KIP_DERIVE: CK_MECHANISM_TYPE = 1296; +pub const CKM_KIP_WRAP: CK_MECHANISM_TYPE = 1297; +pub const CKM_KIP_MAC: CK_MECHANISM_TYPE = 1298; +pub const CKM_CAMELLIA_KEY_GEN: CK_MECHANISM_TYPE = 1360; +pub const CKM_CAMELLIA_ECB: CK_MECHANISM_TYPE = 1361; +pub const CKM_CAMELLIA_CBC: CK_MECHANISM_TYPE = 1362; +pub const CKM_CAMELLIA_MAC: CK_MECHANISM_TYPE = 1363; +pub const CKM_CAMELLIA_MAC_GENERAL: CK_MECHANISM_TYPE = 1364; +pub const CKM_CAMELLIA_CBC_PAD: CK_MECHANISM_TYPE = 1365; +pub const CKM_CAMELLIA_ECB_ENCRYPT_DATA: CK_MECHANISM_TYPE = 1366; +pub const CKM_CAMELLIA_CBC_ENCRYPT_DATA: CK_MECHANISM_TYPE = 1367; +pub const CKM_CAMELLIA_CTR: CK_MECHANISM_TYPE = 1368; +pub const CKM_ARIA_KEY_GEN: CK_MECHANISM_TYPE = 1376; +pub const CKM_ARIA_ECB: CK_MECHANISM_TYPE = 1377; +pub const CKM_ARIA_CBC: CK_MECHANISM_TYPE = 1378; +pub const CKM_ARIA_MAC: CK_MECHANISM_TYPE = 1379; +pub const CKM_ARIA_MAC_GENERAL: CK_MECHANISM_TYPE = 1380; +pub const CKM_ARIA_CBC_PAD: CK_MECHANISM_TYPE = 1381; +pub const CKM_ARIA_ECB_ENCRYPT_DATA: CK_MECHANISM_TYPE = 1382; +pub const CKM_ARIA_CBC_ENCRYPT_DATA: CK_MECHANISM_TYPE = 1383; +pub const CKM_SEED_KEY_GEN: CK_MECHANISM_TYPE = 1616; +pub const CKM_SEED_ECB: CK_MECHANISM_TYPE = 1617; +pub const CKM_SEED_CBC: CK_MECHANISM_TYPE = 1618; +pub const CKM_SEED_MAC: CK_MECHANISM_TYPE = 1619; +pub const CKM_SEED_MAC_GENERAL: CK_MECHANISM_TYPE = 1620; +pub const CKM_SEED_CBC_PAD: CK_MECHANISM_TYPE = 1621; +pub const CKM_SEED_ECB_ENCRYPT_DATA: CK_MECHANISM_TYPE = 1622; +pub const CKM_SEED_CBC_ENCRYPT_DATA: CK_MECHANISM_TYPE = 1623; +pub const CKM_SKIPJACK_KEY_GEN: CK_MECHANISM_TYPE = 4096; +pub const CKM_SKIPJACK_ECB64: CK_MECHANISM_TYPE = 4097; +pub const CKM_SKIPJACK_CBC64: CK_MECHANISM_TYPE = 4098; +pub const CKM_SKIPJACK_OFB64: CK_MECHANISM_TYPE = 4099; +pub const CKM_SKIPJACK_CFB64: CK_MECHANISM_TYPE = 4100; +pub const CKM_SKIPJACK_CFB32: CK_MECHANISM_TYPE = 4101; +pub const CKM_SKIPJACK_CFB16: CK_MECHANISM_TYPE = 4102; +pub const CKM_SKIPJACK_CFB8: CK_MECHANISM_TYPE = 4103; +pub const CKM_SKIPJACK_WRAP: CK_MECHANISM_TYPE = 4104; +pub const CKM_SKIPJACK_PRIVATE_WRAP: CK_MECHANISM_TYPE = 4105; +pub const CKM_SKIPJACK_RELAYX: CK_MECHANISM_TYPE = 4106; +pub const CKM_KEA_KEY_PAIR_GEN: CK_MECHANISM_TYPE = 4112; +pub const CKM_KEA_KEY_DERIVE: CK_MECHANISM_TYPE = 4113; +pub const CKM_KEA_DERIVE: CK_MECHANISM_TYPE = 4114; +pub const CKM_FORTEZZA_TIMESTAMP: CK_MECHANISM_TYPE = 4128; +pub const CKM_BATON_KEY_GEN: CK_MECHANISM_TYPE = 4144; +pub const CKM_BATON_ECB128: CK_MECHANISM_TYPE = 4145; +pub const CKM_BATON_ECB96: CK_MECHANISM_TYPE = 4146; +pub const CKM_BATON_CBC128: CK_MECHANISM_TYPE = 4147; +pub const CKM_BATON_COUNTER: CK_MECHANISM_TYPE = 4148; +pub const CKM_BATON_SHUFFLE: CK_MECHANISM_TYPE = 4149; +pub const CKM_BATON_WRAP: CK_MECHANISM_TYPE = 4150; +pub const CKM_ECDSA_KEY_PAIR_GEN: CK_MECHANISM_TYPE = 4160; +pub const CKM_EC_KEY_PAIR_GEN: CK_MECHANISM_TYPE = 4160; +pub const CKM_ECDSA: CK_MECHANISM_TYPE = 4161; +pub const CKM_ECDSA_SHA1: CK_MECHANISM_TYPE = 4162; +pub const CKM_ECDSA_SHA224: CK_MECHANISM_TYPE = 4163; +pub const CKM_ECDSA_SHA256: CK_MECHANISM_TYPE = 4164; +pub const CKM_ECDSA_SHA384: CK_MECHANISM_TYPE = 4165; +pub const CKM_ECDSA_SHA512: CK_MECHANISM_TYPE = 4166; +pub const CKM_ECDH1_DERIVE: CK_MECHANISM_TYPE = 4176; +pub const CKM_ECDH1_COFACTOR_DERIVE: CK_MECHANISM_TYPE = 4177; +pub const CKM_ECMQV_DERIVE: CK_MECHANISM_TYPE = 4178; +pub const CKM_ECDH_AES_KEY_WRAP: CK_MECHANISM_TYPE = 4179; +pub const CKM_RSA_AES_KEY_WRAP: CK_MECHANISM_TYPE = 4180; +pub const CKM_JUNIPER_KEY_GEN: CK_MECHANISM_TYPE = 4192; +pub const CKM_JUNIPER_ECB128: CK_MECHANISM_TYPE = 4193; +pub const CKM_JUNIPER_CBC128: CK_MECHANISM_TYPE = 4194; +pub const CKM_JUNIPER_COUNTER: CK_MECHANISM_TYPE = 4195; +pub const CKM_JUNIPER_SHUFFLE: CK_MECHANISM_TYPE = 4196; +pub const CKM_JUNIPER_WRAP: CK_MECHANISM_TYPE = 4197; +pub const CKM_FASTHASH: CK_MECHANISM_TYPE = 4208; +pub const CKM_AES_XTS: CK_MECHANISM_TYPE = 4209; +pub const CKM_AES_XTS_KEY_GEN: CK_MECHANISM_TYPE = 4210; +pub const CKM_AES_KEY_GEN: CK_MECHANISM_TYPE = 4224; +pub const CKM_AES_ECB: CK_MECHANISM_TYPE = 4225; +pub const CKM_AES_CBC: CK_MECHANISM_TYPE = 4226; +pub const CKM_AES_MAC: CK_MECHANISM_TYPE = 4227; +pub const CKM_AES_MAC_GENERAL: CK_MECHANISM_TYPE = 4228; +pub const CKM_AES_CBC_PAD: CK_MECHANISM_TYPE = 4229; +pub const CKM_AES_CTR: CK_MECHANISM_TYPE = 4230; +pub const CKM_AES_GCM: CK_MECHANISM_TYPE = 4231; +pub const CKM_AES_CCM: CK_MECHANISM_TYPE = 4232; +pub const CKM_AES_CTS: CK_MECHANISM_TYPE = 4233; +pub const CKM_AES_CMAC: CK_MECHANISM_TYPE = 4234; +pub const CKM_AES_CMAC_GENERAL: CK_MECHANISM_TYPE = 4235; +pub const CKM_AES_XCBC_MAC: CK_MECHANISM_TYPE = 4236; +pub const CKM_AES_XCBC_MAC_96: CK_MECHANISM_TYPE = 4237; +pub const CKM_AES_GMAC: CK_MECHANISM_TYPE = 4238; +pub const CKM_BLOWFISH_KEY_GEN: CK_MECHANISM_TYPE = 4240; +pub const CKM_BLOWFISH_CBC: CK_MECHANISM_TYPE = 4241; +pub const CKM_TWOFISH_KEY_GEN: CK_MECHANISM_TYPE = 4242; +pub const CKM_TWOFISH_CBC: CK_MECHANISM_TYPE = 4243; +pub const CKM_BLOWFISH_CBC_PAD: CK_MECHANISM_TYPE = 4244; +pub const CKM_TWOFISH_CBC_PAD: CK_MECHANISM_TYPE = 4245; +pub const CKM_DES_ECB_ENCRYPT_DATA: CK_MECHANISM_TYPE = 4352; +pub const CKM_DES_CBC_ENCRYPT_DATA: CK_MECHANISM_TYPE = 4353; +pub const CKM_DES3_ECB_ENCRYPT_DATA: CK_MECHANISM_TYPE = 4354; +pub const CKM_DES3_CBC_ENCRYPT_DATA: CK_MECHANISM_TYPE = 4355; +pub const CKM_AES_ECB_ENCRYPT_DATA: CK_MECHANISM_TYPE = 4356; +pub const CKM_AES_CBC_ENCRYPT_DATA: CK_MECHANISM_TYPE = 4357; +pub const CKM_GOSTR3410_KEY_PAIR_GEN: CK_MECHANISM_TYPE = 4608; +pub const CKM_GOSTR3410: CK_MECHANISM_TYPE = 4609; +pub const CKM_GOSTR3410_WITH_GOSTR3411: CK_MECHANISM_TYPE = 4610; +pub const CKM_GOSTR3410_KEY_WRAP: CK_MECHANISM_TYPE = 4611; +pub const CKM_GOSTR3410_DERIVE: CK_MECHANISM_TYPE = 4612; +pub const CKM_GOSTR3411: CK_MECHANISM_TYPE = 4624; +pub const CKM_GOSTR3411_HMAC: CK_MECHANISM_TYPE = 4625; +pub const CKM_GOST28147_KEY_GEN: CK_MECHANISM_TYPE = 4640; +pub const CKM_GOST28147_ECB: CK_MECHANISM_TYPE = 4641; +pub const CKM_GOST28147: CK_MECHANISM_TYPE = 4642; +pub const CKM_GOST28147_MAC: CK_MECHANISM_TYPE = 4643; +pub const CKM_GOST28147_KEY_WRAP: CK_MECHANISM_TYPE = 4644; +pub const CKM_CHACHA20_KEY_GEN: CK_MECHANISM_TYPE = 4645; +pub const CKM_CHACHA20: CK_MECHANISM_TYPE = 4646; +pub const CKM_POLY1305_KEY_GEN: CK_MECHANISM_TYPE = 4647; +pub const CKM_POLY1305: CK_MECHANISM_TYPE = 4648; +pub const CKM_DSA_PARAMETER_GEN: CK_MECHANISM_TYPE = 8192; +pub const CKM_DH_PKCS_PARAMETER_GEN: CK_MECHANISM_TYPE = 8193; +pub const CKM_X9_42_DH_PARAMETER_GEN: CK_MECHANISM_TYPE = 8194; +pub const CKM_DSA_PROBABLISTIC_PARAMETER_GEN: CK_MECHANISM_TYPE = 8195; +pub const CKM_DSA_SHAWE_TAYLOR_PARAMETER_GEN: CK_MECHANISM_TYPE = 8196; +pub const CKM_AES_OFB: CK_MECHANISM_TYPE = 8452; +pub const CKM_AES_CFB64: CK_MECHANISM_TYPE = 8453; +pub const CKM_AES_CFB8: CK_MECHANISM_TYPE = 8454; +pub const CKM_AES_CFB128: CK_MECHANISM_TYPE = 8455; +pub const CKM_AES_CFB1: CK_MECHANISM_TYPE = 8456; +pub const CKM_AES_KEY_WRAP: CK_MECHANISM_TYPE = 8457; +pub const CKM_AES_KEY_WRAP_PAD: CK_MECHANISM_TYPE = 8458; +pub const CKM_AES_KEY_WRAP_KWP: CK_MECHANISM_TYPE = 8459; +pub const CKM_RSA_PKCS_TPM_1_1: CK_MECHANISM_TYPE = 16385; +pub const CKM_RSA_PKCS_OAEP_TPM_1_1: CK_MECHANISM_TYPE = 16386; +pub const CKM_SHA_1_KEY_GEN: CK_MECHANISM_TYPE = 16387; +pub const CKM_SHA224_KEY_GEN: CK_MECHANISM_TYPE = 16388; +pub const CKM_SHA256_KEY_GEN: CK_MECHANISM_TYPE = 16389; +pub const CKM_SHA384_KEY_GEN: CK_MECHANISM_TYPE = 16390; +pub const CKM_SHA512_KEY_GEN: CK_MECHANISM_TYPE = 16391; +pub const CKM_SHA512_224_KEY_GEN: CK_MECHANISM_TYPE = 16392; +pub const CKM_SHA512_256_KEY_GEN: CK_MECHANISM_TYPE = 16393; +pub const CKM_SHA512_T_KEY_GEN: CK_MECHANISM_TYPE = 16394; +pub const CKM_NULL: CK_MECHANISM_TYPE = 16395; +pub const CKM_BLAKE2B_160: CK_MECHANISM_TYPE = 16396; +pub const CKM_BLAKE2B_160_HMAC: CK_MECHANISM_TYPE = 16397; +pub const CKM_BLAKE2B_160_HMAC_GENERAL: CK_MECHANISM_TYPE = 16398; +pub const CKM_BLAKE2B_160_KEY_DERIVE: CK_MECHANISM_TYPE = 16399; +pub const CKM_BLAKE2B_160_KEY_GEN: CK_MECHANISM_TYPE = 16400; +pub const CKM_BLAKE2B_256: CK_MECHANISM_TYPE = 16401; +pub const CKM_BLAKE2B_256_HMAC: CK_MECHANISM_TYPE = 16402; +pub const CKM_BLAKE2B_256_HMAC_GENERAL: CK_MECHANISM_TYPE = 16403; +pub const CKM_BLAKE2B_256_KEY_DERIVE: CK_MECHANISM_TYPE = 16404; +pub const CKM_BLAKE2B_256_KEY_GEN: CK_MECHANISM_TYPE = 16405; +pub const CKM_BLAKE2B_384: CK_MECHANISM_TYPE = 16406; +pub const CKM_BLAKE2B_384_HMAC: CK_MECHANISM_TYPE = 16407; +pub const CKM_BLAKE2B_384_HMAC_GENERAL: CK_MECHANISM_TYPE = 16408; +pub const CKM_BLAKE2B_384_KEY_DERIVE: CK_MECHANISM_TYPE = 16409; +pub const CKM_BLAKE2B_384_KEY_GEN: CK_MECHANISM_TYPE = 16410; +pub const CKM_BLAKE2B_512: CK_MECHANISM_TYPE = 16411; +pub const CKM_BLAKE2B_512_HMAC: CK_MECHANISM_TYPE = 16412; +pub const CKM_BLAKE2B_512_HMAC_GENERAL: CK_MECHANISM_TYPE = 16413; +pub const CKM_BLAKE2B_512_KEY_DERIVE: CK_MECHANISM_TYPE = 16414; +pub const CKM_BLAKE2B_512_KEY_GEN: CK_MECHANISM_TYPE = 16415; +pub const CKM_SALSA20: CK_MECHANISM_TYPE = 16416; +pub const CKM_CHACHA20_POLY1305: CK_MECHANISM_TYPE = 16417; +pub const CKM_SALSA20_POLY1305: CK_MECHANISM_TYPE = 16418; +pub const CKM_X3DH_INITIALIZE: CK_MECHANISM_TYPE = 16419; +pub const CKM_X3DH_RESPOND: CK_MECHANISM_TYPE = 16420; +pub const CKM_X2RATCHET_INITIALIZE: CK_MECHANISM_TYPE = 16421; +pub const CKM_X2RATCHET_RESPOND: CK_MECHANISM_TYPE = 16422; +pub const CKM_X2RATCHET_ENCRYPT: CK_MECHANISM_TYPE = 16423; +pub const CKM_X2RATCHET_DECRYPT: CK_MECHANISM_TYPE = 16424; +pub const CKM_XEDDSA: CK_MECHANISM_TYPE = 16425; +pub const CKM_HKDF_DERIVE: CK_MECHANISM_TYPE = 16426; +pub const CKM_HKDF_DATA: CK_MECHANISM_TYPE = 16427; +pub const CKM_HKDF_KEY_GEN: CK_MECHANISM_TYPE = 16428; +pub const CKM_ECDSA_SHA3_224: CK_MECHANISM_TYPE = 4167; +pub const CKM_ECDSA_SHA3_256: CK_MECHANISM_TYPE = 4168; +pub const CKM_ECDSA_SHA3_384: CK_MECHANISM_TYPE = 4169; +pub const CKM_ECDSA_SHA3_512: CK_MECHANISM_TYPE = 4170; +pub const CKM_EC_EDWARDS_KEY_PAIR_GEN: CK_MECHANISM_TYPE = 4181; +pub const CKM_EC_MONTGOMERY_KEY_PAIR_GEN: CK_MECHANISM_TYPE = 4182; +pub const CKM_EDDSA: CK_MECHANISM_TYPE = 4183; +pub const CKM_SP800_108_COUNTER_KDF: CK_MECHANISM_TYPE = 940; +pub const CKM_SP800_108_FEEDBACK_KDF: CK_MECHANISM_TYPE = 941; +pub const CKM_SP800_108_DOUBLE_PIPELINE_KDF: CK_MECHANISM_TYPE = 942; +pub const CKM_VENDOR_DEFINED: CK_MECHANISM_TYPE = 2147483648; +pub const CKF_HW: CK_FLAGS = 1; +pub const CKF_MESSAGE_ENCRYPT: CK_FLAGS = 2; +pub const CKF_MESSAGE_DECRYPT: CK_FLAGS = 4; +pub const CKF_MESSAGE_SIGN: CK_FLAGS = 8; +pub const CKF_MESSAGE_VERIFY: CK_FLAGS = 16; +pub const CKF_MULTI_MESSGE: CK_FLAGS = 32; +pub const CKF_FIND_OBJECTS: CK_FLAGS = 64; +pub const CKF_ENCRYPT: CK_FLAGS = 256; +pub const CKF_DECRYPT: CK_FLAGS = 512; +pub const CKF_DIGEST: CK_FLAGS = 1024; +pub const CKF_SIGN: CK_FLAGS = 2048; +pub const CKF_SIGN_RECOVER: CK_FLAGS = 4096; +pub const CKF_VERIFY: CK_FLAGS = 8192; +pub const CKF_VERIFY_RECOVER: CK_FLAGS = 16384; +pub const CKF_GENERATE: CK_FLAGS = 32768; +pub const CKF_GENERATE_KEY_PAIR: CK_FLAGS = 65536; +pub const CKF_WRAP: CK_FLAGS = 131072; +pub const CKF_UNWRAP: CK_FLAGS = 262144; +pub const CKF_DERIVE: CK_FLAGS = 524288; +pub const CKF_EC_F_P: CK_FLAGS = 1048576; +pub const CKF_EC_F_2M: CK_FLAGS = 2097152; +pub const CKF_EC_ECPARAMETERS: CK_FLAGS = 4194304; +pub const CKF_EC_OID: CK_FLAGS = 8388608; +pub const CKF_EC_NAMEDCURVE: CK_FLAGS = 8388608; +pub const CKF_EC_UNCOMPRESS: CK_FLAGS = 16777216; +pub const CKF_EC_COMPRESS: CK_FLAGS = 33554432; +pub const CKF_EC_CURVENAME: CK_FLAGS = 67108864; +pub const CKF_EXTENSION: CK_FLAGS = 2147483648; +pub const CKR_OK: CK_RV = 0; +pub const CKR_CANCEL: CK_RV = 1; +pub const CKR_HOST_MEMORY: CK_RV = 2; +pub const CKR_SLOT_ID_INVALID: CK_RV = 3; +pub const CKR_GENERAL_ERROR: CK_RV = 5; +pub const CKR_FUNCTION_FAILED: CK_RV = 6; +pub const CKR_ARGUMENTS_BAD: CK_RV = 7; +pub const CKR_NO_EVENT: CK_RV = 8; +pub const CKR_NEED_TO_CREATE_THREADS: CK_RV = 9; +pub const CKR_CANT_LOCK: CK_RV = 10; +pub const CKR_ATTRIBUTE_READ_ONLY: CK_RV = 16; +pub const CKR_ATTRIBUTE_SENSITIVE: CK_RV = 17; +pub const CKR_ATTRIBUTE_TYPE_INVALID: CK_RV = 18; +pub const CKR_ATTRIBUTE_VALUE_INVALID: CK_RV = 19; +pub const CKR_ACTION_PROHIBITED: CK_RV = 27; +pub const CKR_DATA_INVALID: CK_RV = 32; +pub const CKR_DATA_LEN_RANGE: CK_RV = 33; +pub const CKR_DEVICE_ERROR: CK_RV = 48; +pub const CKR_DEVICE_MEMORY: CK_RV = 49; +pub const CKR_DEVICE_REMOVED: CK_RV = 50; +pub const CKR_ENCRYPTED_DATA_INVALID: CK_RV = 64; +pub const CKR_ENCRYPTED_DATA_LEN_RANGE: CK_RV = 65; +pub const CKR_AEAD_DECRYPT_FAILED: CK_RV = 66; +pub const CKR_FUNCTION_CANCELED: CK_RV = 80; +pub const CKR_FUNCTION_NOT_PARALLEL: CK_RV = 81; +pub const CKR_FUNCTION_NOT_SUPPORTED: CK_RV = 84; +pub const CKR_KEY_HANDLE_INVALID: CK_RV = 96; +pub const CKR_KEY_SIZE_RANGE: CK_RV = 98; +pub const CKR_KEY_TYPE_INCONSISTENT: CK_RV = 99; +pub const CKR_KEY_NOT_NEEDED: CK_RV = 100; +pub const CKR_KEY_CHANGED: CK_RV = 101; +pub const CKR_KEY_NEEDED: CK_RV = 102; +pub const CKR_KEY_INDIGESTIBLE: CK_RV = 103; +pub const CKR_KEY_FUNCTION_NOT_PERMITTED: CK_RV = 104; +pub const CKR_KEY_NOT_WRAPPABLE: CK_RV = 105; +pub const CKR_KEY_UNEXTRACTABLE: CK_RV = 106; +pub const CKR_MECHANISM_INVALID: CK_RV = 112; +pub const CKR_MECHANISM_PARAM_INVALID: CK_RV = 113; +pub const CKR_OBJECT_HANDLE_INVALID: CK_RV = 130; +pub const CKR_OPERATION_ACTIVE: CK_RV = 144; +pub const CKR_OPERATION_NOT_INITIALIZED: CK_RV = 145; +pub const CKR_PIN_INCORRECT: CK_RV = 160; +pub const CKR_PIN_INVALID: CK_RV = 161; +pub const CKR_PIN_LEN_RANGE: CK_RV = 162; +pub const CKR_PIN_EXPIRED: CK_RV = 163; +pub const CKR_PIN_LOCKED: CK_RV = 164; +pub const CKR_SESSION_CLOSED: CK_RV = 176; +pub const CKR_SESSION_COUNT: CK_RV = 177; +pub const CKR_SESSION_HANDLE_INVALID: CK_RV = 179; +pub const CKR_SESSION_PARALLEL_NOT_SUPPORTED: CK_RV = 180; +pub const CKR_SESSION_READ_ONLY: CK_RV = 181; +pub const CKR_SESSION_EXISTS: CK_RV = 182; +pub const CKR_SESSION_READ_ONLY_EXISTS: CK_RV = 183; +pub const CKR_SESSION_READ_WRITE_SO_EXISTS: CK_RV = 184; +pub const CKR_SIGNATURE_INVALID: CK_RV = 192; +pub const CKR_SIGNATURE_LEN_RANGE: CK_RV = 193; +pub const CKR_TEMPLATE_INCOMPLETE: CK_RV = 208; +pub const CKR_TEMPLATE_INCONSISTENT: CK_RV = 209; +pub const CKR_TOKEN_NOT_PRESENT: CK_RV = 224; +pub const CKR_TOKEN_NOT_RECOGNIZED: CK_RV = 225; +pub const CKR_TOKEN_WRITE_PROTECTED: CK_RV = 226; +pub const CKR_UNWRAPPING_KEY_HANDLE_INVALID: CK_RV = 240; +pub const CKR_UNWRAPPING_KEY_SIZE_RANGE: CK_RV = 241; +pub const CKR_UNWRAPPING_KEY_TYPE_INCONSISTENT: CK_RV = 242; +pub const CKR_USER_ALREADY_LOGGED_IN: CK_RV = 256; +pub const CKR_USER_NOT_LOGGED_IN: CK_RV = 257; +pub const CKR_USER_PIN_NOT_INITIALIZED: CK_RV = 258; +pub const CKR_USER_TYPE_INVALID: CK_RV = 259; +pub const CKR_USER_ANOTHER_ALREADY_LOGGED_IN: CK_RV = 260; +pub const CKR_USER_TOO_MANY_TYPES: CK_RV = 261; +pub const CKR_WRAPPED_KEY_INVALID: CK_RV = 272; +pub const CKR_WRAPPED_KEY_LEN_RANGE: CK_RV = 274; +pub const CKR_WRAPPING_KEY_HANDLE_INVALID: CK_RV = 275; +pub const CKR_WRAPPING_KEY_SIZE_RANGE: CK_RV = 276; +pub const CKR_WRAPPING_KEY_TYPE_INCONSISTENT: CK_RV = 277; +pub const CKR_RANDOM_SEED_NOT_SUPPORTED: CK_RV = 288; +pub const CKR_RANDOM_NO_RNG: CK_RV = 289; +pub const CKR_DOMAIN_PARAMS_INVALID: CK_RV = 304; +pub const CKR_CURVE_NOT_SUPPORTED: CK_RV = 320; +pub const CKR_BUFFER_TOO_SMALL: CK_RV = 336; +pub const CKR_SAVED_STATE_INVALID: CK_RV = 352; +pub const CKR_INFORMATION_SENSITIVE: CK_RV = 368; +pub const CKR_STATE_UNSAVEABLE: CK_RV = 384; +pub const CKR_CRYPTOKI_NOT_INITIALIZED: CK_RV = 400; +pub const CKR_CRYPTOKI_ALREADY_INITIALIZED: CK_RV = 401; +pub const CKR_MUTEX_BAD: CK_RV = 416; +pub const CKR_MUTEX_NOT_LOCKED: CK_RV = 417; +pub const CKR_NEW_PIN_MODE: CK_RV = 432; +pub const CKR_NEXT_OTP: CK_RV = 433; +pub const CKR_EXCEEDED_MAX_ITERATIONS: CK_RV = 437; +pub const CKR_FIPS_SELF_TEST_FAILED: CK_RV = 438; +pub const CKR_LIBRARY_LOAD_FAILED: CK_RV = 439; +pub const CKR_PIN_TOO_WEAK: CK_RV = 440; +pub const CKR_PUBLIC_KEY_INVALID: CK_RV = 441; +pub const CKR_FUNCTION_REJECTED: CK_RV = 512; +pub const CKR_TOKEN_RESOURCE_EXCEEDED: CK_RV = 513; +pub const CKR_VENDOR_DEFINED: CK_RV = 2147483648; +pub const CKF_END_OF_MESSAGE: CK_FLAGS = 1; +pub const CKF_INTERFACE_FORK_SAFE: CK_FLAGS = 1; +pub const CKF_LIBRARY_CANT_CREATE_OS_THREADS: CK_FLAGS = 1; +pub const CKF_OS_LOCKING_OK: CK_FLAGS = 2; +pub const CKF_DONT_BLOCK: CK_FLAGS = 1; +pub const CKG_MGF1_SHA1: CK_RSA_PKCS_MGF_TYPE = 1; +pub const CKG_MGF1_SHA256: CK_RSA_PKCS_MGF_TYPE = 2; +pub const CKG_MGF1_SHA384: CK_RSA_PKCS_MGF_TYPE = 3; +pub const CKG_MGF1_SHA512: CK_RSA_PKCS_MGF_TYPE = 4; +pub const CKG_MGF1_SHA224: CK_RSA_PKCS_MGF_TYPE = 5; +pub const CKZ_DATA_SPECIFIED: CK_RSA_PKCS_OAEP_SOURCE_TYPE = 1; +pub const CKD_NULL: CK_EC_KDF_TYPE = 1; +pub const CKD_SHA1_KDF: CK_EC_KDF_TYPE = 2; +pub const CKD_SHA1_KDF_ASN1: CK_EC_KDF_TYPE = 3; +pub const CKD_SHA1_KDF_CONCATENATE: CK_EC_KDF_TYPE = 4; +pub const CKD_SHA224_KDF: CK_EC_KDF_TYPE = 5; +pub const CKD_SHA256_KDF: CK_EC_KDF_TYPE = 6; +pub const CKD_SHA384_KDF: CK_EC_KDF_TYPE = 7; +pub const CKD_SHA512_KDF: CK_EC_KDF_TYPE = 8; +pub const CKD_CPDIVERSIFY_KDF: CK_EC_KDF_TYPE = 9; +pub const CKD_SHA3_224_KDF: CK_EC_KDF_TYPE = 10; +pub const CKD_SHA3_256_KDF: CK_EC_KDF_TYPE = 11; +pub const CKD_SHA3_384_KDF: CK_EC_KDF_TYPE = 12; +pub const CKD_SHA3_512_KDF: CK_EC_KDF_TYPE = 13; +pub const CKD_SHA1_KDF_SP800: CK_EC_KDF_TYPE = 14; +pub const CKD_SHA224_KDF_SP800: CK_EC_KDF_TYPE = 15; +pub const CKD_SHA256_KDF_SP800: CK_EC_KDF_TYPE = 16; +pub const CKD_SHA384_KDF_SP800: CK_EC_KDF_TYPE = 17; +pub const CKD_SHA512_KDF_SP800: CK_EC_KDF_TYPE = 18; +pub const CKD_SHA3_224_KDF_SP800: CK_EC_KDF_TYPE = 19; +pub const CKD_SHA3_256_KDF_SP800: CK_EC_KDF_TYPE = 20; +pub const CKD_SHA3_384_KDF_SP800: CK_EC_KDF_TYPE = 21; +pub const CKD_SHA3_512_KDF_SP800: CK_EC_KDF_TYPE = 22; +pub const CKD_BLAKE2B_160_KDF: CK_EC_KDF_TYPE = 23; +pub const CKD_BLAKE2B_256_KDF: CK_EC_KDF_TYPE = 24; +pub const CKD_BLAKE2B_384_KDF: CK_EC_KDF_TYPE = 25; +pub const CKD_BLAKE2B_512_KDF: CK_EC_KDF_TYPE = 26; +pub const CKP_PKCS5_PBKD2_HMAC_SHA1: CK_PROFILE_ID = 1; +pub const CKP_PKCS5_PBKD2_HMAC_GOSTR3411: CK_PROFILE_ID = 2; +pub const CKP_PKCS5_PBKD2_HMAC_SHA224: CK_PROFILE_ID = 3; +pub const CKP_PKCS5_PBKD2_HMAC_SHA256: CK_PROFILE_ID = 4; +pub const CKP_PKCS5_PBKD2_HMAC_SHA384: CK_PROFILE_ID = 5; +pub const CKP_PKCS5_PBKD2_HMAC_SHA512: CK_PROFILE_ID = 6; +pub const CKP_PKCS5_PBKD2_HMAC_SHA512_224: CK_PROFILE_ID = 7; +pub const CKP_PKCS5_PBKD2_HMAC_SHA512_256: CK_PROFILE_ID = 8; +pub const CKZ_SALT_SPECIFIED: CK_RSA_PKCS_OAEP_SOURCE_TYPE = 1; +pub const CK_OTP_VALUE: CK_ULONG = 0; +pub const CK_OTP_PIN: CK_ULONG = 1; +pub const CK_OTP_CHALLENGE: CK_ULONG = 2; +pub const CK_OTP_TIME: CK_ULONG = 3; +pub const CK_OTP_COUNTER: CK_ULONG = 4; +pub const CK_OTP_FLAGS: CK_ULONG = 5; +pub const CK_OTP_OUTPUT_LENGTH: CK_ULONG = 6; +pub const CK_OTP_OUTPUT_FORMAT: CK_ULONG = 7; +pub const CKF_NEXT_OTP: CK_FLAGS = 1; +pub const CKF_EXCLUDE_TIME: CK_FLAGS = 2; +pub const CKF_EXCLUDE_COUNTER: CK_FLAGS = 4; +pub const CKF_EXCLUDE_CHALLENGE: CK_FLAGS = 8; +pub const CKF_EXCLUDE_PIN: CK_FLAGS = 16; +pub const CKF_USER_FRIENDLY_OTP: CK_FLAGS = 32; +pub const CKG_NO_GENERATE: u32 = 0; +pub const CKG_GENERATE: u32 = 1; +pub const CKG_GENERATE_COUNTER: u32 = 2; +pub const CKG_GENERATE_RANDOM: u32 = 3; +pub const CK_SP800_108_ITERATION_VARIABLE: CK_ULONG = 1; +pub const CK_SP800_108_OPTIONAL_COUNTER: CK_ULONG = 2; +pub const CK_SP800_108_DKM_LENGTH: CK_ULONG = 3; +pub const CK_SP800_108_BYTE_ARRAY: CK_ULONG = 4; +pub const CKF_HKDF_SALT_NULL: CK_FLAGS = 1; +pub const CKF_HKDF_SALT_DATA: CK_FLAGS = 2; +pub const CKF_HKDF_SALT_KEY: CK_FLAGS = 4; +pub const CK_NEED_ARG_LIST: CK_ULONG = 1; +pub const CK_PKCS11_2_0_ONLY: CK_ULONG = 1; +pub type CK_BYTE = ::std::os::raw::c_uchar; +pub type CK_CHAR = CK_BYTE; +pub type CK_UTF8CHAR = CK_BYTE; +pub type CK_BBOOL = CK_BYTE; +pub type CK_ULONG = ::std::os::raw::c_ulong; +pub type CK_LONG = ::std::os::raw::c_long; +pub type CK_FLAGS = CK_ULONG; +pub type CK_BYTE_PTR = *mut CK_BYTE; +pub type CK_CHAR_PTR = *mut CK_CHAR; +pub type CK_UTF8CHAR_PTR = *mut CK_UTF8CHAR; +pub type CK_ULONG_PTR = *mut CK_ULONG; +pub type CK_VOID_PTR = *mut ::std::os::raw::c_void; +pub type CK_VOID_PTR_PTR = *mut CK_VOID_PTR; +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct CK_VERSION { + pub major: CK_BYTE, + pub minor: CK_BYTE, +} +pub type CK_VERSION_PTR = *mut CK_VERSION; +#[repr(C)] +#[cfg_attr(windows, repr(packed))] +#[derive(Debug, Default, Copy, Clone)] +pub struct CK_INFO { + pub cryptokiVersion: CK_VERSION, + pub manufacturerID: [CK_UTF8CHAR; 32usize], + pub flags: CK_FLAGS, + pub libraryDescription: [CK_UTF8CHAR; 32usize], + pub libraryVersion: CK_VERSION, +} +pub type CK_INFO_PTR = *mut CK_INFO; +pub type CK_NOTIFICATION = CK_ULONG; +pub type CK_SLOT_ID = CK_ULONG; +pub type CK_SLOT_ID_PTR = *mut CK_SLOT_ID; +#[repr(C)] +#[cfg_attr(windows, repr(packed))] +#[derive(Debug, Copy, Clone)] +pub struct CK_SLOT_INFO { + pub slotDescription: [CK_UTF8CHAR; 64usize], + pub manufacturerID: [CK_UTF8CHAR; 32usize], + pub flags: CK_FLAGS, + pub hardwareVersion: CK_VERSION, + pub firmwareVersion: CK_VERSION, +} +impl Default for CK_SLOT_INFO { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_SLOT_INFO_PTR = *mut CK_SLOT_INFO; +#[repr(C)] +#[cfg_attr(windows, repr(packed))] +#[derive(Debug, Default, Copy, Clone)] +pub struct CK_TOKEN_INFO { + pub label: [CK_UTF8CHAR; 32usize], + pub manufacturerID: [CK_UTF8CHAR; 32usize], + pub model: [CK_UTF8CHAR; 16usize], + pub serialNumber: [CK_CHAR; 16usize], + pub flags: CK_FLAGS, + pub ulMaxSessionCount: CK_ULONG, + pub ulSessionCount: CK_ULONG, + pub ulMaxRwSessionCount: CK_ULONG, + pub ulRwSessionCount: CK_ULONG, + pub ulMaxPinLen: CK_ULONG, + pub ulMinPinLen: CK_ULONG, + pub ulTotalPublicMemory: CK_ULONG, + pub ulFreePublicMemory: CK_ULONG, + pub ulTotalPrivateMemory: CK_ULONG, + pub ulFreePrivateMemory: CK_ULONG, + pub hardwareVersion: CK_VERSION, + pub firmwareVersion: CK_VERSION, + pub utcTime: [CK_CHAR; 16usize], +} +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; +pub type CK_USER_TYPE = CK_ULONG; +pub type CK_STATE = CK_ULONG; +#[repr(C)] +#[cfg_attr(windows, repr(packed))] +#[derive(Debug, Default, Copy, Clone)] +pub struct CK_SESSION_INFO { + pub slotID: CK_SLOT_ID, + pub state: CK_STATE, + pub flags: CK_FLAGS, + pub ulDeviceError: CK_ULONG, +} +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; +pub type CK_OBJECT_CLASS = CK_ULONG; +pub type CK_OBJECT_CLASS_PTR = *mut CK_OBJECT_CLASS; +pub type CK_HW_FEATURE_TYPE = CK_ULONG; +pub type CK_KEY_TYPE = CK_ULONG; +pub type CK_CERTIFICATE_TYPE = CK_ULONG; +pub type CK_ATTRIBUTE_TYPE = CK_ULONG; +#[repr(C)] +#[cfg_attr(windows, repr(packed))] +#[derive(Debug, Copy, Clone)] +pub struct CK_ATTRIBUTE { + pub type_: CK_ATTRIBUTE_TYPE, + pub pValue: CK_VOID_PTR, + pub ulValueLen: CK_ULONG, +} +impl Default for CK_ATTRIBUTE { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_ATTRIBUTE_PTR = *mut CK_ATTRIBUTE; +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct CK_DATE { + pub year: [CK_CHAR; 4usize], + pub month: [CK_CHAR; 2usize], + pub day: [CK_CHAR; 2usize], +} +pub type CK_MECHANISM_TYPE = CK_ULONG; +pub type CK_MECHANISM_TYPE_PTR = *mut CK_MECHANISM_TYPE; +#[repr(C)] +#[cfg_attr(windows, repr(packed))] +#[derive(Debug, Copy, Clone)] +pub struct CK_MECHANISM { + pub mechanism: CK_MECHANISM_TYPE, + pub pParameter: CK_VOID_PTR, + pub ulParameterLen: CK_ULONG, +} +impl Default for CK_MECHANISM { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_MECHANISM_PTR = *mut CK_MECHANISM; +#[repr(C)] +#[cfg_attr(windows, repr(packed))] +#[derive(Debug, Default, Copy, Clone)] +pub struct CK_MECHANISM_INFO { + pub ulMinKeySize: CK_ULONG, + pub ulMaxKeySize: CK_ULONG, + pub flags: CK_FLAGS, +} +pub type CK_MECHANISM_INFO_PTR = *mut CK_MECHANISM_INFO; +pub type CK_RV = CK_ULONG; +pub type CK_NOTIFY = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + event: CK_NOTIFICATION, + pApplication: CK_VOID_PTR, + ) -> CK_RV, +>; +pub type CK_FUNCTION_LIST_PTR = *mut CK_FUNCTION_LIST; +pub type CK_FUNCTION_LIST_3_0_PTR = *mut CK_FUNCTION_LIST_3_0; +pub type CK_FUNCTION_LIST_PTR_PTR = *mut CK_FUNCTION_LIST_PTR; +pub type CK_FUNCTION_LIST_3_0_PTR_PTR = *mut CK_FUNCTION_LIST_3_0_PTR; +#[repr(C)] +#[cfg_attr(windows, repr(packed))] +#[derive(Debug, Copy, Clone)] +pub struct CK_INTERFACE { + pub pInterfaceName: *mut CK_CHAR, + pub pFunctionList: CK_VOID_PTR, + pub flags: CK_FLAGS, +} +impl Default for CK_INTERFACE { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_INTERFACE_PTR = *mut CK_INTERFACE; +pub type CK_INTERFACE_PTR_PTR = *mut CK_INTERFACE_PTR; +pub type CK_CREATEMUTEX = + ::std::option::Option CK_RV>; +pub type CK_DESTROYMUTEX = + ::std::option::Option CK_RV>; +pub type CK_LOCKMUTEX = ::std::option::Option CK_RV>; +pub type CK_UNLOCKMUTEX = ::std::option::Option CK_RV>; +#[repr(C)] +#[cfg_attr(windows, repr(packed))] +#[derive(Debug, Copy, Clone)] +pub struct CK_C_INITIALIZE_ARGS { + pub CreateMutex: CK_CREATEMUTEX, + pub DestroyMutex: CK_DESTROYMUTEX, + pub LockMutex: CK_LOCKMUTEX, + pub UnlockMutex: CK_UNLOCKMUTEX, + pub flags: CK_FLAGS, + pub pReserved: CK_VOID_PTR, +} +impl Default for CK_C_INITIALIZE_ARGS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_C_INITIALIZE_ARGS_PTR = *mut CK_C_INITIALIZE_ARGS; +pub type CK_RSA_PKCS_MGF_TYPE = CK_ULONG; +pub type CK_RSA_PKCS_MGF_TYPE_PTR = *mut CK_RSA_PKCS_MGF_TYPE; +pub type CK_RSA_PKCS_OAEP_SOURCE_TYPE = CK_ULONG; +pub type CK_RSA_PKCS_OAEP_SOURCE_TYPE_PTR = *mut CK_RSA_PKCS_OAEP_SOURCE_TYPE; +#[repr(C)] +#[cfg_attr(windows, repr(packed))] +#[derive(Debug, Copy, Clone)] +pub struct CK_RSA_PKCS_OAEP_PARAMS { + pub hashAlg: CK_MECHANISM_TYPE, + pub mgf: CK_RSA_PKCS_MGF_TYPE, + pub source: CK_RSA_PKCS_OAEP_SOURCE_TYPE, + pub pSourceData: CK_VOID_PTR, + pub ulSourceDataLen: CK_ULONG, +} +impl Default for CK_RSA_PKCS_OAEP_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_RSA_PKCS_OAEP_PARAMS_PTR = *mut CK_RSA_PKCS_OAEP_PARAMS; +#[repr(C)] +#[cfg_attr(windows, repr(packed))] +#[derive(Debug, Default, Copy, Clone)] +pub struct CK_RSA_PKCS_PSS_PARAMS { + pub hashAlg: CK_MECHANISM_TYPE, + pub mgf: CK_RSA_PKCS_MGF_TYPE, + pub sLen: CK_ULONG, +} +pub type CK_RSA_PKCS_PSS_PARAMS_PTR = *mut CK_RSA_PKCS_PSS_PARAMS; +pub type CK_EC_KDF_TYPE = CK_ULONG; +#[repr(C)] +#[cfg_attr(windows, repr(packed))] +#[derive(Debug, Copy, Clone)] +pub struct CK_ECDH1_DERIVE_PARAMS { + pub kdf: CK_EC_KDF_TYPE, + pub ulSharedDataLen: CK_ULONG, + pub pSharedData: CK_BYTE_PTR, + pub ulPublicDataLen: CK_ULONG, + pub pPublicData: CK_BYTE_PTR, +} +impl Default for CK_ECDH1_DERIVE_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_ECDH1_DERIVE_PARAMS_PTR = *mut CK_ECDH1_DERIVE_PARAMS; +#[repr(C)] +#[cfg_attr(windows, repr(packed))] +#[derive(Debug, Copy, Clone)] +pub struct CK_ECDH2_DERIVE_PARAMS { + pub kdf: CK_EC_KDF_TYPE, + pub ulSharedDataLen: CK_ULONG, + pub pSharedData: CK_BYTE_PTR, + pub ulPublicDataLen: CK_ULONG, + pub pPublicData: CK_BYTE_PTR, + pub ulPrivateDataLen: CK_ULONG, + pub hPrivateData: CK_OBJECT_HANDLE, + pub ulPublicDataLen2: CK_ULONG, + pub pPublicData2: CK_BYTE_PTR, +} +impl Default for CK_ECDH2_DERIVE_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_ECDH2_DERIVE_PARAMS_PTR = *mut CK_ECDH2_DERIVE_PARAMS; +#[repr(C)] +#[cfg_attr(windows, repr(packed))] +#[derive(Debug, Copy, Clone)] +pub struct CK_ECMQV_DERIVE_PARAMS { + pub kdf: CK_EC_KDF_TYPE, + pub ulSharedDataLen: CK_ULONG, + pub pSharedData: CK_BYTE_PTR, + pub ulPublicDataLen: CK_ULONG, + pub pPublicData: CK_BYTE_PTR, + pub ulPrivateDataLen: CK_ULONG, + pub hPrivateData: CK_OBJECT_HANDLE, + pub ulPublicDataLen2: CK_ULONG, + pub pPublicData2: CK_BYTE_PTR, + pub publicKey: CK_OBJECT_HANDLE, +} +impl Default for CK_ECMQV_DERIVE_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_ECMQV_DERIVE_PARAMS_PTR = *mut CK_ECMQV_DERIVE_PARAMS; +pub type CK_X9_42_DH_KDF_TYPE = CK_ULONG; +pub type CK_X9_42_DH_KDF_TYPE_PTR = *mut CK_X9_42_DH_KDF_TYPE; +#[repr(C)] +#[cfg_attr(windows, repr(packed))] +#[derive(Debug, Copy, Clone)] +pub struct CK_X9_42_DH1_DERIVE_PARAMS { + pub kdf: CK_X9_42_DH_KDF_TYPE, + pub ulOtherInfoLen: CK_ULONG, + pub pOtherInfo: CK_BYTE_PTR, + pub ulPublicDataLen: CK_ULONG, + pub pPublicData: CK_BYTE_PTR, +} +impl Default for CK_X9_42_DH1_DERIVE_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_X9_42_DH1_DERIVE_PARAMS_PTR = *mut CK_X9_42_DH1_DERIVE_PARAMS; +#[repr(C)] +#[cfg_attr(windows, repr(packed))] +#[derive(Debug, Copy, Clone)] +pub struct CK_X9_42_DH2_DERIVE_PARAMS { + pub kdf: CK_X9_42_DH_KDF_TYPE, + pub ulOtherInfoLen: CK_ULONG, + pub pOtherInfo: CK_BYTE_PTR, + pub ulPublicDataLen: CK_ULONG, + pub pPublicData: CK_BYTE_PTR, + pub ulPrivateDataLen: CK_ULONG, + pub hPrivateData: CK_OBJECT_HANDLE, + pub ulPublicDataLen2: CK_ULONG, + pub pPublicData2: CK_BYTE_PTR, +} +impl Default for CK_X9_42_DH2_DERIVE_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_X9_42_DH2_DERIVE_PARAMS_PTR = *mut CK_X9_42_DH2_DERIVE_PARAMS; +#[repr(C)] +#[cfg_attr(windows, repr(packed))] +#[derive(Debug, Copy, Clone)] +pub struct CK_X9_42_MQV_DERIVE_PARAMS { + pub kdf: CK_X9_42_DH_KDF_TYPE, + pub ulOtherInfoLen: CK_ULONG, + pub pOtherInfo: CK_BYTE_PTR, + pub ulPublicDataLen: CK_ULONG, + pub pPublicData: CK_BYTE_PTR, + pub ulPrivateDataLen: CK_ULONG, + pub hPrivateData: CK_OBJECT_HANDLE, + pub ulPublicDataLen2: CK_ULONG, + pub pPublicData2: CK_BYTE_PTR, + pub publicKey: CK_OBJECT_HANDLE, +} +impl Default for CK_X9_42_MQV_DERIVE_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_X9_42_MQV_DERIVE_PARAMS_PTR = *mut CK_X9_42_MQV_DERIVE_PARAMS; +#[repr(C)] +#[cfg_attr(windows, repr(packed))] +#[derive(Debug, Copy, Clone)] +pub struct CK_KEA_DERIVE_PARAMS { + pub isSender: CK_BBOOL, + pub ulRandomLen: CK_ULONG, + pub pRandomA: CK_BYTE_PTR, + pub pRandomB: CK_BYTE_PTR, + pub ulPublicDataLen: CK_ULONG, + pub pPublicData: CK_BYTE_PTR, +} +impl Default for CK_KEA_DERIVE_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_KEA_DERIVE_PARAMS_PTR = *mut CK_KEA_DERIVE_PARAMS; +pub type CK_RC2_PARAMS = CK_ULONG; +pub type CK_RC2_PARAMS_PTR = *mut CK_RC2_PARAMS; +#[repr(C)] +#[cfg_attr(windows, repr(packed))] +#[derive(Debug, Default, Copy, Clone)] +pub struct CK_RC2_CBC_PARAMS { + pub ulEffectiveBits: CK_ULONG, + pub iv: [CK_BYTE; 8usize], +} +pub type CK_RC2_CBC_PARAMS_PTR = *mut CK_RC2_CBC_PARAMS; +#[repr(C)] +#[cfg_attr(windows, repr(packed))] +#[derive(Debug, Default, Copy, Clone)] +pub struct CK_RC2_MAC_GENERAL_PARAMS { + pub ulEffectiveBits: CK_ULONG, + pub ulMacLength: CK_ULONG, +} +pub type CK_RC2_MAC_GENERAL_PARAMS_PTR = *mut CK_RC2_MAC_GENERAL_PARAMS; +#[repr(C)] +#[cfg_attr(windows, repr(packed))] +#[derive(Debug, Default, Copy, Clone)] +pub struct CK_RC5_PARAMS { + pub ulWordsize: CK_ULONG, + pub ulRounds: CK_ULONG, +} +pub type CK_RC5_PARAMS_PTR = *mut CK_RC5_PARAMS; +#[repr(C)] +#[cfg_attr(windows, repr(packed))] +#[derive(Debug, Copy, Clone)] +pub struct CK_RC5_CBC_PARAMS { + pub ulWordsize: CK_ULONG, + pub ulRounds: CK_ULONG, + pub pIv: CK_BYTE_PTR, + pub ulIvLen: CK_ULONG, +} +impl Default for CK_RC5_CBC_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_RC5_CBC_PARAMS_PTR = *mut CK_RC5_CBC_PARAMS; +#[repr(C)] +#[cfg_attr(windows, repr(packed))] +#[derive(Debug, Default, Copy, Clone)] +pub struct CK_RC5_MAC_GENERAL_PARAMS { + pub ulWordsize: CK_ULONG, + pub ulRounds: CK_ULONG, + pub ulMacLength: CK_ULONG, +} +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; +#[repr(C)] +#[cfg_attr(windows, repr(packed))] +#[derive(Debug, Copy, Clone)] +pub struct CK_DES_CBC_ENCRYPT_DATA_PARAMS { + pub iv: [CK_BYTE; 8usize], + pub pData: CK_BYTE_PTR, + pub length: CK_ULONG, +} +impl Default for CK_DES_CBC_ENCRYPT_DATA_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_DES_CBC_ENCRYPT_DATA_PARAMS_PTR = *mut CK_DES_CBC_ENCRYPT_DATA_PARAMS; +#[repr(C)] +#[cfg_attr(windows, repr(packed))] +#[derive(Debug, Copy, Clone)] +pub struct CK_AES_CBC_ENCRYPT_DATA_PARAMS { + pub iv: [CK_BYTE; 16usize], + pub pData: CK_BYTE_PTR, + pub length: CK_ULONG, +} +impl Default for CK_AES_CBC_ENCRYPT_DATA_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_AES_CBC_ENCRYPT_DATA_PARAMS_PTR = *mut CK_AES_CBC_ENCRYPT_DATA_PARAMS; +#[repr(C)] +#[cfg_attr(windows, repr(packed))] +#[derive(Debug, Copy, Clone)] +pub struct CK_SKIPJACK_PRIVATE_WRAP_PARAMS { + pub ulPasswordLen: CK_ULONG, + pub pPassword: CK_BYTE_PTR, + pub ulPublicDataLen: CK_ULONG, + pub pPublicData: CK_BYTE_PTR, + pub ulPAndGLen: CK_ULONG, + pub ulQLen: CK_ULONG, + pub ulRandomLen: CK_ULONG, + pub pRandomA: CK_BYTE_PTR, + pub pPrimeP: CK_BYTE_PTR, + pub pBaseG: CK_BYTE_PTR, + pub pSubprimeQ: CK_BYTE_PTR, +} +impl Default for CK_SKIPJACK_PRIVATE_WRAP_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_SKIPJACK_PRIVATE_WRAP_PARAMS_PTR = *mut CK_SKIPJACK_PRIVATE_WRAP_PARAMS; +#[repr(C)] +#[cfg_attr(windows, repr(packed))] +#[derive(Debug, Copy, Clone)] +pub struct CK_SKIPJACK_RELAYX_PARAMS { + pub ulOldWrappedXLen: CK_ULONG, + pub pOldWrappedX: CK_BYTE_PTR, + pub ulOldPasswordLen: CK_ULONG, + pub pOldPassword: CK_BYTE_PTR, + pub ulOldPublicDataLen: CK_ULONG, + pub pOldPublicData: CK_BYTE_PTR, + pub ulOldRandomLen: CK_ULONG, + pub pOldRandomA: CK_BYTE_PTR, + pub ulNewPasswordLen: CK_ULONG, + pub pNewPassword: CK_BYTE_PTR, + pub ulNewPublicDataLen: CK_ULONG, + pub pNewPublicData: CK_BYTE_PTR, + pub ulNewRandomLen: CK_ULONG, + pub pNewRandomA: CK_BYTE_PTR, +} +impl Default for CK_SKIPJACK_RELAYX_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_SKIPJACK_RELAYX_PARAMS_PTR = *mut CK_SKIPJACK_RELAYX_PARAMS; +#[repr(C)] +#[cfg_attr(windows, repr(packed))] +#[derive(Debug, Copy, Clone)] +pub struct CK_PBE_PARAMS { + pub pInitVector: CK_BYTE_PTR, + pub pPassword: CK_UTF8CHAR_PTR, + pub ulPasswordLen: CK_ULONG, + pub pSalt: CK_BYTE_PTR, + pub ulSaltLen: CK_ULONG, + pub ulIteration: CK_ULONG, +} +impl Default for CK_PBE_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_PBE_PARAMS_PTR = *mut CK_PBE_PARAMS; +#[repr(C)] +#[cfg_attr(windows, repr(packed))] +#[derive(Debug, Copy, Clone)] +pub struct CK_KEY_WRAP_SET_OAEP_PARAMS { + pub bBC: CK_BYTE, + pub pX: CK_BYTE_PTR, + pub ulXLen: CK_ULONG, +} +impl Default for CK_KEY_WRAP_SET_OAEP_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_KEY_WRAP_SET_OAEP_PARAMS_PTR = *mut CK_KEY_WRAP_SET_OAEP_PARAMS; +#[repr(C)] +#[cfg_attr(windows, repr(packed))] +#[derive(Debug, Copy, Clone)] +pub struct CK_SSL3_RANDOM_DATA { + pub pClientRandom: CK_BYTE_PTR, + pub ulClientRandomLen: CK_ULONG, + pub pServerRandom: CK_BYTE_PTR, + pub ulServerRandomLen: CK_ULONG, +} +impl Default for CK_SSL3_RANDOM_DATA { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +#[repr(C)] +#[cfg_attr(windows, repr(packed))] +#[derive(Debug, Copy, Clone)] +pub struct CK_SSL3_MASTER_KEY_DERIVE_PARAMS { + pub RandomInfo: CK_SSL3_RANDOM_DATA, + pub pVersion: CK_VERSION_PTR, +} +impl Default for CK_SSL3_MASTER_KEY_DERIVE_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_SSL3_MASTER_KEY_DERIVE_PARAMS_PTR = *mut CK_SSL3_MASTER_KEY_DERIVE_PARAMS; +#[repr(C)] +#[cfg_attr(windows, repr(packed))] +#[derive(Debug, Copy, Clone)] +pub struct CK_SSL3_KEY_MAT_OUT { + pub hClientMacSecret: CK_OBJECT_HANDLE, + pub hServerMacSecret: CK_OBJECT_HANDLE, + pub hClientKey: CK_OBJECT_HANDLE, + pub hServerKey: CK_OBJECT_HANDLE, + pub pIVClient: CK_BYTE_PTR, + pub pIVServer: CK_BYTE_PTR, +} +impl Default for CK_SSL3_KEY_MAT_OUT { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_SSL3_KEY_MAT_OUT_PTR = *mut CK_SSL3_KEY_MAT_OUT; +#[repr(C)] +#[cfg_attr(windows, repr(packed))] +#[derive(Debug, Copy, Clone)] +pub struct CK_SSL3_KEY_MAT_PARAMS { + pub ulMacSizeInBits: CK_ULONG, + pub ulKeySizeInBits: CK_ULONG, + pub ulIVSizeInBits: CK_ULONG, + pub bIsExport: CK_BBOOL, + pub RandomInfo: CK_SSL3_RANDOM_DATA, + pub pReturnedKeyMaterial: CK_SSL3_KEY_MAT_OUT_PTR, +} +impl Default for CK_SSL3_KEY_MAT_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_SSL3_KEY_MAT_PARAMS_PTR = *mut CK_SSL3_KEY_MAT_PARAMS; +#[repr(C)] +#[cfg_attr(windows, repr(packed))] +#[derive(Debug, Copy, Clone)] +pub struct CK_TLS_PRF_PARAMS { + pub pSeed: CK_BYTE_PTR, + pub ulSeedLen: CK_ULONG, + pub pLabel: CK_BYTE_PTR, + pub ulLabelLen: CK_ULONG, + pub pOutput: CK_BYTE_PTR, + pub pulOutputLen: CK_ULONG_PTR, +} +impl Default for CK_TLS_PRF_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_TLS_PRF_PARAMS_PTR = *mut CK_TLS_PRF_PARAMS; +#[repr(C)] +#[cfg_attr(windows, repr(packed))] +#[derive(Debug, Copy, Clone)] +pub struct CK_WTLS_RANDOM_DATA { + pub pClientRandom: CK_BYTE_PTR, + pub ulClientRandomLen: CK_ULONG, + pub pServerRandom: CK_BYTE_PTR, + pub ulServerRandomLen: CK_ULONG, +} +impl Default for CK_WTLS_RANDOM_DATA { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_WTLS_RANDOM_DATA_PTR = *mut CK_WTLS_RANDOM_DATA; +#[repr(C)] +#[cfg_attr(windows, repr(packed))] +#[derive(Debug, Copy, Clone)] +pub struct CK_WTLS_MASTER_KEY_DERIVE_PARAMS { + pub DigestMechanism: CK_MECHANISM_TYPE, + pub RandomInfo: CK_WTLS_RANDOM_DATA, + pub pVersion: CK_BYTE_PTR, +} +impl Default for CK_WTLS_MASTER_KEY_DERIVE_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_WTLS_MASTER_KEY_DERIVE_PARAMS_PTR = *mut CK_WTLS_MASTER_KEY_DERIVE_PARAMS; +#[repr(C)] +#[cfg_attr(windows, repr(packed))] +#[derive(Debug, Copy, Clone)] +pub struct CK_WTLS_PRF_PARAMS { + pub DigestMechanism: CK_MECHANISM_TYPE, + pub pSeed: CK_BYTE_PTR, + pub ulSeedLen: CK_ULONG, + pub pLabel: CK_BYTE_PTR, + pub ulLabelLen: CK_ULONG, + pub pOutput: CK_BYTE_PTR, + pub pulOutputLen: CK_ULONG_PTR, +} +impl Default for CK_WTLS_PRF_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_WTLS_PRF_PARAMS_PTR = *mut CK_WTLS_PRF_PARAMS; +#[repr(C)] +#[cfg_attr(windows, repr(packed))] +#[derive(Debug, Copy, Clone)] +pub struct CK_WTLS_KEY_MAT_OUT { + pub hMacSecret: CK_OBJECT_HANDLE, + pub hKey: CK_OBJECT_HANDLE, + pub pIV: CK_BYTE_PTR, +} +impl Default for CK_WTLS_KEY_MAT_OUT { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_WTLS_KEY_MAT_OUT_PTR = *mut CK_WTLS_KEY_MAT_OUT; +#[repr(C)] +#[cfg_attr(windows, repr(packed))] +#[derive(Debug, Copy, Clone)] +pub struct CK_WTLS_KEY_MAT_PARAMS { + pub DigestMechanism: CK_MECHANISM_TYPE, + pub ulMacSizeInBits: CK_ULONG, + pub ulKeySizeInBits: CK_ULONG, + pub ulIVSizeInBits: CK_ULONG, + pub ulSequenceNumber: CK_ULONG, + pub bIsExport: CK_BBOOL, + pub RandomInfo: CK_WTLS_RANDOM_DATA, + pub pReturnedKeyMaterial: CK_WTLS_KEY_MAT_OUT_PTR, +} +impl Default for CK_WTLS_KEY_MAT_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_WTLS_KEY_MAT_PARAMS_PTR = *mut CK_WTLS_KEY_MAT_PARAMS; +#[repr(C)] +#[cfg_attr(windows, repr(packed))] +#[derive(Debug, Copy, Clone)] +pub struct CK_CMS_SIG_PARAMS { + pub certificateHandle: CK_OBJECT_HANDLE, + pub pSigningMechanism: CK_MECHANISM_PTR, + pub pDigestMechanism: CK_MECHANISM_PTR, + pub pContentType: CK_UTF8CHAR_PTR, + pub pRequestedAttributes: CK_BYTE_PTR, + pub ulRequestedAttributesLen: CK_ULONG, + pub pRequiredAttributes: CK_BYTE_PTR, + pub ulRequiredAttributesLen: CK_ULONG, +} +impl Default for CK_CMS_SIG_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_CMS_SIG_PARAMS_PTR = *mut CK_CMS_SIG_PARAMS; +#[repr(C)] +#[cfg_attr(windows, repr(packed))] +#[derive(Debug, Copy, Clone)] +pub struct CK_KEY_DERIVATION_STRING_DATA { + pub pData: CK_BYTE_PTR, + pub ulLen: CK_ULONG, +} +impl Default for CK_KEY_DERIVATION_STRING_DATA { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_KEY_DERIVATION_STRING_DATA_PTR = *mut CK_KEY_DERIVATION_STRING_DATA; +pub type CK_EXTRACT_PARAMS = CK_ULONG; +pub type CK_EXTRACT_PARAMS_PTR = *mut CK_EXTRACT_PARAMS; +pub type CK_PKCS5_PBKD2_PSEUDO_RANDOM_FUNCTION_TYPE = CK_ULONG; +pub type CK_PKCS5_PBKD2_PSEUDO_RANDOM_FUNCTION_TYPE_PTR = + *mut CK_PKCS5_PBKD2_PSEUDO_RANDOM_FUNCTION_TYPE; +pub type CK_PKCS5_PBKDF2_SALT_SOURCE_TYPE = CK_ULONG; +pub type CK_PKCS5_PBKDF2_SALT_SOURCE_TYPE_PTR = *mut CK_PKCS5_PBKDF2_SALT_SOURCE_TYPE; +#[repr(C)] +#[cfg_attr(windows, repr(packed))] +#[derive(Debug, Copy, Clone)] +pub struct CK_PKCS5_PBKD2_PARAMS { + pub saltSource: CK_PKCS5_PBKDF2_SALT_SOURCE_TYPE, + pub pSaltSourceData: CK_VOID_PTR, + pub ulSaltSourceDataLen: CK_ULONG, + pub iterations: CK_ULONG, + pub prf: CK_PKCS5_PBKD2_PSEUDO_RANDOM_FUNCTION_TYPE, + pub pPrfData: CK_VOID_PTR, + pub ulPrfDataLen: CK_ULONG, + pub pPassword: CK_UTF8CHAR_PTR, + pub ulPasswordLen: CK_ULONG_PTR, +} +impl Default for CK_PKCS5_PBKD2_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_PKCS5_PBKD2_PARAMS_PTR = *mut CK_PKCS5_PBKD2_PARAMS; +#[repr(C)] +#[cfg_attr(windows, repr(packed))] +#[derive(Debug, Copy, Clone)] +pub struct CK_PKCS5_PBKD2_PARAMS2 { + pub saltSource: CK_PKCS5_PBKDF2_SALT_SOURCE_TYPE, + pub pSaltSourceData: CK_VOID_PTR, + pub ulSaltSourceDataLen: CK_ULONG, + pub iterations: CK_ULONG, + pub prf: CK_PKCS5_PBKD2_PSEUDO_RANDOM_FUNCTION_TYPE, + pub pPrfData: CK_VOID_PTR, + pub ulPrfDataLen: CK_ULONG, + pub pPassword: CK_UTF8CHAR_PTR, + pub ulPasswordLen: CK_ULONG, +} +impl Default for CK_PKCS5_PBKD2_PARAMS2 { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_PKCS5_PBKD2_PARAMS2_PTR = *mut CK_PKCS5_PBKD2_PARAMS2; +pub type CK_OTP_PARAM_TYPE = CK_ULONG; +pub type CK_PARAM_TYPE = CK_OTP_PARAM_TYPE; +#[repr(C)] +#[cfg_attr(windows, repr(packed))] +#[derive(Debug, Copy, Clone)] +pub struct CK_OTP_PARAM { + pub type_: CK_OTP_PARAM_TYPE, + pub pValue: CK_VOID_PTR, + pub ulValueLen: CK_ULONG, +} +impl Default for CK_OTP_PARAM { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_OTP_PARAM_PTR = *mut CK_OTP_PARAM; +#[repr(C)] +#[cfg_attr(windows, repr(packed))] +#[derive(Debug, Copy, Clone)] +pub struct CK_OTP_PARAMS { + pub pParams: CK_OTP_PARAM_PTR, + pub ulCount: CK_ULONG, +} +impl Default for CK_OTP_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_OTP_PARAMS_PTR = *mut CK_OTP_PARAMS; +#[repr(C)] +#[cfg_attr(windows, repr(packed))] +#[derive(Debug, Copy, Clone)] +pub struct CK_OTP_SIGNATURE_INFO { + pub pParams: CK_OTP_PARAM_PTR, + pub ulCount: CK_ULONG, +} +impl Default for CK_OTP_SIGNATURE_INFO { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_OTP_SIGNATURE_INFO_PTR = *mut CK_OTP_SIGNATURE_INFO; +#[repr(C)] +#[cfg_attr(windows, repr(packed))] +#[derive(Debug, Copy, Clone)] +pub struct CK_KIP_PARAMS { + pub pMechanism: CK_MECHANISM_PTR, + pub hKey: CK_OBJECT_HANDLE, + pub pSeed: CK_BYTE_PTR, + pub ulSeedLen: CK_ULONG, +} +impl Default for CK_KIP_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_KIP_PARAMS_PTR = *mut CK_KIP_PARAMS; +#[repr(C)] +#[cfg_attr(windows, repr(packed))] +#[derive(Debug, Default, Copy, Clone)] +pub struct CK_AES_CTR_PARAMS { + pub ulCounterBits: CK_ULONG, + pub cb: [CK_BYTE; 16usize], +} +pub type CK_AES_CTR_PARAMS_PTR = *mut CK_AES_CTR_PARAMS; +#[repr(C)] +#[cfg_attr(windows, repr(packed))] +#[derive(Debug, Copy, Clone)] +pub struct CK_GCM_PARAMS { + pub pIv: CK_BYTE_PTR, + pub ulIvLen: CK_ULONG, + pub ulIvBits: CK_ULONG, + pub pAAD: CK_BYTE_PTR, + pub ulAADLen: CK_ULONG, + pub ulTagBits: CK_ULONG, +} +impl Default for CK_GCM_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_GCM_PARAMS_PTR = *mut CK_GCM_PARAMS; +pub type CK_GENERATOR_FUNCTION = CK_ULONG; +#[repr(C)] +#[cfg_attr(windows, repr(packed))] +#[derive(Debug, Copy, Clone)] +pub struct CK_GCM_MESSAGE_PARAMS { + pub pIv: CK_BYTE_PTR, + pub ulIvLen: CK_ULONG, + pub ulIvFixedBits: CK_ULONG, + pub ivGenerator: CK_GENERATOR_FUNCTION, + pub pTag: CK_BYTE_PTR, + pub ulTagBits: CK_ULONG, +} +impl Default for CK_GCM_MESSAGE_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_GCM_MESSAGE_PARAMS_PTR = CK_GCM_MESSAGE_PARAMS; +#[repr(C)] +#[cfg_attr(windows, repr(packed))] +#[derive(Debug, Copy, Clone)] +pub struct CK_CCM_PARAMS { + pub ulDataLen: CK_ULONG, + pub pNonce: CK_BYTE_PTR, + pub ulNonceLen: CK_ULONG, + pub pAAD: CK_BYTE_PTR, + pub ulAADLen: CK_ULONG, + pub ulMACLen: CK_ULONG, +} +impl Default for CK_CCM_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_CCM_PARAMS_PTR = *mut CK_CCM_PARAMS; +#[repr(C)] +#[cfg_attr(windows, repr(packed))] +#[derive(Debug, Copy, Clone)] +pub struct CK_CCM_MESSAGE_PARAMS { + pub ulDataLen: CK_ULONG, + pub pNonce: CK_BYTE_PTR, + pub ulNonceLen: CK_ULONG, + pub ulNonceFixedBits: CK_ULONG, + pub nonceGenerator: CK_GENERATOR_FUNCTION, + pub pMAC: CK_BYTE_PTR, + pub ulMACLen: CK_ULONG, +} +impl Default for CK_CCM_MESSAGE_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_CCM_MESSAGE_PARAMS_PTR = CK_CCM_MESSAGE_PARAMS; +#[repr(C)] +#[cfg_attr(windows, repr(packed))] +#[derive(Debug, Copy, Clone)] +pub struct CK_AES_GCM_PARAMS { + pub pIv: CK_BYTE_PTR, + pub ulIvLen: CK_ULONG, + pub ulIvBits: CK_ULONG, + pub pAAD: CK_BYTE_PTR, + pub ulAADLen: CK_ULONG, + pub ulTagBits: CK_ULONG, +} +impl Default for CK_AES_GCM_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_AES_GCM_PARAMS_PTR = *mut CK_AES_GCM_PARAMS; +#[repr(C)] +#[cfg_attr(windows, repr(packed))] +#[derive(Debug, Copy, Clone)] +pub struct CK_AES_CCM_PARAMS { + pub ulDataLen: CK_ULONG, + pub pNonce: CK_BYTE_PTR, + pub ulNonceLen: CK_ULONG, + pub pAAD: CK_BYTE_PTR, + pub ulAADLen: CK_ULONG, + pub ulMACLen: CK_ULONG, +} +impl Default for CK_AES_CCM_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_AES_CCM_PARAMS_PTR = *mut CK_AES_CCM_PARAMS; +#[repr(C)] +#[cfg_attr(windows, repr(packed))] +#[derive(Debug, Default, Copy, Clone)] +pub struct CK_CAMELLIA_CTR_PARAMS { + pub ulCounterBits: CK_ULONG, + pub cb: [CK_BYTE; 16usize], +} +pub type CK_CAMELLIA_CTR_PARAMS_PTR = *mut CK_CAMELLIA_CTR_PARAMS; +#[repr(C)] +#[cfg_attr(windows, repr(packed))] +#[derive(Debug, Copy, Clone)] +pub struct CK_CAMELLIA_CBC_ENCRYPT_DATA_PARAMS { + pub iv: [CK_BYTE; 16usize], + pub pData: CK_BYTE_PTR, + pub length: CK_ULONG, +} +impl Default for CK_CAMELLIA_CBC_ENCRYPT_DATA_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_CAMELLIA_CBC_ENCRYPT_DATA_PARAMS_PTR = *mut CK_CAMELLIA_CBC_ENCRYPT_DATA_PARAMS; +#[repr(C)] +#[cfg_attr(windows, repr(packed))] +#[derive(Debug, Copy, Clone)] +pub struct CK_ARIA_CBC_ENCRYPT_DATA_PARAMS { + pub iv: [CK_BYTE; 16usize], + pub pData: CK_BYTE_PTR, + pub length: CK_ULONG, +} +impl Default for CK_ARIA_CBC_ENCRYPT_DATA_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_ARIA_CBC_ENCRYPT_DATA_PARAMS_PTR = *mut CK_ARIA_CBC_ENCRYPT_DATA_PARAMS; +#[repr(C)] +#[cfg_attr(windows, repr(packed))] +#[derive(Debug, Copy, Clone)] +pub struct CK_DSA_PARAMETER_GEN_PARAM { + pub hash: CK_MECHANISM_TYPE, + pub pSeed: CK_BYTE_PTR, + pub ulSeedLen: CK_ULONG, + pub ulIndex: CK_ULONG, +} +impl Default for CK_DSA_PARAMETER_GEN_PARAM { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_DSA_PARAMETER_GEN_PARAM_PTR = *mut CK_DSA_PARAMETER_GEN_PARAM; +#[repr(C)] +#[cfg_attr(windows, repr(packed))] +#[derive(Debug, Copy, Clone)] +pub struct CK_ECDH_AES_KEY_WRAP_PARAMS { + pub ulAESKeyBits: CK_ULONG, + pub kdf: CK_EC_KDF_TYPE, + pub ulSharedDataLen: CK_ULONG, + pub pSharedData: CK_BYTE_PTR, +} +impl Default for CK_ECDH_AES_KEY_WRAP_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_ECDH_AES_KEY_WRAP_PARAMS_PTR = *mut CK_ECDH_AES_KEY_WRAP_PARAMS; +pub type CK_JAVA_MIDP_SECURITY_DOMAIN = CK_ULONG; +pub type CK_CERTIFICATE_CATEGORY = CK_ULONG; +#[repr(C)] +#[cfg_attr(windows, repr(packed))] +#[derive(Debug, Copy, Clone)] +pub struct CK_RSA_AES_KEY_WRAP_PARAMS { + pub ulAESKeyBits: CK_ULONG, + pub pOAEPParams: CK_RSA_PKCS_OAEP_PARAMS_PTR, +} +impl Default for CK_RSA_AES_KEY_WRAP_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_RSA_AES_KEY_WRAP_PARAMS_PTR = *mut CK_RSA_AES_KEY_WRAP_PARAMS; +#[repr(C)] +#[cfg_attr(windows, repr(packed))] +#[derive(Debug, Copy, Clone)] +pub struct CK_TLS12_MASTER_KEY_DERIVE_PARAMS { + pub RandomInfo: CK_SSL3_RANDOM_DATA, + pub pVersion: CK_VERSION_PTR, + pub prfHashMechanism: CK_MECHANISM_TYPE, +} +impl Default for CK_TLS12_MASTER_KEY_DERIVE_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_TLS12_MASTER_KEY_DERIVE_PARAMS_PTR = *mut CK_TLS12_MASTER_KEY_DERIVE_PARAMS; +#[repr(C)] +#[cfg_attr(windows, repr(packed))] +#[derive(Debug, Copy, Clone)] +pub struct CK_TLS12_KEY_MAT_PARAMS { + pub ulMacSizeInBits: CK_ULONG, + pub ulKeySizeInBits: CK_ULONG, + pub ulIVSizeInBits: CK_ULONG, + pub bIsExport: CK_BBOOL, + pub RandomInfo: CK_SSL3_RANDOM_DATA, + pub pReturnedKeyMaterial: CK_SSL3_KEY_MAT_OUT_PTR, + pub prfHashMechanism: CK_MECHANISM_TYPE, +} +impl Default for CK_TLS12_KEY_MAT_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_TLS12_KEY_MAT_PARAMS_PTR = *mut CK_TLS12_KEY_MAT_PARAMS; +#[repr(C)] +#[cfg_attr(windows, repr(packed))] +#[derive(Debug, Copy, Clone)] +pub struct CK_TLS_KDF_PARAMS { + pub prfMechanism: CK_MECHANISM_TYPE, + pub pLabel: CK_BYTE_PTR, + pub ulLabelLength: CK_ULONG, + pub RandomInfo: CK_SSL3_RANDOM_DATA, + pub pContextData: CK_BYTE_PTR, + pub ulContextDataLength: CK_ULONG, +} +impl Default for CK_TLS_KDF_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_TLS_KDF_PARAMS_PTR = *mut CK_TLS_KDF_PARAMS; +#[repr(C)] +#[cfg_attr(windows, repr(packed))] +#[derive(Debug, Default, Copy, Clone)] +pub struct CK_TLS_MAC_PARAMS { + pub prfHashMechanism: CK_MECHANISM_TYPE, + pub ulMacLength: CK_ULONG, + pub ulServerOrClient: CK_ULONG, +} +pub type CK_TLS_MAC_PARAMS_PTR = *mut CK_TLS_MAC_PARAMS; +#[repr(C)] +#[cfg_attr(windows, repr(packed))] +#[derive(Debug, Copy, Clone)] +pub struct CK_GOSTR3410_DERIVE_PARAMS { + pub kdf: CK_EC_KDF_TYPE, + pub pPublicData: CK_BYTE_PTR, + pub ulPublicDataLen: CK_ULONG, + pub pUKM: CK_BYTE_PTR, + pub ulUKMLen: CK_ULONG, +} +impl Default for CK_GOSTR3410_DERIVE_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_GOSTR3410_DERIVE_PARAMS_PTR = *mut CK_GOSTR3410_DERIVE_PARAMS; +#[repr(C)] +#[cfg_attr(windows, repr(packed))] +#[derive(Debug, Copy, Clone)] +pub struct CK_GOSTR3410_KEY_WRAP_PARAMS { + pub pWrapOID: CK_BYTE_PTR, + pub ulWrapOIDLen: CK_ULONG, + pub pUKM: CK_BYTE_PTR, + pub ulUKMLen: CK_ULONG, + pub hKey: CK_OBJECT_HANDLE, +} +impl Default for CK_GOSTR3410_KEY_WRAP_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_GOSTR3410_KEY_WRAP_PARAMS_PTR = *mut CK_GOSTR3410_KEY_WRAP_PARAMS; +#[repr(C)] +#[cfg_attr(windows, repr(packed))] +#[derive(Debug, Copy, Clone)] +pub struct CK_SEED_CBC_ENCRYPT_DATA_PARAMS { + pub iv: [CK_BYTE; 16usize], + pub pData: CK_BYTE_PTR, + pub length: CK_ULONG, +} +impl Default for CK_SEED_CBC_ENCRYPT_DATA_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_SEED_CBC_ENCRYPT_DATA_PARAMS_PTR = *mut CK_SEED_CBC_ENCRYPT_DATA_PARAMS; +pub type CK_PROFILE_ID = CK_ULONG; +pub type CK_PRF_DATA_TYPE = CK_ULONG; +pub type CK_SP800_108_PRF_TYPE = CK_MECHANISM_TYPE; +#[repr(C)] +#[cfg_attr(windows, repr(packed))] +#[derive(Debug, Copy, Clone)] +pub struct CK_PRF_DATA_PARAM { + pub type_: CK_PRF_DATA_TYPE, + pub pValue: CK_VOID_PTR, + pub ulValueLen: CK_ULONG, +} +impl Default for CK_PRF_DATA_PARAM { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_PRF_DATA_PARAM_PTR = *mut CK_PRF_DATA_PARAM; +#[repr(C)] +#[cfg_attr(windows, repr(packed))] +#[derive(Debug, Default, Copy, Clone)] +pub struct CK_SP800_108_COUNTER_FORMAT { + pub bLittleEndian: CK_BBOOL, + pub ulWidthInBits: CK_ULONG, +} +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)] +#[cfg_attr(windows, repr(packed))] +#[derive(Debug, Default, Copy, Clone)] +pub struct CK_SP800_108_DKM_LENGTH_FORMAT { + pub dkmLengthMethod: CK_SP800_108_DKM_LENGTH_METHOD, + pub bLittleEndian: CK_BBOOL, + pub ulWidthInBits: CK_ULONG, +} +pub type CK_SP800_108_DKM_LENGTH_FORMAT_PTR = *mut CK_SP800_108_DKM_LENGTH_FORMAT; +#[repr(C)] +#[cfg_attr(windows, repr(packed))] +#[derive(Debug, Copy, Clone)] +pub struct CK_DERIVED_KEY { + pub pTemplate: CK_ATTRIBUTE_PTR, + pub ulAttributeCount: CK_ULONG, + pub phKey: CK_OBJECT_HANDLE_PTR, +} +impl Default for CK_DERIVED_KEY { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_DERIVED_KEY_PTR = *mut CK_DERIVED_KEY; +#[repr(C)] +#[cfg_attr(windows, repr(packed))] +#[derive(Debug, Copy, Clone)] +pub struct CK_SP800_108_KDF_PARAMS { + pub prfType: CK_SP800_108_PRF_TYPE, + pub ulNumberOfDataParams: CK_ULONG, + pub pDataParams: CK_PRF_DATA_PARAM_PTR, + pub ulAdditionalDerivedKeys: CK_ULONG, + pub pAdditionalDerivedKeys: CK_DERIVED_KEY, +} +impl Default for CK_SP800_108_KDF_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_SP800_108_KDF_PARAMS_PTR = *mut CK_SP800_108_KDF_PARAMS; +#[repr(C)] +#[cfg_attr(windows, repr(packed))] +#[derive(Debug, Copy, Clone)] +pub struct CK_SP800_108_FEEDBACK_KDF_PARAMS { + pub prfType: CK_SP800_108_PRF_TYPE, + pub ulNumberOfDataParams: CK_ULONG, + pub pDataParams: CK_PRF_DATA_PARAM_PTR, + pub ulIVLen: CK_ULONG, + pub pIV: CK_BYTE_PTR, + pub ulAdditionalDerivedKeys: CK_ULONG, + pub pAdditionalDerivedKeys: CK_DERIVED_KEY, +} +impl Default for CK_SP800_108_FEEDBACK_KDF_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_SP800_108_FEEDBACK_KDF_PARAMS_PTR = *mut CK_SP800_108_FEEDBACK_KDF_PARAMS; +#[repr(C)] +#[cfg_attr(windows, repr(packed))] +#[derive(Debug, Copy, Clone)] +pub struct CK_EDDSA_PARAMS { + pub phFlag: CK_BBOOL, + pub ulContextDataLen: CK_ULONG, + pub pContextData: CK_BYTE_PTR, +} +impl Default for CK_EDDSA_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_EDDSA_PARAMS_PTR = *mut CK_EDDSA_PARAMS; +#[repr(C)] +#[cfg_attr(windows, repr(packed))] +#[derive(Debug, Copy, Clone)] +pub struct CK_CHACHA20_PARAMS { + pub pBlockCounter: CK_BYTE_PTR, + pub blockCounterBits: CK_ULONG, + pub pNonce: CK_BYTE_PTR, + pub ulNonceBits: CK_ULONG, +} +impl Default for CK_CHACHA20_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +#[repr(C)] +#[cfg_attr(windows, repr(packed))] +#[derive(Debug, Copy, Clone)] +pub struct CK_SALSA20_PARAMS { + pub pBlockCounter: CK_BYTE_PTR, + pub pNonce: CK_BYTE_PTR, + pub ulNonceBits: CK_ULONG, +} +impl Default for CK_SALSA20_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +#[repr(C)] +#[cfg_attr(windows, repr(packed))] +#[derive(Debug, Copy, Clone)] +pub struct CK_SALSA20_CHACHA20_POLY1305_PARAMS { + pub pNonce: CK_BYTE_PTR, + pub ulNonceLen: CK_ULONG, + pub pAAD: CK_BYTE_PTR, + pub ulAADLen: CK_ULONG, +} +impl Default for CK_SALSA20_CHACHA20_POLY1305_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_SALSA20_CHACHA20_POLY1305_PARAMS_PTR = *mut CK_SALSA20_CHACHA20_POLY1305_PARAMS; +#[repr(C)] +#[cfg_attr(windows, repr(packed))] +#[derive(Debug, Copy, Clone)] +pub struct CK_SALSA20_CHACHA20_POLY1305_MSG_PARAMS { + pub pNonce: CK_BYTE_PTR, + pub ulNonceLen: CK_ULONG, + pub pTag: CK_BYTE_PTR, +} +impl Default for CK_SALSA20_CHACHA20_POLY1305_MSG_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_SALSA20_CHACHA20_POLY1305_MSG_PARAMS_PTR = *mut CK_SALSA20_CHACHA20_POLY1305_MSG_PARAMS; +pub type CK_X3DH_KDF_TYPE = CK_ULONG; +pub type CK_X3DH_KDF_TYPE_PTR = *mut CK_X3DH_KDF_TYPE; +#[repr(C)] +#[cfg_attr(windows, repr(packed))] +#[derive(Debug, Copy, Clone)] +pub struct CK_X3DH_INITIATE_PARAMS { + pub kdf: CK_X3DH_KDF_TYPE, + pub pPeer_identity: CK_OBJECT_HANDLE, + pub pPeer_prekey: CK_OBJECT_HANDLE, + pub pPrekey_signature: CK_BYTE_PTR, + pub pOnetime_key: CK_BYTE_PTR, + pub pOwn_identity: CK_OBJECT_HANDLE, + pub pOwn_ephemeral: CK_OBJECT_HANDLE, +} +impl Default for CK_X3DH_INITIATE_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +#[repr(C)] +#[cfg_attr(windows, repr(packed))] +#[derive(Debug, Copy, Clone)] +pub struct CK_X3DH_RESPOND_PARAMS { + pub kdf: CK_X3DH_KDF_TYPE, + pub pIdentity_id: CK_BYTE_PTR, + pub pPrekey_id: CK_BYTE_PTR, + pub pOnetime_id: CK_BYTE_PTR, + pub pInitiator_identity: CK_OBJECT_HANDLE, + pub pInitiator_ephemeral: CK_BYTE_PTR, +} +impl Default for CK_X3DH_RESPOND_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_X2RATCHET_KDF_TYPE = CK_ULONG; +pub type CK_X2RATCHET_KDF_TYPE_PTR = *mut CK_X2RATCHET_KDF_TYPE; +#[repr(C)] +#[cfg_attr(windows, repr(packed))] +#[derive(Debug, Copy, Clone)] +pub struct CK_X2RATCHET_INITIALIZE_PARAMS { + pub sk: CK_BYTE_PTR, + pub peer_public_prekey: CK_OBJECT_HANDLE, + pub peer_public_identity: CK_OBJECT_HANDLE, + pub own_public_identity: CK_OBJECT_HANDLE, + pub bEncryptedHeader: CK_BBOOL, + pub eCurve: CK_ULONG, + pub aeadMechanism: CK_MECHANISM_TYPE, + pub kdfMechanism: CK_X2RATCHET_KDF_TYPE, +} +impl Default for CK_X2RATCHET_INITIALIZE_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_X2RATCHET_INITIALIZE_PARAMS_PTR = *mut CK_X2RATCHET_INITIALIZE_PARAMS; +#[repr(C)] +#[cfg_attr(windows, repr(packed))] +#[derive(Debug, Copy, Clone)] +pub struct CK_X2RATCHET_RESPOND_PARAMS { + pub sk: CK_BYTE_PTR, + pub own_prekey: CK_OBJECT_HANDLE, + pub initiator_identity: CK_OBJECT_HANDLE, + pub own_public_identity: CK_OBJECT_HANDLE, + pub bEncryptedHeader: CK_BBOOL, + pub eCurve: CK_ULONG, + pub aeadMechanism: CK_MECHANISM_TYPE, + pub kdfMechanism: CK_X2RATCHET_KDF_TYPE, +} +impl Default for CK_X2RATCHET_RESPOND_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_X2RATCHET_RESPOND_PARAMS_PTR = *mut CK_X2RATCHET_RESPOND_PARAMS; +pub type CK_XEDDSA_HASH_TYPE = CK_ULONG; +pub type CK_XEDDSA_HASH_TYPE_PTR = *mut CK_XEDDSA_HASH_TYPE; +#[repr(C)] +#[cfg_attr(windows, repr(packed))] +#[derive(Debug, Default, Copy, Clone)] +pub struct CK_XEDDSA_PARAMS { + pub hash: CK_XEDDSA_HASH_TYPE, +} +pub type CK_XEDDSA_PARAMS_PTR = *mut CK_XEDDSA_PARAMS; +#[repr(C)] +#[cfg_attr(windows, repr(packed))] +#[derive(Debug, Copy, Clone)] +pub struct CK_HKDF_PARAMS { + pub bExtract: CK_BBOOL, + pub bExpand: CK_BBOOL, + pub prfHashMechanism: CK_MECHANISM_TYPE, + pub ulSaltType: CK_ULONG, + pub pSalt: CK_BYTE_PTR, + pub ulSaltLen: CK_ULONG, + pub hSaltKey: CK_ULONG, + pub pInfo: CK_BYTE_PTR, + pub ulInfoLen: CK_ULONG, +} +impl Default for CK_HKDF_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_C_Initialize = + ::std::option::Option CK_RV>; +pub type CK_C_Finalize = + ::std::option::Option CK_RV>; +pub type CK_C_GetInfo = ::std::option::Option CK_RV>; +pub type CK_C_GetFunctionList = + ::std::option::Option CK_RV>; +pub type CK_C_GetSlotList = ::std::option::Option< + unsafe extern "C" fn( + tokenPresent: CK_BBOOL, + pSlotList: CK_SLOT_ID_PTR, + pulCount: CK_ULONG_PTR, + ) -> CK_RV, +>; +pub type CK_C_GetSlotInfo = ::std::option::Option< + unsafe extern "C" fn(slotID: CK_SLOT_ID, pInfo: CK_SLOT_INFO_PTR) -> CK_RV, +>; +pub type CK_C_GetTokenInfo = ::std::option::Option< + unsafe extern "C" fn(slotID: CK_SLOT_ID, pInfo: CK_TOKEN_INFO_PTR) -> CK_RV, +>; +pub type CK_C_GetMechanismList = ::std::option::Option< + unsafe extern "C" fn( + slotID: CK_SLOT_ID, + pMechanismList: CK_MECHANISM_TYPE_PTR, + pulCount: CK_ULONG_PTR, + ) -> CK_RV, +>; +pub type CK_C_GetMechanismInfo = ::std::option::Option< + unsafe extern "C" fn( + slotID: CK_SLOT_ID, + type_: CK_MECHANISM_TYPE, + pInfo: CK_MECHANISM_INFO_PTR, + ) -> CK_RV, +>; +pub type CK_C_InitToken = ::std::option::Option< + unsafe extern "C" fn( + slotID: CK_SLOT_ID, + pPin: CK_UTF8CHAR_PTR, + ulPinLen: CK_ULONG, + pLabel: CK_UTF8CHAR_PTR, + ) -> CK_RV, +>; +pub type CK_C_InitPIN = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pPin: CK_UTF8CHAR_PTR, + ulPinLen: CK_ULONG, + ) -> CK_RV, +>; +pub type CK_C_SetPIN = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pOldPin: CK_UTF8CHAR_PTR, + ulOldLen: CK_ULONG, + pNewPin: CK_UTF8CHAR_PTR, + ulNewLen: CK_ULONG, + ) -> CK_RV, +>; +pub type CK_C_OpenSession = ::std::option::Option< + unsafe extern "C" fn( + slotID: CK_SLOT_ID, + flags: CK_FLAGS, + pApplication: CK_VOID_PTR, + Notify: CK_NOTIFY, + phSession: CK_SESSION_HANDLE_PTR, + ) -> CK_RV, +>; +pub type CK_C_CloseSession = + ::std::option::Option CK_RV>; +pub type CK_C_CloseAllSessions = + ::std::option::Option CK_RV>; +pub type CK_C_GetSessionInfo = ::std::option::Option< + unsafe extern "C" fn(hSession: CK_SESSION_HANDLE, pInfo: CK_SESSION_INFO_PTR) -> CK_RV, +>; +pub type CK_C_GetOperationState = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pOperationState: CK_BYTE_PTR, + pulOperationStateLen: CK_ULONG_PTR, + ) -> CK_RV, +>; +pub type CK_C_SetOperationState = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pOperationState: CK_BYTE_PTR, + ulOperationStateLen: CK_ULONG, + hEncryptionKey: CK_OBJECT_HANDLE, + hAuthenticationKey: CK_OBJECT_HANDLE, + ) -> CK_RV, +>; +pub type CK_C_Login = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + userType: CK_USER_TYPE, + pPin: CK_UTF8CHAR_PTR, + ulPinLen: CK_ULONG, + ) -> CK_RV, +>; +pub type CK_C_Logout = + ::std::option::Option CK_RV>; +pub type CK_C_CreateObject = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pTemplate: CK_ATTRIBUTE_PTR, + ulCount: CK_ULONG, + phObject: CK_OBJECT_HANDLE_PTR, + ) -> CK_RV, +>; +pub type CK_C_CopyObject = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + hObject: CK_OBJECT_HANDLE, + pTemplate: CK_ATTRIBUTE_PTR, + ulCount: CK_ULONG, + phNewObject: CK_OBJECT_HANDLE_PTR, + ) -> CK_RV, +>; +pub type CK_C_DestroyObject = ::std::option::Option< + unsafe extern "C" fn(hSession: CK_SESSION_HANDLE, hObject: CK_OBJECT_HANDLE) -> CK_RV, +>; +pub type CK_C_GetObjectSize = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + hObject: CK_OBJECT_HANDLE, + pulSize: CK_ULONG_PTR, + ) -> CK_RV, +>; +pub type CK_C_GetAttributeValue = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + hObject: CK_OBJECT_HANDLE, + pTemplate: CK_ATTRIBUTE_PTR, + ulCount: CK_ULONG, + ) -> CK_RV, +>; +pub type CK_C_SetAttributeValue = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + hObject: CK_OBJECT_HANDLE, + pTemplate: CK_ATTRIBUTE_PTR, + ulCount: CK_ULONG, + ) -> CK_RV, +>; +pub type CK_C_FindObjectsInit = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pTemplate: CK_ATTRIBUTE_PTR, + ulCount: CK_ULONG, + ) -> CK_RV, +>; +pub type CK_C_FindObjects = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + phObject: CK_OBJECT_HANDLE_PTR, + ulMaxObjectCount: CK_ULONG, + pulObjectCount: CK_ULONG_PTR, + ) -> CK_RV, +>; +pub type CK_C_FindObjectsFinal = + ::std::option::Option CK_RV>; +pub type CK_C_EncryptInit = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, + ) -> CK_RV, +>; +pub type CK_C_Encrypt = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pEncryptedData: CK_BYTE_PTR, + pulEncryptedDataLen: CK_ULONG_PTR, + ) -> CK_RV, +>; +pub type CK_C_EncryptUpdate = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pPart: CK_BYTE_PTR, + ulPartLen: CK_ULONG, + pEncryptedPart: CK_BYTE_PTR, + pulEncryptedPartLen: CK_ULONG_PTR, + ) -> CK_RV, +>; +pub type CK_C_EncryptFinal = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pLastEncryptedPart: CK_BYTE_PTR, + pulLastEncryptedPartLen: CK_ULONG_PTR, + ) -> CK_RV, +>; +pub type CK_C_DecryptInit = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, + ) -> CK_RV, +>; +pub type CK_C_Decrypt = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pEncryptedData: CK_BYTE_PTR, + ulEncryptedDataLen: CK_ULONG, + pData: CK_BYTE_PTR, + pulDataLen: CK_ULONG_PTR, + ) -> CK_RV, +>; +pub type CK_C_DecryptUpdate = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pEncryptedPart: CK_BYTE_PTR, + ulEncryptedPartLen: CK_ULONG, + pPart: CK_BYTE_PTR, + pulPartLen: CK_ULONG_PTR, + ) -> CK_RV, +>; +pub type CK_C_DecryptFinal = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pLastPart: CK_BYTE_PTR, + pulLastPartLen: CK_ULONG_PTR, + ) -> CK_RV, +>; +pub type CK_C_DigestInit = ::std::option::Option< + unsafe extern "C" fn(hSession: CK_SESSION_HANDLE, pMechanism: CK_MECHANISM_PTR) -> CK_RV, +>; +pub type CK_C_Digest = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pDigest: CK_BYTE_PTR, + pulDigestLen: CK_ULONG_PTR, + ) -> CK_RV, +>; +pub type CK_C_DigestUpdate = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pPart: CK_BYTE_PTR, + ulPartLen: CK_ULONG, + ) -> CK_RV, +>; +pub type CK_C_DigestKey = ::std::option::Option< + unsafe extern "C" fn(hSession: CK_SESSION_HANDLE, hKey: CK_OBJECT_HANDLE) -> CK_RV, +>; +pub type CK_C_DigestFinal = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pDigest: CK_BYTE_PTR, + pulDigestLen: CK_ULONG_PTR, + ) -> CK_RV, +>; +pub type CK_C_SignInit = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, + ) -> CK_RV, +>; +pub type CK_C_Sign = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + pulSignatureLen: CK_ULONG_PTR, + ) -> CK_RV, +>; +pub type CK_C_SignUpdate = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pPart: CK_BYTE_PTR, + ulPartLen: CK_ULONG, + ) -> CK_RV, +>; +pub type CK_C_SignFinal = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pSignature: CK_BYTE_PTR, + pulSignatureLen: CK_ULONG_PTR, + ) -> CK_RV, +>; +pub type CK_C_SignRecoverInit = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, + ) -> CK_RV, +>; +pub type CK_C_SignRecover = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + pulSignatureLen: CK_ULONG_PTR, + ) -> CK_RV, +>; +pub type CK_C_VerifyInit = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, + ) -> CK_RV, +>; +pub type CK_C_Verify = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + ulSignatureLen: CK_ULONG, + ) -> CK_RV, +>; +pub type CK_C_VerifyUpdate = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pPart: CK_BYTE_PTR, + ulPartLen: CK_ULONG, + ) -> CK_RV, +>; +pub type CK_C_VerifyFinal = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pSignature: CK_BYTE_PTR, + ulSignatureLen: CK_ULONG, + ) -> CK_RV, +>; +pub type CK_C_VerifyRecoverInit = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, + ) -> CK_RV, +>; +pub type CK_C_VerifyRecover = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pSignature: CK_BYTE_PTR, + ulSignatureLen: CK_ULONG, + pData: CK_BYTE_PTR, + pulDataLen: CK_ULONG_PTR, + ) -> CK_RV, +>; +pub type CK_C_DigestEncryptUpdate = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pPart: CK_BYTE_PTR, + ulPartLen: CK_ULONG, + pEncryptedPart: CK_BYTE_PTR, + pulEncryptedPartLen: CK_ULONG_PTR, + ) -> CK_RV, +>; +pub type CK_C_DecryptDigestUpdate = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pEncryptedPart: CK_BYTE_PTR, + ulEncryptedPartLen: CK_ULONG, + pPart: CK_BYTE_PTR, + pulPartLen: CK_ULONG_PTR, + ) -> CK_RV, +>; +pub type CK_C_SignEncryptUpdate = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pPart: CK_BYTE_PTR, + ulPartLen: CK_ULONG, + pEncryptedPart: CK_BYTE_PTR, + pulEncryptedPartLen: CK_ULONG_PTR, + ) -> CK_RV, +>; +pub type CK_C_DecryptVerifyUpdate = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pEncryptedPart: CK_BYTE_PTR, + ulEncryptedPartLen: CK_ULONG, + pPart: CK_BYTE_PTR, + pulPartLen: CK_ULONG_PTR, + ) -> CK_RV, +>; +pub type CK_C_GenerateKey = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + pTemplate: CK_ATTRIBUTE_PTR, + ulCount: CK_ULONG, + phKey: CK_OBJECT_HANDLE_PTR, + ) -> CK_RV, +>; +pub type CK_C_GenerateKeyPair = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + pPublicKeyTemplate: CK_ATTRIBUTE_PTR, + ulPublicKeyAttributeCount: CK_ULONG, + pPrivateKeyTemplate: CK_ATTRIBUTE_PTR, + ulPrivateKeyAttributeCount: CK_ULONG, + phPublicKey: CK_OBJECT_HANDLE_PTR, + phPrivateKey: CK_OBJECT_HANDLE_PTR, + ) -> CK_RV, +>; +pub type CK_C_WrapKey = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hWrappingKey: CK_OBJECT_HANDLE, + hKey: CK_OBJECT_HANDLE, + pWrappedKey: CK_BYTE_PTR, + pulWrappedKeyLen: CK_ULONG_PTR, + ) -> CK_RV, +>; +pub type CK_C_UnwrapKey = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hUnwrappingKey: CK_OBJECT_HANDLE, + pWrappedKey: CK_BYTE_PTR, + ulWrappedKeyLen: CK_ULONG, + pTemplate: CK_ATTRIBUTE_PTR, + ulAttributeCount: CK_ULONG, + phKey: CK_OBJECT_HANDLE_PTR, + ) -> CK_RV, +>; +pub type CK_C_DeriveKey = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hBaseKey: CK_OBJECT_HANDLE, + pTemplate: CK_ATTRIBUTE_PTR, + ulAttributeCount: CK_ULONG, + phKey: CK_OBJECT_HANDLE_PTR, + ) -> CK_RV, +>; +pub type CK_C_SeedRandom = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pSeed: CK_BYTE_PTR, + ulSeedLen: CK_ULONG, + ) -> CK_RV, +>; +pub type CK_C_GenerateRandom = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + RandomData: CK_BYTE_PTR, + ulRandomLen: CK_ULONG, + ) -> CK_RV, +>; +pub type CK_C_GetFunctionStatus = + ::std::option::Option CK_RV>; +pub type CK_C_CancelFunction = + ::std::option::Option CK_RV>; +pub type CK_C_WaitForSlotEvent = ::std::option::Option< + unsafe extern "C" fn(flags: CK_FLAGS, pSlot: CK_SLOT_ID_PTR, pRserved: CK_VOID_PTR) -> CK_RV, +>; +pub type CK_C_GetInterfaceList = ::std::option::Option< + unsafe extern "C" fn(pInterfacesList: CK_INTERFACE_PTR, pulCount: CK_ULONG_PTR) -> CK_RV, +>; +pub type CK_C_GetInterface = ::std::option::Option< + unsafe extern "C" fn( + pInterfaceName: CK_UTF8CHAR_PTR, + pVersion: CK_VERSION_PTR, + ppInterface: CK_INTERFACE_PTR_PTR, + flags: CK_FLAGS, + ) -> CK_RV, +>; +pub type CK_C_LoginUser = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + userType: CK_USER_TYPE, + pPin: CK_UTF8CHAR_PTR, + ulPinLen: CK_ULONG, + pUsername: CK_UTF8CHAR_PTR, + ulUsernameLen: CK_ULONG, + ) -> CK_RV, +>; +pub type CK_C_SessionCancel = ::std::option::Option< + unsafe extern "C" fn(hSession: CK_SESSION_HANDLE, flags: CK_FLAGS) -> CK_RV, +>; +pub type CK_C_MessageEncryptInit = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, + ) -> CK_RV, +>; +pub type CK_C_EncryptMessage = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pAssociatedData: CK_BYTE_PTR, + ulAssociatedDataLen: CK_ULONG, + pPlaintext: CK_BYTE_PTR, + ulPlaintextLen: CK_ULONG, + pCiphertext: CK_BYTE_PTR, + pulCiphertextLen: CK_ULONG_PTR, + ) -> CK_RV, +>; +pub type CK_C_EncryptMessageBegin = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pAssociatedData: CK_BYTE_PTR, + ulAssociatedDataLen: CK_ULONG, + ) -> CK_RV, +>; +pub type CK_C_EncryptMessageNext = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pPlaintextPart: CK_BYTE_PTR, + ulPlaintextPartLen: CK_ULONG, + pCiphertextPart: CK_BYTE_PTR, + pulCiphertextPartLen: CK_ULONG_PTR, + flags: CK_FLAGS, + ) -> CK_RV, +>; +pub type CK_C_MessageEncryptFinal = + ::std::option::Option CK_RV>; +pub type CK_C_MessageDecryptInit = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, + ) -> CK_RV, +>; +pub type CK_C_DecryptMessage = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pAssociatedData: CK_BYTE_PTR, + ulAssociatedDataLen: CK_ULONG, + pCiphertext: CK_BYTE_PTR, + ulCiphertextLen: CK_ULONG, + pPlaintext: CK_BYTE_PTR, + pulPlaintextLen: CK_ULONG_PTR, + ) -> CK_RV, +>; +pub type CK_C_DecryptMessageBegin = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pAssociatedData: CK_BYTE_PTR, + ulAssociatedDataLen: CK_ULONG, + ) -> CK_RV, +>; +pub type CK_C_DecryptMessageNext = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pCiphertext: CK_BYTE_PTR, + ulCiphertextLen: CK_ULONG, + pPlaintext: CK_BYTE_PTR, + pulPlaintextLen: CK_ULONG_PTR, + flags: CK_FLAGS, + ) -> CK_RV, +>; +pub type CK_C_MessageDecryptFinal = + ::std::option::Option CK_RV>; +pub type CK_C_MessageSignInit = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, + ) -> CK_RV, +>; +pub type CK_C_SignMessage = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + pulSignatureLen: CK_ULONG_PTR, + ) -> CK_RV, +>; +pub type CK_C_SignMessageBegin = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + ) -> CK_RV, +>; +pub type CK_C_SignMessageNext = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + pulSignatureLen: CK_ULONG_PTR, + ) -> CK_RV, +>; +pub type CK_C_MessageSignFinal = + ::std::option::Option CK_RV>; +pub type CK_C_MessageVerifyInit = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, + ) -> CK_RV, +>; +pub type CK_C_VerifyMessage = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + ulSignatureLen: CK_ULONG, + ) -> CK_RV, +>; +pub type CK_C_VerifyMessageBegin = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + ) -> CK_RV, +>; +pub type CK_C_VerifyMessageNext = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + ulSignatureLen: CK_ULONG, + ) -> CK_RV, +>; +pub type CK_C_MessageVerifyFinal = + ::std::option::Option CK_RV>; +#[repr(C)] +#[cfg_attr(windows, repr(packed))] +#[derive(Debug, Default, Copy, Clone)] +pub struct CK_FUNCTION_LIST_3_0 { + pub version: CK_VERSION, + pub C_Initialize: CK_C_Initialize, + pub C_Finalize: CK_C_Finalize, + pub C_GetInfo: CK_C_GetInfo, + pub C_GetFunctionList: CK_C_GetFunctionList, + pub C_GetSlotList: CK_C_GetSlotList, + pub C_GetSlotInfo: CK_C_GetSlotInfo, + pub C_GetTokenInfo: CK_C_GetTokenInfo, + pub C_GetMechanismList: CK_C_GetMechanismList, + pub C_GetMechanismInfo: CK_C_GetMechanismInfo, + pub C_InitToken: CK_C_InitToken, + pub C_InitPIN: CK_C_InitPIN, + pub C_SetPIN: CK_C_SetPIN, + pub C_OpenSession: CK_C_OpenSession, + pub C_CloseSession: CK_C_CloseSession, + pub C_CloseAllSessions: CK_C_CloseAllSessions, + pub C_GetSessionInfo: CK_C_GetSessionInfo, + pub C_GetOperationState: CK_C_GetOperationState, + pub C_SetOperationState: CK_C_SetOperationState, + pub C_Login: CK_C_Login, + pub C_Logout: CK_C_Logout, + pub C_CreateObject: CK_C_CreateObject, + pub C_CopyObject: CK_C_CopyObject, + pub C_DestroyObject: CK_C_DestroyObject, + pub C_GetObjectSize: CK_C_GetObjectSize, + pub C_GetAttributeValue: CK_C_GetAttributeValue, + pub C_SetAttributeValue: CK_C_SetAttributeValue, + pub C_FindObjectsInit: CK_C_FindObjectsInit, + pub C_FindObjects: CK_C_FindObjects, + pub C_FindObjectsFinal: CK_C_FindObjectsFinal, + pub C_EncryptInit: CK_C_EncryptInit, + pub C_Encrypt: CK_C_Encrypt, + pub C_EncryptUpdate: CK_C_EncryptUpdate, + pub C_EncryptFinal: CK_C_EncryptFinal, + pub C_DecryptInit: CK_C_DecryptInit, + pub C_Decrypt: CK_C_Decrypt, + pub C_DecryptUpdate: CK_C_DecryptUpdate, + pub C_DecryptFinal: CK_C_DecryptFinal, + pub C_DigestInit: CK_C_DigestInit, + pub C_Digest: CK_C_Digest, + pub C_DigestUpdate: CK_C_DigestUpdate, + pub C_DigestKey: CK_C_DigestKey, + pub C_DigestFinal: CK_C_DigestFinal, + pub C_SignInit: CK_C_SignInit, + pub C_Sign: CK_C_Sign, + pub C_SignUpdate: CK_C_SignUpdate, + pub C_SignFinal: CK_C_SignFinal, + pub C_SignRecoverInit: CK_C_SignRecoverInit, + pub C_SignRecover: CK_C_SignRecover, + pub C_VerifyInit: CK_C_VerifyInit, + pub C_Verify: CK_C_Verify, + pub C_VerifyUpdate: CK_C_VerifyUpdate, + pub C_VerifyFinal: CK_C_VerifyFinal, + pub C_VerifyRecoverInit: CK_C_VerifyRecoverInit, + pub C_VerifyRecover: CK_C_VerifyRecover, + pub C_DigestEncryptUpdate: CK_C_DigestEncryptUpdate, + pub C_DecryptDigestUpdate: CK_C_DecryptDigestUpdate, + pub C_SignEncryptUpdate: CK_C_SignEncryptUpdate, + pub C_DecryptVerifyUpdate: CK_C_DecryptVerifyUpdate, + pub C_GenerateKey: CK_C_GenerateKey, + pub C_GenerateKeyPair: CK_C_GenerateKeyPair, + pub C_WrapKey: CK_C_WrapKey, + pub C_UnwrapKey: CK_C_UnwrapKey, + pub C_DeriveKey: CK_C_DeriveKey, + pub C_SeedRandom: CK_C_SeedRandom, + pub C_GenerateRandom: CK_C_GenerateRandom, + pub C_GetFunctionStatus: CK_C_GetFunctionStatus, + pub C_CancelFunction: CK_C_CancelFunction, + pub C_WaitForSlotEvent: CK_C_WaitForSlotEvent, + pub C_GetInterfaceList: CK_C_GetInterfaceList, + pub C_GetInterface: CK_C_GetInterface, + pub C_LoginUser: CK_C_LoginUser, + pub C_SessionCancel: CK_C_SessionCancel, + pub C_MessageEncryptInit: CK_C_MessageEncryptInit, + pub C_EncryptMessage: CK_C_EncryptMessage, + pub C_EncryptMessageBegin: CK_C_EncryptMessageBegin, + pub C_EncryptMessageNext: CK_C_EncryptMessageNext, + pub C_MessageEncryptFinal: CK_C_MessageEncryptFinal, + pub C_MessageDecryptInit: CK_C_MessageDecryptInit, + pub C_DecryptMessage: CK_C_DecryptMessage, + pub C_DecryptMessageBegin: CK_C_DecryptMessageBegin, + pub C_DecryptMessageNext: CK_C_DecryptMessageNext, + pub C_MessageDecryptFinal: CK_C_MessageDecryptFinal, + pub C_MessageSignInit: CK_C_MessageSignInit, + pub C_SignMessage: CK_C_SignMessage, + pub C_SignMessageBegin: CK_C_SignMessageBegin, + pub C_SignMessageNext: CK_C_SignMessageNext, + pub C_MessageSignFinal: CK_C_MessageSignFinal, + pub C_MessageVerifyInit: CK_C_MessageVerifyInit, + pub C_VerifyMessage: CK_C_VerifyMessage, + pub C_VerifyMessageBegin: CK_C_VerifyMessageBegin, + pub C_VerifyMessageNext: CK_C_VerifyMessageNext, + pub C_MessageVerifyFinal: CK_C_MessageVerifyFinal, +} +#[repr(C)] +#[cfg_attr(windows, repr(packed))] +#[derive(Debug, Default, Copy, Clone)] +pub struct CK_FUNCTION_LIST { + pub version: CK_VERSION, + pub C_Initialize: CK_C_Initialize, + pub C_Finalize: CK_C_Finalize, + pub C_GetInfo: CK_C_GetInfo, + pub C_GetFunctionList: CK_C_GetFunctionList, + pub C_GetSlotList: CK_C_GetSlotList, + pub C_GetSlotInfo: CK_C_GetSlotInfo, + pub C_GetTokenInfo: CK_C_GetTokenInfo, + pub C_GetMechanismList: CK_C_GetMechanismList, + pub C_GetMechanismInfo: CK_C_GetMechanismInfo, + pub C_InitToken: CK_C_InitToken, + pub C_InitPIN: CK_C_InitPIN, + pub C_SetPIN: CK_C_SetPIN, + pub C_OpenSession: CK_C_OpenSession, + pub C_CloseSession: CK_C_CloseSession, + pub C_CloseAllSessions: CK_C_CloseAllSessions, + pub C_GetSessionInfo: CK_C_GetSessionInfo, + pub C_GetOperationState: CK_C_GetOperationState, + pub C_SetOperationState: CK_C_SetOperationState, + pub C_Login: CK_C_Login, + pub C_Logout: CK_C_Logout, + pub C_CreateObject: CK_C_CreateObject, + pub C_CopyObject: CK_C_CopyObject, + pub C_DestroyObject: CK_C_DestroyObject, + pub C_GetObjectSize: CK_C_GetObjectSize, + pub C_GetAttributeValue: CK_C_GetAttributeValue, + pub C_SetAttributeValue: CK_C_SetAttributeValue, + pub C_FindObjectsInit: CK_C_FindObjectsInit, + pub C_FindObjects: CK_C_FindObjects, + pub C_FindObjectsFinal: CK_C_FindObjectsFinal, + pub C_EncryptInit: CK_C_EncryptInit, + pub C_Encrypt: CK_C_Encrypt, + pub C_EncryptUpdate: CK_C_EncryptUpdate, + pub C_EncryptFinal: CK_C_EncryptFinal, + pub C_DecryptInit: CK_C_DecryptInit, + pub C_Decrypt: CK_C_Decrypt, + pub C_DecryptUpdate: CK_C_DecryptUpdate, + pub C_DecryptFinal: CK_C_DecryptFinal, + pub C_DigestInit: CK_C_DigestInit, + pub C_Digest: CK_C_Digest, + pub C_DigestUpdate: CK_C_DigestUpdate, + pub C_DigestKey: CK_C_DigestKey, + pub C_DigestFinal: CK_C_DigestFinal, + pub C_SignInit: CK_C_SignInit, + pub C_Sign: CK_C_Sign, + pub C_SignUpdate: CK_C_SignUpdate, + pub C_SignFinal: CK_C_SignFinal, + pub C_SignRecoverInit: CK_C_SignRecoverInit, + pub C_SignRecover: CK_C_SignRecover, + pub C_VerifyInit: CK_C_VerifyInit, + pub C_Verify: CK_C_Verify, + pub C_VerifyUpdate: CK_C_VerifyUpdate, + pub C_VerifyFinal: CK_C_VerifyFinal, + pub C_VerifyRecoverInit: CK_C_VerifyRecoverInit, + pub C_VerifyRecover: CK_C_VerifyRecover, + pub C_DigestEncryptUpdate: CK_C_DigestEncryptUpdate, + pub C_DecryptDigestUpdate: CK_C_DecryptDigestUpdate, + pub C_SignEncryptUpdate: CK_C_SignEncryptUpdate, + pub C_DecryptVerifyUpdate: CK_C_DecryptVerifyUpdate, + pub C_GenerateKey: CK_C_GenerateKey, + pub C_GenerateKeyPair: CK_C_GenerateKeyPair, + pub C_WrapKey: CK_C_WrapKey, + pub C_UnwrapKey: CK_C_UnwrapKey, + pub C_DeriveKey: CK_C_DeriveKey, + pub C_SeedRandom: CK_C_SeedRandom, + pub C_GenerateRandom: CK_C_GenerateRandom, + pub C_GetFunctionStatus: CK_C_GetFunctionStatus, + pub C_CancelFunction: CK_C_CancelFunction, + pub C_WaitForSlotEvent: CK_C_WaitForSlotEvent, +} +extern crate libloading; +pub struct Pkcs11 { + __library: ::libloading::Library, + pub C_Initialize: + Result CK_RV, ::libloading::Error>, + pub C_Finalize: + Result CK_RV, ::libloading::Error>, + pub C_GetInfo: Result CK_RV, ::libloading::Error>, + pub C_GetFunctionList: Result< + unsafe extern "C" fn(ppFunctionList: CK_FUNCTION_LIST_PTR_PTR) -> CK_RV, + ::libloading::Error, + >, + pub C_GetSlotList: Result< + unsafe extern "C" fn( + tokenPresent: CK_BBOOL, + pSlotList: CK_SLOT_ID_PTR, + pulCount: CK_ULONG_PTR, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_GetSlotInfo: Result< + unsafe extern "C" fn(slotID: CK_SLOT_ID, pInfo: CK_SLOT_INFO_PTR) -> CK_RV, + ::libloading::Error, + >, + pub C_GetTokenInfo: Result< + unsafe extern "C" fn(slotID: CK_SLOT_ID, pInfo: CK_TOKEN_INFO_PTR) -> CK_RV, + ::libloading::Error, + >, + pub C_GetMechanismList: Result< + unsafe extern "C" fn( + slotID: CK_SLOT_ID, + pMechanismList: CK_MECHANISM_TYPE_PTR, + pulCount: CK_ULONG_PTR, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_GetMechanismInfo: Result< + unsafe extern "C" fn( + slotID: CK_SLOT_ID, + type_: CK_MECHANISM_TYPE, + pInfo: CK_MECHANISM_INFO_PTR, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_InitToken: Result< + unsafe extern "C" fn( + slotID: CK_SLOT_ID, + pPin: CK_UTF8CHAR_PTR, + ulPinLen: CK_ULONG, + pLabel: CK_UTF8CHAR_PTR, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_InitPIN: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pPin: CK_UTF8CHAR_PTR, + ulPinLen: CK_ULONG, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_SetPIN: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pOldPin: CK_UTF8CHAR_PTR, + ulOldLen: CK_ULONG, + pNewPin: CK_UTF8CHAR_PTR, + ulNewLen: CK_ULONG, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_OpenSession: Result< + unsafe extern "C" fn( + slotID: CK_SLOT_ID, + flags: CK_FLAGS, + pApplication: CK_VOID_PTR, + Notify: CK_NOTIFY, + phSession: CK_SESSION_HANDLE_PTR, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_CloseSession: + Result CK_RV, ::libloading::Error>, + pub C_CloseAllSessions: + Result CK_RV, ::libloading::Error>, + pub C_GetSessionInfo: Result< + unsafe extern "C" fn(hSession: CK_SESSION_HANDLE, pInfo: CK_SESSION_INFO_PTR) -> CK_RV, + ::libloading::Error, + >, + pub C_GetOperationState: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pOperationState: CK_BYTE_PTR, + pulOperationStateLen: CK_ULONG_PTR, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_SetOperationState: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pOperationState: CK_BYTE_PTR, + ulOperationStateLen: CK_ULONG, + hEncryptionKey: CK_OBJECT_HANDLE, + hAuthenticationKey: CK_OBJECT_HANDLE, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_Login: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + userType: CK_USER_TYPE, + pPin: CK_UTF8CHAR_PTR, + ulPinLen: CK_ULONG, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_Logout: + Result CK_RV, ::libloading::Error>, + pub C_CreateObject: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pTemplate: CK_ATTRIBUTE_PTR, + ulCount: CK_ULONG, + phObject: CK_OBJECT_HANDLE_PTR, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_CopyObject: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + hObject: CK_OBJECT_HANDLE, + pTemplate: CK_ATTRIBUTE_PTR, + ulCount: CK_ULONG, + phNewObject: CK_OBJECT_HANDLE_PTR, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_DestroyObject: Result< + unsafe extern "C" fn(hSession: CK_SESSION_HANDLE, hObject: CK_OBJECT_HANDLE) -> CK_RV, + ::libloading::Error, + >, + pub C_GetObjectSize: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + hObject: CK_OBJECT_HANDLE, + pulSize: CK_ULONG_PTR, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_GetAttributeValue: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + hObject: CK_OBJECT_HANDLE, + pTemplate: CK_ATTRIBUTE_PTR, + ulCount: CK_ULONG, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_SetAttributeValue: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + hObject: CK_OBJECT_HANDLE, + pTemplate: CK_ATTRIBUTE_PTR, + ulCount: CK_ULONG, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_FindObjectsInit: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pTemplate: CK_ATTRIBUTE_PTR, + ulCount: CK_ULONG, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_FindObjects: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + phObject: CK_OBJECT_HANDLE_PTR, + ulMaxObjectCount: CK_ULONG, + pulObjectCount: CK_ULONG_PTR, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_FindObjectsFinal: + Result CK_RV, ::libloading::Error>, + pub C_EncryptInit: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_Encrypt: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pEncryptedData: CK_BYTE_PTR, + pulEncryptedDataLen: CK_ULONG_PTR, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_EncryptUpdate: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pPart: CK_BYTE_PTR, + ulPartLen: CK_ULONG, + pEncryptedPart: CK_BYTE_PTR, + pulEncryptedPartLen: CK_ULONG_PTR, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_EncryptFinal: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pLastEncryptedPart: CK_BYTE_PTR, + pulLastEncryptedPartLen: CK_ULONG_PTR, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_DecryptInit: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_Decrypt: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pEncryptedData: CK_BYTE_PTR, + ulEncryptedDataLen: CK_ULONG, + pData: CK_BYTE_PTR, + pulDataLen: CK_ULONG_PTR, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_DecryptUpdate: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pEncryptedPart: CK_BYTE_PTR, + ulEncryptedPartLen: CK_ULONG, + pPart: CK_BYTE_PTR, + pulPartLen: CK_ULONG_PTR, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_DecryptFinal: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pLastPart: CK_BYTE_PTR, + pulLastPartLen: CK_ULONG_PTR, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_DigestInit: Result< + unsafe extern "C" fn(hSession: CK_SESSION_HANDLE, pMechanism: CK_MECHANISM_PTR) -> CK_RV, + ::libloading::Error, + >, + pub C_Digest: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pDigest: CK_BYTE_PTR, + pulDigestLen: CK_ULONG_PTR, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_DigestUpdate: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pPart: CK_BYTE_PTR, + ulPartLen: CK_ULONG, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_DigestKey: Result< + unsafe extern "C" fn(hSession: CK_SESSION_HANDLE, hKey: CK_OBJECT_HANDLE) -> CK_RV, + ::libloading::Error, + >, + pub C_DigestFinal: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pDigest: CK_BYTE_PTR, + pulDigestLen: CK_ULONG_PTR, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_SignInit: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_Sign: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + pulSignatureLen: CK_ULONG_PTR, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_SignUpdate: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pPart: CK_BYTE_PTR, + ulPartLen: CK_ULONG, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_SignFinal: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pSignature: CK_BYTE_PTR, + pulSignatureLen: CK_ULONG_PTR, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_SignRecoverInit: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_SignRecover: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + pulSignatureLen: CK_ULONG_PTR, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_VerifyInit: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_Verify: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + ulSignatureLen: CK_ULONG, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_VerifyUpdate: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pPart: CK_BYTE_PTR, + ulPartLen: CK_ULONG, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_VerifyFinal: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pSignature: CK_BYTE_PTR, + ulSignatureLen: CK_ULONG, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_VerifyRecoverInit: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_VerifyRecover: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pSignature: CK_BYTE_PTR, + ulSignatureLen: CK_ULONG, + pData: CK_BYTE_PTR, + pulDataLen: CK_ULONG_PTR, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_DigestEncryptUpdate: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pPart: CK_BYTE_PTR, + ulPartLen: CK_ULONG, + pEncryptedPart: CK_BYTE_PTR, + pulEncryptedPartLen: CK_ULONG_PTR, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_DecryptDigestUpdate: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pEncryptedPart: CK_BYTE_PTR, + ulEncryptedPartLen: CK_ULONG, + pPart: CK_BYTE_PTR, + pulPartLen: CK_ULONG_PTR, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_SignEncryptUpdate: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pPart: CK_BYTE_PTR, + ulPartLen: CK_ULONG, + pEncryptedPart: CK_BYTE_PTR, + pulEncryptedPartLen: CK_ULONG_PTR, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_DecryptVerifyUpdate: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pEncryptedPart: CK_BYTE_PTR, + ulEncryptedPartLen: CK_ULONG, + pPart: CK_BYTE_PTR, + pulPartLen: CK_ULONG_PTR, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_GenerateKey: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + pTemplate: CK_ATTRIBUTE_PTR, + ulCount: CK_ULONG, + phKey: CK_OBJECT_HANDLE_PTR, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_GenerateKeyPair: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + pPublicKeyTemplate: CK_ATTRIBUTE_PTR, + ulPublicKeyAttributeCount: CK_ULONG, + pPrivateKeyTemplate: CK_ATTRIBUTE_PTR, + ulPrivateKeyAttributeCount: CK_ULONG, + phPublicKey: CK_OBJECT_HANDLE_PTR, + phPrivateKey: CK_OBJECT_HANDLE_PTR, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_WrapKey: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hWrappingKey: CK_OBJECT_HANDLE, + hKey: CK_OBJECT_HANDLE, + pWrappedKey: CK_BYTE_PTR, + pulWrappedKeyLen: CK_ULONG_PTR, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_UnwrapKey: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hUnwrappingKey: CK_OBJECT_HANDLE, + pWrappedKey: CK_BYTE_PTR, + ulWrappedKeyLen: CK_ULONG, + pTemplate: CK_ATTRIBUTE_PTR, + ulAttributeCount: CK_ULONG, + phKey: CK_OBJECT_HANDLE_PTR, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_DeriveKey: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hBaseKey: CK_OBJECT_HANDLE, + pTemplate: CK_ATTRIBUTE_PTR, + ulAttributeCount: CK_ULONG, + phKey: CK_OBJECT_HANDLE_PTR, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_SeedRandom: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pSeed: CK_BYTE_PTR, + ulSeedLen: CK_ULONG, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_GenerateRandom: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + RandomData: CK_BYTE_PTR, + ulRandomLen: CK_ULONG, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_GetFunctionStatus: + Result CK_RV, ::libloading::Error>, + pub C_CancelFunction: + Result CK_RV, ::libloading::Error>, + pub C_WaitForSlotEvent: Result< + unsafe extern "C" fn( + flags: CK_FLAGS, + pSlot: CK_SLOT_ID_PTR, + pRserved: CK_VOID_PTR, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_GetInterfaceList: Result< + unsafe extern "C" fn(pInterfacesList: CK_INTERFACE_PTR, pulCount: CK_ULONG_PTR) -> CK_RV, + ::libloading::Error, + >, + pub C_GetInterface: Result< + unsafe extern "C" fn( + pInterfaceName: CK_UTF8CHAR_PTR, + pVersion: CK_VERSION_PTR, + ppInterface: CK_INTERFACE_PTR_PTR, + flags: CK_FLAGS, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_LoginUser: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + userType: CK_USER_TYPE, + pPin: CK_UTF8CHAR_PTR, + ulPinLen: CK_ULONG, + pUsername: CK_UTF8CHAR_PTR, + ulUsernameLen: CK_ULONG, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_SessionCancel: Result< + unsafe extern "C" fn(hSession: CK_SESSION_HANDLE, flags: CK_FLAGS) -> CK_RV, + ::libloading::Error, + >, + pub C_MessageEncryptInit: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_EncryptMessage: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pAssociatedData: CK_BYTE_PTR, + ulAssociatedDataLen: CK_ULONG, + pPlaintext: CK_BYTE_PTR, + ulPlaintextLen: CK_ULONG, + pCiphertext: CK_BYTE_PTR, + pulCiphertextLen: CK_ULONG_PTR, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_EncryptMessageBegin: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pAssociatedData: CK_BYTE_PTR, + ulAssociatedDataLen: CK_ULONG, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_EncryptMessageNext: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pPlaintextPart: CK_BYTE_PTR, + ulPlaintextPartLen: CK_ULONG, + pCiphertextPart: CK_BYTE_PTR, + pulCiphertextPartLen: CK_ULONG_PTR, + flags: CK_FLAGS, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_MessageEncryptFinal: + Result CK_RV, ::libloading::Error>, + pub C_MessageDecryptInit: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_DecryptMessage: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pAssociatedData: CK_BYTE_PTR, + ulAssociatedDataLen: CK_ULONG, + pCiphertext: CK_BYTE_PTR, + ulCiphertextLen: CK_ULONG, + pPlaintext: CK_BYTE_PTR, + pulPlaintextLen: CK_ULONG_PTR, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_DecryptMessageBegin: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pAssociatedData: CK_BYTE_PTR, + ulAssociatedDataLen: CK_ULONG, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_DecryptMessageNext: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pCiphertext: CK_BYTE_PTR, + ulCiphertextLen: CK_ULONG, + pPlaintext: CK_BYTE_PTR, + pulPlaintextLen: CK_ULONG_PTR, + flags: CK_FLAGS, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_MessageDecryptFinal: + Result CK_RV, ::libloading::Error>, + pub C_MessageSignInit: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_SignMessage: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + pulSignatureLen: CK_ULONG_PTR, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_SignMessageBegin: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_SignMessageNext: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + pulSignatureLen: CK_ULONG_PTR, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_MessageSignFinal: + Result CK_RV, ::libloading::Error>, + pub C_MessageVerifyInit: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_VerifyMessage: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + ulSignatureLen: CK_ULONG, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_VerifyMessageBegin: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_VerifyMessageNext: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + ulSignatureLen: CK_ULONG, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_MessageVerifyFinal: + Result CK_RV, ::libloading::Error>, +} +impl Pkcs11 { + pub unsafe fn new

(path: P) -> Result + where + P: AsRef<::std::ffi::OsStr>, + { + let library = ::libloading::Library::new(path)?; + Self::from_library(library) + } + pub unsafe fn from_library(library: L) -> Result + where + L: Into<::libloading::Library>, + { + let __library = library.into(); + let C_Initialize = __library.get(b"C_Initialize\0").map(|sym| *sym); + let C_Finalize = __library.get(b"C_Finalize\0").map(|sym| *sym); + let C_GetInfo = __library.get(b"C_GetInfo\0").map(|sym| *sym); + let C_GetFunctionList = __library.get(b"C_GetFunctionList\0").map(|sym| *sym); + let C_GetSlotList = __library.get(b"C_GetSlotList\0").map(|sym| *sym); + let C_GetSlotInfo = __library.get(b"C_GetSlotInfo\0").map(|sym| *sym); + let C_GetTokenInfo = __library.get(b"C_GetTokenInfo\0").map(|sym| *sym); + let C_GetMechanismList = __library.get(b"C_GetMechanismList\0").map(|sym| *sym); + let C_GetMechanismInfo = __library.get(b"C_GetMechanismInfo\0").map(|sym| *sym); + let C_InitToken = __library.get(b"C_InitToken\0").map(|sym| *sym); + let C_InitPIN = __library.get(b"C_InitPIN\0").map(|sym| *sym); + let C_SetPIN = __library.get(b"C_SetPIN\0").map(|sym| *sym); + let C_OpenSession = __library.get(b"C_OpenSession\0").map(|sym| *sym); + let C_CloseSession = __library.get(b"C_CloseSession\0").map(|sym| *sym); + let C_CloseAllSessions = __library.get(b"C_CloseAllSessions\0").map(|sym| *sym); + let C_GetSessionInfo = __library.get(b"C_GetSessionInfo\0").map(|sym| *sym); + let C_GetOperationState = __library.get(b"C_GetOperationState\0").map(|sym| *sym); + let C_SetOperationState = __library.get(b"C_SetOperationState\0").map(|sym| *sym); + let C_Login = __library.get(b"C_Login\0").map(|sym| *sym); + let C_Logout = __library.get(b"C_Logout\0").map(|sym| *sym); + let C_CreateObject = __library.get(b"C_CreateObject\0").map(|sym| *sym); + let C_CopyObject = __library.get(b"C_CopyObject\0").map(|sym| *sym); + let C_DestroyObject = __library.get(b"C_DestroyObject\0").map(|sym| *sym); + let C_GetObjectSize = __library.get(b"C_GetObjectSize\0").map(|sym| *sym); + let C_GetAttributeValue = __library.get(b"C_GetAttributeValue\0").map(|sym| *sym); + let C_SetAttributeValue = __library.get(b"C_SetAttributeValue\0").map(|sym| *sym); + let C_FindObjectsInit = __library.get(b"C_FindObjectsInit\0").map(|sym| *sym); + let C_FindObjects = __library.get(b"C_FindObjects\0").map(|sym| *sym); + let C_FindObjectsFinal = __library.get(b"C_FindObjectsFinal\0").map(|sym| *sym); + let C_EncryptInit = __library.get(b"C_EncryptInit\0").map(|sym| *sym); + let C_Encrypt = __library.get(b"C_Encrypt\0").map(|sym| *sym); + let C_EncryptUpdate = __library.get(b"C_EncryptUpdate\0").map(|sym| *sym); + let C_EncryptFinal = __library.get(b"C_EncryptFinal\0").map(|sym| *sym); + let C_DecryptInit = __library.get(b"C_DecryptInit\0").map(|sym| *sym); + let C_Decrypt = __library.get(b"C_Decrypt\0").map(|sym| *sym); + let C_DecryptUpdate = __library.get(b"C_DecryptUpdate\0").map(|sym| *sym); + let C_DecryptFinal = __library.get(b"C_DecryptFinal\0").map(|sym| *sym); + let C_DigestInit = __library.get(b"C_DigestInit\0").map(|sym| *sym); + let C_Digest = __library.get(b"C_Digest\0").map(|sym| *sym); + let C_DigestUpdate = __library.get(b"C_DigestUpdate\0").map(|sym| *sym); + let C_DigestKey = __library.get(b"C_DigestKey\0").map(|sym| *sym); + let C_DigestFinal = __library.get(b"C_DigestFinal\0").map(|sym| *sym); + let C_SignInit = __library.get(b"C_SignInit\0").map(|sym| *sym); + let C_Sign = __library.get(b"C_Sign\0").map(|sym| *sym); + let C_SignUpdate = __library.get(b"C_SignUpdate\0").map(|sym| *sym); + let C_SignFinal = __library.get(b"C_SignFinal\0").map(|sym| *sym); + let C_SignRecoverInit = __library.get(b"C_SignRecoverInit\0").map(|sym| *sym); + let C_SignRecover = __library.get(b"C_SignRecover\0").map(|sym| *sym); + let C_VerifyInit = __library.get(b"C_VerifyInit\0").map(|sym| *sym); + let C_Verify = __library.get(b"C_Verify\0").map(|sym| *sym); + let C_VerifyUpdate = __library.get(b"C_VerifyUpdate\0").map(|sym| *sym); + let C_VerifyFinal = __library.get(b"C_VerifyFinal\0").map(|sym| *sym); + let C_VerifyRecoverInit = __library.get(b"C_VerifyRecoverInit\0").map(|sym| *sym); + let C_VerifyRecover = __library.get(b"C_VerifyRecover\0").map(|sym| *sym); + let C_DigestEncryptUpdate = __library.get(b"C_DigestEncryptUpdate\0").map(|sym| *sym); + let C_DecryptDigestUpdate = __library.get(b"C_DecryptDigestUpdate\0").map(|sym| *sym); + let C_SignEncryptUpdate = __library.get(b"C_SignEncryptUpdate\0").map(|sym| *sym); + let C_DecryptVerifyUpdate = __library.get(b"C_DecryptVerifyUpdate\0").map(|sym| *sym); + let C_GenerateKey = __library.get(b"C_GenerateKey\0").map(|sym| *sym); + let C_GenerateKeyPair = __library.get(b"C_GenerateKeyPair\0").map(|sym| *sym); + let C_WrapKey = __library.get(b"C_WrapKey\0").map(|sym| *sym); + let C_UnwrapKey = __library.get(b"C_UnwrapKey\0").map(|sym| *sym); + let C_DeriveKey = __library.get(b"C_DeriveKey\0").map(|sym| *sym); + let C_SeedRandom = __library.get(b"C_SeedRandom\0").map(|sym| *sym); + let C_GenerateRandom = __library.get(b"C_GenerateRandom\0").map(|sym| *sym); + let C_GetFunctionStatus = __library.get(b"C_GetFunctionStatus\0").map(|sym| *sym); + let C_CancelFunction = __library.get(b"C_CancelFunction\0").map(|sym| *sym); + let C_WaitForSlotEvent = __library.get(b"C_WaitForSlotEvent\0").map(|sym| *sym); + let C_GetInterfaceList = __library.get(b"C_GetInterfaceList\0").map(|sym| *sym); + let C_GetInterface = __library.get(b"C_GetInterface\0").map(|sym| *sym); + let C_LoginUser = __library.get(b"C_LoginUser\0").map(|sym| *sym); + let C_SessionCancel = __library.get(b"C_SessionCancel\0").map(|sym| *sym); + let C_MessageEncryptInit = __library.get(b"C_MessageEncryptInit\0").map(|sym| *sym); + let C_EncryptMessage = __library.get(b"C_EncryptMessage\0").map(|sym| *sym); + let C_EncryptMessageBegin = __library.get(b"C_EncryptMessageBegin\0").map(|sym| *sym); + let C_EncryptMessageNext = __library.get(b"C_EncryptMessageNext\0").map(|sym| *sym); + let C_MessageEncryptFinal = __library.get(b"C_MessageEncryptFinal\0").map(|sym| *sym); + let C_MessageDecryptInit = __library.get(b"C_MessageDecryptInit\0").map(|sym| *sym); + let C_DecryptMessage = __library.get(b"C_DecryptMessage\0").map(|sym| *sym); + let C_DecryptMessageBegin = __library.get(b"C_DecryptMessageBegin\0").map(|sym| *sym); + let C_DecryptMessageNext = __library.get(b"C_DecryptMessageNext\0").map(|sym| *sym); + let C_MessageDecryptFinal = __library.get(b"C_MessageDecryptFinal\0").map(|sym| *sym); + let C_MessageSignInit = __library.get(b"C_MessageSignInit\0").map(|sym| *sym); + let C_SignMessage = __library.get(b"C_SignMessage\0").map(|sym| *sym); + let C_SignMessageBegin = __library.get(b"C_SignMessageBegin\0").map(|sym| *sym); + let C_SignMessageNext = __library.get(b"C_SignMessageNext\0").map(|sym| *sym); + let C_MessageSignFinal = __library.get(b"C_MessageSignFinal\0").map(|sym| *sym); + let C_MessageVerifyInit = __library.get(b"C_MessageVerifyInit\0").map(|sym| *sym); + let C_VerifyMessage = __library.get(b"C_VerifyMessage\0").map(|sym| *sym); + let C_VerifyMessageBegin = __library.get(b"C_VerifyMessageBegin\0").map(|sym| *sym); + let C_VerifyMessageNext = __library.get(b"C_VerifyMessageNext\0").map(|sym| *sym); + let C_MessageVerifyFinal = __library.get(b"C_MessageVerifyFinal\0").map(|sym| *sym); + Ok(Pkcs11 { + __library, + C_Initialize, + C_Finalize, + C_GetInfo, + C_GetFunctionList, + C_GetSlotList, + C_GetSlotInfo, + C_GetTokenInfo, + C_GetMechanismList, + C_GetMechanismInfo, + C_InitToken, + C_InitPIN, + C_SetPIN, + C_OpenSession, + C_CloseSession, + C_CloseAllSessions, + C_GetSessionInfo, + C_GetOperationState, + C_SetOperationState, + C_Login, + C_Logout, + C_CreateObject, + C_CopyObject, + C_DestroyObject, + C_GetObjectSize, + C_GetAttributeValue, + C_SetAttributeValue, + C_FindObjectsInit, + C_FindObjects, + C_FindObjectsFinal, + C_EncryptInit, + C_Encrypt, + C_EncryptUpdate, + C_EncryptFinal, + C_DecryptInit, + C_Decrypt, + C_DecryptUpdate, + C_DecryptFinal, + C_DigestInit, + C_Digest, + C_DigestUpdate, + C_DigestKey, + C_DigestFinal, + C_SignInit, + C_Sign, + C_SignUpdate, + C_SignFinal, + C_SignRecoverInit, + C_SignRecover, + C_VerifyInit, + C_Verify, + C_VerifyUpdate, + C_VerifyFinal, + C_VerifyRecoverInit, + C_VerifyRecover, + C_DigestEncryptUpdate, + C_DecryptDigestUpdate, + C_SignEncryptUpdate, + C_DecryptVerifyUpdate, + C_GenerateKey, + C_GenerateKeyPair, + C_WrapKey, + C_UnwrapKey, + C_DeriveKey, + C_SeedRandom, + C_GenerateRandom, + C_GetFunctionStatus, + C_CancelFunction, + C_WaitForSlotEvent, + C_GetInterfaceList, + C_GetInterface, + C_LoginUser, + C_SessionCancel, + C_MessageEncryptInit, + C_EncryptMessage, + C_EncryptMessageBegin, + C_EncryptMessageNext, + C_MessageEncryptFinal, + C_MessageDecryptInit, + C_DecryptMessage, + C_DecryptMessageBegin, + C_DecryptMessageNext, + C_MessageDecryptFinal, + C_MessageSignInit, + C_SignMessage, + C_SignMessageBegin, + C_SignMessageNext, + C_MessageSignFinal, + C_MessageVerifyInit, + C_VerifyMessage, + C_VerifyMessageBegin, + C_VerifyMessageNext, + C_MessageVerifyFinal, + }) + } + pub unsafe fn C_Initialize(&self, pInitArgs: CK_VOID_PTR) -> CK_RV { + (self + .C_Initialize + .as_ref() + .expect("Expected function, got error."))(pInitArgs) + } + pub unsafe fn C_Finalize(&self, pReserved: CK_VOID_PTR) -> CK_RV { + (self + .C_Finalize + .as_ref() + .expect("Expected function, got error."))(pReserved) + } + pub unsafe fn C_GetInfo(&self, pInfo: CK_INFO_PTR) -> CK_RV { + (self + .C_GetInfo + .as_ref() + .expect("Expected function, got error."))(pInfo) + } + pub unsafe fn C_GetFunctionList(&self, ppFunctionList: CK_FUNCTION_LIST_PTR_PTR) -> CK_RV { + (self + .C_GetFunctionList + .as_ref() + .expect("Expected function, got error."))(ppFunctionList) + } + pub unsafe fn C_GetSlotList( + &self, + tokenPresent: CK_BBOOL, + pSlotList: CK_SLOT_ID_PTR, + pulCount: CK_ULONG_PTR, + ) -> CK_RV { + (self + .C_GetSlotList + .as_ref() + .expect("Expected function, got error."))(tokenPresent, pSlotList, pulCount) + } + pub unsafe fn C_GetSlotInfo(&self, slotID: CK_SLOT_ID, pInfo: CK_SLOT_INFO_PTR) -> CK_RV { + (self + .C_GetSlotInfo + .as_ref() + .expect("Expected function, got error."))(slotID, pInfo) + } + pub unsafe fn C_GetTokenInfo(&self, slotID: CK_SLOT_ID, pInfo: CK_TOKEN_INFO_PTR) -> CK_RV { + (self + .C_GetTokenInfo + .as_ref() + .expect("Expected function, got error."))(slotID, pInfo) + } + pub unsafe fn C_GetMechanismList( + &self, + slotID: CK_SLOT_ID, + pMechanismList: CK_MECHANISM_TYPE_PTR, + pulCount: CK_ULONG_PTR, + ) -> CK_RV { + (self + .C_GetMechanismList + .as_ref() + .expect("Expected function, got error."))(slotID, pMechanismList, pulCount) + } + pub unsafe fn C_GetMechanismInfo( + &self, + slotID: CK_SLOT_ID, + type_: CK_MECHANISM_TYPE, + pInfo: CK_MECHANISM_INFO_PTR, + ) -> CK_RV { + (self + .C_GetMechanismInfo + .as_ref() + .expect("Expected function, got error."))(slotID, type_, pInfo) + } + pub unsafe fn C_InitToken( + &self, + slotID: CK_SLOT_ID, + pPin: CK_UTF8CHAR_PTR, + ulPinLen: CK_ULONG, + pLabel: CK_UTF8CHAR_PTR, + ) -> CK_RV { + (self + .C_InitToken + .as_ref() + .expect("Expected function, got error."))(slotID, pPin, ulPinLen, pLabel) + } + pub unsafe fn C_InitPIN( + &self, + hSession: CK_SESSION_HANDLE, + pPin: CK_UTF8CHAR_PTR, + ulPinLen: CK_ULONG, + ) -> CK_RV { + (self + .C_InitPIN + .as_ref() + .expect("Expected function, got error."))(hSession, pPin, ulPinLen) + } + pub unsafe fn C_SetPIN( + &self, + hSession: CK_SESSION_HANDLE, + pOldPin: CK_UTF8CHAR_PTR, + ulOldLen: CK_ULONG, + pNewPin: CK_UTF8CHAR_PTR, + ulNewLen: CK_ULONG, + ) -> CK_RV { + (self + .C_SetPIN + .as_ref() + .expect("Expected function, got error."))( + hSession, pOldPin, ulOldLen, pNewPin, ulNewLen, + ) + } + pub unsafe fn C_OpenSession( + &self, + slotID: CK_SLOT_ID, + flags: CK_FLAGS, + pApplication: CK_VOID_PTR, + Notify: CK_NOTIFY, + phSession: CK_SESSION_HANDLE_PTR, + ) -> CK_RV { + (self + .C_OpenSession + .as_ref() + .expect("Expected function, got error."))( + slotID, + flags, + pApplication, + Notify, + phSession, + ) + } + pub unsafe fn C_CloseSession(&self, hSession: CK_SESSION_HANDLE) -> CK_RV { + (self + .C_CloseSession + .as_ref() + .expect("Expected function, got error."))(hSession) + } + pub unsafe fn C_CloseAllSessions(&self, slotID: CK_SLOT_ID) -> CK_RV { + (self + .C_CloseAllSessions + .as_ref() + .expect("Expected function, got error."))(slotID) + } + pub unsafe fn C_GetSessionInfo( + &self, + hSession: CK_SESSION_HANDLE, + pInfo: CK_SESSION_INFO_PTR, + ) -> CK_RV { + (self + .C_GetSessionInfo + .as_ref() + .expect("Expected function, got error."))(hSession, pInfo) + } + pub unsafe fn C_GetOperationState( + &self, + hSession: CK_SESSION_HANDLE, + pOperationState: CK_BYTE_PTR, + pulOperationStateLen: CK_ULONG_PTR, + ) -> CK_RV { + (self + .C_GetOperationState + .as_ref() + .expect("Expected function, got error."))( + hSession, + pOperationState, + pulOperationStateLen, + ) + } + pub unsafe fn C_SetOperationState( + &self, + hSession: CK_SESSION_HANDLE, + pOperationState: CK_BYTE_PTR, + ulOperationStateLen: CK_ULONG, + hEncryptionKey: CK_OBJECT_HANDLE, + hAuthenticationKey: CK_OBJECT_HANDLE, + ) -> CK_RV { + (self + .C_SetOperationState + .as_ref() + .expect("Expected function, got error."))( + hSession, + pOperationState, + ulOperationStateLen, + hEncryptionKey, + hAuthenticationKey, + ) + } + pub unsafe fn C_Login( + &self, + hSession: CK_SESSION_HANDLE, + userType: CK_USER_TYPE, + pPin: CK_UTF8CHAR_PTR, + ulPinLen: CK_ULONG, + ) -> CK_RV { + (self + .C_Login + .as_ref() + .expect("Expected function, got error."))(hSession, userType, pPin, ulPinLen) + } + pub unsafe fn C_Logout(&self, hSession: CK_SESSION_HANDLE) -> CK_RV { + (self + .C_Logout + .as_ref() + .expect("Expected function, got error."))(hSession) + } + pub unsafe fn C_CreateObject( + &self, + hSession: CK_SESSION_HANDLE, + pTemplate: CK_ATTRIBUTE_PTR, + ulCount: CK_ULONG, + phObject: CK_OBJECT_HANDLE_PTR, + ) -> CK_RV { + (self + .C_CreateObject + .as_ref() + .expect("Expected function, got error."))(hSession, pTemplate, ulCount, phObject) + } + pub unsafe fn C_CopyObject( + &self, + hSession: CK_SESSION_HANDLE, + hObject: CK_OBJECT_HANDLE, + pTemplate: CK_ATTRIBUTE_PTR, + ulCount: CK_ULONG, + phNewObject: CK_OBJECT_HANDLE_PTR, + ) -> CK_RV { + (self + .C_CopyObject + .as_ref() + .expect("Expected function, got error."))( + hSession, + hObject, + pTemplate, + ulCount, + phNewObject, + ) + } + pub unsafe fn C_DestroyObject( + &self, + hSession: CK_SESSION_HANDLE, + hObject: CK_OBJECT_HANDLE, + ) -> CK_RV { + (self + .C_DestroyObject + .as_ref() + .expect("Expected function, got error."))(hSession, hObject) + } + pub unsafe fn C_GetObjectSize( + &self, + hSession: CK_SESSION_HANDLE, + hObject: CK_OBJECT_HANDLE, + pulSize: CK_ULONG_PTR, + ) -> CK_RV { + (self + .C_GetObjectSize + .as_ref() + .expect("Expected function, got error."))(hSession, hObject, pulSize) + } + pub unsafe fn C_GetAttributeValue( + &self, + hSession: CK_SESSION_HANDLE, + hObject: CK_OBJECT_HANDLE, + pTemplate: CK_ATTRIBUTE_PTR, + ulCount: CK_ULONG, + ) -> CK_RV { + (self + .C_GetAttributeValue + .as_ref() + .expect("Expected function, got error."))(hSession, hObject, pTemplate, ulCount) + } + pub unsafe fn C_SetAttributeValue( + &self, + hSession: CK_SESSION_HANDLE, + hObject: CK_OBJECT_HANDLE, + pTemplate: CK_ATTRIBUTE_PTR, + ulCount: CK_ULONG, + ) -> CK_RV { + (self + .C_SetAttributeValue + .as_ref() + .expect("Expected function, got error."))(hSession, hObject, pTemplate, ulCount) + } + pub unsafe fn C_FindObjectsInit( + &self, + hSession: CK_SESSION_HANDLE, + pTemplate: CK_ATTRIBUTE_PTR, + ulCount: CK_ULONG, + ) -> CK_RV { + (self + .C_FindObjectsInit + .as_ref() + .expect("Expected function, got error."))(hSession, pTemplate, ulCount) + } + pub unsafe fn C_FindObjects( + &self, + hSession: CK_SESSION_HANDLE, + phObject: CK_OBJECT_HANDLE_PTR, + ulMaxObjectCount: CK_ULONG, + pulObjectCount: CK_ULONG_PTR, + ) -> CK_RV { + (self + .C_FindObjects + .as_ref() + .expect("Expected function, got error."))( + hSession, + phObject, + ulMaxObjectCount, + pulObjectCount, + ) + } + pub unsafe fn C_FindObjectsFinal(&self, hSession: CK_SESSION_HANDLE) -> CK_RV { + (self + .C_FindObjectsFinal + .as_ref() + .expect("Expected function, got error."))(hSession) + } + pub unsafe fn C_EncryptInit( + &self, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, + ) -> CK_RV { + (self + .C_EncryptInit + .as_ref() + .expect("Expected function, got error."))(hSession, pMechanism, hKey) + } + pub unsafe fn C_Encrypt( + &self, + hSession: CK_SESSION_HANDLE, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pEncryptedData: CK_BYTE_PTR, + pulEncryptedDataLen: CK_ULONG_PTR, + ) -> CK_RV { + (self + .C_Encrypt + .as_ref() + .expect("Expected function, got error."))( + hSession, + pData, + ulDataLen, + pEncryptedData, + pulEncryptedDataLen, + ) + } + pub unsafe fn C_EncryptUpdate( + &self, + hSession: CK_SESSION_HANDLE, + pPart: CK_BYTE_PTR, + ulPartLen: CK_ULONG, + pEncryptedPart: CK_BYTE_PTR, + pulEncryptedPartLen: CK_ULONG_PTR, + ) -> CK_RV { + (self + .C_EncryptUpdate + .as_ref() + .expect("Expected function, got error."))( + hSession, + pPart, + ulPartLen, + pEncryptedPart, + pulEncryptedPartLen, + ) + } + pub unsafe fn C_EncryptFinal( + &self, + hSession: CK_SESSION_HANDLE, + pLastEncryptedPart: CK_BYTE_PTR, + pulLastEncryptedPartLen: CK_ULONG_PTR, + ) -> CK_RV { + (self + .C_EncryptFinal + .as_ref() + .expect("Expected function, got error."))( + hSession, + pLastEncryptedPart, + pulLastEncryptedPartLen, + ) + } + pub unsafe fn C_DecryptInit( + &self, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, + ) -> CK_RV { + (self + .C_DecryptInit + .as_ref() + .expect("Expected function, got error."))(hSession, pMechanism, hKey) + } + pub unsafe fn C_Decrypt( + &self, + hSession: CK_SESSION_HANDLE, + pEncryptedData: CK_BYTE_PTR, + ulEncryptedDataLen: CK_ULONG, + pData: CK_BYTE_PTR, + pulDataLen: CK_ULONG_PTR, + ) -> CK_RV { + (self + .C_Decrypt + .as_ref() + .expect("Expected function, got error."))( + hSession, + pEncryptedData, + ulEncryptedDataLen, + pData, + pulDataLen, + ) + } + pub unsafe fn C_DecryptUpdate( + &self, + hSession: CK_SESSION_HANDLE, + pEncryptedPart: CK_BYTE_PTR, + ulEncryptedPartLen: CK_ULONG, + pPart: CK_BYTE_PTR, + pulPartLen: CK_ULONG_PTR, + ) -> CK_RV { + (self + .C_DecryptUpdate + .as_ref() + .expect("Expected function, got error."))( + hSession, + pEncryptedPart, + ulEncryptedPartLen, + pPart, + pulPartLen, + ) + } + pub unsafe fn C_DecryptFinal( + &self, + hSession: CK_SESSION_HANDLE, + pLastPart: CK_BYTE_PTR, + pulLastPartLen: CK_ULONG_PTR, + ) -> CK_RV { + (self + .C_DecryptFinal + .as_ref() + .expect("Expected function, got error."))(hSession, pLastPart, pulLastPartLen) + } + pub unsafe fn C_DigestInit( + &self, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + ) -> CK_RV { + (self + .C_DigestInit + .as_ref() + .expect("Expected function, got error."))(hSession, pMechanism) + } + pub unsafe fn C_Digest( + &self, + hSession: CK_SESSION_HANDLE, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pDigest: CK_BYTE_PTR, + pulDigestLen: CK_ULONG_PTR, + ) -> CK_RV { + (self + .C_Digest + .as_ref() + .expect("Expected function, got error."))( + hSession, + pData, + ulDataLen, + pDigest, + pulDigestLen, + ) + } + pub unsafe fn C_DigestUpdate( + &self, + hSession: CK_SESSION_HANDLE, + pPart: CK_BYTE_PTR, + ulPartLen: CK_ULONG, + ) -> CK_RV { + (self + .C_DigestUpdate + .as_ref() + .expect("Expected function, got error."))(hSession, pPart, ulPartLen) + } + pub unsafe fn C_DigestKey(&self, hSession: CK_SESSION_HANDLE, hKey: CK_OBJECT_HANDLE) -> CK_RV { + (self + .C_DigestKey + .as_ref() + .expect("Expected function, got error."))(hSession, hKey) + } + pub unsafe fn C_DigestFinal( + &self, + hSession: CK_SESSION_HANDLE, + pDigest: CK_BYTE_PTR, + pulDigestLen: CK_ULONG_PTR, + ) -> CK_RV { + (self + .C_DigestFinal + .as_ref() + .expect("Expected function, got error."))(hSession, pDigest, pulDigestLen) + } + pub unsafe fn C_SignInit( + &self, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, + ) -> CK_RV { + (self + .C_SignInit + .as_ref() + .expect("Expected function, got error."))(hSession, pMechanism, hKey) + } + pub unsafe fn C_Sign( + &self, + hSession: CK_SESSION_HANDLE, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + pulSignatureLen: CK_ULONG_PTR, + ) -> CK_RV { + (self.C_Sign.as_ref().expect("Expected function, got error."))( + hSession, + pData, + ulDataLen, + pSignature, + pulSignatureLen, + ) + } + pub unsafe fn C_SignUpdate( + &self, + hSession: CK_SESSION_HANDLE, + pPart: CK_BYTE_PTR, + ulPartLen: CK_ULONG, + ) -> CK_RV { + (self + .C_SignUpdate + .as_ref() + .expect("Expected function, got error."))(hSession, pPart, ulPartLen) + } + pub unsafe fn C_SignFinal( + &self, + hSession: CK_SESSION_HANDLE, + pSignature: CK_BYTE_PTR, + pulSignatureLen: CK_ULONG_PTR, + ) -> CK_RV { + (self + .C_SignFinal + .as_ref() + .expect("Expected function, got error."))(hSession, pSignature, pulSignatureLen) + } + pub unsafe fn C_SignRecoverInit( + &self, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, + ) -> CK_RV { + (self + .C_SignRecoverInit + .as_ref() + .expect("Expected function, got error."))(hSession, pMechanism, hKey) + } + pub unsafe fn C_SignRecover( + &self, + hSession: CK_SESSION_HANDLE, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + pulSignatureLen: CK_ULONG_PTR, + ) -> CK_RV { + (self + .C_SignRecover + .as_ref() + .expect("Expected function, got error."))( + hSession, + pData, + ulDataLen, + pSignature, + pulSignatureLen, + ) + } + pub unsafe fn C_VerifyInit( + &self, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, + ) -> CK_RV { + (self + .C_VerifyInit + .as_ref() + .expect("Expected function, got error."))(hSession, pMechanism, hKey) + } + pub unsafe fn C_Verify( + &self, + hSession: CK_SESSION_HANDLE, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + ulSignatureLen: CK_ULONG, + ) -> CK_RV { + (self + .C_Verify + .as_ref() + .expect("Expected function, got error."))( + hSession, + pData, + ulDataLen, + pSignature, + ulSignatureLen, + ) + } + pub unsafe fn C_VerifyUpdate( + &self, + hSession: CK_SESSION_HANDLE, + pPart: CK_BYTE_PTR, + ulPartLen: CK_ULONG, + ) -> CK_RV { + (self + .C_VerifyUpdate + .as_ref() + .expect("Expected function, got error."))(hSession, pPart, ulPartLen) + } + pub unsafe fn C_VerifyFinal( + &self, + hSession: CK_SESSION_HANDLE, + pSignature: CK_BYTE_PTR, + ulSignatureLen: CK_ULONG, + ) -> CK_RV { + (self + .C_VerifyFinal + .as_ref() + .expect("Expected function, got error."))(hSession, pSignature, ulSignatureLen) + } + pub unsafe fn C_VerifyRecoverInit( + &self, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, + ) -> CK_RV { + (self + .C_VerifyRecoverInit + .as_ref() + .expect("Expected function, got error."))(hSession, pMechanism, hKey) + } + pub unsafe fn C_VerifyRecover( + &self, + hSession: CK_SESSION_HANDLE, + pSignature: CK_BYTE_PTR, + ulSignatureLen: CK_ULONG, + pData: CK_BYTE_PTR, + pulDataLen: CK_ULONG_PTR, + ) -> CK_RV { + (self + .C_VerifyRecover + .as_ref() + .expect("Expected function, got error."))( + hSession, + pSignature, + ulSignatureLen, + pData, + pulDataLen, + ) + } + pub unsafe fn C_DigestEncryptUpdate( + &self, + hSession: CK_SESSION_HANDLE, + pPart: CK_BYTE_PTR, + ulPartLen: CK_ULONG, + pEncryptedPart: CK_BYTE_PTR, + pulEncryptedPartLen: CK_ULONG_PTR, + ) -> CK_RV { + (self + .C_DigestEncryptUpdate + .as_ref() + .expect("Expected function, got error."))( + hSession, + pPart, + ulPartLen, + pEncryptedPart, + pulEncryptedPartLen, + ) + } + pub unsafe fn C_DecryptDigestUpdate( + &self, + hSession: CK_SESSION_HANDLE, + pEncryptedPart: CK_BYTE_PTR, + ulEncryptedPartLen: CK_ULONG, + pPart: CK_BYTE_PTR, + pulPartLen: CK_ULONG_PTR, + ) -> CK_RV { + (self + .C_DecryptDigestUpdate + .as_ref() + .expect("Expected function, got error."))( + hSession, + pEncryptedPart, + ulEncryptedPartLen, + pPart, + pulPartLen, + ) + } + pub unsafe fn C_SignEncryptUpdate( + &self, + hSession: CK_SESSION_HANDLE, + pPart: CK_BYTE_PTR, + ulPartLen: CK_ULONG, + pEncryptedPart: CK_BYTE_PTR, + pulEncryptedPartLen: CK_ULONG_PTR, + ) -> CK_RV { + (self + .C_SignEncryptUpdate + .as_ref() + .expect("Expected function, got error."))( + hSession, + pPart, + ulPartLen, + pEncryptedPart, + pulEncryptedPartLen, + ) + } + pub unsafe fn C_DecryptVerifyUpdate( + &self, + hSession: CK_SESSION_HANDLE, + pEncryptedPart: CK_BYTE_PTR, + ulEncryptedPartLen: CK_ULONG, + pPart: CK_BYTE_PTR, + pulPartLen: CK_ULONG_PTR, + ) -> CK_RV { + (self + .C_DecryptVerifyUpdate + .as_ref() + .expect("Expected function, got error."))( + hSession, + pEncryptedPart, + ulEncryptedPartLen, + pPart, + pulPartLen, + ) + } + pub unsafe fn C_GenerateKey( + &self, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + pTemplate: CK_ATTRIBUTE_PTR, + ulCount: CK_ULONG, + phKey: CK_OBJECT_HANDLE_PTR, + ) -> CK_RV { + (self + .C_GenerateKey + .as_ref() + .expect("Expected function, got error."))( + hSession, pMechanism, pTemplate, ulCount, phKey, + ) + } + pub unsafe fn C_GenerateKeyPair( + &self, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + pPublicKeyTemplate: CK_ATTRIBUTE_PTR, + ulPublicKeyAttributeCount: CK_ULONG, + pPrivateKeyTemplate: CK_ATTRIBUTE_PTR, + ulPrivateKeyAttributeCount: CK_ULONG, + phPublicKey: CK_OBJECT_HANDLE_PTR, + phPrivateKey: CK_OBJECT_HANDLE_PTR, + ) -> CK_RV { + (self + .C_GenerateKeyPair + .as_ref() + .expect("Expected function, got error."))( + hSession, + pMechanism, + pPublicKeyTemplate, + ulPublicKeyAttributeCount, + pPrivateKeyTemplate, + ulPrivateKeyAttributeCount, + phPublicKey, + phPrivateKey, + ) + } + pub unsafe fn C_WrapKey( + &self, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hWrappingKey: CK_OBJECT_HANDLE, + hKey: CK_OBJECT_HANDLE, + pWrappedKey: CK_BYTE_PTR, + pulWrappedKeyLen: CK_ULONG_PTR, + ) -> CK_RV { + (self + .C_WrapKey + .as_ref() + .expect("Expected function, got error."))( + hSession, + pMechanism, + hWrappingKey, + hKey, + pWrappedKey, + pulWrappedKeyLen, + ) + } + pub unsafe fn C_UnwrapKey( + &self, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hUnwrappingKey: CK_OBJECT_HANDLE, + pWrappedKey: CK_BYTE_PTR, + ulWrappedKeyLen: CK_ULONG, + pTemplate: CK_ATTRIBUTE_PTR, + ulAttributeCount: CK_ULONG, + phKey: CK_OBJECT_HANDLE_PTR, + ) -> CK_RV { + (self + .C_UnwrapKey + .as_ref() + .expect("Expected function, got error."))( + hSession, + pMechanism, + hUnwrappingKey, + pWrappedKey, + ulWrappedKeyLen, + pTemplate, + ulAttributeCount, + phKey, + ) + } + pub unsafe fn C_DeriveKey( + &self, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hBaseKey: CK_OBJECT_HANDLE, + pTemplate: CK_ATTRIBUTE_PTR, + ulAttributeCount: CK_ULONG, + phKey: CK_OBJECT_HANDLE_PTR, + ) -> CK_RV { + (self + .C_DeriveKey + .as_ref() + .expect("Expected function, got error."))( + hSession, + pMechanism, + hBaseKey, + pTemplate, + ulAttributeCount, + phKey, + ) + } + pub unsafe fn C_SeedRandom( + &self, + hSession: CK_SESSION_HANDLE, + pSeed: CK_BYTE_PTR, + ulSeedLen: CK_ULONG, + ) -> CK_RV { + (self + .C_SeedRandom + .as_ref() + .expect("Expected function, got error."))(hSession, pSeed, ulSeedLen) + } + pub unsafe fn C_GenerateRandom( + &self, + hSession: CK_SESSION_HANDLE, + RandomData: CK_BYTE_PTR, + ulRandomLen: CK_ULONG, + ) -> CK_RV { + (self + .C_GenerateRandom + .as_ref() + .expect("Expected function, got error."))(hSession, RandomData, ulRandomLen) + } + pub unsafe fn C_GetFunctionStatus(&self, hSession: CK_SESSION_HANDLE) -> CK_RV { + (self + .C_GetFunctionStatus + .as_ref() + .expect("Expected function, got error."))(hSession) + } + pub unsafe fn C_CancelFunction(&self, hSession: CK_SESSION_HANDLE) -> CK_RV { + (self + .C_CancelFunction + .as_ref() + .expect("Expected function, got error."))(hSession) + } + pub unsafe fn C_WaitForSlotEvent( + &self, + flags: CK_FLAGS, + pSlot: CK_SLOT_ID_PTR, + pRserved: CK_VOID_PTR, + ) -> CK_RV { + (self + .C_WaitForSlotEvent + .as_ref() + .expect("Expected function, got error."))(flags, pSlot, pRserved) + } + pub unsafe fn C_GetInterfaceList( + &self, + pInterfacesList: CK_INTERFACE_PTR, + pulCount: CK_ULONG_PTR, + ) -> CK_RV { + (self + .C_GetInterfaceList + .as_ref() + .expect("Expected function, got error."))(pInterfacesList, pulCount) + } + pub unsafe fn C_GetInterface( + &self, + pInterfaceName: CK_UTF8CHAR_PTR, + pVersion: CK_VERSION_PTR, + ppInterface: CK_INTERFACE_PTR_PTR, + flags: CK_FLAGS, + ) -> CK_RV { + (self + .C_GetInterface + .as_ref() + .expect("Expected function, got error."))( + pInterfaceName, pVersion, ppInterface, flags + ) + } + pub unsafe fn C_LoginUser( + &self, + hSession: CK_SESSION_HANDLE, + userType: CK_USER_TYPE, + pPin: CK_UTF8CHAR_PTR, + ulPinLen: CK_ULONG, + pUsername: CK_UTF8CHAR_PTR, + ulUsernameLen: CK_ULONG, + ) -> CK_RV { + (self + .C_LoginUser + .as_ref() + .expect("Expected function, got error."))( + hSession, + userType, + pPin, + ulPinLen, + pUsername, + ulUsernameLen, + ) + } + pub unsafe fn C_SessionCancel(&self, hSession: CK_SESSION_HANDLE, flags: CK_FLAGS) -> CK_RV { + (self + .C_SessionCancel + .as_ref() + .expect("Expected function, got error."))(hSession, flags) + } + pub unsafe fn C_MessageEncryptInit( + &self, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, + ) -> CK_RV { + (self + .C_MessageEncryptInit + .as_ref() + .expect("Expected function, got error."))(hSession, pMechanism, hKey) + } + pub unsafe fn C_EncryptMessage( + &self, + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pAssociatedData: CK_BYTE_PTR, + ulAssociatedDataLen: CK_ULONG, + pPlaintext: CK_BYTE_PTR, + ulPlaintextLen: CK_ULONG, + pCiphertext: CK_BYTE_PTR, + pulCiphertextLen: CK_ULONG_PTR, + ) -> CK_RV { + (self + .C_EncryptMessage + .as_ref() + .expect("Expected function, got error."))( + hSession, + pParameter, + ulParameterLen, + pAssociatedData, + ulAssociatedDataLen, + pPlaintext, + ulPlaintextLen, + pCiphertext, + pulCiphertextLen, + ) + } + pub unsafe fn C_EncryptMessageBegin( + &self, + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pAssociatedData: CK_BYTE_PTR, + ulAssociatedDataLen: CK_ULONG, + ) -> CK_RV { + (self + .C_EncryptMessageBegin + .as_ref() + .expect("Expected function, got error."))( + hSession, + pParameter, + ulParameterLen, + pAssociatedData, + ulAssociatedDataLen, + ) + } + pub unsafe fn C_EncryptMessageNext( + &self, + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pPlaintextPart: CK_BYTE_PTR, + ulPlaintextPartLen: CK_ULONG, + pCiphertextPart: CK_BYTE_PTR, + pulCiphertextPartLen: CK_ULONG_PTR, + flags: CK_FLAGS, + ) -> CK_RV { + (self + .C_EncryptMessageNext + .as_ref() + .expect("Expected function, got error."))( + hSession, + pParameter, + ulParameterLen, + pPlaintextPart, + ulPlaintextPartLen, + pCiphertextPart, + pulCiphertextPartLen, + flags, + ) + } + pub unsafe fn C_MessageEncryptFinal(&self, hSession: CK_SESSION_HANDLE) -> CK_RV { + (self + .C_MessageEncryptFinal + .as_ref() + .expect("Expected function, got error."))(hSession) + } + pub unsafe fn C_MessageDecryptInit( + &self, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, + ) -> CK_RV { + (self + .C_MessageDecryptInit + .as_ref() + .expect("Expected function, got error."))(hSession, pMechanism, hKey) + } + pub unsafe fn C_DecryptMessage( + &self, + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pAssociatedData: CK_BYTE_PTR, + ulAssociatedDataLen: CK_ULONG, + pCiphertext: CK_BYTE_PTR, + ulCiphertextLen: CK_ULONG, + pPlaintext: CK_BYTE_PTR, + pulPlaintextLen: CK_ULONG_PTR, + ) -> CK_RV { + (self + .C_DecryptMessage + .as_ref() + .expect("Expected function, got error."))( + hSession, + pParameter, + ulParameterLen, + pAssociatedData, + ulAssociatedDataLen, + pCiphertext, + ulCiphertextLen, + pPlaintext, + pulPlaintextLen, + ) + } + pub unsafe fn C_DecryptMessageBegin( + &self, + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pAssociatedData: CK_BYTE_PTR, + ulAssociatedDataLen: CK_ULONG, + ) -> CK_RV { + (self + .C_DecryptMessageBegin + .as_ref() + .expect("Expected function, got error."))( + hSession, + pParameter, + ulParameterLen, + pAssociatedData, + ulAssociatedDataLen, + ) + } + pub unsafe fn C_DecryptMessageNext( + &self, + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pCiphertext: CK_BYTE_PTR, + ulCiphertextLen: CK_ULONG, + pPlaintext: CK_BYTE_PTR, + pulPlaintextLen: CK_ULONG_PTR, + flags: CK_FLAGS, + ) -> CK_RV { + (self + .C_DecryptMessageNext + .as_ref() + .expect("Expected function, got error."))( + hSession, + pParameter, + ulParameterLen, + pCiphertext, + ulCiphertextLen, + pPlaintext, + pulPlaintextLen, + flags, + ) + } + pub unsafe fn C_MessageDecryptFinal(&self, hSession: CK_SESSION_HANDLE) -> CK_RV { + (self + .C_MessageDecryptFinal + .as_ref() + .expect("Expected function, got error."))(hSession) + } + pub unsafe fn C_MessageSignInit( + &self, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, + ) -> CK_RV { + (self + .C_MessageSignInit + .as_ref() + .expect("Expected function, got error."))(hSession, pMechanism, hKey) + } + pub unsafe fn C_SignMessage( + &self, + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + pulSignatureLen: CK_ULONG_PTR, + ) -> CK_RV { + (self + .C_SignMessage + .as_ref() + .expect("Expected function, got error."))( + hSession, + pParameter, + ulParameterLen, + pData, + ulDataLen, + pSignature, + pulSignatureLen, + ) + } + pub unsafe fn C_SignMessageBegin( + &self, + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + ) -> CK_RV { + (self + .C_SignMessageBegin + .as_ref() + .expect("Expected function, got error."))(hSession, pParameter, ulParameterLen) + } + pub unsafe fn C_SignMessageNext( + &self, + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + pulSignatureLen: CK_ULONG_PTR, + ) -> CK_RV { + (self + .C_SignMessageNext + .as_ref() + .expect("Expected function, got error."))( + hSession, + pParameter, + ulParameterLen, + pData, + ulDataLen, + pSignature, + pulSignatureLen, + ) + } + pub unsafe fn C_MessageSignFinal(&self, hSession: CK_SESSION_HANDLE) -> CK_RV { + (self + .C_MessageSignFinal + .as_ref() + .expect("Expected function, got error."))(hSession) + } + pub unsafe fn C_MessageVerifyInit( + &self, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, + ) -> CK_RV { + (self + .C_MessageVerifyInit + .as_ref() + .expect("Expected function, got error."))(hSession, pMechanism, hKey) + } + pub unsafe fn C_VerifyMessage( + &self, + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + ulSignatureLen: CK_ULONG, + ) -> CK_RV { + (self + .C_VerifyMessage + .as_ref() + .expect("Expected function, got error."))( + hSession, + pParameter, + ulParameterLen, + pData, + ulDataLen, + pSignature, + ulSignatureLen, + ) + } + pub unsafe fn C_VerifyMessageBegin( + &self, + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + ) -> CK_RV { + (self + .C_VerifyMessageBegin + .as_ref() + .expect("Expected function, got error."))(hSession, pParameter, ulParameterLen) + } + pub unsafe fn C_VerifyMessageNext( + &self, + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + ulSignatureLen: CK_ULONG, + ) -> CK_RV { + (self + .C_VerifyMessageNext + .as_ref() + .expect("Expected function, got error."))( + hSession, + pParameter, + ulParameterLen, + pData, + ulDataLen, + pSignature, + ulSignatureLen, + ) + } + pub unsafe fn C_MessageVerifyFinal(&self, hSession: CK_SESSION_HANDLE) -> CK_RV { + (self + .C_MessageVerifyFinal + .as_ref() + .expect("Expected function, got error."))(hSession) + } +} diff --git a/cryptoki-sys/src/bindings/i686-unknown-linux-gnu.rs b/cryptoki-sys/src/bindings/i686-unknown-linux-gnu.rs index df429e9c..df6e4948 100644 --- a/cryptoki-sys/src/bindings/i686-unknown-linux-gnu.rs +++ b/cryptoki-sys/src/bindings/i686-unknown-linux-gnu.rs @@ -1,10 +1,22 @@ /* automatically generated by rust-bindgen 0.63.0 */ -pub const PKCS11_H: u32 = 1; -pub const CRYPTOKI_VERSION_MAJOR: CK_BYTE = 2; -pub const CRYPTOKI_VERSION_MINOR: CK_BYTE = 40; -pub const P11_KIT_CRYPTOKI_VERSION_REVISION: u32 = 0; -pub const CRYPTOKI_COMPAT: u32 = 1; +pub const NULL_PTR: u32 = 0; +pub const _PKCS11_H_: u32 = 1; +pub const _PKCS11T_H_: u32 = 1; +pub const CRYPTOKI_VERSION_MAJOR: CK_BYTE = 3; +pub const CRYPTOKI_VERSION_MINOR: CK_BYTE = 0; +pub const CRYPTOKI_VERSION_AMENDMENT: CK_BYTE = 0; +pub const CK_TRUE: CK_BBOOL = 1; +pub const CK_FALSE: CK_BBOOL = 0; +pub const FALSE: u32 = 0; +pub const TRUE: u32 = 1; +pub const CK_EFFECTIVELY_INFINITE: CK_ULONG = 0; +pub const CK_INVALID_HANDLE: CK_ULONG = 0; +pub const CKN_SURRENDER: CK_NOTIFICATION = 0; +pub const CKN_OTP_CHANGED: CK_NOTIFICATION = 1; +pub const CKF_TOKEN_PRESENT: CK_FLAGS = 1; +pub const CKF_REMOVABLE_DEVICE: CK_FLAGS = 2; +pub const CKF_HW_SLOT: CK_FLAGS = 4; pub const CKF_RNG: CK_FLAGS = 1; pub const CKF_WRITE_PROTECTED: CK_FLAGS = 2; pub const CKF_LOGIN_REQUIRED: CK_FLAGS = 4; @@ -24,8 +36,6 @@ pub const CKF_SO_PIN_FINAL_TRY: CK_FLAGS = 2097152; pub const CKF_SO_PIN_LOCKED: CK_FLAGS = 4194304; pub const CKF_SO_PIN_TO_BE_CHANGED: CK_FLAGS = 8388608; pub const CKF_ERROR_STATE: CK_FLAGS = 16777216; -pub const CK_EFFECTIVELY_INFINITE: CK_ULONG = 0; -pub const CK_INVALID_HANDLE: CK_ULONG = 0; pub const CKU_SO: CK_USER_TYPE = 0; pub const CKU_USER: CK_USER_TYPE = 1; pub const CKU_CONTEXT_SPECIFIC: CK_USER_TYPE = 2; @@ -45,9 +55,18 @@ pub const CKO_HW_FEATURE: CK_OBJECT_CLASS = 5; pub const CKO_DOMAIN_PARAMETERS: CK_OBJECT_CLASS = 6; pub const CKO_MECHANISM: CK_OBJECT_CLASS = 7; pub const CKO_OTP_KEY: CK_OBJECT_CLASS = 8; +pub const CKO_PROFILE: CK_OBJECT_CLASS = 9; +pub const CKO_VENDOR_DEFINED: CK_OBJECT_CLASS = 2147483648; +pub const CKP_INVALID_ID: CK_PROFILE_ID = 0; +pub const CKP_BASELINE_PROVIDER: CK_PROFILE_ID = 1; +pub const CKP_EXTENDED_PROVIDER: CK_PROFILE_ID = 2; +pub const CKP_AUTHENTICATION_TOKEN: CK_PROFILE_ID = 3; +pub const CKP_PUBLIC_CERTIFICATES_TOKEN: CK_PROFILE_ID = 4; +pub const CKP_VENDOR_DEFINED: CK_PROFILE_ID = 2147483648; pub const CKH_MONOTONIC_COUNTER: CK_HW_FEATURE_TYPE = 1; pub const CKH_CLOCK: CK_HW_FEATURE_TYPE = 2; pub const CKH_USER_INTERFACE: CK_HW_FEATURE_TYPE = 3; +pub const CKH_VENDOR_DEFINED: CK_HW_FEATURE_TYPE = 2147483648; pub const CKK_RSA: CK_KEY_TYPE = 0; pub const CKK_DSA: CK_KEY_TYPE = 1; pub const CKK_DH: CK_KEY_TYPE = 2; @@ -63,6 +82,7 @@ pub const CKK_DES2: CK_KEY_TYPE = 20; pub const CKK_DES3: CK_KEY_TYPE = 21; pub const CKK_CAST: CK_KEY_TYPE = 22; pub const CKK_CAST3: CK_KEY_TYPE = 23; +pub const CKK_CAST5: CK_KEY_TYPE = 24; pub const CKK_CAST128: CK_KEY_TYPE = 24; pub const CKK_RC5: CK_KEY_TYPE = 25; pub const CKK_IDEA: CK_KEY_TYPE = 26; @@ -90,14 +110,48 @@ pub const CKK_SEED: CK_KEY_TYPE = 47; pub const CKK_GOSTR3410: CK_KEY_TYPE = 48; pub const CKK_GOSTR3411: CK_KEY_TYPE = 49; pub const CKK_GOST28147: CK_KEY_TYPE = 50; +pub const CKK_CHACHA20: CK_KEY_TYPE = 51; +pub const CKK_POLY1305: CK_KEY_TYPE = 52; +pub const CKK_AES_XTS: CK_KEY_TYPE = 53; +pub const CKK_SHA3_224_HMAC: CK_KEY_TYPE = 54; +pub const CKK_SHA3_256_HMAC: CK_KEY_TYPE = 55; +pub const CKK_SHA3_384_HMAC: CK_KEY_TYPE = 56; +pub const CKK_SHA3_512_HMAC: CK_KEY_TYPE = 57; +pub const CKK_BLAKE2B_160_HMAC: CK_KEY_TYPE = 58; +pub const CKK_BLAKE2B_256_HMAC: CK_KEY_TYPE = 59; +pub const CKK_BLAKE2B_384_HMAC: CK_KEY_TYPE = 60; +pub const CKK_BLAKE2B_512_HMAC: CK_KEY_TYPE = 61; +pub const CKK_SALSA20: CK_KEY_TYPE = 62; +pub const CKK_X2RATCHET: CK_KEY_TYPE = 63; pub const CKK_EC_EDWARDS: CK_KEY_TYPE = 64; +pub const CKK_EC_MONTGOMERY: CK_KEY_TYPE = 65; +pub const CKK_HKDF: CK_KEY_TYPE = 66; +pub const CKK_VENDOR_DEFINED: CK_KEY_TYPE = 2147483648; +pub const CK_CERTIFICATE_CATEGORY_UNSPECIFIED: CK_ULONG = 0; +pub const CK_CERTIFICATE_CATEGORY_TOKEN_USER: CK_ULONG = 1; +pub const CK_CERTIFICATE_CATEGORY_AUTHORITY: CK_ULONG = 2; +pub const CK_CERTIFICATE_CATEGORY_OTHER_ENTITY: CK_ULONG = 3; +pub const CK_SECURITY_DOMAIN_UNSPECIFIED: CK_ULONG = 0; +pub const CK_SECURITY_DOMAIN_MANUFACTURER: CK_ULONG = 1; +pub const CK_SECURITY_DOMAIN_OPERATOR: CK_ULONG = 2; +pub const CK_SECURITY_DOMAIN_THIRD_PARTY: CK_ULONG = 3; pub const CKC_X_509: CK_CERTIFICATE_TYPE = 0; pub const CKC_X_509_ATTR_CERT: CK_CERTIFICATE_TYPE = 1; pub const CKC_WTLS: CK_CERTIFICATE_TYPE = 2; +pub const CKC_VENDOR_DEFINED: CK_CERTIFICATE_TYPE = 2147483648; +pub const CKF_ARRAY_ATTRIBUTE: CK_FLAGS = 1073741824; +pub const CK_OTP_FORMAT_DECIMAL: CK_ULONG = 0; +pub const CK_OTP_FORMAT_HEXADECIMAL: CK_ULONG = 1; +pub const CK_OTP_FORMAT_ALPHANUMERIC: CK_ULONG = 2; +pub const CK_OTP_FORMAT_BINARY: CK_ULONG = 3; +pub const CK_OTP_PARAM_IGNORED: CK_ULONG = 0; +pub const CK_OTP_PARAM_OPTIONAL: CK_ULONG = 1; +pub const CK_OTP_PARAM_MANDATORY: CK_ULONG = 2; pub const CKA_CLASS: CK_ATTRIBUTE_TYPE = 0; pub const CKA_TOKEN: CK_ATTRIBUTE_TYPE = 1; pub const CKA_PRIVATE: CK_ATTRIBUTE_TYPE = 2; pub const CKA_LABEL: CK_ATTRIBUTE_TYPE = 3; +pub const CKA_UNIQUE_ID: CK_ATTRIBUTE_TYPE = 4; pub const CKA_APPLICATION: CK_ATTRIBUTE_TYPE = 16; pub const CKA_VALUE: CK_ATTRIBUTE_TYPE = 17; pub const CKA_OBJECT_ID: CK_ATTRIBUTE_TYPE = 18; @@ -144,6 +198,7 @@ pub const CKA_PRIME: CK_ATTRIBUTE_TYPE = 304; pub const CKA_SUBPRIME: CK_ATTRIBUTE_TYPE = 305; pub const CKA_BASE: CK_ATTRIBUTE_TYPE = 306; pub const CKA_PRIME_BITS: CK_ATTRIBUTE_TYPE = 307; +pub const CKA_SUBPRIME_BITS: CK_ATTRIBUTE_TYPE = 308; pub const CKA_SUB_PRIME_BITS: CK_ATTRIBUTE_TYPE = 308; pub const CKA_VALUE_BITS: CK_ATTRIBUTE_TYPE = 352; pub const CKA_VALUE_LEN: CK_ATTRIBUTE_TYPE = 353; @@ -162,6 +217,9 @@ pub const CKA_SECONDARY_AUTH: CK_ATTRIBUTE_TYPE = 512; pub const CKA_AUTH_PIN_FLAGS: CK_ATTRIBUTE_TYPE = 513; pub const CKA_ALWAYS_AUTHENTICATE: CK_ATTRIBUTE_TYPE = 514; pub const CKA_WRAP_WITH_TRUSTED: CK_ATTRIBUTE_TYPE = 528; +pub const CKA_WRAP_TEMPLATE: CK_ATTRIBUTE_TYPE = 1073742353; +pub const CKA_UNWRAP_TEMPLATE: CK_ATTRIBUTE_TYPE = 1073742354; +pub const CKA_DERIVE_TEMPLATE: CK_ATTRIBUTE_TYPE = 1073742355; pub const CKA_OTP_FORMAT: CK_ATTRIBUTE_TYPE = 544; pub const CKA_OTP_LENGTH: CK_ATTRIBUTE_TYPE = 545; pub const CKA_OTP_TIME_INTERVAL: CK_ATTRIBUTE_TYPE = 546; @@ -170,12 +228,12 @@ pub const CKA_OTP_CHALLENGE_REQUIREMENT: CK_ATTRIBUTE_TYPE = 548; pub const CKA_OTP_TIME_REQUIREMENT: CK_ATTRIBUTE_TYPE = 549; pub const CKA_OTP_COUNTER_REQUIREMENT: CK_ATTRIBUTE_TYPE = 550; pub const CKA_OTP_PIN_REQUIREMENT: CK_ATTRIBUTE_TYPE = 551; +pub const CKA_OTP_COUNTER: CK_ATTRIBUTE_TYPE = 558; +pub const CKA_OTP_TIME: CK_ATTRIBUTE_TYPE = 559; pub const CKA_OTP_USER_IDENTIFIER: CK_ATTRIBUTE_TYPE = 554; pub const CKA_OTP_SERVICE_IDENTIFIER: CK_ATTRIBUTE_TYPE = 555; pub const CKA_OTP_SERVICE_LOGO: CK_ATTRIBUTE_TYPE = 556; pub const CKA_OTP_SERVICE_LOGO_TYPE: CK_ATTRIBUTE_TYPE = 557; -pub const CKA_OTP_COUNTER: CK_ATTRIBUTE_TYPE = 558; -pub const CKA_OTP_TIME: CK_ATTRIBUTE_TYPE = 559; pub const CKA_GOSTR3410_PARAMS: CK_ATTRIBUTE_TYPE = 592; pub const CKA_GOSTR3411_PARAMS: CK_ATTRIBUTE_TYPE = 593; pub const CKA_GOST28147_PARAMS: CK_ATTRIBUTE_TYPE = 594; @@ -196,6 +254,9 @@ pub const CKA_MECHANISM_TYPE: CK_ATTRIBUTE_TYPE = 1280; pub const CKA_REQUIRED_CMS_ATTRIBUTES: CK_ATTRIBUTE_TYPE = 1281; pub const CKA_DEFAULT_CMS_ATTRIBUTES: CK_ATTRIBUTE_TYPE = 1282; pub const CKA_SUPPORTED_CMS_ATTRIBUTES: CK_ATTRIBUTE_TYPE = 1283; +pub const CKA_ALLOWED_MECHANISMS: CK_ATTRIBUTE_TYPE = 1073743360; +pub const CKA_PROFILE_ID: CK_ATTRIBUTE_TYPE = 1537; +pub const CKA_VENDOR_DEFINED: CK_ATTRIBUTE_TYPE = 2147483648; pub const CKM_RSA_PKCS_KEY_PAIR_GEN: CK_MECHANISM_TYPE = 0; pub const CKM_RSA_PKCS: CK_MECHANISM_TYPE = 1; pub const CKM_RSA_9796: CK_MECHANISM_TYPE = 2; @@ -218,6 +279,10 @@ pub const CKM_DSA_SHA224: CK_MECHANISM_TYPE = 19; pub const CKM_DSA_SHA256: CK_MECHANISM_TYPE = 20; pub const CKM_DSA_SHA384: CK_MECHANISM_TYPE = 21; pub const CKM_DSA_SHA512: CK_MECHANISM_TYPE = 22; +pub const CKM_DSA_SHA3_224: CK_MECHANISM_TYPE = 24; +pub const CKM_DSA_SHA3_256: CK_MECHANISM_TYPE = 25; +pub const CKM_DSA_SHA3_384: CK_MECHANISM_TYPE = 26; +pub const CKM_DSA_SHA3_512: CK_MECHANISM_TYPE = 27; pub const CKM_DH_PKCS_KEY_PAIR_GEN: CK_MECHANISM_TYPE = 32; pub const CKM_DH_PKCS_DERIVE: CK_MECHANISM_TYPE = 33; pub const CKM_X9_42_DH_KEY_PAIR_GEN: CK_MECHANISM_TYPE = 48; @@ -230,6 +295,8 @@ pub const CKM_SHA512_RSA_PKCS: CK_MECHANISM_TYPE = 66; pub const CKM_SHA256_RSA_PKCS_PSS: CK_MECHANISM_TYPE = 67; pub const CKM_SHA384_RSA_PKCS_PSS: CK_MECHANISM_TYPE = 68; pub const CKM_SHA512_RSA_PKCS_PSS: CK_MECHANISM_TYPE = 69; +pub const CKM_SHA224_RSA_PKCS: CK_MECHANISM_TYPE = 70; +pub const CKM_SHA224_RSA_PKCS_PSS: CK_MECHANISM_TYPE = 71; pub const CKM_SHA512_224: CK_MECHANISM_TYPE = 72; pub const CKM_SHA512_224_HMAC: CK_MECHANISM_TYPE = 73; pub const CKM_SHA512_224_HMAC_GENERAL: CK_MECHANISM_TYPE = 74; @@ -242,6 +309,14 @@ pub const CKM_SHA512_T: CK_MECHANISM_TYPE = 80; pub const CKM_SHA512_T_HMAC: CK_MECHANISM_TYPE = 81; pub const CKM_SHA512_T_HMAC_GENERAL: CK_MECHANISM_TYPE = 82; pub const CKM_SHA512_T_KEY_DERIVATION: CK_MECHANISM_TYPE = 83; +pub const CKM_SHA3_256_RSA_PKCS: CK_MECHANISM_TYPE = 96; +pub const CKM_SHA3_384_RSA_PKCS: CK_MECHANISM_TYPE = 97; +pub const CKM_SHA3_512_RSA_PKCS: CK_MECHANISM_TYPE = 98; +pub const CKM_SHA3_256_RSA_PKCS_PSS: CK_MECHANISM_TYPE = 99; +pub const CKM_SHA3_384_RSA_PKCS_PSS: CK_MECHANISM_TYPE = 100; +pub const CKM_SHA3_512_RSA_PKCS_PSS: CK_MECHANISM_TYPE = 101; +pub const CKM_SHA3_224_RSA_PKCS: CK_MECHANISM_TYPE = 102; +pub const CKM_SHA3_224_RSA_PKCS_PSS: CK_MECHANISM_TYPE = 103; pub const CKM_RC2_KEY_GEN: CK_MECHANISM_TYPE = 256; pub const CKM_RC2_ECB: CK_MECHANISM_TYPE = 257; pub const CKM_RC2_CBC: CK_MECHANISM_TYPE = 258; @@ -293,6 +368,9 @@ pub const CKM_RIPEMD160_HMAC_GENERAL: CK_MECHANISM_TYPE = 578; pub const CKM_SHA256: CK_MECHANISM_TYPE = 592; pub const CKM_SHA256_HMAC: CK_MECHANISM_TYPE = 593; pub const CKM_SHA256_HMAC_GENERAL: CK_MECHANISM_TYPE = 594; +pub const CKM_SHA224: CK_MECHANISM_TYPE = 597; +pub const CKM_SHA224_HMAC: CK_MECHANISM_TYPE = 598; +pub const CKM_SHA224_HMAC_GENERAL: CK_MECHANISM_TYPE = 599; pub const CKM_SHA384: CK_MECHANISM_TYPE = 608; pub const CKM_SHA384_HMAC: CK_MECHANISM_TYPE = 609; pub const CKM_SHA384_HMAC_GENERAL: CK_MECHANISM_TYPE = 610; @@ -305,6 +383,22 @@ pub const CKM_HOTP_KEY_GEN: CK_MECHANISM_TYPE = 656; pub const CKM_HOTP: CK_MECHANISM_TYPE = 657; pub const CKM_ACTI: CK_MECHANISM_TYPE = 672; pub const CKM_ACTI_KEY_GEN: CK_MECHANISM_TYPE = 673; +pub const CKM_SHA3_256: CK_MECHANISM_TYPE = 688; +pub const CKM_SHA3_256_HMAC: CK_MECHANISM_TYPE = 689; +pub const CKM_SHA3_256_HMAC_GENERAL: CK_MECHANISM_TYPE = 690; +pub const CKM_SHA3_256_KEY_GEN: CK_MECHANISM_TYPE = 691; +pub const CKM_SHA3_224: CK_MECHANISM_TYPE = 693; +pub const CKM_SHA3_224_HMAC: CK_MECHANISM_TYPE = 694; +pub const CKM_SHA3_224_HMAC_GENERAL: CK_MECHANISM_TYPE = 695; +pub const CKM_SHA3_224_KEY_GEN: CK_MECHANISM_TYPE = 696; +pub const CKM_SHA3_384: CK_MECHANISM_TYPE = 704; +pub const CKM_SHA3_384_HMAC: CK_MECHANISM_TYPE = 705; +pub const CKM_SHA3_384_HMAC_GENERAL: CK_MECHANISM_TYPE = 706; +pub const CKM_SHA3_384_KEY_GEN: CK_MECHANISM_TYPE = 707; +pub const CKM_SHA3_512: CK_MECHANISM_TYPE = 720; +pub const CKM_SHA3_512_HMAC: CK_MECHANISM_TYPE = 721; +pub const CKM_SHA3_512_HMAC_GENERAL: CK_MECHANISM_TYPE = 722; +pub const CKM_SHA3_512_KEY_GEN: CK_MECHANISM_TYPE = 723; pub const CKM_CAST_KEY_GEN: CK_MECHANISM_TYPE = 768; pub const CKM_CAST_ECB: CK_MECHANISM_TYPE = 769; pub const CKM_CAST_CBC: CK_MECHANISM_TYPE = 770; @@ -364,6 +458,13 @@ pub const CKM_SHA1_KEY_DERIVATION: CK_MECHANISM_TYPE = 914; pub const CKM_SHA256_KEY_DERIVATION: CK_MECHANISM_TYPE = 915; pub const CKM_SHA384_KEY_DERIVATION: CK_MECHANISM_TYPE = 916; pub const CKM_SHA512_KEY_DERIVATION: CK_MECHANISM_TYPE = 917; +pub const CKM_SHA224_KEY_DERIVATION: CK_MECHANISM_TYPE = 918; +pub const CKM_SHA3_256_KEY_DERIVE: CK_MECHANISM_TYPE = 919; +pub const CKM_SHA3_224_KEY_DERIVE: CK_MECHANISM_TYPE = 920; +pub const CKM_SHA3_384_KEY_DERIVE: CK_MECHANISM_TYPE = 921; +pub const CKM_SHA3_512_KEY_DERIVE: CK_MECHANISM_TYPE = 922; +pub const CKM_SHAKE_128_KEY_DERIVE: CK_MECHANISM_TYPE = 923; +pub const CKM_SHAKE_256_KEY_DERIVE: CK_MECHANISM_TYPE = 924; pub const CKM_PBE_MD2_DES_CBC: CK_MECHANISM_TYPE = 928; pub const CKM_PBE_MD5_DES_CBC: CK_MECHANISM_TYPE = 929; pub const CKM_PBE_MD5_CAST_CBC: CK_MECHANISM_TYPE = 930; @@ -403,6 +504,13 @@ pub const CKM_KIP_DERIVE: CK_MECHANISM_TYPE = 1296; pub const CKM_KIP_WRAP: CK_MECHANISM_TYPE = 1297; pub const CKM_KIP_MAC: CK_MECHANISM_TYPE = 1298; pub const CKM_CAMELLIA_KEY_GEN: CK_MECHANISM_TYPE = 1360; +pub const CKM_CAMELLIA_ECB: CK_MECHANISM_TYPE = 1361; +pub const CKM_CAMELLIA_CBC: CK_MECHANISM_TYPE = 1362; +pub const CKM_CAMELLIA_MAC: CK_MECHANISM_TYPE = 1363; +pub const CKM_CAMELLIA_MAC_GENERAL: CK_MECHANISM_TYPE = 1364; +pub const CKM_CAMELLIA_CBC_PAD: CK_MECHANISM_TYPE = 1365; +pub const CKM_CAMELLIA_ECB_ENCRYPT_DATA: CK_MECHANISM_TYPE = 1366; +pub const CKM_CAMELLIA_CBC_ENCRYPT_DATA: CK_MECHANISM_TYPE = 1367; pub const CKM_CAMELLIA_CTR: CK_MECHANISM_TYPE = 1368; pub const CKM_ARIA_KEY_GEN: CK_MECHANISM_TYPE = 1376; pub const CKM_ARIA_ECB: CK_MECHANISM_TYPE = 1377; @@ -433,6 +541,7 @@ pub const CKM_SKIPJACK_PRIVATE_WRAP: CK_MECHANISM_TYPE = 4105; pub const CKM_SKIPJACK_RELAYX: CK_MECHANISM_TYPE = 4106; pub const CKM_KEA_KEY_PAIR_GEN: CK_MECHANISM_TYPE = 4112; pub const CKM_KEA_KEY_DERIVE: CK_MECHANISM_TYPE = 4113; +pub const CKM_KEA_DERIVE: CK_MECHANISM_TYPE = 4114; pub const CKM_FORTEZZA_TIMESTAMP: CK_MECHANISM_TYPE = 4128; pub const CKM_BATON_KEY_GEN: CK_MECHANISM_TYPE = 4144; pub const CKM_BATON_ECB128: CK_MECHANISM_TYPE = 4145; @@ -461,6 +570,8 @@ pub const CKM_JUNIPER_COUNTER: CK_MECHANISM_TYPE = 4195; pub const CKM_JUNIPER_SHUFFLE: CK_MECHANISM_TYPE = 4196; pub const CKM_JUNIPER_WRAP: CK_MECHANISM_TYPE = 4197; pub const CKM_FASTHASH: CK_MECHANISM_TYPE = 4208; +pub const CKM_AES_XTS: CK_MECHANISM_TYPE = 4209; +pub const CKM_AES_XTS_KEY_GEN: CK_MECHANISM_TYPE = 4210; pub const CKM_AES_KEY_GEN: CK_MECHANISM_TYPE = 4224; pub const CKM_AES_ECB: CK_MECHANISM_TYPE = 4225; pub const CKM_AES_CBC: CK_MECHANISM_TYPE = 4226; @@ -500,6 +611,10 @@ pub const CKM_GOST28147_ECB: CK_MECHANISM_TYPE = 4641; pub const CKM_GOST28147: CK_MECHANISM_TYPE = 4642; pub const CKM_GOST28147_MAC: CK_MECHANISM_TYPE = 4643; pub const CKM_GOST28147_KEY_WRAP: CK_MECHANISM_TYPE = 4644; +pub const CKM_CHACHA20_KEY_GEN: CK_MECHANISM_TYPE = 4645; +pub const CKM_CHACHA20: CK_MECHANISM_TYPE = 4646; +pub const CKM_POLY1305_KEY_GEN: CK_MECHANISM_TYPE = 4647; +pub const CKM_POLY1305: CK_MECHANISM_TYPE = 4648; pub const CKM_DSA_PARAMETER_GEN: CK_MECHANISM_TYPE = 8192; pub const CKM_DH_PKCS_PARAMETER_GEN: CK_MECHANISM_TYPE = 8193; pub const CKM_X9_42_DH_PARAMETER_GEN: CK_MECHANISM_TYPE = 8194; @@ -510,63 +625,71 @@ pub const CKM_AES_CFB64: CK_MECHANISM_TYPE = 8453; pub const CKM_AES_CFB8: CK_MECHANISM_TYPE = 8454; pub const CKM_AES_CFB128: CK_MECHANISM_TYPE = 8455; pub const CKM_AES_CFB1: CK_MECHANISM_TYPE = 8456; -pub const CKM_SHA224: CK_MECHANISM_TYPE = 597; -pub const CKM_SHA224_HMAC: CK_MECHANISM_TYPE = 598; -pub const CKM_SHA224_HMAC_GENERAL: CK_MECHANISM_TYPE = 599; -pub const CKM_SHA224_RSA_PKCS: CK_MECHANISM_TYPE = 70; -pub const CKM_SHA224_RSA_PKCS_PSS: CK_MECHANISM_TYPE = 71; -pub const CKM_SHA224_KEY_DERIVATION: CK_MECHANISM_TYPE = 918; -pub const CKM_CAMELLIA_ECB: CK_MECHANISM_TYPE = 1361; -pub const CKM_CAMELLIA_CBC: CK_MECHANISM_TYPE = 1362; -pub const CKM_CAMELLIA_MAC: CK_MECHANISM_TYPE = 1363; -pub const CKM_CAMELLIA_MAC_GENERAL: CK_MECHANISM_TYPE = 1364; -pub const CKM_CAMELLIA_CBC_PAD: CK_MECHANISM_TYPE = 1365; -pub const CKM_CAMELLIA_ECB_ENCRYPT_DATA: CK_MECHANISM_TYPE = 1366; -pub const CKM_CAMELLIA_CBC_ENCRYPT_DATA: CK_MECHANISM_TYPE = 1367; pub const CKM_AES_KEY_WRAP: CK_MECHANISM_TYPE = 8457; pub const CKM_AES_KEY_WRAP_PAD: CK_MECHANISM_TYPE = 8458; +pub const CKM_AES_KEY_WRAP_KWP: CK_MECHANISM_TYPE = 8459; pub const CKM_RSA_PKCS_TPM_1_1: CK_MECHANISM_TYPE = 16385; pub const CKM_RSA_PKCS_OAEP_TPM_1_1: CK_MECHANISM_TYPE = 16386; +pub const CKM_SHA_1_KEY_GEN: CK_MECHANISM_TYPE = 16387; +pub const CKM_SHA224_KEY_GEN: CK_MECHANISM_TYPE = 16388; +pub const CKM_SHA256_KEY_GEN: CK_MECHANISM_TYPE = 16389; +pub const CKM_SHA384_KEY_GEN: CK_MECHANISM_TYPE = 16390; +pub const CKM_SHA512_KEY_GEN: CK_MECHANISM_TYPE = 16391; +pub const CKM_SHA512_224_KEY_GEN: CK_MECHANISM_TYPE = 16392; +pub const CKM_SHA512_256_KEY_GEN: CK_MECHANISM_TYPE = 16393; +pub const CKM_SHA512_T_KEY_GEN: CK_MECHANISM_TYPE = 16394; +pub const CKM_NULL: CK_MECHANISM_TYPE = 16395; +pub const CKM_BLAKE2B_160: CK_MECHANISM_TYPE = 16396; +pub const CKM_BLAKE2B_160_HMAC: CK_MECHANISM_TYPE = 16397; +pub const CKM_BLAKE2B_160_HMAC_GENERAL: CK_MECHANISM_TYPE = 16398; +pub const CKM_BLAKE2B_160_KEY_DERIVE: CK_MECHANISM_TYPE = 16399; +pub const CKM_BLAKE2B_160_KEY_GEN: CK_MECHANISM_TYPE = 16400; +pub const CKM_BLAKE2B_256: CK_MECHANISM_TYPE = 16401; +pub const CKM_BLAKE2B_256_HMAC: CK_MECHANISM_TYPE = 16402; +pub const CKM_BLAKE2B_256_HMAC_GENERAL: CK_MECHANISM_TYPE = 16403; +pub const CKM_BLAKE2B_256_KEY_DERIVE: CK_MECHANISM_TYPE = 16404; +pub const CKM_BLAKE2B_256_KEY_GEN: CK_MECHANISM_TYPE = 16405; +pub const CKM_BLAKE2B_384: CK_MECHANISM_TYPE = 16406; +pub const CKM_BLAKE2B_384_HMAC: CK_MECHANISM_TYPE = 16407; +pub const CKM_BLAKE2B_384_HMAC_GENERAL: CK_MECHANISM_TYPE = 16408; +pub const CKM_BLAKE2B_384_KEY_DERIVE: CK_MECHANISM_TYPE = 16409; +pub const CKM_BLAKE2B_384_KEY_GEN: CK_MECHANISM_TYPE = 16410; +pub const CKM_BLAKE2B_512: CK_MECHANISM_TYPE = 16411; +pub const CKM_BLAKE2B_512_HMAC: CK_MECHANISM_TYPE = 16412; +pub const CKM_BLAKE2B_512_HMAC_GENERAL: CK_MECHANISM_TYPE = 16413; +pub const CKM_BLAKE2B_512_KEY_DERIVE: CK_MECHANISM_TYPE = 16414; +pub const CKM_BLAKE2B_512_KEY_GEN: CK_MECHANISM_TYPE = 16415; +pub const CKM_SALSA20: CK_MECHANISM_TYPE = 16416; +pub const CKM_CHACHA20_POLY1305: CK_MECHANISM_TYPE = 16417; +pub const CKM_SALSA20_POLY1305: CK_MECHANISM_TYPE = 16418; +pub const CKM_X3DH_INITIALIZE: CK_MECHANISM_TYPE = 16419; +pub const CKM_X3DH_RESPOND: CK_MECHANISM_TYPE = 16420; +pub const CKM_X2RATCHET_INITIALIZE: CK_MECHANISM_TYPE = 16421; +pub const CKM_X2RATCHET_RESPOND: CK_MECHANISM_TYPE = 16422; +pub const CKM_X2RATCHET_ENCRYPT: CK_MECHANISM_TYPE = 16423; +pub const CKM_X2RATCHET_DECRYPT: CK_MECHANISM_TYPE = 16424; +pub const CKM_XEDDSA: CK_MECHANISM_TYPE = 16425; +pub const CKM_HKDF_DERIVE: CK_MECHANISM_TYPE = 16426; +pub const CKM_HKDF_DATA: CK_MECHANISM_TYPE = 16427; +pub const CKM_HKDF_KEY_GEN: CK_MECHANISM_TYPE = 16428; +pub const CKM_ECDSA_SHA3_224: CK_MECHANISM_TYPE = 4167; +pub const CKM_ECDSA_SHA3_256: CK_MECHANISM_TYPE = 4168; +pub const CKM_ECDSA_SHA3_384: CK_MECHANISM_TYPE = 4169; +pub const CKM_ECDSA_SHA3_512: CK_MECHANISM_TYPE = 4170; pub const CKM_EC_EDWARDS_KEY_PAIR_GEN: CK_MECHANISM_TYPE = 4181; pub const CKM_EC_MONTGOMERY_KEY_PAIR_GEN: CK_MECHANISM_TYPE = 4182; pub const CKM_EDDSA: CK_MECHANISM_TYPE = 4183; -pub const CK_OTP_FORMAT_DECIMAL: CK_ULONG = 0; -pub const CK_OTP_FORMAT_HEXADECIMAL: CK_ULONG = 1; -pub const CK_OTP_FORMAT_ALPHANUMERIC: CK_ULONG = 2; -pub const CK_OTP_FORMAT_BINARY: CK_ULONG = 3; -pub const CK_OTP_PARAM_IGNORED: CK_ULONG = 0; -pub const CK_OTP_PARAM_OPTIONAL: CK_ULONG = 1; -pub const CK_OTP_PARAM_MANDATORY: CK_ULONG = 2; -pub const CK_OTP_VALUE: CK_ULONG = 0; -pub const CK_OTP_PIN: CK_ULONG = 1; -pub const CK_OTP_CHALLENGE: CK_ULONG = 2; -pub const CK_OTP_TIME: CK_ULONG = 3; -pub const CK_OTP_COUNTER: CK_ULONG = 4; -pub const CK_OTP_FLAGS: CK_ULONG = 5; -pub const CK_OTP_OUTPUT_LENGTH: CK_ULONG = 6; -pub const CK_OTP_FORMAT: CK_ULONG = 7; -pub const CKF_NEXT_OTP: CK_FLAGS = 1; -pub const CKF_EXCLUDE_TIME: CK_FLAGS = 2; -pub const CKF_EXCLUDE_COUNTER: CK_FLAGS = 4; -pub const CKF_EXCLUDE_CHALLENGE: CK_FLAGS = 8; -pub const CKF_EXCLUDE_PIN: CK_FLAGS = 16; -pub const CKF_USER_FRIENDLY_OTP: CK_FLAGS = 32; -pub const CKN_OTP_CHANGED: CK_NOTIFICATION = 1; -pub const CKG_MGF1_SHA1: CK_RSA_PKCS_MGF_TYPE = 1; -pub const CKG_MGF1_SHA224: CK_RSA_PKCS_MGF_TYPE = 5; -pub const CKG_MGF1_SHA256: CK_RSA_PKCS_MGF_TYPE = 2; -pub const CKG_MGF1_SHA384: CK_RSA_PKCS_MGF_TYPE = 3; -pub const CKG_MGF1_SHA512: CK_RSA_PKCS_MGF_TYPE = 4; -pub const CKD_NULL: CK_EC_KDF_TYPE = 1; -pub const CKD_SHA1_KDF: CK_EC_KDF_TYPE = 2; -pub const CKD_SHA1_KDF_ASN1: CK_EC_KDF_TYPE = 3; -pub const CKD_SHA1_KDF_CONCATENATE: CK_EC_KDF_TYPE = 4; -pub const CKD_SHA224_KDF: CK_EC_KDF_TYPE = 5; -pub const CKD_SHA256_KDF: CK_EC_KDF_TYPE = 6; -pub const CKD_SHA384_KDF: CK_EC_KDF_TYPE = 7; -pub const CKD_SHA512_KDF: CK_EC_KDF_TYPE = 8; -pub const CKD_CPDIVERSIFY_KDF: CK_EC_KDF_TYPE = 9; +pub const CKM_SP800_108_COUNTER_KDF: CK_MECHANISM_TYPE = 940; +pub const CKM_SP800_108_FEEDBACK_KDF: CK_MECHANISM_TYPE = 941; +pub const CKM_SP800_108_DOUBLE_PIPELINE_KDF: CK_MECHANISM_TYPE = 942; +pub const CKM_VENDOR_DEFINED: CK_MECHANISM_TYPE = 2147483648; pub const CKF_HW: CK_FLAGS = 1; +pub const CKF_MESSAGE_ENCRYPT: CK_FLAGS = 2; +pub const CKF_MESSAGE_DECRYPT: CK_FLAGS = 4; +pub const CKF_MESSAGE_SIGN: CK_FLAGS = 8; +pub const CKF_MESSAGE_VERIFY: CK_FLAGS = 16; +pub const CKF_MULTI_MESSGE: CK_FLAGS = 32; +pub const CKF_FIND_OBJECTS: CK_FLAGS = 64; pub const CKF_ENCRYPT: CK_FLAGS = 256; pub const CKF_DECRYPT: CK_FLAGS = 512; pub const CKF_DIGEST: CK_FLAGS = 1024; @@ -582,12 +705,12 @@ pub const CKF_DERIVE: CK_FLAGS = 524288; pub const CKF_EC_F_P: CK_FLAGS = 1048576; pub const CKF_EC_F_2M: CK_FLAGS = 2097152; pub const CKF_EC_ECPARAMETERS: CK_FLAGS = 4194304; +pub const CKF_EC_OID: CK_FLAGS = 8388608; pub const CKF_EC_NAMEDCURVE: CK_FLAGS = 8388608; pub const CKF_EC_UNCOMPRESS: CK_FLAGS = 16777216; pub const CKF_EC_COMPRESS: CK_FLAGS = 33554432; -pub const CKF_DONT_BLOCK: CK_FLAGS = 1; -pub const CKF_LIBRARY_CANT_CREATE_OS_THREADS: CK_FLAGS = 1; -pub const CKF_OS_LOCKING_OK: CK_FLAGS = 2; +pub const CKF_EC_CURVENAME: CK_FLAGS = 67108864; +pub const CKF_EXTENSION: CK_FLAGS = 2147483648; pub const CKR_OK: CK_RV = 0; pub const CKR_CANCEL: CK_RV = 1; pub const CKR_HOST_MEMORY: CK_RV = 2; @@ -610,6 +733,7 @@ pub const CKR_DEVICE_MEMORY: CK_RV = 49; pub const CKR_DEVICE_REMOVED: CK_RV = 50; pub const CKR_ENCRYPTED_DATA_INVALID: CK_RV = 64; pub const CKR_ENCRYPTED_DATA_LEN_RANGE: CK_RV = 65; +pub const CKR_AEAD_DECRYPT_FAILED: CK_RV = 66; pub const CKR_FUNCTION_CANCELED: CK_RV = 80; pub const CKR_FUNCTION_NOT_PARALLEL: CK_RV = 81; pub const CKR_FUNCTION_NOT_SUPPORTED: CK_RV = 84; @@ -665,6 +789,7 @@ pub const CKR_WRAPPING_KEY_TYPE_INCONSISTENT: CK_RV = 277; pub const CKR_RANDOM_SEED_NOT_SUPPORTED: CK_RV = 288; pub const CKR_RANDOM_NO_RNG: CK_RV = 289; pub const CKR_DOMAIN_PARAMS_INVALID: CK_RV = 304; +pub const CKR_CURVE_NOT_SUPPORTED: CK_RV = 320; pub const CKR_BUFFER_TOO_SMALL: CK_RV = 336; pub const CKR_SAVED_STATE_INVALID: CK_RV = 352; pub const CKR_INFORMATION_SENSITIVE: CK_RV = 368; @@ -675,44 +800,126 @@ pub const CKR_MUTEX_BAD: CK_RV = 416; pub const CKR_MUTEX_NOT_LOCKED: CK_RV = 417; pub const CKR_NEW_PIN_MODE: CK_RV = 432; pub const CKR_NEXT_OTP: CK_RV = 433; -pub const CKR_EXCEEDED_MAX_ITERATIONS: CK_RV = 448; -pub const CKR_FIPS_SELF_TEST_FAILED: CK_RV = 449; -pub const CKR_LIBRARY_LOAD_FAILED: CK_RV = 450; -pub const CKR_PIN_TOO_WEAK: CK_RV = 451; -pub const CKR_PUBLIC_KEY_INVALID: CK_RV = 452; +pub const CKR_EXCEEDED_MAX_ITERATIONS: CK_RV = 437; +pub const CKR_FIPS_SELF_TEST_FAILED: CK_RV = 438; +pub const CKR_LIBRARY_LOAD_FAILED: CK_RV = 439; +pub const CKR_PIN_TOO_WEAK: CK_RV = 440; +pub const CKR_PUBLIC_KEY_INVALID: CK_RV = 441; pub const CKR_FUNCTION_REJECTED: CK_RV = 512; +pub const CKR_TOKEN_RESOURCE_EXCEEDED: CK_RV = 513; +pub const CKR_VENDOR_DEFINED: CK_RV = 2147483648; +pub const CKF_END_OF_MESSAGE: CK_FLAGS = 1; +pub const CKF_INTERFACE_FORK_SAFE: CK_FLAGS = 1; +pub const CKF_LIBRARY_CANT_CREATE_OS_THREADS: CK_FLAGS = 1; +pub const CKF_OS_LOCKING_OK: CK_FLAGS = 2; +pub const CKF_DONT_BLOCK: CK_FLAGS = 1; +pub const CKG_MGF1_SHA1: CK_RSA_PKCS_MGF_TYPE = 1; +pub const CKG_MGF1_SHA256: CK_RSA_PKCS_MGF_TYPE = 2; +pub const CKG_MGF1_SHA384: CK_RSA_PKCS_MGF_TYPE = 3; +pub const CKG_MGF1_SHA512: CK_RSA_PKCS_MGF_TYPE = 4; +pub const CKG_MGF1_SHA224: CK_RSA_PKCS_MGF_TYPE = 5; pub const CKZ_DATA_SPECIFIED: CK_RSA_PKCS_OAEP_SOURCE_TYPE = 1; -pub const CK_FALSE: CK_BBOOL = 0; -pub const CK_TRUE: CK_BBOOL = 1; -pub const FALSE: u32 = 0; -pub const TRUE: u32 = 1; -pub type CK_FLAGS = ::std::os::raw::c_ulong; +pub const CKD_NULL: CK_EC_KDF_TYPE = 1; +pub const CKD_SHA1_KDF: CK_EC_KDF_TYPE = 2; +pub const CKD_SHA1_KDF_ASN1: CK_EC_KDF_TYPE = 3; +pub const CKD_SHA1_KDF_CONCATENATE: CK_EC_KDF_TYPE = 4; +pub const CKD_SHA224_KDF: CK_EC_KDF_TYPE = 5; +pub const CKD_SHA256_KDF: CK_EC_KDF_TYPE = 6; +pub const CKD_SHA384_KDF: CK_EC_KDF_TYPE = 7; +pub const CKD_SHA512_KDF: CK_EC_KDF_TYPE = 8; +pub const CKD_CPDIVERSIFY_KDF: CK_EC_KDF_TYPE = 9; +pub const CKD_SHA3_224_KDF: CK_EC_KDF_TYPE = 10; +pub const CKD_SHA3_256_KDF: CK_EC_KDF_TYPE = 11; +pub const CKD_SHA3_384_KDF: CK_EC_KDF_TYPE = 12; +pub const CKD_SHA3_512_KDF: CK_EC_KDF_TYPE = 13; +pub const CKD_SHA1_KDF_SP800: CK_EC_KDF_TYPE = 14; +pub const CKD_SHA224_KDF_SP800: CK_EC_KDF_TYPE = 15; +pub const CKD_SHA256_KDF_SP800: CK_EC_KDF_TYPE = 16; +pub const CKD_SHA384_KDF_SP800: CK_EC_KDF_TYPE = 17; +pub const CKD_SHA512_KDF_SP800: CK_EC_KDF_TYPE = 18; +pub const CKD_SHA3_224_KDF_SP800: CK_EC_KDF_TYPE = 19; +pub const CKD_SHA3_256_KDF_SP800: CK_EC_KDF_TYPE = 20; +pub const CKD_SHA3_384_KDF_SP800: CK_EC_KDF_TYPE = 21; +pub const CKD_SHA3_512_KDF_SP800: CK_EC_KDF_TYPE = 22; +pub const CKD_BLAKE2B_160_KDF: CK_EC_KDF_TYPE = 23; +pub const CKD_BLAKE2B_256_KDF: CK_EC_KDF_TYPE = 24; +pub const CKD_BLAKE2B_384_KDF: CK_EC_KDF_TYPE = 25; +pub const CKD_BLAKE2B_512_KDF: CK_EC_KDF_TYPE = 26; +pub const CKP_PKCS5_PBKD2_HMAC_SHA1: CK_PROFILE_ID = 1; +pub const CKP_PKCS5_PBKD2_HMAC_GOSTR3411: CK_PROFILE_ID = 2; +pub const CKP_PKCS5_PBKD2_HMAC_SHA224: CK_PROFILE_ID = 3; +pub const CKP_PKCS5_PBKD2_HMAC_SHA256: CK_PROFILE_ID = 4; +pub const CKP_PKCS5_PBKD2_HMAC_SHA384: CK_PROFILE_ID = 5; +pub const CKP_PKCS5_PBKD2_HMAC_SHA512: CK_PROFILE_ID = 6; +pub const CKP_PKCS5_PBKD2_HMAC_SHA512_224: CK_PROFILE_ID = 7; +pub const CKP_PKCS5_PBKD2_HMAC_SHA512_256: CK_PROFILE_ID = 8; +pub const CKZ_SALT_SPECIFIED: CK_RSA_PKCS_OAEP_SOURCE_TYPE = 1; +pub const CK_OTP_VALUE: CK_ULONG = 0; +pub const CK_OTP_PIN: CK_ULONG = 1; +pub const CK_OTP_CHALLENGE: CK_ULONG = 2; +pub const CK_OTP_TIME: CK_ULONG = 3; +pub const CK_OTP_COUNTER: CK_ULONG = 4; +pub const CK_OTP_FLAGS: CK_ULONG = 5; +pub const CK_OTP_OUTPUT_LENGTH: CK_ULONG = 6; +pub const CK_OTP_OUTPUT_FORMAT: CK_ULONG = 7; +pub const CKF_NEXT_OTP: CK_FLAGS = 1; +pub const CKF_EXCLUDE_TIME: CK_FLAGS = 2; +pub const CKF_EXCLUDE_COUNTER: CK_FLAGS = 4; +pub const CKF_EXCLUDE_CHALLENGE: CK_FLAGS = 8; +pub const CKF_EXCLUDE_PIN: CK_FLAGS = 16; +pub const CKF_USER_FRIENDLY_OTP: CK_FLAGS = 32; +pub const CKG_NO_GENERATE: u32 = 0; +pub const CKG_GENERATE: u32 = 1; +pub const CKG_GENERATE_COUNTER: u32 = 2; +pub const CKG_GENERATE_RANDOM: u32 = 3; +pub const CK_SP800_108_ITERATION_VARIABLE: CK_ULONG = 1; +pub const CK_SP800_108_OPTIONAL_COUNTER: CK_ULONG = 2; +pub const CK_SP800_108_DKM_LENGTH: CK_ULONG = 3; +pub const CK_SP800_108_BYTE_ARRAY: CK_ULONG = 4; +pub const CKF_HKDF_SALT_NULL: CK_FLAGS = 1; +pub const CKF_HKDF_SALT_DATA: CK_FLAGS = 2; +pub const CKF_HKDF_SALT_KEY: CK_FLAGS = 4; +pub const CK_NEED_ARG_LIST: CK_ULONG = 1; +pub const CK_PKCS11_2_0_ONLY: CK_ULONG = 1; +pub type CK_BYTE = ::std::os::raw::c_uchar; +pub type CK_CHAR = CK_BYTE; +pub type CK_UTF8CHAR = CK_BYTE; +pub type CK_BBOOL = CK_BYTE; +pub type CK_ULONG = ::std::os::raw::c_ulong; +pub type CK_LONG = ::std::os::raw::c_long; +pub type CK_FLAGS = CK_ULONG; +pub type CK_BYTE_PTR = *mut CK_BYTE; +pub type CK_CHAR_PTR = *mut CK_CHAR; +pub type CK_UTF8CHAR_PTR = *mut CK_UTF8CHAR; +pub type CK_ULONG_PTR = *mut CK_ULONG; +pub type CK_VOID_PTR = *mut ::std::os::raw::c_void; +pub type CK_VOID_PTR_PTR = *mut CK_VOID_PTR; #[repr(C)] #[derive(Debug, Default, Copy, Clone)] -pub struct _CK_VERSION { - pub major: ::std::os::raw::c_uchar, - pub minor: ::std::os::raw::c_uchar, +pub struct CK_VERSION { + pub major: CK_BYTE, + pub minor: CK_BYTE, } #[test] -fn bindgen_test_layout__CK_VERSION() { - const UNINIT: ::std::mem::MaybeUninit<_CK_VERSION> = ::std::mem::MaybeUninit::uninit(); +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::<_CK_VERSION>(), + ::std::mem::size_of::(), 2usize, - concat!("Size of: ", stringify!(_CK_VERSION)) + concat!("Size of: ", stringify!(CK_VERSION)) ); assert_eq!( - ::std::mem::align_of::<_CK_VERSION>(), + ::std::mem::align_of::(), 1usize, - concat!("Alignment of ", stringify!(_CK_VERSION)) + 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!(CK_VERSION), "::", stringify!(major) ) @@ -722,41 +929,42 @@ fn bindgen_test_layout__CK_VERSION() { 1usize, concat!( "Offset of field: ", - stringify!(_CK_VERSION), + stringify!(CK_VERSION), "::", stringify!(minor) ) ); } +pub type CK_VERSION_PTR = *mut CK_VERSION; #[repr(C)] #[derive(Debug, Default, Copy, Clone)] -pub struct _CK_INFO { - pub cryptokiVersion: _CK_VERSION, - pub manufacturerID: [::std::os::raw::c_uchar; 32usize], +pub struct CK_INFO { + pub cryptokiVersion: CK_VERSION, + pub manufacturerID: [CK_UTF8CHAR; 32usize], pub flags: CK_FLAGS, - pub libraryDescription: [::std::os::raw::c_uchar; 32usize], - pub libraryVersion: _CK_VERSION, + pub libraryDescription: [CK_UTF8CHAR; 32usize], + pub libraryVersion: CK_VERSION, } #[test] -fn bindgen_test_layout__CK_INFO() { - const UNINIT: ::std::mem::MaybeUninit<_CK_INFO> = ::std::mem::MaybeUninit::uninit(); +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::<_CK_INFO>(), + ::std::mem::size_of::(), 76usize, - concat!("Size of: ", stringify!(_CK_INFO)) + concat!("Size of: ", stringify!(CK_INFO)) ); assert_eq!( - ::std::mem::align_of::<_CK_INFO>(), + ::std::mem::align_of::(), 4usize, - concat!("Alignment of ", stringify!(_CK_INFO)) + 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!(CK_INFO), "::", stringify!(cryptokiVersion) ) @@ -766,7 +974,7 @@ fn bindgen_test_layout__CK_INFO() { 2usize, concat!( "Offset of field: ", - stringify!(_CK_INFO), + stringify!(CK_INFO), "::", stringify!(manufacturerID) ) @@ -776,7 +984,7 @@ fn bindgen_test_layout__CK_INFO() { 36usize, concat!( "Offset of field: ", - stringify!(_CK_INFO), + stringify!(CK_INFO), "::", stringify!(flags) ) @@ -786,7 +994,7 @@ fn bindgen_test_layout__CK_INFO() { 40usize, concat!( "Offset of field: ", - stringify!(_CK_INFO), + stringify!(CK_INFO), "::", stringify!(libraryDescription) ) @@ -796,44 +1004,45 @@ fn bindgen_test_layout__CK_INFO() { 72usize, concat!( "Offset of field: ", - stringify!(_CK_INFO), + stringify!(CK_INFO), "::", stringify!(libraryVersion) ) ); } -pub type CK_NOTIFICATION = ::std::os::raw::c_ulong; -pub const CKN_SURRENDER: ::std::os::raw::c_ulong = 0; -pub type CK_SLOT_ID = ::std::os::raw::c_ulong; +pub type CK_INFO_PTR = *mut CK_INFO; +pub type CK_NOTIFICATION = CK_ULONG; +pub type CK_SLOT_ID = CK_ULONG; +pub type CK_SLOT_ID_PTR = *mut CK_SLOT_ID; #[repr(C)] #[derive(Debug, Copy, Clone)] -pub struct _CK_SLOT_INFO { - pub slotDescription: [::std::os::raw::c_uchar; 64usize], - pub manufacturerID: [::std::os::raw::c_uchar; 32usize], +pub struct CK_SLOT_INFO { + pub slotDescription: [CK_UTF8CHAR; 64usize], + pub manufacturerID: [CK_UTF8CHAR; 32usize], pub flags: CK_FLAGS, - pub hardwareVersion: _CK_VERSION, - pub firmwareVersion: _CK_VERSION, + pub hardwareVersion: CK_VERSION, + pub firmwareVersion: CK_VERSION, } #[test] -fn bindgen_test_layout__CK_SLOT_INFO() { - const UNINIT: ::std::mem::MaybeUninit<_CK_SLOT_INFO> = ::std::mem::MaybeUninit::uninit(); +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::<_CK_SLOT_INFO>(), + ::std::mem::size_of::(), 104usize, - concat!("Size of: ", stringify!(_CK_SLOT_INFO)) + concat!("Size of: ", stringify!(CK_SLOT_INFO)) ); assert_eq!( - ::std::mem::align_of::<_CK_SLOT_INFO>(), + ::std::mem::align_of::(), 4usize, - concat!("Alignment of ", stringify!(_CK_SLOT_INFO)) + 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!(CK_SLOT_INFO), "::", stringify!(slotDescription) ) @@ -843,7 +1052,7 @@ fn bindgen_test_layout__CK_SLOT_INFO() { 64usize, concat!( "Offset of field: ", - stringify!(_CK_SLOT_INFO), + stringify!(CK_SLOT_INFO), "::", stringify!(manufacturerID) ) @@ -853,7 +1062,7 @@ fn bindgen_test_layout__CK_SLOT_INFO() { 96usize, concat!( "Offset of field: ", - stringify!(_CK_SLOT_INFO), + stringify!(CK_SLOT_INFO), "::", stringify!(flags) ) @@ -863,7 +1072,7 @@ fn bindgen_test_layout__CK_SLOT_INFO() { 100usize, concat!( "Offset of field: ", - stringify!(_CK_SLOT_INFO), + stringify!(CK_SLOT_INFO), "::", stringify!(hardwareVersion) ) @@ -873,13 +1082,13 @@ fn bindgen_test_layout__CK_SLOT_INFO() { 102usize, concat!( "Offset of field: ", - stringify!(_CK_SLOT_INFO), + stringify!(CK_SLOT_INFO), "::", stringify!(firmwareVersion) ) ); } -impl Default for _CK_SLOT_INFO { +impl Default for CK_SLOT_INFO { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { @@ -888,52 +1097,49 @@ impl Default for _CK_SLOT_INFO { } } } -pub const CKF_TOKEN_PRESENT: ::std::os::raw::c_ulong = 1; -pub const CKF_REMOVABLE_DEVICE: ::std::os::raw::c_ulong = 2; -pub const CKF_HW_SLOT: ::std::os::raw::c_ulong = 4; -pub const CKF_ARRAY_ATTRIBUTE: ::std::os::raw::c_ulong = 1073741824; +pub type CK_SLOT_INFO_PTR = *mut CK_SLOT_INFO; #[repr(C)] #[derive(Debug, Default, Copy, Clone)] -pub struct _CK_TOKEN_INFO { - pub label: [::std::os::raw::c_uchar; 32usize], - pub manufacturerID: [::std::os::raw::c_uchar; 32usize], - pub model: [::std::os::raw::c_uchar; 16usize], - pub serialNumber: [::std::os::raw::c_uchar; 16usize], +pub struct CK_TOKEN_INFO { + pub label: [CK_UTF8CHAR; 32usize], + pub manufacturerID: [CK_UTF8CHAR; 32usize], + pub model: [CK_UTF8CHAR; 16usize], + pub serialNumber: [CK_CHAR; 16usize], pub flags: CK_FLAGS, - pub ulMaxSessionCount: ::std::os::raw::c_ulong, - pub ulSessionCount: ::std::os::raw::c_ulong, - pub ulMaxRwSessionCount: ::std::os::raw::c_ulong, - pub ulRwSessionCount: ::std::os::raw::c_ulong, - pub ulMaxPinLen: ::std::os::raw::c_ulong, - pub ulMinPinLen: ::std::os::raw::c_ulong, - pub ulTotalPublicMemory: ::std::os::raw::c_ulong, - pub ulFreePublicMemory: ::std::os::raw::c_ulong, - pub ulTotalPrivateMemory: ::std::os::raw::c_ulong, - pub ulFreePrivateMemory: ::std::os::raw::c_ulong, - pub hardwareVersion: _CK_VERSION, - pub firmwareVersion: _CK_VERSION, - pub utcTime: [::std::os::raw::c_uchar; 16usize], + pub ulMaxSessionCount: CK_ULONG, + pub ulSessionCount: CK_ULONG, + pub ulMaxRwSessionCount: CK_ULONG, + pub ulRwSessionCount: CK_ULONG, + pub ulMaxPinLen: CK_ULONG, + pub ulMinPinLen: CK_ULONG, + pub ulTotalPublicMemory: CK_ULONG, + pub ulFreePublicMemory: CK_ULONG, + pub ulTotalPrivateMemory: CK_ULONG, + pub ulFreePrivateMemory: CK_ULONG, + pub hardwareVersion: CK_VERSION, + pub firmwareVersion: CK_VERSION, + pub utcTime: [CK_CHAR; 16usize], } #[test] -fn bindgen_test_layout__CK_TOKEN_INFO() { - const UNINIT: ::std::mem::MaybeUninit<_CK_TOKEN_INFO> = ::std::mem::MaybeUninit::uninit(); +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::<_CK_TOKEN_INFO>(), + ::std::mem::size_of::(), 160usize, - concat!("Size of: ", stringify!(_CK_TOKEN_INFO)) + concat!("Size of: ", stringify!(CK_TOKEN_INFO)) ); assert_eq!( - ::std::mem::align_of::<_CK_TOKEN_INFO>(), + ::std::mem::align_of::(), 4usize, - concat!("Alignment of ", stringify!(_CK_TOKEN_INFO)) + 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!(CK_TOKEN_INFO), "::", stringify!(label) ) @@ -943,7 +1149,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { 32usize, concat!( "Offset of field: ", - stringify!(_CK_TOKEN_INFO), + stringify!(CK_TOKEN_INFO), "::", stringify!(manufacturerID) ) @@ -953,7 +1159,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { 64usize, concat!( "Offset of field: ", - stringify!(_CK_TOKEN_INFO), + stringify!(CK_TOKEN_INFO), "::", stringify!(model) ) @@ -963,7 +1169,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { 80usize, concat!( "Offset of field: ", - stringify!(_CK_TOKEN_INFO), + stringify!(CK_TOKEN_INFO), "::", stringify!(serialNumber) ) @@ -973,7 +1179,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { 96usize, concat!( "Offset of field: ", - stringify!(_CK_TOKEN_INFO), + stringify!(CK_TOKEN_INFO), "::", stringify!(flags) ) @@ -983,7 +1189,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { 100usize, concat!( "Offset of field: ", - stringify!(_CK_TOKEN_INFO), + stringify!(CK_TOKEN_INFO), "::", stringify!(ulMaxSessionCount) ) @@ -993,7 +1199,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { 104usize, concat!( "Offset of field: ", - stringify!(_CK_TOKEN_INFO), + stringify!(CK_TOKEN_INFO), "::", stringify!(ulSessionCount) ) @@ -1003,7 +1209,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { 108usize, concat!( "Offset of field: ", - stringify!(_CK_TOKEN_INFO), + stringify!(CK_TOKEN_INFO), "::", stringify!(ulMaxRwSessionCount) ) @@ -1013,7 +1219,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { 112usize, concat!( "Offset of field: ", - stringify!(_CK_TOKEN_INFO), + stringify!(CK_TOKEN_INFO), "::", stringify!(ulRwSessionCount) ) @@ -1023,7 +1229,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { 116usize, concat!( "Offset of field: ", - stringify!(_CK_TOKEN_INFO), + stringify!(CK_TOKEN_INFO), "::", stringify!(ulMaxPinLen) ) @@ -1033,7 +1239,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { 120usize, concat!( "Offset of field: ", - stringify!(_CK_TOKEN_INFO), + stringify!(CK_TOKEN_INFO), "::", stringify!(ulMinPinLen) ) @@ -1043,7 +1249,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { 124usize, concat!( "Offset of field: ", - stringify!(_CK_TOKEN_INFO), + stringify!(CK_TOKEN_INFO), "::", stringify!(ulTotalPublicMemory) ) @@ -1053,7 +1259,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { 128usize, concat!( "Offset of field: ", - stringify!(_CK_TOKEN_INFO), + stringify!(CK_TOKEN_INFO), "::", stringify!(ulFreePublicMemory) ) @@ -1063,7 +1269,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { 132usize, concat!( "Offset of field: ", - stringify!(_CK_TOKEN_INFO), + stringify!(CK_TOKEN_INFO), "::", stringify!(ulTotalPrivateMemory) ) @@ -1073,7 +1279,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { 136usize, concat!( "Offset of field: ", - stringify!(_CK_TOKEN_INFO), + stringify!(CK_TOKEN_INFO), "::", stringify!(ulFreePrivateMemory) ) @@ -1083,7 +1289,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { 140usize, concat!( "Offset of field: ", - stringify!(_CK_TOKEN_INFO), + stringify!(CK_TOKEN_INFO), "::", stringify!(hardwareVersion) ) @@ -1093,7 +1299,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { 142usize, concat!( "Offset of field: ", - stringify!(_CK_TOKEN_INFO), + stringify!(CK_TOKEN_INFO), "::", stringify!(firmwareVersion) ) @@ -1103,43 +1309,45 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { 144usize, concat!( "Offset of field: ", - stringify!(_CK_TOKEN_INFO), + stringify!(CK_TOKEN_INFO), "::", stringify!(utcTime) ) ); } -pub type CK_SESSION_HANDLE = ::std::os::raw::c_ulong; -pub type CK_USER_TYPE = ::std::os::raw::c_ulong; -pub type CK_STATE = ::std::os::raw::c_ulong; +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; +pub type CK_USER_TYPE = CK_ULONG; +pub type CK_STATE = CK_ULONG; #[repr(C)] #[derive(Debug, Default, Copy, Clone)] -pub struct _CK_SESSION_INFO { +pub struct CK_SESSION_INFO { pub slotID: CK_SLOT_ID, pub state: CK_STATE, pub flags: CK_FLAGS, - pub ulDeviceError: ::std::os::raw::c_ulong, + pub ulDeviceError: CK_ULONG, } #[test] -fn bindgen_test_layout__CK_SESSION_INFO() { - const UNINIT: ::std::mem::MaybeUninit<_CK_SESSION_INFO> = ::std::mem::MaybeUninit::uninit(); +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::<_CK_SESSION_INFO>(), + ::std::mem::size_of::(), 16usize, - concat!("Size of: ", stringify!(_CK_SESSION_INFO)) + concat!("Size of: ", stringify!(CK_SESSION_INFO)) ); assert_eq!( - ::std::mem::align_of::<_CK_SESSION_INFO>(), + ::std::mem::align_of::(), 4usize, - concat!("Alignment of ", stringify!(_CK_SESSION_INFO)) + 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!(CK_SESSION_INFO), "::", stringify!(slotID) ) @@ -1149,7 +1357,7 @@ fn bindgen_test_layout__CK_SESSION_INFO() { 4usize, concat!( "Offset of field: ", - stringify!(_CK_SESSION_INFO), + stringify!(CK_SESSION_INFO), "::", stringify!(state) ) @@ -1159,7 +1367,7 @@ fn bindgen_test_layout__CK_SESSION_INFO() { 8usize, concat!( "Offset of field: ", - stringify!(_CK_SESSION_INFO), + stringify!(CK_SESSION_INFO), "::", stringify!(flags) ) @@ -1169,45 +1377,48 @@ fn bindgen_test_layout__CK_SESSION_INFO() { 12usize, concat!( "Offset of field: ", - stringify!(_CK_SESSION_INFO), + stringify!(CK_SESSION_INFO), "::", stringify!(ulDeviceError) ) ); } -pub type CK_OBJECT_HANDLE = ::std::os::raw::c_ulong; -pub type CK_OBJECT_CLASS = ::std::os::raw::c_ulong; -pub type CK_HW_FEATURE_TYPE = ::std::os::raw::c_ulong; -pub type CK_KEY_TYPE = ::std::os::raw::c_ulong; -pub type CK_CERTIFICATE_TYPE = ::std::os::raw::c_ulong; -pub type CK_ATTRIBUTE_TYPE = ::std::os::raw::c_ulong; +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; +pub type CK_OBJECT_CLASS = CK_ULONG; +pub type CK_OBJECT_CLASS_PTR = *mut CK_OBJECT_CLASS; +pub type CK_HW_FEATURE_TYPE = CK_ULONG; +pub type CK_KEY_TYPE = CK_ULONG; +pub type CK_CERTIFICATE_TYPE = CK_ULONG; +pub type CK_ATTRIBUTE_TYPE = CK_ULONG; #[repr(C)] #[derive(Debug, Copy, Clone)] -pub struct _CK_ATTRIBUTE { +pub struct CK_ATTRIBUTE { pub type_: CK_ATTRIBUTE_TYPE, - pub pValue: *mut ::std::os::raw::c_void, - pub ulValueLen: ::std::os::raw::c_ulong, + pub pValue: CK_VOID_PTR, + pub ulValueLen: CK_ULONG, } #[test] -fn bindgen_test_layout__CK_ATTRIBUTE() { - const UNINIT: ::std::mem::MaybeUninit<_CK_ATTRIBUTE> = ::std::mem::MaybeUninit::uninit(); +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::<_CK_ATTRIBUTE>(), + ::std::mem::size_of::(), 12usize, - concat!("Size of: ", stringify!(_CK_ATTRIBUTE)) + concat!("Size of: ", stringify!(CK_ATTRIBUTE)) ); assert_eq!( - ::std::mem::align_of::<_CK_ATTRIBUTE>(), + ::std::mem::align_of::(), 4usize, - concat!("Alignment of ", stringify!(_CK_ATTRIBUTE)) + 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!(CK_ATTRIBUTE), "::", stringify!(type_) ) @@ -1217,7 +1428,7 @@ fn bindgen_test_layout__CK_ATTRIBUTE() { 4usize, concat!( "Offset of field: ", - stringify!(_CK_ATTRIBUTE), + stringify!(CK_ATTRIBUTE), "::", stringify!(pValue) ) @@ -1227,13 +1438,13 @@ fn bindgen_test_layout__CK_ATTRIBUTE() { 8usize, concat!( "Offset of field: ", - stringify!(_CK_ATTRIBUTE), + stringify!(CK_ATTRIBUTE), "::", stringify!(ulValueLen) ) ); } -impl Default for _CK_ATTRIBUTE { +impl Default for CK_ATTRIBUTE { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { @@ -1242,33 +1453,34 @@ impl Default for _CK_ATTRIBUTE { } } } +pub type CK_ATTRIBUTE_PTR = *mut CK_ATTRIBUTE; #[repr(C)] #[derive(Debug, Default, Copy, Clone)] -pub struct _CK_DATE { - pub year: [::std::os::raw::c_uchar; 4usize], - pub month: [::std::os::raw::c_uchar; 2usize], - pub day: [::std::os::raw::c_uchar; 2usize], +pub struct CK_DATE { + pub year: [CK_CHAR; 4usize], + pub month: [CK_CHAR; 2usize], + pub day: [CK_CHAR; 2usize], } #[test] -fn bindgen_test_layout__CK_DATE() { - const UNINIT: ::std::mem::MaybeUninit<_CK_DATE> = ::std::mem::MaybeUninit::uninit(); +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::<_CK_DATE>(), + ::std::mem::size_of::(), 8usize, - concat!("Size of: ", stringify!(_CK_DATE)) + concat!("Size of: ", stringify!(CK_DATE)) ); assert_eq!( - ::std::mem::align_of::<_CK_DATE>(), + ::std::mem::align_of::(), 1usize, - concat!("Alignment of ", stringify!(_CK_DATE)) + 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!(CK_DATE), "::", stringify!(year) ) @@ -1278,7 +1490,7 @@ fn bindgen_test_layout__CK_DATE() { 4usize, concat!( "Offset of field: ", - stringify!(_CK_DATE), + stringify!(CK_DATE), "::", stringify!(month) ) @@ -1288,40 +1500,41 @@ fn bindgen_test_layout__CK_DATE() { 6usize, concat!( "Offset of field: ", - stringify!(_CK_DATE), + stringify!(CK_DATE), "::", stringify!(day) ) ); } -pub type CK_MECHANISM_TYPE = ::std::os::raw::c_ulong; +pub type CK_MECHANISM_TYPE = CK_ULONG; +pub type CK_MECHANISM_TYPE_PTR = *mut CK_MECHANISM_TYPE; #[repr(C)] #[derive(Debug, Copy, Clone)] -pub struct _CK_MECHANISM { +pub struct CK_MECHANISM { pub mechanism: CK_MECHANISM_TYPE, - pub pParameter: *mut ::std::os::raw::c_void, - pub ulParameterLen: ::std::os::raw::c_ulong, + pub pParameter: CK_VOID_PTR, + pub ulParameterLen: CK_ULONG, } #[test] -fn bindgen_test_layout__CK_MECHANISM() { - const UNINIT: ::std::mem::MaybeUninit<_CK_MECHANISM> = ::std::mem::MaybeUninit::uninit(); +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::<_CK_MECHANISM>(), + ::std::mem::size_of::(), 12usize, - concat!("Size of: ", stringify!(_CK_MECHANISM)) + concat!("Size of: ", stringify!(CK_MECHANISM)) ); assert_eq!( - ::std::mem::align_of::<_CK_MECHANISM>(), + ::std::mem::align_of::(), 4usize, - concat!("Alignment of ", stringify!(_CK_MECHANISM)) + 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!(CK_MECHANISM), "::", stringify!(mechanism) ) @@ -1331,7 +1544,7 @@ fn bindgen_test_layout__CK_MECHANISM() { 4usize, concat!( "Offset of field: ", - stringify!(_CK_MECHANISM), + stringify!(CK_MECHANISM), "::", stringify!(pParameter) ) @@ -1341,13 +1554,13 @@ fn bindgen_test_layout__CK_MECHANISM() { 8usize, concat!( "Offset of field: ", - stringify!(_CK_MECHANISM), + stringify!(CK_MECHANISM), "::", stringify!(ulParameterLen) ) ); } -impl Default for _CK_MECHANISM { +impl Default for CK_MECHANISM { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { @@ -1356,33 +1569,34 @@ impl Default for _CK_MECHANISM { } } } +pub type CK_MECHANISM_PTR = *mut CK_MECHANISM; #[repr(C)] #[derive(Debug, Default, Copy, Clone)] -pub struct _CK_MECHANISM_INFO { - pub ulMinKeySize: ::std::os::raw::c_ulong, - pub ulMaxKeySize: ::std::os::raw::c_ulong, +pub struct CK_MECHANISM_INFO { + pub ulMinKeySize: CK_ULONG, + pub ulMaxKeySize: CK_ULONG, pub flags: CK_FLAGS, } #[test] -fn bindgen_test_layout__CK_MECHANISM_INFO() { - const UNINIT: ::std::mem::MaybeUninit<_CK_MECHANISM_INFO> = ::std::mem::MaybeUninit::uninit(); +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::<_CK_MECHANISM_INFO>(), + ::std::mem::size_of::(), 12usize, - concat!("Size of: ", stringify!(_CK_MECHANISM_INFO)) + concat!("Size of: ", stringify!(CK_MECHANISM_INFO)) ); assert_eq!( - ::std::mem::align_of::<_CK_MECHANISM_INFO>(), + ::std::mem::align_of::(), 4usize, - concat!("Alignment of ", stringify!(_CK_MECHANISM_INFO)) + 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!(CK_MECHANISM_INFO), "::", stringify!(ulMinKeySize) ) @@ -1392,7 +1606,7 @@ fn bindgen_test_layout__CK_MECHANISM_INFO() { 4usize, concat!( "Offset of field: ", - stringify!(_CK_MECHANISM_INFO), + stringify!(CK_MECHANISM_INFO), "::", stringify!(ulMaxKeySize) ) @@ -1402,66 +1616,78 @@ fn bindgen_test_layout__CK_MECHANISM_INFO() { 8usize, concat!( "Offset of field: ", - stringify!(_CK_MECHANISM_INFO), + stringify!(CK_MECHANISM_INFO), "::", stringify!(flags) ) ); } -pub type CK_PARAM_TYPE = ::std::os::raw::c_ulong; +pub type CK_MECHANISM_INFO_PTR = *mut CK_MECHANISM_INFO; +pub type CK_RV = CK_ULONG; +pub type CK_NOTIFY = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + event: CK_NOTIFICATION, + pApplication: CK_VOID_PTR, + ) -> CK_RV, +>; +pub type CK_FUNCTION_LIST_PTR = *mut CK_FUNCTION_LIST; +pub type CK_FUNCTION_LIST_3_0_PTR = *mut CK_FUNCTION_LIST_3_0; +pub type CK_FUNCTION_LIST_PTR_PTR = *mut CK_FUNCTION_LIST_PTR; +pub type CK_FUNCTION_LIST_3_0_PTR_PTR = *mut CK_FUNCTION_LIST_3_0_PTR; #[repr(C)] #[derive(Debug, Copy, Clone)] -pub struct CK_OTP_PARAM { - pub type_: CK_PARAM_TYPE, - pub pValue: *mut ::std::os::raw::c_void, - pub ulValueLen: ::std::os::raw::c_ulong, +pub struct CK_INTERFACE { + pub pInterfaceName: *mut CK_CHAR, + pub pFunctionList: CK_VOID_PTR, + pub flags: CK_FLAGS, } #[test] -fn bindgen_test_layout_CK_OTP_PARAM() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); +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::(), + ::std::mem::size_of::(), 12usize, - concat!("Size of: ", stringify!(CK_OTP_PARAM)) + concat!("Size of: ", stringify!(CK_INTERFACE)) ); assert_eq!( - ::std::mem::align_of::(), + ::std::mem::align_of::(), 4usize, - concat!("Alignment of ", stringify!(CK_OTP_PARAM)) + concat!("Alignment of ", stringify!(CK_INTERFACE)) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).type_) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).pInterfaceName) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", - stringify!(CK_OTP_PARAM), + stringify!(CK_INTERFACE), "::", - stringify!(type_) + stringify!(pInterfaceName) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pValue) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).pFunctionList) as usize - ptr as usize }, 4usize, concat!( "Offset of field: ", - stringify!(CK_OTP_PARAM), + stringify!(CK_INTERFACE), "::", - stringify!(pValue) + stringify!(pFunctionList) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulValueLen) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).flags) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", - stringify!(CK_OTP_PARAM), + stringify!(CK_INTERFACE), "::", - stringify!(ulValueLen) + stringify!(flags) ) ); } -impl Default for CK_OTP_PARAM { +impl Default for CK_INTERFACE { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { @@ -1470,99 +1696,100 @@ impl Default for CK_OTP_PARAM { } } } +pub type CK_INTERFACE_PTR = *mut CK_INTERFACE; +pub type CK_INTERFACE_PTR_PTR = *mut CK_INTERFACE_PTR; +pub type CK_CREATEMUTEX = + ::std::option::Option CK_RV>; +pub type CK_DESTROYMUTEX = + ::std::option::Option CK_RV>; +pub type CK_LOCKMUTEX = ::std::option::Option CK_RV>; +pub type CK_UNLOCKMUTEX = ::std::option::Option CK_RV>; #[repr(C)] #[derive(Debug, Copy, Clone)] -pub struct CK_OTP_PARAMS { - pub pParams: *mut CK_OTP_PARAM, - pub ulCount: ::std::os::raw::c_ulong, +pub struct CK_C_INITIALIZE_ARGS { + pub CreateMutex: CK_CREATEMUTEX, + pub DestroyMutex: CK_DESTROYMUTEX, + pub LockMutex: CK_LOCKMUTEX, + pub UnlockMutex: CK_UNLOCKMUTEX, + pub flags: CK_FLAGS, + pub pReserved: CK_VOID_PTR, } #[test] -fn bindgen_test_layout_CK_OTP_PARAMS() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); +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::(), - 8usize, - concat!("Size of: ", stringify!(CK_OTP_PARAMS)) + ::std::mem::size_of::(), + 24usize, + concat!("Size of: ", stringify!(CK_C_INITIALIZE_ARGS)) ); assert_eq!( - ::std::mem::align_of::(), + ::std::mem::align_of::(), 4usize, - concat!("Alignment of ", stringify!(CK_OTP_PARAMS)) + concat!("Alignment of ", stringify!(CK_C_INITIALIZE_ARGS)) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pParams) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).CreateMutex) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", - stringify!(CK_OTP_PARAMS), + stringify!(CK_C_INITIALIZE_ARGS), "::", - stringify!(pParams) + stringify!(CreateMutex) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulCount) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).DestroyMutex) as usize - ptr as usize }, 4usize, concat!( "Offset of field: ", - stringify!(CK_OTP_PARAMS), + stringify!(CK_C_INITIALIZE_ARGS), "::", - stringify!(ulCount) + stringify!(DestroyMutex) ) ); -} -impl Default for CK_OTP_PARAMS { - fn default() -> Self { - let mut s = ::std::mem::MaybeUninit::::uninit(); - unsafe { - ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct CK_OTP_SIGNATURE_INFO { - pub pParams: *mut CK_OTP_PARAM, - pub ulCount: ::std::os::raw::c_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::(), + unsafe { ::std::ptr::addr_of!((*ptr).LockMutex) as usize - ptr as usize }, 8usize, - concat!("Size of: ", stringify!(CK_OTP_SIGNATURE_INFO)) + concat!( + "Offset of field: ", + stringify!(CK_C_INITIALIZE_ARGS), + "::", + stringify!(LockMutex) + ) ); assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(CK_OTP_SIGNATURE_INFO)) + unsafe { ::std::ptr::addr_of!((*ptr).UnlockMutex) as usize - ptr as usize }, + 12usize, + concat!( + "Offset of field: ", + stringify!(CK_C_INITIALIZE_ARGS), + "::", + stringify!(UnlockMutex) + ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pParams) as usize - ptr as usize }, - 0usize, + unsafe { ::std::ptr::addr_of!((*ptr).flags) as usize - ptr as usize }, + 16usize, concat!( "Offset of field: ", - stringify!(CK_OTP_SIGNATURE_INFO), + stringify!(CK_C_INITIALIZE_ARGS), "::", - stringify!(pParams) + stringify!(flags) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulCount) as usize - ptr as usize }, - 4usize, + unsafe { ::std::ptr::addr_of!((*ptr).pReserved) as usize - ptr as usize }, + 20usize, concat!( "Offset of field: ", - stringify!(CK_OTP_SIGNATURE_INFO), + stringify!(CK_C_INITIALIZE_ARGS), "::", - stringify!(ulCount) + stringify!(pReserved) ) ); } -impl Default for CK_OTP_SIGNATURE_INFO { +impl Default for CK_C_INITIALIZE_ARGS { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { @@ -1571,35 +1798,41 @@ impl Default for CK_OTP_SIGNATURE_INFO { } } } -pub type CK_RSA_PKCS_MGF_TYPE = ::std::os::raw::c_ulong; +pub type CK_C_INITIALIZE_ARGS_PTR = *mut CK_C_INITIALIZE_ARGS; +pub type CK_RSA_PKCS_MGF_TYPE = CK_ULONG; +pub type CK_RSA_PKCS_MGF_TYPE_PTR = *mut CK_RSA_PKCS_MGF_TYPE; +pub type CK_RSA_PKCS_OAEP_SOURCE_TYPE = CK_ULONG; +pub type CK_RSA_PKCS_OAEP_SOURCE_TYPE_PTR = *mut CK_RSA_PKCS_OAEP_SOURCE_TYPE; #[repr(C)] -#[derive(Debug, Default, Copy, Clone)] -pub struct ck_rsa_pkcs_pss_params { +#[derive(Debug, Copy, Clone)] +pub struct CK_RSA_PKCS_OAEP_PARAMS { pub hashAlg: CK_MECHANISM_TYPE, pub mgf: CK_RSA_PKCS_MGF_TYPE, - pub sLen: ::std::os::raw::c_ulong, + pub source: CK_RSA_PKCS_OAEP_SOURCE_TYPE, + pub pSourceData: CK_VOID_PTR, + pub ulSourceDataLen: CK_ULONG, } #[test] -fn bindgen_test_layout_ck_rsa_pkcs_pss_params() { - const UNINIT: ::std::mem::MaybeUninit = +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::(), - 12usize, - concat!("Size of: ", stringify!(ck_rsa_pkcs_pss_params)) + ::std::mem::size_of::(), + 20usize, + concat!("Size of: ", stringify!(CK_RSA_PKCS_OAEP_PARAMS)) ); assert_eq!( - ::std::mem::align_of::(), + ::std::mem::align_of::(), 4usize, - concat!("Alignment of ", stringify!(ck_rsa_pkcs_pss_params)) + 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_pss_params), + stringify!(CK_RSA_PKCS_OAEP_PARAMS), "::", stringify!(hashAlg) ) @@ -1609,75 +1842,19 @@ fn bindgen_test_layout_ck_rsa_pkcs_pss_params() { 4usize, concat!( "Offset of field: ", - stringify!(ck_rsa_pkcs_pss_params), + stringify!(CK_RSA_PKCS_OAEP_PARAMS), "::", stringify!(mgf) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).sLen) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).source) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", - stringify!(ck_rsa_pkcs_pss_params), + stringify!(CK_RSA_PKCS_OAEP_PARAMS), "::", - stringify!(sLen) - ) - ); -} -pub type CK_RSA_PKCS_OAEP_SOURCE_TYPE = ::std::os::raw::c_ulong; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct ck_rsa_pkcs_oaep_params { - pub hashAlg: CK_MECHANISM_TYPE, - pub mgf: CK_RSA_PKCS_MGF_TYPE, - pub source: CK_RSA_PKCS_OAEP_SOURCE_TYPE, - pub pSourceData: *mut ::std::os::raw::c_void, - pub ulSourceDataLen: ::std::os::raw::c_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::(), - 20usize, - concat!("Size of: ", stringify!(ck_rsa_pkcs_oaep_params)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - 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) + stringify!(source) ) ); assert_eq!( @@ -1685,7 +1862,7 @@ fn bindgen_test_layout_ck_rsa_pkcs_oaep_params() { 12usize, concat!( "Offset of field: ", - stringify!(ck_rsa_pkcs_oaep_params), + stringify!(CK_RSA_PKCS_OAEP_PARAMS), "::", stringify!(pSourceData) ) @@ -1695,13 +1872,13 @@ fn bindgen_test_layout_ck_rsa_pkcs_oaep_params() { 16usize, concat!( "Offset of field: ", - stringify!(ck_rsa_pkcs_oaep_params), + stringify!(CK_RSA_PKCS_OAEP_PARAMS), "::", stringify!(ulSourceDataLen) ) ); } -impl Default for ck_rsa_pkcs_oaep_params { +impl Default for CK_RSA_PKCS_OAEP_PARAMS { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { @@ -1710,133 +1887,138 @@ impl Default for ck_rsa_pkcs_oaep_params { } } } +pub type CK_RSA_PKCS_OAEP_PARAMS_PTR = *mut CK_RSA_PKCS_OAEP_PARAMS; #[repr(C)] #[derive(Debug, Default, Copy, Clone)] -pub struct ck_aes_ctr_params { - pub ulCounterBits: ::std::os::raw::c_ulong, - pub cb: [::std::os::raw::c_uchar; 16usize], +pub struct CK_RSA_PKCS_PSS_PARAMS { + pub hashAlg: CK_MECHANISM_TYPE, + pub mgf: CK_RSA_PKCS_MGF_TYPE, + pub sLen: CK_ULONG, } #[test] -fn bindgen_test_layout_ck_aes_ctr_params() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); +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::(), - 20usize, - concat!("Size of: ", stringify!(ck_aes_ctr_params)) + ::std::mem::size_of::(), + 12usize, + concat!("Size of: ", stringify!(CK_RSA_PKCS_PSS_PARAMS)) ); assert_eq!( - ::std::mem::align_of::(), + ::std::mem::align_of::(), 4usize, - concat!("Alignment of ", stringify!(ck_aes_ctr_params)) + concat!("Alignment of ", stringify!(CK_RSA_PKCS_PSS_PARAMS)) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulCounterBits) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).hashAlg) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", - stringify!(ck_aes_ctr_params), + stringify!(CK_RSA_PKCS_PSS_PARAMS), "::", - stringify!(ulCounterBits) + stringify!(hashAlg) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).cb) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).mgf) as usize - ptr as usize }, 4usize, concat!( "Offset of field: ", - stringify!(ck_aes_ctr_params), + stringify!(CK_RSA_PKCS_PSS_PARAMS), "::", - stringify!(cb) + 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) ) ); } +pub type CK_RSA_PKCS_PSS_PARAMS_PTR = *mut CK_RSA_PKCS_PSS_PARAMS; +pub type CK_EC_KDF_TYPE = CK_ULONG; #[repr(C)] #[derive(Debug, Copy, Clone)] -pub struct ck_gcm_params { - pub pIv: *mut ::std::os::raw::c_uchar, - pub ulIvLen: ::std::os::raw::c_ulong, - pub ulIvBits: ::std::os::raw::c_ulong, - pub pAAD: *mut ::std::os::raw::c_uchar, - pub ulAADLen: ::std::os::raw::c_ulong, - pub ulTagBits: ::std::os::raw::c_ulong, +pub struct CK_ECDH1_DERIVE_PARAMS { + pub kdf: CK_EC_KDF_TYPE, + pub ulSharedDataLen: CK_ULONG, + pub pSharedData: CK_BYTE_PTR, + pub ulPublicDataLen: CK_ULONG, + pub pPublicData: CK_BYTE_PTR, } #[test] -fn bindgen_test_layout_ck_gcm_params() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); +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::(), - 24usize, - concat!("Size of: ", stringify!(ck_gcm_params)) + ::std::mem::size_of::(), + 20usize, + concat!("Size of: ", stringify!(CK_ECDH1_DERIVE_PARAMS)) ); assert_eq!( - ::std::mem::align_of::(), + ::std::mem::align_of::(), 4usize, - concat!("Alignment of ", stringify!(ck_gcm_params)) + concat!("Alignment of ", stringify!(CK_ECDH1_DERIVE_PARAMS)) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pIv) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).kdf) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", - stringify!(ck_gcm_params), + stringify!(CK_ECDH1_DERIVE_PARAMS), "::", - stringify!(pIv) + stringify!(kdf) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulIvLen) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ulSharedDataLen) as usize - ptr as usize }, 4usize, concat!( "Offset of field: ", - stringify!(ck_gcm_params), + stringify!(CK_ECDH1_DERIVE_PARAMS), "::", - stringify!(ulIvLen) + stringify!(ulSharedDataLen) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulIvBits) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).pSharedData) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", - stringify!(ck_gcm_params), + stringify!(CK_ECDH1_DERIVE_PARAMS), "::", - stringify!(ulIvBits) + stringify!(pSharedData) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pAAD) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ulPublicDataLen) as usize - ptr as usize }, 12usize, concat!( "Offset of field: ", - stringify!(ck_gcm_params), + stringify!(CK_ECDH1_DERIVE_PARAMS), "::", - stringify!(pAAD) + stringify!(ulPublicDataLen) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulAADLen) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).pPublicData) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", - stringify!(ck_gcm_params), - "::", - stringify!(ulAADLen) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulTagBits) as usize - ptr as usize }, - 20usize, - concat!( - "Offset of field: ", - stringify!(ck_gcm_params), + stringify!(CK_ECDH1_DERIVE_PARAMS), "::", - stringify!(ulTagBits) + stringify!(pPublicData) ) ); } -impl Default for ck_gcm_params { +impl Default for CK_ECDH1_DERIVE_PARAMS { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { @@ -1845,37 +2027,41 @@ impl Default for ck_gcm_params { } } } -pub type ck_ec_kdf_t = ::std::os::raw::c_ulong; +pub type CK_ECDH1_DERIVE_PARAMS_PTR = *mut CK_ECDH1_DERIVE_PARAMS; #[repr(C)] #[derive(Debug, Copy, Clone)] -pub struct ck_ecdh1_derive_params { - pub kdf: ck_ec_kdf_t, - pub ulSharedDataLen: ::std::os::raw::c_ulong, - pub pSharedData: *mut ::std::os::raw::c_uchar, - pub ulPublicDataLen: ::std::os::raw::c_ulong, - pub pPublicData: *mut ::std::os::raw::c_uchar, +pub struct CK_ECDH2_DERIVE_PARAMS { + pub kdf: CK_EC_KDF_TYPE, + pub ulSharedDataLen: CK_ULONG, + pub pSharedData: CK_BYTE_PTR, + pub ulPublicDataLen: CK_ULONG, + pub pPublicData: CK_BYTE_PTR, + pub ulPrivateDataLen: CK_ULONG, + pub hPrivateData: CK_OBJECT_HANDLE, + pub ulPublicDataLen2: CK_ULONG, + pub pPublicData2: CK_BYTE_PTR, } #[test] -fn bindgen_test_layout_ck_ecdh1_derive_params() { - const UNINIT: ::std::mem::MaybeUninit = +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::(), - 20usize, - concat!("Size of: ", stringify!(ck_ecdh1_derive_params)) + ::std::mem::size_of::(), + 36usize, + concat!("Size of: ", stringify!(CK_ECDH2_DERIVE_PARAMS)) ); assert_eq!( - ::std::mem::align_of::(), + ::std::mem::align_of::(), 4usize, - concat!("Alignment of ", stringify!(ck_ecdh1_derive_params)) + 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_ecdh1_derive_params), + stringify!(CK_ECDH2_DERIVE_PARAMS), "::", stringify!(kdf) ) @@ -1885,7 +2071,7 @@ fn bindgen_test_layout_ck_ecdh1_derive_params() { 4usize, concat!( "Offset of field: ", - stringify!(ck_ecdh1_derive_params), + stringify!(CK_ECDH2_DERIVE_PARAMS), "::", stringify!(ulSharedDataLen) ) @@ -1895,7 +2081,7 @@ fn bindgen_test_layout_ck_ecdh1_derive_params() { 8usize, concat!( "Offset of field: ", - stringify!(ck_ecdh1_derive_params), + stringify!(CK_ECDH2_DERIVE_PARAMS), "::", stringify!(pSharedData) ) @@ -1905,7 +2091,7 @@ fn bindgen_test_layout_ck_ecdh1_derive_params() { 12usize, concat!( "Offset of field: ", - stringify!(ck_ecdh1_derive_params), + stringify!(CK_ECDH2_DERIVE_PARAMS), "::", stringify!(ulPublicDataLen) ) @@ -1915,13 +2101,53 @@ fn bindgen_test_layout_ck_ecdh1_derive_params() { 16usize, concat!( "Offset of field: ", - stringify!(ck_ecdh1_derive_params), + stringify!(CK_ECDH2_DERIVE_PARAMS), "::", stringify!(pPublicData) ) ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ulPrivateDataLen) as usize - ptr as usize }, + 20usize, + 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 }, + 24usize, + 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 }, + 28usize, + 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 }, + 32usize, + concat!( + "Offset of field: ", + stringify!(CK_ECDH2_DERIVE_PARAMS), + "::", + stringify!(pPublicData2) + ) + ); } -impl Default for ck_ecdh1_derive_params { +impl Default for CK_ECDH2_DERIVE_PARAMS { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { @@ -1930,49 +2156,138 @@ impl Default for ck_ecdh1_derive_params { } } } +pub type CK_ECDH2_DERIVE_PARAMS_PTR = *mut CK_ECDH2_DERIVE_PARAMS; #[repr(C)] #[derive(Debug, Copy, Clone)] -pub struct ck_key_derivation_string_data { - pub pData: *mut ::std::os::raw::c_uchar, - pub ulLen: ::std::os::raw::c_ulong, +pub struct CK_ECMQV_DERIVE_PARAMS { + pub kdf: CK_EC_KDF_TYPE, + pub ulSharedDataLen: CK_ULONG, + pub pSharedData: CK_BYTE_PTR, + pub ulPublicDataLen: CK_ULONG, + pub pPublicData: CK_BYTE_PTR, + pub ulPrivateDataLen: CK_ULONG, + pub hPrivateData: CK_OBJECT_HANDLE, + pub ulPublicDataLen2: CK_ULONG, + pub pPublicData2: CK_BYTE_PTR, + pub publicKey: CK_OBJECT_HANDLE, } #[test] -fn bindgen_test_layout_ck_key_derivation_string_data() { - const UNINIT: ::std::mem::MaybeUninit = +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::(), - 8usize, - concat!("Size of: ", stringify!(ck_key_derivation_string_data)) + ::std::mem::size_of::(), + 40usize, + concat!("Size of: ", stringify!(CK_ECMQV_DERIVE_PARAMS)) ); assert_eq!( - ::std::mem::align_of::(), + ::std::mem::align_of::(), 4usize, - concat!("Alignment of ", stringify!(ck_key_derivation_string_data)) + concat!("Alignment of ", stringify!(CK_ECMQV_DERIVE_PARAMS)) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pData) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).kdf) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", - stringify!(ck_key_derivation_string_data), + stringify!(CK_ECMQV_DERIVE_PARAMS), "::", - stringify!(pData) + stringify!(kdf) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulLen) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ulSharedDataLen) as usize - ptr as usize }, 4usize, concat!( "Offset of field: ", - stringify!(ck_key_derivation_string_data), + stringify!(CK_ECMQV_DERIVE_PARAMS), "::", - stringify!(ulLen) + 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 }, + 12usize, + 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 }, + 16usize, + 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 }, + 20usize, + 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 }, + 24usize, + 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 }, + 28usize, + 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 }, + 32usize, + 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 }, + 36usize, + concat!( + "Offset of field: ", + stringify!(CK_ECMQV_DERIVE_PARAMS), + "::", + stringify!(publicKey) ) ); } -impl Default for ck_key_derivation_string_data { +impl Default for CK_ECMQV_DERIVE_PARAMS { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { @@ -1981,60 +2296,85 @@ impl Default for ck_key_derivation_string_data { } } } +pub type CK_ECMQV_DERIVE_PARAMS_PTR = *mut CK_ECMQV_DERIVE_PARAMS; +pub type CK_X9_42_DH_KDF_TYPE = CK_ULONG; +pub type CK_X9_42_DH_KDF_TYPE_PTR = *mut CK_X9_42_DH_KDF_TYPE; #[repr(C)] #[derive(Debug, Copy, Clone)] -pub struct ck_des_cbc_encrypt_data_params { - pub iv: [::std::os::raw::c_uchar; 8usize], - pub pData: *mut ::std::os::raw::c_uchar, - pub length: ::std::os::raw::c_ulong, +pub struct CK_X9_42_DH1_DERIVE_PARAMS { + pub kdf: CK_X9_42_DH_KDF_TYPE, + pub ulOtherInfoLen: CK_ULONG, + pub pOtherInfo: CK_BYTE_PTR, + pub ulPublicDataLen: CK_ULONG, + pub pPublicData: CK_BYTE_PTR, } #[test] -fn bindgen_test_layout_ck_des_cbc_encrypt_data_params() { - const UNINIT: ::std::mem::MaybeUninit = +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::(), - 16usize, - concat!("Size of: ", stringify!(ck_des_cbc_encrypt_data_params)) + ::std::mem::size_of::(), + 20usize, + concat!("Size of: ", stringify!(CK_X9_42_DH1_DERIVE_PARAMS)) ); assert_eq!( - ::std::mem::align_of::(), + ::std::mem::align_of::(), 4usize, - concat!("Alignment of ", stringify!(ck_des_cbc_encrypt_data_params)) + concat!("Alignment of ", stringify!(CK_X9_42_DH1_DERIVE_PARAMS)) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).iv) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).kdf) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", - stringify!(ck_des_cbc_encrypt_data_params), + stringify!(CK_X9_42_DH1_DERIVE_PARAMS), "::", - stringify!(iv) + stringify!(kdf) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pData) as usize - ptr as usize }, + 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_des_cbc_encrypt_data_params), + stringify!(CK_X9_42_DH1_DERIVE_PARAMS), "::", - stringify!(pData) + stringify!(pOtherInfo) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).length) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ulPublicDataLen) as usize - ptr as usize }, 12usize, concat!( "Offset of field: ", - stringify!(ck_des_cbc_encrypt_data_params), + stringify!(CK_X9_42_DH1_DERIVE_PARAMS), "::", - stringify!(length) + stringify!(ulPublicDataLen) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pPublicData) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(CK_X9_42_DH1_DERIVE_PARAMS), + "::", + stringify!(pPublicData) ) ); } -impl Default for ck_des_cbc_encrypt_data_params { +impl Default for CK_X9_42_DH1_DERIVE_PARAMS { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { @@ -2043,540 +2383,7363 @@ impl Default for ck_des_cbc_encrypt_data_params { } } } +pub type CK_X9_42_DH1_DERIVE_PARAMS_PTR = *mut CK_X9_42_DH1_DERIVE_PARAMS; #[repr(C)] #[derive(Debug, Copy, Clone)] -pub struct ck_aes_cbc_encrypt_data_params { - pub iv: [::std::os::raw::c_uchar; 16usize], - pub pData: *mut ::std::os::raw::c_uchar, - pub length: ::std::os::raw::c_ulong, +pub struct CK_X9_42_DH2_DERIVE_PARAMS { + pub kdf: CK_X9_42_DH_KDF_TYPE, + pub ulOtherInfoLen: CK_ULONG, + pub pOtherInfo: CK_BYTE_PTR, + pub ulPublicDataLen: CK_ULONG, + pub pPublicData: CK_BYTE_PTR, + pub ulPrivateDataLen: CK_ULONG, + pub hPrivateData: CK_OBJECT_HANDLE, + pub ulPublicDataLen2: CK_ULONG, + pub pPublicData2: CK_BYTE_PTR, } #[test] -fn bindgen_test_layout_ck_aes_cbc_encrypt_data_params() { - const UNINIT: ::std::mem::MaybeUninit = +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::(), - 24usize, - concat!("Size of: ", stringify!(ck_aes_cbc_encrypt_data_params)) + ::std::mem::size_of::(), + 36usize, + concat!("Size of: ", stringify!(CK_X9_42_DH2_DERIVE_PARAMS)) ); assert_eq!( - ::std::mem::align_of::(), + ::std::mem::align_of::(), 4usize, - concat!("Alignment of ", stringify!(ck_aes_cbc_encrypt_data_params)) + concat!("Alignment of ", stringify!(CK_X9_42_DH2_DERIVE_PARAMS)) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).iv) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).kdf) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", - stringify!(ck_aes_cbc_encrypt_data_params), + stringify!(CK_X9_42_DH2_DERIVE_PARAMS), "::", - stringify!(iv) + stringify!(kdf) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pData) as usize - ptr as usize }, + 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 }, + 12usize, + 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 }, 16usize, concat!( "Offset of field: ", - stringify!(ck_aes_cbc_encrypt_data_params), + stringify!(CK_X9_42_DH2_DERIVE_PARAMS), "::", - stringify!(pData) + stringify!(pPublicData) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).length) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ulPrivateDataLen) as usize - ptr as usize }, 20usize, concat!( "Offset of field: ", - stringify!(ck_aes_cbc_encrypt_data_params), + stringify!(CK_X9_42_DH2_DERIVE_PARAMS), "::", - stringify!(length) + stringify!(ulPrivateDataLen) ) ); -} -impl Default for ck_aes_cbc_encrypt_data_params { - fn default() -> Self { - let mut s = ::std::mem::MaybeUninit::::uninit(); - unsafe { - ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).hPrivateData) as usize - ptr as usize }, + 24usize, + 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 }, + 28usize, + 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 }, + 32usize, + concat!( + "Offset of field: ", + stringify!(CK_X9_42_DH2_DERIVE_PARAMS), + "::", + stringify!(pPublicData2) + ) + ); +} +impl Default for CK_X9_42_DH2_DERIVE_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } } } -pub type CK_RV = ::std::os::raw::c_ulong; -pub type CK_NOTIFY = ::std::option::Option< - unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - event: CK_NOTIFICATION, - application: *mut ::std::os::raw::c_void, - ) -> CK_RV, ->; -pub type CK_C_Initialize = - ::std::option::Option CK_RV>; -pub type CK_C_Finalize = - ::std::option::Option CK_RV>; -pub type CK_C_GetInfo = ::std::option::Option CK_RV>; -pub type CK_C_GetFunctionList = ::std::option::Option< - unsafe extern "C" fn(function_list: *mut *mut _CK_FUNCTION_LIST) -> CK_RV, ->; -pub type CK_C_GetSlotList = ::std::option::Option< - unsafe extern "C" fn( - token_present: ::std::os::raw::c_uchar, - slot_list: *mut CK_SLOT_ID, - ulCount: *mut ::std::os::raw::c_ulong, - ) -> CK_RV, ->; -pub type CK_C_GetSlotInfo = ::std::option::Option< - unsafe extern "C" fn(slotID: CK_SLOT_ID, info: *mut _CK_SLOT_INFO) -> CK_RV, ->; -pub type CK_C_GetTokenInfo = ::std::option::Option< - unsafe extern "C" fn(slotID: CK_SLOT_ID, info: *mut _CK_TOKEN_INFO) -> CK_RV, ->; -pub type CK_C_WaitForSlotEvent = ::std::option::Option< - unsafe extern "C" fn( - flags: CK_FLAGS, - slot: *mut CK_SLOT_ID, - pReserved: *mut ::std::os::raw::c_void, - ) -> CK_RV, ->; -pub type CK_C_GetMechanismList = ::std::option::Option< - unsafe extern "C" fn( - slotID: CK_SLOT_ID, - mechanism_list: *mut CK_MECHANISM_TYPE, - ulCount: *mut ::std::os::raw::c_ulong, - ) -> CK_RV, ->; -pub type CK_C_GetMechanismInfo = ::std::option::Option< - unsafe extern "C" fn( - slotID: CK_SLOT_ID, - type_: CK_MECHANISM_TYPE, - info: *mut _CK_MECHANISM_INFO, - ) -> CK_RV, ->; -pub type CK_C_InitToken = ::std::option::Option< - unsafe extern "C" fn( - slotID: CK_SLOT_ID, - pin: *mut ::std::os::raw::c_uchar, - pin_len: ::std::os::raw::c_ulong, - label: *mut ::std::os::raw::c_uchar, - ) -> CK_RV, ->; -pub type CK_C_InitPIN = ::std::option::Option< - unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - pin: *mut ::std::os::raw::c_uchar, - pin_len: ::std::os::raw::c_ulong, - ) -> CK_RV, ->; -pub type CK_C_SetPIN = ::std::option::Option< - unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - old_pin: *mut ::std::os::raw::c_uchar, - old_len: ::std::os::raw::c_ulong, - new_pin: *mut ::std::os::raw::c_uchar, - new_len: ::std::os::raw::c_ulong, - ) -> CK_RV, ->; -pub type CK_C_OpenSession = ::std::option::Option< - unsafe extern "C" fn( - slotID: CK_SLOT_ID, - flags: CK_FLAGS, - application: *mut ::std::os::raw::c_void, - notify: CK_NOTIFY, - session: *mut CK_SESSION_HANDLE, - ) -> CK_RV, ->; -pub type CK_C_CloseSession = - ::std::option::Option CK_RV>; -pub type CK_C_CloseAllSessions = - ::std::option::Option CK_RV>; -pub type CK_C_GetSessionInfo = ::std::option::Option< - unsafe extern "C" fn(session: CK_SESSION_HANDLE, info: *mut _CK_SESSION_INFO) -> CK_RV, ->; -pub type CK_C_GetOperationState = ::std::option::Option< - unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - operation_state: *mut ::std::os::raw::c_uchar, - operation_state_len: *mut ::std::os::raw::c_ulong, - ) -> CK_RV, ->; -pub type CK_C_SetOperationState = ::std::option::Option< - unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - operation_state: *mut ::std::os::raw::c_uchar, - operation_state_len: ::std::os::raw::c_ulong, - encryption_key: CK_OBJECT_HANDLE, - authentiation_key: CK_OBJECT_HANDLE, - ) -> CK_RV, ->; -pub type CK_C_Login = ::std::option::Option< - unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - user_type: CK_USER_TYPE, - pin: *mut ::std::os::raw::c_uchar, - pin_len: ::std::os::raw::c_ulong, - ) -> CK_RV, ->; -pub type CK_C_Logout = - ::std::option::Option CK_RV>; -pub type CK_C_CreateObject = ::std::option::Option< - unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - templ: *mut _CK_ATTRIBUTE, - ulCount: ::std::os::raw::c_ulong, - object: *mut CK_OBJECT_HANDLE, - ) -> CK_RV, ->; -pub type CK_C_CopyObject = ::std::option::Option< - unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - object: CK_OBJECT_HANDLE, - templ: *mut _CK_ATTRIBUTE, - ulCount: ::std::os::raw::c_ulong, - new_object: *mut CK_OBJECT_HANDLE, - ) -> CK_RV, ->; -pub type CK_C_DestroyObject = ::std::option::Option< - unsafe extern "C" fn(session: CK_SESSION_HANDLE, object: CK_OBJECT_HANDLE) -> CK_RV, ->; -pub type CK_C_GetObjectSize = ::std::option::Option< - unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - object: CK_OBJECT_HANDLE, - size: *mut ::std::os::raw::c_ulong, - ) -> CK_RV, ->; -pub type CK_C_GetAttributeValue = ::std::option::Option< - unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - object: CK_OBJECT_HANDLE, - templ: *mut _CK_ATTRIBUTE, - ulCount: ::std::os::raw::c_ulong, - ) -> CK_RV, ->; -pub type CK_C_SetAttributeValue = ::std::option::Option< - unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - object: CK_OBJECT_HANDLE, - templ: *mut _CK_ATTRIBUTE, - ulCount: ::std::os::raw::c_ulong, - ) -> CK_RV, ->; -pub type CK_C_FindObjectsInit = ::std::option::Option< - unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - templ: *mut _CK_ATTRIBUTE, - ulCount: ::std::os::raw::c_ulong, - ) -> CK_RV, ->; -pub type CK_C_FindObjects = ::std::option::Option< - unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - object: *mut CK_OBJECT_HANDLE, - max_object_count: ::std::os::raw::c_ulong, - object_count: *mut ::std::os::raw::c_ulong, - ) -> CK_RV, ->; -pub type CK_C_FindObjectsFinal = - ::std::option::Option CK_RV>; -pub type CK_C_EncryptInit = ::std::option::Option< - unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - key: CK_OBJECT_HANDLE, - ) -> CK_RV, ->; -pub type CK_C_Encrypt = ::std::option::Option< - unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - data: *mut ::std::os::raw::c_uchar, - data_len: ::std::os::raw::c_ulong, - encrypted_data: *mut ::std::os::raw::c_uchar, - encrypted_data_len: *mut ::std::os::raw::c_ulong, - ) -> CK_RV, ->; -pub type CK_C_EncryptUpdate = ::std::option::Option< - unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - part: *mut ::std::os::raw::c_uchar, - part_len: ::std::os::raw::c_ulong, - encrypted_part: *mut ::std::os::raw::c_uchar, - encrypted_part_len: *mut ::std::os::raw::c_ulong, - ) -> CK_RV, ->; -pub type CK_C_EncryptFinal = ::std::option::Option< - unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - last_encrypted_part: *mut ::std::os::raw::c_uchar, - last_encrypted_part_len: *mut ::std::os::raw::c_ulong, - ) -> CK_RV, ->; -pub type CK_C_DecryptInit = ::std::option::Option< - unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - key: CK_OBJECT_HANDLE, - ) -> CK_RV, ->; -pub type CK_C_Decrypt = ::std::option::Option< - unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - encrypted_data: *mut ::std::os::raw::c_uchar, - encrypted_data_len: ::std::os::raw::c_ulong, - data: *mut ::std::os::raw::c_uchar, - data_len: *mut ::std::os::raw::c_ulong, - ) -> CK_RV, ->; -pub type CK_C_DecryptUpdate = ::std::option::Option< - unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - encrypted_part: *mut ::std::os::raw::c_uchar, - encrypted_part_len: ::std::os::raw::c_ulong, - part: *mut ::std::os::raw::c_uchar, - part_len: *mut ::std::os::raw::c_ulong, - ) -> CK_RV, ->; -pub type CK_C_DecryptFinal = ::std::option::Option< - unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - last_part: *mut ::std::os::raw::c_uchar, - last_part_len: *mut ::std::os::raw::c_ulong, - ) -> CK_RV, ->; -pub type CK_C_DigestInit = ::std::option::Option< - unsafe extern "C" fn(session: CK_SESSION_HANDLE, mechanism: *mut _CK_MECHANISM) -> CK_RV, ->; -pub type CK_C_Digest = ::std::option::Option< - unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - data: *mut ::std::os::raw::c_uchar, - data_len: ::std::os::raw::c_ulong, - digest: *mut ::std::os::raw::c_uchar, - digest_len: *mut ::std::os::raw::c_ulong, - ) -> CK_RV, ->; -pub type CK_C_DigestUpdate = ::std::option::Option< - unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - part: *mut ::std::os::raw::c_uchar, - part_len: ::std::os::raw::c_ulong, - ) -> CK_RV, ->; -pub type CK_C_DigestKey = ::std::option::Option< - unsafe extern "C" fn(session: CK_SESSION_HANDLE, key: CK_OBJECT_HANDLE) -> CK_RV, ->; -pub type CK_C_DigestFinal = ::std::option::Option< - unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - digest: *mut ::std::os::raw::c_uchar, - digest_len: *mut ::std::os::raw::c_ulong, - ) -> CK_RV, ->; -pub type CK_C_SignInit = ::std::option::Option< - unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - key: CK_OBJECT_HANDLE, - ) -> CK_RV, ->; -pub type CK_C_Sign = ::std::option::Option< - unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - data: *mut ::std::os::raw::c_uchar, - data_len: ::std::os::raw::c_ulong, - signature: *mut ::std::os::raw::c_uchar, - signature_len: *mut ::std::os::raw::c_ulong, - ) -> CK_RV, ->; -pub type CK_C_SignUpdate = ::std::option::Option< - unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - part: *mut ::std::os::raw::c_uchar, - part_len: ::std::os::raw::c_ulong, - ) -> CK_RV, ->; -pub type CK_C_SignFinal = ::std::option::Option< - unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - signature: *mut ::std::os::raw::c_uchar, - signature_len: *mut ::std::os::raw::c_ulong, - ) -> CK_RV, ->; -pub type CK_C_SignRecoverInit = ::std::option::Option< - unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - key: CK_OBJECT_HANDLE, - ) -> CK_RV, ->; -pub type CK_C_SignRecover = ::std::option::Option< - unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - data: *mut ::std::os::raw::c_uchar, - data_len: ::std::os::raw::c_ulong, - signature: *mut ::std::os::raw::c_uchar, - signature_len: *mut ::std::os::raw::c_ulong, - ) -> CK_RV, ->; -pub type CK_C_VerifyInit = ::std::option::Option< - unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - key: CK_OBJECT_HANDLE, - ) -> CK_RV, ->; -pub type CK_C_Verify = ::std::option::Option< - unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - data: *mut ::std::os::raw::c_uchar, - data_len: ::std::os::raw::c_ulong, - signature: *mut ::std::os::raw::c_uchar, - signature_len: ::std::os::raw::c_ulong, - ) -> CK_RV, ->; -pub type CK_C_VerifyUpdate = ::std::option::Option< - unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - part: *mut ::std::os::raw::c_uchar, - part_len: ::std::os::raw::c_ulong, - ) -> CK_RV, ->; -pub type CK_C_VerifyFinal = ::std::option::Option< - unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - signature: *mut ::std::os::raw::c_uchar, - signature_len: ::std::os::raw::c_ulong, - ) -> CK_RV, ->; -pub type CK_C_VerifyRecoverInit = ::std::option::Option< - unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - key: CK_OBJECT_HANDLE, - ) -> CK_RV, ->; -pub type CK_C_VerifyRecover = ::std::option::Option< - unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - signature: *mut ::std::os::raw::c_uchar, - signature_len: ::std::os::raw::c_ulong, - data: *mut ::std::os::raw::c_uchar, - data_len: *mut ::std::os::raw::c_ulong, - ) -> CK_RV, ->; -pub type CK_C_DigestEncryptUpdate = ::std::option::Option< - unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - part: *mut ::std::os::raw::c_uchar, - part_len: ::std::os::raw::c_ulong, - encrypted_part: *mut ::std::os::raw::c_uchar, - encrypted_part_len: *mut ::std::os::raw::c_ulong, - ) -> CK_RV, ->; -pub type CK_C_DecryptDigestUpdate = ::std::option::Option< - unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - encrypted_part: *mut ::std::os::raw::c_uchar, - encrypted_part_len: ::std::os::raw::c_ulong, - part: *mut ::std::os::raw::c_uchar, - part_len: *mut ::std::os::raw::c_ulong, - ) -> CK_RV, ->; -pub type CK_C_SignEncryptUpdate = ::std::option::Option< - unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - part: *mut ::std::os::raw::c_uchar, - part_len: ::std::os::raw::c_ulong, - encrypted_part: *mut ::std::os::raw::c_uchar, - encrypted_part_len: *mut ::std::os::raw::c_ulong, - ) -> CK_RV, ->; -pub type CK_C_DecryptVerifyUpdate = ::std::option::Option< - unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - encrypted_part: *mut ::std::os::raw::c_uchar, - encrypted_part_len: ::std::os::raw::c_ulong, - part: *mut ::std::os::raw::c_uchar, - part_len: *mut ::std::os::raw::c_ulong, - ) -> CK_RV, ->; -pub type CK_C_GenerateKey = ::std::option::Option< - unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - templ: *mut _CK_ATTRIBUTE, - ulCount: ::std::os::raw::c_ulong, - key: *mut CK_OBJECT_HANDLE, - ) -> CK_RV, ->; -pub type CK_C_GenerateKeyPair = ::std::option::Option< - unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - public_key_template: *mut _CK_ATTRIBUTE, - public_key_attribute_count: ::std::os::raw::c_ulong, - private_key_template: *mut _CK_ATTRIBUTE, - private_key_attribute_count: ::std::os::raw::c_ulong, - public_key: *mut CK_OBJECT_HANDLE, - private_key: *mut CK_OBJECT_HANDLE, - ) -> CK_RV, ->; -pub type CK_C_WrapKey = ::std::option::Option< - unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - wrapping_key: CK_OBJECT_HANDLE, - key: CK_OBJECT_HANDLE, - wrapped_key: *mut ::std::os::raw::c_uchar, - wrapped_key_len: *mut ::std::os::raw::c_ulong, - ) -> CK_RV, ->; -pub type CK_C_UnwrapKey = ::std::option::Option< - unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - unwrapping_key: CK_OBJECT_HANDLE, - wrapped_key: *mut ::std::os::raw::c_uchar, - wrapped_key_len: ::std::os::raw::c_ulong, - templ: *mut _CK_ATTRIBUTE, - attribute_count: ::std::os::raw::c_ulong, - key: *mut CK_OBJECT_HANDLE, - ) -> CK_RV, ->; +pub type CK_X9_42_DH2_DERIVE_PARAMS_PTR = *mut CK_X9_42_DH2_DERIVE_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_X9_42_MQV_DERIVE_PARAMS { + pub kdf: CK_X9_42_DH_KDF_TYPE, + pub ulOtherInfoLen: CK_ULONG, + pub pOtherInfo: CK_BYTE_PTR, + pub ulPublicDataLen: CK_ULONG, + pub pPublicData: CK_BYTE_PTR, + pub ulPrivateDataLen: CK_ULONG, + pub hPrivateData: CK_OBJECT_HANDLE, + pub ulPublicDataLen2: CK_ULONG, + 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::(), + 40usize, + concat!("Size of: ", stringify!(CK_X9_42_MQV_DERIVE_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + 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 }, + 12usize, + 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 }, + 16usize, + 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 }, + 20usize, + 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 }, + 24usize, + 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 }, + 28usize, + 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 }, + 32usize, + 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 }, + 36usize, + concat!( + "Offset of field: ", + stringify!(CK_X9_42_MQV_DERIVE_PARAMS), + "::", + stringify!(publicKey) + ) + ); +} +impl Default for CK_X9_42_MQV_DERIVE_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_X9_42_MQV_DERIVE_PARAMS_PTR = *mut CK_X9_42_MQV_DERIVE_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_KEA_DERIVE_PARAMS { + pub isSender: CK_BBOOL, + pub ulRandomLen: CK_ULONG, + pub pRandomA: CK_BYTE_PTR, + pub pRandomB: CK_BYTE_PTR, + 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::(), + 24usize, + concat!("Size of: ", stringify!(CK_KEA_DERIVE_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + 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 }, + 4usize, + 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 }, + 8usize, + 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 }, + 12usize, + 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 }, + 16usize, + 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 }, + 20usize, + concat!( + "Offset of field: ", + stringify!(CK_KEA_DERIVE_PARAMS), + "::", + stringify!(pPublicData) + ) + ); +} +impl Default for CK_KEA_DERIVE_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_KEA_DERIVE_PARAMS_PTR = *mut CK_KEA_DERIVE_PARAMS; +pub type CK_RC2_PARAMS = CK_ULONG; +pub type CK_RC2_PARAMS_PTR = *mut CK_RC2_PARAMS; +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +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::(), + 4usize, + 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) + ) + ); +} +pub type CK_RC2_CBC_PARAMS_PTR = *mut CK_RC2_CBC_PARAMS; +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +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::(), + 4usize, + 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) + ) + ); +} +pub type CK_RC2_MAC_GENERAL_PARAMS_PTR = *mut CK_RC2_MAC_GENERAL_PARAMS; +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +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::(), + 4usize, + 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) + ) + ); +} +pub type CK_RC5_PARAMS_PTR = *mut CK_RC5_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_RC5_CBC_PARAMS { + pub ulWordsize: CK_ULONG, + pub ulRounds: CK_ULONG, + 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::(), + 16usize, + concat!("Size of: ", stringify!(CK_RC5_CBC_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + 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 }, + 12usize, + concat!( + "Offset of field: ", + stringify!(CK_RC5_CBC_PARAMS), + "::", + stringify!(ulIvLen) + ) + ); +} +impl Default for CK_RC5_CBC_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_RC5_CBC_PARAMS_PTR = *mut CK_RC5_CBC_PARAMS; +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct CK_RC5_MAC_GENERAL_PARAMS { + pub ulWordsize: CK_ULONG, + 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::(), + 4usize, + 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) + ) + ); +} +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; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_DES_CBC_ENCRYPT_DATA_PARAMS { + pub iv: [CK_BYTE; 8usize], + 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::(), + 16usize, + concat!("Size of: ", stringify!(CK_DES_CBC_ENCRYPT_DATA_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + 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 }, + 12usize, + concat!( + "Offset of field: ", + stringify!(CK_DES_CBC_ENCRYPT_DATA_PARAMS), + "::", + stringify!(length) + ) + ); +} +impl Default for CK_DES_CBC_ENCRYPT_DATA_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_DES_CBC_ENCRYPT_DATA_PARAMS_PTR = *mut CK_DES_CBC_ENCRYPT_DATA_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_AES_CBC_ENCRYPT_DATA_PARAMS { + pub iv: [CK_BYTE; 16usize], + 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::(), + 24usize, + concat!("Size of: ", stringify!(CK_AES_CBC_ENCRYPT_DATA_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + 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 }, + 20usize, + concat!( + "Offset of field: ", + stringify!(CK_AES_CBC_ENCRYPT_DATA_PARAMS), + "::", + stringify!(length) + ) + ); +} +impl Default for CK_AES_CBC_ENCRYPT_DATA_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_AES_CBC_ENCRYPT_DATA_PARAMS_PTR = *mut CK_AES_CBC_ENCRYPT_DATA_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_SKIPJACK_PRIVATE_WRAP_PARAMS { + pub ulPasswordLen: CK_ULONG, + pub pPassword: CK_BYTE_PTR, + pub ulPublicDataLen: CK_ULONG, + pub pPublicData: CK_BYTE_PTR, + pub ulPAndGLen: CK_ULONG, + pub ulQLen: CK_ULONG, + pub ulRandomLen: CK_ULONG, + pub pRandomA: CK_BYTE_PTR, + pub pPrimeP: CK_BYTE_PTR, + 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::(), + 44usize, + concat!("Size of: ", stringify!(CK_SKIPJACK_PRIVATE_WRAP_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + 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 }, + 8usize, + 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 }, + 12usize, + 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 }, + 16usize, + 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 }, + 20usize, + 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 }, + 24usize, + 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 }, + 28usize, + 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 }, + 32usize, + 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 }, + 36usize, + 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 }, + 40usize, + concat!( + "Offset of field: ", + stringify!(CK_SKIPJACK_PRIVATE_WRAP_PARAMS), + "::", + stringify!(pSubprimeQ) + ) + ); +} +impl Default for CK_SKIPJACK_PRIVATE_WRAP_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_SKIPJACK_PRIVATE_WRAP_PARAMS_PTR = *mut CK_SKIPJACK_PRIVATE_WRAP_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_SKIPJACK_RELAYX_PARAMS { + pub ulOldWrappedXLen: CK_ULONG, + pub pOldWrappedX: CK_BYTE_PTR, + pub ulOldPasswordLen: CK_ULONG, + pub pOldPassword: CK_BYTE_PTR, + pub ulOldPublicDataLen: CK_ULONG, + pub pOldPublicData: CK_BYTE_PTR, + pub ulOldRandomLen: CK_ULONG, + pub pOldRandomA: CK_BYTE_PTR, + pub ulNewPasswordLen: CK_ULONG, + pub pNewPassword: CK_BYTE_PTR, + pub ulNewPublicDataLen: CK_ULONG, + pub pNewPublicData: CK_BYTE_PTR, + 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::(), + 56usize, + concat!("Size of: ", stringify!(CK_SKIPJACK_RELAYX_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + 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 }, + 8usize, + 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 }, + 12usize, + 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 }, + 16usize, + 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 }, + 20usize, + 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 }, + 24usize, + 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 }, + 28usize, + 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 }, + 32usize, + 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 }, + 36usize, + 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 }, + 40usize, + 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 }, + 44usize, + 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 }, + 48usize, + 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 }, + 52usize, + concat!( + "Offset of field: ", + stringify!(CK_SKIPJACK_RELAYX_PARAMS), + "::", + stringify!(pNewRandomA) + ) + ); +} +impl Default for CK_SKIPJACK_RELAYX_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_SKIPJACK_RELAYX_PARAMS_PTR = *mut CK_SKIPJACK_RELAYX_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_PBE_PARAMS { + pub pInitVector: CK_BYTE_PTR, + pub pPassword: CK_UTF8CHAR_PTR, + pub ulPasswordLen: CK_ULONG, + pub pSalt: CK_BYTE_PTR, + 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::(), + 24usize, + concat!("Size of: ", stringify!(CK_PBE_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + 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 }, + 4usize, + concat!( + "Offset of field: ", + stringify!(CK_PBE_PARAMS), + "::", + stringify!(pPassword) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ulPasswordLen) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(CK_PBE_PARAMS), + "::", + stringify!(ulPasswordLen) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pSalt) as usize - ptr as usize }, + 12usize, + concat!( + "Offset of field: ", + stringify!(CK_PBE_PARAMS), + "::", + stringify!(pSalt) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ulSaltLen) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(CK_PBE_PARAMS), + "::", + stringify!(ulSaltLen) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ulIteration) as usize - ptr as usize }, + 20usize, + concat!( + "Offset of field: ", + stringify!(CK_PBE_PARAMS), + "::", + stringify!(ulIteration) + ) + ); +} +impl Default for CK_PBE_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_PBE_PARAMS_PTR = *mut CK_PBE_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_KEY_WRAP_SET_OAEP_PARAMS { + pub bBC: CK_BYTE, + 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::(), + 12usize, + concat!("Size of: ", stringify!(CK_KEY_WRAP_SET_OAEP_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + 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 }, + 4usize, + 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 }, + 8usize, + concat!( + "Offset of field: ", + stringify!(CK_KEY_WRAP_SET_OAEP_PARAMS), + "::", + stringify!(ulXLen) + ) + ); +} +impl Default for CK_KEY_WRAP_SET_OAEP_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_KEY_WRAP_SET_OAEP_PARAMS_PTR = *mut CK_KEY_WRAP_SET_OAEP_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_SSL3_RANDOM_DATA { + pub pClientRandom: CK_BYTE_PTR, + pub ulClientRandomLen: CK_ULONG, + 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::(), + 16usize, + concat!("Size of: ", stringify!(CK_SSL3_RANDOM_DATA)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + 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 }, + 4usize, + 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 }, + 8usize, + 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 }, + 12usize, + concat!( + "Offset of field: ", + stringify!(CK_SSL3_RANDOM_DATA), + "::", + stringify!(ulServerRandomLen) + ) + ); +} +impl Default for CK_SSL3_RANDOM_DATA { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct 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::(), + 20usize, + concat!("Size of: ", stringify!(CK_SSL3_MASTER_KEY_DERIVE_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + 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 }, + 16usize, + concat!( + "Offset of field: ", + stringify!(CK_SSL3_MASTER_KEY_DERIVE_PARAMS), + "::", + stringify!(pVersion) + ) + ); +} +impl Default for CK_SSL3_MASTER_KEY_DERIVE_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_SSL3_MASTER_KEY_DERIVE_PARAMS_PTR = *mut CK_SSL3_MASTER_KEY_DERIVE_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_SSL3_KEY_MAT_OUT { + pub hClientMacSecret: CK_OBJECT_HANDLE, + pub hServerMacSecret: CK_OBJECT_HANDLE, + pub hClientKey: CK_OBJECT_HANDLE, + pub hServerKey: CK_OBJECT_HANDLE, + 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::(), + 24usize, + concat!("Size of: ", stringify!(CK_SSL3_KEY_MAT_OUT)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + 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 }, + 20usize, + concat!( + "Offset of field: ", + stringify!(CK_SSL3_KEY_MAT_OUT), + "::", + stringify!(pIVServer) + ) + ); +} +impl Default for CK_SSL3_KEY_MAT_OUT { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_SSL3_KEY_MAT_OUT_PTR = *mut CK_SSL3_KEY_MAT_OUT; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_SSL3_KEY_MAT_PARAMS { + pub ulMacSizeInBits: CK_ULONG, + pub ulKeySizeInBits: CK_ULONG, + pub ulIVSizeInBits: CK_ULONG, + pub bIsExport: CK_BBOOL, + 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::(), + 36usize, + concat!("Size of: ", stringify!(CK_SSL3_KEY_MAT_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + 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 }, + 16usize, + 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 }, + 32usize, + concat!( + "Offset of field: ", + stringify!(CK_SSL3_KEY_MAT_PARAMS), + "::", + stringify!(pReturnedKeyMaterial) + ) + ); +} +impl Default for CK_SSL3_KEY_MAT_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_SSL3_KEY_MAT_PARAMS_PTR = *mut CK_SSL3_KEY_MAT_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_TLS_PRF_PARAMS { + pub pSeed: CK_BYTE_PTR, + pub ulSeedLen: CK_ULONG, + pub pLabel: CK_BYTE_PTR, + pub ulLabelLen: CK_ULONG, + 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::(), + 24usize, + concat!("Size of: ", stringify!(CK_TLS_PRF_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + 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 }, + 4usize, + 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 }, + 8usize, + 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 }, + 12usize, + 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 }, + 16usize, + 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 }, + 20usize, + concat!( + "Offset of field: ", + stringify!(CK_TLS_PRF_PARAMS), + "::", + stringify!(pulOutputLen) + ) + ); +} +impl Default for CK_TLS_PRF_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_TLS_PRF_PARAMS_PTR = *mut CK_TLS_PRF_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_WTLS_RANDOM_DATA { + pub pClientRandom: CK_BYTE_PTR, + pub ulClientRandomLen: CK_ULONG, + 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::(), + 16usize, + concat!("Size of: ", stringify!(CK_WTLS_RANDOM_DATA)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + 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 }, + 4usize, + 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 }, + 8usize, + 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 }, + 12usize, + concat!( + "Offset of field: ", + stringify!(CK_WTLS_RANDOM_DATA), + "::", + stringify!(ulServerRandomLen) + ) + ); +} +impl Default for CK_WTLS_RANDOM_DATA { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_WTLS_RANDOM_DATA_PTR = *mut CK_WTLS_RANDOM_DATA; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_WTLS_MASTER_KEY_DERIVE_PARAMS { + pub DigestMechanism: CK_MECHANISM_TYPE, + 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::(), + 24usize, + concat!("Size of: ", stringify!(CK_WTLS_MASTER_KEY_DERIVE_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + 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 }, + 20usize, + concat!( + "Offset of field: ", + stringify!(CK_WTLS_MASTER_KEY_DERIVE_PARAMS), + "::", + stringify!(pVersion) + ) + ); +} +impl Default for CK_WTLS_MASTER_KEY_DERIVE_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_WTLS_MASTER_KEY_DERIVE_PARAMS_PTR = *mut CK_WTLS_MASTER_KEY_DERIVE_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_WTLS_PRF_PARAMS { + pub DigestMechanism: CK_MECHANISM_TYPE, + pub pSeed: CK_BYTE_PTR, + pub ulSeedLen: CK_ULONG, + pub pLabel: CK_BYTE_PTR, + pub ulLabelLen: CK_ULONG, + 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::(), + 28usize, + concat!("Size of: ", stringify!(CK_WTLS_PRF_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + 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 }, + 8usize, + 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 }, + 12usize, + 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 }, + 16usize, + 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 }, + 20usize, + 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 }, + 24usize, + concat!( + "Offset of field: ", + stringify!(CK_WTLS_PRF_PARAMS), + "::", + stringify!(pulOutputLen) + ) + ); +} +impl Default for CK_WTLS_PRF_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_WTLS_PRF_PARAMS_PTR = *mut CK_WTLS_PRF_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_WTLS_KEY_MAT_OUT { + pub hMacSecret: CK_OBJECT_HANDLE, + 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::(), + 12usize, + concat!("Size of: ", stringify!(CK_WTLS_KEY_MAT_OUT)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + 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) + ) + ); +} +impl Default for CK_WTLS_KEY_MAT_OUT { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_WTLS_KEY_MAT_OUT_PTR = *mut CK_WTLS_KEY_MAT_OUT; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_WTLS_KEY_MAT_PARAMS { + pub DigestMechanism: CK_MECHANISM_TYPE, + pub ulMacSizeInBits: CK_ULONG, + pub ulKeySizeInBits: CK_ULONG, + pub ulIVSizeInBits: CK_ULONG, + pub ulSequenceNumber: CK_ULONG, + pub bIsExport: CK_BBOOL, + 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::(), + 44usize, + concat!("Size of: ", stringify!(CK_WTLS_KEY_MAT_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + 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 }, + 24usize, + 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 }, + 40usize, + concat!( + "Offset of field: ", + stringify!(CK_WTLS_KEY_MAT_PARAMS), + "::", + stringify!(pReturnedKeyMaterial) + ) + ); +} +impl Default for CK_WTLS_KEY_MAT_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_WTLS_KEY_MAT_PARAMS_PTR = *mut CK_WTLS_KEY_MAT_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_CMS_SIG_PARAMS { + pub certificateHandle: CK_OBJECT_HANDLE, + pub pSigningMechanism: CK_MECHANISM_PTR, + pub pDigestMechanism: CK_MECHANISM_PTR, + pub pContentType: CK_UTF8CHAR_PTR, + pub pRequestedAttributes: CK_BYTE_PTR, + pub ulRequestedAttributesLen: CK_ULONG, + 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::(), + 32usize, + concat!("Size of: ", stringify!(CK_CMS_SIG_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + 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 }, + 8usize, + 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 }, + 12usize, + 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 }, + 16usize, + 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 }, + 20usize, + 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 }, + 24usize, + 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 }, + 28usize, + concat!( + "Offset of field: ", + stringify!(CK_CMS_SIG_PARAMS), + "::", + stringify!(ulRequiredAttributesLen) + ) + ); +} +impl Default for CK_CMS_SIG_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_CMS_SIG_PARAMS_PTR = *mut CK_CMS_SIG_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +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::(), + 8usize, + concat!("Size of: ", stringify!(CK_KEY_DERIVATION_STRING_DATA)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + 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 }, + 4usize, + concat!( + "Offset of field: ", + stringify!(CK_KEY_DERIVATION_STRING_DATA), + "::", + stringify!(ulLen) + ) + ); +} +impl Default for CK_KEY_DERIVATION_STRING_DATA { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_KEY_DERIVATION_STRING_DATA_PTR = *mut CK_KEY_DERIVATION_STRING_DATA; +pub type CK_EXTRACT_PARAMS = CK_ULONG; +pub type CK_EXTRACT_PARAMS_PTR = *mut CK_EXTRACT_PARAMS; +pub type CK_PKCS5_PBKD2_PSEUDO_RANDOM_FUNCTION_TYPE = CK_ULONG; +pub type CK_PKCS5_PBKD2_PSEUDO_RANDOM_FUNCTION_TYPE_PTR = + *mut CK_PKCS5_PBKD2_PSEUDO_RANDOM_FUNCTION_TYPE; +pub type CK_PKCS5_PBKDF2_SALT_SOURCE_TYPE = CK_ULONG; +pub type CK_PKCS5_PBKDF2_SALT_SOURCE_TYPE_PTR = *mut CK_PKCS5_PBKDF2_SALT_SOURCE_TYPE; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_PKCS5_PBKD2_PARAMS { + pub saltSource: CK_PKCS5_PBKDF2_SALT_SOURCE_TYPE, + pub pSaltSourceData: CK_VOID_PTR, + pub ulSaltSourceDataLen: CK_ULONG, + pub iterations: CK_ULONG, + pub prf: CK_PKCS5_PBKD2_PSEUDO_RANDOM_FUNCTION_TYPE, + pub pPrfData: CK_VOID_PTR, + pub ulPrfDataLen: CK_ULONG, + 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::(), + 36usize, + concat!("Size of: ", stringify!(CK_PKCS5_PBKD2_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + 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 }, + 8usize, + 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 }, + 12usize, + 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 }, + 16usize, + 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 }, + 20usize, + 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 }, + 24usize, + 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 }, + 28usize, + 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 }, + 32usize, + concat!( + "Offset of field: ", + stringify!(CK_PKCS5_PBKD2_PARAMS), + "::", + stringify!(ulPasswordLen) + ) + ); +} +impl Default for CK_PKCS5_PBKD2_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_PKCS5_PBKD2_PARAMS_PTR = *mut CK_PKCS5_PBKD2_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_PKCS5_PBKD2_PARAMS2 { + pub saltSource: CK_PKCS5_PBKDF2_SALT_SOURCE_TYPE, + pub pSaltSourceData: CK_VOID_PTR, + pub ulSaltSourceDataLen: CK_ULONG, + pub iterations: CK_ULONG, + pub prf: CK_PKCS5_PBKD2_PSEUDO_RANDOM_FUNCTION_TYPE, + pub pPrfData: CK_VOID_PTR, + pub ulPrfDataLen: CK_ULONG, + 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::(), + 36usize, + concat!("Size of: ", stringify!(CK_PKCS5_PBKD2_PARAMS2)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + 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 }, + 8usize, + 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 }, + 12usize, + 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 }, + 16usize, + 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 }, + 20usize, + 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 }, + 24usize, + 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 }, + 28usize, + 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 }, + 32usize, + concat!( + "Offset of field: ", + stringify!(CK_PKCS5_PBKD2_PARAMS2), + "::", + stringify!(ulPasswordLen) + ) + ); +} +impl Default for CK_PKCS5_PBKD2_PARAMS2 { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_PKCS5_PBKD2_PARAMS2_PTR = *mut CK_PKCS5_PBKD2_PARAMS2; +pub type CK_OTP_PARAM_TYPE = CK_ULONG; +pub type CK_PARAM_TYPE = CK_OTP_PARAM_TYPE; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_OTP_PARAM { + pub type_: CK_OTP_PARAM_TYPE, + 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::(), + 12usize, + concat!("Size of: ", stringify!(CK_OTP_PARAM)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + 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 }, + 8usize, + concat!( + "Offset of field: ", + stringify!(CK_OTP_PARAM), + "::", + stringify!(ulValueLen) + ) + ); +} +impl Default for CK_OTP_PARAM { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_OTP_PARAM_PTR = *mut CK_OTP_PARAM; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +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::(), + 8usize, + concat!("Size of: ", stringify!(CK_OTP_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + 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 }, + 4usize, + concat!( + "Offset of field: ", + stringify!(CK_OTP_PARAMS), + "::", + stringify!(ulCount) + ) + ); +} +impl Default for CK_OTP_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_OTP_PARAMS_PTR = *mut CK_OTP_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +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::(), + 8usize, + concat!("Size of: ", stringify!(CK_OTP_SIGNATURE_INFO)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + 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 }, + 4usize, + concat!( + "Offset of field: ", + stringify!(CK_OTP_SIGNATURE_INFO), + "::", + stringify!(ulCount) + ) + ); +} +impl Default for CK_OTP_SIGNATURE_INFO { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_OTP_SIGNATURE_INFO_PTR = *mut CK_OTP_SIGNATURE_INFO; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_KIP_PARAMS { + pub pMechanism: CK_MECHANISM_PTR, + pub hKey: CK_OBJECT_HANDLE, + 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::(), + 16usize, + concat!("Size of: ", stringify!(CK_KIP_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + 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 }, + 4usize, + concat!( + "Offset of field: ", + stringify!(CK_KIP_PARAMS), + "::", + stringify!(hKey) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pSeed) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(CK_KIP_PARAMS), + "::", + stringify!(pSeed) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ulSeedLen) as usize - ptr as usize }, + 12usize, + concat!( + "Offset of field: ", + stringify!(CK_KIP_PARAMS), + "::", + stringify!(ulSeedLen) + ) + ); +} +impl Default for CK_KIP_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_KIP_PARAMS_PTR = *mut CK_KIP_PARAMS; +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +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::(), + 4usize, + 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) + ) + ); +} +pub type CK_AES_CTR_PARAMS_PTR = *mut CK_AES_CTR_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_GCM_PARAMS { + pub pIv: CK_BYTE_PTR, + pub ulIvLen: CK_ULONG, + pub ulIvBits: CK_ULONG, + pub pAAD: CK_BYTE_PTR, + 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::(), + 24usize, + concat!("Size of: ", stringify!(CK_GCM_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + 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 }, + 4usize, + concat!( + "Offset of field: ", + stringify!(CK_GCM_PARAMS), + "::", + stringify!(ulIvLen) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ulIvBits) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(CK_GCM_PARAMS), + "::", + stringify!(ulIvBits) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pAAD) as usize - ptr as usize }, + 12usize, + concat!( + "Offset of field: ", + stringify!(CK_GCM_PARAMS), + "::", + stringify!(pAAD) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ulAADLen) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(CK_GCM_PARAMS), + "::", + stringify!(ulAADLen) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ulTagBits) as usize - ptr as usize }, + 20usize, + concat!( + "Offset of field: ", + stringify!(CK_GCM_PARAMS), + "::", + stringify!(ulTagBits) + ) + ); +} +impl Default for CK_GCM_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_GCM_PARAMS_PTR = *mut CK_GCM_PARAMS; +pub type CK_GENERATOR_FUNCTION = CK_ULONG; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_GCM_MESSAGE_PARAMS { + pub pIv: CK_BYTE_PTR, + pub ulIvLen: CK_ULONG, + pub ulIvFixedBits: CK_ULONG, + pub ivGenerator: CK_GENERATOR_FUNCTION, + 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::(), + 24usize, + concat!("Size of: ", stringify!(CK_GCM_MESSAGE_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + 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 }, + 4usize, + 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 }, + 8usize, + 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 }, + 12usize, + 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 }, + 16usize, + 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 }, + 20usize, + concat!( + "Offset of field: ", + stringify!(CK_GCM_MESSAGE_PARAMS), + "::", + stringify!(ulTagBits) + ) + ); +} +impl Default for CK_GCM_MESSAGE_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_GCM_MESSAGE_PARAMS_PTR = CK_GCM_MESSAGE_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_CCM_PARAMS { + pub ulDataLen: CK_ULONG, + pub pNonce: CK_BYTE_PTR, + pub ulNonceLen: CK_ULONG, + pub pAAD: CK_BYTE_PTR, + 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::(), + 24usize, + concat!("Size of: ", stringify!(CK_CCM_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + 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 }, + 8usize, + concat!( + "Offset of field: ", + stringify!(CK_CCM_PARAMS), + "::", + stringify!(ulNonceLen) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pAAD) as usize - ptr as usize }, + 12usize, + concat!( + "Offset of field: ", + stringify!(CK_CCM_PARAMS), + "::", + stringify!(pAAD) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ulAADLen) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(CK_CCM_PARAMS), + "::", + stringify!(ulAADLen) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ulMACLen) as usize - ptr as usize }, + 20usize, + concat!( + "Offset of field: ", + stringify!(CK_CCM_PARAMS), + "::", + stringify!(ulMACLen) + ) + ); +} +impl Default for CK_CCM_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_CCM_PARAMS_PTR = *mut CK_CCM_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_CCM_MESSAGE_PARAMS { + pub ulDataLen: CK_ULONG, + pub pNonce: CK_BYTE_PTR, + pub ulNonceLen: CK_ULONG, + pub ulNonceFixedBits: CK_ULONG, + pub nonceGenerator: CK_GENERATOR_FUNCTION, + 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::(), + 28usize, + concat!("Size of: ", stringify!(CK_CCM_MESSAGE_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + 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 }, + 8usize, + 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 }, + 12usize, + 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 }, + 16usize, + 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 }, + 20usize, + 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 }, + 24usize, + concat!( + "Offset of field: ", + stringify!(CK_CCM_MESSAGE_PARAMS), + "::", + stringify!(ulMACLen) + ) + ); +} +impl Default for CK_CCM_MESSAGE_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_CCM_MESSAGE_PARAMS_PTR = CK_CCM_MESSAGE_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_AES_GCM_PARAMS { + pub pIv: CK_BYTE_PTR, + pub ulIvLen: CK_ULONG, + pub ulIvBits: CK_ULONG, + pub pAAD: CK_BYTE_PTR, + 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::(), + 24usize, + concat!("Size of: ", stringify!(CK_AES_GCM_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + 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 }, + 4usize, + 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 }, + 8usize, + 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 }, + 12usize, + 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 }, + 16usize, + 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 }, + 20usize, + concat!( + "Offset of field: ", + stringify!(CK_AES_GCM_PARAMS), + "::", + stringify!(ulTagBits) + ) + ); +} +impl Default for CK_AES_GCM_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_AES_GCM_PARAMS_PTR = *mut CK_AES_GCM_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_AES_CCM_PARAMS { + pub ulDataLen: CK_ULONG, + pub pNonce: CK_BYTE_PTR, + pub ulNonceLen: CK_ULONG, + pub pAAD: CK_BYTE_PTR, + 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::(), + 24usize, + concat!("Size of: ", stringify!(CK_AES_CCM_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + 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 }, + 8usize, + 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 }, + 12usize, + 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 }, + 16usize, + 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 }, + 20usize, + concat!( + "Offset of field: ", + stringify!(CK_AES_CCM_PARAMS), + "::", + stringify!(ulMACLen) + ) + ); +} +impl Default for CK_AES_CCM_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_AES_CCM_PARAMS_PTR = *mut CK_AES_CCM_PARAMS; +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +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::(), + 4usize, + 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) + ) + ); +} +pub type CK_CAMELLIA_CTR_PARAMS_PTR = *mut CK_CAMELLIA_CTR_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_CAMELLIA_CBC_ENCRYPT_DATA_PARAMS { + pub iv: [CK_BYTE; 16usize], + 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::(), + 24usize, + concat!("Size of: ", stringify!(CK_CAMELLIA_CBC_ENCRYPT_DATA_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + 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 }, + 20usize, + concat!( + "Offset of field: ", + stringify!(CK_CAMELLIA_CBC_ENCRYPT_DATA_PARAMS), + "::", + stringify!(length) + ) + ); +} +impl Default for CK_CAMELLIA_CBC_ENCRYPT_DATA_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_CAMELLIA_CBC_ENCRYPT_DATA_PARAMS_PTR = *mut CK_CAMELLIA_CBC_ENCRYPT_DATA_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_ARIA_CBC_ENCRYPT_DATA_PARAMS { + pub iv: [CK_BYTE; 16usize], + 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::(), + 24usize, + concat!("Size of: ", stringify!(CK_ARIA_CBC_ENCRYPT_DATA_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + 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 }, + 20usize, + concat!( + "Offset of field: ", + stringify!(CK_ARIA_CBC_ENCRYPT_DATA_PARAMS), + "::", + stringify!(length) + ) + ); +} +impl Default for CK_ARIA_CBC_ENCRYPT_DATA_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_ARIA_CBC_ENCRYPT_DATA_PARAMS_PTR = *mut CK_ARIA_CBC_ENCRYPT_DATA_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_DSA_PARAMETER_GEN_PARAM { + pub hash: CK_MECHANISM_TYPE, + pub pSeed: CK_BYTE_PTR, + 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::(), + 16usize, + concat!("Size of: ", stringify!(CK_DSA_PARAMETER_GEN_PARAM)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + 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 }, + 8usize, + 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 }, + 12usize, + concat!( + "Offset of field: ", + stringify!(CK_DSA_PARAMETER_GEN_PARAM), + "::", + stringify!(ulIndex) + ) + ); +} +impl Default for CK_DSA_PARAMETER_GEN_PARAM { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_DSA_PARAMETER_GEN_PARAM_PTR = *mut CK_DSA_PARAMETER_GEN_PARAM; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_ECDH_AES_KEY_WRAP_PARAMS { + pub ulAESKeyBits: CK_ULONG, + pub kdf: CK_EC_KDF_TYPE, + 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::(), + 16usize, + concat!("Size of: ", stringify!(CK_ECDH_AES_KEY_WRAP_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + 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) + ) + ); +} +impl Default for CK_ECDH_AES_KEY_WRAP_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_ECDH_AES_KEY_WRAP_PARAMS_PTR = *mut CK_ECDH_AES_KEY_WRAP_PARAMS; +pub type CK_JAVA_MIDP_SECURITY_DOMAIN = CK_ULONG; +pub type CK_CERTIFICATE_CATEGORY = CK_ULONG; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +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::(), + 8usize, + concat!("Size of: ", stringify!(CK_RSA_AES_KEY_WRAP_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + 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) + ) + ); +} +impl Default for CK_RSA_AES_KEY_WRAP_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_RSA_AES_KEY_WRAP_PARAMS_PTR = *mut CK_RSA_AES_KEY_WRAP_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_TLS12_MASTER_KEY_DERIVE_PARAMS { + pub RandomInfo: CK_SSL3_RANDOM_DATA, + 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::(), + 24usize, + concat!("Size of: ", stringify!(CK_TLS12_MASTER_KEY_DERIVE_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + 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 }, + 16usize, + 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 }, + 20usize, + concat!( + "Offset of field: ", + stringify!(CK_TLS12_MASTER_KEY_DERIVE_PARAMS), + "::", + stringify!(prfHashMechanism) + ) + ); +} +impl Default for CK_TLS12_MASTER_KEY_DERIVE_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_TLS12_MASTER_KEY_DERIVE_PARAMS_PTR = *mut CK_TLS12_MASTER_KEY_DERIVE_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_TLS12_KEY_MAT_PARAMS { + pub ulMacSizeInBits: CK_ULONG, + pub ulKeySizeInBits: CK_ULONG, + pub ulIVSizeInBits: CK_ULONG, + pub bIsExport: CK_BBOOL, + pub RandomInfo: CK_SSL3_RANDOM_DATA, + 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::(), + 40usize, + concat!("Size of: ", stringify!(CK_TLS12_KEY_MAT_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + 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 }, + 16usize, + 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 }, + 32usize, + 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 }, + 36usize, + concat!( + "Offset of field: ", + stringify!(CK_TLS12_KEY_MAT_PARAMS), + "::", + stringify!(prfHashMechanism) + ) + ); +} +impl Default for CK_TLS12_KEY_MAT_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_TLS12_KEY_MAT_PARAMS_PTR = *mut CK_TLS12_KEY_MAT_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_TLS_KDF_PARAMS { + pub prfMechanism: CK_MECHANISM_TYPE, + pub pLabel: CK_BYTE_PTR, + pub ulLabelLength: CK_ULONG, + pub RandomInfo: CK_SSL3_RANDOM_DATA, + 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::(), + 36usize, + concat!("Size of: ", stringify!(CK_TLS_KDF_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + 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 }, + 8usize, + 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 }, + 12usize, + 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 }, + 28usize, + 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 }, + 32usize, + concat!( + "Offset of field: ", + stringify!(CK_TLS_KDF_PARAMS), + "::", + stringify!(ulContextDataLength) + ) + ); +} +impl Default for CK_TLS_KDF_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_TLS_KDF_PARAMS_PTR = *mut CK_TLS_KDF_PARAMS; +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct CK_TLS_MAC_PARAMS { + pub prfHashMechanism: CK_MECHANISM_TYPE, + 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::(), + 4usize, + 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) + ) + ); +} +pub type CK_TLS_MAC_PARAMS_PTR = *mut CK_TLS_MAC_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_GOSTR3410_DERIVE_PARAMS { + pub kdf: CK_EC_KDF_TYPE, + pub pPublicData: CK_BYTE_PTR, + pub ulPublicDataLen: CK_ULONG, + 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::(), + 20usize, + concat!("Size of: ", stringify!(CK_GOSTR3410_DERIVE_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + 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 }, + 8usize, + 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 }, + 12usize, + 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 }, + 16usize, + concat!( + "Offset of field: ", + stringify!(CK_GOSTR3410_DERIVE_PARAMS), + "::", + stringify!(ulUKMLen) + ) + ); +} +impl Default for CK_GOSTR3410_DERIVE_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_GOSTR3410_DERIVE_PARAMS_PTR = *mut CK_GOSTR3410_DERIVE_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_GOSTR3410_KEY_WRAP_PARAMS { + pub pWrapOID: CK_BYTE_PTR, + pub ulWrapOIDLen: CK_ULONG, + pub pUKM: CK_BYTE_PTR, + 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::(), + 20usize, + concat!("Size of: ", stringify!(CK_GOSTR3410_KEY_WRAP_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + 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 }, + 4usize, + 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 }, + 8usize, + 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 }, + 12usize, + 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 }, + 16usize, + concat!( + "Offset of field: ", + stringify!(CK_GOSTR3410_KEY_WRAP_PARAMS), + "::", + stringify!(hKey) + ) + ); +} +impl Default for CK_GOSTR3410_KEY_WRAP_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_GOSTR3410_KEY_WRAP_PARAMS_PTR = *mut CK_GOSTR3410_KEY_WRAP_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_SEED_CBC_ENCRYPT_DATA_PARAMS { + pub iv: [CK_BYTE; 16usize], + 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::(), + 24usize, + concat!("Size of: ", stringify!(CK_SEED_CBC_ENCRYPT_DATA_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + 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 }, + 20usize, + concat!( + "Offset of field: ", + stringify!(CK_SEED_CBC_ENCRYPT_DATA_PARAMS), + "::", + stringify!(length) + ) + ); +} +impl Default for CK_SEED_CBC_ENCRYPT_DATA_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_SEED_CBC_ENCRYPT_DATA_PARAMS_PTR = *mut CK_SEED_CBC_ENCRYPT_DATA_PARAMS; +pub type CK_PROFILE_ID = CK_ULONG; +pub type CK_PRF_DATA_TYPE = CK_ULONG; +pub type CK_SP800_108_PRF_TYPE = CK_MECHANISM_TYPE; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_PRF_DATA_PARAM { + pub type_: CK_PRF_DATA_TYPE, + 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::(), + 12usize, + concat!("Size of: ", stringify!(CK_PRF_DATA_PARAM)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + 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 }, + 8usize, + concat!( + "Offset of field: ", + stringify!(CK_PRF_DATA_PARAM), + "::", + stringify!(ulValueLen) + ) + ); +} +impl Default for CK_PRF_DATA_PARAM { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_PRF_DATA_PARAM_PTR = *mut CK_PRF_DATA_PARAM; +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +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::(), + 8usize, + concat!("Size of: ", stringify!(CK_SP800_108_COUNTER_FORMAT)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + 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 }, + 4usize, + concat!( + "Offset of field: ", + stringify!(CK_SP800_108_COUNTER_FORMAT), + "::", + stringify!(ulWidthInBits) + ) + ); +} +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)] +#[derive(Debug, Default, Copy, Clone)] +pub struct CK_SP800_108_DKM_LENGTH_FORMAT { + pub dkmLengthMethod: CK_SP800_108_DKM_LENGTH_METHOD, + 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::(), + 12usize, + concat!("Size of: ", stringify!(CK_SP800_108_DKM_LENGTH_FORMAT)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + 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 }, + 8usize, + concat!( + "Offset of field: ", + stringify!(CK_SP800_108_DKM_LENGTH_FORMAT), + "::", + stringify!(ulWidthInBits) + ) + ); +} +pub type CK_SP800_108_DKM_LENGTH_FORMAT_PTR = *mut CK_SP800_108_DKM_LENGTH_FORMAT; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_DERIVED_KEY { + pub pTemplate: CK_ATTRIBUTE_PTR, + 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::(), + 12usize, + concat!("Size of: ", stringify!(CK_DERIVED_KEY)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + 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 }, + 4usize, + concat!( + "Offset of field: ", + stringify!(CK_DERIVED_KEY), + "::", + stringify!(ulAttributeCount) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).phKey) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(CK_DERIVED_KEY), + "::", + stringify!(phKey) + ) + ); +} +impl Default for CK_DERIVED_KEY { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_DERIVED_KEY_PTR = *mut CK_DERIVED_KEY; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_SP800_108_KDF_PARAMS { + pub prfType: CK_SP800_108_PRF_TYPE, + pub ulNumberOfDataParams: CK_ULONG, + pub pDataParams: CK_PRF_DATA_PARAM_PTR, + pub ulAdditionalDerivedKeys: CK_ULONG, + pub pAdditionalDerivedKeys: CK_DERIVED_KEY, +} +#[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::(), + 4usize, + 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 }, + 12usize, + 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 }, + 16usize, + concat!( + "Offset of field: ", + stringify!(CK_SP800_108_KDF_PARAMS), + "::", + stringify!(pAdditionalDerivedKeys) + ) + ); +} +impl Default for CK_SP800_108_KDF_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_SP800_108_KDF_PARAMS_PTR = *mut CK_SP800_108_KDF_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_SP800_108_FEEDBACK_KDF_PARAMS { + pub prfType: CK_SP800_108_PRF_TYPE, + pub ulNumberOfDataParams: CK_ULONG, + pub pDataParams: CK_PRF_DATA_PARAM_PTR, + pub ulIVLen: CK_ULONG, + pub pIV: CK_BYTE_PTR, + pub ulAdditionalDerivedKeys: CK_ULONG, + pub pAdditionalDerivedKeys: CK_DERIVED_KEY, +} +#[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::(), + 36usize, + concat!("Size of: ", stringify!(CK_SP800_108_FEEDBACK_KDF_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + 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 }, + 12usize, + 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 }, + 16usize, + 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 }, + 20usize, + 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 }, + 24usize, + concat!( + "Offset of field: ", + stringify!(CK_SP800_108_FEEDBACK_KDF_PARAMS), + "::", + stringify!(pAdditionalDerivedKeys) + ) + ); +} +impl Default for CK_SP800_108_FEEDBACK_KDF_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_SP800_108_FEEDBACK_KDF_PARAMS_PTR = *mut CK_SP800_108_FEEDBACK_KDF_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_EDDSA_PARAMS { + pub phFlag: CK_BBOOL, + 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::(), + 12usize, + concat!("Size of: ", stringify!(CK_EDDSA_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + 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 }, + 4usize, + concat!( + "Offset of field: ", + stringify!(CK_EDDSA_PARAMS), + "::", + stringify!(ulContextDataLen) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pContextData) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(CK_EDDSA_PARAMS), + "::", + stringify!(pContextData) + ) + ); +} +impl Default for CK_EDDSA_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_EDDSA_PARAMS_PTR = *mut CK_EDDSA_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_CHACHA20_PARAMS { + pub pBlockCounter: CK_BYTE_PTR, + pub blockCounterBits: CK_ULONG, + 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::(), + 16usize, + concat!("Size of: ", stringify!(CK_CHACHA20_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + 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 }, + 4usize, + concat!( + "Offset of field: ", + stringify!(CK_CHACHA20_PARAMS), + "::", + stringify!(blockCounterBits) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pNonce) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(CK_CHACHA20_PARAMS), + "::", + stringify!(pNonce) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ulNonceBits) as usize - ptr as usize }, + 12usize, + concat!( + "Offset of field: ", + stringify!(CK_CHACHA20_PARAMS), + "::", + stringify!(ulNonceBits) + ) + ); +} +impl Default for CK_CHACHA20_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_SALSA20_PARAMS { + pub pBlockCounter: CK_BYTE_PTR, + 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::(), + 12usize, + concat!("Size of: ", stringify!(CK_SALSA20_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + 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 }, + 4usize, + concat!( + "Offset of field: ", + stringify!(CK_SALSA20_PARAMS), + "::", + stringify!(pNonce) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ulNonceBits) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(CK_SALSA20_PARAMS), + "::", + stringify!(ulNonceBits) + ) + ); +} +impl Default for CK_SALSA20_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_SALSA20_CHACHA20_POLY1305_PARAMS { + pub pNonce: CK_BYTE_PTR, + pub ulNonceLen: CK_ULONG, + 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::(), + 16usize, + concat!("Size of: ", stringify!(CK_SALSA20_CHACHA20_POLY1305_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + 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 }, + 4usize, + 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 }, + 8usize, + 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 }, + 12usize, + concat!( + "Offset of field: ", + stringify!(CK_SALSA20_CHACHA20_POLY1305_PARAMS), + "::", + stringify!(ulAADLen) + ) + ); +} +impl Default for CK_SALSA20_CHACHA20_POLY1305_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_SALSA20_CHACHA20_POLY1305_PARAMS_PTR = *mut CK_SALSA20_CHACHA20_POLY1305_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_SALSA20_CHACHA20_POLY1305_MSG_PARAMS { + pub pNonce: CK_BYTE_PTR, + 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::(), + 12usize, + concat!( + "Size of: ", + stringify!(CK_SALSA20_CHACHA20_POLY1305_MSG_PARAMS) + ) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + 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 }, + 4usize, + 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 }, + 8usize, + concat!( + "Offset of field: ", + stringify!(CK_SALSA20_CHACHA20_POLY1305_MSG_PARAMS), + "::", + stringify!(pTag) + ) + ); +} +impl Default for CK_SALSA20_CHACHA20_POLY1305_MSG_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_SALSA20_CHACHA20_POLY1305_MSG_PARAMS_PTR = *mut CK_SALSA20_CHACHA20_POLY1305_MSG_PARAMS; +pub type CK_X3DH_KDF_TYPE = CK_ULONG; +pub type CK_X3DH_KDF_TYPE_PTR = *mut CK_X3DH_KDF_TYPE; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_X3DH_INITIATE_PARAMS { + pub kdf: CK_X3DH_KDF_TYPE, + pub pPeer_identity: CK_OBJECT_HANDLE, + pub pPeer_prekey: CK_OBJECT_HANDLE, + pub pPrekey_signature: CK_BYTE_PTR, + pub pOnetime_key: CK_BYTE_PTR, + 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::(), + 28usize, + concat!("Size of: ", stringify!(CK_X3DH_INITIATE_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + 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 }, + 16usize, + 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 }, + 20usize, + 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 }, + 24usize, + concat!( + "Offset of field: ", + stringify!(CK_X3DH_INITIATE_PARAMS), + "::", + stringify!(pOwn_ephemeral) + ) + ); +} +impl Default for CK_X3DH_INITIATE_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_X3DH_RESPOND_PARAMS { + pub kdf: CK_X3DH_KDF_TYPE, + pub pIdentity_id: CK_BYTE_PTR, + pub pPrekey_id: CK_BYTE_PTR, + pub pOnetime_id: CK_BYTE_PTR, + 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::(), + 24usize, + concat!("Size of: ", stringify!(CK_X3DH_RESPOND_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + 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 }, + 8usize, + 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 }, + 12usize, + 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 }, + 16usize, + 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 }, + 20usize, + concat!( + "Offset of field: ", + stringify!(CK_X3DH_RESPOND_PARAMS), + "::", + stringify!(pInitiator_ephemeral) + ) + ); +} +impl Default for CK_X3DH_RESPOND_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_X2RATCHET_KDF_TYPE = CK_ULONG; +pub type CK_X2RATCHET_KDF_TYPE_PTR = *mut CK_X2RATCHET_KDF_TYPE; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_X2RATCHET_INITIALIZE_PARAMS { + pub sk: CK_BYTE_PTR, + pub peer_public_prekey: CK_OBJECT_HANDLE, + pub peer_public_identity: CK_OBJECT_HANDLE, + pub own_public_identity: CK_OBJECT_HANDLE, + pub bEncryptedHeader: CK_BBOOL, + pub eCurve: CK_ULONG, + 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::(), + 32usize, + concat!("Size of: ", stringify!(CK_X2RATCHET_INITIALIZE_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + 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 }, + 4usize, + 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 }, + 8usize, + 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 }, + 12usize, + 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 }, + 16usize, + 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 }, + 20usize, + 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 }, + 24usize, + 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 }, + 28usize, + concat!( + "Offset of field: ", + stringify!(CK_X2RATCHET_INITIALIZE_PARAMS), + "::", + stringify!(kdfMechanism) + ) + ); +} +impl Default for CK_X2RATCHET_INITIALIZE_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_X2RATCHET_INITIALIZE_PARAMS_PTR = *mut CK_X2RATCHET_INITIALIZE_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_X2RATCHET_RESPOND_PARAMS { + pub sk: CK_BYTE_PTR, + pub own_prekey: CK_OBJECT_HANDLE, + pub initiator_identity: CK_OBJECT_HANDLE, + pub own_public_identity: CK_OBJECT_HANDLE, + pub bEncryptedHeader: CK_BBOOL, + pub eCurve: CK_ULONG, + 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::(), + 32usize, + concat!("Size of: ", stringify!(CK_X2RATCHET_RESPOND_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + 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 }, + 4usize, + 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 }, + 8usize, + 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 }, + 12usize, + 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 }, + 16usize, + 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 }, + 20usize, + 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 }, + 24usize, + 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 }, + 28usize, + concat!( + "Offset of field: ", + stringify!(CK_X2RATCHET_RESPOND_PARAMS), + "::", + stringify!(kdfMechanism) + ) + ); +} +impl Default for CK_X2RATCHET_RESPOND_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_X2RATCHET_RESPOND_PARAMS_PTR = *mut CK_X2RATCHET_RESPOND_PARAMS; +pub type CK_XEDDSA_HASH_TYPE = CK_ULONG; +pub type CK_XEDDSA_HASH_TYPE_PTR = *mut CK_XEDDSA_HASH_TYPE; +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +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::(), + 4usize, + 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) + ) + ); +} +pub type CK_XEDDSA_PARAMS_PTR = *mut CK_XEDDSA_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_HKDF_PARAMS { + pub bExtract: CK_BBOOL, + pub bExpand: CK_BBOOL, + pub prfHashMechanism: CK_MECHANISM_TYPE, + pub ulSaltType: CK_ULONG, + pub pSalt: CK_BYTE_PTR, + pub ulSaltLen: CK_ULONG, + pub hSaltKey: CK_ULONG, + 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::(), + 32usize, + concat!("Size of: ", stringify!(CK_HKDF_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + 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 }, + 4usize, + concat!( + "Offset of field: ", + stringify!(CK_HKDF_PARAMS), + "::", + stringify!(prfHashMechanism) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ulSaltType) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(CK_HKDF_PARAMS), + "::", + stringify!(ulSaltType) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pSalt) as usize - ptr as usize }, + 12usize, + concat!( + "Offset of field: ", + stringify!(CK_HKDF_PARAMS), + "::", + stringify!(pSalt) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ulSaltLen) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(CK_HKDF_PARAMS), + "::", + stringify!(ulSaltLen) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).hSaltKey) as usize - ptr as usize }, + 20usize, + concat!( + "Offset of field: ", + stringify!(CK_HKDF_PARAMS), + "::", + stringify!(hSaltKey) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pInfo) as usize - ptr as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(CK_HKDF_PARAMS), + "::", + stringify!(pInfo) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ulInfoLen) as usize - ptr as usize }, + 28usize, + concat!( + "Offset of field: ", + stringify!(CK_HKDF_PARAMS), + "::", + stringify!(ulInfoLen) + ) + ); +} +impl Default for CK_HKDF_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_C_Initialize = + ::std::option::Option CK_RV>; +pub type CK_C_Finalize = + ::std::option::Option CK_RV>; +pub type CK_C_GetInfo = ::std::option::Option CK_RV>; +pub type CK_C_GetFunctionList = + ::std::option::Option CK_RV>; +pub type CK_C_GetSlotList = ::std::option::Option< + unsafe extern "C" fn( + tokenPresent: CK_BBOOL, + pSlotList: CK_SLOT_ID_PTR, + pulCount: CK_ULONG_PTR, + ) -> CK_RV, +>; +pub type CK_C_GetSlotInfo = ::std::option::Option< + unsafe extern "C" fn(slotID: CK_SLOT_ID, pInfo: CK_SLOT_INFO_PTR) -> CK_RV, +>; +pub type CK_C_GetTokenInfo = ::std::option::Option< + unsafe extern "C" fn(slotID: CK_SLOT_ID, pInfo: CK_TOKEN_INFO_PTR) -> CK_RV, +>; +pub type CK_C_GetMechanismList = ::std::option::Option< + unsafe extern "C" fn( + slotID: CK_SLOT_ID, + pMechanismList: CK_MECHANISM_TYPE_PTR, + pulCount: CK_ULONG_PTR, + ) -> CK_RV, +>; +pub type CK_C_GetMechanismInfo = ::std::option::Option< + unsafe extern "C" fn( + slotID: CK_SLOT_ID, + type_: CK_MECHANISM_TYPE, + pInfo: CK_MECHANISM_INFO_PTR, + ) -> CK_RV, +>; +pub type CK_C_InitToken = ::std::option::Option< + unsafe extern "C" fn( + slotID: CK_SLOT_ID, + pPin: CK_UTF8CHAR_PTR, + ulPinLen: CK_ULONG, + pLabel: CK_UTF8CHAR_PTR, + ) -> CK_RV, +>; +pub type CK_C_InitPIN = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pPin: CK_UTF8CHAR_PTR, + ulPinLen: CK_ULONG, + ) -> CK_RV, +>; +pub type CK_C_SetPIN = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pOldPin: CK_UTF8CHAR_PTR, + ulOldLen: CK_ULONG, + pNewPin: CK_UTF8CHAR_PTR, + ulNewLen: CK_ULONG, + ) -> CK_RV, +>; +pub type CK_C_OpenSession = ::std::option::Option< + unsafe extern "C" fn( + slotID: CK_SLOT_ID, + flags: CK_FLAGS, + pApplication: CK_VOID_PTR, + Notify: CK_NOTIFY, + phSession: CK_SESSION_HANDLE_PTR, + ) -> CK_RV, +>; +pub type CK_C_CloseSession = + ::std::option::Option CK_RV>; +pub type CK_C_CloseAllSessions = + ::std::option::Option CK_RV>; +pub type CK_C_GetSessionInfo = ::std::option::Option< + unsafe extern "C" fn(hSession: CK_SESSION_HANDLE, pInfo: CK_SESSION_INFO_PTR) -> CK_RV, +>; +pub type CK_C_GetOperationState = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pOperationState: CK_BYTE_PTR, + pulOperationStateLen: CK_ULONG_PTR, + ) -> CK_RV, +>; +pub type CK_C_SetOperationState = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pOperationState: CK_BYTE_PTR, + ulOperationStateLen: CK_ULONG, + hEncryptionKey: CK_OBJECT_HANDLE, + hAuthenticationKey: CK_OBJECT_HANDLE, + ) -> CK_RV, +>; +pub type CK_C_Login = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + userType: CK_USER_TYPE, + pPin: CK_UTF8CHAR_PTR, + ulPinLen: CK_ULONG, + ) -> CK_RV, +>; +pub type CK_C_Logout = + ::std::option::Option CK_RV>; +pub type CK_C_CreateObject = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pTemplate: CK_ATTRIBUTE_PTR, + ulCount: CK_ULONG, + phObject: CK_OBJECT_HANDLE_PTR, + ) -> CK_RV, +>; +pub type CK_C_CopyObject = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + hObject: CK_OBJECT_HANDLE, + pTemplate: CK_ATTRIBUTE_PTR, + ulCount: CK_ULONG, + phNewObject: CK_OBJECT_HANDLE_PTR, + ) -> CK_RV, +>; +pub type CK_C_DestroyObject = ::std::option::Option< + unsafe extern "C" fn(hSession: CK_SESSION_HANDLE, hObject: CK_OBJECT_HANDLE) -> CK_RV, +>; +pub type CK_C_GetObjectSize = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + hObject: CK_OBJECT_HANDLE, + pulSize: CK_ULONG_PTR, + ) -> CK_RV, +>; +pub type CK_C_GetAttributeValue = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + hObject: CK_OBJECT_HANDLE, + pTemplate: CK_ATTRIBUTE_PTR, + ulCount: CK_ULONG, + ) -> CK_RV, +>; +pub type CK_C_SetAttributeValue = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + hObject: CK_OBJECT_HANDLE, + pTemplate: CK_ATTRIBUTE_PTR, + ulCount: CK_ULONG, + ) -> CK_RV, +>; +pub type CK_C_FindObjectsInit = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pTemplate: CK_ATTRIBUTE_PTR, + ulCount: CK_ULONG, + ) -> CK_RV, +>; +pub type CK_C_FindObjects = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + phObject: CK_OBJECT_HANDLE_PTR, + ulMaxObjectCount: CK_ULONG, + pulObjectCount: CK_ULONG_PTR, + ) -> CK_RV, +>; +pub type CK_C_FindObjectsFinal = + ::std::option::Option CK_RV>; +pub type CK_C_EncryptInit = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, + ) -> CK_RV, +>; +pub type CK_C_Encrypt = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pEncryptedData: CK_BYTE_PTR, + pulEncryptedDataLen: CK_ULONG_PTR, + ) -> CK_RV, +>; +pub type CK_C_EncryptUpdate = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pPart: CK_BYTE_PTR, + ulPartLen: CK_ULONG, + pEncryptedPart: CK_BYTE_PTR, + pulEncryptedPartLen: CK_ULONG_PTR, + ) -> CK_RV, +>; +pub type CK_C_EncryptFinal = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pLastEncryptedPart: CK_BYTE_PTR, + pulLastEncryptedPartLen: CK_ULONG_PTR, + ) -> CK_RV, +>; +pub type CK_C_DecryptInit = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, + ) -> CK_RV, +>; +pub type CK_C_Decrypt = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pEncryptedData: CK_BYTE_PTR, + ulEncryptedDataLen: CK_ULONG, + pData: CK_BYTE_PTR, + pulDataLen: CK_ULONG_PTR, + ) -> CK_RV, +>; +pub type CK_C_DecryptUpdate = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pEncryptedPart: CK_BYTE_PTR, + ulEncryptedPartLen: CK_ULONG, + pPart: CK_BYTE_PTR, + pulPartLen: CK_ULONG_PTR, + ) -> CK_RV, +>; +pub type CK_C_DecryptFinal = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pLastPart: CK_BYTE_PTR, + pulLastPartLen: CK_ULONG_PTR, + ) -> CK_RV, +>; +pub type CK_C_DigestInit = ::std::option::Option< + unsafe extern "C" fn(hSession: CK_SESSION_HANDLE, pMechanism: CK_MECHANISM_PTR) -> CK_RV, +>; +pub type CK_C_Digest = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pDigest: CK_BYTE_PTR, + pulDigestLen: CK_ULONG_PTR, + ) -> CK_RV, +>; +pub type CK_C_DigestUpdate = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pPart: CK_BYTE_PTR, + ulPartLen: CK_ULONG, + ) -> CK_RV, +>; +pub type CK_C_DigestKey = ::std::option::Option< + unsafe extern "C" fn(hSession: CK_SESSION_HANDLE, hKey: CK_OBJECT_HANDLE) -> CK_RV, +>; +pub type CK_C_DigestFinal = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pDigest: CK_BYTE_PTR, + pulDigestLen: CK_ULONG_PTR, + ) -> CK_RV, +>; +pub type CK_C_SignInit = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, + ) -> CK_RV, +>; +pub type CK_C_Sign = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + pulSignatureLen: CK_ULONG_PTR, + ) -> CK_RV, +>; +pub type CK_C_SignUpdate = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pPart: CK_BYTE_PTR, + ulPartLen: CK_ULONG, + ) -> CK_RV, +>; +pub type CK_C_SignFinal = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pSignature: CK_BYTE_PTR, + pulSignatureLen: CK_ULONG_PTR, + ) -> CK_RV, +>; +pub type CK_C_SignRecoverInit = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, + ) -> CK_RV, +>; +pub type CK_C_SignRecover = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + pulSignatureLen: CK_ULONG_PTR, + ) -> CK_RV, +>; +pub type CK_C_VerifyInit = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, + ) -> CK_RV, +>; +pub type CK_C_Verify = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + ulSignatureLen: CK_ULONG, + ) -> CK_RV, +>; +pub type CK_C_VerifyUpdate = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pPart: CK_BYTE_PTR, + ulPartLen: CK_ULONG, + ) -> CK_RV, +>; +pub type CK_C_VerifyFinal = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pSignature: CK_BYTE_PTR, + ulSignatureLen: CK_ULONG, + ) -> CK_RV, +>; +pub type CK_C_VerifyRecoverInit = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, + ) -> CK_RV, +>; +pub type CK_C_VerifyRecover = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pSignature: CK_BYTE_PTR, + ulSignatureLen: CK_ULONG, + pData: CK_BYTE_PTR, + pulDataLen: CK_ULONG_PTR, + ) -> CK_RV, +>; +pub type CK_C_DigestEncryptUpdate = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pPart: CK_BYTE_PTR, + ulPartLen: CK_ULONG, + pEncryptedPart: CK_BYTE_PTR, + pulEncryptedPartLen: CK_ULONG_PTR, + ) -> CK_RV, +>; +pub type CK_C_DecryptDigestUpdate = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pEncryptedPart: CK_BYTE_PTR, + ulEncryptedPartLen: CK_ULONG, + pPart: CK_BYTE_PTR, + pulPartLen: CK_ULONG_PTR, + ) -> CK_RV, +>; +pub type CK_C_SignEncryptUpdate = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pPart: CK_BYTE_PTR, + ulPartLen: CK_ULONG, + pEncryptedPart: CK_BYTE_PTR, + pulEncryptedPartLen: CK_ULONG_PTR, + ) -> CK_RV, +>; +pub type CK_C_DecryptVerifyUpdate = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pEncryptedPart: CK_BYTE_PTR, + ulEncryptedPartLen: CK_ULONG, + pPart: CK_BYTE_PTR, + pulPartLen: CK_ULONG_PTR, + ) -> CK_RV, +>; +pub type CK_C_GenerateKey = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + pTemplate: CK_ATTRIBUTE_PTR, + ulCount: CK_ULONG, + phKey: CK_OBJECT_HANDLE_PTR, + ) -> CK_RV, +>; +pub type CK_C_GenerateKeyPair = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + pPublicKeyTemplate: CK_ATTRIBUTE_PTR, + ulPublicKeyAttributeCount: CK_ULONG, + pPrivateKeyTemplate: CK_ATTRIBUTE_PTR, + ulPrivateKeyAttributeCount: CK_ULONG, + phPublicKey: CK_OBJECT_HANDLE_PTR, + phPrivateKey: CK_OBJECT_HANDLE_PTR, + ) -> CK_RV, +>; +pub type CK_C_WrapKey = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hWrappingKey: CK_OBJECT_HANDLE, + hKey: CK_OBJECT_HANDLE, + pWrappedKey: CK_BYTE_PTR, + pulWrappedKeyLen: CK_ULONG_PTR, + ) -> CK_RV, +>; +pub type CK_C_UnwrapKey = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hUnwrappingKey: CK_OBJECT_HANDLE, + pWrappedKey: CK_BYTE_PTR, + ulWrappedKeyLen: CK_ULONG, + pTemplate: CK_ATTRIBUTE_PTR, + ulAttributeCount: CK_ULONG, + phKey: CK_OBJECT_HANDLE_PTR, + ) -> CK_RV, +>; pub type CK_C_DeriveKey = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - base_key: CK_OBJECT_HANDLE, - templ: *mut _CK_ATTRIBUTE, - attribute_count: ::std::os::raw::c_ulong, - key: *mut CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hBaseKey: CK_OBJECT_HANDLE, + pTemplate: CK_ATTRIBUTE_PTR, + ulAttributeCount: CK_ULONG, + phKey: CK_OBJECT_HANDLE_PTR, ) -> CK_RV, >; pub type CK_C_SeedRandom = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - seed: *mut ::std::os::raw::c_uchar, - seed_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pSeed: CK_BYTE_PTR, + ulSeedLen: CK_ULONG, ) -> CK_RV, >; pub type CK_C_GenerateRandom = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - random_data: *mut ::std::os::raw::c_uchar, - random_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + RandomData: CK_BYTE_PTR, + ulRandomLen: CK_ULONG, ) -> CK_RV, >; pub type CK_C_GetFunctionStatus = - ::std::option::Option CK_RV>; + ::std::option::Option CK_RV>; pub type CK_C_CancelFunction = - ::std::option::Option CK_RV>; + ::std::option::Option CK_RV>; +pub type CK_C_WaitForSlotEvent = ::std::option::Option< + unsafe extern "C" fn(flags: CK_FLAGS, pSlot: CK_SLOT_ID_PTR, pRserved: CK_VOID_PTR) -> CK_RV, +>; +pub type CK_C_GetInterfaceList = ::std::option::Option< + unsafe extern "C" fn(pInterfacesList: CK_INTERFACE_PTR, pulCount: CK_ULONG_PTR) -> CK_RV, +>; +pub type CK_C_GetInterface = ::std::option::Option< + unsafe extern "C" fn( + pInterfaceName: CK_UTF8CHAR_PTR, + pVersion: CK_VERSION_PTR, + ppInterface: CK_INTERFACE_PTR_PTR, + flags: CK_FLAGS, + ) -> CK_RV, +>; +pub type CK_C_LoginUser = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + userType: CK_USER_TYPE, + pPin: CK_UTF8CHAR_PTR, + ulPinLen: CK_ULONG, + pUsername: CK_UTF8CHAR_PTR, + ulUsernameLen: CK_ULONG, + ) -> CK_RV, +>; +pub type CK_C_SessionCancel = ::std::option::Option< + unsafe extern "C" fn(hSession: CK_SESSION_HANDLE, flags: CK_FLAGS) -> CK_RV, +>; +pub type CK_C_MessageEncryptInit = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, + ) -> CK_RV, +>; +pub type CK_C_EncryptMessage = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pAssociatedData: CK_BYTE_PTR, + ulAssociatedDataLen: CK_ULONG, + pPlaintext: CK_BYTE_PTR, + ulPlaintextLen: CK_ULONG, + pCiphertext: CK_BYTE_PTR, + pulCiphertextLen: CK_ULONG_PTR, + ) -> CK_RV, +>; +pub type CK_C_EncryptMessageBegin = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pAssociatedData: CK_BYTE_PTR, + ulAssociatedDataLen: CK_ULONG, + ) -> CK_RV, +>; +pub type CK_C_EncryptMessageNext = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pPlaintextPart: CK_BYTE_PTR, + ulPlaintextPartLen: CK_ULONG, + pCiphertextPart: CK_BYTE_PTR, + pulCiphertextPartLen: CK_ULONG_PTR, + flags: CK_FLAGS, + ) -> CK_RV, +>; +pub type CK_C_MessageEncryptFinal = + ::std::option::Option CK_RV>; +pub type CK_C_MessageDecryptInit = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, + ) -> CK_RV, +>; +pub type CK_C_DecryptMessage = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pAssociatedData: CK_BYTE_PTR, + ulAssociatedDataLen: CK_ULONG, + pCiphertext: CK_BYTE_PTR, + ulCiphertextLen: CK_ULONG, + pPlaintext: CK_BYTE_PTR, + pulPlaintextLen: CK_ULONG_PTR, + ) -> CK_RV, +>; +pub type CK_C_DecryptMessageBegin = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pAssociatedData: CK_BYTE_PTR, + ulAssociatedDataLen: CK_ULONG, + ) -> CK_RV, +>; +pub type CK_C_DecryptMessageNext = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pCiphertext: CK_BYTE_PTR, + ulCiphertextLen: CK_ULONG, + pPlaintext: CK_BYTE_PTR, + pulPlaintextLen: CK_ULONG_PTR, + flags: CK_FLAGS, + ) -> CK_RV, +>; +pub type CK_C_MessageDecryptFinal = + ::std::option::Option CK_RV>; +pub type CK_C_MessageSignInit = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, + ) -> CK_RV, +>; +pub type CK_C_SignMessage = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + pulSignatureLen: CK_ULONG_PTR, + ) -> CK_RV, +>; +pub type CK_C_SignMessageBegin = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + ) -> CK_RV, +>; +pub type CK_C_SignMessageNext = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + pulSignatureLen: CK_ULONG_PTR, + ) -> CK_RV, +>; +pub type CK_C_MessageSignFinal = + ::std::option::Option CK_RV>; +pub type CK_C_MessageVerifyInit = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, + ) -> CK_RV, +>; +pub type CK_C_VerifyMessage = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + ulSignatureLen: CK_ULONG, + ) -> CK_RV, +>; +pub type CK_C_VerifyMessageBegin = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + ) -> CK_RV, +>; +pub type CK_C_VerifyMessageNext = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + ulSignatureLen: CK_ULONG, + ) -> CK_RV, +>; +pub type CK_C_MessageVerifyFinal = + ::std::option::Option CK_RV>; +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct CK_FUNCTION_LIST_3_0 { + pub version: CK_VERSION, + pub C_Initialize: CK_C_Initialize, + pub C_Finalize: CK_C_Finalize, + pub C_GetInfo: CK_C_GetInfo, + pub C_GetFunctionList: CK_C_GetFunctionList, + pub C_GetSlotList: CK_C_GetSlotList, + pub C_GetSlotInfo: CK_C_GetSlotInfo, + pub C_GetTokenInfo: CK_C_GetTokenInfo, + pub C_GetMechanismList: CK_C_GetMechanismList, + pub C_GetMechanismInfo: CK_C_GetMechanismInfo, + pub C_InitToken: CK_C_InitToken, + pub C_InitPIN: CK_C_InitPIN, + pub C_SetPIN: CK_C_SetPIN, + pub C_OpenSession: CK_C_OpenSession, + pub C_CloseSession: CK_C_CloseSession, + pub C_CloseAllSessions: CK_C_CloseAllSessions, + pub C_GetSessionInfo: CK_C_GetSessionInfo, + pub C_GetOperationState: CK_C_GetOperationState, + pub C_SetOperationState: CK_C_SetOperationState, + pub C_Login: CK_C_Login, + pub C_Logout: CK_C_Logout, + pub C_CreateObject: CK_C_CreateObject, + pub C_CopyObject: CK_C_CopyObject, + pub C_DestroyObject: CK_C_DestroyObject, + pub C_GetObjectSize: CK_C_GetObjectSize, + pub C_GetAttributeValue: CK_C_GetAttributeValue, + pub C_SetAttributeValue: CK_C_SetAttributeValue, + pub C_FindObjectsInit: CK_C_FindObjectsInit, + pub C_FindObjects: CK_C_FindObjects, + pub C_FindObjectsFinal: CK_C_FindObjectsFinal, + pub C_EncryptInit: CK_C_EncryptInit, + pub C_Encrypt: CK_C_Encrypt, + pub C_EncryptUpdate: CK_C_EncryptUpdate, + pub C_EncryptFinal: CK_C_EncryptFinal, + pub C_DecryptInit: CK_C_DecryptInit, + pub C_Decrypt: CK_C_Decrypt, + pub C_DecryptUpdate: CK_C_DecryptUpdate, + pub C_DecryptFinal: CK_C_DecryptFinal, + pub C_DigestInit: CK_C_DigestInit, + pub C_Digest: CK_C_Digest, + pub C_DigestUpdate: CK_C_DigestUpdate, + pub C_DigestKey: CK_C_DigestKey, + pub C_DigestFinal: CK_C_DigestFinal, + pub C_SignInit: CK_C_SignInit, + pub C_Sign: CK_C_Sign, + pub C_SignUpdate: CK_C_SignUpdate, + pub C_SignFinal: CK_C_SignFinal, + pub C_SignRecoverInit: CK_C_SignRecoverInit, + pub C_SignRecover: CK_C_SignRecover, + pub C_VerifyInit: CK_C_VerifyInit, + pub C_Verify: CK_C_Verify, + pub C_VerifyUpdate: CK_C_VerifyUpdate, + pub C_VerifyFinal: CK_C_VerifyFinal, + pub C_VerifyRecoverInit: CK_C_VerifyRecoverInit, + pub C_VerifyRecover: CK_C_VerifyRecover, + pub C_DigestEncryptUpdate: CK_C_DigestEncryptUpdate, + pub C_DecryptDigestUpdate: CK_C_DecryptDigestUpdate, + pub C_SignEncryptUpdate: CK_C_SignEncryptUpdate, + pub C_DecryptVerifyUpdate: CK_C_DecryptVerifyUpdate, + pub C_GenerateKey: CK_C_GenerateKey, + pub C_GenerateKeyPair: CK_C_GenerateKeyPair, + pub C_WrapKey: CK_C_WrapKey, + pub C_UnwrapKey: CK_C_UnwrapKey, + pub C_DeriveKey: CK_C_DeriveKey, + pub C_SeedRandom: CK_C_SeedRandom, + pub C_GenerateRandom: CK_C_GenerateRandom, + pub C_GetFunctionStatus: CK_C_GetFunctionStatus, + pub C_CancelFunction: CK_C_CancelFunction, + pub C_WaitForSlotEvent: CK_C_WaitForSlotEvent, + pub C_GetInterfaceList: CK_C_GetInterfaceList, + pub C_GetInterface: CK_C_GetInterface, + pub C_LoginUser: CK_C_LoginUser, + pub C_SessionCancel: CK_C_SessionCancel, + pub C_MessageEncryptInit: CK_C_MessageEncryptInit, + pub C_EncryptMessage: CK_C_EncryptMessage, + pub C_EncryptMessageBegin: CK_C_EncryptMessageBegin, + pub C_EncryptMessageNext: CK_C_EncryptMessageNext, + pub C_MessageEncryptFinal: CK_C_MessageEncryptFinal, + pub C_MessageDecryptInit: CK_C_MessageDecryptInit, + pub C_DecryptMessage: CK_C_DecryptMessage, + pub C_DecryptMessageBegin: CK_C_DecryptMessageBegin, + pub C_DecryptMessageNext: CK_C_DecryptMessageNext, + pub C_MessageDecryptFinal: CK_C_MessageDecryptFinal, + pub C_MessageSignInit: CK_C_MessageSignInit, + pub C_SignMessage: CK_C_SignMessage, + pub C_SignMessageBegin: CK_C_SignMessageBegin, + pub C_SignMessageNext: CK_C_SignMessageNext, + pub C_MessageSignFinal: CK_C_MessageSignFinal, + pub C_MessageVerifyInit: CK_C_MessageVerifyInit, + pub C_VerifyMessage: CK_C_VerifyMessage, + pub C_VerifyMessageBegin: CK_C_VerifyMessageBegin, + 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::(), + 372usize, + concat!("Size of: ", stringify!(CK_FUNCTION_LIST_3_0)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + 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 }, + 4usize, + 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 }, + 8usize, + 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 }, + 12usize, + 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 }, + 16usize, + 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 }, + 20usize, + 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 }, + 24usize, + 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 }, + 28usize, + 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 }, + 32usize, + 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 }, + 36usize, + 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 }, + 40usize, + 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 }, + 44usize, + 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 }, + 48usize, + 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 }, + 52usize, + 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 }, + 56usize, + 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 }, + 60usize, + 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 }, + 64usize, + 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 }, + 68usize, + 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 }, + 72usize, + 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 }, + 76usize, + 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 }, + 80usize, + 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 }, + 84usize, + 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 }, + 88usize, + 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 }, + 92usize, + 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 }, + 96usize, + 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 }, + 100usize, + 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 }, + 104usize, + 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 }, + 108usize, + 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 }, + 112usize, + 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 }, + 116usize, + 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 }, + 120usize, + 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 }, + 124usize, + 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 }, + 128usize, + 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 }, + 132usize, + 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 }, + 136usize, + 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 }, + 140usize, + 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 }, + 144usize, + 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 }, + 148usize, + 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 }, + 152usize, + 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 }, + 156usize, + 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 }, + 160usize, + 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 }, + 164usize, + 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 }, + 168usize, + 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 }, + 172usize, + 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 }, + 176usize, + 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 }, + 180usize, + 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 }, + 184usize, + 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 }, + 188usize, + 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 }, + 192usize, + 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 }, + 196usize, + 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 }, + 200usize, + 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 }, + 204usize, + 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 }, + 208usize, + 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 }, + 212usize, + 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 }, + 216usize, + 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 }, + 220usize, + 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 }, + 224usize, + 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 }, + 228usize, + 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 }, + 232usize, + 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 }, + 236usize, + 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 }, + 240usize, + 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 }, + 244usize, + 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 }, + 248usize, + 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 }, + 252usize, + 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 }, + 256usize, + 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 }, + 260usize, + 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 }, + 264usize, + 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 }, + 268usize, + 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 }, + 272usize, + 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 }, + 276usize, + 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 }, + 280usize, + 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 }, + 284usize, + 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 }, + 288usize, + 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 }, + 292usize, + 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 }, + 296usize, + 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 }, + 300usize, + 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 }, + 304usize, + 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 }, + 308usize, + 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 }, + 312usize, + 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 }, + 316usize, + 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 }, + 320usize, + 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 }, + 324usize, + 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 }, + 328usize, + 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 }, + 332usize, + 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 }, + 336usize, + 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 }, + 340usize, + 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 }, + 344usize, + 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 }, + 348usize, + 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 }, + 352usize, + 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 }, + 356usize, + 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 }, + 360usize, + 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 }, + 364usize, + 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 }, + 368usize, + concat!( + "Offset of field: ", + stringify!(CK_FUNCTION_LIST_3_0), + "::", + stringify!(C_MessageVerifyFinal) + ) + ); +} #[repr(C)] #[derive(Debug, Default, Copy, Clone)] -pub struct _CK_FUNCTION_LIST { - pub version: _CK_VERSION, +pub struct CK_FUNCTION_LIST { + pub version: CK_VERSION, pub C_Initialize: CK_C_Initialize, pub C_Finalize: CK_C_Finalize, pub C_GetInfo: CK_C_GetInfo, @@ -2647,25 +9810,25 @@ pub struct _CK_FUNCTION_LIST { pub C_WaitForSlotEvent: CK_C_WaitForSlotEvent, } #[test] -fn bindgen_test_layout__CK_FUNCTION_LIST() { - const UNINIT: ::std::mem::MaybeUninit<_CK_FUNCTION_LIST> = ::std::mem::MaybeUninit::uninit(); +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::<_CK_FUNCTION_LIST>(), + ::std::mem::size_of::(), 276usize, - concat!("Size of: ", stringify!(_CK_FUNCTION_LIST)) + concat!("Size of: ", stringify!(CK_FUNCTION_LIST)) ); assert_eq!( - ::std::mem::align_of::<_CK_FUNCTION_LIST>(), + ::std::mem::align_of::(), 4usize, - concat!("Alignment of ", stringify!(_CK_FUNCTION_LIST)) + 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!(CK_FUNCTION_LIST), "::", stringify!(version) ) @@ -2675,7 +9838,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 4usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_Initialize) ) @@ -2685,7 +9848,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 8usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_Finalize) ) @@ -2695,7 +9858,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 12usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_GetInfo) ) @@ -2705,7 +9868,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 16usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_GetFunctionList) ) @@ -2715,7 +9878,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 20usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_GetSlotList) ) @@ -2725,7 +9888,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 24usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_GetSlotInfo) ) @@ -2735,7 +9898,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 28usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_GetTokenInfo) ) @@ -2745,7 +9908,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 32usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_GetMechanismList) ) @@ -2755,7 +9918,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 36usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_GetMechanismInfo) ) @@ -2765,7 +9928,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 40usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_InitToken) ) @@ -2775,7 +9938,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 44usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_InitPIN) ) @@ -2785,7 +9948,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 48usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_SetPIN) ) @@ -2795,7 +9958,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 52usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_OpenSession) ) @@ -2805,7 +9968,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 56usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_CloseSession) ) @@ -2815,7 +9978,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 60usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_CloseAllSessions) ) @@ -2825,7 +9988,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 64usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_GetSessionInfo) ) @@ -2835,7 +9998,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 68usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_GetOperationState) ) @@ -2845,7 +10008,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 72usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_SetOperationState) ) @@ -2855,7 +10018,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 76usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_Login) ) @@ -2865,7 +10028,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 80usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_Logout) ) @@ -2875,7 +10038,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 84usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_CreateObject) ) @@ -2885,7 +10048,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 88usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_CopyObject) ) @@ -2895,7 +10058,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 92usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_DestroyObject) ) @@ -2905,7 +10068,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 96usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_GetObjectSize) ) @@ -2915,7 +10078,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 100usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_GetAttributeValue) ) @@ -2925,7 +10088,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 104usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_SetAttributeValue) ) @@ -2935,7 +10098,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 108usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_FindObjectsInit) ) @@ -2945,7 +10108,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 112usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_FindObjects) ) @@ -2955,7 +10118,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 116usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_FindObjectsFinal) ) @@ -2965,7 +10128,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 120usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_EncryptInit) ) @@ -2975,7 +10138,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 124usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_Encrypt) ) @@ -2985,7 +10148,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 128usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_EncryptUpdate) ) @@ -2995,7 +10158,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 132usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_EncryptFinal) ) @@ -3005,7 +10168,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 136usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_DecryptInit) ) @@ -3015,7 +10178,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 140usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_Decrypt) ) @@ -3025,7 +10188,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 144usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_DecryptUpdate) ) @@ -3035,7 +10198,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 148usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_DecryptFinal) ) @@ -3045,7 +10208,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 152usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_DigestInit) ) @@ -3055,7 +10218,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 156usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_Digest) ) @@ -3065,7 +10228,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 160usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_DigestUpdate) ) @@ -3075,7 +10238,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 164usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_DigestKey) ) @@ -3085,7 +10248,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 168usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_DigestFinal) ) @@ -3095,7 +10258,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 172usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_SignInit) ) @@ -3105,7 +10268,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 176usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_Sign) ) @@ -3115,7 +10278,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 180usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_SignUpdate) ) @@ -3125,7 +10288,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 184usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_SignFinal) ) @@ -3135,7 +10298,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 188usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_SignRecoverInit) ) @@ -3145,7 +10308,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 192usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_SignRecover) ) @@ -3155,7 +10318,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 196usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_VerifyInit) ) @@ -3165,7 +10328,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 200usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_Verify) ) @@ -3175,7 +10338,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 204usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_VerifyUpdate) ) @@ -3185,7 +10348,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 208usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_VerifyFinal) ) @@ -3195,7 +10358,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 212usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_VerifyRecoverInit) ) @@ -3205,7 +10368,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 216usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_VerifyRecover) ) @@ -3215,7 +10378,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 220usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_DigestEncryptUpdate) ) @@ -3225,7 +10388,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 224usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_DecryptDigestUpdate) ) @@ -3235,7 +10398,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 228usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_SignEncryptUpdate) ) @@ -3245,7 +10408,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 232usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_DecryptVerifyUpdate) ) @@ -3255,7 +10418,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 236usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_GenerateKey) ) @@ -3265,7 +10428,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 240usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_GenerateKeyPair) ) @@ -3275,7 +10438,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 244usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_WrapKey) ) @@ -3285,7 +10448,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 248usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_UnwrapKey) ) @@ -3295,7 +10458,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 252usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_DeriveKey) ) @@ -3305,7 +10468,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 256usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_SeedRandom) ) @@ -3315,7 +10478,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 260usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_GenerateRandom) ) @@ -3325,7 +10488,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 264usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_GetFunctionStatus) ) @@ -3335,7 +10498,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 268usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_CancelFunction) ) @@ -3345,223 +10508,45 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 272usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), - "::", - stringify!(C_WaitForSlotEvent) - ) - ); -} -pub type CK_CREATEMUTEX = - ::std::option::Option CK_RV>; -pub type CK_DESTROYMUTEX = - ::std::option::Option CK_RV>; -pub type CK_LOCKMUTEX = - ::std::option::Option CK_RV>; -pub type CK_UNLOCKMUTEX = - ::std::option::Option CK_RV>; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct _CK_C_INITIALIZE_ARGS { - pub CreateMutex: CK_CREATEMUTEX, - pub DestroyMutex: CK_DESTROYMUTEX, - pub LockMutex: CK_LOCKMUTEX, - pub UnlockMutex: CK_UNLOCKMUTEX, - pub flags: CK_FLAGS, - pub pReserved: *mut ::std::os::raw::c_void, -} -#[test] -fn bindgen_test_layout__CK_C_INITIALIZE_ARGS() { - const UNINIT: ::std::mem::MaybeUninit<_CK_C_INITIALIZE_ARGS> = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<_CK_C_INITIALIZE_ARGS>(), - 24usize, - concat!("Size of: ", stringify!(_CK_C_INITIALIZE_ARGS)) - ); - assert_eq!( - ::std::mem::align_of::<_CK_C_INITIALIZE_ARGS>(), - 4usize, - 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 }, - 4usize, - 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 }, - 8usize, - 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 }, - 12usize, - 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 }, - 16usize, - 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 }, - 20usize, - concat!( - "Offset of field: ", - stringify!(_CK_C_INITIALIZE_ARGS), + stringify!(CK_FUNCTION_LIST), "::", - stringify!(pReserved) - ) - ); -} -impl Default for _CK_C_INITIALIZE_ARGS { - fn default() -> Self { - let mut s = ::std::mem::MaybeUninit::::uninit(); - unsafe { - ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -pub type CK_BYTE = ::std::os::raw::c_uchar; -pub type CK_CHAR = ::std::os::raw::c_uchar; -pub type CK_UTF8CHAR = ::std::os::raw::c_uchar; -pub type CK_BBOOL = ::std::os::raw::c_uchar; -pub type CK_ULONG = ::std::os::raw::c_ulong; -pub type CK_LONG = ::std::os::raw::c_long; -pub type CK_BYTE_PTR = *mut CK_BYTE; -pub type CK_CHAR_PTR = *mut CK_CHAR; -pub type CK_UTF8CHAR_PTR = *mut CK_UTF8CHAR; -pub type CK_ULONG_PTR = *mut CK_ULONG; -pub type CK_VOID_PTR = *mut ::std::os::raw::c_void; -pub type CK_VOID_PTR_PTR = *mut *mut ::std::os::raw::c_void; -pub type CK_VERSION = _CK_VERSION; -pub type CK_VERSION_PTR = *mut _CK_VERSION; -pub type CK_INFO = _CK_INFO; -pub type CK_INFO_PTR = *mut _CK_INFO; -pub type CK_SLOT_ID_PTR = *mut CK_SLOT_ID; -pub type CK_SLOT_INFO = _CK_SLOT_INFO; -pub type CK_SLOT_INFO_PTR = *mut _CK_SLOT_INFO; -pub type CK_TOKEN_INFO = _CK_TOKEN_INFO; -pub type CK_TOKEN_INFO_PTR = *mut _CK_TOKEN_INFO; -pub type CK_SESSION_HANDLE_PTR = *mut CK_SESSION_HANDLE; -pub type CK_SESSION_INFO = _CK_SESSION_INFO; -pub type CK_SESSION_INFO_PTR = *mut _CK_SESSION_INFO; -pub type CK_OBJECT_HANDLE_PTR = *mut CK_OBJECT_HANDLE; -pub type CK_OBJECT_CLASS_PTR = *mut CK_OBJECT_CLASS; -pub type CK_ATTRIBUTE = _CK_ATTRIBUTE; -pub type CK_ATTRIBUTE_PTR = *mut _CK_ATTRIBUTE; -pub type CK_DATE = _CK_DATE; -pub type CK_DATE_PTR = *mut _CK_DATE; -pub type CK_MECHANISM_TYPE_PTR = *mut CK_MECHANISM_TYPE; -pub type CK_MECHANISM = _CK_MECHANISM; -pub type CK_MECHANISM_PTR = *mut _CK_MECHANISM; -pub type CK_MECHANISM_INFO = _CK_MECHANISM_INFO; -pub type CK_MECHANISM_INFO_PTR = *mut _CK_MECHANISM_INFO; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct ck_otp_mechanism_info { - _unused: [u8; 0], -} -pub type CK_OTP_MECHANISM_INFO = ck_otp_mechanism_info; -pub type CK_OTP_MECHANISM_INFO_PTR = *mut ck_otp_mechanism_info; -pub type CK_FUNCTION_LIST = _CK_FUNCTION_LIST; -pub type CK_FUNCTION_LIST_PTR = *mut _CK_FUNCTION_LIST; -pub type CK_FUNCTION_LIST_PTR_PTR = *mut *mut _CK_FUNCTION_LIST; -pub type CK_C_INITIALIZE_ARGS = _CK_C_INITIALIZE_ARGS; -pub type CK_C_INITIALIZE_ARGS_PTR = *mut _CK_C_INITIALIZE_ARGS; -pub type CK_RSA_PKCS_PSS_PARAMS = ck_rsa_pkcs_pss_params; -pub type CK_RSA_PKCS_PSS_PARAMS_PTR = *mut ck_rsa_pkcs_pss_params; -pub type CK_RSA_PKCS_OAEP_PARAMS = ck_rsa_pkcs_oaep_params; -pub type CK_RSA_PKCS_OAEP_PARAMS_PTR = *mut ck_rsa_pkcs_oaep_params; -pub type CK_AES_CTR_PARAMS = ck_aes_ctr_params; -pub type CK_AES_CTR_PARAMS_PTR = *mut ck_aes_ctr_params; -pub type CK_GCM_PARAMS = ck_gcm_params; -pub type CK_GCM_PARAMS_PTR = *mut ck_gcm_params; -pub type CK_ECDH1_DERIVE_PARAMS = ck_ecdh1_derive_params; -pub type CK_ECDH1_DERIVE_PARAMS_PTR = *mut ck_ecdh1_derive_params; -pub type CK_KEY_DERIVATION_STRING_DATA = ck_key_derivation_string_data; -pub type CK_KEY_DERIVATION_STRING_DATA_PTR = *mut ck_key_derivation_string_data; -pub type CK_DES_CBC_ENCRYPT_DATA_PARAMS = ck_des_cbc_encrypt_data_params; -pub type CK_DES_CBC_ENCRYPT_DATA_PARAMS_PTR = *mut ck_des_cbc_encrypt_data_params; -pub type CK_AES_CBC_ENCRYPT_DATA_PARAMS = ck_aes_cbc_encrypt_data_params; -pub type CK_AES_CBC_ENCRYPT_DATA_PARAMS_PTR = *mut ck_aes_cbc_encrypt_data_params; + stringify!(C_WaitForSlotEvent) + ) + ); +} extern crate libloading; pub struct Pkcs11 { __library: ::libloading::Library, - pub C_Initialize: Result< - unsafe extern "C" fn(init_args: *mut ::std::os::raw::c_void) -> CK_RV, - ::libloading::Error, - >, - pub C_Finalize: Result< - unsafe extern "C" fn(pReserved: *mut ::std::os::raw::c_void) -> CK_RV, - ::libloading::Error, - >, - pub C_GetInfo: Result CK_RV, ::libloading::Error>, + pub C_Initialize: + Result CK_RV, ::libloading::Error>, + pub C_Finalize: + Result CK_RV, ::libloading::Error>, + pub C_GetInfo: Result CK_RV, ::libloading::Error>, pub C_GetFunctionList: Result< - unsafe extern "C" fn(function_list: *mut *mut _CK_FUNCTION_LIST) -> CK_RV, + unsafe extern "C" fn(ppFunctionList: CK_FUNCTION_LIST_PTR_PTR) -> CK_RV, ::libloading::Error, >, pub C_GetSlotList: Result< unsafe extern "C" fn( - token_present: ::std::os::raw::c_uchar, - slot_list: *mut CK_SLOT_ID, - ulCount: *mut ::std::os::raw::c_ulong, + tokenPresent: CK_BBOOL, + pSlotList: CK_SLOT_ID_PTR, + pulCount: CK_ULONG_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_GetSlotInfo: Result< - unsafe extern "C" fn(slotID: CK_SLOT_ID, info: *mut _CK_SLOT_INFO) -> CK_RV, + unsafe extern "C" fn(slotID: CK_SLOT_ID, pInfo: CK_SLOT_INFO_PTR) -> CK_RV, ::libloading::Error, >, pub C_GetTokenInfo: Result< - unsafe extern "C" fn(slotID: CK_SLOT_ID, info: *mut _CK_TOKEN_INFO) -> CK_RV, - ::libloading::Error, - >, - pub C_WaitForSlotEvent: Result< - unsafe extern "C" fn( - flags: CK_FLAGS, - slot: *mut CK_SLOT_ID, - pReserved: *mut ::std::os::raw::c_void, - ) -> CK_RV, + unsafe extern "C" fn(slotID: CK_SLOT_ID, pInfo: CK_TOKEN_INFO_PTR) -> CK_RV, ::libloading::Error, >, pub C_GetMechanismList: Result< unsafe extern "C" fn( slotID: CK_SLOT_ID, - mechanism_list: *mut CK_MECHANISM_TYPE, - ulCount: *mut ::std::os::raw::c_ulong, + pMechanismList: CK_MECHANISM_TYPE_PTR, + pulCount: CK_ULONG_PTR, ) -> CK_RV, ::libloading::Error, >, @@ -3569,34 +10554,34 @@ pub struct Pkcs11 { unsafe extern "C" fn( slotID: CK_SLOT_ID, type_: CK_MECHANISM_TYPE, - info: *mut _CK_MECHANISM_INFO, + pInfo: CK_MECHANISM_INFO_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_InitToken: Result< unsafe extern "C" fn( slotID: CK_SLOT_ID, - pin: *mut ::std::os::raw::c_uchar, - pin_len: ::std::os::raw::c_ulong, - label: *mut ::std::os::raw::c_uchar, + pPin: CK_UTF8CHAR_PTR, + ulPinLen: CK_ULONG, + pLabel: CK_UTF8CHAR_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_InitPIN: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - pin: *mut ::std::os::raw::c_uchar, - pin_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pPin: CK_UTF8CHAR_PTR, + ulPinLen: CK_ULONG, ) -> CK_RV, ::libloading::Error, >, pub C_SetPIN: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - old_pin: *mut ::std::os::raw::c_uchar, - old_len: ::std::os::raw::c_ulong, - new_pin: *mut ::std::os::raw::c_uchar, - new_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pOldPin: CK_UTF8CHAR_PTR, + ulOldLen: CK_ULONG, + pNewPin: CK_UTF8CHAR_PTR, + ulNewLen: CK_ULONG, ) -> CK_RV, ::libloading::Error, >, @@ -3604,445 +10589,659 @@ pub struct Pkcs11 { unsafe extern "C" fn( slotID: CK_SLOT_ID, flags: CK_FLAGS, - application: *mut ::std::os::raw::c_void, - notify: CK_NOTIFY, - session: *mut CK_SESSION_HANDLE, + pApplication: CK_VOID_PTR, + Notify: CK_NOTIFY, + phSession: CK_SESSION_HANDLE_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_CloseSession: - Result CK_RV, ::libloading::Error>, + Result CK_RV, ::libloading::Error>, pub C_CloseAllSessions: Result CK_RV, ::libloading::Error>, pub C_GetSessionInfo: Result< - unsafe extern "C" fn(session: CK_SESSION_HANDLE, info: *mut _CK_SESSION_INFO) -> CK_RV, + unsafe extern "C" fn(hSession: CK_SESSION_HANDLE, pInfo: CK_SESSION_INFO_PTR) -> CK_RV, ::libloading::Error, >, pub C_GetOperationState: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - operation_state: *mut ::std::os::raw::c_uchar, - operation_state_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pOperationState: CK_BYTE_PTR, + pulOperationStateLen: CK_ULONG_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_SetOperationState: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - operation_state: *mut ::std::os::raw::c_uchar, - operation_state_len: ::std::os::raw::c_ulong, - encryption_key: CK_OBJECT_HANDLE, - authentiation_key: CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pOperationState: CK_BYTE_PTR, + ulOperationStateLen: CK_ULONG, + hEncryptionKey: CK_OBJECT_HANDLE, + hAuthenticationKey: CK_OBJECT_HANDLE, ) -> CK_RV, ::libloading::Error, >, pub C_Login: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - user_type: CK_USER_TYPE, - pin: *mut ::std::os::raw::c_uchar, - pin_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + userType: CK_USER_TYPE, + pPin: CK_UTF8CHAR_PTR, + ulPinLen: CK_ULONG, ) -> CK_RV, ::libloading::Error, >, pub C_Logout: - Result CK_RV, ::libloading::Error>, + Result CK_RV, ::libloading::Error>, pub C_CreateObject: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - templ: *mut _CK_ATTRIBUTE, - ulCount: ::std::os::raw::c_ulong, - object: *mut CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pTemplate: CK_ATTRIBUTE_PTR, + ulCount: CK_ULONG, + phObject: CK_OBJECT_HANDLE_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_CopyObject: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - object: CK_OBJECT_HANDLE, - templ: *mut _CK_ATTRIBUTE, - ulCount: ::std::os::raw::c_ulong, - new_object: *mut CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + hObject: CK_OBJECT_HANDLE, + pTemplate: CK_ATTRIBUTE_PTR, + ulCount: CK_ULONG, + phNewObject: CK_OBJECT_HANDLE_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_DestroyObject: Result< - unsafe extern "C" fn(session: CK_SESSION_HANDLE, object: CK_OBJECT_HANDLE) -> CK_RV, + unsafe extern "C" fn(hSession: CK_SESSION_HANDLE, hObject: CK_OBJECT_HANDLE) -> CK_RV, ::libloading::Error, >, pub C_GetObjectSize: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - object: CK_OBJECT_HANDLE, - size: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + hObject: CK_OBJECT_HANDLE, + pulSize: CK_ULONG_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_GetAttributeValue: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - object: CK_OBJECT_HANDLE, - templ: *mut _CK_ATTRIBUTE, - ulCount: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + hObject: CK_OBJECT_HANDLE, + pTemplate: CK_ATTRIBUTE_PTR, + ulCount: CK_ULONG, ) -> CK_RV, ::libloading::Error, >, pub C_SetAttributeValue: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - object: CK_OBJECT_HANDLE, - templ: *mut _CK_ATTRIBUTE, - ulCount: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + hObject: CK_OBJECT_HANDLE, + pTemplate: CK_ATTRIBUTE_PTR, + ulCount: CK_ULONG, ) -> CK_RV, ::libloading::Error, >, pub C_FindObjectsInit: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - templ: *mut _CK_ATTRIBUTE, - ulCount: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pTemplate: CK_ATTRIBUTE_PTR, + ulCount: CK_ULONG, ) -> CK_RV, ::libloading::Error, >, pub C_FindObjects: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - object: *mut CK_OBJECT_HANDLE, - max_object_count: ::std::os::raw::c_ulong, - object_count: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + phObject: CK_OBJECT_HANDLE_PTR, + ulMaxObjectCount: CK_ULONG, + pulObjectCount: CK_ULONG_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_FindObjectsFinal: - Result CK_RV, ::libloading::Error>, + Result CK_RV, ::libloading::Error>, pub C_EncryptInit: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - key: CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, ) -> CK_RV, ::libloading::Error, >, pub C_Encrypt: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - data: *mut ::std::os::raw::c_uchar, - data_len: ::std::os::raw::c_ulong, - encrypted_data: *mut ::std::os::raw::c_uchar, - encrypted_data_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pEncryptedData: CK_BYTE_PTR, + pulEncryptedDataLen: CK_ULONG_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_EncryptUpdate: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - part: *mut ::std::os::raw::c_uchar, - part_len: ::std::os::raw::c_ulong, - encrypted_part: *mut ::std::os::raw::c_uchar, - encrypted_part_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pPart: CK_BYTE_PTR, + ulPartLen: CK_ULONG, + pEncryptedPart: CK_BYTE_PTR, + pulEncryptedPartLen: CK_ULONG_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_EncryptFinal: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - last_encrypted_part: *mut ::std::os::raw::c_uchar, - last_encrypted_part_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pLastEncryptedPart: CK_BYTE_PTR, + pulLastEncryptedPartLen: CK_ULONG_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_DecryptInit: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - key: CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, ) -> CK_RV, ::libloading::Error, >, pub C_Decrypt: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - encrypted_data: *mut ::std::os::raw::c_uchar, - encrypted_data_len: ::std::os::raw::c_ulong, - data: *mut ::std::os::raw::c_uchar, - data_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pEncryptedData: CK_BYTE_PTR, + ulEncryptedDataLen: CK_ULONG, + pData: CK_BYTE_PTR, + pulDataLen: CK_ULONG_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_DecryptUpdate: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - encrypted_part: *mut ::std::os::raw::c_uchar, - encrypted_part_len: ::std::os::raw::c_ulong, - part: *mut ::std::os::raw::c_uchar, - part_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pEncryptedPart: CK_BYTE_PTR, + ulEncryptedPartLen: CK_ULONG, + pPart: CK_BYTE_PTR, + pulPartLen: CK_ULONG_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_DecryptFinal: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - last_part: *mut ::std::os::raw::c_uchar, - last_part_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pLastPart: CK_BYTE_PTR, + pulLastPartLen: CK_ULONG_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_DigestInit: Result< - unsafe extern "C" fn(session: CK_SESSION_HANDLE, mechanism: *mut _CK_MECHANISM) -> CK_RV, + unsafe extern "C" fn(hSession: CK_SESSION_HANDLE, pMechanism: CK_MECHANISM_PTR) -> CK_RV, ::libloading::Error, >, pub C_Digest: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - data: *mut ::std::os::raw::c_uchar, - data_len: ::std::os::raw::c_ulong, - digest: *mut ::std::os::raw::c_uchar, - digest_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pDigest: CK_BYTE_PTR, + pulDigestLen: CK_ULONG_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_DigestUpdate: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - part: *mut ::std::os::raw::c_uchar, - part_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pPart: CK_BYTE_PTR, + ulPartLen: CK_ULONG, ) -> CK_RV, ::libloading::Error, >, pub C_DigestKey: Result< - unsafe extern "C" fn(session: CK_SESSION_HANDLE, key: CK_OBJECT_HANDLE) -> CK_RV, + unsafe extern "C" fn(hSession: CK_SESSION_HANDLE, hKey: CK_OBJECT_HANDLE) -> CK_RV, ::libloading::Error, >, pub C_DigestFinal: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - digest: *mut ::std::os::raw::c_uchar, - digest_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pDigest: CK_BYTE_PTR, + pulDigestLen: CK_ULONG_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_SignInit: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - key: CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, ) -> CK_RV, ::libloading::Error, >, pub C_Sign: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - data: *mut ::std::os::raw::c_uchar, - data_len: ::std::os::raw::c_ulong, - signature: *mut ::std::os::raw::c_uchar, - signature_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + pulSignatureLen: CK_ULONG_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_SignUpdate: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - part: *mut ::std::os::raw::c_uchar, - part_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pPart: CK_BYTE_PTR, + ulPartLen: CK_ULONG, ) -> CK_RV, ::libloading::Error, >, pub C_SignFinal: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - signature: *mut ::std::os::raw::c_uchar, - signature_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pSignature: CK_BYTE_PTR, + pulSignatureLen: CK_ULONG_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_SignRecoverInit: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - key: CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, ) -> CK_RV, ::libloading::Error, >, pub C_SignRecover: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - data: *mut ::std::os::raw::c_uchar, - data_len: ::std::os::raw::c_ulong, - signature: *mut ::std::os::raw::c_uchar, - signature_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + pulSignatureLen: CK_ULONG_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_VerifyInit: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - key: CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, ) -> CK_RV, ::libloading::Error, >, pub C_Verify: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - data: *mut ::std::os::raw::c_uchar, - data_len: ::std::os::raw::c_ulong, - signature: *mut ::std::os::raw::c_uchar, - signature_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + ulSignatureLen: CK_ULONG, ) -> CK_RV, ::libloading::Error, >, pub C_VerifyUpdate: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - part: *mut ::std::os::raw::c_uchar, - part_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pPart: CK_BYTE_PTR, + ulPartLen: CK_ULONG, ) -> CK_RV, ::libloading::Error, >, pub C_VerifyFinal: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - signature: *mut ::std::os::raw::c_uchar, - signature_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pSignature: CK_BYTE_PTR, + ulSignatureLen: CK_ULONG, ) -> CK_RV, ::libloading::Error, >, pub C_VerifyRecoverInit: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - key: CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, ) -> CK_RV, ::libloading::Error, >, pub C_VerifyRecover: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - signature: *mut ::std::os::raw::c_uchar, - signature_len: ::std::os::raw::c_ulong, - data: *mut ::std::os::raw::c_uchar, - data_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pSignature: CK_BYTE_PTR, + ulSignatureLen: CK_ULONG, + pData: CK_BYTE_PTR, + pulDataLen: CK_ULONG_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_DigestEncryptUpdate: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - part: *mut ::std::os::raw::c_uchar, - part_len: ::std::os::raw::c_ulong, - encrypted_part: *mut ::std::os::raw::c_uchar, - encrypted_part_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pPart: CK_BYTE_PTR, + ulPartLen: CK_ULONG, + pEncryptedPart: CK_BYTE_PTR, + pulEncryptedPartLen: CK_ULONG_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_DecryptDigestUpdate: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - encrypted_part: *mut ::std::os::raw::c_uchar, - encrypted_part_len: ::std::os::raw::c_ulong, - part: *mut ::std::os::raw::c_uchar, - part_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pEncryptedPart: CK_BYTE_PTR, + ulEncryptedPartLen: CK_ULONG, + pPart: CK_BYTE_PTR, + pulPartLen: CK_ULONG_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_SignEncryptUpdate: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - part: *mut ::std::os::raw::c_uchar, - part_len: ::std::os::raw::c_ulong, - encrypted_part: *mut ::std::os::raw::c_uchar, - encrypted_part_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pPart: CK_BYTE_PTR, + ulPartLen: CK_ULONG, + pEncryptedPart: CK_BYTE_PTR, + pulEncryptedPartLen: CK_ULONG_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_DecryptVerifyUpdate: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - encrypted_part: *mut ::std::os::raw::c_uchar, - encrypted_part_len: ::std::os::raw::c_ulong, - part: *mut ::std::os::raw::c_uchar, - part_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pEncryptedPart: CK_BYTE_PTR, + ulEncryptedPartLen: CK_ULONG, + pPart: CK_BYTE_PTR, + pulPartLen: CK_ULONG_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_GenerateKey: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - templ: *mut _CK_ATTRIBUTE, - ulCount: ::std::os::raw::c_ulong, - key: *mut CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + pTemplate: CK_ATTRIBUTE_PTR, + ulCount: CK_ULONG, + phKey: CK_OBJECT_HANDLE_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_GenerateKeyPair: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - public_key_template: *mut _CK_ATTRIBUTE, - public_key_attribute_count: ::std::os::raw::c_ulong, - private_key_template: *mut _CK_ATTRIBUTE, - private_key_attribute_count: ::std::os::raw::c_ulong, - public_key: *mut CK_OBJECT_HANDLE, - private_key: *mut CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + pPublicKeyTemplate: CK_ATTRIBUTE_PTR, + ulPublicKeyAttributeCount: CK_ULONG, + pPrivateKeyTemplate: CK_ATTRIBUTE_PTR, + ulPrivateKeyAttributeCount: CK_ULONG, + phPublicKey: CK_OBJECT_HANDLE_PTR, + phPrivateKey: CK_OBJECT_HANDLE_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_WrapKey: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - wrapping_key: CK_OBJECT_HANDLE, - key: CK_OBJECT_HANDLE, - wrapped_key: *mut ::std::os::raw::c_uchar, - wrapped_key_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hWrappingKey: CK_OBJECT_HANDLE, + hKey: CK_OBJECT_HANDLE, + pWrappedKey: CK_BYTE_PTR, + pulWrappedKeyLen: CK_ULONG_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_UnwrapKey: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - unwrapping_key: CK_OBJECT_HANDLE, - wrapped_key: *mut ::std::os::raw::c_uchar, - wrapped_key_len: ::std::os::raw::c_ulong, - templ: *mut _CK_ATTRIBUTE, - attribute_count: ::std::os::raw::c_ulong, - key: *mut CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hUnwrappingKey: CK_OBJECT_HANDLE, + pWrappedKey: CK_BYTE_PTR, + ulWrappedKeyLen: CK_ULONG, + pTemplate: CK_ATTRIBUTE_PTR, + ulAttributeCount: CK_ULONG, + phKey: CK_OBJECT_HANDLE_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_DeriveKey: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - base_key: CK_OBJECT_HANDLE, - templ: *mut _CK_ATTRIBUTE, - attribute_count: ::std::os::raw::c_ulong, - key: *mut CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hBaseKey: CK_OBJECT_HANDLE, + pTemplate: CK_ATTRIBUTE_PTR, + ulAttributeCount: CK_ULONG, + phKey: CK_OBJECT_HANDLE_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_SeedRandom: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - seed: *mut ::std::os::raw::c_uchar, - seed_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pSeed: CK_BYTE_PTR, + ulSeedLen: CK_ULONG, ) -> CK_RV, ::libloading::Error, >, pub C_GenerateRandom: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - random_data: *mut ::std::os::raw::c_uchar, - random_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + RandomData: CK_BYTE_PTR, + ulRandomLen: CK_ULONG, ) -> CK_RV, ::libloading::Error, >, pub C_GetFunctionStatus: - Result CK_RV, ::libloading::Error>, + Result CK_RV, ::libloading::Error>, pub C_CancelFunction: - Result CK_RV, ::libloading::Error>, + Result CK_RV, ::libloading::Error>, + pub C_WaitForSlotEvent: Result< + unsafe extern "C" fn( + flags: CK_FLAGS, + pSlot: CK_SLOT_ID_PTR, + pRserved: CK_VOID_PTR, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_GetInterfaceList: Result< + unsafe extern "C" fn(pInterfacesList: CK_INTERFACE_PTR, pulCount: CK_ULONG_PTR) -> CK_RV, + ::libloading::Error, + >, + pub C_GetInterface: Result< + unsafe extern "C" fn( + pInterfaceName: CK_UTF8CHAR_PTR, + pVersion: CK_VERSION_PTR, + ppInterface: CK_INTERFACE_PTR_PTR, + flags: CK_FLAGS, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_LoginUser: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + userType: CK_USER_TYPE, + pPin: CK_UTF8CHAR_PTR, + ulPinLen: CK_ULONG, + pUsername: CK_UTF8CHAR_PTR, + ulUsernameLen: CK_ULONG, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_SessionCancel: Result< + unsafe extern "C" fn(hSession: CK_SESSION_HANDLE, flags: CK_FLAGS) -> CK_RV, + ::libloading::Error, + >, + pub C_MessageEncryptInit: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_EncryptMessage: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pAssociatedData: CK_BYTE_PTR, + ulAssociatedDataLen: CK_ULONG, + pPlaintext: CK_BYTE_PTR, + ulPlaintextLen: CK_ULONG, + pCiphertext: CK_BYTE_PTR, + pulCiphertextLen: CK_ULONG_PTR, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_EncryptMessageBegin: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pAssociatedData: CK_BYTE_PTR, + ulAssociatedDataLen: CK_ULONG, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_EncryptMessageNext: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pPlaintextPart: CK_BYTE_PTR, + ulPlaintextPartLen: CK_ULONG, + pCiphertextPart: CK_BYTE_PTR, + pulCiphertextPartLen: CK_ULONG_PTR, + flags: CK_FLAGS, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_MessageEncryptFinal: + Result CK_RV, ::libloading::Error>, + pub C_MessageDecryptInit: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_DecryptMessage: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pAssociatedData: CK_BYTE_PTR, + ulAssociatedDataLen: CK_ULONG, + pCiphertext: CK_BYTE_PTR, + ulCiphertextLen: CK_ULONG, + pPlaintext: CK_BYTE_PTR, + pulPlaintextLen: CK_ULONG_PTR, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_DecryptMessageBegin: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pAssociatedData: CK_BYTE_PTR, + ulAssociatedDataLen: CK_ULONG, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_DecryptMessageNext: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pCiphertext: CK_BYTE_PTR, + ulCiphertextLen: CK_ULONG, + pPlaintext: CK_BYTE_PTR, + pulPlaintextLen: CK_ULONG_PTR, + flags: CK_FLAGS, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_MessageDecryptFinal: + Result CK_RV, ::libloading::Error>, + pub C_MessageSignInit: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_SignMessage: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + pulSignatureLen: CK_ULONG_PTR, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_SignMessageBegin: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_SignMessageNext: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + pulSignatureLen: CK_ULONG_PTR, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_MessageSignFinal: + Result CK_RV, ::libloading::Error>, + pub C_MessageVerifyInit: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_VerifyMessage: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + ulSignatureLen: CK_ULONG, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_VerifyMessageBegin: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_VerifyMessageNext: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + ulSignatureLen: CK_ULONG, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_MessageVerifyFinal: + Result CK_RV, ::libloading::Error>, } impl Pkcs11 { pub unsafe fn new

(path: P) -> Result @@ -4064,7 +11263,6 @@ impl Pkcs11 { let C_GetSlotList = __library.get(b"C_GetSlotList\0").map(|sym| *sym); let C_GetSlotInfo = __library.get(b"C_GetSlotInfo\0").map(|sym| *sym); let C_GetTokenInfo = __library.get(b"C_GetTokenInfo\0").map(|sym| *sym); - let C_WaitForSlotEvent = __library.get(b"C_WaitForSlotEvent\0").map(|sym| *sym); let C_GetMechanismList = __library.get(b"C_GetMechanismList\0").map(|sym| *sym); let C_GetMechanismInfo = __library.get(b"C_GetMechanismInfo\0").map(|sym| *sym); let C_InitToken = __library.get(b"C_InitToken\0").map(|sym| *sym); @@ -4125,6 +11323,31 @@ impl Pkcs11 { let C_GenerateRandom = __library.get(b"C_GenerateRandom\0").map(|sym| *sym); let C_GetFunctionStatus = __library.get(b"C_GetFunctionStatus\0").map(|sym| *sym); let C_CancelFunction = __library.get(b"C_CancelFunction\0").map(|sym| *sym); + let C_WaitForSlotEvent = __library.get(b"C_WaitForSlotEvent\0").map(|sym| *sym); + let C_GetInterfaceList = __library.get(b"C_GetInterfaceList\0").map(|sym| *sym); + let C_GetInterface = __library.get(b"C_GetInterface\0").map(|sym| *sym); + let C_LoginUser = __library.get(b"C_LoginUser\0").map(|sym| *sym); + let C_SessionCancel = __library.get(b"C_SessionCancel\0").map(|sym| *sym); + let C_MessageEncryptInit = __library.get(b"C_MessageEncryptInit\0").map(|sym| *sym); + let C_EncryptMessage = __library.get(b"C_EncryptMessage\0").map(|sym| *sym); + let C_EncryptMessageBegin = __library.get(b"C_EncryptMessageBegin\0").map(|sym| *sym); + let C_EncryptMessageNext = __library.get(b"C_EncryptMessageNext\0").map(|sym| *sym); + let C_MessageEncryptFinal = __library.get(b"C_MessageEncryptFinal\0").map(|sym| *sym); + let C_MessageDecryptInit = __library.get(b"C_MessageDecryptInit\0").map(|sym| *sym); + let C_DecryptMessage = __library.get(b"C_DecryptMessage\0").map(|sym| *sym); + let C_DecryptMessageBegin = __library.get(b"C_DecryptMessageBegin\0").map(|sym| *sym); + let C_DecryptMessageNext = __library.get(b"C_DecryptMessageNext\0").map(|sym| *sym); + let C_MessageDecryptFinal = __library.get(b"C_MessageDecryptFinal\0").map(|sym| *sym); + let C_MessageSignInit = __library.get(b"C_MessageSignInit\0").map(|sym| *sym); + let C_SignMessage = __library.get(b"C_SignMessage\0").map(|sym| *sym); + let C_SignMessageBegin = __library.get(b"C_SignMessageBegin\0").map(|sym| *sym); + let C_SignMessageNext = __library.get(b"C_SignMessageNext\0").map(|sym| *sym); + let C_MessageSignFinal = __library.get(b"C_MessageSignFinal\0").map(|sym| *sym); + let C_MessageVerifyInit = __library.get(b"C_MessageVerifyInit\0").map(|sym| *sym); + let C_VerifyMessage = __library.get(b"C_VerifyMessage\0").map(|sym| *sym); + let C_VerifyMessageBegin = __library.get(b"C_VerifyMessageBegin\0").map(|sym| *sym); + let C_VerifyMessageNext = __library.get(b"C_VerifyMessageNext\0").map(|sym| *sym); + let C_MessageVerifyFinal = __library.get(b"C_MessageVerifyFinal\0").map(|sym| *sym); Ok(Pkcs11 { __library, C_Initialize, @@ -4134,7 +11357,6 @@ impl Pkcs11 { C_GetSlotList, C_GetSlotInfo, C_GetTokenInfo, - C_WaitForSlotEvent, C_GetMechanismList, C_GetMechanismInfo, C_InitToken, @@ -4195,146 +11417,164 @@ impl Pkcs11 { C_GenerateRandom, C_GetFunctionStatus, C_CancelFunction, + C_WaitForSlotEvent, + C_GetInterfaceList, + C_GetInterface, + C_LoginUser, + C_SessionCancel, + C_MessageEncryptInit, + C_EncryptMessage, + C_EncryptMessageBegin, + C_EncryptMessageNext, + C_MessageEncryptFinal, + C_MessageDecryptInit, + C_DecryptMessage, + C_DecryptMessageBegin, + C_DecryptMessageNext, + C_MessageDecryptFinal, + C_MessageSignInit, + C_SignMessage, + C_SignMessageBegin, + C_SignMessageNext, + C_MessageSignFinal, + C_MessageVerifyInit, + C_VerifyMessage, + C_VerifyMessageBegin, + C_VerifyMessageNext, + C_MessageVerifyFinal, }) } - pub unsafe fn C_Initialize(&self, init_args: *mut ::std::os::raw::c_void) -> CK_RV { + pub unsafe fn C_Initialize(&self, pInitArgs: CK_VOID_PTR) -> CK_RV { (self .C_Initialize .as_ref() - .expect("Expected function, got error."))(init_args) + .expect("Expected function, got error."))(pInitArgs) } - pub unsafe fn C_Finalize(&self, pReserved: *mut ::std::os::raw::c_void) -> CK_RV { + pub unsafe fn C_Finalize(&self, pReserved: CK_VOID_PTR) -> CK_RV { (self .C_Finalize .as_ref() .expect("Expected function, got error."))(pReserved) } - pub unsafe fn C_GetInfo(&self, info: *mut _CK_INFO) -> CK_RV { + pub unsafe fn C_GetInfo(&self, pInfo: CK_INFO_PTR) -> CK_RV { (self .C_GetInfo .as_ref() - .expect("Expected function, got error."))(info) + .expect("Expected function, got error."))(pInfo) } - pub unsafe fn C_GetFunctionList(&self, function_list: *mut *mut _CK_FUNCTION_LIST) -> CK_RV { + pub unsafe fn C_GetFunctionList(&self, ppFunctionList: CK_FUNCTION_LIST_PTR_PTR) -> CK_RV { (self .C_GetFunctionList .as_ref() - .expect("Expected function, got error."))(function_list) + .expect("Expected function, got error."))(ppFunctionList) } pub unsafe fn C_GetSlotList( &self, - token_present: ::std::os::raw::c_uchar, - slot_list: *mut CK_SLOT_ID, - ulCount: *mut ::std::os::raw::c_ulong, + tokenPresent: CK_BBOOL, + pSlotList: CK_SLOT_ID_PTR, + pulCount: CK_ULONG_PTR, ) -> CK_RV { (self .C_GetSlotList .as_ref() - .expect("Expected function, got error."))(token_present, slot_list, ulCount) + .expect("Expected function, got error."))(tokenPresent, pSlotList, pulCount) } - pub unsafe fn C_GetSlotInfo(&self, slotID: CK_SLOT_ID, info: *mut _CK_SLOT_INFO) -> CK_RV { + pub unsafe fn C_GetSlotInfo(&self, slotID: CK_SLOT_ID, pInfo: CK_SLOT_INFO_PTR) -> CK_RV { (self .C_GetSlotInfo .as_ref() - .expect("Expected function, got error."))(slotID, info) + .expect("Expected function, got error."))(slotID, pInfo) } - pub unsafe fn C_GetTokenInfo(&self, slotID: CK_SLOT_ID, info: *mut _CK_TOKEN_INFO) -> CK_RV { + pub unsafe fn C_GetTokenInfo(&self, slotID: CK_SLOT_ID, pInfo: CK_TOKEN_INFO_PTR) -> CK_RV { (self .C_GetTokenInfo .as_ref() - .expect("Expected function, got error."))(slotID, info) - } - pub unsafe fn C_WaitForSlotEvent( - &self, - flags: CK_FLAGS, - slot: *mut CK_SLOT_ID, - pReserved: *mut ::std::os::raw::c_void, - ) -> CK_RV { - (self - .C_WaitForSlotEvent - .as_ref() - .expect("Expected function, got error."))(flags, slot, pReserved) + .expect("Expected function, got error."))(slotID, pInfo) } pub unsafe fn C_GetMechanismList( &self, slotID: CK_SLOT_ID, - mechanism_list: *mut CK_MECHANISM_TYPE, - ulCount: *mut ::std::os::raw::c_ulong, + pMechanismList: CK_MECHANISM_TYPE_PTR, + pulCount: CK_ULONG_PTR, ) -> CK_RV { (self .C_GetMechanismList .as_ref() - .expect("Expected function, got error."))(slotID, mechanism_list, ulCount) + .expect("Expected function, got error."))(slotID, pMechanismList, pulCount) } pub unsafe fn C_GetMechanismInfo( &self, slotID: CK_SLOT_ID, type_: CK_MECHANISM_TYPE, - info: *mut _CK_MECHANISM_INFO, + pInfo: CK_MECHANISM_INFO_PTR, ) -> CK_RV { (self .C_GetMechanismInfo .as_ref() - .expect("Expected function, got error."))(slotID, type_, info) + .expect("Expected function, got error."))(slotID, type_, pInfo) } pub unsafe fn C_InitToken( &self, slotID: CK_SLOT_ID, - pin: *mut ::std::os::raw::c_uchar, - pin_len: ::std::os::raw::c_ulong, - label: *mut ::std::os::raw::c_uchar, + pPin: CK_UTF8CHAR_PTR, + ulPinLen: CK_ULONG, + pLabel: CK_UTF8CHAR_PTR, ) -> CK_RV { (self .C_InitToken .as_ref() - .expect("Expected function, got error."))(slotID, pin, pin_len, label) + .expect("Expected function, got error."))(slotID, pPin, ulPinLen, pLabel) } pub unsafe fn C_InitPIN( &self, - session: CK_SESSION_HANDLE, - pin: *mut ::std::os::raw::c_uchar, - pin_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pPin: CK_UTF8CHAR_PTR, + ulPinLen: CK_ULONG, ) -> CK_RV { (self .C_InitPIN .as_ref() - .expect("Expected function, got error."))(session, pin, pin_len) + .expect("Expected function, got error."))(hSession, pPin, ulPinLen) } pub unsafe fn C_SetPIN( &self, - session: CK_SESSION_HANDLE, - old_pin: *mut ::std::os::raw::c_uchar, - old_len: ::std::os::raw::c_ulong, - new_pin: *mut ::std::os::raw::c_uchar, - new_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pOldPin: CK_UTF8CHAR_PTR, + ulOldLen: CK_ULONG, + pNewPin: CK_UTF8CHAR_PTR, + ulNewLen: CK_ULONG, ) -> CK_RV { (self .C_SetPIN .as_ref() .expect("Expected function, got error."))( - session, old_pin, old_len, new_pin, new_len + hSession, pOldPin, ulOldLen, pNewPin, ulNewLen, ) } pub unsafe fn C_OpenSession( &self, slotID: CK_SLOT_ID, flags: CK_FLAGS, - application: *mut ::std::os::raw::c_void, - notify: CK_NOTIFY, - session: *mut CK_SESSION_HANDLE, + pApplication: CK_VOID_PTR, + Notify: CK_NOTIFY, + phSession: CK_SESSION_HANDLE_PTR, ) -> CK_RV { (self .C_OpenSession .as_ref() .expect("Expected function, got error."))( - slotID, flags, application, notify, session + slotID, + flags, + pApplication, + Notify, + phSession, ) } - pub unsafe fn C_CloseSession(&self, session: CK_SESSION_HANDLE) -> CK_RV { + pub unsafe fn C_CloseSession(&self, hSession: CK_SESSION_HANDLE) -> CK_RV { (self .C_CloseSession .as_ref() - .expect("Expected function, got error."))(session) + .expect("Expected function, got error."))(hSession) } pub unsafe fn C_CloseAllSessions(&self, slotID: CK_SLOT_ID) -> CK_RV { (self @@ -4344,723 +11584,1119 @@ impl Pkcs11 { } pub unsafe fn C_GetSessionInfo( &self, - session: CK_SESSION_HANDLE, - info: *mut _CK_SESSION_INFO, + hSession: CK_SESSION_HANDLE, + pInfo: CK_SESSION_INFO_PTR, ) -> CK_RV { (self .C_GetSessionInfo .as_ref() - .expect("Expected function, got error."))(session, info) + .expect("Expected function, got error."))(hSession, pInfo) } pub unsafe fn C_GetOperationState( &self, - session: CK_SESSION_HANDLE, - operation_state: *mut ::std::os::raw::c_uchar, - operation_state_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pOperationState: CK_BYTE_PTR, + pulOperationStateLen: CK_ULONG_PTR, ) -> CK_RV { (self .C_GetOperationState .as_ref() .expect("Expected function, got error."))( - session, operation_state, operation_state_len + hSession, + pOperationState, + pulOperationStateLen, ) } pub unsafe fn C_SetOperationState( &self, - session: CK_SESSION_HANDLE, - operation_state: *mut ::std::os::raw::c_uchar, - operation_state_len: ::std::os::raw::c_ulong, - encryption_key: CK_OBJECT_HANDLE, - authentiation_key: CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pOperationState: CK_BYTE_PTR, + ulOperationStateLen: CK_ULONG, + hEncryptionKey: CK_OBJECT_HANDLE, + hAuthenticationKey: CK_OBJECT_HANDLE, ) -> CK_RV { (self .C_SetOperationState .as_ref() .expect("Expected function, got error."))( - session, - operation_state, - operation_state_len, - encryption_key, - authentiation_key, + hSession, + pOperationState, + ulOperationStateLen, + hEncryptionKey, + hAuthenticationKey, ) } pub unsafe fn C_Login( &self, - session: CK_SESSION_HANDLE, - user_type: CK_USER_TYPE, - pin: *mut ::std::os::raw::c_uchar, - pin_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + userType: CK_USER_TYPE, + pPin: CK_UTF8CHAR_PTR, + ulPinLen: CK_ULONG, ) -> CK_RV { (self .C_Login .as_ref() - .expect("Expected function, got error."))(session, user_type, pin, pin_len) + .expect("Expected function, got error."))(hSession, userType, pPin, ulPinLen) } - pub unsafe fn C_Logout(&self, session: CK_SESSION_HANDLE) -> CK_RV { + pub unsafe fn C_Logout(&self, hSession: CK_SESSION_HANDLE) -> CK_RV { (self .C_Logout .as_ref() - .expect("Expected function, got error."))(session) + .expect("Expected function, got error."))(hSession) } pub unsafe fn C_CreateObject( &self, - session: CK_SESSION_HANDLE, - templ: *mut _CK_ATTRIBUTE, - ulCount: ::std::os::raw::c_ulong, - object: *mut CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pTemplate: CK_ATTRIBUTE_PTR, + ulCount: CK_ULONG, + phObject: CK_OBJECT_HANDLE_PTR, ) -> CK_RV { (self .C_CreateObject .as_ref() - .expect("Expected function, got error."))(session, templ, ulCount, object) + .expect("Expected function, got error."))(hSession, pTemplate, ulCount, phObject) } pub unsafe fn C_CopyObject( &self, - session: CK_SESSION_HANDLE, - object: CK_OBJECT_HANDLE, - templ: *mut _CK_ATTRIBUTE, - ulCount: ::std::os::raw::c_ulong, - new_object: *mut CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + hObject: CK_OBJECT_HANDLE, + pTemplate: CK_ATTRIBUTE_PTR, + ulCount: CK_ULONG, + phNewObject: CK_OBJECT_HANDLE_PTR, ) -> CK_RV { (self .C_CopyObject .as_ref() .expect("Expected function, got error."))( - session, object, templ, ulCount, new_object + hSession, + hObject, + pTemplate, + ulCount, + phNewObject, ) } pub unsafe fn C_DestroyObject( &self, - session: CK_SESSION_HANDLE, - object: CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + hObject: CK_OBJECT_HANDLE, ) -> CK_RV { (self .C_DestroyObject .as_ref() - .expect("Expected function, got error."))(session, object) + .expect("Expected function, got error."))(hSession, hObject) } pub unsafe fn C_GetObjectSize( &self, - session: CK_SESSION_HANDLE, - object: CK_OBJECT_HANDLE, - size: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + hObject: CK_OBJECT_HANDLE, + pulSize: CK_ULONG_PTR, ) -> CK_RV { (self .C_GetObjectSize .as_ref() - .expect("Expected function, got error."))(session, object, size) + .expect("Expected function, got error."))(hSession, hObject, pulSize) } pub unsafe fn C_GetAttributeValue( &self, - session: CK_SESSION_HANDLE, - object: CK_OBJECT_HANDLE, - templ: *mut _CK_ATTRIBUTE, - ulCount: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + hObject: CK_OBJECT_HANDLE, + pTemplate: CK_ATTRIBUTE_PTR, + ulCount: CK_ULONG, ) -> CK_RV { (self .C_GetAttributeValue .as_ref() - .expect("Expected function, got error."))(session, object, templ, ulCount) + .expect("Expected function, got error."))(hSession, hObject, pTemplate, ulCount) } pub unsafe fn C_SetAttributeValue( &self, - session: CK_SESSION_HANDLE, - object: CK_OBJECT_HANDLE, - templ: *mut _CK_ATTRIBUTE, - ulCount: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + hObject: CK_OBJECT_HANDLE, + pTemplate: CK_ATTRIBUTE_PTR, + ulCount: CK_ULONG, ) -> CK_RV { (self .C_SetAttributeValue .as_ref() - .expect("Expected function, got error."))(session, object, templ, ulCount) + .expect("Expected function, got error."))(hSession, hObject, pTemplate, ulCount) } pub unsafe fn C_FindObjectsInit( &self, - session: CK_SESSION_HANDLE, - templ: *mut _CK_ATTRIBUTE, - ulCount: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pTemplate: CK_ATTRIBUTE_PTR, + ulCount: CK_ULONG, ) -> CK_RV { (self .C_FindObjectsInit .as_ref() - .expect("Expected function, got error."))(session, templ, ulCount) + .expect("Expected function, got error."))(hSession, pTemplate, ulCount) } pub unsafe fn C_FindObjects( &self, - session: CK_SESSION_HANDLE, - object: *mut CK_OBJECT_HANDLE, - max_object_count: ::std::os::raw::c_ulong, - object_count: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + phObject: CK_OBJECT_HANDLE_PTR, + ulMaxObjectCount: CK_ULONG, + pulObjectCount: CK_ULONG_PTR, ) -> CK_RV { (self .C_FindObjects .as_ref() .expect("Expected function, got error."))( - session, - object, - max_object_count, - object_count, + hSession, + phObject, + ulMaxObjectCount, + pulObjectCount, ) } - pub unsafe fn C_FindObjectsFinal(&self, session: CK_SESSION_HANDLE) -> CK_RV { + pub unsafe fn C_FindObjectsFinal(&self, hSession: CK_SESSION_HANDLE) -> CK_RV { (self .C_FindObjectsFinal .as_ref() - .expect("Expected function, got error."))(session) + .expect("Expected function, got error."))(hSession) } pub unsafe fn C_EncryptInit( &self, - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - key: CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, ) -> CK_RV { (self .C_EncryptInit .as_ref() - .expect("Expected function, got error."))(session, mechanism, key) + .expect("Expected function, got error."))(hSession, pMechanism, hKey) } pub unsafe fn C_Encrypt( &self, - session: CK_SESSION_HANDLE, - data: *mut ::std::os::raw::c_uchar, - data_len: ::std::os::raw::c_ulong, - encrypted_data: *mut ::std::os::raw::c_uchar, - encrypted_data_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pEncryptedData: CK_BYTE_PTR, + pulEncryptedDataLen: CK_ULONG_PTR, ) -> CK_RV { (self .C_Encrypt .as_ref() .expect("Expected function, got error."))( - session, - data, - data_len, - encrypted_data, - encrypted_data_len, + hSession, + pData, + ulDataLen, + pEncryptedData, + pulEncryptedDataLen, ) } pub unsafe fn C_EncryptUpdate( &self, - session: CK_SESSION_HANDLE, - part: *mut ::std::os::raw::c_uchar, - part_len: ::std::os::raw::c_ulong, - encrypted_part: *mut ::std::os::raw::c_uchar, - encrypted_part_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pPart: CK_BYTE_PTR, + ulPartLen: CK_ULONG, + pEncryptedPart: CK_BYTE_PTR, + pulEncryptedPartLen: CK_ULONG_PTR, ) -> CK_RV { (self .C_EncryptUpdate .as_ref() .expect("Expected function, got error."))( - session, - part, - part_len, - encrypted_part, - encrypted_part_len, + hSession, + pPart, + ulPartLen, + pEncryptedPart, + pulEncryptedPartLen, ) } pub unsafe fn C_EncryptFinal( &self, - session: CK_SESSION_HANDLE, - last_encrypted_part: *mut ::std::os::raw::c_uchar, - last_encrypted_part_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pLastEncryptedPart: CK_BYTE_PTR, + pulLastEncryptedPartLen: CK_ULONG_PTR, ) -> CK_RV { (self .C_EncryptFinal .as_ref() .expect("Expected function, got error."))( - session, - last_encrypted_part, - last_encrypted_part_len, + hSession, + pLastEncryptedPart, + pulLastEncryptedPartLen, ) } pub unsafe fn C_DecryptInit( &self, - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - key: CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, ) -> CK_RV { (self .C_DecryptInit .as_ref() - .expect("Expected function, got error."))(session, mechanism, key) + .expect("Expected function, got error."))(hSession, pMechanism, hKey) } pub unsafe fn C_Decrypt( &self, - session: CK_SESSION_HANDLE, - encrypted_data: *mut ::std::os::raw::c_uchar, - encrypted_data_len: ::std::os::raw::c_ulong, - data: *mut ::std::os::raw::c_uchar, - data_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pEncryptedData: CK_BYTE_PTR, + ulEncryptedDataLen: CK_ULONG, + pData: CK_BYTE_PTR, + pulDataLen: CK_ULONG_PTR, ) -> CK_RV { (self .C_Decrypt .as_ref() .expect("Expected function, got error."))( - session, - encrypted_data, - encrypted_data_len, - data, - data_len, + hSession, + pEncryptedData, + ulEncryptedDataLen, + pData, + pulDataLen, ) } pub unsafe fn C_DecryptUpdate( &self, - session: CK_SESSION_HANDLE, - encrypted_part: *mut ::std::os::raw::c_uchar, - encrypted_part_len: ::std::os::raw::c_ulong, - part: *mut ::std::os::raw::c_uchar, - part_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pEncryptedPart: CK_BYTE_PTR, + ulEncryptedPartLen: CK_ULONG, + pPart: CK_BYTE_PTR, + pulPartLen: CK_ULONG_PTR, ) -> CK_RV { (self .C_DecryptUpdate .as_ref() .expect("Expected function, got error."))( - session, - encrypted_part, - encrypted_part_len, - part, - part_len, + hSession, + pEncryptedPart, + ulEncryptedPartLen, + pPart, + pulPartLen, ) } pub unsafe fn C_DecryptFinal( &self, - session: CK_SESSION_HANDLE, - last_part: *mut ::std::os::raw::c_uchar, - last_part_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pLastPart: CK_BYTE_PTR, + pulLastPartLen: CK_ULONG_PTR, ) -> CK_RV { (self .C_DecryptFinal .as_ref() - .expect("Expected function, got error."))(session, last_part, last_part_len) + .expect("Expected function, got error."))(hSession, pLastPart, pulLastPartLen) } pub unsafe fn C_DigestInit( &self, - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, ) -> CK_RV { (self .C_DigestInit .as_ref() - .expect("Expected function, got error."))(session, mechanism) + .expect("Expected function, got error."))(hSession, pMechanism) } pub unsafe fn C_Digest( &self, - session: CK_SESSION_HANDLE, - data: *mut ::std::os::raw::c_uchar, - data_len: ::std::os::raw::c_ulong, - digest: *mut ::std::os::raw::c_uchar, - digest_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pDigest: CK_BYTE_PTR, + pulDigestLen: CK_ULONG_PTR, ) -> CK_RV { (self .C_Digest .as_ref() .expect("Expected function, got error."))( - session, data, data_len, digest, digest_len + hSession, + pData, + ulDataLen, + pDigest, + pulDigestLen, ) } pub unsafe fn C_DigestUpdate( &self, - session: CK_SESSION_HANDLE, - part: *mut ::std::os::raw::c_uchar, - part_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pPart: CK_BYTE_PTR, + ulPartLen: CK_ULONG, ) -> CK_RV { (self .C_DigestUpdate .as_ref() - .expect("Expected function, got error."))(session, part, part_len) + .expect("Expected function, got error."))(hSession, pPart, ulPartLen) } - pub unsafe fn C_DigestKey(&self, session: CK_SESSION_HANDLE, key: CK_OBJECT_HANDLE) -> CK_RV { + pub unsafe fn C_DigestKey(&self, hSession: CK_SESSION_HANDLE, hKey: CK_OBJECT_HANDLE) -> CK_RV { (self .C_DigestKey .as_ref() - .expect("Expected function, got error."))(session, key) + .expect("Expected function, got error."))(hSession, hKey) } pub unsafe fn C_DigestFinal( &self, - session: CK_SESSION_HANDLE, - digest: *mut ::std::os::raw::c_uchar, - digest_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pDigest: CK_BYTE_PTR, + pulDigestLen: CK_ULONG_PTR, ) -> CK_RV { (self .C_DigestFinal .as_ref() - .expect("Expected function, got error."))(session, digest, digest_len) + .expect("Expected function, got error."))(hSession, pDigest, pulDigestLen) } pub unsafe fn C_SignInit( &self, - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - key: CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, ) -> CK_RV { (self .C_SignInit .as_ref() - .expect("Expected function, got error."))(session, mechanism, key) + .expect("Expected function, got error."))(hSession, pMechanism, hKey) } pub unsafe fn C_Sign( &self, - session: CK_SESSION_HANDLE, - data: *mut ::std::os::raw::c_uchar, - data_len: ::std::os::raw::c_ulong, - signature: *mut ::std::os::raw::c_uchar, - signature_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + pulSignatureLen: CK_ULONG_PTR, ) -> CK_RV { (self.C_Sign.as_ref().expect("Expected function, got error."))( - session, - data, - data_len, - signature, - signature_len, + hSession, + pData, + ulDataLen, + pSignature, + pulSignatureLen, ) } pub unsafe fn C_SignUpdate( &self, - session: CK_SESSION_HANDLE, - part: *mut ::std::os::raw::c_uchar, - part_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pPart: CK_BYTE_PTR, + ulPartLen: CK_ULONG, ) -> CK_RV { (self .C_SignUpdate .as_ref() - .expect("Expected function, got error."))(session, part, part_len) + .expect("Expected function, got error."))(hSession, pPart, ulPartLen) } pub unsafe fn C_SignFinal( &self, - session: CK_SESSION_HANDLE, - signature: *mut ::std::os::raw::c_uchar, - signature_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pSignature: CK_BYTE_PTR, + pulSignatureLen: CK_ULONG_PTR, ) -> CK_RV { (self .C_SignFinal .as_ref() - .expect("Expected function, got error."))(session, signature, signature_len) + .expect("Expected function, got error."))(hSession, pSignature, pulSignatureLen) } pub unsafe fn C_SignRecoverInit( &self, - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - key: CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, ) -> CK_RV { (self .C_SignRecoverInit .as_ref() - .expect("Expected function, got error."))(session, mechanism, key) + .expect("Expected function, got error."))(hSession, pMechanism, hKey) } pub unsafe fn C_SignRecover( &self, - session: CK_SESSION_HANDLE, - data: *mut ::std::os::raw::c_uchar, - data_len: ::std::os::raw::c_ulong, - signature: *mut ::std::os::raw::c_uchar, - signature_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + pulSignatureLen: CK_ULONG_PTR, ) -> CK_RV { (self .C_SignRecover .as_ref() .expect("Expected function, got error."))( - session, - data, - data_len, - signature, - signature_len, + hSession, + pData, + ulDataLen, + pSignature, + pulSignatureLen, ) } pub unsafe fn C_VerifyInit( &self, - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - key: CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, ) -> CK_RV { (self .C_VerifyInit .as_ref() - .expect("Expected function, got error."))(session, mechanism, key) + .expect("Expected function, got error."))(hSession, pMechanism, hKey) } pub unsafe fn C_Verify( &self, - session: CK_SESSION_HANDLE, - data: *mut ::std::os::raw::c_uchar, - data_len: ::std::os::raw::c_ulong, - signature: *mut ::std::os::raw::c_uchar, - signature_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + ulSignatureLen: CK_ULONG, ) -> CK_RV { (self .C_Verify .as_ref() .expect("Expected function, got error."))( - session, - data, - data_len, - signature, - signature_len, + hSession, + pData, + ulDataLen, + pSignature, + ulSignatureLen, ) } pub unsafe fn C_VerifyUpdate( &self, - session: CK_SESSION_HANDLE, - part: *mut ::std::os::raw::c_uchar, - part_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pPart: CK_BYTE_PTR, + ulPartLen: CK_ULONG, ) -> CK_RV { (self .C_VerifyUpdate .as_ref() - .expect("Expected function, got error."))(session, part, part_len) + .expect("Expected function, got error."))(hSession, pPart, ulPartLen) } pub unsafe fn C_VerifyFinal( &self, - session: CK_SESSION_HANDLE, - signature: *mut ::std::os::raw::c_uchar, - signature_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pSignature: CK_BYTE_PTR, + ulSignatureLen: CK_ULONG, ) -> CK_RV { (self .C_VerifyFinal .as_ref() - .expect("Expected function, got error."))(session, signature, signature_len) + .expect("Expected function, got error."))(hSession, pSignature, ulSignatureLen) } pub unsafe fn C_VerifyRecoverInit( &self, - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - key: CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, ) -> CK_RV { (self .C_VerifyRecoverInit .as_ref() - .expect("Expected function, got error."))(session, mechanism, key) + .expect("Expected function, got error."))(hSession, pMechanism, hKey) } pub unsafe fn C_VerifyRecover( &self, - session: CK_SESSION_HANDLE, - signature: *mut ::std::os::raw::c_uchar, - signature_len: ::std::os::raw::c_ulong, - data: *mut ::std::os::raw::c_uchar, - data_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pSignature: CK_BYTE_PTR, + ulSignatureLen: CK_ULONG, + pData: CK_BYTE_PTR, + pulDataLen: CK_ULONG_PTR, ) -> CK_RV { (self .C_VerifyRecover .as_ref() .expect("Expected function, got error."))( - session, - signature, - signature_len, - data, - data_len, + hSession, + pSignature, + ulSignatureLen, + pData, + pulDataLen, ) } pub unsafe fn C_DigestEncryptUpdate( &self, - session: CK_SESSION_HANDLE, - part: *mut ::std::os::raw::c_uchar, - part_len: ::std::os::raw::c_ulong, - encrypted_part: *mut ::std::os::raw::c_uchar, - encrypted_part_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pPart: CK_BYTE_PTR, + ulPartLen: CK_ULONG, + pEncryptedPart: CK_BYTE_PTR, + pulEncryptedPartLen: CK_ULONG_PTR, ) -> CK_RV { (self .C_DigestEncryptUpdate .as_ref() .expect("Expected function, got error."))( - session, - part, - part_len, - encrypted_part, - encrypted_part_len, + hSession, + pPart, + ulPartLen, + pEncryptedPart, + pulEncryptedPartLen, ) } pub unsafe fn C_DecryptDigestUpdate( &self, - session: CK_SESSION_HANDLE, - encrypted_part: *mut ::std::os::raw::c_uchar, - encrypted_part_len: ::std::os::raw::c_ulong, - part: *mut ::std::os::raw::c_uchar, - part_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pEncryptedPart: CK_BYTE_PTR, + ulEncryptedPartLen: CK_ULONG, + pPart: CK_BYTE_PTR, + pulPartLen: CK_ULONG_PTR, ) -> CK_RV { (self .C_DecryptDigestUpdate .as_ref() .expect("Expected function, got error."))( - session, - encrypted_part, - encrypted_part_len, - part, - part_len, + hSession, + pEncryptedPart, + ulEncryptedPartLen, + pPart, + pulPartLen, ) } pub unsafe fn C_SignEncryptUpdate( &self, - session: CK_SESSION_HANDLE, - part: *mut ::std::os::raw::c_uchar, - part_len: ::std::os::raw::c_ulong, - encrypted_part: *mut ::std::os::raw::c_uchar, - encrypted_part_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pPart: CK_BYTE_PTR, + ulPartLen: CK_ULONG, + pEncryptedPart: CK_BYTE_PTR, + pulEncryptedPartLen: CK_ULONG_PTR, ) -> CK_RV { (self .C_SignEncryptUpdate .as_ref() .expect("Expected function, got error."))( - session, - part, - part_len, - encrypted_part, - encrypted_part_len, + hSession, + pPart, + ulPartLen, + pEncryptedPart, + pulEncryptedPartLen, ) } pub unsafe fn C_DecryptVerifyUpdate( &self, - session: CK_SESSION_HANDLE, - encrypted_part: *mut ::std::os::raw::c_uchar, - encrypted_part_len: ::std::os::raw::c_ulong, - part: *mut ::std::os::raw::c_uchar, - part_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pEncryptedPart: CK_BYTE_PTR, + ulEncryptedPartLen: CK_ULONG, + pPart: CK_BYTE_PTR, + pulPartLen: CK_ULONG_PTR, ) -> CK_RV { (self .C_DecryptVerifyUpdate .as_ref() .expect("Expected function, got error."))( - session, - encrypted_part, - encrypted_part_len, - part, - part_len, + hSession, + pEncryptedPart, + ulEncryptedPartLen, + pPart, + pulPartLen, ) } pub unsafe fn C_GenerateKey( &self, - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - templ: *mut _CK_ATTRIBUTE, - ulCount: ::std::os::raw::c_ulong, - key: *mut CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + pTemplate: CK_ATTRIBUTE_PTR, + ulCount: CK_ULONG, + phKey: CK_OBJECT_HANDLE_PTR, ) -> CK_RV { (self .C_GenerateKey .as_ref() .expect("Expected function, got error."))( - session, mechanism, templ, ulCount, key + hSession, pMechanism, pTemplate, ulCount, phKey, ) } pub unsafe fn C_GenerateKeyPair( &self, - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - public_key_template: *mut _CK_ATTRIBUTE, - public_key_attribute_count: ::std::os::raw::c_ulong, - private_key_template: *mut _CK_ATTRIBUTE, - private_key_attribute_count: ::std::os::raw::c_ulong, - public_key: *mut CK_OBJECT_HANDLE, - private_key: *mut CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + pPublicKeyTemplate: CK_ATTRIBUTE_PTR, + ulPublicKeyAttributeCount: CK_ULONG, + pPrivateKeyTemplate: CK_ATTRIBUTE_PTR, + ulPrivateKeyAttributeCount: CK_ULONG, + phPublicKey: CK_OBJECT_HANDLE_PTR, + phPrivateKey: CK_OBJECT_HANDLE_PTR, ) -> CK_RV { (self .C_GenerateKeyPair .as_ref() .expect("Expected function, got error."))( - session, - mechanism, - public_key_template, - public_key_attribute_count, - private_key_template, - private_key_attribute_count, - public_key, - private_key, + hSession, + pMechanism, + pPublicKeyTemplate, + ulPublicKeyAttributeCount, + pPrivateKeyTemplate, + ulPrivateKeyAttributeCount, + phPublicKey, + phPrivateKey, ) } pub unsafe fn C_WrapKey( &self, - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - wrapping_key: CK_OBJECT_HANDLE, - key: CK_OBJECT_HANDLE, - wrapped_key: *mut ::std::os::raw::c_uchar, - wrapped_key_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hWrappingKey: CK_OBJECT_HANDLE, + hKey: CK_OBJECT_HANDLE, + pWrappedKey: CK_BYTE_PTR, + pulWrappedKeyLen: CK_ULONG_PTR, ) -> CK_RV { (self .C_WrapKey .as_ref() .expect("Expected function, got error."))( - session, - mechanism, - wrapping_key, - key, - wrapped_key, - wrapped_key_len, + hSession, + pMechanism, + hWrappingKey, + hKey, + pWrappedKey, + pulWrappedKeyLen, ) } pub unsafe fn C_UnwrapKey( &self, - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - unwrapping_key: CK_OBJECT_HANDLE, - wrapped_key: *mut ::std::os::raw::c_uchar, - wrapped_key_len: ::std::os::raw::c_ulong, - templ: *mut _CK_ATTRIBUTE, - attribute_count: ::std::os::raw::c_ulong, - key: *mut CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hUnwrappingKey: CK_OBJECT_HANDLE, + pWrappedKey: CK_BYTE_PTR, + ulWrappedKeyLen: CK_ULONG, + pTemplate: CK_ATTRIBUTE_PTR, + ulAttributeCount: CK_ULONG, + phKey: CK_OBJECT_HANDLE_PTR, ) -> CK_RV { (self .C_UnwrapKey .as_ref() .expect("Expected function, got error."))( - session, - mechanism, - unwrapping_key, - wrapped_key, - wrapped_key_len, - templ, - attribute_count, - key, + hSession, + pMechanism, + hUnwrappingKey, + pWrappedKey, + ulWrappedKeyLen, + pTemplate, + ulAttributeCount, + phKey, ) } pub unsafe fn C_DeriveKey( &self, - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - base_key: CK_OBJECT_HANDLE, - templ: *mut _CK_ATTRIBUTE, - attribute_count: ::std::os::raw::c_ulong, - key: *mut CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hBaseKey: CK_OBJECT_HANDLE, + pTemplate: CK_ATTRIBUTE_PTR, + ulAttributeCount: CK_ULONG, + phKey: CK_OBJECT_HANDLE_PTR, ) -> CK_RV { (self .C_DeriveKey .as_ref() .expect("Expected function, got error."))( - session, - mechanism, - base_key, - templ, - attribute_count, - key, + hSession, + pMechanism, + hBaseKey, + pTemplate, + ulAttributeCount, + phKey, ) } pub unsafe fn C_SeedRandom( &self, - session: CK_SESSION_HANDLE, - seed: *mut ::std::os::raw::c_uchar, - seed_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pSeed: CK_BYTE_PTR, + ulSeedLen: CK_ULONG, ) -> CK_RV { (self .C_SeedRandom .as_ref() - .expect("Expected function, got error."))(session, seed, seed_len) + .expect("Expected function, got error."))(hSession, pSeed, ulSeedLen) } pub unsafe fn C_GenerateRandom( &self, - session: CK_SESSION_HANDLE, - random_data: *mut ::std::os::raw::c_uchar, - random_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + RandomData: CK_BYTE_PTR, + ulRandomLen: CK_ULONG, ) -> CK_RV { (self .C_GenerateRandom .as_ref() - .expect("Expected function, got error."))(session, random_data, random_len) + .expect("Expected function, got error."))(hSession, RandomData, ulRandomLen) } - pub unsafe fn C_GetFunctionStatus(&self, session: CK_SESSION_HANDLE) -> CK_RV { + pub unsafe fn C_GetFunctionStatus(&self, hSession: CK_SESSION_HANDLE) -> CK_RV { (self .C_GetFunctionStatus .as_ref() - .expect("Expected function, got error."))(session) + .expect("Expected function, got error."))(hSession) } - pub unsafe fn C_CancelFunction(&self, session: CK_SESSION_HANDLE) -> CK_RV { + pub unsafe fn C_CancelFunction(&self, hSession: CK_SESSION_HANDLE) -> CK_RV { (self .C_CancelFunction .as_ref() - .expect("Expected function, got error."))(session) + .expect("Expected function, got error."))(hSession) + } + pub unsafe fn C_WaitForSlotEvent( + &self, + flags: CK_FLAGS, + pSlot: CK_SLOT_ID_PTR, + pRserved: CK_VOID_PTR, + ) -> CK_RV { + (self + .C_WaitForSlotEvent + .as_ref() + .expect("Expected function, got error."))(flags, pSlot, pRserved) + } + pub unsafe fn C_GetInterfaceList( + &self, + pInterfacesList: CK_INTERFACE_PTR, + pulCount: CK_ULONG_PTR, + ) -> CK_RV { + (self + .C_GetInterfaceList + .as_ref() + .expect("Expected function, got error."))(pInterfacesList, pulCount) + } + pub unsafe fn C_GetInterface( + &self, + pInterfaceName: CK_UTF8CHAR_PTR, + pVersion: CK_VERSION_PTR, + ppInterface: CK_INTERFACE_PTR_PTR, + flags: CK_FLAGS, + ) -> CK_RV { + (self + .C_GetInterface + .as_ref() + .expect("Expected function, got error."))( + pInterfaceName, pVersion, ppInterface, flags + ) + } + pub unsafe fn C_LoginUser( + &self, + hSession: CK_SESSION_HANDLE, + userType: CK_USER_TYPE, + pPin: CK_UTF8CHAR_PTR, + ulPinLen: CK_ULONG, + pUsername: CK_UTF8CHAR_PTR, + ulUsernameLen: CK_ULONG, + ) -> CK_RV { + (self + .C_LoginUser + .as_ref() + .expect("Expected function, got error."))( + hSession, + userType, + pPin, + ulPinLen, + pUsername, + ulUsernameLen, + ) + } + pub unsafe fn C_SessionCancel(&self, hSession: CK_SESSION_HANDLE, flags: CK_FLAGS) -> CK_RV { + (self + .C_SessionCancel + .as_ref() + .expect("Expected function, got error."))(hSession, flags) + } + pub unsafe fn C_MessageEncryptInit( + &self, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, + ) -> CK_RV { + (self + .C_MessageEncryptInit + .as_ref() + .expect("Expected function, got error."))(hSession, pMechanism, hKey) + } + pub unsafe fn C_EncryptMessage( + &self, + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pAssociatedData: CK_BYTE_PTR, + ulAssociatedDataLen: CK_ULONG, + pPlaintext: CK_BYTE_PTR, + ulPlaintextLen: CK_ULONG, + pCiphertext: CK_BYTE_PTR, + pulCiphertextLen: CK_ULONG_PTR, + ) -> CK_RV { + (self + .C_EncryptMessage + .as_ref() + .expect("Expected function, got error."))( + hSession, + pParameter, + ulParameterLen, + pAssociatedData, + ulAssociatedDataLen, + pPlaintext, + ulPlaintextLen, + pCiphertext, + pulCiphertextLen, + ) + } + pub unsafe fn C_EncryptMessageBegin( + &self, + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pAssociatedData: CK_BYTE_PTR, + ulAssociatedDataLen: CK_ULONG, + ) -> CK_RV { + (self + .C_EncryptMessageBegin + .as_ref() + .expect("Expected function, got error."))( + hSession, + pParameter, + ulParameterLen, + pAssociatedData, + ulAssociatedDataLen, + ) + } + pub unsafe fn C_EncryptMessageNext( + &self, + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pPlaintextPart: CK_BYTE_PTR, + ulPlaintextPartLen: CK_ULONG, + pCiphertextPart: CK_BYTE_PTR, + pulCiphertextPartLen: CK_ULONG_PTR, + flags: CK_FLAGS, + ) -> CK_RV { + (self + .C_EncryptMessageNext + .as_ref() + .expect("Expected function, got error."))( + hSession, + pParameter, + ulParameterLen, + pPlaintextPart, + ulPlaintextPartLen, + pCiphertextPart, + pulCiphertextPartLen, + flags, + ) + } + pub unsafe fn C_MessageEncryptFinal(&self, hSession: CK_SESSION_HANDLE) -> CK_RV { + (self + .C_MessageEncryptFinal + .as_ref() + .expect("Expected function, got error."))(hSession) + } + pub unsafe fn C_MessageDecryptInit( + &self, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, + ) -> CK_RV { + (self + .C_MessageDecryptInit + .as_ref() + .expect("Expected function, got error."))(hSession, pMechanism, hKey) + } + pub unsafe fn C_DecryptMessage( + &self, + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pAssociatedData: CK_BYTE_PTR, + ulAssociatedDataLen: CK_ULONG, + pCiphertext: CK_BYTE_PTR, + ulCiphertextLen: CK_ULONG, + pPlaintext: CK_BYTE_PTR, + pulPlaintextLen: CK_ULONG_PTR, + ) -> CK_RV { + (self + .C_DecryptMessage + .as_ref() + .expect("Expected function, got error."))( + hSession, + pParameter, + ulParameterLen, + pAssociatedData, + ulAssociatedDataLen, + pCiphertext, + ulCiphertextLen, + pPlaintext, + pulPlaintextLen, + ) + } + pub unsafe fn C_DecryptMessageBegin( + &self, + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pAssociatedData: CK_BYTE_PTR, + ulAssociatedDataLen: CK_ULONG, + ) -> CK_RV { + (self + .C_DecryptMessageBegin + .as_ref() + .expect("Expected function, got error."))( + hSession, + pParameter, + ulParameterLen, + pAssociatedData, + ulAssociatedDataLen, + ) + } + pub unsafe fn C_DecryptMessageNext( + &self, + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pCiphertext: CK_BYTE_PTR, + ulCiphertextLen: CK_ULONG, + pPlaintext: CK_BYTE_PTR, + pulPlaintextLen: CK_ULONG_PTR, + flags: CK_FLAGS, + ) -> CK_RV { + (self + .C_DecryptMessageNext + .as_ref() + .expect("Expected function, got error."))( + hSession, + pParameter, + ulParameterLen, + pCiphertext, + ulCiphertextLen, + pPlaintext, + pulPlaintextLen, + flags, + ) + } + pub unsafe fn C_MessageDecryptFinal(&self, hSession: CK_SESSION_HANDLE) -> CK_RV { + (self + .C_MessageDecryptFinal + .as_ref() + .expect("Expected function, got error."))(hSession) + } + pub unsafe fn C_MessageSignInit( + &self, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, + ) -> CK_RV { + (self + .C_MessageSignInit + .as_ref() + .expect("Expected function, got error."))(hSession, pMechanism, hKey) + } + pub unsafe fn C_SignMessage( + &self, + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + pulSignatureLen: CK_ULONG_PTR, + ) -> CK_RV { + (self + .C_SignMessage + .as_ref() + .expect("Expected function, got error."))( + hSession, + pParameter, + ulParameterLen, + pData, + ulDataLen, + pSignature, + pulSignatureLen, + ) + } + pub unsafe fn C_SignMessageBegin( + &self, + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + ) -> CK_RV { + (self + .C_SignMessageBegin + .as_ref() + .expect("Expected function, got error."))(hSession, pParameter, ulParameterLen) + } + pub unsafe fn C_SignMessageNext( + &self, + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + pulSignatureLen: CK_ULONG_PTR, + ) -> CK_RV { + (self + .C_SignMessageNext + .as_ref() + .expect("Expected function, got error."))( + hSession, + pParameter, + ulParameterLen, + pData, + ulDataLen, + pSignature, + pulSignatureLen, + ) + } + pub unsafe fn C_MessageSignFinal(&self, hSession: CK_SESSION_HANDLE) -> CK_RV { + (self + .C_MessageSignFinal + .as_ref() + .expect("Expected function, got error."))(hSession) + } + pub unsafe fn C_MessageVerifyInit( + &self, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, + ) -> CK_RV { + (self + .C_MessageVerifyInit + .as_ref() + .expect("Expected function, got error."))(hSession, pMechanism, hKey) + } + pub unsafe fn C_VerifyMessage( + &self, + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + ulSignatureLen: CK_ULONG, + ) -> CK_RV { + (self + .C_VerifyMessage + .as_ref() + .expect("Expected function, got error."))( + hSession, + pParameter, + ulParameterLen, + pData, + ulDataLen, + pSignature, + ulSignatureLen, + ) + } + pub unsafe fn C_VerifyMessageBegin( + &self, + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + ) -> CK_RV { + (self + .C_VerifyMessageBegin + .as_ref() + .expect("Expected function, got error."))(hSession, pParameter, ulParameterLen) + } + pub unsafe fn C_VerifyMessageNext( + &self, + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + ulSignatureLen: CK_ULONG, + ) -> CK_RV { + (self + .C_VerifyMessageNext + .as_ref() + .expect("Expected function, got error."))( + hSession, + pParameter, + ulParameterLen, + pData, + ulDataLen, + pSignature, + ulSignatureLen, + ) + } + pub unsafe fn C_MessageVerifyFinal(&self, hSession: CK_SESSION_HANDLE) -> CK_RV { + (self + .C_MessageVerifyFinal + .as_ref() + .expect("Expected function, got error."))(hSession) } } diff --git a/cryptoki-sys/src/bindings/powerpc64-unknown-linux-gnu.rs b/cryptoki-sys/src/bindings/powerpc64-unknown-linux-gnu.rs index 6800365c..c4200fb4 100644 --- a/cryptoki-sys/src/bindings/powerpc64-unknown-linux-gnu.rs +++ b/cryptoki-sys/src/bindings/powerpc64-unknown-linux-gnu.rs @@ -1,10 +1,22 @@ /* automatically generated by rust-bindgen 0.63.0 */ -pub const PKCS11_H: u32 = 1; -pub const CRYPTOKI_VERSION_MAJOR: CK_BYTE = 2; -pub const CRYPTOKI_VERSION_MINOR: CK_BYTE = 40; -pub const P11_KIT_CRYPTOKI_VERSION_REVISION: u32 = 0; -pub const CRYPTOKI_COMPAT: u32 = 1; +pub const NULL_PTR: u32 = 0; +pub const _PKCS11_H_: u32 = 1; +pub const _PKCS11T_H_: u32 = 1; +pub const CRYPTOKI_VERSION_MAJOR: CK_BYTE = 3; +pub const CRYPTOKI_VERSION_MINOR: CK_BYTE = 0; +pub const CRYPTOKI_VERSION_AMENDMENT: CK_BYTE = 0; +pub const CK_TRUE: CK_BBOOL = 1; +pub const CK_FALSE: CK_BBOOL = 0; +pub const FALSE: u32 = 0; +pub const TRUE: u32 = 1; +pub const CK_EFFECTIVELY_INFINITE: CK_ULONG = 0; +pub const CK_INVALID_HANDLE: CK_ULONG = 0; +pub const CKN_SURRENDER: CK_NOTIFICATION = 0; +pub const CKN_OTP_CHANGED: CK_NOTIFICATION = 1; +pub const CKF_TOKEN_PRESENT: CK_FLAGS = 1; +pub const CKF_REMOVABLE_DEVICE: CK_FLAGS = 2; +pub const CKF_HW_SLOT: CK_FLAGS = 4; pub const CKF_RNG: CK_FLAGS = 1; pub const CKF_WRITE_PROTECTED: CK_FLAGS = 2; pub const CKF_LOGIN_REQUIRED: CK_FLAGS = 4; @@ -24,8 +36,6 @@ pub const CKF_SO_PIN_FINAL_TRY: CK_FLAGS = 2097152; pub const CKF_SO_PIN_LOCKED: CK_FLAGS = 4194304; pub const CKF_SO_PIN_TO_BE_CHANGED: CK_FLAGS = 8388608; pub const CKF_ERROR_STATE: CK_FLAGS = 16777216; -pub const CK_EFFECTIVELY_INFINITE: CK_ULONG = 0; -pub const CK_INVALID_HANDLE: CK_ULONG = 0; pub const CKU_SO: CK_USER_TYPE = 0; pub const CKU_USER: CK_USER_TYPE = 1; pub const CKU_CONTEXT_SPECIFIC: CK_USER_TYPE = 2; @@ -45,9 +55,18 @@ pub const CKO_HW_FEATURE: CK_OBJECT_CLASS = 5; pub const CKO_DOMAIN_PARAMETERS: CK_OBJECT_CLASS = 6; pub const CKO_MECHANISM: CK_OBJECT_CLASS = 7; pub const CKO_OTP_KEY: CK_OBJECT_CLASS = 8; +pub const CKO_PROFILE: CK_OBJECT_CLASS = 9; +pub const CKO_VENDOR_DEFINED: CK_OBJECT_CLASS = 2147483648; +pub const CKP_INVALID_ID: CK_PROFILE_ID = 0; +pub const CKP_BASELINE_PROVIDER: CK_PROFILE_ID = 1; +pub const CKP_EXTENDED_PROVIDER: CK_PROFILE_ID = 2; +pub const CKP_AUTHENTICATION_TOKEN: CK_PROFILE_ID = 3; +pub const CKP_PUBLIC_CERTIFICATES_TOKEN: CK_PROFILE_ID = 4; +pub const CKP_VENDOR_DEFINED: CK_PROFILE_ID = 2147483648; pub const CKH_MONOTONIC_COUNTER: CK_HW_FEATURE_TYPE = 1; pub const CKH_CLOCK: CK_HW_FEATURE_TYPE = 2; pub const CKH_USER_INTERFACE: CK_HW_FEATURE_TYPE = 3; +pub const CKH_VENDOR_DEFINED: CK_HW_FEATURE_TYPE = 2147483648; pub const CKK_RSA: CK_KEY_TYPE = 0; pub const CKK_DSA: CK_KEY_TYPE = 1; pub const CKK_DH: CK_KEY_TYPE = 2; @@ -63,6 +82,7 @@ pub const CKK_DES2: CK_KEY_TYPE = 20; pub const CKK_DES3: CK_KEY_TYPE = 21; pub const CKK_CAST: CK_KEY_TYPE = 22; pub const CKK_CAST3: CK_KEY_TYPE = 23; +pub const CKK_CAST5: CK_KEY_TYPE = 24; pub const CKK_CAST128: CK_KEY_TYPE = 24; pub const CKK_RC5: CK_KEY_TYPE = 25; pub const CKK_IDEA: CK_KEY_TYPE = 26; @@ -90,14 +110,48 @@ pub const CKK_SEED: CK_KEY_TYPE = 47; pub const CKK_GOSTR3410: CK_KEY_TYPE = 48; pub const CKK_GOSTR3411: CK_KEY_TYPE = 49; pub const CKK_GOST28147: CK_KEY_TYPE = 50; +pub const CKK_CHACHA20: CK_KEY_TYPE = 51; +pub const CKK_POLY1305: CK_KEY_TYPE = 52; +pub const CKK_AES_XTS: CK_KEY_TYPE = 53; +pub const CKK_SHA3_224_HMAC: CK_KEY_TYPE = 54; +pub const CKK_SHA3_256_HMAC: CK_KEY_TYPE = 55; +pub const CKK_SHA3_384_HMAC: CK_KEY_TYPE = 56; +pub const CKK_SHA3_512_HMAC: CK_KEY_TYPE = 57; +pub const CKK_BLAKE2B_160_HMAC: CK_KEY_TYPE = 58; +pub const CKK_BLAKE2B_256_HMAC: CK_KEY_TYPE = 59; +pub const CKK_BLAKE2B_384_HMAC: CK_KEY_TYPE = 60; +pub const CKK_BLAKE2B_512_HMAC: CK_KEY_TYPE = 61; +pub const CKK_SALSA20: CK_KEY_TYPE = 62; +pub const CKK_X2RATCHET: CK_KEY_TYPE = 63; pub const CKK_EC_EDWARDS: CK_KEY_TYPE = 64; +pub const CKK_EC_MONTGOMERY: CK_KEY_TYPE = 65; +pub const CKK_HKDF: CK_KEY_TYPE = 66; +pub const CKK_VENDOR_DEFINED: CK_KEY_TYPE = 2147483648; +pub const CK_CERTIFICATE_CATEGORY_UNSPECIFIED: CK_ULONG = 0; +pub const CK_CERTIFICATE_CATEGORY_TOKEN_USER: CK_ULONG = 1; +pub const CK_CERTIFICATE_CATEGORY_AUTHORITY: CK_ULONG = 2; +pub const CK_CERTIFICATE_CATEGORY_OTHER_ENTITY: CK_ULONG = 3; +pub const CK_SECURITY_DOMAIN_UNSPECIFIED: CK_ULONG = 0; +pub const CK_SECURITY_DOMAIN_MANUFACTURER: CK_ULONG = 1; +pub const CK_SECURITY_DOMAIN_OPERATOR: CK_ULONG = 2; +pub const CK_SECURITY_DOMAIN_THIRD_PARTY: CK_ULONG = 3; pub const CKC_X_509: CK_CERTIFICATE_TYPE = 0; pub const CKC_X_509_ATTR_CERT: CK_CERTIFICATE_TYPE = 1; pub const CKC_WTLS: CK_CERTIFICATE_TYPE = 2; +pub const CKC_VENDOR_DEFINED: CK_CERTIFICATE_TYPE = 2147483648; +pub const CKF_ARRAY_ATTRIBUTE: CK_FLAGS = 1073741824; +pub const CK_OTP_FORMAT_DECIMAL: CK_ULONG = 0; +pub const CK_OTP_FORMAT_HEXADECIMAL: CK_ULONG = 1; +pub const CK_OTP_FORMAT_ALPHANUMERIC: CK_ULONG = 2; +pub const CK_OTP_FORMAT_BINARY: CK_ULONG = 3; +pub const CK_OTP_PARAM_IGNORED: CK_ULONG = 0; +pub const CK_OTP_PARAM_OPTIONAL: CK_ULONG = 1; +pub const CK_OTP_PARAM_MANDATORY: CK_ULONG = 2; pub const CKA_CLASS: CK_ATTRIBUTE_TYPE = 0; pub const CKA_TOKEN: CK_ATTRIBUTE_TYPE = 1; pub const CKA_PRIVATE: CK_ATTRIBUTE_TYPE = 2; pub const CKA_LABEL: CK_ATTRIBUTE_TYPE = 3; +pub const CKA_UNIQUE_ID: CK_ATTRIBUTE_TYPE = 4; pub const CKA_APPLICATION: CK_ATTRIBUTE_TYPE = 16; pub const CKA_VALUE: CK_ATTRIBUTE_TYPE = 17; pub const CKA_OBJECT_ID: CK_ATTRIBUTE_TYPE = 18; @@ -144,6 +198,7 @@ pub const CKA_PRIME: CK_ATTRIBUTE_TYPE = 304; pub const CKA_SUBPRIME: CK_ATTRIBUTE_TYPE = 305; pub const CKA_BASE: CK_ATTRIBUTE_TYPE = 306; pub const CKA_PRIME_BITS: CK_ATTRIBUTE_TYPE = 307; +pub const CKA_SUBPRIME_BITS: CK_ATTRIBUTE_TYPE = 308; pub const CKA_SUB_PRIME_BITS: CK_ATTRIBUTE_TYPE = 308; pub const CKA_VALUE_BITS: CK_ATTRIBUTE_TYPE = 352; pub const CKA_VALUE_LEN: CK_ATTRIBUTE_TYPE = 353; @@ -162,6 +217,9 @@ pub const CKA_SECONDARY_AUTH: CK_ATTRIBUTE_TYPE = 512; pub const CKA_AUTH_PIN_FLAGS: CK_ATTRIBUTE_TYPE = 513; pub const CKA_ALWAYS_AUTHENTICATE: CK_ATTRIBUTE_TYPE = 514; pub const CKA_WRAP_WITH_TRUSTED: CK_ATTRIBUTE_TYPE = 528; +pub const CKA_WRAP_TEMPLATE: CK_ATTRIBUTE_TYPE = 1073742353; +pub const CKA_UNWRAP_TEMPLATE: CK_ATTRIBUTE_TYPE = 1073742354; +pub const CKA_DERIVE_TEMPLATE: CK_ATTRIBUTE_TYPE = 1073742355; pub const CKA_OTP_FORMAT: CK_ATTRIBUTE_TYPE = 544; pub const CKA_OTP_LENGTH: CK_ATTRIBUTE_TYPE = 545; pub const CKA_OTP_TIME_INTERVAL: CK_ATTRIBUTE_TYPE = 546; @@ -170,12 +228,12 @@ pub const CKA_OTP_CHALLENGE_REQUIREMENT: CK_ATTRIBUTE_TYPE = 548; pub const CKA_OTP_TIME_REQUIREMENT: CK_ATTRIBUTE_TYPE = 549; pub const CKA_OTP_COUNTER_REQUIREMENT: CK_ATTRIBUTE_TYPE = 550; pub const CKA_OTP_PIN_REQUIREMENT: CK_ATTRIBUTE_TYPE = 551; +pub const CKA_OTP_COUNTER: CK_ATTRIBUTE_TYPE = 558; +pub const CKA_OTP_TIME: CK_ATTRIBUTE_TYPE = 559; pub const CKA_OTP_USER_IDENTIFIER: CK_ATTRIBUTE_TYPE = 554; pub const CKA_OTP_SERVICE_IDENTIFIER: CK_ATTRIBUTE_TYPE = 555; pub const CKA_OTP_SERVICE_LOGO: CK_ATTRIBUTE_TYPE = 556; pub const CKA_OTP_SERVICE_LOGO_TYPE: CK_ATTRIBUTE_TYPE = 557; -pub const CKA_OTP_COUNTER: CK_ATTRIBUTE_TYPE = 558; -pub const CKA_OTP_TIME: CK_ATTRIBUTE_TYPE = 559; pub const CKA_GOSTR3410_PARAMS: CK_ATTRIBUTE_TYPE = 592; pub const CKA_GOSTR3411_PARAMS: CK_ATTRIBUTE_TYPE = 593; pub const CKA_GOST28147_PARAMS: CK_ATTRIBUTE_TYPE = 594; @@ -196,6 +254,9 @@ pub const CKA_MECHANISM_TYPE: CK_ATTRIBUTE_TYPE = 1280; pub const CKA_REQUIRED_CMS_ATTRIBUTES: CK_ATTRIBUTE_TYPE = 1281; pub const CKA_DEFAULT_CMS_ATTRIBUTES: CK_ATTRIBUTE_TYPE = 1282; pub const CKA_SUPPORTED_CMS_ATTRIBUTES: CK_ATTRIBUTE_TYPE = 1283; +pub const CKA_ALLOWED_MECHANISMS: CK_ATTRIBUTE_TYPE = 1073743360; +pub const CKA_PROFILE_ID: CK_ATTRIBUTE_TYPE = 1537; +pub const CKA_VENDOR_DEFINED: CK_ATTRIBUTE_TYPE = 2147483648; pub const CKM_RSA_PKCS_KEY_PAIR_GEN: CK_MECHANISM_TYPE = 0; pub const CKM_RSA_PKCS: CK_MECHANISM_TYPE = 1; pub const CKM_RSA_9796: CK_MECHANISM_TYPE = 2; @@ -218,6 +279,10 @@ pub const CKM_DSA_SHA224: CK_MECHANISM_TYPE = 19; pub const CKM_DSA_SHA256: CK_MECHANISM_TYPE = 20; pub const CKM_DSA_SHA384: CK_MECHANISM_TYPE = 21; pub const CKM_DSA_SHA512: CK_MECHANISM_TYPE = 22; +pub const CKM_DSA_SHA3_224: CK_MECHANISM_TYPE = 24; +pub const CKM_DSA_SHA3_256: CK_MECHANISM_TYPE = 25; +pub const CKM_DSA_SHA3_384: CK_MECHANISM_TYPE = 26; +pub const CKM_DSA_SHA3_512: CK_MECHANISM_TYPE = 27; pub const CKM_DH_PKCS_KEY_PAIR_GEN: CK_MECHANISM_TYPE = 32; pub const CKM_DH_PKCS_DERIVE: CK_MECHANISM_TYPE = 33; pub const CKM_X9_42_DH_KEY_PAIR_GEN: CK_MECHANISM_TYPE = 48; @@ -230,6 +295,8 @@ pub const CKM_SHA512_RSA_PKCS: CK_MECHANISM_TYPE = 66; pub const CKM_SHA256_RSA_PKCS_PSS: CK_MECHANISM_TYPE = 67; pub const CKM_SHA384_RSA_PKCS_PSS: CK_MECHANISM_TYPE = 68; pub const CKM_SHA512_RSA_PKCS_PSS: CK_MECHANISM_TYPE = 69; +pub const CKM_SHA224_RSA_PKCS: CK_MECHANISM_TYPE = 70; +pub const CKM_SHA224_RSA_PKCS_PSS: CK_MECHANISM_TYPE = 71; pub const CKM_SHA512_224: CK_MECHANISM_TYPE = 72; pub const CKM_SHA512_224_HMAC: CK_MECHANISM_TYPE = 73; pub const CKM_SHA512_224_HMAC_GENERAL: CK_MECHANISM_TYPE = 74; @@ -242,6 +309,14 @@ pub const CKM_SHA512_T: CK_MECHANISM_TYPE = 80; pub const CKM_SHA512_T_HMAC: CK_MECHANISM_TYPE = 81; pub const CKM_SHA512_T_HMAC_GENERAL: CK_MECHANISM_TYPE = 82; pub const CKM_SHA512_T_KEY_DERIVATION: CK_MECHANISM_TYPE = 83; +pub const CKM_SHA3_256_RSA_PKCS: CK_MECHANISM_TYPE = 96; +pub const CKM_SHA3_384_RSA_PKCS: CK_MECHANISM_TYPE = 97; +pub const CKM_SHA3_512_RSA_PKCS: CK_MECHANISM_TYPE = 98; +pub const CKM_SHA3_256_RSA_PKCS_PSS: CK_MECHANISM_TYPE = 99; +pub const CKM_SHA3_384_RSA_PKCS_PSS: CK_MECHANISM_TYPE = 100; +pub const CKM_SHA3_512_RSA_PKCS_PSS: CK_MECHANISM_TYPE = 101; +pub const CKM_SHA3_224_RSA_PKCS: CK_MECHANISM_TYPE = 102; +pub const CKM_SHA3_224_RSA_PKCS_PSS: CK_MECHANISM_TYPE = 103; pub const CKM_RC2_KEY_GEN: CK_MECHANISM_TYPE = 256; pub const CKM_RC2_ECB: CK_MECHANISM_TYPE = 257; pub const CKM_RC2_CBC: CK_MECHANISM_TYPE = 258; @@ -293,6 +368,9 @@ pub const CKM_RIPEMD160_HMAC_GENERAL: CK_MECHANISM_TYPE = 578; pub const CKM_SHA256: CK_MECHANISM_TYPE = 592; pub const CKM_SHA256_HMAC: CK_MECHANISM_TYPE = 593; pub const CKM_SHA256_HMAC_GENERAL: CK_MECHANISM_TYPE = 594; +pub const CKM_SHA224: CK_MECHANISM_TYPE = 597; +pub const CKM_SHA224_HMAC: CK_MECHANISM_TYPE = 598; +pub const CKM_SHA224_HMAC_GENERAL: CK_MECHANISM_TYPE = 599; pub const CKM_SHA384: CK_MECHANISM_TYPE = 608; pub const CKM_SHA384_HMAC: CK_MECHANISM_TYPE = 609; pub const CKM_SHA384_HMAC_GENERAL: CK_MECHANISM_TYPE = 610; @@ -305,6 +383,22 @@ pub const CKM_HOTP_KEY_GEN: CK_MECHANISM_TYPE = 656; pub const CKM_HOTP: CK_MECHANISM_TYPE = 657; pub const CKM_ACTI: CK_MECHANISM_TYPE = 672; pub const CKM_ACTI_KEY_GEN: CK_MECHANISM_TYPE = 673; +pub const CKM_SHA3_256: CK_MECHANISM_TYPE = 688; +pub const CKM_SHA3_256_HMAC: CK_MECHANISM_TYPE = 689; +pub const CKM_SHA3_256_HMAC_GENERAL: CK_MECHANISM_TYPE = 690; +pub const CKM_SHA3_256_KEY_GEN: CK_MECHANISM_TYPE = 691; +pub const CKM_SHA3_224: CK_MECHANISM_TYPE = 693; +pub const CKM_SHA3_224_HMAC: CK_MECHANISM_TYPE = 694; +pub const CKM_SHA3_224_HMAC_GENERAL: CK_MECHANISM_TYPE = 695; +pub const CKM_SHA3_224_KEY_GEN: CK_MECHANISM_TYPE = 696; +pub const CKM_SHA3_384: CK_MECHANISM_TYPE = 704; +pub const CKM_SHA3_384_HMAC: CK_MECHANISM_TYPE = 705; +pub const CKM_SHA3_384_HMAC_GENERAL: CK_MECHANISM_TYPE = 706; +pub const CKM_SHA3_384_KEY_GEN: CK_MECHANISM_TYPE = 707; +pub const CKM_SHA3_512: CK_MECHANISM_TYPE = 720; +pub const CKM_SHA3_512_HMAC: CK_MECHANISM_TYPE = 721; +pub const CKM_SHA3_512_HMAC_GENERAL: CK_MECHANISM_TYPE = 722; +pub const CKM_SHA3_512_KEY_GEN: CK_MECHANISM_TYPE = 723; pub const CKM_CAST_KEY_GEN: CK_MECHANISM_TYPE = 768; pub const CKM_CAST_ECB: CK_MECHANISM_TYPE = 769; pub const CKM_CAST_CBC: CK_MECHANISM_TYPE = 770; @@ -364,6 +458,13 @@ pub const CKM_SHA1_KEY_DERIVATION: CK_MECHANISM_TYPE = 914; pub const CKM_SHA256_KEY_DERIVATION: CK_MECHANISM_TYPE = 915; pub const CKM_SHA384_KEY_DERIVATION: CK_MECHANISM_TYPE = 916; pub const CKM_SHA512_KEY_DERIVATION: CK_MECHANISM_TYPE = 917; +pub const CKM_SHA224_KEY_DERIVATION: CK_MECHANISM_TYPE = 918; +pub const CKM_SHA3_256_KEY_DERIVE: CK_MECHANISM_TYPE = 919; +pub const CKM_SHA3_224_KEY_DERIVE: CK_MECHANISM_TYPE = 920; +pub const CKM_SHA3_384_KEY_DERIVE: CK_MECHANISM_TYPE = 921; +pub const CKM_SHA3_512_KEY_DERIVE: CK_MECHANISM_TYPE = 922; +pub const CKM_SHAKE_128_KEY_DERIVE: CK_MECHANISM_TYPE = 923; +pub const CKM_SHAKE_256_KEY_DERIVE: CK_MECHANISM_TYPE = 924; pub const CKM_PBE_MD2_DES_CBC: CK_MECHANISM_TYPE = 928; pub const CKM_PBE_MD5_DES_CBC: CK_MECHANISM_TYPE = 929; pub const CKM_PBE_MD5_CAST_CBC: CK_MECHANISM_TYPE = 930; @@ -403,6 +504,13 @@ pub const CKM_KIP_DERIVE: CK_MECHANISM_TYPE = 1296; pub const CKM_KIP_WRAP: CK_MECHANISM_TYPE = 1297; pub const CKM_KIP_MAC: CK_MECHANISM_TYPE = 1298; pub const CKM_CAMELLIA_KEY_GEN: CK_MECHANISM_TYPE = 1360; +pub const CKM_CAMELLIA_ECB: CK_MECHANISM_TYPE = 1361; +pub const CKM_CAMELLIA_CBC: CK_MECHANISM_TYPE = 1362; +pub const CKM_CAMELLIA_MAC: CK_MECHANISM_TYPE = 1363; +pub const CKM_CAMELLIA_MAC_GENERAL: CK_MECHANISM_TYPE = 1364; +pub const CKM_CAMELLIA_CBC_PAD: CK_MECHANISM_TYPE = 1365; +pub const CKM_CAMELLIA_ECB_ENCRYPT_DATA: CK_MECHANISM_TYPE = 1366; +pub const CKM_CAMELLIA_CBC_ENCRYPT_DATA: CK_MECHANISM_TYPE = 1367; pub const CKM_CAMELLIA_CTR: CK_MECHANISM_TYPE = 1368; pub const CKM_ARIA_KEY_GEN: CK_MECHANISM_TYPE = 1376; pub const CKM_ARIA_ECB: CK_MECHANISM_TYPE = 1377; @@ -433,6 +541,7 @@ pub const CKM_SKIPJACK_PRIVATE_WRAP: CK_MECHANISM_TYPE = 4105; pub const CKM_SKIPJACK_RELAYX: CK_MECHANISM_TYPE = 4106; pub const CKM_KEA_KEY_PAIR_GEN: CK_MECHANISM_TYPE = 4112; pub const CKM_KEA_KEY_DERIVE: CK_MECHANISM_TYPE = 4113; +pub const CKM_KEA_DERIVE: CK_MECHANISM_TYPE = 4114; pub const CKM_FORTEZZA_TIMESTAMP: CK_MECHANISM_TYPE = 4128; pub const CKM_BATON_KEY_GEN: CK_MECHANISM_TYPE = 4144; pub const CKM_BATON_ECB128: CK_MECHANISM_TYPE = 4145; @@ -461,6 +570,8 @@ pub const CKM_JUNIPER_COUNTER: CK_MECHANISM_TYPE = 4195; pub const CKM_JUNIPER_SHUFFLE: CK_MECHANISM_TYPE = 4196; pub const CKM_JUNIPER_WRAP: CK_MECHANISM_TYPE = 4197; pub const CKM_FASTHASH: CK_MECHANISM_TYPE = 4208; +pub const CKM_AES_XTS: CK_MECHANISM_TYPE = 4209; +pub const CKM_AES_XTS_KEY_GEN: CK_MECHANISM_TYPE = 4210; pub const CKM_AES_KEY_GEN: CK_MECHANISM_TYPE = 4224; pub const CKM_AES_ECB: CK_MECHANISM_TYPE = 4225; pub const CKM_AES_CBC: CK_MECHANISM_TYPE = 4226; @@ -500,6 +611,10 @@ pub const CKM_GOST28147_ECB: CK_MECHANISM_TYPE = 4641; pub const CKM_GOST28147: CK_MECHANISM_TYPE = 4642; pub const CKM_GOST28147_MAC: CK_MECHANISM_TYPE = 4643; pub const CKM_GOST28147_KEY_WRAP: CK_MECHANISM_TYPE = 4644; +pub const CKM_CHACHA20_KEY_GEN: CK_MECHANISM_TYPE = 4645; +pub const CKM_CHACHA20: CK_MECHANISM_TYPE = 4646; +pub const CKM_POLY1305_KEY_GEN: CK_MECHANISM_TYPE = 4647; +pub const CKM_POLY1305: CK_MECHANISM_TYPE = 4648; pub const CKM_DSA_PARAMETER_GEN: CK_MECHANISM_TYPE = 8192; pub const CKM_DH_PKCS_PARAMETER_GEN: CK_MECHANISM_TYPE = 8193; pub const CKM_X9_42_DH_PARAMETER_GEN: CK_MECHANISM_TYPE = 8194; @@ -510,63 +625,71 @@ pub const CKM_AES_CFB64: CK_MECHANISM_TYPE = 8453; pub const CKM_AES_CFB8: CK_MECHANISM_TYPE = 8454; pub const CKM_AES_CFB128: CK_MECHANISM_TYPE = 8455; pub const CKM_AES_CFB1: CK_MECHANISM_TYPE = 8456; -pub const CKM_SHA224: CK_MECHANISM_TYPE = 597; -pub const CKM_SHA224_HMAC: CK_MECHANISM_TYPE = 598; -pub const CKM_SHA224_HMAC_GENERAL: CK_MECHANISM_TYPE = 599; -pub const CKM_SHA224_RSA_PKCS: CK_MECHANISM_TYPE = 70; -pub const CKM_SHA224_RSA_PKCS_PSS: CK_MECHANISM_TYPE = 71; -pub const CKM_SHA224_KEY_DERIVATION: CK_MECHANISM_TYPE = 918; -pub const CKM_CAMELLIA_ECB: CK_MECHANISM_TYPE = 1361; -pub const CKM_CAMELLIA_CBC: CK_MECHANISM_TYPE = 1362; -pub const CKM_CAMELLIA_MAC: CK_MECHANISM_TYPE = 1363; -pub const CKM_CAMELLIA_MAC_GENERAL: CK_MECHANISM_TYPE = 1364; -pub const CKM_CAMELLIA_CBC_PAD: CK_MECHANISM_TYPE = 1365; -pub const CKM_CAMELLIA_ECB_ENCRYPT_DATA: CK_MECHANISM_TYPE = 1366; -pub const CKM_CAMELLIA_CBC_ENCRYPT_DATA: CK_MECHANISM_TYPE = 1367; pub const CKM_AES_KEY_WRAP: CK_MECHANISM_TYPE = 8457; pub const CKM_AES_KEY_WRAP_PAD: CK_MECHANISM_TYPE = 8458; +pub const CKM_AES_KEY_WRAP_KWP: CK_MECHANISM_TYPE = 8459; pub const CKM_RSA_PKCS_TPM_1_1: CK_MECHANISM_TYPE = 16385; pub const CKM_RSA_PKCS_OAEP_TPM_1_1: CK_MECHANISM_TYPE = 16386; +pub const CKM_SHA_1_KEY_GEN: CK_MECHANISM_TYPE = 16387; +pub const CKM_SHA224_KEY_GEN: CK_MECHANISM_TYPE = 16388; +pub const CKM_SHA256_KEY_GEN: CK_MECHANISM_TYPE = 16389; +pub const CKM_SHA384_KEY_GEN: CK_MECHANISM_TYPE = 16390; +pub const CKM_SHA512_KEY_GEN: CK_MECHANISM_TYPE = 16391; +pub const CKM_SHA512_224_KEY_GEN: CK_MECHANISM_TYPE = 16392; +pub const CKM_SHA512_256_KEY_GEN: CK_MECHANISM_TYPE = 16393; +pub const CKM_SHA512_T_KEY_GEN: CK_MECHANISM_TYPE = 16394; +pub const CKM_NULL: CK_MECHANISM_TYPE = 16395; +pub const CKM_BLAKE2B_160: CK_MECHANISM_TYPE = 16396; +pub const CKM_BLAKE2B_160_HMAC: CK_MECHANISM_TYPE = 16397; +pub const CKM_BLAKE2B_160_HMAC_GENERAL: CK_MECHANISM_TYPE = 16398; +pub const CKM_BLAKE2B_160_KEY_DERIVE: CK_MECHANISM_TYPE = 16399; +pub const CKM_BLAKE2B_160_KEY_GEN: CK_MECHANISM_TYPE = 16400; +pub const CKM_BLAKE2B_256: CK_MECHANISM_TYPE = 16401; +pub const CKM_BLAKE2B_256_HMAC: CK_MECHANISM_TYPE = 16402; +pub const CKM_BLAKE2B_256_HMAC_GENERAL: CK_MECHANISM_TYPE = 16403; +pub const CKM_BLAKE2B_256_KEY_DERIVE: CK_MECHANISM_TYPE = 16404; +pub const CKM_BLAKE2B_256_KEY_GEN: CK_MECHANISM_TYPE = 16405; +pub const CKM_BLAKE2B_384: CK_MECHANISM_TYPE = 16406; +pub const CKM_BLAKE2B_384_HMAC: CK_MECHANISM_TYPE = 16407; +pub const CKM_BLAKE2B_384_HMAC_GENERAL: CK_MECHANISM_TYPE = 16408; +pub const CKM_BLAKE2B_384_KEY_DERIVE: CK_MECHANISM_TYPE = 16409; +pub const CKM_BLAKE2B_384_KEY_GEN: CK_MECHANISM_TYPE = 16410; +pub const CKM_BLAKE2B_512: CK_MECHANISM_TYPE = 16411; +pub const CKM_BLAKE2B_512_HMAC: CK_MECHANISM_TYPE = 16412; +pub const CKM_BLAKE2B_512_HMAC_GENERAL: CK_MECHANISM_TYPE = 16413; +pub const CKM_BLAKE2B_512_KEY_DERIVE: CK_MECHANISM_TYPE = 16414; +pub const CKM_BLAKE2B_512_KEY_GEN: CK_MECHANISM_TYPE = 16415; +pub const CKM_SALSA20: CK_MECHANISM_TYPE = 16416; +pub const CKM_CHACHA20_POLY1305: CK_MECHANISM_TYPE = 16417; +pub const CKM_SALSA20_POLY1305: CK_MECHANISM_TYPE = 16418; +pub const CKM_X3DH_INITIALIZE: CK_MECHANISM_TYPE = 16419; +pub const CKM_X3DH_RESPOND: CK_MECHANISM_TYPE = 16420; +pub const CKM_X2RATCHET_INITIALIZE: CK_MECHANISM_TYPE = 16421; +pub const CKM_X2RATCHET_RESPOND: CK_MECHANISM_TYPE = 16422; +pub const CKM_X2RATCHET_ENCRYPT: CK_MECHANISM_TYPE = 16423; +pub const CKM_X2RATCHET_DECRYPT: CK_MECHANISM_TYPE = 16424; +pub const CKM_XEDDSA: CK_MECHANISM_TYPE = 16425; +pub const CKM_HKDF_DERIVE: CK_MECHANISM_TYPE = 16426; +pub const CKM_HKDF_DATA: CK_MECHANISM_TYPE = 16427; +pub const CKM_HKDF_KEY_GEN: CK_MECHANISM_TYPE = 16428; +pub const CKM_ECDSA_SHA3_224: CK_MECHANISM_TYPE = 4167; +pub const CKM_ECDSA_SHA3_256: CK_MECHANISM_TYPE = 4168; +pub const CKM_ECDSA_SHA3_384: CK_MECHANISM_TYPE = 4169; +pub const CKM_ECDSA_SHA3_512: CK_MECHANISM_TYPE = 4170; pub const CKM_EC_EDWARDS_KEY_PAIR_GEN: CK_MECHANISM_TYPE = 4181; pub const CKM_EC_MONTGOMERY_KEY_PAIR_GEN: CK_MECHANISM_TYPE = 4182; pub const CKM_EDDSA: CK_MECHANISM_TYPE = 4183; -pub const CK_OTP_FORMAT_DECIMAL: CK_ULONG = 0; -pub const CK_OTP_FORMAT_HEXADECIMAL: CK_ULONG = 1; -pub const CK_OTP_FORMAT_ALPHANUMERIC: CK_ULONG = 2; -pub const CK_OTP_FORMAT_BINARY: CK_ULONG = 3; -pub const CK_OTP_PARAM_IGNORED: CK_ULONG = 0; -pub const CK_OTP_PARAM_OPTIONAL: CK_ULONG = 1; -pub const CK_OTP_PARAM_MANDATORY: CK_ULONG = 2; -pub const CK_OTP_VALUE: CK_ULONG = 0; -pub const CK_OTP_PIN: CK_ULONG = 1; -pub const CK_OTP_CHALLENGE: CK_ULONG = 2; -pub const CK_OTP_TIME: CK_ULONG = 3; -pub const CK_OTP_COUNTER: CK_ULONG = 4; -pub const CK_OTP_FLAGS: CK_ULONG = 5; -pub const CK_OTP_OUTPUT_LENGTH: CK_ULONG = 6; -pub const CK_OTP_FORMAT: CK_ULONG = 7; -pub const CKF_NEXT_OTP: CK_FLAGS = 1; -pub const CKF_EXCLUDE_TIME: CK_FLAGS = 2; -pub const CKF_EXCLUDE_COUNTER: CK_FLAGS = 4; -pub const CKF_EXCLUDE_CHALLENGE: CK_FLAGS = 8; -pub const CKF_EXCLUDE_PIN: CK_FLAGS = 16; -pub const CKF_USER_FRIENDLY_OTP: CK_FLAGS = 32; -pub const CKN_OTP_CHANGED: CK_NOTIFICATION = 1; -pub const CKG_MGF1_SHA1: CK_RSA_PKCS_MGF_TYPE = 1; -pub const CKG_MGF1_SHA224: CK_RSA_PKCS_MGF_TYPE = 5; -pub const CKG_MGF1_SHA256: CK_RSA_PKCS_MGF_TYPE = 2; -pub const CKG_MGF1_SHA384: CK_RSA_PKCS_MGF_TYPE = 3; -pub const CKG_MGF1_SHA512: CK_RSA_PKCS_MGF_TYPE = 4; -pub const CKD_NULL: CK_EC_KDF_TYPE = 1; -pub const CKD_SHA1_KDF: CK_EC_KDF_TYPE = 2; -pub const CKD_SHA1_KDF_ASN1: CK_EC_KDF_TYPE = 3; -pub const CKD_SHA1_KDF_CONCATENATE: CK_EC_KDF_TYPE = 4; -pub const CKD_SHA224_KDF: CK_EC_KDF_TYPE = 5; -pub const CKD_SHA256_KDF: CK_EC_KDF_TYPE = 6; -pub const CKD_SHA384_KDF: CK_EC_KDF_TYPE = 7; -pub const CKD_SHA512_KDF: CK_EC_KDF_TYPE = 8; -pub const CKD_CPDIVERSIFY_KDF: CK_EC_KDF_TYPE = 9; +pub const CKM_SP800_108_COUNTER_KDF: CK_MECHANISM_TYPE = 940; +pub const CKM_SP800_108_FEEDBACK_KDF: CK_MECHANISM_TYPE = 941; +pub const CKM_SP800_108_DOUBLE_PIPELINE_KDF: CK_MECHANISM_TYPE = 942; +pub const CKM_VENDOR_DEFINED: CK_MECHANISM_TYPE = 2147483648; pub const CKF_HW: CK_FLAGS = 1; +pub const CKF_MESSAGE_ENCRYPT: CK_FLAGS = 2; +pub const CKF_MESSAGE_DECRYPT: CK_FLAGS = 4; +pub const CKF_MESSAGE_SIGN: CK_FLAGS = 8; +pub const CKF_MESSAGE_VERIFY: CK_FLAGS = 16; +pub const CKF_MULTI_MESSGE: CK_FLAGS = 32; +pub const CKF_FIND_OBJECTS: CK_FLAGS = 64; pub const CKF_ENCRYPT: CK_FLAGS = 256; pub const CKF_DECRYPT: CK_FLAGS = 512; pub const CKF_DIGEST: CK_FLAGS = 1024; @@ -582,12 +705,12 @@ pub const CKF_DERIVE: CK_FLAGS = 524288; pub const CKF_EC_F_P: CK_FLAGS = 1048576; pub const CKF_EC_F_2M: CK_FLAGS = 2097152; pub const CKF_EC_ECPARAMETERS: CK_FLAGS = 4194304; +pub const CKF_EC_OID: CK_FLAGS = 8388608; pub const CKF_EC_NAMEDCURVE: CK_FLAGS = 8388608; pub const CKF_EC_UNCOMPRESS: CK_FLAGS = 16777216; pub const CKF_EC_COMPRESS: CK_FLAGS = 33554432; -pub const CKF_DONT_BLOCK: CK_FLAGS = 1; -pub const CKF_LIBRARY_CANT_CREATE_OS_THREADS: CK_FLAGS = 1; -pub const CKF_OS_LOCKING_OK: CK_FLAGS = 2; +pub const CKF_EC_CURVENAME: CK_FLAGS = 67108864; +pub const CKF_EXTENSION: CK_FLAGS = 2147483648; pub const CKR_OK: CK_RV = 0; pub const CKR_CANCEL: CK_RV = 1; pub const CKR_HOST_MEMORY: CK_RV = 2; @@ -610,6 +733,7 @@ pub const CKR_DEVICE_MEMORY: CK_RV = 49; pub const CKR_DEVICE_REMOVED: CK_RV = 50; pub const CKR_ENCRYPTED_DATA_INVALID: CK_RV = 64; pub const CKR_ENCRYPTED_DATA_LEN_RANGE: CK_RV = 65; +pub const CKR_AEAD_DECRYPT_FAILED: CK_RV = 66; pub const CKR_FUNCTION_CANCELED: CK_RV = 80; pub const CKR_FUNCTION_NOT_PARALLEL: CK_RV = 81; pub const CKR_FUNCTION_NOT_SUPPORTED: CK_RV = 84; @@ -665,6 +789,7 @@ pub const CKR_WRAPPING_KEY_TYPE_INCONSISTENT: CK_RV = 277; pub const CKR_RANDOM_SEED_NOT_SUPPORTED: CK_RV = 288; pub const CKR_RANDOM_NO_RNG: CK_RV = 289; pub const CKR_DOMAIN_PARAMS_INVALID: CK_RV = 304; +pub const CKR_CURVE_NOT_SUPPORTED: CK_RV = 320; pub const CKR_BUFFER_TOO_SMALL: CK_RV = 336; pub const CKR_SAVED_STATE_INVALID: CK_RV = 352; pub const CKR_INFORMATION_SENSITIVE: CK_RV = 368; @@ -675,44 +800,126 @@ pub const CKR_MUTEX_BAD: CK_RV = 416; pub const CKR_MUTEX_NOT_LOCKED: CK_RV = 417; pub const CKR_NEW_PIN_MODE: CK_RV = 432; pub const CKR_NEXT_OTP: CK_RV = 433; -pub const CKR_EXCEEDED_MAX_ITERATIONS: CK_RV = 448; -pub const CKR_FIPS_SELF_TEST_FAILED: CK_RV = 449; -pub const CKR_LIBRARY_LOAD_FAILED: CK_RV = 450; -pub const CKR_PIN_TOO_WEAK: CK_RV = 451; -pub const CKR_PUBLIC_KEY_INVALID: CK_RV = 452; +pub const CKR_EXCEEDED_MAX_ITERATIONS: CK_RV = 437; +pub const CKR_FIPS_SELF_TEST_FAILED: CK_RV = 438; +pub const CKR_LIBRARY_LOAD_FAILED: CK_RV = 439; +pub const CKR_PIN_TOO_WEAK: CK_RV = 440; +pub const CKR_PUBLIC_KEY_INVALID: CK_RV = 441; pub const CKR_FUNCTION_REJECTED: CK_RV = 512; +pub const CKR_TOKEN_RESOURCE_EXCEEDED: CK_RV = 513; +pub const CKR_VENDOR_DEFINED: CK_RV = 2147483648; +pub const CKF_END_OF_MESSAGE: CK_FLAGS = 1; +pub const CKF_INTERFACE_FORK_SAFE: CK_FLAGS = 1; +pub const CKF_LIBRARY_CANT_CREATE_OS_THREADS: CK_FLAGS = 1; +pub const CKF_OS_LOCKING_OK: CK_FLAGS = 2; +pub const CKF_DONT_BLOCK: CK_FLAGS = 1; +pub const CKG_MGF1_SHA1: CK_RSA_PKCS_MGF_TYPE = 1; +pub const CKG_MGF1_SHA256: CK_RSA_PKCS_MGF_TYPE = 2; +pub const CKG_MGF1_SHA384: CK_RSA_PKCS_MGF_TYPE = 3; +pub const CKG_MGF1_SHA512: CK_RSA_PKCS_MGF_TYPE = 4; +pub const CKG_MGF1_SHA224: CK_RSA_PKCS_MGF_TYPE = 5; pub const CKZ_DATA_SPECIFIED: CK_RSA_PKCS_OAEP_SOURCE_TYPE = 1; -pub const CK_FALSE: CK_BBOOL = 0; -pub const CK_TRUE: CK_BBOOL = 1; -pub const FALSE: u32 = 0; -pub const TRUE: u32 = 1; -pub type CK_FLAGS = ::std::os::raw::c_ulong; +pub const CKD_NULL: CK_EC_KDF_TYPE = 1; +pub const CKD_SHA1_KDF: CK_EC_KDF_TYPE = 2; +pub const CKD_SHA1_KDF_ASN1: CK_EC_KDF_TYPE = 3; +pub const CKD_SHA1_KDF_CONCATENATE: CK_EC_KDF_TYPE = 4; +pub const CKD_SHA224_KDF: CK_EC_KDF_TYPE = 5; +pub const CKD_SHA256_KDF: CK_EC_KDF_TYPE = 6; +pub const CKD_SHA384_KDF: CK_EC_KDF_TYPE = 7; +pub const CKD_SHA512_KDF: CK_EC_KDF_TYPE = 8; +pub const CKD_CPDIVERSIFY_KDF: CK_EC_KDF_TYPE = 9; +pub const CKD_SHA3_224_KDF: CK_EC_KDF_TYPE = 10; +pub const CKD_SHA3_256_KDF: CK_EC_KDF_TYPE = 11; +pub const CKD_SHA3_384_KDF: CK_EC_KDF_TYPE = 12; +pub const CKD_SHA3_512_KDF: CK_EC_KDF_TYPE = 13; +pub const CKD_SHA1_KDF_SP800: CK_EC_KDF_TYPE = 14; +pub const CKD_SHA224_KDF_SP800: CK_EC_KDF_TYPE = 15; +pub const CKD_SHA256_KDF_SP800: CK_EC_KDF_TYPE = 16; +pub const CKD_SHA384_KDF_SP800: CK_EC_KDF_TYPE = 17; +pub const CKD_SHA512_KDF_SP800: CK_EC_KDF_TYPE = 18; +pub const CKD_SHA3_224_KDF_SP800: CK_EC_KDF_TYPE = 19; +pub const CKD_SHA3_256_KDF_SP800: CK_EC_KDF_TYPE = 20; +pub const CKD_SHA3_384_KDF_SP800: CK_EC_KDF_TYPE = 21; +pub const CKD_SHA3_512_KDF_SP800: CK_EC_KDF_TYPE = 22; +pub const CKD_BLAKE2B_160_KDF: CK_EC_KDF_TYPE = 23; +pub const CKD_BLAKE2B_256_KDF: CK_EC_KDF_TYPE = 24; +pub const CKD_BLAKE2B_384_KDF: CK_EC_KDF_TYPE = 25; +pub const CKD_BLAKE2B_512_KDF: CK_EC_KDF_TYPE = 26; +pub const CKP_PKCS5_PBKD2_HMAC_SHA1: CK_PROFILE_ID = 1; +pub const CKP_PKCS5_PBKD2_HMAC_GOSTR3411: CK_PROFILE_ID = 2; +pub const CKP_PKCS5_PBKD2_HMAC_SHA224: CK_PROFILE_ID = 3; +pub const CKP_PKCS5_PBKD2_HMAC_SHA256: CK_PROFILE_ID = 4; +pub const CKP_PKCS5_PBKD2_HMAC_SHA384: CK_PROFILE_ID = 5; +pub const CKP_PKCS5_PBKD2_HMAC_SHA512: CK_PROFILE_ID = 6; +pub const CKP_PKCS5_PBKD2_HMAC_SHA512_224: CK_PROFILE_ID = 7; +pub const CKP_PKCS5_PBKD2_HMAC_SHA512_256: CK_PROFILE_ID = 8; +pub const CKZ_SALT_SPECIFIED: CK_RSA_PKCS_OAEP_SOURCE_TYPE = 1; +pub const CK_OTP_VALUE: CK_ULONG = 0; +pub const CK_OTP_PIN: CK_ULONG = 1; +pub const CK_OTP_CHALLENGE: CK_ULONG = 2; +pub const CK_OTP_TIME: CK_ULONG = 3; +pub const CK_OTP_COUNTER: CK_ULONG = 4; +pub const CK_OTP_FLAGS: CK_ULONG = 5; +pub const CK_OTP_OUTPUT_LENGTH: CK_ULONG = 6; +pub const CK_OTP_OUTPUT_FORMAT: CK_ULONG = 7; +pub const CKF_NEXT_OTP: CK_FLAGS = 1; +pub const CKF_EXCLUDE_TIME: CK_FLAGS = 2; +pub const CKF_EXCLUDE_COUNTER: CK_FLAGS = 4; +pub const CKF_EXCLUDE_CHALLENGE: CK_FLAGS = 8; +pub const CKF_EXCLUDE_PIN: CK_FLAGS = 16; +pub const CKF_USER_FRIENDLY_OTP: CK_FLAGS = 32; +pub const CKG_NO_GENERATE: u32 = 0; +pub const CKG_GENERATE: u32 = 1; +pub const CKG_GENERATE_COUNTER: u32 = 2; +pub const CKG_GENERATE_RANDOM: u32 = 3; +pub const CK_SP800_108_ITERATION_VARIABLE: CK_ULONG = 1; +pub const CK_SP800_108_OPTIONAL_COUNTER: CK_ULONG = 2; +pub const CK_SP800_108_DKM_LENGTH: CK_ULONG = 3; +pub const CK_SP800_108_BYTE_ARRAY: CK_ULONG = 4; +pub const CKF_HKDF_SALT_NULL: CK_FLAGS = 1; +pub const CKF_HKDF_SALT_DATA: CK_FLAGS = 2; +pub const CKF_HKDF_SALT_KEY: CK_FLAGS = 4; +pub const CK_NEED_ARG_LIST: CK_ULONG = 1; +pub const CK_PKCS11_2_0_ONLY: CK_ULONG = 1; +pub type CK_BYTE = ::std::os::raw::c_uchar; +pub type CK_CHAR = CK_BYTE; +pub type CK_UTF8CHAR = CK_BYTE; +pub type CK_BBOOL = CK_BYTE; +pub type CK_ULONG = ::std::os::raw::c_ulong; +pub type CK_LONG = ::std::os::raw::c_long; +pub type CK_FLAGS = CK_ULONG; +pub type CK_BYTE_PTR = *mut CK_BYTE; +pub type CK_CHAR_PTR = *mut CK_CHAR; +pub type CK_UTF8CHAR_PTR = *mut CK_UTF8CHAR; +pub type CK_ULONG_PTR = *mut CK_ULONG; +pub type CK_VOID_PTR = *mut ::std::os::raw::c_void; +pub type CK_VOID_PTR_PTR = *mut CK_VOID_PTR; #[repr(C)] #[derive(Debug, Default, Copy, Clone)] -pub struct _CK_VERSION { - pub major: ::std::os::raw::c_uchar, - pub minor: ::std::os::raw::c_uchar, +pub struct CK_VERSION { + pub major: CK_BYTE, + pub minor: CK_BYTE, } #[test] -fn bindgen_test_layout__CK_VERSION() { - const UNINIT: ::std::mem::MaybeUninit<_CK_VERSION> = ::std::mem::MaybeUninit::uninit(); +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::<_CK_VERSION>(), + ::std::mem::size_of::(), 2usize, - concat!("Size of: ", stringify!(_CK_VERSION)) + concat!("Size of: ", stringify!(CK_VERSION)) ); assert_eq!( - ::std::mem::align_of::<_CK_VERSION>(), + ::std::mem::align_of::(), 1usize, - concat!("Alignment of ", stringify!(_CK_VERSION)) + 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!(CK_VERSION), "::", stringify!(major) ) @@ -722,41 +929,42 @@ fn bindgen_test_layout__CK_VERSION() { 1usize, concat!( "Offset of field: ", - stringify!(_CK_VERSION), + stringify!(CK_VERSION), "::", stringify!(minor) ) ); } +pub type CK_VERSION_PTR = *mut CK_VERSION; #[repr(C)] #[derive(Debug, Default, Copy, Clone)] -pub struct _CK_INFO { - pub cryptokiVersion: _CK_VERSION, - pub manufacturerID: [::std::os::raw::c_uchar; 32usize], +pub struct CK_INFO { + pub cryptokiVersion: CK_VERSION, + pub manufacturerID: [CK_UTF8CHAR; 32usize], pub flags: CK_FLAGS, - pub libraryDescription: [::std::os::raw::c_uchar; 32usize], - pub libraryVersion: _CK_VERSION, + pub libraryDescription: [CK_UTF8CHAR; 32usize], + pub libraryVersion: CK_VERSION, } #[test] -fn bindgen_test_layout__CK_INFO() { - const UNINIT: ::std::mem::MaybeUninit<_CK_INFO> = ::std::mem::MaybeUninit::uninit(); +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::<_CK_INFO>(), + ::std::mem::size_of::(), 88usize, - concat!("Size of: ", stringify!(_CK_INFO)) + concat!("Size of: ", stringify!(CK_INFO)) ); assert_eq!( - ::std::mem::align_of::<_CK_INFO>(), + ::std::mem::align_of::(), 8usize, - concat!("Alignment of ", stringify!(_CK_INFO)) + 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!(CK_INFO), "::", stringify!(cryptokiVersion) ) @@ -766,7 +974,7 @@ fn bindgen_test_layout__CK_INFO() { 2usize, concat!( "Offset of field: ", - stringify!(_CK_INFO), + stringify!(CK_INFO), "::", stringify!(manufacturerID) ) @@ -776,7 +984,7 @@ fn bindgen_test_layout__CK_INFO() { 40usize, concat!( "Offset of field: ", - stringify!(_CK_INFO), + stringify!(CK_INFO), "::", stringify!(flags) ) @@ -786,7 +994,7 @@ fn bindgen_test_layout__CK_INFO() { 48usize, concat!( "Offset of field: ", - stringify!(_CK_INFO), + stringify!(CK_INFO), "::", stringify!(libraryDescription) ) @@ -796,44 +1004,45 @@ fn bindgen_test_layout__CK_INFO() { 80usize, concat!( "Offset of field: ", - stringify!(_CK_INFO), + stringify!(CK_INFO), "::", stringify!(libraryVersion) ) ); } -pub type CK_NOTIFICATION = ::std::os::raw::c_ulong; -pub const CKN_SURRENDER: ::std::os::raw::c_ulong = 0; -pub type CK_SLOT_ID = ::std::os::raw::c_ulong; +pub type CK_INFO_PTR = *mut CK_INFO; +pub type CK_NOTIFICATION = CK_ULONG; +pub type CK_SLOT_ID = CK_ULONG; +pub type CK_SLOT_ID_PTR = *mut CK_SLOT_ID; #[repr(C)] #[derive(Debug, Copy, Clone)] -pub struct _CK_SLOT_INFO { - pub slotDescription: [::std::os::raw::c_uchar; 64usize], - pub manufacturerID: [::std::os::raw::c_uchar; 32usize], +pub struct CK_SLOT_INFO { + pub slotDescription: [CK_UTF8CHAR; 64usize], + pub manufacturerID: [CK_UTF8CHAR; 32usize], pub flags: CK_FLAGS, - pub hardwareVersion: _CK_VERSION, - pub firmwareVersion: _CK_VERSION, + pub hardwareVersion: CK_VERSION, + pub firmwareVersion: CK_VERSION, } #[test] -fn bindgen_test_layout__CK_SLOT_INFO() { - const UNINIT: ::std::mem::MaybeUninit<_CK_SLOT_INFO> = ::std::mem::MaybeUninit::uninit(); +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::<_CK_SLOT_INFO>(), + ::std::mem::size_of::(), 112usize, - concat!("Size of: ", stringify!(_CK_SLOT_INFO)) + concat!("Size of: ", stringify!(CK_SLOT_INFO)) ); assert_eq!( - ::std::mem::align_of::<_CK_SLOT_INFO>(), + ::std::mem::align_of::(), 8usize, - concat!("Alignment of ", stringify!(_CK_SLOT_INFO)) + 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!(CK_SLOT_INFO), "::", stringify!(slotDescription) ) @@ -843,7 +1052,7 @@ fn bindgen_test_layout__CK_SLOT_INFO() { 64usize, concat!( "Offset of field: ", - stringify!(_CK_SLOT_INFO), + stringify!(CK_SLOT_INFO), "::", stringify!(manufacturerID) ) @@ -853,7 +1062,7 @@ fn bindgen_test_layout__CK_SLOT_INFO() { 96usize, concat!( "Offset of field: ", - stringify!(_CK_SLOT_INFO), + stringify!(CK_SLOT_INFO), "::", stringify!(flags) ) @@ -863,7 +1072,7 @@ fn bindgen_test_layout__CK_SLOT_INFO() { 104usize, concat!( "Offset of field: ", - stringify!(_CK_SLOT_INFO), + stringify!(CK_SLOT_INFO), "::", stringify!(hardwareVersion) ) @@ -873,13 +1082,13 @@ fn bindgen_test_layout__CK_SLOT_INFO() { 106usize, concat!( "Offset of field: ", - stringify!(_CK_SLOT_INFO), + stringify!(CK_SLOT_INFO), "::", stringify!(firmwareVersion) ) ); } -impl Default for _CK_SLOT_INFO { +impl Default for CK_SLOT_INFO { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { @@ -888,52 +1097,49 @@ impl Default for _CK_SLOT_INFO { } } } -pub const CKF_TOKEN_PRESENT: ::std::os::raw::c_ulong = 1; -pub const CKF_REMOVABLE_DEVICE: ::std::os::raw::c_ulong = 2; -pub const CKF_HW_SLOT: ::std::os::raw::c_ulong = 4; -pub const CKF_ARRAY_ATTRIBUTE: ::std::os::raw::c_ulong = 1073741824; +pub type CK_SLOT_INFO_PTR = *mut CK_SLOT_INFO; #[repr(C)] #[derive(Debug, Default, Copy, Clone)] -pub struct _CK_TOKEN_INFO { - pub label: [::std::os::raw::c_uchar; 32usize], - pub manufacturerID: [::std::os::raw::c_uchar; 32usize], - pub model: [::std::os::raw::c_uchar; 16usize], - pub serialNumber: [::std::os::raw::c_uchar; 16usize], +pub struct CK_TOKEN_INFO { + pub label: [CK_UTF8CHAR; 32usize], + pub manufacturerID: [CK_UTF8CHAR; 32usize], + pub model: [CK_UTF8CHAR; 16usize], + pub serialNumber: [CK_CHAR; 16usize], pub flags: CK_FLAGS, - pub ulMaxSessionCount: ::std::os::raw::c_ulong, - pub ulSessionCount: ::std::os::raw::c_ulong, - pub ulMaxRwSessionCount: ::std::os::raw::c_ulong, - pub ulRwSessionCount: ::std::os::raw::c_ulong, - pub ulMaxPinLen: ::std::os::raw::c_ulong, - pub ulMinPinLen: ::std::os::raw::c_ulong, - pub ulTotalPublicMemory: ::std::os::raw::c_ulong, - pub ulFreePublicMemory: ::std::os::raw::c_ulong, - pub ulTotalPrivateMemory: ::std::os::raw::c_ulong, - pub ulFreePrivateMemory: ::std::os::raw::c_ulong, - pub hardwareVersion: _CK_VERSION, - pub firmwareVersion: _CK_VERSION, - pub utcTime: [::std::os::raw::c_uchar; 16usize], + pub ulMaxSessionCount: CK_ULONG, + pub ulSessionCount: CK_ULONG, + pub ulMaxRwSessionCount: CK_ULONG, + pub ulRwSessionCount: CK_ULONG, + pub ulMaxPinLen: CK_ULONG, + pub ulMinPinLen: CK_ULONG, + pub ulTotalPublicMemory: CK_ULONG, + pub ulFreePublicMemory: CK_ULONG, + pub ulTotalPrivateMemory: CK_ULONG, + pub ulFreePrivateMemory: CK_ULONG, + pub hardwareVersion: CK_VERSION, + pub firmwareVersion: CK_VERSION, + pub utcTime: [CK_CHAR; 16usize], } #[test] -fn bindgen_test_layout__CK_TOKEN_INFO() { - const UNINIT: ::std::mem::MaybeUninit<_CK_TOKEN_INFO> = ::std::mem::MaybeUninit::uninit(); +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::<_CK_TOKEN_INFO>(), + ::std::mem::size_of::(), 208usize, - concat!("Size of: ", stringify!(_CK_TOKEN_INFO)) + concat!("Size of: ", stringify!(CK_TOKEN_INFO)) ); assert_eq!( - ::std::mem::align_of::<_CK_TOKEN_INFO>(), + ::std::mem::align_of::(), 8usize, - concat!("Alignment of ", stringify!(_CK_TOKEN_INFO)) + 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!(CK_TOKEN_INFO), "::", stringify!(label) ) @@ -943,7 +1149,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { 32usize, concat!( "Offset of field: ", - stringify!(_CK_TOKEN_INFO), + stringify!(CK_TOKEN_INFO), "::", stringify!(manufacturerID) ) @@ -953,7 +1159,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { 64usize, concat!( "Offset of field: ", - stringify!(_CK_TOKEN_INFO), + stringify!(CK_TOKEN_INFO), "::", stringify!(model) ) @@ -963,7 +1169,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { 80usize, concat!( "Offset of field: ", - stringify!(_CK_TOKEN_INFO), + stringify!(CK_TOKEN_INFO), "::", stringify!(serialNumber) ) @@ -973,7 +1179,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { 96usize, concat!( "Offset of field: ", - stringify!(_CK_TOKEN_INFO), + stringify!(CK_TOKEN_INFO), "::", stringify!(flags) ) @@ -983,7 +1189,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { 104usize, concat!( "Offset of field: ", - stringify!(_CK_TOKEN_INFO), + stringify!(CK_TOKEN_INFO), "::", stringify!(ulMaxSessionCount) ) @@ -993,7 +1199,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { 112usize, concat!( "Offset of field: ", - stringify!(_CK_TOKEN_INFO), + stringify!(CK_TOKEN_INFO), "::", stringify!(ulSessionCount) ) @@ -1003,7 +1209,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { 120usize, concat!( "Offset of field: ", - stringify!(_CK_TOKEN_INFO), + stringify!(CK_TOKEN_INFO), "::", stringify!(ulMaxRwSessionCount) ) @@ -1013,7 +1219,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { 128usize, concat!( "Offset of field: ", - stringify!(_CK_TOKEN_INFO), + stringify!(CK_TOKEN_INFO), "::", stringify!(ulRwSessionCount) ) @@ -1023,7 +1229,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { 136usize, concat!( "Offset of field: ", - stringify!(_CK_TOKEN_INFO), + stringify!(CK_TOKEN_INFO), "::", stringify!(ulMaxPinLen) ) @@ -1033,7 +1239,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { 144usize, concat!( "Offset of field: ", - stringify!(_CK_TOKEN_INFO), + stringify!(CK_TOKEN_INFO), "::", stringify!(ulMinPinLen) ) @@ -1043,7 +1249,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { 152usize, concat!( "Offset of field: ", - stringify!(_CK_TOKEN_INFO), + stringify!(CK_TOKEN_INFO), "::", stringify!(ulTotalPublicMemory) ) @@ -1053,7 +1259,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { 160usize, concat!( "Offset of field: ", - stringify!(_CK_TOKEN_INFO), + stringify!(CK_TOKEN_INFO), "::", stringify!(ulFreePublicMemory) ) @@ -1063,7 +1269,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { 168usize, concat!( "Offset of field: ", - stringify!(_CK_TOKEN_INFO), + stringify!(CK_TOKEN_INFO), "::", stringify!(ulTotalPrivateMemory) ) @@ -1073,7 +1279,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { 176usize, concat!( "Offset of field: ", - stringify!(_CK_TOKEN_INFO), + stringify!(CK_TOKEN_INFO), "::", stringify!(ulFreePrivateMemory) ) @@ -1083,7 +1289,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { 184usize, concat!( "Offset of field: ", - stringify!(_CK_TOKEN_INFO), + stringify!(CK_TOKEN_INFO), "::", stringify!(hardwareVersion) ) @@ -1093,7 +1299,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { 186usize, concat!( "Offset of field: ", - stringify!(_CK_TOKEN_INFO), + stringify!(CK_TOKEN_INFO), "::", stringify!(firmwareVersion) ) @@ -1103,43 +1309,45 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { 188usize, concat!( "Offset of field: ", - stringify!(_CK_TOKEN_INFO), + stringify!(CK_TOKEN_INFO), "::", stringify!(utcTime) ) ); } -pub type CK_SESSION_HANDLE = ::std::os::raw::c_ulong; -pub type CK_USER_TYPE = ::std::os::raw::c_ulong; -pub type CK_STATE = ::std::os::raw::c_ulong; +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; +pub type CK_USER_TYPE = CK_ULONG; +pub type CK_STATE = CK_ULONG; #[repr(C)] #[derive(Debug, Default, Copy, Clone)] -pub struct _CK_SESSION_INFO { +pub struct CK_SESSION_INFO { pub slotID: CK_SLOT_ID, pub state: CK_STATE, pub flags: CK_FLAGS, - pub ulDeviceError: ::std::os::raw::c_ulong, + pub ulDeviceError: CK_ULONG, } #[test] -fn bindgen_test_layout__CK_SESSION_INFO() { - const UNINIT: ::std::mem::MaybeUninit<_CK_SESSION_INFO> = ::std::mem::MaybeUninit::uninit(); +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::<_CK_SESSION_INFO>(), + ::std::mem::size_of::(), 32usize, - concat!("Size of: ", stringify!(_CK_SESSION_INFO)) + concat!("Size of: ", stringify!(CK_SESSION_INFO)) ); assert_eq!( - ::std::mem::align_of::<_CK_SESSION_INFO>(), + ::std::mem::align_of::(), 8usize, - concat!("Alignment of ", stringify!(_CK_SESSION_INFO)) + 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!(CK_SESSION_INFO), "::", stringify!(slotID) ) @@ -1149,7 +1357,7 @@ fn bindgen_test_layout__CK_SESSION_INFO() { 8usize, concat!( "Offset of field: ", - stringify!(_CK_SESSION_INFO), + stringify!(CK_SESSION_INFO), "::", stringify!(state) ) @@ -1159,7 +1367,7 @@ fn bindgen_test_layout__CK_SESSION_INFO() { 16usize, concat!( "Offset of field: ", - stringify!(_CK_SESSION_INFO), + stringify!(CK_SESSION_INFO), "::", stringify!(flags) ) @@ -1169,45 +1377,48 @@ fn bindgen_test_layout__CK_SESSION_INFO() { 24usize, concat!( "Offset of field: ", - stringify!(_CK_SESSION_INFO), + stringify!(CK_SESSION_INFO), "::", stringify!(ulDeviceError) ) ); } -pub type CK_OBJECT_HANDLE = ::std::os::raw::c_ulong; -pub type CK_OBJECT_CLASS = ::std::os::raw::c_ulong; -pub type CK_HW_FEATURE_TYPE = ::std::os::raw::c_ulong; -pub type CK_KEY_TYPE = ::std::os::raw::c_ulong; -pub type CK_CERTIFICATE_TYPE = ::std::os::raw::c_ulong; -pub type CK_ATTRIBUTE_TYPE = ::std::os::raw::c_ulong; +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; +pub type CK_OBJECT_CLASS = CK_ULONG; +pub type CK_OBJECT_CLASS_PTR = *mut CK_OBJECT_CLASS; +pub type CK_HW_FEATURE_TYPE = CK_ULONG; +pub type CK_KEY_TYPE = CK_ULONG; +pub type CK_CERTIFICATE_TYPE = CK_ULONG; +pub type CK_ATTRIBUTE_TYPE = CK_ULONG; #[repr(C)] #[derive(Debug, Copy, Clone)] -pub struct _CK_ATTRIBUTE { +pub struct CK_ATTRIBUTE { pub type_: CK_ATTRIBUTE_TYPE, - pub pValue: *mut ::std::os::raw::c_void, - pub ulValueLen: ::std::os::raw::c_ulong, + pub pValue: CK_VOID_PTR, + pub ulValueLen: CK_ULONG, } #[test] -fn bindgen_test_layout__CK_ATTRIBUTE() { - const UNINIT: ::std::mem::MaybeUninit<_CK_ATTRIBUTE> = ::std::mem::MaybeUninit::uninit(); +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::<_CK_ATTRIBUTE>(), + ::std::mem::size_of::(), 24usize, - concat!("Size of: ", stringify!(_CK_ATTRIBUTE)) + concat!("Size of: ", stringify!(CK_ATTRIBUTE)) ); assert_eq!( - ::std::mem::align_of::<_CK_ATTRIBUTE>(), + ::std::mem::align_of::(), 8usize, - concat!("Alignment of ", stringify!(_CK_ATTRIBUTE)) + 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!(CK_ATTRIBUTE), "::", stringify!(type_) ) @@ -1217,7 +1428,7 @@ fn bindgen_test_layout__CK_ATTRIBUTE() { 8usize, concat!( "Offset of field: ", - stringify!(_CK_ATTRIBUTE), + stringify!(CK_ATTRIBUTE), "::", stringify!(pValue) ) @@ -1227,13 +1438,13 @@ fn bindgen_test_layout__CK_ATTRIBUTE() { 16usize, concat!( "Offset of field: ", - stringify!(_CK_ATTRIBUTE), + stringify!(CK_ATTRIBUTE), "::", stringify!(ulValueLen) ) ); } -impl Default for _CK_ATTRIBUTE { +impl Default for CK_ATTRIBUTE { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { @@ -1242,33 +1453,34 @@ impl Default for _CK_ATTRIBUTE { } } } +pub type CK_ATTRIBUTE_PTR = *mut CK_ATTRIBUTE; #[repr(C)] #[derive(Debug, Default, Copy, Clone)] -pub struct _CK_DATE { - pub year: [::std::os::raw::c_uchar; 4usize], - pub month: [::std::os::raw::c_uchar; 2usize], - pub day: [::std::os::raw::c_uchar; 2usize], +pub struct CK_DATE { + pub year: [CK_CHAR; 4usize], + pub month: [CK_CHAR; 2usize], + pub day: [CK_CHAR; 2usize], } #[test] -fn bindgen_test_layout__CK_DATE() { - const UNINIT: ::std::mem::MaybeUninit<_CK_DATE> = ::std::mem::MaybeUninit::uninit(); +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::<_CK_DATE>(), + ::std::mem::size_of::(), 8usize, - concat!("Size of: ", stringify!(_CK_DATE)) + concat!("Size of: ", stringify!(CK_DATE)) ); assert_eq!( - ::std::mem::align_of::<_CK_DATE>(), + ::std::mem::align_of::(), 1usize, - concat!("Alignment of ", stringify!(_CK_DATE)) + 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!(CK_DATE), "::", stringify!(year) ) @@ -1278,7 +1490,7 @@ fn bindgen_test_layout__CK_DATE() { 4usize, concat!( "Offset of field: ", - stringify!(_CK_DATE), + stringify!(CK_DATE), "::", stringify!(month) ) @@ -1288,40 +1500,41 @@ fn bindgen_test_layout__CK_DATE() { 6usize, concat!( "Offset of field: ", - stringify!(_CK_DATE), + stringify!(CK_DATE), "::", stringify!(day) ) ); } -pub type CK_MECHANISM_TYPE = ::std::os::raw::c_ulong; +pub type CK_MECHANISM_TYPE = CK_ULONG; +pub type CK_MECHANISM_TYPE_PTR = *mut CK_MECHANISM_TYPE; #[repr(C)] #[derive(Debug, Copy, Clone)] -pub struct _CK_MECHANISM { +pub struct CK_MECHANISM { pub mechanism: CK_MECHANISM_TYPE, - pub pParameter: *mut ::std::os::raw::c_void, - pub ulParameterLen: ::std::os::raw::c_ulong, + pub pParameter: CK_VOID_PTR, + pub ulParameterLen: CK_ULONG, } #[test] -fn bindgen_test_layout__CK_MECHANISM() { - const UNINIT: ::std::mem::MaybeUninit<_CK_MECHANISM> = ::std::mem::MaybeUninit::uninit(); +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::<_CK_MECHANISM>(), + ::std::mem::size_of::(), 24usize, - concat!("Size of: ", stringify!(_CK_MECHANISM)) + concat!("Size of: ", stringify!(CK_MECHANISM)) ); assert_eq!( - ::std::mem::align_of::<_CK_MECHANISM>(), + ::std::mem::align_of::(), 8usize, - concat!("Alignment of ", stringify!(_CK_MECHANISM)) + 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!(CK_MECHANISM), "::", stringify!(mechanism) ) @@ -1331,7 +1544,7 @@ fn bindgen_test_layout__CK_MECHANISM() { 8usize, concat!( "Offset of field: ", - stringify!(_CK_MECHANISM), + stringify!(CK_MECHANISM), "::", stringify!(pParameter) ) @@ -1341,13 +1554,13 @@ fn bindgen_test_layout__CK_MECHANISM() { 16usize, concat!( "Offset of field: ", - stringify!(_CK_MECHANISM), + stringify!(CK_MECHANISM), "::", stringify!(ulParameterLen) ) ); } -impl Default for _CK_MECHANISM { +impl Default for CK_MECHANISM { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { @@ -1356,33 +1569,34 @@ impl Default for _CK_MECHANISM { } } } +pub type CK_MECHANISM_PTR = *mut CK_MECHANISM; #[repr(C)] #[derive(Debug, Default, Copy, Clone)] -pub struct _CK_MECHANISM_INFO { - pub ulMinKeySize: ::std::os::raw::c_ulong, - pub ulMaxKeySize: ::std::os::raw::c_ulong, +pub struct CK_MECHANISM_INFO { + pub ulMinKeySize: CK_ULONG, + pub ulMaxKeySize: CK_ULONG, pub flags: CK_FLAGS, } #[test] -fn bindgen_test_layout__CK_MECHANISM_INFO() { - const UNINIT: ::std::mem::MaybeUninit<_CK_MECHANISM_INFO> = ::std::mem::MaybeUninit::uninit(); +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::<_CK_MECHANISM_INFO>(), + ::std::mem::size_of::(), 24usize, - concat!("Size of: ", stringify!(_CK_MECHANISM_INFO)) + concat!("Size of: ", stringify!(CK_MECHANISM_INFO)) ); assert_eq!( - ::std::mem::align_of::<_CK_MECHANISM_INFO>(), + ::std::mem::align_of::(), 8usize, - concat!("Alignment of ", stringify!(_CK_MECHANISM_INFO)) + 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!(CK_MECHANISM_INFO), "::", stringify!(ulMinKeySize) ) @@ -1392,7 +1606,7 @@ fn bindgen_test_layout__CK_MECHANISM_INFO() { 8usize, concat!( "Offset of field: ", - stringify!(_CK_MECHANISM_INFO), + stringify!(CK_MECHANISM_INFO), "::", stringify!(ulMaxKeySize) ) @@ -1402,66 +1616,78 @@ fn bindgen_test_layout__CK_MECHANISM_INFO() { 16usize, concat!( "Offset of field: ", - stringify!(_CK_MECHANISM_INFO), + stringify!(CK_MECHANISM_INFO), "::", stringify!(flags) ) ); } -pub type CK_PARAM_TYPE = ::std::os::raw::c_ulong; +pub type CK_MECHANISM_INFO_PTR = *mut CK_MECHANISM_INFO; +pub type CK_RV = CK_ULONG; +pub type CK_NOTIFY = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + event: CK_NOTIFICATION, + pApplication: CK_VOID_PTR, + ) -> CK_RV, +>; +pub type CK_FUNCTION_LIST_PTR = *mut CK_FUNCTION_LIST; +pub type CK_FUNCTION_LIST_3_0_PTR = *mut CK_FUNCTION_LIST_3_0; +pub type CK_FUNCTION_LIST_PTR_PTR = *mut CK_FUNCTION_LIST_PTR; +pub type CK_FUNCTION_LIST_3_0_PTR_PTR = *mut CK_FUNCTION_LIST_3_0_PTR; #[repr(C)] #[derive(Debug, Copy, Clone)] -pub struct CK_OTP_PARAM { - pub type_: CK_PARAM_TYPE, - pub pValue: *mut ::std::os::raw::c_void, - pub ulValueLen: ::std::os::raw::c_ulong, +pub struct CK_INTERFACE { + pub pInterfaceName: *mut CK_CHAR, + pub pFunctionList: CK_VOID_PTR, + pub flags: CK_FLAGS, } #[test] -fn bindgen_test_layout_CK_OTP_PARAM() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); +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::(), + ::std::mem::size_of::(), 24usize, - concat!("Size of: ", stringify!(CK_OTP_PARAM)) + concat!("Size of: ", stringify!(CK_INTERFACE)) ); assert_eq!( - ::std::mem::align_of::(), + ::std::mem::align_of::(), 8usize, - concat!("Alignment of ", stringify!(CK_OTP_PARAM)) + concat!("Alignment of ", stringify!(CK_INTERFACE)) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).type_) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).pInterfaceName) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", - stringify!(CK_OTP_PARAM), + stringify!(CK_INTERFACE), "::", - stringify!(type_) + stringify!(pInterfaceName) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pValue) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).pFunctionList) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", - stringify!(CK_OTP_PARAM), + stringify!(CK_INTERFACE), "::", - stringify!(pValue) + stringify!(pFunctionList) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulValueLen) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).flags) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", - stringify!(CK_OTP_PARAM), + stringify!(CK_INTERFACE), "::", - stringify!(ulValueLen) + stringify!(flags) ) ); } -impl Default for CK_OTP_PARAM { +impl Default for CK_INTERFACE { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { @@ -1470,99 +1696,100 @@ impl Default for CK_OTP_PARAM { } } } +pub type CK_INTERFACE_PTR = *mut CK_INTERFACE; +pub type CK_INTERFACE_PTR_PTR = *mut CK_INTERFACE_PTR; +pub type CK_CREATEMUTEX = + ::std::option::Option CK_RV>; +pub type CK_DESTROYMUTEX = + ::std::option::Option CK_RV>; +pub type CK_LOCKMUTEX = ::std::option::Option CK_RV>; +pub type CK_UNLOCKMUTEX = ::std::option::Option CK_RV>; #[repr(C)] #[derive(Debug, Copy, Clone)] -pub struct CK_OTP_PARAMS { - pub pParams: *mut CK_OTP_PARAM, - pub ulCount: ::std::os::raw::c_ulong, +pub struct CK_C_INITIALIZE_ARGS { + pub CreateMutex: CK_CREATEMUTEX, + pub DestroyMutex: CK_DESTROYMUTEX, + pub LockMutex: CK_LOCKMUTEX, + pub UnlockMutex: CK_UNLOCKMUTEX, + pub flags: CK_FLAGS, + pub pReserved: CK_VOID_PTR, } #[test] -fn bindgen_test_layout_CK_OTP_PARAMS() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); +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::(), - 16usize, - concat!("Size of: ", stringify!(CK_OTP_PARAMS)) + ::std::mem::size_of::(), + 48usize, + concat!("Size of: ", stringify!(CK_C_INITIALIZE_ARGS)) ); assert_eq!( - ::std::mem::align_of::(), + ::std::mem::align_of::(), 8usize, - concat!("Alignment of ", stringify!(CK_OTP_PARAMS)) + concat!("Alignment of ", stringify!(CK_C_INITIALIZE_ARGS)) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pParams) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).CreateMutex) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", - stringify!(CK_OTP_PARAMS), + stringify!(CK_C_INITIALIZE_ARGS), "::", - stringify!(pParams) + stringify!(CreateMutex) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulCount) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).DestroyMutex) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", - stringify!(CK_OTP_PARAMS), + stringify!(CK_C_INITIALIZE_ARGS), "::", - stringify!(ulCount) + stringify!(DestroyMutex) ) ); -} -impl Default for CK_OTP_PARAMS { - fn default() -> Self { - let mut s = ::std::mem::MaybeUninit::::uninit(); - unsafe { - ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct CK_OTP_SIGNATURE_INFO { - pub pParams: *mut CK_OTP_PARAM, - pub ulCount: ::std::os::raw::c_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::(), + unsafe { ::std::ptr::addr_of!((*ptr).LockMutex) as usize - ptr as usize }, 16usize, - concat!("Size of: ", stringify!(CK_OTP_SIGNATURE_INFO)) + concat!( + "Offset of field: ", + stringify!(CK_C_INITIALIZE_ARGS), + "::", + stringify!(LockMutex) + ) ); assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(CK_OTP_SIGNATURE_INFO)) + 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).pParams) as usize - ptr as usize }, - 0usize, + unsafe { ::std::ptr::addr_of!((*ptr).flags) as usize - ptr as usize }, + 32usize, concat!( "Offset of field: ", - stringify!(CK_OTP_SIGNATURE_INFO), + stringify!(CK_C_INITIALIZE_ARGS), "::", - stringify!(pParams) + stringify!(flags) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulCount) as usize - ptr as usize }, - 8usize, + unsafe { ::std::ptr::addr_of!((*ptr).pReserved) as usize - ptr as usize }, + 40usize, concat!( "Offset of field: ", - stringify!(CK_OTP_SIGNATURE_INFO), + stringify!(CK_C_INITIALIZE_ARGS), "::", - stringify!(ulCount) + stringify!(pReserved) ) ); } -impl Default for CK_OTP_SIGNATURE_INFO { +impl Default for CK_C_INITIALIZE_ARGS { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { @@ -1571,35 +1798,41 @@ impl Default for CK_OTP_SIGNATURE_INFO { } } } -pub type CK_RSA_PKCS_MGF_TYPE = ::std::os::raw::c_ulong; +pub type CK_C_INITIALIZE_ARGS_PTR = *mut CK_C_INITIALIZE_ARGS; +pub type CK_RSA_PKCS_MGF_TYPE = CK_ULONG; +pub type CK_RSA_PKCS_MGF_TYPE_PTR = *mut CK_RSA_PKCS_MGF_TYPE; +pub type CK_RSA_PKCS_OAEP_SOURCE_TYPE = CK_ULONG; +pub type CK_RSA_PKCS_OAEP_SOURCE_TYPE_PTR = *mut CK_RSA_PKCS_OAEP_SOURCE_TYPE; #[repr(C)] -#[derive(Debug, Default, Copy, Clone)] -pub struct ck_rsa_pkcs_pss_params { +#[derive(Debug, Copy, Clone)] +pub struct CK_RSA_PKCS_OAEP_PARAMS { pub hashAlg: CK_MECHANISM_TYPE, pub mgf: CK_RSA_PKCS_MGF_TYPE, - pub sLen: ::std::os::raw::c_ulong, + pub source: CK_RSA_PKCS_OAEP_SOURCE_TYPE, + pub pSourceData: CK_VOID_PTR, + pub ulSourceDataLen: CK_ULONG, } #[test] -fn bindgen_test_layout_ck_rsa_pkcs_pss_params() { - const UNINIT: ::std::mem::MaybeUninit = +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_pss_params)) + ::std::mem::size_of::(), + 40usize, + concat!("Size of: ", stringify!(CK_RSA_PKCS_OAEP_PARAMS)) ); assert_eq!( - ::std::mem::align_of::(), + ::std::mem::align_of::(), 8usize, - concat!("Alignment of ", stringify!(ck_rsa_pkcs_pss_params)) + 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_pss_params), + stringify!(CK_RSA_PKCS_OAEP_PARAMS), "::", stringify!(hashAlg) ) @@ -1609,75 +1842,19 @@ fn bindgen_test_layout_ck_rsa_pkcs_pss_params() { 8usize, concat!( "Offset of field: ", - stringify!(ck_rsa_pkcs_pss_params), + stringify!(CK_RSA_PKCS_OAEP_PARAMS), "::", stringify!(mgf) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).sLen) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).source) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", - stringify!(ck_rsa_pkcs_pss_params), + stringify!(CK_RSA_PKCS_OAEP_PARAMS), "::", - stringify!(sLen) - ) - ); -} -pub type CK_RSA_PKCS_OAEP_SOURCE_TYPE = ::std::os::raw::c_ulong; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct ck_rsa_pkcs_oaep_params { - pub hashAlg: CK_MECHANISM_TYPE, - pub mgf: CK_RSA_PKCS_MGF_TYPE, - pub source: CK_RSA_PKCS_OAEP_SOURCE_TYPE, - pub pSourceData: *mut ::std::os::raw::c_void, - pub ulSourceDataLen: ::std::os::raw::c_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::(), - 40usize, - concat!("Size of: ", stringify!(ck_rsa_pkcs_oaep_params)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - 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 }, - 8usize, - 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 }, - 16usize, - concat!( - "Offset of field: ", - stringify!(ck_rsa_pkcs_oaep_params), - "::", - stringify!(source) + stringify!(source) ) ); assert_eq!( @@ -1685,7 +1862,7 @@ fn bindgen_test_layout_ck_rsa_pkcs_oaep_params() { 24usize, concat!( "Offset of field: ", - stringify!(ck_rsa_pkcs_oaep_params), + stringify!(CK_RSA_PKCS_OAEP_PARAMS), "::", stringify!(pSourceData) ) @@ -1695,13 +1872,13 @@ fn bindgen_test_layout_ck_rsa_pkcs_oaep_params() { 32usize, concat!( "Offset of field: ", - stringify!(ck_rsa_pkcs_oaep_params), + stringify!(CK_RSA_PKCS_OAEP_PARAMS), "::", stringify!(ulSourceDataLen) ) ); } -impl Default for ck_rsa_pkcs_oaep_params { +impl Default for CK_RSA_PKCS_OAEP_PARAMS { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { @@ -1710,133 +1887,138 @@ impl Default for ck_rsa_pkcs_oaep_params { } } } +pub type CK_RSA_PKCS_OAEP_PARAMS_PTR = *mut CK_RSA_PKCS_OAEP_PARAMS; #[repr(C)] #[derive(Debug, Default, Copy, Clone)] -pub struct ck_aes_ctr_params { - pub ulCounterBits: ::std::os::raw::c_ulong, - pub cb: [::std::os::raw::c_uchar; 16usize], +pub struct CK_RSA_PKCS_PSS_PARAMS { + pub hashAlg: CK_MECHANISM_TYPE, + pub mgf: CK_RSA_PKCS_MGF_TYPE, + pub sLen: CK_ULONG, } #[test] -fn bindgen_test_layout_ck_aes_ctr_params() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); +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::(), + ::std::mem::size_of::(), 24usize, - concat!("Size of: ", stringify!(ck_aes_ctr_params)) + concat!("Size of: ", stringify!(CK_RSA_PKCS_PSS_PARAMS)) ); assert_eq!( - ::std::mem::align_of::(), + ::std::mem::align_of::(), 8usize, - concat!("Alignment of ", stringify!(ck_aes_ctr_params)) + concat!("Alignment of ", stringify!(CK_RSA_PKCS_PSS_PARAMS)) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulCounterBits) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).hashAlg) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", - stringify!(ck_aes_ctr_params), + stringify!(CK_RSA_PKCS_PSS_PARAMS), "::", - stringify!(ulCounterBits) + stringify!(hashAlg) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).cb) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).mgf) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", - stringify!(ck_aes_ctr_params), + stringify!(CK_RSA_PKCS_PSS_PARAMS), "::", - stringify!(cb) + stringify!(mgf) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).sLen) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(CK_RSA_PKCS_PSS_PARAMS), + "::", + stringify!(sLen) ) ); } +pub type CK_RSA_PKCS_PSS_PARAMS_PTR = *mut CK_RSA_PKCS_PSS_PARAMS; +pub type CK_EC_KDF_TYPE = CK_ULONG; #[repr(C)] #[derive(Debug, Copy, Clone)] -pub struct ck_gcm_params { - pub pIv: *mut ::std::os::raw::c_uchar, - pub ulIvLen: ::std::os::raw::c_ulong, - pub ulIvBits: ::std::os::raw::c_ulong, - pub pAAD: *mut ::std::os::raw::c_uchar, - pub ulAADLen: ::std::os::raw::c_ulong, - pub ulTagBits: ::std::os::raw::c_ulong, +pub struct CK_ECDH1_DERIVE_PARAMS { + pub kdf: CK_EC_KDF_TYPE, + pub ulSharedDataLen: CK_ULONG, + pub pSharedData: CK_BYTE_PTR, + pub ulPublicDataLen: CK_ULONG, + pub pPublicData: CK_BYTE_PTR, } #[test] -fn bindgen_test_layout_ck_gcm_params() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); +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::(), - 48usize, - concat!("Size of: ", stringify!(ck_gcm_params)) + ::std::mem::size_of::(), + 40usize, + concat!("Size of: ", stringify!(CK_ECDH1_DERIVE_PARAMS)) ); assert_eq!( - ::std::mem::align_of::(), + ::std::mem::align_of::(), 8usize, - concat!("Alignment of ", stringify!(ck_gcm_params)) + concat!("Alignment of ", stringify!(CK_ECDH1_DERIVE_PARAMS)) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pIv) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).kdf) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", - stringify!(ck_gcm_params), + stringify!(CK_ECDH1_DERIVE_PARAMS), "::", - stringify!(pIv) + stringify!(kdf) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulIvLen) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ulSharedDataLen) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", - stringify!(ck_gcm_params), + stringify!(CK_ECDH1_DERIVE_PARAMS), "::", - stringify!(ulIvLen) + stringify!(ulSharedDataLen) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulIvBits) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).pSharedData) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", - stringify!(ck_gcm_params), + stringify!(CK_ECDH1_DERIVE_PARAMS), "::", - stringify!(ulIvBits) + stringify!(pSharedData) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pAAD) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ulPublicDataLen) as usize - ptr as usize }, 24usize, concat!( "Offset of field: ", - stringify!(ck_gcm_params), + stringify!(CK_ECDH1_DERIVE_PARAMS), "::", - stringify!(pAAD) + stringify!(ulPublicDataLen) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulAADLen) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).pPublicData) as usize - ptr as usize }, 32usize, concat!( "Offset of field: ", - stringify!(ck_gcm_params), - "::", - stringify!(ulAADLen) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulTagBits) as usize - ptr as usize }, - 40usize, - concat!( - "Offset of field: ", - stringify!(ck_gcm_params), + stringify!(CK_ECDH1_DERIVE_PARAMS), "::", - stringify!(ulTagBits) + stringify!(pPublicData) ) ); } -impl Default for ck_gcm_params { +impl Default for CK_ECDH1_DERIVE_PARAMS { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { @@ -1845,37 +2027,41 @@ impl Default for ck_gcm_params { } } } -pub type ck_ec_kdf_t = ::std::os::raw::c_ulong; +pub type CK_ECDH1_DERIVE_PARAMS_PTR = *mut CK_ECDH1_DERIVE_PARAMS; #[repr(C)] #[derive(Debug, Copy, Clone)] -pub struct ck_ecdh1_derive_params { - pub kdf: ck_ec_kdf_t, - pub ulSharedDataLen: ::std::os::raw::c_ulong, - pub pSharedData: *mut ::std::os::raw::c_uchar, - pub ulPublicDataLen: ::std::os::raw::c_ulong, - pub pPublicData: *mut ::std::os::raw::c_uchar, +pub struct CK_ECDH2_DERIVE_PARAMS { + pub kdf: CK_EC_KDF_TYPE, + pub ulSharedDataLen: CK_ULONG, + pub pSharedData: CK_BYTE_PTR, + pub ulPublicDataLen: CK_ULONG, + pub pPublicData: CK_BYTE_PTR, + pub ulPrivateDataLen: CK_ULONG, + pub hPrivateData: CK_OBJECT_HANDLE, + pub ulPublicDataLen2: CK_ULONG, + pub pPublicData2: CK_BYTE_PTR, } #[test] -fn bindgen_test_layout_ck_ecdh1_derive_params() { - const UNINIT: ::std::mem::MaybeUninit = +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::(), - 40usize, - concat!("Size of: ", stringify!(ck_ecdh1_derive_params)) + ::std::mem::size_of::(), + 72usize, + concat!("Size of: ", stringify!(CK_ECDH2_DERIVE_PARAMS)) ); assert_eq!( - ::std::mem::align_of::(), + ::std::mem::align_of::(), 8usize, - concat!("Alignment of ", stringify!(ck_ecdh1_derive_params)) + 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_ecdh1_derive_params), + stringify!(CK_ECDH2_DERIVE_PARAMS), "::", stringify!(kdf) ) @@ -1885,7 +2071,7 @@ fn bindgen_test_layout_ck_ecdh1_derive_params() { 8usize, concat!( "Offset of field: ", - stringify!(ck_ecdh1_derive_params), + stringify!(CK_ECDH2_DERIVE_PARAMS), "::", stringify!(ulSharedDataLen) ) @@ -1895,7 +2081,7 @@ fn bindgen_test_layout_ck_ecdh1_derive_params() { 16usize, concat!( "Offset of field: ", - stringify!(ck_ecdh1_derive_params), + stringify!(CK_ECDH2_DERIVE_PARAMS), "::", stringify!(pSharedData) ) @@ -1905,7 +2091,7 @@ fn bindgen_test_layout_ck_ecdh1_derive_params() { 24usize, concat!( "Offset of field: ", - stringify!(ck_ecdh1_derive_params), + stringify!(CK_ECDH2_DERIVE_PARAMS), "::", stringify!(ulPublicDataLen) ) @@ -1915,13 +2101,53 @@ fn bindgen_test_layout_ck_ecdh1_derive_params() { 32usize, concat!( "Offset of field: ", - stringify!(ck_ecdh1_derive_params), + stringify!(CK_ECDH2_DERIVE_PARAMS), "::", stringify!(pPublicData) ) ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ulPrivateDataLen) as usize - ptr as usize }, + 40usize, + 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 }, + 48usize, + 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 }, + 56usize, + 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 }, + 64usize, + concat!( + "Offset of field: ", + stringify!(CK_ECDH2_DERIVE_PARAMS), + "::", + stringify!(pPublicData2) + ) + ); } -impl Default for ck_ecdh1_derive_params { +impl Default for CK_ECDH2_DERIVE_PARAMS { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { @@ -1930,49 +2156,138 @@ impl Default for ck_ecdh1_derive_params { } } } +pub type CK_ECDH2_DERIVE_PARAMS_PTR = *mut CK_ECDH2_DERIVE_PARAMS; #[repr(C)] #[derive(Debug, Copy, Clone)] -pub struct ck_key_derivation_string_data { - pub pData: *mut ::std::os::raw::c_uchar, - pub ulLen: ::std::os::raw::c_ulong, +pub struct CK_ECMQV_DERIVE_PARAMS { + pub kdf: CK_EC_KDF_TYPE, + pub ulSharedDataLen: CK_ULONG, + pub pSharedData: CK_BYTE_PTR, + pub ulPublicDataLen: CK_ULONG, + pub pPublicData: CK_BYTE_PTR, + pub ulPrivateDataLen: CK_ULONG, + pub hPrivateData: CK_OBJECT_HANDLE, + pub ulPublicDataLen2: CK_ULONG, + pub pPublicData2: CK_BYTE_PTR, + pub publicKey: CK_OBJECT_HANDLE, } #[test] -fn bindgen_test_layout_ck_key_derivation_string_data() { - const UNINIT: ::std::mem::MaybeUninit = +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::(), - 16usize, - concat!("Size of: ", stringify!(ck_key_derivation_string_data)) + ::std::mem::size_of::(), + 80usize, + concat!("Size of: ", stringify!(CK_ECMQV_DERIVE_PARAMS)) ); assert_eq!( - ::std::mem::align_of::(), + ::std::mem::align_of::(), 8usize, - concat!("Alignment of ", stringify!(ck_key_derivation_string_data)) + concat!("Alignment of ", stringify!(CK_ECMQV_DERIVE_PARAMS)) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pData) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).kdf) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", - stringify!(ck_key_derivation_string_data), + stringify!(CK_ECMQV_DERIVE_PARAMS), "::", - stringify!(pData) + stringify!(kdf) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulLen) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ulSharedDataLen) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", - stringify!(ck_key_derivation_string_data), + stringify!(CK_ECMQV_DERIVE_PARAMS), "::", - stringify!(ulLen) + stringify!(ulSharedDataLen) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pSharedData) as usize - ptr as usize }, + 16usize, + 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 }, + 24usize, + 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 }, + 32usize, + 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 }, + 40usize, + 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 }, + 48usize, + 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 }, + 56usize, + 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 }, + 64usize, + 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 }, + 72usize, + concat!( + "Offset of field: ", + stringify!(CK_ECMQV_DERIVE_PARAMS), + "::", + stringify!(publicKey) ) ); } -impl Default for ck_key_derivation_string_data { +impl Default for CK_ECMQV_DERIVE_PARAMS { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { @@ -1981,60 +2296,85 @@ impl Default for ck_key_derivation_string_data { } } } +pub type CK_ECMQV_DERIVE_PARAMS_PTR = *mut CK_ECMQV_DERIVE_PARAMS; +pub type CK_X9_42_DH_KDF_TYPE = CK_ULONG; +pub type CK_X9_42_DH_KDF_TYPE_PTR = *mut CK_X9_42_DH_KDF_TYPE; #[repr(C)] #[derive(Debug, Copy, Clone)] -pub struct ck_des_cbc_encrypt_data_params { - pub iv: [::std::os::raw::c_uchar; 8usize], - pub pData: *mut ::std::os::raw::c_uchar, - pub length: ::std::os::raw::c_ulong, +pub struct CK_X9_42_DH1_DERIVE_PARAMS { + pub kdf: CK_X9_42_DH_KDF_TYPE, + pub ulOtherInfoLen: CK_ULONG, + pub pOtherInfo: CK_BYTE_PTR, + pub ulPublicDataLen: CK_ULONG, + pub pPublicData: CK_BYTE_PTR, } #[test] -fn bindgen_test_layout_ck_des_cbc_encrypt_data_params() { - const UNINIT: ::std::mem::MaybeUninit = +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::(), - 24usize, - concat!("Size of: ", stringify!(ck_des_cbc_encrypt_data_params)) + ::std::mem::size_of::(), + 40usize, + concat!("Size of: ", stringify!(CK_X9_42_DH1_DERIVE_PARAMS)) ); assert_eq!( - ::std::mem::align_of::(), + ::std::mem::align_of::(), 8usize, - concat!("Alignment of ", stringify!(ck_des_cbc_encrypt_data_params)) + concat!("Alignment of ", stringify!(CK_X9_42_DH1_DERIVE_PARAMS)) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).iv) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).kdf) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", - stringify!(ck_des_cbc_encrypt_data_params), + stringify!(CK_X9_42_DH1_DERIVE_PARAMS), "::", - stringify!(iv) + stringify!(kdf) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pData) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ulOtherInfoLen) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", - stringify!(ck_des_cbc_encrypt_data_params), + stringify!(CK_X9_42_DH1_DERIVE_PARAMS), "::", - stringify!(pData) + stringify!(ulOtherInfoLen) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).length) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).pOtherInfo) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", - stringify!(ck_des_cbc_encrypt_data_params), + stringify!(CK_X9_42_DH1_DERIVE_PARAMS), "::", - stringify!(length) + stringify!(pOtherInfo) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ulPublicDataLen) as usize - ptr as usize }, + 24usize, + 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 }, + 32usize, + concat!( + "Offset of field: ", + stringify!(CK_X9_42_DH1_DERIVE_PARAMS), + "::", + stringify!(pPublicData) ) ); } -impl Default for ck_des_cbc_encrypt_data_params { +impl Default for CK_X9_42_DH1_DERIVE_PARAMS { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { @@ -2043,540 +2383,7363 @@ impl Default for ck_des_cbc_encrypt_data_params { } } } +pub type CK_X9_42_DH1_DERIVE_PARAMS_PTR = *mut CK_X9_42_DH1_DERIVE_PARAMS; #[repr(C)] #[derive(Debug, Copy, Clone)] -pub struct ck_aes_cbc_encrypt_data_params { - pub iv: [::std::os::raw::c_uchar; 16usize], - pub pData: *mut ::std::os::raw::c_uchar, - pub length: ::std::os::raw::c_ulong, +pub struct CK_X9_42_DH2_DERIVE_PARAMS { + pub kdf: CK_X9_42_DH_KDF_TYPE, + pub ulOtherInfoLen: CK_ULONG, + pub pOtherInfo: CK_BYTE_PTR, + pub ulPublicDataLen: CK_ULONG, + pub pPublicData: CK_BYTE_PTR, + pub ulPrivateDataLen: CK_ULONG, + pub hPrivateData: CK_OBJECT_HANDLE, + pub ulPublicDataLen2: CK_ULONG, + pub pPublicData2: CK_BYTE_PTR, } #[test] -fn bindgen_test_layout_ck_aes_cbc_encrypt_data_params() { - const UNINIT: ::std::mem::MaybeUninit = +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::(), - 32usize, - concat!("Size of: ", stringify!(ck_aes_cbc_encrypt_data_params)) + ::std::mem::size_of::(), + 72usize, + concat!("Size of: ", stringify!(CK_X9_42_DH2_DERIVE_PARAMS)) ); assert_eq!( - ::std::mem::align_of::(), + ::std::mem::align_of::(), 8usize, - concat!("Alignment of ", stringify!(ck_aes_cbc_encrypt_data_params)) + concat!("Alignment of ", stringify!(CK_X9_42_DH2_DERIVE_PARAMS)) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).iv) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).kdf) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", - stringify!(ck_aes_cbc_encrypt_data_params), + stringify!(CK_X9_42_DH2_DERIVE_PARAMS), "::", - stringify!(iv) + stringify!(kdf) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pData) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ulOtherInfoLen) as usize - ptr as usize }, + 8usize, + 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 }, 16usize, concat!( "Offset of field: ", - stringify!(ck_aes_cbc_encrypt_data_params), + stringify!(CK_X9_42_DH2_DERIVE_PARAMS), "::", - stringify!(pData) + stringify!(pOtherInfo) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).length) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ulPublicDataLen) as usize - ptr as usize }, 24usize, concat!( "Offset of field: ", - stringify!(ck_aes_cbc_encrypt_data_params), + stringify!(CK_X9_42_DH2_DERIVE_PARAMS), "::", - stringify!(length) + stringify!(ulPublicDataLen) ) ); -} -impl Default for ck_aes_cbc_encrypt_data_params { - fn default() -> Self { - let mut s = ::std::mem::MaybeUninit::::uninit(); - unsafe { - ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -pub type CK_RV = ::std::os::raw::c_ulong; -pub type CK_NOTIFY = ::std::option::Option< - unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - event: CK_NOTIFICATION, - application: *mut ::std::os::raw::c_void, - ) -> CK_RV, ->; -pub type CK_C_Initialize = - ::std::option::Option CK_RV>; -pub type CK_C_Finalize = - ::std::option::Option CK_RV>; -pub type CK_C_GetInfo = ::std::option::Option CK_RV>; -pub type CK_C_GetFunctionList = ::std::option::Option< - unsafe extern "C" fn(function_list: *mut *mut _CK_FUNCTION_LIST) -> CK_RV, ->; -pub type CK_C_GetSlotList = ::std::option::Option< - unsafe extern "C" fn( - token_present: ::std::os::raw::c_uchar, - slot_list: *mut CK_SLOT_ID, - ulCount: *mut ::std::os::raw::c_ulong, - ) -> CK_RV, ->; -pub type CK_C_GetSlotInfo = ::std::option::Option< - unsafe extern "C" fn(slotID: CK_SLOT_ID, info: *mut _CK_SLOT_INFO) -> CK_RV, ->; -pub type CK_C_GetTokenInfo = ::std::option::Option< - unsafe extern "C" fn(slotID: CK_SLOT_ID, info: *mut _CK_TOKEN_INFO) -> CK_RV, ->; -pub type CK_C_WaitForSlotEvent = ::std::option::Option< + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pPublicData) as usize - ptr as usize }, + 32usize, + 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 }, + 40usize, + 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 }, + 48usize, + 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 }, + 56usize, + 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 }, + 64usize, + concat!( + "Offset of field: ", + stringify!(CK_X9_42_DH2_DERIVE_PARAMS), + "::", + stringify!(pPublicData2) + ) + ); +} +impl Default for CK_X9_42_DH2_DERIVE_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_X9_42_DH2_DERIVE_PARAMS_PTR = *mut CK_X9_42_DH2_DERIVE_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_X9_42_MQV_DERIVE_PARAMS { + pub kdf: CK_X9_42_DH_KDF_TYPE, + pub ulOtherInfoLen: CK_ULONG, + pub pOtherInfo: CK_BYTE_PTR, + pub ulPublicDataLen: CK_ULONG, + pub pPublicData: CK_BYTE_PTR, + pub ulPrivateDataLen: CK_ULONG, + pub hPrivateData: CK_OBJECT_HANDLE, + pub ulPublicDataLen2: CK_ULONG, + 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::(), + 80usize, + concat!("Size of: ", stringify!(CK_X9_42_MQV_DERIVE_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + 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 }, + 16usize, + 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 }, + 24usize, + 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 }, + 32usize, + 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 }, + 40usize, + 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 }, + 48usize, + 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 }, + 56usize, + 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 }, + 64usize, + 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 }, + 72usize, + concat!( + "Offset of field: ", + stringify!(CK_X9_42_MQV_DERIVE_PARAMS), + "::", + stringify!(publicKey) + ) + ); +} +impl Default for CK_X9_42_MQV_DERIVE_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_X9_42_MQV_DERIVE_PARAMS_PTR = *mut CK_X9_42_MQV_DERIVE_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_KEA_DERIVE_PARAMS { + pub isSender: CK_BBOOL, + pub ulRandomLen: CK_ULONG, + pub pRandomA: CK_BYTE_PTR, + pub pRandomB: CK_BYTE_PTR, + 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::(), + 48usize, + concat!("Size of: ", stringify!(CK_KEA_DERIVE_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + 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 }, + 16usize, + 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 }, + 24usize, + 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 }, + 32usize, + 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 }, + 40usize, + concat!( + "Offset of field: ", + stringify!(CK_KEA_DERIVE_PARAMS), + "::", + stringify!(pPublicData) + ) + ); +} +impl Default for CK_KEA_DERIVE_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_KEA_DERIVE_PARAMS_PTR = *mut CK_KEA_DERIVE_PARAMS; +pub type CK_RC2_PARAMS = CK_ULONG; +pub type CK_RC2_PARAMS_PTR = *mut CK_RC2_PARAMS; +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +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::(), + 16usize, + concat!("Size of: ", stringify!(CK_RC2_CBC_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + concat!( + "Offset of field: ", + stringify!(CK_RC2_CBC_PARAMS), + "::", + stringify!(iv) + ) + ); +} +pub type CK_RC2_CBC_PARAMS_PTR = *mut CK_RC2_CBC_PARAMS; +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +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::(), + 16usize, + concat!("Size of: ", stringify!(CK_RC2_MAC_GENERAL_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + concat!( + "Offset of field: ", + stringify!(CK_RC2_MAC_GENERAL_PARAMS), + "::", + stringify!(ulMacLength) + ) + ); +} +pub type CK_RC2_MAC_GENERAL_PARAMS_PTR = *mut CK_RC2_MAC_GENERAL_PARAMS; +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +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::(), + 16usize, + concat!("Size of: ", stringify!(CK_RC5_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + concat!( + "Offset of field: ", + stringify!(CK_RC5_PARAMS), + "::", + stringify!(ulRounds) + ) + ); +} +pub type CK_RC5_PARAMS_PTR = *mut CK_RC5_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_RC5_CBC_PARAMS { + pub ulWordsize: CK_ULONG, + pub ulRounds: CK_ULONG, + 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::(), + 32usize, + concat!("Size of: ", stringify!(CK_RC5_CBC_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + 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 }, + 16usize, + 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 }, + 24usize, + concat!( + "Offset of field: ", + stringify!(CK_RC5_CBC_PARAMS), + "::", + stringify!(ulIvLen) + ) + ); +} +impl Default for CK_RC5_CBC_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_RC5_CBC_PARAMS_PTR = *mut CK_RC5_CBC_PARAMS; +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct CK_RC5_MAC_GENERAL_PARAMS { + pub ulWordsize: CK_ULONG, + 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::(), + 24usize, + concat!("Size of: ", stringify!(CK_RC5_MAC_GENERAL_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + 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 }, + 16usize, + concat!( + "Offset of field: ", + stringify!(CK_RC5_MAC_GENERAL_PARAMS), + "::", + stringify!(ulMacLength) + ) + ); +} +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; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_DES_CBC_ENCRYPT_DATA_PARAMS { + pub iv: [CK_BYTE; 8usize], + 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::(), + 24usize, + concat!("Size of: ", stringify!(CK_DES_CBC_ENCRYPT_DATA_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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) + ) + ); +} +impl Default for CK_DES_CBC_ENCRYPT_DATA_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_DES_CBC_ENCRYPT_DATA_PARAMS_PTR = *mut CK_DES_CBC_ENCRYPT_DATA_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_AES_CBC_ENCRYPT_DATA_PARAMS { + pub iv: [CK_BYTE; 16usize], + 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::(), + 32usize, + concat!("Size of: ", stringify!(CK_AES_CBC_ENCRYPT_DATA_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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) + ) + ); +} +impl Default for CK_AES_CBC_ENCRYPT_DATA_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_AES_CBC_ENCRYPT_DATA_PARAMS_PTR = *mut CK_AES_CBC_ENCRYPT_DATA_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_SKIPJACK_PRIVATE_WRAP_PARAMS { + pub ulPasswordLen: CK_ULONG, + pub pPassword: CK_BYTE_PTR, + pub ulPublicDataLen: CK_ULONG, + pub pPublicData: CK_BYTE_PTR, + pub ulPAndGLen: CK_ULONG, + pub ulQLen: CK_ULONG, + pub ulRandomLen: CK_ULONG, + pub pRandomA: CK_BYTE_PTR, + pub pPrimeP: CK_BYTE_PTR, + 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::(), + 88usize, + concat!("Size of: ", stringify!(CK_SKIPJACK_PRIVATE_WRAP_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + 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 }, + 16usize, + 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 }, + 24usize, + 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 }, + 32usize, + 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 }, + 40usize, + 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 }, + 48usize, + 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 }, + 56usize, + 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 }, + 64usize, + 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 }, + 72usize, + 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 }, + 80usize, + concat!( + "Offset of field: ", + stringify!(CK_SKIPJACK_PRIVATE_WRAP_PARAMS), + "::", + stringify!(pSubprimeQ) + ) + ); +} +impl Default for CK_SKIPJACK_PRIVATE_WRAP_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_SKIPJACK_PRIVATE_WRAP_PARAMS_PTR = *mut CK_SKIPJACK_PRIVATE_WRAP_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_SKIPJACK_RELAYX_PARAMS { + pub ulOldWrappedXLen: CK_ULONG, + pub pOldWrappedX: CK_BYTE_PTR, + pub ulOldPasswordLen: CK_ULONG, + pub pOldPassword: CK_BYTE_PTR, + pub ulOldPublicDataLen: CK_ULONG, + pub pOldPublicData: CK_BYTE_PTR, + pub ulOldRandomLen: CK_ULONG, + pub pOldRandomA: CK_BYTE_PTR, + pub ulNewPasswordLen: CK_ULONG, + pub pNewPassword: CK_BYTE_PTR, + pub ulNewPublicDataLen: CK_ULONG, + pub pNewPublicData: CK_BYTE_PTR, + 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::(), + 112usize, + concat!("Size of: ", stringify!(CK_SKIPJACK_RELAYX_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + 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 }, + 16usize, + 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 }, + 24usize, + 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 }, + 32usize, + 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 }, + 40usize, + 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 }, + 48usize, + 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 }, + 56usize, + 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 }, + 64usize, + 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 }, + 72usize, + 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 }, + 80usize, + 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 }, + 88usize, + 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 }, + 96usize, + 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 }, + 104usize, + concat!( + "Offset of field: ", + stringify!(CK_SKIPJACK_RELAYX_PARAMS), + "::", + stringify!(pNewRandomA) + ) + ); +} +impl Default for CK_SKIPJACK_RELAYX_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_SKIPJACK_RELAYX_PARAMS_PTR = *mut CK_SKIPJACK_RELAYX_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_PBE_PARAMS { + pub pInitVector: CK_BYTE_PTR, + pub pPassword: CK_UTF8CHAR_PTR, + pub ulPasswordLen: CK_ULONG, + pub pSalt: CK_BYTE_PTR, + 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::(), + 48usize, + concat!("Size of: ", stringify!(CK_PBE_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 24usize, + concat!( + "Offset of field: ", + stringify!(CK_PBE_PARAMS), + "::", + stringify!(pSalt) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ulSaltLen) as usize - ptr as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(CK_PBE_PARAMS), + "::", + stringify!(ulSaltLen) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ulIteration) as usize - ptr as usize }, + 40usize, + concat!( + "Offset of field: ", + stringify!(CK_PBE_PARAMS), + "::", + stringify!(ulIteration) + ) + ); +} +impl Default for CK_PBE_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_PBE_PARAMS_PTR = *mut CK_PBE_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_KEY_WRAP_SET_OAEP_PARAMS { + pub bBC: CK_BYTE, + 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::(), + 24usize, + concat!("Size of: ", stringify!(CK_KEY_WRAP_SET_OAEP_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + 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 }, + 16usize, + concat!( + "Offset of field: ", + stringify!(CK_KEY_WRAP_SET_OAEP_PARAMS), + "::", + stringify!(ulXLen) + ) + ); +} +impl Default for CK_KEY_WRAP_SET_OAEP_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_KEY_WRAP_SET_OAEP_PARAMS_PTR = *mut CK_KEY_WRAP_SET_OAEP_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_SSL3_RANDOM_DATA { + pub pClientRandom: CK_BYTE_PTR, + pub ulClientRandomLen: CK_ULONG, + 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::(), + 32usize, + concat!("Size of: ", stringify!(CK_SSL3_RANDOM_DATA)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 16usize, + 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 }, + 24usize, + concat!( + "Offset of field: ", + stringify!(CK_SSL3_RANDOM_DATA), + "::", + stringify!(ulServerRandomLen) + ) + ); +} +impl Default for CK_SSL3_RANDOM_DATA { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct 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::(), + 40usize, + concat!("Size of: ", stringify!(CK_SSL3_MASTER_KEY_DERIVE_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 32usize, + concat!( + "Offset of field: ", + stringify!(CK_SSL3_MASTER_KEY_DERIVE_PARAMS), + "::", + stringify!(pVersion) + ) + ); +} +impl Default for CK_SSL3_MASTER_KEY_DERIVE_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_SSL3_MASTER_KEY_DERIVE_PARAMS_PTR = *mut CK_SSL3_MASTER_KEY_DERIVE_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_SSL3_KEY_MAT_OUT { + pub hClientMacSecret: CK_OBJECT_HANDLE, + pub hServerMacSecret: CK_OBJECT_HANDLE, + pub hClientKey: CK_OBJECT_HANDLE, + pub hServerKey: CK_OBJECT_HANDLE, + 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::(), + 48usize, + concat!("Size of: ", stringify!(CK_SSL3_KEY_MAT_OUT)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + 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 }, + 16usize, + 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 }, + 24usize, + 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 }, + 32usize, + 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 }, + 40usize, + concat!( + "Offset of field: ", + stringify!(CK_SSL3_KEY_MAT_OUT), + "::", + stringify!(pIVServer) + ) + ); +} +impl Default for CK_SSL3_KEY_MAT_OUT { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_SSL3_KEY_MAT_OUT_PTR = *mut CK_SSL3_KEY_MAT_OUT; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_SSL3_KEY_MAT_PARAMS { + pub ulMacSizeInBits: CK_ULONG, + pub ulKeySizeInBits: CK_ULONG, + pub ulIVSizeInBits: CK_ULONG, + pub bIsExport: CK_BBOOL, + 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::(), + 72usize, + concat!("Size of: ", stringify!(CK_SSL3_KEY_MAT_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + 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 }, + 16usize, + 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 }, + 24usize, + 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 }, + 32usize, + 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 }, + 64usize, + concat!( + "Offset of field: ", + stringify!(CK_SSL3_KEY_MAT_PARAMS), + "::", + stringify!(pReturnedKeyMaterial) + ) + ); +} +impl Default for CK_SSL3_KEY_MAT_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_SSL3_KEY_MAT_PARAMS_PTR = *mut CK_SSL3_KEY_MAT_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_TLS_PRF_PARAMS { + pub pSeed: CK_BYTE_PTR, + pub ulSeedLen: CK_ULONG, + pub pLabel: CK_BYTE_PTR, + pub ulLabelLen: CK_ULONG, + 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::(), + 48usize, + concat!("Size of: ", stringify!(CK_TLS_PRF_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 16usize, + 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 }, + 24usize, + 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 }, + 32usize, + 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 }, + 40usize, + concat!( + "Offset of field: ", + stringify!(CK_TLS_PRF_PARAMS), + "::", + stringify!(pulOutputLen) + ) + ); +} +impl Default for CK_TLS_PRF_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_TLS_PRF_PARAMS_PTR = *mut CK_TLS_PRF_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_WTLS_RANDOM_DATA { + pub pClientRandom: CK_BYTE_PTR, + pub ulClientRandomLen: CK_ULONG, + 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::(), + 32usize, + concat!("Size of: ", stringify!(CK_WTLS_RANDOM_DATA)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 16usize, + 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 }, + 24usize, + concat!( + "Offset of field: ", + stringify!(CK_WTLS_RANDOM_DATA), + "::", + stringify!(ulServerRandomLen) + ) + ); +} +impl Default for CK_WTLS_RANDOM_DATA { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_WTLS_RANDOM_DATA_PTR = *mut CK_WTLS_RANDOM_DATA; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_WTLS_MASTER_KEY_DERIVE_PARAMS { + pub DigestMechanism: CK_MECHANISM_TYPE, + 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::(), + 48usize, + concat!("Size of: ", stringify!(CK_WTLS_MASTER_KEY_DERIVE_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + 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 }, + 40usize, + concat!( + "Offset of field: ", + stringify!(CK_WTLS_MASTER_KEY_DERIVE_PARAMS), + "::", + stringify!(pVersion) + ) + ); +} +impl Default for CK_WTLS_MASTER_KEY_DERIVE_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_WTLS_MASTER_KEY_DERIVE_PARAMS_PTR = *mut CK_WTLS_MASTER_KEY_DERIVE_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_WTLS_PRF_PARAMS { + pub DigestMechanism: CK_MECHANISM_TYPE, + pub pSeed: CK_BYTE_PTR, + pub ulSeedLen: CK_ULONG, + pub pLabel: CK_BYTE_PTR, + pub ulLabelLen: CK_ULONG, + 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::(), + 56usize, + concat!("Size of: ", stringify!(CK_WTLS_PRF_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + 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 }, + 16usize, + 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 }, + 24usize, + 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 }, + 32usize, + 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 }, + 40usize, + 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 }, + 48usize, + concat!( + "Offset of field: ", + stringify!(CK_WTLS_PRF_PARAMS), + "::", + stringify!(pulOutputLen) + ) + ); +} +impl Default for CK_WTLS_PRF_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_WTLS_PRF_PARAMS_PTR = *mut CK_WTLS_PRF_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_WTLS_KEY_MAT_OUT { + pub hMacSecret: CK_OBJECT_HANDLE, + 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::(), + 24usize, + concat!("Size of: ", stringify!(CK_WTLS_KEY_MAT_OUT)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + 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 }, + 16usize, + concat!( + "Offset of field: ", + stringify!(CK_WTLS_KEY_MAT_OUT), + "::", + stringify!(pIV) + ) + ); +} +impl Default for CK_WTLS_KEY_MAT_OUT { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_WTLS_KEY_MAT_OUT_PTR = *mut CK_WTLS_KEY_MAT_OUT; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_WTLS_KEY_MAT_PARAMS { + pub DigestMechanism: CK_MECHANISM_TYPE, + pub ulMacSizeInBits: CK_ULONG, + pub ulKeySizeInBits: CK_ULONG, + pub ulIVSizeInBits: CK_ULONG, + pub ulSequenceNumber: CK_ULONG, + pub bIsExport: CK_BBOOL, + 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::(), + 88usize, + concat!("Size of: ", stringify!(CK_WTLS_KEY_MAT_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + 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 }, + 16usize, + 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 }, + 24usize, + 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 }, + 32usize, + 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 }, + 40usize, + 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 }, + 48usize, + 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 }, + 80usize, + concat!( + "Offset of field: ", + stringify!(CK_WTLS_KEY_MAT_PARAMS), + "::", + stringify!(pReturnedKeyMaterial) + ) + ); +} +impl Default for CK_WTLS_KEY_MAT_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_WTLS_KEY_MAT_PARAMS_PTR = *mut CK_WTLS_KEY_MAT_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_CMS_SIG_PARAMS { + pub certificateHandle: CK_OBJECT_HANDLE, + pub pSigningMechanism: CK_MECHANISM_PTR, + pub pDigestMechanism: CK_MECHANISM_PTR, + pub pContentType: CK_UTF8CHAR_PTR, + pub pRequestedAttributes: CK_BYTE_PTR, + pub ulRequestedAttributesLen: CK_ULONG, + 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::(), + 64usize, + concat!("Size of: ", stringify!(CK_CMS_SIG_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + 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 }, + 16usize, + 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 }, + 24usize, + 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 }, + 32usize, + 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 }, + 40usize, + 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 }, + 48usize, + 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 }, + 56usize, + concat!( + "Offset of field: ", + stringify!(CK_CMS_SIG_PARAMS), + "::", + stringify!(ulRequiredAttributesLen) + ) + ); +} +impl Default for CK_CMS_SIG_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_CMS_SIG_PARAMS_PTR = *mut CK_CMS_SIG_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +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::(), + 16usize, + concat!("Size of: ", stringify!(CK_KEY_DERIVATION_STRING_DATA)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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) + ) + ); +} +impl Default for CK_KEY_DERIVATION_STRING_DATA { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_KEY_DERIVATION_STRING_DATA_PTR = *mut CK_KEY_DERIVATION_STRING_DATA; +pub type CK_EXTRACT_PARAMS = CK_ULONG; +pub type CK_EXTRACT_PARAMS_PTR = *mut CK_EXTRACT_PARAMS; +pub type CK_PKCS5_PBKD2_PSEUDO_RANDOM_FUNCTION_TYPE = CK_ULONG; +pub type CK_PKCS5_PBKD2_PSEUDO_RANDOM_FUNCTION_TYPE_PTR = + *mut CK_PKCS5_PBKD2_PSEUDO_RANDOM_FUNCTION_TYPE; +pub type CK_PKCS5_PBKDF2_SALT_SOURCE_TYPE = CK_ULONG; +pub type CK_PKCS5_PBKDF2_SALT_SOURCE_TYPE_PTR = *mut CK_PKCS5_PBKDF2_SALT_SOURCE_TYPE; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_PKCS5_PBKD2_PARAMS { + pub saltSource: CK_PKCS5_PBKDF2_SALT_SOURCE_TYPE, + pub pSaltSourceData: CK_VOID_PTR, + pub ulSaltSourceDataLen: CK_ULONG, + pub iterations: CK_ULONG, + pub prf: CK_PKCS5_PBKD2_PSEUDO_RANDOM_FUNCTION_TYPE, + pub pPrfData: CK_VOID_PTR, + pub ulPrfDataLen: CK_ULONG, + 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::(), + 72usize, + concat!("Size of: ", stringify!(CK_PKCS5_PBKD2_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + 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 }, + 16usize, + 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 }, + 24usize, + 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 }, + 32usize, + 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 }, + 40usize, + 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 }, + 48usize, + 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 }, + 56usize, + 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 }, + 64usize, + concat!( + "Offset of field: ", + stringify!(CK_PKCS5_PBKD2_PARAMS), + "::", + stringify!(ulPasswordLen) + ) + ); +} +impl Default for CK_PKCS5_PBKD2_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_PKCS5_PBKD2_PARAMS_PTR = *mut CK_PKCS5_PBKD2_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_PKCS5_PBKD2_PARAMS2 { + pub saltSource: CK_PKCS5_PBKDF2_SALT_SOURCE_TYPE, + pub pSaltSourceData: CK_VOID_PTR, + pub ulSaltSourceDataLen: CK_ULONG, + pub iterations: CK_ULONG, + pub prf: CK_PKCS5_PBKD2_PSEUDO_RANDOM_FUNCTION_TYPE, + pub pPrfData: CK_VOID_PTR, + pub ulPrfDataLen: CK_ULONG, + 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::(), + 72usize, + concat!("Size of: ", stringify!(CK_PKCS5_PBKD2_PARAMS2)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + 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 }, + 16usize, + 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 }, + 24usize, + 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 }, + 32usize, + 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 }, + 40usize, + 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 }, + 48usize, + 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 }, + 56usize, + 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 }, + 64usize, + concat!( + "Offset of field: ", + stringify!(CK_PKCS5_PBKD2_PARAMS2), + "::", + stringify!(ulPasswordLen) + ) + ); +} +impl Default for CK_PKCS5_PBKD2_PARAMS2 { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_PKCS5_PBKD2_PARAMS2_PTR = *mut CK_PKCS5_PBKD2_PARAMS2; +pub type CK_OTP_PARAM_TYPE = CK_ULONG; +pub type CK_PARAM_TYPE = CK_OTP_PARAM_TYPE; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_OTP_PARAM { + pub type_: CK_OTP_PARAM_TYPE, + 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::(), + 24usize, + concat!("Size of: ", stringify!(CK_OTP_PARAM)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + concat!( + "Offset of field: ", + stringify!(CK_OTP_PARAM), + "::", + stringify!(pValue) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ulValueLen) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(CK_OTP_PARAM), + "::", + stringify!(ulValueLen) + ) + ); +} +impl Default for CK_OTP_PARAM { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_OTP_PARAM_PTR = *mut CK_OTP_PARAM; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +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::(), + 16usize, + concat!("Size of: ", stringify!(CK_OTP_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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) + ) + ); +} +impl Default for CK_OTP_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_OTP_PARAMS_PTR = *mut CK_OTP_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +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::(), + 16usize, + concat!("Size of: ", stringify!(CK_OTP_SIGNATURE_INFO)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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) + ) + ); +} +impl Default for CK_OTP_SIGNATURE_INFO { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_OTP_SIGNATURE_INFO_PTR = *mut CK_OTP_SIGNATURE_INFO; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_KIP_PARAMS { + pub pMechanism: CK_MECHANISM_PTR, + pub hKey: CK_OBJECT_HANDLE, + 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::(), + 32usize, + concat!("Size of: ", stringify!(CK_KIP_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 16usize, + concat!( + "Offset of field: ", + stringify!(CK_KIP_PARAMS), + "::", + stringify!(pSeed) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ulSeedLen) as usize - ptr as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(CK_KIP_PARAMS), + "::", + stringify!(ulSeedLen) + ) + ); +} +impl Default for CK_KIP_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_KIP_PARAMS_PTR = *mut CK_KIP_PARAMS; +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +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::(), + 24usize, + concat!("Size of: ", stringify!(CK_AES_CTR_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + concat!( + "Offset of field: ", + stringify!(CK_AES_CTR_PARAMS), + "::", + stringify!(cb) + ) + ); +} +pub type CK_AES_CTR_PARAMS_PTR = *mut CK_AES_CTR_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_GCM_PARAMS { + pub pIv: CK_BYTE_PTR, + pub ulIvLen: CK_ULONG, + pub ulIvBits: CK_ULONG, + pub pAAD: CK_BYTE_PTR, + 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::(), + 48usize, + concat!("Size of: ", stringify!(CK_GCM_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 16usize, + concat!( + "Offset of field: ", + stringify!(CK_GCM_PARAMS), + "::", + stringify!(ulIvBits) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pAAD) as usize - ptr as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(CK_GCM_PARAMS), + "::", + stringify!(pAAD) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ulAADLen) as usize - ptr as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(CK_GCM_PARAMS), + "::", + stringify!(ulAADLen) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ulTagBits) as usize - ptr as usize }, + 40usize, + concat!( + "Offset of field: ", + stringify!(CK_GCM_PARAMS), + "::", + stringify!(ulTagBits) + ) + ); +} +impl Default for CK_GCM_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_GCM_PARAMS_PTR = *mut CK_GCM_PARAMS; +pub type CK_GENERATOR_FUNCTION = CK_ULONG; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_GCM_MESSAGE_PARAMS { + pub pIv: CK_BYTE_PTR, + pub ulIvLen: CK_ULONG, + pub ulIvFixedBits: CK_ULONG, + pub ivGenerator: CK_GENERATOR_FUNCTION, + 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::(), + 48usize, + concat!("Size of: ", stringify!(CK_GCM_MESSAGE_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 16usize, + 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 }, + 24usize, + 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 }, + 32usize, + 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 }, + 40usize, + concat!( + "Offset of field: ", + stringify!(CK_GCM_MESSAGE_PARAMS), + "::", + stringify!(ulTagBits) + ) + ); +} +impl Default for CK_GCM_MESSAGE_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_GCM_MESSAGE_PARAMS_PTR = CK_GCM_MESSAGE_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_CCM_PARAMS { + pub ulDataLen: CK_ULONG, + pub pNonce: CK_BYTE_PTR, + pub ulNonceLen: CK_ULONG, + pub pAAD: CK_BYTE_PTR, + 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::(), + 48usize, + concat!("Size of: ", stringify!(CK_CCM_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + concat!( + "Offset of field: ", + stringify!(CK_CCM_PARAMS), + "::", + stringify!(pNonce) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ulNonceLen) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(CK_CCM_PARAMS), + "::", + stringify!(ulNonceLen) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pAAD) as usize - ptr as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(CK_CCM_PARAMS), + "::", + stringify!(pAAD) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ulAADLen) as usize - ptr as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(CK_CCM_PARAMS), + "::", + stringify!(ulAADLen) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ulMACLen) as usize - ptr as usize }, + 40usize, + concat!( + "Offset of field: ", + stringify!(CK_CCM_PARAMS), + "::", + stringify!(ulMACLen) + ) + ); +} +impl Default for CK_CCM_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_CCM_PARAMS_PTR = *mut CK_CCM_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_CCM_MESSAGE_PARAMS { + pub ulDataLen: CK_ULONG, + pub pNonce: CK_BYTE_PTR, + pub ulNonceLen: CK_ULONG, + pub ulNonceFixedBits: CK_ULONG, + pub nonceGenerator: CK_GENERATOR_FUNCTION, + 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::(), + 56usize, + concat!("Size of: ", stringify!(CK_CCM_MESSAGE_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + 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 }, + 16usize, + 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 }, + 24usize, + 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 }, + 32usize, + 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 }, + 40usize, + 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 }, + 48usize, + concat!( + "Offset of field: ", + stringify!(CK_CCM_MESSAGE_PARAMS), + "::", + stringify!(ulMACLen) + ) + ); +} +impl Default for CK_CCM_MESSAGE_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_CCM_MESSAGE_PARAMS_PTR = CK_CCM_MESSAGE_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_AES_GCM_PARAMS { + pub pIv: CK_BYTE_PTR, + pub ulIvLen: CK_ULONG, + pub ulIvBits: CK_ULONG, + pub pAAD: CK_BYTE_PTR, + 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::(), + 48usize, + concat!("Size of: ", stringify!(CK_AES_GCM_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 16usize, + 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 }, + 24usize, + 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 }, + 32usize, + 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 }, + 40usize, + concat!( + "Offset of field: ", + stringify!(CK_AES_GCM_PARAMS), + "::", + stringify!(ulTagBits) + ) + ); +} +impl Default for CK_AES_GCM_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_AES_GCM_PARAMS_PTR = *mut CK_AES_GCM_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_AES_CCM_PARAMS { + pub ulDataLen: CK_ULONG, + pub pNonce: CK_BYTE_PTR, + pub ulNonceLen: CK_ULONG, + pub pAAD: CK_BYTE_PTR, + 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::(), + 48usize, + concat!("Size of: ", stringify!(CK_AES_CCM_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + 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 }, + 16usize, + 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 }, + 24usize, + 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 }, + 32usize, + 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 }, + 40usize, + concat!( + "Offset of field: ", + stringify!(CK_AES_CCM_PARAMS), + "::", + stringify!(ulMACLen) + ) + ); +} +impl Default for CK_AES_CCM_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_AES_CCM_PARAMS_PTR = *mut CK_AES_CCM_PARAMS; +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +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::(), + 24usize, + concat!("Size of: ", stringify!(CK_CAMELLIA_CTR_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + concat!( + "Offset of field: ", + stringify!(CK_CAMELLIA_CTR_PARAMS), + "::", + stringify!(cb) + ) + ); +} +pub type CK_CAMELLIA_CTR_PARAMS_PTR = *mut CK_CAMELLIA_CTR_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_CAMELLIA_CBC_ENCRYPT_DATA_PARAMS { + pub iv: [CK_BYTE; 16usize], + 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::(), + 32usize, + concat!("Size of: ", stringify!(CK_CAMELLIA_CBC_ENCRYPT_DATA_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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) + ) + ); +} +impl Default for CK_CAMELLIA_CBC_ENCRYPT_DATA_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_CAMELLIA_CBC_ENCRYPT_DATA_PARAMS_PTR = *mut CK_CAMELLIA_CBC_ENCRYPT_DATA_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_ARIA_CBC_ENCRYPT_DATA_PARAMS { + pub iv: [CK_BYTE; 16usize], + 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::(), + 32usize, + concat!("Size of: ", stringify!(CK_ARIA_CBC_ENCRYPT_DATA_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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) + ) + ); +} +impl Default for CK_ARIA_CBC_ENCRYPT_DATA_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_ARIA_CBC_ENCRYPT_DATA_PARAMS_PTR = *mut CK_ARIA_CBC_ENCRYPT_DATA_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_DSA_PARAMETER_GEN_PARAM { + pub hash: CK_MECHANISM_TYPE, + pub pSeed: CK_BYTE_PTR, + 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::(), + 32usize, + concat!("Size of: ", stringify!(CK_DSA_PARAMETER_GEN_PARAM)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + 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 }, + 16usize, + 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 }, + 24usize, + concat!( + "Offset of field: ", + stringify!(CK_DSA_PARAMETER_GEN_PARAM), + "::", + stringify!(ulIndex) + ) + ); +} +impl Default for CK_DSA_PARAMETER_GEN_PARAM { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_DSA_PARAMETER_GEN_PARAM_PTR = *mut CK_DSA_PARAMETER_GEN_PARAM; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_ECDH_AES_KEY_WRAP_PARAMS { + pub ulAESKeyBits: CK_ULONG, + pub kdf: CK_EC_KDF_TYPE, + 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::(), + 32usize, + concat!("Size of: ", stringify!(CK_ECDH_AES_KEY_WRAP_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + 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 }, + 16usize, + 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 }, + 24usize, + concat!( + "Offset of field: ", + stringify!(CK_ECDH_AES_KEY_WRAP_PARAMS), + "::", + stringify!(pSharedData) + ) + ); +} +impl Default for CK_ECDH_AES_KEY_WRAP_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_ECDH_AES_KEY_WRAP_PARAMS_PTR = *mut CK_ECDH_AES_KEY_WRAP_PARAMS; +pub type CK_JAVA_MIDP_SECURITY_DOMAIN = CK_ULONG; +pub type CK_CERTIFICATE_CATEGORY = CK_ULONG; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +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::(), + 16usize, + concat!("Size of: ", stringify!(CK_RSA_AES_KEY_WRAP_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + concat!( + "Offset of field: ", + stringify!(CK_RSA_AES_KEY_WRAP_PARAMS), + "::", + stringify!(pOAEPParams) + ) + ); +} +impl Default for CK_RSA_AES_KEY_WRAP_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_RSA_AES_KEY_WRAP_PARAMS_PTR = *mut CK_RSA_AES_KEY_WRAP_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_TLS12_MASTER_KEY_DERIVE_PARAMS { + pub RandomInfo: CK_SSL3_RANDOM_DATA, + 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::(), + 48usize, + concat!("Size of: ", stringify!(CK_TLS12_MASTER_KEY_DERIVE_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 32usize, + 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 }, + 40usize, + concat!( + "Offset of field: ", + stringify!(CK_TLS12_MASTER_KEY_DERIVE_PARAMS), + "::", + stringify!(prfHashMechanism) + ) + ); +} +impl Default for CK_TLS12_MASTER_KEY_DERIVE_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_TLS12_MASTER_KEY_DERIVE_PARAMS_PTR = *mut CK_TLS12_MASTER_KEY_DERIVE_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_TLS12_KEY_MAT_PARAMS { + pub ulMacSizeInBits: CK_ULONG, + pub ulKeySizeInBits: CK_ULONG, + pub ulIVSizeInBits: CK_ULONG, + pub bIsExport: CK_BBOOL, + pub RandomInfo: CK_SSL3_RANDOM_DATA, + 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::(), + 80usize, + concat!("Size of: ", stringify!(CK_TLS12_KEY_MAT_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + 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 }, + 16usize, + 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 }, + 24usize, + 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 }, + 32usize, + 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 }, + 64usize, + 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 }, + 72usize, + concat!( + "Offset of field: ", + stringify!(CK_TLS12_KEY_MAT_PARAMS), + "::", + stringify!(prfHashMechanism) + ) + ); +} +impl Default for CK_TLS12_KEY_MAT_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_TLS12_KEY_MAT_PARAMS_PTR = *mut CK_TLS12_KEY_MAT_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_TLS_KDF_PARAMS { + pub prfMechanism: CK_MECHANISM_TYPE, + pub pLabel: CK_BYTE_PTR, + pub ulLabelLength: CK_ULONG, + pub RandomInfo: CK_SSL3_RANDOM_DATA, + 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::(), + 72usize, + concat!("Size of: ", stringify!(CK_TLS_KDF_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + 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 }, + 16usize, + 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 }, + 24usize, + 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 }, + 56usize, + 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 }, + 64usize, + concat!( + "Offset of field: ", + stringify!(CK_TLS_KDF_PARAMS), + "::", + stringify!(ulContextDataLength) + ) + ); +} +impl Default for CK_TLS_KDF_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_TLS_KDF_PARAMS_PTR = *mut CK_TLS_KDF_PARAMS; +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct CK_TLS_MAC_PARAMS { + pub prfHashMechanism: CK_MECHANISM_TYPE, + 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::(), + 24usize, + concat!("Size of: ", stringify!(CK_TLS_MAC_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + 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 }, + 16usize, + concat!( + "Offset of field: ", + stringify!(CK_TLS_MAC_PARAMS), + "::", + stringify!(ulServerOrClient) + ) + ); +} +pub type CK_TLS_MAC_PARAMS_PTR = *mut CK_TLS_MAC_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_GOSTR3410_DERIVE_PARAMS { + pub kdf: CK_EC_KDF_TYPE, + pub pPublicData: CK_BYTE_PTR, + pub ulPublicDataLen: CK_ULONG, + 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::(), + 40usize, + concat!("Size of: ", stringify!(CK_GOSTR3410_DERIVE_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + 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 }, + 16usize, + 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 }, + 24usize, + 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 }, + 32usize, + concat!( + "Offset of field: ", + stringify!(CK_GOSTR3410_DERIVE_PARAMS), + "::", + stringify!(ulUKMLen) + ) + ); +} +impl Default for CK_GOSTR3410_DERIVE_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_GOSTR3410_DERIVE_PARAMS_PTR = *mut CK_GOSTR3410_DERIVE_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_GOSTR3410_KEY_WRAP_PARAMS { + pub pWrapOID: CK_BYTE_PTR, + pub ulWrapOIDLen: CK_ULONG, + pub pUKM: CK_BYTE_PTR, + 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::(), + 40usize, + concat!("Size of: ", stringify!(CK_GOSTR3410_KEY_WRAP_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 16usize, + 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 }, + 24usize, + 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 }, + 32usize, + concat!( + "Offset of field: ", + stringify!(CK_GOSTR3410_KEY_WRAP_PARAMS), + "::", + stringify!(hKey) + ) + ); +} +impl Default for CK_GOSTR3410_KEY_WRAP_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_GOSTR3410_KEY_WRAP_PARAMS_PTR = *mut CK_GOSTR3410_KEY_WRAP_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_SEED_CBC_ENCRYPT_DATA_PARAMS { + pub iv: [CK_BYTE; 16usize], + 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::(), + 32usize, + concat!("Size of: ", stringify!(CK_SEED_CBC_ENCRYPT_DATA_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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) + ) + ); +} +impl Default for CK_SEED_CBC_ENCRYPT_DATA_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_SEED_CBC_ENCRYPT_DATA_PARAMS_PTR = *mut CK_SEED_CBC_ENCRYPT_DATA_PARAMS; +pub type CK_PROFILE_ID = CK_ULONG; +pub type CK_PRF_DATA_TYPE = CK_ULONG; +pub type CK_SP800_108_PRF_TYPE = CK_MECHANISM_TYPE; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_PRF_DATA_PARAM { + pub type_: CK_PRF_DATA_TYPE, + 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::(), + 24usize, + concat!("Size of: ", stringify!(CK_PRF_DATA_PARAM)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + 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 }, + 16usize, + concat!( + "Offset of field: ", + stringify!(CK_PRF_DATA_PARAM), + "::", + stringify!(ulValueLen) + ) + ); +} +impl Default for CK_PRF_DATA_PARAM { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_PRF_DATA_PARAM_PTR = *mut CK_PRF_DATA_PARAM; +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +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::(), + 16usize, + concat!("Size of: ", stringify!(CK_SP800_108_COUNTER_FORMAT)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + concat!( + "Offset of field: ", + stringify!(CK_SP800_108_COUNTER_FORMAT), + "::", + stringify!(ulWidthInBits) + ) + ); +} +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)] +#[derive(Debug, Default, Copy, Clone)] +pub struct CK_SP800_108_DKM_LENGTH_FORMAT { + pub dkmLengthMethod: CK_SP800_108_DKM_LENGTH_METHOD, + 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::(), + 24usize, + concat!("Size of: ", stringify!(CK_SP800_108_DKM_LENGTH_FORMAT)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + 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 }, + 16usize, + concat!( + "Offset of field: ", + stringify!(CK_SP800_108_DKM_LENGTH_FORMAT), + "::", + stringify!(ulWidthInBits) + ) + ); +} +pub type CK_SP800_108_DKM_LENGTH_FORMAT_PTR = *mut CK_SP800_108_DKM_LENGTH_FORMAT; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_DERIVED_KEY { + pub pTemplate: CK_ATTRIBUTE_PTR, + 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::(), + 24usize, + concat!("Size of: ", stringify!(CK_DERIVED_KEY)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 16usize, + concat!( + "Offset of field: ", + stringify!(CK_DERIVED_KEY), + "::", + stringify!(phKey) + ) + ); +} +impl Default for CK_DERIVED_KEY { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_DERIVED_KEY_PTR = *mut CK_DERIVED_KEY; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_SP800_108_KDF_PARAMS { + pub prfType: CK_SP800_108_PRF_TYPE, + pub ulNumberOfDataParams: CK_ULONG, + pub pDataParams: CK_PRF_DATA_PARAM_PTR, + pub ulAdditionalDerivedKeys: CK_ULONG, + pub pAdditionalDerivedKeys: CK_DERIVED_KEY, +} +#[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::(), + 56usize, + concat!("Size of: ", stringify!(CK_SP800_108_KDF_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + 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 }, + 16usize, + 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 }, + 24usize, + 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 }, + 32usize, + concat!( + "Offset of field: ", + stringify!(CK_SP800_108_KDF_PARAMS), + "::", + stringify!(pAdditionalDerivedKeys) + ) + ); +} +impl Default for CK_SP800_108_KDF_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_SP800_108_KDF_PARAMS_PTR = *mut CK_SP800_108_KDF_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_SP800_108_FEEDBACK_KDF_PARAMS { + pub prfType: CK_SP800_108_PRF_TYPE, + pub ulNumberOfDataParams: CK_ULONG, + pub pDataParams: CK_PRF_DATA_PARAM_PTR, + pub ulIVLen: CK_ULONG, + pub pIV: CK_BYTE_PTR, + pub ulAdditionalDerivedKeys: CK_ULONG, + pub pAdditionalDerivedKeys: CK_DERIVED_KEY, +} +#[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::(), + 72usize, + concat!("Size of: ", stringify!(CK_SP800_108_FEEDBACK_KDF_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + 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 }, + 16usize, + 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 }, + 24usize, + 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 }, + 32usize, + 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 }, + 40usize, + 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 }, + 48usize, + concat!( + "Offset of field: ", + stringify!(CK_SP800_108_FEEDBACK_KDF_PARAMS), + "::", + stringify!(pAdditionalDerivedKeys) + ) + ); +} +impl Default for CK_SP800_108_FEEDBACK_KDF_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_SP800_108_FEEDBACK_KDF_PARAMS_PTR = *mut CK_SP800_108_FEEDBACK_KDF_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_EDDSA_PARAMS { + pub phFlag: CK_BBOOL, + 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::(), + 24usize, + concat!("Size of: ", stringify!(CK_EDDSA_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + concat!( + "Offset of field: ", + stringify!(CK_EDDSA_PARAMS), + "::", + stringify!(ulContextDataLen) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pContextData) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(CK_EDDSA_PARAMS), + "::", + stringify!(pContextData) + ) + ); +} +impl Default for CK_EDDSA_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_EDDSA_PARAMS_PTR = *mut CK_EDDSA_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_CHACHA20_PARAMS { + pub pBlockCounter: CK_BYTE_PTR, + pub blockCounterBits: CK_ULONG, + 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::(), + 32usize, + concat!("Size of: ", stringify!(CK_CHACHA20_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 16usize, + concat!( + "Offset of field: ", + stringify!(CK_CHACHA20_PARAMS), + "::", + stringify!(pNonce) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ulNonceBits) as usize - ptr as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(CK_CHACHA20_PARAMS), + "::", + stringify!(ulNonceBits) + ) + ); +} +impl Default for CK_CHACHA20_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_SALSA20_PARAMS { + pub pBlockCounter: CK_BYTE_PTR, + 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::(), + 24usize, + concat!("Size of: ", stringify!(CK_SALSA20_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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) + ) + ); +} +impl Default for CK_SALSA20_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_SALSA20_CHACHA20_POLY1305_PARAMS { + pub pNonce: CK_BYTE_PTR, + pub ulNonceLen: CK_ULONG, + 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::(), + 32usize, + concat!("Size of: ", stringify!(CK_SALSA20_CHACHA20_POLY1305_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 16usize, + 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 }, + 24usize, + concat!( + "Offset of field: ", + stringify!(CK_SALSA20_CHACHA20_POLY1305_PARAMS), + "::", + stringify!(ulAADLen) + ) + ); +} +impl Default for CK_SALSA20_CHACHA20_POLY1305_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_SALSA20_CHACHA20_POLY1305_PARAMS_PTR = *mut CK_SALSA20_CHACHA20_POLY1305_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_SALSA20_CHACHA20_POLY1305_MSG_PARAMS { + pub pNonce: CK_BYTE_PTR, + 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::(), + 24usize, + concat!( + "Size of: ", + stringify!(CK_SALSA20_CHACHA20_POLY1305_MSG_PARAMS) + ) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 16usize, + concat!( + "Offset of field: ", + stringify!(CK_SALSA20_CHACHA20_POLY1305_MSG_PARAMS), + "::", + stringify!(pTag) + ) + ); +} +impl Default for CK_SALSA20_CHACHA20_POLY1305_MSG_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_SALSA20_CHACHA20_POLY1305_MSG_PARAMS_PTR = *mut CK_SALSA20_CHACHA20_POLY1305_MSG_PARAMS; +pub type CK_X3DH_KDF_TYPE = CK_ULONG; +pub type CK_X3DH_KDF_TYPE_PTR = *mut CK_X3DH_KDF_TYPE; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_X3DH_INITIATE_PARAMS { + pub kdf: CK_X3DH_KDF_TYPE, + pub pPeer_identity: CK_OBJECT_HANDLE, + pub pPeer_prekey: CK_OBJECT_HANDLE, + pub pPrekey_signature: CK_BYTE_PTR, + pub pOnetime_key: CK_BYTE_PTR, + 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::(), + 56usize, + concat!("Size of: ", stringify!(CK_X3DH_INITIATE_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + 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 }, + 16usize, + 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 }, + 24usize, + 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 }, + 32usize, + 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 }, + 40usize, + 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 }, + 48usize, + concat!( + "Offset of field: ", + stringify!(CK_X3DH_INITIATE_PARAMS), + "::", + stringify!(pOwn_ephemeral) + ) + ); +} +impl Default for CK_X3DH_INITIATE_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_X3DH_RESPOND_PARAMS { + pub kdf: CK_X3DH_KDF_TYPE, + pub pIdentity_id: CK_BYTE_PTR, + pub pPrekey_id: CK_BYTE_PTR, + pub pOnetime_id: CK_BYTE_PTR, + 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::(), + 48usize, + concat!("Size of: ", stringify!(CK_X3DH_RESPOND_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + 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 }, + 16usize, + 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 }, + 24usize, + 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 }, + 32usize, + 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 }, + 40usize, + concat!( + "Offset of field: ", + stringify!(CK_X3DH_RESPOND_PARAMS), + "::", + stringify!(pInitiator_ephemeral) + ) + ); +} +impl Default for CK_X3DH_RESPOND_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_X2RATCHET_KDF_TYPE = CK_ULONG; +pub type CK_X2RATCHET_KDF_TYPE_PTR = *mut CK_X2RATCHET_KDF_TYPE; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_X2RATCHET_INITIALIZE_PARAMS { + pub sk: CK_BYTE_PTR, + pub peer_public_prekey: CK_OBJECT_HANDLE, + pub peer_public_identity: CK_OBJECT_HANDLE, + pub own_public_identity: CK_OBJECT_HANDLE, + pub bEncryptedHeader: CK_BBOOL, + pub eCurve: CK_ULONG, + 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::(), + 64usize, + concat!("Size of: ", stringify!(CK_X2RATCHET_INITIALIZE_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 16usize, + 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 }, + 24usize, + 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 }, + 32usize, + 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 }, + 40usize, + 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 }, + 48usize, + 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 }, + 56usize, + concat!( + "Offset of field: ", + stringify!(CK_X2RATCHET_INITIALIZE_PARAMS), + "::", + stringify!(kdfMechanism) + ) + ); +} +impl Default for CK_X2RATCHET_INITIALIZE_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_X2RATCHET_INITIALIZE_PARAMS_PTR = *mut CK_X2RATCHET_INITIALIZE_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_X2RATCHET_RESPOND_PARAMS { + pub sk: CK_BYTE_PTR, + pub own_prekey: CK_OBJECT_HANDLE, + pub initiator_identity: CK_OBJECT_HANDLE, + pub own_public_identity: CK_OBJECT_HANDLE, + pub bEncryptedHeader: CK_BBOOL, + pub eCurve: CK_ULONG, + 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::(), + 64usize, + concat!("Size of: ", stringify!(CK_X2RATCHET_RESPOND_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 16usize, + 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 }, + 24usize, + 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 }, + 32usize, + 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 }, + 40usize, + 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 }, + 48usize, + 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 }, + 56usize, + concat!( + "Offset of field: ", + stringify!(CK_X2RATCHET_RESPOND_PARAMS), + "::", + stringify!(kdfMechanism) + ) + ); +} +impl Default for CK_X2RATCHET_RESPOND_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_X2RATCHET_RESPOND_PARAMS_PTR = *mut CK_X2RATCHET_RESPOND_PARAMS; +pub type CK_XEDDSA_HASH_TYPE = CK_ULONG; +pub type CK_XEDDSA_HASH_TYPE_PTR = *mut CK_XEDDSA_HASH_TYPE; +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +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::(), + 8usize, + concat!("Size of: ", stringify!(CK_XEDDSA_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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) + ) + ); +} +pub type CK_XEDDSA_PARAMS_PTR = *mut CK_XEDDSA_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_HKDF_PARAMS { + pub bExtract: CK_BBOOL, + pub bExpand: CK_BBOOL, + pub prfHashMechanism: CK_MECHANISM_TYPE, + pub ulSaltType: CK_ULONG, + pub pSalt: CK_BYTE_PTR, + pub ulSaltLen: CK_ULONG, + pub hSaltKey: CK_ULONG, + 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::(), + 64usize, + concat!("Size of: ", stringify!(CK_HKDF_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + concat!( + "Offset of field: ", + stringify!(CK_HKDF_PARAMS), + "::", + stringify!(prfHashMechanism) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ulSaltType) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(CK_HKDF_PARAMS), + "::", + stringify!(ulSaltType) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pSalt) as usize - ptr as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(CK_HKDF_PARAMS), + "::", + stringify!(pSalt) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ulSaltLen) as usize - ptr as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(CK_HKDF_PARAMS), + "::", + stringify!(ulSaltLen) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).hSaltKey) as usize - ptr as usize }, + 40usize, + concat!( + "Offset of field: ", + stringify!(CK_HKDF_PARAMS), + "::", + stringify!(hSaltKey) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pInfo) as usize - ptr as usize }, + 48usize, + concat!( + "Offset of field: ", + stringify!(CK_HKDF_PARAMS), + "::", + stringify!(pInfo) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ulInfoLen) as usize - ptr as usize }, + 56usize, + concat!( + "Offset of field: ", + stringify!(CK_HKDF_PARAMS), + "::", + stringify!(ulInfoLen) + ) + ); +} +impl Default for CK_HKDF_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_C_Initialize = + ::std::option::Option CK_RV>; +pub type CK_C_Finalize = + ::std::option::Option CK_RV>; +pub type CK_C_GetInfo = ::std::option::Option CK_RV>; +pub type CK_C_GetFunctionList = + ::std::option::Option CK_RV>; +pub type CK_C_GetSlotList = ::std::option::Option< unsafe extern "C" fn( - flags: CK_FLAGS, - slot: *mut CK_SLOT_ID, - pReserved: *mut ::std::os::raw::c_void, + tokenPresent: CK_BBOOL, + pSlotList: CK_SLOT_ID_PTR, + pulCount: CK_ULONG_PTR, ) -> CK_RV, >; +pub type CK_C_GetSlotInfo = ::std::option::Option< + unsafe extern "C" fn(slotID: CK_SLOT_ID, pInfo: CK_SLOT_INFO_PTR) -> CK_RV, +>; +pub type CK_C_GetTokenInfo = ::std::option::Option< + unsafe extern "C" fn(slotID: CK_SLOT_ID, pInfo: CK_TOKEN_INFO_PTR) -> CK_RV, +>; pub type CK_C_GetMechanismList = ::std::option::Option< unsafe extern "C" fn( slotID: CK_SLOT_ID, - mechanism_list: *mut CK_MECHANISM_TYPE, - ulCount: *mut ::std::os::raw::c_ulong, + pMechanismList: CK_MECHANISM_TYPE_PTR, + pulCount: CK_ULONG_PTR, ) -> CK_RV, >; pub type CK_C_GetMechanismInfo = ::std::option::Option< unsafe extern "C" fn( slotID: CK_SLOT_ID, type_: CK_MECHANISM_TYPE, - info: *mut _CK_MECHANISM_INFO, + pInfo: CK_MECHANISM_INFO_PTR, ) -> CK_RV, >; pub type CK_C_InitToken = ::std::option::Option< unsafe extern "C" fn( slotID: CK_SLOT_ID, - pin: *mut ::std::os::raw::c_uchar, - pin_len: ::std::os::raw::c_ulong, - label: *mut ::std::os::raw::c_uchar, + pPin: CK_UTF8CHAR_PTR, + ulPinLen: CK_ULONG, + pLabel: CK_UTF8CHAR_PTR, ) -> CK_RV, >; pub type CK_C_InitPIN = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - pin: *mut ::std::os::raw::c_uchar, - pin_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pPin: CK_UTF8CHAR_PTR, + ulPinLen: CK_ULONG, ) -> CK_RV, >; pub type CK_C_SetPIN = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - old_pin: *mut ::std::os::raw::c_uchar, - old_len: ::std::os::raw::c_ulong, - new_pin: *mut ::std::os::raw::c_uchar, - new_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pOldPin: CK_UTF8CHAR_PTR, + ulOldLen: CK_ULONG, + pNewPin: CK_UTF8CHAR_PTR, + ulNewLen: CK_ULONG, ) -> CK_RV, >; pub type CK_C_OpenSession = ::std::option::Option< unsafe extern "C" fn( slotID: CK_SLOT_ID, flags: CK_FLAGS, - application: *mut ::std::os::raw::c_void, - notify: CK_NOTIFY, - session: *mut CK_SESSION_HANDLE, + pApplication: CK_VOID_PTR, + Notify: CK_NOTIFY, + phSession: CK_SESSION_HANDLE_PTR, ) -> CK_RV, >; pub type CK_C_CloseSession = - ::std::option::Option CK_RV>; + ::std::option::Option CK_RV>; pub type CK_C_CloseAllSessions = ::std::option::Option CK_RV>; pub type CK_C_GetSessionInfo = ::std::option::Option< - unsafe extern "C" fn(session: CK_SESSION_HANDLE, info: *mut _CK_SESSION_INFO) -> CK_RV, + unsafe extern "C" fn(hSession: CK_SESSION_HANDLE, pInfo: CK_SESSION_INFO_PTR) -> CK_RV, >; pub type CK_C_GetOperationState = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - operation_state: *mut ::std::os::raw::c_uchar, - operation_state_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pOperationState: CK_BYTE_PTR, + pulOperationStateLen: CK_ULONG_PTR, ) -> CK_RV, >; pub type CK_C_SetOperationState = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - operation_state: *mut ::std::os::raw::c_uchar, - operation_state_len: ::std::os::raw::c_ulong, - encryption_key: CK_OBJECT_HANDLE, - authentiation_key: CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pOperationState: CK_BYTE_PTR, + ulOperationStateLen: CK_ULONG, + hEncryptionKey: CK_OBJECT_HANDLE, + hAuthenticationKey: CK_OBJECT_HANDLE, ) -> CK_RV, >; pub type CK_C_Login = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - user_type: CK_USER_TYPE, - pin: *mut ::std::os::raw::c_uchar, - pin_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + userType: CK_USER_TYPE, + pPin: CK_UTF8CHAR_PTR, + ulPinLen: CK_ULONG, ) -> CK_RV, >; pub type CK_C_Logout = - ::std::option::Option CK_RV>; + ::std::option::Option CK_RV>; pub type CK_C_CreateObject = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - templ: *mut _CK_ATTRIBUTE, - ulCount: ::std::os::raw::c_ulong, - object: *mut CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pTemplate: CK_ATTRIBUTE_PTR, + ulCount: CK_ULONG, + phObject: CK_OBJECT_HANDLE_PTR, ) -> CK_RV, >; pub type CK_C_CopyObject = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - object: CK_OBJECT_HANDLE, - templ: *mut _CK_ATTRIBUTE, - ulCount: ::std::os::raw::c_ulong, - new_object: *mut CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + hObject: CK_OBJECT_HANDLE, + pTemplate: CK_ATTRIBUTE_PTR, + ulCount: CK_ULONG, + phNewObject: CK_OBJECT_HANDLE_PTR, ) -> CK_RV, >; pub type CK_C_DestroyObject = ::std::option::Option< - unsafe extern "C" fn(session: CK_SESSION_HANDLE, object: CK_OBJECT_HANDLE) -> CK_RV, + unsafe extern "C" fn(hSession: CK_SESSION_HANDLE, hObject: CK_OBJECT_HANDLE) -> CK_RV, >; pub type CK_C_GetObjectSize = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - object: CK_OBJECT_HANDLE, - size: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + hObject: CK_OBJECT_HANDLE, + pulSize: CK_ULONG_PTR, ) -> CK_RV, >; pub type CK_C_GetAttributeValue = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - object: CK_OBJECT_HANDLE, - templ: *mut _CK_ATTRIBUTE, - ulCount: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + hObject: CK_OBJECT_HANDLE, + pTemplate: CK_ATTRIBUTE_PTR, + ulCount: CK_ULONG, ) -> CK_RV, >; pub type CK_C_SetAttributeValue = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - object: CK_OBJECT_HANDLE, - templ: *mut _CK_ATTRIBUTE, - ulCount: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + hObject: CK_OBJECT_HANDLE, + pTemplate: CK_ATTRIBUTE_PTR, + ulCount: CK_ULONG, ) -> CK_RV, >; pub type CK_C_FindObjectsInit = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - templ: *mut _CK_ATTRIBUTE, - ulCount: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pTemplate: CK_ATTRIBUTE_PTR, + ulCount: CK_ULONG, ) -> CK_RV, >; pub type CK_C_FindObjects = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - object: *mut CK_OBJECT_HANDLE, - max_object_count: ::std::os::raw::c_ulong, - object_count: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + phObject: CK_OBJECT_HANDLE_PTR, + ulMaxObjectCount: CK_ULONG, + pulObjectCount: CK_ULONG_PTR, ) -> CK_RV, >; pub type CK_C_FindObjectsFinal = - ::std::option::Option CK_RV>; + ::std::option::Option CK_RV>; pub type CK_C_EncryptInit = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - key: CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, ) -> CK_RV, >; pub type CK_C_Encrypt = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - data: *mut ::std::os::raw::c_uchar, - data_len: ::std::os::raw::c_ulong, - encrypted_data: *mut ::std::os::raw::c_uchar, - encrypted_data_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pEncryptedData: CK_BYTE_PTR, + pulEncryptedDataLen: CK_ULONG_PTR, ) -> CK_RV, >; pub type CK_C_EncryptUpdate = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - part: *mut ::std::os::raw::c_uchar, - part_len: ::std::os::raw::c_ulong, - encrypted_part: *mut ::std::os::raw::c_uchar, - encrypted_part_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pPart: CK_BYTE_PTR, + ulPartLen: CK_ULONG, + pEncryptedPart: CK_BYTE_PTR, + pulEncryptedPartLen: CK_ULONG_PTR, ) -> CK_RV, >; pub type CK_C_EncryptFinal = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - last_encrypted_part: *mut ::std::os::raw::c_uchar, - last_encrypted_part_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pLastEncryptedPart: CK_BYTE_PTR, + pulLastEncryptedPartLen: CK_ULONG_PTR, ) -> CK_RV, >; pub type CK_C_DecryptInit = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - key: CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, ) -> CK_RV, >; pub type CK_C_Decrypt = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - encrypted_data: *mut ::std::os::raw::c_uchar, - encrypted_data_len: ::std::os::raw::c_ulong, - data: *mut ::std::os::raw::c_uchar, - data_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pEncryptedData: CK_BYTE_PTR, + ulEncryptedDataLen: CK_ULONG, + pData: CK_BYTE_PTR, + pulDataLen: CK_ULONG_PTR, ) -> CK_RV, >; pub type CK_C_DecryptUpdate = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - encrypted_part: *mut ::std::os::raw::c_uchar, - encrypted_part_len: ::std::os::raw::c_ulong, - part: *mut ::std::os::raw::c_uchar, - part_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pEncryptedPart: CK_BYTE_PTR, + ulEncryptedPartLen: CK_ULONG, + pPart: CK_BYTE_PTR, + pulPartLen: CK_ULONG_PTR, ) -> CK_RV, >; pub type CK_C_DecryptFinal = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - last_part: *mut ::std::os::raw::c_uchar, - last_part_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pLastPart: CK_BYTE_PTR, + pulLastPartLen: CK_ULONG_PTR, ) -> CK_RV, >; pub type CK_C_DigestInit = ::std::option::Option< - unsafe extern "C" fn(session: CK_SESSION_HANDLE, mechanism: *mut _CK_MECHANISM) -> CK_RV, + unsafe extern "C" fn(hSession: CK_SESSION_HANDLE, pMechanism: CK_MECHANISM_PTR) -> CK_RV, >; pub type CK_C_Digest = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - data: *mut ::std::os::raw::c_uchar, - data_len: ::std::os::raw::c_ulong, - digest: *mut ::std::os::raw::c_uchar, - digest_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pDigest: CK_BYTE_PTR, + pulDigestLen: CK_ULONG_PTR, ) -> CK_RV, >; pub type CK_C_DigestUpdate = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - part: *mut ::std::os::raw::c_uchar, - part_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pPart: CK_BYTE_PTR, + ulPartLen: CK_ULONG, ) -> CK_RV, >; pub type CK_C_DigestKey = ::std::option::Option< - unsafe extern "C" fn(session: CK_SESSION_HANDLE, key: CK_OBJECT_HANDLE) -> CK_RV, + unsafe extern "C" fn(hSession: CK_SESSION_HANDLE, hKey: CK_OBJECT_HANDLE) -> CK_RV, >; pub type CK_C_DigestFinal = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - digest: *mut ::std::os::raw::c_uchar, - digest_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pDigest: CK_BYTE_PTR, + pulDigestLen: CK_ULONG_PTR, ) -> CK_RV, >; pub type CK_C_SignInit = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - key: CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, ) -> CK_RV, >; pub type CK_C_Sign = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - data: *mut ::std::os::raw::c_uchar, - data_len: ::std::os::raw::c_ulong, - signature: *mut ::std::os::raw::c_uchar, - signature_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + pulSignatureLen: CK_ULONG_PTR, ) -> CK_RV, >; pub type CK_C_SignUpdate = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - part: *mut ::std::os::raw::c_uchar, - part_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pPart: CK_BYTE_PTR, + ulPartLen: CK_ULONG, ) -> CK_RV, >; pub type CK_C_SignFinal = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - signature: *mut ::std::os::raw::c_uchar, - signature_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pSignature: CK_BYTE_PTR, + pulSignatureLen: CK_ULONG_PTR, ) -> CK_RV, >; pub type CK_C_SignRecoverInit = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - key: CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, ) -> CK_RV, >; pub type CK_C_SignRecover = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - data: *mut ::std::os::raw::c_uchar, - data_len: ::std::os::raw::c_ulong, - signature: *mut ::std::os::raw::c_uchar, - signature_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + pulSignatureLen: CK_ULONG_PTR, ) -> CK_RV, >; pub type CK_C_VerifyInit = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - key: CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, ) -> CK_RV, >; pub type CK_C_Verify = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - data: *mut ::std::os::raw::c_uchar, - data_len: ::std::os::raw::c_ulong, - signature: *mut ::std::os::raw::c_uchar, - signature_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + ulSignatureLen: CK_ULONG, ) -> CK_RV, >; pub type CK_C_VerifyUpdate = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - part: *mut ::std::os::raw::c_uchar, - part_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pPart: CK_BYTE_PTR, + ulPartLen: CK_ULONG, ) -> CK_RV, >; pub type CK_C_VerifyFinal = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - signature: *mut ::std::os::raw::c_uchar, - signature_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pSignature: CK_BYTE_PTR, + ulSignatureLen: CK_ULONG, ) -> CK_RV, >; pub type CK_C_VerifyRecoverInit = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - key: CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, ) -> CK_RV, >; pub type CK_C_VerifyRecover = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - signature: *mut ::std::os::raw::c_uchar, - signature_len: ::std::os::raw::c_ulong, - data: *mut ::std::os::raw::c_uchar, - data_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pSignature: CK_BYTE_PTR, + ulSignatureLen: CK_ULONG, + pData: CK_BYTE_PTR, + pulDataLen: CK_ULONG_PTR, ) -> CK_RV, >; pub type CK_C_DigestEncryptUpdate = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - part: *mut ::std::os::raw::c_uchar, - part_len: ::std::os::raw::c_ulong, - encrypted_part: *mut ::std::os::raw::c_uchar, - encrypted_part_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pPart: CK_BYTE_PTR, + ulPartLen: CK_ULONG, + pEncryptedPart: CK_BYTE_PTR, + pulEncryptedPartLen: CK_ULONG_PTR, ) -> CK_RV, >; pub type CK_C_DecryptDigestUpdate = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - encrypted_part: *mut ::std::os::raw::c_uchar, - encrypted_part_len: ::std::os::raw::c_ulong, - part: *mut ::std::os::raw::c_uchar, - part_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pEncryptedPart: CK_BYTE_PTR, + ulEncryptedPartLen: CK_ULONG, + pPart: CK_BYTE_PTR, + pulPartLen: CK_ULONG_PTR, ) -> CK_RV, >; pub type CK_C_SignEncryptUpdate = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - part: *mut ::std::os::raw::c_uchar, - part_len: ::std::os::raw::c_ulong, - encrypted_part: *mut ::std::os::raw::c_uchar, - encrypted_part_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pPart: CK_BYTE_PTR, + ulPartLen: CK_ULONG, + pEncryptedPart: CK_BYTE_PTR, + pulEncryptedPartLen: CK_ULONG_PTR, ) -> CK_RV, >; pub type CK_C_DecryptVerifyUpdate = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - encrypted_part: *mut ::std::os::raw::c_uchar, - encrypted_part_len: ::std::os::raw::c_ulong, - part: *mut ::std::os::raw::c_uchar, - part_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pEncryptedPart: CK_BYTE_PTR, + ulEncryptedPartLen: CK_ULONG, + pPart: CK_BYTE_PTR, + pulPartLen: CK_ULONG_PTR, ) -> CK_RV, >; pub type CK_C_GenerateKey = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - templ: *mut _CK_ATTRIBUTE, - ulCount: ::std::os::raw::c_ulong, - key: *mut CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + pTemplate: CK_ATTRIBUTE_PTR, + ulCount: CK_ULONG, + phKey: CK_OBJECT_HANDLE_PTR, ) -> CK_RV, >; pub type CK_C_GenerateKeyPair = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - public_key_template: *mut _CK_ATTRIBUTE, - public_key_attribute_count: ::std::os::raw::c_ulong, - private_key_template: *mut _CK_ATTRIBUTE, - private_key_attribute_count: ::std::os::raw::c_ulong, - public_key: *mut CK_OBJECT_HANDLE, - private_key: *mut CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + pPublicKeyTemplate: CK_ATTRIBUTE_PTR, + ulPublicKeyAttributeCount: CK_ULONG, + pPrivateKeyTemplate: CK_ATTRIBUTE_PTR, + ulPrivateKeyAttributeCount: CK_ULONG, + phPublicKey: CK_OBJECT_HANDLE_PTR, + phPrivateKey: CK_OBJECT_HANDLE_PTR, ) -> CK_RV, >; pub type CK_C_WrapKey = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - wrapping_key: CK_OBJECT_HANDLE, - key: CK_OBJECT_HANDLE, - wrapped_key: *mut ::std::os::raw::c_uchar, - wrapped_key_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hWrappingKey: CK_OBJECT_HANDLE, + hKey: CK_OBJECT_HANDLE, + pWrappedKey: CK_BYTE_PTR, + pulWrappedKeyLen: CK_ULONG_PTR, ) -> CK_RV, >; pub type CK_C_UnwrapKey = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - unwrapping_key: CK_OBJECT_HANDLE, - wrapped_key: *mut ::std::os::raw::c_uchar, - wrapped_key_len: ::std::os::raw::c_ulong, - templ: *mut _CK_ATTRIBUTE, - attribute_count: ::std::os::raw::c_ulong, - key: *mut CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hUnwrappingKey: CK_OBJECT_HANDLE, + pWrappedKey: CK_BYTE_PTR, + ulWrappedKeyLen: CK_ULONG, + pTemplate: CK_ATTRIBUTE_PTR, + ulAttributeCount: CK_ULONG, + phKey: CK_OBJECT_HANDLE_PTR, ) -> CK_RV, >; pub type CK_C_DeriveKey = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - base_key: CK_OBJECT_HANDLE, - templ: *mut _CK_ATTRIBUTE, - attribute_count: ::std::os::raw::c_ulong, - key: *mut CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hBaseKey: CK_OBJECT_HANDLE, + pTemplate: CK_ATTRIBUTE_PTR, + ulAttributeCount: CK_ULONG, + phKey: CK_OBJECT_HANDLE_PTR, ) -> CK_RV, >; pub type CK_C_SeedRandom = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - seed: *mut ::std::os::raw::c_uchar, - seed_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pSeed: CK_BYTE_PTR, + ulSeedLen: CK_ULONG, ) -> CK_RV, >; pub type CK_C_GenerateRandom = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - random_data: *mut ::std::os::raw::c_uchar, - random_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + RandomData: CK_BYTE_PTR, + ulRandomLen: CK_ULONG, ) -> CK_RV, >; pub type CK_C_GetFunctionStatus = - ::std::option::Option CK_RV>; + ::std::option::Option CK_RV>; pub type CK_C_CancelFunction = - ::std::option::Option CK_RV>; + ::std::option::Option CK_RV>; +pub type CK_C_WaitForSlotEvent = ::std::option::Option< + unsafe extern "C" fn(flags: CK_FLAGS, pSlot: CK_SLOT_ID_PTR, pRserved: CK_VOID_PTR) -> CK_RV, +>; +pub type CK_C_GetInterfaceList = ::std::option::Option< + unsafe extern "C" fn(pInterfacesList: CK_INTERFACE_PTR, pulCount: CK_ULONG_PTR) -> CK_RV, +>; +pub type CK_C_GetInterface = ::std::option::Option< + unsafe extern "C" fn( + pInterfaceName: CK_UTF8CHAR_PTR, + pVersion: CK_VERSION_PTR, + ppInterface: CK_INTERFACE_PTR_PTR, + flags: CK_FLAGS, + ) -> CK_RV, +>; +pub type CK_C_LoginUser = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + userType: CK_USER_TYPE, + pPin: CK_UTF8CHAR_PTR, + ulPinLen: CK_ULONG, + pUsername: CK_UTF8CHAR_PTR, + ulUsernameLen: CK_ULONG, + ) -> CK_RV, +>; +pub type CK_C_SessionCancel = ::std::option::Option< + unsafe extern "C" fn(hSession: CK_SESSION_HANDLE, flags: CK_FLAGS) -> CK_RV, +>; +pub type CK_C_MessageEncryptInit = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, + ) -> CK_RV, +>; +pub type CK_C_EncryptMessage = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pAssociatedData: CK_BYTE_PTR, + ulAssociatedDataLen: CK_ULONG, + pPlaintext: CK_BYTE_PTR, + ulPlaintextLen: CK_ULONG, + pCiphertext: CK_BYTE_PTR, + pulCiphertextLen: CK_ULONG_PTR, + ) -> CK_RV, +>; +pub type CK_C_EncryptMessageBegin = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pAssociatedData: CK_BYTE_PTR, + ulAssociatedDataLen: CK_ULONG, + ) -> CK_RV, +>; +pub type CK_C_EncryptMessageNext = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pPlaintextPart: CK_BYTE_PTR, + ulPlaintextPartLen: CK_ULONG, + pCiphertextPart: CK_BYTE_PTR, + pulCiphertextPartLen: CK_ULONG_PTR, + flags: CK_FLAGS, + ) -> CK_RV, +>; +pub type CK_C_MessageEncryptFinal = + ::std::option::Option CK_RV>; +pub type CK_C_MessageDecryptInit = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, + ) -> CK_RV, +>; +pub type CK_C_DecryptMessage = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pAssociatedData: CK_BYTE_PTR, + ulAssociatedDataLen: CK_ULONG, + pCiphertext: CK_BYTE_PTR, + ulCiphertextLen: CK_ULONG, + pPlaintext: CK_BYTE_PTR, + pulPlaintextLen: CK_ULONG_PTR, + ) -> CK_RV, +>; +pub type CK_C_DecryptMessageBegin = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pAssociatedData: CK_BYTE_PTR, + ulAssociatedDataLen: CK_ULONG, + ) -> CK_RV, +>; +pub type CK_C_DecryptMessageNext = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pCiphertext: CK_BYTE_PTR, + ulCiphertextLen: CK_ULONG, + pPlaintext: CK_BYTE_PTR, + pulPlaintextLen: CK_ULONG_PTR, + flags: CK_FLAGS, + ) -> CK_RV, +>; +pub type CK_C_MessageDecryptFinal = + ::std::option::Option CK_RV>; +pub type CK_C_MessageSignInit = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, + ) -> CK_RV, +>; +pub type CK_C_SignMessage = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + pulSignatureLen: CK_ULONG_PTR, + ) -> CK_RV, +>; +pub type CK_C_SignMessageBegin = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + ) -> CK_RV, +>; +pub type CK_C_SignMessageNext = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + pulSignatureLen: CK_ULONG_PTR, + ) -> CK_RV, +>; +pub type CK_C_MessageSignFinal = + ::std::option::Option CK_RV>; +pub type CK_C_MessageVerifyInit = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, + ) -> CK_RV, +>; +pub type CK_C_VerifyMessage = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + ulSignatureLen: CK_ULONG, + ) -> CK_RV, +>; +pub type CK_C_VerifyMessageBegin = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + ) -> CK_RV, +>; +pub type CK_C_VerifyMessageNext = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + ulSignatureLen: CK_ULONG, + ) -> CK_RV, +>; +pub type CK_C_MessageVerifyFinal = + ::std::option::Option CK_RV>; +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct CK_FUNCTION_LIST_3_0 { + pub version: CK_VERSION, + pub C_Initialize: CK_C_Initialize, + pub C_Finalize: CK_C_Finalize, + pub C_GetInfo: CK_C_GetInfo, + pub C_GetFunctionList: CK_C_GetFunctionList, + pub C_GetSlotList: CK_C_GetSlotList, + pub C_GetSlotInfo: CK_C_GetSlotInfo, + pub C_GetTokenInfo: CK_C_GetTokenInfo, + pub C_GetMechanismList: CK_C_GetMechanismList, + pub C_GetMechanismInfo: CK_C_GetMechanismInfo, + pub C_InitToken: CK_C_InitToken, + pub C_InitPIN: CK_C_InitPIN, + pub C_SetPIN: CK_C_SetPIN, + pub C_OpenSession: CK_C_OpenSession, + pub C_CloseSession: CK_C_CloseSession, + pub C_CloseAllSessions: CK_C_CloseAllSessions, + pub C_GetSessionInfo: CK_C_GetSessionInfo, + pub C_GetOperationState: CK_C_GetOperationState, + pub C_SetOperationState: CK_C_SetOperationState, + pub C_Login: CK_C_Login, + pub C_Logout: CK_C_Logout, + pub C_CreateObject: CK_C_CreateObject, + pub C_CopyObject: CK_C_CopyObject, + pub C_DestroyObject: CK_C_DestroyObject, + pub C_GetObjectSize: CK_C_GetObjectSize, + pub C_GetAttributeValue: CK_C_GetAttributeValue, + pub C_SetAttributeValue: CK_C_SetAttributeValue, + pub C_FindObjectsInit: CK_C_FindObjectsInit, + pub C_FindObjects: CK_C_FindObjects, + pub C_FindObjectsFinal: CK_C_FindObjectsFinal, + pub C_EncryptInit: CK_C_EncryptInit, + pub C_Encrypt: CK_C_Encrypt, + pub C_EncryptUpdate: CK_C_EncryptUpdate, + pub C_EncryptFinal: CK_C_EncryptFinal, + pub C_DecryptInit: CK_C_DecryptInit, + pub C_Decrypt: CK_C_Decrypt, + pub C_DecryptUpdate: CK_C_DecryptUpdate, + pub C_DecryptFinal: CK_C_DecryptFinal, + pub C_DigestInit: CK_C_DigestInit, + pub C_Digest: CK_C_Digest, + pub C_DigestUpdate: CK_C_DigestUpdate, + pub C_DigestKey: CK_C_DigestKey, + pub C_DigestFinal: CK_C_DigestFinal, + pub C_SignInit: CK_C_SignInit, + pub C_Sign: CK_C_Sign, + pub C_SignUpdate: CK_C_SignUpdate, + pub C_SignFinal: CK_C_SignFinal, + pub C_SignRecoverInit: CK_C_SignRecoverInit, + pub C_SignRecover: CK_C_SignRecover, + pub C_VerifyInit: CK_C_VerifyInit, + pub C_Verify: CK_C_Verify, + pub C_VerifyUpdate: CK_C_VerifyUpdate, + pub C_VerifyFinal: CK_C_VerifyFinal, + pub C_VerifyRecoverInit: CK_C_VerifyRecoverInit, + pub C_VerifyRecover: CK_C_VerifyRecover, + pub C_DigestEncryptUpdate: CK_C_DigestEncryptUpdate, + pub C_DecryptDigestUpdate: CK_C_DecryptDigestUpdate, + pub C_SignEncryptUpdate: CK_C_SignEncryptUpdate, + pub C_DecryptVerifyUpdate: CK_C_DecryptVerifyUpdate, + pub C_GenerateKey: CK_C_GenerateKey, + pub C_GenerateKeyPair: CK_C_GenerateKeyPair, + pub C_WrapKey: CK_C_WrapKey, + pub C_UnwrapKey: CK_C_UnwrapKey, + pub C_DeriveKey: CK_C_DeriveKey, + pub C_SeedRandom: CK_C_SeedRandom, + pub C_GenerateRandom: CK_C_GenerateRandom, + pub C_GetFunctionStatus: CK_C_GetFunctionStatus, + pub C_CancelFunction: CK_C_CancelFunction, + pub C_WaitForSlotEvent: CK_C_WaitForSlotEvent, + pub C_GetInterfaceList: CK_C_GetInterfaceList, + pub C_GetInterface: CK_C_GetInterface, + pub C_LoginUser: CK_C_LoginUser, + pub C_SessionCancel: CK_C_SessionCancel, + pub C_MessageEncryptInit: CK_C_MessageEncryptInit, + pub C_EncryptMessage: CK_C_EncryptMessage, + pub C_EncryptMessageBegin: CK_C_EncryptMessageBegin, + pub C_EncryptMessageNext: CK_C_EncryptMessageNext, + pub C_MessageEncryptFinal: CK_C_MessageEncryptFinal, + pub C_MessageDecryptInit: CK_C_MessageDecryptInit, + pub C_DecryptMessage: CK_C_DecryptMessage, + pub C_DecryptMessageBegin: CK_C_DecryptMessageBegin, + pub C_DecryptMessageNext: CK_C_DecryptMessageNext, + pub C_MessageDecryptFinal: CK_C_MessageDecryptFinal, + pub C_MessageSignInit: CK_C_MessageSignInit, + pub C_SignMessage: CK_C_SignMessage, + pub C_SignMessageBegin: CK_C_SignMessageBegin, + pub C_SignMessageNext: CK_C_SignMessageNext, + pub C_MessageSignFinal: CK_C_MessageSignFinal, + pub C_MessageVerifyInit: CK_C_MessageVerifyInit, + pub C_VerifyMessage: CK_C_VerifyMessage, + pub C_VerifyMessageBegin: CK_C_VerifyMessageBegin, + 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::(), + 744usize, + concat!("Size of: ", stringify!(CK_FUNCTION_LIST_3_0)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + 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 }, + 16usize, + 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 }, + 24usize, + 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 }, + 32usize, + 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 }, + 40usize, + 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 }, + 48usize, + 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 }, + 56usize, + 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 }, + 64usize, + 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 }, + 72usize, + 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 }, + 80usize, + 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 }, + 88usize, + 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 }, + 96usize, + 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 }, + 104usize, + 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 }, + 112usize, + 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 }, + 120usize, + 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 }, + 128usize, + 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 }, + 136usize, + 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 }, + 144usize, + 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 }, + 152usize, + 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 }, + 160usize, + 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 }, + 168usize, + 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 }, + 176usize, + 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 }, + 184usize, + 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 }, + 192usize, + 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 }, + 200usize, + 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 }, + 208usize, + 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 }, + 216usize, + 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 }, + 224usize, + 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 }, + 232usize, + 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 }, + 240usize, + 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 }, + 248usize, + 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 }, + 256usize, + 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 }, + 264usize, + 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 }, + 272usize, + 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 }, + 280usize, + 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 }, + 288usize, + 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 }, + 296usize, + 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 }, + 304usize, + 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 }, + 312usize, + 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 }, + 320usize, + 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 }, + 328usize, + 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 }, + 336usize, + 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 }, + 344usize, + 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 }, + 352usize, + 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 }, + 360usize, + 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 }, + 368usize, + 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 }, + 376usize, + 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 }, + 384usize, + 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 }, + 392usize, + 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 }, + 400usize, + 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 }, + 408usize, + 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 }, + 416usize, + 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 }, + 424usize, + 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 }, + 432usize, + 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 }, + 440usize, + 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 }, + 448usize, + 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 }, + 456usize, + 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 }, + 464usize, + 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 }, + 472usize, + 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 }, + 480usize, + 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 }, + 488usize, + 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 }, + 496usize, + 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 }, + 504usize, + 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 }, + 512usize, + 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 }, + 520usize, + 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 }, + 528usize, + 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 }, + 536usize, + 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 }, + 544usize, + 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 }, + 552usize, + 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 }, + 560usize, + 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 }, + 568usize, + 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 }, + 576usize, + 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 }, + 584usize, + 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 }, + 592usize, + 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 }, + 600usize, + 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 }, + 608usize, + 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 }, + 616usize, + 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 }, + 624usize, + 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 }, + 632usize, + 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 }, + 640usize, + 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 }, + 648usize, + 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 }, + 656usize, + 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 }, + 664usize, + 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 }, + 672usize, + 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 }, + 680usize, + 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 }, + 688usize, + 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 }, + 696usize, + 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 }, + 704usize, + 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 }, + 712usize, + 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 }, + 720usize, + 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 }, + 728usize, + 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 }, + 736usize, + concat!( + "Offset of field: ", + stringify!(CK_FUNCTION_LIST_3_0), + "::", + stringify!(C_MessageVerifyFinal) + ) + ); +} #[repr(C)] #[derive(Debug, Default, Copy, Clone)] -pub struct _CK_FUNCTION_LIST { - pub version: _CK_VERSION, +pub struct CK_FUNCTION_LIST { + pub version: CK_VERSION, pub C_Initialize: CK_C_Initialize, pub C_Finalize: CK_C_Finalize, pub C_GetInfo: CK_C_GetInfo, @@ -2647,25 +9810,25 @@ pub struct _CK_FUNCTION_LIST { pub C_WaitForSlotEvent: CK_C_WaitForSlotEvent, } #[test] -fn bindgen_test_layout__CK_FUNCTION_LIST() { - const UNINIT: ::std::mem::MaybeUninit<_CK_FUNCTION_LIST> = ::std::mem::MaybeUninit::uninit(); +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::<_CK_FUNCTION_LIST>(), + ::std::mem::size_of::(), 552usize, - concat!("Size of: ", stringify!(_CK_FUNCTION_LIST)) + concat!("Size of: ", stringify!(CK_FUNCTION_LIST)) ); assert_eq!( - ::std::mem::align_of::<_CK_FUNCTION_LIST>(), + ::std::mem::align_of::(), 8usize, - concat!("Alignment of ", stringify!(_CK_FUNCTION_LIST)) + 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!(CK_FUNCTION_LIST), "::", stringify!(version) ) @@ -2675,7 +9838,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 8usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_Initialize) ) @@ -2685,7 +9848,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 16usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_Finalize) ) @@ -2695,7 +9858,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 24usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_GetInfo) ) @@ -2705,7 +9868,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 32usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_GetFunctionList) ) @@ -2715,7 +9878,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 40usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_GetSlotList) ) @@ -2725,7 +9888,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 48usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_GetSlotInfo) ) @@ -2735,7 +9898,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 56usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_GetTokenInfo) ) @@ -2745,7 +9908,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 64usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_GetMechanismList) ) @@ -2755,7 +9918,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 72usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_GetMechanismInfo) ) @@ -2765,7 +9928,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 80usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_InitToken) ) @@ -2775,7 +9938,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 88usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_InitPIN) ) @@ -2785,7 +9948,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 96usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_SetPIN) ) @@ -2795,7 +9958,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 104usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_OpenSession) ) @@ -2805,7 +9968,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 112usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_CloseSession) ) @@ -2815,7 +9978,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 120usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_CloseAllSessions) ) @@ -2825,7 +9988,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 128usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_GetSessionInfo) ) @@ -2835,7 +9998,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 136usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_GetOperationState) ) @@ -2845,7 +10008,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 144usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_SetOperationState) ) @@ -2855,7 +10018,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 152usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_Login) ) @@ -2865,7 +10028,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 160usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_Logout) ) @@ -2875,7 +10038,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 168usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_CreateObject) ) @@ -2885,7 +10048,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 176usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_CopyObject) ) @@ -2895,7 +10058,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 184usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_DestroyObject) ) @@ -2905,7 +10068,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 192usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_GetObjectSize) ) @@ -2915,7 +10078,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 200usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_GetAttributeValue) ) @@ -2925,7 +10088,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 208usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_SetAttributeValue) ) @@ -2935,7 +10098,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 216usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_FindObjectsInit) ) @@ -2945,7 +10108,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 224usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_FindObjects) ) @@ -2955,7 +10118,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 232usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_FindObjectsFinal) ) @@ -2965,7 +10128,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 240usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_EncryptInit) ) @@ -2975,7 +10138,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 248usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_Encrypt) ) @@ -2985,7 +10148,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 256usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_EncryptUpdate) ) @@ -2995,7 +10158,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 264usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_EncryptFinal) ) @@ -3005,7 +10168,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 272usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_DecryptInit) ) @@ -3015,7 +10178,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 280usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_Decrypt) ) @@ -3025,7 +10188,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 288usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_DecryptUpdate) ) @@ -3035,7 +10198,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 296usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_DecryptFinal) ) @@ -3045,7 +10208,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 304usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_DigestInit) ) @@ -3055,7 +10218,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 312usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_Digest) ) @@ -3065,7 +10228,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 320usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_DigestUpdate) ) @@ -3075,7 +10238,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 328usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_DigestKey) ) @@ -3085,7 +10248,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 336usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_DigestFinal) ) @@ -3095,7 +10258,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 344usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_SignInit) ) @@ -3105,7 +10268,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 352usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_Sign) ) @@ -3115,7 +10278,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 360usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_SignUpdate) ) @@ -3125,7 +10288,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 368usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_SignFinal) ) @@ -3135,7 +10298,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 376usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_SignRecoverInit) ) @@ -3145,7 +10308,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 384usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_SignRecover) ) @@ -3155,7 +10318,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 392usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_VerifyInit) ) @@ -3165,7 +10328,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 400usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_Verify) ) @@ -3175,7 +10338,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 408usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_VerifyUpdate) ) @@ -3185,7 +10348,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 416usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_VerifyFinal) ) @@ -3195,7 +10358,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 424usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_VerifyRecoverInit) ) @@ -3205,7 +10368,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 432usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_VerifyRecover) ) @@ -3215,7 +10378,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 440usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_DigestEncryptUpdate) ) @@ -3225,7 +10388,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 448usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_DecryptDigestUpdate) ) @@ -3235,7 +10398,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 456usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_SignEncryptUpdate) ) @@ -3245,7 +10408,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 464usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_DecryptVerifyUpdate) ) @@ -3255,7 +10418,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 472usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_GenerateKey) ) @@ -3265,7 +10428,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 480usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_GenerateKeyPair) ) @@ -3275,7 +10438,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 488usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_WrapKey) ) @@ -3285,7 +10448,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 496usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_UnwrapKey) ) @@ -3295,7 +10458,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 504usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_DeriveKey) ) @@ -3305,7 +10468,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 512usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_SeedRandom) ) @@ -3315,7 +10478,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 520usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_GenerateRandom) ) @@ -3325,7 +10488,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 528usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_GetFunctionStatus) ) @@ -3335,7 +10498,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 536usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_CancelFunction) ) @@ -3345,223 +10508,45 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 544usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), - "::", - stringify!(C_WaitForSlotEvent) - ) - ); -} -pub type CK_CREATEMUTEX = - ::std::option::Option CK_RV>; -pub type CK_DESTROYMUTEX = - ::std::option::Option CK_RV>; -pub type CK_LOCKMUTEX = - ::std::option::Option CK_RV>; -pub type CK_UNLOCKMUTEX = - ::std::option::Option CK_RV>; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct _CK_C_INITIALIZE_ARGS { - pub CreateMutex: CK_CREATEMUTEX, - pub DestroyMutex: CK_DESTROYMUTEX, - pub LockMutex: CK_LOCKMUTEX, - pub UnlockMutex: CK_UNLOCKMUTEX, - pub flags: CK_FLAGS, - pub pReserved: *mut ::std::os::raw::c_void, -} -#[test] -fn bindgen_test_layout__CK_C_INITIALIZE_ARGS() { - const UNINIT: ::std::mem::MaybeUninit<_CK_C_INITIALIZE_ARGS> = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<_CK_C_INITIALIZE_ARGS>(), - 48usize, - concat!("Size of: ", stringify!(_CK_C_INITIALIZE_ARGS)) - ); - assert_eq!( - ::std::mem::align_of::<_CK_C_INITIALIZE_ARGS>(), - 8usize, - 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 }, - 40usize, - concat!( - "Offset of field: ", - stringify!(_CK_C_INITIALIZE_ARGS), + stringify!(CK_FUNCTION_LIST), "::", - stringify!(pReserved) - ) - ); -} -impl Default for _CK_C_INITIALIZE_ARGS { - fn default() -> Self { - let mut s = ::std::mem::MaybeUninit::::uninit(); - unsafe { - ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -pub type CK_BYTE = ::std::os::raw::c_uchar; -pub type CK_CHAR = ::std::os::raw::c_uchar; -pub type CK_UTF8CHAR = ::std::os::raw::c_uchar; -pub type CK_BBOOL = ::std::os::raw::c_uchar; -pub type CK_ULONG = ::std::os::raw::c_ulong; -pub type CK_LONG = ::std::os::raw::c_long; -pub type CK_BYTE_PTR = *mut CK_BYTE; -pub type CK_CHAR_PTR = *mut CK_CHAR; -pub type CK_UTF8CHAR_PTR = *mut CK_UTF8CHAR; -pub type CK_ULONG_PTR = *mut CK_ULONG; -pub type CK_VOID_PTR = *mut ::std::os::raw::c_void; -pub type CK_VOID_PTR_PTR = *mut *mut ::std::os::raw::c_void; -pub type CK_VERSION = _CK_VERSION; -pub type CK_VERSION_PTR = *mut _CK_VERSION; -pub type CK_INFO = _CK_INFO; -pub type CK_INFO_PTR = *mut _CK_INFO; -pub type CK_SLOT_ID_PTR = *mut CK_SLOT_ID; -pub type CK_SLOT_INFO = _CK_SLOT_INFO; -pub type CK_SLOT_INFO_PTR = *mut _CK_SLOT_INFO; -pub type CK_TOKEN_INFO = _CK_TOKEN_INFO; -pub type CK_TOKEN_INFO_PTR = *mut _CK_TOKEN_INFO; -pub type CK_SESSION_HANDLE_PTR = *mut CK_SESSION_HANDLE; -pub type CK_SESSION_INFO = _CK_SESSION_INFO; -pub type CK_SESSION_INFO_PTR = *mut _CK_SESSION_INFO; -pub type CK_OBJECT_HANDLE_PTR = *mut CK_OBJECT_HANDLE; -pub type CK_OBJECT_CLASS_PTR = *mut CK_OBJECT_CLASS; -pub type CK_ATTRIBUTE = _CK_ATTRIBUTE; -pub type CK_ATTRIBUTE_PTR = *mut _CK_ATTRIBUTE; -pub type CK_DATE = _CK_DATE; -pub type CK_DATE_PTR = *mut _CK_DATE; -pub type CK_MECHANISM_TYPE_PTR = *mut CK_MECHANISM_TYPE; -pub type CK_MECHANISM = _CK_MECHANISM; -pub type CK_MECHANISM_PTR = *mut _CK_MECHANISM; -pub type CK_MECHANISM_INFO = _CK_MECHANISM_INFO; -pub type CK_MECHANISM_INFO_PTR = *mut _CK_MECHANISM_INFO; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct ck_otp_mechanism_info { - _unused: [u8; 0], -} -pub type CK_OTP_MECHANISM_INFO = ck_otp_mechanism_info; -pub type CK_OTP_MECHANISM_INFO_PTR = *mut ck_otp_mechanism_info; -pub type CK_FUNCTION_LIST = _CK_FUNCTION_LIST; -pub type CK_FUNCTION_LIST_PTR = *mut _CK_FUNCTION_LIST; -pub type CK_FUNCTION_LIST_PTR_PTR = *mut *mut _CK_FUNCTION_LIST; -pub type CK_C_INITIALIZE_ARGS = _CK_C_INITIALIZE_ARGS; -pub type CK_C_INITIALIZE_ARGS_PTR = *mut _CK_C_INITIALIZE_ARGS; -pub type CK_RSA_PKCS_PSS_PARAMS = ck_rsa_pkcs_pss_params; -pub type CK_RSA_PKCS_PSS_PARAMS_PTR = *mut ck_rsa_pkcs_pss_params; -pub type CK_RSA_PKCS_OAEP_PARAMS = ck_rsa_pkcs_oaep_params; -pub type CK_RSA_PKCS_OAEP_PARAMS_PTR = *mut ck_rsa_pkcs_oaep_params; -pub type CK_AES_CTR_PARAMS = ck_aes_ctr_params; -pub type CK_AES_CTR_PARAMS_PTR = *mut ck_aes_ctr_params; -pub type CK_GCM_PARAMS = ck_gcm_params; -pub type CK_GCM_PARAMS_PTR = *mut ck_gcm_params; -pub type CK_ECDH1_DERIVE_PARAMS = ck_ecdh1_derive_params; -pub type CK_ECDH1_DERIVE_PARAMS_PTR = *mut ck_ecdh1_derive_params; -pub type CK_KEY_DERIVATION_STRING_DATA = ck_key_derivation_string_data; -pub type CK_KEY_DERIVATION_STRING_DATA_PTR = *mut ck_key_derivation_string_data; -pub type CK_DES_CBC_ENCRYPT_DATA_PARAMS = ck_des_cbc_encrypt_data_params; -pub type CK_DES_CBC_ENCRYPT_DATA_PARAMS_PTR = *mut ck_des_cbc_encrypt_data_params; -pub type CK_AES_CBC_ENCRYPT_DATA_PARAMS = ck_aes_cbc_encrypt_data_params; -pub type CK_AES_CBC_ENCRYPT_DATA_PARAMS_PTR = *mut ck_aes_cbc_encrypt_data_params; + stringify!(C_WaitForSlotEvent) + ) + ); +} extern crate libloading; pub struct Pkcs11 { __library: ::libloading::Library, - pub C_Initialize: Result< - unsafe extern "C" fn(init_args: *mut ::std::os::raw::c_void) -> CK_RV, - ::libloading::Error, - >, - pub C_Finalize: Result< - unsafe extern "C" fn(pReserved: *mut ::std::os::raw::c_void) -> CK_RV, - ::libloading::Error, - >, - pub C_GetInfo: Result CK_RV, ::libloading::Error>, + pub C_Initialize: + Result CK_RV, ::libloading::Error>, + pub C_Finalize: + Result CK_RV, ::libloading::Error>, + pub C_GetInfo: Result CK_RV, ::libloading::Error>, pub C_GetFunctionList: Result< - unsafe extern "C" fn(function_list: *mut *mut _CK_FUNCTION_LIST) -> CK_RV, + unsafe extern "C" fn(ppFunctionList: CK_FUNCTION_LIST_PTR_PTR) -> CK_RV, ::libloading::Error, >, pub C_GetSlotList: Result< unsafe extern "C" fn( - token_present: ::std::os::raw::c_uchar, - slot_list: *mut CK_SLOT_ID, - ulCount: *mut ::std::os::raw::c_ulong, + tokenPresent: CK_BBOOL, + pSlotList: CK_SLOT_ID_PTR, + pulCount: CK_ULONG_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_GetSlotInfo: Result< - unsafe extern "C" fn(slotID: CK_SLOT_ID, info: *mut _CK_SLOT_INFO) -> CK_RV, + unsafe extern "C" fn(slotID: CK_SLOT_ID, pInfo: CK_SLOT_INFO_PTR) -> CK_RV, ::libloading::Error, >, pub C_GetTokenInfo: Result< - unsafe extern "C" fn(slotID: CK_SLOT_ID, info: *mut _CK_TOKEN_INFO) -> CK_RV, - ::libloading::Error, - >, - pub C_WaitForSlotEvent: Result< - unsafe extern "C" fn( - flags: CK_FLAGS, - slot: *mut CK_SLOT_ID, - pReserved: *mut ::std::os::raw::c_void, - ) -> CK_RV, + unsafe extern "C" fn(slotID: CK_SLOT_ID, pInfo: CK_TOKEN_INFO_PTR) -> CK_RV, ::libloading::Error, >, pub C_GetMechanismList: Result< unsafe extern "C" fn( slotID: CK_SLOT_ID, - mechanism_list: *mut CK_MECHANISM_TYPE, - ulCount: *mut ::std::os::raw::c_ulong, + pMechanismList: CK_MECHANISM_TYPE_PTR, + pulCount: CK_ULONG_PTR, ) -> CK_RV, ::libloading::Error, >, @@ -3569,34 +10554,34 @@ pub struct Pkcs11 { unsafe extern "C" fn( slotID: CK_SLOT_ID, type_: CK_MECHANISM_TYPE, - info: *mut _CK_MECHANISM_INFO, + pInfo: CK_MECHANISM_INFO_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_InitToken: Result< unsafe extern "C" fn( slotID: CK_SLOT_ID, - pin: *mut ::std::os::raw::c_uchar, - pin_len: ::std::os::raw::c_ulong, - label: *mut ::std::os::raw::c_uchar, + pPin: CK_UTF8CHAR_PTR, + ulPinLen: CK_ULONG, + pLabel: CK_UTF8CHAR_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_InitPIN: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - pin: *mut ::std::os::raw::c_uchar, - pin_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pPin: CK_UTF8CHAR_PTR, + ulPinLen: CK_ULONG, ) -> CK_RV, ::libloading::Error, >, pub C_SetPIN: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - old_pin: *mut ::std::os::raw::c_uchar, - old_len: ::std::os::raw::c_ulong, - new_pin: *mut ::std::os::raw::c_uchar, - new_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pOldPin: CK_UTF8CHAR_PTR, + ulOldLen: CK_ULONG, + pNewPin: CK_UTF8CHAR_PTR, + ulNewLen: CK_ULONG, ) -> CK_RV, ::libloading::Error, >, @@ -3604,445 +10589,659 @@ pub struct Pkcs11 { unsafe extern "C" fn( slotID: CK_SLOT_ID, flags: CK_FLAGS, - application: *mut ::std::os::raw::c_void, - notify: CK_NOTIFY, - session: *mut CK_SESSION_HANDLE, + pApplication: CK_VOID_PTR, + Notify: CK_NOTIFY, + phSession: CK_SESSION_HANDLE_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_CloseSession: - Result CK_RV, ::libloading::Error>, + Result CK_RV, ::libloading::Error>, pub C_CloseAllSessions: Result CK_RV, ::libloading::Error>, pub C_GetSessionInfo: Result< - unsafe extern "C" fn(session: CK_SESSION_HANDLE, info: *mut _CK_SESSION_INFO) -> CK_RV, + unsafe extern "C" fn(hSession: CK_SESSION_HANDLE, pInfo: CK_SESSION_INFO_PTR) -> CK_RV, ::libloading::Error, >, pub C_GetOperationState: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - operation_state: *mut ::std::os::raw::c_uchar, - operation_state_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pOperationState: CK_BYTE_PTR, + pulOperationStateLen: CK_ULONG_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_SetOperationState: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - operation_state: *mut ::std::os::raw::c_uchar, - operation_state_len: ::std::os::raw::c_ulong, - encryption_key: CK_OBJECT_HANDLE, - authentiation_key: CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pOperationState: CK_BYTE_PTR, + ulOperationStateLen: CK_ULONG, + hEncryptionKey: CK_OBJECT_HANDLE, + hAuthenticationKey: CK_OBJECT_HANDLE, ) -> CK_RV, ::libloading::Error, >, pub C_Login: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - user_type: CK_USER_TYPE, - pin: *mut ::std::os::raw::c_uchar, - pin_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + userType: CK_USER_TYPE, + pPin: CK_UTF8CHAR_PTR, + ulPinLen: CK_ULONG, ) -> CK_RV, ::libloading::Error, >, pub C_Logout: - Result CK_RV, ::libloading::Error>, + Result CK_RV, ::libloading::Error>, pub C_CreateObject: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - templ: *mut _CK_ATTRIBUTE, - ulCount: ::std::os::raw::c_ulong, - object: *mut CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pTemplate: CK_ATTRIBUTE_PTR, + ulCount: CK_ULONG, + phObject: CK_OBJECT_HANDLE_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_CopyObject: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - object: CK_OBJECT_HANDLE, - templ: *mut _CK_ATTRIBUTE, - ulCount: ::std::os::raw::c_ulong, - new_object: *mut CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + hObject: CK_OBJECT_HANDLE, + pTemplate: CK_ATTRIBUTE_PTR, + ulCount: CK_ULONG, + phNewObject: CK_OBJECT_HANDLE_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_DestroyObject: Result< - unsafe extern "C" fn(session: CK_SESSION_HANDLE, object: CK_OBJECT_HANDLE) -> CK_RV, + unsafe extern "C" fn(hSession: CK_SESSION_HANDLE, hObject: CK_OBJECT_HANDLE) -> CK_RV, ::libloading::Error, >, pub C_GetObjectSize: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - object: CK_OBJECT_HANDLE, - size: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + hObject: CK_OBJECT_HANDLE, + pulSize: CK_ULONG_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_GetAttributeValue: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - object: CK_OBJECT_HANDLE, - templ: *mut _CK_ATTRIBUTE, - ulCount: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + hObject: CK_OBJECT_HANDLE, + pTemplate: CK_ATTRIBUTE_PTR, + ulCount: CK_ULONG, ) -> CK_RV, ::libloading::Error, >, pub C_SetAttributeValue: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - object: CK_OBJECT_HANDLE, - templ: *mut _CK_ATTRIBUTE, - ulCount: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + hObject: CK_OBJECT_HANDLE, + pTemplate: CK_ATTRIBUTE_PTR, + ulCount: CK_ULONG, ) -> CK_RV, ::libloading::Error, >, pub C_FindObjectsInit: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - templ: *mut _CK_ATTRIBUTE, - ulCount: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pTemplate: CK_ATTRIBUTE_PTR, + ulCount: CK_ULONG, ) -> CK_RV, ::libloading::Error, >, pub C_FindObjects: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - object: *mut CK_OBJECT_HANDLE, - max_object_count: ::std::os::raw::c_ulong, - object_count: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + phObject: CK_OBJECT_HANDLE_PTR, + ulMaxObjectCount: CK_ULONG, + pulObjectCount: CK_ULONG_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_FindObjectsFinal: - Result CK_RV, ::libloading::Error>, + Result CK_RV, ::libloading::Error>, pub C_EncryptInit: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - key: CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, ) -> CK_RV, ::libloading::Error, >, pub C_Encrypt: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - data: *mut ::std::os::raw::c_uchar, - data_len: ::std::os::raw::c_ulong, - encrypted_data: *mut ::std::os::raw::c_uchar, - encrypted_data_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pEncryptedData: CK_BYTE_PTR, + pulEncryptedDataLen: CK_ULONG_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_EncryptUpdate: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - part: *mut ::std::os::raw::c_uchar, - part_len: ::std::os::raw::c_ulong, - encrypted_part: *mut ::std::os::raw::c_uchar, - encrypted_part_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pPart: CK_BYTE_PTR, + ulPartLen: CK_ULONG, + pEncryptedPart: CK_BYTE_PTR, + pulEncryptedPartLen: CK_ULONG_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_EncryptFinal: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - last_encrypted_part: *mut ::std::os::raw::c_uchar, - last_encrypted_part_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pLastEncryptedPart: CK_BYTE_PTR, + pulLastEncryptedPartLen: CK_ULONG_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_DecryptInit: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - key: CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, ) -> CK_RV, ::libloading::Error, >, pub C_Decrypt: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - encrypted_data: *mut ::std::os::raw::c_uchar, - encrypted_data_len: ::std::os::raw::c_ulong, - data: *mut ::std::os::raw::c_uchar, - data_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pEncryptedData: CK_BYTE_PTR, + ulEncryptedDataLen: CK_ULONG, + pData: CK_BYTE_PTR, + pulDataLen: CK_ULONG_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_DecryptUpdate: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - encrypted_part: *mut ::std::os::raw::c_uchar, - encrypted_part_len: ::std::os::raw::c_ulong, - part: *mut ::std::os::raw::c_uchar, - part_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pEncryptedPart: CK_BYTE_PTR, + ulEncryptedPartLen: CK_ULONG, + pPart: CK_BYTE_PTR, + pulPartLen: CK_ULONG_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_DecryptFinal: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - last_part: *mut ::std::os::raw::c_uchar, - last_part_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pLastPart: CK_BYTE_PTR, + pulLastPartLen: CK_ULONG_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_DigestInit: Result< - unsafe extern "C" fn(session: CK_SESSION_HANDLE, mechanism: *mut _CK_MECHANISM) -> CK_RV, + unsafe extern "C" fn(hSession: CK_SESSION_HANDLE, pMechanism: CK_MECHANISM_PTR) -> CK_RV, ::libloading::Error, >, pub C_Digest: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - data: *mut ::std::os::raw::c_uchar, - data_len: ::std::os::raw::c_ulong, - digest: *mut ::std::os::raw::c_uchar, - digest_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pDigest: CK_BYTE_PTR, + pulDigestLen: CK_ULONG_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_DigestUpdate: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - part: *mut ::std::os::raw::c_uchar, - part_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pPart: CK_BYTE_PTR, + ulPartLen: CK_ULONG, ) -> CK_RV, ::libloading::Error, >, pub C_DigestKey: Result< - unsafe extern "C" fn(session: CK_SESSION_HANDLE, key: CK_OBJECT_HANDLE) -> CK_RV, + unsafe extern "C" fn(hSession: CK_SESSION_HANDLE, hKey: CK_OBJECT_HANDLE) -> CK_RV, ::libloading::Error, >, pub C_DigestFinal: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - digest: *mut ::std::os::raw::c_uchar, - digest_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pDigest: CK_BYTE_PTR, + pulDigestLen: CK_ULONG_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_SignInit: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - key: CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, ) -> CK_RV, ::libloading::Error, >, pub C_Sign: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - data: *mut ::std::os::raw::c_uchar, - data_len: ::std::os::raw::c_ulong, - signature: *mut ::std::os::raw::c_uchar, - signature_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + pulSignatureLen: CK_ULONG_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_SignUpdate: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - part: *mut ::std::os::raw::c_uchar, - part_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pPart: CK_BYTE_PTR, + ulPartLen: CK_ULONG, ) -> CK_RV, ::libloading::Error, >, pub C_SignFinal: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - signature: *mut ::std::os::raw::c_uchar, - signature_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pSignature: CK_BYTE_PTR, + pulSignatureLen: CK_ULONG_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_SignRecoverInit: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - key: CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, ) -> CK_RV, ::libloading::Error, >, pub C_SignRecover: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - data: *mut ::std::os::raw::c_uchar, - data_len: ::std::os::raw::c_ulong, - signature: *mut ::std::os::raw::c_uchar, - signature_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + pulSignatureLen: CK_ULONG_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_VerifyInit: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - key: CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, ) -> CK_RV, ::libloading::Error, >, pub C_Verify: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - data: *mut ::std::os::raw::c_uchar, - data_len: ::std::os::raw::c_ulong, - signature: *mut ::std::os::raw::c_uchar, - signature_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + ulSignatureLen: CK_ULONG, ) -> CK_RV, ::libloading::Error, >, pub C_VerifyUpdate: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - part: *mut ::std::os::raw::c_uchar, - part_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pPart: CK_BYTE_PTR, + ulPartLen: CK_ULONG, ) -> CK_RV, ::libloading::Error, >, pub C_VerifyFinal: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - signature: *mut ::std::os::raw::c_uchar, - signature_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pSignature: CK_BYTE_PTR, + ulSignatureLen: CK_ULONG, ) -> CK_RV, ::libloading::Error, >, pub C_VerifyRecoverInit: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - key: CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, ) -> CK_RV, ::libloading::Error, >, pub C_VerifyRecover: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - signature: *mut ::std::os::raw::c_uchar, - signature_len: ::std::os::raw::c_ulong, - data: *mut ::std::os::raw::c_uchar, - data_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pSignature: CK_BYTE_PTR, + ulSignatureLen: CK_ULONG, + pData: CK_BYTE_PTR, + pulDataLen: CK_ULONG_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_DigestEncryptUpdate: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - part: *mut ::std::os::raw::c_uchar, - part_len: ::std::os::raw::c_ulong, - encrypted_part: *mut ::std::os::raw::c_uchar, - encrypted_part_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pPart: CK_BYTE_PTR, + ulPartLen: CK_ULONG, + pEncryptedPart: CK_BYTE_PTR, + pulEncryptedPartLen: CK_ULONG_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_DecryptDigestUpdate: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - encrypted_part: *mut ::std::os::raw::c_uchar, - encrypted_part_len: ::std::os::raw::c_ulong, - part: *mut ::std::os::raw::c_uchar, - part_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pEncryptedPart: CK_BYTE_PTR, + ulEncryptedPartLen: CK_ULONG, + pPart: CK_BYTE_PTR, + pulPartLen: CK_ULONG_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_SignEncryptUpdate: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - part: *mut ::std::os::raw::c_uchar, - part_len: ::std::os::raw::c_ulong, - encrypted_part: *mut ::std::os::raw::c_uchar, - encrypted_part_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pPart: CK_BYTE_PTR, + ulPartLen: CK_ULONG, + pEncryptedPart: CK_BYTE_PTR, + pulEncryptedPartLen: CK_ULONG_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_DecryptVerifyUpdate: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - encrypted_part: *mut ::std::os::raw::c_uchar, - encrypted_part_len: ::std::os::raw::c_ulong, - part: *mut ::std::os::raw::c_uchar, - part_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pEncryptedPart: CK_BYTE_PTR, + ulEncryptedPartLen: CK_ULONG, + pPart: CK_BYTE_PTR, + pulPartLen: CK_ULONG_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_GenerateKey: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - templ: *mut _CK_ATTRIBUTE, - ulCount: ::std::os::raw::c_ulong, - key: *mut CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + pTemplate: CK_ATTRIBUTE_PTR, + ulCount: CK_ULONG, + phKey: CK_OBJECT_HANDLE_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_GenerateKeyPair: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - public_key_template: *mut _CK_ATTRIBUTE, - public_key_attribute_count: ::std::os::raw::c_ulong, - private_key_template: *mut _CK_ATTRIBUTE, - private_key_attribute_count: ::std::os::raw::c_ulong, - public_key: *mut CK_OBJECT_HANDLE, - private_key: *mut CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + pPublicKeyTemplate: CK_ATTRIBUTE_PTR, + ulPublicKeyAttributeCount: CK_ULONG, + pPrivateKeyTemplate: CK_ATTRIBUTE_PTR, + ulPrivateKeyAttributeCount: CK_ULONG, + phPublicKey: CK_OBJECT_HANDLE_PTR, + phPrivateKey: CK_OBJECT_HANDLE_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_WrapKey: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - wrapping_key: CK_OBJECT_HANDLE, - key: CK_OBJECT_HANDLE, - wrapped_key: *mut ::std::os::raw::c_uchar, - wrapped_key_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hWrappingKey: CK_OBJECT_HANDLE, + hKey: CK_OBJECT_HANDLE, + pWrappedKey: CK_BYTE_PTR, + pulWrappedKeyLen: CK_ULONG_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_UnwrapKey: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - unwrapping_key: CK_OBJECT_HANDLE, - wrapped_key: *mut ::std::os::raw::c_uchar, - wrapped_key_len: ::std::os::raw::c_ulong, - templ: *mut _CK_ATTRIBUTE, - attribute_count: ::std::os::raw::c_ulong, - key: *mut CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hUnwrappingKey: CK_OBJECT_HANDLE, + pWrappedKey: CK_BYTE_PTR, + ulWrappedKeyLen: CK_ULONG, + pTemplate: CK_ATTRIBUTE_PTR, + ulAttributeCount: CK_ULONG, + phKey: CK_OBJECT_HANDLE_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_DeriveKey: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - base_key: CK_OBJECT_HANDLE, - templ: *mut _CK_ATTRIBUTE, - attribute_count: ::std::os::raw::c_ulong, - key: *mut CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hBaseKey: CK_OBJECT_HANDLE, + pTemplate: CK_ATTRIBUTE_PTR, + ulAttributeCount: CK_ULONG, + phKey: CK_OBJECT_HANDLE_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_SeedRandom: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - seed: *mut ::std::os::raw::c_uchar, - seed_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pSeed: CK_BYTE_PTR, + ulSeedLen: CK_ULONG, ) -> CK_RV, ::libloading::Error, >, pub C_GenerateRandom: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - random_data: *mut ::std::os::raw::c_uchar, - random_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + RandomData: CK_BYTE_PTR, + ulRandomLen: CK_ULONG, ) -> CK_RV, ::libloading::Error, >, pub C_GetFunctionStatus: - Result CK_RV, ::libloading::Error>, + Result CK_RV, ::libloading::Error>, pub C_CancelFunction: - Result CK_RV, ::libloading::Error>, + Result CK_RV, ::libloading::Error>, + pub C_WaitForSlotEvent: Result< + unsafe extern "C" fn( + flags: CK_FLAGS, + pSlot: CK_SLOT_ID_PTR, + pRserved: CK_VOID_PTR, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_GetInterfaceList: Result< + unsafe extern "C" fn(pInterfacesList: CK_INTERFACE_PTR, pulCount: CK_ULONG_PTR) -> CK_RV, + ::libloading::Error, + >, + pub C_GetInterface: Result< + unsafe extern "C" fn( + pInterfaceName: CK_UTF8CHAR_PTR, + pVersion: CK_VERSION_PTR, + ppInterface: CK_INTERFACE_PTR_PTR, + flags: CK_FLAGS, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_LoginUser: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + userType: CK_USER_TYPE, + pPin: CK_UTF8CHAR_PTR, + ulPinLen: CK_ULONG, + pUsername: CK_UTF8CHAR_PTR, + ulUsernameLen: CK_ULONG, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_SessionCancel: Result< + unsafe extern "C" fn(hSession: CK_SESSION_HANDLE, flags: CK_FLAGS) -> CK_RV, + ::libloading::Error, + >, + pub C_MessageEncryptInit: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_EncryptMessage: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pAssociatedData: CK_BYTE_PTR, + ulAssociatedDataLen: CK_ULONG, + pPlaintext: CK_BYTE_PTR, + ulPlaintextLen: CK_ULONG, + pCiphertext: CK_BYTE_PTR, + pulCiphertextLen: CK_ULONG_PTR, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_EncryptMessageBegin: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pAssociatedData: CK_BYTE_PTR, + ulAssociatedDataLen: CK_ULONG, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_EncryptMessageNext: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pPlaintextPart: CK_BYTE_PTR, + ulPlaintextPartLen: CK_ULONG, + pCiphertextPart: CK_BYTE_PTR, + pulCiphertextPartLen: CK_ULONG_PTR, + flags: CK_FLAGS, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_MessageEncryptFinal: + Result CK_RV, ::libloading::Error>, + pub C_MessageDecryptInit: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_DecryptMessage: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pAssociatedData: CK_BYTE_PTR, + ulAssociatedDataLen: CK_ULONG, + pCiphertext: CK_BYTE_PTR, + ulCiphertextLen: CK_ULONG, + pPlaintext: CK_BYTE_PTR, + pulPlaintextLen: CK_ULONG_PTR, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_DecryptMessageBegin: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pAssociatedData: CK_BYTE_PTR, + ulAssociatedDataLen: CK_ULONG, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_DecryptMessageNext: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pCiphertext: CK_BYTE_PTR, + ulCiphertextLen: CK_ULONG, + pPlaintext: CK_BYTE_PTR, + pulPlaintextLen: CK_ULONG_PTR, + flags: CK_FLAGS, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_MessageDecryptFinal: + Result CK_RV, ::libloading::Error>, + pub C_MessageSignInit: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_SignMessage: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + pulSignatureLen: CK_ULONG_PTR, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_SignMessageBegin: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_SignMessageNext: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + pulSignatureLen: CK_ULONG_PTR, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_MessageSignFinal: + Result CK_RV, ::libloading::Error>, + pub C_MessageVerifyInit: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_VerifyMessage: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + ulSignatureLen: CK_ULONG, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_VerifyMessageBegin: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_VerifyMessageNext: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + ulSignatureLen: CK_ULONG, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_MessageVerifyFinal: + Result CK_RV, ::libloading::Error>, } impl Pkcs11 { pub unsafe fn new

(path: P) -> Result @@ -4064,7 +11263,6 @@ impl Pkcs11 { let C_GetSlotList = __library.get(b"C_GetSlotList\0").map(|sym| *sym); let C_GetSlotInfo = __library.get(b"C_GetSlotInfo\0").map(|sym| *sym); let C_GetTokenInfo = __library.get(b"C_GetTokenInfo\0").map(|sym| *sym); - let C_WaitForSlotEvent = __library.get(b"C_WaitForSlotEvent\0").map(|sym| *sym); let C_GetMechanismList = __library.get(b"C_GetMechanismList\0").map(|sym| *sym); let C_GetMechanismInfo = __library.get(b"C_GetMechanismInfo\0").map(|sym| *sym); let C_InitToken = __library.get(b"C_InitToken\0").map(|sym| *sym); @@ -4125,6 +11323,31 @@ impl Pkcs11 { let C_GenerateRandom = __library.get(b"C_GenerateRandom\0").map(|sym| *sym); let C_GetFunctionStatus = __library.get(b"C_GetFunctionStatus\0").map(|sym| *sym); let C_CancelFunction = __library.get(b"C_CancelFunction\0").map(|sym| *sym); + let C_WaitForSlotEvent = __library.get(b"C_WaitForSlotEvent\0").map(|sym| *sym); + let C_GetInterfaceList = __library.get(b"C_GetInterfaceList\0").map(|sym| *sym); + let C_GetInterface = __library.get(b"C_GetInterface\0").map(|sym| *sym); + let C_LoginUser = __library.get(b"C_LoginUser\0").map(|sym| *sym); + let C_SessionCancel = __library.get(b"C_SessionCancel\0").map(|sym| *sym); + let C_MessageEncryptInit = __library.get(b"C_MessageEncryptInit\0").map(|sym| *sym); + let C_EncryptMessage = __library.get(b"C_EncryptMessage\0").map(|sym| *sym); + let C_EncryptMessageBegin = __library.get(b"C_EncryptMessageBegin\0").map(|sym| *sym); + let C_EncryptMessageNext = __library.get(b"C_EncryptMessageNext\0").map(|sym| *sym); + let C_MessageEncryptFinal = __library.get(b"C_MessageEncryptFinal\0").map(|sym| *sym); + let C_MessageDecryptInit = __library.get(b"C_MessageDecryptInit\0").map(|sym| *sym); + let C_DecryptMessage = __library.get(b"C_DecryptMessage\0").map(|sym| *sym); + let C_DecryptMessageBegin = __library.get(b"C_DecryptMessageBegin\0").map(|sym| *sym); + let C_DecryptMessageNext = __library.get(b"C_DecryptMessageNext\0").map(|sym| *sym); + let C_MessageDecryptFinal = __library.get(b"C_MessageDecryptFinal\0").map(|sym| *sym); + let C_MessageSignInit = __library.get(b"C_MessageSignInit\0").map(|sym| *sym); + let C_SignMessage = __library.get(b"C_SignMessage\0").map(|sym| *sym); + let C_SignMessageBegin = __library.get(b"C_SignMessageBegin\0").map(|sym| *sym); + let C_SignMessageNext = __library.get(b"C_SignMessageNext\0").map(|sym| *sym); + let C_MessageSignFinal = __library.get(b"C_MessageSignFinal\0").map(|sym| *sym); + let C_MessageVerifyInit = __library.get(b"C_MessageVerifyInit\0").map(|sym| *sym); + let C_VerifyMessage = __library.get(b"C_VerifyMessage\0").map(|sym| *sym); + let C_VerifyMessageBegin = __library.get(b"C_VerifyMessageBegin\0").map(|sym| *sym); + let C_VerifyMessageNext = __library.get(b"C_VerifyMessageNext\0").map(|sym| *sym); + let C_MessageVerifyFinal = __library.get(b"C_MessageVerifyFinal\0").map(|sym| *sym); Ok(Pkcs11 { __library, C_Initialize, @@ -4134,7 +11357,6 @@ impl Pkcs11 { C_GetSlotList, C_GetSlotInfo, C_GetTokenInfo, - C_WaitForSlotEvent, C_GetMechanismList, C_GetMechanismInfo, C_InitToken, @@ -4195,146 +11417,164 @@ impl Pkcs11 { C_GenerateRandom, C_GetFunctionStatus, C_CancelFunction, + C_WaitForSlotEvent, + C_GetInterfaceList, + C_GetInterface, + C_LoginUser, + C_SessionCancel, + C_MessageEncryptInit, + C_EncryptMessage, + C_EncryptMessageBegin, + C_EncryptMessageNext, + C_MessageEncryptFinal, + C_MessageDecryptInit, + C_DecryptMessage, + C_DecryptMessageBegin, + C_DecryptMessageNext, + C_MessageDecryptFinal, + C_MessageSignInit, + C_SignMessage, + C_SignMessageBegin, + C_SignMessageNext, + C_MessageSignFinal, + C_MessageVerifyInit, + C_VerifyMessage, + C_VerifyMessageBegin, + C_VerifyMessageNext, + C_MessageVerifyFinal, }) } - pub unsafe fn C_Initialize(&self, init_args: *mut ::std::os::raw::c_void) -> CK_RV { + pub unsafe fn C_Initialize(&self, pInitArgs: CK_VOID_PTR) -> CK_RV { (self .C_Initialize .as_ref() - .expect("Expected function, got error."))(init_args) + .expect("Expected function, got error."))(pInitArgs) } - pub unsafe fn C_Finalize(&self, pReserved: *mut ::std::os::raw::c_void) -> CK_RV { + pub unsafe fn C_Finalize(&self, pReserved: CK_VOID_PTR) -> CK_RV { (self .C_Finalize .as_ref() .expect("Expected function, got error."))(pReserved) } - pub unsafe fn C_GetInfo(&self, info: *mut _CK_INFO) -> CK_RV { + pub unsafe fn C_GetInfo(&self, pInfo: CK_INFO_PTR) -> CK_RV { (self .C_GetInfo .as_ref() - .expect("Expected function, got error."))(info) + .expect("Expected function, got error."))(pInfo) } - pub unsafe fn C_GetFunctionList(&self, function_list: *mut *mut _CK_FUNCTION_LIST) -> CK_RV { + pub unsafe fn C_GetFunctionList(&self, ppFunctionList: CK_FUNCTION_LIST_PTR_PTR) -> CK_RV { (self .C_GetFunctionList .as_ref() - .expect("Expected function, got error."))(function_list) + .expect("Expected function, got error."))(ppFunctionList) } pub unsafe fn C_GetSlotList( &self, - token_present: ::std::os::raw::c_uchar, - slot_list: *mut CK_SLOT_ID, - ulCount: *mut ::std::os::raw::c_ulong, + tokenPresent: CK_BBOOL, + pSlotList: CK_SLOT_ID_PTR, + pulCount: CK_ULONG_PTR, ) -> CK_RV { (self .C_GetSlotList .as_ref() - .expect("Expected function, got error."))(token_present, slot_list, ulCount) + .expect("Expected function, got error."))(tokenPresent, pSlotList, pulCount) } - pub unsafe fn C_GetSlotInfo(&self, slotID: CK_SLOT_ID, info: *mut _CK_SLOT_INFO) -> CK_RV { + pub unsafe fn C_GetSlotInfo(&self, slotID: CK_SLOT_ID, pInfo: CK_SLOT_INFO_PTR) -> CK_RV { (self .C_GetSlotInfo .as_ref() - .expect("Expected function, got error."))(slotID, info) + .expect("Expected function, got error."))(slotID, pInfo) } - pub unsafe fn C_GetTokenInfo(&self, slotID: CK_SLOT_ID, info: *mut _CK_TOKEN_INFO) -> CK_RV { + pub unsafe fn C_GetTokenInfo(&self, slotID: CK_SLOT_ID, pInfo: CK_TOKEN_INFO_PTR) -> CK_RV { (self .C_GetTokenInfo .as_ref() - .expect("Expected function, got error."))(slotID, info) - } - pub unsafe fn C_WaitForSlotEvent( - &self, - flags: CK_FLAGS, - slot: *mut CK_SLOT_ID, - pReserved: *mut ::std::os::raw::c_void, - ) -> CK_RV { - (self - .C_WaitForSlotEvent - .as_ref() - .expect("Expected function, got error."))(flags, slot, pReserved) + .expect("Expected function, got error."))(slotID, pInfo) } pub unsafe fn C_GetMechanismList( &self, slotID: CK_SLOT_ID, - mechanism_list: *mut CK_MECHANISM_TYPE, - ulCount: *mut ::std::os::raw::c_ulong, + pMechanismList: CK_MECHANISM_TYPE_PTR, + pulCount: CK_ULONG_PTR, ) -> CK_RV { (self .C_GetMechanismList .as_ref() - .expect("Expected function, got error."))(slotID, mechanism_list, ulCount) + .expect("Expected function, got error."))(slotID, pMechanismList, pulCount) } pub unsafe fn C_GetMechanismInfo( &self, slotID: CK_SLOT_ID, type_: CK_MECHANISM_TYPE, - info: *mut _CK_MECHANISM_INFO, + pInfo: CK_MECHANISM_INFO_PTR, ) -> CK_RV { (self .C_GetMechanismInfo .as_ref() - .expect("Expected function, got error."))(slotID, type_, info) + .expect("Expected function, got error."))(slotID, type_, pInfo) } pub unsafe fn C_InitToken( &self, slotID: CK_SLOT_ID, - pin: *mut ::std::os::raw::c_uchar, - pin_len: ::std::os::raw::c_ulong, - label: *mut ::std::os::raw::c_uchar, + pPin: CK_UTF8CHAR_PTR, + ulPinLen: CK_ULONG, + pLabel: CK_UTF8CHAR_PTR, ) -> CK_RV { (self .C_InitToken .as_ref() - .expect("Expected function, got error."))(slotID, pin, pin_len, label) + .expect("Expected function, got error."))(slotID, pPin, ulPinLen, pLabel) } pub unsafe fn C_InitPIN( &self, - session: CK_SESSION_HANDLE, - pin: *mut ::std::os::raw::c_uchar, - pin_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pPin: CK_UTF8CHAR_PTR, + ulPinLen: CK_ULONG, ) -> CK_RV { (self .C_InitPIN .as_ref() - .expect("Expected function, got error."))(session, pin, pin_len) + .expect("Expected function, got error."))(hSession, pPin, ulPinLen) } pub unsafe fn C_SetPIN( &self, - session: CK_SESSION_HANDLE, - old_pin: *mut ::std::os::raw::c_uchar, - old_len: ::std::os::raw::c_ulong, - new_pin: *mut ::std::os::raw::c_uchar, - new_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pOldPin: CK_UTF8CHAR_PTR, + ulOldLen: CK_ULONG, + pNewPin: CK_UTF8CHAR_PTR, + ulNewLen: CK_ULONG, ) -> CK_RV { (self .C_SetPIN .as_ref() .expect("Expected function, got error."))( - session, old_pin, old_len, new_pin, new_len + hSession, pOldPin, ulOldLen, pNewPin, ulNewLen, ) } pub unsafe fn C_OpenSession( &self, slotID: CK_SLOT_ID, flags: CK_FLAGS, - application: *mut ::std::os::raw::c_void, - notify: CK_NOTIFY, - session: *mut CK_SESSION_HANDLE, + pApplication: CK_VOID_PTR, + Notify: CK_NOTIFY, + phSession: CK_SESSION_HANDLE_PTR, ) -> CK_RV { (self .C_OpenSession .as_ref() .expect("Expected function, got error."))( - slotID, flags, application, notify, session + slotID, + flags, + pApplication, + Notify, + phSession, ) } - pub unsafe fn C_CloseSession(&self, session: CK_SESSION_HANDLE) -> CK_RV { + pub unsafe fn C_CloseSession(&self, hSession: CK_SESSION_HANDLE) -> CK_RV { (self .C_CloseSession .as_ref() - .expect("Expected function, got error."))(session) + .expect("Expected function, got error."))(hSession) } pub unsafe fn C_CloseAllSessions(&self, slotID: CK_SLOT_ID) -> CK_RV { (self @@ -4344,723 +11584,1119 @@ impl Pkcs11 { } pub unsafe fn C_GetSessionInfo( &self, - session: CK_SESSION_HANDLE, - info: *mut _CK_SESSION_INFO, + hSession: CK_SESSION_HANDLE, + pInfo: CK_SESSION_INFO_PTR, ) -> CK_RV { (self .C_GetSessionInfo .as_ref() - .expect("Expected function, got error."))(session, info) + .expect("Expected function, got error."))(hSession, pInfo) } pub unsafe fn C_GetOperationState( &self, - session: CK_SESSION_HANDLE, - operation_state: *mut ::std::os::raw::c_uchar, - operation_state_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pOperationState: CK_BYTE_PTR, + pulOperationStateLen: CK_ULONG_PTR, ) -> CK_RV { (self .C_GetOperationState .as_ref() .expect("Expected function, got error."))( - session, operation_state, operation_state_len + hSession, + pOperationState, + pulOperationStateLen, ) } pub unsafe fn C_SetOperationState( &self, - session: CK_SESSION_HANDLE, - operation_state: *mut ::std::os::raw::c_uchar, - operation_state_len: ::std::os::raw::c_ulong, - encryption_key: CK_OBJECT_HANDLE, - authentiation_key: CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pOperationState: CK_BYTE_PTR, + ulOperationStateLen: CK_ULONG, + hEncryptionKey: CK_OBJECT_HANDLE, + hAuthenticationKey: CK_OBJECT_HANDLE, ) -> CK_RV { (self .C_SetOperationState .as_ref() .expect("Expected function, got error."))( - session, - operation_state, - operation_state_len, - encryption_key, - authentiation_key, + hSession, + pOperationState, + ulOperationStateLen, + hEncryptionKey, + hAuthenticationKey, ) } pub unsafe fn C_Login( &self, - session: CK_SESSION_HANDLE, - user_type: CK_USER_TYPE, - pin: *mut ::std::os::raw::c_uchar, - pin_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + userType: CK_USER_TYPE, + pPin: CK_UTF8CHAR_PTR, + ulPinLen: CK_ULONG, ) -> CK_RV { (self .C_Login .as_ref() - .expect("Expected function, got error."))(session, user_type, pin, pin_len) + .expect("Expected function, got error."))(hSession, userType, pPin, ulPinLen) } - pub unsafe fn C_Logout(&self, session: CK_SESSION_HANDLE) -> CK_RV { + pub unsafe fn C_Logout(&self, hSession: CK_SESSION_HANDLE) -> CK_RV { (self .C_Logout .as_ref() - .expect("Expected function, got error."))(session) + .expect("Expected function, got error."))(hSession) } pub unsafe fn C_CreateObject( &self, - session: CK_SESSION_HANDLE, - templ: *mut _CK_ATTRIBUTE, - ulCount: ::std::os::raw::c_ulong, - object: *mut CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pTemplate: CK_ATTRIBUTE_PTR, + ulCount: CK_ULONG, + phObject: CK_OBJECT_HANDLE_PTR, ) -> CK_RV { (self .C_CreateObject .as_ref() - .expect("Expected function, got error."))(session, templ, ulCount, object) + .expect("Expected function, got error."))(hSession, pTemplate, ulCount, phObject) } pub unsafe fn C_CopyObject( &self, - session: CK_SESSION_HANDLE, - object: CK_OBJECT_HANDLE, - templ: *mut _CK_ATTRIBUTE, - ulCount: ::std::os::raw::c_ulong, - new_object: *mut CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + hObject: CK_OBJECT_HANDLE, + pTemplate: CK_ATTRIBUTE_PTR, + ulCount: CK_ULONG, + phNewObject: CK_OBJECT_HANDLE_PTR, ) -> CK_RV { (self .C_CopyObject .as_ref() .expect("Expected function, got error."))( - session, object, templ, ulCount, new_object + hSession, + hObject, + pTemplate, + ulCount, + phNewObject, ) } pub unsafe fn C_DestroyObject( &self, - session: CK_SESSION_HANDLE, - object: CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + hObject: CK_OBJECT_HANDLE, ) -> CK_RV { (self .C_DestroyObject .as_ref() - .expect("Expected function, got error."))(session, object) + .expect("Expected function, got error."))(hSession, hObject) } pub unsafe fn C_GetObjectSize( &self, - session: CK_SESSION_HANDLE, - object: CK_OBJECT_HANDLE, - size: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + hObject: CK_OBJECT_HANDLE, + pulSize: CK_ULONG_PTR, ) -> CK_RV { (self .C_GetObjectSize .as_ref() - .expect("Expected function, got error."))(session, object, size) + .expect("Expected function, got error."))(hSession, hObject, pulSize) } pub unsafe fn C_GetAttributeValue( &self, - session: CK_SESSION_HANDLE, - object: CK_OBJECT_HANDLE, - templ: *mut _CK_ATTRIBUTE, - ulCount: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + hObject: CK_OBJECT_HANDLE, + pTemplate: CK_ATTRIBUTE_PTR, + ulCount: CK_ULONG, ) -> CK_RV { (self .C_GetAttributeValue .as_ref() - .expect("Expected function, got error."))(session, object, templ, ulCount) + .expect("Expected function, got error."))(hSession, hObject, pTemplate, ulCount) } pub unsafe fn C_SetAttributeValue( &self, - session: CK_SESSION_HANDLE, - object: CK_OBJECT_HANDLE, - templ: *mut _CK_ATTRIBUTE, - ulCount: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + hObject: CK_OBJECT_HANDLE, + pTemplate: CK_ATTRIBUTE_PTR, + ulCount: CK_ULONG, ) -> CK_RV { (self .C_SetAttributeValue .as_ref() - .expect("Expected function, got error."))(session, object, templ, ulCount) + .expect("Expected function, got error."))(hSession, hObject, pTemplate, ulCount) } pub unsafe fn C_FindObjectsInit( &self, - session: CK_SESSION_HANDLE, - templ: *mut _CK_ATTRIBUTE, - ulCount: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pTemplate: CK_ATTRIBUTE_PTR, + ulCount: CK_ULONG, ) -> CK_RV { (self .C_FindObjectsInit .as_ref() - .expect("Expected function, got error."))(session, templ, ulCount) + .expect("Expected function, got error."))(hSession, pTemplate, ulCount) } pub unsafe fn C_FindObjects( &self, - session: CK_SESSION_HANDLE, - object: *mut CK_OBJECT_HANDLE, - max_object_count: ::std::os::raw::c_ulong, - object_count: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + phObject: CK_OBJECT_HANDLE_PTR, + ulMaxObjectCount: CK_ULONG, + pulObjectCount: CK_ULONG_PTR, ) -> CK_RV { (self .C_FindObjects .as_ref() .expect("Expected function, got error."))( - session, - object, - max_object_count, - object_count, + hSession, + phObject, + ulMaxObjectCount, + pulObjectCount, ) } - pub unsafe fn C_FindObjectsFinal(&self, session: CK_SESSION_HANDLE) -> CK_RV { + pub unsafe fn C_FindObjectsFinal(&self, hSession: CK_SESSION_HANDLE) -> CK_RV { (self .C_FindObjectsFinal .as_ref() - .expect("Expected function, got error."))(session) + .expect("Expected function, got error."))(hSession) } pub unsafe fn C_EncryptInit( &self, - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - key: CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, ) -> CK_RV { (self .C_EncryptInit .as_ref() - .expect("Expected function, got error."))(session, mechanism, key) + .expect("Expected function, got error."))(hSession, pMechanism, hKey) } pub unsafe fn C_Encrypt( &self, - session: CK_SESSION_HANDLE, - data: *mut ::std::os::raw::c_uchar, - data_len: ::std::os::raw::c_ulong, - encrypted_data: *mut ::std::os::raw::c_uchar, - encrypted_data_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pEncryptedData: CK_BYTE_PTR, + pulEncryptedDataLen: CK_ULONG_PTR, ) -> CK_RV { (self .C_Encrypt .as_ref() .expect("Expected function, got error."))( - session, - data, - data_len, - encrypted_data, - encrypted_data_len, + hSession, + pData, + ulDataLen, + pEncryptedData, + pulEncryptedDataLen, ) } pub unsafe fn C_EncryptUpdate( &self, - session: CK_SESSION_HANDLE, - part: *mut ::std::os::raw::c_uchar, - part_len: ::std::os::raw::c_ulong, - encrypted_part: *mut ::std::os::raw::c_uchar, - encrypted_part_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pPart: CK_BYTE_PTR, + ulPartLen: CK_ULONG, + pEncryptedPart: CK_BYTE_PTR, + pulEncryptedPartLen: CK_ULONG_PTR, ) -> CK_RV { (self .C_EncryptUpdate .as_ref() .expect("Expected function, got error."))( - session, - part, - part_len, - encrypted_part, - encrypted_part_len, + hSession, + pPart, + ulPartLen, + pEncryptedPart, + pulEncryptedPartLen, ) } pub unsafe fn C_EncryptFinal( &self, - session: CK_SESSION_HANDLE, - last_encrypted_part: *mut ::std::os::raw::c_uchar, - last_encrypted_part_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pLastEncryptedPart: CK_BYTE_PTR, + pulLastEncryptedPartLen: CK_ULONG_PTR, ) -> CK_RV { (self .C_EncryptFinal .as_ref() .expect("Expected function, got error."))( - session, - last_encrypted_part, - last_encrypted_part_len, + hSession, + pLastEncryptedPart, + pulLastEncryptedPartLen, ) } pub unsafe fn C_DecryptInit( &self, - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - key: CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, ) -> CK_RV { (self .C_DecryptInit .as_ref() - .expect("Expected function, got error."))(session, mechanism, key) + .expect("Expected function, got error."))(hSession, pMechanism, hKey) } pub unsafe fn C_Decrypt( &self, - session: CK_SESSION_HANDLE, - encrypted_data: *mut ::std::os::raw::c_uchar, - encrypted_data_len: ::std::os::raw::c_ulong, - data: *mut ::std::os::raw::c_uchar, - data_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pEncryptedData: CK_BYTE_PTR, + ulEncryptedDataLen: CK_ULONG, + pData: CK_BYTE_PTR, + pulDataLen: CK_ULONG_PTR, ) -> CK_RV { (self .C_Decrypt .as_ref() .expect("Expected function, got error."))( - session, - encrypted_data, - encrypted_data_len, - data, - data_len, + hSession, + pEncryptedData, + ulEncryptedDataLen, + pData, + pulDataLen, ) } pub unsafe fn C_DecryptUpdate( &self, - session: CK_SESSION_HANDLE, - encrypted_part: *mut ::std::os::raw::c_uchar, - encrypted_part_len: ::std::os::raw::c_ulong, - part: *mut ::std::os::raw::c_uchar, - part_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pEncryptedPart: CK_BYTE_PTR, + ulEncryptedPartLen: CK_ULONG, + pPart: CK_BYTE_PTR, + pulPartLen: CK_ULONG_PTR, ) -> CK_RV { (self .C_DecryptUpdate .as_ref() .expect("Expected function, got error."))( - session, - encrypted_part, - encrypted_part_len, - part, - part_len, + hSession, + pEncryptedPart, + ulEncryptedPartLen, + pPart, + pulPartLen, ) } pub unsafe fn C_DecryptFinal( &self, - session: CK_SESSION_HANDLE, - last_part: *mut ::std::os::raw::c_uchar, - last_part_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pLastPart: CK_BYTE_PTR, + pulLastPartLen: CK_ULONG_PTR, ) -> CK_RV { (self .C_DecryptFinal .as_ref() - .expect("Expected function, got error."))(session, last_part, last_part_len) + .expect("Expected function, got error."))(hSession, pLastPart, pulLastPartLen) } pub unsafe fn C_DigestInit( &self, - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, ) -> CK_RV { (self .C_DigestInit .as_ref() - .expect("Expected function, got error."))(session, mechanism) + .expect("Expected function, got error."))(hSession, pMechanism) } pub unsafe fn C_Digest( &self, - session: CK_SESSION_HANDLE, - data: *mut ::std::os::raw::c_uchar, - data_len: ::std::os::raw::c_ulong, - digest: *mut ::std::os::raw::c_uchar, - digest_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pDigest: CK_BYTE_PTR, + pulDigestLen: CK_ULONG_PTR, ) -> CK_RV { (self .C_Digest .as_ref() .expect("Expected function, got error."))( - session, data, data_len, digest, digest_len + hSession, + pData, + ulDataLen, + pDigest, + pulDigestLen, ) } pub unsafe fn C_DigestUpdate( &self, - session: CK_SESSION_HANDLE, - part: *mut ::std::os::raw::c_uchar, - part_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pPart: CK_BYTE_PTR, + ulPartLen: CK_ULONG, ) -> CK_RV { (self .C_DigestUpdate .as_ref() - .expect("Expected function, got error."))(session, part, part_len) + .expect("Expected function, got error."))(hSession, pPart, ulPartLen) } - pub unsafe fn C_DigestKey(&self, session: CK_SESSION_HANDLE, key: CK_OBJECT_HANDLE) -> CK_RV { + pub unsafe fn C_DigestKey(&self, hSession: CK_SESSION_HANDLE, hKey: CK_OBJECT_HANDLE) -> CK_RV { (self .C_DigestKey .as_ref() - .expect("Expected function, got error."))(session, key) + .expect("Expected function, got error."))(hSession, hKey) } pub unsafe fn C_DigestFinal( &self, - session: CK_SESSION_HANDLE, - digest: *mut ::std::os::raw::c_uchar, - digest_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pDigest: CK_BYTE_PTR, + pulDigestLen: CK_ULONG_PTR, ) -> CK_RV { (self .C_DigestFinal .as_ref() - .expect("Expected function, got error."))(session, digest, digest_len) + .expect("Expected function, got error."))(hSession, pDigest, pulDigestLen) } pub unsafe fn C_SignInit( &self, - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - key: CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, ) -> CK_RV { (self .C_SignInit .as_ref() - .expect("Expected function, got error."))(session, mechanism, key) + .expect("Expected function, got error."))(hSession, pMechanism, hKey) } pub unsafe fn C_Sign( &self, - session: CK_SESSION_HANDLE, - data: *mut ::std::os::raw::c_uchar, - data_len: ::std::os::raw::c_ulong, - signature: *mut ::std::os::raw::c_uchar, - signature_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + pulSignatureLen: CK_ULONG_PTR, ) -> CK_RV { (self.C_Sign.as_ref().expect("Expected function, got error."))( - session, - data, - data_len, - signature, - signature_len, + hSession, + pData, + ulDataLen, + pSignature, + pulSignatureLen, ) } pub unsafe fn C_SignUpdate( &self, - session: CK_SESSION_HANDLE, - part: *mut ::std::os::raw::c_uchar, - part_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pPart: CK_BYTE_PTR, + ulPartLen: CK_ULONG, ) -> CK_RV { (self .C_SignUpdate .as_ref() - .expect("Expected function, got error."))(session, part, part_len) + .expect("Expected function, got error."))(hSession, pPart, ulPartLen) } pub unsafe fn C_SignFinal( &self, - session: CK_SESSION_HANDLE, - signature: *mut ::std::os::raw::c_uchar, - signature_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pSignature: CK_BYTE_PTR, + pulSignatureLen: CK_ULONG_PTR, ) -> CK_RV { (self .C_SignFinal .as_ref() - .expect("Expected function, got error."))(session, signature, signature_len) + .expect("Expected function, got error."))(hSession, pSignature, pulSignatureLen) } pub unsafe fn C_SignRecoverInit( &self, - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - key: CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, ) -> CK_RV { (self .C_SignRecoverInit .as_ref() - .expect("Expected function, got error."))(session, mechanism, key) + .expect("Expected function, got error."))(hSession, pMechanism, hKey) } pub unsafe fn C_SignRecover( &self, - session: CK_SESSION_HANDLE, - data: *mut ::std::os::raw::c_uchar, - data_len: ::std::os::raw::c_ulong, - signature: *mut ::std::os::raw::c_uchar, - signature_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + pulSignatureLen: CK_ULONG_PTR, ) -> CK_RV { (self .C_SignRecover .as_ref() .expect("Expected function, got error."))( - session, - data, - data_len, - signature, - signature_len, + hSession, + pData, + ulDataLen, + pSignature, + pulSignatureLen, ) } pub unsafe fn C_VerifyInit( &self, - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - key: CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, ) -> CK_RV { (self .C_VerifyInit .as_ref() - .expect("Expected function, got error."))(session, mechanism, key) + .expect("Expected function, got error."))(hSession, pMechanism, hKey) } pub unsafe fn C_Verify( &self, - session: CK_SESSION_HANDLE, - data: *mut ::std::os::raw::c_uchar, - data_len: ::std::os::raw::c_ulong, - signature: *mut ::std::os::raw::c_uchar, - signature_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + ulSignatureLen: CK_ULONG, ) -> CK_RV { (self .C_Verify .as_ref() .expect("Expected function, got error."))( - session, - data, - data_len, - signature, - signature_len, + hSession, + pData, + ulDataLen, + pSignature, + ulSignatureLen, ) } pub unsafe fn C_VerifyUpdate( &self, - session: CK_SESSION_HANDLE, - part: *mut ::std::os::raw::c_uchar, - part_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pPart: CK_BYTE_PTR, + ulPartLen: CK_ULONG, ) -> CK_RV { (self .C_VerifyUpdate .as_ref() - .expect("Expected function, got error."))(session, part, part_len) + .expect("Expected function, got error."))(hSession, pPart, ulPartLen) } pub unsafe fn C_VerifyFinal( &self, - session: CK_SESSION_HANDLE, - signature: *mut ::std::os::raw::c_uchar, - signature_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pSignature: CK_BYTE_PTR, + ulSignatureLen: CK_ULONG, ) -> CK_RV { (self .C_VerifyFinal .as_ref() - .expect("Expected function, got error."))(session, signature, signature_len) + .expect("Expected function, got error."))(hSession, pSignature, ulSignatureLen) } pub unsafe fn C_VerifyRecoverInit( &self, - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - key: CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, ) -> CK_RV { (self .C_VerifyRecoverInit .as_ref() - .expect("Expected function, got error."))(session, mechanism, key) + .expect("Expected function, got error."))(hSession, pMechanism, hKey) } pub unsafe fn C_VerifyRecover( &self, - session: CK_SESSION_HANDLE, - signature: *mut ::std::os::raw::c_uchar, - signature_len: ::std::os::raw::c_ulong, - data: *mut ::std::os::raw::c_uchar, - data_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pSignature: CK_BYTE_PTR, + ulSignatureLen: CK_ULONG, + pData: CK_BYTE_PTR, + pulDataLen: CK_ULONG_PTR, ) -> CK_RV { (self .C_VerifyRecover .as_ref() .expect("Expected function, got error."))( - session, - signature, - signature_len, - data, - data_len, + hSession, + pSignature, + ulSignatureLen, + pData, + pulDataLen, ) } pub unsafe fn C_DigestEncryptUpdate( &self, - session: CK_SESSION_HANDLE, - part: *mut ::std::os::raw::c_uchar, - part_len: ::std::os::raw::c_ulong, - encrypted_part: *mut ::std::os::raw::c_uchar, - encrypted_part_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pPart: CK_BYTE_PTR, + ulPartLen: CK_ULONG, + pEncryptedPart: CK_BYTE_PTR, + pulEncryptedPartLen: CK_ULONG_PTR, ) -> CK_RV { (self .C_DigestEncryptUpdate .as_ref() .expect("Expected function, got error."))( - session, - part, - part_len, - encrypted_part, - encrypted_part_len, + hSession, + pPart, + ulPartLen, + pEncryptedPart, + pulEncryptedPartLen, ) } pub unsafe fn C_DecryptDigestUpdate( &self, - session: CK_SESSION_HANDLE, - encrypted_part: *mut ::std::os::raw::c_uchar, - encrypted_part_len: ::std::os::raw::c_ulong, - part: *mut ::std::os::raw::c_uchar, - part_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pEncryptedPart: CK_BYTE_PTR, + ulEncryptedPartLen: CK_ULONG, + pPart: CK_BYTE_PTR, + pulPartLen: CK_ULONG_PTR, ) -> CK_RV { (self .C_DecryptDigestUpdate .as_ref() .expect("Expected function, got error."))( - session, - encrypted_part, - encrypted_part_len, - part, - part_len, + hSession, + pEncryptedPart, + ulEncryptedPartLen, + pPart, + pulPartLen, ) } pub unsafe fn C_SignEncryptUpdate( &self, - session: CK_SESSION_HANDLE, - part: *mut ::std::os::raw::c_uchar, - part_len: ::std::os::raw::c_ulong, - encrypted_part: *mut ::std::os::raw::c_uchar, - encrypted_part_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pPart: CK_BYTE_PTR, + ulPartLen: CK_ULONG, + pEncryptedPart: CK_BYTE_PTR, + pulEncryptedPartLen: CK_ULONG_PTR, ) -> CK_RV { (self .C_SignEncryptUpdate .as_ref() .expect("Expected function, got error."))( - session, - part, - part_len, - encrypted_part, - encrypted_part_len, + hSession, + pPart, + ulPartLen, + pEncryptedPart, + pulEncryptedPartLen, ) } pub unsafe fn C_DecryptVerifyUpdate( &self, - session: CK_SESSION_HANDLE, - encrypted_part: *mut ::std::os::raw::c_uchar, - encrypted_part_len: ::std::os::raw::c_ulong, - part: *mut ::std::os::raw::c_uchar, - part_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pEncryptedPart: CK_BYTE_PTR, + ulEncryptedPartLen: CK_ULONG, + pPart: CK_BYTE_PTR, + pulPartLen: CK_ULONG_PTR, ) -> CK_RV { (self .C_DecryptVerifyUpdate .as_ref() .expect("Expected function, got error."))( - session, - encrypted_part, - encrypted_part_len, - part, - part_len, + hSession, + pEncryptedPart, + ulEncryptedPartLen, + pPart, + pulPartLen, ) } pub unsafe fn C_GenerateKey( &self, - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - templ: *mut _CK_ATTRIBUTE, - ulCount: ::std::os::raw::c_ulong, - key: *mut CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + pTemplate: CK_ATTRIBUTE_PTR, + ulCount: CK_ULONG, + phKey: CK_OBJECT_HANDLE_PTR, ) -> CK_RV { (self .C_GenerateKey .as_ref() .expect("Expected function, got error."))( - session, mechanism, templ, ulCount, key + hSession, pMechanism, pTemplate, ulCount, phKey, ) } pub unsafe fn C_GenerateKeyPair( &self, - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - public_key_template: *mut _CK_ATTRIBUTE, - public_key_attribute_count: ::std::os::raw::c_ulong, - private_key_template: *mut _CK_ATTRIBUTE, - private_key_attribute_count: ::std::os::raw::c_ulong, - public_key: *mut CK_OBJECT_HANDLE, - private_key: *mut CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + pPublicKeyTemplate: CK_ATTRIBUTE_PTR, + ulPublicKeyAttributeCount: CK_ULONG, + pPrivateKeyTemplate: CK_ATTRIBUTE_PTR, + ulPrivateKeyAttributeCount: CK_ULONG, + phPublicKey: CK_OBJECT_HANDLE_PTR, + phPrivateKey: CK_OBJECT_HANDLE_PTR, ) -> CK_RV { (self .C_GenerateKeyPair .as_ref() .expect("Expected function, got error."))( - session, - mechanism, - public_key_template, - public_key_attribute_count, - private_key_template, - private_key_attribute_count, - public_key, - private_key, + hSession, + pMechanism, + pPublicKeyTemplate, + ulPublicKeyAttributeCount, + pPrivateKeyTemplate, + ulPrivateKeyAttributeCount, + phPublicKey, + phPrivateKey, ) } pub unsafe fn C_WrapKey( &self, - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - wrapping_key: CK_OBJECT_HANDLE, - key: CK_OBJECT_HANDLE, - wrapped_key: *mut ::std::os::raw::c_uchar, - wrapped_key_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hWrappingKey: CK_OBJECT_HANDLE, + hKey: CK_OBJECT_HANDLE, + pWrappedKey: CK_BYTE_PTR, + pulWrappedKeyLen: CK_ULONG_PTR, ) -> CK_RV { (self .C_WrapKey .as_ref() .expect("Expected function, got error."))( - session, - mechanism, - wrapping_key, - key, - wrapped_key, - wrapped_key_len, + hSession, + pMechanism, + hWrappingKey, + hKey, + pWrappedKey, + pulWrappedKeyLen, ) } pub unsafe fn C_UnwrapKey( &self, - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - unwrapping_key: CK_OBJECT_HANDLE, - wrapped_key: *mut ::std::os::raw::c_uchar, - wrapped_key_len: ::std::os::raw::c_ulong, - templ: *mut _CK_ATTRIBUTE, - attribute_count: ::std::os::raw::c_ulong, - key: *mut CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hUnwrappingKey: CK_OBJECT_HANDLE, + pWrappedKey: CK_BYTE_PTR, + ulWrappedKeyLen: CK_ULONG, + pTemplate: CK_ATTRIBUTE_PTR, + ulAttributeCount: CK_ULONG, + phKey: CK_OBJECT_HANDLE_PTR, ) -> CK_RV { (self .C_UnwrapKey .as_ref() .expect("Expected function, got error."))( - session, - mechanism, - unwrapping_key, - wrapped_key, - wrapped_key_len, - templ, - attribute_count, - key, + hSession, + pMechanism, + hUnwrappingKey, + pWrappedKey, + ulWrappedKeyLen, + pTemplate, + ulAttributeCount, + phKey, ) } pub unsafe fn C_DeriveKey( &self, - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - base_key: CK_OBJECT_HANDLE, - templ: *mut _CK_ATTRIBUTE, - attribute_count: ::std::os::raw::c_ulong, - key: *mut CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hBaseKey: CK_OBJECT_HANDLE, + pTemplate: CK_ATTRIBUTE_PTR, + ulAttributeCount: CK_ULONG, + phKey: CK_OBJECT_HANDLE_PTR, ) -> CK_RV { (self .C_DeriveKey .as_ref() .expect("Expected function, got error."))( - session, - mechanism, - base_key, - templ, - attribute_count, - key, + hSession, + pMechanism, + hBaseKey, + pTemplate, + ulAttributeCount, + phKey, ) } pub unsafe fn C_SeedRandom( &self, - session: CK_SESSION_HANDLE, - seed: *mut ::std::os::raw::c_uchar, - seed_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pSeed: CK_BYTE_PTR, + ulSeedLen: CK_ULONG, ) -> CK_RV { (self .C_SeedRandom .as_ref() - .expect("Expected function, got error."))(session, seed, seed_len) + .expect("Expected function, got error."))(hSession, pSeed, ulSeedLen) } pub unsafe fn C_GenerateRandom( &self, - session: CK_SESSION_HANDLE, - random_data: *mut ::std::os::raw::c_uchar, - random_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + RandomData: CK_BYTE_PTR, + ulRandomLen: CK_ULONG, ) -> CK_RV { (self .C_GenerateRandom .as_ref() - .expect("Expected function, got error."))(session, random_data, random_len) + .expect("Expected function, got error."))(hSession, RandomData, ulRandomLen) } - pub unsafe fn C_GetFunctionStatus(&self, session: CK_SESSION_HANDLE) -> CK_RV { + pub unsafe fn C_GetFunctionStatus(&self, hSession: CK_SESSION_HANDLE) -> CK_RV { (self .C_GetFunctionStatus .as_ref() - .expect("Expected function, got error."))(session) + .expect("Expected function, got error."))(hSession) } - pub unsafe fn C_CancelFunction(&self, session: CK_SESSION_HANDLE) -> CK_RV { + pub unsafe fn C_CancelFunction(&self, hSession: CK_SESSION_HANDLE) -> CK_RV { (self .C_CancelFunction .as_ref() - .expect("Expected function, got error."))(session) + .expect("Expected function, got error."))(hSession) + } + pub unsafe fn C_WaitForSlotEvent( + &self, + flags: CK_FLAGS, + pSlot: CK_SLOT_ID_PTR, + pRserved: CK_VOID_PTR, + ) -> CK_RV { + (self + .C_WaitForSlotEvent + .as_ref() + .expect("Expected function, got error."))(flags, pSlot, pRserved) + } + pub unsafe fn C_GetInterfaceList( + &self, + pInterfacesList: CK_INTERFACE_PTR, + pulCount: CK_ULONG_PTR, + ) -> CK_RV { + (self + .C_GetInterfaceList + .as_ref() + .expect("Expected function, got error."))(pInterfacesList, pulCount) + } + pub unsafe fn C_GetInterface( + &self, + pInterfaceName: CK_UTF8CHAR_PTR, + pVersion: CK_VERSION_PTR, + ppInterface: CK_INTERFACE_PTR_PTR, + flags: CK_FLAGS, + ) -> CK_RV { + (self + .C_GetInterface + .as_ref() + .expect("Expected function, got error."))( + pInterfaceName, pVersion, ppInterface, flags + ) + } + pub unsafe fn C_LoginUser( + &self, + hSession: CK_SESSION_HANDLE, + userType: CK_USER_TYPE, + pPin: CK_UTF8CHAR_PTR, + ulPinLen: CK_ULONG, + pUsername: CK_UTF8CHAR_PTR, + ulUsernameLen: CK_ULONG, + ) -> CK_RV { + (self + .C_LoginUser + .as_ref() + .expect("Expected function, got error."))( + hSession, + userType, + pPin, + ulPinLen, + pUsername, + ulUsernameLen, + ) + } + pub unsafe fn C_SessionCancel(&self, hSession: CK_SESSION_HANDLE, flags: CK_FLAGS) -> CK_RV { + (self + .C_SessionCancel + .as_ref() + .expect("Expected function, got error."))(hSession, flags) + } + pub unsafe fn C_MessageEncryptInit( + &self, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, + ) -> CK_RV { + (self + .C_MessageEncryptInit + .as_ref() + .expect("Expected function, got error."))(hSession, pMechanism, hKey) + } + pub unsafe fn C_EncryptMessage( + &self, + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pAssociatedData: CK_BYTE_PTR, + ulAssociatedDataLen: CK_ULONG, + pPlaintext: CK_BYTE_PTR, + ulPlaintextLen: CK_ULONG, + pCiphertext: CK_BYTE_PTR, + pulCiphertextLen: CK_ULONG_PTR, + ) -> CK_RV { + (self + .C_EncryptMessage + .as_ref() + .expect("Expected function, got error."))( + hSession, + pParameter, + ulParameterLen, + pAssociatedData, + ulAssociatedDataLen, + pPlaintext, + ulPlaintextLen, + pCiphertext, + pulCiphertextLen, + ) + } + pub unsafe fn C_EncryptMessageBegin( + &self, + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pAssociatedData: CK_BYTE_PTR, + ulAssociatedDataLen: CK_ULONG, + ) -> CK_RV { + (self + .C_EncryptMessageBegin + .as_ref() + .expect("Expected function, got error."))( + hSession, + pParameter, + ulParameterLen, + pAssociatedData, + ulAssociatedDataLen, + ) + } + pub unsafe fn C_EncryptMessageNext( + &self, + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pPlaintextPart: CK_BYTE_PTR, + ulPlaintextPartLen: CK_ULONG, + pCiphertextPart: CK_BYTE_PTR, + pulCiphertextPartLen: CK_ULONG_PTR, + flags: CK_FLAGS, + ) -> CK_RV { + (self + .C_EncryptMessageNext + .as_ref() + .expect("Expected function, got error."))( + hSession, + pParameter, + ulParameterLen, + pPlaintextPart, + ulPlaintextPartLen, + pCiphertextPart, + pulCiphertextPartLen, + flags, + ) + } + pub unsafe fn C_MessageEncryptFinal(&self, hSession: CK_SESSION_HANDLE) -> CK_RV { + (self + .C_MessageEncryptFinal + .as_ref() + .expect("Expected function, got error."))(hSession) + } + pub unsafe fn C_MessageDecryptInit( + &self, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, + ) -> CK_RV { + (self + .C_MessageDecryptInit + .as_ref() + .expect("Expected function, got error."))(hSession, pMechanism, hKey) + } + pub unsafe fn C_DecryptMessage( + &self, + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pAssociatedData: CK_BYTE_PTR, + ulAssociatedDataLen: CK_ULONG, + pCiphertext: CK_BYTE_PTR, + ulCiphertextLen: CK_ULONG, + pPlaintext: CK_BYTE_PTR, + pulPlaintextLen: CK_ULONG_PTR, + ) -> CK_RV { + (self + .C_DecryptMessage + .as_ref() + .expect("Expected function, got error."))( + hSession, + pParameter, + ulParameterLen, + pAssociatedData, + ulAssociatedDataLen, + pCiphertext, + ulCiphertextLen, + pPlaintext, + pulPlaintextLen, + ) + } + pub unsafe fn C_DecryptMessageBegin( + &self, + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pAssociatedData: CK_BYTE_PTR, + ulAssociatedDataLen: CK_ULONG, + ) -> CK_RV { + (self + .C_DecryptMessageBegin + .as_ref() + .expect("Expected function, got error."))( + hSession, + pParameter, + ulParameterLen, + pAssociatedData, + ulAssociatedDataLen, + ) + } + pub unsafe fn C_DecryptMessageNext( + &self, + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pCiphertext: CK_BYTE_PTR, + ulCiphertextLen: CK_ULONG, + pPlaintext: CK_BYTE_PTR, + pulPlaintextLen: CK_ULONG_PTR, + flags: CK_FLAGS, + ) -> CK_RV { + (self + .C_DecryptMessageNext + .as_ref() + .expect("Expected function, got error."))( + hSession, + pParameter, + ulParameterLen, + pCiphertext, + ulCiphertextLen, + pPlaintext, + pulPlaintextLen, + flags, + ) + } + pub unsafe fn C_MessageDecryptFinal(&self, hSession: CK_SESSION_HANDLE) -> CK_RV { + (self + .C_MessageDecryptFinal + .as_ref() + .expect("Expected function, got error."))(hSession) + } + pub unsafe fn C_MessageSignInit( + &self, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, + ) -> CK_RV { + (self + .C_MessageSignInit + .as_ref() + .expect("Expected function, got error."))(hSession, pMechanism, hKey) + } + pub unsafe fn C_SignMessage( + &self, + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + pulSignatureLen: CK_ULONG_PTR, + ) -> CK_RV { + (self + .C_SignMessage + .as_ref() + .expect("Expected function, got error."))( + hSession, + pParameter, + ulParameterLen, + pData, + ulDataLen, + pSignature, + pulSignatureLen, + ) + } + pub unsafe fn C_SignMessageBegin( + &self, + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + ) -> CK_RV { + (self + .C_SignMessageBegin + .as_ref() + .expect("Expected function, got error."))(hSession, pParameter, ulParameterLen) + } + pub unsafe fn C_SignMessageNext( + &self, + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + pulSignatureLen: CK_ULONG_PTR, + ) -> CK_RV { + (self + .C_SignMessageNext + .as_ref() + .expect("Expected function, got error."))( + hSession, + pParameter, + ulParameterLen, + pData, + ulDataLen, + pSignature, + pulSignatureLen, + ) + } + pub unsafe fn C_MessageSignFinal(&self, hSession: CK_SESSION_HANDLE) -> CK_RV { + (self + .C_MessageSignFinal + .as_ref() + .expect("Expected function, got error."))(hSession) + } + pub unsafe fn C_MessageVerifyInit( + &self, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, + ) -> CK_RV { + (self + .C_MessageVerifyInit + .as_ref() + .expect("Expected function, got error."))(hSession, pMechanism, hKey) + } + pub unsafe fn C_VerifyMessage( + &self, + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + ulSignatureLen: CK_ULONG, + ) -> CK_RV { + (self + .C_VerifyMessage + .as_ref() + .expect("Expected function, got error."))( + hSession, + pParameter, + ulParameterLen, + pData, + ulDataLen, + pSignature, + ulSignatureLen, + ) + } + pub unsafe fn C_VerifyMessageBegin( + &self, + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + ) -> CK_RV { + (self + .C_VerifyMessageBegin + .as_ref() + .expect("Expected function, got error."))(hSession, pParameter, ulParameterLen) + } + pub unsafe fn C_VerifyMessageNext( + &self, + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + ulSignatureLen: CK_ULONG, + ) -> CK_RV { + (self + .C_VerifyMessageNext + .as_ref() + .expect("Expected function, got error."))( + hSession, + pParameter, + ulParameterLen, + pData, + ulDataLen, + pSignature, + ulSignatureLen, + ) + } + pub unsafe fn C_MessageVerifyFinal(&self, hSession: CK_SESSION_HANDLE) -> CK_RV { + (self + .C_MessageVerifyFinal + .as_ref() + .expect("Expected function, got error."))(hSession) } } diff --git a/cryptoki-sys/src/bindings/x86_64-apple-darwin.rs b/cryptoki-sys/src/bindings/x86_64-apple-darwin.rs index 6800365c..c4200fb4 100644 --- a/cryptoki-sys/src/bindings/x86_64-apple-darwin.rs +++ b/cryptoki-sys/src/bindings/x86_64-apple-darwin.rs @@ -1,10 +1,22 @@ /* automatically generated by rust-bindgen 0.63.0 */ -pub const PKCS11_H: u32 = 1; -pub const CRYPTOKI_VERSION_MAJOR: CK_BYTE = 2; -pub const CRYPTOKI_VERSION_MINOR: CK_BYTE = 40; -pub const P11_KIT_CRYPTOKI_VERSION_REVISION: u32 = 0; -pub const CRYPTOKI_COMPAT: u32 = 1; +pub const NULL_PTR: u32 = 0; +pub const _PKCS11_H_: u32 = 1; +pub const _PKCS11T_H_: u32 = 1; +pub const CRYPTOKI_VERSION_MAJOR: CK_BYTE = 3; +pub const CRYPTOKI_VERSION_MINOR: CK_BYTE = 0; +pub const CRYPTOKI_VERSION_AMENDMENT: CK_BYTE = 0; +pub const CK_TRUE: CK_BBOOL = 1; +pub const CK_FALSE: CK_BBOOL = 0; +pub const FALSE: u32 = 0; +pub const TRUE: u32 = 1; +pub const CK_EFFECTIVELY_INFINITE: CK_ULONG = 0; +pub const CK_INVALID_HANDLE: CK_ULONG = 0; +pub const CKN_SURRENDER: CK_NOTIFICATION = 0; +pub const CKN_OTP_CHANGED: CK_NOTIFICATION = 1; +pub const CKF_TOKEN_PRESENT: CK_FLAGS = 1; +pub const CKF_REMOVABLE_DEVICE: CK_FLAGS = 2; +pub const CKF_HW_SLOT: CK_FLAGS = 4; pub const CKF_RNG: CK_FLAGS = 1; pub const CKF_WRITE_PROTECTED: CK_FLAGS = 2; pub const CKF_LOGIN_REQUIRED: CK_FLAGS = 4; @@ -24,8 +36,6 @@ pub const CKF_SO_PIN_FINAL_TRY: CK_FLAGS = 2097152; pub const CKF_SO_PIN_LOCKED: CK_FLAGS = 4194304; pub const CKF_SO_PIN_TO_BE_CHANGED: CK_FLAGS = 8388608; pub const CKF_ERROR_STATE: CK_FLAGS = 16777216; -pub const CK_EFFECTIVELY_INFINITE: CK_ULONG = 0; -pub const CK_INVALID_HANDLE: CK_ULONG = 0; pub const CKU_SO: CK_USER_TYPE = 0; pub const CKU_USER: CK_USER_TYPE = 1; pub const CKU_CONTEXT_SPECIFIC: CK_USER_TYPE = 2; @@ -45,9 +55,18 @@ pub const CKO_HW_FEATURE: CK_OBJECT_CLASS = 5; pub const CKO_DOMAIN_PARAMETERS: CK_OBJECT_CLASS = 6; pub const CKO_MECHANISM: CK_OBJECT_CLASS = 7; pub const CKO_OTP_KEY: CK_OBJECT_CLASS = 8; +pub const CKO_PROFILE: CK_OBJECT_CLASS = 9; +pub const CKO_VENDOR_DEFINED: CK_OBJECT_CLASS = 2147483648; +pub const CKP_INVALID_ID: CK_PROFILE_ID = 0; +pub const CKP_BASELINE_PROVIDER: CK_PROFILE_ID = 1; +pub const CKP_EXTENDED_PROVIDER: CK_PROFILE_ID = 2; +pub const CKP_AUTHENTICATION_TOKEN: CK_PROFILE_ID = 3; +pub const CKP_PUBLIC_CERTIFICATES_TOKEN: CK_PROFILE_ID = 4; +pub const CKP_VENDOR_DEFINED: CK_PROFILE_ID = 2147483648; pub const CKH_MONOTONIC_COUNTER: CK_HW_FEATURE_TYPE = 1; pub const CKH_CLOCK: CK_HW_FEATURE_TYPE = 2; pub const CKH_USER_INTERFACE: CK_HW_FEATURE_TYPE = 3; +pub const CKH_VENDOR_DEFINED: CK_HW_FEATURE_TYPE = 2147483648; pub const CKK_RSA: CK_KEY_TYPE = 0; pub const CKK_DSA: CK_KEY_TYPE = 1; pub const CKK_DH: CK_KEY_TYPE = 2; @@ -63,6 +82,7 @@ pub const CKK_DES2: CK_KEY_TYPE = 20; pub const CKK_DES3: CK_KEY_TYPE = 21; pub const CKK_CAST: CK_KEY_TYPE = 22; pub const CKK_CAST3: CK_KEY_TYPE = 23; +pub const CKK_CAST5: CK_KEY_TYPE = 24; pub const CKK_CAST128: CK_KEY_TYPE = 24; pub const CKK_RC5: CK_KEY_TYPE = 25; pub const CKK_IDEA: CK_KEY_TYPE = 26; @@ -90,14 +110,48 @@ pub const CKK_SEED: CK_KEY_TYPE = 47; pub const CKK_GOSTR3410: CK_KEY_TYPE = 48; pub const CKK_GOSTR3411: CK_KEY_TYPE = 49; pub const CKK_GOST28147: CK_KEY_TYPE = 50; +pub const CKK_CHACHA20: CK_KEY_TYPE = 51; +pub const CKK_POLY1305: CK_KEY_TYPE = 52; +pub const CKK_AES_XTS: CK_KEY_TYPE = 53; +pub const CKK_SHA3_224_HMAC: CK_KEY_TYPE = 54; +pub const CKK_SHA3_256_HMAC: CK_KEY_TYPE = 55; +pub const CKK_SHA3_384_HMAC: CK_KEY_TYPE = 56; +pub const CKK_SHA3_512_HMAC: CK_KEY_TYPE = 57; +pub const CKK_BLAKE2B_160_HMAC: CK_KEY_TYPE = 58; +pub const CKK_BLAKE2B_256_HMAC: CK_KEY_TYPE = 59; +pub const CKK_BLAKE2B_384_HMAC: CK_KEY_TYPE = 60; +pub const CKK_BLAKE2B_512_HMAC: CK_KEY_TYPE = 61; +pub const CKK_SALSA20: CK_KEY_TYPE = 62; +pub const CKK_X2RATCHET: CK_KEY_TYPE = 63; pub const CKK_EC_EDWARDS: CK_KEY_TYPE = 64; +pub const CKK_EC_MONTGOMERY: CK_KEY_TYPE = 65; +pub const CKK_HKDF: CK_KEY_TYPE = 66; +pub const CKK_VENDOR_DEFINED: CK_KEY_TYPE = 2147483648; +pub const CK_CERTIFICATE_CATEGORY_UNSPECIFIED: CK_ULONG = 0; +pub const CK_CERTIFICATE_CATEGORY_TOKEN_USER: CK_ULONG = 1; +pub const CK_CERTIFICATE_CATEGORY_AUTHORITY: CK_ULONG = 2; +pub const CK_CERTIFICATE_CATEGORY_OTHER_ENTITY: CK_ULONG = 3; +pub const CK_SECURITY_DOMAIN_UNSPECIFIED: CK_ULONG = 0; +pub const CK_SECURITY_DOMAIN_MANUFACTURER: CK_ULONG = 1; +pub const CK_SECURITY_DOMAIN_OPERATOR: CK_ULONG = 2; +pub const CK_SECURITY_DOMAIN_THIRD_PARTY: CK_ULONG = 3; pub const CKC_X_509: CK_CERTIFICATE_TYPE = 0; pub const CKC_X_509_ATTR_CERT: CK_CERTIFICATE_TYPE = 1; pub const CKC_WTLS: CK_CERTIFICATE_TYPE = 2; +pub const CKC_VENDOR_DEFINED: CK_CERTIFICATE_TYPE = 2147483648; +pub const CKF_ARRAY_ATTRIBUTE: CK_FLAGS = 1073741824; +pub const CK_OTP_FORMAT_DECIMAL: CK_ULONG = 0; +pub const CK_OTP_FORMAT_HEXADECIMAL: CK_ULONG = 1; +pub const CK_OTP_FORMAT_ALPHANUMERIC: CK_ULONG = 2; +pub const CK_OTP_FORMAT_BINARY: CK_ULONG = 3; +pub const CK_OTP_PARAM_IGNORED: CK_ULONG = 0; +pub const CK_OTP_PARAM_OPTIONAL: CK_ULONG = 1; +pub const CK_OTP_PARAM_MANDATORY: CK_ULONG = 2; pub const CKA_CLASS: CK_ATTRIBUTE_TYPE = 0; pub const CKA_TOKEN: CK_ATTRIBUTE_TYPE = 1; pub const CKA_PRIVATE: CK_ATTRIBUTE_TYPE = 2; pub const CKA_LABEL: CK_ATTRIBUTE_TYPE = 3; +pub const CKA_UNIQUE_ID: CK_ATTRIBUTE_TYPE = 4; pub const CKA_APPLICATION: CK_ATTRIBUTE_TYPE = 16; pub const CKA_VALUE: CK_ATTRIBUTE_TYPE = 17; pub const CKA_OBJECT_ID: CK_ATTRIBUTE_TYPE = 18; @@ -144,6 +198,7 @@ pub const CKA_PRIME: CK_ATTRIBUTE_TYPE = 304; pub const CKA_SUBPRIME: CK_ATTRIBUTE_TYPE = 305; pub const CKA_BASE: CK_ATTRIBUTE_TYPE = 306; pub const CKA_PRIME_BITS: CK_ATTRIBUTE_TYPE = 307; +pub const CKA_SUBPRIME_BITS: CK_ATTRIBUTE_TYPE = 308; pub const CKA_SUB_PRIME_BITS: CK_ATTRIBUTE_TYPE = 308; pub const CKA_VALUE_BITS: CK_ATTRIBUTE_TYPE = 352; pub const CKA_VALUE_LEN: CK_ATTRIBUTE_TYPE = 353; @@ -162,6 +217,9 @@ pub const CKA_SECONDARY_AUTH: CK_ATTRIBUTE_TYPE = 512; pub const CKA_AUTH_PIN_FLAGS: CK_ATTRIBUTE_TYPE = 513; pub const CKA_ALWAYS_AUTHENTICATE: CK_ATTRIBUTE_TYPE = 514; pub const CKA_WRAP_WITH_TRUSTED: CK_ATTRIBUTE_TYPE = 528; +pub const CKA_WRAP_TEMPLATE: CK_ATTRIBUTE_TYPE = 1073742353; +pub const CKA_UNWRAP_TEMPLATE: CK_ATTRIBUTE_TYPE = 1073742354; +pub const CKA_DERIVE_TEMPLATE: CK_ATTRIBUTE_TYPE = 1073742355; pub const CKA_OTP_FORMAT: CK_ATTRIBUTE_TYPE = 544; pub const CKA_OTP_LENGTH: CK_ATTRIBUTE_TYPE = 545; pub const CKA_OTP_TIME_INTERVAL: CK_ATTRIBUTE_TYPE = 546; @@ -170,12 +228,12 @@ pub const CKA_OTP_CHALLENGE_REQUIREMENT: CK_ATTRIBUTE_TYPE = 548; pub const CKA_OTP_TIME_REQUIREMENT: CK_ATTRIBUTE_TYPE = 549; pub const CKA_OTP_COUNTER_REQUIREMENT: CK_ATTRIBUTE_TYPE = 550; pub const CKA_OTP_PIN_REQUIREMENT: CK_ATTRIBUTE_TYPE = 551; +pub const CKA_OTP_COUNTER: CK_ATTRIBUTE_TYPE = 558; +pub const CKA_OTP_TIME: CK_ATTRIBUTE_TYPE = 559; pub const CKA_OTP_USER_IDENTIFIER: CK_ATTRIBUTE_TYPE = 554; pub const CKA_OTP_SERVICE_IDENTIFIER: CK_ATTRIBUTE_TYPE = 555; pub const CKA_OTP_SERVICE_LOGO: CK_ATTRIBUTE_TYPE = 556; pub const CKA_OTP_SERVICE_LOGO_TYPE: CK_ATTRIBUTE_TYPE = 557; -pub const CKA_OTP_COUNTER: CK_ATTRIBUTE_TYPE = 558; -pub const CKA_OTP_TIME: CK_ATTRIBUTE_TYPE = 559; pub const CKA_GOSTR3410_PARAMS: CK_ATTRIBUTE_TYPE = 592; pub const CKA_GOSTR3411_PARAMS: CK_ATTRIBUTE_TYPE = 593; pub const CKA_GOST28147_PARAMS: CK_ATTRIBUTE_TYPE = 594; @@ -196,6 +254,9 @@ pub const CKA_MECHANISM_TYPE: CK_ATTRIBUTE_TYPE = 1280; pub const CKA_REQUIRED_CMS_ATTRIBUTES: CK_ATTRIBUTE_TYPE = 1281; pub const CKA_DEFAULT_CMS_ATTRIBUTES: CK_ATTRIBUTE_TYPE = 1282; pub const CKA_SUPPORTED_CMS_ATTRIBUTES: CK_ATTRIBUTE_TYPE = 1283; +pub const CKA_ALLOWED_MECHANISMS: CK_ATTRIBUTE_TYPE = 1073743360; +pub const CKA_PROFILE_ID: CK_ATTRIBUTE_TYPE = 1537; +pub const CKA_VENDOR_DEFINED: CK_ATTRIBUTE_TYPE = 2147483648; pub const CKM_RSA_PKCS_KEY_PAIR_GEN: CK_MECHANISM_TYPE = 0; pub const CKM_RSA_PKCS: CK_MECHANISM_TYPE = 1; pub const CKM_RSA_9796: CK_MECHANISM_TYPE = 2; @@ -218,6 +279,10 @@ pub const CKM_DSA_SHA224: CK_MECHANISM_TYPE = 19; pub const CKM_DSA_SHA256: CK_MECHANISM_TYPE = 20; pub const CKM_DSA_SHA384: CK_MECHANISM_TYPE = 21; pub const CKM_DSA_SHA512: CK_MECHANISM_TYPE = 22; +pub const CKM_DSA_SHA3_224: CK_MECHANISM_TYPE = 24; +pub const CKM_DSA_SHA3_256: CK_MECHANISM_TYPE = 25; +pub const CKM_DSA_SHA3_384: CK_MECHANISM_TYPE = 26; +pub const CKM_DSA_SHA3_512: CK_MECHANISM_TYPE = 27; pub const CKM_DH_PKCS_KEY_PAIR_GEN: CK_MECHANISM_TYPE = 32; pub const CKM_DH_PKCS_DERIVE: CK_MECHANISM_TYPE = 33; pub const CKM_X9_42_DH_KEY_PAIR_GEN: CK_MECHANISM_TYPE = 48; @@ -230,6 +295,8 @@ pub const CKM_SHA512_RSA_PKCS: CK_MECHANISM_TYPE = 66; pub const CKM_SHA256_RSA_PKCS_PSS: CK_MECHANISM_TYPE = 67; pub const CKM_SHA384_RSA_PKCS_PSS: CK_MECHANISM_TYPE = 68; pub const CKM_SHA512_RSA_PKCS_PSS: CK_MECHANISM_TYPE = 69; +pub const CKM_SHA224_RSA_PKCS: CK_MECHANISM_TYPE = 70; +pub const CKM_SHA224_RSA_PKCS_PSS: CK_MECHANISM_TYPE = 71; pub const CKM_SHA512_224: CK_MECHANISM_TYPE = 72; pub const CKM_SHA512_224_HMAC: CK_MECHANISM_TYPE = 73; pub const CKM_SHA512_224_HMAC_GENERAL: CK_MECHANISM_TYPE = 74; @@ -242,6 +309,14 @@ pub const CKM_SHA512_T: CK_MECHANISM_TYPE = 80; pub const CKM_SHA512_T_HMAC: CK_MECHANISM_TYPE = 81; pub const CKM_SHA512_T_HMAC_GENERAL: CK_MECHANISM_TYPE = 82; pub const CKM_SHA512_T_KEY_DERIVATION: CK_MECHANISM_TYPE = 83; +pub const CKM_SHA3_256_RSA_PKCS: CK_MECHANISM_TYPE = 96; +pub const CKM_SHA3_384_RSA_PKCS: CK_MECHANISM_TYPE = 97; +pub const CKM_SHA3_512_RSA_PKCS: CK_MECHANISM_TYPE = 98; +pub const CKM_SHA3_256_RSA_PKCS_PSS: CK_MECHANISM_TYPE = 99; +pub const CKM_SHA3_384_RSA_PKCS_PSS: CK_MECHANISM_TYPE = 100; +pub const CKM_SHA3_512_RSA_PKCS_PSS: CK_MECHANISM_TYPE = 101; +pub const CKM_SHA3_224_RSA_PKCS: CK_MECHANISM_TYPE = 102; +pub const CKM_SHA3_224_RSA_PKCS_PSS: CK_MECHANISM_TYPE = 103; pub const CKM_RC2_KEY_GEN: CK_MECHANISM_TYPE = 256; pub const CKM_RC2_ECB: CK_MECHANISM_TYPE = 257; pub const CKM_RC2_CBC: CK_MECHANISM_TYPE = 258; @@ -293,6 +368,9 @@ pub const CKM_RIPEMD160_HMAC_GENERAL: CK_MECHANISM_TYPE = 578; pub const CKM_SHA256: CK_MECHANISM_TYPE = 592; pub const CKM_SHA256_HMAC: CK_MECHANISM_TYPE = 593; pub const CKM_SHA256_HMAC_GENERAL: CK_MECHANISM_TYPE = 594; +pub const CKM_SHA224: CK_MECHANISM_TYPE = 597; +pub const CKM_SHA224_HMAC: CK_MECHANISM_TYPE = 598; +pub const CKM_SHA224_HMAC_GENERAL: CK_MECHANISM_TYPE = 599; pub const CKM_SHA384: CK_MECHANISM_TYPE = 608; pub const CKM_SHA384_HMAC: CK_MECHANISM_TYPE = 609; pub const CKM_SHA384_HMAC_GENERAL: CK_MECHANISM_TYPE = 610; @@ -305,6 +383,22 @@ pub const CKM_HOTP_KEY_GEN: CK_MECHANISM_TYPE = 656; pub const CKM_HOTP: CK_MECHANISM_TYPE = 657; pub const CKM_ACTI: CK_MECHANISM_TYPE = 672; pub const CKM_ACTI_KEY_GEN: CK_MECHANISM_TYPE = 673; +pub const CKM_SHA3_256: CK_MECHANISM_TYPE = 688; +pub const CKM_SHA3_256_HMAC: CK_MECHANISM_TYPE = 689; +pub const CKM_SHA3_256_HMAC_GENERAL: CK_MECHANISM_TYPE = 690; +pub const CKM_SHA3_256_KEY_GEN: CK_MECHANISM_TYPE = 691; +pub const CKM_SHA3_224: CK_MECHANISM_TYPE = 693; +pub const CKM_SHA3_224_HMAC: CK_MECHANISM_TYPE = 694; +pub const CKM_SHA3_224_HMAC_GENERAL: CK_MECHANISM_TYPE = 695; +pub const CKM_SHA3_224_KEY_GEN: CK_MECHANISM_TYPE = 696; +pub const CKM_SHA3_384: CK_MECHANISM_TYPE = 704; +pub const CKM_SHA3_384_HMAC: CK_MECHANISM_TYPE = 705; +pub const CKM_SHA3_384_HMAC_GENERAL: CK_MECHANISM_TYPE = 706; +pub const CKM_SHA3_384_KEY_GEN: CK_MECHANISM_TYPE = 707; +pub const CKM_SHA3_512: CK_MECHANISM_TYPE = 720; +pub const CKM_SHA3_512_HMAC: CK_MECHANISM_TYPE = 721; +pub const CKM_SHA3_512_HMAC_GENERAL: CK_MECHANISM_TYPE = 722; +pub const CKM_SHA3_512_KEY_GEN: CK_MECHANISM_TYPE = 723; pub const CKM_CAST_KEY_GEN: CK_MECHANISM_TYPE = 768; pub const CKM_CAST_ECB: CK_MECHANISM_TYPE = 769; pub const CKM_CAST_CBC: CK_MECHANISM_TYPE = 770; @@ -364,6 +458,13 @@ pub const CKM_SHA1_KEY_DERIVATION: CK_MECHANISM_TYPE = 914; pub const CKM_SHA256_KEY_DERIVATION: CK_MECHANISM_TYPE = 915; pub const CKM_SHA384_KEY_DERIVATION: CK_MECHANISM_TYPE = 916; pub const CKM_SHA512_KEY_DERIVATION: CK_MECHANISM_TYPE = 917; +pub const CKM_SHA224_KEY_DERIVATION: CK_MECHANISM_TYPE = 918; +pub const CKM_SHA3_256_KEY_DERIVE: CK_MECHANISM_TYPE = 919; +pub const CKM_SHA3_224_KEY_DERIVE: CK_MECHANISM_TYPE = 920; +pub const CKM_SHA3_384_KEY_DERIVE: CK_MECHANISM_TYPE = 921; +pub const CKM_SHA3_512_KEY_DERIVE: CK_MECHANISM_TYPE = 922; +pub const CKM_SHAKE_128_KEY_DERIVE: CK_MECHANISM_TYPE = 923; +pub const CKM_SHAKE_256_KEY_DERIVE: CK_MECHANISM_TYPE = 924; pub const CKM_PBE_MD2_DES_CBC: CK_MECHANISM_TYPE = 928; pub const CKM_PBE_MD5_DES_CBC: CK_MECHANISM_TYPE = 929; pub const CKM_PBE_MD5_CAST_CBC: CK_MECHANISM_TYPE = 930; @@ -403,6 +504,13 @@ pub const CKM_KIP_DERIVE: CK_MECHANISM_TYPE = 1296; pub const CKM_KIP_WRAP: CK_MECHANISM_TYPE = 1297; pub const CKM_KIP_MAC: CK_MECHANISM_TYPE = 1298; pub const CKM_CAMELLIA_KEY_GEN: CK_MECHANISM_TYPE = 1360; +pub const CKM_CAMELLIA_ECB: CK_MECHANISM_TYPE = 1361; +pub const CKM_CAMELLIA_CBC: CK_MECHANISM_TYPE = 1362; +pub const CKM_CAMELLIA_MAC: CK_MECHANISM_TYPE = 1363; +pub const CKM_CAMELLIA_MAC_GENERAL: CK_MECHANISM_TYPE = 1364; +pub const CKM_CAMELLIA_CBC_PAD: CK_MECHANISM_TYPE = 1365; +pub const CKM_CAMELLIA_ECB_ENCRYPT_DATA: CK_MECHANISM_TYPE = 1366; +pub const CKM_CAMELLIA_CBC_ENCRYPT_DATA: CK_MECHANISM_TYPE = 1367; pub const CKM_CAMELLIA_CTR: CK_MECHANISM_TYPE = 1368; pub const CKM_ARIA_KEY_GEN: CK_MECHANISM_TYPE = 1376; pub const CKM_ARIA_ECB: CK_MECHANISM_TYPE = 1377; @@ -433,6 +541,7 @@ pub const CKM_SKIPJACK_PRIVATE_WRAP: CK_MECHANISM_TYPE = 4105; pub const CKM_SKIPJACK_RELAYX: CK_MECHANISM_TYPE = 4106; pub const CKM_KEA_KEY_PAIR_GEN: CK_MECHANISM_TYPE = 4112; pub const CKM_KEA_KEY_DERIVE: CK_MECHANISM_TYPE = 4113; +pub const CKM_KEA_DERIVE: CK_MECHANISM_TYPE = 4114; pub const CKM_FORTEZZA_TIMESTAMP: CK_MECHANISM_TYPE = 4128; pub const CKM_BATON_KEY_GEN: CK_MECHANISM_TYPE = 4144; pub const CKM_BATON_ECB128: CK_MECHANISM_TYPE = 4145; @@ -461,6 +570,8 @@ pub const CKM_JUNIPER_COUNTER: CK_MECHANISM_TYPE = 4195; pub const CKM_JUNIPER_SHUFFLE: CK_MECHANISM_TYPE = 4196; pub const CKM_JUNIPER_WRAP: CK_MECHANISM_TYPE = 4197; pub const CKM_FASTHASH: CK_MECHANISM_TYPE = 4208; +pub const CKM_AES_XTS: CK_MECHANISM_TYPE = 4209; +pub const CKM_AES_XTS_KEY_GEN: CK_MECHANISM_TYPE = 4210; pub const CKM_AES_KEY_GEN: CK_MECHANISM_TYPE = 4224; pub const CKM_AES_ECB: CK_MECHANISM_TYPE = 4225; pub const CKM_AES_CBC: CK_MECHANISM_TYPE = 4226; @@ -500,6 +611,10 @@ pub const CKM_GOST28147_ECB: CK_MECHANISM_TYPE = 4641; pub const CKM_GOST28147: CK_MECHANISM_TYPE = 4642; pub const CKM_GOST28147_MAC: CK_MECHANISM_TYPE = 4643; pub const CKM_GOST28147_KEY_WRAP: CK_MECHANISM_TYPE = 4644; +pub const CKM_CHACHA20_KEY_GEN: CK_MECHANISM_TYPE = 4645; +pub const CKM_CHACHA20: CK_MECHANISM_TYPE = 4646; +pub const CKM_POLY1305_KEY_GEN: CK_MECHANISM_TYPE = 4647; +pub const CKM_POLY1305: CK_MECHANISM_TYPE = 4648; pub const CKM_DSA_PARAMETER_GEN: CK_MECHANISM_TYPE = 8192; pub const CKM_DH_PKCS_PARAMETER_GEN: CK_MECHANISM_TYPE = 8193; pub const CKM_X9_42_DH_PARAMETER_GEN: CK_MECHANISM_TYPE = 8194; @@ -510,63 +625,71 @@ pub const CKM_AES_CFB64: CK_MECHANISM_TYPE = 8453; pub const CKM_AES_CFB8: CK_MECHANISM_TYPE = 8454; pub const CKM_AES_CFB128: CK_MECHANISM_TYPE = 8455; pub const CKM_AES_CFB1: CK_MECHANISM_TYPE = 8456; -pub const CKM_SHA224: CK_MECHANISM_TYPE = 597; -pub const CKM_SHA224_HMAC: CK_MECHANISM_TYPE = 598; -pub const CKM_SHA224_HMAC_GENERAL: CK_MECHANISM_TYPE = 599; -pub const CKM_SHA224_RSA_PKCS: CK_MECHANISM_TYPE = 70; -pub const CKM_SHA224_RSA_PKCS_PSS: CK_MECHANISM_TYPE = 71; -pub const CKM_SHA224_KEY_DERIVATION: CK_MECHANISM_TYPE = 918; -pub const CKM_CAMELLIA_ECB: CK_MECHANISM_TYPE = 1361; -pub const CKM_CAMELLIA_CBC: CK_MECHANISM_TYPE = 1362; -pub const CKM_CAMELLIA_MAC: CK_MECHANISM_TYPE = 1363; -pub const CKM_CAMELLIA_MAC_GENERAL: CK_MECHANISM_TYPE = 1364; -pub const CKM_CAMELLIA_CBC_PAD: CK_MECHANISM_TYPE = 1365; -pub const CKM_CAMELLIA_ECB_ENCRYPT_DATA: CK_MECHANISM_TYPE = 1366; -pub const CKM_CAMELLIA_CBC_ENCRYPT_DATA: CK_MECHANISM_TYPE = 1367; pub const CKM_AES_KEY_WRAP: CK_MECHANISM_TYPE = 8457; pub const CKM_AES_KEY_WRAP_PAD: CK_MECHANISM_TYPE = 8458; +pub const CKM_AES_KEY_WRAP_KWP: CK_MECHANISM_TYPE = 8459; pub const CKM_RSA_PKCS_TPM_1_1: CK_MECHANISM_TYPE = 16385; pub const CKM_RSA_PKCS_OAEP_TPM_1_1: CK_MECHANISM_TYPE = 16386; +pub const CKM_SHA_1_KEY_GEN: CK_MECHANISM_TYPE = 16387; +pub const CKM_SHA224_KEY_GEN: CK_MECHANISM_TYPE = 16388; +pub const CKM_SHA256_KEY_GEN: CK_MECHANISM_TYPE = 16389; +pub const CKM_SHA384_KEY_GEN: CK_MECHANISM_TYPE = 16390; +pub const CKM_SHA512_KEY_GEN: CK_MECHANISM_TYPE = 16391; +pub const CKM_SHA512_224_KEY_GEN: CK_MECHANISM_TYPE = 16392; +pub const CKM_SHA512_256_KEY_GEN: CK_MECHANISM_TYPE = 16393; +pub const CKM_SHA512_T_KEY_GEN: CK_MECHANISM_TYPE = 16394; +pub const CKM_NULL: CK_MECHANISM_TYPE = 16395; +pub const CKM_BLAKE2B_160: CK_MECHANISM_TYPE = 16396; +pub const CKM_BLAKE2B_160_HMAC: CK_MECHANISM_TYPE = 16397; +pub const CKM_BLAKE2B_160_HMAC_GENERAL: CK_MECHANISM_TYPE = 16398; +pub const CKM_BLAKE2B_160_KEY_DERIVE: CK_MECHANISM_TYPE = 16399; +pub const CKM_BLAKE2B_160_KEY_GEN: CK_MECHANISM_TYPE = 16400; +pub const CKM_BLAKE2B_256: CK_MECHANISM_TYPE = 16401; +pub const CKM_BLAKE2B_256_HMAC: CK_MECHANISM_TYPE = 16402; +pub const CKM_BLAKE2B_256_HMAC_GENERAL: CK_MECHANISM_TYPE = 16403; +pub const CKM_BLAKE2B_256_KEY_DERIVE: CK_MECHANISM_TYPE = 16404; +pub const CKM_BLAKE2B_256_KEY_GEN: CK_MECHANISM_TYPE = 16405; +pub const CKM_BLAKE2B_384: CK_MECHANISM_TYPE = 16406; +pub const CKM_BLAKE2B_384_HMAC: CK_MECHANISM_TYPE = 16407; +pub const CKM_BLAKE2B_384_HMAC_GENERAL: CK_MECHANISM_TYPE = 16408; +pub const CKM_BLAKE2B_384_KEY_DERIVE: CK_MECHANISM_TYPE = 16409; +pub const CKM_BLAKE2B_384_KEY_GEN: CK_MECHANISM_TYPE = 16410; +pub const CKM_BLAKE2B_512: CK_MECHANISM_TYPE = 16411; +pub const CKM_BLAKE2B_512_HMAC: CK_MECHANISM_TYPE = 16412; +pub const CKM_BLAKE2B_512_HMAC_GENERAL: CK_MECHANISM_TYPE = 16413; +pub const CKM_BLAKE2B_512_KEY_DERIVE: CK_MECHANISM_TYPE = 16414; +pub const CKM_BLAKE2B_512_KEY_GEN: CK_MECHANISM_TYPE = 16415; +pub const CKM_SALSA20: CK_MECHANISM_TYPE = 16416; +pub const CKM_CHACHA20_POLY1305: CK_MECHANISM_TYPE = 16417; +pub const CKM_SALSA20_POLY1305: CK_MECHANISM_TYPE = 16418; +pub const CKM_X3DH_INITIALIZE: CK_MECHANISM_TYPE = 16419; +pub const CKM_X3DH_RESPOND: CK_MECHANISM_TYPE = 16420; +pub const CKM_X2RATCHET_INITIALIZE: CK_MECHANISM_TYPE = 16421; +pub const CKM_X2RATCHET_RESPOND: CK_MECHANISM_TYPE = 16422; +pub const CKM_X2RATCHET_ENCRYPT: CK_MECHANISM_TYPE = 16423; +pub const CKM_X2RATCHET_DECRYPT: CK_MECHANISM_TYPE = 16424; +pub const CKM_XEDDSA: CK_MECHANISM_TYPE = 16425; +pub const CKM_HKDF_DERIVE: CK_MECHANISM_TYPE = 16426; +pub const CKM_HKDF_DATA: CK_MECHANISM_TYPE = 16427; +pub const CKM_HKDF_KEY_GEN: CK_MECHANISM_TYPE = 16428; +pub const CKM_ECDSA_SHA3_224: CK_MECHANISM_TYPE = 4167; +pub const CKM_ECDSA_SHA3_256: CK_MECHANISM_TYPE = 4168; +pub const CKM_ECDSA_SHA3_384: CK_MECHANISM_TYPE = 4169; +pub const CKM_ECDSA_SHA3_512: CK_MECHANISM_TYPE = 4170; pub const CKM_EC_EDWARDS_KEY_PAIR_GEN: CK_MECHANISM_TYPE = 4181; pub const CKM_EC_MONTGOMERY_KEY_PAIR_GEN: CK_MECHANISM_TYPE = 4182; pub const CKM_EDDSA: CK_MECHANISM_TYPE = 4183; -pub const CK_OTP_FORMAT_DECIMAL: CK_ULONG = 0; -pub const CK_OTP_FORMAT_HEXADECIMAL: CK_ULONG = 1; -pub const CK_OTP_FORMAT_ALPHANUMERIC: CK_ULONG = 2; -pub const CK_OTP_FORMAT_BINARY: CK_ULONG = 3; -pub const CK_OTP_PARAM_IGNORED: CK_ULONG = 0; -pub const CK_OTP_PARAM_OPTIONAL: CK_ULONG = 1; -pub const CK_OTP_PARAM_MANDATORY: CK_ULONG = 2; -pub const CK_OTP_VALUE: CK_ULONG = 0; -pub const CK_OTP_PIN: CK_ULONG = 1; -pub const CK_OTP_CHALLENGE: CK_ULONG = 2; -pub const CK_OTP_TIME: CK_ULONG = 3; -pub const CK_OTP_COUNTER: CK_ULONG = 4; -pub const CK_OTP_FLAGS: CK_ULONG = 5; -pub const CK_OTP_OUTPUT_LENGTH: CK_ULONG = 6; -pub const CK_OTP_FORMAT: CK_ULONG = 7; -pub const CKF_NEXT_OTP: CK_FLAGS = 1; -pub const CKF_EXCLUDE_TIME: CK_FLAGS = 2; -pub const CKF_EXCLUDE_COUNTER: CK_FLAGS = 4; -pub const CKF_EXCLUDE_CHALLENGE: CK_FLAGS = 8; -pub const CKF_EXCLUDE_PIN: CK_FLAGS = 16; -pub const CKF_USER_FRIENDLY_OTP: CK_FLAGS = 32; -pub const CKN_OTP_CHANGED: CK_NOTIFICATION = 1; -pub const CKG_MGF1_SHA1: CK_RSA_PKCS_MGF_TYPE = 1; -pub const CKG_MGF1_SHA224: CK_RSA_PKCS_MGF_TYPE = 5; -pub const CKG_MGF1_SHA256: CK_RSA_PKCS_MGF_TYPE = 2; -pub const CKG_MGF1_SHA384: CK_RSA_PKCS_MGF_TYPE = 3; -pub const CKG_MGF1_SHA512: CK_RSA_PKCS_MGF_TYPE = 4; -pub const CKD_NULL: CK_EC_KDF_TYPE = 1; -pub const CKD_SHA1_KDF: CK_EC_KDF_TYPE = 2; -pub const CKD_SHA1_KDF_ASN1: CK_EC_KDF_TYPE = 3; -pub const CKD_SHA1_KDF_CONCATENATE: CK_EC_KDF_TYPE = 4; -pub const CKD_SHA224_KDF: CK_EC_KDF_TYPE = 5; -pub const CKD_SHA256_KDF: CK_EC_KDF_TYPE = 6; -pub const CKD_SHA384_KDF: CK_EC_KDF_TYPE = 7; -pub const CKD_SHA512_KDF: CK_EC_KDF_TYPE = 8; -pub const CKD_CPDIVERSIFY_KDF: CK_EC_KDF_TYPE = 9; +pub const CKM_SP800_108_COUNTER_KDF: CK_MECHANISM_TYPE = 940; +pub const CKM_SP800_108_FEEDBACK_KDF: CK_MECHANISM_TYPE = 941; +pub const CKM_SP800_108_DOUBLE_PIPELINE_KDF: CK_MECHANISM_TYPE = 942; +pub const CKM_VENDOR_DEFINED: CK_MECHANISM_TYPE = 2147483648; pub const CKF_HW: CK_FLAGS = 1; +pub const CKF_MESSAGE_ENCRYPT: CK_FLAGS = 2; +pub const CKF_MESSAGE_DECRYPT: CK_FLAGS = 4; +pub const CKF_MESSAGE_SIGN: CK_FLAGS = 8; +pub const CKF_MESSAGE_VERIFY: CK_FLAGS = 16; +pub const CKF_MULTI_MESSGE: CK_FLAGS = 32; +pub const CKF_FIND_OBJECTS: CK_FLAGS = 64; pub const CKF_ENCRYPT: CK_FLAGS = 256; pub const CKF_DECRYPT: CK_FLAGS = 512; pub const CKF_DIGEST: CK_FLAGS = 1024; @@ -582,12 +705,12 @@ pub const CKF_DERIVE: CK_FLAGS = 524288; pub const CKF_EC_F_P: CK_FLAGS = 1048576; pub const CKF_EC_F_2M: CK_FLAGS = 2097152; pub const CKF_EC_ECPARAMETERS: CK_FLAGS = 4194304; +pub const CKF_EC_OID: CK_FLAGS = 8388608; pub const CKF_EC_NAMEDCURVE: CK_FLAGS = 8388608; pub const CKF_EC_UNCOMPRESS: CK_FLAGS = 16777216; pub const CKF_EC_COMPRESS: CK_FLAGS = 33554432; -pub const CKF_DONT_BLOCK: CK_FLAGS = 1; -pub const CKF_LIBRARY_CANT_CREATE_OS_THREADS: CK_FLAGS = 1; -pub const CKF_OS_LOCKING_OK: CK_FLAGS = 2; +pub const CKF_EC_CURVENAME: CK_FLAGS = 67108864; +pub const CKF_EXTENSION: CK_FLAGS = 2147483648; pub const CKR_OK: CK_RV = 0; pub const CKR_CANCEL: CK_RV = 1; pub const CKR_HOST_MEMORY: CK_RV = 2; @@ -610,6 +733,7 @@ pub const CKR_DEVICE_MEMORY: CK_RV = 49; pub const CKR_DEVICE_REMOVED: CK_RV = 50; pub const CKR_ENCRYPTED_DATA_INVALID: CK_RV = 64; pub const CKR_ENCRYPTED_DATA_LEN_RANGE: CK_RV = 65; +pub const CKR_AEAD_DECRYPT_FAILED: CK_RV = 66; pub const CKR_FUNCTION_CANCELED: CK_RV = 80; pub const CKR_FUNCTION_NOT_PARALLEL: CK_RV = 81; pub const CKR_FUNCTION_NOT_SUPPORTED: CK_RV = 84; @@ -665,6 +789,7 @@ pub const CKR_WRAPPING_KEY_TYPE_INCONSISTENT: CK_RV = 277; pub const CKR_RANDOM_SEED_NOT_SUPPORTED: CK_RV = 288; pub const CKR_RANDOM_NO_RNG: CK_RV = 289; pub const CKR_DOMAIN_PARAMS_INVALID: CK_RV = 304; +pub const CKR_CURVE_NOT_SUPPORTED: CK_RV = 320; pub const CKR_BUFFER_TOO_SMALL: CK_RV = 336; pub const CKR_SAVED_STATE_INVALID: CK_RV = 352; pub const CKR_INFORMATION_SENSITIVE: CK_RV = 368; @@ -675,44 +800,126 @@ pub const CKR_MUTEX_BAD: CK_RV = 416; pub const CKR_MUTEX_NOT_LOCKED: CK_RV = 417; pub const CKR_NEW_PIN_MODE: CK_RV = 432; pub const CKR_NEXT_OTP: CK_RV = 433; -pub const CKR_EXCEEDED_MAX_ITERATIONS: CK_RV = 448; -pub const CKR_FIPS_SELF_TEST_FAILED: CK_RV = 449; -pub const CKR_LIBRARY_LOAD_FAILED: CK_RV = 450; -pub const CKR_PIN_TOO_WEAK: CK_RV = 451; -pub const CKR_PUBLIC_KEY_INVALID: CK_RV = 452; +pub const CKR_EXCEEDED_MAX_ITERATIONS: CK_RV = 437; +pub const CKR_FIPS_SELF_TEST_FAILED: CK_RV = 438; +pub const CKR_LIBRARY_LOAD_FAILED: CK_RV = 439; +pub const CKR_PIN_TOO_WEAK: CK_RV = 440; +pub const CKR_PUBLIC_KEY_INVALID: CK_RV = 441; pub const CKR_FUNCTION_REJECTED: CK_RV = 512; +pub const CKR_TOKEN_RESOURCE_EXCEEDED: CK_RV = 513; +pub const CKR_VENDOR_DEFINED: CK_RV = 2147483648; +pub const CKF_END_OF_MESSAGE: CK_FLAGS = 1; +pub const CKF_INTERFACE_FORK_SAFE: CK_FLAGS = 1; +pub const CKF_LIBRARY_CANT_CREATE_OS_THREADS: CK_FLAGS = 1; +pub const CKF_OS_LOCKING_OK: CK_FLAGS = 2; +pub const CKF_DONT_BLOCK: CK_FLAGS = 1; +pub const CKG_MGF1_SHA1: CK_RSA_PKCS_MGF_TYPE = 1; +pub const CKG_MGF1_SHA256: CK_RSA_PKCS_MGF_TYPE = 2; +pub const CKG_MGF1_SHA384: CK_RSA_PKCS_MGF_TYPE = 3; +pub const CKG_MGF1_SHA512: CK_RSA_PKCS_MGF_TYPE = 4; +pub const CKG_MGF1_SHA224: CK_RSA_PKCS_MGF_TYPE = 5; pub const CKZ_DATA_SPECIFIED: CK_RSA_PKCS_OAEP_SOURCE_TYPE = 1; -pub const CK_FALSE: CK_BBOOL = 0; -pub const CK_TRUE: CK_BBOOL = 1; -pub const FALSE: u32 = 0; -pub const TRUE: u32 = 1; -pub type CK_FLAGS = ::std::os::raw::c_ulong; +pub const CKD_NULL: CK_EC_KDF_TYPE = 1; +pub const CKD_SHA1_KDF: CK_EC_KDF_TYPE = 2; +pub const CKD_SHA1_KDF_ASN1: CK_EC_KDF_TYPE = 3; +pub const CKD_SHA1_KDF_CONCATENATE: CK_EC_KDF_TYPE = 4; +pub const CKD_SHA224_KDF: CK_EC_KDF_TYPE = 5; +pub const CKD_SHA256_KDF: CK_EC_KDF_TYPE = 6; +pub const CKD_SHA384_KDF: CK_EC_KDF_TYPE = 7; +pub const CKD_SHA512_KDF: CK_EC_KDF_TYPE = 8; +pub const CKD_CPDIVERSIFY_KDF: CK_EC_KDF_TYPE = 9; +pub const CKD_SHA3_224_KDF: CK_EC_KDF_TYPE = 10; +pub const CKD_SHA3_256_KDF: CK_EC_KDF_TYPE = 11; +pub const CKD_SHA3_384_KDF: CK_EC_KDF_TYPE = 12; +pub const CKD_SHA3_512_KDF: CK_EC_KDF_TYPE = 13; +pub const CKD_SHA1_KDF_SP800: CK_EC_KDF_TYPE = 14; +pub const CKD_SHA224_KDF_SP800: CK_EC_KDF_TYPE = 15; +pub const CKD_SHA256_KDF_SP800: CK_EC_KDF_TYPE = 16; +pub const CKD_SHA384_KDF_SP800: CK_EC_KDF_TYPE = 17; +pub const CKD_SHA512_KDF_SP800: CK_EC_KDF_TYPE = 18; +pub const CKD_SHA3_224_KDF_SP800: CK_EC_KDF_TYPE = 19; +pub const CKD_SHA3_256_KDF_SP800: CK_EC_KDF_TYPE = 20; +pub const CKD_SHA3_384_KDF_SP800: CK_EC_KDF_TYPE = 21; +pub const CKD_SHA3_512_KDF_SP800: CK_EC_KDF_TYPE = 22; +pub const CKD_BLAKE2B_160_KDF: CK_EC_KDF_TYPE = 23; +pub const CKD_BLAKE2B_256_KDF: CK_EC_KDF_TYPE = 24; +pub const CKD_BLAKE2B_384_KDF: CK_EC_KDF_TYPE = 25; +pub const CKD_BLAKE2B_512_KDF: CK_EC_KDF_TYPE = 26; +pub const CKP_PKCS5_PBKD2_HMAC_SHA1: CK_PROFILE_ID = 1; +pub const CKP_PKCS5_PBKD2_HMAC_GOSTR3411: CK_PROFILE_ID = 2; +pub const CKP_PKCS5_PBKD2_HMAC_SHA224: CK_PROFILE_ID = 3; +pub const CKP_PKCS5_PBKD2_HMAC_SHA256: CK_PROFILE_ID = 4; +pub const CKP_PKCS5_PBKD2_HMAC_SHA384: CK_PROFILE_ID = 5; +pub const CKP_PKCS5_PBKD2_HMAC_SHA512: CK_PROFILE_ID = 6; +pub const CKP_PKCS5_PBKD2_HMAC_SHA512_224: CK_PROFILE_ID = 7; +pub const CKP_PKCS5_PBKD2_HMAC_SHA512_256: CK_PROFILE_ID = 8; +pub const CKZ_SALT_SPECIFIED: CK_RSA_PKCS_OAEP_SOURCE_TYPE = 1; +pub const CK_OTP_VALUE: CK_ULONG = 0; +pub const CK_OTP_PIN: CK_ULONG = 1; +pub const CK_OTP_CHALLENGE: CK_ULONG = 2; +pub const CK_OTP_TIME: CK_ULONG = 3; +pub const CK_OTP_COUNTER: CK_ULONG = 4; +pub const CK_OTP_FLAGS: CK_ULONG = 5; +pub const CK_OTP_OUTPUT_LENGTH: CK_ULONG = 6; +pub const CK_OTP_OUTPUT_FORMAT: CK_ULONG = 7; +pub const CKF_NEXT_OTP: CK_FLAGS = 1; +pub const CKF_EXCLUDE_TIME: CK_FLAGS = 2; +pub const CKF_EXCLUDE_COUNTER: CK_FLAGS = 4; +pub const CKF_EXCLUDE_CHALLENGE: CK_FLAGS = 8; +pub const CKF_EXCLUDE_PIN: CK_FLAGS = 16; +pub const CKF_USER_FRIENDLY_OTP: CK_FLAGS = 32; +pub const CKG_NO_GENERATE: u32 = 0; +pub const CKG_GENERATE: u32 = 1; +pub const CKG_GENERATE_COUNTER: u32 = 2; +pub const CKG_GENERATE_RANDOM: u32 = 3; +pub const CK_SP800_108_ITERATION_VARIABLE: CK_ULONG = 1; +pub const CK_SP800_108_OPTIONAL_COUNTER: CK_ULONG = 2; +pub const CK_SP800_108_DKM_LENGTH: CK_ULONG = 3; +pub const CK_SP800_108_BYTE_ARRAY: CK_ULONG = 4; +pub const CKF_HKDF_SALT_NULL: CK_FLAGS = 1; +pub const CKF_HKDF_SALT_DATA: CK_FLAGS = 2; +pub const CKF_HKDF_SALT_KEY: CK_FLAGS = 4; +pub const CK_NEED_ARG_LIST: CK_ULONG = 1; +pub const CK_PKCS11_2_0_ONLY: CK_ULONG = 1; +pub type CK_BYTE = ::std::os::raw::c_uchar; +pub type CK_CHAR = CK_BYTE; +pub type CK_UTF8CHAR = CK_BYTE; +pub type CK_BBOOL = CK_BYTE; +pub type CK_ULONG = ::std::os::raw::c_ulong; +pub type CK_LONG = ::std::os::raw::c_long; +pub type CK_FLAGS = CK_ULONG; +pub type CK_BYTE_PTR = *mut CK_BYTE; +pub type CK_CHAR_PTR = *mut CK_CHAR; +pub type CK_UTF8CHAR_PTR = *mut CK_UTF8CHAR; +pub type CK_ULONG_PTR = *mut CK_ULONG; +pub type CK_VOID_PTR = *mut ::std::os::raw::c_void; +pub type CK_VOID_PTR_PTR = *mut CK_VOID_PTR; #[repr(C)] #[derive(Debug, Default, Copy, Clone)] -pub struct _CK_VERSION { - pub major: ::std::os::raw::c_uchar, - pub minor: ::std::os::raw::c_uchar, +pub struct CK_VERSION { + pub major: CK_BYTE, + pub minor: CK_BYTE, } #[test] -fn bindgen_test_layout__CK_VERSION() { - const UNINIT: ::std::mem::MaybeUninit<_CK_VERSION> = ::std::mem::MaybeUninit::uninit(); +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::<_CK_VERSION>(), + ::std::mem::size_of::(), 2usize, - concat!("Size of: ", stringify!(_CK_VERSION)) + concat!("Size of: ", stringify!(CK_VERSION)) ); assert_eq!( - ::std::mem::align_of::<_CK_VERSION>(), + ::std::mem::align_of::(), 1usize, - concat!("Alignment of ", stringify!(_CK_VERSION)) + 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!(CK_VERSION), "::", stringify!(major) ) @@ -722,41 +929,42 @@ fn bindgen_test_layout__CK_VERSION() { 1usize, concat!( "Offset of field: ", - stringify!(_CK_VERSION), + stringify!(CK_VERSION), "::", stringify!(minor) ) ); } +pub type CK_VERSION_PTR = *mut CK_VERSION; #[repr(C)] #[derive(Debug, Default, Copy, Clone)] -pub struct _CK_INFO { - pub cryptokiVersion: _CK_VERSION, - pub manufacturerID: [::std::os::raw::c_uchar; 32usize], +pub struct CK_INFO { + pub cryptokiVersion: CK_VERSION, + pub manufacturerID: [CK_UTF8CHAR; 32usize], pub flags: CK_FLAGS, - pub libraryDescription: [::std::os::raw::c_uchar; 32usize], - pub libraryVersion: _CK_VERSION, + pub libraryDescription: [CK_UTF8CHAR; 32usize], + pub libraryVersion: CK_VERSION, } #[test] -fn bindgen_test_layout__CK_INFO() { - const UNINIT: ::std::mem::MaybeUninit<_CK_INFO> = ::std::mem::MaybeUninit::uninit(); +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::<_CK_INFO>(), + ::std::mem::size_of::(), 88usize, - concat!("Size of: ", stringify!(_CK_INFO)) + concat!("Size of: ", stringify!(CK_INFO)) ); assert_eq!( - ::std::mem::align_of::<_CK_INFO>(), + ::std::mem::align_of::(), 8usize, - concat!("Alignment of ", stringify!(_CK_INFO)) + 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!(CK_INFO), "::", stringify!(cryptokiVersion) ) @@ -766,7 +974,7 @@ fn bindgen_test_layout__CK_INFO() { 2usize, concat!( "Offset of field: ", - stringify!(_CK_INFO), + stringify!(CK_INFO), "::", stringify!(manufacturerID) ) @@ -776,7 +984,7 @@ fn bindgen_test_layout__CK_INFO() { 40usize, concat!( "Offset of field: ", - stringify!(_CK_INFO), + stringify!(CK_INFO), "::", stringify!(flags) ) @@ -786,7 +994,7 @@ fn bindgen_test_layout__CK_INFO() { 48usize, concat!( "Offset of field: ", - stringify!(_CK_INFO), + stringify!(CK_INFO), "::", stringify!(libraryDescription) ) @@ -796,44 +1004,45 @@ fn bindgen_test_layout__CK_INFO() { 80usize, concat!( "Offset of field: ", - stringify!(_CK_INFO), + stringify!(CK_INFO), "::", stringify!(libraryVersion) ) ); } -pub type CK_NOTIFICATION = ::std::os::raw::c_ulong; -pub const CKN_SURRENDER: ::std::os::raw::c_ulong = 0; -pub type CK_SLOT_ID = ::std::os::raw::c_ulong; +pub type CK_INFO_PTR = *mut CK_INFO; +pub type CK_NOTIFICATION = CK_ULONG; +pub type CK_SLOT_ID = CK_ULONG; +pub type CK_SLOT_ID_PTR = *mut CK_SLOT_ID; #[repr(C)] #[derive(Debug, Copy, Clone)] -pub struct _CK_SLOT_INFO { - pub slotDescription: [::std::os::raw::c_uchar; 64usize], - pub manufacturerID: [::std::os::raw::c_uchar; 32usize], +pub struct CK_SLOT_INFO { + pub slotDescription: [CK_UTF8CHAR; 64usize], + pub manufacturerID: [CK_UTF8CHAR; 32usize], pub flags: CK_FLAGS, - pub hardwareVersion: _CK_VERSION, - pub firmwareVersion: _CK_VERSION, + pub hardwareVersion: CK_VERSION, + pub firmwareVersion: CK_VERSION, } #[test] -fn bindgen_test_layout__CK_SLOT_INFO() { - const UNINIT: ::std::mem::MaybeUninit<_CK_SLOT_INFO> = ::std::mem::MaybeUninit::uninit(); +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::<_CK_SLOT_INFO>(), + ::std::mem::size_of::(), 112usize, - concat!("Size of: ", stringify!(_CK_SLOT_INFO)) + concat!("Size of: ", stringify!(CK_SLOT_INFO)) ); assert_eq!( - ::std::mem::align_of::<_CK_SLOT_INFO>(), + ::std::mem::align_of::(), 8usize, - concat!("Alignment of ", stringify!(_CK_SLOT_INFO)) + 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!(CK_SLOT_INFO), "::", stringify!(slotDescription) ) @@ -843,7 +1052,7 @@ fn bindgen_test_layout__CK_SLOT_INFO() { 64usize, concat!( "Offset of field: ", - stringify!(_CK_SLOT_INFO), + stringify!(CK_SLOT_INFO), "::", stringify!(manufacturerID) ) @@ -853,7 +1062,7 @@ fn bindgen_test_layout__CK_SLOT_INFO() { 96usize, concat!( "Offset of field: ", - stringify!(_CK_SLOT_INFO), + stringify!(CK_SLOT_INFO), "::", stringify!(flags) ) @@ -863,7 +1072,7 @@ fn bindgen_test_layout__CK_SLOT_INFO() { 104usize, concat!( "Offset of field: ", - stringify!(_CK_SLOT_INFO), + stringify!(CK_SLOT_INFO), "::", stringify!(hardwareVersion) ) @@ -873,13 +1082,13 @@ fn bindgen_test_layout__CK_SLOT_INFO() { 106usize, concat!( "Offset of field: ", - stringify!(_CK_SLOT_INFO), + stringify!(CK_SLOT_INFO), "::", stringify!(firmwareVersion) ) ); } -impl Default for _CK_SLOT_INFO { +impl Default for CK_SLOT_INFO { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { @@ -888,52 +1097,49 @@ impl Default for _CK_SLOT_INFO { } } } -pub const CKF_TOKEN_PRESENT: ::std::os::raw::c_ulong = 1; -pub const CKF_REMOVABLE_DEVICE: ::std::os::raw::c_ulong = 2; -pub const CKF_HW_SLOT: ::std::os::raw::c_ulong = 4; -pub const CKF_ARRAY_ATTRIBUTE: ::std::os::raw::c_ulong = 1073741824; +pub type CK_SLOT_INFO_PTR = *mut CK_SLOT_INFO; #[repr(C)] #[derive(Debug, Default, Copy, Clone)] -pub struct _CK_TOKEN_INFO { - pub label: [::std::os::raw::c_uchar; 32usize], - pub manufacturerID: [::std::os::raw::c_uchar; 32usize], - pub model: [::std::os::raw::c_uchar; 16usize], - pub serialNumber: [::std::os::raw::c_uchar; 16usize], +pub struct CK_TOKEN_INFO { + pub label: [CK_UTF8CHAR; 32usize], + pub manufacturerID: [CK_UTF8CHAR; 32usize], + pub model: [CK_UTF8CHAR; 16usize], + pub serialNumber: [CK_CHAR; 16usize], pub flags: CK_FLAGS, - pub ulMaxSessionCount: ::std::os::raw::c_ulong, - pub ulSessionCount: ::std::os::raw::c_ulong, - pub ulMaxRwSessionCount: ::std::os::raw::c_ulong, - pub ulRwSessionCount: ::std::os::raw::c_ulong, - pub ulMaxPinLen: ::std::os::raw::c_ulong, - pub ulMinPinLen: ::std::os::raw::c_ulong, - pub ulTotalPublicMemory: ::std::os::raw::c_ulong, - pub ulFreePublicMemory: ::std::os::raw::c_ulong, - pub ulTotalPrivateMemory: ::std::os::raw::c_ulong, - pub ulFreePrivateMemory: ::std::os::raw::c_ulong, - pub hardwareVersion: _CK_VERSION, - pub firmwareVersion: _CK_VERSION, - pub utcTime: [::std::os::raw::c_uchar; 16usize], + pub ulMaxSessionCount: CK_ULONG, + pub ulSessionCount: CK_ULONG, + pub ulMaxRwSessionCount: CK_ULONG, + pub ulRwSessionCount: CK_ULONG, + pub ulMaxPinLen: CK_ULONG, + pub ulMinPinLen: CK_ULONG, + pub ulTotalPublicMemory: CK_ULONG, + pub ulFreePublicMemory: CK_ULONG, + pub ulTotalPrivateMemory: CK_ULONG, + pub ulFreePrivateMemory: CK_ULONG, + pub hardwareVersion: CK_VERSION, + pub firmwareVersion: CK_VERSION, + pub utcTime: [CK_CHAR; 16usize], } #[test] -fn bindgen_test_layout__CK_TOKEN_INFO() { - const UNINIT: ::std::mem::MaybeUninit<_CK_TOKEN_INFO> = ::std::mem::MaybeUninit::uninit(); +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::<_CK_TOKEN_INFO>(), + ::std::mem::size_of::(), 208usize, - concat!("Size of: ", stringify!(_CK_TOKEN_INFO)) + concat!("Size of: ", stringify!(CK_TOKEN_INFO)) ); assert_eq!( - ::std::mem::align_of::<_CK_TOKEN_INFO>(), + ::std::mem::align_of::(), 8usize, - concat!("Alignment of ", stringify!(_CK_TOKEN_INFO)) + 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!(CK_TOKEN_INFO), "::", stringify!(label) ) @@ -943,7 +1149,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { 32usize, concat!( "Offset of field: ", - stringify!(_CK_TOKEN_INFO), + stringify!(CK_TOKEN_INFO), "::", stringify!(manufacturerID) ) @@ -953,7 +1159,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { 64usize, concat!( "Offset of field: ", - stringify!(_CK_TOKEN_INFO), + stringify!(CK_TOKEN_INFO), "::", stringify!(model) ) @@ -963,7 +1169,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { 80usize, concat!( "Offset of field: ", - stringify!(_CK_TOKEN_INFO), + stringify!(CK_TOKEN_INFO), "::", stringify!(serialNumber) ) @@ -973,7 +1179,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { 96usize, concat!( "Offset of field: ", - stringify!(_CK_TOKEN_INFO), + stringify!(CK_TOKEN_INFO), "::", stringify!(flags) ) @@ -983,7 +1189,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { 104usize, concat!( "Offset of field: ", - stringify!(_CK_TOKEN_INFO), + stringify!(CK_TOKEN_INFO), "::", stringify!(ulMaxSessionCount) ) @@ -993,7 +1199,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { 112usize, concat!( "Offset of field: ", - stringify!(_CK_TOKEN_INFO), + stringify!(CK_TOKEN_INFO), "::", stringify!(ulSessionCount) ) @@ -1003,7 +1209,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { 120usize, concat!( "Offset of field: ", - stringify!(_CK_TOKEN_INFO), + stringify!(CK_TOKEN_INFO), "::", stringify!(ulMaxRwSessionCount) ) @@ -1013,7 +1219,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { 128usize, concat!( "Offset of field: ", - stringify!(_CK_TOKEN_INFO), + stringify!(CK_TOKEN_INFO), "::", stringify!(ulRwSessionCount) ) @@ -1023,7 +1229,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { 136usize, concat!( "Offset of field: ", - stringify!(_CK_TOKEN_INFO), + stringify!(CK_TOKEN_INFO), "::", stringify!(ulMaxPinLen) ) @@ -1033,7 +1239,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { 144usize, concat!( "Offset of field: ", - stringify!(_CK_TOKEN_INFO), + stringify!(CK_TOKEN_INFO), "::", stringify!(ulMinPinLen) ) @@ -1043,7 +1249,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { 152usize, concat!( "Offset of field: ", - stringify!(_CK_TOKEN_INFO), + stringify!(CK_TOKEN_INFO), "::", stringify!(ulTotalPublicMemory) ) @@ -1053,7 +1259,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { 160usize, concat!( "Offset of field: ", - stringify!(_CK_TOKEN_INFO), + stringify!(CK_TOKEN_INFO), "::", stringify!(ulFreePublicMemory) ) @@ -1063,7 +1269,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { 168usize, concat!( "Offset of field: ", - stringify!(_CK_TOKEN_INFO), + stringify!(CK_TOKEN_INFO), "::", stringify!(ulTotalPrivateMemory) ) @@ -1073,7 +1279,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { 176usize, concat!( "Offset of field: ", - stringify!(_CK_TOKEN_INFO), + stringify!(CK_TOKEN_INFO), "::", stringify!(ulFreePrivateMemory) ) @@ -1083,7 +1289,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { 184usize, concat!( "Offset of field: ", - stringify!(_CK_TOKEN_INFO), + stringify!(CK_TOKEN_INFO), "::", stringify!(hardwareVersion) ) @@ -1093,7 +1299,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { 186usize, concat!( "Offset of field: ", - stringify!(_CK_TOKEN_INFO), + stringify!(CK_TOKEN_INFO), "::", stringify!(firmwareVersion) ) @@ -1103,43 +1309,45 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { 188usize, concat!( "Offset of field: ", - stringify!(_CK_TOKEN_INFO), + stringify!(CK_TOKEN_INFO), "::", stringify!(utcTime) ) ); } -pub type CK_SESSION_HANDLE = ::std::os::raw::c_ulong; -pub type CK_USER_TYPE = ::std::os::raw::c_ulong; -pub type CK_STATE = ::std::os::raw::c_ulong; +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; +pub type CK_USER_TYPE = CK_ULONG; +pub type CK_STATE = CK_ULONG; #[repr(C)] #[derive(Debug, Default, Copy, Clone)] -pub struct _CK_SESSION_INFO { +pub struct CK_SESSION_INFO { pub slotID: CK_SLOT_ID, pub state: CK_STATE, pub flags: CK_FLAGS, - pub ulDeviceError: ::std::os::raw::c_ulong, + pub ulDeviceError: CK_ULONG, } #[test] -fn bindgen_test_layout__CK_SESSION_INFO() { - const UNINIT: ::std::mem::MaybeUninit<_CK_SESSION_INFO> = ::std::mem::MaybeUninit::uninit(); +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::<_CK_SESSION_INFO>(), + ::std::mem::size_of::(), 32usize, - concat!("Size of: ", stringify!(_CK_SESSION_INFO)) + concat!("Size of: ", stringify!(CK_SESSION_INFO)) ); assert_eq!( - ::std::mem::align_of::<_CK_SESSION_INFO>(), + ::std::mem::align_of::(), 8usize, - concat!("Alignment of ", stringify!(_CK_SESSION_INFO)) + 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!(CK_SESSION_INFO), "::", stringify!(slotID) ) @@ -1149,7 +1357,7 @@ fn bindgen_test_layout__CK_SESSION_INFO() { 8usize, concat!( "Offset of field: ", - stringify!(_CK_SESSION_INFO), + stringify!(CK_SESSION_INFO), "::", stringify!(state) ) @@ -1159,7 +1367,7 @@ fn bindgen_test_layout__CK_SESSION_INFO() { 16usize, concat!( "Offset of field: ", - stringify!(_CK_SESSION_INFO), + stringify!(CK_SESSION_INFO), "::", stringify!(flags) ) @@ -1169,45 +1377,48 @@ fn bindgen_test_layout__CK_SESSION_INFO() { 24usize, concat!( "Offset of field: ", - stringify!(_CK_SESSION_INFO), + stringify!(CK_SESSION_INFO), "::", stringify!(ulDeviceError) ) ); } -pub type CK_OBJECT_HANDLE = ::std::os::raw::c_ulong; -pub type CK_OBJECT_CLASS = ::std::os::raw::c_ulong; -pub type CK_HW_FEATURE_TYPE = ::std::os::raw::c_ulong; -pub type CK_KEY_TYPE = ::std::os::raw::c_ulong; -pub type CK_CERTIFICATE_TYPE = ::std::os::raw::c_ulong; -pub type CK_ATTRIBUTE_TYPE = ::std::os::raw::c_ulong; +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; +pub type CK_OBJECT_CLASS = CK_ULONG; +pub type CK_OBJECT_CLASS_PTR = *mut CK_OBJECT_CLASS; +pub type CK_HW_FEATURE_TYPE = CK_ULONG; +pub type CK_KEY_TYPE = CK_ULONG; +pub type CK_CERTIFICATE_TYPE = CK_ULONG; +pub type CK_ATTRIBUTE_TYPE = CK_ULONG; #[repr(C)] #[derive(Debug, Copy, Clone)] -pub struct _CK_ATTRIBUTE { +pub struct CK_ATTRIBUTE { pub type_: CK_ATTRIBUTE_TYPE, - pub pValue: *mut ::std::os::raw::c_void, - pub ulValueLen: ::std::os::raw::c_ulong, + pub pValue: CK_VOID_PTR, + pub ulValueLen: CK_ULONG, } #[test] -fn bindgen_test_layout__CK_ATTRIBUTE() { - const UNINIT: ::std::mem::MaybeUninit<_CK_ATTRIBUTE> = ::std::mem::MaybeUninit::uninit(); +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::<_CK_ATTRIBUTE>(), + ::std::mem::size_of::(), 24usize, - concat!("Size of: ", stringify!(_CK_ATTRIBUTE)) + concat!("Size of: ", stringify!(CK_ATTRIBUTE)) ); assert_eq!( - ::std::mem::align_of::<_CK_ATTRIBUTE>(), + ::std::mem::align_of::(), 8usize, - concat!("Alignment of ", stringify!(_CK_ATTRIBUTE)) + 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!(CK_ATTRIBUTE), "::", stringify!(type_) ) @@ -1217,7 +1428,7 @@ fn bindgen_test_layout__CK_ATTRIBUTE() { 8usize, concat!( "Offset of field: ", - stringify!(_CK_ATTRIBUTE), + stringify!(CK_ATTRIBUTE), "::", stringify!(pValue) ) @@ -1227,13 +1438,13 @@ fn bindgen_test_layout__CK_ATTRIBUTE() { 16usize, concat!( "Offset of field: ", - stringify!(_CK_ATTRIBUTE), + stringify!(CK_ATTRIBUTE), "::", stringify!(ulValueLen) ) ); } -impl Default for _CK_ATTRIBUTE { +impl Default for CK_ATTRIBUTE { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { @@ -1242,33 +1453,34 @@ impl Default for _CK_ATTRIBUTE { } } } +pub type CK_ATTRIBUTE_PTR = *mut CK_ATTRIBUTE; #[repr(C)] #[derive(Debug, Default, Copy, Clone)] -pub struct _CK_DATE { - pub year: [::std::os::raw::c_uchar; 4usize], - pub month: [::std::os::raw::c_uchar; 2usize], - pub day: [::std::os::raw::c_uchar; 2usize], +pub struct CK_DATE { + pub year: [CK_CHAR; 4usize], + pub month: [CK_CHAR; 2usize], + pub day: [CK_CHAR; 2usize], } #[test] -fn bindgen_test_layout__CK_DATE() { - const UNINIT: ::std::mem::MaybeUninit<_CK_DATE> = ::std::mem::MaybeUninit::uninit(); +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::<_CK_DATE>(), + ::std::mem::size_of::(), 8usize, - concat!("Size of: ", stringify!(_CK_DATE)) + concat!("Size of: ", stringify!(CK_DATE)) ); assert_eq!( - ::std::mem::align_of::<_CK_DATE>(), + ::std::mem::align_of::(), 1usize, - concat!("Alignment of ", stringify!(_CK_DATE)) + 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!(CK_DATE), "::", stringify!(year) ) @@ -1278,7 +1490,7 @@ fn bindgen_test_layout__CK_DATE() { 4usize, concat!( "Offset of field: ", - stringify!(_CK_DATE), + stringify!(CK_DATE), "::", stringify!(month) ) @@ -1288,40 +1500,41 @@ fn bindgen_test_layout__CK_DATE() { 6usize, concat!( "Offset of field: ", - stringify!(_CK_DATE), + stringify!(CK_DATE), "::", stringify!(day) ) ); } -pub type CK_MECHANISM_TYPE = ::std::os::raw::c_ulong; +pub type CK_MECHANISM_TYPE = CK_ULONG; +pub type CK_MECHANISM_TYPE_PTR = *mut CK_MECHANISM_TYPE; #[repr(C)] #[derive(Debug, Copy, Clone)] -pub struct _CK_MECHANISM { +pub struct CK_MECHANISM { pub mechanism: CK_MECHANISM_TYPE, - pub pParameter: *mut ::std::os::raw::c_void, - pub ulParameterLen: ::std::os::raw::c_ulong, + pub pParameter: CK_VOID_PTR, + pub ulParameterLen: CK_ULONG, } #[test] -fn bindgen_test_layout__CK_MECHANISM() { - const UNINIT: ::std::mem::MaybeUninit<_CK_MECHANISM> = ::std::mem::MaybeUninit::uninit(); +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::<_CK_MECHANISM>(), + ::std::mem::size_of::(), 24usize, - concat!("Size of: ", stringify!(_CK_MECHANISM)) + concat!("Size of: ", stringify!(CK_MECHANISM)) ); assert_eq!( - ::std::mem::align_of::<_CK_MECHANISM>(), + ::std::mem::align_of::(), 8usize, - concat!("Alignment of ", stringify!(_CK_MECHANISM)) + 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!(CK_MECHANISM), "::", stringify!(mechanism) ) @@ -1331,7 +1544,7 @@ fn bindgen_test_layout__CK_MECHANISM() { 8usize, concat!( "Offset of field: ", - stringify!(_CK_MECHANISM), + stringify!(CK_MECHANISM), "::", stringify!(pParameter) ) @@ -1341,13 +1554,13 @@ fn bindgen_test_layout__CK_MECHANISM() { 16usize, concat!( "Offset of field: ", - stringify!(_CK_MECHANISM), + stringify!(CK_MECHANISM), "::", stringify!(ulParameterLen) ) ); } -impl Default for _CK_MECHANISM { +impl Default for CK_MECHANISM { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { @@ -1356,33 +1569,34 @@ impl Default for _CK_MECHANISM { } } } +pub type CK_MECHANISM_PTR = *mut CK_MECHANISM; #[repr(C)] #[derive(Debug, Default, Copy, Clone)] -pub struct _CK_MECHANISM_INFO { - pub ulMinKeySize: ::std::os::raw::c_ulong, - pub ulMaxKeySize: ::std::os::raw::c_ulong, +pub struct CK_MECHANISM_INFO { + pub ulMinKeySize: CK_ULONG, + pub ulMaxKeySize: CK_ULONG, pub flags: CK_FLAGS, } #[test] -fn bindgen_test_layout__CK_MECHANISM_INFO() { - const UNINIT: ::std::mem::MaybeUninit<_CK_MECHANISM_INFO> = ::std::mem::MaybeUninit::uninit(); +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::<_CK_MECHANISM_INFO>(), + ::std::mem::size_of::(), 24usize, - concat!("Size of: ", stringify!(_CK_MECHANISM_INFO)) + concat!("Size of: ", stringify!(CK_MECHANISM_INFO)) ); assert_eq!( - ::std::mem::align_of::<_CK_MECHANISM_INFO>(), + ::std::mem::align_of::(), 8usize, - concat!("Alignment of ", stringify!(_CK_MECHANISM_INFO)) + 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!(CK_MECHANISM_INFO), "::", stringify!(ulMinKeySize) ) @@ -1392,7 +1606,7 @@ fn bindgen_test_layout__CK_MECHANISM_INFO() { 8usize, concat!( "Offset of field: ", - stringify!(_CK_MECHANISM_INFO), + stringify!(CK_MECHANISM_INFO), "::", stringify!(ulMaxKeySize) ) @@ -1402,66 +1616,78 @@ fn bindgen_test_layout__CK_MECHANISM_INFO() { 16usize, concat!( "Offset of field: ", - stringify!(_CK_MECHANISM_INFO), + stringify!(CK_MECHANISM_INFO), "::", stringify!(flags) ) ); } -pub type CK_PARAM_TYPE = ::std::os::raw::c_ulong; +pub type CK_MECHANISM_INFO_PTR = *mut CK_MECHANISM_INFO; +pub type CK_RV = CK_ULONG; +pub type CK_NOTIFY = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + event: CK_NOTIFICATION, + pApplication: CK_VOID_PTR, + ) -> CK_RV, +>; +pub type CK_FUNCTION_LIST_PTR = *mut CK_FUNCTION_LIST; +pub type CK_FUNCTION_LIST_3_0_PTR = *mut CK_FUNCTION_LIST_3_0; +pub type CK_FUNCTION_LIST_PTR_PTR = *mut CK_FUNCTION_LIST_PTR; +pub type CK_FUNCTION_LIST_3_0_PTR_PTR = *mut CK_FUNCTION_LIST_3_0_PTR; #[repr(C)] #[derive(Debug, Copy, Clone)] -pub struct CK_OTP_PARAM { - pub type_: CK_PARAM_TYPE, - pub pValue: *mut ::std::os::raw::c_void, - pub ulValueLen: ::std::os::raw::c_ulong, +pub struct CK_INTERFACE { + pub pInterfaceName: *mut CK_CHAR, + pub pFunctionList: CK_VOID_PTR, + pub flags: CK_FLAGS, } #[test] -fn bindgen_test_layout_CK_OTP_PARAM() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); +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::(), + ::std::mem::size_of::(), 24usize, - concat!("Size of: ", stringify!(CK_OTP_PARAM)) + concat!("Size of: ", stringify!(CK_INTERFACE)) ); assert_eq!( - ::std::mem::align_of::(), + ::std::mem::align_of::(), 8usize, - concat!("Alignment of ", stringify!(CK_OTP_PARAM)) + concat!("Alignment of ", stringify!(CK_INTERFACE)) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).type_) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).pInterfaceName) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", - stringify!(CK_OTP_PARAM), + stringify!(CK_INTERFACE), "::", - stringify!(type_) + stringify!(pInterfaceName) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pValue) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).pFunctionList) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", - stringify!(CK_OTP_PARAM), + stringify!(CK_INTERFACE), "::", - stringify!(pValue) + stringify!(pFunctionList) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulValueLen) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).flags) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", - stringify!(CK_OTP_PARAM), + stringify!(CK_INTERFACE), "::", - stringify!(ulValueLen) + stringify!(flags) ) ); } -impl Default for CK_OTP_PARAM { +impl Default for CK_INTERFACE { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { @@ -1470,99 +1696,100 @@ impl Default for CK_OTP_PARAM { } } } +pub type CK_INTERFACE_PTR = *mut CK_INTERFACE; +pub type CK_INTERFACE_PTR_PTR = *mut CK_INTERFACE_PTR; +pub type CK_CREATEMUTEX = + ::std::option::Option CK_RV>; +pub type CK_DESTROYMUTEX = + ::std::option::Option CK_RV>; +pub type CK_LOCKMUTEX = ::std::option::Option CK_RV>; +pub type CK_UNLOCKMUTEX = ::std::option::Option CK_RV>; #[repr(C)] #[derive(Debug, Copy, Clone)] -pub struct CK_OTP_PARAMS { - pub pParams: *mut CK_OTP_PARAM, - pub ulCount: ::std::os::raw::c_ulong, +pub struct CK_C_INITIALIZE_ARGS { + pub CreateMutex: CK_CREATEMUTEX, + pub DestroyMutex: CK_DESTROYMUTEX, + pub LockMutex: CK_LOCKMUTEX, + pub UnlockMutex: CK_UNLOCKMUTEX, + pub flags: CK_FLAGS, + pub pReserved: CK_VOID_PTR, } #[test] -fn bindgen_test_layout_CK_OTP_PARAMS() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); +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::(), - 16usize, - concat!("Size of: ", stringify!(CK_OTP_PARAMS)) + ::std::mem::size_of::(), + 48usize, + concat!("Size of: ", stringify!(CK_C_INITIALIZE_ARGS)) ); assert_eq!( - ::std::mem::align_of::(), + ::std::mem::align_of::(), 8usize, - concat!("Alignment of ", stringify!(CK_OTP_PARAMS)) + concat!("Alignment of ", stringify!(CK_C_INITIALIZE_ARGS)) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pParams) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).CreateMutex) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", - stringify!(CK_OTP_PARAMS), + stringify!(CK_C_INITIALIZE_ARGS), "::", - stringify!(pParams) + stringify!(CreateMutex) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulCount) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).DestroyMutex) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", - stringify!(CK_OTP_PARAMS), + stringify!(CK_C_INITIALIZE_ARGS), "::", - stringify!(ulCount) + stringify!(DestroyMutex) ) ); -} -impl Default for CK_OTP_PARAMS { - fn default() -> Self { - let mut s = ::std::mem::MaybeUninit::::uninit(); - unsafe { - ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct CK_OTP_SIGNATURE_INFO { - pub pParams: *mut CK_OTP_PARAM, - pub ulCount: ::std::os::raw::c_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::(), + unsafe { ::std::ptr::addr_of!((*ptr).LockMutex) as usize - ptr as usize }, 16usize, - concat!("Size of: ", stringify!(CK_OTP_SIGNATURE_INFO)) + concat!( + "Offset of field: ", + stringify!(CK_C_INITIALIZE_ARGS), + "::", + stringify!(LockMutex) + ) ); assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(CK_OTP_SIGNATURE_INFO)) + 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).pParams) as usize - ptr as usize }, - 0usize, + unsafe { ::std::ptr::addr_of!((*ptr).flags) as usize - ptr as usize }, + 32usize, concat!( "Offset of field: ", - stringify!(CK_OTP_SIGNATURE_INFO), + stringify!(CK_C_INITIALIZE_ARGS), "::", - stringify!(pParams) + stringify!(flags) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulCount) as usize - ptr as usize }, - 8usize, + unsafe { ::std::ptr::addr_of!((*ptr).pReserved) as usize - ptr as usize }, + 40usize, concat!( "Offset of field: ", - stringify!(CK_OTP_SIGNATURE_INFO), + stringify!(CK_C_INITIALIZE_ARGS), "::", - stringify!(ulCount) + stringify!(pReserved) ) ); } -impl Default for CK_OTP_SIGNATURE_INFO { +impl Default for CK_C_INITIALIZE_ARGS { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { @@ -1571,35 +1798,41 @@ impl Default for CK_OTP_SIGNATURE_INFO { } } } -pub type CK_RSA_PKCS_MGF_TYPE = ::std::os::raw::c_ulong; +pub type CK_C_INITIALIZE_ARGS_PTR = *mut CK_C_INITIALIZE_ARGS; +pub type CK_RSA_PKCS_MGF_TYPE = CK_ULONG; +pub type CK_RSA_PKCS_MGF_TYPE_PTR = *mut CK_RSA_PKCS_MGF_TYPE; +pub type CK_RSA_PKCS_OAEP_SOURCE_TYPE = CK_ULONG; +pub type CK_RSA_PKCS_OAEP_SOURCE_TYPE_PTR = *mut CK_RSA_PKCS_OAEP_SOURCE_TYPE; #[repr(C)] -#[derive(Debug, Default, Copy, Clone)] -pub struct ck_rsa_pkcs_pss_params { +#[derive(Debug, Copy, Clone)] +pub struct CK_RSA_PKCS_OAEP_PARAMS { pub hashAlg: CK_MECHANISM_TYPE, pub mgf: CK_RSA_PKCS_MGF_TYPE, - pub sLen: ::std::os::raw::c_ulong, + pub source: CK_RSA_PKCS_OAEP_SOURCE_TYPE, + pub pSourceData: CK_VOID_PTR, + pub ulSourceDataLen: CK_ULONG, } #[test] -fn bindgen_test_layout_ck_rsa_pkcs_pss_params() { - const UNINIT: ::std::mem::MaybeUninit = +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_pss_params)) + ::std::mem::size_of::(), + 40usize, + concat!("Size of: ", stringify!(CK_RSA_PKCS_OAEP_PARAMS)) ); assert_eq!( - ::std::mem::align_of::(), + ::std::mem::align_of::(), 8usize, - concat!("Alignment of ", stringify!(ck_rsa_pkcs_pss_params)) + 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_pss_params), + stringify!(CK_RSA_PKCS_OAEP_PARAMS), "::", stringify!(hashAlg) ) @@ -1609,75 +1842,19 @@ fn bindgen_test_layout_ck_rsa_pkcs_pss_params() { 8usize, concat!( "Offset of field: ", - stringify!(ck_rsa_pkcs_pss_params), + stringify!(CK_RSA_PKCS_OAEP_PARAMS), "::", stringify!(mgf) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).sLen) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).source) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", - stringify!(ck_rsa_pkcs_pss_params), + stringify!(CK_RSA_PKCS_OAEP_PARAMS), "::", - stringify!(sLen) - ) - ); -} -pub type CK_RSA_PKCS_OAEP_SOURCE_TYPE = ::std::os::raw::c_ulong; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct ck_rsa_pkcs_oaep_params { - pub hashAlg: CK_MECHANISM_TYPE, - pub mgf: CK_RSA_PKCS_MGF_TYPE, - pub source: CK_RSA_PKCS_OAEP_SOURCE_TYPE, - pub pSourceData: *mut ::std::os::raw::c_void, - pub ulSourceDataLen: ::std::os::raw::c_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::(), - 40usize, - concat!("Size of: ", stringify!(ck_rsa_pkcs_oaep_params)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - 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 }, - 8usize, - 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 }, - 16usize, - concat!( - "Offset of field: ", - stringify!(ck_rsa_pkcs_oaep_params), - "::", - stringify!(source) + stringify!(source) ) ); assert_eq!( @@ -1685,7 +1862,7 @@ fn bindgen_test_layout_ck_rsa_pkcs_oaep_params() { 24usize, concat!( "Offset of field: ", - stringify!(ck_rsa_pkcs_oaep_params), + stringify!(CK_RSA_PKCS_OAEP_PARAMS), "::", stringify!(pSourceData) ) @@ -1695,13 +1872,13 @@ fn bindgen_test_layout_ck_rsa_pkcs_oaep_params() { 32usize, concat!( "Offset of field: ", - stringify!(ck_rsa_pkcs_oaep_params), + stringify!(CK_RSA_PKCS_OAEP_PARAMS), "::", stringify!(ulSourceDataLen) ) ); } -impl Default for ck_rsa_pkcs_oaep_params { +impl Default for CK_RSA_PKCS_OAEP_PARAMS { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { @@ -1710,133 +1887,138 @@ impl Default for ck_rsa_pkcs_oaep_params { } } } +pub type CK_RSA_PKCS_OAEP_PARAMS_PTR = *mut CK_RSA_PKCS_OAEP_PARAMS; #[repr(C)] #[derive(Debug, Default, Copy, Clone)] -pub struct ck_aes_ctr_params { - pub ulCounterBits: ::std::os::raw::c_ulong, - pub cb: [::std::os::raw::c_uchar; 16usize], +pub struct CK_RSA_PKCS_PSS_PARAMS { + pub hashAlg: CK_MECHANISM_TYPE, + pub mgf: CK_RSA_PKCS_MGF_TYPE, + pub sLen: CK_ULONG, } #[test] -fn bindgen_test_layout_ck_aes_ctr_params() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); +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::(), + ::std::mem::size_of::(), 24usize, - concat!("Size of: ", stringify!(ck_aes_ctr_params)) + concat!("Size of: ", stringify!(CK_RSA_PKCS_PSS_PARAMS)) ); assert_eq!( - ::std::mem::align_of::(), + ::std::mem::align_of::(), 8usize, - concat!("Alignment of ", stringify!(ck_aes_ctr_params)) + concat!("Alignment of ", stringify!(CK_RSA_PKCS_PSS_PARAMS)) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulCounterBits) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).hashAlg) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", - stringify!(ck_aes_ctr_params), + stringify!(CK_RSA_PKCS_PSS_PARAMS), "::", - stringify!(ulCounterBits) + stringify!(hashAlg) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).cb) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).mgf) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", - stringify!(ck_aes_ctr_params), + stringify!(CK_RSA_PKCS_PSS_PARAMS), "::", - stringify!(cb) + stringify!(mgf) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).sLen) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(CK_RSA_PKCS_PSS_PARAMS), + "::", + stringify!(sLen) ) ); } +pub type CK_RSA_PKCS_PSS_PARAMS_PTR = *mut CK_RSA_PKCS_PSS_PARAMS; +pub type CK_EC_KDF_TYPE = CK_ULONG; #[repr(C)] #[derive(Debug, Copy, Clone)] -pub struct ck_gcm_params { - pub pIv: *mut ::std::os::raw::c_uchar, - pub ulIvLen: ::std::os::raw::c_ulong, - pub ulIvBits: ::std::os::raw::c_ulong, - pub pAAD: *mut ::std::os::raw::c_uchar, - pub ulAADLen: ::std::os::raw::c_ulong, - pub ulTagBits: ::std::os::raw::c_ulong, +pub struct CK_ECDH1_DERIVE_PARAMS { + pub kdf: CK_EC_KDF_TYPE, + pub ulSharedDataLen: CK_ULONG, + pub pSharedData: CK_BYTE_PTR, + pub ulPublicDataLen: CK_ULONG, + pub pPublicData: CK_BYTE_PTR, } #[test] -fn bindgen_test_layout_ck_gcm_params() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); +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::(), - 48usize, - concat!("Size of: ", stringify!(ck_gcm_params)) + ::std::mem::size_of::(), + 40usize, + concat!("Size of: ", stringify!(CK_ECDH1_DERIVE_PARAMS)) ); assert_eq!( - ::std::mem::align_of::(), + ::std::mem::align_of::(), 8usize, - concat!("Alignment of ", stringify!(ck_gcm_params)) + concat!("Alignment of ", stringify!(CK_ECDH1_DERIVE_PARAMS)) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pIv) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).kdf) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", - stringify!(ck_gcm_params), + stringify!(CK_ECDH1_DERIVE_PARAMS), "::", - stringify!(pIv) + stringify!(kdf) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulIvLen) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ulSharedDataLen) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", - stringify!(ck_gcm_params), + stringify!(CK_ECDH1_DERIVE_PARAMS), "::", - stringify!(ulIvLen) + stringify!(ulSharedDataLen) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulIvBits) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).pSharedData) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", - stringify!(ck_gcm_params), + stringify!(CK_ECDH1_DERIVE_PARAMS), "::", - stringify!(ulIvBits) + stringify!(pSharedData) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pAAD) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ulPublicDataLen) as usize - ptr as usize }, 24usize, concat!( "Offset of field: ", - stringify!(ck_gcm_params), + stringify!(CK_ECDH1_DERIVE_PARAMS), "::", - stringify!(pAAD) + stringify!(ulPublicDataLen) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulAADLen) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).pPublicData) as usize - ptr as usize }, 32usize, concat!( "Offset of field: ", - stringify!(ck_gcm_params), - "::", - stringify!(ulAADLen) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulTagBits) as usize - ptr as usize }, - 40usize, - concat!( - "Offset of field: ", - stringify!(ck_gcm_params), + stringify!(CK_ECDH1_DERIVE_PARAMS), "::", - stringify!(ulTagBits) + stringify!(pPublicData) ) ); } -impl Default for ck_gcm_params { +impl Default for CK_ECDH1_DERIVE_PARAMS { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { @@ -1845,37 +2027,41 @@ impl Default for ck_gcm_params { } } } -pub type ck_ec_kdf_t = ::std::os::raw::c_ulong; +pub type CK_ECDH1_DERIVE_PARAMS_PTR = *mut CK_ECDH1_DERIVE_PARAMS; #[repr(C)] #[derive(Debug, Copy, Clone)] -pub struct ck_ecdh1_derive_params { - pub kdf: ck_ec_kdf_t, - pub ulSharedDataLen: ::std::os::raw::c_ulong, - pub pSharedData: *mut ::std::os::raw::c_uchar, - pub ulPublicDataLen: ::std::os::raw::c_ulong, - pub pPublicData: *mut ::std::os::raw::c_uchar, +pub struct CK_ECDH2_DERIVE_PARAMS { + pub kdf: CK_EC_KDF_TYPE, + pub ulSharedDataLen: CK_ULONG, + pub pSharedData: CK_BYTE_PTR, + pub ulPublicDataLen: CK_ULONG, + pub pPublicData: CK_BYTE_PTR, + pub ulPrivateDataLen: CK_ULONG, + pub hPrivateData: CK_OBJECT_HANDLE, + pub ulPublicDataLen2: CK_ULONG, + pub pPublicData2: CK_BYTE_PTR, } #[test] -fn bindgen_test_layout_ck_ecdh1_derive_params() { - const UNINIT: ::std::mem::MaybeUninit = +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::(), - 40usize, - concat!("Size of: ", stringify!(ck_ecdh1_derive_params)) + ::std::mem::size_of::(), + 72usize, + concat!("Size of: ", stringify!(CK_ECDH2_DERIVE_PARAMS)) ); assert_eq!( - ::std::mem::align_of::(), + ::std::mem::align_of::(), 8usize, - concat!("Alignment of ", stringify!(ck_ecdh1_derive_params)) + 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_ecdh1_derive_params), + stringify!(CK_ECDH2_DERIVE_PARAMS), "::", stringify!(kdf) ) @@ -1885,7 +2071,7 @@ fn bindgen_test_layout_ck_ecdh1_derive_params() { 8usize, concat!( "Offset of field: ", - stringify!(ck_ecdh1_derive_params), + stringify!(CK_ECDH2_DERIVE_PARAMS), "::", stringify!(ulSharedDataLen) ) @@ -1895,7 +2081,7 @@ fn bindgen_test_layout_ck_ecdh1_derive_params() { 16usize, concat!( "Offset of field: ", - stringify!(ck_ecdh1_derive_params), + stringify!(CK_ECDH2_DERIVE_PARAMS), "::", stringify!(pSharedData) ) @@ -1905,7 +2091,7 @@ fn bindgen_test_layout_ck_ecdh1_derive_params() { 24usize, concat!( "Offset of field: ", - stringify!(ck_ecdh1_derive_params), + stringify!(CK_ECDH2_DERIVE_PARAMS), "::", stringify!(ulPublicDataLen) ) @@ -1915,13 +2101,53 @@ fn bindgen_test_layout_ck_ecdh1_derive_params() { 32usize, concat!( "Offset of field: ", - stringify!(ck_ecdh1_derive_params), + stringify!(CK_ECDH2_DERIVE_PARAMS), "::", stringify!(pPublicData) ) ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ulPrivateDataLen) as usize - ptr as usize }, + 40usize, + 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 }, + 48usize, + 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 }, + 56usize, + 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 }, + 64usize, + concat!( + "Offset of field: ", + stringify!(CK_ECDH2_DERIVE_PARAMS), + "::", + stringify!(pPublicData2) + ) + ); } -impl Default for ck_ecdh1_derive_params { +impl Default for CK_ECDH2_DERIVE_PARAMS { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { @@ -1930,49 +2156,138 @@ impl Default for ck_ecdh1_derive_params { } } } +pub type CK_ECDH2_DERIVE_PARAMS_PTR = *mut CK_ECDH2_DERIVE_PARAMS; #[repr(C)] #[derive(Debug, Copy, Clone)] -pub struct ck_key_derivation_string_data { - pub pData: *mut ::std::os::raw::c_uchar, - pub ulLen: ::std::os::raw::c_ulong, +pub struct CK_ECMQV_DERIVE_PARAMS { + pub kdf: CK_EC_KDF_TYPE, + pub ulSharedDataLen: CK_ULONG, + pub pSharedData: CK_BYTE_PTR, + pub ulPublicDataLen: CK_ULONG, + pub pPublicData: CK_BYTE_PTR, + pub ulPrivateDataLen: CK_ULONG, + pub hPrivateData: CK_OBJECT_HANDLE, + pub ulPublicDataLen2: CK_ULONG, + pub pPublicData2: CK_BYTE_PTR, + pub publicKey: CK_OBJECT_HANDLE, } #[test] -fn bindgen_test_layout_ck_key_derivation_string_data() { - const UNINIT: ::std::mem::MaybeUninit = +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::(), - 16usize, - concat!("Size of: ", stringify!(ck_key_derivation_string_data)) + ::std::mem::size_of::(), + 80usize, + concat!("Size of: ", stringify!(CK_ECMQV_DERIVE_PARAMS)) ); assert_eq!( - ::std::mem::align_of::(), + ::std::mem::align_of::(), 8usize, - concat!("Alignment of ", stringify!(ck_key_derivation_string_data)) + concat!("Alignment of ", stringify!(CK_ECMQV_DERIVE_PARAMS)) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pData) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).kdf) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", - stringify!(ck_key_derivation_string_data), + stringify!(CK_ECMQV_DERIVE_PARAMS), "::", - stringify!(pData) + stringify!(kdf) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulLen) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ulSharedDataLen) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", - stringify!(ck_key_derivation_string_data), + stringify!(CK_ECMQV_DERIVE_PARAMS), "::", - stringify!(ulLen) + stringify!(ulSharedDataLen) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pSharedData) as usize - ptr as usize }, + 16usize, + 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 }, + 24usize, + 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 }, + 32usize, + 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 }, + 40usize, + 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 }, + 48usize, + 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 }, + 56usize, + 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 }, + 64usize, + 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 }, + 72usize, + concat!( + "Offset of field: ", + stringify!(CK_ECMQV_DERIVE_PARAMS), + "::", + stringify!(publicKey) ) ); } -impl Default for ck_key_derivation_string_data { +impl Default for CK_ECMQV_DERIVE_PARAMS { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { @@ -1981,60 +2296,85 @@ impl Default for ck_key_derivation_string_data { } } } +pub type CK_ECMQV_DERIVE_PARAMS_PTR = *mut CK_ECMQV_DERIVE_PARAMS; +pub type CK_X9_42_DH_KDF_TYPE = CK_ULONG; +pub type CK_X9_42_DH_KDF_TYPE_PTR = *mut CK_X9_42_DH_KDF_TYPE; #[repr(C)] #[derive(Debug, Copy, Clone)] -pub struct ck_des_cbc_encrypt_data_params { - pub iv: [::std::os::raw::c_uchar; 8usize], - pub pData: *mut ::std::os::raw::c_uchar, - pub length: ::std::os::raw::c_ulong, +pub struct CK_X9_42_DH1_DERIVE_PARAMS { + pub kdf: CK_X9_42_DH_KDF_TYPE, + pub ulOtherInfoLen: CK_ULONG, + pub pOtherInfo: CK_BYTE_PTR, + pub ulPublicDataLen: CK_ULONG, + pub pPublicData: CK_BYTE_PTR, } #[test] -fn bindgen_test_layout_ck_des_cbc_encrypt_data_params() { - const UNINIT: ::std::mem::MaybeUninit = +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::(), - 24usize, - concat!("Size of: ", stringify!(ck_des_cbc_encrypt_data_params)) + ::std::mem::size_of::(), + 40usize, + concat!("Size of: ", stringify!(CK_X9_42_DH1_DERIVE_PARAMS)) ); assert_eq!( - ::std::mem::align_of::(), + ::std::mem::align_of::(), 8usize, - concat!("Alignment of ", stringify!(ck_des_cbc_encrypt_data_params)) + concat!("Alignment of ", stringify!(CK_X9_42_DH1_DERIVE_PARAMS)) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).iv) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).kdf) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", - stringify!(ck_des_cbc_encrypt_data_params), + stringify!(CK_X9_42_DH1_DERIVE_PARAMS), "::", - stringify!(iv) + stringify!(kdf) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pData) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ulOtherInfoLen) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", - stringify!(ck_des_cbc_encrypt_data_params), + stringify!(CK_X9_42_DH1_DERIVE_PARAMS), "::", - stringify!(pData) + stringify!(ulOtherInfoLen) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).length) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).pOtherInfo) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", - stringify!(ck_des_cbc_encrypt_data_params), + stringify!(CK_X9_42_DH1_DERIVE_PARAMS), "::", - stringify!(length) + stringify!(pOtherInfo) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ulPublicDataLen) as usize - ptr as usize }, + 24usize, + 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 }, + 32usize, + concat!( + "Offset of field: ", + stringify!(CK_X9_42_DH1_DERIVE_PARAMS), + "::", + stringify!(pPublicData) ) ); } -impl Default for ck_des_cbc_encrypt_data_params { +impl Default for CK_X9_42_DH1_DERIVE_PARAMS { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { @@ -2043,540 +2383,7363 @@ impl Default for ck_des_cbc_encrypt_data_params { } } } +pub type CK_X9_42_DH1_DERIVE_PARAMS_PTR = *mut CK_X9_42_DH1_DERIVE_PARAMS; #[repr(C)] #[derive(Debug, Copy, Clone)] -pub struct ck_aes_cbc_encrypt_data_params { - pub iv: [::std::os::raw::c_uchar; 16usize], - pub pData: *mut ::std::os::raw::c_uchar, - pub length: ::std::os::raw::c_ulong, +pub struct CK_X9_42_DH2_DERIVE_PARAMS { + pub kdf: CK_X9_42_DH_KDF_TYPE, + pub ulOtherInfoLen: CK_ULONG, + pub pOtherInfo: CK_BYTE_PTR, + pub ulPublicDataLen: CK_ULONG, + pub pPublicData: CK_BYTE_PTR, + pub ulPrivateDataLen: CK_ULONG, + pub hPrivateData: CK_OBJECT_HANDLE, + pub ulPublicDataLen2: CK_ULONG, + pub pPublicData2: CK_BYTE_PTR, } #[test] -fn bindgen_test_layout_ck_aes_cbc_encrypt_data_params() { - const UNINIT: ::std::mem::MaybeUninit = +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::(), - 32usize, - concat!("Size of: ", stringify!(ck_aes_cbc_encrypt_data_params)) + ::std::mem::size_of::(), + 72usize, + concat!("Size of: ", stringify!(CK_X9_42_DH2_DERIVE_PARAMS)) ); assert_eq!( - ::std::mem::align_of::(), + ::std::mem::align_of::(), 8usize, - concat!("Alignment of ", stringify!(ck_aes_cbc_encrypt_data_params)) + concat!("Alignment of ", stringify!(CK_X9_42_DH2_DERIVE_PARAMS)) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).iv) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).kdf) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", - stringify!(ck_aes_cbc_encrypt_data_params), + stringify!(CK_X9_42_DH2_DERIVE_PARAMS), "::", - stringify!(iv) + stringify!(kdf) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pData) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ulOtherInfoLen) as usize - ptr as usize }, + 8usize, + 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 }, 16usize, concat!( "Offset of field: ", - stringify!(ck_aes_cbc_encrypt_data_params), + stringify!(CK_X9_42_DH2_DERIVE_PARAMS), "::", - stringify!(pData) + stringify!(pOtherInfo) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).length) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ulPublicDataLen) as usize - ptr as usize }, 24usize, concat!( "Offset of field: ", - stringify!(ck_aes_cbc_encrypt_data_params), + stringify!(CK_X9_42_DH2_DERIVE_PARAMS), "::", - stringify!(length) + stringify!(ulPublicDataLen) ) ); -} -impl Default for ck_aes_cbc_encrypt_data_params { - fn default() -> Self { - let mut s = ::std::mem::MaybeUninit::::uninit(); - unsafe { - ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -pub type CK_RV = ::std::os::raw::c_ulong; -pub type CK_NOTIFY = ::std::option::Option< - unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - event: CK_NOTIFICATION, - application: *mut ::std::os::raw::c_void, - ) -> CK_RV, ->; -pub type CK_C_Initialize = - ::std::option::Option CK_RV>; -pub type CK_C_Finalize = - ::std::option::Option CK_RV>; -pub type CK_C_GetInfo = ::std::option::Option CK_RV>; -pub type CK_C_GetFunctionList = ::std::option::Option< - unsafe extern "C" fn(function_list: *mut *mut _CK_FUNCTION_LIST) -> CK_RV, ->; -pub type CK_C_GetSlotList = ::std::option::Option< - unsafe extern "C" fn( - token_present: ::std::os::raw::c_uchar, - slot_list: *mut CK_SLOT_ID, - ulCount: *mut ::std::os::raw::c_ulong, - ) -> CK_RV, ->; -pub type CK_C_GetSlotInfo = ::std::option::Option< - unsafe extern "C" fn(slotID: CK_SLOT_ID, info: *mut _CK_SLOT_INFO) -> CK_RV, ->; -pub type CK_C_GetTokenInfo = ::std::option::Option< - unsafe extern "C" fn(slotID: CK_SLOT_ID, info: *mut _CK_TOKEN_INFO) -> CK_RV, ->; -pub type CK_C_WaitForSlotEvent = ::std::option::Option< + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pPublicData) as usize - ptr as usize }, + 32usize, + 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 }, + 40usize, + 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 }, + 48usize, + 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 }, + 56usize, + 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 }, + 64usize, + concat!( + "Offset of field: ", + stringify!(CK_X9_42_DH2_DERIVE_PARAMS), + "::", + stringify!(pPublicData2) + ) + ); +} +impl Default for CK_X9_42_DH2_DERIVE_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_X9_42_DH2_DERIVE_PARAMS_PTR = *mut CK_X9_42_DH2_DERIVE_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_X9_42_MQV_DERIVE_PARAMS { + pub kdf: CK_X9_42_DH_KDF_TYPE, + pub ulOtherInfoLen: CK_ULONG, + pub pOtherInfo: CK_BYTE_PTR, + pub ulPublicDataLen: CK_ULONG, + pub pPublicData: CK_BYTE_PTR, + pub ulPrivateDataLen: CK_ULONG, + pub hPrivateData: CK_OBJECT_HANDLE, + pub ulPublicDataLen2: CK_ULONG, + 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::(), + 80usize, + concat!("Size of: ", stringify!(CK_X9_42_MQV_DERIVE_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + 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 }, + 16usize, + 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 }, + 24usize, + 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 }, + 32usize, + 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 }, + 40usize, + 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 }, + 48usize, + 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 }, + 56usize, + 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 }, + 64usize, + 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 }, + 72usize, + concat!( + "Offset of field: ", + stringify!(CK_X9_42_MQV_DERIVE_PARAMS), + "::", + stringify!(publicKey) + ) + ); +} +impl Default for CK_X9_42_MQV_DERIVE_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_X9_42_MQV_DERIVE_PARAMS_PTR = *mut CK_X9_42_MQV_DERIVE_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_KEA_DERIVE_PARAMS { + pub isSender: CK_BBOOL, + pub ulRandomLen: CK_ULONG, + pub pRandomA: CK_BYTE_PTR, + pub pRandomB: CK_BYTE_PTR, + 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::(), + 48usize, + concat!("Size of: ", stringify!(CK_KEA_DERIVE_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + 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 }, + 16usize, + 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 }, + 24usize, + 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 }, + 32usize, + 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 }, + 40usize, + concat!( + "Offset of field: ", + stringify!(CK_KEA_DERIVE_PARAMS), + "::", + stringify!(pPublicData) + ) + ); +} +impl Default for CK_KEA_DERIVE_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_KEA_DERIVE_PARAMS_PTR = *mut CK_KEA_DERIVE_PARAMS; +pub type CK_RC2_PARAMS = CK_ULONG; +pub type CK_RC2_PARAMS_PTR = *mut CK_RC2_PARAMS; +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +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::(), + 16usize, + concat!("Size of: ", stringify!(CK_RC2_CBC_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + concat!( + "Offset of field: ", + stringify!(CK_RC2_CBC_PARAMS), + "::", + stringify!(iv) + ) + ); +} +pub type CK_RC2_CBC_PARAMS_PTR = *mut CK_RC2_CBC_PARAMS; +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +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::(), + 16usize, + concat!("Size of: ", stringify!(CK_RC2_MAC_GENERAL_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + concat!( + "Offset of field: ", + stringify!(CK_RC2_MAC_GENERAL_PARAMS), + "::", + stringify!(ulMacLength) + ) + ); +} +pub type CK_RC2_MAC_GENERAL_PARAMS_PTR = *mut CK_RC2_MAC_GENERAL_PARAMS; +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +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::(), + 16usize, + concat!("Size of: ", stringify!(CK_RC5_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + concat!( + "Offset of field: ", + stringify!(CK_RC5_PARAMS), + "::", + stringify!(ulRounds) + ) + ); +} +pub type CK_RC5_PARAMS_PTR = *mut CK_RC5_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_RC5_CBC_PARAMS { + pub ulWordsize: CK_ULONG, + pub ulRounds: CK_ULONG, + 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::(), + 32usize, + concat!("Size of: ", stringify!(CK_RC5_CBC_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + 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 }, + 16usize, + 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 }, + 24usize, + concat!( + "Offset of field: ", + stringify!(CK_RC5_CBC_PARAMS), + "::", + stringify!(ulIvLen) + ) + ); +} +impl Default for CK_RC5_CBC_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_RC5_CBC_PARAMS_PTR = *mut CK_RC5_CBC_PARAMS; +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct CK_RC5_MAC_GENERAL_PARAMS { + pub ulWordsize: CK_ULONG, + 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::(), + 24usize, + concat!("Size of: ", stringify!(CK_RC5_MAC_GENERAL_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + 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 }, + 16usize, + concat!( + "Offset of field: ", + stringify!(CK_RC5_MAC_GENERAL_PARAMS), + "::", + stringify!(ulMacLength) + ) + ); +} +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; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_DES_CBC_ENCRYPT_DATA_PARAMS { + pub iv: [CK_BYTE; 8usize], + 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::(), + 24usize, + concat!("Size of: ", stringify!(CK_DES_CBC_ENCRYPT_DATA_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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) + ) + ); +} +impl Default for CK_DES_CBC_ENCRYPT_DATA_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_DES_CBC_ENCRYPT_DATA_PARAMS_PTR = *mut CK_DES_CBC_ENCRYPT_DATA_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_AES_CBC_ENCRYPT_DATA_PARAMS { + pub iv: [CK_BYTE; 16usize], + 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::(), + 32usize, + concat!("Size of: ", stringify!(CK_AES_CBC_ENCRYPT_DATA_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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) + ) + ); +} +impl Default for CK_AES_CBC_ENCRYPT_DATA_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_AES_CBC_ENCRYPT_DATA_PARAMS_PTR = *mut CK_AES_CBC_ENCRYPT_DATA_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_SKIPJACK_PRIVATE_WRAP_PARAMS { + pub ulPasswordLen: CK_ULONG, + pub pPassword: CK_BYTE_PTR, + pub ulPublicDataLen: CK_ULONG, + pub pPublicData: CK_BYTE_PTR, + pub ulPAndGLen: CK_ULONG, + pub ulQLen: CK_ULONG, + pub ulRandomLen: CK_ULONG, + pub pRandomA: CK_BYTE_PTR, + pub pPrimeP: CK_BYTE_PTR, + 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::(), + 88usize, + concat!("Size of: ", stringify!(CK_SKIPJACK_PRIVATE_WRAP_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + 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 }, + 16usize, + 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 }, + 24usize, + 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 }, + 32usize, + 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 }, + 40usize, + 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 }, + 48usize, + 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 }, + 56usize, + 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 }, + 64usize, + 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 }, + 72usize, + 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 }, + 80usize, + concat!( + "Offset of field: ", + stringify!(CK_SKIPJACK_PRIVATE_WRAP_PARAMS), + "::", + stringify!(pSubprimeQ) + ) + ); +} +impl Default for CK_SKIPJACK_PRIVATE_WRAP_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_SKIPJACK_PRIVATE_WRAP_PARAMS_PTR = *mut CK_SKIPJACK_PRIVATE_WRAP_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_SKIPJACK_RELAYX_PARAMS { + pub ulOldWrappedXLen: CK_ULONG, + pub pOldWrappedX: CK_BYTE_PTR, + pub ulOldPasswordLen: CK_ULONG, + pub pOldPassword: CK_BYTE_PTR, + pub ulOldPublicDataLen: CK_ULONG, + pub pOldPublicData: CK_BYTE_PTR, + pub ulOldRandomLen: CK_ULONG, + pub pOldRandomA: CK_BYTE_PTR, + pub ulNewPasswordLen: CK_ULONG, + pub pNewPassword: CK_BYTE_PTR, + pub ulNewPublicDataLen: CK_ULONG, + pub pNewPublicData: CK_BYTE_PTR, + 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::(), + 112usize, + concat!("Size of: ", stringify!(CK_SKIPJACK_RELAYX_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + 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 }, + 16usize, + 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 }, + 24usize, + 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 }, + 32usize, + 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 }, + 40usize, + 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 }, + 48usize, + 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 }, + 56usize, + 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 }, + 64usize, + 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 }, + 72usize, + 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 }, + 80usize, + 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 }, + 88usize, + 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 }, + 96usize, + 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 }, + 104usize, + concat!( + "Offset of field: ", + stringify!(CK_SKIPJACK_RELAYX_PARAMS), + "::", + stringify!(pNewRandomA) + ) + ); +} +impl Default for CK_SKIPJACK_RELAYX_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_SKIPJACK_RELAYX_PARAMS_PTR = *mut CK_SKIPJACK_RELAYX_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_PBE_PARAMS { + pub pInitVector: CK_BYTE_PTR, + pub pPassword: CK_UTF8CHAR_PTR, + pub ulPasswordLen: CK_ULONG, + pub pSalt: CK_BYTE_PTR, + 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::(), + 48usize, + concat!("Size of: ", stringify!(CK_PBE_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 24usize, + concat!( + "Offset of field: ", + stringify!(CK_PBE_PARAMS), + "::", + stringify!(pSalt) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ulSaltLen) as usize - ptr as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(CK_PBE_PARAMS), + "::", + stringify!(ulSaltLen) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ulIteration) as usize - ptr as usize }, + 40usize, + concat!( + "Offset of field: ", + stringify!(CK_PBE_PARAMS), + "::", + stringify!(ulIteration) + ) + ); +} +impl Default for CK_PBE_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_PBE_PARAMS_PTR = *mut CK_PBE_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_KEY_WRAP_SET_OAEP_PARAMS { + pub bBC: CK_BYTE, + 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::(), + 24usize, + concat!("Size of: ", stringify!(CK_KEY_WRAP_SET_OAEP_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + 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 }, + 16usize, + concat!( + "Offset of field: ", + stringify!(CK_KEY_WRAP_SET_OAEP_PARAMS), + "::", + stringify!(ulXLen) + ) + ); +} +impl Default for CK_KEY_WRAP_SET_OAEP_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_KEY_WRAP_SET_OAEP_PARAMS_PTR = *mut CK_KEY_WRAP_SET_OAEP_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_SSL3_RANDOM_DATA { + pub pClientRandom: CK_BYTE_PTR, + pub ulClientRandomLen: CK_ULONG, + 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::(), + 32usize, + concat!("Size of: ", stringify!(CK_SSL3_RANDOM_DATA)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 16usize, + 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 }, + 24usize, + concat!( + "Offset of field: ", + stringify!(CK_SSL3_RANDOM_DATA), + "::", + stringify!(ulServerRandomLen) + ) + ); +} +impl Default for CK_SSL3_RANDOM_DATA { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct 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::(), + 40usize, + concat!("Size of: ", stringify!(CK_SSL3_MASTER_KEY_DERIVE_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 32usize, + concat!( + "Offset of field: ", + stringify!(CK_SSL3_MASTER_KEY_DERIVE_PARAMS), + "::", + stringify!(pVersion) + ) + ); +} +impl Default for CK_SSL3_MASTER_KEY_DERIVE_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_SSL3_MASTER_KEY_DERIVE_PARAMS_PTR = *mut CK_SSL3_MASTER_KEY_DERIVE_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_SSL3_KEY_MAT_OUT { + pub hClientMacSecret: CK_OBJECT_HANDLE, + pub hServerMacSecret: CK_OBJECT_HANDLE, + pub hClientKey: CK_OBJECT_HANDLE, + pub hServerKey: CK_OBJECT_HANDLE, + 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::(), + 48usize, + concat!("Size of: ", stringify!(CK_SSL3_KEY_MAT_OUT)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + 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 }, + 16usize, + 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 }, + 24usize, + 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 }, + 32usize, + 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 }, + 40usize, + concat!( + "Offset of field: ", + stringify!(CK_SSL3_KEY_MAT_OUT), + "::", + stringify!(pIVServer) + ) + ); +} +impl Default for CK_SSL3_KEY_MAT_OUT { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_SSL3_KEY_MAT_OUT_PTR = *mut CK_SSL3_KEY_MAT_OUT; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_SSL3_KEY_MAT_PARAMS { + pub ulMacSizeInBits: CK_ULONG, + pub ulKeySizeInBits: CK_ULONG, + pub ulIVSizeInBits: CK_ULONG, + pub bIsExport: CK_BBOOL, + 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::(), + 72usize, + concat!("Size of: ", stringify!(CK_SSL3_KEY_MAT_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + 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 }, + 16usize, + 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 }, + 24usize, + 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 }, + 32usize, + 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 }, + 64usize, + concat!( + "Offset of field: ", + stringify!(CK_SSL3_KEY_MAT_PARAMS), + "::", + stringify!(pReturnedKeyMaterial) + ) + ); +} +impl Default for CK_SSL3_KEY_MAT_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_SSL3_KEY_MAT_PARAMS_PTR = *mut CK_SSL3_KEY_MAT_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_TLS_PRF_PARAMS { + pub pSeed: CK_BYTE_PTR, + pub ulSeedLen: CK_ULONG, + pub pLabel: CK_BYTE_PTR, + pub ulLabelLen: CK_ULONG, + 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::(), + 48usize, + concat!("Size of: ", stringify!(CK_TLS_PRF_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 16usize, + 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 }, + 24usize, + 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 }, + 32usize, + 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 }, + 40usize, + concat!( + "Offset of field: ", + stringify!(CK_TLS_PRF_PARAMS), + "::", + stringify!(pulOutputLen) + ) + ); +} +impl Default for CK_TLS_PRF_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_TLS_PRF_PARAMS_PTR = *mut CK_TLS_PRF_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_WTLS_RANDOM_DATA { + pub pClientRandom: CK_BYTE_PTR, + pub ulClientRandomLen: CK_ULONG, + 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::(), + 32usize, + concat!("Size of: ", stringify!(CK_WTLS_RANDOM_DATA)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 16usize, + 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 }, + 24usize, + concat!( + "Offset of field: ", + stringify!(CK_WTLS_RANDOM_DATA), + "::", + stringify!(ulServerRandomLen) + ) + ); +} +impl Default for CK_WTLS_RANDOM_DATA { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_WTLS_RANDOM_DATA_PTR = *mut CK_WTLS_RANDOM_DATA; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_WTLS_MASTER_KEY_DERIVE_PARAMS { + pub DigestMechanism: CK_MECHANISM_TYPE, + 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::(), + 48usize, + concat!("Size of: ", stringify!(CK_WTLS_MASTER_KEY_DERIVE_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + 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 }, + 40usize, + concat!( + "Offset of field: ", + stringify!(CK_WTLS_MASTER_KEY_DERIVE_PARAMS), + "::", + stringify!(pVersion) + ) + ); +} +impl Default for CK_WTLS_MASTER_KEY_DERIVE_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_WTLS_MASTER_KEY_DERIVE_PARAMS_PTR = *mut CK_WTLS_MASTER_KEY_DERIVE_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_WTLS_PRF_PARAMS { + pub DigestMechanism: CK_MECHANISM_TYPE, + pub pSeed: CK_BYTE_PTR, + pub ulSeedLen: CK_ULONG, + pub pLabel: CK_BYTE_PTR, + pub ulLabelLen: CK_ULONG, + 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::(), + 56usize, + concat!("Size of: ", stringify!(CK_WTLS_PRF_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + 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 }, + 16usize, + 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 }, + 24usize, + 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 }, + 32usize, + 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 }, + 40usize, + 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 }, + 48usize, + concat!( + "Offset of field: ", + stringify!(CK_WTLS_PRF_PARAMS), + "::", + stringify!(pulOutputLen) + ) + ); +} +impl Default for CK_WTLS_PRF_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_WTLS_PRF_PARAMS_PTR = *mut CK_WTLS_PRF_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_WTLS_KEY_MAT_OUT { + pub hMacSecret: CK_OBJECT_HANDLE, + 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::(), + 24usize, + concat!("Size of: ", stringify!(CK_WTLS_KEY_MAT_OUT)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + 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 }, + 16usize, + concat!( + "Offset of field: ", + stringify!(CK_WTLS_KEY_MAT_OUT), + "::", + stringify!(pIV) + ) + ); +} +impl Default for CK_WTLS_KEY_MAT_OUT { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_WTLS_KEY_MAT_OUT_PTR = *mut CK_WTLS_KEY_MAT_OUT; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_WTLS_KEY_MAT_PARAMS { + pub DigestMechanism: CK_MECHANISM_TYPE, + pub ulMacSizeInBits: CK_ULONG, + pub ulKeySizeInBits: CK_ULONG, + pub ulIVSizeInBits: CK_ULONG, + pub ulSequenceNumber: CK_ULONG, + pub bIsExport: CK_BBOOL, + 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::(), + 88usize, + concat!("Size of: ", stringify!(CK_WTLS_KEY_MAT_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + 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 }, + 16usize, + 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 }, + 24usize, + 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 }, + 32usize, + 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 }, + 40usize, + 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 }, + 48usize, + 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 }, + 80usize, + concat!( + "Offset of field: ", + stringify!(CK_WTLS_KEY_MAT_PARAMS), + "::", + stringify!(pReturnedKeyMaterial) + ) + ); +} +impl Default for CK_WTLS_KEY_MAT_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_WTLS_KEY_MAT_PARAMS_PTR = *mut CK_WTLS_KEY_MAT_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_CMS_SIG_PARAMS { + pub certificateHandle: CK_OBJECT_HANDLE, + pub pSigningMechanism: CK_MECHANISM_PTR, + pub pDigestMechanism: CK_MECHANISM_PTR, + pub pContentType: CK_UTF8CHAR_PTR, + pub pRequestedAttributes: CK_BYTE_PTR, + pub ulRequestedAttributesLen: CK_ULONG, + 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::(), + 64usize, + concat!("Size of: ", stringify!(CK_CMS_SIG_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + 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 }, + 16usize, + 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 }, + 24usize, + 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 }, + 32usize, + 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 }, + 40usize, + 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 }, + 48usize, + 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 }, + 56usize, + concat!( + "Offset of field: ", + stringify!(CK_CMS_SIG_PARAMS), + "::", + stringify!(ulRequiredAttributesLen) + ) + ); +} +impl Default for CK_CMS_SIG_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_CMS_SIG_PARAMS_PTR = *mut CK_CMS_SIG_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +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::(), + 16usize, + concat!("Size of: ", stringify!(CK_KEY_DERIVATION_STRING_DATA)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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) + ) + ); +} +impl Default for CK_KEY_DERIVATION_STRING_DATA { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_KEY_DERIVATION_STRING_DATA_PTR = *mut CK_KEY_DERIVATION_STRING_DATA; +pub type CK_EXTRACT_PARAMS = CK_ULONG; +pub type CK_EXTRACT_PARAMS_PTR = *mut CK_EXTRACT_PARAMS; +pub type CK_PKCS5_PBKD2_PSEUDO_RANDOM_FUNCTION_TYPE = CK_ULONG; +pub type CK_PKCS5_PBKD2_PSEUDO_RANDOM_FUNCTION_TYPE_PTR = + *mut CK_PKCS5_PBKD2_PSEUDO_RANDOM_FUNCTION_TYPE; +pub type CK_PKCS5_PBKDF2_SALT_SOURCE_TYPE = CK_ULONG; +pub type CK_PKCS5_PBKDF2_SALT_SOURCE_TYPE_PTR = *mut CK_PKCS5_PBKDF2_SALT_SOURCE_TYPE; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_PKCS5_PBKD2_PARAMS { + pub saltSource: CK_PKCS5_PBKDF2_SALT_SOURCE_TYPE, + pub pSaltSourceData: CK_VOID_PTR, + pub ulSaltSourceDataLen: CK_ULONG, + pub iterations: CK_ULONG, + pub prf: CK_PKCS5_PBKD2_PSEUDO_RANDOM_FUNCTION_TYPE, + pub pPrfData: CK_VOID_PTR, + pub ulPrfDataLen: CK_ULONG, + 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::(), + 72usize, + concat!("Size of: ", stringify!(CK_PKCS5_PBKD2_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + 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 }, + 16usize, + 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 }, + 24usize, + 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 }, + 32usize, + 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 }, + 40usize, + 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 }, + 48usize, + 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 }, + 56usize, + 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 }, + 64usize, + concat!( + "Offset of field: ", + stringify!(CK_PKCS5_PBKD2_PARAMS), + "::", + stringify!(ulPasswordLen) + ) + ); +} +impl Default for CK_PKCS5_PBKD2_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_PKCS5_PBKD2_PARAMS_PTR = *mut CK_PKCS5_PBKD2_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_PKCS5_PBKD2_PARAMS2 { + pub saltSource: CK_PKCS5_PBKDF2_SALT_SOURCE_TYPE, + pub pSaltSourceData: CK_VOID_PTR, + pub ulSaltSourceDataLen: CK_ULONG, + pub iterations: CK_ULONG, + pub prf: CK_PKCS5_PBKD2_PSEUDO_RANDOM_FUNCTION_TYPE, + pub pPrfData: CK_VOID_PTR, + pub ulPrfDataLen: CK_ULONG, + 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::(), + 72usize, + concat!("Size of: ", stringify!(CK_PKCS5_PBKD2_PARAMS2)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + 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 }, + 16usize, + 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 }, + 24usize, + 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 }, + 32usize, + 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 }, + 40usize, + 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 }, + 48usize, + 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 }, + 56usize, + 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 }, + 64usize, + concat!( + "Offset of field: ", + stringify!(CK_PKCS5_PBKD2_PARAMS2), + "::", + stringify!(ulPasswordLen) + ) + ); +} +impl Default for CK_PKCS5_PBKD2_PARAMS2 { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_PKCS5_PBKD2_PARAMS2_PTR = *mut CK_PKCS5_PBKD2_PARAMS2; +pub type CK_OTP_PARAM_TYPE = CK_ULONG; +pub type CK_PARAM_TYPE = CK_OTP_PARAM_TYPE; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_OTP_PARAM { + pub type_: CK_OTP_PARAM_TYPE, + 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::(), + 24usize, + concat!("Size of: ", stringify!(CK_OTP_PARAM)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + concat!( + "Offset of field: ", + stringify!(CK_OTP_PARAM), + "::", + stringify!(pValue) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ulValueLen) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(CK_OTP_PARAM), + "::", + stringify!(ulValueLen) + ) + ); +} +impl Default for CK_OTP_PARAM { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_OTP_PARAM_PTR = *mut CK_OTP_PARAM; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +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::(), + 16usize, + concat!("Size of: ", stringify!(CK_OTP_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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) + ) + ); +} +impl Default for CK_OTP_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_OTP_PARAMS_PTR = *mut CK_OTP_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +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::(), + 16usize, + concat!("Size of: ", stringify!(CK_OTP_SIGNATURE_INFO)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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) + ) + ); +} +impl Default for CK_OTP_SIGNATURE_INFO { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_OTP_SIGNATURE_INFO_PTR = *mut CK_OTP_SIGNATURE_INFO; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_KIP_PARAMS { + pub pMechanism: CK_MECHANISM_PTR, + pub hKey: CK_OBJECT_HANDLE, + 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::(), + 32usize, + concat!("Size of: ", stringify!(CK_KIP_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 16usize, + concat!( + "Offset of field: ", + stringify!(CK_KIP_PARAMS), + "::", + stringify!(pSeed) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ulSeedLen) as usize - ptr as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(CK_KIP_PARAMS), + "::", + stringify!(ulSeedLen) + ) + ); +} +impl Default for CK_KIP_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_KIP_PARAMS_PTR = *mut CK_KIP_PARAMS; +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +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::(), + 24usize, + concat!("Size of: ", stringify!(CK_AES_CTR_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + concat!( + "Offset of field: ", + stringify!(CK_AES_CTR_PARAMS), + "::", + stringify!(cb) + ) + ); +} +pub type CK_AES_CTR_PARAMS_PTR = *mut CK_AES_CTR_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_GCM_PARAMS { + pub pIv: CK_BYTE_PTR, + pub ulIvLen: CK_ULONG, + pub ulIvBits: CK_ULONG, + pub pAAD: CK_BYTE_PTR, + 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::(), + 48usize, + concat!("Size of: ", stringify!(CK_GCM_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 16usize, + concat!( + "Offset of field: ", + stringify!(CK_GCM_PARAMS), + "::", + stringify!(ulIvBits) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pAAD) as usize - ptr as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(CK_GCM_PARAMS), + "::", + stringify!(pAAD) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ulAADLen) as usize - ptr as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(CK_GCM_PARAMS), + "::", + stringify!(ulAADLen) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ulTagBits) as usize - ptr as usize }, + 40usize, + concat!( + "Offset of field: ", + stringify!(CK_GCM_PARAMS), + "::", + stringify!(ulTagBits) + ) + ); +} +impl Default for CK_GCM_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_GCM_PARAMS_PTR = *mut CK_GCM_PARAMS; +pub type CK_GENERATOR_FUNCTION = CK_ULONG; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_GCM_MESSAGE_PARAMS { + pub pIv: CK_BYTE_PTR, + pub ulIvLen: CK_ULONG, + pub ulIvFixedBits: CK_ULONG, + pub ivGenerator: CK_GENERATOR_FUNCTION, + 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::(), + 48usize, + concat!("Size of: ", stringify!(CK_GCM_MESSAGE_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 16usize, + 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 }, + 24usize, + 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 }, + 32usize, + 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 }, + 40usize, + concat!( + "Offset of field: ", + stringify!(CK_GCM_MESSAGE_PARAMS), + "::", + stringify!(ulTagBits) + ) + ); +} +impl Default for CK_GCM_MESSAGE_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_GCM_MESSAGE_PARAMS_PTR = CK_GCM_MESSAGE_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_CCM_PARAMS { + pub ulDataLen: CK_ULONG, + pub pNonce: CK_BYTE_PTR, + pub ulNonceLen: CK_ULONG, + pub pAAD: CK_BYTE_PTR, + 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::(), + 48usize, + concat!("Size of: ", stringify!(CK_CCM_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + concat!( + "Offset of field: ", + stringify!(CK_CCM_PARAMS), + "::", + stringify!(pNonce) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ulNonceLen) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(CK_CCM_PARAMS), + "::", + stringify!(ulNonceLen) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pAAD) as usize - ptr as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(CK_CCM_PARAMS), + "::", + stringify!(pAAD) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ulAADLen) as usize - ptr as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(CK_CCM_PARAMS), + "::", + stringify!(ulAADLen) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ulMACLen) as usize - ptr as usize }, + 40usize, + concat!( + "Offset of field: ", + stringify!(CK_CCM_PARAMS), + "::", + stringify!(ulMACLen) + ) + ); +} +impl Default for CK_CCM_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_CCM_PARAMS_PTR = *mut CK_CCM_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_CCM_MESSAGE_PARAMS { + pub ulDataLen: CK_ULONG, + pub pNonce: CK_BYTE_PTR, + pub ulNonceLen: CK_ULONG, + pub ulNonceFixedBits: CK_ULONG, + pub nonceGenerator: CK_GENERATOR_FUNCTION, + 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::(), + 56usize, + concat!("Size of: ", stringify!(CK_CCM_MESSAGE_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + 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 }, + 16usize, + 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 }, + 24usize, + 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 }, + 32usize, + 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 }, + 40usize, + 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 }, + 48usize, + concat!( + "Offset of field: ", + stringify!(CK_CCM_MESSAGE_PARAMS), + "::", + stringify!(ulMACLen) + ) + ); +} +impl Default for CK_CCM_MESSAGE_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_CCM_MESSAGE_PARAMS_PTR = CK_CCM_MESSAGE_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_AES_GCM_PARAMS { + pub pIv: CK_BYTE_PTR, + pub ulIvLen: CK_ULONG, + pub ulIvBits: CK_ULONG, + pub pAAD: CK_BYTE_PTR, + 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::(), + 48usize, + concat!("Size of: ", stringify!(CK_AES_GCM_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 16usize, + 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 }, + 24usize, + 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 }, + 32usize, + 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 }, + 40usize, + concat!( + "Offset of field: ", + stringify!(CK_AES_GCM_PARAMS), + "::", + stringify!(ulTagBits) + ) + ); +} +impl Default for CK_AES_GCM_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_AES_GCM_PARAMS_PTR = *mut CK_AES_GCM_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_AES_CCM_PARAMS { + pub ulDataLen: CK_ULONG, + pub pNonce: CK_BYTE_PTR, + pub ulNonceLen: CK_ULONG, + pub pAAD: CK_BYTE_PTR, + 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::(), + 48usize, + concat!("Size of: ", stringify!(CK_AES_CCM_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + 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 }, + 16usize, + 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 }, + 24usize, + 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 }, + 32usize, + 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 }, + 40usize, + concat!( + "Offset of field: ", + stringify!(CK_AES_CCM_PARAMS), + "::", + stringify!(ulMACLen) + ) + ); +} +impl Default for CK_AES_CCM_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_AES_CCM_PARAMS_PTR = *mut CK_AES_CCM_PARAMS; +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +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::(), + 24usize, + concat!("Size of: ", stringify!(CK_CAMELLIA_CTR_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + concat!( + "Offset of field: ", + stringify!(CK_CAMELLIA_CTR_PARAMS), + "::", + stringify!(cb) + ) + ); +} +pub type CK_CAMELLIA_CTR_PARAMS_PTR = *mut CK_CAMELLIA_CTR_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_CAMELLIA_CBC_ENCRYPT_DATA_PARAMS { + pub iv: [CK_BYTE; 16usize], + 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::(), + 32usize, + concat!("Size of: ", stringify!(CK_CAMELLIA_CBC_ENCRYPT_DATA_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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) + ) + ); +} +impl Default for CK_CAMELLIA_CBC_ENCRYPT_DATA_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_CAMELLIA_CBC_ENCRYPT_DATA_PARAMS_PTR = *mut CK_CAMELLIA_CBC_ENCRYPT_DATA_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_ARIA_CBC_ENCRYPT_DATA_PARAMS { + pub iv: [CK_BYTE; 16usize], + 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::(), + 32usize, + concat!("Size of: ", stringify!(CK_ARIA_CBC_ENCRYPT_DATA_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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) + ) + ); +} +impl Default for CK_ARIA_CBC_ENCRYPT_DATA_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_ARIA_CBC_ENCRYPT_DATA_PARAMS_PTR = *mut CK_ARIA_CBC_ENCRYPT_DATA_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_DSA_PARAMETER_GEN_PARAM { + pub hash: CK_MECHANISM_TYPE, + pub pSeed: CK_BYTE_PTR, + 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::(), + 32usize, + concat!("Size of: ", stringify!(CK_DSA_PARAMETER_GEN_PARAM)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + 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 }, + 16usize, + 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 }, + 24usize, + concat!( + "Offset of field: ", + stringify!(CK_DSA_PARAMETER_GEN_PARAM), + "::", + stringify!(ulIndex) + ) + ); +} +impl Default for CK_DSA_PARAMETER_GEN_PARAM { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_DSA_PARAMETER_GEN_PARAM_PTR = *mut CK_DSA_PARAMETER_GEN_PARAM; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_ECDH_AES_KEY_WRAP_PARAMS { + pub ulAESKeyBits: CK_ULONG, + pub kdf: CK_EC_KDF_TYPE, + 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::(), + 32usize, + concat!("Size of: ", stringify!(CK_ECDH_AES_KEY_WRAP_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + 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 }, + 16usize, + 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 }, + 24usize, + concat!( + "Offset of field: ", + stringify!(CK_ECDH_AES_KEY_WRAP_PARAMS), + "::", + stringify!(pSharedData) + ) + ); +} +impl Default for CK_ECDH_AES_KEY_WRAP_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_ECDH_AES_KEY_WRAP_PARAMS_PTR = *mut CK_ECDH_AES_KEY_WRAP_PARAMS; +pub type CK_JAVA_MIDP_SECURITY_DOMAIN = CK_ULONG; +pub type CK_CERTIFICATE_CATEGORY = CK_ULONG; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +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::(), + 16usize, + concat!("Size of: ", stringify!(CK_RSA_AES_KEY_WRAP_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + concat!( + "Offset of field: ", + stringify!(CK_RSA_AES_KEY_WRAP_PARAMS), + "::", + stringify!(pOAEPParams) + ) + ); +} +impl Default for CK_RSA_AES_KEY_WRAP_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_RSA_AES_KEY_WRAP_PARAMS_PTR = *mut CK_RSA_AES_KEY_WRAP_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_TLS12_MASTER_KEY_DERIVE_PARAMS { + pub RandomInfo: CK_SSL3_RANDOM_DATA, + 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::(), + 48usize, + concat!("Size of: ", stringify!(CK_TLS12_MASTER_KEY_DERIVE_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 32usize, + 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 }, + 40usize, + concat!( + "Offset of field: ", + stringify!(CK_TLS12_MASTER_KEY_DERIVE_PARAMS), + "::", + stringify!(prfHashMechanism) + ) + ); +} +impl Default for CK_TLS12_MASTER_KEY_DERIVE_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_TLS12_MASTER_KEY_DERIVE_PARAMS_PTR = *mut CK_TLS12_MASTER_KEY_DERIVE_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_TLS12_KEY_MAT_PARAMS { + pub ulMacSizeInBits: CK_ULONG, + pub ulKeySizeInBits: CK_ULONG, + pub ulIVSizeInBits: CK_ULONG, + pub bIsExport: CK_BBOOL, + pub RandomInfo: CK_SSL3_RANDOM_DATA, + 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::(), + 80usize, + concat!("Size of: ", stringify!(CK_TLS12_KEY_MAT_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + 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 }, + 16usize, + 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 }, + 24usize, + 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 }, + 32usize, + 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 }, + 64usize, + 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 }, + 72usize, + concat!( + "Offset of field: ", + stringify!(CK_TLS12_KEY_MAT_PARAMS), + "::", + stringify!(prfHashMechanism) + ) + ); +} +impl Default for CK_TLS12_KEY_MAT_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_TLS12_KEY_MAT_PARAMS_PTR = *mut CK_TLS12_KEY_MAT_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_TLS_KDF_PARAMS { + pub prfMechanism: CK_MECHANISM_TYPE, + pub pLabel: CK_BYTE_PTR, + pub ulLabelLength: CK_ULONG, + pub RandomInfo: CK_SSL3_RANDOM_DATA, + 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::(), + 72usize, + concat!("Size of: ", stringify!(CK_TLS_KDF_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + 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 }, + 16usize, + 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 }, + 24usize, + 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 }, + 56usize, + 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 }, + 64usize, + concat!( + "Offset of field: ", + stringify!(CK_TLS_KDF_PARAMS), + "::", + stringify!(ulContextDataLength) + ) + ); +} +impl Default for CK_TLS_KDF_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_TLS_KDF_PARAMS_PTR = *mut CK_TLS_KDF_PARAMS; +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct CK_TLS_MAC_PARAMS { + pub prfHashMechanism: CK_MECHANISM_TYPE, + 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::(), + 24usize, + concat!("Size of: ", stringify!(CK_TLS_MAC_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + 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 }, + 16usize, + concat!( + "Offset of field: ", + stringify!(CK_TLS_MAC_PARAMS), + "::", + stringify!(ulServerOrClient) + ) + ); +} +pub type CK_TLS_MAC_PARAMS_PTR = *mut CK_TLS_MAC_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_GOSTR3410_DERIVE_PARAMS { + pub kdf: CK_EC_KDF_TYPE, + pub pPublicData: CK_BYTE_PTR, + pub ulPublicDataLen: CK_ULONG, + 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::(), + 40usize, + concat!("Size of: ", stringify!(CK_GOSTR3410_DERIVE_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + 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 }, + 16usize, + 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 }, + 24usize, + 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 }, + 32usize, + concat!( + "Offset of field: ", + stringify!(CK_GOSTR3410_DERIVE_PARAMS), + "::", + stringify!(ulUKMLen) + ) + ); +} +impl Default for CK_GOSTR3410_DERIVE_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_GOSTR3410_DERIVE_PARAMS_PTR = *mut CK_GOSTR3410_DERIVE_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_GOSTR3410_KEY_WRAP_PARAMS { + pub pWrapOID: CK_BYTE_PTR, + pub ulWrapOIDLen: CK_ULONG, + pub pUKM: CK_BYTE_PTR, + 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::(), + 40usize, + concat!("Size of: ", stringify!(CK_GOSTR3410_KEY_WRAP_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 16usize, + 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 }, + 24usize, + 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 }, + 32usize, + concat!( + "Offset of field: ", + stringify!(CK_GOSTR3410_KEY_WRAP_PARAMS), + "::", + stringify!(hKey) + ) + ); +} +impl Default for CK_GOSTR3410_KEY_WRAP_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_GOSTR3410_KEY_WRAP_PARAMS_PTR = *mut CK_GOSTR3410_KEY_WRAP_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_SEED_CBC_ENCRYPT_DATA_PARAMS { + pub iv: [CK_BYTE; 16usize], + 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::(), + 32usize, + concat!("Size of: ", stringify!(CK_SEED_CBC_ENCRYPT_DATA_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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) + ) + ); +} +impl Default for CK_SEED_CBC_ENCRYPT_DATA_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_SEED_CBC_ENCRYPT_DATA_PARAMS_PTR = *mut CK_SEED_CBC_ENCRYPT_DATA_PARAMS; +pub type CK_PROFILE_ID = CK_ULONG; +pub type CK_PRF_DATA_TYPE = CK_ULONG; +pub type CK_SP800_108_PRF_TYPE = CK_MECHANISM_TYPE; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_PRF_DATA_PARAM { + pub type_: CK_PRF_DATA_TYPE, + 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::(), + 24usize, + concat!("Size of: ", stringify!(CK_PRF_DATA_PARAM)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + 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 }, + 16usize, + concat!( + "Offset of field: ", + stringify!(CK_PRF_DATA_PARAM), + "::", + stringify!(ulValueLen) + ) + ); +} +impl Default for CK_PRF_DATA_PARAM { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_PRF_DATA_PARAM_PTR = *mut CK_PRF_DATA_PARAM; +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +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::(), + 16usize, + concat!("Size of: ", stringify!(CK_SP800_108_COUNTER_FORMAT)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + concat!( + "Offset of field: ", + stringify!(CK_SP800_108_COUNTER_FORMAT), + "::", + stringify!(ulWidthInBits) + ) + ); +} +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)] +#[derive(Debug, Default, Copy, Clone)] +pub struct CK_SP800_108_DKM_LENGTH_FORMAT { + pub dkmLengthMethod: CK_SP800_108_DKM_LENGTH_METHOD, + 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::(), + 24usize, + concat!("Size of: ", stringify!(CK_SP800_108_DKM_LENGTH_FORMAT)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + 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 }, + 16usize, + concat!( + "Offset of field: ", + stringify!(CK_SP800_108_DKM_LENGTH_FORMAT), + "::", + stringify!(ulWidthInBits) + ) + ); +} +pub type CK_SP800_108_DKM_LENGTH_FORMAT_PTR = *mut CK_SP800_108_DKM_LENGTH_FORMAT; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_DERIVED_KEY { + pub pTemplate: CK_ATTRIBUTE_PTR, + 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::(), + 24usize, + concat!("Size of: ", stringify!(CK_DERIVED_KEY)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 16usize, + concat!( + "Offset of field: ", + stringify!(CK_DERIVED_KEY), + "::", + stringify!(phKey) + ) + ); +} +impl Default for CK_DERIVED_KEY { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_DERIVED_KEY_PTR = *mut CK_DERIVED_KEY; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_SP800_108_KDF_PARAMS { + pub prfType: CK_SP800_108_PRF_TYPE, + pub ulNumberOfDataParams: CK_ULONG, + pub pDataParams: CK_PRF_DATA_PARAM_PTR, + pub ulAdditionalDerivedKeys: CK_ULONG, + pub pAdditionalDerivedKeys: CK_DERIVED_KEY, +} +#[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::(), + 56usize, + concat!("Size of: ", stringify!(CK_SP800_108_KDF_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + 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 }, + 16usize, + 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 }, + 24usize, + 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 }, + 32usize, + concat!( + "Offset of field: ", + stringify!(CK_SP800_108_KDF_PARAMS), + "::", + stringify!(pAdditionalDerivedKeys) + ) + ); +} +impl Default for CK_SP800_108_KDF_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_SP800_108_KDF_PARAMS_PTR = *mut CK_SP800_108_KDF_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_SP800_108_FEEDBACK_KDF_PARAMS { + pub prfType: CK_SP800_108_PRF_TYPE, + pub ulNumberOfDataParams: CK_ULONG, + pub pDataParams: CK_PRF_DATA_PARAM_PTR, + pub ulIVLen: CK_ULONG, + pub pIV: CK_BYTE_PTR, + pub ulAdditionalDerivedKeys: CK_ULONG, + pub pAdditionalDerivedKeys: CK_DERIVED_KEY, +} +#[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::(), + 72usize, + concat!("Size of: ", stringify!(CK_SP800_108_FEEDBACK_KDF_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + 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 }, + 16usize, + 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 }, + 24usize, + 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 }, + 32usize, + 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 }, + 40usize, + 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 }, + 48usize, + concat!( + "Offset of field: ", + stringify!(CK_SP800_108_FEEDBACK_KDF_PARAMS), + "::", + stringify!(pAdditionalDerivedKeys) + ) + ); +} +impl Default for CK_SP800_108_FEEDBACK_KDF_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_SP800_108_FEEDBACK_KDF_PARAMS_PTR = *mut CK_SP800_108_FEEDBACK_KDF_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_EDDSA_PARAMS { + pub phFlag: CK_BBOOL, + 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::(), + 24usize, + concat!("Size of: ", stringify!(CK_EDDSA_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + concat!( + "Offset of field: ", + stringify!(CK_EDDSA_PARAMS), + "::", + stringify!(ulContextDataLen) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pContextData) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(CK_EDDSA_PARAMS), + "::", + stringify!(pContextData) + ) + ); +} +impl Default for CK_EDDSA_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_EDDSA_PARAMS_PTR = *mut CK_EDDSA_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_CHACHA20_PARAMS { + pub pBlockCounter: CK_BYTE_PTR, + pub blockCounterBits: CK_ULONG, + 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::(), + 32usize, + concat!("Size of: ", stringify!(CK_CHACHA20_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 16usize, + concat!( + "Offset of field: ", + stringify!(CK_CHACHA20_PARAMS), + "::", + stringify!(pNonce) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ulNonceBits) as usize - ptr as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(CK_CHACHA20_PARAMS), + "::", + stringify!(ulNonceBits) + ) + ); +} +impl Default for CK_CHACHA20_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_SALSA20_PARAMS { + pub pBlockCounter: CK_BYTE_PTR, + 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::(), + 24usize, + concat!("Size of: ", stringify!(CK_SALSA20_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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) + ) + ); +} +impl Default for CK_SALSA20_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_SALSA20_CHACHA20_POLY1305_PARAMS { + pub pNonce: CK_BYTE_PTR, + pub ulNonceLen: CK_ULONG, + 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::(), + 32usize, + concat!("Size of: ", stringify!(CK_SALSA20_CHACHA20_POLY1305_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 16usize, + 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 }, + 24usize, + concat!( + "Offset of field: ", + stringify!(CK_SALSA20_CHACHA20_POLY1305_PARAMS), + "::", + stringify!(ulAADLen) + ) + ); +} +impl Default for CK_SALSA20_CHACHA20_POLY1305_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_SALSA20_CHACHA20_POLY1305_PARAMS_PTR = *mut CK_SALSA20_CHACHA20_POLY1305_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_SALSA20_CHACHA20_POLY1305_MSG_PARAMS { + pub pNonce: CK_BYTE_PTR, + 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::(), + 24usize, + concat!( + "Size of: ", + stringify!(CK_SALSA20_CHACHA20_POLY1305_MSG_PARAMS) + ) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 16usize, + concat!( + "Offset of field: ", + stringify!(CK_SALSA20_CHACHA20_POLY1305_MSG_PARAMS), + "::", + stringify!(pTag) + ) + ); +} +impl Default for CK_SALSA20_CHACHA20_POLY1305_MSG_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_SALSA20_CHACHA20_POLY1305_MSG_PARAMS_PTR = *mut CK_SALSA20_CHACHA20_POLY1305_MSG_PARAMS; +pub type CK_X3DH_KDF_TYPE = CK_ULONG; +pub type CK_X3DH_KDF_TYPE_PTR = *mut CK_X3DH_KDF_TYPE; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_X3DH_INITIATE_PARAMS { + pub kdf: CK_X3DH_KDF_TYPE, + pub pPeer_identity: CK_OBJECT_HANDLE, + pub pPeer_prekey: CK_OBJECT_HANDLE, + pub pPrekey_signature: CK_BYTE_PTR, + pub pOnetime_key: CK_BYTE_PTR, + 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::(), + 56usize, + concat!("Size of: ", stringify!(CK_X3DH_INITIATE_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + 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 }, + 16usize, + 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 }, + 24usize, + 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 }, + 32usize, + 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 }, + 40usize, + 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 }, + 48usize, + concat!( + "Offset of field: ", + stringify!(CK_X3DH_INITIATE_PARAMS), + "::", + stringify!(pOwn_ephemeral) + ) + ); +} +impl Default for CK_X3DH_INITIATE_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_X3DH_RESPOND_PARAMS { + pub kdf: CK_X3DH_KDF_TYPE, + pub pIdentity_id: CK_BYTE_PTR, + pub pPrekey_id: CK_BYTE_PTR, + pub pOnetime_id: CK_BYTE_PTR, + 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::(), + 48usize, + concat!("Size of: ", stringify!(CK_X3DH_RESPOND_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + 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 }, + 16usize, + 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 }, + 24usize, + 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 }, + 32usize, + 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 }, + 40usize, + concat!( + "Offset of field: ", + stringify!(CK_X3DH_RESPOND_PARAMS), + "::", + stringify!(pInitiator_ephemeral) + ) + ); +} +impl Default for CK_X3DH_RESPOND_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_X2RATCHET_KDF_TYPE = CK_ULONG; +pub type CK_X2RATCHET_KDF_TYPE_PTR = *mut CK_X2RATCHET_KDF_TYPE; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_X2RATCHET_INITIALIZE_PARAMS { + pub sk: CK_BYTE_PTR, + pub peer_public_prekey: CK_OBJECT_HANDLE, + pub peer_public_identity: CK_OBJECT_HANDLE, + pub own_public_identity: CK_OBJECT_HANDLE, + pub bEncryptedHeader: CK_BBOOL, + pub eCurve: CK_ULONG, + 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::(), + 64usize, + concat!("Size of: ", stringify!(CK_X2RATCHET_INITIALIZE_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 16usize, + 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 }, + 24usize, + 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 }, + 32usize, + 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 }, + 40usize, + 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 }, + 48usize, + 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 }, + 56usize, + concat!( + "Offset of field: ", + stringify!(CK_X2RATCHET_INITIALIZE_PARAMS), + "::", + stringify!(kdfMechanism) + ) + ); +} +impl Default for CK_X2RATCHET_INITIALIZE_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_X2RATCHET_INITIALIZE_PARAMS_PTR = *mut CK_X2RATCHET_INITIALIZE_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_X2RATCHET_RESPOND_PARAMS { + pub sk: CK_BYTE_PTR, + pub own_prekey: CK_OBJECT_HANDLE, + pub initiator_identity: CK_OBJECT_HANDLE, + pub own_public_identity: CK_OBJECT_HANDLE, + pub bEncryptedHeader: CK_BBOOL, + pub eCurve: CK_ULONG, + 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::(), + 64usize, + concat!("Size of: ", stringify!(CK_X2RATCHET_RESPOND_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 16usize, + 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 }, + 24usize, + 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 }, + 32usize, + 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 }, + 40usize, + 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 }, + 48usize, + 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 }, + 56usize, + concat!( + "Offset of field: ", + stringify!(CK_X2RATCHET_RESPOND_PARAMS), + "::", + stringify!(kdfMechanism) + ) + ); +} +impl Default for CK_X2RATCHET_RESPOND_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_X2RATCHET_RESPOND_PARAMS_PTR = *mut CK_X2RATCHET_RESPOND_PARAMS; +pub type CK_XEDDSA_HASH_TYPE = CK_ULONG; +pub type CK_XEDDSA_HASH_TYPE_PTR = *mut CK_XEDDSA_HASH_TYPE; +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +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::(), + 8usize, + concat!("Size of: ", stringify!(CK_XEDDSA_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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) + ) + ); +} +pub type CK_XEDDSA_PARAMS_PTR = *mut CK_XEDDSA_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_HKDF_PARAMS { + pub bExtract: CK_BBOOL, + pub bExpand: CK_BBOOL, + pub prfHashMechanism: CK_MECHANISM_TYPE, + pub ulSaltType: CK_ULONG, + pub pSalt: CK_BYTE_PTR, + pub ulSaltLen: CK_ULONG, + pub hSaltKey: CK_ULONG, + 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::(), + 64usize, + concat!("Size of: ", stringify!(CK_HKDF_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + concat!( + "Offset of field: ", + stringify!(CK_HKDF_PARAMS), + "::", + stringify!(prfHashMechanism) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ulSaltType) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(CK_HKDF_PARAMS), + "::", + stringify!(ulSaltType) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pSalt) as usize - ptr as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(CK_HKDF_PARAMS), + "::", + stringify!(pSalt) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ulSaltLen) as usize - ptr as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(CK_HKDF_PARAMS), + "::", + stringify!(ulSaltLen) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).hSaltKey) as usize - ptr as usize }, + 40usize, + concat!( + "Offset of field: ", + stringify!(CK_HKDF_PARAMS), + "::", + stringify!(hSaltKey) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pInfo) as usize - ptr as usize }, + 48usize, + concat!( + "Offset of field: ", + stringify!(CK_HKDF_PARAMS), + "::", + stringify!(pInfo) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ulInfoLen) as usize - ptr as usize }, + 56usize, + concat!( + "Offset of field: ", + stringify!(CK_HKDF_PARAMS), + "::", + stringify!(ulInfoLen) + ) + ); +} +impl Default for CK_HKDF_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_C_Initialize = + ::std::option::Option CK_RV>; +pub type CK_C_Finalize = + ::std::option::Option CK_RV>; +pub type CK_C_GetInfo = ::std::option::Option CK_RV>; +pub type CK_C_GetFunctionList = + ::std::option::Option CK_RV>; +pub type CK_C_GetSlotList = ::std::option::Option< unsafe extern "C" fn( - flags: CK_FLAGS, - slot: *mut CK_SLOT_ID, - pReserved: *mut ::std::os::raw::c_void, + tokenPresent: CK_BBOOL, + pSlotList: CK_SLOT_ID_PTR, + pulCount: CK_ULONG_PTR, ) -> CK_RV, >; +pub type CK_C_GetSlotInfo = ::std::option::Option< + unsafe extern "C" fn(slotID: CK_SLOT_ID, pInfo: CK_SLOT_INFO_PTR) -> CK_RV, +>; +pub type CK_C_GetTokenInfo = ::std::option::Option< + unsafe extern "C" fn(slotID: CK_SLOT_ID, pInfo: CK_TOKEN_INFO_PTR) -> CK_RV, +>; pub type CK_C_GetMechanismList = ::std::option::Option< unsafe extern "C" fn( slotID: CK_SLOT_ID, - mechanism_list: *mut CK_MECHANISM_TYPE, - ulCount: *mut ::std::os::raw::c_ulong, + pMechanismList: CK_MECHANISM_TYPE_PTR, + pulCount: CK_ULONG_PTR, ) -> CK_RV, >; pub type CK_C_GetMechanismInfo = ::std::option::Option< unsafe extern "C" fn( slotID: CK_SLOT_ID, type_: CK_MECHANISM_TYPE, - info: *mut _CK_MECHANISM_INFO, + pInfo: CK_MECHANISM_INFO_PTR, ) -> CK_RV, >; pub type CK_C_InitToken = ::std::option::Option< unsafe extern "C" fn( slotID: CK_SLOT_ID, - pin: *mut ::std::os::raw::c_uchar, - pin_len: ::std::os::raw::c_ulong, - label: *mut ::std::os::raw::c_uchar, + pPin: CK_UTF8CHAR_PTR, + ulPinLen: CK_ULONG, + pLabel: CK_UTF8CHAR_PTR, ) -> CK_RV, >; pub type CK_C_InitPIN = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - pin: *mut ::std::os::raw::c_uchar, - pin_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pPin: CK_UTF8CHAR_PTR, + ulPinLen: CK_ULONG, ) -> CK_RV, >; pub type CK_C_SetPIN = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - old_pin: *mut ::std::os::raw::c_uchar, - old_len: ::std::os::raw::c_ulong, - new_pin: *mut ::std::os::raw::c_uchar, - new_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pOldPin: CK_UTF8CHAR_PTR, + ulOldLen: CK_ULONG, + pNewPin: CK_UTF8CHAR_PTR, + ulNewLen: CK_ULONG, ) -> CK_RV, >; pub type CK_C_OpenSession = ::std::option::Option< unsafe extern "C" fn( slotID: CK_SLOT_ID, flags: CK_FLAGS, - application: *mut ::std::os::raw::c_void, - notify: CK_NOTIFY, - session: *mut CK_SESSION_HANDLE, + pApplication: CK_VOID_PTR, + Notify: CK_NOTIFY, + phSession: CK_SESSION_HANDLE_PTR, ) -> CK_RV, >; pub type CK_C_CloseSession = - ::std::option::Option CK_RV>; + ::std::option::Option CK_RV>; pub type CK_C_CloseAllSessions = ::std::option::Option CK_RV>; pub type CK_C_GetSessionInfo = ::std::option::Option< - unsafe extern "C" fn(session: CK_SESSION_HANDLE, info: *mut _CK_SESSION_INFO) -> CK_RV, + unsafe extern "C" fn(hSession: CK_SESSION_HANDLE, pInfo: CK_SESSION_INFO_PTR) -> CK_RV, >; pub type CK_C_GetOperationState = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - operation_state: *mut ::std::os::raw::c_uchar, - operation_state_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pOperationState: CK_BYTE_PTR, + pulOperationStateLen: CK_ULONG_PTR, ) -> CK_RV, >; pub type CK_C_SetOperationState = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - operation_state: *mut ::std::os::raw::c_uchar, - operation_state_len: ::std::os::raw::c_ulong, - encryption_key: CK_OBJECT_HANDLE, - authentiation_key: CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pOperationState: CK_BYTE_PTR, + ulOperationStateLen: CK_ULONG, + hEncryptionKey: CK_OBJECT_HANDLE, + hAuthenticationKey: CK_OBJECT_HANDLE, ) -> CK_RV, >; pub type CK_C_Login = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - user_type: CK_USER_TYPE, - pin: *mut ::std::os::raw::c_uchar, - pin_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + userType: CK_USER_TYPE, + pPin: CK_UTF8CHAR_PTR, + ulPinLen: CK_ULONG, ) -> CK_RV, >; pub type CK_C_Logout = - ::std::option::Option CK_RV>; + ::std::option::Option CK_RV>; pub type CK_C_CreateObject = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - templ: *mut _CK_ATTRIBUTE, - ulCount: ::std::os::raw::c_ulong, - object: *mut CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pTemplate: CK_ATTRIBUTE_PTR, + ulCount: CK_ULONG, + phObject: CK_OBJECT_HANDLE_PTR, ) -> CK_RV, >; pub type CK_C_CopyObject = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - object: CK_OBJECT_HANDLE, - templ: *mut _CK_ATTRIBUTE, - ulCount: ::std::os::raw::c_ulong, - new_object: *mut CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + hObject: CK_OBJECT_HANDLE, + pTemplate: CK_ATTRIBUTE_PTR, + ulCount: CK_ULONG, + phNewObject: CK_OBJECT_HANDLE_PTR, ) -> CK_RV, >; pub type CK_C_DestroyObject = ::std::option::Option< - unsafe extern "C" fn(session: CK_SESSION_HANDLE, object: CK_OBJECT_HANDLE) -> CK_RV, + unsafe extern "C" fn(hSession: CK_SESSION_HANDLE, hObject: CK_OBJECT_HANDLE) -> CK_RV, >; pub type CK_C_GetObjectSize = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - object: CK_OBJECT_HANDLE, - size: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + hObject: CK_OBJECT_HANDLE, + pulSize: CK_ULONG_PTR, ) -> CK_RV, >; pub type CK_C_GetAttributeValue = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - object: CK_OBJECT_HANDLE, - templ: *mut _CK_ATTRIBUTE, - ulCount: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + hObject: CK_OBJECT_HANDLE, + pTemplate: CK_ATTRIBUTE_PTR, + ulCount: CK_ULONG, ) -> CK_RV, >; pub type CK_C_SetAttributeValue = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - object: CK_OBJECT_HANDLE, - templ: *mut _CK_ATTRIBUTE, - ulCount: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + hObject: CK_OBJECT_HANDLE, + pTemplate: CK_ATTRIBUTE_PTR, + ulCount: CK_ULONG, ) -> CK_RV, >; pub type CK_C_FindObjectsInit = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - templ: *mut _CK_ATTRIBUTE, - ulCount: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pTemplate: CK_ATTRIBUTE_PTR, + ulCount: CK_ULONG, ) -> CK_RV, >; pub type CK_C_FindObjects = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - object: *mut CK_OBJECT_HANDLE, - max_object_count: ::std::os::raw::c_ulong, - object_count: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + phObject: CK_OBJECT_HANDLE_PTR, + ulMaxObjectCount: CK_ULONG, + pulObjectCount: CK_ULONG_PTR, ) -> CK_RV, >; pub type CK_C_FindObjectsFinal = - ::std::option::Option CK_RV>; + ::std::option::Option CK_RV>; pub type CK_C_EncryptInit = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - key: CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, ) -> CK_RV, >; pub type CK_C_Encrypt = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - data: *mut ::std::os::raw::c_uchar, - data_len: ::std::os::raw::c_ulong, - encrypted_data: *mut ::std::os::raw::c_uchar, - encrypted_data_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pEncryptedData: CK_BYTE_PTR, + pulEncryptedDataLen: CK_ULONG_PTR, ) -> CK_RV, >; pub type CK_C_EncryptUpdate = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - part: *mut ::std::os::raw::c_uchar, - part_len: ::std::os::raw::c_ulong, - encrypted_part: *mut ::std::os::raw::c_uchar, - encrypted_part_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pPart: CK_BYTE_PTR, + ulPartLen: CK_ULONG, + pEncryptedPart: CK_BYTE_PTR, + pulEncryptedPartLen: CK_ULONG_PTR, ) -> CK_RV, >; pub type CK_C_EncryptFinal = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - last_encrypted_part: *mut ::std::os::raw::c_uchar, - last_encrypted_part_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pLastEncryptedPart: CK_BYTE_PTR, + pulLastEncryptedPartLen: CK_ULONG_PTR, ) -> CK_RV, >; pub type CK_C_DecryptInit = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - key: CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, ) -> CK_RV, >; pub type CK_C_Decrypt = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - encrypted_data: *mut ::std::os::raw::c_uchar, - encrypted_data_len: ::std::os::raw::c_ulong, - data: *mut ::std::os::raw::c_uchar, - data_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pEncryptedData: CK_BYTE_PTR, + ulEncryptedDataLen: CK_ULONG, + pData: CK_BYTE_PTR, + pulDataLen: CK_ULONG_PTR, ) -> CK_RV, >; pub type CK_C_DecryptUpdate = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - encrypted_part: *mut ::std::os::raw::c_uchar, - encrypted_part_len: ::std::os::raw::c_ulong, - part: *mut ::std::os::raw::c_uchar, - part_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pEncryptedPart: CK_BYTE_PTR, + ulEncryptedPartLen: CK_ULONG, + pPart: CK_BYTE_PTR, + pulPartLen: CK_ULONG_PTR, ) -> CK_RV, >; pub type CK_C_DecryptFinal = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - last_part: *mut ::std::os::raw::c_uchar, - last_part_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pLastPart: CK_BYTE_PTR, + pulLastPartLen: CK_ULONG_PTR, ) -> CK_RV, >; pub type CK_C_DigestInit = ::std::option::Option< - unsafe extern "C" fn(session: CK_SESSION_HANDLE, mechanism: *mut _CK_MECHANISM) -> CK_RV, + unsafe extern "C" fn(hSession: CK_SESSION_HANDLE, pMechanism: CK_MECHANISM_PTR) -> CK_RV, >; pub type CK_C_Digest = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - data: *mut ::std::os::raw::c_uchar, - data_len: ::std::os::raw::c_ulong, - digest: *mut ::std::os::raw::c_uchar, - digest_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pDigest: CK_BYTE_PTR, + pulDigestLen: CK_ULONG_PTR, ) -> CK_RV, >; pub type CK_C_DigestUpdate = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - part: *mut ::std::os::raw::c_uchar, - part_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pPart: CK_BYTE_PTR, + ulPartLen: CK_ULONG, ) -> CK_RV, >; pub type CK_C_DigestKey = ::std::option::Option< - unsafe extern "C" fn(session: CK_SESSION_HANDLE, key: CK_OBJECT_HANDLE) -> CK_RV, + unsafe extern "C" fn(hSession: CK_SESSION_HANDLE, hKey: CK_OBJECT_HANDLE) -> CK_RV, >; pub type CK_C_DigestFinal = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - digest: *mut ::std::os::raw::c_uchar, - digest_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pDigest: CK_BYTE_PTR, + pulDigestLen: CK_ULONG_PTR, ) -> CK_RV, >; pub type CK_C_SignInit = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - key: CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, ) -> CK_RV, >; pub type CK_C_Sign = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - data: *mut ::std::os::raw::c_uchar, - data_len: ::std::os::raw::c_ulong, - signature: *mut ::std::os::raw::c_uchar, - signature_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + pulSignatureLen: CK_ULONG_PTR, ) -> CK_RV, >; pub type CK_C_SignUpdate = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - part: *mut ::std::os::raw::c_uchar, - part_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pPart: CK_BYTE_PTR, + ulPartLen: CK_ULONG, ) -> CK_RV, >; pub type CK_C_SignFinal = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - signature: *mut ::std::os::raw::c_uchar, - signature_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pSignature: CK_BYTE_PTR, + pulSignatureLen: CK_ULONG_PTR, ) -> CK_RV, >; pub type CK_C_SignRecoverInit = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - key: CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, ) -> CK_RV, >; pub type CK_C_SignRecover = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - data: *mut ::std::os::raw::c_uchar, - data_len: ::std::os::raw::c_ulong, - signature: *mut ::std::os::raw::c_uchar, - signature_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + pulSignatureLen: CK_ULONG_PTR, ) -> CK_RV, >; pub type CK_C_VerifyInit = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - key: CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, ) -> CK_RV, >; pub type CK_C_Verify = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - data: *mut ::std::os::raw::c_uchar, - data_len: ::std::os::raw::c_ulong, - signature: *mut ::std::os::raw::c_uchar, - signature_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + ulSignatureLen: CK_ULONG, ) -> CK_RV, >; pub type CK_C_VerifyUpdate = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - part: *mut ::std::os::raw::c_uchar, - part_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pPart: CK_BYTE_PTR, + ulPartLen: CK_ULONG, ) -> CK_RV, >; pub type CK_C_VerifyFinal = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - signature: *mut ::std::os::raw::c_uchar, - signature_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pSignature: CK_BYTE_PTR, + ulSignatureLen: CK_ULONG, ) -> CK_RV, >; pub type CK_C_VerifyRecoverInit = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - key: CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, ) -> CK_RV, >; pub type CK_C_VerifyRecover = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - signature: *mut ::std::os::raw::c_uchar, - signature_len: ::std::os::raw::c_ulong, - data: *mut ::std::os::raw::c_uchar, - data_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pSignature: CK_BYTE_PTR, + ulSignatureLen: CK_ULONG, + pData: CK_BYTE_PTR, + pulDataLen: CK_ULONG_PTR, ) -> CK_RV, >; pub type CK_C_DigestEncryptUpdate = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - part: *mut ::std::os::raw::c_uchar, - part_len: ::std::os::raw::c_ulong, - encrypted_part: *mut ::std::os::raw::c_uchar, - encrypted_part_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pPart: CK_BYTE_PTR, + ulPartLen: CK_ULONG, + pEncryptedPart: CK_BYTE_PTR, + pulEncryptedPartLen: CK_ULONG_PTR, ) -> CK_RV, >; pub type CK_C_DecryptDigestUpdate = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - encrypted_part: *mut ::std::os::raw::c_uchar, - encrypted_part_len: ::std::os::raw::c_ulong, - part: *mut ::std::os::raw::c_uchar, - part_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pEncryptedPart: CK_BYTE_PTR, + ulEncryptedPartLen: CK_ULONG, + pPart: CK_BYTE_PTR, + pulPartLen: CK_ULONG_PTR, ) -> CK_RV, >; pub type CK_C_SignEncryptUpdate = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - part: *mut ::std::os::raw::c_uchar, - part_len: ::std::os::raw::c_ulong, - encrypted_part: *mut ::std::os::raw::c_uchar, - encrypted_part_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pPart: CK_BYTE_PTR, + ulPartLen: CK_ULONG, + pEncryptedPart: CK_BYTE_PTR, + pulEncryptedPartLen: CK_ULONG_PTR, ) -> CK_RV, >; pub type CK_C_DecryptVerifyUpdate = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - encrypted_part: *mut ::std::os::raw::c_uchar, - encrypted_part_len: ::std::os::raw::c_ulong, - part: *mut ::std::os::raw::c_uchar, - part_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pEncryptedPart: CK_BYTE_PTR, + ulEncryptedPartLen: CK_ULONG, + pPart: CK_BYTE_PTR, + pulPartLen: CK_ULONG_PTR, ) -> CK_RV, >; pub type CK_C_GenerateKey = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - templ: *mut _CK_ATTRIBUTE, - ulCount: ::std::os::raw::c_ulong, - key: *mut CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + pTemplate: CK_ATTRIBUTE_PTR, + ulCount: CK_ULONG, + phKey: CK_OBJECT_HANDLE_PTR, ) -> CK_RV, >; pub type CK_C_GenerateKeyPair = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - public_key_template: *mut _CK_ATTRIBUTE, - public_key_attribute_count: ::std::os::raw::c_ulong, - private_key_template: *mut _CK_ATTRIBUTE, - private_key_attribute_count: ::std::os::raw::c_ulong, - public_key: *mut CK_OBJECT_HANDLE, - private_key: *mut CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + pPublicKeyTemplate: CK_ATTRIBUTE_PTR, + ulPublicKeyAttributeCount: CK_ULONG, + pPrivateKeyTemplate: CK_ATTRIBUTE_PTR, + ulPrivateKeyAttributeCount: CK_ULONG, + phPublicKey: CK_OBJECT_HANDLE_PTR, + phPrivateKey: CK_OBJECT_HANDLE_PTR, ) -> CK_RV, >; pub type CK_C_WrapKey = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - wrapping_key: CK_OBJECT_HANDLE, - key: CK_OBJECT_HANDLE, - wrapped_key: *mut ::std::os::raw::c_uchar, - wrapped_key_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hWrappingKey: CK_OBJECT_HANDLE, + hKey: CK_OBJECT_HANDLE, + pWrappedKey: CK_BYTE_PTR, + pulWrappedKeyLen: CK_ULONG_PTR, ) -> CK_RV, >; pub type CK_C_UnwrapKey = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - unwrapping_key: CK_OBJECT_HANDLE, - wrapped_key: *mut ::std::os::raw::c_uchar, - wrapped_key_len: ::std::os::raw::c_ulong, - templ: *mut _CK_ATTRIBUTE, - attribute_count: ::std::os::raw::c_ulong, - key: *mut CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hUnwrappingKey: CK_OBJECT_HANDLE, + pWrappedKey: CK_BYTE_PTR, + ulWrappedKeyLen: CK_ULONG, + pTemplate: CK_ATTRIBUTE_PTR, + ulAttributeCount: CK_ULONG, + phKey: CK_OBJECT_HANDLE_PTR, ) -> CK_RV, >; pub type CK_C_DeriveKey = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - base_key: CK_OBJECT_HANDLE, - templ: *mut _CK_ATTRIBUTE, - attribute_count: ::std::os::raw::c_ulong, - key: *mut CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hBaseKey: CK_OBJECT_HANDLE, + pTemplate: CK_ATTRIBUTE_PTR, + ulAttributeCount: CK_ULONG, + phKey: CK_OBJECT_HANDLE_PTR, ) -> CK_RV, >; pub type CK_C_SeedRandom = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - seed: *mut ::std::os::raw::c_uchar, - seed_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pSeed: CK_BYTE_PTR, + ulSeedLen: CK_ULONG, ) -> CK_RV, >; pub type CK_C_GenerateRandom = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - random_data: *mut ::std::os::raw::c_uchar, - random_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + RandomData: CK_BYTE_PTR, + ulRandomLen: CK_ULONG, ) -> CK_RV, >; pub type CK_C_GetFunctionStatus = - ::std::option::Option CK_RV>; + ::std::option::Option CK_RV>; pub type CK_C_CancelFunction = - ::std::option::Option CK_RV>; + ::std::option::Option CK_RV>; +pub type CK_C_WaitForSlotEvent = ::std::option::Option< + unsafe extern "C" fn(flags: CK_FLAGS, pSlot: CK_SLOT_ID_PTR, pRserved: CK_VOID_PTR) -> CK_RV, +>; +pub type CK_C_GetInterfaceList = ::std::option::Option< + unsafe extern "C" fn(pInterfacesList: CK_INTERFACE_PTR, pulCount: CK_ULONG_PTR) -> CK_RV, +>; +pub type CK_C_GetInterface = ::std::option::Option< + unsafe extern "C" fn( + pInterfaceName: CK_UTF8CHAR_PTR, + pVersion: CK_VERSION_PTR, + ppInterface: CK_INTERFACE_PTR_PTR, + flags: CK_FLAGS, + ) -> CK_RV, +>; +pub type CK_C_LoginUser = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + userType: CK_USER_TYPE, + pPin: CK_UTF8CHAR_PTR, + ulPinLen: CK_ULONG, + pUsername: CK_UTF8CHAR_PTR, + ulUsernameLen: CK_ULONG, + ) -> CK_RV, +>; +pub type CK_C_SessionCancel = ::std::option::Option< + unsafe extern "C" fn(hSession: CK_SESSION_HANDLE, flags: CK_FLAGS) -> CK_RV, +>; +pub type CK_C_MessageEncryptInit = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, + ) -> CK_RV, +>; +pub type CK_C_EncryptMessage = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pAssociatedData: CK_BYTE_PTR, + ulAssociatedDataLen: CK_ULONG, + pPlaintext: CK_BYTE_PTR, + ulPlaintextLen: CK_ULONG, + pCiphertext: CK_BYTE_PTR, + pulCiphertextLen: CK_ULONG_PTR, + ) -> CK_RV, +>; +pub type CK_C_EncryptMessageBegin = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pAssociatedData: CK_BYTE_PTR, + ulAssociatedDataLen: CK_ULONG, + ) -> CK_RV, +>; +pub type CK_C_EncryptMessageNext = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pPlaintextPart: CK_BYTE_PTR, + ulPlaintextPartLen: CK_ULONG, + pCiphertextPart: CK_BYTE_PTR, + pulCiphertextPartLen: CK_ULONG_PTR, + flags: CK_FLAGS, + ) -> CK_RV, +>; +pub type CK_C_MessageEncryptFinal = + ::std::option::Option CK_RV>; +pub type CK_C_MessageDecryptInit = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, + ) -> CK_RV, +>; +pub type CK_C_DecryptMessage = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pAssociatedData: CK_BYTE_PTR, + ulAssociatedDataLen: CK_ULONG, + pCiphertext: CK_BYTE_PTR, + ulCiphertextLen: CK_ULONG, + pPlaintext: CK_BYTE_PTR, + pulPlaintextLen: CK_ULONG_PTR, + ) -> CK_RV, +>; +pub type CK_C_DecryptMessageBegin = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pAssociatedData: CK_BYTE_PTR, + ulAssociatedDataLen: CK_ULONG, + ) -> CK_RV, +>; +pub type CK_C_DecryptMessageNext = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pCiphertext: CK_BYTE_PTR, + ulCiphertextLen: CK_ULONG, + pPlaintext: CK_BYTE_PTR, + pulPlaintextLen: CK_ULONG_PTR, + flags: CK_FLAGS, + ) -> CK_RV, +>; +pub type CK_C_MessageDecryptFinal = + ::std::option::Option CK_RV>; +pub type CK_C_MessageSignInit = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, + ) -> CK_RV, +>; +pub type CK_C_SignMessage = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + pulSignatureLen: CK_ULONG_PTR, + ) -> CK_RV, +>; +pub type CK_C_SignMessageBegin = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + ) -> CK_RV, +>; +pub type CK_C_SignMessageNext = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + pulSignatureLen: CK_ULONG_PTR, + ) -> CK_RV, +>; +pub type CK_C_MessageSignFinal = + ::std::option::Option CK_RV>; +pub type CK_C_MessageVerifyInit = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, + ) -> CK_RV, +>; +pub type CK_C_VerifyMessage = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + ulSignatureLen: CK_ULONG, + ) -> CK_RV, +>; +pub type CK_C_VerifyMessageBegin = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + ) -> CK_RV, +>; +pub type CK_C_VerifyMessageNext = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + ulSignatureLen: CK_ULONG, + ) -> CK_RV, +>; +pub type CK_C_MessageVerifyFinal = + ::std::option::Option CK_RV>; +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct CK_FUNCTION_LIST_3_0 { + pub version: CK_VERSION, + pub C_Initialize: CK_C_Initialize, + pub C_Finalize: CK_C_Finalize, + pub C_GetInfo: CK_C_GetInfo, + pub C_GetFunctionList: CK_C_GetFunctionList, + pub C_GetSlotList: CK_C_GetSlotList, + pub C_GetSlotInfo: CK_C_GetSlotInfo, + pub C_GetTokenInfo: CK_C_GetTokenInfo, + pub C_GetMechanismList: CK_C_GetMechanismList, + pub C_GetMechanismInfo: CK_C_GetMechanismInfo, + pub C_InitToken: CK_C_InitToken, + pub C_InitPIN: CK_C_InitPIN, + pub C_SetPIN: CK_C_SetPIN, + pub C_OpenSession: CK_C_OpenSession, + pub C_CloseSession: CK_C_CloseSession, + pub C_CloseAllSessions: CK_C_CloseAllSessions, + pub C_GetSessionInfo: CK_C_GetSessionInfo, + pub C_GetOperationState: CK_C_GetOperationState, + pub C_SetOperationState: CK_C_SetOperationState, + pub C_Login: CK_C_Login, + pub C_Logout: CK_C_Logout, + pub C_CreateObject: CK_C_CreateObject, + pub C_CopyObject: CK_C_CopyObject, + pub C_DestroyObject: CK_C_DestroyObject, + pub C_GetObjectSize: CK_C_GetObjectSize, + pub C_GetAttributeValue: CK_C_GetAttributeValue, + pub C_SetAttributeValue: CK_C_SetAttributeValue, + pub C_FindObjectsInit: CK_C_FindObjectsInit, + pub C_FindObjects: CK_C_FindObjects, + pub C_FindObjectsFinal: CK_C_FindObjectsFinal, + pub C_EncryptInit: CK_C_EncryptInit, + pub C_Encrypt: CK_C_Encrypt, + pub C_EncryptUpdate: CK_C_EncryptUpdate, + pub C_EncryptFinal: CK_C_EncryptFinal, + pub C_DecryptInit: CK_C_DecryptInit, + pub C_Decrypt: CK_C_Decrypt, + pub C_DecryptUpdate: CK_C_DecryptUpdate, + pub C_DecryptFinal: CK_C_DecryptFinal, + pub C_DigestInit: CK_C_DigestInit, + pub C_Digest: CK_C_Digest, + pub C_DigestUpdate: CK_C_DigestUpdate, + pub C_DigestKey: CK_C_DigestKey, + pub C_DigestFinal: CK_C_DigestFinal, + pub C_SignInit: CK_C_SignInit, + pub C_Sign: CK_C_Sign, + pub C_SignUpdate: CK_C_SignUpdate, + pub C_SignFinal: CK_C_SignFinal, + pub C_SignRecoverInit: CK_C_SignRecoverInit, + pub C_SignRecover: CK_C_SignRecover, + pub C_VerifyInit: CK_C_VerifyInit, + pub C_Verify: CK_C_Verify, + pub C_VerifyUpdate: CK_C_VerifyUpdate, + pub C_VerifyFinal: CK_C_VerifyFinal, + pub C_VerifyRecoverInit: CK_C_VerifyRecoverInit, + pub C_VerifyRecover: CK_C_VerifyRecover, + pub C_DigestEncryptUpdate: CK_C_DigestEncryptUpdate, + pub C_DecryptDigestUpdate: CK_C_DecryptDigestUpdate, + pub C_SignEncryptUpdate: CK_C_SignEncryptUpdate, + pub C_DecryptVerifyUpdate: CK_C_DecryptVerifyUpdate, + pub C_GenerateKey: CK_C_GenerateKey, + pub C_GenerateKeyPair: CK_C_GenerateKeyPair, + pub C_WrapKey: CK_C_WrapKey, + pub C_UnwrapKey: CK_C_UnwrapKey, + pub C_DeriveKey: CK_C_DeriveKey, + pub C_SeedRandom: CK_C_SeedRandom, + pub C_GenerateRandom: CK_C_GenerateRandom, + pub C_GetFunctionStatus: CK_C_GetFunctionStatus, + pub C_CancelFunction: CK_C_CancelFunction, + pub C_WaitForSlotEvent: CK_C_WaitForSlotEvent, + pub C_GetInterfaceList: CK_C_GetInterfaceList, + pub C_GetInterface: CK_C_GetInterface, + pub C_LoginUser: CK_C_LoginUser, + pub C_SessionCancel: CK_C_SessionCancel, + pub C_MessageEncryptInit: CK_C_MessageEncryptInit, + pub C_EncryptMessage: CK_C_EncryptMessage, + pub C_EncryptMessageBegin: CK_C_EncryptMessageBegin, + pub C_EncryptMessageNext: CK_C_EncryptMessageNext, + pub C_MessageEncryptFinal: CK_C_MessageEncryptFinal, + pub C_MessageDecryptInit: CK_C_MessageDecryptInit, + pub C_DecryptMessage: CK_C_DecryptMessage, + pub C_DecryptMessageBegin: CK_C_DecryptMessageBegin, + pub C_DecryptMessageNext: CK_C_DecryptMessageNext, + pub C_MessageDecryptFinal: CK_C_MessageDecryptFinal, + pub C_MessageSignInit: CK_C_MessageSignInit, + pub C_SignMessage: CK_C_SignMessage, + pub C_SignMessageBegin: CK_C_SignMessageBegin, + pub C_SignMessageNext: CK_C_SignMessageNext, + pub C_MessageSignFinal: CK_C_MessageSignFinal, + pub C_MessageVerifyInit: CK_C_MessageVerifyInit, + pub C_VerifyMessage: CK_C_VerifyMessage, + pub C_VerifyMessageBegin: CK_C_VerifyMessageBegin, + 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::(), + 744usize, + concat!("Size of: ", stringify!(CK_FUNCTION_LIST_3_0)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + 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 }, + 16usize, + 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 }, + 24usize, + 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 }, + 32usize, + 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 }, + 40usize, + 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 }, + 48usize, + 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 }, + 56usize, + 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 }, + 64usize, + 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 }, + 72usize, + 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 }, + 80usize, + 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 }, + 88usize, + 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 }, + 96usize, + 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 }, + 104usize, + 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 }, + 112usize, + 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 }, + 120usize, + 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 }, + 128usize, + 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 }, + 136usize, + 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 }, + 144usize, + 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 }, + 152usize, + 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 }, + 160usize, + 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 }, + 168usize, + 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 }, + 176usize, + 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 }, + 184usize, + 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 }, + 192usize, + 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 }, + 200usize, + 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 }, + 208usize, + 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 }, + 216usize, + 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 }, + 224usize, + 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 }, + 232usize, + 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 }, + 240usize, + 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 }, + 248usize, + 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 }, + 256usize, + 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 }, + 264usize, + 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 }, + 272usize, + 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 }, + 280usize, + 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 }, + 288usize, + 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 }, + 296usize, + 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 }, + 304usize, + 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 }, + 312usize, + 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 }, + 320usize, + 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 }, + 328usize, + 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 }, + 336usize, + 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 }, + 344usize, + 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 }, + 352usize, + 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 }, + 360usize, + 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 }, + 368usize, + 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 }, + 376usize, + 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 }, + 384usize, + 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 }, + 392usize, + 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 }, + 400usize, + 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 }, + 408usize, + 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 }, + 416usize, + 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 }, + 424usize, + 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 }, + 432usize, + 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 }, + 440usize, + 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 }, + 448usize, + 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 }, + 456usize, + 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 }, + 464usize, + 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 }, + 472usize, + 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 }, + 480usize, + 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 }, + 488usize, + 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 }, + 496usize, + 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 }, + 504usize, + 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 }, + 512usize, + 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 }, + 520usize, + 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 }, + 528usize, + 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 }, + 536usize, + 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 }, + 544usize, + 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 }, + 552usize, + 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 }, + 560usize, + 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 }, + 568usize, + 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 }, + 576usize, + 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 }, + 584usize, + 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 }, + 592usize, + 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 }, + 600usize, + 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 }, + 608usize, + 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 }, + 616usize, + 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 }, + 624usize, + 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 }, + 632usize, + 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 }, + 640usize, + 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 }, + 648usize, + 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 }, + 656usize, + 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 }, + 664usize, + 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 }, + 672usize, + 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 }, + 680usize, + 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 }, + 688usize, + 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 }, + 696usize, + 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 }, + 704usize, + 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 }, + 712usize, + 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 }, + 720usize, + 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 }, + 728usize, + 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 }, + 736usize, + concat!( + "Offset of field: ", + stringify!(CK_FUNCTION_LIST_3_0), + "::", + stringify!(C_MessageVerifyFinal) + ) + ); +} #[repr(C)] #[derive(Debug, Default, Copy, Clone)] -pub struct _CK_FUNCTION_LIST { - pub version: _CK_VERSION, +pub struct CK_FUNCTION_LIST { + pub version: CK_VERSION, pub C_Initialize: CK_C_Initialize, pub C_Finalize: CK_C_Finalize, pub C_GetInfo: CK_C_GetInfo, @@ -2647,25 +9810,25 @@ pub struct _CK_FUNCTION_LIST { pub C_WaitForSlotEvent: CK_C_WaitForSlotEvent, } #[test] -fn bindgen_test_layout__CK_FUNCTION_LIST() { - const UNINIT: ::std::mem::MaybeUninit<_CK_FUNCTION_LIST> = ::std::mem::MaybeUninit::uninit(); +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::<_CK_FUNCTION_LIST>(), + ::std::mem::size_of::(), 552usize, - concat!("Size of: ", stringify!(_CK_FUNCTION_LIST)) + concat!("Size of: ", stringify!(CK_FUNCTION_LIST)) ); assert_eq!( - ::std::mem::align_of::<_CK_FUNCTION_LIST>(), + ::std::mem::align_of::(), 8usize, - concat!("Alignment of ", stringify!(_CK_FUNCTION_LIST)) + 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!(CK_FUNCTION_LIST), "::", stringify!(version) ) @@ -2675,7 +9838,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 8usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_Initialize) ) @@ -2685,7 +9848,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 16usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_Finalize) ) @@ -2695,7 +9858,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 24usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_GetInfo) ) @@ -2705,7 +9868,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 32usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_GetFunctionList) ) @@ -2715,7 +9878,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 40usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_GetSlotList) ) @@ -2725,7 +9888,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 48usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_GetSlotInfo) ) @@ -2735,7 +9898,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 56usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_GetTokenInfo) ) @@ -2745,7 +9908,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 64usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_GetMechanismList) ) @@ -2755,7 +9918,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 72usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_GetMechanismInfo) ) @@ -2765,7 +9928,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 80usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_InitToken) ) @@ -2775,7 +9938,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 88usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_InitPIN) ) @@ -2785,7 +9948,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 96usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_SetPIN) ) @@ -2795,7 +9958,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 104usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_OpenSession) ) @@ -2805,7 +9968,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 112usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_CloseSession) ) @@ -2815,7 +9978,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 120usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_CloseAllSessions) ) @@ -2825,7 +9988,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 128usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_GetSessionInfo) ) @@ -2835,7 +9998,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 136usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_GetOperationState) ) @@ -2845,7 +10008,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 144usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_SetOperationState) ) @@ -2855,7 +10018,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 152usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_Login) ) @@ -2865,7 +10028,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 160usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_Logout) ) @@ -2875,7 +10038,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 168usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_CreateObject) ) @@ -2885,7 +10048,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 176usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_CopyObject) ) @@ -2895,7 +10058,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 184usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_DestroyObject) ) @@ -2905,7 +10068,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 192usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_GetObjectSize) ) @@ -2915,7 +10078,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 200usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_GetAttributeValue) ) @@ -2925,7 +10088,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 208usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_SetAttributeValue) ) @@ -2935,7 +10098,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 216usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_FindObjectsInit) ) @@ -2945,7 +10108,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 224usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_FindObjects) ) @@ -2955,7 +10118,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 232usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_FindObjectsFinal) ) @@ -2965,7 +10128,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 240usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_EncryptInit) ) @@ -2975,7 +10138,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 248usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_Encrypt) ) @@ -2985,7 +10148,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 256usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_EncryptUpdate) ) @@ -2995,7 +10158,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 264usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_EncryptFinal) ) @@ -3005,7 +10168,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 272usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_DecryptInit) ) @@ -3015,7 +10178,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 280usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_Decrypt) ) @@ -3025,7 +10188,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 288usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_DecryptUpdate) ) @@ -3035,7 +10198,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 296usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_DecryptFinal) ) @@ -3045,7 +10208,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 304usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_DigestInit) ) @@ -3055,7 +10218,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 312usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_Digest) ) @@ -3065,7 +10228,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 320usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_DigestUpdate) ) @@ -3075,7 +10238,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 328usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_DigestKey) ) @@ -3085,7 +10248,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 336usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_DigestFinal) ) @@ -3095,7 +10258,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 344usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_SignInit) ) @@ -3105,7 +10268,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 352usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_Sign) ) @@ -3115,7 +10278,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 360usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_SignUpdate) ) @@ -3125,7 +10288,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 368usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_SignFinal) ) @@ -3135,7 +10298,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 376usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_SignRecoverInit) ) @@ -3145,7 +10308,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 384usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_SignRecover) ) @@ -3155,7 +10318,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 392usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_VerifyInit) ) @@ -3165,7 +10328,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 400usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_Verify) ) @@ -3175,7 +10338,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 408usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_VerifyUpdate) ) @@ -3185,7 +10348,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 416usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_VerifyFinal) ) @@ -3195,7 +10358,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 424usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_VerifyRecoverInit) ) @@ -3205,7 +10368,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 432usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_VerifyRecover) ) @@ -3215,7 +10378,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 440usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_DigestEncryptUpdate) ) @@ -3225,7 +10388,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 448usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_DecryptDigestUpdate) ) @@ -3235,7 +10398,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 456usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_SignEncryptUpdate) ) @@ -3245,7 +10408,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 464usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_DecryptVerifyUpdate) ) @@ -3255,7 +10418,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 472usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_GenerateKey) ) @@ -3265,7 +10428,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 480usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_GenerateKeyPair) ) @@ -3275,7 +10438,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 488usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_WrapKey) ) @@ -3285,7 +10448,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 496usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_UnwrapKey) ) @@ -3295,7 +10458,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 504usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_DeriveKey) ) @@ -3305,7 +10468,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 512usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_SeedRandom) ) @@ -3315,7 +10478,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 520usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_GenerateRandom) ) @@ -3325,7 +10488,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 528usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_GetFunctionStatus) ) @@ -3335,7 +10498,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 536usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_CancelFunction) ) @@ -3345,223 +10508,45 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 544usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), - "::", - stringify!(C_WaitForSlotEvent) - ) - ); -} -pub type CK_CREATEMUTEX = - ::std::option::Option CK_RV>; -pub type CK_DESTROYMUTEX = - ::std::option::Option CK_RV>; -pub type CK_LOCKMUTEX = - ::std::option::Option CK_RV>; -pub type CK_UNLOCKMUTEX = - ::std::option::Option CK_RV>; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct _CK_C_INITIALIZE_ARGS { - pub CreateMutex: CK_CREATEMUTEX, - pub DestroyMutex: CK_DESTROYMUTEX, - pub LockMutex: CK_LOCKMUTEX, - pub UnlockMutex: CK_UNLOCKMUTEX, - pub flags: CK_FLAGS, - pub pReserved: *mut ::std::os::raw::c_void, -} -#[test] -fn bindgen_test_layout__CK_C_INITIALIZE_ARGS() { - const UNINIT: ::std::mem::MaybeUninit<_CK_C_INITIALIZE_ARGS> = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<_CK_C_INITIALIZE_ARGS>(), - 48usize, - concat!("Size of: ", stringify!(_CK_C_INITIALIZE_ARGS)) - ); - assert_eq!( - ::std::mem::align_of::<_CK_C_INITIALIZE_ARGS>(), - 8usize, - 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 }, - 40usize, - concat!( - "Offset of field: ", - stringify!(_CK_C_INITIALIZE_ARGS), + stringify!(CK_FUNCTION_LIST), "::", - stringify!(pReserved) - ) - ); -} -impl Default for _CK_C_INITIALIZE_ARGS { - fn default() -> Self { - let mut s = ::std::mem::MaybeUninit::::uninit(); - unsafe { - ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -pub type CK_BYTE = ::std::os::raw::c_uchar; -pub type CK_CHAR = ::std::os::raw::c_uchar; -pub type CK_UTF8CHAR = ::std::os::raw::c_uchar; -pub type CK_BBOOL = ::std::os::raw::c_uchar; -pub type CK_ULONG = ::std::os::raw::c_ulong; -pub type CK_LONG = ::std::os::raw::c_long; -pub type CK_BYTE_PTR = *mut CK_BYTE; -pub type CK_CHAR_PTR = *mut CK_CHAR; -pub type CK_UTF8CHAR_PTR = *mut CK_UTF8CHAR; -pub type CK_ULONG_PTR = *mut CK_ULONG; -pub type CK_VOID_PTR = *mut ::std::os::raw::c_void; -pub type CK_VOID_PTR_PTR = *mut *mut ::std::os::raw::c_void; -pub type CK_VERSION = _CK_VERSION; -pub type CK_VERSION_PTR = *mut _CK_VERSION; -pub type CK_INFO = _CK_INFO; -pub type CK_INFO_PTR = *mut _CK_INFO; -pub type CK_SLOT_ID_PTR = *mut CK_SLOT_ID; -pub type CK_SLOT_INFO = _CK_SLOT_INFO; -pub type CK_SLOT_INFO_PTR = *mut _CK_SLOT_INFO; -pub type CK_TOKEN_INFO = _CK_TOKEN_INFO; -pub type CK_TOKEN_INFO_PTR = *mut _CK_TOKEN_INFO; -pub type CK_SESSION_HANDLE_PTR = *mut CK_SESSION_HANDLE; -pub type CK_SESSION_INFO = _CK_SESSION_INFO; -pub type CK_SESSION_INFO_PTR = *mut _CK_SESSION_INFO; -pub type CK_OBJECT_HANDLE_PTR = *mut CK_OBJECT_HANDLE; -pub type CK_OBJECT_CLASS_PTR = *mut CK_OBJECT_CLASS; -pub type CK_ATTRIBUTE = _CK_ATTRIBUTE; -pub type CK_ATTRIBUTE_PTR = *mut _CK_ATTRIBUTE; -pub type CK_DATE = _CK_DATE; -pub type CK_DATE_PTR = *mut _CK_DATE; -pub type CK_MECHANISM_TYPE_PTR = *mut CK_MECHANISM_TYPE; -pub type CK_MECHANISM = _CK_MECHANISM; -pub type CK_MECHANISM_PTR = *mut _CK_MECHANISM; -pub type CK_MECHANISM_INFO = _CK_MECHANISM_INFO; -pub type CK_MECHANISM_INFO_PTR = *mut _CK_MECHANISM_INFO; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct ck_otp_mechanism_info { - _unused: [u8; 0], -} -pub type CK_OTP_MECHANISM_INFO = ck_otp_mechanism_info; -pub type CK_OTP_MECHANISM_INFO_PTR = *mut ck_otp_mechanism_info; -pub type CK_FUNCTION_LIST = _CK_FUNCTION_LIST; -pub type CK_FUNCTION_LIST_PTR = *mut _CK_FUNCTION_LIST; -pub type CK_FUNCTION_LIST_PTR_PTR = *mut *mut _CK_FUNCTION_LIST; -pub type CK_C_INITIALIZE_ARGS = _CK_C_INITIALIZE_ARGS; -pub type CK_C_INITIALIZE_ARGS_PTR = *mut _CK_C_INITIALIZE_ARGS; -pub type CK_RSA_PKCS_PSS_PARAMS = ck_rsa_pkcs_pss_params; -pub type CK_RSA_PKCS_PSS_PARAMS_PTR = *mut ck_rsa_pkcs_pss_params; -pub type CK_RSA_PKCS_OAEP_PARAMS = ck_rsa_pkcs_oaep_params; -pub type CK_RSA_PKCS_OAEP_PARAMS_PTR = *mut ck_rsa_pkcs_oaep_params; -pub type CK_AES_CTR_PARAMS = ck_aes_ctr_params; -pub type CK_AES_CTR_PARAMS_PTR = *mut ck_aes_ctr_params; -pub type CK_GCM_PARAMS = ck_gcm_params; -pub type CK_GCM_PARAMS_PTR = *mut ck_gcm_params; -pub type CK_ECDH1_DERIVE_PARAMS = ck_ecdh1_derive_params; -pub type CK_ECDH1_DERIVE_PARAMS_PTR = *mut ck_ecdh1_derive_params; -pub type CK_KEY_DERIVATION_STRING_DATA = ck_key_derivation_string_data; -pub type CK_KEY_DERIVATION_STRING_DATA_PTR = *mut ck_key_derivation_string_data; -pub type CK_DES_CBC_ENCRYPT_DATA_PARAMS = ck_des_cbc_encrypt_data_params; -pub type CK_DES_CBC_ENCRYPT_DATA_PARAMS_PTR = *mut ck_des_cbc_encrypt_data_params; -pub type CK_AES_CBC_ENCRYPT_DATA_PARAMS = ck_aes_cbc_encrypt_data_params; -pub type CK_AES_CBC_ENCRYPT_DATA_PARAMS_PTR = *mut ck_aes_cbc_encrypt_data_params; + stringify!(C_WaitForSlotEvent) + ) + ); +} extern crate libloading; pub struct Pkcs11 { __library: ::libloading::Library, - pub C_Initialize: Result< - unsafe extern "C" fn(init_args: *mut ::std::os::raw::c_void) -> CK_RV, - ::libloading::Error, - >, - pub C_Finalize: Result< - unsafe extern "C" fn(pReserved: *mut ::std::os::raw::c_void) -> CK_RV, - ::libloading::Error, - >, - pub C_GetInfo: Result CK_RV, ::libloading::Error>, + pub C_Initialize: + Result CK_RV, ::libloading::Error>, + pub C_Finalize: + Result CK_RV, ::libloading::Error>, + pub C_GetInfo: Result CK_RV, ::libloading::Error>, pub C_GetFunctionList: Result< - unsafe extern "C" fn(function_list: *mut *mut _CK_FUNCTION_LIST) -> CK_RV, + unsafe extern "C" fn(ppFunctionList: CK_FUNCTION_LIST_PTR_PTR) -> CK_RV, ::libloading::Error, >, pub C_GetSlotList: Result< unsafe extern "C" fn( - token_present: ::std::os::raw::c_uchar, - slot_list: *mut CK_SLOT_ID, - ulCount: *mut ::std::os::raw::c_ulong, + tokenPresent: CK_BBOOL, + pSlotList: CK_SLOT_ID_PTR, + pulCount: CK_ULONG_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_GetSlotInfo: Result< - unsafe extern "C" fn(slotID: CK_SLOT_ID, info: *mut _CK_SLOT_INFO) -> CK_RV, + unsafe extern "C" fn(slotID: CK_SLOT_ID, pInfo: CK_SLOT_INFO_PTR) -> CK_RV, ::libloading::Error, >, pub C_GetTokenInfo: Result< - unsafe extern "C" fn(slotID: CK_SLOT_ID, info: *mut _CK_TOKEN_INFO) -> CK_RV, - ::libloading::Error, - >, - pub C_WaitForSlotEvent: Result< - unsafe extern "C" fn( - flags: CK_FLAGS, - slot: *mut CK_SLOT_ID, - pReserved: *mut ::std::os::raw::c_void, - ) -> CK_RV, + unsafe extern "C" fn(slotID: CK_SLOT_ID, pInfo: CK_TOKEN_INFO_PTR) -> CK_RV, ::libloading::Error, >, pub C_GetMechanismList: Result< unsafe extern "C" fn( slotID: CK_SLOT_ID, - mechanism_list: *mut CK_MECHANISM_TYPE, - ulCount: *mut ::std::os::raw::c_ulong, + pMechanismList: CK_MECHANISM_TYPE_PTR, + pulCount: CK_ULONG_PTR, ) -> CK_RV, ::libloading::Error, >, @@ -3569,34 +10554,34 @@ pub struct Pkcs11 { unsafe extern "C" fn( slotID: CK_SLOT_ID, type_: CK_MECHANISM_TYPE, - info: *mut _CK_MECHANISM_INFO, + pInfo: CK_MECHANISM_INFO_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_InitToken: Result< unsafe extern "C" fn( slotID: CK_SLOT_ID, - pin: *mut ::std::os::raw::c_uchar, - pin_len: ::std::os::raw::c_ulong, - label: *mut ::std::os::raw::c_uchar, + pPin: CK_UTF8CHAR_PTR, + ulPinLen: CK_ULONG, + pLabel: CK_UTF8CHAR_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_InitPIN: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - pin: *mut ::std::os::raw::c_uchar, - pin_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pPin: CK_UTF8CHAR_PTR, + ulPinLen: CK_ULONG, ) -> CK_RV, ::libloading::Error, >, pub C_SetPIN: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - old_pin: *mut ::std::os::raw::c_uchar, - old_len: ::std::os::raw::c_ulong, - new_pin: *mut ::std::os::raw::c_uchar, - new_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pOldPin: CK_UTF8CHAR_PTR, + ulOldLen: CK_ULONG, + pNewPin: CK_UTF8CHAR_PTR, + ulNewLen: CK_ULONG, ) -> CK_RV, ::libloading::Error, >, @@ -3604,445 +10589,659 @@ pub struct Pkcs11 { unsafe extern "C" fn( slotID: CK_SLOT_ID, flags: CK_FLAGS, - application: *mut ::std::os::raw::c_void, - notify: CK_NOTIFY, - session: *mut CK_SESSION_HANDLE, + pApplication: CK_VOID_PTR, + Notify: CK_NOTIFY, + phSession: CK_SESSION_HANDLE_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_CloseSession: - Result CK_RV, ::libloading::Error>, + Result CK_RV, ::libloading::Error>, pub C_CloseAllSessions: Result CK_RV, ::libloading::Error>, pub C_GetSessionInfo: Result< - unsafe extern "C" fn(session: CK_SESSION_HANDLE, info: *mut _CK_SESSION_INFO) -> CK_RV, + unsafe extern "C" fn(hSession: CK_SESSION_HANDLE, pInfo: CK_SESSION_INFO_PTR) -> CK_RV, ::libloading::Error, >, pub C_GetOperationState: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - operation_state: *mut ::std::os::raw::c_uchar, - operation_state_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pOperationState: CK_BYTE_PTR, + pulOperationStateLen: CK_ULONG_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_SetOperationState: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - operation_state: *mut ::std::os::raw::c_uchar, - operation_state_len: ::std::os::raw::c_ulong, - encryption_key: CK_OBJECT_HANDLE, - authentiation_key: CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pOperationState: CK_BYTE_PTR, + ulOperationStateLen: CK_ULONG, + hEncryptionKey: CK_OBJECT_HANDLE, + hAuthenticationKey: CK_OBJECT_HANDLE, ) -> CK_RV, ::libloading::Error, >, pub C_Login: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - user_type: CK_USER_TYPE, - pin: *mut ::std::os::raw::c_uchar, - pin_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + userType: CK_USER_TYPE, + pPin: CK_UTF8CHAR_PTR, + ulPinLen: CK_ULONG, ) -> CK_RV, ::libloading::Error, >, pub C_Logout: - Result CK_RV, ::libloading::Error>, + Result CK_RV, ::libloading::Error>, pub C_CreateObject: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - templ: *mut _CK_ATTRIBUTE, - ulCount: ::std::os::raw::c_ulong, - object: *mut CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pTemplate: CK_ATTRIBUTE_PTR, + ulCount: CK_ULONG, + phObject: CK_OBJECT_HANDLE_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_CopyObject: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - object: CK_OBJECT_HANDLE, - templ: *mut _CK_ATTRIBUTE, - ulCount: ::std::os::raw::c_ulong, - new_object: *mut CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + hObject: CK_OBJECT_HANDLE, + pTemplate: CK_ATTRIBUTE_PTR, + ulCount: CK_ULONG, + phNewObject: CK_OBJECT_HANDLE_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_DestroyObject: Result< - unsafe extern "C" fn(session: CK_SESSION_HANDLE, object: CK_OBJECT_HANDLE) -> CK_RV, + unsafe extern "C" fn(hSession: CK_SESSION_HANDLE, hObject: CK_OBJECT_HANDLE) -> CK_RV, ::libloading::Error, >, pub C_GetObjectSize: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - object: CK_OBJECT_HANDLE, - size: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + hObject: CK_OBJECT_HANDLE, + pulSize: CK_ULONG_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_GetAttributeValue: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - object: CK_OBJECT_HANDLE, - templ: *mut _CK_ATTRIBUTE, - ulCount: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + hObject: CK_OBJECT_HANDLE, + pTemplate: CK_ATTRIBUTE_PTR, + ulCount: CK_ULONG, ) -> CK_RV, ::libloading::Error, >, pub C_SetAttributeValue: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - object: CK_OBJECT_HANDLE, - templ: *mut _CK_ATTRIBUTE, - ulCount: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + hObject: CK_OBJECT_HANDLE, + pTemplate: CK_ATTRIBUTE_PTR, + ulCount: CK_ULONG, ) -> CK_RV, ::libloading::Error, >, pub C_FindObjectsInit: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - templ: *mut _CK_ATTRIBUTE, - ulCount: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pTemplate: CK_ATTRIBUTE_PTR, + ulCount: CK_ULONG, ) -> CK_RV, ::libloading::Error, >, pub C_FindObjects: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - object: *mut CK_OBJECT_HANDLE, - max_object_count: ::std::os::raw::c_ulong, - object_count: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + phObject: CK_OBJECT_HANDLE_PTR, + ulMaxObjectCount: CK_ULONG, + pulObjectCount: CK_ULONG_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_FindObjectsFinal: - Result CK_RV, ::libloading::Error>, + Result CK_RV, ::libloading::Error>, pub C_EncryptInit: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - key: CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, ) -> CK_RV, ::libloading::Error, >, pub C_Encrypt: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - data: *mut ::std::os::raw::c_uchar, - data_len: ::std::os::raw::c_ulong, - encrypted_data: *mut ::std::os::raw::c_uchar, - encrypted_data_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pEncryptedData: CK_BYTE_PTR, + pulEncryptedDataLen: CK_ULONG_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_EncryptUpdate: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - part: *mut ::std::os::raw::c_uchar, - part_len: ::std::os::raw::c_ulong, - encrypted_part: *mut ::std::os::raw::c_uchar, - encrypted_part_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pPart: CK_BYTE_PTR, + ulPartLen: CK_ULONG, + pEncryptedPart: CK_BYTE_PTR, + pulEncryptedPartLen: CK_ULONG_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_EncryptFinal: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - last_encrypted_part: *mut ::std::os::raw::c_uchar, - last_encrypted_part_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pLastEncryptedPart: CK_BYTE_PTR, + pulLastEncryptedPartLen: CK_ULONG_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_DecryptInit: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - key: CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, ) -> CK_RV, ::libloading::Error, >, pub C_Decrypt: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - encrypted_data: *mut ::std::os::raw::c_uchar, - encrypted_data_len: ::std::os::raw::c_ulong, - data: *mut ::std::os::raw::c_uchar, - data_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pEncryptedData: CK_BYTE_PTR, + ulEncryptedDataLen: CK_ULONG, + pData: CK_BYTE_PTR, + pulDataLen: CK_ULONG_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_DecryptUpdate: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - encrypted_part: *mut ::std::os::raw::c_uchar, - encrypted_part_len: ::std::os::raw::c_ulong, - part: *mut ::std::os::raw::c_uchar, - part_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pEncryptedPart: CK_BYTE_PTR, + ulEncryptedPartLen: CK_ULONG, + pPart: CK_BYTE_PTR, + pulPartLen: CK_ULONG_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_DecryptFinal: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - last_part: *mut ::std::os::raw::c_uchar, - last_part_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pLastPart: CK_BYTE_PTR, + pulLastPartLen: CK_ULONG_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_DigestInit: Result< - unsafe extern "C" fn(session: CK_SESSION_HANDLE, mechanism: *mut _CK_MECHANISM) -> CK_RV, + unsafe extern "C" fn(hSession: CK_SESSION_HANDLE, pMechanism: CK_MECHANISM_PTR) -> CK_RV, ::libloading::Error, >, pub C_Digest: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - data: *mut ::std::os::raw::c_uchar, - data_len: ::std::os::raw::c_ulong, - digest: *mut ::std::os::raw::c_uchar, - digest_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pDigest: CK_BYTE_PTR, + pulDigestLen: CK_ULONG_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_DigestUpdate: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - part: *mut ::std::os::raw::c_uchar, - part_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pPart: CK_BYTE_PTR, + ulPartLen: CK_ULONG, ) -> CK_RV, ::libloading::Error, >, pub C_DigestKey: Result< - unsafe extern "C" fn(session: CK_SESSION_HANDLE, key: CK_OBJECT_HANDLE) -> CK_RV, + unsafe extern "C" fn(hSession: CK_SESSION_HANDLE, hKey: CK_OBJECT_HANDLE) -> CK_RV, ::libloading::Error, >, pub C_DigestFinal: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - digest: *mut ::std::os::raw::c_uchar, - digest_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pDigest: CK_BYTE_PTR, + pulDigestLen: CK_ULONG_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_SignInit: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - key: CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, ) -> CK_RV, ::libloading::Error, >, pub C_Sign: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - data: *mut ::std::os::raw::c_uchar, - data_len: ::std::os::raw::c_ulong, - signature: *mut ::std::os::raw::c_uchar, - signature_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + pulSignatureLen: CK_ULONG_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_SignUpdate: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - part: *mut ::std::os::raw::c_uchar, - part_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pPart: CK_BYTE_PTR, + ulPartLen: CK_ULONG, ) -> CK_RV, ::libloading::Error, >, pub C_SignFinal: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - signature: *mut ::std::os::raw::c_uchar, - signature_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pSignature: CK_BYTE_PTR, + pulSignatureLen: CK_ULONG_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_SignRecoverInit: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - key: CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, ) -> CK_RV, ::libloading::Error, >, pub C_SignRecover: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - data: *mut ::std::os::raw::c_uchar, - data_len: ::std::os::raw::c_ulong, - signature: *mut ::std::os::raw::c_uchar, - signature_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + pulSignatureLen: CK_ULONG_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_VerifyInit: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - key: CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, ) -> CK_RV, ::libloading::Error, >, pub C_Verify: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - data: *mut ::std::os::raw::c_uchar, - data_len: ::std::os::raw::c_ulong, - signature: *mut ::std::os::raw::c_uchar, - signature_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + ulSignatureLen: CK_ULONG, ) -> CK_RV, ::libloading::Error, >, pub C_VerifyUpdate: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - part: *mut ::std::os::raw::c_uchar, - part_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pPart: CK_BYTE_PTR, + ulPartLen: CK_ULONG, ) -> CK_RV, ::libloading::Error, >, pub C_VerifyFinal: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - signature: *mut ::std::os::raw::c_uchar, - signature_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pSignature: CK_BYTE_PTR, + ulSignatureLen: CK_ULONG, ) -> CK_RV, ::libloading::Error, >, pub C_VerifyRecoverInit: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - key: CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, ) -> CK_RV, ::libloading::Error, >, pub C_VerifyRecover: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - signature: *mut ::std::os::raw::c_uchar, - signature_len: ::std::os::raw::c_ulong, - data: *mut ::std::os::raw::c_uchar, - data_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pSignature: CK_BYTE_PTR, + ulSignatureLen: CK_ULONG, + pData: CK_BYTE_PTR, + pulDataLen: CK_ULONG_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_DigestEncryptUpdate: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - part: *mut ::std::os::raw::c_uchar, - part_len: ::std::os::raw::c_ulong, - encrypted_part: *mut ::std::os::raw::c_uchar, - encrypted_part_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pPart: CK_BYTE_PTR, + ulPartLen: CK_ULONG, + pEncryptedPart: CK_BYTE_PTR, + pulEncryptedPartLen: CK_ULONG_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_DecryptDigestUpdate: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - encrypted_part: *mut ::std::os::raw::c_uchar, - encrypted_part_len: ::std::os::raw::c_ulong, - part: *mut ::std::os::raw::c_uchar, - part_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pEncryptedPart: CK_BYTE_PTR, + ulEncryptedPartLen: CK_ULONG, + pPart: CK_BYTE_PTR, + pulPartLen: CK_ULONG_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_SignEncryptUpdate: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - part: *mut ::std::os::raw::c_uchar, - part_len: ::std::os::raw::c_ulong, - encrypted_part: *mut ::std::os::raw::c_uchar, - encrypted_part_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pPart: CK_BYTE_PTR, + ulPartLen: CK_ULONG, + pEncryptedPart: CK_BYTE_PTR, + pulEncryptedPartLen: CK_ULONG_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_DecryptVerifyUpdate: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - encrypted_part: *mut ::std::os::raw::c_uchar, - encrypted_part_len: ::std::os::raw::c_ulong, - part: *mut ::std::os::raw::c_uchar, - part_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pEncryptedPart: CK_BYTE_PTR, + ulEncryptedPartLen: CK_ULONG, + pPart: CK_BYTE_PTR, + pulPartLen: CK_ULONG_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_GenerateKey: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - templ: *mut _CK_ATTRIBUTE, - ulCount: ::std::os::raw::c_ulong, - key: *mut CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + pTemplate: CK_ATTRIBUTE_PTR, + ulCount: CK_ULONG, + phKey: CK_OBJECT_HANDLE_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_GenerateKeyPair: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - public_key_template: *mut _CK_ATTRIBUTE, - public_key_attribute_count: ::std::os::raw::c_ulong, - private_key_template: *mut _CK_ATTRIBUTE, - private_key_attribute_count: ::std::os::raw::c_ulong, - public_key: *mut CK_OBJECT_HANDLE, - private_key: *mut CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + pPublicKeyTemplate: CK_ATTRIBUTE_PTR, + ulPublicKeyAttributeCount: CK_ULONG, + pPrivateKeyTemplate: CK_ATTRIBUTE_PTR, + ulPrivateKeyAttributeCount: CK_ULONG, + phPublicKey: CK_OBJECT_HANDLE_PTR, + phPrivateKey: CK_OBJECT_HANDLE_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_WrapKey: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - wrapping_key: CK_OBJECT_HANDLE, - key: CK_OBJECT_HANDLE, - wrapped_key: *mut ::std::os::raw::c_uchar, - wrapped_key_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hWrappingKey: CK_OBJECT_HANDLE, + hKey: CK_OBJECT_HANDLE, + pWrappedKey: CK_BYTE_PTR, + pulWrappedKeyLen: CK_ULONG_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_UnwrapKey: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - unwrapping_key: CK_OBJECT_HANDLE, - wrapped_key: *mut ::std::os::raw::c_uchar, - wrapped_key_len: ::std::os::raw::c_ulong, - templ: *mut _CK_ATTRIBUTE, - attribute_count: ::std::os::raw::c_ulong, - key: *mut CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hUnwrappingKey: CK_OBJECT_HANDLE, + pWrappedKey: CK_BYTE_PTR, + ulWrappedKeyLen: CK_ULONG, + pTemplate: CK_ATTRIBUTE_PTR, + ulAttributeCount: CK_ULONG, + phKey: CK_OBJECT_HANDLE_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_DeriveKey: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - base_key: CK_OBJECT_HANDLE, - templ: *mut _CK_ATTRIBUTE, - attribute_count: ::std::os::raw::c_ulong, - key: *mut CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hBaseKey: CK_OBJECT_HANDLE, + pTemplate: CK_ATTRIBUTE_PTR, + ulAttributeCount: CK_ULONG, + phKey: CK_OBJECT_HANDLE_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_SeedRandom: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - seed: *mut ::std::os::raw::c_uchar, - seed_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pSeed: CK_BYTE_PTR, + ulSeedLen: CK_ULONG, ) -> CK_RV, ::libloading::Error, >, pub C_GenerateRandom: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - random_data: *mut ::std::os::raw::c_uchar, - random_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + RandomData: CK_BYTE_PTR, + ulRandomLen: CK_ULONG, ) -> CK_RV, ::libloading::Error, >, pub C_GetFunctionStatus: - Result CK_RV, ::libloading::Error>, + Result CK_RV, ::libloading::Error>, pub C_CancelFunction: - Result CK_RV, ::libloading::Error>, + Result CK_RV, ::libloading::Error>, + pub C_WaitForSlotEvent: Result< + unsafe extern "C" fn( + flags: CK_FLAGS, + pSlot: CK_SLOT_ID_PTR, + pRserved: CK_VOID_PTR, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_GetInterfaceList: Result< + unsafe extern "C" fn(pInterfacesList: CK_INTERFACE_PTR, pulCount: CK_ULONG_PTR) -> CK_RV, + ::libloading::Error, + >, + pub C_GetInterface: Result< + unsafe extern "C" fn( + pInterfaceName: CK_UTF8CHAR_PTR, + pVersion: CK_VERSION_PTR, + ppInterface: CK_INTERFACE_PTR_PTR, + flags: CK_FLAGS, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_LoginUser: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + userType: CK_USER_TYPE, + pPin: CK_UTF8CHAR_PTR, + ulPinLen: CK_ULONG, + pUsername: CK_UTF8CHAR_PTR, + ulUsernameLen: CK_ULONG, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_SessionCancel: Result< + unsafe extern "C" fn(hSession: CK_SESSION_HANDLE, flags: CK_FLAGS) -> CK_RV, + ::libloading::Error, + >, + pub C_MessageEncryptInit: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_EncryptMessage: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pAssociatedData: CK_BYTE_PTR, + ulAssociatedDataLen: CK_ULONG, + pPlaintext: CK_BYTE_PTR, + ulPlaintextLen: CK_ULONG, + pCiphertext: CK_BYTE_PTR, + pulCiphertextLen: CK_ULONG_PTR, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_EncryptMessageBegin: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pAssociatedData: CK_BYTE_PTR, + ulAssociatedDataLen: CK_ULONG, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_EncryptMessageNext: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pPlaintextPart: CK_BYTE_PTR, + ulPlaintextPartLen: CK_ULONG, + pCiphertextPart: CK_BYTE_PTR, + pulCiphertextPartLen: CK_ULONG_PTR, + flags: CK_FLAGS, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_MessageEncryptFinal: + Result CK_RV, ::libloading::Error>, + pub C_MessageDecryptInit: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_DecryptMessage: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pAssociatedData: CK_BYTE_PTR, + ulAssociatedDataLen: CK_ULONG, + pCiphertext: CK_BYTE_PTR, + ulCiphertextLen: CK_ULONG, + pPlaintext: CK_BYTE_PTR, + pulPlaintextLen: CK_ULONG_PTR, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_DecryptMessageBegin: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pAssociatedData: CK_BYTE_PTR, + ulAssociatedDataLen: CK_ULONG, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_DecryptMessageNext: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pCiphertext: CK_BYTE_PTR, + ulCiphertextLen: CK_ULONG, + pPlaintext: CK_BYTE_PTR, + pulPlaintextLen: CK_ULONG_PTR, + flags: CK_FLAGS, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_MessageDecryptFinal: + Result CK_RV, ::libloading::Error>, + pub C_MessageSignInit: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_SignMessage: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + pulSignatureLen: CK_ULONG_PTR, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_SignMessageBegin: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_SignMessageNext: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + pulSignatureLen: CK_ULONG_PTR, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_MessageSignFinal: + Result CK_RV, ::libloading::Error>, + pub C_MessageVerifyInit: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_VerifyMessage: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + ulSignatureLen: CK_ULONG, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_VerifyMessageBegin: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_VerifyMessageNext: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + ulSignatureLen: CK_ULONG, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_MessageVerifyFinal: + Result CK_RV, ::libloading::Error>, } impl Pkcs11 { pub unsafe fn new

(path: P) -> Result @@ -4064,7 +11263,6 @@ impl Pkcs11 { let C_GetSlotList = __library.get(b"C_GetSlotList\0").map(|sym| *sym); let C_GetSlotInfo = __library.get(b"C_GetSlotInfo\0").map(|sym| *sym); let C_GetTokenInfo = __library.get(b"C_GetTokenInfo\0").map(|sym| *sym); - let C_WaitForSlotEvent = __library.get(b"C_WaitForSlotEvent\0").map(|sym| *sym); let C_GetMechanismList = __library.get(b"C_GetMechanismList\0").map(|sym| *sym); let C_GetMechanismInfo = __library.get(b"C_GetMechanismInfo\0").map(|sym| *sym); let C_InitToken = __library.get(b"C_InitToken\0").map(|sym| *sym); @@ -4125,6 +11323,31 @@ impl Pkcs11 { let C_GenerateRandom = __library.get(b"C_GenerateRandom\0").map(|sym| *sym); let C_GetFunctionStatus = __library.get(b"C_GetFunctionStatus\0").map(|sym| *sym); let C_CancelFunction = __library.get(b"C_CancelFunction\0").map(|sym| *sym); + let C_WaitForSlotEvent = __library.get(b"C_WaitForSlotEvent\0").map(|sym| *sym); + let C_GetInterfaceList = __library.get(b"C_GetInterfaceList\0").map(|sym| *sym); + let C_GetInterface = __library.get(b"C_GetInterface\0").map(|sym| *sym); + let C_LoginUser = __library.get(b"C_LoginUser\0").map(|sym| *sym); + let C_SessionCancel = __library.get(b"C_SessionCancel\0").map(|sym| *sym); + let C_MessageEncryptInit = __library.get(b"C_MessageEncryptInit\0").map(|sym| *sym); + let C_EncryptMessage = __library.get(b"C_EncryptMessage\0").map(|sym| *sym); + let C_EncryptMessageBegin = __library.get(b"C_EncryptMessageBegin\0").map(|sym| *sym); + let C_EncryptMessageNext = __library.get(b"C_EncryptMessageNext\0").map(|sym| *sym); + let C_MessageEncryptFinal = __library.get(b"C_MessageEncryptFinal\0").map(|sym| *sym); + let C_MessageDecryptInit = __library.get(b"C_MessageDecryptInit\0").map(|sym| *sym); + let C_DecryptMessage = __library.get(b"C_DecryptMessage\0").map(|sym| *sym); + let C_DecryptMessageBegin = __library.get(b"C_DecryptMessageBegin\0").map(|sym| *sym); + let C_DecryptMessageNext = __library.get(b"C_DecryptMessageNext\0").map(|sym| *sym); + let C_MessageDecryptFinal = __library.get(b"C_MessageDecryptFinal\0").map(|sym| *sym); + let C_MessageSignInit = __library.get(b"C_MessageSignInit\0").map(|sym| *sym); + let C_SignMessage = __library.get(b"C_SignMessage\0").map(|sym| *sym); + let C_SignMessageBegin = __library.get(b"C_SignMessageBegin\0").map(|sym| *sym); + let C_SignMessageNext = __library.get(b"C_SignMessageNext\0").map(|sym| *sym); + let C_MessageSignFinal = __library.get(b"C_MessageSignFinal\0").map(|sym| *sym); + let C_MessageVerifyInit = __library.get(b"C_MessageVerifyInit\0").map(|sym| *sym); + let C_VerifyMessage = __library.get(b"C_VerifyMessage\0").map(|sym| *sym); + let C_VerifyMessageBegin = __library.get(b"C_VerifyMessageBegin\0").map(|sym| *sym); + let C_VerifyMessageNext = __library.get(b"C_VerifyMessageNext\0").map(|sym| *sym); + let C_MessageVerifyFinal = __library.get(b"C_MessageVerifyFinal\0").map(|sym| *sym); Ok(Pkcs11 { __library, C_Initialize, @@ -4134,7 +11357,6 @@ impl Pkcs11 { C_GetSlotList, C_GetSlotInfo, C_GetTokenInfo, - C_WaitForSlotEvent, C_GetMechanismList, C_GetMechanismInfo, C_InitToken, @@ -4195,146 +11417,164 @@ impl Pkcs11 { C_GenerateRandom, C_GetFunctionStatus, C_CancelFunction, + C_WaitForSlotEvent, + C_GetInterfaceList, + C_GetInterface, + C_LoginUser, + C_SessionCancel, + C_MessageEncryptInit, + C_EncryptMessage, + C_EncryptMessageBegin, + C_EncryptMessageNext, + C_MessageEncryptFinal, + C_MessageDecryptInit, + C_DecryptMessage, + C_DecryptMessageBegin, + C_DecryptMessageNext, + C_MessageDecryptFinal, + C_MessageSignInit, + C_SignMessage, + C_SignMessageBegin, + C_SignMessageNext, + C_MessageSignFinal, + C_MessageVerifyInit, + C_VerifyMessage, + C_VerifyMessageBegin, + C_VerifyMessageNext, + C_MessageVerifyFinal, }) } - pub unsafe fn C_Initialize(&self, init_args: *mut ::std::os::raw::c_void) -> CK_RV { + pub unsafe fn C_Initialize(&self, pInitArgs: CK_VOID_PTR) -> CK_RV { (self .C_Initialize .as_ref() - .expect("Expected function, got error."))(init_args) + .expect("Expected function, got error."))(pInitArgs) } - pub unsafe fn C_Finalize(&self, pReserved: *mut ::std::os::raw::c_void) -> CK_RV { + pub unsafe fn C_Finalize(&self, pReserved: CK_VOID_PTR) -> CK_RV { (self .C_Finalize .as_ref() .expect("Expected function, got error."))(pReserved) } - pub unsafe fn C_GetInfo(&self, info: *mut _CK_INFO) -> CK_RV { + pub unsafe fn C_GetInfo(&self, pInfo: CK_INFO_PTR) -> CK_RV { (self .C_GetInfo .as_ref() - .expect("Expected function, got error."))(info) + .expect("Expected function, got error."))(pInfo) } - pub unsafe fn C_GetFunctionList(&self, function_list: *mut *mut _CK_FUNCTION_LIST) -> CK_RV { + pub unsafe fn C_GetFunctionList(&self, ppFunctionList: CK_FUNCTION_LIST_PTR_PTR) -> CK_RV { (self .C_GetFunctionList .as_ref() - .expect("Expected function, got error."))(function_list) + .expect("Expected function, got error."))(ppFunctionList) } pub unsafe fn C_GetSlotList( &self, - token_present: ::std::os::raw::c_uchar, - slot_list: *mut CK_SLOT_ID, - ulCount: *mut ::std::os::raw::c_ulong, + tokenPresent: CK_BBOOL, + pSlotList: CK_SLOT_ID_PTR, + pulCount: CK_ULONG_PTR, ) -> CK_RV { (self .C_GetSlotList .as_ref() - .expect("Expected function, got error."))(token_present, slot_list, ulCount) + .expect("Expected function, got error."))(tokenPresent, pSlotList, pulCount) } - pub unsafe fn C_GetSlotInfo(&self, slotID: CK_SLOT_ID, info: *mut _CK_SLOT_INFO) -> CK_RV { + pub unsafe fn C_GetSlotInfo(&self, slotID: CK_SLOT_ID, pInfo: CK_SLOT_INFO_PTR) -> CK_RV { (self .C_GetSlotInfo .as_ref() - .expect("Expected function, got error."))(slotID, info) + .expect("Expected function, got error."))(slotID, pInfo) } - pub unsafe fn C_GetTokenInfo(&self, slotID: CK_SLOT_ID, info: *mut _CK_TOKEN_INFO) -> CK_RV { + pub unsafe fn C_GetTokenInfo(&self, slotID: CK_SLOT_ID, pInfo: CK_TOKEN_INFO_PTR) -> CK_RV { (self .C_GetTokenInfo .as_ref() - .expect("Expected function, got error."))(slotID, info) - } - pub unsafe fn C_WaitForSlotEvent( - &self, - flags: CK_FLAGS, - slot: *mut CK_SLOT_ID, - pReserved: *mut ::std::os::raw::c_void, - ) -> CK_RV { - (self - .C_WaitForSlotEvent - .as_ref() - .expect("Expected function, got error."))(flags, slot, pReserved) + .expect("Expected function, got error."))(slotID, pInfo) } pub unsafe fn C_GetMechanismList( &self, slotID: CK_SLOT_ID, - mechanism_list: *mut CK_MECHANISM_TYPE, - ulCount: *mut ::std::os::raw::c_ulong, + pMechanismList: CK_MECHANISM_TYPE_PTR, + pulCount: CK_ULONG_PTR, ) -> CK_RV { (self .C_GetMechanismList .as_ref() - .expect("Expected function, got error."))(slotID, mechanism_list, ulCount) + .expect("Expected function, got error."))(slotID, pMechanismList, pulCount) } pub unsafe fn C_GetMechanismInfo( &self, slotID: CK_SLOT_ID, type_: CK_MECHANISM_TYPE, - info: *mut _CK_MECHANISM_INFO, + pInfo: CK_MECHANISM_INFO_PTR, ) -> CK_RV { (self .C_GetMechanismInfo .as_ref() - .expect("Expected function, got error."))(slotID, type_, info) + .expect("Expected function, got error."))(slotID, type_, pInfo) } pub unsafe fn C_InitToken( &self, slotID: CK_SLOT_ID, - pin: *mut ::std::os::raw::c_uchar, - pin_len: ::std::os::raw::c_ulong, - label: *mut ::std::os::raw::c_uchar, + pPin: CK_UTF8CHAR_PTR, + ulPinLen: CK_ULONG, + pLabel: CK_UTF8CHAR_PTR, ) -> CK_RV { (self .C_InitToken .as_ref() - .expect("Expected function, got error."))(slotID, pin, pin_len, label) + .expect("Expected function, got error."))(slotID, pPin, ulPinLen, pLabel) } pub unsafe fn C_InitPIN( &self, - session: CK_SESSION_HANDLE, - pin: *mut ::std::os::raw::c_uchar, - pin_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pPin: CK_UTF8CHAR_PTR, + ulPinLen: CK_ULONG, ) -> CK_RV { (self .C_InitPIN .as_ref() - .expect("Expected function, got error."))(session, pin, pin_len) + .expect("Expected function, got error."))(hSession, pPin, ulPinLen) } pub unsafe fn C_SetPIN( &self, - session: CK_SESSION_HANDLE, - old_pin: *mut ::std::os::raw::c_uchar, - old_len: ::std::os::raw::c_ulong, - new_pin: *mut ::std::os::raw::c_uchar, - new_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pOldPin: CK_UTF8CHAR_PTR, + ulOldLen: CK_ULONG, + pNewPin: CK_UTF8CHAR_PTR, + ulNewLen: CK_ULONG, ) -> CK_RV { (self .C_SetPIN .as_ref() .expect("Expected function, got error."))( - session, old_pin, old_len, new_pin, new_len + hSession, pOldPin, ulOldLen, pNewPin, ulNewLen, ) } pub unsafe fn C_OpenSession( &self, slotID: CK_SLOT_ID, flags: CK_FLAGS, - application: *mut ::std::os::raw::c_void, - notify: CK_NOTIFY, - session: *mut CK_SESSION_HANDLE, + pApplication: CK_VOID_PTR, + Notify: CK_NOTIFY, + phSession: CK_SESSION_HANDLE_PTR, ) -> CK_RV { (self .C_OpenSession .as_ref() .expect("Expected function, got error."))( - slotID, flags, application, notify, session + slotID, + flags, + pApplication, + Notify, + phSession, ) } - pub unsafe fn C_CloseSession(&self, session: CK_SESSION_HANDLE) -> CK_RV { + pub unsafe fn C_CloseSession(&self, hSession: CK_SESSION_HANDLE) -> CK_RV { (self .C_CloseSession .as_ref() - .expect("Expected function, got error."))(session) + .expect("Expected function, got error."))(hSession) } pub unsafe fn C_CloseAllSessions(&self, slotID: CK_SLOT_ID) -> CK_RV { (self @@ -4344,723 +11584,1119 @@ impl Pkcs11 { } pub unsafe fn C_GetSessionInfo( &self, - session: CK_SESSION_HANDLE, - info: *mut _CK_SESSION_INFO, + hSession: CK_SESSION_HANDLE, + pInfo: CK_SESSION_INFO_PTR, ) -> CK_RV { (self .C_GetSessionInfo .as_ref() - .expect("Expected function, got error."))(session, info) + .expect("Expected function, got error."))(hSession, pInfo) } pub unsafe fn C_GetOperationState( &self, - session: CK_SESSION_HANDLE, - operation_state: *mut ::std::os::raw::c_uchar, - operation_state_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pOperationState: CK_BYTE_PTR, + pulOperationStateLen: CK_ULONG_PTR, ) -> CK_RV { (self .C_GetOperationState .as_ref() .expect("Expected function, got error."))( - session, operation_state, operation_state_len + hSession, + pOperationState, + pulOperationStateLen, ) } pub unsafe fn C_SetOperationState( &self, - session: CK_SESSION_HANDLE, - operation_state: *mut ::std::os::raw::c_uchar, - operation_state_len: ::std::os::raw::c_ulong, - encryption_key: CK_OBJECT_HANDLE, - authentiation_key: CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pOperationState: CK_BYTE_PTR, + ulOperationStateLen: CK_ULONG, + hEncryptionKey: CK_OBJECT_HANDLE, + hAuthenticationKey: CK_OBJECT_HANDLE, ) -> CK_RV { (self .C_SetOperationState .as_ref() .expect("Expected function, got error."))( - session, - operation_state, - operation_state_len, - encryption_key, - authentiation_key, + hSession, + pOperationState, + ulOperationStateLen, + hEncryptionKey, + hAuthenticationKey, ) } pub unsafe fn C_Login( &self, - session: CK_SESSION_HANDLE, - user_type: CK_USER_TYPE, - pin: *mut ::std::os::raw::c_uchar, - pin_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + userType: CK_USER_TYPE, + pPin: CK_UTF8CHAR_PTR, + ulPinLen: CK_ULONG, ) -> CK_RV { (self .C_Login .as_ref() - .expect("Expected function, got error."))(session, user_type, pin, pin_len) + .expect("Expected function, got error."))(hSession, userType, pPin, ulPinLen) } - pub unsafe fn C_Logout(&self, session: CK_SESSION_HANDLE) -> CK_RV { + pub unsafe fn C_Logout(&self, hSession: CK_SESSION_HANDLE) -> CK_RV { (self .C_Logout .as_ref() - .expect("Expected function, got error."))(session) + .expect("Expected function, got error."))(hSession) } pub unsafe fn C_CreateObject( &self, - session: CK_SESSION_HANDLE, - templ: *mut _CK_ATTRIBUTE, - ulCount: ::std::os::raw::c_ulong, - object: *mut CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pTemplate: CK_ATTRIBUTE_PTR, + ulCount: CK_ULONG, + phObject: CK_OBJECT_HANDLE_PTR, ) -> CK_RV { (self .C_CreateObject .as_ref() - .expect("Expected function, got error."))(session, templ, ulCount, object) + .expect("Expected function, got error."))(hSession, pTemplate, ulCount, phObject) } pub unsafe fn C_CopyObject( &self, - session: CK_SESSION_HANDLE, - object: CK_OBJECT_HANDLE, - templ: *mut _CK_ATTRIBUTE, - ulCount: ::std::os::raw::c_ulong, - new_object: *mut CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + hObject: CK_OBJECT_HANDLE, + pTemplate: CK_ATTRIBUTE_PTR, + ulCount: CK_ULONG, + phNewObject: CK_OBJECT_HANDLE_PTR, ) -> CK_RV { (self .C_CopyObject .as_ref() .expect("Expected function, got error."))( - session, object, templ, ulCount, new_object + hSession, + hObject, + pTemplate, + ulCount, + phNewObject, ) } pub unsafe fn C_DestroyObject( &self, - session: CK_SESSION_HANDLE, - object: CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + hObject: CK_OBJECT_HANDLE, ) -> CK_RV { (self .C_DestroyObject .as_ref() - .expect("Expected function, got error."))(session, object) + .expect("Expected function, got error."))(hSession, hObject) } pub unsafe fn C_GetObjectSize( &self, - session: CK_SESSION_HANDLE, - object: CK_OBJECT_HANDLE, - size: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + hObject: CK_OBJECT_HANDLE, + pulSize: CK_ULONG_PTR, ) -> CK_RV { (self .C_GetObjectSize .as_ref() - .expect("Expected function, got error."))(session, object, size) + .expect("Expected function, got error."))(hSession, hObject, pulSize) } pub unsafe fn C_GetAttributeValue( &self, - session: CK_SESSION_HANDLE, - object: CK_OBJECT_HANDLE, - templ: *mut _CK_ATTRIBUTE, - ulCount: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + hObject: CK_OBJECT_HANDLE, + pTemplate: CK_ATTRIBUTE_PTR, + ulCount: CK_ULONG, ) -> CK_RV { (self .C_GetAttributeValue .as_ref() - .expect("Expected function, got error."))(session, object, templ, ulCount) + .expect("Expected function, got error."))(hSession, hObject, pTemplate, ulCount) } pub unsafe fn C_SetAttributeValue( &self, - session: CK_SESSION_HANDLE, - object: CK_OBJECT_HANDLE, - templ: *mut _CK_ATTRIBUTE, - ulCount: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + hObject: CK_OBJECT_HANDLE, + pTemplate: CK_ATTRIBUTE_PTR, + ulCount: CK_ULONG, ) -> CK_RV { (self .C_SetAttributeValue .as_ref() - .expect("Expected function, got error."))(session, object, templ, ulCount) + .expect("Expected function, got error."))(hSession, hObject, pTemplate, ulCount) } pub unsafe fn C_FindObjectsInit( &self, - session: CK_SESSION_HANDLE, - templ: *mut _CK_ATTRIBUTE, - ulCount: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pTemplate: CK_ATTRIBUTE_PTR, + ulCount: CK_ULONG, ) -> CK_RV { (self .C_FindObjectsInit .as_ref() - .expect("Expected function, got error."))(session, templ, ulCount) + .expect("Expected function, got error."))(hSession, pTemplate, ulCount) } pub unsafe fn C_FindObjects( &self, - session: CK_SESSION_HANDLE, - object: *mut CK_OBJECT_HANDLE, - max_object_count: ::std::os::raw::c_ulong, - object_count: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + phObject: CK_OBJECT_HANDLE_PTR, + ulMaxObjectCount: CK_ULONG, + pulObjectCount: CK_ULONG_PTR, ) -> CK_RV { (self .C_FindObjects .as_ref() .expect("Expected function, got error."))( - session, - object, - max_object_count, - object_count, + hSession, + phObject, + ulMaxObjectCount, + pulObjectCount, ) } - pub unsafe fn C_FindObjectsFinal(&self, session: CK_SESSION_HANDLE) -> CK_RV { + pub unsafe fn C_FindObjectsFinal(&self, hSession: CK_SESSION_HANDLE) -> CK_RV { (self .C_FindObjectsFinal .as_ref() - .expect("Expected function, got error."))(session) + .expect("Expected function, got error."))(hSession) } pub unsafe fn C_EncryptInit( &self, - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - key: CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, ) -> CK_RV { (self .C_EncryptInit .as_ref() - .expect("Expected function, got error."))(session, mechanism, key) + .expect("Expected function, got error."))(hSession, pMechanism, hKey) } pub unsafe fn C_Encrypt( &self, - session: CK_SESSION_HANDLE, - data: *mut ::std::os::raw::c_uchar, - data_len: ::std::os::raw::c_ulong, - encrypted_data: *mut ::std::os::raw::c_uchar, - encrypted_data_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pEncryptedData: CK_BYTE_PTR, + pulEncryptedDataLen: CK_ULONG_PTR, ) -> CK_RV { (self .C_Encrypt .as_ref() .expect("Expected function, got error."))( - session, - data, - data_len, - encrypted_data, - encrypted_data_len, + hSession, + pData, + ulDataLen, + pEncryptedData, + pulEncryptedDataLen, ) } pub unsafe fn C_EncryptUpdate( &self, - session: CK_SESSION_HANDLE, - part: *mut ::std::os::raw::c_uchar, - part_len: ::std::os::raw::c_ulong, - encrypted_part: *mut ::std::os::raw::c_uchar, - encrypted_part_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pPart: CK_BYTE_PTR, + ulPartLen: CK_ULONG, + pEncryptedPart: CK_BYTE_PTR, + pulEncryptedPartLen: CK_ULONG_PTR, ) -> CK_RV { (self .C_EncryptUpdate .as_ref() .expect("Expected function, got error."))( - session, - part, - part_len, - encrypted_part, - encrypted_part_len, + hSession, + pPart, + ulPartLen, + pEncryptedPart, + pulEncryptedPartLen, ) } pub unsafe fn C_EncryptFinal( &self, - session: CK_SESSION_HANDLE, - last_encrypted_part: *mut ::std::os::raw::c_uchar, - last_encrypted_part_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pLastEncryptedPart: CK_BYTE_PTR, + pulLastEncryptedPartLen: CK_ULONG_PTR, ) -> CK_RV { (self .C_EncryptFinal .as_ref() .expect("Expected function, got error."))( - session, - last_encrypted_part, - last_encrypted_part_len, + hSession, + pLastEncryptedPart, + pulLastEncryptedPartLen, ) } pub unsafe fn C_DecryptInit( &self, - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - key: CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, ) -> CK_RV { (self .C_DecryptInit .as_ref() - .expect("Expected function, got error."))(session, mechanism, key) + .expect("Expected function, got error."))(hSession, pMechanism, hKey) } pub unsafe fn C_Decrypt( &self, - session: CK_SESSION_HANDLE, - encrypted_data: *mut ::std::os::raw::c_uchar, - encrypted_data_len: ::std::os::raw::c_ulong, - data: *mut ::std::os::raw::c_uchar, - data_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pEncryptedData: CK_BYTE_PTR, + ulEncryptedDataLen: CK_ULONG, + pData: CK_BYTE_PTR, + pulDataLen: CK_ULONG_PTR, ) -> CK_RV { (self .C_Decrypt .as_ref() .expect("Expected function, got error."))( - session, - encrypted_data, - encrypted_data_len, - data, - data_len, + hSession, + pEncryptedData, + ulEncryptedDataLen, + pData, + pulDataLen, ) } pub unsafe fn C_DecryptUpdate( &self, - session: CK_SESSION_HANDLE, - encrypted_part: *mut ::std::os::raw::c_uchar, - encrypted_part_len: ::std::os::raw::c_ulong, - part: *mut ::std::os::raw::c_uchar, - part_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pEncryptedPart: CK_BYTE_PTR, + ulEncryptedPartLen: CK_ULONG, + pPart: CK_BYTE_PTR, + pulPartLen: CK_ULONG_PTR, ) -> CK_RV { (self .C_DecryptUpdate .as_ref() .expect("Expected function, got error."))( - session, - encrypted_part, - encrypted_part_len, - part, - part_len, + hSession, + pEncryptedPart, + ulEncryptedPartLen, + pPart, + pulPartLen, ) } pub unsafe fn C_DecryptFinal( &self, - session: CK_SESSION_HANDLE, - last_part: *mut ::std::os::raw::c_uchar, - last_part_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pLastPart: CK_BYTE_PTR, + pulLastPartLen: CK_ULONG_PTR, ) -> CK_RV { (self .C_DecryptFinal .as_ref() - .expect("Expected function, got error."))(session, last_part, last_part_len) + .expect("Expected function, got error."))(hSession, pLastPart, pulLastPartLen) } pub unsafe fn C_DigestInit( &self, - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, ) -> CK_RV { (self .C_DigestInit .as_ref() - .expect("Expected function, got error."))(session, mechanism) + .expect("Expected function, got error."))(hSession, pMechanism) } pub unsafe fn C_Digest( &self, - session: CK_SESSION_HANDLE, - data: *mut ::std::os::raw::c_uchar, - data_len: ::std::os::raw::c_ulong, - digest: *mut ::std::os::raw::c_uchar, - digest_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pDigest: CK_BYTE_PTR, + pulDigestLen: CK_ULONG_PTR, ) -> CK_RV { (self .C_Digest .as_ref() .expect("Expected function, got error."))( - session, data, data_len, digest, digest_len + hSession, + pData, + ulDataLen, + pDigest, + pulDigestLen, ) } pub unsafe fn C_DigestUpdate( &self, - session: CK_SESSION_HANDLE, - part: *mut ::std::os::raw::c_uchar, - part_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pPart: CK_BYTE_PTR, + ulPartLen: CK_ULONG, ) -> CK_RV { (self .C_DigestUpdate .as_ref() - .expect("Expected function, got error."))(session, part, part_len) + .expect("Expected function, got error."))(hSession, pPart, ulPartLen) } - pub unsafe fn C_DigestKey(&self, session: CK_SESSION_HANDLE, key: CK_OBJECT_HANDLE) -> CK_RV { + pub unsafe fn C_DigestKey(&self, hSession: CK_SESSION_HANDLE, hKey: CK_OBJECT_HANDLE) -> CK_RV { (self .C_DigestKey .as_ref() - .expect("Expected function, got error."))(session, key) + .expect("Expected function, got error."))(hSession, hKey) } pub unsafe fn C_DigestFinal( &self, - session: CK_SESSION_HANDLE, - digest: *mut ::std::os::raw::c_uchar, - digest_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pDigest: CK_BYTE_PTR, + pulDigestLen: CK_ULONG_PTR, ) -> CK_RV { (self .C_DigestFinal .as_ref() - .expect("Expected function, got error."))(session, digest, digest_len) + .expect("Expected function, got error."))(hSession, pDigest, pulDigestLen) } pub unsafe fn C_SignInit( &self, - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - key: CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, ) -> CK_RV { (self .C_SignInit .as_ref() - .expect("Expected function, got error."))(session, mechanism, key) + .expect("Expected function, got error."))(hSession, pMechanism, hKey) } pub unsafe fn C_Sign( &self, - session: CK_SESSION_HANDLE, - data: *mut ::std::os::raw::c_uchar, - data_len: ::std::os::raw::c_ulong, - signature: *mut ::std::os::raw::c_uchar, - signature_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + pulSignatureLen: CK_ULONG_PTR, ) -> CK_RV { (self.C_Sign.as_ref().expect("Expected function, got error."))( - session, - data, - data_len, - signature, - signature_len, + hSession, + pData, + ulDataLen, + pSignature, + pulSignatureLen, ) } pub unsafe fn C_SignUpdate( &self, - session: CK_SESSION_HANDLE, - part: *mut ::std::os::raw::c_uchar, - part_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pPart: CK_BYTE_PTR, + ulPartLen: CK_ULONG, ) -> CK_RV { (self .C_SignUpdate .as_ref() - .expect("Expected function, got error."))(session, part, part_len) + .expect("Expected function, got error."))(hSession, pPart, ulPartLen) } pub unsafe fn C_SignFinal( &self, - session: CK_SESSION_HANDLE, - signature: *mut ::std::os::raw::c_uchar, - signature_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pSignature: CK_BYTE_PTR, + pulSignatureLen: CK_ULONG_PTR, ) -> CK_RV { (self .C_SignFinal .as_ref() - .expect("Expected function, got error."))(session, signature, signature_len) + .expect("Expected function, got error."))(hSession, pSignature, pulSignatureLen) } pub unsafe fn C_SignRecoverInit( &self, - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - key: CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, ) -> CK_RV { (self .C_SignRecoverInit .as_ref() - .expect("Expected function, got error."))(session, mechanism, key) + .expect("Expected function, got error."))(hSession, pMechanism, hKey) } pub unsafe fn C_SignRecover( &self, - session: CK_SESSION_HANDLE, - data: *mut ::std::os::raw::c_uchar, - data_len: ::std::os::raw::c_ulong, - signature: *mut ::std::os::raw::c_uchar, - signature_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + pulSignatureLen: CK_ULONG_PTR, ) -> CK_RV { (self .C_SignRecover .as_ref() .expect("Expected function, got error."))( - session, - data, - data_len, - signature, - signature_len, + hSession, + pData, + ulDataLen, + pSignature, + pulSignatureLen, ) } pub unsafe fn C_VerifyInit( &self, - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - key: CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, ) -> CK_RV { (self .C_VerifyInit .as_ref() - .expect("Expected function, got error."))(session, mechanism, key) + .expect("Expected function, got error."))(hSession, pMechanism, hKey) } pub unsafe fn C_Verify( &self, - session: CK_SESSION_HANDLE, - data: *mut ::std::os::raw::c_uchar, - data_len: ::std::os::raw::c_ulong, - signature: *mut ::std::os::raw::c_uchar, - signature_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + ulSignatureLen: CK_ULONG, ) -> CK_RV { (self .C_Verify .as_ref() .expect("Expected function, got error."))( - session, - data, - data_len, - signature, - signature_len, + hSession, + pData, + ulDataLen, + pSignature, + ulSignatureLen, ) } pub unsafe fn C_VerifyUpdate( &self, - session: CK_SESSION_HANDLE, - part: *mut ::std::os::raw::c_uchar, - part_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pPart: CK_BYTE_PTR, + ulPartLen: CK_ULONG, ) -> CK_RV { (self .C_VerifyUpdate .as_ref() - .expect("Expected function, got error."))(session, part, part_len) + .expect("Expected function, got error."))(hSession, pPart, ulPartLen) } pub unsafe fn C_VerifyFinal( &self, - session: CK_SESSION_HANDLE, - signature: *mut ::std::os::raw::c_uchar, - signature_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pSignature: CK_BYTE_PTR, + ulSignatureLen: CK_ULONG, ) -> CK_RV { (self .C_VerifyFinal .as_ref() - .expect("Expected function, got error."))(session, signature, signature_len) + .expect("Expected function, got error."))(hSession, pSignature, ulSignatureLen) } pub unsafe fn C_VerifyRecoverInit( &self, - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - key: CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, ) -> CK_RV { (self .C_VerifyRecoverInit .as_ref() - .expect("Expected function, got error."))(session, mechanism, key) + .expect("Expected function, got error."))(hSession, pMechanism, hKey) } pub unsafe fn C_VerifyRecover( &self, - session: CK_SESSION_HANDLE, - signature: *mut ::std::os::raw::c_uchar, - signature_len: ::std::os::raw::c_ulong, - data: *mut ::std::os::raw::c_uchar, - data_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pSignature: CK_BYTE_PTR, + ulSignatureLen: CK_ULONG, + pData: CK_BYTE_PTR, + pulDataLen: CK_ULONG_PTR, ) -> CK_RV { (self .C_VerifyRecover .as_ref() .expect("Expected function, got error."))( - session, - signature, - signature_len, - data, - data_len, + hSession, + pSignature, + ulSignatureLen, + pData, + pulDataLen, ) } pub unsafe fn C_DigestEncryptUpdate( &self, - session: CK_SESSION_HANDLE, - part: *mut ::std::os::raw::c_uchar, - part_len: ::std::os::raw::c_ulong, - encrypted_part: *mut ::std::os::raw::c_uchar, - encrypted_part_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pPart: CK_BYTE_PTR, + ulPartLen: CK_ULONG, + pEncryptedPart: CK_BYTE_PTR, + pulEncryptedPartLen: CK_ULONG_PTR, ) -> CK_RV { (self .C_DigestEncryptUpdate .as_ref() .expect("Expected function, got error."))( - session, - part, - part_len, - encrypted_part, - encrypted_part_len, + hSession, + pPart, + ulPartLen, + pEncryptedPart, + pulEncryptedPartLen, ) } pub unsafe fn C_DecryptDigestUpdate( &self, - session: CK_SESSION_HANDLE, - encrypted_part: *mut ::std::os::raw::c_uchar, - encrypted_part_len: ::std::os::raw::c_ulong, - part: *mut ::std::os::raw::c_uchar, - part_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pEncryptedPart: CK_BYTE_PTR, + ulEncryptedPartLen: CK_ULONG, + pPart: CK_BYTE_PTR, + pulPartLen: CK_ULONG_PTR, ) -> CK_RV { (self .C_DecryptDigestUpdate .as_ref() .expect("Expected function, got error."))( - session, - encrypted_part, - encrypted_part_len, - part, - part_len, + hSession, + pEncryptedPart, + ulEncryptedPartLen, + pPart, + pulPartLen, ) } pub unsafe fn C_SignEncryptUpdate( &self, - session: CK_SESSION_HANDLE, - part: *mut ::std::os::raw::c_uchar, - part_len: ::std::os::raw::c_ulong, - encrypted_part: *mut ::std::os::raw::c_uchar, - encrypted_part_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pPart: CK_BYTE_PTR, + ulPartLen: CK_ULONG, + pEncryptedPart: CK_BYTE_PTR, + pulEncryptedPartLen: CK_ULONG_PTR, ) -> CK_RV { (self .C_SignEncryptUpdate .as_ref() .expect("Expected function, got error."))( - session, - part, - part_len, - encrypted_part, - encrypted_part_len, + hSession, + pPart, + ulPartLen, + pEncryptedPart, + pulEncryptedPartLen, ) } pub unsafe fn C_DecryptVerifyUpdate( &self, - session: CK_SESSION_HANDLE, - encrypted_part: *mut ::std::os::raw::c_uchar, - encrypted_part_len: ::std::os::raw::c_ulong, - part: *mut ::std::os::raw::c_uchar, - part_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pEncryptedPart: CK_BYTE_PTR, + ulEncryptedPartLen: CK_ULONG, + pPart: CK_BYTE_PTR, + pulPartLen: CK_ULONG_PTR, ) -> CK_RV { (self .C_DecryptVerifyUpdate .as_ref() .expect("Expected function, got error."))( - session, - encrypted_part, - encrypted_part_len, - part, - part_len, + hSession, + pEncryptedPart, + ulEncryptedPartLen, + pPart, + pulPartLen, ) } pub unsafe fn C_GenerateKey( &self, - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - templ: *mut _CK_ATTRIBUTE, - ulCount: ::std::os::raw::c_ulong, - key: *mut CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + pTemplate: CK_ATTRIBUTE_PTR, + ulCount: CK_ULONG, + phKey: CK_OBJECT_HANDLE_PTR, ) -> CK_RV { (self .C_GenerateKey .as_ref() .expect("Expected function, got error."))( - session, mechanism, templ, ulCount, key + hSession, pMechanism, pTemplate, ulCount, phKey, ) } pub unsafe fn C_GenerateKeyPair( &self, - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - public_key_template: *mut _CK_ATTRIBUTE, - public_key_attribute_count: ::std::os::raw::c_ulong, - private_key_template: *mut _CK_ATTRIBUTE, - private_key_attribute_count: ::std::os::raw::c_ulong, - public_key: *mut CK_OBJECT_HANDLE, - private_key: *mut CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + pPublicKeyTemplate: CK_ATTRIBUTE_PTR, + ulPublicKeyAttributeCount: CK_ULONG, + pPrivateKeyTemplate: CK_ATTRIBUTE_PTR, + ulPrivateKeyAttributeCount: CK_ULONG, + phPublicKey: CK_OBJECT_HANDLE_PTR, + phPrivateKey: CK_OBJECT_HANDLE_PTR, ) -> CK_RV { (self .C_GenerateKeyPair .as_ref() .expect("Expected function, got error."))( - session, - mechanism, - public_key_template, - public_key_attribute_count, - private_key_template, - private_key_attribute_count, - public_key, - private_key, + hSession, + pMechanism, + pPublicKeyTemplate, + ulPublicKeyAttributeCount, + pPrivateKeyTemplate, + ulPrivateKeyAttributeCount, + phPublicKey, + phPrivateKey, ) } pub unsafe fn C_WrapKey( &self, - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - wrapping_key: CK_OBJECT_HANDLE, - key: CK_OBJECT_HANDLE, - wrapped_key: *mut ::std::os::raw::c_uchar, - wrapped_key_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hWrappingKey: CK_OBJECT_HANDLE, + hKey: CK_OBJECT_HANDLE, + pWrappedKey: CK_BYTE_PTR, + pulWrappedKeyLen: CK_ULONG_PTR, ) -> CK_RV { (self .C_WrapKey .as_ref() .expect("Expected function, got error."))( - session, - mechanism, - wrapping_key, - key, - wrapped_key, - wrapped_key_len, + hSession, + pMechanism, + hWrappingKey, + hKey, + pWrappedKey, + pulWrappedKeyLen, ) } pub unsafe fn C_UnwrapKey( &self, - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - unwrapping_key: CK_OBJECT_HANDLE, - wrapped_key: *mut ::std::os::raw::c_uchar, - wrapped_key_len: ::std::os::raw::c_ulong, - templ: *mut _CK_ATTRIBUTE, - attribute_count: ::std::os::raw::c_ulong, - key: *mut CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hUnwrappingKey: CK_OBJECT_HANDLE, + pWrappedKey: CK_BYTE_PTR, + ulWrappedKeyLen: CK_ULONG, + pTemplate: CK_ATTRIBUTE_PTR, + ulAttributeCount: CK_ULONG, + phKey: CK_OBJECT_HANDLE_PTR, ) -> CK_RV { (self .C_UnwrapKey .as_ref() .expect("Expected function, got error."))( - session, - mechanism, - unwrapping_key, - wrapped_key, - wrapped_key_len, - templ, - attribute_count, - key, + hSession, + pMechanism, + hUnwrappingKey, + pWrappedKey, + ulWrappedKeyLen, + pTemplate, + ulAttributeCount, + phKey, ) } pub unsafe fn C_DeriveKey( &self, - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - base_key: CK_OBJECT_HANDLE, - templ: *mut _CK_ATTRIBUTE, - attribute_count: ::std::os::raw::c_ulong, - key: *mut CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hBaseKey: CK_OBJECT_HANDLE, + pTemplate: CK_ATTRIBUTE_PTR, + ulAttributeCount: CK_ULONG, + phKey: CK_OBJECT_HANDLE_PTR, ) -> CK_RV { (self .C_DeriveKey .as_ref() .expect("Expected function, got error."))( - session, - mechanism, - base_key, - templ, - attribute_count, - key, + hSession, + pMechanism, + hBaseKey, + pTemplate, + ulAttributeCount, + phKey, ) } pub unsafe fn C_SeedRandom( &self, - session: CK_SESSION_HANDLE, - seed: *mut ::std::os::raw::c_uchar, - seed_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pSeed: CK_BYTE_PTR, + ulSeedLen: CK_ULONG, ) -> CK_RV { (self .C_SeedRandom .as_ref() - .expect("Expected function, got error."))(session, seed, seed_len) + .expect("Expected function, got error."))(hSession, pSeed, ulSeedLen) } pub unsafe fn C_GenerateRandom( &self, - session: CK_SESSION_HANDLE, - random_data: *mut ::std::os::raw::c_uchar, - random_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + RandomData: CK_BYTE_PTR, + ulRandomLen: CK_ULONG, ) -> CK_RV { (self .C_GenerateRandom .as_ref() - .expect("Expected function, got error."))(session, random_data, random_len) + .expect("Expected function, got error."))(hSession, RandomData, ulRandomLen) } - pub unsafe fn C_GetFunctionStatus(&self, session: CK_SESSION_HANDLE) -> CK_RV { + pub unsafe fn C_GetFunctionStatus(&self, hSession: CK_SESSION_HANDLE) -> CK_RV { (self .C_GetFunctionStatus .as_ref() - .expect("Expected function, got error."))(session) + .expect("Expected function, got error."))(hSession) } - pub unsafe fn C_CancelFunction(&self, session: CK_SESSION_HANDLE) -> CK_RV { + pub unsafe fn C_CancelFunction(&self, hSession: CK_SESSION_HANDLE) -> CK_RV { (self .C_CancelFunction .as_ref() - .expect("Expected function, got error."))(session) + .expect("Expected function, got error."))(hSession) + } + pub unsafe fn C_WaitForSlotEvent( + &self, + flags: CK_FLAGS, + pSlot: CK_SLOT_ID_PTR, + pRserved: CK_VOID_PTR, + ) -> CK_RV { + (self + .C_WaitForSlotEvent + .as_ref() + .expect("Expected function, got error."))(flags, pSlot, pRserved) + } + pub unsafe fn C_GetInterfaceList( + &self, + pInterfacesList: CK_INTERFACE_PTR, + pulCount: CK_ULONG_PTR, + ) -> CK_RV { + (self + .C_GetInterfaceList + .as_ref() + .expect("Expected function, got error."))(pInterfacesList, pulCount) + } + pub unsafe fn C_GetInterface( + &self, + pInterfaceName: CK_UTF8CHAR_PTR, + pVersion: CK_VERSION_PTR, + ppInterface: CK_INTERFACE_PTR_PTR, + flags: CK_FLAGS, + ) -> CK_RV { + (self + .C_GetInterface + .as_ref() + .expect("Expected function, got error."))( + pInterfaceName, pVersion, ppInterface, flags + ) + } + pub unsafe fn C_LoginUser( + &self, + hSession: CK_SESSION_HANDLE, + userType: CK_USER_TYPE, + pPin: CK_UTF8CHAR_PTR, + ulPinLen: CK_ULONG, + pUsername: CK_UTF8CHAR_PTR, + ulUsernameLen: CK_ULONG, + ) -> CK_RV { + (self + .C_LoginUser + .as_ref() + .expect("Expected function, got error."))( + hSession, + userType, + pPin, + ulPinLen, + pUsername, + ulUsernameLen, + ) + } + pub unsafe fn C_SessionCancel(&self, hSession: CK_SESSION_HANDLE, flags: CK_FLAGS) -> CK_RV { + (self + .C_SessionCancel + .as_ref() + .expect("Expected function, got error."))(hSession, flags) + } + pub unsafe fn C_MessageEncryptInit( + &self, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, + ) -> CK_RV { + (self + .C_MessageEncryptInit + .as_ref() + .expect("Expected function, got error."))(hSession, pMechanism, hKey) + } + pub unsafe fn C_EncryptMessage( + &self, + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pAssociatedData: CK_BYTE_PTR, + ulAssociatedDataLen: CK_ULONG, + pPlaintext: CK_BYTE_PTR, + ulPlaintextLen: CK_ULONG, + pCiphertext: CK_BYTE_PTR, + pulCiphertextLen: CK_ULONG_PTR, + ) -> CK_RV { + (self + .C_EncryptMessage + .as_ref() + .expect("Expected function, got error."))( + hSession, + pParameter, + ulParameterLen, + pAssociatedData, + ulAssociatedDataLen, + pPlaintext, + ulPlaintextLen, + pCiphertext, + pulCiphertextLen, + ) + } + pub unsafe fn C_EncryptMessageBegin( + &self, + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pAssociatedData: CK_BYTE_PTR, + ulAssociatedDataLen: CK_ULONG, + ) -> CK_RV { + (self + .C_EncryptMessageBegin + .as_ref() + .expect("Expected function, got error."))( + hSession, + pParameter, + ulParameterLen, + pAssociatedData, + ulAssociatedDataLen, + ) + } + pub unsafe fn C_EncryptMessageNext( + &self, + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pPlaintextPart: CK_BYTE_PTR, + ulPlaintextPartLen: CK_ULONG, + pCiphertextPart: CK_BYTE_PTR, + pulCiphertextPartLen: CK_ULONG_PTR, + flags: CK_FLAGS, + ) -> CK_RV { + (self + .C_EncryptMessageNext + .as_ref() + .expect("Expected function, got error."))( + hSession, + pParameter, + ulParameterLen, + pPlaintextPart, + ulPlaintextPartLen, + pCiphertextPart, + pulCiphertextPartLen, + flags, + ) + } + pub unsafe fn C_MessageEncryptFinal(&self, hSession: CK_SESSION_HANDLE) -> CK_RV { + (self + .C_MessageEncryptFinal + .as_ref() + .expect("Expected function, got error."))(hSession) + } + pub unsafe fn C_MessageDecryptInit( + &self, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, + ) -> CK_RV { + (self + .C_MessageDecryptInit + .as_ref() + .expect("Expected function, got error."))(hSession, pMechanism, hKey) + } + pub unsafe fn C_DecryptMessage( + &self, + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pAssociatedData: CK_BYTE_PTR, + ulAssociatedDataLen: CK_ULONG, + pCiphertext: CK_BYTE_PTR, + ulCiphertextLen: CK_ULONG, + pPlaintext: CK_BYTE_PTR, + pulPlaintextLen: CK_ULONG_PTR, + ) -> CK_RV { + (self + .C_DecryptMessage + .as_ref() + .expect("Expected function, got error."))( + hSession, + pParameter, + ulParameterLen, + pAssociatedData, + ulAssociatedDataLen, + pCiphertext, + ulCiphertextLen, + pPlaintext, + pulPlaintextLen, + ) + } + pub unsafe fn C_DecryptMessageBegin( + &self, + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pAssociatedData: CK_BYTE_PTR, + ulAssociatedDataLen: CK_ULONG, + ) -> CK_RV { + (self + .C_DecryptMessageBegin + .as_ref() + .expect("Expected function, got error."))( + hSession, + pParameter, + ulParameterLen, + pAssociatedData, + ulAssociatedDataLen, + ) + } + pub unsafe fn C_DecryptMessageNext( + &self, + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pCiphertext: CK_BYTE_PTR, + ulCiphertextLen: CK_ULONG, + pPlaintext: CK_BYTE_PTR, + pulPlaintextLen: CK_ULONG_PTR, + flags: CK_FLAGS, + ) -> CK_RV { + (self + .C_DecryptMessageNext + .as_ref() + .expect("Expected function, got error."))( + hSession, + pParameter, + ulParameterLen, + pCiphertext, + ulCiphertextLen, + pPlaintext, + pulPlaintextLen, + flags, + ) + } + pub unsafe fn C_MessageDecryptFinal(&self, hSession: CK_SESSION_HANDLE) -> CK_RV { + (self + .C_MessageDecryptFinal + .as_ref() + .expect("Expected function, got error."))(hSession) + } + pub unsafe fn C_MessageSignInit( + &self, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, + ) -> CK_RV { + (self + .C_MessageSignInit + .as_ref() + .expect("Expected function, got error."))(hSession, pMechanism, hKey) + } + pub unsafe fn C_SignMessage( + &self, + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + pulSignatureLen: CK_ULONG_PTR, + ) -> CK_RV { + (self + .C_SignMessage + .as_ref() + .expect("Expected function, got error."))( + hSession, + pParameter, + ulParameterLen, + pData, + ulDataLen, + pSignature, + pulSignatureLen, + ) + } + pub unsafe fn C_SignMessageBegin( + &self, + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + ) -> CK_RV { + (self + .C_SignMessageBegin + .as_ref() + .expect("Expected function, got error."))(hSession, pParameter, ulParameterLen) + } + pub unsafe fn C_SignMessageNext( + &self, + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + pulSignatureLen: CK_ULONG_PTR, + ) -> CK_RV { + (self + .C_SignMessageNext + .as_ref() + .expect("Expected function, got error."))( + hSession, + pParameter, + ulParameterLen, + pData, + ulDataLen, + pSignature, + pulSignatureLen, + ) + } + pub unsafe fn C_MessageSignFinal(&self, hSession: CK_SESSION_HANDLE) -> CK_RV { + (self + .C_MessageSignFinal + .as_ref() + .expect("Expected function, got error."))(hSession) + } + pub unsafe fn C_MessageVerifyInit( + &self, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, + ) -> CK_RV { + (self + .C_MessageVerifyInit + .as_ref() + .expect("Expected function, got error."))(hSession, pMechanism, hKey) + } + pub unsafe fn C_VerifyMessage( + &self, + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + ulSignatureLen: CK_ULONG, + ) -> CK_RV { + (self + .C_VerifyMessage + .as_ref() + .expect("Expected function, got error."))( + hSession, + pParameter, + ulParameterLen, + pData, + ulDataLen, + pSignature, + ulSignatureLen, + ) + } + pub unsafe fn C_VerifyMessageBegin( + &self, + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + ) -> CK_RV { + (self + .C_VerifyMessageBegin + .as_ref() + .expect("Expected function, got error."))(hSession, pParameter, ulParameterLen) + } + pub unsafe fn C_VerifyMessageNext( + &self, + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + ulSignatureLen: CK_ULONG, + ) -> CK_RV { + (self + .C_VerifyMessageNext + .as_ref() + .expect("Expected function, got error."))( + hSession, + pParameter, + ulParameterLen, + pData, + ulDataLen, + pSignature, + ulSignatureLen, + ) + } + pub unsafe fn C_MessageVerifyFinal(&self, hSession: CK_SESSION_HANDLE) -> CK_RV { + (self + .C_MessageVerifyFinal + .as_ref() + .expect("Expected function, got error."))(hSession) } } diff --git a/cryptoki-sys/src/bindings/x86_64-pc-windows-msvc.rs b/cryptoki-sys/src/bindings/x86_64-pc-windows-msvc.rs index 618e8917..1179f5d2 100644 --- a/cryptoki-sys/src/bindings/x86_64-pc-windows-msvc.rs +++ b/cryptoki-sys/src/bindings/x86_64-pc-windows-msvc.rs @@ -1,10 +1,22 @@ /* automatically generated by rust-bindgen 0.63.0 */ -pub const PKCS11_H: u32 = 1; -pub const CRYPTOKI_VERSION_MAJOR: CK_BYTE = 2; -pub const CRYPTOKI_VERSION_MINOR: CK_BYTE = 40; -pub const P11_KIT_CRYPTOKI_VERSION_REVISION: u32 = 0; -pub const CRYPTOKI_COMPAT: u32 = 1; +pub const NULL_PTR: u32 = 0; +pub const _PKCS11_H_: u32 = 1; +pub const _PKCS11T_H_: u32 = 1; +pub const CRYPTOKI_VERSION_MAJOR: CK_BYTE = 3; +pub const CRYPTOKI_VERSION_MINOR: CK_BYTE = 0; +pub const CRYPTOKI_VERSION_AMENDMENT: CK_BYTE = 0; +pub const CK_TRUE: CK_BBOOL = 1; +pub const CK_FALSE: CK_BBOOL = 0; +pub const FALSE: u32 = 0; +pub const TRUE: u32 = 1; +pub const CK_EFFECTIVELY_INFINITE: CK_ULONG = 0; +pub const CK_INVALID_HANDLE: CK_ULONG = 0; +pub const CKN_SURRENDER: CK_NOTIFICATION = 0; +pub const CKN_OTP_CHANGED: CK_NOTIFICATION = 1; +pub const CKF_TOKEN_PRESENT: CK_FLAGS = 1; +pub const CKF_REMOVABLE_DEVICE: CK_FLAGS = 2; +pub const CKF_HW_SLOT: CK_FLAGS = 4; pub const CKF_RNG: CK_FLAGS = 1; pub const CKF_WRITE_PROTECTED: CK_FLAGS = 2; pub const CKF_LOGIN_REQUIRED: CK_FLAGS = 4; @@ -24,8 +36,6 @@ pub const CKF_SO_PIN_FINAL_TRY: CK_FLAGS = 2097152; pub const CKF_SO_PIN_LOCKED: CK_FLAGS = 4194304; pub const CKF_SO_PIN_TO_BE_CHANGED: CK_FLAGS = 8388608; pub const CKF_ERROR_STATE: CK_FLAGS = 16777216; -pub const CK_EFFECTIVELY_INFINITE: CK_ULONG = 0; -pub const CK_INVALID_HANDLE: CK_ULONG = 0; pub const CKU_SO: CK_USER_TYPE = 0; pub const CKU_USER: CK_USER_TYPE = 1; pub const CKU_CONTEXT_SPECIFIC: CK_USER_TYPE = 2; @@ -45,9 +55,18 @@ pub const CKO_HW_FEATURE: CK_OBJECT_CLASS = 5; pub const CKO_DOMAIN_PARAMETERS: CK_OBJECT_CLASS = 6; pub const CKO_MECHANISM: CK_OBJECT_CLASS = 7; pub const CKO_OTP_KEY: CK_OBJECT_CLASS = 8; +pub const CKO_PROFILE: CK_OBJECT_CLASS = 9; +pub const CKO_VENDOR_DEFINED: CK_OBJECT_CLASS = 2147483648; +pub const CKP_INVALID_ID: CK_PROFILE_ID = 0; +pub const CKP_BASELINE_PROVIDER: CK_PROFILE_ID = 1; +pub const CKP_EXTENDED_PROVIDER: CK_PROFILE_ID = 2; +pub const CKP_AUTHENTICATION_TOKEN: CK_PROFILE_ID = 3; +pub const CKP_PUBLIC_CERTIFICATES_TOKEN: CK_PROFILE_ID = 4; +pub const CKP_VENDOR_DEFINED: CK_PROFILE_ID = 2147483648; pub const CKH_MONOTONIC_COUNTER: CK_HW_FEATURE_TYPE = 1; pub const CKH_CLOCK: CK_HW_FEATURE_TYPE = 2; pub const CKH_USER_INTERFACE: CK_HW_FEATURE_TYPE = 3; +pub const CKH_VENDOR_DEFINED: CK_HW_FEATURE_TYPE = 2147483648; pub const CKK_RSA: CK_KEY_TYPE = 0; pub const CKK_DSA: CK_KEY_TYPE = 1; pub const CKK_DH: CK_KEY_TYPE = 2; @@ -63,6 +82,7 @@ pub const CKK_DES2: CK_KEY_TYPE = 20; pub const CKK_DES3: CK_KEY_TYPE = 21; pub const CKK_CAST: CK_KEY_TYPE = 22; pub const CKK_CAST3: CK_KEY_TYPE = 23; +pub const CKK_CAST5: CK_KEY_TYPE = 24; pub const CKK_CAST128: CK_KEY_TYPE = 24; pub const CKK_RC5: CK_KEY_TYPE = 25; pub const CKK_IDEA: CK_KEY_TYPE = 26; @@ -90,14 +110,48 @@ pub const CKK_SEED: CK_KEY_TYPE = 47; pub const CKK_GOSTR3410: CK_KEY_TYPE = 48; pub const CKK_GOSTR3411: CK_KEY_TYPE = 49; pub const CKK_GOST28147: CK_KEY_TYPE = 50; +pub const CKK_CHACHA20: CK_KEY_TYPE = 51; +pub const CKK_POLY1305: CK_KEY_TYPE = 52; +pub const CKK_AES_XTS: CK_KEY_TYPE = 53; +pub const CKK_SHA3_224_HMAC: CK_KEY_TYPE = 54; +pub const CKK_SHA3_256_HMAC: CK_KEY_TYPE = 55; +pub const CKK_SHA3_384_HMAC: CK_KEY_TYPE = 56; +pub const CKK_SHA3_512_HMAC: CK_KEY_TYPE = 57; +pub const CKK_BLAKE2B_160_HMAC: CK_KEY_TYPE = 58; +pub const CKK_BLAKE2B_256_HMAC: CK_KEY_TYPE = 59; +pub const CKK_BLAKE2B_384_HMAC: CK_KEY_TYPE = 60; +pub const CKK_BLAKE2B_512_HMAC: CK_KEY_TYPE = 61; +pub const CKK_SALSA20: CK_KEY_TYPE = 62; +pub const CKK_X2RATCHET: CK_KEY_TYPE = 63; pub const CKK_EC_EDWARDS: CK_KEY_TYPE = 64; +pub const CKK_EC_MONTGOMERY: CK_KEY_TYPE = 65; +pub const CKK_HKDF: CK_KEY_TYPE = 66; +pub const CKK_VENDOR_DEFINED: CK_KEY_TYPE = 2147483648; +pub const CK_CERTIFICATE_CATEGORY_UNSPECIFIED: CK_ULONG = 0; +pub const CK_CERTIFICATE_CATEGORY_TOKEN_USER: CK_ULONG = 1; +pub const CK_CERTIFICATE_CATEGORY_AUTHORITY: CK_ULONG = 2; +pub const CK_CERTIFICATE_CATEGORY_OTHER_ENTITY: CK_ULONG = 3; +pub const CK_SECURITY_DOMAIN_UNSPECIFIED: CK_ULONG = 0; +pub const CK_SECURITY_DOMAIN_MANUFACTURER: CK_ULONG = 1; +pub const CK_SECURITY_DOMAIN_OPERATOR: CK_ULONG = 2; +pub const CK_SECURITY_DOMAIN_THIRD_PARTY: CK_ULONG = 3; pub const CKC_X_509: CK_CERTIFICATE_TYPE = 0; pub const CKC_X_509_ATTR_CERT: CK_CERTIFICATE_TYPE = 1; pub const CKC_WTLS: CK_CERTIFICATE_TYPE = 2; +pub const CKC_VENDOR_DEFINED: CK_CERTIFICATE_TYPE = 2147483648; +pub const CKF_ARRAY_ATTRIBUTE: CK_FLAGS = 1073741824; +pub const CK_OTP_FORMAT_DECIMAL: CK_ULONG = 0; +pub const CK_OTP_FORMAT_HEXADECIMAL: CK_ULONG = 1; +pub const CK_OTP_FORMAT_ALPHANUMERIC: CK_ULONG = 2; +pub const CK_OTP_FORMAT_BINARY: CK_ULONG = 3; +pub const CK_OTP_PARAM_IGNORED: CK_ULONG = 0; +pub const CK_OTP_PARAM_OPTIONAL: CK_ULONG = 1; +pub const CK_OTP_PARAM_MANDATORY: CK_ULONG = 2; pub const CKA_CLASS: CK_ATTRIBUTE_TYPE = 0; pub const CKA_TOKEN: CK_ATTRIBUTE_TYPE = 1; pub const CKA_PRIVATE: CK_ATTRIBUTE_TYPE = 2; pub const CKA_LABEL: CK_ATTRIBUTE_TYPE = 3; +pub const CKA_UNIQUE_ID: CK_ATTRIBUTE_TYPE = 4; pub const CKA_APPLICATION: CK_ATTRIBUTE_TYPE = 16; pub const CKA_VALUE: CK_ATTRIBUTE_TYPE = 17; pub const CKA_OBJECT_ID: CK_ATTRIBUTE_TYPE = 18; @@ -144,6 +198,7 @@ pub const CKA_PRIME: CK_ATTRIBUTE_TYPE = 304; pub const CKA_SUBPRIME: CK_ATTRIBUTE_TYPE = 305; pub const CKA_BASE: CK_ATTRIBUTE_TYPE = 306; pub const CKA_PRIME_BITS: CK_ATTRIBUTE_TYPE = 307; +pub const CKA_SUBPRIME_BITS: CK_ATTRIBUTE_TYPE = 308; pub const CKA_SUB_PRIME_BITS: CK_ATTRIBUTE_TYPE = 308; pub const CKA_VALUE_BITS: CK_ATTRIBUTE_TYPE = 352; pub const CKA_VALUE_LEN: CK_ATTRIBUTE_TYPE = 353; @@ -162,6 +217,9 @@ pub const CKA_SECONDARY_AUTH: CK_ATTRIBUTE_TYPE = 512; pub const CKA_AUTH_PIN_FLAGS: CK_ATTRIBUTE_TYPE = 513; pub const CKA_ALWAYS_AUTHENTICATE: CK_ATTRIBUTE_TYPE = 514; pub const CKA_WRAP_WITH_TRUSTED: CK_ATTRIBUTE_TYPE = 528; +pub const CKA_WRAP_TEMPLATE: CK_ATTRIBUTE_TYPE = 1073742353; +pub const CKA_UNWRAP_TEMPLATE: CK_ATTRIBUTE_TYPE = 1073742354; +pub const CKA_DERIVE_TEMPLATE: CK_ATTRIBUTE_TYPE = 1073742355; pub const CKA_OTP_FORMAT: CK_ATTRIBUTE_TYPE = 544; pub const CKA_OTP_LENGTH: CK_ATTRIBUTE_TYPE = 545; pub const CKA_OTP_TIME_INTERVAL: CK_ATTRIBUTE_TYPE = 546; @@ -170,12 +228,12 @@ pub const CKA_OTP_CHALLENGE_REQUIREMENT: CK_ATTRIBUTE_TYPE = 548; pub const CKA_OTP_TIME_REQUIREMENT: CK_ATTRIBUTE_TYPE = 549; pub const CKA_OTP_COUNTER_REQUIREMENT: CK_ATTRIBUTE_TYPE = 550; pub const CKA_OTP_PIN_REQUIREMENT: CK_ATTRIBUTE_TYPE = 551; +pub const CKA_OTP_COUNTER: CK_ATTRIBUTE_TYPE = 558; +pub const CKA_OTP_TIME: CK_ATTRIBUTE_TYPE = 559; pub const CKA_OTP_USER_IDENTIFIER: CK_ATTRIBUTE_TYPE = 554; pub const CKA_OTP_SERVICE_IDENTIFIER: CK_ATTRIBUTE_TYPE = 555; pub const CKA_OTP_SERVICE_LOGO: CK_ATTRIBUTE_TYPE = 556; pub const CKA_OTP_SERVICE_LOGO_TYPE: CK_ATTRIBUTE_TYPE = 557; -pub const CKA_OTP_COUNTER: CK_ATTRIBUTE_TYPE = 558; -pub const CKA_OTP_TIME: CK_ATTRIBUTE_TYPE = 559; pub const CKA_GOSTR3410_PARAMS: CK_ATTRIBUTE_TYPE = 592; pub const CKA_GOSTR3411_PARAMS: CK_ATTRIBUTE_TYPE = 593; pub const CKA_GOST28147_PARAMS: CK_ATTRIBUTE_TYPE = 594; @@ -196,6 +254,9 @@ pub const CKA_MECHANISM_TYPE: CK_ATTRIBUTE_TYPE = 1280; pub const CKA_REQUIRED_CMS_ATTRIBUTES: CK_ATTRIBUTE_TYPE = 1281; pub const CKA_DEFAULT_CMS_ATTRIBUTES: CK_ATTRIBUTE_TYPE = 1282; pub const CKA_SUPPORTED_CMS_ATTRIBUTES: CK_ATTRIBUTE_TYPE = 1283; +pub const CKA_ALLOWED_MECHANISMS: CK_ATTRIBUTE_TYPE = 1073743360; +pub const CKA_PROFILE_ID: CK_ATTRIBUTE_TYPE = 1537; +pub const CKA_VENDOR_DEFINED: CK_ATTRIBUTE_TYPE = 2147483648; pub const CKM_RSA_PKCS_KEY_PAIR_GEN: CK_MECHANISM_TYPE = 0; pub const CKM_RSA_PKCS: CK_MECHANISM_TYPE = 1; pub const CKM_RSA_9796: CK_MECHANISM_TYPE = 2; @@ -218,6 +279,10 @@ pub const CKM_DSA_SHA224: CK_MECHANISM_TYPE = 19; pub const CKM_DSA_SHA256: CK_MECHANISM_TYPE = 20; pub const CKM_DSA_SHA384: CK_MECHANISM_TYPE = 21; pub const CKM_DSA_SHA512: CK_MECHANISM_TYPE = 22; +pub const CKM_DSA_SHA3_224: CK_MECHANISM_TYPE = 24; +pub const CKM_DSA_SHA3_256: CK_MECHANISM_TYPE = 25; +pub const CKM_DSA_SHA3_384: CK_MECHANISM_TYPE = 26; +pub const CKM_DSA_SHA3_512: CK_MECHANISM_TYPE = 27; pub const CKM_DH_PKCS_KEY_PAIR_GEN: CK_MECHANISM_TYPE = 32; pub const CKM_DH_PKCS_DERIVE: CK_MECHANISM_TYPE = 33; pub const CKM_X9_42_DH_KEY_PAIR_GEN: CK_MECHANISM_TYPE = 48; @@ -230,6 +295,8 @@ pub const CKM_SHA512_RSA_PKCS: CK_MECHANISM_TYPE = 66; pub const CKM_SHA256_RSA_PKCS_PSS: CK_MECHANISM_TYPE = 67; pub const CKM_SHA384_RSA_PKCS_PSS: CK_MECHANISM_TYPE = 68; pub const CKM_SHA512_RSA_PKCS_PSS: CK_MECHANISM_TYPE = 69; +pub const CKM_SHA224_RSA_PKCS: CK_MECHANISM_TYPE = 70; +pub const CKM_SHA224_RSA_PKCS_PSS: CK_MECHANISM_TYPE = 71; pub const CKM_SHA512_224: CK_MECHANISM_TYPE = 72; pub const CKM_SHA512_224_HMAC: CK_MECHANISM_TYPE = 73; pub const CKM_SHA512_224_HMAC_GENERAL: CK_MECHANISM_TYPE = 74; @@ -242,6 +309,14 @@ pub const CKM_SHA512_T: CK_MECHANISM_TYPE = 80; pub const CKM_SHA512_T_HMAC: CK_MECHANISM_TYPE = 81; pub const CKM_SHA512_T_HMAC_GENERAL: CK_MECHANISM_TYPE = 82; pub const CKM_SHA512_T_KEY_DERIVATION: CK_MECHANISM_TYPE = 83; +pub const CKM_SHA3_256_RSA_PKCS: CK_MECHANISM_TYPE = 96; +pub const CKM_SHA3_384_RSA_PKCS: CK_MECHANISM_TYPE = 97; +pub const CKM_SHA3_512_RSA_PKCS: CK_MECHANISM_TYPE = 98; +pub const CKM_SHA3_256_RSA_PKCS_PSS: CK_MECHANISM_TYPE = 99; +pub const CKM_SHA3_384_RSA_PKCS_PSS: CK_MECHANISM_TYPE = 100; +pub const CKM_SHA3_512_RSA_PKCS_PSS: CK_MECHANISM_TYPE = 101; +pub const CKM_SHA3_224_RSA_PKCS: CK_MECHANISM_TYPE = 102; +pub const CKM_SHA3_224_RSA_PKCS_PSS: CK_MECHANISM_TYPE = 103; pub const CKM_RC2_KEY_GEN: CK_MECHANISM_TYPE = 256; pub const CKM_RC2_ECB: CK_MECHANISM_TYPE = 257; pub const CKM_RC2_CBC: CK_MECHANISM_TYPE = 258; @@ -293,6 +368,9 @@ pub const CKM_RIPEMD160_HMAC_GENERAL: CK_MECHANISM_TYPE = 578; pub const CKM_SHA256: CK_MECHANISM_TYPE = 592; pub const CKM_SHA256_HMAC: CK_MECHANISM_TYPE = 593; pub const CKM_SHA256_HMAC_GENERAL: CK_MECHANISM_TYPE = 594; +pub const CKM_SHA224: CK_MECHANISM_TYPE = 597; +pub const CKM_SHA224_HMAC: CK_MECHANISM_TYPE = 598; +pub const CKM_SHA224_HMAC_GENERAL: CK_MECHANISM_TYPE = 599; pub const CKM_SHA384: CK_MECHANISM_TYPE = 608; pub const CKM_SHA384_HMAC: CK_MECHANISM_TYPE = 609; pub const CKM_SHA384_HMAC_GENERAL: CK_MECHANISM_TYPE = 610; @@ -305,6 +383,22 @@ pub const CKM_HOTP_KEY_GEN: CK_MECHANISM_TYPE = 656; pub const CKM_HOTP: CK_MECHANISM_TYPE = 657; pub const CKM_ACTI: CK_MECHANISM_TYPE = 672; pub const CKM_ACTI_KEY_GEN: CK_MECHANISM_TYPE = 673; +pub const CKM_SHA3_256: CK_MECHANISM_TYPE = 688; +pub const CKM_SHA3_256_HMAC: CK_MECHANISM_TYPE = 689; +pub const CKM_SHA3_256_HMAC_GENERAL: CK_MECHANISM_TYPE = 690; +pub const CKM_SHA3_256_KEY_GEN: CK_MECHANISM_TYPE = 691; +pub const CKM_SHA3_224: CK_MECHANISM_TYPE = 693; +pub const CKM_SHA3_224_HMAC: CK_MECHANISM_TYPE = 694; +pub const CKM_SHA3_224_HMAC_GENERAL: CK_MECHANISM_TYPE = 695; +pub const CKM_SHA3_224_KEY_GEN: CK_MECHANISM_TYPE = 696; +pub const CKM_SHA3_384: CK_MECHANISM_TYPE = 704; +pub const CKM_SHA3_384_HMAC: CK_MECHANISM_TYPE = 705; +pub const CKM_SHA3_384_HMAC_GENERAL: CK_MECHANISM_TYPE = 706; +pub const CKM_SHA3_384_KEY_GEN: CK_MECHANISM_TYPE = 707; +pub const CKM_SHA3_512: CK_MECHANISM_TYPE = 720; +pub const CKM_SHA3_512_HMAC: CK_MECHANISM_TYPE = 721; +pub const CKM_SHA3_512_HMAC_GENERAL: CK_MECHANISM_TYPE = 722; +pub const CKM_SHA3_512_KEY_GEN: CK_MECHANISM_TYPE = 723; pub const CKM_CAST_KEY_GEN: CK_MECHANISM_TYPE = 768; pub const CKM_CAST_ECB: CK_MECHANISM_TYPE = 769; pub const CKM_CAST_CBC: CK_MECHANISM_TYPE = 770; @@ -364,6 +458,13 @@ pub const CKM_SHA1_KEY_DERIVATION: CK_MECHANISM_TYPE = 914; pub const CKM_SHA256_KEY_DERIVATION: CK_MECHANISM_TYPE = 915; pub const CKM_SHA384_KEY_DERIVATION: CK_MECHANISM_TYPE = 916; pub const CKM_SHA512_KEY_DERIVATION: CK_MECHANISM_TYPE = 917; +pub const CKM_SHA224_KEY_DERIVATION: CK_MECHANISM_TYPE = 918; +pub const CKM_SHA3_256_KEY_DERIVE: CK_MECHANISM_TYPE = 919; +pub const CKM_SHA3_224_KEY_DERIVE: CK_MECHANISM_TYPE = 920; +pub const CKM_SHA3_384_KEY_DERIVE: CK_MECHANISM_TYPE = 921; +pub const CKM_SHA3_512_KEY_DERIVE: CK_MECHANISM_TYPE = 922; +pub const CKM_SHAKE_128_KEY_DERIVE: CK_MECHANISM_TYPE = 923; +pub const CKM_SHAKE_256_KEY_DERIVE: CK_MECHANISM_TYPE = 924; pub const CKM_PBE_MD2_DES_CBC: CK_MECHANISM_TYPE = 928; pub const CKM_PBE_MD5_DES_CBC: CK_MECHANISM_TYPE = 929; pub const CKM_PBE_MD5_CAST_CBC: CK_MECHANISM_TYPE = 930; @@ -403,6 +504,13 @@ pub const CKM_KIP_DERIVE: CK_MECHANISM_TYPE = 1296; pub const CKM_KIP_WRAP: CK_MECHANISM_TYPE = 1297; pub const CKM_KIP_MAC: CK_MECHANISM_TYPE = 1298; pub const CKM_CAMELLIA_KEY_GEN: CK_MECHANISM_TYPE = 1360; +pub const CKM_CAMELLIA_ECB: CK_MECHANISM_TYPE = 1361; +pub const CKM_CAMELLIA_CBC: CK_MECHANISM_TYPE = 1362; +pub const CKM_CAMELLIA_MAC: CK_MECHANISM_TYPE = 1363; +pub const CKM_CAMELLIA_MAC_GENERAL: CK_MECHANISM_TYPE = 1364; +pub const CKM_CAMELLIA_CBC_PAD: CK_MECHANISM_TYPE = 1365; +pub const CKM_CAMELLIA_ECB_ENCRYPT_DATA: CK_MECHANISM_TYPE = 1366; +pub const CKM_CAMELLIA_CBC_ENCRYPT_DATA: CK_MECHANISM_TYPE = 1367; pub const CKM_CAMELLIA_CTR: CK_MECHANISM_TYPE = 1368; pub const CKM_ARIA_KEY_GEN: CK_MECHANISM_TYPE = 1376; pub const CKM_ARIA_ECB: CK_MECHANISM_TYPE = 1377; @@ -433,6 +541,7 @@ pub const CKM_SKIPJACK_PRIVATE_WRAP: CK_MECHANISM_TYPE = 4105; pub const CKM_SKIPJACK_RELAYX: CK_MECHANISM_TYPE = 4106; pub const CKM_KEA_KEY_PAIR_GEN: CK_MECHANISM_TYPE = 4112; pub const CKM_KEA_KEY_DERIVE: CK_MECHANISM_TYPE = 4113; +pub const CKM_KEA_DERIVE: CK_MECHANISM_TYPE = 4114; pub const CKM_FORTEZZA_TIMESTAMP: CK_MECHANISM_TYPE = 4128; pub const CKM_BATON_KEY_GEN: CK_MECHANISM_TYPE = 4144; pub const CKM_BATON_ECB128: CK_MECHANISM_TYPE = 4145; @@ -461,6 +570,8 @@ pub const CKM_JUNIPER_COUNTER: CK_MECHANISM_TYPE = 4195; pub const CKM_JUNIPER_SHUFFLE: CK_MECHANISM_TYPE = 4196; pub const CKM_JUNIPER_WRAP: CK_MECHANISM_TYPE = 4197; pub const CKM_FASTHASH: CK_MECHANISM_TYPE = 4208; +pub const CKM_AES_XTS: CK_MECHANISM_TYPE = 4209; +pub const CKM_AES_XTS_KEY_GEN: CK_MECHANISM_TYPE = 4210; pub const CKM_AES_KEY_GEN: CK_MECHANISM_TYPE = 4224; pub const CKM_AES_ECB: CK_MECHANISM_TYPE = 4225; pub const CKM_AES_CBC: CK_MECHANISM_TYPE = 4226; @@ -500,6 +611,10 @@ pub const CKM_GOST28147_ECB: CK_MECHANISM_TYPE = 4641; pub const CKM_GOST28147: CK_MECHANISM_TYPE = 4642; pub const CKM_GOST28147_MAC: CK_MECHANISM_TYPE = 4643; pub const CKM_GOST28147_KEY_WRAP: CK_MECHANISM_TYPE = 4644; +pub const CKM_CHACHA20_KEY_GEN: CK_MECHANISM_TYPE = 4645; +pub const CKM_CHACHA20: CK_MECHANISM_TYPE = 4646; +pub const CKM_POLY1305_KEY_GEN: CK_MECHANISM_TYPE = 4647; +pub const CKM_POLY1305: CK_MECHANISM_TYPE = 4648; pub const CKM_DSA_PARAMETER_GEN: CK_MECHANISM_TYPE = 8192; pub const CKM_DH_PKCS_PARAMETER_GEN: CK_MECHANISM_TYPE = 8193; pub const CKM_X9_42_DH_PARAMETER_GEN: CK_MECHANISM_TYPE = 8194; @@ -510,63 +625,71 @@ pub const CKM_AES_CFB64: CK_MECHANISM_TYPE = 8453; pub const CKM_AES_CFB8: CK_MECHANISM_TYPE = 8454; pub const CKM_AES_CFB128: CK_MECHANISM_TYPE = 8455; pub const CKM_AES_CFB1: CK_MECHANISM_TYPE = 8456; -pub const CKM_SHA224: CK_MECHANISM_TYPE = 597; -pub const CKM_SHA224_HMAC: CK_MECHANISM_TYPE = 598; -pub const CKM_SHA224_HMAC_GENERAL: CK_MECHANISM_TYPE = 599; -pub const CKM_SHA224_RSA_PKCS: CK_MECHANISM_TYPE = 70; -pub const CKM_SHA224_RSA_PKCS_PSS: CK_MECHANISM_TYPE = 71; -pub const CKM_SHA224_KEY_DERIVATION: CK_MECHANISM_TYPE = 918; -pub const CKM_CAMELLIA_ECB: CK_MECHANISM_TYPE = 1361; -pub const CKM_CAMELLIA_CBC: CK_MECHANISM_TYPE = 1362; -pub const CKM_CAMELLIA_MAC: CK_MECHANISM_TYPE = 1363; -pub const CKM_CAMELLIA_MAC_GENERAL: CK_MECHANISM_TYPE = 1364; -pub const CKM_CAMELLIA_CBC_PAD: CK_MECHANISM_TYPE = 1365; -pub const CKM_CAMELLIA_ECB_ENCRYPT_DATA: CK_MECHANISM_TYPE = 1366; -pub const CKM_CAMELLIA_CBC_ENCRYPT_DATA: CK_MECHANISM_TYPE = 1367; pub const CKM_AES_KEY_WRAP: CK_MECHANISM_TYPE = 8457; pub const CKM_AES_KEY_WRAP_PAD: CK_MECHANISM_TYPE = 8458; +pub const CKM_AES_KEY_WRAP_KWP: CK_MECHANISM_TYPE = 8459; pub const CKM_RSA_PKCS_TPM_1_1: CK_MECHANISM_TYPE = 16385; pub const CKM_RSA_PKCS_OAEP_TPM_1_1: CK_MECHANISM_TYPE = 16386; +pub const CKM_SHA_1_KEY_GEN: CK_MECHANISM_TYPE = 16387; +pub const CKM_SHA224_KEY_GEN: CK_MECHANISM_TYPE = 16388; +pub const CKM_SHA256_KEY_GEN: CK_MECHANISM_TYPE = 16389; +pub const CKM_SHA384_KEY_GEN: CK_MECHANISM_TYPE = 16390; +pub const CKM_SHA512_KEY_GEN: CK_MECHANISM_TYPE = 16391; +pub const CKM_SHA512_224_KEY_GEN: CK_MECHANISM_TYPE = 16392; +pub const CKM_SHA512_256_KEY_GEN: CK_MECHANISM_TYPE = 16393; +pub const CKM_SHA512_T_KEY_GEN: CK_MECHANISM_TYPE = 16394; +pub const CKM_NULL: CK_MECHANISM_TYPE = 16395; +pub const CKM_BLAKE2B_160: CK_MECHANISM_TYPE = 16396; +pub const CKM_BLAKE2B_160_HMAC: CK_MECHANISM_TYPE = 16397; +pub const CKM_BLAKE2B_160_HMAC_GENERAL: CK_MECHANISM_TYPE = 16398; +pub const CKM_BLAKE2B_160_KEY_DERIVE: CK_MECHANISM_TYPE = 16399; +pub const CKM_BLAKE2B_160_KEY_GEN: CK_MECHANISM_TYPE = 16400; +pub const CKM_BLAKE2B_256: CK_MECHANISM_TYPE = 16401; +pub const CKM_BLAKE2B_256_HMAC: CK_MECHANISM_TYPE = 16402; +pub const CKM_BLAKE2B_256_HMAC_GENERAL: CK_MECHANISM_TYPE = 16403; +pub const CKM_BLAKE2B_256_KEY_DERIVE: CK_MECHANISM_TYPE = 16404; +pub const CKM_BLAKE2B_256_KEY_GEN: CK_MECHANISM_TYPE = 16405; +pub const CKM_BLAKE2B_384: CK_MECHANISM_TYPE = 16406; +pub const CKM_BLAKE2B_384_HMAC: CK_MECHANISM_TYPE = 16407; +pub const CKM_BLAKE2B_384_HMAC_GENERAL: CK_MECHANISM_TYPE = 16408; +pub const CKM_BLAKE2B_384_KEY_DERIVE: CK_MECHANISM_TYPE = 16409; +pub const CKM_BLAKE2B_384_KEY_GEN: CK_MECHANISM_TYPE = 16410; +pub const CKM_BLAKE2B_512: CK_MECHANISM_TYPE = 16411; +pub const CKM_BLAKE2B_512_HMAC: CK_MECHANISM_TYPE = 16412; +pub const CKM_BLAKE2B_512_HMAC_GENERAL: CK_MECHANISM_TYPE = 16413; +pub const CKM_BLAKE2B_512_KEY_DERIVE: CK_MECHANISM_TYPE = 16414; +pub const CKM_BLAKE2B_512_KEY_GEN: CK_MECHANISM_TYPE = 16415; +pub const CKM_SALSA20: CK_MECHANISM_TYPE = 16416; +pub const CKM_CHACHA20_POLY1305: CK_MECHANISM_TYPE = 16417; +pub const CKM_SALSA20_POLY1305: CK_MECHANISM_TYPE = 16418; +pub const CKM_X3DH_INITIALIZE: CK_MECHANISM_TYPE = 16419; +pub const CKM_X3DH_RESPOND: CK_MECHANISM_TYPE = 16420; +pub const CKM_X2RATCHET_INITIALIZE: CK_MECHANISM_TYPE = 16421; +pub const CKM_X2RATCHET_RESPOND: CK_MECHANISM_TYPE = 16422; +pub const CKM_X2RATCHET_ENCRYPT: CK_MECHANISM_TYPE = 16423; +pub const CKM_X2RATCHET_DECRYPT: CK_MECHANISM_TYPE = 16424; +pub const CKM_XEDDSA: CK_MECHANISM_TYPE = 16425; +pub const CKM_HKDF_DERIVE: CK_MECHANISM_TYPE = 16426; +pub const CKM_HKDF_DATA: CK_MECHANISM_TYPE = 16427; +pub const CKM_HKDF_KEY_GEN: CK_MECHANISM_TYPE = 16428; +pub const CKM_ECDSA_SHA3_224: CK_MECHANISM_TYPE = 4167; +pub const CKM_ECDSA_SHA3_256: CK_MECHANISM_TYPE = 4168; +pub const CKM_ECDSA_SHA3_384: CK_MECHANISM_TYPE = 4169; +pub const CKM_ECDSA_SHA3_512: CK_MECHANISM_TYPE = 4170; pub const CKM_EC_EDWARDS_KEY_PAIR_GEN: CK_MECHANISM_TYPE = 4181; pub const CKM_EC_MONTGOMERY_KEY_PAIR_GEN: CK_MECHANISM_TYPE = 4182; pub const CKM_EDDSA: CK_MECHANISM_TYPE = 4183; -pub const CK_OTP_FORMAT_DECIMAL: CK_ULONG = 0; -pub const CK_OTP_FORMAT_HEXADECIMAL: CK_ULONG = 1; -pub const CK_OTP_FORMAT_ALPHANUMERIC: CK_ULONG = 2; -pub const CK_OTP_FORMAT_BINARY: CK_ULONG = 3; -pub const CK_OTP_PARAM_IGNORED: CK_ULONG = 0; -pub const CK_OTP_PARAM_OPTIONAL: CK_ULONG = 1; -pub const CK_OTP_PARAM_MANDATORY: CK_ULONG = 2; -pub const CK_OTP_VALUE: CK_ULONG = 0; -pub const CK_OTP_PIN: CK_ULONG = 1; -pub const CK_OTP_CHALLENGE: CK_ULONG = 2; -pub const CK_OTP_TIME: CK_ULONG = 3; -pub const CK_OTP_COUNTER: CK_ULONG = 4; -pub const CK_OTP_FLAGS: CK_ULONG = 5; -pub const CK_OTP_OUTPUT_LENGTH: CK_ULONG = 6; -pub const CK_OTP_FORMAT: CK_ULONG = 7; -pub const CKF_NEXT_OTP: CK_FLAGS = 1; -pub const CKF_EXCLUDE_TIME: CK_FLAGS = 2; -pub const CKF_EXCLUDE_COUNTER: CK_FLAGS = 4; -pub const CKF_EXCLUDE_CHALLENGE: CK_FLAGS = 8; -pub const CKF_EXCLUDE_PIN: CK_FLAGS = 16; -pub const CKF_USER_FRIENDLY_OTP: CK_FLAGS = 32; -pub const CKN_OTP_CHANGED: CK_NOTIFICATION = 1; -pub const CKG_MGF1_SHA1: CK_RSA_PKCS_MGF_TYPE = 1; -pub const CKG_MGF1_SHA224: CK_RSA_PKCS_MGF_TYPE = 5; -pub const CKG_MGF1_SHA256: CK_RSA_PKCS_MGF_TYPE = 2; -pub const CKG_MGF1_SHA384: CK_RSA_PKCS_MGF_TYPE = 3; -pub const CKG_MGF1_SHA512: CK_RSA_PKCS_MGF_TYPE = 4; -pub const CKD_NULL: CK_EC_KDF_TYPE = 1; -pub const CKD_SHA1_KDF: CK_EC_KDF_TYPE = 2; -pub const CKD_SHA1_KDF_ASN1: CK_EC_KDF_TYPE = 3; -pub const CKD_SHA1_KDF_CONCATENATE: CK_EC_KDF_TYPE = 4; -pub const CKD_SHA224_KDF: CK_EC_KDF_TYPE = 5; -pub const CKD_SHA256_KDF: CK_EC_KDF_TYPE = 6; -pub const CKD_SHA384_KDF: CK_EC_KDF_TYPE = 7; -pub const CKD_SHA512_KDF: CK_EC_KDF_TYPE = 8; -pub const CKD_CPDIVERSIFY_KDF: CK_EC_KDF_TYPE = 9; +pub const CKM_SP800_108_COUNTER_KDF: CK_MECHANISM_TYPE = 940; +pub const CKM_SP800_108_FEEDBACK_KDF: CK_MECHANISM_TYPE = 941; +pub const CKM_SP800_108_DOUBLE_PIPELINE_KDF: CK_MECHANISM_TYPE = 942; +pub const CKM_VENDOR_DEFINED: CK_MECHANISM_TYPE = 2147483648; pub const CKF_HW: CK_FLAGS = 1; +pub const CKF_MESSAGE_ENCRYPT: CK_FLAGS = 2; +pub const CKF_MESSAGE_DECRYPT: CK_FLAGS = 4; +pub const CKF_MESSAGE_SIGN: CK_FLAGS = 8; +pub const CKF_MESSAGE_VERIFY: CK_FLAGS = 16; +pub const CKF_MULTI_MESSGE: CK_FLAGS = 32; +pub const CKF_FIND_OBJECTS: CK_FLAGS = 64; pub const CKF_ENCRYPT: CK_FLAGS = 256; pub const CKF_DECRYPT: CK_FLAGS = 512; pub const CKF_DIGEST: CK_FLAGS = 1024; @@ -582,12 +705,12 @@ pub const CKF_DERIVE: CK_FLAGS = 524288; pub const CKF_EC_F_P: CK_FLAGS = 1048576; pub const CKF_EC_F_2M: CK_FLAGS = 2097152; pub const CKF_EC_ECPARAMETERS: CK_FLAGS = 4194304; +pub const CKF_EC_OID: CK_FLAGS = 8388608; pub const CKF_EC_NAMEDCURVE: CK_FLAGS = 8388608; pub const CKF_EC_UNCOMPRESS: CK_FLAGS = 16777216; pub const CKF_EC_COMPRESS: CK_FLAGS = 33554432; -pub const CKF_DONT_BLOCK: CK_FLAGS = 1; -pub const CKF_LIBRARY_CANT_CREATE_OS_THREADS: CK_FLAGS = 1; -pub const CKF_OS_LOCKING_OK: CK_FLAGS = 2; +pub const CKF_EC_CURVENAME: CK_FLAGS = 67108864; +pub const CKF_EXTENSION: CK_FLAGS = 2147483648; pub const CKR_OK: CK_RV = 0; pub const CKR_CANCEL: CK_RV = 1; pub const CKR_HOST_MEMORY: CK_RV = 2; @@ -610,6 +733,7 @@ pub const CKR_DEVICE_MEMORY: CK_RV = 49; pub const CKR_DEVICE_REMOVED: CK_RV = 50; pub const CKR_ENCRYPTED_DATA_INVALID: CK_RV = 64; pub const CKR_ENCRYPTED_DATA_LEN_RANGE: CK_RV = 65; +pub const CKR_AEAD_DECRYPT_FAILED: CK_RV = 66; pub const CKR_FUNCTION_CANCELED: CK_RV = 80; pub const CKR_FUNCTION_NOT_PARALLEL: CK_RV = 81; pub const CKR_FUNCTION_NOT_SUPPORTED: CK_RV = 84; @@ -665,6 +789,7 @@ pub const CKR_WRAPPING_KEY_TYPE_INCONSISTENT: CK_RV = 277; pub const CKR_RANDOM_SEED_NOT_SUPPORTED: CK_RV = 288; pub const CKR_RANDOM_NO_RNG: CK_RV = 289; pub const CKR_DOMAIN_PARAMS_INVALID: CK_RV = 304; +pub const CKR_CURVE_NOT_SUPPORTED: CK_RV = 320; pub const CKR_BUFFER_TOO_SMALL: CK_RV = 336; pub const CKR_SAVED_STATE_INVALID: CK_RV = 352; pub const CKR_INFORMATION_SENSITIVE: CK_RV = 368; @@ -675,44 +800,126 @@ pub const CKR_MUTEX_BAD: CK_RV = 416; pub const CKR_MUTEX_NOT_LOCKED: CK_RV = 417; pub const CKR_NEW_PIN_MODE: CK_RV = 432; pub const CKR_NEXT_OTP: CK_RV = 433; -pub const CKR_EXCEEDED_MAX_ITERATIONS: CK_RV = 448; -pub const CKR_FIPS_SELF_TEST_FAILED: CK_RV = 449; -pub const CKR_LIBRARY_LOAD_FAILED: CK_RV = 450; -pub const CKR_PIN_TOO_WEAK: CK_RV = 451; -pub const CKR_PUBLIC_KEY_INVALID: CK_RV = 452; +pub const CKR_EXCEEDED_MAX_ITERATIONS: CK_RV = 437; +pub const CKR_FIPS_SELF_TEST_FAILED: CK_RV = 438; +pub const CKR_LIBRARY_LOAD_FAILED: CK_RV = 439; +pub const CKR_PIN_TOO_WEAK: CK_RV = 440; +pub const CKR_PUBLIC_KEY_INVALID: CK_RV = 441; pub const CKR_FUNCTION_REJECTED: CK_RV = 512; +pub const CKR_TOKEN_RESOURCE_EXCEEDED: CK_RV = 513; +pub const CKR_VENDOR_DEFINED: CK_RV = 2147483648; +pub const CKF_END_OF_MESSAGE: CK_FLAGS = 1; +pub const CKF_INTERFACE_FORK_SAFE: CK_FLAGS = 1; +pub const CKF_LIBRARY_CANT_CREATE_OS_THREADS: CK_FLAGS = 1; +pub const CKF_OS_LOCKING_OK: CK_FLAGS = 2; +pub const CKF_DONT_BLOCK: CK_FLAGS = 1; +pub const CKG_MGF1_SHA1: CK_RSA_PKCS_MGF_TYPE = 1; +pub const CKG_MGF1_SHA256: CK_RSA_PKCS_MGF_TYPE = 2; +pub const CKG_MGF1_SHA384: CK_RSA_PKCS_MGF_TYPE = 3; +pub const CKG_MGF1_SHA512: CK_RSA_PKCS_MGF_TYPE = 4; +pub const CKG_MGF1_SHA224: CK_RSA_PKCS_MGF_TYPE = 5; pub const CKZ_DATA_SPECIFIED: CK_RSA_PKCS_OAEP_SOURCE_TYPE = 1; -pub const CK_FALSE: CK_BBOOL = 0; -pub const CK_TRUE: CK_BBOOL = 1; -pub const FALSE: u32 = 0; -pub const TRUE: u32 = 1; -pub type CK_FLAGS = ::std::os::raw::c_ulong; +pub const CKD_NULL: CK_EC_KDF_TYPE = 1; +pub const CKD_SHA1_KDF: CK_EC_KDF_TYPE = 2; +pub const CKD_SHA1_KDF_ASN1: CK_EC_KDF_TYPE = 3; +pub const CKD_SHA1_KDF_CONCATENATE: CK_EC_KDF_TYPE = 4; +pub const CKD_SHA224_KDF: CK_EC_KDF_TYPE = 5; +pub const CKD_SHA256_KDF: CK_EC_KDF_TYPE = 6; +pub const CKD_SHA384_KDF: CK_EC_KDF_TYPE = 7; +pub const CKD_SHA512_KDF: CK_EC_KDF_TYPE = 8; +pub const CKD_CPDIVERSIFY_KDF: CK_EC_KDF_TYPE = 9; +pub const CKD_SHA3_224_KDF: CK_EC_KDF_TYPE = 10; +pub const CKD_SHA3_256_KDF: CK_EC_KDF_TYPE = 11; +pub const CKD_SHA3_384_KDF: CK_EC_KDF_TYPE = 12; +pub const CKD_SHA3_512_KDF: CK_EC_KDF_TYPE = 13; +pub const CKD_SHA1_KDF_SP800: CK_EC_KDF_TYPE = 14; +pub const CKD_SHA224_KDF_SP800: CK_EC_KDF_TYPE = 15; +pub const CKD_SHA256_KDF_SP800: CK_EC_KDF_TYPE = 16; +pub const CKD_SHA384_KDF_SP800: CK_EC_KDF_TYPE = 17; +pub const CKD_SHA512_KDF_SP800: CK_EC_KDF_TYPE = 18; +pub const CKD_SHA3_224_KDF_SP800: CK_EC_KDF_TYPE = 19; +pub const CKD_SHA3_256_KDF_SP800: CK_EC_KDF_TYPE = 20; +pub const CKD_SHA3_384_KDF_SP800: CK_EC_KDF_TYPE = 21; +pub const CKD_SHA3_512_KDF_SP800: CK_EC_KDF_TYPE = 22; +pub const CKD_BLAKE2B_160_KDF: CK_EC_KDF_TYPE = 23; +pub const CKD_BLAKE2B_256_KDF: CK_EC_KDF_TYPE = 24; +pub const CKD_BLAKE2B_384_KDF: CK_EC_KDF_TYPE = 25; +pub const CKD_BLAKE2B_512_KDF: CK_EC_KDF_TYPE = 26; +pub const CKP_PKCS5_PBKD2_HMAC_SHA1: CK_PROFILE_ID = 1; +pub const CKP_PKCS5_PBKD2_HMAC_GOSTR3411: CK_PROFILE_ID = 2; +pub const CKP_PKCS5_PBKD2_HMAC_SHA224: CK_PROFILE_ID = 3; +pub const CKP_PKCS5_PBKD2_HMAC_SHA256: CK_PROFILE_ID = 4; +pub const CKP_PKCS5_PBKD2_HMAC_SHA384: CK_PROFILE_ID = 5; +pub const CKP_PKCS5_PBKD2_HMAC_SHA512: CK_PROFILE_ID = 6; +pub const CKP_PKCS5_PBKD2_HMAC_SHA512_224: CK_PROFILE_ID = 7; +pub const CKP_PKCS5_PBKD2_HMAC_SHA512_256: CK_PROFILE_ID = 8; +pub const CKZ_SALT_SPECIFIED: CK_RSA_PKCS_OAEP_SOURCE_TYPE = 1; +pub const CK_OTP_VALUE: CK_ULONG = 0; +pub const CK_OTP_PIN: CK_ULONG = 1; +pub const CK_OTP_CHALLENGE: CK_ULONG = 2; +pub const CK_OTP_TIME: CK_ULONG = 3; +pub const CK_OTP_COUNTER: CK_ULONG = 4; +pub const CK_OTP_FLAGS: CK_ULONG = 5; +pub const CK_OTP_OUTPUT_LENGTH: CK_ULONG = 6; +pub const CK_OTP_OUTPUT_FORMAT: CK_ULONG = 7; +pub const CKF_NEXT_OTP: CK_FLAGS = 1; +pub const CKF_EXCLUDE_TIME: CK_FLAGS = 2; +pub const CKF_EXCLUDE_COUNTER: CK_FLAGS = 4; +pub const CKF_EXCLUDE_CHALLENGE: CK_FLAGS = 8; +pub const CKF_EXCLUDE_PIN: CK_FLAGS = 16; +pub const CKF_USER_FRIENDLY_OTP: CK_FLAGS = 32; +pub const CKG_NO_GENERATE: u32 = 0; +pub const CKG_GENERATE: u32 = 1; +pub const CKG_GENERATE_COUNTER: u32 = 2; +pub const CKG_GENERATE_RANDOM: u32 = 3; +pub const CK_SP800_108_ITERATION_VARIABLE: CK_ULONG = 1; +pub const CK_SP800_108_OPTIONAL_COUNTER: CK_ULONG = 2; +pub const CK_SP800_108_DKM_LENGTH: CK_ULONG = 3; +pub const CK_SP800_108_BYTE_ARRAY: CK_ULONG = 4; +pub const CKF_HKDF_SALT_NULL: CK_FLAGS = 1; +pub const CKF_HKDF_SALT_DATA: CK_FLAGS = 2; +pub const CKF_HKDF_SALT_KEY: CK_FLAGS = 4; +pub const CK_NEED_ARG_LIST: CK_ULONG = 1; +pub const CK_PKCS11_2_0_ONLY: CK_ULONG = 1; +pub type CK_BYTE = ::std::os::raw::c_uchar; +pub type CK_CHAR = CK_BYTE; +pub type CK_UTF8CHAR = CK_BYTE; +pub type CK_BBOOL = CK_BYTE; +pub type CK_ULONG = ::std::os::raw::c_ulong; +pub type CK_LONG = ::std::os::raw::c_long; +pub type CK_FLAGS = CK_ULONG; +pub type CK_BYTE_PTR = *mut CK_BYTE; +pub type CK_CHAR_PTR = *mut CK_CHAR; +pub type CK_UTF8CHAR_PTR = *mut CK_UTF8CHAR; +pub type CK_ULONG_PTR = *mut CK_ULONG; +pub type CK_VOID_PTR = *mut ::std::os::raw::c_void; +pub type CK_VOID_PTR_PTR = *mut CK_VOID_PTR; #[repr(C)] #[derive(Debug, Default, Copy, Clone)] -pub struct _CK_VERSION { - pub major: ::std::os::raw::c_uchar, - pub minor: ::std::os::raw::c_uchar, +pub struct CK_VERSION { + pub major: CK_BYTE, + pub minor: CK_BYTE, } #[test] -fn bindgen_test_layout__CK_VERSION() { - const UNINIT: ::std::mem::MaybeUninit<_CK_VERSION> = ::std::mem::MaybeUninit::uninit(); +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::<_CK_VERSION>(), + ::std::mem::size_of::(), 2usize, - concat!("Size of: ", stringify!(_CK_VERSION)) + concat!("Size of: ", stringify!(CK_VERSION)) ); assert_eq!( - ::std::mem::align_of::<_CK_VERSION>(), + ::std::mem::align_of::(), 1usize, - concat!("Alignment of ", stringify!(_CK_VERSION)) + 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!(CK_VERSION), "::", stringify!(major) ) @@ -722,41 +929,42 @@ fn bindgen_test_layout__CK_VERSION() { 1usize, concat!( "Offset of field: ", - stringify!(_CK_VERSION), + stringify!(CK_VERSION), "::", stringify!(minor) ) ); } +pub type CK_VERSION_PTR = *mut CK_VERSION; #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone)] -pub struct _CK_INFO { - pub cryptokiVersion: _CK_VERSION, - pub manufacturerID: [::std::os::raw::c_uchar; 32usize], +pub struct CK_INFO { + pub cryptokiVersion: CK_VERSION, + pub manufacturerID: [CK_UTF8CHAR; 32usize], pub flags: CK_FLAGS, - pub libraryDescription: [::std::os::raw::c_uchar; 32usize], - pub libraryVersion: _CK_VERSION, + pub libraryDescription: [CK_UTF8CHAR; 32usize], + pub libraryVersion: CK_VERSION, } #[test] -fn bindgen_test_layout__CK_INFO() { - const UNINIT: ::std::mem::MaybeUninit<_CK_INFO> = ::std::mem::MaybeUninit::uninit(); +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::<_CK_INFO>(), + ::std::mem::size_of::(), 72usize, - concat!("Size of: ", stringify!(_CK_INFO)) + concat!("Size of: ", stringify!(CK_INFO)) ); assert_eq!( - ::std::mem::align_of::<_CK_INFO>(), + ::std::mem::align_of::(), 1usize, - concat!("Alignment of ", stringify!(_CK_INFO)) + 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!(CK_INFO), "::", stringify!(cryptokiVersion) ) @@ -766,7 +974,7 @@ fn bindgen_test_layout__CK_INFO() { 2usize, concat!( "Offset of field: ", - stringify!(_CK_INFO), + stringify!(CK_INFO), "::", stringify!(manufacturerID) ) @@ -776,7 +984,7 @@ fn bindgen_test_layout__CK_INFO() { 34usize, concat!( "Offset of field: ", - stringify!(_CK_INFO), + stringify!(CK_INFO), "::", stringify!(flags) ) @@ -786,7 +994,7 @@ fn bindgen_test_layout__CK_INFO() { 38usize, concat!( "Offset of field: ", - stringify!(_CK_INFO), + stringify!(CK_INFO), "::", stringify!(libraryDescription) ) @@ -796,44 +1004,45 @@ fn bindgen_test_layout__CK_INFO() { 70usize, concat!( "Offset of field: ", - stringify!(_CK_INFO), + stringify!(CK_INFO), "::", stringify!(libraryVersion) ) ); } -pub type CK_NOTIFICATION = ::std::os::raw::c_ulong; -pub const CKN_SURRENDER: ::std::os::raw::c_ulong = 0; -pub type CK_SLOT_ID = ::std::os::raw::c_ulong; +pub type CK_INFO_PTR = *mut CK_INFO; +pub type CK_NOTIFICATION = CK_ULONG; +pub type CK_SLOT_ID = CK_ULONG; +pub type CK_SLOT_ID_PTR = *mut CK_SLOT_ID; #[repr(C, packed)] #[derive(Debug, Copy, Clone)] -pub struct _CK_SLOT_INFO { - pub slotDescription: [::std::os::raw::c_uchar; 64usize], - pub manufacturerID: [::std::os::raw::c_uchar; 32usize], +pub struct CK_SLOT_INFO { + pub slotDescription: [CK_UTF8CHAR; 64usize], + pub manufacturerID: [CK_UTF8CHAR; 32usize], pub flags: CK_FLAGS, - pub hardwareVersion: _CK_VERSION, - pub firmwareVersion: _CK_VERSION, + pub hardwareVersion: CK_VERSION, + pub firmwareVersion: CK_VERSION, } #[test] -fn bindgen_test_layout__CK_SLOT_INFO() { - const UNINIT: ::std::mem::MaybeUninit<_CK_SLOT_INFO> = ::std::mem::MaybeUninit::uninit(); +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::<_CK_SLOT_INFO>(), + ::std::mem::size_of::(), 104usize, - concat!("Size of: ", stringify!(_CK_SLOT_INFO)) + concat!("Size of: ", stringify!(CK_SLOT_INFO)) ); assert_eq!( - ::std::mem::align_of::<_CK_SLOT_INFO>(), + ::std::mem::align_of::(), 1usize, - concat!("Alignment of ", stringify!(_CK_SLOT_INFO)) + 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!(CK_SLOT_INFO), "::", stringify!(slotDescription) ) @@ -843,7 +1052,7 @@ fn bindgen_test_layout__CK_SLOT_INFO() { 64usize, concat!( "Offset of field: ", - stringify!(_CK_SLOT_INFO), + stringify!(CK_SLOT_INFO), "::", stringify!(manufacturerID) ) @@ -853,7 +1062,7 @@ fn bindgen_test_layout__CK_SLOT_INFO() { 96usize, concat!( "Offset of field: ", - stringify!(_CK_SLOT_INFO), + stringify!(CK_SLOT_INFO), "::", stringify!(flags) ) @@ -863,7 +1072,7 @@ fn bindgen_test_layout__CK_SLOT_INFO() { 100usize, concat!( "Offset of field: ", - stringify!(_CK_SLOT_INFO), + stringify!(CK_SLOT_INFO), "::", stringify!(hardwareVersion) ) @@ -873,13 +1082,13 @@ fn bindgen_test_layout__CK_SLOT_INFO() { 102usize, concat!( "Offset of field: ", - stringify!(_CK_SLOT_INFO), + stringify!(CK_SLOT_INFO), "::", stringify!(firmwareVersion) ) ); } -impl Default for _CK_SLOT_INFO { +impl Default for CK_SLOT_INFO { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { @@ -888,52 +1097,49 @@ impl Default for _CK_SLOT_INFO { } } } -pub const CKF_TOKEN_PRESENT: ::std::os::raw::c_ulong = 1; -pub const CKF_REMOVABLE_DEVICE: ::std::os::raw::c_ulong = 2; -pub const CKF_HW_SLOT: ::std::os::raw::c_ulong = 4; -pub const CKF_ARRAY_ATTRIBUTE: ::std::os::raw::c_ulong = 1073741824; +pub type CK_SLOT_INFO_PTR = *mut CK_SLOT_INFO; #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone)] -pub struct _CK_TOKEN_INFO { - pub label: [::std::os::raw::c_uchar; 32usize], - pub manufacturerID: [::std::os::raw::c_uchar; 32usize], - pub model: [::std::os::raw::c_uchar; 16usize], - pub serialNumber: [::std::os::raw::c_uchar; 16usize], +pub struct CK_TOKEN_INFO { + pub label: [CK_UTF8CHAR; 32usize], + pub manufacturerID: [CK_UTF8CHAR; 32usize], + pub model: [CK_UTF8CHAR; 16usize], + pub serialNumber: [CK_CHAR; 16usize], pub flags: CK_FLAGS, - pub ulMaxSessionCount: ::std::os::raw::c_ulong, - pub ulSessionCount: ::std::os::raw::c_ulong, - pub ulMaxRwSessionCount: ::std::os::raw::c_ulong, - pub ulRwSessionCount: ::std::os::raw::c_ulong, - pub ulMaxPinLen: ::std::os::raw::c_ulong, - pub ulMinPinLen: ::std::os::raw::c_ulong, - pub ulTotalPublicMemory: ::std::os::raw::c_ulong, - pub ulFreePublicMemory: ::std::os::raw::c_ulong, - pub ulTotalPrivateMemory: ::std::os::raw::c_ulong, - pub ulFreePrivateMemory: ::std::os::raw::c_ulong, - pub hardwareVersion: _CK_VERSION, - pub firmwareVersion: _CK_VERSION, - pub utcTime: [::std::os::raw::c_uchar; 16usize], + pub ulMaxSessionCount: CK_ULONG, + pub ulSessionCount: CK_ULONG, + pub ulMaxRwSessionCount: CK_ULONG, + pub ulRwSessionCount: CK_ULONG, + pub ulMaxPinLen: CK_ULONG, + pub ulMinPinLen: CK_ULONG, + pub ulTotalPublicMemory: CK_ULONG, + pub ulFreePublicMemory: CK_ULONG, + pub ulTotalPrivateMemory: CK_ULONG, + pub ulFreePrivateMemory: CK_ULONG, + pub hardwareVersion: CK_VERSION, + pub firmwareVersion: CK_VERSION, + pub utcTime: [CK_CHAR; 16usize], } #[test] -fn bindgen_test_layout__CK_TOKEN_INFO() { - const UNINIT: ::std::mem::MaybeUninit<_CK_TOKEN_INFO> = ::std::mem::MaybeUninit::uninit(); +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::<_CK_TOKEN_INFO>(), + ::std::mem::size_of::(), 160usize, - concat!("Size of: ", stringify!(_CK_TOKEN_INFO)) + concat!("Size of: ", stringify!(CK_TOKEN_INFO)) ); assert_eq!( - ::std::mem::align_of::<_CK_TOKEN_INFO>(), + ::std::mem::align_of::(), 1usize, - concat!("Alignment of ", stringify!(_CK_TOKEN_INFO)) + 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!(CK_TOKEN_INFO), "::", stringify!(label) ) @@ -943,7 +1149,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { 32usize, concat!( "Offset of field: ", - stringify!(_CK_TOKEN_INFO), + stringify!(CK_TOKEN_INFO), "::", stringify!(manufacturerID) ) @@ -953,7 +1159,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { 64usize, concat!( "Offset of field: ", - stringify!(_CK_TOKEN_INFO), + stringify!(CK_TOKEN_INFO), "::", stringify!(model) ) @@ -963,7 +1169,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { 80usize, concat!( "Offset of field: ", - stringify!(_CK_TOKEN_INFO), + stringify!(CK_TOKEN_INFO), "::", stringify!(serialNumber) ) @@ -973,7 +1179,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { 96usize, concat!( "Offset of field: ", - stringify!(_CK_TOKEN_INFO), + stringify!(CK_TOKEN_INFO), "::", stringify!(flags) ) @@ -983,7 +1189,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { 100usize, concat!( "Offset of field: ", - stringify!(_CK_TOKEN_INFO), + stringify!(CK_TOKEN_INFO), "::", stringify!(ulMaxSessionCount) ) @@ -993,7 +1199,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { 104usize, concat!( "Offset of field: ", - stringify!(_CK_TOKEN_INFO), + stringify!(CK_TOKEN_INFO), "::", stringify!(ulSessionCount) ) @@ -1003,7 +1209,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { 108usize, concat!( "Offset of field: ", - stringify!(_CK_TOKEN_INFO), + stringify!(CK_TOKEN_INFO), "::", stringify!(ulMaxRwSessionCount) ) @@ -1013,7 +1219,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { 112usize, concat!( "Offset of field: ", - stringify!(_CK_TOKEN_INFO), + stringify!(CK_TOKEN_INFO), "::", stringify!(ulRwSessionCount) ) @@ -1023,7 +1229,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { 116usize, concat!( "Offset of field: ", - stringify!(_CK_TOKEN_INFO), + stringify!(CK_TOKEN_INFO), "::", stringify!(ulMaxPinLen) ) @@ -1033,7 +1239,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { 120usize, concat!( "Offset of field: ", - stringify!(_CK_TOKEN_INFO), + stringify!(CK_TOKEN_INFO), "::", stringify!(ulMinPinLen) ) @@ -1043,7 +1249,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { 124usize, concat!( "Offset of field: ", - stringify!(_CK_TOKEN_INFO), + stringify!(CK_TOKEN_INFO), "::", stringify!(ulTotalPublicMemory) ) @@ -1053,7 +1259,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { 128usize, concat!( "Offset of field: ", - stringify!(_CK_TOKEN_INFO), + stringify!(CK_TOKEN_INFO), "::", stringify!(ulFreePublicMemory) ) @@ -1063,7 +1269,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { 132usize, concat!( "Offset of field: ", - stringify!(_CK_TOKEN_INFO), + stringify!(CK_TOKEN_INFO), "::", stringify!(ulTotalPrivateMemory) ) @@ -1073,7 +1279,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { 136usize, concat!( "Offset of field: ", - stringify!(_CK_TOKEN_INFO), + stringify!(CK_TOKEN_INFO), "::", stringify!(ulFreePrivateMemory) ) @@ -1083,7 +1289,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { 140usize, concat!( "Offset of field: ", - stringify!(_CK_TOKEN_INFO), + stringify!(CK_TOKEN_INFO), "::", stringify!(hardwareVersion) ) @@ -1093,7 +1299,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { 142usize, concat!( "Offset of field: ", - stringify!(_CK_TOKEN_INFO), + stringify!(CK_TOKEN_INFO), "::", stringify!(firmwareVersion) ) @@ -1103,43 +1309,45 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { 144usize, concat!( "Offset of field: ", - stringify!(_CK_TOKEN_INFO), + stringify!(CK_TOKEN_INFO), "::", stringify!(utcTime) ) ); } -pub type CK_SESSION_HANDLE = ::std::os::raw::c_ulong; -pub type CK_USER_TYPE = ::std::os::raw::c_ulong; -pub type CK_STATE = ::std::os::raw::c_ulong; +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; +pub type CK_USER_TYPE = CK_ULONG; +pub type CK_STATE = CK_ULONG; #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone)] -pub struct _CK_SESSION_INFO { +pub struct CK_SESSION_INFO { pub slotID: CK_SLOT_ID, pub state: CK_STATE, pub flags: CK_FLAGS, - pub ulDeviceError: ::std::os::raw::c_ulong, + pub ulDeviceError: CK_ULONG, } #[test] -fn bindgen_test_layout__CK_SESSION_INFO() { - const UNINIT: ::std::mem::MaybeUninit<_CK_SESSION_INFO> = ::std::mem::MaybeUninit::uninit(); +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::<_CK_SESSION_INFO>(), + ::std::mem::size_of::(), 16usize, - concat!("Size of: ", stringify!(_CK_SESSION_INFO)) + concat!("Size of: ", stringify!(CK_SESSION_INFO)) ); assert_eq!( - ::std::mem::align_of::<_CK_SESSION_INFO>(), + ::std::mem::align_of::(), 1usize, - concat!("Alignment of ", stringify!(_CK_SESSION_INFO)) + 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!(CK_SESSION_INFO), "::", stringify!(slotID) ) @@ -1149,7 +1357,7 @@ fn bindgen_test_layout__CK_SESSION_INFO() { 4usize, concat!( "Offset of field: ", - stringify!(_CK_SESSION_INFO), + stringify!(CK_SESSION_INFO), "::", stringify!(state) ) @@ -1159,7 +1367,7 @@ fn bindgen_test_layout__CK_SESSION_INFO() { 8usize, concat!( "Offset of field: ", - stringify!(_CK_SESSION_INFO), + stringify!(CK_SESSION_INFO), "::", stringify!(flags) ) @@ -1169,45 +1377,48 @@ fn bindgen_test_layout__CK_SESSION_INFO() { 12usize, concat!( "Offset of field: ", - stringify!(_CK_SESSION_INFO), + stringify!(CK_SESSION_INFO), "::", stringify!(ulDeviceError) ) ); } -pub type CK_OBJECT_HANDLE = ::std::os::raw::c_ulong; -pub type CK_OBJECT_CLASS = ::std::os::raw::c_ulong; -pub type CK_HW_FEATURE_TYPE = ::std::os::raw::c_ulong; -pub type CK_KEY_TYPE = ::std::os::raw::c_ulong; -pub type CK_CERTIFICATE_TYPE = ::std::os::raw::c_ulong; -pub type CK_ATTRIBUTE_TYPE = ::std::os::raw::c_ulong; +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; +pub type CK_OBJECT_CLASS = CK_ULONG; +pub type CK_OBJECT_CLASS_PTR = *mut CK_OBJECT_CLASS; +pub type CK_HW_FEATURE_TYPE = CK_ULONG; +pub type CK_KEY_TYPE = CK_ULONG; +pub type CK_CERTIFICATE_TYPE = CK_ULONG; +pub type CK_ATTRIBUTE_TYPE = CK_ULONG; #[repr(C, packed)] #[derive(Debug, Copy, Clone)] -pub struct _CK_ATTRIBUTE { +pub struct CK_ATTRIBUTE { pub type_: CK_ATTRIBUTE_TYPE, - pub pValue: *mut ::std::os::raw::c_void, - pub ulValueLen: ::std::os::raw::c_ulong, + pub pValue: CK_VOID_PTR, + pub ulValueLen: CK_ULONG, } #[test] -fn bindgen_test_layout__CK_ATTRIBUTE() { - const UNINIT: ::std::mem::MaybeUninit<_CK_ATTRIBUTE> = ::std::mem::MaybeUninit::uninit(); +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::<_CK_ATTRIBUTE>(), + ::std::mem::size_of::(), 16usize, - concat!("Size of: ", stringify!(_CK_ATTRIBUTE)) + concat!("Size of: ", stringify!(CK_ATTRIBUTE)) ); assert_eq!( - ::std::mem::align_of::<_CK_ATTRIBUTE>(), + ::std::mem::align_of::(), 1usize, - concat!("Alignment of ", stringify!(_CK_ATTRIBUTE)) + 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!(CK_ATTRIBUTE), "::", stringify!(type_) ) @@ -1217,7 +1428,7 @@ fn bindgen_test_layout__CK_ATTRIBUTE() { 4usize, concat!( "Offset of field: ", - stringify!(_CK_ATTRIBUTE), + stringify!(CK_ATTRIBUTE), "::", stringify!(pValue) ) @@ -1227,13 +1438,13 @@ fn bindgen_test_layout__CK_ATTRIBUTE() { 12usize, concat!( "Offset of field: ", - stringify!(_CK_ATTRIBUTE), + stringify!(CK_ATTRIBUTE), "::", stringify!(ulValueLen) ) ); } -impl Default for _CK_ATTRIBUTE { +impl Default for CK_ATTRIBUTE { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { @@ -1242,33 +1453,34 @@ impl Default for _CK_ATTRIBUTE { } } } +pub type CK_ATTRIBUTE_PTR = *mut CK_ATTRIBUTE; #[repr(C)] #[derive(Debug, Default, Copy, Clone)] -pub struct _CK_DATE { - pub year: [::std::os::raw::c_uchar; 4usize], - pub month: [::std::os::raw::c_uchar; 2usize], - pub day: [::std::os::raw::c_uchar; 2usize], +pub struct CK_DATE { + pub year: [CK_CHAR; 4usize], + pub month: [CK_CHAR; 2usize], + pub day: [CK_CHAR; 2usize], } #[test] -fn bindgen_test_layout__CK_DATE() { - const UNINIT: ::std::mem::MaybeUninit<_CK_DATE> = ::std::mem::MaybeUninit::uninit(); +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::<_CK_DATE>(), + ::std::mem::size_of::(), 8usize, - concat!("Size of: ", stringify!(_CK_DATE)) + concat!("Size of: ", stringify!(CK_DATE)) ); assert_eq!( - ::std::mem::align_of::<_CK_DATE>(), + ::std::mem::align_of::(), 1usize, - concat!("Alignment of ", stringify!(_CK_DATE)) + 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!(CK_DATE), "::", stringify!(year) ) @@ -1278,7 +1490,7 @@ fn bindgen_test_layout__CK_DATE() { 4usize, concat!( "Offset of field: ", - stringify!(_CK_DATE), + stringify!(CK_DATE), "::", stringify!(month) ) @@ -1288,40 +1500,41 @@ fn bindgen_test_layout__CK_DATE() { 6usize, concat!( "Offset of field: ", - stringify!(_CK_DATE), + stringify!(CK_DATE), "::", stringify!(day) ) ); } -pub type CK_MECHANISM_TYPE = ::std::os::raw::c_ulong; +pub type CK_MECHANISM_TYPE = CK_ULONG; +pub type CK_MECHANISM_TYPE_PTR = *mut CK_MECHANISM_TYPE; #[repr(C, packed)] #[derive(Debug, Copy, Clone)] -pub struct _CK_MECHANISM { +pub struct CK_MECHANISM { pub mechanism: CK_MECHANISM_TYPE, - pub pParameter: *mut ::std::os::raw::c_void, - pub ulParameterLen: ::std::os::raw::c_ulong, + pub pParameter: CK_VOID_PTR, + pub ulParameterLen: CK_ULONG, } #[test] -fn bindgen_test_layout__CK_MECHANISM() { - const UNINIT: ::std::mem::MaybeUninit<_CK_MECHANISM> = ::std::mem::MaybeUninit::uninit(); +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::<_CK_MECHANISM>(), + ::std::mem::size_of::(), 16usize, - concat!("Size of: ", stringify!(_CK_MECHANISM)) + concat!("Size of: ", stringify!(CK_MECHANISM)) ); assert_eq!( - ::std::mem::align_of::<_CK_MECHANISM>(), + ::std::mem::align_of::(), 1usize, - concat!("Alignment of ", stringify!(_CK_MECHANISM)) + 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!(CK_MECHANISM), "::", stringify!(mechanism) ) @@ -1331,7 +1544,7 @@ fn bindgen_test_layout__CK_MECHANISM() { 4usize, concat!( "Offset of field: ", - stringify!(_CK_MECHANISM), + stringify!(CK_MECHANISM), "::", stringify!(pParameter) ) @@ -1341,13 +1554,13 @@ fn bindgen_test_layout__CK_MECHANISM() { 12usize, concat!( "Offset of field: ", - stringify!(_CK_MECHANISM), + stringify!(CK_MECHANISM), "::", stringify!(ulParameterLen) ) ); } -impl Default for _CK_MECHANISM { +impl Default for CK_MECHANISM { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { @@ -1356,33 +1569,34 @@ impl Default for _CK_MECHANISM { } } } +pub type CK_MECHANISM_PTR = *mut CK_MECHANISM; #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone)] -pub struct _CK_MECHANISM_INFO { - pub ulMinKeySize: ::std::os::raw::c_ulong, - pub ulMaxKeySize: ::std::os::raw::c_ulong, +pub struct CK_MECHANISM_INFO { + pub ulMinKeySize: CK_ULONG, + pub ulMaxKeySize: CK_ULONG, pub flags: CK_FLAGS, } #[test] -fn bindgen_test_layout__CK_MECHANISM_INFO() { - const UNINIT: ::std::mem::MaybeUninit<_CK_MECHANISM_INFO> = ::std::mem::MaybeUninit::uninit(); +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::<_CK_MECHANISM_INFO>(), + ::std::mem::size_of::(), 12usize, - concat!("Size of: ", stringify!(_CK_MECHANISM_INFO)) + concat!("Size of: ", stringify!(CK_MECHANISM_INFO)) ); assert_eq!( - ::std::mem::align_of::<_CK_MECHANISM_INFO>(), + ::std::mem::align_of::(), 1usize, - concat!("Alignment of ", stringify!(_CK_MECHANISM_INFO)) + 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!(CK_MECHANISM_INFO), "::", stringify!(ulMinKeySize) ) @@ -1392,7 +1606,7 @@ fn bindgen_test_layout__CK_MECHANISM_INFO() { 4usize, concat!( "Offset of field: ", - stringify!(_CK_MECHANISM_INFO), + stringify!(CK_MECHANISM_INFO), "::", stringify!(ulMaxKeySize) ) @@ -1402,66 +1616,78 @@ fn bindgen_test_layout__CK_MECHANISM_INFO() { 8usize, concat!( "Offset of field: ", - stringify!(_CK_MECHANISM_INFO), + stringify!(CK_MECHANISM_INFO), "::", stringify!(flags) ) ); } -pub type CK_PARAM_TYPE = ::std::os::raw::c_ulong; +pub type CK_MECHANISM_INFO_PTR = *mut CK_MECHANISM_INFO; +pub type CK_RV = CK_ULONG; +pub type CK_NOTIFY = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + event: CK_NOTIFICATION, + pApplication: CK_VOID_PTR, + ) -> CK_RV, +>; +pub type CK_FUNCTION_LIST_PTR = *mut CK_FUNCTION_LIST; +pub type CK_FUNCTION_LIST_3_0_PTR = *mut CK_FUNCTION_LIST_3_0; +pub type CK_FUNCTION_LIST_PTR_PTR = *mut CK_FUNCTION_LIST_PTR; +pub type CK_FUNCTION_LIST_3_0_PTR_PTR = *mut CK_FUNCTION_LIST_3_0_PTR; #[repr(C, packed)] #[derive(Debug, Copy, Clone)] -pub struct CK_OTP_PARAM { - pub type_: CK_PARAM_TYPE, - pub pValue: *mut ::std::os::raw::c_void, - pub ulValueLen: ::std::os::raw::c_ulong, +pub struct CK_INTERFACE { + pub pInterfaceName: *mut CK_CHAR, + pub pFunctionList: CK_VOID_PTR, + pub flags: CK_FLAGS, } #[test] -fn bindgen_test_layout_CK_OTP_PARAM() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); +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::(), - 16usize, - concat!("Size of: ", stringify!(CK_OTP_PARAM)) + ::std::mem::size_of::(), + 20usize, + concat!("Size of: ", stringify!(CK_INTERFACE)) ); assert_eq!( - ::std::mem::align_of::(), + ::std::mem::align_of::(), 1usize, - concat!("Alignment of ", stringify!(CK_OTP_PARAM)) + concat!("Alignment of ", stringify!(CK_INTERFACE)) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).type_) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).pInterfaceName) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", - stringify!(CK_OTP_PARAM), + stringify!(CK_INTERFACE), "::", - stringify!(type_) + stringify!(pInterfaceName) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pValue) as usize - ptr as usize }, - 4usize, + unsafe { ::std::ptr::addr_of!((*ptr).pFunctionList) as usize - ptr as usize }, + 8usize, concat!( "Offset of field: ", - stringify!(CK_OTP_PARAM), + stringify!(CK_INTERFACE), "::", - stringify!(pValue) + stringify!(pFunctionList) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulValueLen) as usize - ptr as usize }, - 12usize, + unsafe { ::std::ptr::addr_of!((*ptr).flags) as usize - ptr as usize }, + 16usize, concat!( "Offset of field: ", - stringify!(CK_OTP_PARAM), + stringify!(CK_INTERFACE), "::", - stringify!(ulValueLen) + stringify!(flags) ) ); } -impl Default for CK_OTP_PARAM { +impl Default for CK_INTERFACE { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { @@ -1470,99 +1696,100 @@ impl Default for CK_OTP_PARAM { } } } +pub type CK_INTERFACE_PTR = *mut CK_INTERFACE; +pub type CK_INTERFACE_PTR_PTR = *mut CK_INTERFACE_PTR; +pub type CK_CREATEMUTEX = + ::std::option::Option CK_RV>; +pub type CK_DESTROYMUTEX = + ::std::option::Option CK_RV>; +pub type CK_LOCKMUTEX = ::std::option::Option CK_RV>; +pub type CK_UNLOCKMUTEX = ::std::option::Option CK_RV>; #[repr(C, packed)] #[derive(Debug, Copy, Clone)] -pub struct CK_OTP_PARAMS { - pub pParams: *mut CK_OTP_PARAM, - pub ulCount: ::std::os::raw::c_ulong, +pub struct CK_C_INITIALIZE_ARGS { + pub CreateMutex: CK_CREATEMUTEX, + pub DestroyMutex: CK_DESTROYMUTEX, + pub LockMutex: CK_LOCKMUTEX, + pub UnlockMutex: CK_UNLOCKMUTEX, + pub flags: CK_FLAGS, + pub pReserved: CK_VOID_PTR, } #[test] -fn bindgen_test_layout_CK_OTP_PARAMS() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); +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::(), - 12usize, - concat!("Size of: ", stringify!(CK_OTP_PARAMS)) + ::std::mem::size_of::(), + 44usize, + concat!("Size of: ", stringify!(CK_C_INITIALIZE_ARGS)) ); assert_eq!( - ::std::mem::align_of::(), + ::std::mem::align_of::(), 1usize, - concat!("Alignment of ", stringify!(CK_OTP_PARAMS)) + concat!("Alignment of ", stringify!(CK_C_INITIALIZE_ARGS)) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pParams) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).CreateMutex) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", - stringify!(CK_OTP_PARAMS), + stringify!(CK_C_INITIALIZE_ARGS), "::", - stringify!(pParams) + stringify!(CreateMutex) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulCount) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).DestroyMutex) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", - stringify!(CK_OTP_PARAMS), + stringify!(CK_C_INITIALIZE_ARGS), "::", - stringify!(ulCount) + stringify!(DestroyMutex) ) ); -} -impl Default for CK_OTP_PARAMS { - fn default() -> Self { - let mut s = ::std::mem::MaybeUninit::::uninit(); - unsafe { - ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -#[repr(C, packed)] -#[derive(Debug, Copy, Clone)] -pub struct CK_OTP_SIGNATURE_INFO { - pub pParams: *mut CK_OTP_PARAM, - pub ulCount: ::std::os::raw::c_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)) + 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!( - ::std::mem::align_of::(), - 1usize, - concat!("Alignment of ", stringify!(CK_OTP_SIGNATURE_INFO)) + 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).pParams) as usize - ptr as usize }, - 0usize, + unsafe { ::std::ptr::addr_of!((*ptr).flags) as usize - ptr as usize }, + 32usize, concat!( "Offset of field: ", - stringify!(CK_OTP_SIGNATURE_INFO), + stringify!(CK_C_INITIALIZE_ARGS), "::", - stringify!(pParams) + stringify!(flags) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulCount) as usize - ptr as usize }, - 8usize, + unsafe { ::std::ptr::addr_of!((*ptr).pReserved) as usize - ptr as usize }, + 36usize, concat!( "Offset of field: ", - stringify!(CK_OTP_SIGNATURE_INFO), + stringify!(CK_C_INITIALIZE_ARGS), "::", - stringify!(ulCount) + stringify!(pReserved) ) ); } -impl Default for CK_OTP_SIGNATURE_INFO { +impl Default for CK_C_INITIALIZE_ARGS { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { @@ -1571,35 +1798,41 @@ impl Default for CK_OTP_SIGNATURE_INFO { } } } -pub type CK_RSA_PKCS_MGF_TYPE = ::std::os::raw::c_ulong; +pub type CK_C_INITIALIZE_ARGS_PTR = *mut CK_C_INITIALIZE_ARGS; +pub type CK_RSA_PKCS_MGF_TYPE = CK_ULONG; +pub type CK_RSA_PKCS_MGF_TYPE_PTR = *mut CK_RSA_PKCS_MGF_TYPE; +pub type CK_RSA_PKCS_OAEP_SOURCE_TYPE = CK_ULONG; +pub type CK_RSA_PKCS_OAEP_SOURCE_TYPE_PTR = *mut CK_RSA_PKCS_OAEP_SOURCE_TYPE; #[repr(C, packed)] -#[derive(Debug, Default, Copy, Clone)] -pub struct ck_rsa_pkcs_pss_params { +#[derive(Debug, Copy, Clone)] +pub struct CK_RSA_PKCS_OAEP_PARAMS { pub hashAlg: CK_MECHANISM_TYPE, pub mgf: CK_RSA_PKCS_MGF_TYPE, - pub sLen: ::std::os::raw::c_ulong, + pub source: CK_RSA_PKCS_OAEP_SOURCE_TYPE, + pub pSourceData: CK_VOID_PTR, + pub ulSourceDataLen: CK_ULONG, } #[test] -fn bindgen_test_layout_ck_rsa_pkcs_pss_params() { - const UNINIT: ::std::mem::MaybeUninit = +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::(), - 12usize, - concat!("Size of: ", stringify!(ck_rsa_pkcs_pss_params)) + ::std::mem::size_of::(), + 24usize, + concat!("Size of: ", stringify!(CK_RSA_PKCS_OAEP_PARAMS)) ); assert_eq!( - ::std::mem::align_of::(), + ::std::mem::align_of::(), 1usize, - concat!("Alignment of ", stringify!(ck_rsa_pkcs_pss_params)) + 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_pss_params), + stringify!(CK_RSA_PKCS_OAEP_PARAMS), "::", stringify!(hashAlg) ) @@ -1609,53 +1842,80 @@ fn bindgen_test_layout_ck_rsa_pkcs_pss_params() { 4usize, concat!( "Offset of field: ", - stringify!(ck_rsa_pkcs_pss_params), + stringify!(CK_RSA_PKCS_OAEP_PARAMS), "::", stringify!(mgf) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).sLen) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).source) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", - stringify!(ck_rsa_pkcs_pss_params), + stringify!(CK_RSA_PKCS_OAEP_PARAMS), "::", - stringify!(sLen) + stringify!(source) ) ); -} -pub type CK_RSA_PKCS_OAEP_SOURCE_TYPE = ::std::os::raw::c_ulong; -#[repr(C, packed)] -#[derive(Debug, Copy, Clone)] -pub struct ck_rsa_pkcs_oaep_params { - pub hashAlg: CK_MECHANISM_TYPE, - pub mgf: CK_RSA_PKCS_MGF_TYPE, - pub source: CK_RSA_PKCS_OAEP_SOURCE_TYPE, - pub pSourceData: *mut ::std::os::raw::c_void, - pub ulSourceDataLen: ::std::os::raw::c_ulong, + 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) + ) + ); +} +impl Default for CK_RSA_PKCS_OAEP_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_RSA_PKCS_OAEP_PARAMS_PTR = *mut CK_RSA_PKCS_OAEP_PARAMS; +#[repr(C, packed)] +#[derive(Debug, Default, Copy, Clone)] +pub struct CK_RSA_PKCS_PSS_PARAMS { + pub hashAlg: CK_MECHANISM_TYPE, + pub mgf: CK_RSA_PKCS_MGF_TYPE, + pub sLen: CK_ULONG, } #[test] -fn bindgen_test_layout_ck_rsa_pkcs_oaep_params() { - const UNINIT: ::std::mem::MaybeUninit = +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::(), - 24usize, - concat!("Size of: ", stringify!(ck_rsa_pkcs_oaep_params)) + ::std::mem::size_of::(), + 12usize, + concat!("Size of: ", stringify!(CK_RSA_PKCS_PSS_PARAMS)) ); assert_eq!( - ::std::mem::align_of::(), + ::std::mem::align_of::(), 1usize, - concat!("Alignment of ", stringify!(ck_rsa_pkcs_oaep_params)) + 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_oaep_params), + stringify!(CK_RSA_PKCS_PSS_PARAMS), "::", stringify!(hashAlg) ) @@ -1665,43 +1925,100 @@ fn bindgen_test_layout_ck_rsa_pkcs_oaep_params() { 4usize, concat!( "Offset of field: ", - stringify!(ck_rsa_pkcs_oaep_params), + stringify!(CK_RSA_PKCS_PSS_PARAMS), "::", stringify!(mgf) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).source) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).sLen) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", - stringify!(ck_rsa_pkcs_oaep_params), + stringify!(CK_RSA_PKCS_PSS_PARAMS), "::", - stringify!(source) + stringify!(sLen) ) ); +} +pub type CK_RSA_PKCS_PSS_PARAMS_PTR = *mut CK_RSA_PKCS_PSS_PARAMS; +pub type CK_EC_KDF_TYPE = CK_ULONG; +#[repr(C, packed)] +#[derive(Debug, Copy, Clone)] +pub struct CK_ECDH1_DERIVE_PARAMS { + pub kdf: CK_EC_KDF_TYPE, + pub ulSharedDataLen: CK_ULONG, + pub pSharedData: CK_BYTE_PTR, + 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!( - unsafe { ::std::ptr::addr_of!((*ptr).pSourceData) as usize - ptr as usize }, - 12usize, + ::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_rsa_pkcs_oaep_params), + stringify!(CK_ECDH1_DERIVE_PARAMS), "::", - stringify!(pSourceData) + stringify!(kdf) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulSourceDataLen) as usize - ptr as usize }, + 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_rsa_pkcs_oaep_params), + stringify!(CK_ECDH1_DERIVE_PARAMS), "::", - stringify!(ulSourceDataLen) + stringify!(pPublicData) ) ); } -impl Default for ck_rsa_pkcs_oaep_params { +impl Default for CK_ECDH1_DERIVE_PARAMS { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { @@ -1710,133 +2027,127 @@ impl Default for ck_rsa_pkcs_oaep_params { } } } +pub type CK_ECDH1_DERIVE_PARAMS_PTR = *mut CK_ECDH1_DERIVE_PARAMS; #[repr(C, packed)] -#[derive(Debug, Default, Copy, Clone)] -pub struct ck_aes_ctr_params { - pub ulCounterBits: ::std::os::raw::c_ulong, - pub cb: [::std::os::raw::c_uchar; 16usize], +#[derive(Debug, Copy, Clone)] +pub struct CK_ECDH2_DERIVE_PARAMS { + pub kdf: CK_EC_KDF_TYPE, + pub ulSharedDataLen: CK_ULONG, + pub pSharedData: CK_BYTE_PTR, + pub ulPublicDataLen: CK_ULONG, + pub pPublicData: CK_BYTE_PTR, + pub ulPrivateDataLen: CK_ULONG, + pub hPrivateData: CK_OBJECT_HANDLE, + pub ulPublicDataLen2: CK_ULONG, + pub pPublicData2: CK_BYTE_PTR, } #[test] -fn bindgen_test_layout_ck_aes_ctr_params() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); +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::(), - 20usize, - concat!("Size of: ", stringify!(ck_aes_ctr_params)) + ::std::mem::size_of::(), + 48usize, + concat!("Size of: ", stringify!(CK_ECDH2_DERIVE_PARAMS)) ); assert_eq!( - ::std::mem::align_of::(), + ::std::mem::align_of::(), 1usize, - concat!("Alignment of ", stringify!(ck_aes_ctr_params)) + concat!("Alignment of ", stringify!(CK_ECDH2_DERIVE_PARAMS)) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulCounterBits) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).kdf) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", - stringify!(ck_aes_ctr_params), + stringify!(CK_ECDH2_DERIVE_PARAMS), "::", - stringify!(ulCounterBits) + stringify!(kdf) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).cb) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ulSharedDataLen) as usize - ptr as usize }, 4usize, concat!( "Offset of field: ", - stringify!(ck_aes_ctr_params), + stringify!(CK_ECDH2_DERIVE_PARAMS), "::", - stringify!(cb) + stringify!(ulSharedDataLen) ) ); -} -#[repr(C, packed)] -#[derive(Debug, Copy, Clone)] -pub struct ck_gcm_params { - pub pIv: *mut ::std::os::raw::c_uchar, - pub ulIvLen: ::std::os::raw::c_ulong, - pub ulIvBits: ::std::os::raw::c_ulong, - pub pAAD: *mut ::std::os::raw::c_uchar, - pub ulAADLen: ::std::os::raw::c_ulong, - pub ulTagBits: ::std::os::raw::c_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)) + 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).pIv) as usize - ptr as usize }, - 0usize, + unsafe { ::std::ptr::addr_of!((*ptr).ulPublicDataLen) as usize - ptr as usize }, + 16usize, concat!( "Offset of field: ", - stringify!(ck_gcm_params), + stringify!(CK_ECDH2_DERIVE_PARAMS), "::", - stringify!(pIv) + stringify!(ulPublicDataLen) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulIvLen) as usize - ptr as usize }, - 8usize, + unsafe { ::std::ptr::addr_of!((*ptr).pPublicData) as usize - ptr as usize }, + 20usize, concat!( "Offset of field: ", - stringify!(ck_gcm_params), + stringify!(CK_ECDH2_DERIVE_PARAMS), "::", - stringify!(ulIvLen) + stringify!(pPublicData) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulIvBits) as usize - ptr as usize }, - 12usize, + unsafe { ::std::ptr::addr_of!((*ptr).ulPrivateDataLen) as usize - ptr as usize }, + 28usize, concat!( "Offset of field: ", - stringify!(ck_gcm_params), + stringify!(CK_ECDH2_DERIVE_PARAMS), "::", - stringify!(ulIvBits) + stringify!(ulPrivateDataLen) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pAAD) as usize - ptr as usize }, - 16usize, + unsafe { ::std::ptr::addr_of!((*ptr).hPrivateData) as usize - ptr as usize }, + 32usize, concat!( "Offset of field: ", - stringify!(ck_gcm_params), + stringify!(CK_ECDH2_DERIVE_PARAMS), "::", - stringify!(pAAD) + stringify!(hPrivateData) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulAADLen) as usize - ptr as usize }, - 24usize, + unsafe { ::std::ptr::addr_of!((*ptr).ulPublicDataLen2) as usize - ptr as usize }, + 36usize, concat!( "Offset of field: ", - stringify!(ck_gcm_params), + stringify!(CK_ECDH2_DERIVE_PARAMS), "::", - stringify!(ulAADLen) + stringify!(ulPublicDataLen2) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulTagBits) as usize - ptr as usize }, - 28usize, + unsafe { ::std::ptr::addr_of!((*ptr).pPublicData2) as usize - ptr as usize }, + 40usize, concat!( "Offset of field: ", - stringify!(ck_gcm_params), + stringify!(CK_ECDH2_DERIVE_PARAMS), "::", - stringify!(ulTagBits) + stringify!(pPublicData2) ) ); } -impl Default for ck_gcm_params { +impl Default for CK_ECDH2_DERIVE_PARAMS { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { @@ -1845,37 +2156,42 @@ impl Default for ck_gcm_params { } } } -pub type ck_ec_kdf_t = ::std::os::raw::c_ulong; +pub type CK_ECDH2_DERIVE_PARAMS_PTR = *mut CK_ECDH2_DERIVE_PARAMS; #[repr(C, packed)] #[derive(Debug, Copy, Clone)] -pub struct ck_ecdh1_derive_params { - pub kdf: ck_ec_kdf_t, - pub ulSharedDataLen: ::std::os::raw::c_ulong, - pub pSharedData: *mut ::std::os::raw::c_uchar, - pub ulPublicDataLen: ::std::os::raw::c_ulong, - pub pPublicData: *mut ::std::os::raw::c_uchar, +pub struct CK_ECMQV_DERIVE_PARAMS { + pub kdf: CK_EC_KDF_TYPE, + pub ulSharedDataLen: CK_ULONG, + pub pSharedData: CK_BYTE_PTR, + pub ulPublicDataLen: CK_ULONG, + pub pPublicData: CK_BYTE_PTR, + pub ulPrivateDataLen: CK_ULONG, + pub hPrivateData: CK_OBJECT_HANDLE, + pub ulPublicDataLen2: CK_ULONG, + pub pPublicData2: CK_BYTE_PTR, + pub publicKey: CK_OBJECT_HANDLE, } #[test] -fn bindgen_test_layout_ck_ecdh1_derive_params() { - const UNINIT: ::std::mem::MaybeUninit = +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::(), - 28usize, - concat!("Size of: ", stringify!(ck_ecdh1_derive_params)) + ::std::mem::size_of::(), + 52usize, + concat!("Size of: ", stringify!(CK_ECMQV_DERIVE_PARAMS)) ); assert_eq!( - ::std::mem::align_of::(), + ::std::mem::align_of::(), 1usize, - concat!("Alignment of ", stringify!(ck_ecdh1_derive_params)) + 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_ecdh1_derive_params), + stringify!(CK_ECMQV_DERIVE_PARAMS), "::", stringify!(kdf) ) @@ -1885,7 +2201,7 @@ fn bindgen_test_layout_ck_ecdh1_derive_params() { 4usize, concat!( "Offset of field: ", - stringify!(ck_ecdh1_derive_params), + stringify!(CK_ECMQV_DERIVE_PARAMS), "::", stringify!(ulSharedDataLen) ) @@ -1895,7 +2211,7 @@ fn bindgen_test_layout_ck_ecdh1_derive_params() { 8usize, concat!( "Offset of field: ", - stringify!(ck_ecdh1_derive_params), + stringify!(CK_ECMQV_DERIVE_PARAMS), "::", stringify!(pSharedData) ) @@ -1905,7 +2221,7 @@ fn bindgen_test_layout_ck_ecdh1_derive_params() { 16usize, concat!( "Offset of field: ", - stringify!(ck_ecdh1_derive_params), + stringify!(CK_ECMQV_DERIVE_PARAMS), "::", stringify!(ulPublicDataLen) ) @@ -1915,64 +2231,63 @@ fn bindgen_test_layout_ck_ecdh1_derive_params() { 20usize, concat!( "Offset of field: ", - stringify!(ck_ecdh1_derive_params), + stringify!(CK_ECMQV_DERIVE_PARAMS), "::", stringify!(pPublicData) ) ); -} -impl Default for ck_ecdh1_derive_params { - fn default() -> Self { - let mut s = ::std::mem::MaybeUninit::::uninit(); - unsafe { - ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -#[repr(C, packed)] -#[derive(Debug, Copy, Clone)] -pub struct ck_key_derivation_string_data { - pub pData: *mut ::std::os::raw::c_uchar, - pub ulLen: ::std::os::raw::c_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)) + 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!( - ::std::mem::align_of::(), - 1usize, - concat!("Alignment of ", stringify!(ck_key_derivation_string_data)) + 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).pData) as usize - ptr as usize }, - 0usize, + unsafe { ::std::ptr::addr_of!((*ptr).ulPublicDataLen2) as usize - ptr as usize }, + 36usize, concat!( "Offset of field: ", - stringify!(ck_key_derivation_string_data), + stringify!(CK_ECMQV_DERIVE_PARAMS), "::", - stringify!(pData) + stringify!(ulPublicDataLen2) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulLen) as usize - ptr as usize }, - 8usize, + unsafe { ::std::ptr::addr_of!((*ptr).pPublicData2) as usize - ptr as usize }, + 40usize, concat!( "Offset of field: ", - stringify!(ck_key_derivation_string_data), + stringify!(CK_ECMQV_DERIVE_PARAMS), "::", - stringify!(ulLen) + 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) ) ); } -impl Default for ck_key_derivation_string_data { +impl Default for CK_ECMQV_DERIVE_PARAMS { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { @@ -1981,60 +2296,85 @@ impl Default for ck_key_derivation_string_data { } } } +pub type CK_ECMQV_DERIVE_PARAMS_PTR = *mut CK_ECMQV_DERIVE_PARAMS; +pub type CK_X9_42_DH_KDF_TYPE = CK_ULONG; +pub type CK_X9_42_DH_KDF_TYPE_PTR = *mut CK_X9_42_DH_KDF_TYPE; #[repr(C, packed)] #[derive(Debug, Copy, Clone)] -pub struct ck_des_cbc_encrypt_data_params { - pub iv: [::std::os::raw::c_uchar; 8usize], - pub pData: *mut ::std::os::raw::c_uchar, - pub length: ::std::os::raw::c_ulong, +pub struct CK_X9_42_DH1_DERIVE_PARAMS { + pub kdf: CK_X9_42_DH_KDF_TYPE, + pub ulOtherInfoLen: CK_ULONG, + pub pOtherInfo: CK_BYTE_PTR, + pub ulPublicDataLen: CK_ULONG, + pub pPublicData: CK_BYTE_PTR, } #[test] -fn bindgen_test_layout_ck_des_cbc_encrypt_data_params() { - const UNINIT: ::std::mem::MaybeUninit = +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::(), - 20usize, - concat!("Size of: ", stringify!(ck_des_cbc_encrypt_data_params)) + ::std::mem::size_of::(), + 28usize, + concat!("Size of: ", stringify!(CK_X9_42_DH1_DERIVE_PARAMS)) ); assert_eq!( - ::std::mem::align_of::(), + ::std::mem::align_of::(), 1usize, - concat!("Alignment of ", stringify!(ck_des_cbc_encrypt_data_params)) + concat!("Alignment of ", stringify!(CK_X9_42_DH1_DERIVE_PARAMS)) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).iv) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).kdf) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", - stringify!(ck_des_cbc_encrypt_data_params), + stringify!(CK_X9_42_DH1_DERIVE_PARAMS), "::", - stringify!(iv) + stringify!(kdf) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pData) as usize - ptr as usize }, + 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_des_cbc_encrypt_data_params), + stringify!(CK_X9_42_DH1_DERIVE_PARAMS), "::", - stringify!(pData) + stringify!(pOtherInfo) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).length) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ulPublicDataLen) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", - stringify!(ck_des_cbc_encrypt_data_params), + stringify!(CK_X9_42_DH1_DERIVE_PARAMS), "::", - stringify!(length) + 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) ) ); } -impl Default for ck_des_cbc_encrypt_data_params { +impl Default for CK_X9_42_DH1_DERIVE_PARAMS { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { @@ -2043,540 +2383,7363 @@ impl Default for ck_des_cbc_encrypt_data_params { } } } +pub type CK_X9_42_DH1_DERIVE_PARAMS_PTR = *mut CK_X9_42_DH1_DERIVE_PARAMS; #[repr(C, packed)] #[derive(Debug, Copy, Clone)] -pub struct ck_aes_cbc_encrypt_data_params { - pub iv: [::std::os::raw::c_uchar; 16usize], - pub pData: *mut ::std::os::raw::c_uchar, - pub length: ::std::os::raw::c_ulong, +pub struct CK_X9_42_DH2_DERIVE_PARAMS { + pub kdf: CK_X9_42_DH_KDF_TYPE, + pub ulOtherInfoLen: CK_ULONG, + pub pOtherInfo: CK_BYTE_PTR, + pub ulPublicDataLen: CK_ULONG, + pub pPublicData: CK_BYTE_PTR, + pub ulPrivateDataLen: CK_ULONG, + pub hPrivateData: CK_OBJECT_HANDLE, + pub ulPublicDataLen2: CK_ULONG, + pub pPublicData2: CK_BYTE_PTR, } #[test] -fn bindgen_test_layout_ck_aes_cbc_encrypt_data_params() { - const UNINIT: ::std::mem::MaybeUninit = +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::(), - 28usize, - concat!("Size of: ", stringify!(ck_aes_cbc_encrypt_data_params)) + ::std::mem::size_of::(), + 48usize, + concat!("Size of: ", stringify!(CK_X9_42_DH2_DERIVE_PARAMS)) ); assert_eq!( - ::std::mem::align_of::(), + ::std::mem::align_of::(), 1usize, - concat!("Alignment of ", stringify!(ck_aes_cbc_encrypt_data_params)) + concat!("Alignment of ", stringify!(CK_X9_42_DH2_DERIVE_PARAMS)) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).iv) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).kdf) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", - stringify!(ck_aes_cbc_encrypt_data_params), + stringify!(CK_X9_42_DH2_DERIVE_PARAMS), "::", - stringify!(iv) + stringify!(kdf) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pData) as usize - ptr as usize }, + 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_aes_cbc_encrypt_data_params), + stringify!(CK_X9_42_DH2_DERIVE_PARAMS), "::", - stringify!(pData) + stringify!(ulPublicDataLen) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).length) as usize - ptr as usize }, - 24usize, + unsafe { ::std::ptr::addr_of!((*ptr).pPublicData) as usize - ptr as usize }, + 20usize, concat!( "Offset of field: ", - stringify!(ck_aes_cbc_encrypt_data_params), + stringify!(CK_X9_42_DH2_DERIVE_PARAMS), "::", - stringify!(length) + stringify!(pPublicData) ) ); -} -impl Default for ck_aes_cbc_encrypt_data_params { - fn default() -> Self { - let mut s = ::std::mem::MaybeUninit::::uninit(); - unsafe { - ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -pub type CK_RV = ::std::os::raw::c_ulong; -pub type CK_NOTIFY = ::std::option::Option< - unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - event: CK_NOTIFICATION, - application: *mut ::std::os::raw::c_void, - ) -> CK_RV, ->; + 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) + ) + ); +} +impl Default for CK_X9_42_DH2_DERIVE_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_X9_42_DH2_DERIVE_PARAMS_PTR = *mut CK_X9_42_DH2_DERIVE_PARAMS; +#[repr(C, packed)] +#[derive(Debug, Copy, Clone)] +pub struct CK_X9_42_MQV_DERIVE_PARAMS { + pub kdf: CK_X9_42_DH_KDF_TYPE, + pub ulOtherInfoLen: CK_ULONG, + pub pOtherInfo: CK_BYTE_PTR, + pub ulPublicDataLen: CK_ULONG, + pub pPublicData: CK_BYTE_PTR, + pub ulPrivateDataLen: CK_ULONG, + pub hPrivateData: CK_OBJECT_HANDLE, + pub ulPublicDataLen2: CK_ULONG, + 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) + ) + ); +} +impl Default for CK_X9_42_MQV_DERIVE_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_X9_42_MQV_DERIVE_PARAMS_PTR = *mut CK_X9_42_MQV_DERIVE_PARAMS; +#[repr(C, packed)] +#[derive(Debug, Copy, Clone)] +pub struct CK_KEA_DERIVE_PARAMS { + pub isSender: CK_BBOOL, + pub ulRandomLen: CK_ULONG, + pub pRandomA: CK_BYTE_PTR, + pub pRandomB: CK_BYTE_PTR, + 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) + ) + ); +} +impl Default for CK_KEA_DERIVE_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_KEA_DERIVE_PARAMS_PTR = *mut CK_KEA_DERIVE_PARAMS; +pub type CK_RC2_PARAMS = CK_ULONG; +pub type CK_RC2_PARAMS_PTR = *mut CK_RC2_PARAMS; +#[repr(C, packed)] +#[derive(Debug, Default, Copy, Clone)] +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) + ) + ); +} +pub type CK_RC2_CBC_PARAMS_PTR = *mut CK_RC2_CBC_PARAMS; +#[repr(C, packed)] +#[derive(Debug, Default, Copy, Clone)] +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) + ) + ); +} +pub type CK_RC2_MAC_GENERAL_PARAMS_PTR = *mut CK_RC2_MAC_GENERAL_PARAMS; +#[repr(C, packed)] +#[derive(Debug, Default, Copy, Clone)] +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) + ) + ); +} +pub type CK_RC5_PARAMS_PTR = *mut CK_RC5_PARAMS; +#[repr(C, packed)] +#[derive(Debug, Copy, Clone)] +pub struct CK_RC5_CBC_PARAMS { + pub ulWordsize: CK_ULONG, + pub ulRounds: CK_ULONG, + 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) + ) + ); +} +impl Default for CK_RC5_CBC_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_RC5_CBC_PARAMS_PTR = *mut CK_RC5_CBC_PARAMS; +#[repr(C, packed)] +#[derive(Debug, Default, Copy, Clone)] +pub struct CK_RC5_MAC_GENERAL_PARAMS { + pub ulWordsize: CK_ULONG, + 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) + ) + ); +} +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; +#[repr(C, packed)] +#[derive(Debug, Copy, Clone)] +pub struct CK_DES_CBC_ENCRYPT_DATA_PARAMS { + pub iv: [CK_BYTE; 8usize], + 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) + ) + ); +} +impl Default for CK_DES_CBC_ENCRYPT_DATA_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_DES_CBC_ENCRYPT_DATA_PARAMS_PTR = *mut CK_DES_CBC_ENCRYPT_DATA_PARAMS; +#[repr(C, packed)] +#[derive(Debug, Copy, Clone)] +pub struct CK_AES_CBC_ENCRYPT_DATA_PARAMS { + pub iv: [CK_BYTE; 16usize], + 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) + ) + ); +} +impl Default for CK_AES_CBC_ENCRYPT_DATA_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_AES_CBC_ENCRYPT_DATA_PARAMS_PTR = *mut CK_AES_CBC_ENCRYPT_DATA_PARAMS; +#[repr(C, packed)] +#[derive(Debug, Copy, Clone)] +pub struct CK_SKIPJACK_PRIVATE_WRAP_PARAMS { + pub ulPasswordLen: CK_ULONG, + pub pPassword: CK_BYTE_PTR, + pub ulPublicDataLen: CK_ULONG, + pub pPublicData: CK_BYTE_PTR, + pub ulPAndGLen: CK_ULONG, + pub ulQLen: CK_ULONG, + pub ulRandomLen: CK_ULONG, + pub pRandomA: CK_BYTE_PTR, + pub pPrimeP: CK_BYTE_PTR, + 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) + ) + ); +} +impl Default for CK_SKIPJACK_PRIVATE_WRAP_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_SKIPJACK_PRIVATE_WRAP_PARAMS_PTR = *mut CK_SKIPJACK_PRIVATE_WRAP_PARAMS; +#[repr(C, packed)] +#[derive(Debug, Copy, Clone)] +pub struct CK_SKIPJACK_RELAYX_PARAMS { + pub ulOldWrappedXLen: CK_ULONG, + pub pOldWrappedX: CK_BYTE_PTR, + pub ulOldPasswordLen: CK_ULONG, + pub pOldPassword: CK_BYTE_PTR, + pub ulOldPublicDataLen: CK_ULONG, + pub pOldPublicData: CK_BYTE_PTR, + pub ulOldRandomLen: CK_ULONG, + pub pOldRandomA: CK_BYTE_PTR, + pub ulNewPasswordLen: CK_ULONG, + pub pNewPassword: CK_BYTE_PTR, + pub ulNewPublicDataLen: CK_ULONG, + pub pNewPublicData: CK_BYTE_PTR, + 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) + ) + ); +} +impl Default for CK_SKIPJACK_RELAYX_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_SKIPJACK_RELAYX_PARAMS_PTR = *mut CK_SKIPJACK_RELAYX_PARAMS; +#[repr(C, packed)] +#[derive(Debug, Copy, Clone)] +pub struct CK_PBE_PARAMS { + pub pInitVector: CK_BYTE_PTR, + pub pPassword: CK_UTF8CHAR_PTR, + pub ulPasswordLen: CK_ULONG, + pub pSalt: CK_BYTE_PTR, + 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) + ) + ); +} +impl Default for CK_PBE_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_PBE_PARAMS_PTR = *mut CK_PBE_PARAMS; +#[repr(C, packed)] +#[derive(Debug, Copy, Clone)] +pub struct CK_KEY_WRAP_SET_OAEP_PARAMS { + pub bBC: CK_BYTE, + 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) + ) + ); +} +impl Default for CK_KEY_WRAP_SET_OAEP_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_KEY_WRAP_SET_OAEP_PARAMS_PTR = *mut CK_KEY_WRAP_SET_OAEP_PARAMS; +#[repr(C, packed)] +#[derive(Debug, Copy, Clone)] +pub struct CK_SSL3_RANDOM_DATA { + pub pClientRandom: CK_BYTE_PTR, + pub ulClientRandomLen: CK_ULONG, + 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) + ) + ); +} +impl Default for CK_SSL3_RANDOM_DATA { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +#[repr(C, packed)] +#[derive(Debug, Copy, Clone)] +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) + ) + ); +} +impl Default for CK_SSL3_MASTER_KEY_DERIVE_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_SSL3_MASTER_KEY_DERIVE_PARAMS_PTR = *mut CK_SSL3_MASTER_KEY_DERIVE_PARAMS; +#[repr(C, packed)] +#[derive(Debug, Copy, Clone)] +pub struct CK_SSL3_KEY_MAT_OUT { + pub hClientMacSecret: CK_OBJECT_HANDLE, + pub hServerMacSecret: CK_OBJECT_HANDLE, + pub hClientKey: CK_OBJECT_HANDLE, + pub hServerKey: CK_OBJECT_HANDLE, + 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) + ) + ); +} +impl Default for CK_SSL3_KEY_MAT_OUT { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_SSL3_KEY_MAT_OUT_PTR = *mut CK_SSL3_KEY_MAT_OUT; +#[repr(C, packed)] +#[derive(Debug, Copy, Clone)] +pub struct CK_SSL3_KEY_MAT_PARAMS { + pub ulMacSizeInBits: CK_ULONG, + pub ulKeySizeInBits: CK_ULONG, + pub ulIVSizeInBits: CK_ULONG, + pub bIsExport: CK_BBOOL, + 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) + ) + ); +} +impl Default for CK_SSL3_KEY_MAT_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_SSL3_KEY_MAT_PARAMS_PTR = *mut CK_SSL3_KEY_MAT_PARAMS; +#[repr(C, packed)] +#[derive(Debug, Copy, Clone)] +pub struct CK_TLS_PRF_PARAMS { + pub pSeed: CK_BYTE_PTR, + pub ulSeedLen: CK_ULONG, + pub pLabel: CK_BYTE_PTR, + pub ulLabelLen: CK_ULONG, + 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) + ) + ); +} +impl Default for CK_TLS_PRF_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_TLS_PRF_PARAMS_PTR = *mut CK_TLS_PRF_PARAMS; +#[repr(C, packed)] +#[derive(Debug, Copy, Clone)] +pub struct CK_WTLS_RANDOM_DATA { + pub pClientRandom: CK_BYTE_PTR, + pub ulClientRandomLen: CK_ULONG, + 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) + ) + ); +} +impl Default for CK_WTLS_RANDOM_DATA { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_WTLS_RANDOM_DATA_PTR = *mut CK_WTLS_RANDOM_DATA; +#[repr(C, packed)] +#[derive(Debug, Copy, Clone)] +pub struct CK_WTLS_MASTER_KEY_DERIVE_PARAMS { + pub DigestMechanism: CK_MECHANISM_TYPE, + 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) + ) + ); +} +impl Default for CK_WTLS_MASTER_KEY_DERIVE_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_WTLS_MASTER_KEY_DERIVE_PARAMS_PTR = *mut CK_WTLS_MASTER_KEY_DERIVE_PARAMS; +#[repr(C, packed)] +#[derive(Debug, Copy, Clone)] +pub struct CK_WTLS_PRF_PARAMS { + pub DigestMechanism: CK_MECHANISM_TYPE, + pub pSeed: CK_BYTE_PTR, + pub ulSeedLen: CK_ULONG, + pub pLabel: CK_BYTE_PTR, + pub ulLabelLen: CK_ULONG, + 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) + ) + ); +} +impl Default for CK_WTLS_PRF_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_WTLS_PRF_PARAMS_PTR = *mut CK_WTLS_PRF_PARAMS; +#[repr(C, packed)] +#[derive(Debug, Copy, Clone)] +pub struct CK_WTLS_KEY_MAT_OUT { + pub hMacSecret: CK_OBJECT_HANDLE, + 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) + ) + ); +} +impl Default for CK_WTLS_KEY_MAT_OUT { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_WTLS_KEY_MAT_OUT_PTR = *mut CK_WTLS_KEY_MAT_OUT; +#[repr(C, packed)] +#[derive(Debug, Copy, Clone)] +pub struct CK_WTLS_KEY_MAT_PARAMS { + pub DigestMechanism: CK_MECHANISM_TYPE, + pub ulMacSizeInBits: CK_ULONG, + pub ulKeySizeInBits: CK_ULONG, + pub ulIVSizeInBits: CK_ULONG, + pub ulSequenceNumber: CK_ULONG, + pub bIsExport: CK_BBOOL, + 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) + ) + ); +} +impl Default for CK_WTLS_KEY_MAT_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_WTLS_KEY_MAT_PARAMS_PTR = *mut CK_WTLS_KEY_MAT_PARAMS; +#[repr(C, packed)] +#[derive(Debug, Copy, Clone)] +pub struct CK_CMS_SIG_PARAMS { + pub certificateHandle: CK_OBJECT_HANDLE, + pub pSigningMechanism: CK_MECHANISM_PTR, + pub pDigestMechanism: CK_MECHANISM_PTR, + pub pContentType: CK_UTF8CHAR_PTR, + pub pRequestedAttributes: CK_BYTE_PTR, + pub ulRequestedAttributesLen: CK_ULONG, + 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) + ) + ); +} +impl Default for CK_CMS_SIG_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_CMS_SIG_PARAMS_PTR = *mut CK_CMS_SIG_PARAMS; +#[repr(C, packed)] +#[derive(Debug, Copy, Clone)] +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) + ) + ); +} +impl Default for CK_KEY_DERIVATION_STRING_DATA { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_KEY_DERIVATION_STRING_DATA_PTR = *mut CK_KEY_DERIVATION_STRING_DATA; +pub type CK_EXTRACT_PARAMS = CK_ULONG; +pub type CK_EXTRACT_PARAMS_PTR = *mut CK_EXTRACT_PARAMS; +pub type CK_PKCS5_PBKD2_PSEUDO_RANDOM_FUNCTION_TYPE = CK_ULONG; +pub type CK_PKCS5_PBKD2_PSEUDO_RANDOM_FUNCTION_TYPE_PTR = + *mut CK_PKCS5_PBKD2_PSEUDO_RANDOM_FUNCTION_TYPE; +pub type CK_PKCS5_PBKDF2_SALT_SOURCE_TYPE = CK_ULONG; +pub type CK_PKCS5_PBKDF2_SALT_SOURCE_TYPE_PTR = *mut CK_PKCS5_PBKDF2_SALT_SOURCE_TYPE; +#[repr(C, packed)] +#[derive(Debug, Copy, Clone)] +pub struct CK_PKCS5_PBKD2_PARAMS { + pub saltSource: CK_PKCS5_PBKDF2_SALT_SOURCE_TYPE, + pub pSaltSourceData: CK_VOID_PTR, + pub ulSaltSourceDataLen: CK_ULONG, + pub iterations: CK_ULONG, + pub prf: CK_PKCS5_PBKD2_PSEUDO_RANDOM_FUNCTION_TYPE, + pub pPrfData: CK_VOID_PTR, + pub ulPrfDataLen: CK_ULONG, + 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) + ) + ); +} +impl Default for CK_PKCS5_PBKD2_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_PKCS5_PBKD2_PARAMS_PTR = *mut CK_PKCS5_PBKD2_PARAMS; +#[repr(C, packed)] +#[derive(Debug, Copy, Clone)] +pub struct CK_PKCS5_PBKD2_PARAMS2 { + pub saltSource: CK_PKCS5_PBKDF2_SALT_SOURCE_TYPE, + pub pSaltSourceData: CK_VOID_PTR, + pub ulSaltSourceDataLen: CK_ULONG, + pub iterations: CK_ULONG, + pub prf: CK_PKCS5_PBKD2_PSEUDO_RANDOM_FUNCTION_TYPE, + pub pPrfData: CK_VOID_PTR, + pub ulPrfDataLen: CK_ULONG, + 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) + ) + ); +} +impl Default for CK_PKCS5_PBKD2_PARAMS2 { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_PKCS5_PBKD2_PARAMS2_PTR = *mut CK_PKCS5_PBKD2_PARAMS2; +pub type CK_OTP_PARAM_TYPE = CK_ULONG; +pub type CK_PARAM_TYPE = CK_OTP_PARAM_TYPE; +#[repr(C, packed)] +#[derive(Debug, Copy, Clone)] +pub struct CK_OTP_PARAM { + pub type_: CK_OTP_PARAM_TYPE, + 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) + ) + ); +} +impl Default for CK_OTP_PARAM { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_OTP_PARAM_PTR = *mut CK_OTP_PARAM; +#[repr(C, packed)] +#[derive(Debug, Copy, Clone)] +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) + ) + ); +} +impl Default for CK_OTP_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_OTP_PARAMS_PTR = *mut CK_OTP_PARAMS; +#[repr(C, packed)] +#[derive(Debug, Copy, Clone)] +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) + ) + ); +} +impl Default for CK_OTP_SIGNATURE_INFO { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_OTP_SIGNATURE_INFO_PTR = *mut CK_OTP_SIGNATURE_INFO; +#[repr(C, packed)] +#[derive(Debug, Copy, Clone)] +pub struct CK_KIP_PARAMS { + pub pMechanism: CK_MECHANISM_PTR, + pub hKey: CK_OBJECT_HANDLE, + 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) + ) + ); +} +impl Default for CK_KIP_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_KIP_PARAMS_PTR = *mut CK_KIP_PARAMS; +#[repr(C, packed)] +#[derive(Debug, Default, Copy, Clone)] +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) + ) + ); +} +pub type CK_AES_CTR_PARAMS_PTR = *mut CK_AES_CTR_PARAMS; +#[repr(C, packed)] +#[derive(Debug, Copy, Clone)] +pub struct CK_GCM_PARAMS { + pub pIv: CK_BYTE_PTR, + pub ulIvLen: CK_ULONG, + pub ulIvBits: CK_ULONG, + pub pAAD: CK_BYTE_PTR, + 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) + ) + ); +} +impl Default for CK_GCM_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_GCM_PARAMS_PTR = *mut CK_GCM_PARAMS; +pub type CK_GENERATOR_FUNCTION = CK_ULONG; +#[repr(C, packed)] +#[derive(Debug, Copy, Clone)] +pub struct CK_GCM_MESSAGE_PARAMS { + pub pIv: CK_BYTE_PTR, + pub ulIvLen: CK_ULONG, + pub ulIvFixedBits: CK_ULONG, + pub ivGenerator: CK_GENERATOR_FUNCTION, + 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) + ) + ); +} +impl Default for CK_GCM_MESSAGE_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_GCM_MESSAGE_PARAMS_PTR = CK_GCM_MESSAGE_PARAMS; +#[repr(C, packed)] +#[derive(Debug, Copy, Clone)] +pub struct CK_CCM_PARAMS { + pub ulDataLen: CK_ULONG, + pub pNonce: CK_BYTE_PTR, + pub ulNonceLen: CK_ULONG, + pub pAAD: CK_BYTE_PTR, + 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) + ) + ); +} +impl Default for CK_CCM_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_CCM_PARAMS_PTR = *mut CK_CCM_PARAMS; +#[repr(C, packed)] +#[derive(Debug, Copy, Clone)] +pub struct CK_CCM_MESSAGE_PARAMS { + pub ulDataLen: CK_ULONG, + pub pNonce: CK_BYTE_PTR, + pub ulNonceLen: CK_ULONG, + pub ulNonceFixedBits: CK_ULONG, + pub nonceGenerator: CK_GENERATOR_FUNCTION, + 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) + ) + ); +} +impl Default for CK_CCM_MESSAGE_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_CCM_MESSAGE_PARAMS_PTR = CK_CCM_MESSAGE_PARAMS; +#[repr(C, packed)] +#[derive(Debug, Copy, Clone)] +pub struct CK_AES_GCM_PARAMS { + pub pIv: CK_BYTE_PTR, + pub ulIvLen: CK_ULONG, + pub ulIvBits: CK_ULONG, + pub pAAD: CK_BYTE_PTR, + 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) + ) + ); +} +impl Default for CK_AES_GCM_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_AES_GCM_PARAMS_PTR = *mut CK_AES_GCM_PARAMS; +#[repr(C, packed)] +#[derive(Debug, Copy, Clone)] +pub struct CK_AES_CCM_PARAMS { + pub ulDataLen: CK_ULONG, + pub pNonce: CK_BYTE_PTR, + pub ulNonceLen: CK_ULONG, + pub pAAD: CK_BYTE_PTR, + 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) + ) + ); +} +impl Default for CK_AES_CCM_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_AES_CCM_PARAMS_PTR = *mut CK_AES_CCM_PARAMS; +#[repr(C, packed)] +#[derive(Debug, Default, Copy, Clone)] +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) + ) + ); +} +pub type CK_CAMELLIA_CTR_PARAMS_PTR = *mut CK_CAMELLIA_CTR_PARAMS; +#[repr(C, packed)] +#[derive(Debug, Copy, Clone)] +pub struct CK_CAMELLIA_CBC_ENCRYPT_DATA_PARAMS { + pub iv: [CK_BYTE; 16usize], + 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) + ) + ); +} +impl Default for CK_CAMELLIA_CBC_ENCRYPT_DATA_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_CAMELLIA_CBC_ENCRYPT_DATA_PARAMS_PTR = *mut CK_CAMELLIA_CBC_ENCRYPT_DATA_PARAMS; +#[repr(C, packed)] +#[derive(Debug, Copy, Clone)] +pub struct CK_ARIA_CBC_ENCRYPT_DATA_PARAMS { + pub iv: [CK_BYTE; 16usize], + 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) + ) + ); +} +impl Default for CK_ARIA_CBC_ENCRYPT_DATA_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_ARIA_CBC_ENCRYPT_DATA_PARAMS_PTR = *mut CK_ARIA_CBC_ENCRYPT_DATA_PARAMS; +#[repr(C, packed)] +#[derive(Debug, Copy, Clone)] +pub struct CK_DSA_PARAMETER_GEN_PARAM { + pub hash: CK_MECHANISM_TYPE, + pub pSeed: CK_BYTE_PTR, + 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) + ) + ); +} +impl Default for CK_DSA_PARAMETER_GEN_PARAM { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_DSA_PARAMETER_GEN_PARAM_PTR = *mut CK_DSA_PARAMETER_GEN_PARAM; +#[repr(C, packed)] +#[derive(Debug, Copy, Clone)] +pub struct CK_ECDH_AES_KEY_WRAP_PARAMS { + pub ulAESKeyBits: CK_ULONG, + pub kdf: CK_EC_KDF_TYPE, + 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) + ) + ); +} +impl Default for CK_ECDH_AES_KEY_WRAP_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_ECDH_AES_KEY_WRAP_PARAMS_PTR = *mut CK_ECDH_AES_KEY_WRAP_PARAMS; +pub type CK_JAVA_MIDP_SECURITY_DOMAIN = CK_ULONG; +pub type CK_CERTIFICATE_CATEGORY = CK_ULONG; +#[repr(C, packed)] +#[derive(Debug, Copy, Clone)] +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) + ) + ); +} +impl Default for CK_RSA_AES_KEY_WRAP_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_RSA_AES_KEY_WRAP_PARAMS_PTR = *mut CK_RSA_AES_KEY_WRAP_PARAMS; +#[repr(C, packed)] +#[derive(Debug, Copy, Clone)] +pub struct CK_TLS12_MASTER_KEY_DERIVE_PARAMS { + pub RandomInfo: CK_SSL3_RANDOM_DATA, + 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) + ) + ); +} +impl Default for CK_TLS12_MASTER_KEY_DERIVE_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_TLS12_MASTER_KEY_DERIVE_PARAMS_PTR = *mut CK_TLS12_MASTER_KEY_DERIVE_PARAMS; +#[repr(C, packed)] +#[derive(Debug, Copy, Clone)] +pub struct CK_TLS12_KEY_MAT_PARAMS { + pub ulMacSizeInBits: CK_ULONG, + pub ulKeySizeInBits: CK_ULONG, + pub ulIVSizeInBits: CK_ULONG, + pub bIsExport: CK_BBOOL, + pub RandomInfo: CK_SSL3_RANDOM_DATA, + 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) + ) + ); +} +impl Default for CK_TLS12_KEY_MAT_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_TLS12_KEY_MAT_PARAMS_PTR = *mut CK_TLS12_KEY_MAT_PARAMS; +#[repr(C, packed)] +#[derive(Debug, Copy, Clone)] +pub struct CK_TLS_KDF_PARAMS { + pub prfMechanism: CK_MECHANISM_TYPE, + pub pLabel: CK_BYTE_PTR, + pub ulLabelLength: CK_ULONG, + pub RandomInfo: CK_SSL3_RANDOM_DATA, + 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) + ) + ); +} +impl Default for CK_TLS_KDF_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_TLS_KDF_PARAMS_PTR = *mut CK_TLS_KDF_PARAMS; +#[repr(C, packed)] +#[derive(Debug, Default, Copy, Clone)] +pub struct CK_TLS_MAC_PARAMS { + pub prfHashMechanism: CK_MECHANISM_TYPE, + 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) + ) + ); +} +pub type CK_TLS_MAC_PARAMS_PTR = *mut CK_TLS_MAC_PARAMS; +#[repr(C, packed)] +#[derive(Debug, Copy, Clone)] +pub struct CK_GOSTR3410_DERIVE_PARAMS { + pub kdf: CK_EC_KDF_TYPE, + pub pPublicData: CK_BYTE_PTR, + pub ulPublicDataLen: CK_ULONG, + 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) + ) + ); +} +impl Default for CK_GOSTR3410_DERIVE_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_GOSTR3410_DERIVE_PARAMS_PTR = *mut CK_GOSTR3410_DERIVE_PARAMS; +#[repr(C, packed)] +#[derive(Debug, Copy, Clone)] +pub struct CK_GOSTR3410_KEY_WRAP_PARAMS { + pub pWrapOID: CK_BYTE_PTR, + pub ulWrapOIDLen: CK_ULONG, + pub pUKM: CK_BYTE_PTR, + 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) + ) + ); +} +impl Default for CK_GOSTR3410_KEY_WRAP_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_GOSTR3410_KEY_WRAP_PARAMS_PTR = *mut CK_GOSTR3410_KEY_WRAP_PARAMS; +#[repr(C, packed)] +#[derive(Debug, Copy, Clone)] +pub struct CK_SEED_CBC_ENCRYPT_DATA_PARAMS { + pub iv: [CK_BYTE; 16usize], + 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) + ) + ); +} +impl Default for CK_SEED_CBC_ENCRYPT_DATA_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_SEED_CBC_ENCRYPT_DATA_PARAMS_PTR = *mut CK_SEED_CBC_ENCRYPT_DATA_PARAMS; +pub type CK_PROFILE_ID = CK_ULONG; +pub type CK_PRF_DATA_TYPE = CK_ULONG; +pub type CK_SP800_108_PRF_TYPE = CK_MECHANISM_TYPE; +#[repr(C, packed)] +#[derive(Debug, Copy, Clone)] +pub struct CK_PRF_DATA_PARAM { + pub type_: CK_PRF_DATA_TYPE, + 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) + ) + ); +} +impl Default for CK_PRF_DATA_PARAM { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_PRF_DATA_PARAM_PTR = *mut CK_PRF_DATA_PARAM; +#[repr(C, packed)] +#[derive(Debug, Default, Copy, Clone)] +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) + ) + ); +} +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)] +#[derive(Debug, Default, Copy, Clone)] +pub struct CK_SP800_108_DKM_LENGTH_FORMAT { + pub dkmLengthMethod: CK_SP800_108_DKM_LENGTH_METHOD, + 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) + ) + ); +} +pub type CK_SP800_108_DKM_LENGTH_FORMAT_PTR = *mut CK_SP800_108_DKM_LENGTH_FORMAT; +#[repr(C, packed)] +#[derive(Debug, Copy, Clone)] +pub struct CK_DERIVED_KEY { + pub pTemplate: CK_ATTRIBUTE_PTR, + 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) + ) + ); +} +impl Default for CK_DERIVED_KEY { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_DERIVED_KEY_PTR = *mut CK_DERIVED_KEY; +#[repr(C, packed)] +#[derive(Debug, Copy, Clone)] +pub struct CK_SP800_108_KDF_PARAMS { + pub prfType: CK_SP800_108_PRF_TYPE, + pub ulNumberOfDataParams: CK_ULONG, + pub pDataParams: CK_PRF_DATA_PARAM_PTR, + pub ulAdditionalDerivedKeys: CK_ULONG, + pub pAdditionalDerivedKeys: CK_DERIVED_KEY, +} +#[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::(), + 40usize, + 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) + ) + ); +} +impl Default for CK_SP800_108_KDF_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_SP800_108_KDF_PARAMS_PTR = *mut CK_SP800_108_KDF_PARAMS; +#[repr(C, packed)] +#[derive(Debug, Copy, Clone)] +pub struct CK_SP800_108_FEEDBACK_KDF_PARAMS { + pub prfType: CK_SP800_108_PRF_TYPE, + pub ulNumberOfDataParams: CK_ULONG, + pub pDataParams: CK_PRF_DATA_PARAM_PTR, + pub ulIVLen: CK_ULONG, + pub pIV: CK_BYTE_PTR, + pub ulAdditionalDerivedKeys: CK_ULONG, + pub pAdditionalDerivedKeys: CK_DERIVED_KEY, +} +#[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::(), + 52usize, + 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) + ) + ); +} +impl Default for CK_SP800_108_FEEDBACK_KDF_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_SP800_108_FEEDBACK_KDF_PARAMS_PTR = *mut CK_SP800_108_FEEDBACK_KDF_PARAMS; +#[repr(C, packed)] +#[derive(Debug, Copy, Clone)] +pub struct CK_EDDSA_PARAMS { + pub phFlag: CK_BBOOL, + 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) + ) + ); +} +impl Default for CK_EDDSA_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_EDDSA_PARAMS_PTR = *mut CK_EDDSA_PARAMS; +#[repr(C, packed)] +#[derive(Debug, Copy, Clone)] +pub struct CK_CHACHA20_PARAMS { + pub pBlockCounter: CK_BYTE_PTR, + pub blockCounterBits: CK_ULONG, + 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) + ) + ); +} +impl Default for CK_CHACHA20_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +#[repr(C, packed)] +#[derive(Debug, Copy, Clone)] +pub struct CK_SALSA20_PARAMS { + pub pBlockCounter: CK_BYTE_PTR, + 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) + ) + ); +} +impl Default for CK_SALSA20_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +#[repr(C, packed)] +#[derive(Debug, Copy, Clone)] +pub struct CK_SALSA20_CHACHA20_POLY1305_PARAMS { + pub pNonce: CK_BYTE_PTR, + pub ulNonceLen: CK_ULONG, + 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) + ) + ); +} +impl Default for CK_SALSA20_CHACHA20_POLY1305_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_SALSA20_CHACHA20_POLY1305_PARAMS_PTR = *mut CK_SALSA20_CHACHA20_POLY1305_PARAMS; +#[repr(C, packed)] +#[derive(Debug, Copy, Clone)] +pub struct CK_SALSA20_CHACHA20_POLY1305_MSG_PARAMS { + pub pNonce: CK_BYTE_PTR, + 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) + ) + ); +} +impl Default for CK_SALSA20_CHACHA20_POLY1305_MSG_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_SALSA20_CHACHA20_POLY1305_MSG_PARAMS_PTR = *mut CK_SALSA20_CHACHA20_POLY1305_MSG_PARAMS; +pub type CK_X3DH_KDF_TYPE = CK_ULONG; +pub type CK_X3DH_KDF_TYPE_PTR = *mut CK_X3DH_KDF_TYPE; +#[repr(C, packed)] +#[derive(Debug, Copy, Clone)] +pub struct CK_X3DH_INITIATE_PARAMS { + pub kdf: CK_X3DH_KDF_TYPE, + pub pPeer_identity: CK_OBJECT_HANDLE, + pub pPeer_prekey: CK_OBJECT_HANDLE, + pub pPrekey_signature: CK_BYTE_PTR, + pub pOnetime_key: CK_BYTE_PTR, + 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) + ) + ); +} +impl Default for CK_X3DH_INITIATE_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +#[repr(C, packed)] +#[derive(Debug, Copy, Clone)] +pub struct CK_X3DH_RESPOND_PARAMS { + pub kdf: CK_X3DH_KDF_TYPE, + pub pIdentity_id: CK_BYTE_PTR, + pub pPrekey_id: CK_BYTE_PTR, + pub pOnetime_id: CK_BYTE_PTR, + 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) + ) + ); +} +impl Default for CK_X3DH_RESPOND_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_X2RATCHET_KDF_TYPE = CK_ULONG; +pub type CK_X2RATCHET_KDF_TYPE_PTR = *mut CK_X2RATCHET_KDF_TYPE; +#[repr(C, packed)] +#[derive(Debug, Copy, Clone)] +pub struct CK_X2RATCHET_INITIALIZE_PARAMS { + pub sk: CK_BYTE_PTR, + pub peer_public_prekey: CK_OBJECT_HANDLE, + pub peer_public_identity: CK_OBJECT_HANDLE, + pub own_public_identity: CK_OBJECT_HANDLE, + pub bEncryptedHeader: CK_BBOOL, + pub eCurve: CK_ULONG, + 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) + ) + ); +} +impl Default for CK_X2RATCHET_INITIALIZE_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_X2RATCHET_INITIALIZE_PARAMS_PTR = *mut CK_X2RATCHET_INITIALIZE_PARAMS; +#[repr(C, packed)] +#[derive(Debug, Copy, Clone)] +pub struct CK_X2RATCHET_RESPOND_PARAMS { + pub sk: CK_BYTE_PTR, + pub own_prekey: CK_OBJECT_HANDLE, + pub initiator_identity: CK_OBJECT_HANDLE, + pub own_public_identity: CK_OBJECT_HANDLE, + pub bEncryptedHeader: CK_BBOOL, + pub eCurve: CK_ULONG, + 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) + ) + ); +} +impl Default for CK_X2RATCHET_RESPOND_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_X2RATCHET_RESPOND_PARAMS_PTR = *mut CK_X2RATCHET_RESPOND_PARAMS; +pub type CK_XEDDSA_HASH_TYPE = CK_ULONG; +pub type CK_XEDDSA_HASH_TYPE_PTR = *mut CK_XEDDSA_HASH_TYPE; +#[repr(C, packed)] +#[derive(Debug, Default, Copy, Clone)] +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) + ) + ); +} +pub type CK_XEDDSA_PARAMS_PTR = *mut CK_XEDDSA_PARAMS; +#[repr(C, packed)] +#[derive(Debug, Copy, Clone)] +pub struct CK_HKDF_PARAMS { + pub bExtract: CK_BBOOL, + pub bExpand: CK_BBOOL, + pub prfHashMechanism: CK_MECHANISM_TYPE, + pub ulSaltType: CK_ULONG, + pub pSalt: CK_BYTE_PTR, + pub ulSaltLen: CK_ULONG, + pub hSaltKey: CK_ULONG, + 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) + ) + ); +} +impl Default for CK_HKDF_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} pub type CK_C_Initialize = - ::std::option::Option CK_RV>; + ::std::option::Option CK_RV>; pub type CK_C_Finalize = - ::std::option::Option CK_RV>; -pub type CK_C_GetInfo = ::std::option::Option CK_RV>; -pub type CK_C_GetFunctionList = ::std::option::Option< - unsafe extern "C" fn(function_list: *mut *mut _CK_FUNCTION_LIST) -> CK_RV, ->; + ::std::option::Option CK_RV>; +pub type CK_C_GetInfo = ::std::option::Option CK_RV>; +pub type CK_C_GetFunctionList = + ::std::option::Option CK_RV>; pub type CK_C_GetSlotList = ::std::option::Option< unsafe extern "C" fn( - token_present: ::std::os::raw::c_uchar, - slot_list: *mut CK_SLOT_ID, - ulCount: *mut ::std::os::raw::c_ulong, + tokenPresent: CK_BBOOL, + pSlotList: CK_SLOT_ID_PTR, + pulCount: CK_ULONG_PTR, ) -> CK_RV, >; pub type CK_C_GetSlotInfo = ::std::option::Option< - unsafe extern "C" fn(slotID: CK_SLOT_ID, info: *mut _CK_SLOT_INFO) -> CK_RV, + unsafe extern "C" fn(slotID: CK_SLOT_ID, pInfo: CK_SLOT_INFO_PTR) -> CK_RV, >; pub type CK_C_GetTokenInfo = ::std::option::Option< - unsafe extern "C" fn(slotID: CK_SLOT_ID, info: *mut _CK_TOKEN_INFO) -> CK_RV, ->; -pub type CK_C_WaitForSlotEvent = ::std::option::Option< - unsafe extern "C" fn( - flags: CK_FLAGS, - slot: *mut CK_SLOT_ID, - pReserved: *mut ::std::os::raw::c_void, - ) -> CK_RV, + unsafe extern "C" fn(slotID: CK_SLOT_ID, pInfo: CK_TOKEN_INFO_PTR) -> CK_RV, >; pub type CK_C_GetMechanismList = ::std::option::Option< unsafe extern "C" fn( slotID: CK_SLOT_ID, - mechanism_list: *mut CK_MECHANISM_TYPE, - ulCount: *mut ::std::os::raw::c_ulong, + pMechanismList: CK_MECHANISM_TYPE_PTR, + pulCount: CK_ULONG_PTR, ) -> CK_RV, >; pub type CK_C_GetMechanismInfo = ::std::option::Option< unsafe extern "C" fn( slotID: CK_SLOT_ID, type_: CK_MECHANISM_TYPE, - info: *mut _CK_MECHANISM_INFO, + pInfo: CK_MECHANISM_INFO_PTR, ) -> CK_RV, >; pub type CK_C_InitToken = ::std::option::Option< unsafe extern "C" fn( slotID: CK_SLOT_ID, - pin: *mut ::std::os::raw::c_uchar, - pin_len: ::std::os::raw::c_ulong, - label: *mut ::std::os::raw::c_uchar, + pPin: CK_UTF8CHAR_PTR, + ulPinLen: CK_ULONG, + pLabel: CK_UTF8CHAR_PTR, ) -> CK_RV, >; pub type CK_C_InitPIN = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - pin: *mut ::std::os::raw::c_uchar, - pin_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pPin: CK_UTF8CHAR_PTR, + ulPinLen: CK_ULONG, ) -> CK_RV, >; pub type CK_C_SetPIN = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - old_pin: *mut ::std::os::raw::c_uchar, - old_len: ::std::os::raw::c_ulong, - new_pin: *mut ::std::os::raw::c_uchar, - new_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pOldPin: CK_UTF8CHAR_PTR, + ulOldLen: CK_ULONG, + pNewPin: CK_UTF8CHAR_PTR, + ulNewLen: CK_ULONG, ) -> CK_RV, >; pub type CK_C_OpenSession = ::std::option::Option< unsafe extern "C" fn( slotID: CK_SLOT_ID, flags: CK_FLAGS, - application: *mut ::std::os::raw::c_void, - notify: CK_NOTIFY, - session: *mut CK_SESSION_HANDLE, + pApplication: CK_VOID_PTR, + Notify: CK_NOTIFY, + phSession: CK_SESSION_HANDLE_PTR, ) -> CK_RV, >; pub type CK_C_CloseSession = - ::std::option::Option CK_RV>; + ::std::option::Option CK_RV>; pub type CK_C_CloseAllSessions = ::std::option::Option CK_RV>; pub type CK_C_GetSessionInfo = ::std::option::Option< - unsafe extern "C" fn(session: CK_SESSION_HANDLE, info: *mut _CK_SESSION_INFO) -> CK_RV, + unsafe extern "C" fn(hSession: CK_SESSION_HANDLE, pInfo: CK_SESSION_INFO_PTR) -> CK_RV, >; pub type CK_C_GetOperationState = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - operation_state: *mut ::std::os::raw::c_uchar, - operation_state_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pOperationState: CK_BYTE_PTR, + pulOperationStateLen: CK_ULONG_PTR, ) -> CK_RV, >; pub type CK_C_SetOperationState = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - operation_state: *mut ::std::os::raw::c_uchar, - operation_state_len: ::std::os::raw::c_ulong, - encryption_key: CK_OBJECT_HANDLE, - authentiation_key: CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pOperationState: CK_BYTE_PTR, + ulOperationStateLen: CK_ULONG, + hEncryptionKey: CK_OBJECT_HANDLE, + hAuthenticationKey: CK_OBJECT_HANDLE, ) -> CK_RV, >; pub type CK_C_Login = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - user_type: CK_USER_TYPE, - pin: *mut ::std::os::raw::c_uchar, - pin_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + userType: CK_USER_TYPE, + pPin: CK_UTF8CHAR_PTR, + ulPinLen: CK_ULONG, ) -> CK_RV, >; pub type CK_C_Logout = - ::std::option::Option CK_RV>; + ::std::option::Option CK_RV>; pub type CK_C_CreateObject = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - templ: *mut _CK_ATTRIBUTE, - ulCount: ::std::os::raw::c_ulong, - object: *mut CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pTemplate: CK_ATTRIBUTE_PTR, + ulCount: CK_ULONG, + phObject: CK_OBJECT_HANDLE_PTR, ) -> CK_RV, >; pub type CK_C_CopyObject = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - object: CK_OBJECT_HANDLE, - templ: *mut _CK_ATTRIBUTE, - ulCount: ::std::os::raw::c_ulong, - new_object: *mut CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + hObject: CK_OBJECT_HANDLE, + pTemplate: CK_ATTRIBUTE_PTR, + ulCount: CK_ULONG, + phNewObject: CK_OBJECT_HANDLE_PTR, ) -> CK_RV, >; pub type CK_C_DestroyObject = ::std::option::Option< - unsafe extern "C" fn(session: CK_SESSION_HANDLE, object: CK_OBJECT_HANDLE) -> CK_RV, + unsafe extern "C" fn(hSession: CK_SESSION_HANDLE, hObject: CK_OBJECT_HANDLE) -> CK_RV, >; pub type CK_C_GetObjectSize = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - object: CK_OBJECT_HANDLE, - size: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + hObject: CK_OBJECT_HANDLE, + pulSize: CK_ULONG_PTR, ) -> CK_RV, >; pub type CK_C_GetAttributeValue = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - object: CK_OBJECT_HANDLE, - templ: *mut _CK_ATTRIBUTE, - ulCount: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + hObject: CK_OBJECT_HANDLE, + pTemplate: CK_ATTRIBUTE_PTR, + ulCount: CK_ULONG, ) -> CK_RV, >; pub type CK_C_SetAttributeValue = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - object: CK_OBJECT_HANDLE, - templ: *mut _CK_ATTRIBUTE, - ulCount: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + hObject: CK_OBJECT_HANDLE, + pTemplate: CK_ATTRIBUTE_PTR, + ulCount: CK_ULONG, ) -> CK_RV, >; pub type CK_C_FindObjectsInit = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - templ: *mut _CK_ATTRIBUTE, - ulCount: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pTemplate: CK_ATTRIBUTE_PTR, + ulCount: CK_ULONG, ) -> CK_RV, >; pub type CK_C_FindObjects = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - object: *mut CK_OBJECT_HANDLE, - max_object_count: ::std::os::raw::c_ulong, - object_count: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + phObject: CK_OBJECT_HANDLE_PTR, + ulMaxObjectCount: CK_ULONG, + pulObjectCount: CK_ULONG_PTR, ) -> CK_RV, >; pub type CK_C_FindObjectsFinal = - ::std::option::Option CK_RV>; + ::std::option::Option CK_RV>; pub type CK_C_EncryptInit = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - key: CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, ) -> CK_RV, >; pub type CK_C_Encrypt = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - data: *mut ::std::os::raw::c_uchar, - data_len: ::std::os::raw::c_ulong, - encrypted_data: *mut ::std::os::raw::c_uchar, - encrypted_data_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pEncryptedData: CK_BYTE_PTR, + pulEncryptedDataLen: CK_ULONG_PTR, ) -> CK_RV, >; pub type CK_C_EncryptUpdate = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - part: *mut ::std::os::raw::c_uchar, - part_len: ::std::os::raw::c_ulong, - encrypted_part: *mut ::std::os::raw::c_uchar, - encrypted_part_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pPart: CK_BYTE_PTR, + ulPartLen: CK_ULONG, + pEncryptedPart: CK_BYTE_PTR, + pulEncryptedPartLen: CK_ULONG_PTR, ) -> CK_RV, >; pub type CK_C_EncryptFinal = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - last_encrypted_part: *mut ::std::os::raw::c_uchar, - last_encrypted_part_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pLastEncryptedPart: CK_BYTE_PTR, + pulLastEncryptedPartLen: CK_ULONG_PTR, ) -> CK_RV, >; pub type CK_C_DecryptInit = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - key: CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, ) -> CK_RV, >; pub type CK_C_Decrypt = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - encrypted_data: *mut ::std::os::raw::c_uchar, - encrypted_data_len: ::std::os::raw::c_ulong, - data: *mut ::std::os::raw::c_uchar, - data_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pEncryptedData: CK_BYTE_PTR, + ulEncryptedDataLen: CK_ULONG, + pData: CK_BYTE_PTR, + pulDataLen: CK_ULONG_PTR, ) -> CK_RV, >; pub type CK_C_DecryptUpdate = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - encrypted_part: *mut ::std::os::raw::c_uchar, - encrypted_part_len: ::std::os::raw::c_ulong, - part: *mut ::std::os::raw::c_uchar, - part_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pEncryptedPart: CK_BYTE_PTR, + ulEncryptedPartLen: CK_ULONG, + pPart: CK_BYTE_PTR, + pulPartLen: CK_ULONG_PTR, ) -> CK_RV, >; pub type CK_C_DecryptFinal = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - last_part: *mut ::std::os::raw::c_uchar, - last_part_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pLastPart: CK_BYTE_PTR, + pulLastPartLen: CK_ULONG_PTR, ) -> CK_RV, >; pub type CK_C_DigestInit = ::std::option::Option< - unsafe extern "C" fn(session: CK_SESSION_HANDLE, mechanism: *mut _CK_MECHANISM) -> CK_RV, + unsafe extern "C" fn(hSession: CK_SESSION_HANDLE, pMechanism: CK_MECHANISM_PTR) -> CK_RV, >; pub type CK_C_Digest = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - data: *mut ::std::os::raw::c_uchar, - data_len: ::std::os::raw::c_ulong, - digest: *mut ::std::os::raw::c_uchar, - digest_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pDigest: CK_BYTE_PTR, + pulDigestLen: CK_ULONG_PTR, ) -> CK_RV, >; pub type CK_C_DigestUpdate = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - part: *mut ::std::os::raw::c_uchar, - part_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pPart: CK_BYTE_PTR, + ulPartLen: CK_ULONG, ) -> CK_RV, >; pub type CK_C_DigestKey = ::std::option::Option< - unsafe extern "C" fn(session: CK_SESSION_HANDLE, key: CK_OBJECT_HANDLE) -> CK_RV, + unsafe extern "C" fn(hSession: CK_SESSION_HANDLE, hKey: CK_OBJECT_HANDLE) -> CK_RV, >; pub type CK_C_DigestFinal = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - digest: *mut ::std::os::raw::c_uchar, - digest_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pDigest: CK_BYTE_PTR, + pulDigestLen: CK_ULONG_PTR, ) -> CK_RV, >; pub type CK_C_SignInit = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - key: CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, ) -> CK_RV, >; pub type CK_C_Sign = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - data: *mut ::std::os::raw::c_uchar, - data_len: ::std::os::raw::c_ulong, - signature: *mut ::std::os::raw::c_uchar, - signature_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + pulSignatureLen: CK_ULONG_PTR, ) -> CK_RV, >; pub type CK_C_SignUpdate = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - part: *mut ::std::os::raw::c_uchar, - part_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pPart: CK_BYTE_PTR, + ulPartLen: CK_ULONG, ) -> CK_RV, >; pub type CK_C_SignFinal = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - signature: *mut ::std::os::raw::c_uchar, - signature_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pSignature: CK_BYTE_PTR, + pulSignatureLen: CK_ULONG_PTR, ) -> CK_RV, >; pub type CK_C_SignRecoverInit = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - key: CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, ) -> CK_RV, >; pub type CK_C_SignRecover = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - data: *mut ::std::os::raw::c_uchar, - data_len: ::std::os::raw::c_ulong, - signature: *mut ::std::os::raw::c_uchar, - signature_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + pulSignatureLen: CK_ULONG_PTR, ) -> CK_RV, >; pub type CK_C_VerifyInit = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - key: CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, ) -> CK_RV, >; pub type CK_C_Verify = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - data: *mut ::std::os::raw::c_uchar, - data_len: ::std::os::raw::c_ulong, - signature: *mut ::std::os::raw::c_uchar, - signature_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + ulSignatureLen: CK_ULONG, ) -> CK_RV, >; pub type CK_C_VerifyUpdate = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - part: *mut ::std::os::raw::c_uchar, - part_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pPart: CK_BYTE_PTR, + ulPartLen: CK_ULONG, ) -> CK_RV, >; pub type CK_C_VerifyFinal = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - signature: *mut ::std::os::raw::c_uchar, - signature_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pSignature: CK_BYTE_PTR, + ulSignatureLen: CK_ULONG, ) -> CK_RV, >; pub type CK_C_VerifyRecoverInit = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - key: CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, ) -> CK_RV, >; pub type CK_C_VerifyRecover = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - signature: *mut ::std::os::raw::c_uchar, - signature_len: ::std::os::raw::c_ulong, - data: *mut ::std::os::raw::c_uchar, - data_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pSignature: CK_BYTE_PTR, + ulSignatureLen: CK_ULONG, + pData: CK_BYTE_PTR, + pulDataLen: CK_ULONG_PTR, ) -> CK_RV, >; pub type CK_C_DigestEncryptUpdate = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - part: *mut ::std::os::raw::c_uchar, - part_len: ::std::os::raw::c_ulong, - encrypted_part: *mut ::std::os::raw::c_uchar, - encrypted_part_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pPart: CK_BYTE_PTR, + ulPartLen: CK_ULONG, + pEncryptedPart: CK_BYTE_PTR, + pulEncryptedPartLen: CK_ULONG_PTR, ) -> CK_RV, >; pub type CK_C_DecryptDigestUpdate = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - encrypted_part: *mut ::std::os::raw::c_uchar, - encrypted_part_len: ::std::os::raw::c_ulong, - part: *mut ::std::os::raw::c_uchar, - part_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pEncryptedPart: CK_BYTE_PTR, + ulEncryptedPartLen: CK_ULONG, + pPart: CK_BYTE_PTR, + pulPartLen: CK_ULONG_PTR, ) -> CK_RV, >; pub type CK_C_SignEncryptUpdate = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - part: *mut ::std::os::raw::c_uchar, - part_len: ::std::os::raw::c_ulong, - encrypted_part: *mut ::std::os::raw::c_uchar, - encrypted_part_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pPart: CK_BYTE_PTR, + ulPartLen: CK_ULONG, + pEncryptedPart: CK_BYTE_PTR, + pulEncryptedPartLen: CK_ULONG_PTR, ) -> CK_RV, >; pub type CK_C_DecryptVerifyUpdate = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - encrypted_part: *mut ::std::os::raw::c_uchar, - encrypted_part_len: ::std::os::raw::c_ulong, - part: *mut ::std::os::raw::c_uchar, - part_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pEncryptedPart: CK_BYTE_PTR, + ulEncryptedPartLen: CK_ULONG, + pPart: CK_BYTE_PTR, + pulPartLen: CK_ULONG_PTR, ) -> CK_RV, >; pub type CK_C_GenerateKey = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - templ: *mut _CK_ATTRIBUTE, - ulCount: ::std::os::raw::c_ulong, - key: *mut CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + pTemplate: CK_ATTRIBUTE_PTR, + ulCount: CK_ULONG, + phKey: CK_OBJECT_HANDLE_PTR, ) -> CK_RV, >; pub type CK_C_GenerateKeyPair = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - public_key_template: *mut _CK_ATTRIBUTE, - public_key_attribute_count: ::std::os::raw::c_ulong, - private_key_template: *mut _CK_ATTRIBUTE, - private_key_attribute_count: ::std::os::raw::c_ulong, - public_key: *mut CK_OBJECT_HANDLE, - private_key: *mut CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + pPublicKeyTemplate: CK_ATTRIBUTE_PTR, + ulPublicKeyAttributeCount: CK_ULONG, + pPrivateKeyTemplate: CK_ATTRIBUTE_PTR, + ulPrivateKeyAttributeCount: CK_ULONG, + phPublicKey: CK_OBJECT_HANDLE_PTR, + phPrivateKey: CK_OBJECT_HANDLE_PTR, ) -> CK_RV, >; pub type CK_C_WrapKey = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - wrapping_key: CK_OBJECT_HANDLE, - key: CK_OBJECT_HANDLE, - wrapped_key: *mut ::std::os::raw::c_uchar, - wrapped_key_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hWrappingKey: CK_OBJECT_HANDLE, + hKey: CK_OBJECT_HANDLE, + pWrappedKey: CK_BYTE_PTR, + pulWrappedKeyLen: CK_ULONG_PTR, ) -> CK_RV, >; pub type CK_C_UnwrapKey = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - unwrapping_key: CK_OBJECT_HANDLE, - wrapped_key: *mut ::std::os::raw::c_uchar, - wrapped_key_len: ::std::os::raw::c_ulong, - templ: *mut _CK_ATTRIBUTE, - attribute_count: ::std::os::raw::c_ulong, - key: *mut CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hUnwrappingKey: CK_OBJECT_HANDLE, + pWrappedKey: CK_BYTE_PTR, + ulWrappedKeyLen: CK_ULONG, + pTemplate: CK_ATTRIBUTE_PTR, + ulAttributeCount: CK_ULONG, + phKey: CK_OBJECT_HANDLE_PTR, ) -> CK_RV, >; pub type CK_C_DeriveKey = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - base_key: CK_OBJECT_HANDLE, - templ: *mut _CK_ATTRIBUTE, - attribute_count: ::std::os::raw::c_ulong, - key: *mut CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hBaseKey: CK_OBJECT_HANDLE, + pTemplate: CK_ATTRIBUTE_PTR, + ulAttributeCount: CK_ULONG, + phKey: CK_OBJECT_HANDLE_PTR, ) -> CK_RV, >; pub type CK_C_SeedRandom = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - seed: *mut ::std::os::raw::c_uchar, - seed_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pSeed: CK_BYTE_PTR, + ulSeedLen: CK_ULONG, ) -> CK_RV, >; pub type CK_C_GenerateRandom = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - random_data: *mut ::std::os::raw::c_uchar, - random_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + RandomData: CK_BYTE_PTR, + ulRandomLen: CK_ULONG, ) -> CK_RV, >; pub type CK_C_GetFunctionStatus = - ::std::option::Option CK_RV>; + ::std::option::Option CK_RV>; pub type CK_C_CancelFunction = - ::std::option::Option CK_RV>; + ::std::option::Option CK_RV>; +pub type CK_C_WaitForSlotEvent = ::std::option::Option< + unsafe extern "C" fn(flags: CK_FLAGS, pSlot: CK_SLOT_ID_PTR, pRserved: CK_VOID_PTR) -> CK_RV, +>; +pub type CK_C_GetInterfaceList = ::std::option::Option< + unsafe extern "C" fn(pInterfacesList: CK_INTERFACE_PTR, pulCount: CK_ULONG_PTR) -> CK_RV, +>; +pub type CK_C_GetInterface = ::std::option::Option< + unsafe extern "C" fn( + pInterfaceName: CK_UTF8CHAR_PTR, + pVersion: CK_VERSION_PTR, + ppInterface: CK_INTERFACE_PTR_PTR, + flags: CK_FLAGS, + ) -> CK_RV, +>; +pub type CK_C_LoginUser = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + userType: CK_USER_TYPE, + pPin: CK_UTF8CHAR_PTR, + ulPinLen: CK_ULONG, + pUsername: CK_UTF8CHAR_PTR, + ulUsernameLen: CK_ULONG, + ) -> CK_RV, +>; +pub type CK_C_SessionCancel = ::std::option::Option< + unsafe extern "C" fn(hSession: CK_SESSION_HANDLE, flags: CK_FLAGS) -> CK_RV, +>; +pub type CK_C_MessageEncryptInit = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, + ) -> CK_RV, +>; +pub type CK_C_EncryptMessage = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pAssociatedData: CK_BYTE_PTR, + ulAssociatedDataLen: CK_ULONG, + pPlaintext: CK_BYTE_PTR, + ulPlaintextLen: CK_ULONG, + pCiphertext: CK_BYTE_PTR, + pulCiphertextLen: CK_ULONG_PTR, + ) -> CK_RV, +>; +pub type CK_C_EncryptMessageBegin = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pAssociatedData: CK_BYTE_PTR, + ulAssociatedDataLen: CK_ULONG, + ) -> CK_RV, +>; +pub type CK_C_EncryptMessageNext = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pPlaintextPart: CK_BYTE_PTR, + ulPlaintextPartLen: CK_ULONG, + pCiphertextPart: CK_BYTE_PTR, + pulCiphertextPartLen: CK_ULONG_PTR, + flags: CK_FLAGS, + ) -> CK_RV, +>; +pub type CK_C_MessageEncryptFinal = + ::std::option::Option CK_RV>; +pub type CK_C_MessageDecryptInit = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, + ) -> CK_RV, +>; +pub type CK_C_DecryptMessage = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pAssociatedData: CK_BYTE_PTR, + ulAssociatedDataLen: CK_ULONG, + pCiphertext: CK_BYTE_PTR, + ulCiphertextLen: CK_ULONG, + pPlaintext: CK_BYTE_PTR, + pulPlaintextLen: CK_ULONG_PTR, + ) -> CK_RV, +>; +pub type CK_C_DecryptMessageBegin = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pAssociatedData: CK_BYTE_PTR, + ulAssociatedDataLen: CK_ULONG, + ) -> CK_RV, +>; +pub type CK_C_DecryptMessageNext = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pCiphertext: CK_BYTE_PTR, + ulCiphertextLen: CK_ULONG, + pPlaintext: CK_BYTE_PTR, + pulPlaintextLen: CK_ULONG_PTR, + flags: CK_FLAGS, + ) -> CK_RV, +>; +pub type CK_C_MessageDecryptFinal = + ::std::option::Option CK_RV>; +pub type CK_C_MessageSignInit = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, + ) -> CK_RV, +>; +pub type CK_C_SignMessage = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + pulSignatureLen: CK_ULONG_PTR, + ) -> CK_RV, +>; +pub type CK_C_SignMessageBegin = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + ) -> CK_RV, +>; +pub type CK_C_SignMessageNext = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + pulSignatureLen: CK_ULONG_PTR, + ) -> CK_RV, +>; +pub type CK_C_MessageSignFinal = + ::std::option::Option CK_RV>; +pub type CK_C_MessageVerifyInit = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, + ) -> CK_RV, +>; +pub type CK_C_VerifyMessage = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + ulSignatureLen: CK_ULONG, + ) -> CK_RV, +>; +pub type CK_C_VerifyMessageBegin = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + ) -> CK_RV, +>; +pub type CK_C_VerifyMessageNext = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + ulSignatureLen: CK_ULONG, + ) -> CK_RV, +>; +pub type CK_C_MessageVerifyFinal = + ::std::option::Option CK_RV>; +#[repr(C, packed)] +#[derive(Debug, Default, Copy, Clone)] +pub struct CK_FUNCTION_LIST_3_0 { + pub version: CK_VERSION, + pub C_Initialize: CK_C_Initialize, + pub C_Finalize: CK_C_Finalize, + pub C_GetInfo: CK_C_GetInfo, + pub C_GetFunctionList: CK_C_GetFunctionList, + pub C_GetSlotList: CK_C_GetSlotList, + pub C_GetSlotInfo: CK_C_GetSlotInfo, + pub C_GetTokenInfo: CK_C_GetTokenInfo, + pub C_GetMechanismList: CK_C_GetMechanismList, + pub C_GetMechanismInfo: CK_C_GetMechanismInfo, + pub C_InitToken: CK_C_InitToken, + pub C_InitPIN: CK_C_InitPIN, + pub C_SetPIN: CK_C_SetPIN, + pub C_OpenSession: CK_C_OpenSession, + pub C_CloseSession: CK_C_CloseSession, + pub C_CloseAllSessions: CK_C_CloseAllSessions, + pub C_GetSessionInfo: CK_C_GetSessionInfo, + pub C_GetOperationState: CK_C_GetOperationState, + pub C_SetOperationState: CK_C_SetOperationState, + pub C_Login: CK_C_Login, + pub C_Logout: CK_C_Logout, + pub C_CreateObject: CK_C_CreateObject, + pub C_CopyObject: CK_C_CopyObject, + pub C_DestroyObject: CK_C_DestroyObject, + pub C_GetObjectSize: CK_C_GetObjectSize, + pub C_GetAttributeValue: CK_C_GetAttributeValue, + pub C_SetAttributeValue: CK_C_SetAttributeValue, + pub C_FindObjectsInit: CK_C_FindObjectsInit, + pub C_FindObjects: CK_C_FindObjects, + pub C_FindObjectsFinal: CK_C_FindObjectsFinal, + pub C_EncryptInit: CK_C_EncryptInit, + pub C_Encrypt: CK_C_Encrypt, + pub C_EncryptUpdate: CK_C_EncryptUpdate, + pub C_EncryptFinal: CK_C_EncryptFinal, + pub C_DecryptInit: CK_C_DecryptInit, + pub C_Decrypt: CK_C_Decrypt, + pub C_DecryptUpdate: CK_C_DecryptUpdate, + pub C_DecryptFinal: CK_C_DecryptFinal, + pub C_DigestInit: CK_C_DigestInit, + pub C_Digest: CK_C_Digest, + pub C_DigestUpdate: CK_C_DigestUpdate, + pub C_DigestKey: CK_C_DigestKey, + pub C_DigestFinal: CK_C_DigestFinal, + pub C_SignInit: CK_C_SignInit, + pub C_Sign: CK_C_Sign, + pub C_SignUpdate: CK_C_SignUpdate, + pub C_SignFinal: CK_C_SignFinal, + pub C_SignRecoverInit: CK_C_SignRecoverInit, + pub C_SignRecover: CK_C_SignRecover, + pub C_VerifyInit: CK_C_VerifyInit, + pub C_Verify: CK_C_Verify, + pub C_VerifyUpdate: CK_C_VerifyUpdate, + pub C_VerifyFinal: CK_C_VerifyFinal, + pub C_VerifyRecoverInit: CK_C_VerifyRecoverInit, + pub C_VerifyRecover: CK_C_VerifyRecover, + pub C_DigestEncryptUpdate: CK_C_DigestEncryptUpdate, + pub C_DecryptDigestUpdate: CK_C_DecryptDigestUpdate, + pub C_SignEncryptUpdate: CK_C_SignEncryptUpdate, + pub C_DecryptVerifyUpdate: CK_C_DecryptVerifyUpdate, + pub C_GenerateKey: CK_C_GenerateKey, + pub C_GenerateKeyPair: CK_C_GenerateKeyPair, + pub C_WrapKey: CK_C_WrapKey, + pub C_UnwrapKey: CK_C_UnwrapKey, + pub C_DeriveKey: CK_C_DeriveKey, + pub C_SeedRandom: CK_C_SeedRandom, + pub C_GenerateRandom: CK_C_GenerateRandom, + pub C_GetFunctionStatus: CK_C_GetFunctionStatus, + pub C_CancelFunction: CK_C_CancelFunction, + pub C_WaitForSlotEvent: CK_C_WaitForSlotEvent, + pub C_GetInterfaceList: CK_C_GetInterfaceList, + pub C_GetInterface: CK_C_GetInterface, + pub C_LoginUser: CK_C_LoginUser, + pub C_SessionCancel: CK_C_SessionCancel, + pub C_MessageEncryptInit: CK_C_MessageEncryptInit, + pub C_EncryptMessage: CK_C_EncryptMessage, + pub C_EncryptMessageBegin: CK_C_EncryptMessageBegin, + pub C_EncryptMessageNext: CK_C_EncryptMessageNext, + pub C_MessageEncryptFinal: CK_C_MessageEncryptFinal, + pub C_MessageDecryptInit: CK_C_MessageDecryptInit, + pub C_DecryptMessage: CK_C_DecryptMessage, + pub C_DecryptMessageBegin: CK_C_DecryptMessageBegin, + pub C_DecryptMessageNext: CK_C_DecryptMessageNext, + pub C_MessageDecryptFinal: CK_C_MessageDecryptFinal, + pub C_MessageSignInit: CK_C_MessageSignInit, + pub C_SignMessage: CK_C_SignMessage, + pub C_SignMessageBegin: CK_C_SignMessageBegin, + pub C_SignMessageNext: CK_C_SignMessageNext, + pub C_MessageSignFinal: CK_C_MessageSignFinal, + pub C_MessageVerifyInit: CK_C_MessageVerifyInit, + pub C_VerifyMessage: CK_C_VerifyMessage, + pub C_VerifyMessageBegin: CK_C_VerifyMessageBegin, + 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) + ) + ); +} #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone)] -pub struct _CK_FUNCTION_LIST { - pub version: _CK_VERSION, +pub struct CK_FUNCTION_LIST { + pub version: CK_VERSION, pub C_Initialize: CK_C_Initialize, pub C_Finalize: CK_C_Finalize, pub C_GetInfo: CK_C_GetInfo, @@ -2647,25 +9810,25 @@ pub struct _CK_FUNCTION_LIST { pub C_WaitForSlotEvent: CK_C_WaitForSlotEvent, } #[test] -fn bindgen_test_layout__CK_FUNCTION_LIST() { - const UNINIT: ::std::mem::MaybeUninit<_CK_FUNCTION_LIST> = ::std::mem::MaybeUninit::uninit(); +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::<_CK_FUNCTION_LIST>(), + ::std::mem::size_of::(), 546usize, - concat!("Size of: ", stringify!(_CK_FUNCTION_LIST)) + concat!("Size of: ", stringify!(CK_FUNCTION_LIST)) ); assert_eq!( - ::std::mem::align_of::<_CK_FUNCTION_LIST>(), + ::std::mem::align_of::(), 1usize, - concat!("Alignment of ", stringify!(_CK_FUNCTION_LIST)) + 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!(CK_FUNCTION_LIST), "::", stringify!(version) ) @@ -2675,7 +9838,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 2usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_Initialize) ) @@ -2685,7 +9848,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 10usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_Finalize) ) @@ -2695,7 +9858,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 18usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_GetInfo) ) @@ -2705,7 +9868,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 26usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_GetFunctionList) ) @@ -2715,7 +9878,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 34usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_GetSlotList) ) @@ -2725,7 +9888,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 42usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_GetSlotInfo) ) @@ -2735,7 +9898,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 50usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_GetTokenInfo) ) @@ -2745,7 +9908,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 58usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_GetMechanismList) ) @@ -2755,7 +9918,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 66usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_GetMechanismInfo) ) @@ -2765,7 +9928,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 74usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_InitToken) ) @@ -2775,7 +9938,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 82usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_InitPIN) ) @@ -2785,7 +9948,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 90usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_SetPIN) ) @@ -2795,7 +9958,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 98usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_OpenSession) ) @@ -2805,7 +9968,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 106usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_CloseSession) ) @@ -2815,7 +9978,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 114usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_CloseAllSessions) ) @@ -2825,7 +9988,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 122usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_GetSessionInfo) ) @@ -2835,7 +9998,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 130usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_GetOperationState) ) @@ -2845,7 +10008,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 138usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_SetOperationState) ) @@ -2855,7 +10018,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 146usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_Login) ) @@ -2865,7 +10028,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 154usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_Logout) ) @@ -2875,7 +10038,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 162usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_CreateObject) ) @@ -2885,7 +10048,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 170usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_CopyObject) ) @@ -2895,7 +10058,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 178usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_DestroyObject) ) @@ -2905,7 +10068,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 186usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_GetObjectSize) ) @@ -2915,7 +10078,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 194usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_GetAttributeValue) ) @@ -2925,7 +10088,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 202usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_SetAttributeValue) ) @@ -2935,7 +10098,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 210usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_FindObjectsInit) ) @@ -2945,7 +10108,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 218usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_FindObjects) ) @@ -2955,7 +10118,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 226usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_FindObjectsFinal) ) @@ -2965,7 +10128,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 234usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_EncryptInit) ) @@ -2975,7 +10138,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 242usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_Encrypt) ) @@ -2985,7 +10148,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 250usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_EncryptUpdate) ) @@ -2995,7 +10158,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 258usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_EncryptFinal) ) @@ -3005,7 +10168,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 266usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_DecryptInit) ) @@ -3015,7 +10178,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 274usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_Decrypt) ) @@ -3025,7 +10188,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 282usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_DecryptUpdate) ) @@ -3035,7 +10198,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 290usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_DecryptFinal) ) @@ -3045,7 +10208,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 298usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_DigestInit) ) @@ -3055,7 +10218,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 306usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_Digest) ) @@ -3065,7 +10228,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 314usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_DigestUpdate) ) @@ -3075,7 +10238,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 322usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_DigestKey) ) @@ -3085,7 +10248,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 330usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_DigestFinal) ) @@ -3095,7 +10258,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 338usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_SignInit) ) @@ -3105,7 +10268,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 346usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_Sign) ) @@ -3115,7 +10278,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 354usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_SignUpdate) ) @@ -3125,7 +10288,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 362usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_SignFinal) ) @@ -3135,7 +10298,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 370usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_SignRecoverInit) ) @@ -3145,7 +10308,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 378usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_SignRecover) ) @@ -3155,7 +10318,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 386usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_VerifyInit) ) @@ -3165,7 +10328,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 394usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_Verify) ) @@ -3175,7 +10338,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 402usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_VerifyUpdate) ) @@ -3185,7 +10348,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 410usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_VerifyFinal) ) @@ -3195,7 +10358,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 418usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_VerifyRecoverInit) ) @@ -3205,7 +10368,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 426usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_VerifyRecover) ) @@ -3215,7 +10378,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 434usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_DigestEncryptUpdate) ) @@ -3225,7 +10388,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 442usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_DecryptDigestUpdate) ) @@ -3235,7 +10398,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 450usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_SignEncryptUpdate) ) @@ -3245,7 +10408,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 458usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_DecryptVerifyUpdate) ) @@ -3255,7 +10418,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 466usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_GenerateKey) ) @@ -3265,7 +10428,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 474usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_GenerateKeyPair) ) @@ -3275,7 +10438,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 482usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_WrapKey) ) @@ -3285,7 +10448,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 490usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_UnwrapKey) ) @@ -3295,7 +10458,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 498usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_DeriveKey) ) @@ -3305,7 +10468,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 506usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_SeedRandom) ) @@ -3315,7 +10478,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 514usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_GenerateRandom) ) @@ -3325,7 +10488,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 522usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_GetFunctionStatus) ) @@ -3335,7 +10498,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 530usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_CancelFunction) ) @@ -3345,223 +10508,45 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 538usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), - "::", - stringify!(C_WaitForSlotEvent) - ) - ); -} -pub type CK_CREATEMUTEX = - ::std::option::Option CK_RV>; -pub type CK_DESTROYMUTEX = - ::std::option::Option CK_RV>; -pub type CK_LOCKMUTEX = - ::std::option::Option CK_RV>; -pub type CK_UNLOCKMUTEX = - ::std::option::Option CK_RV>; -#[repr(C, packed)] -#[derive(Debug, Copy, Clone)] -pub struct _CK_C_INITIALIZE_ARGS { - pub CreateMutex: CK_CREATEMUTEX, - pub DestroyMutex: CK_DESTROYMUTEX, - pub LockMutex: CK_LOCKMUTEX, - pub UnlockMutex: CK_UNLOCKMUTEX, - pub flags: CK_FLAGS, - pub pReserved: *mut ::std::os::raw::c_void, -} -#[test] -fn bindgen_test_layout__CK_C_INITIALIZE_ARGS() { - const UNINIT: ::std::mem::MaybeUninit<_CK_C_INITIALIZE_ARGS> = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<_CK_C_INITIALIZE_ARGS>(), - 44usize, - concat!("Size of: ", stringify!(_CK_C_INITIALIZE_ARGS)) - ); - assert_eq!( - ::std::mem::align_of::<_CK_C_INITIALIZE_ARGS>(), - 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!(CK_FUNCTION_LIST), "::", - stringify!(pReserved) - ) - ); -} -impl Default for _CK_C_INITIALIZE_ARGS { - fn default() -> Self { - let mut s = ::std::mem::MaybeUninit::::uninit(); - unsafe { - ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -pub type CK_BYTE = ::std::os::raw::c_uchar; -pub type CK_CHAR = ::std::os::raw::c_uchar; -pub type CK_UTF8CHAR = ::std::os::raw::c_uchar; -pub type CK_BBOOL = ::std::os::raw::c_uchar; -pub type CK_ULONG = ::std::os::raw::c_ulong; -pub type CK_LONG = ::std::os::raw::c_long; -pub type CK_BYTE_PTR = *mut CK_BYTE; -pub type CK_CHAR_PTR = *mut CK_CHAR; -pub type CK_UTF8CHAR_PTR = *mut CK_UTF8CHAR; -pub type CK_ULONG_PTR = *mut CK_ULONG; -pub type CK_VOID_PTR = *mut ::std::os::raw::c_void; -pub type CK_VOID_PTR_PTR = *mut *mut ::std::os::raw::c_void; -pub type CK_VERSION = _CK_VERSION; -pub type CK_VERSION_PTR = *mut _CK_VERSION; -pub type CK_INFO = _CK_INFO; -pub type CK_INFO_PTR = *mut _CK_INFO; -pub type CK_SLOT_ID_PTR = *mut CK_SLOT_ID; -pub type CK_SLOT_INFO = _CK_SLOT_INFO; -pub type CK_SLOT_INFO_PTR = *mut _CK_SLOT_INFO; -pub type CK_TOKEN_INFO = _CK_TOKEN_INFO; -pub type CK_TOKEN_INFO_PTR = *mut _CK_TOKEN_INFO; -pub type CK_SESSION_HANDLE_PTR = *mut CK_SESSION_HANDLE; -pub type CK_SESSION_INFO = _CK_SESSION_INFO; -pub type CK_SESSION_INFO_PTR = *mut _CK_SESSION_INFO; -pub type CK_OBJECT_HANDLE_PTR = *mut CK_OBJECT_HANDLE; -pub type CK_OBJECT_CLASS_PTR = *mut CK_OBJECT_CLASS; -pub type CK_ATTRIBUTE = _CK_ATTRIBUTE; -pub type CK_ATTRIBUTE_PTR = *mut _CK_ATTRIBUTE; -pub type CK_DATE = _CK_DATE; -pub type CK_DATE_PTR = *mut _CK_DATE; -pub type CK_MECHANISM_TYPE_PTR = *mut CK_MECHANISM_TYPE; -pub type CK_MECHANISM = _CK_MECHANISM; -pub type CK_MECHANISM_PTR = *mut _CK_MECHANISM; -pub type CK_MECHANISM_INFO = _CK_MECHANISM_INFO; -pub type CK_MECHANISM_INFO_PTR = *mut _CK_MECHANISM_INFO; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct ck_otp_mechanism_info { - _unused: [u8; 0], -} -pub type CK_OTP_MECHANISM_INFO = ck_otp_mechanism_info; -pub type CK_OTP_MECHANISM_INFO_PTR = *mut ck_otp_mechanism_info; -pub type CK_FUNCTION_LIST = _CK_FUNCTION_LIST; -pub type CK_FUNCTION_LIST_PTR = *mut _CK_FUNCTION_LIST; -pub type CK_FUNCTION_LIST_PTR_PTR = *mut *mut _CK_FUNCTION_LIST; -pub type CK_C_INITIALIZE_ARGS = _CK_C_INITIALIZE_ARGS; -pub type CK_C_INITIALIZE_ARGS_PTR = *mut _CK_C_INITIALIZE_ARGS; -pub type CK_RSA_PKCS_PSS_PARAMS = ck_rsa_pkcs_pss_params; -pub type CK_RSA_PKCS_PSS_PARAMS_PTR = *mut ck_rsa_pkcs_pss_params; -pub type CK_RSA_PKCS_OAEP_PARAMS = ck_rsa_pkcs_oaep_params; -pub type CK_RSA_PKCS_OAEP_PARAMS_PTR = *mut ck_rsa_pkcs_oaep_params; -pub type CK_AES_CTR_PARAMS = ck_aes_ctr_params; -pub type CK_AES_CTR_PARAMS_PTR = *mut ck_aes_ctr_params; -pub type CK_GCM_PARAMS = ck_gcm_params; -pub type CK_GCM_PARAMS_PTR = *mut ck_gcm_params; -pub type CK_ECDH1_DERIVE_PARAMS = ck_ecdh1_derive_params; -pub type CK_ECDH1_DERIVE_PARAMS_PTR = *mut ck_ecdh1_derive_params; -pub type CK_KEY_DERIVATION_STRING_DATA = ck_key_derivation_string_data; -pub type CK_KEY_DERIVATION_STRING_DATA_PTR = *mut ck_key_derivation_string_data; -pub type CK_DES_CBC_ENCRYPT_DATA_PARAMS = ck_des_cbc_encrypt_data_params; -pub type CK_DES_CBC_ENCRYPT_DATA_PARAMS_PTR = *mut ck_des_cbc_encrypt_data_params; -pub type CK_AES_CBC_ENCRYPT_DATA_PARAMS = ck_aes_cbc_encrypt_data_params; -pub type CK_AES_CBC_ENCRYPT_DATA_PARAMS_PTR = *mut ck_aes_cbc_encrypt_data_params; + stringify!(C_WaitForSlotEvent) + ) + ); +} extern crate libloading; pub struct Pkcs11 { __library: ::libloading::Library, - pub C_Initialize: Result< - unsafe extern "C" fn(init_args: *mut ::std::os::raw::c_void) -> CK_RV, - ::libloading::Error, - >, - pub C_Finalize: Result< - unsafe extern "C" fn(pReserved: *mut ::std::os::raw::c_void) -> CK_RV, - ::libloading::Error, - >, - pub C_GetInfo: Result CK_RV, ::libloading::Error>, + pub C_Initialize: + Result CK_RV, ::libloading::Error>, + pub C_Finalize: + Result CK_RV, ::libloading::Error>, + pub C_GetInfo: Result CK_RV, ::libloading::Error>, pub C_GetFunctionList: Result< - unsafe extern "C" fn(function_list: *mut *mut _CK_FUNCTION_LIST) -> CK_RV, + unsafe extern "C" fn(ppFunctionList: CK_FUNCTION_LIST_PTR_PTR) -> CK_RV, ::libloading::Error, >, pub C_GetSlotList: Result< unsafe extern "C" fn( - token_present: ::std::os::raw::c_uchar, - slot_list: *mut CK_SLOT_ID, - ulCount: *mut ::std::os::raw::c_ulong, + tokenPresent: CK_BBOOL, + pSlotList: CK_SLOT_ID_PTR, + pulCount: CK_ULONG_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_GetSlotInfo: Result< - unsafe extern "C" fn(slotID: CK_SLOT_ID, info: *mut _CK_SLOT_INFO) -> CK_RV, + unsafe extern "C" fn(slotID: CK_SLOT_ID, pInfo: CK_SLOT_INFO_PTR) -> CK_RV, ::libloading::Error, >, pub C_GetTokenInfo: Result< - unsafe extern "C" fn(slotID: CK_SLOT_ID, info: *mut _CK_TOKEN_INFO) -> CK_RV, - ::libloading::Error, - >, - pub C_WaitForSlotEvent: Result< - unsafe extern "C" fn( - flags: CK_FLAGS, - slot: *mut CK_SLOT_ID, - pReserved: *mut ::std::os::raw::c_void, - ) -> CK_RV, + unsafe extern "C" fn(slotID: CK_SLOT_ID, pInfo: CK_TOKEN_INFO_PTR) -> CK_RV, ::libloading::Error, >, pub C_GetMechanismList: Result< unsafe extern "C" fn( slotID: CK_SLOT_ID, - mechanism_list: *mut CK_MECHANISM_TYPE, - ulCount: *mut ::std::os::raw::c_ulong, + pMechanismList: CK_MECHANISM_TYPE_PTR, + pulCount: CK_ULONG_PTR, ) -> CK_RV, ::libloading::Error, >, @@ -3569,34 +10554,34 @@ pub struct Pkcs11 { unsafe extern "C" fn( slotID: CK_SLOT_ID, type_: CK_MECHANISM_TYPE, - info: *mut _CK_MECHANISM_INFO, + pInfo: CK_MECHANISM_INFO_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_InitToken: Result< unsafe extern "C" fn( slotID: CK_SLOT_ID, - pin: *mut ::std::os::raw::c_uchar, - pin_len: ::std::os::raw::c_ulong, - label: *mut ::std::os::raw::c_uchar, + pPin: CK_UTF8CHAR_PTR, + ulPinLen: CK_ULONG, + pLabel: CK_UTF8CHAR_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_InitPIN: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - pin: *mut ::std::os::raw::c_uchar, - pin_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pPin: CK_UTF8CHAR_PTR, + ulPinLen: CK_ULONG, ) -> CK_RV, ::libloading::Error, >, pub C_SetPIN: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - old_pin: *mut ::std::os::raw::c_uchar, - old_len: ::std::os::raw::c_ulong, - new_pin: *mut ::std::os::raw::c_uchar, - new_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pOldPin: CK_UTF8CHAR_PTR, + ulOldLen: CK_ULONG, + pNewPin: CK_UTF8CHAR_PTR, + ulNewLen: CK_ULONG, ) -> CK_RV, ::libloading::Error, >, @@ -3604,445 +10589,659 @@ pub struct Pkcs11 { unsafe extern "C" fn( slotID: CK_SLOT_ID, flags: CK_FLAGS, - application: *mut ::std::os::raw::c_void, - notify: CK_NOTIFY, - session: *mut CK_SESSION_HANDLE, + pApplication: CK_VOID_PTR, + Notify: CK_NOTIFY, + phSession: CK_SESSION_HANDLE_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_CloseSession: - Result CK_RV, ::libloading::Error>, + Result CK_RV, ::libloading::Error>, pub C_CloseAllSessions: Result CK_RV, ::libloading::Error>, pub C_GetSessionInfo: Result< - unsafe extern "C" fn(session: CK_SESSION_HANDLE, info: *mut _CK_SESSION_INFO) -> CK_RV, + unsafe extern "C" fn(hSession: CK_SESSION_HANDLE, pInfo: CK_SESSION_INFO_PTR) -> CK_RV, ::libloading::Error, >, pub C_GetOperationState: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - operation_state: *mut ::std::os::raw::c_uchar, - operation_state_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pOperationState: CK_BYTE_PTR, + pulOperationStateLen: CK_ULONG_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_SetOperationState: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - operation_state: *mut ::std::os::raw::c_uchar, - operation_state_len: ::std::os::raw::c_ulong, - encryption_key: CK_OBJECT_HANDLE, - authentiation_key: CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pOperationState: CK_BYTE_PTR, + ulOperationStateLen: CK_ULONG, + hEncryptionKey: CK_OBJECT_HANDLE, + hAuthenticationKey: CK_OBJECT_HANDLE, ) -> CK_RV, ::libloading::Error, >, pub C_Login: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - user_type: CK_USER_TYPE, - pin: *mut ::std::os::raw::c_uchar, - pin_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + userType: CK_USER_TYPE, + pPin: CK_UTF8CHAR_PTR, + ulPinLen: CK_ULONG, ) -> CK_RV, ::libloading::Error, >, pub C_Logout: - Result CK_RV, ::libloading::Error>, + Result CK_RV, ::libloading::Error>, pub C_CreateObject: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - templ: *mut _CK_ATTRIBUTE, - ulCount: ::std::os::raw::c_ulong, - object: *mut CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pTemplate: CK_ATTRIBUTE_PTR, + ulCount: CK_ULONG, + phObject: CK_OBJECT_HANDLE_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_CopyObject: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - object: CK_OBJECT_HANDLE, - templ: *mut _CK_ATTRIBUTE, - ulCount: ::std::os::raw::c_ulong, - new_object: *mut CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + hObject: CK_OBJECT_HANDLE, + pTemplate: CK_ATTRIBUTE_PTR, + ulCount: CK_ULONG, + phNewObject: CK_OBJECT_HANDLE_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_DestroyObject: Result< - unsafe extern "C" fn(session: CK_SESSION_HANDLE, object: CK_OBJECT_HANDLE) -> CK_RV, + unsafe extern "C" fn(hSession: CK_SESSION_HANDLE, hObject: CK_OBJECT_HANDLE) -> CK_RV, ::libloading::Error, >, pub C_GetObjectSize: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - object: CK_OBJECT_HANDLE, - size: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + hObject: CK_OBJECT_HANDLE, + pulSize: CK_ULONG_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_GetAttributeValue: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - object: CK_OBJECT_HANDLE, - templ: *mut _CK_ATTRIBUTE, - ulCount: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + hObject: CK_OBJECT_HANDLE, + pTemplate: CK_ATTRIBUTE_PTR, + ulCount: CK_ULONG, ) -> CK_RV, ::libloading::Error, >, pub C_SetAttributeValue: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - object: CK_OBJECT_HANDLE, - templ: *mut _CK_ATTRIBUTE, - ulCount: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + hObject: CK_OBJECT_HANDLE, + pTemplate: CK_ATTRIBUTE_PTR, + ulCount: CK_ULONG, ) -> CK_RV, ::libloading::Error, >, pub C_FindObjectsInit: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - templ: *mut _CK_ATTRIBUTE, - ulCount: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pTemplate: CK_ATTRIBUTE_PTR, + ulCount: CK_ULONG, ) -> CK_RV, ::libloading::Error, >, pub C_FindObjects: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - object: *mut CK_OBJECT_HANDLE, - max_object_count: ::std::os::raw::c_ulong, - object_count: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + phObject: CK_OBJECT_HANDLE_PTR, + ulMaxObjectCount: CK_ULONG, + pulObjectCount: CK_ULONG_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_FindObjectsFinal: - Result CK_RV, ::libloading::Error>, + Result CK_RV, ::libloading::Error>, pub C_EncryptInit: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - key: CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, ) -> CK_RV, ::libloading::Error, >, pub C_Encrypt: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - data: *mut ::std::os::raw::c_uchar, - data_len: ::std::os::raw::c_ulong, - encrypted_data: *mut ::std::os::raw::c_uchar, - encrypted_data_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pEncryptedData: CK_BYTE_PTR, + pulEncryptedDataLen: CK_ULONG_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_EncryptUpdate: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - part: *mut ::std::os::raw::c_uchar, - part_len: ::std::os::raw::c_ulong, - encrypted_part: *mut ::std::os::raw::c_uchar, - encrypted_part_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pPart: CK_BYTE_PTR, + ulPartLen: CK_ULONG, + pEncryptedPart: CK_BYTE_PTR, + pulEncryptedPartLen: CK_ULONG_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_EncryptFinal: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - last_encrypted_part: *mut ::std::os::raw::c_uchar, - last_encrypted_part_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pLastEncryptedPart: CK_BYTE_PTR, + pulLastEncryptedPartLen: CK_ULONG_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_DecryptInit: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - key: CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, ) -> CK_RV, ::libloading::Error, >, pub C_Decrypt: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - encrypted_data: *mut ::std::os::raw::c_uchar, - encrypted_data_len: ::std::os::raw::c_ulong, - data: *mut ::std::os::raw::c_uchar, - data_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pEncryptedData: CK_BYTE_PTR, + ulEncryptedDataLen: CK_ULONG, + pData: CK_BYTE_PTR, + pulDataLen: CK_ULONG_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_DecryptUpdate: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - encrypted_part: *mut ::std::os::raw::c_uchar, - encrypted_part_len: ::std::os::raw::c_ulong, - part: *mut ::std::os::raw::c_uchar, - part_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pEncryptedPart: CK_BYTE_PTR, + ulEncryptedPartLen: CK_ULONG, + pPart: CK_BYTE_PTR, + pulPartLen: CK_ULONG_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_DecryptFinal: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - last_part: *mut ::std::os::raw::c_uchar, - last_part_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pLastPart: CK_BYTE_PTR, + pulLastPartLen: CK_ULONG_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_DigestInit: Result< - unsafe extern "C" fn(session: CK_SESSION_HANDLE, mechanism: *mut _CK_MECHANISM) -> CK_RV, + unsafe extern "C" fn(hSession: CK_SESSION_HANDLE, pMechanism: CK_MECHANISM_PTR) -> CK_RV, ::libloading::Error, >, pub C_Digest: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - data: *mut ::std::os::raw::c_uchar, - data_len: ::std::os::raw::c_ulong, - digest: *mut ::std::os::raw::c_uchar, - digest_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pDigest: CK_BYTE_PTR, + pulDigestLen: CK_ULONG_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_DigestUpdate: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - part: *mut ::std::os::raw::c_uchar, - part_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pPart: CK_BYTE_PTR, + ulPartLen: CK_ULONG, ) -> CK_RV, ::libloading::Error, >, pub C_DigestKey: Result< - unsafe extern "C" fn(session: CK_SESSION_HANDLE, key: CK_OBJECT_HANDLE) -> CK_RV, + unsafe extern "C" fn(hSession: CK_SESSION_HANDLE, hKey: CK_OBJECT_HANDLE) -> CK_RV, ::libloading::Error, >, pub C_DigestFinal: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - digest: *mut ::std::os::raw::c_uchar, - digest_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pDigest: CK_BYTE_PTR, + pulDigestLen: CK_ULONG_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_SignInit: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - key: CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, ) -> CK_RV, ::libloading::Error, >, pub C_Sign: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - data: *mut ::std::os::raw::c_uchar, - data_len: ::std::os::raw::c_ulong, - signature: *mut ::std::os::raw::c_uchar, - signature_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + pulSignatureLen: CK_ULONG_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_SignUpdate: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - part: *mut ::std::os::raw::c_uchar, - part_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pPart: CK_BYTE_PTR, + ulPartLen: CK_ULONG, ) -> CK_RV, ::libloading::Error, >, pub C_SignFinal: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - signature: *mut ::std::os::raw::c_uchar, - signature_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pSignature: CK_BYTE_PTR, + pulSignatureLen: CK_ULONG_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_SignRecoverInit: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - key: CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, ) -> CK_RV, ::libloading::Error, >, pub C_SignRecover: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - data: *mut ::std::os::raw::c_uchar, - data_len: ::std::os::raw::c_ulong, - signature: *mut ::std::os::raw::c_uchar, - signature_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + pulSignatureLen: CK_ULONG_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_VerifyInit: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - key: CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, ) -> CK_RV, ::libloading::Error, >, pub C_Verify: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - data: *mut ::std::os::raw::c_uchar, - data_len: ::std::os::raw::c_ulong, - signature: *mut ::std::os::raw::c_uchar, - signature_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + ulSignatureLen: CK_ULONG, ) -> CK_RV, ::libloading::Error, >, pub C_VerifyUpdate: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - part: *mut ::std::os::raw::c_uchar, - part_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pPart: CK_BYTE_PTR, + ulPartLen: CK_ULONG, ) -> CK_RV, ::libloading::Error, >, pub C_VerifyFinal: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - signature: *mut ::std::os::raw::c_uchar, - signature_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pSignature: CK_BYTE_PTR, + ulSignatureLen: CK_ULONG, ) -> CK_RV, ::libloading::Error, >, pub C_VerifyRecoverInit: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - key: CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, ) -> CK_RV, ::libloading::Error, >, pub C_VerifyRecover: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - signature: *mut ::std::os::raw::c_uchar, - signature_len: ::std::os::raw::c_ulong, - data: *mut ::std::os::raw::c_uchar, - data_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pSignature: CK_BYTE_PTR, + ulSignatureLen: CK_ULONG, + pData: CK_BYTE_PTR, + pulDataLen: CK_ULONG_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_DigestEncryptUpdate: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - part: *mut ::std::os::raw::c_uchar, - part_len: ::std::os::raw::c_ulong, - encrypted_part: *mut ::std::os::raw::c_uchar, - encrypted_part_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pPart: CK_BYTE_PTR, + ulPartLen: CK_ULONG, + pEncryptedPart: CK_BYTE_PTR, + pulEncryptedPartLen: CK_ULONG_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_DecryptDigestUpdate: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - encrypted_part: *mut ::std::os::raw::c_uchar, - encrypted_part_len: ::std::os::raw::c_ulong, - part: *mut ::std::os::raw::c_uchar, - part_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pEncryptedPart: CK_BYTE_PTR, + ulEncryptedPartLen: CK_ULONG, + pPart: CK_BYTE_PTR, + pulPartLen: CK_ULONG_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_SignEncryptUpdate: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - part: *mut ::std::os::raw::c_uchar, - part_len: ::std::os::raw::c_ulong, - encrypted_part: *mut ::std::os::raw::c_uchar, - encrypted_part_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pPart: CK_BYTE_PTR, + ulPartLen: CK_ULONG, + pEncryptedPart: CK_BYTE_PTR, + pulEncryptedPartLen: CK_ULONG_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_DecryptVerifyUpdate: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - encrypted_part: *mut ::std::os::raw::c_uchar, - encrypted_part_len: ::std::os::raw::c_ulong, - part: *mut ::std::os::raw::c_uchar, - part_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pEncryptedPart: CK_BYTE_PTR, + ulEncryptedPartLen: CK_ULONG, + pPart: CK_BYTE_PTR, + pulPartLen: CK_ULONG_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_GenerateKey: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - templ: *mut _CK_ATTRIBUTE, - ulCount: ::std::os::raw::c_ulong, - key: *mut CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + pTemplate: CK_ATTRIBUTE_PTR, + ulCount: CK_ULONG, + phKey: CK_OBJECT_HANDLE_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_GenerateKeyPair: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - public_key_template: *mut _CK_ATTRIBUTE, - public_key_attribute_count: ::std::os::raw::c_ulong, - private_key_template: *mut _CK_ATTRIBUTE, - private_key_attribute_count: ::std::os::raw::c_ulong, - public_key: *mut CK_OBJECT_HANDLE, - private_key: *mut CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + pPublicKeyTemplate: CK_ATTRIBUTE_PTR, + ulPublicKeyAttributeCount: CK_ULONG, + pPrivateKeyTemplate: CK_ATTRIBUTE_PTR, + ulPrivateKeyAttributeCount: CK_ULONG, + phPublicKey: CK_OBJECT_HANDLE_PTR, + phPrivateKey: CK_OBJECT_HANDLE_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_WrapKey: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - wrapping_key: CK_OBJECT_HANDLE, - key: CK_OBJECT_HANDLE, - wrapped_key: *mut ::std::os::raw::c_uchar, - wrapped_key_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hWrappingKey: CK_OBJECT_HANDLE, + hKey: CK_OBJECT_HANDLE, + pWrappedKey: CK_BYTE_PTR, + pulWrappedKeyLen: CK_ULONG_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_UnwrapKey: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - unwrapping_key: CK_OBJECT_HANDLE, - wrapped_key: *mut ::std::os::raw::c_uchar, - wrapped_key_len: ::std::os::raw::c_ulong, - templ: *mut _CK_ATTRIBUTE, - attribute_count: ::std::os::raw::c_ulong, - key: *mut CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hUnwrappingKey: CK_OBJECT_HANDLE, + pWrappedKey: CK_BYTE_PTR, + ulWrappedKeyLen: CK_ULONG, + pTemplate: CK_ATTRIBUTE_PTR, + ulAttributeCount: CK_ULONG, + phKey: CK_OBJECT_HANDLE_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_DeriveKey: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - base_key: CK_OBJECT_HANDLE, - templ: *mut _CK_ATTRIBUTE, - attribute_count: ::std::os::raw::c_ulong, - key: *mut CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hBaseKey: CK_OBJECT_HANDLE, + pTemplate: CK_ATTRIBUTE_PTR, + ulAttributeCount: CK_ULONG, + phKey: CK_OBJECT_HANDLE_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_SeedRandom: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - seed: *mut ::std::os::raw::c_uchar, - seed_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pSeed: CK_BYTE_PTR, + ulSeedLen: CK_ULONG, ) -> CK_RV, ::libloading::Error, >, pub C_GenerateRandom: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - random_data: *mut ::std::os::raw::c_uchar, - random_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + RandomData: CK_BYTE_PTR, + ulRandomLen: CK_ULONG, ) -> CK_RV, ::libloading::Error, >, pub C_GetFunctionStatus: - Result CK_RV, ::libloading::Error>, + Result CK_RV, ::libloading::Error>, pub C_CancelFunction: - Result CK_RV, ::libloading::Error>, + Result CK_RV, ::libloading::Error>, + pub C_WaitForSlotEvent: Result< + unsafe extern "C" fn( + flags: CK_FLAGS, + pSlot: CK_SLOT_ID_PTR, + pRserved: CK_VOID_PTR, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_GetInterfaceList: Result< + unsafe extern "C" fn(pInterfacesList: CK_INTERFACE_PTR, pulCount: CK_ULONG_PTR) -> CK_RV, + ::libloading::Error, + >, + pub C_GetInterface: Result< + unsafe extern "C" fn( + pInterfaceName: CK_UTF8CHAR_PTR, + pVersion: CK_VERSION_PTR, + ppInterface: CK_INTERFACE_PTR_PTR, + flags: CK_FLAGS, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_LoginUser: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + userType: CK_USER_TYPE, + pPin: CK_UTF8CHAR_PTR, + ulPinLen: CK_ULONG, + pUsername: CK_UTF8CHAR_PTR, + ulUsernameLen: CK_ULONG, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_SessionCancel: Result< + unsafe extern "C" fn(hSession: CK_SESSION_HANDLE, flags: CK_FLAGS) -> CK_RV, + ::libloading::Error, + >, + pub C_MessageEncryptInit: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_EncryptMessage: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pAssociatedData: CK_BYTE_PTR, + ulAssociatedDataLen: CK_ULONG, + pPlaintext: CK_BYTE_PTR, + ulPlaintextLen: CK_ULONG, + pCiphertext: CK_BYTE_PTR, + pulCiphertextLen: CK_ULONG_PTR, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_EncryptMessageBegin: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pAssociatedData: CK_BYTE_PTR, + ulAssociatedDataLen: CK_ULONG, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_EncryptMessageNext: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pPlaintextPart: CK_BYTE_PTR, + ulPlaintextPartLen: CK_ULONG, + pCiphertextPart: CK_BYTE_PTR, + pulCiphertextPartLen: CK_ULONG_PTR, + flags: CK_FLAGS, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_MessageEncryptFinal: + Result CK_RV, ::libloading::Error>, + pub C_MessageDecryptInit: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_DecryptMessage: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pAssociatedData: CK_BYTE_PTR, + ulAssociatedDataLen: CK_ULONG, + pCiphertext: CK_BYTE_PTR, + ulCiphertextLen: CK_ULONG, + pPlaintext: CK_BYTE_PTR, + pulPlaintextLen: CK_ULONG_PTR, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_DecryptMessageBegin: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pAssociatedData: CK_BYTE_PTR, + ulAssociatedDataLen: CK_ULONG, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_DecryptMessageNext: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pCiphertext: CK_BYTE_PTR, + ulCiphertextLen: CK_ULONG, + pPlaintext: CK_BYTE_PTR, + pulPlaintextLen: CK_ULONG_PTR, + flags: CK_FLAGS, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_MessageDecryptFinal: + Result CK_RV, ::libloading::Error>, + pub C_MessageSignInit: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_SignMessage: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + pulSignatureLen: CK_ULONG_PTR, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_SignMessageBegin: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_SignMessageNext: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + pulSignatureLen: CK_ULONG_PTR, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_MessageSignFinal: + Result CK_RV, ::libloading::Error>, + pub C_MessageVerifyInit: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_VerifyMessage: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + ulSignatureLen: CK_ULONG, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_VerifyMessageBegin: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_VerifyMessageNext: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + ulSignatureLen: CK_ULONG, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_MessageVerifyFinal: + Result CK_RV, ::libloading::Error>, } impl Pkcs11 { pub unsafe fn new

(path: P) -> Result @@ -4064,7 +11263,6 @@ impl Pkcs11 { let C_GetSlotList = __library.get(b"C_GetSlotList\0").map(|sym| *sym); let C_GetSlotInfo = __library.get(b"C_GetSlotInfo\0").map(|sym| *sym); let C_GetTokenInfo = __library.get(b"C_GetTokenInfo\0").map(|sym| *sym); - let C_WaitForSlotEvent = __library.get(b"C_WaitForSlotEvent\0").map(|sym| *sym); let C_GetMechanismList = __library.get(b"C_GetMechanismList\0").map(|sym| *sym); let C_GetMechanismInfo = __library.get(b"C_GetMechanismInfo\0").map(|sym| *sym); let C_InitToken = __library.get(b"C_InitToken\0").map(|sym| *sym); @@ -4125,6 +11323,31 @@ impl Pkcs11 { let C_GenerateRandom = __library.get(b"C_GenerateRandom\0").map(|sym| *sym); let C_GetFunctionStatus = __library.get(b"C_GetFunctionStatus\0").map(|sym| *sym); let C_CancelFunction = __library.get(b"C_CancelFunction\0").map(|sym| *sym); + let C_WaitForSlotEvent = __library.get(b"C_WaitForSlotEvent\0").map(|sym| *sym); + let C_GetInterfaceList = __library.get(b"C_GetInterfaceList\0").map(|sym| *sym); + let C_GetInterface = __library.get(b"C_GetInterface\0").map(|sym| *sym); + let C_LoginUser = __library.get(b"C_LoginUser\0").map(|sym| *sym); + let C_SessionCancel = __library.get(b"C_SessionCancel\0").map(|sym| *sym); + let C_MessageEncryptInit = __library.get(b"C_MessageEncryptInit\0").map(|sym| *sym); + let C_EncryptMessage = __library.get(b"C_EncryptMessage\0").map(|sym| *sym); + let C_EncryptMessageBegin = __library.get(b"C_EncryptMessageBegin\0").map(|sym| *sym); + let C_EncryptMessageNext = __library.get(b"C_EncryptMessageNext\0").map(|sym| *sym); + let C_MessageEncryptFinal = __library.get(b"C_MessageEncryptFinal\0").map(|sym| *sym); + let C_MessageDecryptInit = __library.get(b"C_MessageDecryptInit\0").map(|sym| *sym); + let C_DecryptMessage = __library.get(b"C_DecryptMessage\0").map(|sym| *sym); + let C_DecryptMessageBegin = __library.get(b"C_DecryptMessageBegin\0").map(|sym| *sym); + let C_DecryptMessageNext = __library.get(b"C_DecryptMessageNext\0").map(|sym| *sym); + let C_MessageDecryptFinal = __library.get(b"C_MessageDecryptFinal\0").map(|sym| *sym); + let C_MessageSignInit = __library.get(b"C_MessageSignInit\0").map(|sym| *sym); + let C_SignMessage = __library.get(b"C_SignMessage\0").map(|sym| *sym); + let C_SignMessageBegin = __library.get(b"C_SignMessageBegin\0").map(|sym| *sym); + let C_SignMessageNext = __library.get(b"C_SignMessageNext\0").map(|sym| *sym); + let C_MessageSignFinal = __library.get(b"C_MessageSignFinal\0").map(|sym| *sym); + let C_MessageVerifyInit = __library.get(b"C_MessageVerifyInit\0").map(|sym| *sym); + let C_VerifyMessage = __library.get(b"C_VerifyMessage\0").map(|sym| *sym); + let C_VerifyMessageBegin = __library.get(b"C_VerifyMessageBegin\0").map(|sym| *sym); + let C_VerifyMessageNext = __library.get(b"C_VerifyMessageNext\0").map(|sym| *sym); + let C_MessageVerifyFinal = __library.get(b"C_MessageVerifyFinal\0").map(|sym| *sym); Ok(Pkcs11 { __library, C_Initialize, @@ -4134,7 +11357,6 @@ impl Pkcs11 { C_GetSlotList, C_GetSlotInfo, C_GetTokenInfo, - C_WaitForSlotEvent, C_GetMechanismList, C_GetMechanismInfo, C_InitToken, @@ -4195,146 +11417,164 @@ impl Pkcs11 { C_GenerateRandom, C_GetFunctionStatus, C_CancelFunction, + C_WaitForSlotEvent, + C_GetInterfaceList, + C_GetInterface, + C_LoginUser, + C_SessionCancel, + C_MessageEncryptInit, + C_EncryptMessage, + C_EncryptMessageBegin, + C_EncryptMessageNext, + C_MessageEncryptFinal, + C_MessageDecryptInit, + C_DecryptMessage, + C_DecryptMessageBegin, + C_DecryptMessageNext, + C_MessageDecryptFinal, + C_MessageSignInit, + C_SignMessage, + C_SignMessageBegin, + C_SignMessageNext, + C_MessageSignFinal, + C_MessageVerifyInit, + C_VerifyMessage, + C_VerifyMessageBegin, + C_VerifyMessageNext, + C_MessageVerifyFinal, }) } - pub unsafe fn C_Initialize(&self, init_args: *mut ::std::os::raw::c_void) -> CK_RV { + pub unsafe fn C_Initialize(&self, pInitArgs: CK_VOID_PTR) -> CK_RV { (self .C_Initialize .as_ref() - .expect("Expected function, got error."))(init_args) + .expect("Expected function, got error."))(pInitArgs) } - pub unsafe fn C_Finalize(&self, pReserved: *mut ::std::os::raw::c_void) -> CK_RV { + pub unsafe fn C_Finalize(&self, pReserved: CK_VOID_PTR) -> CK_RV { (self .C_Finalize .as_ref() .expect("Expected function, got error."))(pReserved) } - pub unsafe fn C_GetInfo(&self, info: *mut _CK_INFO) -> CK_RV { + pub unsafe fn C_GetInfo(&self, pInfo: CK_INFO_PTR) -> CK_RV { (self .C_GetInfo .as_ref() - .expect("Expected function, got error."))(info) + .expect("Expected function, got error."))(pInfo) } - pub unsafe fn C_GetFunctionList(&self, function_list: *mut *mut _CK_FUNCTION_LIST) -> CK_RV { + pub unsafe fn C_GetFunctionList(&self, ppFunctionList: CK_FUNCTION_LIST_PTR_PTR) -> CK_RV { (self .C_GetFunctionList .as_ref() - .expect("Expected function, got error."))(function_list) + .expect("Expected function, got error."))(ppFunctionList) } pub unsafe fn C_GetSlotList( &self, - token_present: ::std::os::raw::c_uchar, - slot_list: *mut CK_SLOT_ID, - ulCount: *mut ::std::os::raw::c_ulong, + tokenPresent: CK_BBOOL, + pSlotList: CK_SLOT_ID_PTR, + pulCount: CK_ULONG_PTR, ) -> CK_RV { (self .C_GetSlotList .as_ref() - .expect("Expected function, got error."))(token_present, slot_list, ulCount) + .expect("Expected function, got error."))(tokenPresent, pSlotList, pulCount) } - pub unsafe fn C_GetSlotInfo(&self, slotID: CK_SLOT_ID, info: *mut _CK_SLOT_INFO) -> CK_RV { + pub unsafe fn C_GetSlotInfo(&self, slotID: CK_SLOT_ID, pInfo: CK_SLOT_INFO_PTR) -> CK_RV { (self .C_GetSlotInfo .as_ref() - .expect("Expected function, got error."))(slotID, info) + .expect("Expected function, got error."))(slotID, pInfo) } - pub unsafe fn C_GetTokenInfo(&self, slotID: CK_SLOT_ID, info: *mut _CK_TOKEN_INFO) -> CK_RV { + pub unsafe fn C_GetTokenInfo(&self, slotID: CK_SLOT_ID, pInfo: CK_TOKEN_INFO_PTR) -> CK_RV { (self .C_GetTokenInfo .as_ref() - .expect("Expected function, got error."))(slotID, info) - } - pub unsafe fn C_WaitForSlotEvent( - &self, - flags: CK_FLAGS, - slot: *mut CK_SLOT_ID, - pReserved: *mut ::std::os::raw::c_void, - ) -> CK_RV { - (self - .C_WaitForSlotEvent - .as_ref() - .expect("Expected function, got error."))(flags, slot, pReserved) + .expect("Expected function, got error."))(slotID, pInfo) } pub unsafe fn C_GetMechanismList( &self, slotID: CK_SLOT_ID, - mechanism_list: *mut CK_MECHANISM_TYPE, - ulCount: *mut ::std::os::raw::c_ulong, + pMechanismList: CK_MECHANISM_TYPE_PTR, + pulCount: CK_ULONG_PTR, ) -> CK_RV { (self .C_GetMechanismList .as_ref() - .expect("Expected function, got error."))(slotID, mechanism_list, ulCount) + .expect("Expected function, got error."))(slotID, pMechanismList, pulCount) } pub unsafe fn C_GetMechanismInfo( &self, slotID: CK_SLOT_ID, type_: CK_MECHANISM_TYPE, - info: *mut _CK_MECHANISM_INFO, + pInfo: CK_MECHANISM_INFO_PTR, ) -> CK_RV { (self .C_GetMechanismInfo .as_ref() - .expect("Expected function, got error."))(slotID, type_, info) + .expect("Expected function, got error."))(slotID, type_, pInfo) } pub unsafe fn C_InitToken( &self, slotID: CK_SLOT_ID, - pin: *mut ::std::os::raw::c_uchar, - pin_len: ::std::os::raw::c_ulong, - label: *mut ::std::os::raw::c_uchar, + pPin: CK_UTF8CHAR_PTR, + ulPinLen: CK_ULONG, + pLabel: CK_UTF8CHAR_PTR, ) -> CK_RV { (self .C_InitToken .as_ref() - .expect("Expected function, got error."))(slotID, pin, pin_len, label) + .expect("Expected function, got error."))(slotID, pPin, ulPinLen, pLabel) } pub unsafe fn C_InitPIN( &self, - session: CK_SESSION_HANDLE, - pin: *mut ::std::os::raw::c_uchar, - pin_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pPin: CK_UTF8CHAR_PTR, + ulPinLen: CK_ULONG, ) -> CK_RV { (self .C_InitPIN .as_ref() - .expect("Expected function, got error."))(session, pin, pin_len) + .expect("Expected function, got error."))(hSession, pPin, ulPinLen) } pub unsafe fn C_SetPIN( &self, - session: CK_SESSION_HANDLE, - old_pin: *mut ::std::os::raw::c_uchar, - old_len: ::std::os::raw::c_ulong, - new_pin: *mut ::std::os::raw::c_uchar, - new_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pOldPin: CK_UTF8CHAR_PTR, + ulOldLen: CK_ULONG, + pNewPin: CK_UTF8CHAR_PTR, + ulNewLen: CK_ULONG, ) -> CK_RV { (self .C_SetPIN .as_ref() .expect("Expected function, got error."))( - session, old_pin, old_len, new_pin, new_len + hSession, pOldPin, ulOldLen, pNewPin, ulNewLen, ) } pub unsafe fn C_OpenSession( &self, slotID: CK_SLOT_ID, flags: CK_FLAGS, - application: *mut ::std::os::raw::c_void, - notify: CK_NOTIFY, - session: *mut CK_SESSION_HANDLE, + pApplication: CK_VOID_PTR, + Notify: CK_NOTIFY, + phSession: CK_SESSION_HANDLE_PTR, ) -> CK_RV { (self .C_OpenSession .as_ref() .expect("Expected function, got error."))( - slotID, flags, application, notify, session + slotID, + flags, + pApplication, + Notify, + phSession, ) } - pub unsafe fn C_CloseSession(&self, session: CK_SESSION_HANDLE) -> CK_RV { + pub unsafe fn C_CloseSession(&self, hSession: CK_SESSION_HANDLE) -> CK_RV { (self .C_CloseSession .as_ref() - .expect("Expected function, got error."))(session) + .expect("Expected function, got error."))(hSession) } pub unsafe fn C_CloseAllSessions(&self, slotID: CK_SLOT_ID) -> CK_RV { (self @@ -4344,723 +11584,1119 @@ impl Pkcs11 { } pub unsafe fn C_GetSessionInfo( &self, - session: CK_SESSION_HANDLE, - info: *mut _CK_SESSION_INFO, + hSession: CK_SESSION_HANDLE, + pInfo: CK_SESSION_INFO_PTR, ) -> CK_RV { (self .C_GetSessionInfo .as_ref() - .expect("Expected function, got error."))(session, info) + .expect("Expected function, got error."))(hSession, pInfo) } pub unsafe fn C_GetOperationState( &self, - session: CK_SESSION_HANDLE, - operation_state: *mut ::std::os::raw::c_uchar, - operation_state_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pOperationState: CK_BYTE_PTR, + pulOperationStateLen: CK_ULONG_PTR, ) -> CK_RV { (self .C_GetOperationState .as_ref() .expect("Expected function, got error."))( - session, operation_state, operation_state_len + hSession, + pOperationState, + pulOperationStateLen, ) } pub unsafe fn C_SetOperationState( &self, - session: CK_SESSION_HANDLE, - operation_state: *mut ::std::os::raw::c_uchar, - operation_state_len: ::std::os::raw::c_ulong, - encryption_key: CK_OBJECT_HANDLE, - authentiation_key: CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pOperationState: CK_BYTE_PTR, + ulOperationStateLen: CK_ULONG, + hEncryptionKey: CK_OBJECT_HANDLE, + hAuthenticationKey: CK_OBJECT_HANDLE, ) -> CK_RV { (self .C_SetOperationState .as_ref() .expect("Expected function, got error."))( - session, - operation_state, - operation_state_len, - encryption_key, - authentiation_key, + hSession, + pOperationState, + ulOperationStateLen, + hEncryptionKey, + hAuthenticationKey, ) } pub unsafe fn C_Login( &self, - session: CK_SESSION_HANDLE, - user_type: CK_USER_TYPE, - pin: *mut ::std::os::raw::c_uchar, - pin_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + userType: CK_USER_TYPE, + pPin: CK_UTF8CHAR_PTR, + ulPinLen: CK_ULONG, ) -> CK_RV { (self .C_Login .as_ref() - .expect("Expected function, got error."))(session, user_type, pin, pin_len) + .expect("Expected function, got error."))(hSession, userType, pPin, ulPinLen) } - pub unsafe fn C_Logout(&self, session: CK_SESSION_HANDLE) -> CK_RV { + pub unsafe fn C_Logout(&self, hSession: CK_SESSION_HANDLE) -> CK_RV { (self .C_Logout .as_ref() - .expect("Expected function, got error."))(session) + .expect("Expected function, got error."))(hSession) } pub unsafe fn C_CreateObject( &self, - session: CK_SESSION_HANDLE, - templ: *mut _CK_ATTRIBUTE, - ulCount: ::std::os::raw::c_ulong, - object: *mut CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pTemplate: CK_ATTRIBUTE_PTR, + ulCount: CK_ULONG, + phObject: CK_OBJECT_HANDLE_PTR, ) -> CK_RV { (self .C_CreateObject .as_ref() - .expect("Expected function, got error."))(session, templ, ulCount, object) + .expect("Expected function, got error."))(hSession, pTemplate, ulCount, phObject) } pub unsafe fn C_CopyObject( &self, - session: CK_SESSION_HANDLE, - object: CK_OBJECT_HANDLE, - templ: *mut _CK_ATTRIBUTE, - ulCount: ::std::os::raw::c_ulong, - new_object: *mut CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + hObject: CK_OBJECT_HANDLE, + pTemplate: CK_ATTRIBUTE_PTR, + ulCount: CK_ULONG, + phNewObject: CK_OBJECT_HANDLE_PTR, ) -> CK_RV { (self .C_CopyObject .as_ref() .expect("Expected function, got error."))( - session, object, templ, ulCount, new_object + hSession, + hObject, + pTemplate, + ulCount, + phNewObject, ) } pub unsafe fn C_DestroyObject( &self, - session: CK_SESSION_HANDLE, - object: CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + hObject: CK_OBJECT_HANDLE, ) -> CK_RV { (self .C_DestroyObject .as_ref() - .expect("Expected function, got error."))(session, object) + .expect("Expected function, got error."))(hSession, hObject) } pub unsafe fn C_GetObjectSize( &self, - session: CK_SESSION_HANDLE, - object: CK_OBJECT_HANDLE, - size: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + hObject: CK_OBJECT_HANDLE, + pulSize: CK_ULONG_PTR, ) -> CK_RV { (self .C_GetObjectSize .as_ref() - .expect("Expected function, got error."))(session, object, size) + .expect("Expected function, got error."))(hSession, hObject, pulSize) } pub unsafe fn C_GetAttributeValue( &self, - session: CK_SESSION_HANDLE, - object: CK_OBJECT_HANDLE, - templ: *mut _CK_ATTRIBUTE, - ulCount: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + hObject: CK_OBJECT_HANDLE, + pTemplate: CK_ATTRIBUTE_PTR, + ulCount: CK_ULONG, ) -> CK_RV { (self .C_GetAttributeValue .as_ref() - .expect("Expected function, got error."))(session, object, templ, ulCount) + .expect("Expected function, got error."))(hSession, hObject, pTemplate, ulCount) } pub unsafe fn C_SetAttributeValue( &self, - session: CK_SESSION_HANDLE, - object: CK_OBJECT_HANDLE, - templ: *mut _CK_ATTRIBUTE, - ulCount: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + hObject: CK_OBJECT_HANDLE, + pTemplate: CK_ATTRIBUTE_PTR, + ulCount: CK_ULONG, ) -> CK_RV { (self .C_SetAttributeValue .as_ref() - .expect("Expected function, got error."))(session, object, templ, ulCount) + .expect("Expected function, got error."))(hSession, hObject, pTemplate, ulCount) } pub unsafe fn C_FindObjectsInit( &self, - session: CK_SESSION_HANDLE, - templ: *mut _CK_ATTRIBUTE, - ulCount: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pTemplate: CK_ATTRIBUTE_PTR, + ulCount: CK_ULONG, ) -> CK_RV { (self .C_FindObjectsInit .as_ref() - .expect("Expected function, got error."))(session, templ, ulCount) + .expect("Expected function, got error."))(hSession, pTemplate, ulCount) } pub unsafe fn C_FindObjects( &self, - session: CK_SESSION_HANDLE, - object: *mut CK_OBJECT_HANDLE, - max_object_count: ::std::os::raw::c_ulong, - object_count: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + phObject: CK_OBJECT_HANDLE_PTR, + ulMaxObjectCount: CK_ULONG, + pulObjectCount: CK_ULONG_PTR, ) -> CK_RV { (self .C_FindObjects .as_ref() .expect("Expected function, got error."))( - session, - object, - max_object_count, - object_count, + hSession, + phObject, + ulMaxObjectCount, + pulObjectCount, ) } - pub unsafe fn C_FindObjectsFinal(&self, session: CK_SESSION_HANDLE) -> CK_RV { + pub unsafe fn C_FindObjectsFinal(&self, hSession: CK_SESSION_HANDLE) -> CK_RV { (self .C_FindObjectsFinal .as_ref() - .expect("Expected function, got error."))(session) + .expect("Expected function, got error."))(hSession) } pub unsafe fn C_EncryptInit( &self, - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - key: CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, ) -> CK_RV { (self .C_EncryptInit .as_ref() - .expect("Expected function, got error."))(session, mechanism, key) + .expect("Expected function, got error."))(hSession, pMechanism, hKey) } pub unsafe fn C_Encrypt( &self, - session: CK_SESSION_HANDLE, - data: *mut ::std::os::raw::c_uchar, - data_len: ::std::os::raw::c_ulong, - encrypted_data: *mut ::std::os::raw::c_uchar, - encrypted_data_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pEncryptedData: CK_BYTE_PTR, + pulEncryptedDataLen: CK_ULONG_PTR, ) -> CK_RV { (self .C_Encrypt .as_ref() .expect("Expected function, got error."))( - session, - data, - data_len, - encrypted_data, - encrypted_data_len, + hSession, + pData, + ulDataLen, + pEncryptedData, + pulEncryptedDataLen, ) } pub unsafe fn C_EncryptUpdate( &self, - session: CK_SESSION_HANDLE, - part: *mut ::std::os::raw::c_uchar, - part_len: ::std::os::raw::c_ulong, - encrypted_part: *mut ::std::os::raw::c_uchar, - encrypted_part_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pPart: CK_BYTE_PTR, + ulPartLen: CK_ULONG, + pEncryptedPart: CK_BYTE_PTR, + pulEncryptedPartLen: CK_ULONG_PTR, ) -> CK_RV { (self .C_EncryptUpdate .as_ref() .expect("Expected function, got error."))( - session, - part, - part_len, - encrypted_part, - encrypted_part_len, + hSession, + pPart, + ulPartLen, + pEncryptedPart, + pulEncryptedPartLen, ) } pub unsafe fn C_EncryptFinal( &self, - session: CK_SESSION_HANDLE, - last_encrypted_part: *mut ::std::os::raw::c_uchar, - last_encrypted_part_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pLastEncryptedPart: CK_BYTE_PTR, + pulLastEncryptedPartLen: CK_ULONG_PTR, ) -> CK_RV { (self .C_EncryptFinal .as_ref() .expect("Expected function, got error."))( - session, - last_encrypted_part, - last_encrypted_part_len, + hSession, + pLastEncryptedPart, + pulLastEncryptedPartLen, ) } pub unsafe fn C_DecryptInit( &self, - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - key: CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, ) -> CK_RV { (self .C_DecryptInit .as_ref() - .expect("Expected function, got error."))(session, mechanism, key) + .expect("Expected function, got error."))(hSession, pMechanism, hKey) } pub unsafe fn C_Decrypt( &self, - session: CK_SESSION_HANDLE, - encrypted_data: *mut ::std::os::raw::c_uchar, - encrypted_data_len: ::std::os::raw::c_ulong, - data: *mut ::std::os::raw::c_uchar, - data_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pEncryptedData: CK_BYTE_PTR, + ulEncryptedDataLen: CK_ULONG, + pData: CK_BYTE_PTR, + pulDataLen: CK_ULONG_PTR, ) -> CK_RV { (self .C_Decrypt .as_ref() .expect("Expected function, got error."))( - session, - encrypted_data, - encrypted_data_len, - data, - data_len, + hSession, + pEncryptedData, + ulEncryptedDataLen, + pData, + pulDataLen, ) } pub unsafe fn C_DecryptUpdate( &self, - session: CK_SESSION_HANDLE, - encrypted_part: *mut ::std::os::raw::c_uchar, - encrypted_part_len: ::std::os::raw::c_ulong, - part: *mut ::std::os::raw::c_uchar, - part_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pEncryptedPart: CK_BYTE_PTR, + ulEncryptedPartLen: CK_ULONG, + pPart: CK_BYTE_PTR, + pulPartLen: CK_ULONG_PTR, ) -> CK_RV { (self .C_DecryptUpdate .as_ref() .expect("Expected function, got error."))( - session, - encrypted_part, - encrypted_part_len, - part, - part_len, + hSession, + pEncryptedPart, + ulEncryptedPartLen, + pPart, + pulPartLen, ) } pub unsafe fn C_DecryptFinal( &self, - session: CK_SESSION_HANDLE, - last_part: *mut ::std::os::raw::c_uchar, - last_part_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pLastPart: CK_BYTE_PTR, + pulLastPartLen: CK_ULONG_PTR, ) -> CK_RV { (self .C_DecryptFinal .as_ref() - .expect("Expected function, got error."))(session, last_part, last_part_len) + .expect("Expected function, got error."))(hSession, pLastPart, pulLastPartLen) } pub unsafe fn C_DigestInit( &self, - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, ) -> CK_RV { (self .C_DigestInit .as_ref() - .expect("Expected function, got error."))(session, mechanism) + .expect("Expected function, got error."))(hSession, pMechanism) } pub unsafe fn C_Digest( &self, - session: CK_SESSION_HANDLE, - data: *mut ::std::os::raw::c_uchar, - data_len: ::std::os::raw::c_ulong, - digest: *mut ::std::os::raw::c_uchar, - digest_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pDigest: CK_BYTE_PTR, + pulDigestLen: CK_ULONG_PTR, ) -> CK_RV { (self .C_Digest .as_ref() .expect("Expected function, got error."))( - session, data, data_len, digest, digest_len + hSession, + pData, + ulDataLen, + pDigest, + pulDigestLen, ) } pub unsafe fn C_DigestUpdate( &self, - session: CK_SESSION_HANDLE, - part: *mut ::std::os::raw::c_uchar, - part_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pPart: CK_BYTE_PTR, + ulPartLen: CK_ULONG, ) -> CK_RV { (self .C_DigestUpdate .as_ref() - .expect("Expected function, got error."))(session, part, part_len) + .expect("Expected function, got error."))(hSession, pPart, ulPartLen) } - pub unsafe fn C_DigestKey(&self, session: CK_SESSION_HANDLE, key: CK_OBJECT_HANDLE) -> CK_RV { + pub unsafe fn C_DigestKey(&self, hSession: CK_SESSION_HANDLE, hKey: CK_OBJECT_HANDLE) -> CK_RV { (self .C_DigestKey .as_ref() - .expect("Expected function, got error."))(session, key) + .expect("Expected function, got error."))(hSession, hKey) } pub unsafe fn C_DigestFinal( &self, - session: CK_SESSION_HANDLE, - digest: *mut ::std::os::raw::c_uchar, - digest_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pDigest: CK_BYTE_PTR, + pulDigestLen: CK_ULONG_PTR, ) -> CK_RV { (self .C_DigestFinal .as_ref() - .expect("Expected function, got error."))(session, digest, digest_len) + .expect("Expected function, got error."))(hSession, pDigest, pulDigestLen) } pub unsafe fn C_SignInit( &self, - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - key: CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, ) -> CK_RV { (self .C_SignInit .as_ref() - .expect("Expected function, got error."))(session, mechanism, key) + .expect("Expected function, got error."))(hSession, pMechanism, hKey) } pub unsafe fn C_Sign( &self, - session: CK_SESSION_HANDLE, - data: *mut ::std::os::raw::c_uchar, - data_len: ::std::os::raw::c_ulong, - signature: *mut ::std::os::raw::c_uchar, - signature_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + pulSignatureLen: CK_ULONG_PTR, ) -> CK_RV { (self.C_Sign.as_ref().expect("Expected function, got error."))( - session, - data, - data_len, - signature, - signature_len, + hSession, + pData, + ulDataLen, + pSignature, + pulSignatureLen, ) } pub unsafe fn C_SignUpdate( &self, - session: CK_SESSION_HANDLE, - part: *mut ::std::os::raw::c_uchar, - part_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pPart: CK_BYTE_PTR, + ulPartLen: CK_ULONG, ) -> CK_RV { (self .C_SignUpdate .as_ref() - .expect("Expected function, got error."))(session, part, part_len) + .expect("Expected function, got error."))(hSession, pPart, ulPartLen) } pub unsafe fn C_SignFinal( &self, - session: CK_SESSION_HANDLE, - signature: *mut ::std::os::raw::c_uchar, - signature_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pSignature: CK_BYTE_PTR, + pulSignatureLen: CK_ULONG_PTR, ) -> CK_RV { (self .C_SignFinal .as_ref() - .expect("Expected function, got error."))(session, signature, signature_len) + .expect("Expected function, got error."))(hSession, pSignature, pulSignatureLen) } pub unsafe fn C_SignRecoverInit( &self, - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - key: CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, ) -> CK_RV { (self .C_SignRecoverInit .as_ref() - .expect("Expected function, got error."))(session, mechanism, key) + .expect("Expected function, got error."))(hSession, pMechanism, hKey) } pub unsafe fn C_SignRecover( &self, - session: CK_SESSION_HANDLE, - data: *mut ::std::os::raw::c_uchar, - data_len: ::std::os::raw::c_ulong, - signature: *mut ::std::os::raw::c_uchar, - signature_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + pulSignatureLen: CK_ULONG_PTR, ) -> CK_RV { (self .C_SignRecover .as_ref() .expect("Expected function, got error."))( - session, - data, - data_len, - signature, - signature_len, + hSession, + pData, + ulDataLen, + pSignature, + pulSignatureLen, ) } pub unsafe fn C_VerifyInit( &self, - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - key: CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, ) -> CK_RV { (self .C_VerifyInit .as_ref() - .expect("Expected function, got error."))(session, mechanism, key) + .expect("Expected function, got error."))(hSession, pMechanism, hKey) } pub unsafe fn C_Verify( &self, - session: CK_SESSION_HANDLE, - data: *mut ::std::os::raw::c_uchar, - data_len: ::std::os::raw::c_ulong, - signature: *mut ::std::os::raw::c_uchar, - signature_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + ulSignatureLen: CK_ULONG, ) -> CK_RV { (self .C_Verify .as_ref() .expect("Expected function, got error."))( - session, - data, - data_len, - signature, - signature_len, + hSession, + pData, + ulDataLen, + pSignature, + ulSignatureLen, ) } pub unsafe fn C_VerifyUpdate( &self, - session: CK_SESSION_HANDLE, - part: *mut ::std::os::raw::c_uchar, - part_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pPart: CK_BYTE_PTR, + ulPartLen: CK_ULONG, ) -> CK_RV { (self .C_VerifyUpdate .as_ref() - .expect("Expected function, got error."))(session, part, part_len) + .expect("Expected function, got error."))(hSession, pPart, ulPartLen) } pub unsafe fn C_VerifyFinal( &self, - session: CK_SESSION_HANDLE, - signature: *mut ::std::os::raw::c_uchar, - signature_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pSignature: CK_BYTE_PTR, + ulSignatureLen: CK_ULONG, ) -> CK_RV { (self .C_VerifyFinal .as_ref() - .expect("Expected function, got error."))(session, signature, signature_len) + .expect("Expected function, got error."))(hSession, pSignature, ulSignatureLen) } pub unsafe fn C_VerifyRecoverInit( &self, - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - key: CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, ) -> CK_RV { (self .C_VerifyRecoverInit .as_ref() - .expect("Expected function, got error."))(session, mechanism, key) + .expect("Expected function, got error."))(hSession, pMechanism, hKey) } pub unsafe fn C_VerifyRecover( &self, - session: CK_SESSION_HANDLE, - signature: *mut ::std::os::raw::c_uchar, - signature_len: ::std::os::raw::c_ulong, - data: *mut ::std::os::raw::c_uchar, - data_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pSignature: CK_BYTE_PTR, + ulSignatureLen: CK_ULONG, + pData: CK_BYTE_PTR, + pulDataLen: CK_ULONG_PTR, ) -> CK_RV { (self .C_VerifyRecover .as_ref() .expect("Expected function, got error."))( - session, - signature, - signature_len, - data, - data_len, + hSession, + pSignature, + ulSignatureLen, + pData, + pulDataLen, ) } pub unsafe fn C_DigestEncryptUpdate( &self, - session: CK_SESSION_HANDLE, - part: *mut ::std::os::raw::c_uchar, - part_len: ::std::os::raw::c_ulong, - encrypted_part: *mut ::std::os::raw::c_uchar, - encrypted_part_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pPart: CK_BYTE_PTR, + ulPartLen: CK_ULONG, + pEncryptedPart: CK_BYTE_PTR, + pulEncryptedPartLen: CK_ULONG_PTR, ) -> CK_RV { (self .C_DigestEncryptUpdate .as_ref() .expect("Expected function, got error."))( - session, - part, - part_len, - encrypted_part, - encrypted_part_len, + hSession, + pPart, + ulPartLen, + pEncryptedPart, + pulEncryptedPartLen, ) } pub unsafe fn C_DecryptDigestUpdate( &self, - session: CK_SESSION_HANDLE, - encrypted_part: *mut ::std::os::raw::c_uchar, - encrypted_part_len: ::std::os::raw::c_ulong, - part: *mut ::std::os::raw::c_uchar, - part_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pEncryptedPart: CK_BYTE_PTR, + ulEncryptedPartLen: CK_ULONG, + pPart: CK_BYTE_PTR, + pulPartLen: CK_ULONG_PTR, ) -> CK_RV { (self .C_DecryptDigestUpdate .as_ref() .expect("Expected function, got error."))( - session, - encrypted_part, - encrypted_part_len, - part, - part_len, + hSession, + pEncryptedPart, + ulEncryptedPartLen, + pPart, + pulPartLen, ) } pub unsafe fn C_SignEncryptUpdate( &self, - session: CK_SESSION_HANDLE, - part: *mut ::std::os::raw::c_uchar, - part_len: ::std::os::raw::c_ulong, - encrypted_part: *mut ::std::os::raw::c_uchar, - encrypted_part_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pPart: CK_BYTE_PTR, + ulPartLen: CK_ULONG, + pEncryptedPart: CK_BYTE_PTR, + pulEncryptedPartLen: CK_ULONG_PTR, ) -> CK_RV { (self .C_SignEncryptUpdate .as_ref() .expect("Expected function, got error."))( - session, - part, - part_len, - encrypted_part, - encrypted_part_len, + hSession, + pPart, + ulPartLen, + pEncryptedPart, + pulEncryptedPartLen, ) } pub unsafe fn C_DecryptVerifyUpdate( &self, - session: CK_SESSION_HANDLE, - encrypted_part: *mut ::std::os::raw::c_uchar, - encrypted_part_len: ::std::os::raw::c_ulong, - part: *mut ::std::os::raw::c_uchar, - part_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pEncryptedPart: CK_BYTE_PTR, + ulEncryptedPartLen: CK_ULONG, + pPart: CK_BYTE_PTR, + pulPartLen: CK_ULONG_PTR, ) -> CK_RV { (self .C_DecryptVerifyUpdate .as_ref() .expect("Expected function, got error."))( - session, - encrypted_part, - encrypted_part_len, - part, - part_len, + hSession, + pEncryptedPart, + ulEncryptedPartLen, + pPart, + pulPartLen, ) } pub unsafe fn C_GenerateKey( &self, - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - templ: *mut _CK_ATTRIBUTE, - ulCount: ::std::os::raw::c_ulong, - key: *mut CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + pTemplate: CK_ATTRIBUTE_PTR, + ulCount: CK_ULONG, + phKey: CK_OBJECT_HANDLE_PTR, ) -> CK_RV { (self .C_GenerateKey .as_ref() .expect("Expected function, got error."))( - session, mechanism, templ, ulCount, key + hSession, pMechanism, pTemplate, ulCount, phKey, ) } pub unsafe fn C_GenerateKeyPair( &self, - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - public_key_template: *mut _CK_ATTRIBUTE, - public_key_attribute_count: ::std::os::raw::c_ulong, - private_key_template: *mut _CK_ATTRIBUTE, - private_key_attribute_count: ::std::os::raw::c_ulong, - public_key: *mut CK_OBJECT_HANDLE, - private_key: *mut CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + pPublicKeyTemplate: CK_ATTRIBUTE_PTR, + ulPublicKeyAttributeCount: CK_ULONG, + pPrivateKeyTemplate: CK_ATTRIBUTE_PTR, + ulPrivateKeyAttributeCount: CK_ULONG, + phPublicKey: CK_OBJECT_HANDLE_PTR, + phPrivateKey: CK_OBJECT_HANDLE_PTR, ) -> CK_RV { (self .C_GenerateKeyPair .as_ref() .expect("Expected function, got error."))( - session, - mechanism, - public_key_template, - public_key_attribute_count, - private_key_template, - private_key_attribute_count, - public_key, - private_key, + hSession, + pMechanism, + pPublicKeyTemplate, + ulPublicKeyAttributeCount, + pPrivateKeyTemplate, + ulPrivateKeyAttributeCount, + phPublicKey, + phPrivateKey, ) } pub unsafe fn C_WrapKey( &self, - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - wrapping_key: CK_OBJECT_HANDLE, - key: CK_OBJECT_HANDLE, - wrapped_key: *mut ::std::os::raw::c_uchar, - wrapped_key_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hWrappingKey: CK_OBJECT_HANDLE, + hKey: CK_OBJECT_HANDLE, + pWrappedKey: CK_BYTE_PTR, + pulWrappedKeyLen: CK_ULONG_PTR, ) -> CK_RV { (self .C_WrapKey .as_ref() .expect("Expected function, got error."))( - session, - mechanism, - wrapping_key, - key, - wrapped_key, - wrapped_key_len, + hSession, + pMechanism, + hWrappingKey, + hKey, + pWrappedKey, + pulWrappedKeyLen, ) } pub unsafe fn C_UnwrapKey( &self, - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - unwrapping_key: CK_OBJECT_HANDLE, - wrapped_key: *mut ::std::os::raw::c_uchar, - wrapped_key_len: ::std::os::raw::c_ulong, - templ: *mut _CK_ATTRIBUTE, - attribute_count: ::std::os::raw::c_ulong, - key: *mut CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hUnwrappingKey: CK_OBJECT_HANDLE, + pWrappedKey: CK_BYTE_PTR, + ulWrappedKeyLen: CK_ULONG, + pTemplate: CK_ATTRIBUTE_PTR, + ulAttributeCount: CK_ULONG, + phKey: CK_OBJECT_HANDLE_PTR, ) -> CK_RV { (self .C_UnwrapKey .as_ref() .expect("Expected function, got error."))( - session, - mechanism, - unwrapping_key, - wrapped_key, - wrapped_key_len, - templ, - attribute_count, - key, + hSession, + pMechanism, + hUnwrappingKey, + pWrappedKey, + ulWrappedKeyLen, + pTemplate, + ulAttributeCount, + phKey, ) } pub unsafe fn C_DeriveKey( &self, - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - base_key: CK_OBJECT_HANDLE, - templ: *mut _CK_ATTRIBUTE, - attribute_count: ::std::os::raw::c_ulong, - key: *mut CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hBaseKey: CK_OBJECT_HANDLE, + pTemplate: CK_ATTRIBUTE_PTR, + ulAttributeCount: CK_ULONG, + phKey: CK_OBJECT_HANDLE_PTR, ) -> CK_RV { (self .C_DeriveKey .as_ref() .expect("Expected function, got error."))( - session, - mechanism, - base_key, - templ, - attribute_count, - key, + hSession, + pMechanism, + hBaseKey, + pTemplate, + ulAttributeCount, + phKey, ) } pub unsafe fn C_SeedRandom( &self, - session: CK_SESSION_HANDLE, - seed: *mut ::std::os::raw::c_uchar, - seed_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pSeed: CK_BYTE_PTR, + ulSeedLen: CK_ULONG, ) -> CK_RV { (self .C_SeedRandom .as_ref() - .expect("Expected function, got error."))(session, seed, seed_len) + .expect("Expected function, got error."))(hSession, pSeed, ulSeedLen) } pub unsafe fn C_GenerateRandom( &self, - session: CK_SESSION_HANDLE, - random_data: *mut ::std::os::raw::c_uchar, - random_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + RandomData: CK_BYTE_PTR, + ulRandomLen: CK_ULONG, ) -> CK_RV { (self .C_GenerateRandom .as_ref() - .expect("Expected function, got error."))(session, random_data, random_len) + .expect("Expected function, got error."))(hSession, RandomData, ulRandomLen) } - pub unsafe fn C_GetFunctionStatus(&self, session: CK_SESSION_HANDLE) -> CK_RV { + pub unsafe fn C_GetFunctionStatus(&self, hSession: CK_SESSION_HANDLE) -> CK_RV { (self .C_GetFunctionStatus .as_ref() - .expect("Expected function, got error."))(session) + .expect("Expected function, got error."))(hSession) } - pub unsafe fn C_CancelFunction(&self, session: CK_SESSION_HANDLE) -> CK_RV { + pub unsafe fn C_CancelFunction(&self, hSession: CK_SESSION_HANDLE) -> CK_RV { (self .C_CancelFunction .as_ref() - .expect("Expected function, got error."))(session) + .expect("Expected function, got error."))(hSession) + } + pub unsafe fn C_WaitForSlotEvent( + &self, + flags: CK_FLAGS, + pSlot: CK_SLOT_ID_PTR, + pRserved: CK_VOID_PTR, + ) -> CK_RV { + (self + .C_WaitForSlotEvent + .as_ref() + .expect("Expected function, got error."))(flags, pSlot, pRserved) + } + pub unsafe fn C_GetInterfaceList( + &self, + pInterfacesList: CK_INTERFACE_PTR, + pulCount: CK_ULONG_PTR, + ) -> CK_RV { + (self + .C_GetInterfaceList + .as_ref() + .expect("Expected function, got error."))(pInterfacesList, pulCount) + } + pub unsafe fn C_GetInterface( + &self, + pInterfaceName: CK_UTF8CHAR_PTR, + pVersion: CK_VERSION_PTR, + ppInterface: CK_INTERFACE_PTR_PTR, + flags: CK_FLAGS, + ) -> CK_RV { + (self + .C_GetInterface + .as_ref() + .expect("Expected function, got error."))( + pInterfaceName, pVersion, ppInterface, flags + ) + } + pub unsafe fn C_LoginUser( + &self, + hSession: CK_SESSION_HANDLE, + userType: CK_USER_TYPE, + pPin: CK_UTF8CHAR_PTR, + ulPinLen: CK_ULONG, + pUsername: CK_UTF8CHAR_PTR, + ulUsernameLen: CK_ULONG, + ) -> CK_RV { + (self + .C_LoginUser + .as_ref() + .expect("Expected function, got error."))( + hSession, + userType, + pPin, + ulPinLen, + pUsername, + ulUsernameLen, + ) + } + pub unsafe fn C_SessionCancel(&self, hSession: CK_SESSION_HANDLE, flags: CK_FLAGS) -> CK_RV { + (self + .C_SessionCancel + .as_ref() + .expect("Expected function, got error."))(hSession, flags) + } + pub unsafe fn C_MessageEncryptInit( + &self, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, + ) -> CK_RV { + (self + .C_MessageEncryptInit + .as_ref() + .expect("Expected function, got error."))(hSession, pMechanism, hKey) + } + pub unsafe fn C_EncryptMessage( + &self, + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pAssociatedData: CK_BYTE_PTR, + ulAssociatedDataLen: CK_ULONG, + pPlaintext: CK_BYTE_PTR, + ulPlaintextLen: CK_ULONG, + pCiphertext: CK_BYTE_PTR, + pulCiphertextLen: CK_ULONG_PTR, + ) -> CK_RV { + (self + .C_EncryptMessage + .as_ref() + .expect("Expected function, got error."))( + hSession, + pParameter, + ulParameterLen, + pAssociatedData, + ulAssociatedDataLen, + pPlaintext, + ulPlaintextLen, + pCiphertext, + pulCiphertextLen, + ) + } + pub unsafe fn C_EncryptMessageBegin( + &self, + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pAssociatedData: CK_BYTE_PTR, + ulAssociatedDataLen: CK_ULONG, + ) -> CK_RV { + (self + .C_EncryptMessageBegin + .as_ref() + .expect("Expected function, got error."))( + hSession, + pParameter, + ulParameterLen, + pAssociatedData, + ulAssociatedDataLen, + ) + } + pub unsafe fn C_EncryptMessageNext( + &self, + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pPlaintextPart: CK_BYTE_PTR, + ulPlaintextPartLen: CK_ULONG, + pCiphertextPart: CK_BYTE_PTR, + pulCiphertextPartLen: CK_ULONG_PTR, + flags: CK_FLAGS, + ) -> CK_RV { + (self + .C_EncryptMessageNext + .as_ref() + .expect("Expected function, got error."))( + hSession, + pParameter, + ulParameterLen, + pPlaintextPart, + ulPlaintextPartLen, + pCiphertextPart, + pulCiphertextPartLen, + flags, + ) + } + pub unsafe fn C_MessageEncryptFinal(&self, hSession: CK_SESSION_HANDLE) -> CK_RV { + (self + .C_MessageEncryptFinal + .as_ref() + .expect("Expected function, got error."))(hSession) + } + pub unsafe fn C_MessageDecryptInit( + &self, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, + ) -> CK_RV { + (self + .C_MessageDecryptInit + .as_ref() + .expect("Expected function, got error."))(hSession, pMechanism, hKey) + } + pub unsafe fn C_DecryptMessage( + &self, + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pAssociatedData: CK_BYTE_PTR, + ulAssociatedDataLen: CK_ULONG, + pCiphertext: CK_BYTE_PTR, + ulCiphertextLen: CK_ULONG, + pPlaintext: CK_BYTE_PTR, + pulPlaintextLen: CK_ULONG_PTR, + ) -> CK_RV { + (self + .C_DecryptMessage + .as_ref() + .expect("Expected function, got error."))( + hSession, + pParameter, + ulParameterLen, + pAssociatedData, + ulAssociatedDataLen, + pCiphertext, + ulCiphertextLen, + pPlaintext, + pulPlaintextLen, + ) + } + pub unsafe fn C_DecryptMessageBegin( + &self, + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pAssociatedData: CK_BYTE_PTR, + ulAssociatedDataLen: CK_ULONG, + ) -> CK_RV { + (self + .C_DecryptMessageBegin + .as_ref() + .expect("Expected function, got error."))( + hSession, + pParameter, + ulParameterLen, + pAssociatedData, + ulAssociatedDataLen, + ) + } + pub unsafe fn C_DecryptMessageNext( + &self, + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pCiphertext: CK_BYTE_PTR, + ulCiphertextLen: CK_ULONG, + pPlaintext: CK_BYTE_PTR, + pulPlaintextLen: CK_ULONG_PTR, + flags: CK_FLAGS, + ) -> CK_RV { + (self + .C_DecryptMessageNext + .as_ref() + .expect("Expected function, got error."))( + hSession, + pParameter, + ulParameterLen, + pCiphertext, + ulCiphertextLen, + pPlaintext, + pulPlaintextLen, + flags, + ) + } + pub unsafe fn C_MessageDecryptFinal(&self, hSession: CK_SESSION_HANDLE) -> CK_RV { + (self + .C_MessageDecryptFinal + .as_ref() + .expect("Expected function, got error."))(hSession) + } + pub unsafe fn C_MessageSignInit( + &self, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, + ) -> CK_RV { + (self + .C_MessageSignInit + .as_ref() + .expect("Expected function, got error."))(hSession, pMechanism, hKey) + } + pub unsafe fn C_SignMessage( + &self, + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + pulSignatureLen: CK_ULONG_PTR, + ) -> CK_RV { + (self + .C_SignMessage + .as_ref() + .expect("Expected function, got error."))( + hSession, + pParameter, + ulParameterLen, + pData, + ulDataLen, + pSignature, + pulSignatureLen, + ) + } + pub unsafe fn C_SignMessageBegin( + &self, + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + ) -> CK_RV { + (self + .C_SignMessageBegin + .as_ref() + .expect("Expected function, got error."))(hSession, pParameter, ulParameterLen) + } + pub unsafe fn C_SignMessageNext( + &self, + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + pulSignatureLen: CK_ULONG_PTR, + ) -> CK_RV { + (self + .C_SignMessageNext + .as_ref() + .expect("Expected function, got error."))( + hSession, + pParameter, + ulParameterLen, + pData, + ulDataLen, + pSignature, + pulSignatureLen, + ) + } + pub unsafe fn C_MessageSignFinal(&self, hSession: CK_SESSION_HANDLE) -> CK_RV { + (self + .C_MessageSignFinal + .as_ref() + .expect("Expected function, got error."))(hSession) + } + pub unsafe fn C_MessageVerifyInit( + &self, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, + ) -> CK_RV { + (self + .C_MessageVerifyInit + .as_ref() + .expect("Expected function, got error."))(hSession, pMechanism, hKey) + } + pub unsafe fn C_VerifyMessage( + &self, + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + ulSignatureLen: CK_ULONG, + ) -> CK_RV { + (self + .C_VerifyMessage + .as_ref() + .expect("Expected function, got error."))( + hSession, + pParameter, + ulParameterLen, + pData, + ulDataLen, + pSignature, + ulSignatureLen, + ) + } + pub unsafe fn C_VerifyMessageBegin( + &self, + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + ) -> CK_RV { + (self + .C_VerifyMessageBegin + .as_ref() + .expect("Expected function, got error."))(hSession, pParameter, ulParameterLen) + } + pub unsafe fn C_VerifyMessageNext( + &self, + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + ulSignatureLen: CK_ULONG, + ) -> CK_RV { + (self + .C_VerifyMessageNext + .as_ref() + .expect("Expected function, got error."))( + hSession, + pParameter, + ulParameterLen, + pData, + ulDataLen, + pSignature, + ulSignatureLen, + ) + } + pub unsafe fn C_MessageVerifyFinal(&self, hSession: CK_SESSION_HANDLE) -> CK_RV { + (self + .C_MessageVerifyFinal + .as_ref() + .expect("Expected function, got error."))(hSession) } } diff --git a/cryptoki-sys/src/bindings/x86_64-unknown-freebsd.rs b/cryptoki-sys/src/bindings/x86_64-unknown-freebsd.rs index 6800365c..c4200fb4 100644 --- a/cryptoki-sys/src/bindings/x86_64-unknown-freebsd.rs +++ b/cryptoki-sys/src/bindings/x86_64-unknown-freebsd.rs @@ -1,10 +1,22 @@ /* automatically generated by rust-bindgen 0.63.0 */ -pub const PKCS11_H: u32 = 1; -pub const CRYPTOKI_VERSION_MAJOR: CK_BYTE = 2; -pub const CRYPTOKI_VERSION_MINOR: CK_BYTE = 40; -pub const P11_KIT_CRYPTOKI_VERSION_REVISION: u32 = 0; -pub const CRYPTOKI_COMPAT: u32 = 1; +pub const NULL_PTR: u32 = 0; +pub const _PKCS11_H_: u32 = 1; +pub const _PKCS11T_H_: u32 = 1; +pub const CRYPTOKI_VERSION_MAJOR: CK_BYTE = 3; +pub const CRYPTOKI_VERSION_MINOR: CK_BYTE = 0; +pub const CRYPTOKI_VERSION_AMENDMENT: CK_BYTE = 0; +pub const CK_TRUE: CK_BBOOL = 1; +pub const CK_FALSE: CK_BBOOL = 0; +pub const FALSE: u32 = 0; +pub const TRUE: u32 = 1; +pub const CK_EFFECTIVELY_INFINITE: CK_ULONG = 0; +pub const CK_INVALID_HANDLE: CK_ULONG = 0; +pub const CKN_SURRENDER: CK_NOTIFICATION = 0; +pub const CKN_OTP_CHANGED: CK_NOTIFICATION = 1; +pub const CKF_TOKEN_PRESENT: CK_FLAGS = 1; +pub const CKF_REMOVABLE_DEVICE: CK_FLAGS = 2; +pub const CKF_HW_SLOT: CK_FLAGS = 4; pub const CKF_RNG: CK_FLAGS = 1; pub const CKF_WRITE_PROTECTED: CK_FLAGS = 2; pub const CKF_LOGIN_REQUIRED: CK_FLAGS = 4; @@ -24,8 +36,6 @@ pub const CKF_SO_PIN_FINAL_TRY: CK_FLAGS = 2097152; pub const CKF_SO_PIN_LOCKED: CK_FLAGS = 4194304; pub const CKF_SO_PIN_TO_BE_CHANGED: CK_FLAGS = 8388608; pub const CKF_ERROR_STATE: CK_FLAGS = 16777216; -pub const CK_EFFECTIVELY_INFINITE: CK_ULONG = 0; -pub const CK_INVALID_HANDLE: CK_ULONG = 0; pub const CKU_SO: CK_USER_TYPE = 0; pub const CKU_USER: CK_USER_TYPE = 1; pub const CKU_CONTEXT_SPECIFIC: CK_USER_TYPE = 2; @@ -45,9 +55,18 @@ pub const CKO_HW_FEATURE: CK_OBJECT_CLASS = 5; pub const CKO_DOMAIN_PARAMETERS: CK_OBJECT_CLASS = 6; pub const CKO_MECHANISM: CK_OBJECT_CLASS = 7; pub const CKO_OTP_KEY: CK_OBJECT_CLASS = 8; +pub const CKO_PROFILE: CK_OBJECT_CLASS = 9; +pub const CKO_VENDOR_DEFINED: CK_OBJECT_CLASS = 2147483648; +pub const CKP_INVALID_ID: CK_PROFILE_ID = 0; +pub const CKP_BASELINE_PROVIDER: CK_PROFILE_ID = 1; +pub const CKP_EXTENDED_PROVIDER: CK_PROFILE_ID = 2; +pub const CKP_AUTHENTICATION_TOKEN: CK_PROFILE_ID = 3; +pub const CKP_PUBLIC_CERTIFICATES_TOKEN: CK_PROFILE_ID = 4; +pub const CKP_VENDOR_DEFINED: CK_PROFILE_ID = 2147483648; pub const CKH_MONOTONIC_COUNTER: CK_HW_FEATURE_TYPE = 1; pub const CKH_CLOCK: CK_HW_FEATURE_TYPE = 2; pub const CKH_USER_INTERFACE: CK_HW_FEATURE_TYPE = 3; +pub const CKH_VENDOR_DEFINED: CK_HW_FEATURE_TYPE = 2147483648; pub const CKK_RSA: CK_KEY_TYPE = 0; pub const CKK_DSA: CK_KEY_TYPE = 1; pub const CKK_DH: CK_KEY_TYPE = 2; @@ -63,6 +82,7 @@ pub const CKK_DES2: CK_KEY_TYPE = 20; pub const CKK_DES3: CK_KEY_TYPE = 21; pub const CKK_CAST: CK_KEY_TYPE = 22; pub const CKK_CAST3: CK_KEY_TYPE = 23; +pub const CKK_CAST5: CK_KEY_TYPE = 24; pub const CKK_CAST128: CK_KEY_TYPE = 24; pub const CKK_RC5: CK_KEY_TYPE = 25; pub const CKK_IDEA: CK_KEY_TYPE = 26; @@ -90,14 +110,48 @@ pub const CKK_SEED: CK_KEY_TYPE = 47; pub const CKK_GOSTR3410: CK_KEY_TYPE = 48; pub const CKK_GOSTR3411: CK_KEY_TYPE = 49; pub const CKK_GOST28147: CK_KEY_TYPE = 50; +pub const CKK_CHACHA20: CK_KEY_TYPE = 51; +pub const CKK_POLY1305: CK_KEY_TYPE = 52; +pub const CKK_AES_XTS: CK_KEY_TYPE = 53; +pub const CKK_SHA3_224_HMAC: CK_KEY_TYPE = 54; +pub const CKK_SHA3_256_HMAC: CK_KEY_TYPE = 55; +pub const CKK_SHA3_384_HMAC: CK_KEY_TYPE = 56; +pub const CKK_SHA3_512_HMAC: CK_KEY_TYPE = 57; +pub const CKK_BLAKE2B_160_HMAC: CK_KEY_TYPE = 58; +pub const CKK_BLAKE2B_256_HMAC: CK_KEY_TYPE = 59; +pub const CKK_BLAKE2B_384_HMAC: CK_KEY_TYPE = 60; +pub const CKK_BLAKE2B_512_HMAC: CK_KEY_TYPE = 61; +pub const CKK_SALSA20: CK_KEY_TYPE = 62; +pub const CKK_X2RATCHET: CK_KEY_TYPE = 63; pub const CKK_EC_EDWARDS: CK_KEY_TYPE = 64; +pub const CKK_EC_MONTGOMERY: CK_KEY_TYPE = 65; +pub const CKK_HKDF: CK_KEY_TYPE = 66; +pub const CKK_VENDOR_DEFINED: CK_KEY_TYPE = 2147483648; +pub const CK_CERTIFICATE_CATEGORY_UNSPECIFIED: CK_ULONG = 0; +pub const CK_CERTIFICATE_CATEGORY_TOKEN_USER: CK_ULONG = 1; +pub const CK_CERTIFICATE_CATEGORY_AUTHORITY: CK_ULONG = 2; +pub const CK_CERTIFICATE_CATEGORY_OTHER_ENTITY: CK_ULONG = 3; +pub const CK_SECURITY_DOMAIN_UNSPECIFIED: CK_ULONG = 0; +pub const CK_SECURITY_DOMAIN_MANUFACTURER: CK_ULONG = 1; +pub const CK_SECURITY_DOMAIN_OPERATOR: CK_ULONG = 2; +pub const CK_SECURITY_DOMAIN_THIRD_PARTY: CK_ULONG = 3; pub const CKC_X_509: CK_CERTIFICATE_TYPE = 0; pub const CKC_X_509_ATTR_CERT: CK_CERTIFICATE_TYPE = 1; pub const CKC_WTLS: CK_CERTIFICATE_TYPE = 2; +pub const CKC_VENDOR_DEFINED: CK_CERTIFICATE_TYPE = 2147483648; +pub const CKF_ARRAY_ATTRIBUTE: CK_FLAGS = 1073741824; +pub const CK_OTP_FORMAT_DECIMAL: CK_ULONG = 0; +pub const CK_OTP_FORMAT_HEXADECIMAL: CK_ULONG = 1; +pub const CK_OTP_FORMAT_ALPHANUMERIC: CK_ULONG = 2; +pub const CK_OTP_FORMAT_BINARY: CK_ULONG = 3; +pub const CK_OTP_PARAM_IGNORED: CK_ULONG = 0; +pub const CK_OTP_PARAM_OPTIONAL: CK_ULONG = 1; +pub const CK_OTP_PARAM_MANDATORY: CK_ULONG = 2; pub const CKA_CLASS: CK_ATTRIBUTE_TYPE = 0; pub const CKA_TOKEN: CK_ATTRIBUTE_TYPE = 1; pub const CKA_PRIVATE: CK_ATTRIBUTE_TYPE = 2; pub const CKA_LABEL: CK_ATTRIBUTE_TYPE = 3; +pub const CKA_UNIQUE_ID: CK_ATTRIBUTE_TYPE = 4; pub const CKA_APPLICATION: CK_ATTRIBUTE_TYPE = 16; pub const CKA_VALUE: CK_ATTRIBUTE_TYPE = 17; pub const CKA_OBJECT_ID: CK_ATTRIBUTE_TYPE = 18; @@ -144,6 +198,7 @@ pub const CKA_PRIME: CK_ATTRIBUTE_TYPE = 304; pub const CKA_SUBPRIME: CK_ATTRIBUTE_TYPE = 305; pub const CKA_BASE: CK_ATTRIBUTE_TYPE = 306; pub const CKA_PRIME_BITS: CK_ATTRIBUTE_TYPE = 307; +pub const CKA_SUBPRIME_BITS: CK_ATTRIBUTE_TYPE = 308; pub const CKA_SUB_PRIME_BITS: CK_ATTRIBUTE_TYPE = 308; pub const CKA_VALUE_BITS: CK_ATTRIBUTE_TYPE = 352; pub const CKA_VALUE_LEN: CK_ATTRIBUTE_TYPE = 353; @@ -162,6 +217,9 @@ pub const CKA_SECONDARY_AUTH: CK_ATTRIBUTE_TYPE = 512; pub const CKA_AUTH_PIN_FLAGS: CK_ATTRIBUTE_TYPE = 513; pub const CKA_ALWAYS_AUTHENTICATE: CK_ATTRIBUTE_TYPE = 514; pub const CKA_WRAP_WITH_TRUSTED: CK_ATTRIBUTE_TYPE = 528; +pub const CKA_WRAP_TEMPLATE: CK_ATTRIBUTE_TYPE = 1073742353; +pub const CKA_UNWRAP_TEMPLATE: CK_ATTRIBUTE_TYPE = 1073742354; +pub const CKA_DERIVE_TEMPLATE: CK_ATTRIBUTE_TYPE = 1073742355; pub const CKA_OTP_FORMAT: CK_ATTRIBUTE_TYPE = 544; pub const CKA_OTP_LENGTH: CK_ATTRIBUTE_TYPE = 545; pub const CKA_OTP_TIME_INTERVAL: CK_ATTRIBUTE_TYPE = 546; @@ -170,12 +228,12 @@ pub const CKA_OTP_CHALLENGE_REQUIREMENT: CK_ATTRIBUTE_TYPE = 548; pub const CKA_OTP_TIME_REQUIREMENT: CK_ATTRIBUTE_TYPE = 549; pub const CKA_OTP_COUNTER_REQUIREMENT: CK_ATTRIBUTE_TYPE = 550; pub const CKA_OTP_PIN_REQUIREMENT: CK_ATTRIBUTE_TYPE = 551; +pub const CKA_OTP_COUNTER: CK_ATTRIBUTE_TYPE = 558; +pub const CKA_OTP_TIME: CK_ATTRIBUTE_TYPE = 559; pub const CKA_OTP_USER_IDENTIFIER: CK_ATTRIBUTE_TYPE = 554; pub const CKA_OTP_SERVICE_IDENTIFIER: CK_ATTRIBUTE_TYPE = 555; pub const CKA_OTP_SERVICE_LOGO: CK_ATTRIBUTE_TYPE = 556; pub const CKA_OTP_SERVICE_LOGO_TYPE: CK_ATTRIBUTE_TYPE = 557; -pub const CKA_OTP_COUNTER: CK_ATTRIBUTE_TYPE = 558; -pub const CKA_OTP_TIME: CK_ATTRIBUTE_TYPE = 559; pub const CKA_GOSTR3410_PARAMS: CK_ATTRIBUTE_TYPE = 592; pub const CKA_GOSTR3411_PARAMS: CK_ATTRIBUTE_TYPE = 593; pub const CKA_GOST28147_PARAMS: CK_ATTRIBUTE_TYPE = 594; @@ -196,6 +254,9 @@ pub const CKA_MECHANISM_TYPE: CK_ATTRIBUTE_TYPE = 1280; pub const CKA_REQUIRED_CMS_ATTRIBUTES: CK_ATTRIBUTE_TYPE = 1281; pub const CKA_DEFAULT_CMS_ATTRIBUTES: CK_ATTRIBUTE_TYPE = 1282; pub const CKA_SUPPORTED_CMS_ATTRIBUTES: CK_ATTRIBUTE_TYPE = 1283; +pub const CKA_ALLOWED_MECHANISMS: CK_ATTRIBUTE_TYPE = 1073743360; +pub const CKA_PROFILE_ID: CK_ATTRIBUTE_TYPE = 1537; +pub const CKA_VENDOR_DEFINED: CK_ATTRIBUTE_TYPE = 2147483648; pub const CKM_RSA_PKCS_KEY_PAIR_GEN: CK_MECHANISM_TYPE = 0; pub const CKM_RSA_PKCS: CK_MECHANISM_TYPE = 1; pub const CKM_RSA_9796: CK_MECHANISM_TYPE = 2; @@ -218,6 +279,10 @@ pub const CKM_DSA_SHA224: CK_MECHANISM_TYPE = 19; pub const CKM_DSA_SHA256: CK_MECHANISM_TYPE = 20; pub const CKM_DSA_SHA384: CK_MECHANISM_TYPE = 21; pub const CKM_DSA_SHA512: CK_MECHANISM_TYPE = 22; +pub const CKM_DSA_SHA3_224: CK_MECHANISM_TYPE = 24; +pub const CKM_DSA_SHA3_256: CK_MECHANISM_TYPE = 25; +pub const CKM_DSA_SHA3_384: CK_MECHANISM_TYPE = 26; +pub const CKM_DSA_SHA3_512: CK_MECHANISM_TYPE = 27; pub const CKM_DH_PKCS_KEY_PAIR_GEN: CK_MECHANISM_TYPE = 32; pub const CKM_DH_PKCS_DERIVE: CK_MECHANISM_TYPE = 33; pub const CKM_X9_42_DH_KEY_PAIR_GEN: CK_MECHANISM_TYPE = 48; @@ -230,6 +295,8 @@ pub const CKM_SHA512_RSA_PKCS: CK_MECHANISM_TYPE = 66; pub const CKM_SHA256_RSA_PKCS_PSS: CK_MECHANISM_TYPE = 67; pub const CKM_SHA384_RSA_PKCS_PSS: CK_MECHANISM_TYPE = 68; pub const CKM_SHA512_RSA_PKCS_PSS: CK_MECHANISM_TYPE = 69; +pub const CKM_SHA224_RSA_PKCS: CK_MECHANISM_TYPE = 70; +pub const CKM_SHA224_RSA_PKCS_PSS: CK_MECHANISM_TYPE = 71; pub const CKM_SHA512_224: CK_MECHANISM_TYPE = 72; pub const CKM_SHA512_224_HMAC: CK_MECHANISM_TYPE = 73; pub const CKM_SHA512_224_HMAC_GENERAL: CK_MECHANISM_TYPE = 74; @@ -242,6 +309,14 @@ pub const CKM_SHA512_T: CK_MECHANISM_TYPE = 80; pub const CKM_SHA512_T_HMAC: CK_MECHANISM_TYPE = 81; pub const CKM_SHA512_T_HMAC_GENERAL: CK_MECHANISM_TYPE = 82; pub const CKM_SHA512_T_KEY_DERIVATION: CK_MECHANISM_TYPE = 83; +pub const CKM_SHA3_256_RSA_PKCS: CK_MECHANISM_TYPE = 96; +pub const CKM_SHA3_384_RSA_PKCS: CK_MECHANISM_TYPE = 97; +pub const CKM_SHA3_512_RSA_PKCS: CK_MECHANISM_TYPE = 98; +pub const CKM_SHA3_256_RSA_PKCS_PSS: CK_MECHANISM_TYPE = 99; +pub const CKM_SHA3_384_RSA_PKCS_PSS: CK_MECHANISM_TYPE = 100; +pub const CKM_SHA3_512_RSA_PKCS_PSS: CK_MECHANISM_TYPE = 101; +pub const CKM_SHA3_224_RSA_PKCS: CK_MECHANISM_TYPE = 102; +pub const CKM_SHA3_224_RSA_PKCS_PSS: CK_MECHANISM_TYPE = 103; pub const CKM_RC2_KEY_GEN: CK_MECHANISM_TYPE = 256; pub const CKM_RC2_ECB: CK_MECHANISM_TYPE = 257; pub const CKM_RC2_CBC: CK_MECHANISM_TYPE = 258; @@ -293,6 +368,9 @@ pub const CKM_RIPEMD160_HMAC_GENERAL: CK_MECHANISM_TYPE = 578; pub const CKM_SHA256: CK_MECHANISM_TYPE = 592; pub const CKM_SHA256_HMAC: CK_MECHANISM_TYPE = 593; pub const CKM_SHA256_HMAC_GENERAL: CK_MECHANISM_TYPE = 594; +pub const CKM_SHA224: CK_MECHANISM_TYPE = 597; +pub const CKM_SHA224_HMAC: CK_MECHANISM_TYPE = 598; +pub const CKM_SHA224_HMAC_GENERAL: CK_MECHANISM_TYPE = 599; pub const CKM_SHA384: CK_MECHANISM_TYPE = 608; pub const CKM_SHA384_HMAC: CK_MECHANISM_TYPE = 609; pub const CKM_SHA384_HMAC_GENERAL: CK_MECHANISM_TYPE = 610; @@ -305,6 +383,22 @@ pub const CKM_HOTP_KEY_GEN: CK_MECHANISM_TYPE = 656; pub const CKM_HOTP: CK_MECHANISM_TYPE = 657; pub const CKM_ACTI: CK_MECHANISM_TYPE = 672; pub const CKM_ACTI_KEY_GEN: CK_MECHANISM_TYPE = 673; +pub const CKM_SHA3_256: CK_MECHANISM_TYPE = 688; +pub const CKM_SHA3_256_HMAC: CK_MECHANISM_TYPE = 689; +pub const CKM_SHA3_256_HMAC_GENERAL: CK_MECHANISM_TYPE = 690; +pub const CKM_SHA3_256_KEY_GEN: CK_MECHANISM_TYPE = 691; +pub const CKM_SHA3_224: CK_MECHANISM_TYPE = 693; +pub const CKM_SHA3_224_HMAC: CK_MECHANISM_TYPE = 694; +pub const CKM_SHA3_224_HMAC_GENERAL: CK_MECHANISM_TYPE = 695; +pub const CKM_SHA3_224_KEY_GEN: CK_MECHANISM_TYPE = 696; +pub const CKM_SHA3_384: CK_MECHANISM_TYPE = 704; +pub const CKM_SHA3_384_HMAC: CK_MECHANISM_TYPE = 705; +pub const CKM_SHA3_384_HMAC_GENERAL: CK_MECHANISM_TYPE = 706; +pub const CKM_SHA3_384_KEY_GEN: CK_MECHANISM_TYPE = 707; +pub const CKM_SHA3_512: CK_MECHANISM_TYPE = 720; +pub const CKM_SHA3_512_HMAC: CK_MECHANISM_TYPE = 721; +pub const CKM_SHA3_512_HMAC_GENERAL: CK_MECHANISM_TYPE = 722; +pub const CKM_SHA3_512_KEY_GEN: CK_MECHANISM_TYPE = 723; pub const CKM_CAST_KEY_GEN: CK_MECHANISM_TYPE = 768; pub const CKM_CAST_ECB: CK_MECHANISM_TYPE = 769; pub const CKM_CAST_CBC: CK_MECHANISM_TYPE = 770; @@ -364,6 +458,13 @@ pub const CKM_SHA1_KEY_DERIVATION: CK_MECHANISM_TYPE = 914; pub const CKM_SHA256_KEY_DERIVATION: CK_MECHANISM_TYPE = 915; pub const CKM_SHA384_KEY_DERIVATION: CK_MECHANISM_TYPE = 916; pub const CKM_SHA512_KEY_DERIVATION: CK_MECHANISM_TYPE = 917; +pub const CKM_SHA224_KEY_DERIVATION: CK_MECHANISM_TYPE = 918; +pub const CKM_SHA3_256_KEY_DERIVE: CK_MECHANISM_TYPE = 919; +pub const CKM_SHA3_224_KEY_DERIVE: CK_MECHANISM_TYPE = 920; +pub const CKM_SHA3_384_KEY_DERIVE: CK_MECHANISM_TYPE = 921; +pub const CKM_SHA3_512_KEY_DERIVE: CK_MECHANISM_TYPE = 922; +pub const CKM_SHAKE_128_KEY_DERIVE: CK_MECHANISM_TYPE = 923; +pub const CKM_SHAKE_256_KEY_DERIVE: CK_MECHANISM_TYPE = 924; pub const CKM_PBE_MD2_DES_CBC: CK_MECHANISM_TYPE = 928; pub const CKM_PBE_MD5_DES_CBC: CK_MECHANISM_TYPE = 929; pub const CKM_PBE_MD5_CAST_CBC: CK_MECHANISM_TYPE = 930; @@ -403,6 +504,13 @@ pub const CKM_KIP_DERIVE: CK_MECHANISM_TYPE = 1296; pub const CKM_KIP_WRAP: CK_MECHANISM_TYPE = 1297; pub const CKM_KIP_MAC: CK_MECHANISM_TYPE = 1298; pub const CKM_CAMELLIA_KEY_GEN: CK_MECHANISM_TYPE = 1360; +pub const CKM_CAMELLIA_ECB: CK_MECHANISM_TYPE = 1361; +pub const CKM_CAMELLIA_CBC: CK_MECHANISM_TYPE = 1362; +pub const CKM_CAMELLIA_MAC: CK_MECHANISM_TYPE = 1363; +pub const CKM_CAMELLIA_MAC_GENERAL: CK_MECHANISM_TYPE = 1364; +pub const CKM_CAMELLIA_CBC_PAD: CK_MECHANISM_TYPE = 1365; +pub const CKM_CAMELLIA_ECB_ENCRYPT_DATA: CK_MECHANISM_TYPE = 1366; +pub const CKM_CAMELLIA_CBC_ENCRYPT_DATA: CK_MECHANISM_TYPE = 1367; pub const CKM_CAMELLIA_CTR: CK_MECHANISM_TYPE = 1368; pub const CKM_ARIA_KEY_GEN: CK_MECHANISM_TYPE = 1376; pub const CKM_ARIA_ECB: CK_MECHANISM_TYPE = 1377; @@ -433,6 +541,7 @@ pub const CKM_SKIPJACK_PRIVATE_WRAP: CK_MECHANISM_TYPE = 4105; pub const CKM_SKIPJACK_RELAYX: CK_MECHANISM_TYPE = 4106; pub const CKM_KEA_KEY_PAIR_GEN: CK_MECHANISM_TYPE = 4112; pub const CKM_KEA_KEY_DERIVE: CK_MECHANISM_TYPE = 4113; +pub const CKM_KEA_DERIVE: CK_MECHANISM_TYPE = 4114; pub const CKM_FORTEZZA_TIMESTAMP: CK_MECHANISM_TYPE = 4128; pub const CKM_BATON_KEY_GEN: CK_MECHANISM_TYPE = 4144; pub const CKM_BATON_ECB128: CK_MECHANISM_TYPE = 4145; @@ -461,6 +570,8 @@ pub const CKM_JUNIPER_COUNTER: CK_MECHANISM_TYPE = 4195; pub const CKM_JUNIPER_SHUFFLE: CK_MECHANISM_TYPE = 4196; pub const CKM_JUNIPER_WRAP: CK_MECHANISM_TYPE = 4197; pub const CKM_FASTHASH: CK_MECHANISM_TYPE = 4208; +pub const CKM_AES_XTS: CK_MECHANISM_TYPE = 4209; +pub const CKM_AES_XTS_KEY_GEN: CK_MECHANISM_TYPE = 4210; pub const CKM_AES_KEY_GEN: CK_MECHANISM_TYPE = 4224; pub const CKM_AES_ECB: CK_MECHANISM_TYPE = 4225; pub const CKM_AES_CBC: CK_MECHANISM_TYPE = 4226; @@ -500,6 +611,10 @@ pub const CKM_GOST28147_ECB: CK_MECHANISM_TYPE = 4641; pub const CKM_GOST28147: CK_MECHANISM_TYPE = 4642; pub const CKM_GOST28147_MAC: CK_MECHANISM_TYPE = 4643; pub const CKM_GOST28147_KEY_WRAP: CK_MECHANISM_TYPE = 4644; +pub const CKM_CHACHA20_KEY_GEN: CK_MECHANISM_TYPE = 4645; +pub const CKM_CHACHA20: CK_MECHANISM_TYPE = 4646; +pub const CKM_POLY1305_KEY_GEN: CK_MECHANISM_TYPE = 4647; +pub const CKM_POLY1305: CK_MECHANISM_TYPE = 4648; pub const CKM_DSA_PARAMETER_GEN: CK_MECHANISM_TYPE = 8192; pub const CKM_DH_PKCS_PARAMETER_GEN: CK_MECHANISM_TYPE = 8193; pub const CKM_X9_42_DH_PARAMETER_GEN: CK_MECHANISM_TYPE = 8194; @@ -510,63 +625,71 @@ pub const CKM_AES_CFB64: CK_MECHANISM_TYPE = 8453; pub const CKM_AES_CFB8: CK_MECHANISM_TYPE = 8454; pub const CKM_AES_CFB128: CK_MECHANISM_TYPE = 8455; pub const CKM_AES_CFB1: CK_MECHANISM_TYPE = 8456; -pub const CKM_SHA224: CK_MECHANISM_TYPE = 597; -pub const CKM_SHA224_HMAC: CK_MECHANISM_TYPE = 598; -pub const CKM_SHA224_HMAC_GENERAL: CK_MECHANISM_TYPE = 599; -pub const CKM_SHA224_RSA_PKCS: CK_MECHANISM_TYPE = 70; -pub const CKM_SHA224_RSA_PKCS_PSS: CK_MECHANISM_TYPE = 71; -pub const CKM_SHA224_KEY_DERIVATION: CK_MECHANISM_TYPE = 918; -pub const CKM_CAMELLIA_ECB: CK_MECHANISM_TYPE = 1361; -pub const CKM_CAMELLIA_CBC: CK_MECHANISM_TYPE = 1362; -pub const CKM_CAMELLIA_MAC: CK_MECHANISM_TYPE = 1363; -pub const CKM_CAMELLIA_MAC_GENERAL: CK_MECHANISM_TYPE = 1364; -pub const CKM_CAMELLIA_CBC_PAD: CK_MECHANISM_TYPE = 1365; -pub const CKM_CAMELLIA_ECB_ENCRYPT_DATA: CK_MECHANISM_TYPE = 1366; -pub const CKM_CAMELLIA_CBC_ENCRYPT_DATA: CK_MECHANISM_TYPE = 1367; pub const CKM_AES_KEY_WRAP: CK_MECHANISM_TYPE = 8457; pub const CKM_AES_KEY_WRAP_PAD: CK_MECHANISM_TYPE = 8458; +pub const CKM_AES_KEY_WRAP_KWP: CK_MECHANISM_TYPE = 8459; pub const CKM_RSA_PKCS_TPM_1_1: CK_MECHANISM_TYPE = 16385; pub const CKM_RSA_PKCS_OAEP_TPM_1_1: CK_MECHANISM_TYPE = 16386; +pub const CKM_SHA_1_KEY_GEN: CK_MECHANISM_TYPE = 16387; +pub const CKM_SHA224_KEY_GEN: CK_MECHANISM_TYPE = 16388; +pub const CKM_SHA256_KEY_GEN: CK_MECHANISM_TYPE = 16389; +pub const CKM_SHA384_KEY_GEN: CK_MECHANISM_TYPE = 16390; +pub const CKM_SHA512_KEY_GEN: CK_MECHANISM_TYPE = 16391; +pub const CKM_SHA512_224_KEY_GEN: CK_MECHANISM_TYPE = 16392; +pub const CKM_SHA512_256_KEY_GEN: CK_MECHANISM_TYPE = 16393; +pub const CKM_SHA512_T_KEY_GEN: CK_MECHANISM_TYPE = 16394; +pub const CKM_NULL: CK_MECHANISM_TYPE = 16395; +pub const CKM_BLAKE2B_160: CK_MECHANISM_TYPE = 16396; +pub const CKM_BLAKE2B_160_HMAC: CK_MECHANISM_TYPE = 16397; +pub const CKM_BLAKE2B_160_HMAC_GENERAL: CK_MECHANISM_TYPE = 16398; +pub const CKM_BLAKE2B_160_KEY_DERIVE: CK_MECHANISM_TYPE = 16399; +pub const CKM_BLAKE2B_160_KEY_GEN: CK_MECHANISM_TYPE = 16400; +pub const CKM_BLAKE2B_256: CK_MECHANISM_TYPE = 16401; +pub const CKM_BLAKE2B_256_HMAC: CK_MECHANISM_TYPE = 16402; +pub const CKM_BLAKE2B_256_HMAC_GENERAL: CK_MECHANISM_TYPE = 16403; +pub const CKM_BLAKE2B_256_KEY_DERIVE: CK_MECHANISM_TYPE = 16404; +pub const CKM_BLAKE2B_256_KEY_GEN: CK_MECHANISM_TYPE = 16405; +pub const CKM_BLAKE2B_384: CK_MECHANISM_TYPE = 16406; +pub const CKM_BLAKE2B_384_HMAC: CK_MECHANISM_TYPE = 16407; +pub const CKM_BLAKE2B_384_HMAC_GENERAL: CK_MECHANISM_TYPE = 16408; +pub const CKM_BLAKE2B_384_KEY_DERIVE: CK_MECHANISM_TYPE = 16409; +pub const CKM_BLAKE2B_384_KEY_GEN: CK_MECHANISM_TYPE = 16410; +pub const CKM_BLAKE2B_512: CK_MECHANISM_TYPE = 16411; +pub const CKM_BLAKE2B_512_HMAC: CK_MECHANISM_TYPE = 16412; +pub const CKM_BLAKE2B_512_HMAC_GENERAL: CK_MECHANISM_TYPE = 16413; +pub const CKM_BLAKE2B_512_KEY_DERIVE: CK_MECHANISM_TYPE = 16414; +pub const CKM_BLAKE2B_512_KEY_GEN: CK_MECHANISM_TYPE = 16415; +pub const CKM_SALSA20: CK_MECHANISM_TYPE = 16416; +pub const CKM_CHACHA20_POLY1305: CK_MECHANISM_TYPE = 16417; +pub const CKM_SALSA20_POLY1305: CK_MECHANISM_TYPE = 16418; +pub const CKM_X3DH_INITIALIZE: CK_MECHANISM_TYPE = 16419; +pub const CKM_X3DH_RESPOND: CK_MECHANISM_TYPE = 16420; +pub const CKM_X2RATCHET_INITIALIZE: CK_MECHANISM_TYPE = 16421; +pub const CKM_X2RATCHET_RESPOND: CK_MECHANISM_TYPE = 16422; +pub const CKM_X2RATCHET_ENCRYPT: CK_MECHANISM_TYPE = 16423; +pub const CKM_X2RATCHET_DECRYPT: CK_MECHANISM_TYPE = 16424; +pub const CKM_XEDDSA: CK_MECHANISM_TYPE = 16425; +pub const CKM_HKDF_DERIVE: CK_MECHANISM_TYPE = 16426; +pub const CKM_HKDF_DATA: CK_MECHANISM_TYPE = 16427; +pub const CKM_HKDF_KEY_GEN: CK_MECHANISM_TYPE = 16428; +pub const CKM_ECDSA_SHA3_224: CK_MECHANISM_TYPE = 4167; +pub const CKM_ECDSA_SHA3_256: CK_MECHANISM_TYPE = 4168; +pub const CKM_ECDSA_SHA3_384: CK_MECHANISM_TYPE = 4169; +pub const CKM_ECDSA_SHA3_512: CK_MECHANISM_TYPE = 4170; pub const CKM_EC_EDWARDS_KEY_PAIR_GEN: CK_MECHANISM_TYPE = 4181; pub const CKM_EC_MONTGOMERY_KEY_PAIR_GEN: CK_MECHANISM_TYPE = 4182; pub const CKM_EDDSA: CK_MECHANISM_TYPE = 4183; -pub const CK_OTP_FORMAT_DECIMAL: CK_ULONG = 0; -pub const CK_OTP_FORMAT_HEXADECIMAL: CK_ULONG = 1; -pub const CK_OTP_FORMAT_ALPHANUMERIC: CK_ULONG = 2; -pub const CK_OTP_FORMAT_BINARY: CK_ULONG = 3; -pub const CK_OTP_PARAM_IGNORED: CK_ULONG = 0; -pub const CK_OTP_PARAM_OPTIONAL: CK_ULONG = 1; -pub const CK_OTP_PARAM_MANDATORY: CK_ULONG = 2; -pub const CK_OTP_VALUE: CK_ULONG = 0; -pub const CK_OTP_PIN: CK_ULONG = 1; -pub const CK_OTP_CHALLENGE: CK_ULONG = 2; -pub const CK_OTP_TIME: CK_ULONG = 3; -pub const CK_OTP_COUNTER: CK_ULONG = 4; -pub const CK_OTP_FLAGS: CK_ULONG = 5; -pub const CK_OTP_OUTPUT_LENGTH: CK_ULONG = 6; -pub const CK_OTP_FORMAT: CK_ULONG = 7; -pub const CKF_NEXT_OTP: CK_FLAGS = 1; -pub const CKF_EXCLUDE_TIME: CK_FLAGS = 2; -pub const CKF_EXCLUDE_COUNTER: CK_FLAGS = 4; -pub const CKF_EXCLUDE_CHALLENGE: CK_FLAGS = 8; -pub const CKF_EXCLUDE_PIN: CK_FLAGS = 16; -pub const CKF_USER_FRIENDLY_OTP: CK_FLAGS = 32; -pub const CKN_OTP_CHANGED: CK_NOTIFICATION = 1; -pub const CKG_MGF1_SHA1: CK_RSA_PKCS_MGF_TYPE = 1; -pub const CKG_MGF1_SHA224: CK_RSA_PKCS_MGF_TYPE = 5; -pub const CKG_MGF1_SHA256: CK_RSA_PKCS_MGF_TYPE = 2; -pub const CKG_MGF1_SHA384: CK_RSA_PKCS_MGF_TYPE = 3; -pub const CKG_MGF1_SHA512: CK_RSA_PKCS_MGF_TYPE = 4; -pub const CKD_NULL: CK_EC_KDF_TYPE = 1; -pub const CKD_SHA1_KDF: CK_EC_KDF_TYPE = 2; -pub const CKD_SHA1_KDF_ASN1: CK_EC_KDF_TYPE = 3; -pub const CKD_SHA1_KDF_CONCATENATE: CK_EC_KDF_TYPE = 4; -pub const CKD_SHA224_KDF: CK_EC_KDF_TYPE = 5; -pub const CKD_SHA256_KDF: CK_EC_KDF_TYPE = 6; -pub const CKD_SHA384_KDF: CK_EC_KDF_TYPE = 7; -pub const CKD_SHA512_KDF: CK_EC_KDF_TYPE = 8; -pub const CKD_CPDIVERSIFY_KDF: CK_EC_KDF_TYPE = 9; +pub const CKM_SP800_108_COUNTER_KDF: CK_MECHANISM_TYPE = 940; +pub const CKM_SP800_108_FEEDBACK_KDF: CK_MECHANISM_TYPE = 941; +pub const CKM_SP800_108_DOUBLE_PIPELINE_KDF: CK_MECHANISM_TYPE = 942; +pub const CKM_VENDOR_DEFINED: CK_MECHANISM_TYPE = 2147483648; pub const CKF_HW: CK_FLAGS = 1; +pub const CKF_MESSAGE_ENCRYPT: CK_FLAGS = 2; +pub const CKF_MESSAGE_DECRYPT: CK_FLAGS = 4; +pub const CKF_MESSAGE_SIGN: CK_FLAGS = 8; +pub const CKF_MESSAGE_VERIFY: CK_FLAGS = 16; +pub const CKF_MULTI_MESSGE: CK_FLAGS = 32; +pub const CKF_FIND_OBJECTS: CK_FLAGS = 64; pub const CKF_ENCRYPT: CK_FLAGS = 256; pub const CKF_DECRYPT: CK_FLAGS = 512; pub const CKF_DIGEST: CK_FLAGS = 1024; @@ -582,12 +705,12 @@ pub const CKF_DERIVE: CK_FLAGS = 524288; pub const CKF_EC_F_P: CK_FLAGS = 1048576; pub const CKF_EC_F_2M: CK_FLAGS = 2097152; pub const CKF_EC_ECPARAMETERS: CK_FLAGS = 4194304; +pub const CKF_EC_OID: CK_FLAGS = 8388608; pub const CKF_EC_NAMEDCURVE: CK_FLAGS = 8388608; pub const CKF_EC_UNCOMPRESS: CK_FLAGS = 16777216; pub const CKF_EC_COMPRESS: CK_FLAGS = 33554432; -pub const CKF_DONT_BLOCK: CK_FLAGS = 1; -pub const CKF_LIBRARY_CANT_CREATE_OS_THREADS: CK_FLAGS = 1; -pub const CKF_OS_LOCKING_OK: CK_FLAGS = 2; +pub const CKF_EC_CURVENAME: CK_FLAGS = 67108864; +pub const CKF_EXTENSION: CK_FLAGS = 2147483648; pub const CKR_OK: CK_RV = 0; pub const CKR_CANCEL: CK_RV = 1; pub const CKR_HOST_MEMORY: CK_RV = 2; @@ -610,6 +733,7 @@ pub const CKR_DEVICE_MEMORY: CK_RV = 49; pub const CKR_DEVICE_REMOVED: CK_RV = 50; pub const CKR_ENCRYPTED_DATA_INVALID: CK_RV = 64; pub const CKR_ENCRYPTED_DATA_LEN_RANGE: CK_RV = 65; +pub const CKR_AEAD_DECRYPT_FAILED: CK_RV = 66; pub const CKR_FUNCTION_CANCELED: CK_RV = 80; pub const CKR_FUNCTION_NOT_PARALLEL: CK_RV = 81; pub const CKR_FUNCTION_NOT_SUPPORTED: CK_RV = 84; @@ -665,6 +789,7 @@ pub const CKR_WRAPPING_KEY_TYPE_INCONSISTENT: CK_RV = 277; pub const CKR_RANDOM_SEED_NOT_SUPPORTED: CK_RV = 288; pub const CKR_RANDOM_NO_RNG: CK_RV = 289; pub const CKR_DOMAIN_PARAMS_INVALID: CK_RV = 304; +pub const CKR_CURVE_NOT_SUPPORTED: CK_RV = 320; pub const CKR_BUFFER_TOO_SMALL: CK_RV = 336; pub const CKR_SAVED_STATE_INVALID: CK_RV = 352; pub const CKR_INFORMATION_SENSITIVE: CK_RV = 368; @@ -675,44 +800,126 @@ pub const CKR_MUTEX_BAD: CK_RV = 416; pub const CKR_MUTEX_NOT_LOCKED: CK_RV = 417; pub const CKR_NEW_PIN_MODE: CK_RV = 432; pub const CKR_NEXT_OTP: CK_RV = 433; -pub const CKR_EXCEEDED_MAX_ITERATIONS: CK_RV = 448; -pub const CKR_FIPS_SELF_TEST_FAILED: CK_RV = 449; -pub const CKR_LIBRARY_LOAD_FAILED: CK_RV = 450; -pub const CKR_PIN_TOO_WEAK: CK_RV = 451; -pub const CKR_PUBLIC_KEY_INVALID: CK_RV = 452; +pub const CKR_EXCEEDED_MAX_ITERATIONS: CK_RV = 437; +pub const CKR_FIPS_SELF_TEST_FAILED: CK_RV = 438; +pub const CKR_LIBRARY_LOAD_FAILED: CK_RV = 439; +pub const CKR_PIN_TOO_WEAK: CK_RV = 440; +pub const CKR_PUBLIC_KEY_INVALID: CK_RV = 441; pub const CKR_FUNCTION_REJECTED: CK_RV = 512; +pub const CKR_TOKEN_RESOURCE_EXCEEDED: CK_RV = 513; +pub const CKR_VENDOR_DEFINED: CK_RV = 2147483648; +pub const CKF_END_OF_MESSAGE: CK_FLAGS = 1; +pub const CKF_INTERFACE_FORK_SAFE: CK_FLAGS = 1; +pub const CKF_LIBRARY_CANT_CREATE_OS_THREADS: CK_FLAGS = 1; +pub const CKF_OS_LOCKING_OK: CK_FLAGS = 2; +pub const CKF_DONT_BLOCK: CK_FLAGS = 1; +pub const CKG_MGF1_SHA1: CK_RSA_PKCS_MGF_TYPE = 1; +pub const CKG_MGF1_SHA256: CK_RSA_PKCS_MGF_TYPE = 2; +pub const CKG_MGF1_SHA384: CK_RSA_PKCS_MGF_TYPE = 3; +pub const CKG_MGF1_SHA512: CK_RSA_PKCS_MGF_TYPE = 4; +pub const CKG_MGF1_SHA224: CK_RSA_PKCS_MGF_TYPE = 5; pub const CKZ_DATA_SPECIFIED: CK_RSA_PKCS_OAEP_SOURCE_TYPE = 1; -pub const CK_FALSE: CK_BBOOL = 0; -pub const CK_TRUE: CK_BBOOL = 1; -pub const FALSE: u32 = 0; -pub const TRUE: u32 = 1; -pub type CK_FLAGS = ::std::os::raw::c_ulong; +pub const CKD_NULL: CK_EC_KDF_TYPE = 1; +pub const CKD_SHA1_KDF: CK_EC_KDF_TYPE = 2; +pub const CKD_SHA1_KDF_ASN1: CK_EC_KDF_TYPE = 3; +pub const CKD_SHA1_KDF_CONCATENATE: CK_EC_KDF_TYPE = 4; +pub const CKD_SHA224_KDF: CK_EC_KDF_TYPE = 5; +pub const CKD_SHA256_KDF: CK_EC_KDF_TYPE = 6; +pub const CKD_SHA384_KDF: CK_EC_KDF_TYPE = 7; +pub const CKD_SHA512_KDF: CK_EC_KDF_TYPE = 8; +pub const CKD_CPDIVERSIFY_KDF: CK_EC_KDF_TYPE = 9; +pub const CKD_SHA3_224_KDF: CK_EC_KDF_TYPE = 10; +pub const CKD_SHA3_256_KDF: CK_EC_KDF_TYPE = 11; +pub const CKD_SHA3_384_KDF: CK_EC_KDF_TYPE = 12; +pub const CKD_SHA3_512_KDF: CK_EC_KDF_TYPE = 13; +pub const CKD_SHA1_KDF_SP800: CK_EC_KDF_TYPE = 14; +pub const CKD_SHA224_KDF_SP800: CK_EC_KDF_TYPE = 15; +pub const CKD_SHA256_KDF_SP800: CK_EC_KDF_TYPE = 16; +pub const CKD_SHA384_KDF_SP800: CK_EC_KDF_TYPE = 17; +pub const CKD_SHA512_KDF_SP800: CK_EC_KDF_TYPE = 18; +pub const CKD_SHA3_224_KDF_SP800: CK_EC_KDF_TYPE = 19; +pub const CKD_SHA3_256_KDF_SP800: CK_EC_KDF_TYPE = 20; +pub const CKD_SHA3_384_KDF_SP800: CK_EC_KDF_TYPE = 21; +pub const CKD_SHA3_512_KDF_SP800: CK_EC_KDF_TYPE = 22; +pub const CKD_BLAKE2B_160_KDF: CK_EC_KDF_TYPE = 23; +pub const CKD_BLAKE2B_256_KDF: CK_EC_KDF_TYPE = 24; +pub const CKD_BLAKE2B_384_KDF: CK_EC_KDF_TYPE = 25; +pub const CKD_BLAKE2B_512_KDF: CK_EC_KDF_TYPE = 26; +pub const CKP_PKCS5_PBKD2_HMAC_SHA1: CK_PROFILE_ID = 1; +pub const CKP_PKCS5_PBKD2_HMAC_GOSTR3411: CK_PROFILE_ID = 2; +pub const CKP_PKCS5_PBKD2_HMAC_SHA224: CK_PROFILE_ID = 3; +pub const CKP_PKCS5_PBKD2_HMAC_SHA256: CK_PROFILE_ID = 4; +pub const CKP_PKCS5_PBKD2_HMAC_SHA384: CK_PROFILE_ID = 5; +pub const CKP_PKCS5_PBKD2_HMAC_SHA512: CK_PROFILE_ID = 6; +pub const CKP_PKCS5_PBKD2_HMAC_SHA512_224: CK_PROFILE_ID = 7; +pub const CKP_PKCS5_PBKD2_HMAC_SHA512_256: CK_PROFILE_ID = 8; +pub const CKZ_SALT_SPECIFIED: CK_RSA_PKCS_OAEP_SOURCE_TYPE = 1; +pub const CK_OTP_VALUE: CK_ULONG = 0; +pub const CK_OTP_PIN: CK_ULONG = 1; +pub const CK_OTP_CHALLENGE: CK_ULONG = 2; +pub const CK_OTP_TIME: CK_ULONG = 3; +pub const CK_OTP_COUNTER: CK_ULONG = 4; +pub const CK_OTP_FLAGS: CK_ULONG = 5; +pub const CK_OTP_OUTPUT_LENGTH: CK_ULONG = 6; +pub const CK_OTP_OUTPUT_FORMAT: CK_ULONG = 7; +pub const CKF_NEXT_OTP: CK_FLAGS = 1; +pub const CKF_EXCLUDE_TIME: CK_FLAGS = 2; +pub const CKF_EXCLUDE_COUNTER: CK_FLAGS = 4; +pub const CKF_EXCLUDE_CHALLENGE: CK_FLAGS = 8; +pub const CKF_EXCLUDE_PIN: CK_FLAGS = 16; +pub const CKF_USER_FRIENDLY_OTP: CK_FLAGS = 32; +pub const CKG_NO_GENERATE: u32 = 0; +pub const CKG_GENERATE: u32 = 1; +pub const CKG_GENERATE_COUNTER: u32 = 2; +pub const CKG_GENERATE_RANDOM: u32 = 3; +pub const CK_SP800_108_ITERATION_VARIABLE: CK_ULONG = 1; +pub const CK_SP800_108_OPTIONAL_COUNTER: CK_ULONG = 2; +pub const CK_SP800_108_DKM_LENGTH: CK_ULONG = 3; +pub const CK_SP800_108_BYTE_ARRAY: CK_ULONG = 4; +pub const CKF_HKDF_SALT_NULL: CK_FLAGS = 1; +pub const CKF_HKDF_SALT_DATA: CK_FLAGS = 2; +pub const CKF_HKDF_SALT_KEY: CK_FLAGS = 4; +pub const CK_NEED_ARG_LIST: CK_ULONG = 1; +pub const CK_PKCS11_2_0_ONLY: CK_ULONG = 1; +pub type CK_BYTE = ::std::os::raw::c_uchar; +pub type CK_CHAR = CK_BYTE; +pub type CK_UTF8CHAR = CK_BYTE; +pub type CK_BBOOL = CK_BYTE; +pub type CK_ULONG = ::std::os::raw::c_ulong; +pub type CK_LONG = ::std::os::raw::c_long; +pub type CK_FLAGS = CK_ULONG; +pub type CK_BYTE_PTR = *mut CK_BYTE; +pub type CK_CHAR_PTR = *mut CK_CHAR; +pub type CK_UTF8CHAR_PTR = *mut CK_UTF8CHAR; +pub type CK_ULONG_PTR = *mut CK_ULONG; +pub type CK_VOID_PTR = *mut ::std::os::raw::c_void; +pub type CK_VOID_PTR_PTR = *mut CK_VOID_PTR; #[repr(C)] #[derive(Debug, Default, Copy, Clone)] -pub struct _CK_VERSION { - pub major: ::std::os::raw::c_uchar, - pub minor: ::std::os::raw::c_uchar, +pub struct CK_VERSION { + pub major: CK_BYTE, + pub minor: CK_BYTE, } #[test] -fn bindgen_test_layout__CK_VERSION() { - const UNINIT: ::std::mem::MaybeUninit<_CK_VERSION> = ::std::mem::MaybeUninit::uninit(); +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::<_CK_VERSION>(), + ::std::mem::size_of::(), 2usize, - concat!("Size of: ", stringify!(_CK_VERSION)) + concat!("Size of: ", stringify!(CK_VERSION)) ); assert_eq!( - ::std::mem::align_of::<_CK_VERSION>(), + ::std::mem::align_of::(), 1usize, - concat!("Alignment of ", stringify!(_CK_VERSION)) + 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!(CK_VERSION), "::", stringify!(major) ) @@ -722,41 +929,42 @@ fn bindgen_test_layout__CK_VERSION() { 1usize, concat!( "Offset of field: ", - stringify!(_CK_VERSION), + stringify!(CK_VERSION), "::", stringify!(minor) ) ); } +pub type CK_VERSION_PTR = *mut CK_VERSION; #[repr(C)] #[derive(Debug, Default, Copy, Clone)] -pub struct _CK_INFO { - pub cryptokiVersion: _CK_VERSION, - pub manufacturerID: [::std::os::raw::c_uchar; 32usize], +pub struct CK_INFO { + pub cryptokiVersion: CK_VERSION, + pub manufacturerID: [CK_UTF8CHAR; 32usize], pub flags: CK_FLAGS, - pub libraryDescription: [::std::os::raw::c_uchar; 32usize], - pub libraryVersion: _CK_VERSION, + pub libraryDescription: [CK_UTF8CHAR; 32usize], + pub libraryVersion: CK_VERSION, } #[test] -fn bindgen_test_layout__CK_INFO() { - const UNINIT: ::std::mem::MaybeUninit<_CK_INFO> = ::std::mem::MaybeUninit::uninit(); +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::<_CK_INFO>(), + ::std::mem::size_of::(), 88usize, - concat!("Size of: ", stringify!(_CK_INFO)) + concat!("Size of: ", stringify!(CK_INFO)) ); assert_eq!( - ::std::mem::align_of::<_CK_INFO>(), + ::std::mem::align_of::(), 8usize, - concat!("Alignment of ", stringify!(_CK_INFO)) + 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!(CK_INFO), "::", stringify!(cryptokiVersion) ) @@ -766,7 +974,7 @@ fn bindgen_test_layout__CK_INFO() { 2usize, concat!( "Offset of field: ", - stringify!(_CK_INFO), + stringify!(CK_INFO), "::", stringify!(manufacturerID) ) @@ -776,7 +984,7 @@ fn bindgen_test_layout__CK_INFO() { 40usize, concat!( "Offset of field: ", - stringify!(_CK_INFO), + stringify!(CK_INFO), "::", stringify!(flags) ) @@ -786,7 +994,7 @@ fn bindgen_test_layout__CK_INFO() { 48usize, concat!( "Offset of field: ", - stringify!(_CK_INFO), + stringify!(CK_INFO), "::", stringify!(libraryDescription) ) @@ -796,44 +1004,45 @@ fn bindgen_test_layout__CK_INFO() { 80usize, concat!( "Offset of field: ", - stringify!(_CK_INFO), + stringify!(CK_INFO), "::", stringify!(libraryVersion) ) ); } -pub type CK_NOTIFICATION = ::std::os::raw::c_ulong; -pub const CKN_SURRENDER: ::std::os::raw::c_ulong = 0; -pub type CK_SLOT_ID = ::std::os::raw::c_ulong; +pub type CK_INFO_PTR = *mut CK_INFO; +pub type CK_NOTIFICATION = CK_ULONG; +pub type CK_SLOT_ID = CK_ULONG; +pub type CK_SLOT_ID_PTR = *mut CK_SLOT_ID; #[repr(C)] #[derive(Debug, Copy, Clone)] -pub struct _CK_SLOT_INFO { - pub slotDescription: [::std::os::raw::c_uchar; 64usize], - pub manufacturerID: [::std::os::raw::c_uchar; 32usize], +pub struct CK_SLOT_INFO { + pub slotDescription: [CK_UTF8CHAR; 64usize], + pub manufacturerID: [CK_UTF8CHAR; 32usize], pub flags: CK_FLAGS, - pub hardwareVersion: _CK_VERSION, - pub firmwareVersion: _CK_VERSION, + pub hardwareVersion: CK_VERSION, + pub firmwareVersion: CK_VERSION, } #[test] -fn bindgen_test_layout__CK_SLOT_INFO() { - const UNINIT: ::std::mem::MaybeUninit<_CK_SLOT_INFO> = ::std::mem::MaybeUninit::uninit(); +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::<_CK_SLOT_INFO>(), + ::std::mem::size_of::(), 112usize, - concat!("Size of: ", stringify!(_CK_SLOT_INFO)) + concat!("Size of: ", stringify!(CK_SLOT_INFO)) ); assert_eq!( - ::std::mem::align_of::<_CK_SLOT_INFO>(), + ::std::mem::align_of::(), 8usize, - concat!("Alignment of ", stringify!(_CK_SLOT_INFO)) + 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!(CK_SLOT_INFO), "::", stringify!(slotDescription) ) @@ -843,7 +1052,7 @@ fn bindgen_test_layout__CK_SLOT_INFO() { 64usize, concat!( "Offset of field: ", - stringify!(_CK_SLOT_INFO), + stringify!(CK_SLOT_INFO), "::", stringify!(manufacturerID) ) @@ -853,7 +1062,7 @@ fn bindgen_test_layout__CK_SLOT_INFO() { 96usize, concat!( "Offset of field: ", - stringify!(_CK_SLOT_INFO), + stringify!(CK_SLOT_INFO), "::", stringify!(flags) ) @@ -863,7 +1072,7 @@ fn bindgen_test_layout__CK_SLOT_INFO() { 104usize, concat!( "Offset of field: ", - stringify!(_CK_SLOT_INFO), + stringify!(CK_SLOT_INFO), "::", stringify!(hardwareVersion) ) @@ -873,13 +1082,13 @@ fn bindgen_test_layout__CK_SLOT_INFO() { 106usize, concat!( "Offset of field: ", - stringify!(_CK_SLOT_INFO), + stringify!(CK_SLOT_INFO), "::", stringify!(firmwareVersion) ) ); } -impl Default for _CK_SLOT_INFO { +impl Default for CK_SLOT_INFO { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { @@ -888,52 +1097,49 @@ impl Default for _CK_SLOT_INFO { } } } -pub const CKF_TOKEN_PRESENT: ::std::os::raw::c_ulong = 1; -pub const CKF_REMOVABLE_DEVICE: ::std::os::raw::c_ulong = 2; -pub const CKF_HW_SLOT: ::std::os::raw::c_ulong = 4; -pub const CKF_ARRAY_ATTRIBUTE: ::std::os::raw::c_ulong = 1073741824; +pub type CK_SLOT_INFO_PTR = *mut CK_SLOT_INFO; #[repr(C)] #[derive(Debug, Default, Copy, Clone)] -pub struct _CK_TOKEN_INFO { - pub label: [::std::os::raw::c_uchar; 32usize], - pub manufacturerID: [::std::os::raw::c_uchar; 32usize], - pub model: [::std::os::raw::c_uchar; 16usize], - pub serialNumber: [::std::os::raw::c_uchar; 16usize], +pub struct CK_TOKEN_INFO { + pub label: [CK_UTF8CHAR; 32usize], + pub manufacturerID: [CK_UTF8CHAR; 32usize], + pub model: [CK_UTF8CHAR; 16usize], + pub serialNumber: [CK_CHAR; 16usize], pub flags: CK_FLAGS, - pub ulMaxSessionCount: ::std::os::raw::c_ulong, - pub ulSessionCount: ::std::os::raw::c_ulong, - pub ulMaxRwSessionCount: ::std::os::raw::c_ulong, - pub ulRwSessionCount: ::std::os::raw::c_ulong, - pub ulMaxPinLen: ::std::os::raw::c_ulong, - pub ulMinPinLen: ::std::os::raw::c_ulong, - pub ulTotalPublicMemory: ::std::os::raw::c_ulong, - pub ulFreePublicMemory: ::std::os::raw::c_ulong, - pub ulTotalPrivateMemory: ::std::os::raw::c_ulong, - pub ulFreePrivateMemory: ::std::os::raw::c_ulong, - pub hardwareVersion: _CK_VERSION, - pub firmwareVersion: _CK_VERSION, - pub utcTime: [::std::os::raw::c_uchar; 16usize], + pub ulMaxSessionCount: CK_ULONG, + pub ulSessionCount: CK_ULONG, + pub ulMaxRwSessionCount: CK_ULONG, + pub ulRwSessionCount: CK_ULONG, + pub ulMaxPinLen: CK_ULONG, + pub ulMinPinLen: CK_ULONG, + pub ulTotalPublicMemory: CK_ULONG, + pub ulFreePublicMemory: CK_ULONG, + pub ulTotalPrivateMemory: CK_ULONG, + pub ulFreePrivateMemory: CK_ULONG, + pub hardwareVersion: CK_VERSION, + pub firmwareVersion: CK_VERSION, + pub utcTime: [CK_CHAR; 16usize], } #[test] -fn bindgen_test_layout__CK_TOKEN_INFO() { - const UNINIT: ::std::mem::MaybeUninit<_CK_TOKEN_INFO> = ::std::mem::MaybeUninit::uninit(); +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::<_CK_TOKEN_INFO>(), + ::std::mem::size_of::(), 208usize, - concat!("Size of: ", stringify!(_CK_TOKEN_INFO)) + concat!("Size of: ", stringify!(CK_TOKEN_INFO)) ); assert_eq!( - ::std::mem::align_of::<_CK_TOKEN_INFO>(), + ::std::mem::align_of::(), 8usize, - concat!("Alignment of ", stringify!(_CK_TOKEN_INFO)) + 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!(CK_TOKEN_INFO), "::", stringify!(label) ) @@ -943,7 +1149,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { 32usize, concat!( "Offset of field: ", - stringify!(_CK_TOKEN_INFO), + stringify!(CK_TOKEN_INFO), "::", stringify!(manufacturerID) ) @@ -953,7 +1159,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { 64usize, concat!( "Offset of field: ", - stringify!(_CK_TOKEN_INFO), + stringify!(CK_TOKEN_INFO), "::", stringify!(model) ) @@ -963,7 +1169,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { 80usize, concat!( "Offset of field: ", - stringify!(_CK_TOKEN_INFO), + stringify!(CK_TOKEN_INFO), "::", stringify!(serialNumber) ) @@ -973,7 +1179,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { 96usize, concat!( "Offset of field: ", - stringify!(_CK_TOKEN_INFO), + stringify!(CK_TOKEN_INFO), "::", stringify!(flags) ) @@ -983,7 +1189,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { 104usize, concat!( "Offset of field: ", - stringify!(_CK_TOKEN_INFO), + stringify!(CK_TOKEN_INFO), "::", stringify!(ulMaxSessionCount) ) @@ -993,7 +1199,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { 112usize, concat!( "Offset of field: ", - stringify!(_CK_TOKEN_INFO), + stringify!(CK_TOKEN_INFO), "::", stringify!(ulSessionCount) ) @@ -1003,7 +1209,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { 120usize, concat!( "Offset of field: ", - stringify!(_CK_TOKEN_INFO), + stringify!(CK_TOKEN_INFO), "::", stringify!(ulMaxRwSessionCount) ) @@ -1013,7 +1219,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { 128usize, concat!( "Offset of field: ", - stringify!(_CK_TOKEN_INFO), + stringify!(CK_TOKEN_INFO), "::", stringify!(ulRwSessionCount) ) @@ -1023,7 +1229,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { 136usize, concat!( "Offset of field: ", - stringify!(_CK_TOKEN_INFO), + stringify!(CK_TOKEN_INFO), "::", stringify!(ulMaxPinLen) ) @@ -1033,7 +1239,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { 144usize, concat!( "Offset of field: ", - stringify!(_CK_TOKEN_INFO), + stringify!(CK_TOKEN_INFO), "::", stringify!(ulMinPinLen) ) @@ -1043,7 +1249,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { 152usize, concat!( "Offset of field: ", - stringify!(_CK_TOKEN_INFO), + stringify!(CK_TOKEN_INFO), "::", stringify!(ulTotalPublicMemory) ) @@ -1053,7 +1259,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { 160usize, concat!( "Offset of field: ", - stringify!(_CK_TOKEN_INFO), + stringify!(CK_TOKEN_INFO), "::", stringify!(ulFreePublicMemory) ) @@ -1063,7 +1269,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { 168usize, concat!( "Offset of field: ", - stringify!(_CK_TOKEN_INFO), + stringify!(CK_TOKEN_INFO), "::", stringify!(ulTotalPrivateMemory) ) @@ -1073,7 +1279,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { 176usize, concat!( "Offset of field: ", - stringify!(_CK_TOKEN_INFO), + stringify!(CK_TOKEN_INFO), "::", stringify!(ulFreePrivateMemory) ) @@ -1083,7 +1289,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { 184usize, concat!( "Offset of field: ", - stringify!(_CK_TOKEN_INFO), + stringify!(CK_TOKEN_INFO), "::", stringify!(hardwareVersion) ) @@ -1093,7 +1299,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { 186usize, concat!( "Offset of field: ", - stringify!(_CK_TOKEN_INFO), + stringify!(CK_TOKEN_INFO), "::", stringify!(firmwareVersion) ) @@ -1103,43 +1309,45 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { 188usize, concat!( "Offset of field: ", - stringify!(_CK_TOKEN_INFO), + stringify!(CK_TOKEN_INFO), "::", stringify!(utcTime) ) ); } -pub type CK_SESSION_HANDLE = ::std::os::raw::c_ulong; -pub type CK_USER_TYPE = ::std::os::raw::c_ulong; -pub type CK_STATE = ::std::os::raw::c_ulong; +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; +pub type CK_USER_TYPE = CK_ULONG; +pub type CK_STATE = CK_ULONG; #[repr(C)] #[derive(Debug, Default, Copy, Clone)] -pub struct _CK_SESSION_INFO { +pub struct CK_SESSION_INFO { pub slotID: CK_SLOT_ID, pub state: CK_STATE, pub flags: CK_FLAGS, - pub ulDeviceError: ::std::os::raw::c_ulong, + pub ulDeviceError: CK_ULONG, } #[test] -fn bindgen_test_layout__CK_SESSION_INFO() { - const UNINIT: ::std::mem::MaybeUninit<_CK_SESSION_INFO> = ::std::mem::MaybeUninit::uninit(); +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::<_CK_SESSION_INFO>(), + ::std::mem::size_of::(), 32usize, - concat!("Size of: ", stringify!(_CK_SESSION_INFO)) + concat!("Size of: ", stringify!(CK_SESSION_INFO)) ); assert_eq!( - ::std::mem::align_of::<_CK_SESSION_INFO>(), + ::std::mem::align_of::(), 8usize, - concat!("Alignment of ", stringify!(_CK_SESSION_INFO)) + 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!(CK_SESSION_INFO), "::", stringify!(slotID) ) @@ -1149,7 +1357,7 @@ fn bindgen_test_layout__CK_SESSION_INFO() { 8usize, concat!( "Offset of field: ", - stringify!(_CK_SESSION_INFO), + stringify!(CK_SESSION_INFO), "::", stringify!(state) ) @@ -1159,7 +1367,7 @@ fn bindgen_test_layout__CK_SESSION_INFO() { 16usize, concat!( "Offset of field: ", - stringify!(_CK_SESSION_INFO), + stringify!(CK_SESSION_INFO), "::", stringify!(flags) ) @@ -1169,45 +1377,48 @@ fn bindgen_test_layout__CK_SESSION_INFO() { 24usize, concat!( "Offset of field: ", - stringify!(_CK_SESSION_INFO), + stringify!(CK_SESSION_INFO), "::", stringify!(ulDeviceError) ) ); } -pub type CK_OBJECT_HANDLE = ::std::os::raw::c_ulong; -pub type CK_OBJECT_CLASS = ::std::os::raw::c_ulong; -pub type CK_HW_FEATURE_TYPE = ::std::os::raw::c_ulong; -pub type CK_KEY_TYPE = ::std::os::raw::c_ulong; -pub type CK_CERTIFICATE_TYPE = ::std::os::raw::c_ulong; -pub type CK_ATTRIBUTE_TYPE = ::std::os::raw::c_ulong; +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; +pub type CK_OBJECT_CLASS = CK_ULONG; +pub type CK_OBJECT_CLASS_PTR = *mut CK_OBJECT_CLASS; +pub type CK_HW_FEATURE_TYPE = CK_ULONG; +pub type CK_KEY_TYPE = CK_ULONG; +pub type CK_CERTIFICATE_TYPE = CK_ULONG; +pub type CK_ATTRIBUTE_TYPE = CK_ULONG; #[repr(C)] #[derive(Debug, Copy, Clone)] -pub struct _CK_ATTRIBUTE { +pub struct CK_ATTRIBUTE { pub type_: CK_ATTRIBUTE_TYPE, - pub pValue: *mut ::std::os::raw::c_void, - pub ulValueLen: ::std::os::raw::c_ulong, + pub pValue: CK_VOID_PTR, + pub ulValueLen: CK_ULONG, } #[test] -fn bindgen_test_layout__CK_ATTRIBUTE() { - const UNINIT: ::std::mem::MaybeUninit<_CK_ATTRIBUTE> = ::std::mem::MaybeUninit::uninit(); +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::<_CK_ATTRIBUTE>(), + ::std::mem::size_of::(), 24usize, - concat!("Size of: ", stringify!(_CK_ATTRIBUTE)) + concat!("Size of: ", stringify!(CK_ATTRIBUTE)) ); assert_eq!( - ::std::mem::align_of::<_CK_ATTRIBUTE>(), + ::std::mem::align_of::(), 8usize, - concat!("Alignment of ", stringify!(_CK_ATTRIBUTE)) + 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!(CK_ATTRIBUTE), "::", stringify!(type_) ) @@ -1217,7 +1428,7 @@ fn bindgen_test_layout__CK_ATTRIBUTE() { 8usize, concat!( "Offset of field: ", - stringify!(_CK_ATTRIBUTE), + stringify!(CK_ATTRIBUTE), "::", stringify!(pValue) ) @@ -1227,13 +1438,13 @@ fn bindgen_test_layout__CK_ATTRIBUTE() { 16usize, concat!( "Offset of field: ", - stringify!(_CK_ATTRIBUTE), + stringify!(CK_ATTRIBUTE), "::", stringify!(ulValueLen) ) ); } -impl Default for _CK_ATTRIBUTE { +impl Default for CK_ATTRIBUTE { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { @@ -1242,33 +1453,34 @@ impl Default for _CK_ATTRIBUTE { } } } +pub type CK_ATTRIBUTE_PTR = *mut CK_ATTRIBUTE; #[repr(C)] #[derive(Debug, Default, Copy, Clone)] -pub struct _CK_DATE { - pub year: [::std::os::raw::c_uchar; 4usize], - pub month: [::std::os::raw::c_uchar; 2usize], - pub day: [::std::os::raw::c_uchar; 2usize], +pub struct CK_DATE { + pub year: [CK_CHAR; 4usize], + pub month: [CK_CHAR; 2usize], + pub day: [CK_CHAR; 2usize], } #[test] -fn bindgen_test_layout__CK_DATE() { - const UNINIT: ::std::mem::MaybeUninit<_CK_DATE> = ::std::mem::MaybeUninit::uninit(); +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::<_CK_DATE>(), + ::std::mem::size_of::(), 8usize, - concat!("Size of: ", stringify!(_CK_DATE)) + concat!("Size of: ", stringify!(CK_DATE)) ); assert_eq!( - ::std::mem::align_of::<_CK_DATE>(), + ::std::mem::align_of::(), 1usize, - concat!("Alignment of ", stringify!(_CK_DATE)) + 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!(CK_DATE), "::", stringify!(year) ) @@ -1278,7 +1490,7 @@ fn bindgen_test_layout__CK_DATE() { 4usize, concat!( "Offset of field: ", - stringify!(_CK_DATE), + stringify!(CK_DATE), "::", stringify!(month) ) @@ -1288,40 +1500,41 @@ fn bindgen_test_layout__CK_DATE() { 6usize, concat!( "Offset of field: ", - stringify!(_CK_DATE), + stringify!(CK_DATE), "::", stringify!(day) ) ); } -pub type CK_MECHANISM_TYPE = ::std::os::raw::c_ulong; +pub type CK_MECHANISM_TYPE = CK_ULONG; +pub type CK_MECHANISM_TYPE_PTR = *mut CK_MECHANISM_TYPE; #[repr(C)] #[derive(Debug, Copy, Clone)] -pub struct _CK_MECHANISM { +pub struct CK_MECHANISM { pub mechanism: CK_MECHANISM_TYPE, - pub pParameter: *mut ::std::os::raw::c_void, - pub ulParameterLen: ::std::os::raw::c_ulong, + pub pParameter: CK_VOID_PTR, + pub ulParameterLen: CK_ULONG, } #[test] -fn bindgen_test_layout__CK_MECHANISM() { - const UNINIT: ::std::mem::MaybeUninit<_CK_MECHANISM> = ::std::mem::MaybeUninit::uninit(); +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::<_CK_MECHANISM>(), + ::std::mem::size_of::(), 24usize, - concat!("Size of: ", stringify!(_CK_MECHANISM)) + concat!("Size of: ", stringify!(CK_MECHANISM)) ); assert_eq!( - ::std::mem::align_of::<_CK_MECHANISM>(), + ::std::mem::align_of::(), 8usize, - concat!("Alignment of ", stringify!(_CK_MECHANISM)) + 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!(CK_MECHANISM), "::", stringify!(mechanism) ) @@ -1331,7 +1544,7 @@ fn bindgen_test_layout__CK_MECHANISM() { 8usize, concat!( "Offset of field: ", - stringify!(_CK_MECHANISM), + stringify!(CK_MECHANISM), "::", stringify!(pParameter) ) @@ -1341,13 +1554,13 @@ fn bindgen_test_layout__CK_MECHANISM() { 16usize, concat!( "Offset of field: ", - stringify!(_CK_MECHANISM), + stringify!(CK_MECHANISM), "::", stringify!(ulParameterLen) ) ); } -impl Default for _CK_MECHANISM { +impl Default for CK_MECHANISM { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { @@ -1356,33 +1569,34 @@ impl Default for _CK_MECHANISM { } } } +pub type CK_MECHANISM_PTR = *mut CK_MECHANISM; #[repr(C)] #[derive(Debug, Default, Copy, Clone)] -pub struct _CK_MECHANISM_INFO { - pub ulMinKeySize: ::std::os::raw::c_ulong, - pub ulMaxKeySize: ::std::os::raw::c_ulong, +pub struct CK_MECHANISM_INFO { + pub ulMinKeySize: CK_ULONG, + pub ulMaxKeySize: CK_ULONG, pub flags: CK_FLAGS, } #[test] -fn bindgen_test_layout__CK_MECHANISM_INFO() { - const UNINIT: ::std::mem::MaybeUninit<_CK_MECHANISM_INFO> = ::std::mem::MaybeUninit::uninit(); +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::<_CK_MECHANISM_INFO>(), + ::std::mem::size_of::(), 24usize, - concat!("Size of: ", stringify!(_CK_MECHANISM_INFO)) + concat!("Size of: ", stringify!(CK_MECHANISM_INFO)) ); assert_eq!( - ::std::mem::align_of::<_CK_MECHANISM_INFO>(), + ::std::mem::align_of::(), 8usize, - concat!("Alignment of ", stringify!(_CK_MECHANISM_INFO)) + 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!(CK_MECHANISM_INFO), "::", stringify!(ulMinKeySize) ) @@ -1392,7 +1606,7 @@ fn bindgen_test_layout__CK_MECHANISM_INFO() { 8usize, concat!( "Offset of field: ", - stringify!(_CK_MECHANISM_INFO), + stringify!(CK_MECHANISM_INFO), "::", stringify!(ulMaxKeySize) ) @@ -1402,66 +1616,78 @@ fn bindgen_test_layout__CK_MECHANISM_INFO() { 16usize, concat!( "Offset of field: ", - stringify!(_CK_MECHANISM_INFO), + stringify!(CK_MECHANISM_INFO), "::", stringify!(flags) ) ); } -pub type CK_PARAM_TYPE = ::std::os::raw::c_ulong; +pub type CK_MECHANISM_INFO_PTR = *mut CK_MECHANISM_INFO; +pub type CK_RV = CK_ULONG; +pub type CK_NOTIFY = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + event: CK_NOTIFICATION, + pApplication: CK_VOID_PTR, + ) -> CK_RV, +>; +pub type CK_FUNCTION_LIST_PTR = *mut CK_FUNCTION_LIST; +pub type CK_FUNCTION_LIST_3_0_PTR = *mut CK_FUNCTION_LIST_3_0; +pub type CK_FUNCTION_LIST_PTR_PTR = *mut CK_FUNCTION_LIST_PTR; +pub type CK_FUNCTION_LIST_3_0_PTR_PTR = *mut CK_FUNCTION_LIST_3_0_PTR; #[repr(C)] #[derive(Debug, Copy, Clone)] -pub struct CK_OTP_PARAM { - pub type_: CK_PARAM_TYPE, - pub pValue: *mut ::std::os::raw::c_void, - pub ulValueLen: ::std::os::raw::c_ulong, +pub struct CK_INTERFACE { + pub pInterfaceName: *mut CK_CHAR, + pub pFunctionList: CK_VOID_PTR, + pub flags: CK_FLAGS, } #[test] -fn bindgen_test_layout_CK_OTP_PARAM() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); +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::(), + ::std::mem::size_of::(), 24usize, - concat!("Size of: ", stringify!(CK_OTP_PARAM)) + concat!("Size of: ", stringify!(CK_INTERFACE)) ); assert_eq!( - ::std::mem::align_of::(), + ::std::mem::align_of::(), 8usize, - concat!("Alignment of ", stringify!(CK_OTP_PARAM)) + concat!("Alignment of ", stringify!(CK_INTERFACE)) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).type_) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).pInterfaceName) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", - stringify!(CK_OTP_PARAM), + stringify!(CK_INTERFACE), "::", - stringify!(type_) + stringify!(pInterfaceName) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pValue) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).pFunctionList) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", - stringify!(CK_OTP_PARAM), + stringify!(CK_INTERFACE), "::", - stringify!(pValue) + stringify!(pFunctionList) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulValueLen) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).flags) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", - stringify!(CK_OTP_PARAM), + stringify!(CK_INTERFACE), "::", - stringify!(ulValueLen) + stringify!(flags) ) ); } -impl Default for CK_OTP_PARAM { +impl Default for CK_INTERFACE { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { @@ -1470,99 +1696,100 @@ impl Default for CK_OTP_PARAM { } } } +pub type CK_INTERFACE_PTR = *mut CK_INTERFACE; +pub type CK_INTERFACE_PTR_PTR = *mut CK_INTERFACE_PTR; +pub type CK_CREATEMUTEX = + ::std::option::Option CK_RV>; +pub type CK_DESTROYMUTEX = + ::std::option::Option CK_RV>; +pub type CK_LOCKMUTEX = ::std::option::Option CK_RV>; +pub type CK_UNLOCKMUTEX = ::std::option::Option CK_RV>; #[repr(C)] #[derive(Debug, Copy, Clone)] -pub struct CK_OTP_PARAMS { - pub pParams: *mut CK_OTP_PARAM, - pub ulCount: ::std::os::raw::c_ulong, +pub struct CK_C_INITIALIZE_ARGS { + pub CreateMutex: CK_CREATEMUTEX, + pub DestroyMutex: CK_DESTROYMUTEX, + pub LockMutex: CK_LOCKMUTEX, + pub UnlockMutex: CK_UNLOCKMUTEX, + pub flags: CK_FLAGS, + pub pReserved: CK_VOID_PTR, } #[test] -fn bindgen_test_layout_CK_OTP_PARAMS() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); +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::(), - 16usize, - concat!("Size of: ", stringify!(CK_OTP_PARAMS)) + ::std::mem::size_of::(), + 48usize, + concat!("Size of: ", stringify!(CK_C_INITIALIZE_ARGS)) ); assert_eq!( - ::std::mem::align_of::(), + ::std::mem::align_of::(), 8usize, - concat!("Alignment of ", stringify!(CK_OTP_PARAMS)) + concat!("Alignment of ", stringify!(CK_C_INITIALIZE_ARGS)) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pParams) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).CreateMutex) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", - stringify!(CK_OTP_PARAMS), + stringify!(CK_C_INITIALIZE_ARGS), "::", - stringify!(pParams) + stringify!(CreateMutex) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulCount) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).DestroyMutex) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", - stringify!(CK_OTP_PARAMS), + stringify!(CK_C_INITIALIZE_ARGS), "::", - stringify!(ulCount) + stringify!(DestroyMutex) ) ); -} -impl Default for CK_OTP_PARAMS { - fn default() -> Self { - let mut s = ::std::mem::MaybeUninit::::uninit(); - unsafe { - ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct CK_OTP_SIGNATURE_INFO { - pub pParams: *mut CK_OTP_PARAM, - pub ulCount: ::std::os::raw::c_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::(), + unsafe { ::std::ptr::addr_of!((*ptr).LockMutex) as usize - ptr as usize }, 16usize, - concat!("Size of: ", stringify!(CK_OTP_SIGNATURE_INFO)) + concat!( + "Offset of field: ", + stringify!(CK_C_INITIALIZE_ARGS), + "::", + stringify!(LockMutex) + ) ); assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(CK_OTP_SIGNATURE_INFO)) + 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).pParams) as usize - ptr as usize }, - 0usize, + unsafe { ::std::ptr::addr_of!((*ptr).flags) as usize - ptr as usize }, + 32usize, concat!( "Offset of field: ", - stringify!(CK_OTP_SIGNATURE_INFO), + stringify!(CK_C_INITIALIZE_ARGS), "::", - stringify!(pParams) + stringify!(flags) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulCount) as usize - ptr as usize }, - 8usize, + unsafe { ::std::ptr::addr_of!((*ptr).pReserved) as usize - ptr as usize }, + 40usize, concat!( "Offset of field: ", - stringify!(CK_OTP_SIGNATURE_INFO), + stringify!(CK_C_INITIALIZE_ARGS), "::", - stringify!(ulCount) + stringify!(pReserved) ) ); } -impl Default for CK_OTP_SIGNATURE_INFO { +impl Default for CK_C_INITIALIZE_ARGS { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { @@ -1571,35 +1798,41 @@ impl Default for CK_OTP_SIGNATURE_INFO { } } } -pub type CK_RSA_PKCS_MGF_TYPE = ::std::os::raw::c_ulong; +pub type CK_C_INITIALIZE_ARGS_PTR = *mut CK_C_INITIALIZE_ARGS; +pub type CK_RSA_PKCS_MGF_TYPE = CK_ULONG; +pub type CK_RSA_PKCS_MGF_TYPE_PTR = *mut CK_RSA_PKCS_MGF_TYPE; +pub type CK_RSA_PKCS_OAEP_SOURCE_TYPE = CK_ULONG; +pub type CK_RSA_PKCS_OAEP_SOURCE_TYPE_PTR = *mut CK_RSA_PKCS_OAEP_SOURCE_TYPE; #[repr(C)] -#[derive(Debug, Default, Copy, Clone)] -pub struct ck_rsa_pkcs_pss_params { +#[derive(Debug, Copy, Clone)] +pub struct CK_RSA_PKCS_OAEP_PARAMS { pub hashAlg: CK_MECHANISM_TYPE, pub mgf: CK_RSA_PKCS_MGF_TYPE, - pub sLen: ::std::os::raw::c_ulong, + pub source: CK_RSA_PKCS_OAEP_SOURCE_TYPE, + pub pSourceData: CK_VOID_PTR, + pub ulSourceDataLen: CK_ULONG, } #[test] -fn bindgen_test_layout_ck_rsa_pkcs_pss_params() { - const UNINIT: ::std::mem::MaybeUninit = +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_pss_params)) + ::std::mem::size_of::(), + 40usize, + concat!("Size of: ", stringify!(CK_RSA_PKCS_OAEP_PARAMS)) ); assert_eq!( - ::std::mem::align_of::(), + ::std::mem::align_of::(), 8usize, - concat!("Alignment of ", stringify!(ck_rsa_pkcs_pss_params)) + 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_pss_params), + stringify!(CK_RSA_PKCS_OAEP_PARAMS), "::", stringify!(hashAlg) ) @@ -1609,75 +1842,19 @@ fn bindgen_test_layout_ck_rsa_pkcs_pss_params() { 8usize, concat!( "Offset of field: ", - stringify!(ck_rsa_pkcs_pss_params), + stringify!(CK_RSA_PKCS_OAEP_PARAMS), "::", stringify!(mgf) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).sLen) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).source) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", - stringify!(ck_rsa_pkcs_pss_params), + stringify!(CK_RSA_PKCS_OAEP_PARAMS), "::", - stringify!(sLen) - ) - ); -} -pub type CK_RSA_PKCS_OAEP_SOURCE_TYPE = ::std::os::raw::c_ulong; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct ck_rsa_pkcs_oaep_params { - pub hashAlg: CK_MECHANISM_TYPE, - pub mgf: CK_RSA_PKCS_MGF_TYPE, - pub source: CK_RSA_PKCS_OAEP_SOURCE_TYPE, - pub pSourceData: *mut ::std::os::raw::c_void, - pub ulSourceDataLen: ::std::os::raw::c_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::(), - 40usize, - concat!("Size of: ", stringify!(ck_rsa_pkcs_oaep_params)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - 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 }, - 8usize, - 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 }, - 16usize, - concat!( - "Offset of field: ", - stringify!(ck_rsa_pkcs_oaep_params), - "::", - stringify!(source) + stringify!(source) ) ); assert_eq!( @@ -1685,7 +1862,7 @@ fn bindgen_test_layout_ck_rsa_pkcs_oaep_params() { 24usize, concat!( "Offset of field: ", - stringify!(ck_rsa_pkcs_oaep_params), + stringify!(CK_RSA_PKCS_OAEP_PARAMS), "::", stringify!(pSourceData) ) @@ -1695,13 +1872,13 @@ fn bindgen_test_layout_ck_rsa_pkcs_oaep_params() { 32usize, concat!( "Offset of field: ", - stringify!(ck_rsa_pkcs_oaep_params), + stringify!(CK_RSA_PKCS_OAEP_PARAMS), "::", stringify!(ulSourceDataLen) ) ); } -impl Default for ck_rsa_pkcs_oaep_params { +impl Default for CK_RSA_PKCS_OAEP_PARAMS { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { @@ -1710,133 +1887,138 @@ impl Default for ck_rsa_pkcs_oaep_params { } } } +pub type CK_RSA_PKCS_OAEP_PARAMS_PTR = *mut CK_RSA_PKCS_OAEP_PARAMS; #[repr(C)] #[derive(Debug, Default, Copy, Clone)] -pub struct ck_aes_ctr_params { - pub ulCounterBits: ::std::os::raw::c_ulong, - pub cb: [::std::os::raw::c_uchar; 16usize], +pub struct CK_RSA_PKCS_PSS_PARAMS { + pub hashAlg: CK_MECHANISM_TYPE, + pub mgf: CK_RSA_PKCS_MGF_TYPE, + pub sLen: CK_ULONG, } #[test] -fn bindgen_test_layout_ck_aes_ctr_params() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); +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::(), + ::std::mem::size_of::(), 24usize, - concat!("Size of: ", stringify!(ck_aes_ctr_params)) + concat!("Size of: ", stringify!(CK_RSA_PKCS_PSS_PARAMS)) ); assert_eq!( - ::std::mem::align_of::(), + ::std::mem::align_of::(), 8usize, - concat!("Alignment of ", stringify!(ck_aes_ctr_params)) + concat!("Alignment of ", stringify!(CK_RSA_PKCS_PSS_PARAMS)) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulCounterBits) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).hashAlg) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", - stringify!(ck_aes_ctr_params), + stringify!(CK_RSA_PKCS_PSS_PARAMS), "::", - stringify!(ulCounterBits) + stringify!(hashAlg) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).cb) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).mgf) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", - stringify!(ck_aes_ctr_params), + stringify!(CK_RSA_PKCS_PSS_PARAMS), "::", - stringify!(cb) + stringify!(mgf) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).sLen) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(CK_RSA_PKCS_PSS_PARAMS), + "::", + stringify!(sLen) ) ); } +pub type CK_RSA_PKCS_PSS_PARAMS_PTR = *mut CK_RSA_PKCS_PSS_PARAMS; +pub type CK_EC_KDF_TYPE = CK_ULONG; #[repr(C)] #[derive(Debug, Copy, Clone)] -pub struct ck_gcm_params { - pub pIv: *mut ::std::os::raw::c_uchar, - pub ulIvLen: ::std::os::raw::c_ulong, - pub ulIvBits: ::std::os::raw::c_ulong, - pub pAAD: *mut ::std::os::raw::c_uchar, - pub ulAADLen: ::std::os::raw::c_ulong, - pub ulTagBits: ::std::os::raw::c_ulong, +pub struct CK_ECDH1_DERIVE_PARAMS { + pub kdf: CK_EC_KDF_TYPE, + pub ulSharedDataLen: CK_ULONG, + pub pSharedData: CK_BYTE_PTR, + pub ulPublicDataLen: CK_ULONG, + pub pPublicData: CK_BYTE_PTR, } #[test] -fn bindgen_test_layout_ck_gcm_params() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); +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::(), - 48usize, - concat!("Size of: ", stringify!(ck_gcm_params)) + ::std::mem::size_of::(), + 40usize, + concat!("Size of: ", stringify!(CK_ECDH1_DERIVE_PARAMS)) ); assert_eq!( - ::std::mem::align_of::(), + ::std::mem::align_of::(), 8usize, - concat!("Alignment of ", stringify!(ck_gcm_params)) + concat!("Alignment of ", stringify!(CK_ECDH1_DERIVE_PARAMS)) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pIv) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).kdf) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", - stringify!(ck_gcm_params), + stringify!(CK_ECDH1_DERIVE_PARAMS), "::", - stringify!(pIv) + stringify!(kdf) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulIvLen) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ulSharedDataLen) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", - stringify!(ck_gcm_params), + stringify!(CK_ECDH1_DERIVE_PARAMS), "::", - stringify!(ulIvLen) + stringify!(ulSharedDataLen) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulIvBits) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).pSharedData) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", - stringify!(ck_gcm_params), + stringify!(CK_ECDH1_DERIVE_PARAMS), "::", - stringify!(ulIvBits) + stringify!(pSharedData) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pAAD) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ulPublicDataLen) as usize - ptr as usize }, 24usize, concat!( "Offset of field: ", - stringify!(ck_gcm_params), + stringify!(CK_ECDH1_DERIVE_PARAMS), "::", - stringify!(pAAD) + stringify!(ulPublicDataLen) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulAADLen) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).pPublicData) as usize - ptr as usize }, 32usize, concat!( "Offset of field: ", - stringify!(ck_gcm_params), - "::", - stringify!(ulAADLen) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulTagBits) as usize - ptr as usize }, - 40usize, - concat!( - "Offset of field: ", - stringify!(ck_gcm_params), + stringify!(CK_ECDH1_DERIVE_PARAMS), "::", - stringify!(ulTagBits) + stringify!(pPublicData) ) ); } -impl Default for ck_gcm_params { +impl Default for CK_ECDH1_DERIVE_PARAMS { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { @@ -1845,37 +2027,41 @@ impl Default for ck_gcm_params { } } } -pub type ck_ec_kdf_t = ::std::os::raw::c_ulong; +pub type CK_ECDH1_DERIVE_PARAMS_PTR = *mut CK_ECDH1_DERIVE_PARAMS; #[repr(C)] #[derive(Debug, Copy, Clone)] -pub struct ck_ecdh1_derive_params { - pub kdf: ck_ec_kdf_t, - pub ulSharedDataLen: ::std::os::raw::c_ulong, - pub pSharedData: *mut ::std::os::raw::c_uchar, - pub ulPublicDataLen: ::std::os::raw::c_ulong, - pub pPublicData: *mut ::std::os::raw::c_uchar, +pub struct CK_ECDH2_DERIVE_PARAMS { + pub kdf: CK_EC_KDF_TYPE, + pub ulSharedDataLen: CK_ULONG, + pub pSharedData: CK_BYTE_PTR, + pub ulPublicDataLen: CK_ULONG, + pub pPublicData: CK_BYTE_PTR, + pub ulPrivateDataLen: CK_ULONG, + pub hPrivateData: CK_OBJECT_HANDLE, + pub ulPublicDataLen2: CK_ULONG, + pub pPublicData2: CK_BYTE_PTR, } #[test] -fn bindgen_test_layout_ck_ecdh1_derive_params() { - const UNINIT: ::std::mem::MaybeUninit = +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::(), - 40usize, - concat!("Size of: ", stringify!(ck_ecdh1_derive_params)) + ::std::mem::size_of::(), + 72usize, + concat!("Size of: ", stringify!(CK_ECDH2_DERIVE_PARAMS)) ); assert_eq!( - ::std::mem::align_of::(), + ::std::mem::align_of::(), 8usize, - concat!("Alignment of ", stringify!(ck_ecdh1_derive_params)) + 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_ecdh1_derive_params), + stringify!(CK_ECDH2_DERIVE_PARAMS), "::", stringify!(kdf) ) @@ -1885,7 +2071,7 @@ fn bindgen_test_layout_ck_ecdh1_derive_params() { 8usize, concat!( "Offset of field: ", - stringify!(ck_ecdh1_derive_params), + stringify!(CK_ECDH2_DERIVE_PARAMS), "::", stringify!(ulSharedDataLen) ) @@ -1895,7 +2081,7 @@ fn bindgen_test_layout_ck_ecdh1_derive_params() { 16usize, concat!( "Offset of field: ", - stringify!(ck_ecdh1_derive_params), + stringify!(CK_ECDH2_DERIVE_PARAMS), "::", stringify!(pSharedData) ) @@ -1905,7 +2091,7 @@ fn bindgen_test_layout_ck_ecdh1_derive_params() { 24usize, concat!( "Offset of field: ", - stringify!(ck_ecdh1_derive_params), + stringify!(CK_ECDH2_DERIVE_PARAMS), "::", stringify!(ulPublicDataLen) ) @@ -1915,13 +2101,53 @@ fn bindgen_test_layout_ck_ecdh1_derive_params() { 32usize, concat!( "Offset of field: ", - stringify!(ck_ecdh1_derive_params), + stringify!(CK_ECDH2_DERIVE_PARAMS), "::", stringify!(pPublicData) ) ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ulPrivateDataLen) as usize - ptr as usize }, + 40usize, + 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 }, + 48usize, + 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 }, + 56usize, + 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 }, + 64usize, + concat!( + "Offset of field: ", + stringify!(CK_ECDH2_DERIVE_PARAMS), + "::", + stringify!(pPublicData2) + ) + ); } -impl Default for ck_ecdh1_derive_params { +impl Default for CK_ECDH2_DERIVE_PARAMS { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { @@ -1930,49 +2156,138 @@ impl Default for ck_ecdh1_derive_params { } } } +pub type CK_ECDH2_DERIVE_PARAMS_PTR = *mut CK_ECDH2_DERIVE_PARAMS; #[repr(C)] #[derive(Debug, Copy, Clone)] -pub struct ck_key_derivation_string_data { - pub pData: *mut ::std::os::raw::c_uchar, - pub ulLen: ::std::os::raw::c_ulong, +pub struct CK_ECMQV_DERIVE_PARAMS { + pub kdf: CK_EC_KDF_TYPE, + pub ulSharedDataLen: CK_ULONG, + pub pSharedData: CK_BYTE_PTR, + pub ulPublicDataLen: CK_ULONG, + pub pPublicData: CK_BYTE_PTR, + pub ulPrivateDataLen: CK_ULONG, + pub hPrivateData: CK_OBJECT_HANDLE, + pub ulPublicDataLen2: CK_ULONG, + pub pPublicData2: CK_BYTE_PTR, + pub publicKey: CK_OBJECT_HANDLE, } #[test] -fn bindgen_test_layout_ck_key_derivation_string_data() { - const UNINIT: ::std::mem::MaybeUninit = +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::(), - 16usize, - concat!("Size of: ", stringify!(ck_key_derivation_string_data)) + ::std::mem::size_of::(), + 80usize, + concat!("Size of: ", stringify!(CK_ECMQV_DERIVE_PARAMS)) ); assert_eq!( - ::std::mem::align_of::(), + ::std::mem::align_of::(), 8usize, - concat!("Alignment of ", stringify!(ck_key_derivation_string_data)) + concat!("Alignment of ", stringify!(CK_ECMQV_DERIVE_PARAMS)) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pData) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).kdf) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", - stringify!(ck_key_derivation_string_data), + stringify!(CK_ECMQV_DERIVE_PARAMS), "::", - stringify!(pData) + stringify!(kdf) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulLen) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ulSharedDataLen) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", - stringify!(ck_key_derivation_string_data), + stringify!(CK_ECMQV_DERIVE_PARAMS), "::", - stringify!(ulLen) + stringify!(ulSharedDataLen) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pSharedData) as usize - ptr as usize }, + 16usize, + 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 }, + 24usize, + 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 }, + 32usize, + 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 }, + 40usize, + 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 }, + 48usize, + 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 }, + 56usize, + 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 }, + 64usize, + 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 }, + 72usize, + concat!( + "Offset of field: ", + stringify!(CK_ECMQV_DERIVE_PARAMS), + "::", + stringify!(publicKey) ) ); } -impl Default for ck_key_derivation_string_data { +impl Default for CK_ECMQV_DERIVE_PARAMS { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { @@ -1981,60 +2296,85 @@ impl Default for ck_key_derivation_string_data { } } } +pub type CK_ECMQV_DERIVE_PARAMS_PTR = *mut CK_ECMQV_DERIVE_PARAMS; +pub type CK_X9_42_DH_KDF_TYPE = CK_ULONG; +pub type CK_X9_42_DH_KDF_TYPE_PTR = *mut CK_X9_42_DH_KDF_TYPE; #[repr(C)] #[derive(Debug, Copy, Clone)] -pub struct ck_des_cbc_encrypt_data_params { - pub iv: [::std::os::raw::c_uchar; 8usize], - pub pData: *mut ::std::os::raw::c_uchar, - pub length: ::std::os::raw::c_ulong, +pub struct CK_X9_42_DH1_DERIVE_PARAMS { + pub kdf: CK_X9_42_DH_KDF_TYPE, + pub ulOtherInfoLen: CK_ULONG, + pub pOtherInfo: CK_BYTE_PTR, + pub ulPublicDataLen: CK_ULONG, + pub pPublicData: CK_BYTE_PTR, } #[test] -fn bindgen_test_layout_ck_des_cbc_encrypt_data_params() { - const UNINIT: ::std::mem::MaybeUninit = +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::(), - 24usize, - concat!("Size of: ", stringify!(ck_des_cbc_encrypt_data_params)) + ::std::mem::size_of::(), + 40usize, + concat!("Size of: ", stringify!(CK_X9_42_DH1_DERIVE_PARAMS)) ); assert_eq!( - ::std::mem::align_of::(), + ::std::mem::align_of::(), 8usize, - concat!("Alignment of ", stringify!(ck_des_cbc_encrypt_data_params)) + concat!("Alignment of ", stringify!(CK_X9_42_DH1_DERIVE_PARAMS)) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).iv) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).kdf) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", - stringify!(ck_des_cbc_encrypt_data_params), + stringify!(CK_X9_42_DH1_DERIVE_PARAMS), "::", - stringify!(iv) + stringify!(kdf) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pData) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ulOtherInfoLen) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", - stringify!(ck_des_cbc_encrypt_data_params), + stringify!(CK_X9_42_DH1_DERIVE_PARAMS), "::", - stringify!(pData) + stringify!(ulOtherInfoLen) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).length) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).pOtherInfo) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", - stringify!(ck_des_cbc_encrypt_data_params), + stringify!(CK_X9_42_DH1_DERIVE_PARAMS), "::", - stringify!(length) + stringify!(pOtherInfo) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ulPublicDataLen) as usize - ptr as usize }, + 24usize, + 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 }, + 32usize, + concat!( + "Offset of field: ", + stringify!(CK_X9_42_DH1_DERIVE_PARAMS), + "::", + stringify!(pPublicData) ) ); } -impl Default for ck_des_cbc_encrypt_data_params { +impl Default for CK_X9_42_DH1_DERIVE_PARAMS { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { @@ -2043,540 +2383,7363 @@ impl Default for ck_des_cbc_encrypt_data_params { } } } +pub type CK_X9_42_DH1_DERIVE_PARAMS_PTR = *mut CK_X9_42_DH1_DERIVE_PARAMS; #[repr(C)] #[derive(Debug, Copy, Clone)] -pub struct ck_aes_cbc_encrypt_data_params { - pub iv: [::std::os::raw::c_uchar; 16usize], - pub pData: *mut ::std::os::raw::c_uchar, - pub length: ::std::os::raw::c_ulong, +pub struct CK_X9_42_DH2_DERIVE_PARAMS { + pub kdf: CK_X9_42_DH_KDF_TYPE, + pub ulOtherInfoLen: CK_ULONG, + pub pOtherInfo: CK_BYTE_PTR, + pub ulPublicDataLen: CK_ULONG, + pub pPublicData: CK_BYTE_PTR, + pub ulPrivateDataLen: CK_ULONG, + pub hPrivateData: CK_OBJECT_HANDLE, + pub ulPublicDataLen2: CK_ULONG, + pub pPublicData2: CK_BYTE_PTR, } #[test] -fn bindgen_test_layout_ck_aes_cbc_encrypt_data_params() { - const UNINIT: ::std::mem::MaybeUninit = +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::(), - 32usize, - concat!("Size of: ", stringify!(ck_aes_cbc_encrypt_data_params)) + ::std::mem::size_of::(), + 72usize, + concat!("Size of: ", stringify!(CK_X9_42_DH2_DERIVE_PARAMS)) ); assert_eq!( - ::std::mem::align_of::(), + ::std::mem::align_of::(), 8usize, - concat!("Alignment of ", stringify!(ck_aes_cbc_encrypt_data_params)) + concat!("Alignment of ", stringify!(CK_X9_42_DH2_DERIVE_PARAMS)) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).iv) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).kdf) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", - stringify!(ck_aes_cbc_encrypt_data_params), + stringify!(CK_X9_42_DH2_DERIVE_PARAMS), "::", - stringify!(iv) + stringify!(kdf) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pData) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ulOtherInfoLen) as usize - ptr as usize }, + 8usize, + 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 }, 16usize, concat!( "Offset of field: ", - stringify!(ck_aes_cbc_encrypt_data_params), + stringify!(CK_X9_42_DH2_DERIVE_PARAMS), "::", - stringify!(pData) + stringify!(pOtherInfo) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).length) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ulPublicDataLen) as usize - ptr as usize }, 24usize, concat!( "Offset of field: ", - stringify!(ck_aes_cbc_encrypt_data_params), + stringify!(CK_X9_42_DH2_DERIVE_PARAMS), "::", - stringify!(length) + stringify!(ulPublicDataLen) ) ); -} -impl Default for ck_aes_cbc_encrypt_data_params { - fn default() -> Self { - let mut s = ::std::mem::MaybeUninit::::uninit(); - unsafe { - ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -pub type CK_RV = ::std::os::raw::c_ulong; -pub type CK_NOTIFY = ::std::option::Option< - unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - event: CK_NOTIFICATION, - application: *mut ::std::os::raw::c_void, - ) -> CK_RV, ->; -pub type CK_C_Initialize = - ::std::option::Option CK_RV>; -pub type CK_C_Finalize = - ::std::option::Option CK_RV>; -pub type CK_C_GetInfo = ::std::option::Option CK_RV>; -pub type CK_C_GetFunctionList = ::std::option::Option< - unsafe extern "C" fn(function_list: *mut *mut _CK_FUNCTION_LIST) -> CK_RV, ->; -pub type CK_C_GetSlotList = ::std::option::Option< - unsafe extern "C" fn( - token_present: ::std::os::raw::c_uchar, - slot_list: *mut CK_SLOT_ID, - ulCount: *mut ::std::os::raw::c_ulong, - ) -> CK_RV, ->; -pub type CK_C_GetSlotInfo = ::std::option::Option< - unsafe extern "C" fn(slotID: CK_SLOT_ID, info: *mut _CK_SLOT_INFO) -> CK_RV, ->; -pub type CK_C_GetTokenInfo = ::std::option::Option< - unsafe extern "C" fn(slotID: CK_SLOT_ID, info: *mut _CK_TOKEN_INFO) -> CK_RV, ->; -pub type CK_C_WaitForSlotEvent = ::std::option::Option< + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pPublicData) as usize - ptr as usize }, + 32usize, + 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 }, + 40usize, + 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 }, + 48usize, + 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 }, + 56usize, + 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 }, + 64usize, + concat!( + "Offset of field: ", + stringify!(CK_X9_42_DH2_DERIVE_PARAMS), + "::", + stringify!(pPublicData2) + ) + ); +} +impl Default for CK_X9_42_DH2_DERIVE_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_X9_42_DH2_DERIVE_PARAMS_PTR = *mut CK_X9_42_DH2_DERIVE_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_X9_42_MQV_DERIVE_PARAMS { + pub kdf: CK_X9_42_DH_KDF_TYPE, + pub ulOtherInfoLen: CK_ULONG, + pub pOtherInfo: CK_BYTE_PTR, + pub ulPublicDataLen: CK_ULONG, + pub pPublicData: CK_BYTE_PTR, + pub ulPrivateDataLen: CK_ULONG, + pub hPrivateData: CK_OBJECT_HANDLE, + pub ulPublicDataLen2: CK_ULONG, + 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::(), + 80usize, + concat!("Size of: ", stringify!(CK_X9_42_MQV_DERIVE_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + 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 }, + 16usize, + 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 }, + 24usize, + 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 }, + 32usize, + 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 }, + 40usize, + 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 }, + 48usize, + 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 }, + 56usize, + 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 }, + 64usize, + 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 }, + 72usize, + concat!( + "Offset of field: ", + stringify!(CK_X9_42_MQV_DERIVE_PARAMS), + "::", + stringify!(publicKey) + ) + ); +} +impl Default for CK_X9_42_MQV_DERIVE_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_X9_42_MQV_DERIVE_PARAMS_PTR = *mut CK_X9_42_MQV_DERIVE_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_KEA_DERIVE_PARAMS { + pub isSender: CK_BBOOL, + pub ulRandomLen: CK_ULONG, + pub pRandomA: CK_BYTE_PTR, + pub pRandomB: CK_BYTE_PTR, + 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::(), + 48usize, + concat!("Size of: ", stringify!(CK_KEA_DERIVE_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + 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 }, + 16usize, + 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 }, + 24usize, + 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 }, + 32usize, + 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 }, + 40usize, + concat!( + "Offset of field: ", + stringify!(CK_KEA_DERIVE_PARAMS), + "::", + stringify!(pPublicData) + ) + ); +} +impl Default for CK_KEA_DERIVE_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_KEA_DERIVE_PARAMS_PTR = *mut CK_KEA_DERIVE_PARAMS; +pub type CK_RC2_PARAMS = CK_ULONG; +pub type CK_RC2_PARAMS_PTR = *mut CK_RC2_PARAMS; +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +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::(), + 16usize, + concat!("Size of: ", stringify!(CK_RC2_CBC_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + concat!( + "Offset of field: ", + stringify!(CK_RC2_CBC_PARAMS), + "::", + stringify!(iv) + ) + ); +} +pub type CK_RC2_CBC_PARAMS_PTR = *mut CK_RC2_CBC_PARAMS; +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +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::(), + 16usize, + concat!("Size of: ", stringify!(CK_RC2_MAC_GENERAL_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + concat!( + "Offset of field: ", + stringify!(CK_RC2_MAC_GENERAL_PARAMS), + "::", + stringify!(ulMacLength) + ) + ); +} +pub type CK_RC2_MAC_GENERAL_PARAMS_PTR = *mut CK_RC2_MAC_GENERAL_PARAMS; +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +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::(), + 16usize, + concat!("Size of: ", stringify!(CK_RC5_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + concat!( + "Offset of field: ", + stringify!(CK_RC5_PARAMS), + "::", + stringify!(ulRounds) + ) + ); +} +pub type CK_RC5_PARAMS_PTR = *mut CK_RC5_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_RC5_CBC_PARAMS { + pub ulWordsize: CK_ULONG, + pub ulRounds: CK_ULONG, + 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::(), + 32usize, + concat!("Size of: ", stringify!(CK_RC5_CBC_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + 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 }, + 16usize, + 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 }, + 24usize, + concat!( + "Offset of field: ", + stringify!(CK_RC5_CBC_PARAMS), + "::", + stringify!(ulIvLen) + ) + ); +} +impl Default for CK_RC5_CBC_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_RC5_CBC_PARAMS_PTR = *mut CK_RC5_CBC_PARAMS; +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct CK_RC5_MAC_GENERAL_PARAMS { + pub ulWordsize: CK_ULONG, + 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::(), + 24usize, + concat!("Size of: ", stringify!(CK_RC5_MAC_GENERAL_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + 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 }, + 16usize, + concat!( + "Offset of field: ", + stringify!(CK_RC5_MAC_GENERAL_PARAMS), + "::", + stringify!(ulMacLength) + ) + ); +} +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; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_DES_CBC_ENCRYPT_DATA_PARAMS { + pub iv: [CK_BYTE; 8usize], + 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::(), + 24usize, + concat!("Size of: ", stringify!(CK_DES_CBC_ENCRYPT_DATA_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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) + ) + ); +} +impl Default for CK_DES_CBC_ENCRYPT_DATA_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_DES_CBC_ENCRYPT_DATA_PARAMS_PTR = *mut CK_DES_CBC_ENCRYPT_DATA_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_AES_CBC_ENCRYPT_DATA_PARAMS { + pub iv: [CK_BYTE; 16usize], + 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::(), + 32usize, + concat!("Size of: ", stringify!(CK_AES_CBC_ENCRYPT_DATA_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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) + ) + ); +} +impl Default for CK_AES_CBC_ENCRYPT_DATA_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_AES_CBC_ENCRYPT_DATA_PARAMS_PTR = *mut CK_AES_CBC_ENCRYPT_DATA_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_SKIPJACK_PRIVATE_WRAP_PARAMS { + pub ulPasswordLen: CK_ULONG, + pub pPassword: CK_BYTE_PTR, + pub ulPublicDataLen: CK_ULONG, + pub pPublicData: CK_BYTE_PTR, + pub ulPAndGLen: CK_ULONG, + pub ulQLen: CK_ULONG, + pub ulRandomLen: CK_ULONG, + pub pRandomA: CK_BYTE_PTR, + pub pPrimeP: CK_BYTE_PTR, + 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::(), + 88usize, + concat!("Size of: ", stringify!(CK_SKIPJACK_PRIVATE_WRAP_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + 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 }, + 16usize, + 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 }, + 24usize, + 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 }, + 32usize, + 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 }, + 40usize, + 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 }, + 48usize, + 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 }, + 56usize, + 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 }, + 64usize, + 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 }, + 72usize, + 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 }, + 80usize, + concat!( + "Offset of field: ", + stringify!(CK_SKIPJACK_PRIVATE_WRAP_PARAMS), + "::", + stringify!(pSubprimeQ) + ) + ); +} +impl Default for CK_SKIPJACK_PRIVATE_WRAP_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_SKIPJACK_PRIVATE_WRAP_PARAMS_PTR = *mut CK_SKIPJACK_PRIVATE_WRAP_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_SKIPJACK_RELAYX_PARAMS { + pub ulOldWrappedXLen: CK_ULONG, + pub pOldWrappedX: CK_BYTE_PTR, + pub ulOldPasswordLen: CK_ULONG, + pub pOldPassword: CK_BYTE_PTR, + pub ulOldPublicDataLen: CK_ULONG, + pub pOldPublicData: CK_BYTE_PTR, + pub ulOldRandomLen: CK_ULONG, + pub pOldRandomA: CK_BYTE_PTR, + pub ulNewPasswordLen: CK_ULONG, + pub pNewPassword: CK_BYTE_PTR, + pub ulNewPublicDataLen: CK_ULONG, + pub pNewPublicData: CK_BYTE_PTR, + 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::(), + 112usize, + concat!("Size of: ", stringify!(CK_SKIPJACK_RELAYX_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + 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 }, + 16usize, + 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 }, + 24usize, + 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 }, + 32usize, + 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 }, + 40usize, + 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 }, + 48usize, + 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 }, + 56usize, + 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 }, + 64usize, + 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 }, + 72usize, + 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 }, + 80usize, + 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 }, + 88usize, + 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 }, + 96usize, + 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 }, + 104usize, + concat!( + "Offset of field: ", + stringify!(CK_SKIPJACK_RELAYX_PARAMS), + "::", + stringify!(pNewRandomA) + ) + ); +} +impl Default for CK_SKIPJACK_RELAYX_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_SKIPJACK_RELAYX_PARAMS_PTR = *mut CK_SKIPJACK_RELAYX_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_PBE_PARAMS { + pub pInitVector: CK_BYTE_PTR, + pub pPassword: CK_UTF8CHAR_PTR, + pub ulPasswordLen: CK_ULONG, + pub pSalt: CK_BYTE_PTR, + 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::(), + 48usize, + concat!("Size of: ", stringify!(CK_PBE_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 24usize, + concat!( + "Offset of field: ", + stringify!(CK_PBE_PARAMS), + "::", + stringify!(pSalt) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ulSaltLen) as usize - ptr as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(CK_PBE_PARAMS), + "::", + stringify!(ulSaltLen) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ulIteration) as usize - ptr as usize }, + 40usize, + concat!( + "Offset of field: ", + stringify!(CK_PBE_PARAMS), + "::", + stringify!(ulIteration) + ) + ); +} +impl Default for CK_PBE_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_PBE_PARAMS_PTR = *mut CK_PBE_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_KEY_WRAP_SET_OAEP_PARAMS { + pub bBC: CK_BYTE, + 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::(), + 24usize, + concat!("Size of: ", stringify!(CK_KEY_WRAP_SET_OAEP_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + 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 }, + 16usize, + concat!( + "Offset of field: ", + stringify!(CK_KEY_WRAP_SET_OAEP_PARAMS), + "::", + stringify!(ulXLen) + ) + ); +} +impl Default for CK_KEY_WRAP_SET_OAEP_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_KEY_WRAP_SET_OAEP_PARAMS_PTR = *mut CK_KEY_WRAP_SET_OAEP_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_SSL3_RANDOM_DATA { + pub pClientRandom: CK_BYTE_PTR, + pub ulClientRandomLen: CK_ULONG, + 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::(), + 32usize, + concat!("Size of: ", stringify!(CK_SSL3_RANDOM_DATA)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 16usize, + 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 }, + 24usize, + concat!( + "Offset of field: ", + stringify!(CK_SSL3_RANDOM_DATA), + "::", + stringify!(ulServerRandomLen) + ) + ); +} +impl Default for CK_SSL3_RANDOM_DATA { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct 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::(), + 40usize, + concat!("Size of: ", stringify!(CK_SSL3_MASTER_KEY_DERIVE_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 32usize, + concat!( + "Offset of field: ", + stringify!(CK_SSL3_MASTER_KEY_DERIVE_PARAMS), + "::", + stringify!(pVersion) + ) + ); +} +impl Default for CK_SSL3_MASTER_KEY_DERIVE_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_SSL3_MASTER_KEY_DERIVE_PARAMS_PTR = *mut CK_SSL3_MASTER_KEY_DERIVE_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_SSL3_KEY_MAT_OUT { + pub hClientMacSecret: CK_OBJECT_HANDLE, + pub hServerMacSecret: CK_OBJECT_HANDLE, + pub hClientKey: CK_OBJECT_HANDLE, + pub hServerKey: CK_OBJECT_HANDLE, + 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::(), + 48usize, + concat!("Size of: ", stringify!(CK_SSL3_KEY_MAT_OUT)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + 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 }, + 16usize, + 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 }, + 24usize, + 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 }, + 32usize, + 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 }, + 40usize, + concat!( + "Offset of field: ", + stringify!(CK_SSL3_KEY_MAT_OUT), + "::", + stringify!(pIVServer) + ) + ); +} +impl Default for CK_SSL3_KEY_MAT_OUT { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_SSL3_KEY_MAT_OUT_PTR = *mut CK_SSL3_KEY_MAT_OUT; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_SSL3_KEY_MAT_PARAMS { + pub ulMacSizeInBits: CK_ULONG, + pub ulKeySizeInBits: CK_ULONG, + pub ulIVSizeInBits: CK_ULONG, + pub bIsExport: CK_BBOOL, + 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::(), + 72usize, + concat!("Size of: ", stringify!(CK_SSL3_KEY_MAT_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + 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 }, + 16usize, + 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 }, + 24usize, + 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 }, + 32usize, + 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 }, + 64usize, + concat!( + "Offset of field: ", + stringify!(CK_SSL3_KEY_MAT_PARAMS), + "::", + stringify!(pReturnedKeyMaterial) + ) + ); +} +impl Default for CK_SSL3_KEY_MAT_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_SSL3_KEY_MAT_PARAMS_PTR = *mut CK_SSL3_KEY_MAT_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_TLS_PRF_PARAMS { + pub pSeed: CK_BYTE_PTR, + pub ulSeedLen: CK_ULONG, + pub pLabel: CK_BYTE_PTR, + pub ulLabelLen: CK_ULONG, + 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::(), + 48usize, + concat!("Size of: ", stringify!(CK_TLS_PRF_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 16usize, + 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 }, + 24usize, + 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 }, + 32usize, + 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 }, + 40usize, + concat!( + "Offset of field: ", + stringify!(CK_TLS_PRF_PARAMS), + "::", + stringify!(pulOutputLen) + ) + ); +} +impl Default for CK_TLS_PRF_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_TLS_PRF_PARAMS_PTR = *mut CK_TLS_PRF_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_WTLS_RANDOM_DATA { + pub pClientRandom: CK_BYTE_PTR, + pub ulClientRandomLen: CK_ULONG, + 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::(), + 32usize, + concat!("Size of: ", stringify!(CK_WTLS_RANDOM_DATA)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 16usize, + 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 }, + 24usize, + concat!( + "Offset of field: ", + stringify!(CK_WTLS_RANDOM_DATA), + "::", + stringify!(ulServerRandomLen) + ) + ); +} +impl Default for CK_WTLS_RANDOM_DATA { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_WTLS_RANDOM_DATA_PTR = *mut CK_WTLS_RANDOM_DATA; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_WTLS_MASTER_KEY_DERIVE_PARAMS { + pub DigestMechanism: CK_MECHANISM_TYPE, + 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::(), + 48usize, + concat!("Size of: ", stringify!(CK_WTLS_MASTER_KEY_DERIVE_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + 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 }, + 40usize, + concat!( + "Offset of field: ", + stringify!(CK_WTLS_MASTER_KEY_DERIVE_PARAMS), + "::", + stringify!(pVersion) + ) + ); +} +impl Default for CK_WTLS_MASTER_KEY_DERIVE_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_WTLS_MASTER_KEY_DERIVE_PARAMS_PTR = *mut CK_WTLS_MASTER_KEY_DERIVE_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_WTLS_PRF_PARAMS { + pub DigestMechanism: CK_MECHANISM_TYPE, + pub pSeed: CK_BYTE_PTR, + pub ulSeedLen: CK_ULONG, + pub pLabel: CK_BYTE_PTR, + pub ulLabelLen: CK_ULONG, + 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::(), + 56usize, + concat!("Size of: ", stringify!(CK_WTLS_PRF_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + 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 }, + 16usize, + 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 }, + 24usize, + 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 }, + 32usize, + 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 }, + 40usize, + 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 }, + 48usize, + concat!( + "Offset of field: ", + stringify!(CK_WTLS_PRF_PARAMS), + "::", + stringify!(pulOutputLen) + ) + ); +} +impl Default for CK_WTLS_PRF_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_WTLS_PRF_PARAMS_PTR = *mut CK_WTLS_PRF_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_WTLS_KEY_MAT_OUT { + pub hMacSecret: CK_OBJECT_HANDLE, + 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::(), + 24usize, + concat!("Size of: ", stringify!(CK_WTLS_KEY_MAT_OUT)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + 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 }, + 16usize, + concat!( + "Offset of field: ", + stringify!(CK_WTLS_KEY_MAT_OUT), + "::", + stringify!(pIV) + ) + ); +} +impl Default for CK_WTLS_KEY_MAT_OUT { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_WTLS_KEY_MAT_OUT_PTR = *mut CK_WTLS_KEY_MAT_OUT; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_WTLS_KEY_MAT_PARAMS { + pub DigestMechanism: CK_MECHANISM_TYPE, + pub ulMacSizeInBits: CK_ULONG, + pub ulKeySizeInBits: CK_ULONG, + pub ulIVSizeInBits: CK_ULONG, + pub ulSequenceNumber: CK_ULONG, + pub bIsExport: CK_BBOOL, + 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::(), + 88usize, + concat!("Size of: ", stringify!(CK_WTLS_KEY_MAT_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + 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 }, + 16usize, + 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 }, + 24usize, + 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 }, + 32usize, + 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 }, + 40usize, + 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 }, + 48usize, + 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 }, + 80usize, + concat!( + "Offset of field: ", + stringify!(CK_WTLS_KEY_MAT_PARAMS), + "::", + stringify!(pReturnedKeyMaterial) + ) + ); +} +impl Default for CK_WTLS_KEY_MAT_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_WTLS_KEY_MAT_PARAMS_PTR = *mut CK_WTLS_KEY_MAT_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_CMS_SIG_PARAMS { + pub certificateHandle: CK_OBJECT_HANDLE, + pub pSigningMechanism: CK_MECHANISM_PTR, + pub pDigestMechanism: CK_MECHANISM_PTR, + pub pContentType: CK_UTF8CHAR_PTR, + pub pRequestedAttributes: CK_BYTE_PTR, + pub ulRequestedAttributesLen: CK_ULONG, + 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::(), + 64usize, + concat!("Size of: ", stringify!(CK_CMS_SIG_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + 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 }, + 16usize, + 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 }, + 24usize, + 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 }, + 32usize, + 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 }, + 40usize, + 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 }, + 48usize, + 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 }, + 56usize, + concat!( + "Offset of field: ", + stringify!(CK_CMS_SIG_PARAMS), + "::", + stringify!(ulRequiredAttributesLen) + ) + ); +} +impl Default for CK_CMS_SIG_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_CMS_SIG_PARAMS_PTR = *mut CK_CMS_SIG_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +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::(), + 16usize, + concat!("Size of: ", stringify!(CK_KEY_DERIVATION_STRING_DATA)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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) + ) + ); +} +impl Default for CK_KEY_DERIVATION_STRING_DATA { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_KEY_DERIVATION_STRING_DATA_PTR = *mut CK_KEY_DERIVATION_STRING_DATA; +pub type CK_EXTRACT_PARAMS = CK_ULONG; +pub type CK_EXTRACT_PARAMS_PTR = *mut CK_EXTRACT_PARAMS; +pub type CK_PKCS5_PBKD2_PSEUDO_RANDOM_FUNCTION_TYPE = CK_ULONG; +pub type CK_PKCS5_PBKD2_PSEUDO_RANDOM_FUNCTION_TYPE_PTR = + *mut CK_PKCS5_PBKD2_PSEUDO_RANDOM_FUNCTION_TYPE; +pub type CK_PKCS5_PBKDF2_SALT_SOURCE_TYPE = CK_ULONG; +pub type CK_PKCS5_PBKDF2_SALT_SOURCE_TYPE_PTR = *mut CK_PKCS5_PBKDF2_SALT_SOURCE_TYPE; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_PKCS5_PBKD2_PARAMS { + pub saltSource: CK_PKCS5_PBKDF2_SALT_SOURCE_TYPE, + pub pSaltSourceData: CK_VOID_PTR, + pub ulSaltSourceDataLen: CK_ULONG, + pub iterations: CK_ULONG, + pub prf: CK_PKCS5_PBKD2_PSEUDO_RANDOM_FUNCTION_TYPE, + pub pPrfData: CK_VOID_PTR, + pub ulPrfDataLen: CK_ULONG, + 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::(), + 72usize, + concat!("Size of: ", stringify!(CK_PKCS5_PBKD2_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + 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 }, + 16usize, + 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 }, + 24usize, + 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 }, + 32usize, + 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 }, + 40usize, + 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 }, + 48usize, + 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 }, + 56usize, + 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 }, + 64usize, + concat!( + "Offset of field: ", + stringify!(CK_PKCS5_PBKD2_PARAMS), + "::", + stringify!(ulPasswordLen) + ) + ); +} +impl Default for CK_PKCS5_PBKD2_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_PKCS5_PBKD2_PARAMS_PTR = *mut CK_PKCS5_PBKD2_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_PKCS5_PBKD2_PARAMS2 { + pub saltSource: CK_PKCS5_PBKDF2_SALT_SOURCE_TYPE, + pub pSaltSourceData: CK_VOID_PTR, + pub ulSaltSourceDataLen: CK_ULONG, + pub iterations: CK_ULONG, + pub prf: CK_PKCS5_PBKD2_PSEUDO_RANDOM_FUNCTION_TYPE, + pub pPrfData: CK_VOID_PTR, + pub ulPrfDataLen: CK_ULONG, + 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::(), + 72usize, + concat!("Size of: ", stringify!(CK_PKCS5_PBKD2_PARAMS2)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + 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 }, + 16usize, + 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 }, + 24usize, + 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 }, + 32usize, + 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 }, + 40usize, + 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 }, + 48usize, + 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 }, + 56usize, + 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 }, + 64usize, + concat!( + "Offset of field: ", + stringify!(CK_PKCS5_PBKD2_PARAMS2), + "::", + stringify!(ulPasswordLen) + ) + ); +} +impl Default for CK_PKCS5_PBKD2_PARAMS2 { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_PKCS5_PBKD2_PARAMS2_PTR = *mut CK_PKCS5_PBKD2_PARAMS2; +pub type CK_OTP_PARAM_TYPE = CK_ULONG; +pub type CK_PARAM_TYPE = CK_OTP_PARAM_TYPE; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_OTP_PARAM { + pub type_: CK_OTP_PARAM_TYPE, + 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::(), + 24usize, + concat!("Size of: ", stringify!(CK_OTP_PARAM)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + concat!( + "Offset of field: ", + stringify!(CK_OTP_PARAM), + "::", + stringify!(pValue) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ulValueLen) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(CK_OTP_PARAM), + "::", + stringify!(ulValueLen) + ) + ); +} +impl Default for CK_OTP_PARAM { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_OTP_PARAM_PTR = *mut CK_OTP_PARAM; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +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::(), + 16usize, + concat!("Size of: ", stringify!(CK_OTP_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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) + ) + ); +} +impl Default for CK_OTP_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_OTP_PARAMS_PTR = *mut CK_OTP_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +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::(), + 16usize, + concat!("Size of: ", stringify!(CK_OTP_SIGNATURE_INFO)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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) + ) + ); +} +impl Default for CK_OTP_SIGNATURE_INFO { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_OTP_SIGNATURE_INFO_PTR = *mut CK_OTP_SIGNATURE_INFO; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_KIP_PARAMS { + pub pMechanism: CK_MECHANISM_PTR, + pub hKey: CK_OBJECT_HANDLE, + 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::(), + 32usize, + concat!("Size of: ", stringify!(CK_KIP_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 16usize, + concat!( + "Offset of field: ", + stringify!(CK_KIP_PARAMS), + "::", + stringify!(pSeed) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ulSeedLen) as usize - ptr as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(CK_KIP_PARAMS), + "::", + stringify!(ulSeedLen) + ) + ); +} +impl Default for CK_KIP_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_KIP_PARAMS_PTR = *mut CK_KIP_PARAMS; +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +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::(), + 24usize, + concat!("Size of: ", stringify!(CK_AES_CTR_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + concat!( + "Offset of field: ", + stringify!(CK_AES_CTR_PARAMS), + "::", + stringify!(cb) + ) + ); +} +pub type CK_AES_CTR_PARAMS_PTR = *mut CK_AES_CTR_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_GCM_PARAMS { + pub pIv: CK_BYTE_PTR, + pub ulIvLen: CK_ULONG, + pub ulIvBits: CK_ULONG, + pub pAAD: CK_BYTE_PTR, + 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::(), + 48usize, + concat!("Size of: ", stringify!(CK_GCM_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 16usize, + concat!( + "Offset of field: ", + stringify!(CK_GCM_PARAMS), + "::", + stringify!(ulIvBits) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pAAD) as usize - ptr as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(CK_GCM_PARAMS), + "::", + stringify!(pAAD) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ulAADLen) as usize - ptr as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(CK_GCM_PARAMS), + "::", + stringify!(ulAADLen) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ulTagBits) as usize - ptr as usize }, + 40usize, + concat!( + "Offset of field: ", + stringify!(CK_GCM_PARAMS), + "::", + stringify!(ulTagBits) + ) + ); +} +impl Default for CK_GCM_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_GCM_PARAMS_PTR = *mut CK_GCM_PARAMS; +pub type CK_GENERATOR_FUNCTION = CK_ULONG; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_GCM_MESSAGE_PARAMS { + pub pIv: CK_BYTE_PTR, + pub ulIvLen: CK_ULONG, + pub ulIvFixedBits: CK_ULONG, + pub ivGenerator: CK_GENERATOR_FUNCTION, + 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::(), + 48usize, + concat!("Size of: ", stringify!(CK_GCM_MESSAGE_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 16usize, + 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 }, + 24usize, + 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 }, + 32usize, + 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 }, + 40usize, + concat!( + "Offset of field: ", + stringify!(CK_GCM_MESSAGE_PARAMS), + "::", + stringify!(ulTagBits) + ) + ); +} +impl Default for CK_GCM_MESSAGE_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_GCM_MESSAGE_PARAMS_PTR = CK_GCM_MESSAGE_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_CCM_PARAMS { + pub ulDataLen: CK_ULONG, + pub pNonce: CK_BYTE_PTR, + pub ulNonceLen: CK_ULONG, + pub pAAD: CK_BYTE_PTR, + 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::(), + 48usize, + concat!("Size of: ", stringify!(CK_CCM_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + concat!( + "Offset of field: ", + stringify!(CK_CCM_PARAMS), + "::", + stringify!(pNonce) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ulNonceLen) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(CK_CCM_PARAMS), + "::", + stringify!(ulNonceLen) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pAAD) as usize - ptr as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(CK_CCM_PARAMS), + "::", + stringify!(pAAD) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ulAADLen) as usize - ptr as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(CK_CCM_PARAMS), + "::", + stringify!(ulAADLen) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ulMACLen) as usize - ptr as usize }, + 40usize, + concat!( + "Offset of field: ", + stringify!(CK_CCM_PARAMS), + "::", + stringify!(ulMACLen) + ) + ); +} +impl Default for CK_CCM_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_CCM_PARAMS_PTR = *mut CK_CCM_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_CCM_MESSAGE_PARAMS { + pub ulDataLen: CK_ULONG, + pub pNonce: CK_BYTE_PTR, + pub ulNonceLen: CK_ULONG, + pub ulNonceFixedBits: CK_ULONG, + pub nonceGenerator: CK_GENERATOR_FUNCTION, + 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::(), + 56usize, + concat!("Size of: ", stringify!(CK_CCM_MESSAGE_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + 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 }, + 16usize, + 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 }, + 24usize, + 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 }, + 32usize, + 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 }, + 40usize, + 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 }, + 48usize, + concat!( + "Offset of field: ", + stringify!(CK_CCM_MESSAGE_PARAMS), + "::", + stringify!(ulMACLen) + ) + ); +} +impl Default for CK_CCM_MESSAGE_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_CCM_MESSAGE_PARAMS_PTR = CK_CCM_MESSAGE_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_AES_GCM_PARAMS { + pub pIv: CK_BYTE_PTR, + pub ulIvLen: CK_ULONG, + pub ulIvBits: CK_ULONG, + pub pAAD: CK_BYTE_PTR, + 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::(), + 48usize, + concat!("Size of: ", stringify!(CK_AES_GCM_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 16usize, + 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 }, + 24usize, + 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 }, + 32usize, + 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 }, + 40usize, + concat!( + "Offset of field: ", + stringify!(CK_AES_GCM_PARAMS), + "::", + stringify!(ulTagBits) + ) + ); +} +impl Default for CK_AES_GCM_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_AES_GCM_PARAMS_PTR = *mut CK_AES_GCM_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_AES_CCM_PARAMS { + pub ulDataLen: CK_ULONG, + pub pNonce: CK_BYTE_PTR, + pub ulNonceLen: CK_ULONG, + pub pAAD: CK_BYTE_PTR, + 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::(), + 48usize, + concat!("Size of: ", stringify!(CK_AES_CCM_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + 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 }, + 16usize, + 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 }, + 24usize, + 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 }, + 32usize, + 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 }, + 40usize, + concat!( + "Offset of field: ", + stringify!(CK_AES_CCM_PARAMS), + "::", + stringify!(ulMACLen) + ) + ); +} +impl Default for CK_AES_CCM_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_AES_CCM_PARAMS_PTR = *mut CK_AES_CCM_PARAMS; +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +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::(), + 24usize, + concat!("Size of: ", stringify!(CK_CAMELLIA_CTR_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + concat!( + "Offset of field: ", + stringify!(CK_CAMELLIA_CTR_PARAMS), + "::", + stringify!(cb) + ) + ); +} +pub type CK_CAMELLIA_CTR_PARAMS_PTR = *mut CK_CAMELLIA_CTR_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_CAMELLIA_CBC_ENCRYPT_DATA_PARAMS { + pub iv: [CK_BYTE; 16usize], + 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::(), + 32usize, + concat!("Size of: ", stringify!(CK_CAMELLIA_CBC_ENCRYPT_DATA_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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) + ) + ); +} +impl Default for CK_CAMELLIA_CBC_ENCRYPT_DATA_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_CAMELLIA_CBC_ENCRYPT_DATA_PARAMS_PTR = *mut CK_CAMELLIA_CBC_ENCRYPT_DATA_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_ARIA_CBC_ENCRYPT_DATA_PARAMS { + pub iv: [CK_BYTE; 16usize], + 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::(), + 32usize, + concat!("Size of: ", stringify!(CK_ARIA_CBC_ENCRYPT_DATA_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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) + ) + ); +} +impl Default for CK_ARIA_CBC_ENCRYPT_DATA_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_ARIA_CBC_ENCRYPT_DATA_PARAMS_PTR = *mut CK_ARIA_CBC_ENCRYPT_DATA_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_DSA_PARAMETER_GEN_PARAM { + pub hash: CK_MECHANISM_TYPE, + pub pSeed: CK_BYTE_PTR, + 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::(), + 32usize, + concat!("Size of: ", stringify!(CK_DSA_PARAMETER_GEN_PARAM)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + 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 }, + 16usize, + 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 }, + 24usize, + concat!( + "Offset of field: ", + stringify!(CK_DSA_PARAMETER_GEN_PARAM), + "::", + stringify!(ulIndex) + ) + ); +} +impl Default for CK_DSA_PARAMETER_GEN_PARAM { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_DSA_PARAMETER_GEN_PARAM_PTR = *mut CK_DSA_PARAMETER_GEN_PARAM; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_ECDH_AES_KEY_WRAP_PARAMS { + pub ulAESKeyBits: CK_ULONG, + pub kdf: CK_EC_KDF_TYPE, + 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::(), + 32usize, + concat!("Size of: ", stringify!(CK_ECDH_AES_KEY_WRAP_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + 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 }, + 16usize, + 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 }, + 24usize, + concat!( + "Offset of field: ", + stringify!(CK_ECDH_AES_KEY_WRAP_PARAMS), + "::", + stringify!(pSharedData) + ) + ); +} +impl Default for CK_ECDH_AES_KEY_WRAP_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_ECDH_AES_KEY_WRAP_PARAMS_PTR = *mut CK_ECDH_AES_KEY_WRAP_PARAMS; +pub type CK_JAVA_MIDP_SECURITY_DOMAIN = CK_ULONG; +pub type CK_CERTIFICATE_CATEGORY = CK_ULONG; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +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::(), + 16usize, + concat!("Size of: ", stringify!(CK_RSA_AES_KEY_WRAP_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + concat!( + "Offset of field: ", + stringify!(CK_RSA_AES_KEY_WRAP_PARAMS), + "::", + stringify!(pOAEPParams) + ) + ); +} +impl Default for CK_RSA_AES_KEY_WRAP_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_RSA_AES_KEY_WRAP_PARAMS_PTR = *mut CK_RSA_AES_KEY_WRAP_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_TLS12_MASTER_KEY_DERIVE_PARAMS { + pub RandomInfo: CK_SSL3_RANDOM_DATA, + 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::(), + 48usize, + concat!("Size of: ", stringify!(CK_TLS12_MASTER_KEY_DERIVE_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 32usize, + 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 }, + 40usize, + concat!( + "Offset of field: ", + stringify!(CK_TLS12_MASTER_KEY_DERIVE_PARAMS), + "::", + stringify!(prfHashMechanism) + ) + ); +} +impl Default for CK_TLS12_MASTER_KEY_DERIVE_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_TLS12_MASTER_KEY_DERIVE_PARAMS_PTR = *mut CK_TLS12_MASTER_KEY_DERIVE_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_TLS12_KEY_MAT_PARAMS { + pub ulMacSizeInBits: CK_ULONG, + pub ulKeySizeInBits: CK_ULONG, + pub ulIVSizeInBits: CK_ULONG, + pub bIsExport: CK_BBOOL, + pub RandomInfo: CK_SSL3_RANDOM_DATA, + 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::(), + 80usize, + concat!("Size of: ", stringify!(CK_TLS12_KEY_MAT_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + 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 }, + 16usize, + 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 }, + 24usize, + 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 }, + 32usize, + 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 }, + 64usize, + 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 }, + 72usize, + concat!( + "Offset of field: ", + stringify!(CK_TLS12_KEY_MAT_PARAMS), + "::", + stringify!(prfHashMechanism) + ) + ); +} +impl Default for CK_TLS12_KEY_MAT_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_TLS12_KEY_MAT_PARAMS_PTR = *mut CK_TLS12_KEY_MAT_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_TLS_KDF_PARAMS { + pub prfMechanism: CK_MECHANISM_TYPE, + pub pLabel: CK_BYTE_PTR, + pub ulLabelLength: CK_ULONG, + pub RandomInfo: CK_SSL3_RANDOM_DATA, + 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::(), + 72usize, + concat!("Size of: ", stringify!(CK_TLS_KDF_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + 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 }, + 16usize, + 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 }, + 24usize, + 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 }, + 56usize, + 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 }, + 64usize, + concat!( + "Offset of field: ", + stringify!(CK_TLS_KDF_PARAMS), + "::", + stringify!(ulContextDataLength) + ) + ); +} +impl Default for CK_TLS_KDF_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_TLS_KDF_PARAMS_PTR = *mut CK_TLS_KDF_PARAMS; +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct CK_TLS_MAC_PARAMS { + pub prfHashMechanism: CK_MECHANISM_TYPE, + 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::(), + 24usize, + concat!("Size of: ", stringify!(CK_TLS_MAC_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + 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 }, + 16usize, + concat!( + "Offset of field: ", + stringify!(CK_TLS_MAC_PARAMS), + "::", + stringify!(ulServerOrClient) + ) + ); +} +pub type CK_TLS_MAC_PARAMS_PTR = *mut CK_TLS_MAC_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_GOSTR3410_DERIVE_PARAMS { + pub kdf: CK_EC_KDF_TYPE, + pub pPublicData: CK_BYTE_PTR, + pub ulPublicDataLen: CK_ULONG, + 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::(), + 40usize, + concat!("Size of: ", stringify!(CK_GOSTR3410_DERIVE_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + 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 }, + 16usize, + 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 }, + 24usize, + 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 }, + 32usize, + concat!( + "Offset of field: ", + stringify!(CK_GOSTR3410_DERIVE_PARAMS), + "::", + stringify!(ulUKMLen) + ) + ); +} +impl Default for CK_GOSTR3410_DERIVE_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_GOSTR3410_DERIVE_PARAMS_PTR = *mut CK_GOSTR3410_DERIVE_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_GOSTR3410_KEY_WRAP_PARAMS { + pub pWrapOID: CK_BYTE_PTR, + pub ulWrapOIDLen: CK_ULONG, + pub pUKM: CK_BYTE_PTR, + 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::(), + 40usize, + concat!("Size of: ", stringify!(CK_GOSTR3410_KEY_WRAP_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 16usize, + 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 }, + 24usize, + 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 }, + 32usize, + concat!( + "Offset of field: ", + stringify!(CK_GOSTR3410_KEY_WRAP_PARAMS), + "::", + stringify!(hKey) + ) + ); +} +impl Default for CK_GOSTR3410_KEY_WRAP_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_GOSTR3410_KEY_WRAP_PARAMS_PTR = *mut CK_GOSTR3410_KEY_WRAP_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_SEED_CBC_ENCRYPT_DATA_PARAMS { + pub iv: [CK_BYTE; 16usize], + 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::(), + 32usize, + concat!("Size of: ", stringify!(CK_SEED_CBC_ENCRYPT_DATA_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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) + ) + ); +} +impl Default for CK_SEED_CBC_ENCRYPT_DATA_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_SEED_CBC_ENCRYPT_DATA_PARAMS_PTR = *mut CK_SEED_CBC_ENCRYPT_DATA_PARAMS; +pub type CK_PROFILE_ID = CK_ULONG; +pub type CK_PRF_DATA_TYPE = CK_ULONG; +pub type CK_SP800_108_PRF_TYPE = CK_MECHANISM_TYPE; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_PRF_DATA_PARAM { + pub type_: CK_PRF_DATA_TYPE, + 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::(), + 24usize, + concat!("Size of: ", stringify!(CK_PRF_DATA_PARAM)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + 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 }, + 16usize, + concat!( + "Offset of field: ", + stringify!(CK_PRF_DATA_PARAM), + "::", + stringify!(ulValueLen) + ) + ); +} +impl Default for CK_PRF_DATA_PARAM { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_PRF_DATA_PARAM_PTR = *mut CK_PRF_DATA_PARAM; +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +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::(), + 16usize, + concat!("Size of: ", stringify!(CK_SP800_108_COUNTER_FORMAT)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + concat!( + "Offset of field: ", + stringify!(CK_SP800_108_COUNTER_FORMAT), + "::", + stringify!(ulWidthInBits) + ) + ); +} +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)] +#[derive(Debug, Default, Copy, Clone)] +pub struct CK_SP800_108_DKM_LENGTH_FORMAT { + pub dkmLengthMethod: CK_SP800_108_DKM_LENGTH_METHOD, + 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::(), + 24usize, + concat!("Size of: ", stringify!(CK_SP800_108_DKM_LENGTH_FORMAT)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + 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 }, + 16usize, + concat!( + "Offset of field: ", + stringify!(CK_SP800_108_DKM_LENGTH_FORMAT), + "::", + stringify!(ulWidthInBits) + ) + ); +} +pub type CK_SP800_108_DKM_LENGTH_FORMAT_PTR = *mut CK_SP800_108_DKM_LENGTH_FORMAT; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_DERIVED_KEY { + pub pTemplate: CK_ATTRIBUTE_PTR, + 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::(), + 24usize, + concat!("Size of: ", stringify!(CK_DERIVED_KEY)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 16usize, + concat!( + "Offset of field: ", + stringify!(CK_DERIVED_KEY), + "::", + stringify!(phKey) + ) + ); +} +impl Default for CK_DERIVED_KEY { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_DERIVED_KEY_PTR = *mut CK_DERIVED_KEY; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_SP800_108_KDF_PARAMS { + pub prfType: CK_SP800_108_PRF_TYPE, + pub ulNumberOfDataParams: CK_ULONG, + pub pDataParams: CK_PRF_DATA_PARAM_PTR, + pub ulAdditionalDerivedKeys: CK_ULONG, + pub pAdditionalDerivedKeys: CK_DERIVED_KEY, +} +#[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::(), + 56usize, + concat!("Size of: ", stringify!(CK_SP800_108_KDF_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + 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 }, + 16usize, + 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 }, + 24usize, + 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 }, + 32usize, + concat!( + "Offset of field: ", + stringify!(CK_SP800_108_KDF_PARAMS), + "::", + stringify!(pAdditionalDerivedKeys) + ) + ); +} +impl Default for CK_SP800_108_KDF_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_SP800_108_KDF_PARAMS_PTR = *mut CK_SP800_108_KDF_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_SP800_108_FEEDBACK_KDF_PARAMS { + pub prfType: CK_SP800_108_PRF_TYPE, + pub ulNumberOfDataParams: CK_ULONG, + pub pDataParams: CK_PRF_DATA_PARAM_PTR, + pub ulIVLen: CK_ULONG, + pub pIV: CK_BYTE_PTR, + pub ulAdditionalDerivedKeys: CK_ULONG, + pub pAdditionalDerivedKeys: CK_DERIVED_KEY, +} +#[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::(), + 72usize, + concat!("Size of: ", stringify!(CK_SP800_108_FEEDBACK_KDF_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + 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 }, + 16usize, + 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 }, + 24usize, + 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 }, + 32usize, + 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 }, + 40usize, + 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 }, + 48usize, + concat!( + "Offset of field: ", + stringify!(CK_SP800_108_FEEDBACK_KDF_PARAMS), + "::", + stringify!(pAdditionalDerivedKeys) + ) + ); +} +impl Default for CK_SP800_108_FEEDBACK_KDF_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_SP800_108_FEEDBACK_KDF_PARAMS_PTR = *mut CK_SP800_108_FEEDBACK_KDF_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_EDDSA_PARAMS { + pub phFlag: CK_BBOOL, + 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::(), + 24usize, + concat!("Size of: ", stringify!(CK_EDDSA_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + concat!( + "Offset of field: ", + stringify!(CK_EDDSA_PARAMS), + "::", + stringify!(ulContextDataLen) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pContextData) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(CK_EDDSA_PARAMS), + "::", + stringify!(pContextData) + ) + ); +} +impl Default for CK_EDDSA_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_EDDSA_PARAMS_PTR = *mut CK_EDDSA_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_CHACHA20_PARAMS { + pub pBlockCounter: CK_BYTE_PTR, + pub blockCounterBits: CK_ULONG, + 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::(), + 32usize, + concat!("Size of: ", stringify!(CK_CHACHA20_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 16usize, + concat!( + "Offset of field: ", + stringify!(CK_CHACHA20_PARAMS), + "::", + stringify!(pNonce) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ulNonceBits) as usize - ptr as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(CK_CHACHA20_PARAMS), + "::", + stringify!(ulNonceBits) + ) + ); +} +impl Default for CK_CHACHA20_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_SALSA20_PARAMS { + pub pBlockCounter: CK_BYTE_PTR, + 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::(), + 24usize, + concat!("Size of: ", stringify!(CK_SALSA20_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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) + ) + ); +} +impl Default for CK_SALSA20_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_SALSA20_CHACHA20_POLY1305_PARAMS { + pub pNonce: CK_BYTE_PTR, + pub ulNonceLen: CK_ULONG, + 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::(), + 32usize, + concat!("Size of: ", stringify!(CK_SALSA20_CHACHA20_POLY1305_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 16usize, + 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 }, + 24usize, + concat!( + "Offset of field: ", + stringify!(CK_SALSA20_CHACHA20_POLY1305_PARAMS), + "::", + stringify!(ulAADLen) + ) + ); +} +impl Default for CK_SALSA20_CHACHA20_POLY1305_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_SALSA20_CHACHA20_POLY1305_PARAMS_PTR = *mut CK_SALSA20_CHACHA20_POLY1305_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_SALSA20_CHACHA20_POLY1305_MSG_PARAMS { + pub pNonce: CK_BYTE_PTR, + 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::(), + 24usize, + concat!( + "Size of: ", + stringify!(CK_SALSA20_CHACHA20_POLY1305_MSG_PARAMS) + ) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 16usize, + concat!( + "Offset of field: ", + stringify!(CK_SALSA20_CHACHA20_POLY1305_MSG_PARAMS), + "::", + stringify!(pTag) + ) + ); +} +impl Default for CK_SALSA20_CHACHA20_POLY1305_MSG_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_SALSA20_CHACHA20_POLY1305_MSG_PARAMS_PTR = *mut CK_SALSA20_CHACHA20_POLY1305_MSG_PARAMS; +pub type CK_X3DH_KDF_TYPE = CK_ULONG; +pub type CK_X3DH_KDF_TYPE_PTR = *mut CK_X3DH_KDF_TYPE; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_X3DH_INITIATE_PARAMS { + pub kdf: CK_X3DH_KDF_TYPE, + pub pPeer_identity: CK_OBJECT_HANDLE, + pub pPeer_prekey: CK_OBJECT_HANDLE, + pub pPrekey_signature: CK_BYTE_PTR, + pub pOnetime_key: CK_BYTE_PTR, + 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::(), + 56usize, + concat!("Size of: ", stringify!(CK_X3DH_INITIATE_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + 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 }, + 16usize, + 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 }, + 24usize, + 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 }, + 32usize, + 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 }, + 40usize, + 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 }, + 48usize, + concat!( + "Offset of field: ", + stringify!(CK_X3DH_INITIATE_PARAMS), + "::", + stringify!(pOwn_ephemeral) + ) + ); +} +impl Default for CK_X3DH_INITIATE_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_X3DH_RESPOND_PARAMS { + pub kdf: CK_X3DH_KDF_TYPE, + pub pIdentity_id: CK_BYTE_PTR, + pub pPrekey_id: CK_BYTE_PTR, + pub pOnetime_id: CK_BYTE_PTR, + 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::(), + 48usize, + concat!("Size of: ", stringify!(CK_X3DH_RESPOND_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + 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 }, + 16usize, + 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 }, + 24usize, + 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 }, + 32usize, + 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 }, + 40usize, + concat!( + "Offset of field: ", + stringify!(CK_X3DH_RESPOND_PARAMS), + "::", + stringify!(pInitiator_ephemeral) + ) + ); +} +impl Default for CK_X3DH_RESPOND_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_X2RATCHET_KDF_TYPE = CK_ULONG; +pub type CK_X2RATCHET_KDF_TYPE_PTR = *mut CK_X2RATCHET_KDF_TYPE; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_X2RATCHET_INITIALIZE_PARAMS { + pub sk: CK_BYTE_PTR, + pub peer_public_prekey: CK_OBJECT_HANDLE, + pub peer_public_identity: CK_OBJECT_HANDLE, + pub own_public_identity: CK_OBJECT_HANDLE, + pub bEncryptedHeader: CK_BBOOL, + pub eCurve: CK_ULONG, + 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::(), + 64usize, + concat!("Size of: ", stringify!(CK_X2RATCHET_INITIALIZE_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 16usize, + 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 }, + 24usize, + 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 }, + 32usize, + 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 }, + 40usize, + 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 }, + 48usize, + 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 }, + 56usize, + concat!( + "Offset of field: ", + stringify!(CK_X2RATCHET_INITIALIZE_PARAMS), + "::", + stringify!(kdfMechanism) + ) + ); +} +impl Default for CK_X2RATCHET_INITIALIZE_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_X2RATCHET_INITIALIZE_PARAMS_PTR = *mut CK_X2RATCHET_INITIALIZE_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_X2RATCHET_RESPOND_PARAMS { + pub sk: CK_BYTE_PTR, + pub own_prekey: CK_OBJECT_HANDLE, + pub initiator_identity: CK_OBJECT_HANDLE, + pub own_public_identity: CK_OBJECT_HANDLE, + pub bEncryptedHeader: CK_BBOOL, + pub eCurve: CK_ULONG, + 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::(), + 64usize, + concat!("Size of: ", stringify!(CK_X2RATCHET_RESPOND_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 16usize, + 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 }, + 24usize, + 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 }, + 32usize, + 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 }, + 40usize, + 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 }, + 48usize, + 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 }, + 56usize, + concat!( + "Offset of field: ", + stringify!(CK_X2RATCHET_RESPOND_PARAMS), + "::", + stringify!(kdfMechanism) + ) + ); +} +impl Default for CK_X2RATCHET_RESPOND_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_X2RATCHET_RESPOND_PARAMS_PTR = *mut CK_X2RATCHET_RESPOND_PARAMS; +pub type CK_XEDDSA_HASH_TYPE = CK_ULONG; +pub type CK_XEDDSA_HASH_TYPE_PTR = *mut CK_XEDDSA_HASH_TYPE; +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +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::(), + 8usize, + concat!("Size of: ", stringify!(CK_XEDDSA_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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) + ) + ); +} +pub type CK_XEDDSA_PARAMS_PTR = *mut CK_XEDDSA_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_HKDF_PARAMS { + pub bExtract: CK_BBOOL, + pub bExpand: CK_BBOOL, + pub prfHashMechanism: CK_MECHANISM_TYPE, + pub ulSaltType: CK_ULONG, + pub pSalt: CK_BYTE_PTR, + pub ulSaltLen: CK_ULONG, + pub hSaltKey: CK_ULONG, + 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::(), + 64usize, + concat!("Size of: ", stringify!(CK_HKDF_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + concat!( + "Offset of field: ", + stringify!(CK_HKDF_PARAMS), + "::", + stringify!(prfHashMechanism) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ulSaltType) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(CK_HKDF_PARAMS), + "::", + stringify!(ulSaltType) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pSalt) as usize - ptr as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(CK_HKDF_PARAMS), + "::", + stringify!(pSalt) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ulSaltLen) as usize - ptr as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(CK_HKDF_PARAMS), + "::", + stringify!(ulSaltLen) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).hSaltKey) as usize - ptr as usize }, + 40usize, + concat!( + "Offset of field: ", + stringify!(CK_HKDF_PARAMS), + "::", + stringify!(hSaltKey) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pInfo) as usize - ptr as usize }, + 48usize, + concat!( + "Offset of field: ", + stringify!(CK_HKDF_PARAMS), + "::", + stringify!(pInfo) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ulInfoLen) as usize - ptr as usize }, + 56usize, + concat!( + "Offset of field: ", + stringify!(CK_HKDF_PARAMS), + "::", + stringify!(ulInfoLen) + ) + ); +} +impl Default for CK_HKDF_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_C_Initialize = + ::std::option::Option CK_RV>; +pub type CK_C_Finalize = + ::std::option::Option CK_RV>; +pub type CK_C_GetInfo = ::std::option::Option CK_RV>; +pub type CK_C_GetFunctionList = + ::std::option::Option CK_RV>; +pub type CK_C_GetSlotList = ::std::option::Option< unsafe extern "C" fn( - flags: CK_FLAGS, - slot: *mut CK_SLOT_ID, - pReserved: *mut ::std::os::raw::c_void, + tokenPresent: CK_BBOOL, + pSlotList: CK_SLOT_ID_PTR, + pulCount: CK_ULONG_PTR, ) -> CK_RV, >; +pub type CK_C_GetSlotInfo = ::std::option::Option< + unsafe extern "C" fn(slotID: CK_SLOT_ID, pInfo: CK_SLOT_INFO_PTR) -> CK_RV, +>; +pub type CK_C_GetTokenInfo = ::std::option::Option< + unsafe extern "C" fn(slotID: CK_SLOT_ID, pInfo: CK_TOKEN_INFO_PTR) -> CK_RV, +>; pub type CK_C_GetMechanismList = ::std::option::Option< unsafe extern "C" fn( slotID: CK_SLOT_ID, - mechanism_list: *mut CK_MECHANISM_TYPE, - ulCount: *mut ::std::os::raw::c_ulong, + pMechanismList: CK_MECHANISM_TYPE_PTR, + pulCount: CK_ULONG_PTR, ) -> CK_RV, >; pub type CK_C_GetMechanismInfo = ::std::option::Option< unsafe extern "C" fn( slotID: CK_SLOT_ID, type_: CK_MECHANISM_TYPE, - info: *mut _CK_MECHANISM_INFO, + pInfo: CK_MECHANISM_INFO_PTR, ) -> CK_RV, >; pub type CK_C_InitToken = ::std::option::Option< unsafe extern "C" fn( slotID: CK_SLOT_ID, - pin: *mut ::std::os::raw::c_uchar, - pin_len: ::std::os::raw::c_ulong, - label: *mut ::std::os::raw::c_uchar, + pPin: CK_UTF8CHAR_PTR, + ulPinLen: CK_ULONG, + pLabel: CK_UTF8CHAR_PTR, ) -> CK_RV, >; pub type CK_C_InitPIN = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - pin: *mut ::std::os::raw::c_uchar, - pin_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pPin: CK_UTF8CHAR_PTR, + ulPinLen: CK_ULONG, ) -> CK_RV, >; pub type CK_C_SetPIN = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - old_pin: *mut ::std::os::raw::c_uchar, - old_len: ::std::os::raw::c_ulong, - new_pin: *mut ::std::os::raw::c_uchar, - new_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pOldPin: CK_UTF8CHAR_PTR, + ulOldLen: CK_ULONG, + pNewPin: CK_UTF8CHAR_PTR, + ulNewLen: CK_ULONG, ) -> CK_RV, >; pub type CK_C_OpenSession = ::std::option::Option< unsafe extern "C" fn( slotID: CK_SLOT_ID, flags: CK_FLAGS, - application: *mut ::std::os::raw::c_void, - notify: CK_NOTIFY, - session: *mut CK_SESSION_HANDLE, + pApplication: CK_VOID_PTR, + Notify: CK_NOTIFY, + phSession: CK_SESSION_HANDLE_PTR, ) -> CK_RV, >; pub type CK_C_CloseSession = - ::std::option::Option CK_RV>; + ::std::option::Option CK_RV>; pub type CK_C_CloseAllSessions = ::std::option::Option CK_RV>; pub type CK_C_GetSessionInfo = ::std::option::Option< - unsafe extern "C" fn(session: CK_SESSION_HANDLE, info: *mut _CK_SESSION_INFO) -> CK_RV, + unsafe extern "C" fn(hSession: CK_SESSION_HANDLE, pInfo: CK_SESSION_INFO_PTR) -> CK_RV, >; pub type CK_C_GetOperationState = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - operation_state: *mut ::std::os::raw::c_uchar, - operation_state_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pOperationState: CK_BYTE_PTR, + pulOperationStateLen: CK_ULONG_PTR, ) -> CK_RV, >; pub type CK_C_SetOperationState = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - operation_state: *mut ::std::os::raw::c_uchar, - operation_state_len: ::std::os::raw::c_ulong, - encryption_key: CK_OBJECT_HANDLE, - authentiation_key: CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pOperationState: CK_BYTE_PTR, + ulOperationStateLen: CK_ULONG, + hEncryptionKey: CK_OBJECT_HANDLE, + hAuthenticationKey: CK_OBJECT_HANDLE, ) -> CK_RV, >; pub type CK_C_Login = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - user_type: CK_USER_TYPE, - pin: *mut ::std::os::raw::c_uchar, - pin_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + userType: CK_USER_TYPE, + pPin: CK_UTF8CHAR_PTR, + ulPinLen: CK_ULONG, ) -> CK_RV, >; pub type CK_C_Logout = - ::std::option::Option CK_RV>; + ::std::option::Option CK_RV>; pub type CK_C_CreateObject = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - templ: *mut _CK_ATTRIBUTE, - ulCount: ::std::os::raw::c_ulong, - object: *mut CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pTemplate: CK_ATTRIBUTE_PTR, + ulCount: CK_ULONG, + phObject: CK_OBJECT_HANDLE_PTR, ) -> CK_RV, >; pub type CK_C_CopyObject = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - object: CK_OBJECT_HANDLE, - templ: *mut _CK_ATTRIBUTE, - ulCount: ::std::os::raw::c_ulong, - new_object: *mut CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + hObject: CK_OBJECT_HANDLE, + pTemplate: CK_ATTRIBUTE_PTR, + ulCount: CK_ULONG, + phNewObject: CK_OBJECT_HANDLE_PTR, ) -> CK_RV, >; pub type CK_C_DestroyObject = ::std::option::Option< - unsafe extern "C" fn(session: CK_SESSION_HANDLE, object: CK_OBJECT_HANDLE) -> CK_RV, + unsafe extern "C" fn(hSession: CK_SESSION_HANDLE, hObject: CK_OBJECT_HANDLE) -> CK_RV, >; pub type CK_C_GetObjectSize = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - object: CK_OBJECT_HANDLE, - size: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + hObject: CK_OBJECT_HANDLE, + pulSize: CK_ULONG_PTR, ) -> CK_RV, >; pub type CK_C_GetAttributeValue = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - object: CK_OBJECT_HANDLE, - templ: *mut _CK_ATTRIBUTE, - ulCount: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + hObject: CK_OBJECT_HANDLE, + pTemplate: CK_ATTRIBUTE_PTR, + ulCount: CK_ULONG, ) -> CK_RV, >; pub type CK_C_SetAttributeValue = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - object: CK_OBJECT_HANDLE, - templ: *mut _CK_ATTRIBUTE, - ulCount: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + hObject: CK_OBJECT_HANDLE, + pTemplate: CK_ATTRIBUTE_PTR, + ulCount: CK_ULONG, ) -> CK_RV, >; pub type CK_C_FindObjectsInit = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - templ: *mut _CK_ATTRIBUTE, - ulCount: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pTemplate: CK_ATTRIBUTE_PTR, + ulCount: CK_ULONG, ) -> CK_RV, >; pub type CK_C_FindObjects = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - object: *mut CK_OBJECT_HANDLE, - max_object_count: ::std::os::raw::c_ulong, - object_count: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + phObject: CK_OBJECT_HANDLE_PTR, + ulMaxObjectCount: CK_ULONG, + pulObjectCount: CK_ULONG_PTR, ) -> CK_RV, >; pub type CK_C_FindObjectsFinal = - ::std::option::Option CK_RV>; + ::std::option::Option CK_RV>; pub type CK_C_EncryptInit = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - key: CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, ) -> CK_RV, >; pub type CK_C_Encrypt = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - data: *mut ::std::os::raw::c_uchar, - data_len: ::std::os::raw::c_ulong, - encrypted_data: *mut ::std::os::raw::c_uchar, - encrypted_data_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pEncryptedData: CK_BYTE_PTR, + pulEncryptedDataLen: CK_ULONG_PTR, ) -> CK_RV, >; pub type CK_C_EncryptUpdate = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - part: *mut ::std::os::raw::c_uchar, - part_len: ::std::os::raw::c_ulong, - encrypted_part: *mut ::std::os::raw::c_uchar, - encrypted_part_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pPart: CK_BYTE_PTR, + ulPartLen: CK_ULONG, + pEncryptedPart: CK_BYTE_PTR, + pulEncryptedPartLen: CK_ULONG_PTR, ) -> CK_RV, >; pub type CK_C_EncryptFinal = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - last_encrypted_part: *mut ::std::os::raw::c_uchar, - last_encrypted_part_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pLastEncryptedPart: CK_BYTE_PTR, + pulLastEncryptedPartLen: CK_ULONG_PTR, ) -> CK_RV, >; pub type CK_C_DecryptInit = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - key: CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, ) -> CK_RV, >; pub type CK_C_Decrypt = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - encrypted_data: *mut ::std::os::raw::c_uchar, - encrypted_data_len: ::std::os::raw::c_ulong, - data: *mut ::std::os::raw::c_uchar, - data_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pEncryptedData: CK_BYTE_PTR, + ulEncryptedDataLen: CK_ULONG, + pData: CK_BYTE_PTR, + pulDataLen: CK_ULONG_PTR, ) -> CK_RV, >; pub type CK_C_DecryptUpdate = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - encrypted_part: *mut ::std::os::raw::c_uchar, - encrypted_part_len: ::std::os::raw::c_ulong, - part: *mut ::std::os::raw::c_uchar, - part_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pEncryptedPart: CK_BYTE_PTR, + ulEncryptedPartLen: CK_ULONG, + pPart: CK_BYTE_PTR, + pulPartLen: CK_ULONG_PTR, ) -> CK_RV, >; pub type CK_C_DecryptFinal = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - last_part: *mut ::std::os::raw::c_uchar, - last_part_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pLastPart: CK_BYTE_PTR, + pulLastPartLen: CK_ULONG_PTR, ) -> CK_RV, >; pub type CK_C_DigestInit = ::std::option::Option< - unsafe extern "C" fn(session: CK_SESSION_HANDLE, mechanism: *mut _CK_MECHANISM) -> CK_RV, + unsafe extern "C" fn(hSession: CK_SESSION_HANDLE, pMechanism: CK_MECHANISM_PTR) -> CK_RV, >; pub type CK_C_Digest = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - data: *mut ::std::os::raw::c_uchar, - data_len: ::std::os::raw::c_ulong, - digest: *mut ::std::os::raw::c_uchar, - digest_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pDigest: CK_BYTE_PTR, + pulDigestLen: CK_ULONG_PTR, ) -> CK_RV, >; pub type CK_C_DigestUpdate = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - part: *mut ::std::os::raw::c_uchar, - part_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pPart: CK_BYTE_PTR, + ulPartLen: CK_ULONG, ) -> CK_RV, >; pub type CK_C_DigestKey = ::std::option::Option< - unsafe extern "C" fn(session: CK_SESSION_HANDLE, key: CK_OBJECT_HANDLE) -> CK_RV, + unsafe extern "C" fn(hSession: CK_SESSION_HANDLE, hKey: CK_OBJECT_HANDLE) -> CK_RV, >; pub type CK_C_DigestFinal = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - digest: *mut ::std::os::raw::c_uchar, - digest_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pDigest: CK_BYTE_PTR, + pulDigestLen: CK_ULONG_PTR, ) -> CK_RV, >; pub type CK_C_SignInit = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - key: CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, ) -> CK_RV, >; pub type CK_C_Sign = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - data: *mut ::std::os::raw::c_uchar, - data_len: ::std::os::raw::c_ulong, - signature: *mut ::std::os::raw::c_uchar, - signature_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + pulSignatureLen: CK_ULONG_PTR, ) -> CK_RV, >; pub type CK_C_SignUpdate = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - part: *mut ::std::os::raw::c_uchar, - part_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pPart: CK_BYTE_PTR, + ulPartLen: CK_ULONG, ) -> CK_RV, >; pub type CK_C_SignFinal = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - signature: *mut ::std::os::raw::c_uchar, - signature_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pSignature: CK_BYTE_PTR, + pulSignatureLen: CK_ULONG_PTR, ) -> CK_RV, >; pub type CK_C_SignRecoverInit = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - key: CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, ) -> CK_RV, >; pub type CK_C_SignRecover = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - data: *mut ::std::os::raw::c_uchar, - data_len: ::std::os::raw::c_ulong, - signature: *mut ::std::os::raw::c_uchar, - signature_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + pulSignatureLen: CK_ULONG_PTR, ) -> CK_RV, >; pub type CK_C_VerifyInit = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - key: CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, ) -> CK_RV, >; pub type CK_C_Verify = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - data: *mut ::std::os::raw::c_uchar, - data_len: ::std::os::raw::c_ulong, - signature: *mut ::std::os::raw::c_uchar, - signature_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + ulSignatureLen: CK_ULONG, ) -> CK_RV, >; pub type CK_C_VerifyUpdate = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - part: *mut ::std::os::raw::c_uchar, - part_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pPart: CK_BYTE_PTR, + ulPartLen: CK_ULONG, ) -> CK_RV, >; pub type CK_C_VerifyFinal = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - signature: *mut ::std::os::raw::c_uchar, - signature_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pSignature: CK_BYTE_PTR, + ulSignatureLen: CK_ULONG, ) -> CK_RV, >; pub type CK_C_VerifyRecoverInit = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - key: CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, ) -> CK_RV, >; pub type CK_C_VerifyRecover = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - signature: *mut ::std::os::raw::c_uchar, - signature_len: ::std::os::raw::c_ulong, - data: *mut ::std::os::raw::c_uchar, - data_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pSignature: CK_BYTE_PTR, + ulSignatureLen: CK_ULONG, + pData: CK_BYTE_PTR, + pulDataLen: CK_ULONG_PTR, ) -> CK_RV, >; pub type CK_C_DigestEncryptUpdate = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - part: *mut ::std::os::raw::c_uchar, - part_len: ::std::os::raw::c_ulong, - encrypted_part: *mut ::std::os::raw::c_uchar, - encrypted_part_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pPart: CK_BYTE_PTR, + ulPartLen: CK_ULONG, + pEncryptedPart: CK_BYTE_PTR, + pulEncryptedPartLen: CK_ULONG_PTR, ) -> CK_RV, >; pub type CK_C_DecryptDigestUpdate = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - encrypted_part: *mut ::std::os::raw::c_uchar, - encrypted_part_len: ::std::os::raw::c_ulong, - part: *mut ::std::os::raw::c_uchar, - part_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pEncryptedPart: CK_BYTE_PTR, + ulEncryptedPartLen: CK_ULONG, + pPart: CK_BYTE_PTR, + pulPartLen: CK_ULONG_PTR, ) -> CK_RV, >; pub type CK_C_SignEncryptUpdate = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - part: *mut ::std::os::raw::c_uchar, - part_len: ::std::os::raw::c_ulong, - encrypted_part: *mut ::std::os::raw::c_uchar, - encrypted_part_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pPart: CK_BYTE_PTR, + ulPartLen: CK_ULONG, + pEncryptedPart: CK_BYTE_PTR, + pulEncryptedPartLen: CK_ULONG_PTR, ) -> CK_RV, >; pub type CK_C_DecryptVerifyUpdate = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - encrypted_part: *mut ::std::os::raw::c_uchar, - encrypted_part_len: ::std::os::raw::c_ulong, - part: *mut ::std::os::raw::c_uchar, - part_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pEncryptedPart: CK_BYTE_PTR, + ulEncryptedPartLen: CK_ULONG, + pPart: CK_BYTE_PTR, + pulPartLen: CK_ULONG_PTR, ) -> CK_RV, >; pub type CK_C_GenerateKey = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - templ: *mut _CK_ATTRIBUTE, - ulCount: ::std::os::raw::c_ulong, - key: *mut CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + pTemplate: CK_ATTRIBUTE_PTR, + ulCount: CK_ULONG, + phKey: CK_OBJECT_HANDLE_PTR, ) -> CK_RV, >; pub type CK_C_GenerateKeyPair = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - public_key_template: *mut _CK_ATTRIBUTE, - public_key_attribute_count: ::std::os::raw::c_ulong, - private_key_template: *mut _CK_ATTRIBUTE, - private_key_attribute_count: ::std::os::raw::c_ulong, - public_key: *mut CK_OBJECT_HANDLE, - private_key: *mut CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + pPublicKeyTemplate: CK_ATTRIBUTE_PTR, + ulPublicKeyAttributeCount: CK_ULONG, + pPrivateKeyTemplate: CK_ATTRIBUTE_PTR, + ulPrivateKeyAttributeCount: CK_ULONG, + phPublicKey: CK_OBJECT_HANDLE_PTR, + phPrivateKey: CK_OBJECT_HANDLE_PTR, ) -> CK_RV, >; pub type CK_C_WrapKey = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - wrapping_key: CK_OBJECT_HANDLE, - key: CK_OBJECT_HANDLE, - wrapped_key: *mut ::std::os::raw::c_uchar, - wrapped_key_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hWrappingKey: CK_OBJECT_HANDLE, + hKey: CK_OBJECT_HANDLE, + pWrappedKey: CK_BYTE_PTR, + pulWrappedKeyLen: CK_ULONG_PTR, ) -> CK_RV, >; pub type CK_C_UnwrapKey = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - unwrapping_key: CK_OBJECT_HANDLE, - wrapped_key: *mut ::std::os::raw::c_uchar, - wrapped_key_len: ::std::os::raw::c_ulong, - templ: *mut _CK_ATTRIBUTE, - attribute_count: ::std::os::raw::c_ulong, - key: *mut CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hUnwrappingKey: CK_OBJECT_HANDLE, + pWrappedKey: CK_BYTE_PTR, + ulWrappedKeyLen: CK_ULONG, + pTemplate: CK_ATTRIBUTE_PTR, + ulAttributeCount: CK_ULONG, + phKey: CK_OBJECT_HANDLE_PTR, ) -> CK_RV, >; pub type CK_C_DeriveKey = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - base_key: CK_OBJECT_HANDLE, - templ: *mut _CK_ATTRIBUTE, - attribute_count: ::std::os::raw::c_ulong, - key: *mut CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hBaseKey: CK_OBJECT_HANDLE, + pTemplate: CK_ATTRIBUTE_PTR, + ulAttributeCount: CK_ULONG, + phKey: CK_OBJECT_HANDLE_PTR, ) -> CK_RV, >; pub type CK_C_SeedRandom = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - seed: *mut ::std::os::raw::c_uchar, - seed_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pSeed: CK_BYTE_PTR, + ulSeedLen: CK_ULONG, ) -> CK_RV, >; pub type CK_C_GenerateRandom = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - random_data: *mut ::std::os::raw::c_uchar, - random_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + RandomData: CK_BYTE_PTR, + ulRandomLen: CK_ULONG, ) -> CK_RV, >; pub type CK_C_GetFunctionStatus = - ::std::option::Option CK_RV>; + ::std::option::Option CK_RV>; pub type CK_C_CancelFunction = - ::std::option::Option CK_RV>; + ::std::option::Option CK_RV>; +pub type CK_C_WaitForSlotEvent = ::std::option::Option< + unsafe extern "C" fn(flags: CK_FLAGS, pSlot: CK_SLOT_ID_PTR, pRserved: CK_VOID_PTR) -> CK_RV, +>; +pub type CK_C_GetInterfaceList = ::std::option::Option< + unsafe extern "C" fn(pInterfacesList: CK_INTERFACE_PTR, pulCount: CK_ULONG_PTR) -> CK_RV, +>; +pub type CK_C_GetInterface = ::std::option::Option< + unsafe extern "C" fn( + pInterfaceName: CK_UTF8CHAR_PTR, + pVersion: CK_VERSION_PTR, + ppInterface: CK_INTERFACE_PTR_PTR, + flags: CK_FLAGS, + ) -> CK_RV, +>; +pub type CK_C_LoginUser = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + userType: CK_USER_TYPE, + pPin: CK_UTF8CHAR_PTR, + ulPinLen: CK_ULONG, + pUsername: CK_UTF8CHAR_PTR, + ulUsernameLen: CK_ULONG, + ) -> CK_RV, +>; +pub type CK_C_SessionCancel = ::std::option::Option< + unsafe extern "C" fn(hSession: CK_SESSION_HANDLE, flags: CK_FLAGS) -> CK_RV, +>; +pub type CK_C_MessageEncryptInit = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, + ) -> CK_RV, +>; +pub type CK_C_EncryptMessage = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pAssociatedData: CK_BYTE_PTR, + ulAssociatedDataLen: CK_ULONG, + pPlaintext: CK_BYTE_PTR, + ulPlaintextLen: CK_ULONG, + pCiphertext: CK_BYTE_PTR, + pulCiphertextLen: CK_ULONG_PTR, + ) -> CK_RV, +>; +pub type CK_C_EncryptMessageBegin = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pAssociatedData: CK_BYTE_PTR, + ulAssociatedDataLen: CK_ULONG, + ) -> CK_RV, +>; +pub type CK_C_EncryptMessageNext = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pPlaintextPart: CK_BYTE_PTR, + ulPlaintextPartLen: CK_ULONG, + pCiphertextPart: CK_BYTE_PTR, + pulCiphertextPartLen: CK_ULONG_PTR, + flags: CK_FLAGS, + ) -> CK_RV, +>; +pub type CK_C_MessageEncryptFinal = + ::std::option::Option CK_RV>; +pub type CK_C_MessageDecryptInit = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, + ) -> CK_RV, +>; +pub type CK_C_DecryptMessage = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pAssociatedData: CK_BYTE_PTR, + ulAssociatedDataLen: CK_ULONG, + pCiphertext: CK_BYTE_PTR, + ulCiphertextLen: CK_ULONG, + pPlaintext: CK_BYTE_PTR, + pulPlaintextLen: CK_ULONG_PTR, + ) -> CK_RV, +>; +pub type CK_C_DecryptMessageBegin = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pAssociatedData: CK_BYTE_PTR, + ulAssociatedDataLen: CK_ULONG, + ) -> CK_RV, +>; +pub type CK_C_DecryptMessageNext = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pCiphertext: CK_BYTE_PTR, + ulCiphertextLen: CK_ULONG, + pPlaintext: CK_BYTE_PTR, + pulPlaintextLen: CK_ULONG_PTR, + flags: CK_FLAGS, + ) -> CK_RV, +>; +pub type CK_C_MessageDecryptFinal = + ::std::option::Option CK_RV>; +pub type CK_C_MessageSignInit = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, + ) -> CK_RV, +>; +pub type CK_C_SignMessage = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + pulSignatureLen: CK_ULONG_PTR, + ) -> CK_RV, +>; +pub type CK_C_SignMessageBegin = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + ) -> CK_RV, +>; +pub type CK_C_SignMessageNext = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + pulSignatureLen: CK_ULONG_PTR, + ) -> CK_RV, +>; +pub type CK_C_MessageSignFinal = + ::std::option::Option CK_RV>; +pub type CK_C_MessageVerifyInit = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, + ) -> CK_RV, +>; +pub type CK_C_VerifyMessage = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + ulSignatureLen: CK_ULONG, + ) -> CK_RV, +>; +pub type CK_C_VerifyMessageBegin = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + ) -> CK_RV, +>; +pub type CK_C_VerifyMessageNext = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + ulSignatureLen: CK_ULONG, + ) -> CK_RV, +>; +pub type CK_C_MessageVerifyFinal = + ::std::option::Option CK_RV>; +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct CK_FUNCTION_LIST_3_0 { + pub version: CK_VERSION, + pub C_Initialize: CK_C_Initialize, + pub C_Finalize: CK_C_Finalize, + pub C_GetInfo: CK_C_GetInfo, + pub C_GetFunctionList: CK_C_GetFunctionList, + pub C_GetSlotList: CK_C_GetSlotList, + pub C_GetSlotInfo: CK_C_GetSlotInfo, + pub C_GetTokenInfo: CK_C_GetTokenInfo, + pub C_GetMechanismList: CK_C_GetMechanismList, + pub C_GetMechanismInfo: CK_C_GetMechanismInfo, + pub C_InitToken: CK_C_InitToken, + pub C_InitPIN: CK_C_InitPIN, + pub C_SetPIN: CK_C_SetPIN, + pub C_OpenSession: CK_C_OpenSession, + pub C_CloseSession: CK_C_CloseSession, + pub C_CloseAllSessions: CK_C_CloseAllSessions, + pub C_GetSessionInfo: CK_C_GetSessionInfo, + pub C_GetOperationState: CK_C_GetOperationState, + pub C_SetOperationState: CK_C_SetOperationState, + pub C_Login: CK_C_Login, + pub C_Logout: CK_C_Logout, + pub C_CreateObject: CK_C_CreateObject, + pub C_CopyObject: CK_C_CopyObject, + pub C_DestroyObject: CK_C_DestroyObject, + pub C_GetObjectSize: CK_C_GetObjectSize, + pub C_GetAttributeValue: CK_C_GetAttributeValue, + pub C_SetAttributeValue: CK_C_SetAttributeValue, + pub C_FindObjectsInit: CK_C_FindObjectsInit, + pub C_FindObjects: CK_C_FindObjects, + pub C_FindObjectsFinal: CK_C_FindObjectsFinal, + pub C_EncryptInit: CK_C_EncryptInit, + pub C_Encrypt: CK_C_Encrypt, + pub C_EncryptUpdate: CK_C_EncryptUpdate, + pub C_EncryptFinal: CK_C_EncryptFinal, + pub C_DecryptInit: CK_C_DecryptInit, + pub C_Decrypt: CK_C_Decrypt, + pub C_DecryptUpdate: CK_C_DecryptUpdate, + pub C_DecryptFinal: CK_C_DecryptFinal, + pub C_DigestInit: CK_C_DigestInit, + pub C_Digest: CK_C_Digest, + pub C_DigestUpdate: CK_C_DigestUpdate, + pub C_DigestKey: CK_C_DigestKey, + pub C_DigestFinal: CK_C_DigestFinal, + pub C_SignInit: CK_C_SignInit, + pub C_Sign: CK_C_Sign, + pub C_SignUpdate: CK_C_SignUpdate, + pub C_SignFinal: CK_C_SignFinal, + pub C_SignRecoverInit: CK_C_SignRecoverInit, + pub C_SignRecover: CK_C_SignRecover, + pub C_VerifyInit: CK_C_VerifyInit, + pub C_Verify: CK_C_Verify, + pub C_VerifyUpdate: CK_C_VerifyUpdate, + pub C_VerifyFinal: CK_C_VerifyFinal, + pub C_VerifyRecoverInit: CK_C_VerifyRecoverInit, + pub C_VerifyRecover: CK_C_VerifyRecover, + pub C_DigestEncryptUpdate: CK_C_DigestEncryptUpdate, + pub C_DecryptDigestUpdate: CK_C_DecryptDigestUpdate, + pub C_SignEncryptUpdate: CK_C_SignEncryptUpdate, + pub C_DecryptVerifyUpdate: CK_C_DecryptVerifyUpdate, + pub C_GenerateKey: CK_C_GenerateKey, + pub C_GenerateKeyPair: CK_C_GenerateKeyPair, + pub C_WrapKey: CK_C_WrapKey, + pub C_UnwrapKey: CK_C_UnwrapKey, + pub C_DeriveKey: CK_C_DeriveKey, + pub C_SeedRandom: CK_C_SeedRandom, + pub C_GenerateRandom: CK_C_GenerateRandom, + pub C_GetFunctionStatus: CK_C_GetFunctionStatus, + pub C_CancelFunction: CK_C_CancelFunction, + pub C_WaitForSlotEvent: CK_C_WaitForSlotEvent, + pub C_GetInterfaceList: CK_C_GetInterfaceList, + pub C_GetInterface: CK_C_GetInterface, + pub C_LoginUser: CK_C_LoginUser, + pub C_SessionCancel: CK_C_SessionCancel, + pub C_MessageEncryptInit: CK_C_MessageEncryptInit, + pub C_EncryptMessage: CK_C_EncryptMessage, + pub C_EncryptMessageBegin: CK_C_EncryptMessageBegin, + pub C_EncryptMessageNext: CK_C_EncryptMessageNext, + pub C_MessageEncryptFinal: CK_C_MessageEncryptFinal, + pub C_MessageDecryptInit: CK_C_MessageDecryptInit, + pub C_DecryptMessage: CK_C_DecryptMessage, + pub C_DecryptMessageBegin: CK_C_DecryptMessageBegin, + pub C_DecryptMessageNext: CK_C_DecryptMessageNext, + pub C_MessageDecryptFinal: CK_C_MessageDecryptFinal, + pub C_MessageSignInit: CK_C_MessageSignInit, + pub C_SignMessage: CK_C_SignMessage, + pub C_SignMessageBegin: CK_C_SignMessageBegin, + pub C_SignMessageNext: CK_C_SignMessageNext, + pub C_MessageSignFinal: CK_C_MessageSignFinal, + pub C_MessageVerifyInit: CK_C_MessageVerifyInit, + pub C_VerifyMessage: CK_C_VerifyMessage, + pub C_VerifyMessageBegin: CK_C_VerifyMessageBegin, + 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::(), + 744usize, + concat!("Size of: ", stringify!(CK_FUNCTION_LIST_3_0)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + 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 }, + 16usize, + 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 }, + 24usize, + 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 }, + 32usize, + 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 }, + 40usize, + 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 }, + 48usize, + 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 }, + 56usize, + 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 }, + 64usize, + 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 }, + 72usize, + 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 }, + 80usize, + 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 }, + 88usize, + 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 }, + 96usize, + 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 }, + 104usize, + 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 }, + 112usize, + 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 }, + 120usize, + 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 }, + 128usize, + 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 }, + 136usize, + 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 }, + 144usize, + 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 }, + 152usize, + 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 }, + 160usize, + 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 }, + 168usize, + 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 }, + 176usize, + 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 }, + 184usize, + 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 }, + 192usize, + 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 }, + 200usize, + 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 }, + 208usize, + 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 }, + 216usize, + 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 }, + 224usize, + 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 }, + 232usize, + 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 }, + 240usize, + 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 }, + 248usize, + 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 }, + 256usize, + 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 }, + 264usize, + 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 }, + 272usize, + 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 }, + 280usize, + 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 }, + 288usize, + 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 }, + 296usize, + 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 }, + 304usize, + 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 }, + 312usize, + 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 }, + 320usize, + 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 }, + 328usize, + 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 }, + 336usize, + 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 }, + 344usize, + 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 }, + 352usize, + 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 }, + 360usize, + 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 }, + 368usize, + 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 }, + 376usize, + 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 }, + 384usize, + 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 }, + 392usize, + 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 }, + 400usize, + 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 }, + 408usize, + 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 }, + 416usize, + 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 }, + 424usize, + 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 }, + 432usize, + 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 }, + 440usize, + 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 }, + 448usize, + 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 }, + 456usize, + 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 }, + 464usize, + 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 }, + 472usize, + 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 }, + 480usize, + 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 }, + 488usize, + 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 }, + 496usize, + 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 }, + 504usize, + 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 }, + 512usize, + 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 }, + 520usize, + 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 }, + 528usize, + 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 }, + 536usize, + 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 }, + 544usize, + 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 }, + 552usize, + 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 }, + 560usize, + 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 }, + 568usize, + 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 }, + 576usize, + 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 }, + 584usize, + 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 }, + 592usize, + 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 }, + 600usize, + 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 }, + 608usize, + 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 }, + 616usize, + 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 }, + 624usize, + 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 }, + 632usize, + 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 }, + 640usize, + 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 }, + 648usize, + 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 }, + 656usize, + 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 }, + 664usize, + 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 }, + 672usize, + 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 }, + 680usize, + 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 }, + 688usize, + 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 }, + 696usize, + 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 }, + 704usize, + 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 }, + 712usize, + 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 }, + 720usize, + 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 }, + 728usize, + 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 }, + 736usize, + concat!( + "Offset of field: ", + stringify!(CK_FUNCTION_LIST_3_0), + "::", + stringify!(C_MessageVerifyFinal) + ) + ); +} #[repr(C)] #[derive(Debug, Default, Copy, Clone)] -pub struct _CK_FUNCTION_LIST { - pub version: _CK_VERSION, +pub struct CK_FUNCTION_LIST { + pub version: CK_VERSION, pub C_Initialize: CK_C_Initialize, pub C_Finalize: CK_C_Finalize, pub C_GetInfo: CK_C_GetInfo, @@ -2647,25 +9810,25 @@ pub struct _CK_FUNCTION_LIST { pub C_WaitForSlotEvent: CK_C_WaitForSlotEvent, } #[test] -fn bindgen_test_layout__CK_FUNCTION_LIST() { - const UNINIT: ::std::mem::MaybeUninit<_CK_FUNCTION_LIST> = ::std::mem::MaybeUninit::uninit(); +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::<_CK_FUNCTION_LIST>(), + ::std::mem::size_of::(), 552usize, - concat!("Size of: ", stringify!(_CK_FUNCTION_LIST)) + concat!("Size of: ", stringify!(CK_FUNCTION_LIST)) ); assert_eq!( - ::std::mem::align_of::<_CK_FUNCTION_LIST>(), + ::std::mem::align_of::(), 8usize, - concat!("Alignment of ", stringify!(_CK_FUNCTION_LIST)) + 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!(CK_FUNCTION_LIST), "::", stringify!(version) ) @@ -2675,7 +9838,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 8usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_Initialize) ) @@ -2685,7 +9848,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 16usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_Finalize) ) @@ -2695,7 +9858,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 24usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_GetInfo) ) @@ -2705,7 +9868,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 32usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_GetFunctionList) ) @@ -2715,7 +9878,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 40usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_GetSlotList) ) @@ -2725,7 +9888,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 48usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_GetSlotInfo) ) @@ -2735,7 +9898,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 56usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_GetTokenInfo) ) @@ -2745,7 +9908,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 64usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_GetMechanismList) ) @@ -2755,7 +9918,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 72usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_GetMechanismInfo) ) @@ -2765,7 +9928,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 80usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_InitToken) ) @@ -2775,7 +9938,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 88usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_InitPIN) ) @@ -2785,7 +9948,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 96usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_SetPIN) ) @@ -2795,7 +9958,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 104usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_OpenSession) ) @@ -2805,7 +9968,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 112usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_CloseSession) ) @@ -2815,7 +9978,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 120usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_CloseAllSessions) ) @@ -2825,7 +9988,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 128usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_GetSessionInfo) ) @@ -2835,7 +9998,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 136usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_GetOperationState) ) @@ -2845,7 +10008,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 144usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_SetOperationState) ) @@ -2855,7 +10018,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 152usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_Login) ) @@ -2865,7 +10028,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 160usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_Logout) ) @@ -2875,7 +10038,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 168usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_CreateObject) ) @@ -2885,7 +10048,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 176usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_CopyObject) ) @@ -2895,7 +10058,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 184usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_DestroyObject) ) @@ -2905,7 +10068,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 192usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_GetObjectSize) ) @@ -2915,7 +10078,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 200usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_GetAttributeValue) ) @@ -2925,7 +10088,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 208usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_SetAttributeValue) ) @@ -2935,7 +10098,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 216usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_FindObjectsInit) ) @@ -2945,7 +10108,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 224usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_FindObjects) ) @@ -2955,7 +10118,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 232usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_FindObjectsFinal) ) @@ -2965,7 +10128,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 240usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_EncryptInit) ) @@ -2975,7 +10138,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 248usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_Encrypt) ) @@ -2985,7 +10148,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 256usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_EncryptUpdate) ) @@ -2995,7 +10158,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 264usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_EncryptFinal) ) @@ -3005,7 +10168,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 272usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_DecryptInit) ) @@ -3015,7 +10178,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 280usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_Decrypt) ) @@ -3025,7 +10188,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 288usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_DecryptUpdate) ) @@ -3035,7 +10198,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 296usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_DecryptFinal) ) @@ -3045,7 +10208,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 304usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_DigestInit) ) @@ -3055,7 +10218,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 312usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_Digest) ) @@ -3065,7 +10228,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 320usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_DigestUpdate) ) @@ -3075,7 +10238,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 328usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_DigestKey) ) @@ -3085,7 +10248,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 336usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_DigestFinal) ) @@ -3095,7 +10258,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 344usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_SignInit) ) @@ -3105,7 +10268,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 352usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_Sign) ) @@ -3115,7 +10278,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 360usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_SignUpdate) ) @@ -3125,7 +10288,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 368usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_SignFinal) ) @@ -3135,7 +10298,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 376usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_SignRecoverInit) ) @@ -3145,7 +10308,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 384usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_SignRecover) ) @@ -3155,7 +10318,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 392usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_VerifyInit) ) @@ -3165,7 +10328,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 400usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_Verify) ) @@ -3175,7 +10338,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 408usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_VerifyUpdate) ) @@ -3185,7 +10348,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 416usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_VerifyFinal) ) @@ -3195,7 +10358,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 424usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_VerifyRecoverInit) ) @@ -3205,7 +10368,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 432usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_VerifyRecover) ) @@ -3215,7 +10378,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 440usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_DigestEncryptUpdate) ) @@ -3225,7 +10388,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 448usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_DecryptDigestUpdate) ) @@ -3235,7 +10398,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 456usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_SignEncryptUpdate) ) @@ -3245,7 +10408,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 464usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_DecryptVerifyUpdate) ) @@ -3255,7 +10418,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 472usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_GenerateKey) ) @@ -3265,7 +10428,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 480usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_GenerateKeyPair) ) @@ -3275,7 +10438,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 488usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_WrapKey) ) @@ -3285,7 +10448,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 496usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_UnwrapKey) ) @@ -3295,7 +10458,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 504usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_DeriveKey) ) @@ -3305,7 +10468,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 512usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_SeedRandom) ) @@ -3315,7 +10478,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 520usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_GenerateRandom) ) @@ -3325,7 +10488,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 528usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_GetFunctionStatus) ) @@ -3335,7 +10498,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 536usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_CancelFunction) ) @@ -3345,223 +10508,45 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 544usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), - "::", - stringify!(C_WaitForSlotEvent) - ) - ); -} -pub type CK_CREATEMUTEX = - ::std::option::Option CK_RV>; -pub type CK_DESTROYMUTEX = - ::std::option::Option CK_RV>; -pub type CK_LOCKMUTEX = - ::std::option::Option CK_RV>; -pub type CK_UNLOCKMUTEX = - ::std::option::Option CK_RV>; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct _CK_C_INITIALIZE_ARGS { - pub CreateMutex: CK_CREATEMUTEX, - pub DestroyMutex: CK_DESTROYMUTEX, - pub LockMutex: CK_LOCKMUTEX, - pub UnlockMutex: CK_UNLOCKMUTEX, - pub flags: CK_FLAGS, - pub pReserved: *mut ::std::os::raw::c_void, -} -#[test] -fn bindgen_test_layout__CK_C_INITIALIZE_ARGS() { - const UNINIT: ::std::mem::MaybeUninit<_CK_C_INITIALIZE_ARGS> = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<_CK_C_INITIALIZE_ARGS>(), - 48usize, - concat!("Size of: ", stringify!(_CK_C_INITIALIZE_ARGS)) - ); - assert_eq!( - ::std::mem::align_of::<_CK_C_INITIALIZE_ARGS>(), - 8usize, - 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 }, - 40usize, - concat!( - "Offset of field: ", - stringify!(_CK_C_INITIALIZE_ARGS), + stringify!(CK_FUNCTION_LIST), "::", - stringify!(pReserved) - ) - ); -} -impl Default for _CK_C_INITIALIZE_ARGS { - fn default() -> Self { - let mut s = ::std::mem::MaybeUninit::::uninit(); - unsafe { - ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -pub type CK_BYTE = ::std::os::raw::c_uchar; -pub type CK_CHAR = ::std::os::raw::c_uchar; -pub type CK_UTF8CHAR = ::std::os::raw::c_uchar; -pub type CK_BBOOL = ::std::os::raw::c_uchar; -pub type CK_ULONG = ::std::os::raw::c_ulong; -pub type CK_LONG = ::std::os::raw::c_long; -pub type CK_BYTE_PTR = *mut CK_BYTE; -pub type CK_CHAR_PTR = *mut CK_CHAR; -pub type CK_UTF8CHAR_PTR = *mut CK_UTF8CHAR; -pub type CK_ULONG_PTR = *mut CK_ULONG; -pub type CK_VOID_PTR = *mut ::std::os::raw::c_void; -pub type CK_VOID_PTR_PTR = *mut *mut ::std::os::raw::c_void; -pub type CK_VERSION = _CK_VERSION; -pub type CK_VERSION_PTR = *mut _CK_VERSION; -pub type CK_INFO = _CK_INFO; -pub type CK_INFO_PTR = *mut _CK_INFO; -pub type CK_SLOT_ID_PTR = *mut CK_SLOT_ID; -pub type CK_SLOT_INFO = _CK_SLOT_INFO; -pub type CK_SLOT_INFO_PTR = *mut _CK_SLOT_INFO; -pub type CK_TOKEN_INFO = _CK_TOKEN_INFO; -pub type CK_TOKEN_INFO_PTR = *mut _CK_TOKEN_INFO; -pub type CK_SESSION_HANDLE_PTR = *mut CK_SESSION_HANDLE; -pub type CK_SESSION_INFO = _CK_SESSION_INFO; -pub type CK_SESSION_INFO_PTR = *mut _CK_SESSION_INFO; -pub type CK_OBJECT_HANDLE_PTR = *mut CK_OBJECT_HANDLE; -pub type CK_OBJECT_CLASS_PTR = *mut CK_OBJECT_CLASS; -pub type CK_ATTRIBUTE = _CK_ATTRIBUTE; -pub type CK_ATTRIBUTE_PTR = *mut _CK_ATTRIBUTE; -pub type CK_DATE = _CK_DATE; -pub type CK_DATE_PTR = *mut _CK_DATE; -pub type CK_MECHANISM_TYPE_PTR = *mut CK_MECHANISM_TYPE; -pub type CK_MECHANISM = _CK_MECHANISM; -pub type CK_MECHANISM_PTR = *mut _CK_MECHANISM; -pub type CK_MECHANISM_INFO = _CK_MECHANISM_INFO; -pub type CK_MECHANISM_INFO_PTR = *mut _CK_MECHANISM_INFO; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct ck_otp_mechanism_info { - _unused: [u8; 0], -} -pub type CK_OTP_MECHANISM_INFO = ck_otp_mechanism_info; -pub type CK_OTP_MECHANISM_INFO_PTR = *mut ck_otp_mechanism_info; -pub type CK_FUNCTION_LIST = _CK_FUNCTION_LIST; -pub type CK_FUNCTION_LIST_PTR = *mut _CK_FUNCTION_LIST; -pub type CK_FUNCTION_LIST_PTR_PTR = *mut *mut _CK_FUNCTION_LIST; -pub type CK_C_INITIALIZE_ARGS = _CK_C_INITIALIZE_ARGS; -pub type CK_C_INITIALIZE_ARGS_PTR = *mut _CK_C_INITIALIZE_ARGS; -pub type CK_RSA_PKCS_PSS_PARAMS = ck_rsa_pkcs_pss_params; -pub type CK_RSA_PKCS_PSS_PARAMS_PTR = *mut ck_rsa_pkcs_pss_params; -pub type CK_RSA_PKCS_OAEP_PARAMS = ck_rsa_pkcs_oaep_params; -pub type CK_RSA_PKCS_OAEP_PARAMS_PTR = *mut ck_rsa_pkcs_oaep_params; -pub type CK_AES_CTR_PARAMS = ck_aes_ctr_params; -pub type CK_AES_CTR_PARAMS_PTR = *mut ck_aes_ctr_params; -pub type CK_GCM_PARAMS = ck_gcm_params; -pub type CK_GCM_PARAMS_PTR = *mut ck_gcm_params; -pub type CK_ECDH1_DERIVE_PARAMS = ck_ecdh1_derive_params; -pub type CK_ECDH1_DERIVE_PARAMS_PTR = *mut ck_ecdh1_derive_params; -pub type CK_KEY_DERIVATION_STRING_DATA = ck_key_derivation_string_data; -pub type CK_KEY_DERIVATION_STRING_DATA_PTR = *mut ck_key_derivation_string_data; -pub type CK_DES_CBC_ENCRYPT_DATA_PARAMS = ck_des_cbc_encrypt_data_params; -pub type CK_DES_CBC_ENCRYPT_DATA_PARAMS_PTR = *mut ck_des_cbc_encrypt_data_params; -pub type CK_AES_CBC_ENCRYPT_DATA_PARAMS = ck_aes_cbc_encrypt_data_params; -pub type CK_AES_CBC_ENCRYPT_DATA_PARAMS_PTR = *mut ck_aes_cbc_encrypt_data_params; + stringify!(C_WaitForSlotEvent) + ) + ); +} extern crate libloading; pub struct Pkcs11 { __library: ::libloading::Library, - pub C_Initialize: Result< - unsafe extern "C" fn(init_args: *mut ::std::os::raw::c_void) -> CK_RV, - ::libloading::Error, - >, - pub C_Finalize: Result< - unsafe extern "C" fn(pReserved: *mut ::std::os::raw::c_void) -> CK_RV, - ::libloading::Error, - >, - pub C_GetInfo: Result CK_RV, ::libloading::Error>, + pub C_Initialize: + Result CK_RV, ::libloading::Error>, + pub C_Finalize: + Result CK_RV, ::libloading::Error>, + pub C_GetInfo: Result CK_RV, ::libloading::Error>, pub C_GetFunctionList: Result< - unsafe extern "C" fn(function_list: *mut *mut _CK_FUNCTION_LIST) -> CK_RV, + unsafe extern "C" fn(ppFunctionList: CK_FUNCTION_LIST_PTR_PTR) -> CK_RV, ::libloading::Error, >, pub C_GetSlotList: Result< unsafe extern "C" fn( - token_present: ::std::os::raw::c_uchar, - slot_list: *mut CK_SLOT_ID, - ulCount: *mut ::std::os::raw::c_ulong, + tokenPresent: CK_BBOOL, + pSlotList: CK_SLOT_ID_PTR, + pulCount: CK_ULONG_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_GetSlotInfo: Result< - unsafe extern "C" fn(slotID: CK_SLOT_ID, info: *mut _CK_SLOT_INFO) -> CK_RV, + unsafe extern "C" fn(slotID: CK_SLOT_ID, pInfo: CK_SLOT_INFO_PTR) -> CK_RV, ::libloading::Error, >, pub C_GetTokenInfo: Result< - unsafe extern "C" fn(slotID: CK_SLOT_ID, info: *mut _CK_TOKEN_INFO) -> CK_RV, - ::libloading::Error, - >, - pub C_WaitForSlotEvent: Result< - unsafe extern "C" fn( - flags: CK_FLAGS, - slot: *mut CK_SLOT_ID, - pReserved: *mut ::std::os::raw::c_void, - ) -> CK_RV, + unsafe extern "C" fn(slotID: CK_SLOT_ID, pInfo: CK_TOKEN_INFO_PTR) -> CK_RV, ::libloading::Error, >, pub C_GetMechanismList: Result< unsafe extern "C" fn( slotID: CK_SLOT_ID, - mechanism_list: *mut CK_MECHANISM_TYPE, - ulCount: *mut ::std::os::raw::c_ulong, + pMechanismList: CK_MECHANISM_TYPE_PTR, + pulCount: CK_ULONG_PTR, ) -> CK_RV, ::libloading::Error, >, @@ -3569,34 +10554,34 @@ pub struct Pkcs11 { unsafe extern "C" fn( slotID: CK_SLOT_ID, type_: CK_MECHANISM_TYPE, - info: *mut _CK_MECHANISM_INFO, + pInfo: CK_MECHANISM_INFO_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_InitToken: Result< unsafe extern "C" fn( slotID: CK_SLOT_ID, - pin: *mut ::std::os::raw::c_uchar, - pin_len: ::std::os::raw::c_ulong, - label: *mut ::std::os::raw::c_uchar, + pPin: CK_UTF8CHAR_PTR, + ulPinLen: CK_ULONG, + pLabel: CK_UTF8CHAR_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_InitPIN: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - pin: *mut ::std::os::raw::c_uchar, - pin_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pPin: CK_UTF8CHAR_PTR, + ulPinLen: CK_ULONG, ) -> CK_RV, ::libloading::Error, >, pub C_SetPIN: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - old_pin: *mut ::std::os::raw::c_uchar, - old_len: ::std::os::raw::c_ulong, - new_pin: *mut ::std::os::raw::c_uchar, - new_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pOldPin: CK_UTF8CHAR_PTR, + ulOldLen: CK_ULONG, + pNewPin: CK_UTF8CHAR_PTR, + ulNewLen: CK_ULONG, ) -> CK_RV, ::libloading::Error, >, @@ -3604,445 +10589,659 @@ pub struct Pkcs11 { unsafe extern "C" fn( slotID: CK_SLOT_ID, flags: CK_FLAGS, - application: *mut ::std::os::raw::c_void, - notify: CK_NOTIFY, - session: *mut CK_SESSION_HANDLE, + pApplication: CK_VOID_PTR, + Notify: CK_NOTIFY, + phSession: CK_SESSION_HANDLE_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_CloseSession: - Result CK_RV, ::libloading::Error>, + Result CK_RV, ::libloading::Error>, pub C_CloseAllSessions: Result CK_RV, ::libloading::Error>, pub C_GetSessionInfo: Result< - unsafe extern "C" fn(session: CK_SESSION_HANDLE, info: *mut _CK_SESSION_INFO) -> CK_RV, + unsafe extern "C" fn(hSession: CK_SESSION_HANDLE, pInfo: CK_SESSION_INFO_PTR) -> CK_RV, ::libloading::Error, >, pub C_GetOperationState: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - operation_state: *mut ::std::os::raw::c_uchar, - operation_state_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pOperationState: CK_BYTE_PTR, + pulOperationStateLen: CK_ULONG_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_SetOperationState: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - operation_state: *mut ::std::os::raw::c_uchar, - operation_state_len: ::std::os::raw::c_ulong, - encryption_key: CK_OBJECT_HANDLE, - authentiation_key: CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pOperationState: CK_BYTE_PTR, + ulOperationStateLen: CK_ULONG, + hEncryptionKey: CK_OBJECT_HANDLE, + hAuthenticationKey: CK_OBJECT_HANDLE, ) -> CK_RV, ::libloading::Error, >, pub C_Login: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - user_type: CK_USER_TYPE, - pin: *mut ::std::os::raw::c_uchar, - pin_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + userType: CK_USER_TYPE, + pPin: CK_UTF8CHAR_PTR, + ulPinLen: CK_ULONG, ) -> CK_RV, ::libloading::Error, >, pub C_Logout: - Result CK_RV, ::libloading::Error>, + Result CK_RV, ::libloading::Error>, pub C_CreateObject: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - templ: *mut _CK_ATTRIBUTE, - ulCount: ::std::os::raw::c_ulong, - object: *mut CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pTemplate: CK_ATTRIBUTE_PTR, + ulCount: CK_ULONG, + phObject: CK_OBJECT_HANDLE_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_CopyObject: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - object: CK_OBJECT_HANDLE, - templ: *mut _CK_ATTRIBUTE, - ulCount: ::std::os::raw::c_ulong, - new_object: *mut CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + hObject: CK_OBJECT_HANDLE, + pTemplate: CK_ATTRIBUTE_PTR, + ulCount: CK_ULONG, + phNewObject: CK_OBJECT_HANDLE_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_DestroyObject: Result< - unsafe extern "C" fn(session: CK_SESSION_HANDLE, object: CK_OBJECT_HANDLE) -> CK_RV, + unsafe extern "C" fn(hSession: CK_SESSION_HANDLE, hObject: CK_OBJECT_HANDLE) -> CK_RV, ::libloading::Error, >, pub C_GetObjectSize: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - object: CK_OBJECT_HANDLE, - size: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + hObject: CK_OBJECT_HANDLE, + pulSize: CK_ULONG_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_GetAttributeValue: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - object: CK_OBJECT_HANDLE, - templ: *mut _CK_ATTRIBUTE, - ulCount: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + hObject: CK_OBJECT_HANDLE, + pTemplate: CK_ATTRIBUTE_PTR, + ulCount: CK_ULONG, ) -> CK_RV, ::libloading::Error, >, pub C_SetAttributeValue: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - object: CK_OBJECT_HANDLE, - templ: *mut _CK_ATTRIBUTE, - ulCount: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + hObject: CK_OBJECT_HANDLE, + pTemplate: CK_ATTRIBUTE_PTR, + ulCount: CK_ULONG, ) -> CK_RV, ::libloading::Error, >, pub C_FindObjectsInit: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - templ: *mut _CK_ATTRIBUTE, - ulCount: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pTemplate: CK_ATTRIBUTE_PTR, + ulCount: CK_ULONG, ) -> CK_RV, ::libloading::Error, >, pub C_FindObjects: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - object: *mut CK_OBJECT_HANDLE, - max_object_count: ::std::os::raw::c_ulong, - object_count: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + phObject: CK_OBJECT_HANDLE_PTR, + ulMaxObjectCount: CK_ULONG, + pulObjectCount: CK_ULONG_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_FindObjectsFinal: - Result CK_RV, ::libloading::Error>, + Result CK_RV, ::libloading::Error>, pub C_EncryptInit: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - key: CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, ) -> CK_RV, ::libloading::Error, >, pub C_Encrypt: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - data: *mut ::std::os::raw::c_uchar, - data_len: ::std::os::raw::c_ulong, - encrypted_data: *mut ::std::os::raw::c_uchar, - encrypted_data_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pEncryptedData: CK_BYTE_PTR, + pulEncryptedDataLen: CK_ULONG_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_EncryptUpdate: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - part: *mut ::std::os::raw::c_uchar, - part_len: ::std::os::raw::c_ulong, - encrypted_part: *mut ::std::os::raw::c_uchar, - encrypted_part_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pPart: CK_BYTE_PTR, + ulPartLen: CK_ULONG, + pEncryptedPart: CK_BYTE_PTR, + pulEncryptedPartLen: CK_ULONG_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_EncryptFinal: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - last_encrypted_part: *mut ::std::os::raw::c_uchar, - last_encrypted_part_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pLastEncryptedPart: CK_BYTE_PTR, + pulLastEncryptedPartLen: CK_ULONG_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_DecryptInit: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - key: CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, ) -> CK_RV, ::libloading::Error, >, pub C_Decrypt: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - encrypted_data: *mut ::std::os::raw::c_uchar, - encrypted_data_len: ::std::os::raw::c_ulong, - data: *mut ::std::os::raw::c_uchar, - data_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pEncryptedData: CK_BYTE_PTR, + ulEncryptedDataLen: CK_ULONG, + pData: CK_BYTE_PTR, + pulDataLen: CK_ULONG_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_DecryptUpdate: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - encrypted_part: *mut ::std::os::raw::c_uchar, - encrypted_part_len: ::std::os::raw::c_ulong, - part: *mut ::std::os::raw::c_uchar, - part_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pEncryptedPart: CK_BYTE_PTR, + ulEncryptedPartLen: CK_ULONG, + pPart: CK_BYTE_PTR, + pulPartLen: CK_ULONG_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_DecryptFinal: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - last_part: *mut ::std::os::raw::c_uchar, - last_part_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pLastPart: CK_BYTE_PTR, + pulLastPartLen: CK_ULONG_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_DigestInit: Result< - unsafe extern "C" fn(session: CK_SESSION_HANDLE, mechanism: *mut _CK_MECHANISM) -> CK_RV, + unsafe extern "C" fn(hSession: CK_SESSION_HANDLE, pMechanism: CK_MECHANISM_PTR) -> CK_RV, ::libloading::Error, >, pub C_Digest: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - data: *mut ::std::os::raw::c_uchar, - data_len: ::std::os::raw::c_ulong, - digest: *mut ::std::os::raw::c_uchar, - digest_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pDigest: CK_BYTE_PTR, + pulDigestLen: CK_ULONG_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_DigestUpdate: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - part: *mut ::std::os::raw::c_uchar, - part_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pPart: CK_BYTE_PTR, + ulPartLen: CK_ULONG, ) -> CK_RV, ::libloading::Error, >, pub C_DigestKey: Result< - unsafe extern "C" fn(session: CK_SESSION_HANDLE, key: CK_OBJECT_HANDLE) -> CK_RV, + unsafe extern "C" fn(hSession: CK_SESSION_HANDLE, hKey: CK_OBJECT_HANDLE) -> CK_RV, ::libloading::Error, >, pub C_DigestFinal: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - digest: *mut ::std::os::raw::c_uchar, - digest_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pDigest: CK_BYTE_PTR, + pulDigestLen: CK_ULONG_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_SignInit: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - key: CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, ) -> CK_RV, ::libloading::Error, >, pub C_Sign: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - data: *mut ::std::os::raw::c_uchar, - data_len: ::std::os::raw::c_ulong, - signature: *mut ::std::os::raw::c_uchar, - signature_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + pulSignatureLen: CK_ULONG_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_SignUpdate: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - part: *mut ::std::os::raw::c_uchar, - part_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pPart: CK_BYTE_PTR, + ulPartLen: CK_ULONG, ) -> CK_RV, ::libloading::Error, >, pub C_SignFinal: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - signature: *mut ::std::os::raw::c_uchar, - signature_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pSignature: CK_BYTE_PTR, + pulSignatureLen: CK_ULONG_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_SignRecoverInit: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - key: CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, ) -> CK_RV, ::libloading::Error, >, pub C_SignRecover: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - data: *mut ::std::os::raw::c_uchar, - data_len: ::std::os::raw::c_ulong, - signature: *mut ::std::os::raw::c_uchar, - signature_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + pulSignatureLen: CK_ULONG_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_VerifyInit: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - key: CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, ) -> CK_RV, ::libloading::Error, >, pub C_Verify: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - data: *mut ::std::os::raw::c_uchar, - data_len: ::std::os::raw::c_ulong, - signature: *mut ::std::os::raw::c_uchar, - signature_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + ulSignatureLen: CK_ULONG, ) -> CK_RV, ::libloading::Error, >, pub C_VerifyUpdate: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - part: *mut ::std::os::raw::c_uchar, - part_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pPart: CK_BYTE_PTR, + ulPartLen: CK_ULONG, ) -> CK_RV, ::libloading::Error, >, pub C_VerifyFinal: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - signature: *mut ::std::os::raw::c_uchar, - signature_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pSignature: CK_BYTE_PTR, + ulSignatureLen: CK_ULONG, ) -> CK_RV, ::libloading::Error, >, pub C_VerifyRecoverInit: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - key: CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, ) -> CK_RV, ::libloading::Error, >, pub C_VerifyRecover: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - signature: *mut ::std::os::raw::c_uchar, - signature_len: ::std::os::raw::c_ulong, - data: *mut ::std::os::raw::c_uchar, - data_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pSignature: CK_BYTE_PTR, + ulSignatureLen: CK_ULONG, + pData: CK_BYTE_PTR, + pulDataLen: CK_ULONG_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_DigestEncryptUpdate: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - part: *mut ::std::os::raw::c_uchar, - part_len: ::std::os::raw::c_ulong, - encrypted_part: *mut ::std::os::raw::c_uchar, - encrypted_part_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pPart: CK_BYTE_PTR, + ulPartLen: CK_ULONG, + pEncryptedPart: CK_BYTE_PTR, + pulEncryptedPartLen: CK_ULONG_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_DecryptDigestUpdate: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - encrypted_part: *mut ::std::os::raw::c_uchar, - encrypted_part_len: ::std::os::raw::c_ulong, - part: *mut ::std::os::raw::c_uchar, - part_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pEncryptedPart: CK_BYTE_PTR, + ulEncryptedPartLen: CK_ULONG, + pPart: CK_BYTE_PTR, + pulPartLen: CK_ULONG_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_SignEncryptUpdate: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - part: *mut ::std::os::raw::c_uchar, - part_len: ::std::os::raw::c_ulong, - encrypted_part: *mut ::std::os::raw::c_uchar, - encrypted_part_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pPart: CK_BYTE_PTR, + ulPartLen: CK_ULONG, + pEncryptedPart: CK_BYTE_PTR, + pulEncryptedPartLen: CK_ULONG_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_DecryptVerifyUpdate: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - encrypted_part: *mut ::std::os::raw::c_uchar, - encrypted_part_len: ::std::os::raw::c_ulong, - part: *mut ::std::os::raw::c_uchar, - part_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pEncryptedPart: CK_BYTE_PTR, + ulEncryptedPartLen: CK_ULONG, + pPart: CK_BYTE_PTR, + pulPartLen: CK_ULONG_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_GenerateKey: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - templ: *mut _CK_ATTRIBUTE, - ulCount: ::std::os::raw::c_ulong, - key: *mut CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + pTemplate: CK_ATTRIBUTE_PTR, + ulCount: CK_ULONG, + phKey: CK_OBJECT_HANDLE_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_GenerateKeyPair: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - public_key_template: *mut _CK_ATTRIBUTE, - public_key_attribute_count: ::std::os::raw::c_ulong, - private_key_template: *mut _CK_ATTRIBUTE, - private_key_attribute_count: ::std::os::raw::c_ulong, - public_key: *mut CK_OBJECT_HANDLE, - private_key: *mut CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + pPublicKeyTemplate: CK_ATTRIBUTE_PTR, + ulPublicKeyAttributeCount: CK_ULONG, + pPrivateKeyTemplate: CK_ATTRIBUTE_PTR, + ulPrivateKeyAttributeCount: CK_ULONG, + phPublicKey: CK_OBJECT_HANDLE_PTR, + phPrivateKey: CK_OBJECT_HANDLE_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_WrapKey: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - wrapping_key: CK_OBJECT_HANDLE, - key: CK_OBJECT_HANDLE, - wrapped_key: *mut ::std::os::raw::c_uchar, - wrapped_key_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hWrappingKey: CK_OBJECT_HANDLE, + hKey: CK_OBJECT_HANDLE, + pWrappedKey: CK_BYTE_PTR, + pulWrappedKeyLen: CK_ULONG_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_UnwrapKey: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - unwrapping_key: CK_OBJECT_HANDLE, - wrapped_key: *mut ::std::os::raw::c_uchar, - wrapped_key_len: ::std::os::raw::c_ulong, - templ: *mut _CK_ATTRIBUTE, - attribute_count: ::std::os::raw::c_ulong, - key: *mut CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hUnwrappingKey: CK_OBJECT_HANDLE, + pWrappedKey: CK_BYTE_PTR, + ulWrappedKeyLen: CK_ULONG, + pTemplate: CK_ATTRIBUTE_PTR, + ulAttributeCount: CK_ULONG, + phKey: CK_OBJECT_HANDLE_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_DeriveKey: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - base_key: CK_OBJECT_HANDLE, - templ: *mut _CK_ATTRIBUTE, - attribute_count: ::std::os::raw::c_ulong, - key: *mut CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hBaseKey: CK_OBJECT_HANDLE, + pTemplate: CK_ATTRIBUTE_PTR, + ulAttributeCount: CK_ULONG, + phKey: CK_OBJECT_HANDLE_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_SeedRandom: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - seed: *mut ::std::os::raw::c_uchar, - seed_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pSeed: CK_BYTE_PTR, + ulSeedLen: CK_ULONG, ) -> CK_RV, ::libloading::Error, >, pub C_GenerateRandom: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - random_data: *mut ::std::os::raw::c_uchar, - random_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + RandomData: CK_BYTE_PTR, + ulRandomLen: CK_ULONG, ) -> CK_RV, ::libloading::Error, >, pub C_GetFunctionStatus: - Result CK_RV, ::libloading::Error>, + Result CK_RV, ::libloading::Error>, pub C_CancelFunction: - Result CK_RV, ::libloading::Error>, + Result CK_RV, ::libloading::Error>, + pub C_WaitForSlotEvent: Result< + unsafe extern "C" fn( + flags: CK_FLAGS, + pSlot: CK_SLOT_ID_PTR, + pRserved: CK_VOID_PTR, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_GetInterfaceList: Result< + unsafe extern "C" fn(pInterfacesList: CK_INTERFACE_PTR, pulCount: CK_ULONG_PTR) -> CK_RV, + ::libloading::Error, + >, + pub C_GetInterface: Result< + unsafe extern "C" fn( + pInterfaceName: CK_UTF8CHAR_PTR, + pVersion: CK_VERSION_PTR, + ppInterface: CK_INTERFACE_PTR_PTR, + flags: CK_FLAGS, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_LoginUser: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + userType: CK_USER_TYPE, + pPin: CK_UTF8CHAR_PTR, + ulPinLen: CK_ULONG, + pUsername: CK_UTF8CHAR_PTR, + ulUsernameLen: CK_ULONG, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_SessionCancel: Result< + unsafe extern "C" fn(hSession: CK_SESSION_HANDLE, flags: CK_FLAGS) -> CK_RV, + ::libloading::Error, + >, + pub C_MessageEncryptInit: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_EncryptMessage: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pAssociatedData: CK_BYTE_PTR, + ulAssociatedDataLen: CK_ULONG, + pPlaintext: CK_BYTE_PTR, + ulPlaintextLen: CK_ULONG, + pCiphertext: CK_BYTE_PTR, + pulCiphertextLen: CK_ULONG_PTR, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_EncryptMessageBegin: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pAssociatedData: CK_BYTE_PTR, + ulAssociatedDataLen: CK_ULONG, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_EncryptMessageNext: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pPlaintextPart: CK_BYTE_PTR, + ulPlaintextPartLen: CK_ULONG, + pCiphertextPart: CK_BYTE_PTR, + pulCiphertextPartLen: CK_ULONG_PTR, + flags: CK_FLAGS, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_MessageEncryptFinal: + Result CK_RV, ::libloading::Error>, + pub C_MessageDecryptInit: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_DecryptMessage: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pAssociatedData: CK_BYTE_PTR, + ulAssociatedDataLen: CK_ULONG, + pCiphertext: CK_BYTE_PTR, + ulCiphertextLen: CK_ULONG, + pPlaintext: CK_BYTE_PTR, + pulPlaintextLen: CK_ULONG_PTR, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_DecryptMessageBegin: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pAssociatedData: CK_BYTE_PTR, + ulAssociatedDataLen: CK_ULONG, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_DecryptMessageNext: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pCiphertext: CK_BYTE_PTR, + ulCiphertextLen: CK_ULONG, + pPlaintext: CK_BYTE_PTR, + pulPlaintextLen: CK_ULONG_PTR, + flags: CK_FLAGS, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_MessageDecryptFinal: + Result CK_RV, ::libloading::Error>, + pub C_MessageSignInit: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_SignMessage: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + pulSignatureLen: CK_ULONG_PTR, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_SignMessageBegin: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_SignMessageNext: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + pulSignatureLen: CK_ULONG_PTR, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_MessageSignFinal: + Result CK_RV, ::libloading::Error>, + pub C_MessageVerifyInit: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_VerifyMessage: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + ulSignatureLen: CK_ULONG, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_VerifyMessageBegin: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_VerifyMessageNext: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + ulSignatureLen: CK_ULONG, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_MessageVerifyFinal: + Result CK_RV, ::libloading::Error>, } impl Pkcs11 { pub unsafe fn new

(path: P) -> Result @@ -4064,7 +11263,6 @@ impl Pkcs11 { let C_GetSlotList = __library.get(b"C_GetSlotList\0").map(|sym| *sym); let C_GetSlotInfo = __library.get(b"C_GetSlotInfo\0").map(|sym| *sym); let C_GetTokenInfo = __library.get(b"C_GetTokenInfo\0").map(|sym| *sym); - let C_WaitForSlotEvent = __library.get(b"C_WaitForSlotEvent\0").map(|sym| *sym); let C_GetMechanismList = __library.get(b"C_GetMechanismList\0").map(|sym| *sym); let C_GetMechanismInfo = __library.get(b"C_GetMechanismInfo\0").map(|sym| *sym); let C_InitToken = __library.get(b"C_InitToken\0").map(|sym| *sym); @@ -4125,6 +11323,31 @@ impl Pkcs11 { let C_GenerateRandom = __library.get(b"C_GenerateRandom\0").map(|sym| *sym); let C_GetFunctionStatus = __library.get(b"C_GetFunctionStatus\0").map(|sym| *sym); let C_CancelFunction = __library.get(b"C_CancelFunction\0").map(|sym| *sym); + let C_WaitForSlotEvent = __library.get(b"C_WaitForSlotEvent\0").map(|sym| *sym); + let C_GetInterfaceList = __library.get(b"C_GetInterfaceList\0").map(|sym| *sym); + let C_GetInterface = __library.get(b"C_GetInterface\0").map(|sym| *sym); + let C_LoginUser = __library.get(b"C_LoginUser\0").map(|sym| *sym); + let C_SessionCancel = __library.get(b"C_SessionCancel\0").map(|sym| *sym); + let C_MessageEncryptInit = __library.get(b"C_MessageEncryptInit\0").map(|sym| *sym); + let C_EncryptMessage = __library.get(b"C_EncryptMessage\0").map(|sym| *sym); + let C_EncryptMessageBegin = __library.get(b"C_EncryptMessageBegin\0").map(|sym| *sym); + let C_EncryptMessageNext = __library.get(b"C_EncryptMessageNext\0").map(|sym| *sym); + let C_MessageEncryptFinal = __library.get(b"C_MessageEncryptFinal\0").map(|sym| *sym); + let C_MessageDecryptInit = __library.get(b"C_MessageDecryptInit\0").map(|sym| *sym); + let C_DecryptMessage = __library.get(b"C_DecryptMessage\0").map(|sym| *sym); + let C_DecryptMessageBegin = __library.get(b"C_DecryptMessageBegin\0").map(|sym| *sym); + let C_DecryptMessageNext = __library.get(b"C_DecryptMessageNext\0").map(|sym| *sym); + let C_MessageDecryptFinal = __library.get(b"C_MessageDecryptFinal\0").map(|sym| *sym); + let C_MessageSignInit = __library.get(b"C_MessageSignInit\0").map(|sym| *sym); + let C_SignMessage = __library.get(b"C_SignMessage\0").map(|sym| *sym); + let C_SignMessageBegin = __library.get(b"C_SignMessageBegin\0").map(|sym| *sym); + let C_SignMessageNext = __library.get(b"C_SignMessageNext\0").map(|sym| *sym); + let C_MessageSignFinal = __library.get(b"C_MessageSignFinal\0").map(|sym| *sym); + let C_MessageVerifyInit = __library.get(b"C_MessageVerifyInit\0").map(|sym| *sym); + let C_VerifyMessage = __library.get(b"C_VerifyMessage\0").map(|sym| *sym); + let C_VerifyMessageBegin = __library.get(b"C_VerifyMessageBegin\0").map(|sym| *sym); + let C_VerifyMessageNext = __library.get(b"C_VerifyMessageNext\0").map(|sym| *sym); + let C_MessageVerifyFinal = __library.get(b"C_MessageVerifyFinal\0").map(|sym| *sym); Ok(Pkcs11 { __library, C_Initialize, @@ -4134,7 +11357,6 @@ impl Pkcs11 { C_GetSlotList, C_GetSlotInfo, C_GetTokenInfo, - C_WaitForSlotEvent, C_GetMechanismList, C_GetMechanismInfo, C_InitToken, @@ -4195,146 +11417,164 @@ impl Pkcs11 { C_GenerateRandom, C_GetFunctionStatus, C_CancelFunction, + C_WaitForSlotEvent, + C_GetInterfaceList, + C_GetInterface, + C_LoginUser, + C_SessionCancel, + C_MessageEncryptInit, + C_EncryptMessage, + C_EncryptMessageBegin, + C_EncryptMessageNext, + C_MessageEncryptFinal, + C_MessageDecryptInit, + C_DecryptMessage, + C_DecryptMessageBegin, + C_DecryptMessageNext, + C_MessageDecryptFinal, + C_MessageSignInit, + C_SignMessage, + C_SignMessageBegin, + C_SignMessageNext, + C_MessageSignFinal, + C_MessageVerifyInit, + C_VerifyMessage, + C_VerifyMessageBegin, + C_VerifyMessageNext, + C_MessageVerifyFinal, }) } - pub unsafe fn C_Initialize(&self, init_args: *mut ::std::os::raw::c_void) -> CK_RV { + pub unsafe fn C_Initialize(&self, pInitArgs: CK_VOID_PTR) -> CK_RV { (self .C_Initialize .as_ref() - .expect("Expected function, got error."))(init_args) + .expect("Expected function, got error."))(pInitArgs) } - pub unsafe fn C_Finalize(&self, pReserved: *mut ::std::os::raw::c_void) -> CK_RV { + pub unsafe fn C_Finalize(&self, pReserved: CK_VOID_PTR) -> CK_RV { (self .C_Finalize .as_ref() .expect("Expected function, got error."))(pReserved) } - pub unsafe fn C_GetInfo(&self, info: *mut _CK_INFO) -> CK_RV { + pub unsafe fn C_GetInfo(&self, pInfo: CK_INFO_PTR) -> CK_RV { (self .C_GetInfo .as_ref() - .expect("Expected function, got error."))(info) + .expect("Expected function, got error."))(pInfo) } - pub unsafe fn C_GetFunctionList(&self, function_list: *mut *mut _CK_FUNCTION_LIST) -> CK_RV { + pub unsafe fn C_GetFunctionList(&self, ppFunctionList: CK_FUNCTION_LIST_PTR_PTR) -> CK_RV { (self .C_GetFunctionList .as_ref() - .expect("Expected function, got error."))(function_list) + .expect("Expected function, got error."))(ppFunctionList) } pub unsafe fn C_GetSlotList( &self, - token_present: ::std::os::raw::c_uchar, - slot_list: *mut CK_SLOT_ID, - ulCount: *mut ::std::os::raw::c_ulong, + tokenPresent: CK_BBOOL, + pSlotList: CK_SLOT_ID_PTR, + pulCount: CK_ULONG_PTR, ) -> CK_RV { (self .C_GetSlotList .as_ref() - .expect("Expected function, got error."))(token_present, slot_list, ulCount) + .expect("Expected function, got error."))(tokenPresent, pSlotList, pulCount) } - pub unsafe fn C_GetSlotInfo(&self, slotID: CK_SLOT_ID, info: *mut _CK_SLOT_INFO) -> CK_RV { + pub unsafe fn C_GetSlotInfo(&self, slotID: CK_SLOT_ID, pInfo: CK_SLOT_INFO_PTR) -> CK_RV { (self .C_GetSlotInfo .as_ref() - .expect("Expected function, got error."))(slotID, info) + .expect("Expected function, got error."))(slotID, pInfo) } - pub unsafe fn C_GetTokenInfo(&self, slotID: CK_SLOT_ID, info: *mut _CK_TOKEN_INFO) -> CK_RV { + pub unsafe fn C_GetTokenInfo(&self, slotID: CK_SLOT_ID, pInfo: CK_TOKEN_INFO_PTR) -> CK_RV { (self .C_GetTokenInfo .as_ref() - .expect("Expected function, got error."))(slotID, info) - } - pub unsafe fn C_WaitForSlotEvent( - &self, - flags: CK_FLAGS, - slot: *mut CK_SLOT_ID, - pReserved: *mut ::std::os::raw::c_void, - ) -> CK_RV { - (self - .C_WaitForSlotEvent - .as_ref() - .expect("Expected function, got error."))(flags, slot, pReserved) + .expect("Expected function, got error."))(slotID, pInfo) } pub unsafe fn C_GetMechanismList( &self, slotID: CK_SLOT_ID, - mechanism_list: *mut CK_MECHANISM_TYPE, - ulCount: *mut ::std::os::raw::c_ulong, + pMechanismList: CK_MECHANISM_TYPE_PTR, + pulCount: CK_ULONG_PTR, ) -> CK_RV { (self .C_GetMechanismList .as_ref() - .expect("Expected function, got error."))(slotID, mechanism_list, ulCount) + .expect("Expected function, got error."))(slotID, pMechanismList, pulCount) } pub unsafe fn C_GetMechanismInfo( &self, slotID: CK_SLOT_ID, type_: CK_MECHANISM_TYPE, - info: *mut _CK_MECHANISM_INFO, + pInfo: CK_MECHANISM_INFO_PTR, ) -> CK_RV { (self .C_GetMechanismInfo .as_ref() - .expect("Expected function, got error."))(slotID, type_, info) + .expect("Expected function, got error."))(slotID, type_, pInfo) } pub unsafe fn C_InitToken( &self, slotID: CK_SLOT_ID, - pin: *mut ::std::os::raw::c_uchar, - pin_len: ::std::os::raw::c_ulong, - label: *mut ::std::os::raw::c_uchar, + pPin: CK_UTF8CHAR_PTR, + ulPinLen: CK_ULONG, + pLabel: CK_UTF8CHAR_PTR, ) -> CK_RV { (self .C_InitToken .as_ref() - .expect("Expected function, got error."))(slotID, pin, pin_len, label) + .expect("Expected function, got error."))(slotID, pPin, ulPinLen, pLabel) } pub unsafe fn C_InitPIN( &self, - session: CK_SESSION_HANDLE, - pin: *mut ::std::os::raw::c_uchar, - pin_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pPin: CK_UTF8CHAR_PTR, + ulPinLen: CK_ULONG, ) -> CK_RV { (self .C_InitPIN .as_ref() - .expect("Expected function, got error."))(session, pin, pin_len) + .expect("Expected function, got error."))(hSession, pPin, ulPinLen) } pub unsafe fn C_SetPIN( &self, - session: CK_SESSION_HANDLE, - old_pin: *mut ::std::os::raw::c_uchar, - old_len: ::std::os::raw::c_ulong, - new_pin: *mut ::std::os::raw::c_uchar, - new_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pOldPin: CK_UTF8CHAR_PTR, + ulOldLen: CK_ULONG, + pNewPin: CK_UTF8CHAR_PTR, + ulNewLen: CK_ULONG, ) -> CK_RV { (self .C_SetPIN .as_ref() .expect("Expected function, got error."))( - session, old_pin, old_len, new_pin, new_len + hSession, pOldPin, ulOldLen, pNewPin, ulNewLen, ) } pub unsafe fn C_OpenSession( &self, slotID: CK_SLOT_ID, flags: CK_FLAGS, - application: *mut ::std::os::raw::c_void, - notify: CK_NOTIFY, - session: *mut CK_SESSION_HANDLE, + pApplication: CK_VOID_PTR, + Notify: CK_NOTIFY, + phSession: CK_SESSION_HANDLE_PTR, ) -> CK_RV { (self .C_OpenSession .as_ref() .expect("Expected function, got error."))( - slotID, flags, application, notify, session + slotID, + flags, + pApplication, + Notify, + phSession, ) } - pub unsafe fn C_CloseSession(&self, session: CK_SESSION_HANDLE) -> CK_RV { + pub unsafe fn C_CloseSession(&self, hSession: CK_SESSION_HANDLE) -> CK_RV { (self .C_CloseSession .as_ref() - .expect("Expected function, got error."))(session) + .expect("Expected function, got error."))(hSession) } pub unsafe fn C_CloseAllSessions(&self, slotID: CK_SLOT_ID) -> CK_RV { (self @@ -4344,723 +11584,1119 @@ impl Pkcs11 { } pub unsafe fn C_GetSessionInfo( &self, - session: CK_SESSION_HANDLE, - info: *mut _CK_SESSION_INFO, + hSession: CK_SESSION_HANDLE, + pInfo: CK_SESSION_INFO_PTR, ) -> CK_RV { (self .C_GetSessionInfo .as_ref() - .expect("Expected function, got error."))(session, info) + .expect("Expected function, got error."))(hSession, pInfo) } pub unsafe fn C_GetOperationState( &self, - session: CK_SESSION_HANDLE, - operation_state: *mut ::std::os::raw::c_uchar, - operation_state_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pOperationState: CK_BYTE_PTR, + pulOperationStateLen: CK_ULONG_PTR, ) -> CK_RV { (self .C_GetOperationState .as_ref() .expect("Expected function, got error."))( - session, operation_state, operation_state_len + hSession, + pOperationState, + pulOperationStateLen, ) } pub unsafe fn C_SetOperationState( &self, - session: CK_SESSION_HANDLE, - operation_state: *mut ::std::os::raw::c_uchar, - operation_state_len: ::std::os::raw::c_ulong, - encryption_key: CK_OBJECT_HANDLE, - authentiation_key: CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pOperationState: CK_BYTE_PTR, + ulOperationStateLen: CK_ULONG, + hEncryptionKey: CK_OBJECT_HANDLE, + hAuthenticationKey: CK_OBJECT_HANDLE, ) -> CK_RV { (self .C_SetOperationState .as_ref() .expect("Expected function, got error."))( - session, - operation_state, - operation_state_len, - encryption_key, - authentiation_key, + hSession, + pOperationState, + ulOperationStateLen, + hEncryptionKey, + hAuthenticationKey, ) } pub unsafe fn C_Login( &self, - session: CK_SESSION_HANDLE, - user_type: CK_USER_TYPE, - pin: *mut ::std::os::raw::c_uchar, - pin_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + userType: CK_USER_TYPE, + pPin: CK_UTF8CHAR_PTR, + ulPinLen: CK_ULONG, ) -> CK_RV { (self .C_Login .as_ref() - .expect("Expected function, got error."))(session, user_type, pin, pin_len) + .expect("Expected function, got error."))(hSession, userType, pPin, ulPinLen) } - pub unsafe fn C_Logout(&self, session: CK_SESSION_HANDLE) -> CK_RV { + pub unsafe fn C_Logout(&self, hSession: CK_SESSION_HANDLE) -> CK_RV { (self .C_Logout .as_ref() - .expect("Expected function, got error."))(session) + .expect("Expected function, got error."))(hSession) } pub unsafe fn C_CreateObject( &self, - session: CK_SESSION_HANDLE, - templ: *mut _CK_ATTRIBUTE, - ulCount: ::std::os::raw::c_ulong, - object: *mut CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pTemplate: CK_ATTRIBUTE_PTR, + ulCount: CK_ULONG, + phObject: CK_OBJECT_HANDLE_PTR, ) -> CK_RV { (self .C_CreateObject .as_ref() - .expect("Expected function, got error."))(session, templ, ulCount, object) + .expect("Expected function, got error."))(hSession, pTemplate, ulCount, phObject) } pub unsafe fn C_CopyObject( &self, - session: CK_SESSION_HANDLE, - object: CK_OBJECT_HANDLE, - templ: *mut _CK_ATTRIBUTE, - ulCount: ::std::os::raw::c_ulong, - new_object: *mut CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + hObject: CK_OBJECT_HANDLE, + pTemplate: CK_ATTRIBUTE_PTR, + ulCount: CK_ULONG, + phNewObject: CK_OBJECT_HANDLE_PTR, ) -> CK_RV { (self .C_CopyObject .as_ref() .expect("Expected function, got error."))( - session, object, templ, ulCount, new_object + hSession, + hObject, + pTemplate, + ulCount, + phNewObject, ) } pub unsafe fn C_DestroyObject( &self, - session: CK_SESSION_HANDLE, - object: CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + hObject: CK_OBJECT_HANDLE, ) -> CK_RV { (self .C_DestroyObject .as_ref() - .expect("Expected function, got error."))(session, object) + .expect("Expected function, got error."))(hSession, hObject) } pub unsafe fn C_GetObjectSize( &self, - session: CK_SESSION_HANDLE, - object: CK_OBJECT_HANDLE, - size: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + hObject: CK_OBJECT_HANDLE, + pulSize: CK_ULONG_PTR, ) -> CK_RV { (self .C_GetObjectSize .as_ref() - .expect("Expected function, got error."))(session, object, size) + .expect("Expected function, got error."))(hSession, hObject, pulSize) } pub unsafe fn C_GetAttributeValue( &self, - session: CK_SESSION_HANDLE, - object: CK_OBJECT_HANDLE, - templ: *mut _CK_ATTRIBUTE, - ulCount: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + hObject: CK_OBJECT_HANDLE, + pTemplate: CK_ATTRIBUTE_PTR, + ulCount: CK_ULONG, ) -> CK_RV { (self .C_GetAttributeValue .as_ref() - .expect("Expected function, got error."))(session, object, templ, ulCount) + .expect("Expected function, got error."))(hSession, hObject, pTemplate, ulCount) } pub unsafe fn C_SetAttributeValue( &self, - session: CK_SESSION_HANDLE, - object: CK_OBJECT_HANDLE, - templ: *mut _CK_ATTRIBUTE, - ulCount: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + hObject: CK_OBJECT_HANDLE, + pTemplate: CK_ATTRIBUTE_PTR, + ulCount: CK_ULONG, ) -> CK_RV { (self .C_SetAttributeValue .as_ref() - .expect("Expected function, got error."))(session, object, templ, ulCount) + .expect("Expected function, got error."))(hSession, hObject, pTemplate, ulCount) } pub unsafe fn C_FindObjectsInit( &self, - session: CK_SESSION_HANDLE, - templ: *mut _CK_ATTRIBUTE, - ulCount: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pTemplate: CK_ATTRIBUTE_PTR, + ulCount: CK_ULONG, ) -> CK_RV { (self .C_FindObjectsInit .as_ref() - .expect("Expected function, got error."))(session, templ, ulCount) + .expect("Expected function, got error."))(hSession, pTemplate, ulCount) } pub unsafe fn C_FindObjects( &self, - session: CK_SESSION_HANDLE, - object: *mut CK_OBJECT_HANDLE, - max_object_count: ::std::os::raw::c_ulong, - object_count: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + phObject: CK_OBJECT_HANDLE_PTR, + ulMaxObjectCount: CK_ULONG, + pulObjectCount: CK_ULONG_PTR, ) -> CK_RV { (self .C_FindObjects .as_ref() .expect("Expected function, got error."))( - session, - object, - max_object_count, - object_count, + hSession, + phObject, + ulMaxObjectCount, + pulObjectCount, ) } - pub unsafe fn C_FindObjectsFinal(&self, session: CK_SESSION_HANDLE) -> CK_RV { + pub unsafe fn C_FindObjectsFinal(&self, hSession: CK_SESSION_HANDLE) -> CK_RV { (self .C_FindObjectsFinal .as_ref() - .expect("Expected function, got error."))(session) + .expect("Expected function, got error."))(hSession) } pub unsafe fn C_EncryptInit( &self, - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - key: CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, ) -> CK_RV { (self .C_EncryptInit .as_ref() - .expect("Expected function, got error."))(session, mechanism, key) + .expect("Expected function, got error."))(hSession, pMechanism, hKey) } pub unsafe fn C_Encrypt( &self, - session: CK_SESSION_HANDLE, - data: *mut ::std::os::raw::c_uchar, - data_len: ::std::os::raw::c_ulong, - encrypted_data: *mut ::std::os::raw::c_uchar, - encrypted_data_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pEncryptedData: CK_BYTE_PTR, + pulEncryptedDataLen: CK_ULONG_PTR, ) -> CK_RV { (self .C_Encrypt .as_ref() .expect("Expected function, got error."))( - session, - data, - data_len, - encrypted_data, - encrypted_data_len, + hSession, + pData, + ulDataLen, + pEncryptedData, + pulEncryptedDataLen, ) } pub unsafe fn C_EncryptUpdate( &self, - session: CK_SESSION_HANDLE, - part: *mut ::std::os::raw::c_uchar, - part_len: ::std::os::raw::c_ulong, - encrypted_part: *mut ::std::os::raw::c_uchar, - encrypted_part_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pPart: CK_BYTE_PTR, + ulPartLen: CK_ULONG, + pEncryptedPart: CK_BYTE_PTR, + pulEncryptedPartLen: CK_ULONG_PTR, ) -> CK_RV { (self .C_EncryptUpdate .as_ref() .expect("Expected function, got error."))( - session, - part, - part_len, - encrypted_part, - encrypted_part_len, + hSession, + pPart, + ulPartLen, + pEncryptedPart, + pulEncryptedPartLen, ) } pub unsafe fn C_EncryptFinal( &self, - session: CK_SESSION_HANDLE, - last_encrypted_part: *mut ::std::os::raw::c_uchar, - last_encrypted_part_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pLastEncryptedPart: CK_BYTE_PTR, + pulLastEncryptedPartLen: CK_ULONG_PTR, ) -> CK_RV { (self .C_EncryptFinal .as_ref() .expect("Expected function, got error."))( - session, - last_encrypted_part, - last_encrypted_part_len, + hSession, + pLastEncryptedPart, + pulLastEncryptedPartLen, ) } pub unsafe fn C_DecryptInit( &self, - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - key: CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, ) -> CK_RV { (self .C_DecryptInit .as_ref() - .expect("Expected function, got error."))(session, mechanism, key) + .expect("Expected function, got error."))(hSession, pMechanism, hKey) } pub unsafe fn C_Decrypt( &self, - session: CK_SESSION_HANDLE, - encrypted_data: *mut ::std::os::raw::c_uchar, - encrypted_data_len: ::std::os::raw::c_ulong, - data: *mut ::std::os::raw::c_uchar, - data_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pEncryptedData: CK_BYTE_PTR, + ulEncryptedDataLen: CK_ULONG, + pData: CK_BYTE_PTR, + pulDataLen: CK_ULONG_PTR, ) -> CK_RV { (self .C_Decrypt .as_ref() .expect("Expected function, got error."))( - session, - encrypted_data, - encrypted_data_len, - data, - data_len, + hSession, + pEncryptedData, + ulEncryptedDataLen, + pData, + pulDataLen, ) } pub unsafe fn C_DecryptUpdate( &self, - session: CK_SESSION_HANDLE, - encrypted_part: *mut ::std::os::raw::c_uchar, - encrypted_part_len: ::std::os::raw::c_ulong, - part: *mut ::std::os::raw::c_uchar, - part_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pEncryptedPart: CK_BYTE_PTR, + ulEncryptedPartLen: CK_ULONG, + pPart: CK_BYTE_PTR, + pulPartLen: CK_ULONG_PTR, ) -> CK_RV { (self .C_DecryptUpdate .as_ref() .expect("Expected function, got error."))( - session, - encrypted_part, - encrypted_part_len, - part, - part_len, + hSession, + pEncryptedPart, + ulEncryptedPartLen, + pPart, + pulPartLen, ) } pub unsafe fn C_DecryptFinal( &self, - session: CK_SESSION_HANDLE, - last_part: *mut ::std::os::raw::c_uchar, - last_part_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pLastPart: CK_BYTE_PTR, + pulLastPartLen: CK_ULONG_PTR, ) -> CK_RV { (self .C_DecryptFinal .as_ref() - .expect("Expected function, got error."))(session, last_part, last_part_len) + .expect("Expected function, got error."))(hSession, pLastPart, pulLastPartLen) } pub unsafe fn C_DigestInit( &self, - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, ) -> CK_RV { (self .C_DigestInit .as_ref() - .expect("Expected function, got error."))(session, mechanism) + .expect("Expected function, got error."))(hSession, pMechanism) } pub unsafe fn C_Digest( &self, - session: CK_SESSION_HANDLE, - data: *mut ::std::os::raw::c_uchar, - data_len: ::std::os::raw::c_ulong, - digest: *mut ::std::os::raw::c_uchar, - digest_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pDigest: CK_BYTE_PTR, + pulDigestLen: CK_ULONG_PTR, ) -> CK_RV { (self .C_Digest .as_ref() .expect("Expected function, got error."))( - session, data, data_len, digest, digest_len + hSession, + pData, + ulDataLen, + pDigest, + pulDigestLen, ) } pub unsafe fn C_DigestUpdate( &self, - session: CK_SESSION_HANDLE, - part: *mut ::std::os::raw::c_uchar, - part_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pPart: CK_BYTE_PTR, + ulPartLen: CK_ULONG, ) -> CK_RV { (self .C_DigestUpdate .as_ref() - .expect("Expected function, got error."))(session, part, part_len) + .expect("Expected function, got error."))(hSession, pPart, ulPartLen) } - pub unsafe fn C_DigestKey(&self, session: CK_SESSION_HANDLE, key: CK_OBJECT_HANDLE) -> CK_RV { + pub unsafe fn C_DigestKey(&self, hSession: CK_SESSION_HANDLE, hKey: CK_OBJECT_HANDLE) -> CK_RV { (self .C_DigestKey .as_ref() - .expect("Expected function, got error."))(session, key) + .expect("Expected function, got error."))(hSession, hKey) } pub unsafe fn C_DigestFinal( &self, - session: CK_SESSION_HANDLE, - digest: *mut ::std::os::raw::c_uchar, - digest_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pDigest: CK_BYTE_PTR, + pulDigestLen: CK_ULONG_PTR, ) -> CK_RV { (self .C_DigestFinal .as_ref() - .expect("Expected function, got error."))(session, digest, digest_len) + .expect("Expected function, got error."))(hSession, pDigest, pulDigestLen) } pub unsafe fn C_SignInit( &self, - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - key: CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, ) -> CK_RV { (self .C_SignInit .as_ref() - .expect("Expected function, got error."))(session, mechanism, key) + .expect("Expected function, got error."))(hSession, pMechanism, hKey) } pub unsafe fn C_Sign( &self, - session: CK_SESSION_HANDLE, - data: *mut ::std::os::raw::c_uchar, - data_len: ::std::os::raw::c_ulong, - signature: *mut ::std::os::raw::c_uchar, - signature_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + pulSignatureLen: CK_ULONG_PTR, ) -> CK_RV { (self.C_Sign.as_ref().expect("Expected function, got error."))( - session, - data, - data_len, - signature, - signature_len, + hSession, + pData, + ulDataLen, + pSignature, + pulSignatureLen, ) } pub unsafe fn C_SignUpdate( &self, - session: CK_SESSION_HANDLE, - part: *mut ::std::os::raw::c_uchar, - part_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pPart: CK_BYTE_PTR, + ulPartLen: CK_ULONG, ) -> CK_RV { (self .C_SignUpdate .as_ref() - .expect("Expected function, got error."))(session, part, part_len) + .expect("Expected function, got error."))(hSession, pPart, ulPartLen) } pub unsafe fn C_SignFinal( &self, - session: CK_SESSION_HANDLE, - signature: *mut ::std::os::raw::c_uchar, - signature_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pSignature: CK_BYTE_PTR, + pulSignatureLen: CK_ULONG_PTR, ) -> CK_RV { (self .C_SignFinal .as_ref() - .expect("Expected function, got error."))(session, signature, signature_len) + .expect("Expected function, got error."))(hSession, pSignature, pulSignatureLen) } pub unsafe fn C_SignRecoverInit( &self, - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - key: CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, ) -> CK_RV { (self .C_SignRecoverInit .as_ref() - .expect("Expected function, got error."))(session, mechanism, key) + .expect("Expected function, got error."))(hSession, pMechanism, hKey) } pub unsafe fn C_SignRecover( &self, - session: CK_SESSION_HANDLE, - data: *mut ::std::os::raw::c_uchar, - data_len: ::std::os::raw::c_ulong, - signature: *mut ::std::os::raw::c_uchar, - signature_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + pulSignatureLen: CK_ULONG_PTR, ) -> CK_RV { (self .C_SignRecover .as_ref() .expect("Expected function, got error."))( - session, - data, - data_len, - signature, - signature_len, + hSession, + pData, + ulDataLen, + pSignature, + pulSignatureLen, ) } pub unsafe fn C_VerifyInit( &self, - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - key: CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, ) -> CK_RV { (self .C_VerifyInit .as_ref() - .expect("Expected function, got error."))(session, mechanism, key) + .expect("Expected function, got error."))(hSession, pMechanism, hKey) } pub unsafe fn C_Verify( &self, - session: CK_SESSION_HANDLE, - data: *mut ::std::os::raw::c_uchar, - data_len: ::std::os::raw::c_ulong, - signature: *mut ::std::os::raw::c_uchar, - signature_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + ulSignatureLen: CK_ULONG, ) -> CK_RV { (self .C_Verify .as_ref() .expect("Expected function, got error."))( - session, - data, - data_len, - signature, - signature_len, + hSession, + pData, + ulDataLen, + pSignature, + ulSignatureLen, ) } pub unsafe fn C_VerifyUpdate( &self, - session: CK_SESSION_HANDLE, - part: *mut ::std::os::raw::c_uchar, - part_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pPart: CK_BYTE_PTR, + ulPartLen: CK_ULONG, ) -> CK_RV { (self .C_VerifyUpdate .as_ref() - .expect("Expected function, got error."))(session, part, part_len) + .expect("Expected function, got error."))(hSession, pPart, ulPartLen) } pub unsafe fn C_VerifyFinal( &self, - session: CK_SESSION_HANDLE, - signature: *mut ::std::os::raw::c_uchar, - signature_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pSignature: CK_BYTE_PTR, + ulSignatureLen: CK_ULONG, ) -> CK_RV { (self .C_VerifyFinal .as_ref() - .expect("Expected function, got error."))(session, signature, signature_len) + .expect("Expected function, got error."))(hSession, pSignature, ulSignatureLen) } pub unsafe fn C_VerifyRecoverInit( &self, - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - key: CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, ) -> CK_RV { (self .C_VerifyRecoverInit .as_ref() - .expect("Expected function, got error."))(session, mechanism, key) + .expect("Expected function, got error."))(hSession, pMechanism, hKey) } pub unsafe fn C_VerifyRecover( &self, - session: CK_SESSION_HANDLE, - signature: *mut ::std::os::raw::c_uchar, - signature_len: ::std::os::raw::c_ulong, - data: *mut ::std::os::raw::c_uchar, - data_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pSignature: CK_BYTE_PTR, + ulSignatureLen: CK_ULONG, + pData: CK_BYTE_PTR, + pulDataLen: CK_ULONG_PTR, ) -> CK_RV { (self .C_VerifyRecover .as_ref() .expect("Expected function, got error."))( - session, - signature, - signature_len, - data, - data_len, + hSession, + pSignature, + ulSignatureLen, + pData, + pulDataLen, ) } pub unsafe fn C_DigestEncryptUpdate( &self, - session: CK_SESSION_HANDLE, - part: *mut ::std::os::raw::c_uchar, - part_len: ::std::os::raw::c_ulong, - encrypted_part: *mut ::std::os::raw::c_uchar, - encrypted_part_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pPart: CK_BYTE_PTR, + ulPartLen: CK_ULONG, + pEncryptedPart: CK_BYTE_PTR, + pulEncryptedPartLen: CK_ULONG_PTR, ) -> CK_RV { (self .C_DigestEncryptUpdate .as_ref() .expect("Expected function, got error."))( - session, - part, - part_len, - encrypted_part, - encrypted_part_len, + hSession, + pPart, + ulPartLen, + pEncryptedPart, + pulEncryptedPartLen, ) } pub unsafe fn C_DecryptDigestUpdate( &self, - session: CK_SESSION_HANDLE, - encrypted_part: *mut ::std::os::raw::c_uchar, - encrypted_part_len: ::std::os::raw::c_ulong, - part: *mut ::std::os::raw::c_uchar, - part_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pEncryptedPart: CK_BYTE_PTR, + ulEncryptedPartLen: CK_ULONG, + pPart: CK_BYTE_PTR, + pulPartLen: CK_ULONG_PTR, ) -> CK_RV { (self .C_DecryptDigestUpdate .as_ref() .expect("Expected function, got error."))( - session, - encrypted_part, - encrypted_part_len, - part, - part_len, + hSession, + pEncryptedPart, + ulEncryptedPartLen, + pPart, + pulPartLen, ) } pub unsafe fn C_SignEncryptUpdate( &self, - session: CK_SESSION_HANDLE, - part: *mut ::std::os::raw::c_uchar, - part_len: ::std::os::raw::c_ulong, - encrypted_part: *mut ::std::os::raw::c_uchar, - encrypted_part_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pPart: CK_BYTE_PTR, + ulPartLen: CK_ULONG, + pEncryptedPart: CK_BYTE_PTR, + pulEncryptedPartLen: CK_ULONG_PTR, ) -> CK_RV { (self .C_SignEncryptUpdate .as_ref() .expect("Expected function, got error."))( - session, - part, - part_len, - encrypted_part, - encrypted_part_len, + hSession, + pPart, + ulPartLen, + pEncryptedPart, + pulEncryptedPartLen, ) } pub unsafe fn C_DecryptVerifyUpdate( &self, - session: CK_SESSION_HANDLE, - encrypted_part: *mut ::std::os::raw::c_uchar, - encrypted_part_len: ::std::os::raw::c_ulong, - part: *mut ::std::os::raw::c_uchar, - part_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pEncryptedPart: CK_BYTE_PTR, + ulEncryptedPartLen: CK_ULONG, + pPart: CK_BYTE_PTR, + pulPartLen: CK_ULONG_PTR, ) -> CK_RV { (self .C_DecryptVerifyUpdate .as_ref() .expect("Expected function, got error."))( - session, - encrypted_part, - encrypted_part_len, - part, - part_len, + hSession, + pEncryptedPart, + ulEncryptedPartLen, + pPart, + pulPartLen, ) } pub unsafe fn C_GenerateKey( &self, - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - templ: *mut _CK_ATTRIBUTE, - ulCount: ::std::os::raw::c_ulong, - key: *mut CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + pTemplate: CK_ATTRIBUTE_PTR, + ulCount: CK_ULONG, + phKey: CK_OBJECT_HANDLE_PTR, ) -> CK_RV { (self .C_GenerateKey .as_ref() .expect("Expected function, got error."))( - session, mechanism, templ, ulCount, key + hSession, pMechanism, pTemplate, ulCount, phKey, ) } pub unsafe fn C_GenerateKeyPair( &self, - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - public_key_template: *mut _CK_ATTRIBUTE, - public_key_attribute_count: ::std::os::raw::c_ulong, - private_key_template: *mut _CK_ATTRIBUTE, - private_key_attribute_count: ::std::os::raw::c_ulong, - public_key: *mut CK_OBJECT_HANDLE, - private_key: *mut CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + pPublicKeyTemplate: CK_ATTRIBUTE_PTR, + ulPublicKeyAttributeCount: CK_ULONG, + pPrivateKeyTemplate: CK_ATTRIBUTE_PTR, + ulPrivateKeyAttributeCount: CK_ULONG, + phPublicKey: CK_OBJECT_HANDLE_PTR, + phPrivateKey: CK_OBJECT_HANDLE_PTR, ) -> CK_RV { (self .C_GenerateKeyPair .as_ref() .expect("Expected function, got error."))( - session, - mechanism, - public_key_template, - public_key_attribute_count, - private_key_template, - private_key_attribute_count, - public_key, - private_key, + hSession, + pMechanism, + pPublicKeyTemplate, + ulPublicKeyAttributeCount, + pPrivateKeyTemplate, + ulPrivateKeyAttributeCount, + phPublicKey, + phPrivateKey, ) } pub unsafe fn C_WrapKey( &self, - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - wrapping_key: CK_OBJECT_HANDLE, - key: CK_OBJECT_HANDLE, - wrapped_key: *mut ::std::os::raw::c_uchar, - wrapped_key_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hWrappingKey: CK_OBJECT_HANDLE, + hKey: CK_OBJECT_HANDLE, + pWrappedKey: CK_BYTE_PTR, + pulWrappedKeyLen: CK_ULONG_PTR, ) -> CK_RV { (self .C_WrapKey .as_ref() .expect("Expected function, got error."))( - session, - mechanism, - wrapping_key, - key, - wrapped_key, - wrapped_key_len, + hSession, + pMechanism, + hWrappingKey, + hKey, + pWrappedKey, + pulWrappedKeyLen, ) } pub unsafe fn C_UnwrapKey( &self, - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - unwrapping_key: CK_OBJECT_HANDLE, - wrapped_key: *mut ::std::os::raw::c_uchar, - wrapped_key_len: ::std::os::raw::c_ulong, - templ: *mut _CK_ATTRIBUTE, - attribute_count: ::std::os::raw::c_ulong, - key: *mut CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hUnwrappingKey: CK_OBJECT_HANDLE, + pWrappedKey: CK_BYTE_PTR, + ulWrappedKeyLen: CK_ULONG, + pTemplate: CK_ATTRIBUTE_PTR, + ulAttributeCount: CK_ULONG, + phKey: CK_OBJECT_HANDLE_PTR, ) -> CK_RV { (self .C_UnwrapKey .as_ref() .expect("Expected function, got error."))( - session, - mechanism, - unwrapping_key, - wrapped_key, - wrapped_key_len, - templ, - attribute_count, - key, + hSession, + pMechanism, + hUnwrappingKey, + pWrappedKey, + ulWrappedKeyLen, + pTemplate, + ulAttributeCount, + phKey, ) } pub unsafe fn C_DeriveKey( &self, - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - base_key: CK_OBJECT_HANDLE, - templ: *mut _CK_ATTRIBUTE, - attribute_count: ::std::os::raw::c_ulong, - key: *mut CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hBaseKey: CK_OBJECT_HANDLE, + pTemplate: CK_ATTRIBUTE_PTR, + ulAttributeCount: CK_ULONG, + phKey: CK_OBJECT_HANDLE_PTR, ) -> CK_RV { (self .C_DeriveKey .as_ref() .expect("Expected function, got error."))( - session, - mechanism, - base_key, - templ, - attribute_count, - key, + hSession, + pMechanism, + hBaseKey, + pTemplate, + ulAttributeCount, + phKey, ) } pub unsafe fn C_SeedRandom( &self, - session: CK_SESSION_HANDLE, - seed: *mut ::std::os::raw::c_uchar, - seed_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pSeed: CK_BYTE_PTR, + ulSeedLen: CK_ULONG, ) -> CK_RV { (self .C_SeedRandom .as_ref() - .expect("Expected function, got error."))(session, seed, seed_len) + .expect("Expected function, got error."))(hSession, pSeed, ulSeedLen) } pub unsafe fn C_GenerateRandom( &self, - session: CK_SESSION_HANDLE, - random_data: *mut ::std::os::raw::c_uchar, - random_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + RandomData: CK_BYTE_PTR, + ulRandomLen: CK_ULONG, ) -> CK_RV { (self .C_GenerateRandom .as_ref() - .expect("Expected function, got error."))(session, random_data, random_len) + .expect("Expected function, got error."))(hSession, RandomData, ulRandomLen) } - pub unsafe fn C_GetFunctionStatus(&self, session: CK_SESSION_HANDLE) -> CK_RV { + pub unsafe fn C_GetFunctionStatus(&self, hSession: CK_SESSION_HANDLE) -> CK_RV { (self .C_GetFunctionStatus .as_ref() - .expect("Expected function, got error."))(session) + .expect("Expected function, got error."))(hSession) } - pub unsafe fn C_CancelFunction(&self, session: CK_SESSION_HANDLE) -> CK_RV { + pub unsafe fn C_CancelFunction(&self, hSession: CK_SESSION_HANDLE) -> CK_RV { (self .C_CancelFunction .as_ref() - .expect("Expected function, got error."))(session) + .expect("Expected function, got error."))(hSession) + } + pub unsafe fn C_WaitForSlotEvent( + &self, + flags: CK_FLAGS, + pSlot: CK_SLOT_ID_PTR, + pRserved: CK_VOID_PTR, + ) -> CK_RV { + (self + .C_WaitForSlotEvent + .as_ref() + .expect("Expected function, got error."))(flags, pSlot, pRserved) + } + pub unsafe fn C_GetInterfaceList( + &self, + pInterfacesList: CK_INTERFACE_PTR, + pulCount: CK_ULONG_PTR, + ) -> CK_RV { + (self + .C_GetInterfaceList + .as_ref() + .expect("Expected function, got error."))(pInterfacesList, pulCount) + } + pub unsafe fn C_GetInterface( + &self, + pInterfaceName: CK_UTF8CHAR_PTR, + pVersion: CK_VERSION_PTR, + ppInterface: CK_INTERFACE_PTR_PTR, + flags: CK_FLAGS, + ) -> CK_RV { + (self + .C_GetInterface + .as_ref() + .expect("Expected function, got error."))( + pInterfaceName, pVersion, ppInterface, flags + ) + } + pub unsafe fn C_LoginUser( + &self, + hSession: CK_SESSION_HANDLE, + userType: CK_USER_TYPE, + pPin: CK_UTF8CHAR_PTR, + ulPinLen: CK_ULONG, + pUsername: CK_UTF8CHAR_PTR, + ulUsernameLen: CK_ULONG, + ) -> CK_RV { + (self + .C_LoginUser + .as_ref() + .expect("Expected function, got error."))( + hSession, + userType, + pPin, + ulPinLen, + pUsername, + ulUsernameLen, + ) + } + pub unsafe fn C_SessionCancel(&self, hSession: CK_SESSION_HANDLE, flags: CK_FLAGS) -> CK_RV { + (self + .C_SessionCancel + .as_ref() + .expect("Expected function, got error."))(hSession, flags) + } + pub unsafe fn C_MessageEncryptInit( + &self, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, + ) -> CK_RV { + (self + .C_MessageEncryptInit + .as_ref() + .expect("Expected function, got error."))(hSession, pMechanism, hKey) + } + pub unsafe fn C_EncryptMessage( + &self, + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pAssociatedData: CK_BYTE_PTR, + ulAssociatedDataLen: CK_ULONG, + pPlaintext: CK_BYTE_PTR, + ulPlaintextLen: CK_ULONG, + pCiphertext: CK_BYTE_PTR, + pulCiphertextLen: CK_ULONG_PTR, + ) -> CK_RV { + (self + .C_EncryptMessage + .as_ref() + .expect("Expected function, got error."))( + hSession, + pParameter, + ulParameterLen, + pAssociatedData, + ulAssociatedDataLen, + pPlaintext, + ulPlaintextLen, + pCiphertext, + pulCiphertextLen, + ) + } + pub unsafe fn C_EncryptMessageBegin( + &self, + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pAssociatedData: CK_BYTE_PTR, + ulAssociatedDataLen: CK_ULONG, + ) -> CK_RV { + (self + .C_EncryptMessageBegin + .as_ref() + .expect("Expected function, got error."))( + hSession, + pParameter, + ulParameterLen, + pAssociatedData, + ulAssociatedDataLen, + ) + } + pub unsafe fn C_EncryptMessageNext( + &self, + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pPlaintextPart: CK_BYTE_PTR, + ulPlaintextPartLen: CK_ULONG, + pCiphertextPart: CK_BYTE_PTR, + pulCiphertextPartLen: CK_ULONG_PTR, + flags: CK_FLAGS, + ) -> CK_RV { + (self + .C_EncryptMessageNext + .as_ref() + .expect("Expected function, got error."))( + hSession, + pParameter, + ulParameterLen, + pPlaintextPart, + ulPlaintextPartLen, + pCiphertextPart, + pulCiphertextPartLen, + flags, + ) + } + pub unsafe fn C_MessageEncryptFinal(&self, hSession: CK_SESSION_HANDLE) -> CK_RV { + (self + .C_MessageEncryptFinal + .as_ref() + .expect("Expected function, got error."))(hSession) + } + pub unsafe fn C_MessageDecryptInit( + &self, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, + ) -> CK_RV { + (self + .C_MessageDecryptInit + .as_ref() + .expect("Expected function, got error."))(hSession, pMechanism, hKey) + } + pub unsafe fn C_DecryptMessage( + &self, + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pAssociatedData: CK_BYTE_PTR, + ulAssociatedDataLen: CK_ULONG, + pCiphertext: CK_BYTE_PTR, + ulCiphertextLen: CK_ULONG, + pPlaintext: CK_BYTE_PTR, + pulPlaintextLen: CK_ULONG_PTR, + ) -> CK_RV { + (self + .C_DecryptMessage + .as_ref() + .expect("Expected function, got error."))( + hSession, + pParameter, + ulParameterLen, + pAssociatedData, + ulAssociatedDataLen, + pCiphertext, + ulCiphertextLen, + pPlaintext, + pulPlaintextLen, + ) + } + pub unsafe fn C_DecryptMessageBegin( + &self, + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pAssociatedData: CK_BYTE_PTR, + ulAssociatedDataLen: CK_ULONG, + ) -> CK_RV { + (self + .C_DecryptMessageBegin + .as_ref() + .expect("Expected function, got error."))( + hSession, + pParameter, + ulParameterLen, + pAssociatedData, + ulAssociatedDataLen, + ) + } + pub unsafe fn C_DecryptMessageNext( + &self, + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pCiphertext: CK_BYTE_PTR, + ulCiphertextLen: CK_ULONG, + pPlaintext: CK_BYTE_PTR, + pulPlaintextLen: CK_ULONG_PTR, + flags: CK_FLAGS, + ) -> CK_RV { + (self + .C_DecryptMessageNext + .as_ref() + .expect("Expected function, got error."))( + hSession, + pParameter, + ulParameterLen, + pCiphertext, + ulCiphertextLen, + pPlaintext, + pulPlaintextLen, + flags, + ) + } + pub unsafe fn C_MessageDecryptFinal(&self, hSession: CK_SESSION_HANDLE) -> CK_RV { + (self + .C_MessageDecryptFinal + .as_ref() + .expect("Expected function, got error."))(hSession) + } + pub unsafe fn C_MessageSignInit( + &self, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, + ) -> CK_RV { + (self + .C_MessageSignInit + .as_ref() + .expect("Expected function, got error."))(hSession, pMechanism, hKey) + } + pub unsafe fn C_SignMessage( + &self, + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + pulSignatureLen: CK_ULONG_PTR, + ) -> CK_RV { + (self + .C_SignMessage + .as_ref() + .expect("Expected function, got error."))( + hSession, + pParameter, + ulParameterLen, + pData, + ulDataLen, + pSignature, + pulSignatureLen, + ) + } + pub unsafe fn C_SignMessageBegin( + &self, + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + ) -> CK_RV { + (self + .C_SignMessageBegin + .as_ref() + .expect("Expected function, got error."))(hSession, pParameter, ulParameterLen) + } + pub unsafe fn C_SignMessageNext( + &self, + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + pulSignatureLen: CK_ULONG_PTR, + ) -> CK_RV { + (self + .C_SignMessageNext + .as_ref() + .expect("Expected function, got error."))( + hSession, + pParameter, + ulParameterLen, + pData, + ulDataLen, + pSignature, + pulSignatureLen, + ) + } + pub unsafe fn C_MessageSignFinal(&self, hSession: CK_SESSION_HANDLE) -> CK_RV { + (self + .C_MessageSignFinal + .as_ref() + .expect("Expected function, got error."))(hSession) + } + pub unsafe fn C_MessageVerifyInit( + &self, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, + ) -> CK_RV { + (self + .C_MessageVerifyInit + .as_ref() + .expect("Expected function, got error."))(hSession, pMechanism, hKey) + } + pub unsafe fn C_VerifyMessage( + &self, + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + ulSignatureLen: CK_ULONG, + ) -> CK_RV { + (self + .C_VerifyMessage + .as_ref() + .expect("Expected function, got error."))( + hSession, + pParameter, + ulParameterLen, + pData, + ulDataLen, + pSignature, + ulSignatureLen, + ) + } + pub unsafe fn C_VerifyMessageBegin( + &self, + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + ) -> CK_RV { + (self + .C_VerifyMessageBegin + .as_ref() + .expect("Expected function, got error."))(hSession, pParameter, ulParameterLen) + } + pub unsafe fn C_VerifyMessageNext( + &self, + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + ulSignatureLen: CK_ULONG, + ) -> CK_RV { + (self + .C_VerifyMessageNext + .as_ref() + .expect("Expected function, got error."))( + hSession, + pParameter, + ulParameterLen, + pData, + ulDataLen, + pSignature, + ulSignatureLen, + ) + } + pub unsafe fn C_MessageVerifyFinal(&self, hSession: CK_SESSION_HANDLE) -> CK_RV { + (self + .C_MessageVerifyFinal + .as_ref() + .expect("Expected function, got error."))(hSession) } } diff --git a/cryptoki-sys/src/bindings/x86_64-unknown-linux-gnu.rs b/cryptoki-sys/src/bindings/x86_64-unknown-linux-gnu.rs index 6800365c..c4200fb4 100644 --- a/cryptoki-sys/src/bindings/x86_64-unknown-linux-gnu.rs +++ b/cryptoki-sys/src/bindings/x86_64-unknown-linux-gnu.rs @@ -1,10 +1,22 @@ /* automatically generated by rust-bindgen 0.63.0 */ -pub const PKCS11_H: u32 = 1; -pub const CRYPTOKI_VERSION_MAJOR: CK_BYTE = 2; -pub const CRYPTOKI_VERSION_MINOR: CK_BYTE = 40; -pub const P11_KIT_CRYPTOKI_VERSION_REVISION: u32 = 0; -pub const CRYPTOKI_COMPAT: u32 = 1; +pub const NULL_PTR: u32 = 0; +pub const _PKCS11_H_: u32 = 1; +pub const _PKCS11T_H_: u32 = 1; +pub const CRYPTOKI_VERSION_MAJOR: CK_BYTE = 3; +pub const CRYPTOKI_VERSION_MINOR: CK_BYTE = 0; +pub const CRYPTOKI_VERSION_AMENDMENT: CK_BYTE = 0; +pub const CK_TRUE: CK_BBOOL = 1; +pub const CK_FALSE: CK_BBOOL = 0; +pub const FALSE: u32 = 0; +pub const TRUE: u32 = 1; +pub const CK_EFFECTIVELY_INFINITE: CK_ULONG = 0; +pub const CK_INVALID_HANDLE: CK_ULONG = 0; +pub const CKN_SURRENDER: CK_NOTIFICATION = 0; +pub const CKN_OTP_CHANGED: CK_NOTIFICATION = 1; +pub const CKF_TOKEN_PRESENT: CK_FLAGS = 1; +pub const CKF_REMOVABLE_DEVICE: CK_FLAGS = 2; +pub const CKF_HW_SLOT: CK_FLAGS = 4; pub const CKF_RNG: CK_FLAGS = 1; pub const CKF_WRITE_PROTECTED: CK_FLAGS = 2; pub const CKF_LOGIN_REQUIRED: CK_FLAGS = 4; @@ -24,8 +36,6 @@ pub const CKF_SO_PIN_FINAL_TRY: CK_FLAGS = 2097152; pub const CKF_SO_PIN_LOCKED: CK_FLAGS = 4194304; pub const CKF_SO_PIN_TO_BE_CHANGED: CK_FLAGS = 8388608; pub const CKF_ERROR_STATE: CK_FLAGS = 16777216; -pub const CK_EFFECTIVELY_INFINITE: CK_ULONG = 0; -pub const CK_INVALID_HANDLE: CK_ULONG = 0; pub const CKU_SO: CK_USER_TYPE = 0; pub const CKU_USER: CK_USER_TYPE = 1; pub const CKU_CONTEXT_SPECIFIC: CK_USER_TYPE = 2; @@ -45,9 +55,18 @@ pub const CKO_HW_FEATURE: CK_OBJECT_CLASS = 5; pub const CKO_DOMAIN_PARAMETERS: CK_OBJECT_CLASS = 6; pub const CKO_MECHANISM: CK_OBJECT_CLASS = 7; pub const CKO_OTP_KEY: CK_OBJECT_CLASS = 8; +pub const CKO_PROFILE: CK_OBJECT_CLASS = 9; +pub const CKO_VENDOR_DEFINED: CK_OBJECT_CLASS = 2147483648; +pub const CKP_INVALID_ID: CK_PROFILE_ID = 0; +pub const CKP_BASELINE_PROVIDER: CK_PROFILE_ID = 1; +pub const CKP_EXTENDED_PROVIDER: CK_PROFILE_ID = 2; +pub const CKP_AUTHENTICATION_TOKEN: CK_PROFILE_ID = 3; +pub const CKP_PUBLIC_CERTIFICATES_TOKEN: CK_PROFILE_ID = 4; +pub const CKP_VENDOR_DEFINED: CK_PROFILE_ID = 2147483648; pub const CKH_MONOTONIC_COUNTER: CK_HW_FEATURE_TYPE = 1; pub const CKH_CLOCK: CK_HW_FEATURE_TYPE = 2; pub const CKH_USER_INTERFACE: CK_HW_FEATURE_TYPE = 3; +pub const CKH_VENDOR_DEFINED: CK_HW_FEATURE_TYPE = 2147483648; pub const CKK_RSA: CK_KEY_TYPE = 0; pub const CKK_DSA: CK_KEY_TYPE = 1; pub const CKK_DH: CK_KEY_TYPE = 2; @@ -63,6 +82,7 @@ pub const CKK_DES2: CK_KEY_TYPE = 20; pub const CKK_DES3: CK_KEY_TYPE = 21; pub const CKK_CAST: CK_KEY_TYPE = 22; pub const CKK_CAST3: CK_KEY_TYPE = 23; +pub const CKK_CAST5: CK_KEY_TYPE = 24; pub const CKK_CAST128: CK_KEY_TYPE = 24; pub const CKK_RC5: CK_KEY_TYPE = 25; pub const CKK_IDEA: CK_KEY_TYPE = 26; @@ -90,14 +110,48 @@ pub const CKK_SEED: CK_KEY_TYPE = 47; pub const CKK_GOSTR3410: CK_KEY_TYPE = 48; pub const CKK_GOSTR3411: CK_KEY_TYPE = 49; pub const CKK_GOST28147: CK_KEY_TYPE = 50; +pub const CKK_CHACHA20: CK_KEY_TYPE = 51; +pub const CKK_POLY1305: CK_KEY_TYPE = 52; +pub const CKK_AES_XTS: CK_KEY_TYPE = 53; +pub const CKK_SHA3_224_HMAC: CK_KEY_TYPE = 54; +pub const CKK_SHA3_256_HMAC: CK_KEY_TYPE = 55; +pub const CKK_SHA3_384_HMAC: CK_KEY_TYPE = 56; +pub const CKK_SHA3_512_HMAC: CK_KEY_TYPE = 57; +pub const CKK_BLAKE2B_160_HMAC: CK_KEY_TYPE = 58; +pub const CKK_BLAKE2B_256_HMAC: CK_KEY_TYPE = 59; +pub const CKK_BLAKE2B_384_HMAC: CK_KEY_TYPE = 60; +pub const CKK_BLAKE2B_512_HMAC: CK_KEY_TYPE = 61; +pub const CKK_SALSA20: CK_KEY_TYPE = 62; +pub const CKK_X2RATCHET: CK_KEY_TYPE = 63; pub const CKK_EC_EDWARDS: CK_KEY_TYPE = 64; +pub const CKK_EC_MONTGOMERY: CK_KEY_TYPE = 65; +pub const CKK_HKDF: CK_KEY_TYPE = 66; +pub const CKK_VENDOR_DEFINED: CK_KEY_TYPE = 2147483648; +pub const CK_CERTIFICATE_CATEGORY_UNSPECIFIED: CK_ULONG = 0; +pub const CK_CERTIFICATE_CATEGORY_TOKEN_USER: CK_ULONG = 1; +pub const CK_CERTIFICATE_CATEGORY_AUTHORITY: CK_ULONG = 2; +pub const CK_CERTIFICATE_CATEGORY_OTHER_ENTITY: CK_ULONG = 3; +pub const CK_SECURITY_DOMAIN_UNSPECIFIED: CK_ULONG = 0; +pub const CK_SECURITY_DOMAIN_MANUFACTURER: CK_ULONG = 1; +pub const CK_SECURITY_DOMAIN_OPERATOR: CK_ULONG = 2; +pub const CK_SECURITY_DOMAIN_THIRD_PARTY: CK_ULONG = 3; pub const CKC_X_509: CK_CERTIFICATE_TYPE = 0; pub const CKC_X_509_ATTR_CERT: CK_CERTIFICATE_TYPE = 1; pub const CKC_WTLS: CK_CERTIFICATE_TYPE = 2; +pub const CKC_VENDOR_DEFINED: CK_CERTIFICATE_TYPE = 2147483648; +pub const CKF_ARRAY_ATTRIBUTE: CK_FLAGS = 1073741824; +pub const CK_OTP_FORMAT_DECIMAL: CK_ULONG = 0; +pub const CK_OTP_FORMAT_HEXADECIMAL: CK_ULONG = 1; +pub const CK_OTP_FORMAT_ALPHANUMERIC: CK_ULONG = 2; +pub const CK_OTP_FORMAT_BINARY: CK_ULONG = 3; +pub const CK_OTP_PARAM_IGNORED: CK_ULONG = 0; +pub const CK_OTP_PARAM_OPTIONAL: CK_ULONG = 1; +pub const CK_OTP_PARAM_MANDATORY: CK_ULONG = 2; pub const CKA_CLASS: CK_ATTRIBUTE_TYPE = 0; pub const CKA_TOKEN: CK_ATTRIBUTE_TYPE = 1; pub const CKA_PRIVATE: CK_ATTRIBUTE_TYPE = 2; pub const CKA_LABEL: CK_ATTRIBUTE_TYPE = 3; +pub const CKA_UNIQUE_ID: CK_ATTRIBUTE_TYPE = 4; pub const CKA_APPLICATION: CK_ATTRIBUTE_TYPE = 16; pub const CKA_VALUE: CK_ATTRIBUTE_TYPE = 17; pub const CKA_OBJECT_ID: CK_ATTRIBUTE_TYPE = 18; @@ -144,6 +198,7 @@ pub const CKA_PRIME: CK_ATTRIBUTE_TYPE = 304; pub const CKA_SUBPRIME: CK_ATTRIBUTE_TYPE = 305; pub const CKA_BASE: CK_ATTRIBUTE_TYPE = 306; pub const CKA_PRIME_BITS: CK_ATTRIBUTE_TYPE = 307; +pub const CKA_SUBPRIME_BITS: CK_ATTRIBUTE_TYPE = 308; pub const CKA_SUB_PRIME_BITS: CK_ATTRIBUTE_TYPE = 308; pub const CKA_VALUE_BITS: CK_ATTRIBUTE_TYPE = 352; pub const CKA_VALUE_LEN: CK_ATTRIBUTE_TYPE = 353; @@ -162,6 +217,9 @@ pub const CKA_SECONDARY_AUTH: CK_ATTRIBUTE_TYPE = 512; pub const CKA_AUTH_PIN_FLAGS: CK_ATTRIBUTE_TYPE = 513; pub const CKA_ALWAYS_AUTHENTICATE: CK_ATTRIBUTE_TYPE = 514; pub const CKA_WRAP_WITH_TRUSTED: CK_ATTRIBUTE_TYPE = 528; +pub const CKA_WRAP_TEMPLATE: CK_ATTRIBUTE_TYPE = 1073742353; +pub const CKA_UNWRAP_TEMPLATE: CK_ATTRIBUTE_TYPE = 1073742354; +pub const CKA_DERIVE_TEMPLATE: CK_ATTRIBUTE_TYPE = 1073742355; pub const CKA_OTP_FORMAT: CK_ATTRIBUTE_TYPE = 544; pub const CKA_OTP_LENGTH: CK_ATTRIBUTE_TYPE = 545; pub const CKA_OTP_TIME_INTERVAL: CK_ATTRIBUTE_TYPE = 546; @@ -170,12 +228,12 @@ pub const CKA_OTP_CHALLENGE_REQUIREMENT: CK_ATTRIBUTE_TYPE = 548; pub const CKA_OTP_TIME_REQUIREMENT: CK_ATTRIBUTE_TYPE = 549; pub const CKA_OTP_COUNTER_REQUIREMENT: CK_ATTRIBUTE_TYPE = 550; pub const CKA_OTP_PIN_REQUIREMENT: CK_ATTRIBUTE_TYPE = 551; +pub const CKA_OTP_COUNTER: CK_ATTRIBUTE_TYPE = 558; +pub const CKA_OTP_TIME: CK_ATTRIBUTE_TYPE = 559; pub const CKA_OTP_USER_IDENTIFIER: CK_ATTRIBUTE_TYPE = 554; pub const CKA_OTP_SERVICE_IDENTIFIER: CK_ATTRIBUTE_TYPE = 555; pub const CKA_OTP_SERVICE_LOGO: CK_ATTRIBUTE_TYPE = 556; pub const CKA_OTP_SERVICE_LOGO_TYPE: CK_ATTRIBUTE_TYPE = 557; -pub const CKA_OTP_COUNTER: CK_ATTRIBUTE_TYPE = 558; -pub const CKA_OTP_TIME: CK_ATTRIBUTE_TYPE = 559; pub const CKA_GOSTR3410_PARAMS: CK_ATTRIBUTE_TYPE = 592; pub const CKA_GOSTR3411_PARAMS: CK_ATTRIBUTE_TYPE = 593; pub const CKA_GOST28147_PARAMS: CK_ATTRIBUTE_TYPE = 594; @@ -196,6 +254,9 @@ pub const CKA_MECHANISM_TYPE: CK_ATTRIBUTE_TYPE = 1280; pub const CKA_REQUIRED_CMS_ATTRIBUTES: CK_ATTRIBUTE_TYPE = 1281; pub const CKA_DEFAULT_CMS_ATTRIBUTES: CK_ATTRIBUTE_TYPE = 1282; pub const CKA_SUPPORTED_CMS_ATTRIBUTES: CK_ATTRIBUTE_TYPE = 1283; +pub const CKA_ALLOWED_MECHANISMS: CK_ATTRIBUTE_TYPE = 1073743360; +pub const CKA_PROFILE_ID: CK_ATTRIBUTE_TYPE = 1537; +pub const CKA_VENDOR_DEFINED: CK_ATTRIBUTE_TYPE = 2147483648; pub const CKM_RSA_PKCS_KEY_PAIR_GEN: CK_MECHANISM_TYPE = 0; pub const CKM_RSA_PKCS: CK_MECHANISM_TYPE = 1; pub const CKM_RSA_9796: CK_MECHANISM_TYPE = 2; @@ -218,6 +279,10 @@ pub const CKM_DSA_SHA224: CK_MECHANISM_TYPE = 19; pub const CKM_DSA_SHA256: CK_MECHANISM_TYPE = 20; pub const CKM_DSA_SHA384: CK_MECHANISM_TYPE = 21; pub const CKM_DSA_SHA512: CK_MECHANISM_TYPE = 22; +pub const CKM_DSA_SHA3_224: CK_MECHANISM_TYPE = 24; +pub const CKM_DSA_SHA3_256: CK_MECHANISM_TYPE = 25; +pub const CKM_DSA_SHA3_384: CK_MECHANISM_TYPE = 26; +pub const CKM_DSA_SHA3_512: CK_MECHANISM_TYPE = 27; pub const CKM_DH_PKCS_KEY_PAIR_GEN: CK_MECHANISM_TYPE = 32; pub const CKM_DH_PKCS_DERIVE: CK_MECHANISM_TYPE = 33; pub const CKM_X9_42_DH_KEY_PAIR_GEN: CK_MECHANISM_TYPE = 48; @@ -230,6 +295,8 @@ pub const CKM_SHA512_RSA_PKCS: CK_MECHANISM_TYPE = 66; pub const CKM_SHA256_RSA_PKCS_PSS: CK_MECHANISM_TYPE = 67; pub const CKM_SHA384_RSA_PKCS_PSS: CK_MECHANISM_TYPE = 68; pub const CKM_SHA512_RSA_PKCS_PSS: CK_MECHANISM_TYPE = 69; +pub const CKM_SHA224_RSA_PKCS: CK_MECHANISM_TYPE = 70; +pub const CKM_SHA224_RSA_PKCS_PSS: CK_MECHANISM_TYPE = 71; pub const CKM_SHA512_224: CK_MECHANISM_TYPE = 72; pub const CKM_SHA512_224_HMAC: CK_MECHANISM_TYPE = 73; pub const CKM_SHA512_224_HMAC_GENERAL: CK_MECHANISM_TYPE = 74; @@ -242,6 +309,14 @@ pub const CKM_SHA512_T: CK_MECHANISM_TYPE = 80; pub const CKM_SHA512_T_HMAC: CK_MECHANISM_TYPE = 81; pub const CKM_SHA512_T_HMAC_GENERAL: CK_MECHANISM_TYPE = 82; pub const CKM_SHA512_T_KEY_DERIVATION: CK_MECHANISM_TYPE = 83; +pub const CKM_SHA3_256_RSA_PKCS: CK_MECHANISM_TYPE = 96; +pub const CKM_SHA3_384_RSA_PKCS: CK_MECHANISM_TYPE = 97; +pub const CKM_SHA3_512_RSA_PKCS: CK_MECHANISM_TYPE = 98; +pub const CKM_SHA3_256_RSA_PKCS_PSS: CK_MECHANISM_TYPE = 99; +pub const CKM_SHA3_384_RSA_PKCS_PSS: CK_MECHANISM_TYPE = 100; +pub const CKM_SHA3_512_RSA_PKCS_PSS: CK_MECHANISM_TYPE = 101; +pub const CKM_SHA3_224_RSA_PKCS: CK_MECHANISM_TYPE = 102; +pub const CKM_SHA3_224_RSA_PKCS_PSS: CK_MECHANISM_TYPE = 103; pub const CKM_RC2_KEY_GEN: CK_MECHANISM_TYPE = 256; pub const CKM_RC2_ECB: CK_MECHANISM_TYPE = 257; pub const CKM_RC2_CBC: CK_MECHANISM_TYPE = 258; @@ -293,6 +368,9 @@ pub const CKM_RIPEMD160_HMAC_GENERAL: CK_MECHANISM_TYPE = 578; pub const CKM_SHA256: CK_MECHANISM_TYPE = 592; pub const CKM_SHA256_HMAC: CK_MECHANISM_TYPE = 593; pub const CKM_SHA256_HMAC_GENERAL: CK_MECHANISM_TYPE = 594; +pub const CKM_SHA224: CK_MECHANISM_TYPE = 597; +pub const CKM_SHA224_HMAC: CK_MECHANISM_TYPE = 598; +pub const CKM_SHA224_HMAC_GENERAL: CK_MECHANISM_TYPE = 599; pub const CKM_SHA384: CK_MECHANISM_TYPE = 608; pub const CKM_SHA384_HMAC: CK_MECHANISM_TYPE = 609; pub const CKM_SHA384_HMAC_GENERAL: CK_MECHANISM_TYPE = 610; @@ -305,6 +383,22 @@ pub const CKM_HOTP_KEY_GEN: CK_MECHANISM_TYPE = 656; pub const CKM_HOTP: CK_MECHANISM_TYPE = 657; pub const CKM_ACTI: CK_MECHANISM_TYPE = 672; pub const CKM_ACTI_KEY_GEN: CK_MECHANISM_TYPE = 673; +pub const CKM_SHA3_256: CK_MECHANISM_TYPE = 688; +pub const CKM_SHA3_256_HMAC: CK_MECHANISM_TYPE = 689; +pub const CKM_SHA3_256_HMAC_GENERAL: CK_MECHANISM_TYPE = 690; +pub const CKM_SHA3_256_KEY_GEN: CK_MECHANISM_TYPE = 691; +pub const CKM_SHA3_224: CK_MECHANISM_TYPE = 693; +pub const CKM_SHA3_224_HMAC: CK_MECHANISM_TYPE = 694; +pub const CKM_SHA3_224_HMAC_GENERAL: CK_MECHANISM_TYPE = 695; +pub const CKM_SHA3_224_KEY_GEN: CK_MECHANISM_TYPE = 696; +pub const CKM_SHA3_384: CK_MECHANISM_TYPE = 704; +pub const CKM_SHA3_384_HMAC: CK_MECHANISM_TYPE = 705; +pub const CKM_SHA3_384_HMAC_GENERAL: CK_MECHANISM_TYPE = 706; +pub const CKM_SHA3_384_KEY_GEN: CK_MECHANISM_TYPE = 707; +pub const CKM_SHA3_512: CK_MECHANISM_TYPE = 720; +pub const CKM_SHA3_512_HMAC: CK_MECHANISM_TYPE = 721; +pub const CKM_SHA3_512_HMAC_GENERAL: CK_MECHANISM_TYPE = 722; +pub const CKM_SHA3_512_KEY_GEN: CK_MECHANISM_TYPE = 723; pub const CKM_CAST_KEY_GEN: CK_MECHANISM_TYPE = 768; pub const CKM_CAST_ECB: CK_MECHANISM_TYPE = 769; pub const CKM_CAST_CBC: CK_MECHANISM_TYPE = 770; @@ -364,6 +458,13 @@ pub const CKM_SHA1_KEY_DERIVATION: CK_MECHANISM_TYPE = 914; pub const CKM_SHA256_KEY_DERIVATION: CK_MECHANISM_TYPE = 915; pub const CKM_SHA384_KEY_DERIVATION: CK_MECHANISM_TYPE = 916; pub const CKM_SHA512_KEY_DERIVATION: CK_MECHANISM_TYPE = 917; +pub const CKM_SHA224_KEY_DERIVATION: CK_MECHANISM_TYPE = 918; +pub const CKM_SHA3_256_KEY_DERIVE: CK_MECHANISM_TYPE = 919; +pub const CKM_SHA3_224_KEY_DERIVE: CK_MECHANISM_TYPE = 920; +pub const CKM_SHA3_384_KEY_DERIVE: CK_MECHANISM_TYPE = 921; +pub const CKM_SHA3_512_KEY_DERIVE: CK_MECHANISM_TYPE = 922; +pub const CKM_SHAKE_128_KEY_DERIVE: CK_MECHANISM_TYPE = 923; +pub const CKM_SHAKE_256_KEY_DERIVE: CK_MECHANISM_TYPE = 924; pub const CKM_PBE_MD2_DES_CBC: CK_MECHANISM_TYPE = 928; pub const CKM_PBE_MD5_DES_CBC: CK_MECHANISM_TYPE = 929; pub const CKM_PBE_MD5_CAST_CBC: CK_MECHANISM_TYPE = 930; @@ -403,6 +504,13 @@ pub const CKM_KIP_DERIVE: CK_MECHANISM_TYPE = 1296; pub const CKM_KIP_WRAP: CK_MECHANISM_TYPE = 1297; pub const CKM_KIP_MAC: CK_MECHANISM_TYPE = 1298; pub const CKM_CAMELLIA_KEY_GEN: CK_MECHANISM_TYPE = 1360; +pub const CKM_CAMELLIA_ECB: CK_MECHANISM_TYPE = 1361; +pub const CKM_CAMELLIA_CBC: CK_MECHANISM_TYPE = 1362; +pub const CKM_CAMELLIA_MAC: CK_MECHANISM_TYPE = 1363; +pub const CKM_CAMELLIA_MAC_GENERAL: CK_MECHANISM_TYPE = 1364; +pub const CKM_CAMELLIA_CBC_PAD: CK_MECHANISM_TYPE = 1365; +pub const CKM_CAMELLIA_ECB_ENCRYPT_DATA: CK_MECHANISM_TYPE = 1366; +pub const CKM_CAMELLIA_CBC_ENCRYPT_DATA: CK_MECHANISM_TYPE = 1367; pub const CKM_CAMELLIA_CTR: CK_MECHANISM_TYPE = 1368; pub const CKM_ARIA_KEY_GEN: CK_MECHANISM_TYPE = 1376; pub const CKM_ARIA_ECB: CK_MECHANISM_TYPE = 1377; @@ -433,6 +541,7 @@ pub const CKM_SKIPJACK_PRIVATE_WRAP: CK_MECHANISM_TYPE = 4105; pub const CKM_SKIPJACK_RELAYX: CK_MECHANISM_TYPE = 4106; pub const CKM_KEA_KEY_PAIR_GEN: CK_MECHANISM_TYPE = 4112; pub const CKM_KEA_KEY_DERIVE: CK_MECHANISM_TYPE = 4113; +pub const CKM_KEA_DERIVE: CK_MECHANISM_TYPE = 4114; pub const CKM_FORTEZZA_TIMESTAMP: CK_MECHANISM_TYPE = 4128; pub const CKM_BATON_KEY_GEN: CK_MECHANISM_TYPE = 4144; pub const CKM_BATON_ECB128: CK_MECHANISM_TYPE = 4145; @@ -461,6 +570,8 @@ pub const CKM_JUNIPER_COUNTER: CK_MECHANISM_TYPE = 4195; pub const CKM_JUNIPER_SHUFFLE: CK_MECHANISM_TYPE = 4196; pub const CKM_JUNIPER_WRAP: CK_MECHANISM_TYPE = 4197; pub const CKM_FASTHASH: CK_MECHANISM_TYPE = 4208; +pub const CKM_AES_XTS: CK_MECHANISM_TYPE = 4209; +pub const CKM_AES_XTS_KEY_GEN: CK_MECHANISM_TYPE = 4210; pub const CKM_AES_KEY_GEN: CK_MECHANISM_TYPE = 4224; pub const CKM_AES_ECB: CK_MECHANISM_TYPE = 4225; pub const CKM_AES_CBC: CK_MECHANISM_TYPE = 4226; @@ -500,6 +611,10 @@ pub const CKM_GOST28147_ECB: CK_MECHANISM_TYPE = 4641; pub const CKM_GOST28147: CK_MECHANISM_TYPE = 4642; pub const CKM_GOST28147_MAC: CK_MECHANISM_TYPE = 4643; pub const CKM_GOST28147_KEY_WRAP: CK_MECHANISM_TYPE = 4644; +pub const CKM_CHACHA20_KEY_GEN: CK_MECHANISM_TYPE = 4645; +pub const CKM_CHACHA20: CK_MECHANISM_TYPE = 4646; +pub const CKM_POLY1305_KEY_GEN: CK_MECHANISM_TYPE = 4647; +pub const CKM_POLY1305: CK_MECHANISM_TYPE = 4648; pub const CKM_DSA_PARAMETER_GEN: CK_MECHANISM_TYPE = 8192; pub const CKM_DH_PKCS_PARAMETER_GEN: CK_MECHANISM_TYPE = 8193; pub const CKM_X9_42_DH_PARAMETER_GEN: CK_MECHANISM_TYPE = 8194; @@ -510,63 +625,71 @@ pub const CKM_AES_CFB64: CK_MECHANISM_TYPE = 8453; pub const CKM_AES_CFB8: CK_MECHANISM_TYPE = 8454; pub const CKM_AES_CFB128: CK_MECHANISM_TYPE = 8455; pub const CKM_AES_CFB1: CK_MECHANISM_TYPE = 8456; -pub const CKM_SHA224: CK_MECHANISM_TYPE = 597; -pub const CKM_SHA224_HMAC: CK_MECHANISM_TYPE = 598; -pub const CKM_SHA224_HMAC_GENERAL: CK_MECHANISM_TYPE = 599; -pub const CKM_SHA224_RSA_PKCS: CK_MECHANISM_TYPE = 70; -pub const CKM_SHA224_RSA_PKCS_PSS: CK_MECHANISM_TYPE = 71; -pub const CKM_SHA224_KEY_DERIVATION: CK_MECHANISM_TYPE = 918; -pub const CKM_CAMELLIA_ECB: CK_MECHANISM_TYPE = 1361; -pub const CKM_CAMELLIA_CBC: CK_MECHANISM_TYPE = 1362; -pub const CKM_CAMELLIA_MAC: CK_MECHANISM_TYPE = 1363; -pub const CKM_CAMELLIA_MAC_GENERAL: CK_MECHANISM_TYPE = 1364; -pub const CKM_CAMELLIA_CBC_PAD: CK_MECHANISM_TYPE = 1365; -pub const CKM_CAMELLIA_ECB_ENCRYPT_DATA: CK_MECHANISM_TYPE = 1366; -pub const CKM_CAMELLIA_CBC_ENCRYPT_DATA: CK_MECHANISM_TYPE = 1367; pub const CKM_AES_KEY_WRAP: CK_MECHANISM_TYPE = 8457; pub const CKM_AES_KEY_WRAP_PAD: CK_MECHANISM_TYPE = 8458; +pub const CKM_AES_KEY_WRAP_KWP: CK_MECHANISM_TYPE = 8459; pub const CKM_RSA_PKCS_TPM_1_1: CK_MECHANISM_TYPE = 16385; pub const CKM_RSA_PKCS_OAEP_TPM_1_1: CK_MECHANISM_TYPE = 16386; +pub const CKM_SHA_1_KEY_GEN: CK_MECHANISM_TYPE = 16387; +pub const CKM_SHA224_KEY_GEN: CK_MECHANISM_TYPE = 16388; +pub const CKM_SHA256_KEY_GEN: CK_MECHANISM_TYPE = 16389; +pub const CKM_SHA384_KEY_GEN: CK_MECHANISM_TYPE = 16390; +pub const CKM_SHA512_KEY_GEN: CK_MECHANISM_TYPE = 16391; +pub const CKM_SHA512_224_KEY_GEN: CK_MECHANISM_TYPE = 16392; +pub const CKM_SHA512_256_KEY_GEN: CK_MECHANISM_TYPE = 16393; +pub const CKM_SHA512_T_KEY_GEN: CK_MECHANISM_TYPE = 16394; +pub const CKM_NULL: CK_MECHANISM_TYPE = 16395; +pub const CKM_BLAKE2B_160: CK_MECHANISM_TYPE = 16396; +pub const CKM_BLAKE2B_160_HMAC: CK_MECHANISM_TYPE = 16397; +pub const CKM_BLAKE2B_160_HMAC_GENERAL: CK_MECHANISM_TYPE = 16398; +pub const CKM_BLAKE2B_160_KEY_DERIVE: CK_MECHANISM_TYPE = 16399; +pub const CKM_BLAKE2B_160_KEY_GEN: CK_MECHANISM_TYPE = 16400; +pub const CKM_BLAKE2B_256: CK_MECHANISM_TYPE = 16401; +pub const CKM_BLAKE2B_256_HMAC: CK_MECHANISM_TYPE = 16402; +pub const CKM_BLAKE2B_256_HMAC_GENERAL: CK_MECHANISM_TYPE = 16403; +pub const CKM_BLAKE2B_256_KEY_DERIVE: CK_MECHANISM_TYPE = 16404; +pub const CKM_BLAKE2B_256_KEY_GEN: CK_MECHANISM_TYPE = 16405; +pub const CKM_BLAKE2B_384: CK_MECHANISM_TYPE = 16406; +pub const CKM_BLAKE2B_384_HMAC: CK_MECHANISM_TYPE = 16407; +pub const CKM_BLAKE2B_384_HMAC_GENERAL: CK_MECHANISM_TYPE = 16408; +pub const CKM_BLAKE2B_384_KEY_DERIVE: CK_MECHANISM_TYPE = 16409; +pub const CKM_BLAKE2B_384_KEY_GEN: CK_MECHANISM_TYPE = 16410; +pub const CKM_BLAKE2B_512: CK_MECHANISM_TYPE = 16411; +pub const CKM_BLAKE2B_512_HMAC: CK_MECHANISM_TYPE = 16412; +pub const CKM_BLAKE2B_512_HMAC_GENERAL: CK_MECHANISM_TYPE = 16413; +pub const CKM_BLAKE2B_512_KEY_DERIVE: CK_MECHANISM_TYPE = 16414; +pub const CKM_BLAKE2B_512_KEY_GEN: CK_MECHANISM_TYPE = 16415; +pub const CKM_SALSA20: CK_MECHANISM_TYPE = 16416; +pub const CKM_CHACHA20_POLY1305: CK_MECHANISM_TYPE = 16417; +pub const CKM_SALSA20_POLY1305: CK_MECHANISM_TYPE = 16418; +pub const CKM_X3DH_INITIALIZE: CK_MECHANISM_TYPE = 16419; +pub const CKM_X3DH_RESPOND: CK_MECHANISM_TYPE = 16420; +pub const CKM_X2RATCHET_INITIALIZE: CK_MECHANISM_TYPE = 16421; +pub const CKM_X2RATCHET_RESPOND: CK_MECHANISM_TYPE = 16422; +pub const CKM_X2RATCHET_ENCRYPT: CK_MECHANISM_TYPE = 16423; +pub const CKM_X2RATCHET_DECRYPT: CK_MECHANISM_TYPE = 16424; +pub const CKM_XEDDSA: CK_MECHANISM_TYPE = 16425; +pub const CKM_HKDF_DERIVE: CK_MECHANISM_TYPE = 16426; +pub const CKM_HKDF_DATA: CK_MECHANISM_TYPE = 16427; +pub const CKM_HKDF_KEY_GEN: CK_MECHANISM_TYPE = 16428; +pub const CKM_ECDSA_SHA3_224: CK_MECHANISM_TYPE = 4167; +pub const CKM_ECDSA_SHA3_256: CK_MECHANISM_TYPE = 4168; +pub const CKM_ECDSA_SHA3_384: CK_MECHANISM_TYPE = 4169; +pub const CKM_ECDSA_SHA3_512: CK_MECHANISM_TYPE = 4170; pub const CKM_EC_EDWARDS_KEY_PAIR_GEN: CK_MECHANISM_TYPE = 4181; pub const CKM_EC_MONTGOMERY_KEY_PAIR_GEN: CK_MECHANISM_TYPE = 4182; pub const CKM_EDDSA: CK_MECHANISM_TYPE = 4183; -pub const CK_OTP_FORMAT_DECIMAL: CK_ULONG = 0; -pub const CK_OTP_FORMAT_HEXADECIMAL: CK_ULONG = 1; -pub const CK_OTP_FORMAT_ALPHANUMERIC: CK_ULONG = 2; -pub const CK_OTP_FORMAT_BINARY: CK_ULONG = 3; -pub const CK_OTP_PARAM_IGNORED: CK_ULONG = 0; -pub const CK_OTP_PARAM_OPTIONAL: CK_ULONG = 1; -pub const CK_OTP_PARAM_MANDATORY: CK_ULONG = 2; -pub const CK_OTP_VALUE: CK_ULONG = 0; -pub const CK_OTP_PIN: CK_ULONG = 1; -pub const CK_OTP_CHALLENGE: CK_ULONG = 2; -pub const CK_OTP_TIME: CK_ULONG = 3; -pub const CK_OTP_COUNTER: CK_ULONG = 4; -pub const CK_OTP_FLAGS: CK_ULONG = 5; -pub const CK_OTP_OUTPUT_LENGTH: CK_ULONG = 6; -pub const CK_OTP_FORMAT: CK_ULONG = 7; -pub const CKF_NEXT_OTP: CK_FLAGS = 1; -pub const CKF_EXCLUDE_TIME: CK_FLAGS = 2; -pub const CKF_EXCLUDE_COUNTER: CK_FLAGS = 4; -pub const CKF_EXCLUDE_CHALLENGE: CK_FLAGS = 8; -pub const CKF_EXCLUDE_PIN: CK_FLAGS = 16; -pub const CKF_USER_FRIENDLY_OTP: CK_FLAGS = 32; -pub const CKN_OTP_CHANGED: CK_NOTIFICATION = 1; -pub const CKG_MGF1_SHA1: CK_RSA_PKCS_MGF_TYPE = 1; -pub const CKG_MGF1_SHA224: CK_RSA_PKCS_MGF_TYPE = 5; -pub const CKG_MGF1_SHA256: CK_RSA_PKCS_MGF_TYPE = 2; -pub const CKG_MGF1_SHA384: CK_RSA_PKCS_MGF_TYPE = 3; -pub const CKG_MGF1_SHA512: CK_RSA_PKCS_MGF_TYPE = 4; -pub const CKD_NULL: CK_EC_KDF_TYPE = 1; -pub const CKD_SHA1_KDF: CK_EC_KDF_TYPE = 2; -pub const CKD_SHA1_KDF_ASN1: CK_EC_KDF_TYPE = 3; -pub const CKD_SHA1_KDF_CONCATENATE: CK_EC_KDF_TYPE = 4; -pub const CKD_SHA224_KDF: CK_EC_KDF_TYPE = 5; -pub const CKD_SHA256_KDF: CK_EC_KDF_TYPE = 6; -pub const CKD_SHA384_KDF: CK_EC_KDF_TYPE = 7; -pub const CKD_SHA512_KDF: CK_EC_KDF_TYPE = 8; -pub const CKD_CPDIVERSIFY_KDF: CK_EC_KDF_TYPE = 9; +pub const CKM_SP800_108_COUNTER_KDF: CK_MECHANISM_TYPE = 940; +pub const CKM_SP800_108_FEEDBACK_KDF: CK_MECHANISM_TYPE = 941; +pub const CKM_SP800_108_DOUBLE_PIPELINE_KDF: CK_MECHANISM_TYPE = 942; +pub const CKM_VENDOR_DEFINED: CK_MECHANISM_TYPE = 2147483648; pub const CKF_HW: CK_FLAGS = 1; +pub const CKF_MESSAGE_ENCRYPT: CK_FLAGS = 2; +pub const CKF_MESSAGE_DECRYPT: CK_FLAGS = 4; +pub const CKF_MESSAGE_SIGN: CK_FLAGS = 8; +pub const CKF_MESSAGE_VERIFY: CK_FLAGS = 16; +pub const CKF_MULTI_MESSGE: CK_FLAGS = 32; +pub const CKF_FIND_OBJECTS: CK_FLAGS = 64; pub const CKF_ENCRYPT: CK_FLAGS = 256; pub const CKF_DECRYPT: CK_FLAGS = 512; pub const CKF_DIGEST: CK_FLAGS = 1024; @@ -582,12 +705,12 @@ pub const CKF_DERIVE: CK_FLAGS = 524288; pub const CKF_EC_F_P: CK_FLAGS = 1048576; pub const CKF_EC_F_2M: CK_FLAGS = 2097152; pub const CKF_EC_ECPARAMETERS: CK_FLAGS = 4194304; +pub const CKF_EC_OID: CK_FLAGS = 8388608; pub const CKF_EC_NAMEDCURVE: CK_FLAGS = 8388608; pub const CKF_EC_UNCOMPRESS: CK_FLAGS = 16777216; pub const CKF_EC_COMPRESS: CK_FLAGS = 33554432; -pub const CKF_DONT_BLOCK: CK_FLAGS = 1; -pub const CKF_LIBRARY_CANT_CREATE_OS_THREADS: CK_FLAGS = 1; -pub const CKF_OS_LOCKING_OK: CK_FLAGS = 2; +pub const CKF_EC_CURVENAME: CK_FLAGS = 67108864; +pub const CKF_EXTENSION: CK_FLAGS = 2147483648; pub const CKR_OK: CK_RV = 0; pub const CKR_CANCEL: CK_RV = 1; pub const CKR_HOST_MEMORY: CK_RV = 2; @@ -610,6 +733,7 @@ pub const CKR_DEVICE_MEMORY: CK_RV = 49; pub const CKR_DEVICE_REMOVED: CK_RV = 50; pub const CKR_ENCRYPTED_DATA_INVALID: CK_RV = 64; pub const CKR_ENCRYPTED_DATA_LEN_RANGE: CK_RV = 65; +pub const CKR_AEAD_DECRYPT_FAILED: CK_RV = 66; pub const CKR_FUNCTION_CANCELED: CK_RV = 80; pub const CKR_FUNCTION_NOT_PARALLEL: CK_RV = 81; pub const CKR_FUNCTION_NOT_SUPPORTED: CK_RV = 84; @@ -665,6 +789,7 @@ pub const CKR_WRAPPING_KEY_TYPE_INCONSISTENT: CK_RV = 277; pub const CKR_RANDOM_SEED_NOT_SUPPORTED: CK_RV = 288; pub const CKR_RANDOM_NO_RNG: CK_RV = 289; pub const CKR_DOMAIN_PARAMS_INVALID: CK_RV = 304; +pub const CKR_CURVE_NOT_SUPPORTED: CK_RV = 320; pub const CKR_BUFFER_TOO_SMALL: CK_RV = 336; pub const CKR_SAVED_STATE_INVALID: CK_RV = 352; pub const CKR_INFORMATION_SENSITIVE: CK_RV = 368; @@ -675,44 +800,126 @@ pub const CKR_MUTEX_BAD: CK_RV = 416; pub const CKR_MUTEX_NOT_LOCKED: CK_RV = 417; pub const CKR_NEW_PIN_MODE: CK_RV = 432; pub const CKR_NEXT_OTP: CK_RV = 433; -pub const CKR_EXCEEDED_MAX_ITERATIONS: CK_RV = 448; -pub const CKR_FIPS_SELF_TEST_FAILED: CK_RV = 449; -pub const CKR_LIBRARY_LOAD_FAILED: CK_RV = 450; -pub const CKR_PIN_TOO_WEAK: CK_RV = 451; -pub const CKR_PUBLIC_KEY_INVALID: CK_RV = 452; +pub const CKR_EXCEEDED_MAX_ITERATIONS: CK_RV = 437; +pub const CKR_FIPS_SELF_TEST_FAILED: CK_RV = 438; +pub const CKR_LIBRARY_LOAD_FAILED: CK_RV = 439; +pub const CKR_PIN_TOO_WEAK: CK_RV = 440; +pub const CKR_PUBLIC_KEY_INVALID: CK_RV = 441; pub const CKR_FUNCTION_REJECTED: CK_RV = 512; +pub const CKR_TOKEN_RESOURCE_EXCEEDED: CK_RV = 513; +pub const CKR_VENDOR_DEFINED: CK_RV = 2147483648; +pub const CKF_END_OF_MESSAGE: CK_FLAGS = 1; +pub const CKF_INTERFACE_FORK_SAFE: CK_FLAGS = 1; +pub const CKF_LIBRARY_CANT_CREATE_OS_THREADS: CK_FLAGS = 1; +pub const CKF_OS_LOCKING_OK: CK_FLAGS = 2; +pub const CKF_DONT_BLOCK: CK_FLAGS = 1; +pub const CKG_MGF1_SHA1: CK_RSA_PKCS_MGF_TYPE = 1; +pub const CKG_MGF1_SHA256: CK_RSA_PKCS_MGF_TYPE = 2; +pub const CKG_MGF1_SHA384: CK_RSA_PKCS_MGF_TYPE = 3; +pub const CKG_MGF1_SHA512: CK_RSA_PKCS_MGF_TYPE = 4; +pub const CKG_MGF1_SHA224: CK_RSA_PKCS_MGF_TYPE = 5; pub const CKZ_DATA_SPECIFIED: CK_RSA_PKCS_OAEP_SOURCE_TYPE = 1; -pub const CK_FALSE: CK_BBOOL = 0; -pub const CK_TRUE: CK_BBOOL = 1; -pub const FALSE: u32 = 0; -pub const TRUE: u32 = 1; -pub type CK_FLAGS = ::std::os::raw::c_ulong; +pub const CKD_NULL: CK_EC_KDF_TYPE = 1; +pub const CKD_SHA1_KDF: CK_EC_KDF_TYPE = 2; +pub const CKD_SHA1_KDF_ASN1: CK_EC_KDF_TYPE = 3; +pub const CKD_SHA1_KDF_CONCATENATE: CK_EC_KDF_TYPE = 4; +pub const CKD_SHA224_KDF: CK_EC_KDF_TYPE = 5; +pub const CKD_SHA256_KDF: CK_EC_KDF_TYPE = 6; +pub const CKD_SHA384_KDF: CK_EC_KDF_TYPE = 7; +pub const CKD_SHA512_KDF: CK_EC_KDF_TYPE = 8; +pub const CKD_CPDIVERSIFY_KDF: CK_EC_KDF_TYPE = 9; +pub const CKD_SHA3_224_KDF: CK_EC_KDF_TYPE = 10; +pub const CKD_SHA3_256_KDF: CK_EC_KDF_TYPE = 11; +pub const CKD_SHA3_384_KDF: CK_EC_KDF_TYPE = 12; +pub const CKD_SHA3_512_KDF: CK_EC_KDF_TYPE = 13; +pub const CKD_SHA1_KDF_SP800: CK_EC_KDF_TYPE = 14; +pub const CKD_SHA224_KDF_SP800: CK_EC_KDF_TYPE = 15; +pub const CKD_SHA256_KDF_SP800: CK_EC_KDF_TYPE = 16; +pub const CKD_SHA384_KDF_SP800: CK_EC_KDF_TYPE = 17; +pub const CKD_SHA512_KDF_SP800: CK_EC_KDF_TYPE = 18; +pub const CKD_SHA3_224_KDF_SP800: CK_EC_KDF_TYPE = 19; +pub const CKD_SHA3_256_KDF_SP800: CK_EC_KDF_TYPE = 20; +pub const CKD_SHA3_384_KDF_SP800: CK_EC_KDF_TYPE = 21; +pub const CKD_SHA3_512_KDF_SP800: CK_EC_KDF_TYPE = 22; +pub const CKD_BLAKE2B_160_KDF: CK_EC_KDF_TYPE = 23; +pub const CKD_BLAKE2B_256_KDF: CK_EC_KDF_TYPE = 24; +pub const CKD_BLAKE2B_384_KDF: CK_EC_KDF_TYPE = 25; +pub const CKD_BLAKE2B_512_KDF: CK_EC_KDF_TYPE = 26; +pub const CKP_PKCS5_PBKD2_HMAC_SHA1: CK_PROFILE_ID = 1; +pub const CKP_PKCS5_PBKD2_HMAC_GOSTR3411: CK_PROFILE_ID = 2; +pub const CKP_PKCS5_PBKD2_HMAC_SHA224: CK_PROFILE_ID = 3; +pub const CKP_PKCS5_PBKD2_HMAC_SHA256: CK_PROFILE_ID = 4; +pub const CKP_PKCS5_PBKD2_HMAC_SHA384: CK_PROFILE_ID = 5; +pub const CKP_PKCS5_PBKD2_HMAC_SHA512: CK_PROFILE_ID = 6; +pub const CKP_PKCS5_PBKD2_HMAC_SHA512_224: CK_PROFILE_ID = 7; +pub const CKP_PKCS5_PBKD2_HMAC_SHA512_256: CK_PROFILE_ID = 8; +pub const CKZ_SALT_SPECIFIED: CK_RSA_PKCS_OAEP_SOURCE_TYPE = 1; +pub const CK_OTP_VALUE: CK_ULONG = 0; +pub const CK_OTP_PIN: CK_ULONG = 1; +pub const CK_OTP_CHALLENGE: CK_ULONG = 2; +pub const CK_OTP_TIME: CK_ULONG = 3; +pub const CK_OTP_COUNTER: CK_ULONG = 4; +pub const CK_OTP_FLAGS: CK_ULONG = 5; +pub const CK_OTP_OUTPUT_LENGTH: CK_ULONG = 6; +pub const CK_OTP_OUTPUT_FORMAT: CK_ULONG = 7; +pub const CKF_NEXT_OTP: CK_FLAGS = 1; +pub const CKF_EXCLUDE_TIME: CK_FLAGS = 2; +pub const CKF_EXCLUDE_COUNTER: CK_FLAGS = 4; +pub const CKF_EXCLUDE_CHALLENGE: CK_FLAGS = 8; +pub const CKF_EXCLUDE_PIN: CK_FLAGS = 16; +pub const CKF_USER_FRIENDLY_OTP: CK_FLAGS = 32; +pub const CKG_NO_GENERATE: u32 = 0; +pub const CKG_GENERATE: u32 = 1; +pub const CKG_GENERATE_COUNTER: u32 = 2; +pub const CKG_GENERATE_RANDOM: u32 = 3; +pub const CK_SP800_108_ITERATION_VARIABLE: CK_ULONG = 1; +pub const CK_SP800_108_OPTIONAL_COUNTER: CK_ULONG = 2; +pub const CK_SP800_108_DKM_LENGTH: CK_ULONG = 3; +pub const CK_SP800_108_BYTE_ARRAY: CK_ULONG = 4; +pub const CKF_HKDF_SALT_NULL: CK_FLAGS = 1; +pub const CKF_HKDF_SALT_DATA: CK_FLAGS = 2; +pub const CKF_HKDF_SALT_KEY: CK_FLAGS = 4; +pub const CK_NEED_ARG_LIST: CK_ULONG = 1; +pub const CK_PKCS11_2_0_ONLY: CK_ULONG = 1; +pub type CK_BYTE = ::std::os::raw::c_uchar; +pub type CK_CHAR = CK_BYTE; +pub type CK_UTF8CHAR = CK_BYTE; +pub type CK_BBOOL = CK_BYTE; +pub type CK_ULONG = ::std::os::raw::c_ulong; +pub type CK_LONG = ::std::os::raw::c_long; +pub type CK_FLAGS = CK_ULONG; +pub type CK_BYTE_PTR = *mut CK_BYTE; +pub type CK_CHAR_PTR = *mut CK_CHAR; +pub type CK_UTF8CHAR_PTR = *mut CK_UTF8CHAR; +pub type CK_ULONG_PTR = *mut CK_ULONG; +pub type CK_VOID_PTR = *mut ::std::os::raw::c_void; +pub type CK_VOID_PTR_PTR = *mut CK_VOID_PTR; #[repr(C)] #[derive(Debug, Default, Copy, Clone)] -pub struct _CK_VERSION { - pub major: ::std::os::raw::c_uchar, - pub minor: ::std::os::raw::c_uchar, +pub struct CK_VERSION { + pub major: CK_BYTE, + pub minor: CK_BYTE, } #[test] -fn bindgen_test_layout__CK_VERSION() { - const UNINIT: ::std::mem::MaybeUninit<_CK_VERSION> = ::std::mem::MaybeUninit::uninit(); +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::<_CK_VERSION>(), + ::std::mem::size_of::(), 2usize, - concat!("Size of: ", stringify!(_CK_VERSION)) + concat!("Size of: ", stringify!(CK_VERSION)) ); assert_eq!( - ::std::mem::align_of::<_CK_VERSION>(), + ::std::mem::align_of::(), 1usize, - concat!("Alignment of ", stringify!(_CK_VERSION)) + 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!(CK_VERSION), "::", stringify!(major) ) @@ -722,41 +929,42 @@ fn bindgen_test_layout__CK_VERSION() { 1usize, concat!( "Offset of field: ", - stringify!(_CK_VERSION), + stringify!(CK_VERSION), "::", stringify!(minor) ) ); } +pub type CK_VERSION_PTR = *mut CK_VERSION; #[repr(C)] #[derive(Debug, Default, Copy, Clone)] -pub struct _CK_INFO { - pub cryptokiVersion: _CK_VERSION, - pub manufacturerID: [::std::os::raw::c_uchar; 32usize], +pub struct CK_INFO { + pub cryptokiVersion: CK_VERSION, + pub manufacturerID: [CK_UTF8CHAR; 32usize], pub flags: CK_FLAGS, - pub libraryDescription: [::std::os::raw::c_uchar; 32usize], - pub libraryVersion: _CK_VERSION, + pub libraryDescription: [CK_UTF8CHAR; 32usize], + pub libraryVersion: CK_VERSION, } #[test] -fn bindgen_test_layout__CK_INFO() { - const UNINIT: ::std::mem::MaybeUninit<_CK_INFO> = ::std::mem::MaybeUninit::uninit(); +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::<_CK_INFO>(), + ::std::mem::size_of::(), 88usize, - concat!("Size of: ", stringify!(_CK_INFO)) + concat!("Size of: ", stringify!(CK_INFO)) ); assert_eq!( - ::std::mem::align_of::<_CK_INFO>(), + ::std::mem::align_of::(), 8usize, - concat!("Alignment of ", stringify!(_CK_INFO)) + 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!(CK_INFO), "::", stringify!(cryptokiVersion) ) @@ -766,7 +974,7 @@ fn bindgen_test_layout__CK_INFO() { 2usize, concat!( "Offset of field: ", - stringify!(_CK_INFO), + stringify!(CK_INFO), "::", stringify!(manufacturerID) ) @@ -776,7 +984,7 @@ fn bindgen_test_layout__CK_INFO() { 40usize, concat!( "Offset of field: ", - stringify!(_CK_INFO), + stringify!(CK_INFO), "::", stringify!(flags) ) @@ -786,7 +994,7 @@ fn bindgen_test_layout__CK_INFO() { 48usize, concat!( "Offset of field: ", - stringify!(_CK_INFO), + stringify!(CK_INFO), "::", stringify!(libraryDescription) ) @@ -796,44 +1004,45 @@ fn bindgen_test_layout__CK_INFO() { 80usize, concat!( "Offset of field: ", - stringify!(_CK_INFO), + stringify!(CK_INFO), "::", stringify!(libraryVersion) ) ); } -pub type CK_NOTIFICATION = ::std::os::raw::c_ulong; -pub const CKN_SURRENDER: ::std::os::raw::c_ulong = 0; -pub type CK_SLOT_ID = ::std::os::raw::c_ulong; +pub type CK_INFO_PTR = *mut CK_INFO; +pub type CK_NOTIFICATION = CK_ULONG; +pub type CK_SLOT_ID = CK_ULONG; +pub type CK_SLOT_ID_PTR = *mut CK_SLOT_ID; #[repr(C)] #[derive(Debug, Copy, Clone)] -pub struct _CK_SLOT_INFO { - pub slotDescription: [::std::os::raw::c_uchar; 64usize], - pub manufacturerID: [::std::os::raw::c_uchar; 32usize], +pub struct CK_SLOT_INFO { + pub slotDescription: [CK_UTF8CHAR; 64usize], + pub manufacturerID: [CK_UTF8CHAR; 32usize], pub flags: CK_FLAGS, - pub hardwareVersion: _CK_VERSION, - pub firmwareVersion: _CK_VERSION, + pub hardwareVersion: CK_VERSION, + pub firmwareVersion: CK_VERSION, } #[test] -fn bindgen_test_layout__CK_SLOT_INFO() { - const UNINIT: ::std::mem::MaybeUninit<_CK_SLOT_INFO> = ::std::mem::MaybeUninit::uninit(); +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::<_CK_SLOT_INFO>(), + ::std::mem::size_of::(), 112usize, - concat!("Size of: ", stringify!(_CK_SLOT_INFO)) + concat!("Size of: ", stringify!(CK_SLOT_INFO)) ); assert_eq!( - ::std::mem::align_of::<_CK_SLOT_INFO>(), + ::std::mem::align_of::(), 8usize, - concat!("Alignment of ", stringify!(_CK_SLOT_INFO)) + 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!(CK_SLOT_INFO), "::", stringify!(slotDescription) ) @@ -843,7 +1052,7 @@ fn bindgen_test_layout__CK_SLOT_INFO() { 64usize, concat!( "Offset of field: ", - stringify!(_CK_SLOT_INFO), + stringify!(CK_SLOT_INFO), "::", stringify!(manufacturerID) ) @@ -853,7 +1062,7 @@ fn bindgen_test_layout__CK_SLOT_INFO() { 96usize, concat!( "Offset of field: ", - stringify!(_CK_SLOT_INFO), + stringify!(CK_SLOT_INFO), "::", stringify!(flags) ) @@ -863,7 +1072,7 @@ fn bindgen_test_layout__CK_SLOT_INFO() { 104usize, concat!( "Offset of field: ", - stringify!(_CK_SLOT_INFO), + stringify!(CK_SLOT_INFO), "::", stringify!(hardwareVersion) ) @@ -873,13 +1082,13 @@ fn bindgen_test_layout__CK_SLOT_INFO() { 106usize, concat!( "Offset of field: ", - stringify!(_CK_SLOT_INFO), + stringify!(CK_SLOT_INFO), "::", stringify!(firmwareVersion) ) ); } -impl Default for _CK_SLOT_INFO { +impl Default for CK_SLOT_INFO { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { @@ -888,52 +1097,49 @@ impl Default for _CK_SLOT_INFO { } } } -pub const CKF_TOKEN_PRESENT: ::std::os::raw::c_ulong = 1; -pub const CKF_REMOVABLE_DEVICE: ::std::os::raw::c_ulong = 2; -pub const CKF_HW_SLOT: ::std::os::raw::c_ulong = 4; -pub const CKF_ARRAY_ATTRIBUTE: ::std::os::raw::c_ulong = 1073741824; +pub type CK_SLOT_INFO_PTR = *mut CK_SLOT_INFO; #[repr(C)] #[derive(Debug, Default, Copy, Clone)] -pub struct _CK_TOKEN_INFO { - pub label: [::std::os::raw::c_uchar; 32usize], - pub manufacturerID: [::std::os::raw::c_uchar; 32usize], - pub model: [::std::os::raw::c_uchar; 16usize], - pub serialNumber: [::std::os::raw::c_uchar; 16usize], +pub struct CK_TOKEN_INFO { + pub label: [CK_UTF8CHAR; 32usize], + pub manufacturerID: [CK_UTF8CHAR; 32usize], + pub model: [CK_UTF8CHAR; 16usize], + pub serialNumber: [CK_CHAR; 16usize], pub flags: CK_FLAGS, - pub ulMaxSessionCount: ::std::os::raw::c_ulong, - pub ulSessionCount: ::std::os::raw::c_ulong, - pub ulMaxRwSessionCount: ::std::os::raw::c_ulong, - pub ulRwSessionCount: ::std::os::raw::c_ulong, - pub ulMaxPinLen: ::std::os::raw::c_ulong, - pub ulMinPinLen: ::std::os::raw::c_ulong, - pub ulTotalPublicMemory: ::std::os::raw::c_ulong, - pub ulFreePublicMemory: ::std::os::raw::c_ulong, - pub ulTotalPrivateMemory: ::std::os::raw::c_ulong, - pub ulFreePrivateMemory: ::std::os::raw::c_ulong, - pub hardwareVersion: _CK_VERSION, - pub firmwareVersion: _CK_VERSION, - pub utcTime: [::std::os::raw::c_uchar; 16usize], + pub ulMaxSessionCount: CK_ULONG, + pub ulSessionCount: CK_ULONG, + pub ulMaxRwSessionCount: CK_ULONG, + pub ulRwSessionCount: CK_ULONG, + pub ulMaxPinLen: CK_ULONG, + pub ulMinPinLen: CK_ULONG, + pub ulTotalPublicMemory: CK_ULONG, + pub ulFreePublicMemory: CK_ULONG, + pub ulTotalPrivateMemory: CK_ULONG, + pub ulFreePrivateMemory: CK_ULONG, + pub hardwareVersion: CK_VERSION, + pub firmwareVersion: CK_VERSION, + pub utcTime: [CK_CHAR; 16usize], } #[test] -fn bindgen_test_layout__CK_TOKEN_INFO() { - const UNINIT: ::std::mem::MaybeUninit<_CK_TOKEN_INFO> = ::std::mem::MaybeUninit::uninit(); +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::<_CK_TOKEN_INFO>(), + ::std::mem::size_of::(), 208usize, - concat!("Size of: ", stringify!(_CK_TOKEN_INFO)) + concat!("Size of: ", stringify!(CK_TOKEN_INFO)) ); assert_eq!( - ::std::mem::align_of::<_CK_TOKEN_INFO>(), + ::std::mem::align_of::(), 8usize, - concat!("Alignment of ", stringify!(_CK_TOKEN_INFO)) + 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!(CK_TOKEN_INFO), "::", stringify!(label) ) @@ -943,7 +1149,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { 32usize, concat!( "Offset of field: ", - stringify!(_CK_TOKEN_INFO), + stringify!(CK_TOKEN_INFO), "::", stringify!(manufacturerID) ) @@ -953,7 +1159,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { 64usize, concat!( "Offset of field: ", - stringify!(_CK_TOKEN_INFO), + stringify!(CK_TOKEN_INFO), "::", stringify!(model) ) @@ -963,7 +1169,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { 80usize, concat!( "Offset of field: ", - stringify!(_CK_TOKEN_INFO), + stringify!(CK_TOKEN_INFO), "::", stringify!(serialNumber) ) @@ -973,7 +1179,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { 96usize, concat!( "Offset of field: ", - stringify!(_CK_TOKEN_INFO), + stringify!(CK_TOKEN_INFO), "::", stringify!(flags) ) @@ -983,7 +1189,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { 104usize, concat!( "Offset of field: ", - stringify!(_CK_TOKEN_INFO), + stringify!(CK_TOKEN_INFO), "::", stringify!(ulMaxSessionCount) ) @@ -993,7 +1199,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { 112usize, concat!( "Offset of field: ", - stringify!(_CK_TOKEN_INFO), + stringify!(CK_TOKEN_INFO), "::", stringify!(ulSessionCount) ) @@ -1003,7 +1209,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { 120usize, concat!( "Offset of field: ", - stringify!(_CK_TOKEN_INFO), + stringify!(CK_TOKEN_INFO), "::", stringify!(ulMaxRwSessionCount) ) @@ -1013,7 +1219,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { 128usize, concat!( "Offset of field: ", - stringify!(_CK_TOKEN_INFO), + stringify!(CK_TOKEN_INFO), "::", stringify!(ulRwSessionCount) ) @@ -1023,7 +1229,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { 136usize, concat!( "Offset of field: ", - stringify!(_CK_TOKEN_INFO), + stringify!(CK_TOKEN_INFO), "::", stringify!(ulMaxPinLen) ) @@ -1033,7 +1239,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { 144usize, concat!( "Offset of field: ", - stringify!(_CK_TOKEN_INFO), + stringify!(CK_TOKEN_INFO), "::", stringify!(ulMinPinLen) ) @@ -1043,7 +1249,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { 152usize, concat!( "Offset of field: ", - stringify!(_CK_TOKEN_INFO), + stringify!(CK_TOKEN_INFO), "::", stringify!(ulTotalPublicMemory) ) @@ -1053,7 +1259,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { 160usize, concat!( "Offset of field: ", - stringify!(_CK_TOKEN_INFO), + stringify!(CK_TOKEN_INFO), "::", stringify!(ulFreePublicMemory) ) @@ -1063,7 +1269,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { 168usize, concat!( "Offset of field: ", - stringify!(_CK_TOKEN_INFO), + stringify!(CK_TOKEN_INFO), "::", stringify!(ulTotalPrivateMemory) ) @@ -1073,7 +1279,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { 176usize, concat!( "Offset of field: ", - stringify!(_CK_TOKEN_INFO), + stringify!(CK_TOKEN_INFO), "::", stringify!(ulFreePrivateMemory) ) @@ -1083,7 +1289,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { 184usize, concat!( "Offset of field: ", - stringify!(_CK_TOKEN_INFO), + stringify!(CK_TOKEN_INFO), "::", stringify!(hardwareVersion) ) @@ -1093,7 +1299,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { 186usize, concat!( "Offset of field: ", - stringify!(_CK_TOKEN_INFO), + stringify!(CK_TOKEN_INFO), "::", stringify!(firmwareVersion) ) @@ -1103,43 +1309,45 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { 188usize, concat!( "Offset of field: ", - stringify!(_CK_TOKEN_INFO), + stringify!(CK_TOKEN_INFO), "::", stringify!(utcTime) ) ); } -pub type CK_SESSION_HANDLE = ::std::os::raw::c_ulong; -pub type CK_USER_TYPE = ::std::os::raw::c_ulong; -pub type CK_STATE = ::std::os::raw::c_ulong; +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; +pub type CK_USER_TYPE = CK_ULONG; +pub type CK_STATE = CK_ULONG; #[repr(C)] #[derive(Debug, Default, Copy, Clone)] -pub struct _CK_SESSION_INFO { +pub struct CK_SESSION_INFO { pub slotID: CK_SLOT_ID, pub state: CK_STATE, pub flags: CK_FLAGS, - pub ulDeviceError: ::std::os::raw::c_ulong, + pub ulDeviceError: CK_ULONG, } #[test] -fn bindgen_test_layout__CK_SESSION_INFO() { - const UNINIT: ::std::mem::MaybeUninit<_CK_SESSION_INFO> = ::std::mem::MaybeUninit::uninit(); +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::<_CK_SESSION_INFO>(), + ::std::mem::size_of::(), 32usize, - concat!("Size of: ", stringify!(_CK_SESSION_INFO)) + concat!("Size of: ", stringify!(CK_SESSION_INFO)) ); assert_eq!( - ::std::mem::align_of::<_CK_SESSION_INFO>(), + ::std::mem::align_of::(), 8usize, - concat!("Alignment of ", stringify!(_CK_SESSION_INFO)) + 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!(CK_SESSION_INFO), "::", stringify!(slotID) ) @@ -1149,7 +1357,7 @@ fn bindgen_test_layout__CK_SESSION_INFO() { 8usize, concat!( "Offset of field: ", - stringify!(_CK_SESSION_INFO), + stringify!(CK_SESSION_INFO), "::", stringify!(state) ) @@ -1159,7 +1367,7 @@ fn bindgen_test_layout__CK_SESSION_INFO() { 16usize, concat!( "Offset of field: ", - stringify!(_CK_SESSION_INFO), + stringify!(CK_SESSION_INFO), "::", stringify!(flags) ) @@ -1169,45 +1377,48 @@ fn bindgen_test_layout__CK_SESSION_INFO() { 24usize, concat!( "Offset of field: ", - stringify!(_CK_SESSION_INFO), + stringify!(CK_SESSION_INFO), "::", stringify!(ulDeviceError) ) ); } -pub type CK_OBJECT_HANDLE = ::std::os::raw::c_ulong; -pub type CK_OBJECT_CLASS = ::std::os::raw::c_ulong; -pub type CK_HW_FEATURE_TYPE = ::std::os::raw::c_ulong; -pub type CK_KEY_TYPE = ::std::os::raw::c_ulong; -pub type CK_CERTIFICATE_TYPE = ::std::os::raw::c_ulong; -pub type CK_ATTRIBUTE_TYPE = ::std::os::raw::c_ulong; +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; +pub type CK_OBJECT_CLASS = CK_ULONG; +pub type CK_OBJECT_CLASS_PTR = *mut CK_OBJECT_CLASS; +pub type CK_HW_FEATURE_TYPE = CK_ULONG; +pub type CK_KEY_TYPE = CK_ULONG; +pub type CK_CERTIFICATE_TYPE = CK_ULONG; +pub type CK_ATTRIBUTE_TYPE = CK_ULONG; #[repr(C)] #[derive(Debug, Copy, Clone)] -pub struct _CK_ATTRIBUTE { +pub struct CK_ATTRIBUTE { pub type_: CK_ATTRIBUTE_TYPE, - pub pValue: *mut ::std::os::raw::c_void, - pub ulValueLen: ::std::os::raw::c_ulong, + pub pValue: CK_VOID_PTR, + pub ulValueLen: CK_ULONG, } #[test] -fn bindgen_test_layout__CK_ATTRIBUTE() { - const UNINIT: ::std::mem::MaybeUninit<_CK_ATTRIBUTE> = ::std::mem::MaybeUninit::uninit(); +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::<_CK_ATTRIBUTE>(), + ::std::mem::size_of::(), 24usize, - concat!("Size of: ", stringify!(_CK_ATTRIBUTE)) + concat!("Size of: ", stringify!(CK_ATTRIBUTE)) ); assert_eq!( - ::std::mem::align_of::<_CK_ATTRIBUTE>(), + ::std::mem::align_of::(), 8usize, - concat!("Alignment of ", stringify!(_CK_ATTRIBUTE)) + 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!(CK_ATTRIBUTE), "::", stringify!(type_) ) @@ -1217,7 +1428,7 @@ fn bindgen_test_layout__CK_ATTRIBUTE() { 8usize, concat!( "Offset of field: ", - stringify!(_CK_ATTRIBUTE), + stringify!(CK_ATTRIBUTE), "::", stringify!(pValue) ) @@ -1227,13 +1438,13 @@ fn bindgen_test_layout__CK_ATTRIBUTE() { 16usize, concat!( "Offset of field: ", - stringify!(_CK_ATTRIBUTE), + stringify!(CK_ATTRIBUTE), "::", stringify!(ulValueLen) ) ); } -impl Default for _CK_ATTRIBUTE { +impl Default for CK_ATTRIBUTE { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { @@ -1242,33 +1453,34 @@ impl Default for _CK_ATTRIBUTE { } } } +pub type CK_ATTRIBUTE_PTR = *mut CK_ATTRIBUTE; #[repr(C)] #[derive(Debug, Default, Copy, Clone)] -pub struct _CK_DATE { - pub year: [::std::os::raw::c_uchar; 4usize], - pub month: [::std::os::raw::c_uchar; 2usize], - pub day: [::std::os::raw::c_uchar; 2usize], +pub struct CK_DATE { + pub year: [CK_CHAR; 4usize], + pub month: [CK_CHAR; 2usize], + pub day: [CK_CHAR; 2usize], } #[test] -fn bindgen_test_layout__CK_DATE() { - const UNINIT: ::std::mem::MaybeUninit<_CK_DATE> = ::std::mem::MaybeUninit::uninit(); +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::<_CK_DATE>(), + ::std::mem::size_of::(), 8usize, - concat!("Size of: ", stringify!(_CK_DATE)) + concat!("Size of: ", stringify!(CK_DATE)) ); assert_eq!( - ::std::mem::align_of::<_CK_DATE>(), + ::std::mem::align_of::(), 1usize, - concat!("Alignment of ", stringify!(_CK_DATE)) + 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!(CK_DATE), "::", stringify!(year) ) @@ -1278,7 +1490,7 @@ fn bindgen_test_layout__CK_DATE() { 4usize, concat!( "Offset of field: ", - stringify!(_CK_DATE), + stringify!(CK_DATE), "::", stringify!(month) ) @@ -1288,40 +1500,41 @@ fn bindgen_test_layout__CK_DATE() { 6usize, concat!( "Offset of field: ", - stringify!(_CK_DATE), + stringify!(CK_DATE), "::", stringify!(day) ) ); } -pub type CK_MECHANISM_TYPE = ::std::os::raw::c_ulong; +pub type CK_MECHANISM_TYPE = CK_ULONG; +pub type CK_MECHANISM_TYPE_PTR = *mut CK_MECHANISM_TYPE; #[repr(C)] #[derive(Debug, Copy, Clone)] -pub struct _CK_MECHANISM { +pub struct CK_MECHANISM { pub mechanism: CK_MECHANISM_TYPE, - pub pParameter: *mut ::std::os::raw::c_void, - pub ulParameterLen: ::std::os::raw::c_ulong, + pub pParameter: CK_VOID_PTR, + pub ulParameterLen: CK_ULONG, } #[test] -fn bindgen_test_layout__CK_MECHANISM() { - const UNINIT: ::std::mem::MaybeUninit<_CK_MECHANISM> = ::std::mem::MaybeUninit::uninit(); +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::<_CK_MECHANISM>(), + ::std::mem::size_of::(), 24usize, - concat!("Size of: ", stringify!(_CK_MECHANISM)) + concat!("Size of: ", stringify!(CK_MECHANISM)) ); assert_eq!( - ::std::mem::align_of::<_CK_MECHANISM>(), + ::std::mem::align_of::(), 8usize, - concat!("Alignment of ", stringify!(_CK_MECHANISM)) + 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!(CK_MECHANISM), "::", stringify!(mechanism) ) @@ -1331,7 +1544,7 @@ fn bindgen_test_layout__CK_MECHANISM() { 8usize, concat!( "Offset of field: ", - stringify!(_CK_MECHANISM), + stringify!(CK_MECHANISM), "::", stringify!(pParameter) ) @@ -1341,13 +1554,13 @@ fn bindgen_test_layout__CK_MECHANISM() { 16usize, concat!( "Offset of field: ", - stringify!(_CK_MECHANISM), + stringify!(CK_MECHANISM), "::", stringify!(ulParameterLen) ) ); } -impl Default for _CK_MECHANISM { +impl Default for CK_MECHANISM { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { @@ -1356,33 +1569,34 @@ impl Default for _CK_MECHANISM { } } } +pub type CK_MECHANISM_PTR = *mut CK_MECHANISM; #[repr(C)] #[derive(Debug, Default, Copy, Clone)] -pub struct _CK_MECHANISM_INFO { - pub ulMinKeySize: ::std::os::raw::c_ulong, - pub ulMaxKeySize: ::std::os::raw::c_ulong, +pub struct CK_MECHANISM_INFO { + pub ulMinKeySize: CK_ULONG, + pub ulMaxKeySize: CK_ULONG, pub flags: CK_FLAGS, } #[test] -fn bindgen_test_layout__CK_MECHANISM_INFO() { - const UNINIT: ::std::mem::MaybeUninit<_CK_MECHANISM_INFO> = ::std::mem::MaybeUninit::uninit(); +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::<_CK_MECHANISM_INFO>(), + ::std::mem::size_of::(), 24usize, - concat!("Size of: ", stringify!(_CK_MECHANISM_INFO)) + concat!("Size of: ", stringify!(CK_MECHANISM_INFO)) ); assert_eq!( - ::std::mem::align_of::<_CK_MECHANISM_INFO>(), + ::std::mem::align_of::(), 8usize, - concat!("Alignment of ", stringify!(_CK_MECHANISM_INFO)) + 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!(CK_MECHANISM_INFO), "::", stringify!(ulMinKeySize) ) @@ -1392,7 +1606,7 @@ fn bindgen_test_layout__CK_MECHANISM_INFO() { 8usize, concat!( "Offset of field: ", - stringify!(_CK_MECHANISM_INFO), + stringify!(CK_MECHANISM_INFO), "::", stringify!(ulMaxKeySize) ) @@ -1402,66 +1616,78 @@ fn bindgen_test_layout__CK_MECHANISM_INFO() { 16usize, concat!( "Offset of field: ", - stringify!(_CK_MECHANISM_INFO), + stringify!(CK_MECHANISM_INFO), "::", stringify!(flags) ) ); } -pub type CK_PARAM_TYPE = ::std::os::raw::c_ulong; +pub type CK_MECHANISM_INFO_PTR = *mut CK_MECHANISM_INFO; +pub type CK_RV = CK_ULONG; +pub type CK_NOTIFY = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + event: CK_NOTIFICATION, + pApplication: CK_VOID_PTR, + ) -> CK_RV, +>; +pub type CK_FUNCTION_LIST_PTR = *mut CK_FUNCTION_LIST; +pub type CK_FUNCTION_LIST_3_0_PTR = *mut CK_FUNCTION_LIST_3_0; +pub type CK_FUNCTION_LIST_PTR_PTR = *mut CK_FUNCTION_LIST_PTR; +pub type CK_FUNCTION_LIST_3_0_PTR_PTR = *mut CK_FUNCTION_LIST_3_0_PTR; #[repr(C)] #[derive(Debug, Copy, Clone)] -pub struct CK_OTP_PARAM { - pub type_: CK_PARAM_TYPE, - pub pValue: *mut ::std::os::raw::c_void, - pub ulValueLen: ::std::os::raw::c_ulong, +pub struct CK_INTERFACE { + pub pInterfaceName: *mut CK_CHAR, + pub pFunctionList: CK_VOID_PTR, + pub flags: CK_FLAGS, } #[test] -fn bindgen_test_layout_CK_OTP_PARAM() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); +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::(), + ::std::mem::size_of::(), 24usize, - concat!("Size of: ", stringify!(CK_OTP_PARAM)) + concat!("Size of: ", stringify!(CK_INTERFACE)) ); assert_eq!( - ::std::mem::align_of::(), + ::std::mem::align_of::(), 8usize, - concat!("Alignment of ", stringify!(CK_OTP_PARAM)) + concat!("Alignment of ", stringify!(CK_INTERFACE)) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).type_) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).pInterfaceName) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", - stringify!(CK_OTP_PARAM), + stringify!(CK_INTERFACE), "::", - stringify!(type_) + stringify!(pInterfaceName) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pValue) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).pFunctionList) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", - stringify!(CK_OTP_PARAM), + stringify!(CK_INTERFACE), "::", - stringify!(pValue) + stringify!(pFunctionList) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulValueLen) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).flags) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", - stringify!(CK_OTP_PARAM), + stringify!(CK_INTERFACE), "::", - stringify!(ulValueLen) + stringify!(flags) ) ); } -impl Default for CK_OTP_PARAM { +impl Default for CK_INTERFACE { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { @@ -1470,99 +1696,100 @@ impl Default for CK_OTP_PARAM { } } } +pub type CK_INTERFACE_PTR = *mut CK_INTERFACE; +pub type CK_INTERFACE_PTR_PTR = *mut CK_INTERFACE_PTR; +pub type CK_CREATEMUTEX = + ::std::option::Option CK_RV>; +pub type CK_DESTROYMUTEX = + ::std::option::Option CK_RV>; +pub type CK_LOCKMUTEX = ::std::option::Option CK_RV>; +pub type CK_UNLOCKMUTEX = ::std::option::Option CK_RV>; #[repr(C)] #[derive(Debug, Copy, Clone)] -pub struct CK_OTP_PARAMS { - pub pParams: *mut CK_OTP_PARAM, - pub ulCount: ::std::os::raw::c_ulong, +pub struct CK_C_INITIALIZE_ARGS { + pub CreateMutex: CK_CREATEMUTEX, + pub DestroyMutex: CK_DESTROYMUTEX, + pub LockMutex: CK_LOCKMUTEX, + pub UnlockMutex: CK_UNLOCKMUTEX, + pub flags: CK_FLAGS, + pub pReserved: CK_VOID_PTR, } #[test] -fn bindgen_test_layout_CK_OTP_PARAMS() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); +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::(), - 16usize, - concat!("Size of: ", stringify!(CK_OTP_PARAMS)) + ::std::mem::size_of::(), + 48usize, + concat!("Size of: ", stringify!(CK_C_INITIALIZE_ARGS)) ); assert_eq!( - ::std::mem::align_of::(), + ::std::mem::align_of::(), 8usize, - concat!("Alignment of ", stringify!(CK_OTP_PARAMS)) + concat!("Alignment of ", stringify!(CK_C_INITIALIZE_ARGS)) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pParams) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).CreateMutex) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", - stringify!(CK_OTP_PARAMS), + stringify!(CK_C_INITIALIZE_ARGS), "::", - stringify!(pParams) + stringify!(CreateMutex) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulCount) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).DestroyMutex) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", - stringify!(CK_OTP_PARAMS), + stringify!(CK_C_INITIALIZE_ARGS), "::", - stringify!(ulCount) + stringify!(DestroyMutex) ) ); -} -impl Default for CK_OTP_PARAMS { - fn default() -> Self { - let mut s = ::std::mem::MaybeUninit::::uninit(); - unsafe { - ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct CK_OTP_SIGNATURE_INFO { - pub pParams: *mut CK_OTP_PARAM, - pub ulCount: ::std::os::raw::c_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::(), + unsafe { ::std::ptr::addr_of!((*ptr).LockMutex) as usize - ptr as usize }, 16usize, - concat!("Size of: ", stringify!(CK_OTP_SIGNATURE_INFO)) + concat!( + "Offset of field: ", + stringify!(CK_C_INITIALIZE_ARGS), + "::", + stringify!(LockMutex) + ) ); assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(CK_OTP_SIGNATURE_INFO)) + 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).pParams) as usize - ptr as usize }, - 0usize, + unsafe { ::std::ptr::addr_of!((*ptr).flags) as usize - ptr as usize }, + 32usize, concat!( "Offset of field: ", - stringify!(CK_OTP_SIGNATURE_INFO), + stringify!(CK_C_INITIALIZE_ARGS), "::", - stringify!(pParams) + stringify!(flags) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulCount) as usize - ptr as usize }, - 8usize, + unsafe { ::std::ptr::addr_of!((*ptr).pReserved) as usize - ptr as usize }, + 40usize, concat!( "Offset of field: ", - stringify!(CK_OTP_SIGNATURE_INFO), + stringify!(CK_C_INITIALIZE_ARGS), "::", - stringify!(ulCount) + stringify!(pReserved) ) ); } -impl Default for CK_OTP_SIGNATURE_INFO { +impl Default for CK_C_INITIALIZE_ARGS { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { @@ -1571,35 +1798,41 @@ impl Default for CK_OTP_SIGNATURE_INFO { } } } -pub type CK_RSA_PKCS_MGF_TYPE = ::std::os::raw::c_ulong; +pub type CK_C_INITIALIZE_ARGS_PTR = *mut CK_C_INITIALIZE_ARGS; +pub type CK_RSA_PKCS_MGF_TYPE = CK_ULONG; +pub type CK_RSA_PKCS_MGF_TYPE_PTR = *mut CK_RSA_PKCS_MGF_TYPE; +pub type CK_RSA_PKCS_OAEP_SOURCE_TYPE = CK_ULONG; +pub type CK_RSA_PKCS_OAEP_SOURCE_TYPE_PTR = *mut CK_RSA_PKCS_OAEP_SOURCE_TYPE; #[repr(C)] -#[derive(Debug, Default, Copy, Clone)] -pub struct ck_rsa_pkcs_pss_params { +#[derive(Debug, Copy, Clone)] +pub struct CK_RSA_PKCS_OAEP_PARAMS { pub hashAlg: CK_MECHANISM_TYPE, pub mgf: CK_RSA_PKCS_MGF_TYPE, - pub sLen: ::std::os::raw::c_ulong, + pub source: CK_RSA_PKCS_OAEP_SOURCE_TYPE, + pub pSourceData: CK_VOID_PTR, + pub ulSourceDataLen: CK_ULONG, } #[test] -fn bindgen_test_layout_ck_rsa_pkcs_pss_params() { - const UNINIT: ::std::mem::MaybeUninit = +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_pss_params)) + ::std::mem::size_of::(), + 40usize, + concat!("Size of: ", stringify!(CK_RSA_PKCS_OAEP_PARAMS)) ); assert_eq!( - ::std::mem::align_of::(), + ::std::mem::align_of::(), 8usize, - concat!("Alignment of ", stringify!(ck_rsa_pkcs_pss_params)) + 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_pss_params), + stringify!(CK_RSA_PKCS_OAEP_PARAMS), "::", stringify!(hashAlg) ) @@ -1609,75 +1842,19 @@ fn bindgen_test_layout_ck_rsa_pkcs_pss_params() { 8usize, concat!( "Offset of field: ", - stringify!(ck_rsa_pkcs_pss_params), + stringify!(CK_RSA_PKCS_OAEP_PARAMS), "::", stringify!(mgf) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).sLen) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).source) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", - stringify!(ck_rsa_pkcs_pss_params), + stringify!(CK_RSA_PKCS_OAEP_PARAMS), "::", - stringify!(sLen) - ) - ); -} -pub type CK_RSA_PKCS_OAEP_SOURCE_TYPE = ::std::os::raw::c_ulong; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct ck_rsa_pkcs_oaep_params { - pub hashAlg: CK_MECHANISM_TYPE, - pub mgf: CK_RSA_PKCS_MGF_TYPE, - pub source: CK_RSA_PKCS_OAEP_SOURCE_TYPE, - pub pSourceData: *mut ::std::os::raw::c_void, - pub ulSourceDataLen: ::std::os::raw::c_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::(), - 40usize, - concat!("Size of: ", stringify!(ck_rsa_pkcs_oaep_params)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - 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 }, - 8usize, - 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 }, - 16usize, - concat!( - "Offset of field: ", - stringify!(ck_rsa_pkcs_oaep_params), - "::", - stringify!(source) + stringify!(source) ) ); assert_eq!( @@ -1685,7 +1862,7 @@ fn bindgen_test_layout_ck_rsa_pkcs_oaep_params() { 24usize, concat!( "Offset of field: ", - stringify!(ck_rsa_pkcs_oaep_params), + stringify!(CK_RSA_PKCS_OAEP_PARAMS), "::", stringify!(pSourceData) ) @@ -1695,13 +1872,13 @@ fn bindgen_test_layout_ck_rsa_pkcs_oaep_params() { 32usize, concat!( "Offset of field: ", - stringify!(ck_rsa_pkcs_oaep_params), + stringify!(CK_RSA_PKCS_OAEP_PARAMS), "::", stringify!(ulSourceDataLen) ) ); } -impl Default for ck_rsa_pkcs_oaep_params { +impl Default for CK_RSA_PKCS_OAEP_PARAMS { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { @@ -1710,133 +1887,138 @@ impl Default for ck_rsa_pkcs_oaep_params { } } } +pub type CK_RSA_PKCS_OAEP_PARAMS_PTR = *mut CK_RSA_PKCS_OAEP_PARAMS; #[repr(C)] #[derive(Debug, Default, Copy, Clone)] -pub struct ck_aes_ctr_params { - pub ulCounterBits: ::std::os::raw::c_ulong, - pub cb: [::std::os::raw::c_uchar; 16usize], +pub struct CK_RSA_PKCS_PSS_PARAMS { + pub hashAlg: CK_MECHANISM_TYPE, + pub mgf: CK_RSA_PKCS_MGF_TYPE, + pub sLen: CK_ULONG, } #[test] -fn bindgen_test_layout_ck_aes_ctr_params() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); +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::(), + ::std::mem::size_of::(), 24usize, - concat!("Size of: ", stringify!(ck_aes_ctr_params)) + concat!("Size of: ", stringify!(CK_RSA_PKCS_PSS_PARAMS)) ); assert_eq!( - ::std::mem::align_of::(), + ::std::mem::align_of::(), 8usize, - concat!("Alignment of ", stringify!(ck_aes_ctr_params)) + concat!("Alignment of ", stringify!(CK_RSA_PKCS_PSS_PARAMS)) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulCounterBits) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).hashAlg) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", - stringify!(ck_aes_ctr_params), + stringify!(CK_RSA_PKCS_PSS_PARAMS), "::", - stringify!(ulCounterBits) + stringify!(hashAlg) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).cb) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).mgf) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", - stringify!(ck_aes_ctr_params), + stringify!(CK_RSA_PKCS_PSS_PARAMS), "::", - stringify!(cb) + stringify!(mgf) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).sLen) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(CK_RSA_PKCS_PSS_PARAMS), + "::", + stringify!(sLen) ) ); } +pub type CK_RSA_PKCS_PSS_PARAMS_PTR = *mut CK_RSA_PKCS_PSS_PARAMS; +pub type CK_EC_KDF_TYPE = CK_ULONG; #[repr(C)] #[derive(Debug, Copy, Clone)] -pub struct ck_gcm_params { - pub pIv: *mut ::std::os::raw::c_uchar, - pub ulIvLen: ::std::os::raw::c_ulong, - pub ulIvBits: ::std::os::raw::c_ulong, - pub pAAD: *mut ::std::os::raw::c_uchar, - pub ulAADLen: ::std::os::raw::c_ulong, - pub ulTagBits: ::std::os::raw::c_ulong, +pub struct CK_ECDH1_DERIVE_PARAMS { + pub kdf: CK_EC_KDF_TYPE, + pub ulSharedDataLen: CK_ULONG, + pub pSharedData: CK_BYTE_PTR, + pub ulPublicDataLen: CK_ULONG, + pub pPublicData: CK_BYTE_PTR, } #[test] -fn bindgen_test_layout_ck_gcm_params() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); +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::(), - 48usize, - concat!("Size of: ", stringify!(ck_gcm_params)) + ::std::mem::size_of::(), + 40usize, + concat!("Size of: ", stringify!(CK_ECDH1_DERIVE_PARAMS)) ); assert_eq!( - ::std::mem::align_of::(), + ::std::mem::align_of::(), 8usize, - concat!("Alignment of ", stringify!(ck_gcm_params)) + concat!("Alignment of ", stringify!(CK_ECDH1_DERIVE_PARAMS)) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pIv) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).kdf) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", - stringify!(ck_gcm_params), + stringify!(CK_ECDH1_DERIVE_PARAMS), "::", - stringify!(pIv) + stringify!(kdf) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulIvLen) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ulSharedDataLen) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", - stringify!(ck_gcm_params), + stringify!(CK_ECDH1_DERIVE_PARAMS), "::", - stringify!(ulIvLen) + stringify!(ulSharedDataLen) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulIvBits) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).pSharedData) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", - stringify!(ck_gcm_params), + stringify!(CK_ECDH1_DERIVE_PARAMS), "::", - stringify!(ulIvBits) + stringify!(pSharedData) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pAAD) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ulPublicDataLen) as usize - ptr as usize }, 24usize, concat!( "Offset of field: ", - stringify!(ck_gcm_params), + stringify!(CK_ECDH1_DERIVE_PARAMS), "::", - stringify!(pAAD) + stringify!(ulPublicDataLen) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulAADLen) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).pPublicData) as usize - ptr as usize }, 32usize, concat!( "Offset of field: ", - stringify!(ck_gcm_params), - "::", - stringify!(ulAADLen) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulTagBits) as usize - ptr as usize }, - 40usize, - concat!( - "Offset of field: ", - stringify!(ck_gcm_params), + stringify!(CK_ECDH1_DERIVE_PARAMS), "::", - stringify!(ulTagBits) + stringify!(pPublicData) ) ); } -impl Default for ck_gcm_params { +impl Default for CK_ECDH1_DERIVE_PARAMS { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { @@ -1845,37 +2027,41 @@ impl Default for ck_gcm_params { } } } -pub type ck_ec_kdf_t = ::std::os::raw::c_ulong; +pub type CK_ECDH1_DERIVE_PARAMS_PTR = *mut CK_ECDH1_DERIVE_PARAMS; #[repr(C)] #[derive(Debug, Copy, Clone)] -pub struct ck_ecdh1_derive_params { - pub kdf: ck_ec_kdf_t, - pub ulSharedDataLen: ::std::os::raw::c_ulong, - pub pSharedData: *mut ::std::os::raw::c_uchar, - pub ulPublicDataLen: ::std::os::raw::c_ulong, - pub pPublicData: *mut ::std::os::raw::c_uchar, +pub struct CK_ECDH2_DERIVE_PARAMS { + pub kdf: CK_EC_KDF_TYPE, + pub ulSharedDataLen: CK_ULONG, + pub pSharedData: CK_BYTE_PTR, + pub ulPublicDataLen: CK_ULONG, + pub pPublicData: CK_BYTE_PTR, + pub ulPrivateDataLen: CK_ULONG, + pub hPrivateData: CK_OBJECT_HANDLE, + pub ulPublicDataLen2: CK_ULONG, + pub pPublicData2: CK_BYTE_PTR, } #[test] -fn bindgen_test_layout_ck_ecdh1_derive_params() { - const UNINIT: ::std::mem::MaybeUninit = +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::(), - 40usize, - concat!("Size of: ", stringify!(ck_ecdh1_derive_params)) + ::std::mem::size_of::(), + 72usize, + concat!("Size of: ", stringify!(CK_ECDH2_DERIVE_PARAMS)) ); assert_eq!( - ::std::mem::align_of::(), + ::std::mem::align_of::(), 8usize, - concat!("Alignment of ", stringify!(ck_ecdh1_derive_params)) + 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_ecdh1_derive_params), + stringify!(CK_ECDH2_DERIVE_PARAMS), "::", stringify!(kdf) ) @@ -1885,7 +2071,7 @@ fn bindgen_test_layout_ck_ecdh1_derive_params() { 8usize, concat!( "Offset of field: ", - stringify!(ck_ecdh1_derive_params), + stringify!(CK_ECDH2_DERIVE_PARAMS), "::", stringify!(ulSharedDataLen) ) @@ -1895,7 +2081,7 @@ fn bindgen_test_layout_ck_ecdh1_derive_params() { 16usize, concat!( "Offset of field: ", - stringify!(ck_ecdh1_derive_params), + stringify!(CK_ECDH2_DERIVE_PARAMS), "::", stringify!(pSharedData) ) @@ -1905,7 +2091,7 @@ fn bindgen_test_layout_ck_ecdh1_derive_params() { 24usize, concat!( "Offset of field: ", - stringify!(ck_ecdh1_derive_params), + stringify!(CK_ECDH2_DERIVE_PARAMS), "::", stringify!(ulPublicDataLen) ) @@ -1915,13 +2101,53 @@ fn bindgen_test_layout_ck_ecdh1_derive_params() { 32usize, concat!( "Offset of field: ", - stringify!(ck_ecdh1_derive_params), + stringify!(CK_ECDH2_DERIVE_PARAMS), "::", stringify!(pPublicData) ) ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ulPrivateDataLen) as usize - ptr as usize }, + 40usize, + 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 }, + 48usize, + 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 }, + 56usize, + 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 }, + 64usize, + concat!( + "Offset of field: ", + stringify!(CK_ECDH2_DERIVE_PARAMS), + "::", + stringify!(pPublicData2) + ) + ); } -impl Default for ck_ecdh1_derive_params { +impl Default for CK_ECDH2_DERIVE_PARAMS { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { @@ -1930,49 +2156,138 @@ impl Default for ck_ecdh1_derive_params { } } } +pub type CK_ECDH2_DERIVE_PARAMS_PTR = *mut CK_ECDH2_DERIVE_PARAMS; #[repr(C)] #[derive(Debug, Copy, Clone)] -pub struct ck_key_derivation_string_data { - pub pData: *mut ::std::os::raw::c_uchar, - pub ulLen: ::std::os::raw::c_ulong, +pub struct CK_ECMQV_DERIVE_PARAMS { + pub kdf: CK_EC_KDF_TYPE, + pub ulSharedDataLen: CK_ULONG, + pub pSharedData: CK_BYTE_PTR, + pub ulPublicDataLen: CK_ULONG, + pub pPublicData: CK_BYTE_PTR, + pub ulPrivateDataLen: CK_ULONG, + pub hPrivateData: CK_OBJECT_HANDLE, + pub ulPublicDataLen2: CK_ULONG, + pub pPublicData2: CK_BYTE_PTR, + pub publicKey: CK_OBJECT_HANDLE, } #[test] -fn bindgen_test_layout_ck_key_derivation_string_data() { - const UNINIT: ::std::mem::MaybeUninit = +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::(), - 16usize, - concat!("Size of: ", stringify!(ck_key_derivation_string_data)) + ::std::mem::size_of::(), + 80usize, + concat!("Size of: ", stringify!(CK_ECMQV_DERIVE_PARAMS)) ); assert_eq!( - ::std::mem::align_of::(), + ::std::mem::align_of::(), 8usize, - concat!("Alignment of ", stringify!(ck_key_derivation_string_data)) + concat!("Alignment of ", stringify!(CK_ECMQV_DERIVE_PARAMS)) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pData) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).kdf) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", - stringify!(ck_key_derivation_string_data), + stringify!(CK_ECMQV_DERIVE_PARAMS), "::", - stringify!(pData) + stringify!(kdf) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ulLen) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ulSharedDataLen) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", - stringify!(ck_key_derivation_string_data), + stringify!(CK_ECMQV_DERIVE_PARAMS), "::", - stringify!(ulLen) + stringify!(ulSharedDataLen) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pSharedData) as usize - ptr as usize }, + 16usize, + 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 }, + 24usize, + 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 }, + 32usize, + 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 }, + 40usize, + 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 }, + 48usize, + 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 }, + 56usize, + 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 }, + 64usize, + 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 }, + 72usize, + concat!( + "Offset of field: ", + stringify!(CK_ECMQV_DERIVE_PARAMS), + "::", + stringify!(publicKey) ) ); } -impl Default for ck_key_derivation_string_data { +impl Default for CK_ECMQV_DERIVE_PARAMS { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { @@ -1981,60 +2296,85 @@ impl Default for ck_key_derivation_string_data { } } } +pub type CK_ECMQV_DERIVE_PARAMS_PTR = *mut CK_ECMQV_DERIVE_PARAMS; +pub type CK_X9_42_DH_KDF_TYPE = CK_ULONG; +pub type CK_X9_42_DH_KDF_TYPE_PTR = *mut CK_X9_42_DH_KDF_TYPE; #[repr(C)] #[derive(Debug, Copy, Clone)] -pub struct ck_des_cbc_encrypt_data_params { - pub iv: [::std::os::raw::c_uchar; 8usize], - pub pData: *mut ::std::os::raw::c_uchar, - pub length: ::std::os::raw::c_ulong, +pub struct CK_X9_42_DH1_DERIVE_PARAMS { + pub kdf: CK_X9_42_DH_KDF_TYPE, + pub ulOtherInfoLen: CK_ULONG, + pub pOtherInfo: CK_BYTE_PTR, + pub ulPublicDataLen: CK_ULONG, + pub pPublicData: CK_BYTE_PTR, } #[test] -fn bindgen_test_layout_ck_des_cbc_encrypt_data_params() { - const UNINIT: ::std::mem::MaybeUninit = +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::(), - 24usize, - concat!("Size of: ", stringify!(ck_des_cbc_encrypt_data_params)) + ::std::mem::size_of::(), + 40usize, + concat!("Size of: ", stringify!(CK_X9_42_DH1_DERIVE_PARAMS)) ); assert_eq!( - ::std::mem::align_of::(), + ::std::mem::align_of::(), 8usize, - concat!("Alignment of ", stringify!(ck_des_cbc_encrypt_data_params)) + concat!("Alignment of ", stringify!(CK_X9_42_DH1_DERIVE_PARAMS)) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).iv) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).kdf) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", - stringify!(ck_des_cbc_encrypt_data_params), + stringify!(CK_X9_42_DH1_DERIVE_PARAMS), "::", - stringify!(iv) + stringify!(kdf) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pData) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ulOtherInfoLen) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", - stringify!(ck_des_cbc_encrypt_data_params), + stringify!(CK_X9_42_DH1_DERIVE_PARAMS), "::", - stringify!(pData) + stringify!(ulOtherInfoLen) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).length) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).pOtherInfo) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", - stringify!(ck_des_cbc_encrypt_data_params), + stringify!(CK_X9_42_DH1_DERIVE_PARAMS), "::", - stringify!(length) + stringify!(pOtherInfo) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ulPublicDataLen) as usize - ptr as usize }, + 24usize, + 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 }, + 32usize, + concat!( + "Offset of field: ", + stringify!(CK_X9_42_DH1_DERIVE_PARAMS), + "::", + stringify!(pPublicData) ) ); } -impl Default for ck_des_cbc_encrypt_data_params { +impl Default for CK_X9_42_DH1_DERIVE_PARAMS { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { @@ -2043,540 +2383,7363 @@ impl Default for ck_des_cbc_encrypt_data_params { } } } +pub type CK_X9_42_DH1_DERIVE_PARAMS_PTR = *mut CK_X9_42_DH1_DERIVE_PARAMS; #[repr(C)] #[derive(Debug, Copy, Clone)] -pub struct ck_aes_cbc_encrypt_data_params { - pub iv: [::std::os::raw::c_uchar; 16usize], - pub pData: *mut ::std::os::raw::c_uchar, - pub length: ::std::os::raw::c_ulong, +pub struct CK_X9_42_DH2_DERIVE_PARAMS { + pub kdf: CK_X9_42_DH_KDF_TYPE, + pub ulOtherInfoLen: CK_ULONG, + pub pOtherInfo: CK_BYTE_PTR, + pub ulPublicDataLen: CK_ULONG, + pub pPublicData: CK_BYTE_PTR, + pub ulPrivateDataLen: CK_ULONG, + pub hPrivateData: CK_OBJECT_HANDLE, + pub ulPublicDataLen2: CK_ULONG, + pub pPublicData2: CK_BYTE_PTR, } #[test] -fn bindgen_test_layout_ck_aes_cbc_encrypt_data_params() { - const UNINIT: ::std::mem::MaybeUninit = +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::(), - 32usize, - concat!("Size of: ", stringify!(ck_aes_cbc_encrypt_data_params)) + ::std::mem::size_of::(), + 72usize, + concat!("Size of: ", stringify!(CK_X9_42_DH2_DERIVE_PARAMS)) ); assert_eq!( - ::std::mem::align_of::(), + ::std::mem::align_of::(), 8usize, - concat!("Alignment of ", stringify!(ck_aes_cbc_encrypt_data_params)) + concat!("Alignment of ", stringify!(CK_X9_42_DH2_DERIVE_PARAMS)) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).iv) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).kdf) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", - stringify!(ck_aes_cbc_encrypt_data_params), + stringify!(CK_X9_42_DH2_DERIVE_PARAMS), "::", - stringify!(iv) + stringify!(kdf) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pData) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ulOtherInfoLen) as usize - ptr as usize }, + 8usize, + 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 }, 16usize, concat!( "Offset of field: ", - stringify!(ck_aes_cbc_encrypt_data_params), + stringify!(CK_X9_42_DH2_DERIVE_PARAMS), "::", - stringify!(pData) + stringify!(pOtherInfo) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).length) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ulPublicDataLen) as usize - ptr as usize }, 24usize, concat!( "Offset of field: ", - stringify!(ck_aes_cbc_encrypt_data_params), + stringify!(CK_X9_42_DH2_DERIVE_PARAMS), "::", - stringify!(length) + stringify!(ulPublicDataLen) ) ); -} -impl Default for ck_aes_cbc_encrypt_data_params { - fn default() -> Self { - let mut s = ::std::mem::MaybeUninit::::uninit(); - unsafe { - ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -pub type CK_RV = ::std::os::raw::c_ulong; -pub type CK_NOTIFY = ::std::option::Option< - unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - event: CK_NOTIFICATION, - application: *mut ::std::os::raw::c_void, - ) -> CK_RV, ->; -pub type CK_C_Initialize = - ::std::option::Option CK_RV>; -pub type CK_C_Finalize = - ::std::option::Option CK_RV>; -pub type CK_C_GetInfo = ::std::option::Option CK_RV>; -pub type CK_C_GetFunctionList = ::std::option::Option< - unsafe extern "C" fn(function_list: *mut *mut _CK_FUNCTION_LIST) -> CK_RV, ->; -pub type CK_C_GetSlotList = ::std::option::Option< - unsafe extern "C" fn( - token_present: ::std::os::raw::c_uchar, - slot_list: *mut CK_SLOT_ID, - ulCount: *mut ::std::os::raw::c_ulong, - ) -> CK_RV, ->; -pub type CK_C_GetSlotInfo = ::std::option::Option< - unsafe extern "C" fn(slotID: CK_SLOT_ID, info: *mut _CK_SLOT_INFO) -> CK_RV, ->; -pub type CK_C_GetTokenInfo = ::std::option::Option< - unsafe extern "C" fn(slotID: CK_SLOT_ID, info: *mut _CK_TOKEN_INFO) -> CK_RV, ->; -pub type CK_C_WaitForSlotEvent = ::std::option::Option< + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pPublicData) as usize - ptr as usize }, + 32usize, + 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 }, + 40usize, + 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 }, + 48usize, + 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 }, + 56usize, + 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 }, + 64usize, + concat!( + "Offset of field: ", + stringify!(CK_X9_42_DH2_DERIVE_PARAMS), + "::", + stringify!(pPublicData2) + ) + ); +} +impl Default for CK_X9_42_DH2_DERIVE_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_X9_42_DH2_DERIVE_PARAMS_PTR = *mut CK_X9_42_DH2_DERIVE_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_X9_42_MQV_DERIVE_PARAMS { + pub kdf: CK_X9_42_DH_KDF_TYPE, + pub ulOtherInfoLen: CK_ULONG, + pub pOtherInfo: CK_BYTE_PTR, + pub ulPublicDataLen: CK_ULONG, + pub pPublicData: CK_BYTE_PTR, + pub ulPrivateDataLen: CK_ULONG, + pub hPrivateData: CK_OBJECT_HANDLE, + pub ulPublicDataLen2: CK_ULONG, + 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::(), + 80usize, + concat!("Size of: ", stringify!(CK_X9_42_MQV_DERIVE_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + 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 }, + 16usize, + 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 }, + 24usize, + 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 }, + 32usize, + 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 }, + 40usize, + 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 }, + 48usize, + 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 }, + 56usize, + 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 }, + 64usize, + 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 }, + 72usize, + concat!( + "Offset of field: ", + stringify!(CK_X9_42_MQV_DERIVE_PARAMS), + "::", + stringify!(publicKey) + ) + ); +} +impl Default for CK_X9_42_MQV_DERIVE_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_X9_42_MQV_DERIVE_PARAMS_PTR = *mut CK_X9_42_MQV_DERIVE_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_KEA_DERIVE_PARAMS { + pub isSender: CK_BBOOL, + pub ulRandomLen: CK_ULONG, + pub pRandomA: CK_BYTE_PTR, + pub pRandomB: CK_BYTE_PTR, + 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::(), + 48usize, + concat!("Size of: ", stringify!(CK_KEA_DERIVE_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + 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 }, + 16usize, + 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 }, + 24usize, + 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 }, + 32usize, + 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 }, + 40usize, + concat!( + "Offset of field: ", + stringify!(CK_KEA_DERIVE_PARAMS), + "::", + stringify!(pPublicData) + ) + ); +} +impl Default for CK_KEA_DERIVE_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_KEA_DERIVE_PARAMS_PTR = *mut CK_KEA_DERIVE_PARAMS; +pub type CK_RC2_PARAMS = CK_ULONG; +pub type CK_RC2_PARAMS_PTR = *mut CK_RC2_PARAMS; +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +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::(), + 16usize, + concat!("Size of: ", stringify!(CK_RC2_CBC_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + concat!( + "Offset of field: ", + stringify!(CK_RC2_CBC_PARAMS), + "::", + stringify!(iv) + ) + ); +} +pub type CK_RC2_CBC_PARAMS_PTR = *mut CK_RC2_CBC_PARAMS; +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +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::(), + 16usize, + concat!("Size of: ", stringify!(CK_RC2_MAC_GENERAL_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + concat!( + "Offset of field: ", + stringify!(CK_RC2_MAC_GENERAL_PARAMS), + "::", + stringify!(ulMacLength) + ) + ); +} +pub type CK_RC2_MAC_GENERAL_PARAMS_PTR = *mut CK_RC2_MAC_GENERAL_PARAMS; +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +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::(), + 16usize, + concat!("Size of: ", stringify!(CK_RC5_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + concat!( + "Offset of field: ", + stringify!(CK_RC5_PARAMS), + "::", + stringify!(ulRounds) + ) + ); +} +pub type CK_RC5_PARAMS_PTR = *mut CK_RC5_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_RC5_CBC_PARAMS { + pub ulWordsize: CK_ULONG, + pub ulRounds: CK_ULONG, + 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::(), + 32usize, + concat!("Size of: ", stringify!(CK_RC5_CBC_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + 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 }, + 16usize, + 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 }, + 24usize, + concat!( + "Offset of field: ", + stringify!(CK_RC5_CBC_PARAMS), + "::", + stringify!(ulIvLen) + ) + ); +} +impl Default for CK_RC5_CBC_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_RC5_CBC_PARAMS_PTR = *mut CK_RC5_CBC_PARAMS; +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct CK_RC5_MAC_GENERAL_PARAMS { + pub ulWordsize: CK_ULONG, + 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::(), + 24usize, + concat!("Size of: ", stringify!(CK_RC5_MAC_GENERAL_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + 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 }, + 16usize, + concat!( + "Offset of field: ", + stringify!(CK_RC5_MAC_GENERAL_PARAMS), + "::", + stringify!(ulMacLength) + ) + ); +} +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; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_DES_CBC_ENCRYPT_DATA_PARAMS { + pub iv: [CK_BYTE; 8usize], + 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::(), + 24usize, + concat!("Size of: ", stringify!(CK_DES_CBC_ENCRYPT_DATA_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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) + ) + ); +} +impl Default for CK_DES_CBC_ENCRYPT_DATA_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_DES_CBC_ENCRYPT_DATA_PARAMS_PTR = *mut CK_DES_CBC_ENCRYPT_DATA_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_AES_CBC_ENCRYPT_DATA_PARAMS { + pub iv: [CK_BYTE; 16usize], + 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::(), + 32usize, + concat!("Size of: ", stringify!(CK_AES_CBC_ENCRYPT_DATA_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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) + ) + ); +} +impl Default for CK_AES_CBC_ENCRYPT_DATA_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_AES_CBC_ENCRYPT_DATA_PARAMS_PTR = *mut CK_AES_CBC_ENCRYPT_DATA_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_SKIPJACK_PRIVATE_WRAP_PARAMS { + pub ulPasswordLen: CK_ULONG, + pub pPassword: CK_BYTE_PTR, + pub ulPublicDataLen: CK_ULONG, + pub pPublicData: CK_BYTE_PTR, + pub ulPAndGLen: CK_ULONG, + pub ulQLen: CK_ULONG, + pub ulRandomLen: CK_ULONG, + pub pRandomA: CK_BYTE_PTR, + pub pPrimeP: CK_BYTE_PTR, + 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::(), + 88usize, + concat!("Size of: ", stringify!(CK_SKIPJACK_PRIVATE_WRAP_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + 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 }, + 16usize, + 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 }, + 24usize, + 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 }, + 32usize, + 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 }, + 40usize, + 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 }, + 48usize, + 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 }, + 56usize, + 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 }, + 64usize, + 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 }, + 72usize, + 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 }, + 80usize, + concat!( + "Offset of field: ", + stringify!(CK_SKIPJACK_PRIVATE_WRAP_PARAMS), + "::", + stringify!(pSubprimeQ) + ) + ); +} +impl Default for CK_SKIPJACK_PRIVATE_WRAP_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_SKIPJACK_PRIVATE_WRAP_PARAMS_PTR = *mut CK_SKIPJACK_PRIVATE_WRAP_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_SKIPJACK_RELAYX_PARAMS { + pub ulOldWrappedXLen: CK_ULONG, + pub pOldWrappedX: CK_BYTE_PTR, + pub ulOldPasswordLen: CK_ULONG, + pub pOldPassword: CK_BYTE_PTR, + pub ulOldPublicDataLen: CK_ULONG, + pub pOldPublicData: CK_BYTE_PTR, + pub ulOldRandomLen: CK_ULONG, + pub pOldRandomA: CK_BYTE_PTR, + pub ulNewPasswordLen: CK_ULONG, + pub pNewPassword: CK_BYTE_PTR, + pub ulNewPublicDataLen: CK_ULONG, + pub pNewPublicData: CK_BYTE_PTR, + 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::(), + 112usize, + concat!("Size of: ", stringify!(CK_SKIPJACK_RELAYX_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + 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 }, + 16usize, + 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 }, + 24usize, + 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 }, + 32usize, + 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 }, + 40usize, + 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 }, + 48usize, + 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 }, + 56usize, + 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 }, + 64usize, + 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 }, + 72usize, + 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 }, + 80usize, + 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 }, + 88usize, + 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 }, + 96usize, + 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 }, + 104usize, + concat!( + "Offset of field: ", + stringify!(CK_SKIPJACK_RELAYX_PARAMS), + "::", + stringify!(pNewRandomA) + ) + ); +} +impl Default for CK_SKIPJACK_RELAYX_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_SKIPJACK_RELAYX_PARAMS_PTR = *mut CK_SKIPJACK_RELAYX_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_PBE_PARAMS { + pub pInitVector: CK_BYTE_PTR, + pub pPassword: CK_UTF8CHAR_PTR, + pub ulPasswordLen: CK_ULONG, + pub pSalt: CK_BYTE_PTR, + 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::(), + 48usize, + concat!("Size of: ", stringify!(CK_PBE_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 24usize, + concat!( + "Offset of field: ", + stringify!(CK_PBE_PARAMS), + "::", + stringify!(pSalt) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ulSaltLen) as usize - ptr as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(CK_PBE_PARAMS), + "::", + stringify!(ulSaltLen) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ulIteration) as usize - ptr as usize }, + 40usize, + concat!( + "Offset of field: ", + stringify!(CK_PBE_PARAMS), + "::", + stringify!(ulIteration) + ) + ); +} +impl Default for CK_PBE_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_PBE_PARAMS_PTR = *mut CK_PBE_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_KEY_WRAP_SET_OAEP_PARAMS { + pub bBC: CK_BYTE, + 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::(), + 24usize, + concat!("Size of: ", stringify!(CK_KEY_WRAP_SET_OAEP_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + 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 }, + 16usize, + concat!( + "Offset of field: ", + stringify!(CK_KEY_WRAP_SET_OAEP_PARAMS), + "::", + stringify!(ulXLen) + ) + ); +} +impl Default for CK_KEY_WRAP_SET_OAEP_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_KEY_WRAP_SET_OAEP_PARAMS_PTR = *mut CK_KEY_WRAP_SET_OAEP_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_SSL3_RANDOM_DATA { + pub pClientRandom: CK_BYTE_PTR, + pub ulClientRandomLen: CK_ULONG, + 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::(), + 32usize, + concat!("Size of: ", stringify!(CK_SSL3_RANDOM_DATA)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 16usize, + 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 }, + 24usize, + concat!( + "Offset of field: ", + stringify!(CK_SSL3_RANDOM_DATA), + "::", + stringify!(ulServerRandomLen) + ) + ); +} +impl Default for CK_SSL3_RANDOM_DATA { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct 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::(), + 40usize, + concat!("Size of: ", stringify!(CK_SSL3_MASTER_KEY_DERIVE_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 32usize, + concat!( + "Offset of field: ", + stringify!(CK_SSL3_MASTER_KEY_DERIVE_PARAMS), + "::", + stringify!(pVersion) + ) + ); +} +impl Default for CK_SSL3_MASTER_KEY_DERIVE_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_SSL3_MASTER_KEY_DERIVE_PARAMS_PTR = *mut CK_SSL3_MASTER_KEY_DERIVE_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_SSL3_KEY_MAT_OUT { + pub hClientMacSecret: CK_OBJECT_HANDLE, + pub hServerMacSecret: CK_OBJECT_HANDLE, + pub hClientKey: CK_OBJECT_HANDLE, + pub hServerKey: CK_OBJECT_HANDLE, + 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::(), + 48usize, + concat!("Size of: ", stringify!(CK_SSL3_KEY_MAT_OUT)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + 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 }, + 16usize, + 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 }, + 24usize, + 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 }, + 32usize, + 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 }, + 40usize, + concat!( + "Offset of field: ", + stringify!(CK_SSL3_KEY_MAT_OUT), + "::", + stringify!(pIVServer) + ) + ); +} +impl Default for CK_SSL3_KEY_MAT_OUT { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_SSL3_KEY_MAT_OUT_PTR = *mut CK_SSL3_KEY_MAT_OUT; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_SSL3_KEY_MAT_PARAMS { + pub ulMacSizeInBits: CK_ULONG, + pub ulKeySizeInBits: CK_ULONG, + pub ulIVSizeInBits: CK_ULONG, + pub bIsExport: CK_BBOOL, + 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::(), + 72usize, + concat!("Size of: ", stringify!(CK_SSL3_KEY_MAT_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + 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 }, + 16usize, + 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 }, + 24usize, + 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 }, + 32usize, + 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 }, + 64usize, + concat!( + "Offset of field: ", + stringify!(CK_SSL3_KEY_MAT_PARAMS), + "::", + stringify!(pReturnedKeyMaterial) + ) + ); +} +impl Default for CK_SSL3_KEY_MAT_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_SSL3_KEY_MAT_PARAMS_PTR = *mut CK_SSL3_KEY_MAT_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_TLS_PRF_PARAMS { + pub pSeed: CK_BYTE_PTR, + pub ulSeedLen: CK_ULONG, + pub pLabel: CK_BYTE_PTR, + pub ulLabelLen: CK_ULONG, + 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::(), + 48usize, + concat!("Size of: ", stringify!(CK_TLS_PRF_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 16usize, + 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 }, + 24usize, + 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 }, + 32usize, + 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 }, + 40usize, + concat!( + "Offset of field: ", + stringify!(CK_TLS_PRF_PARAMS), + "::", + stringify!(pulOutputLen) + ) + ); +} +impl Default for CK_TLS_PRF_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_TLS_PRF_PARAMS_PTR = *mut CK_TLS_PRF_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_WTLS_RANDOM_DATA { + pub pClientRandom: CK_BYTE_PTR, + pub ulClientRandomLen: CK_ULONG, + 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::(), + 32usize, + concat!("Size of: ", stringify!(CK_WTLS_RANDOM_DATA)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 16usize, + 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 }, + 24usize, + concat!( + "Offset of field: ", + stringify!(CK_WTLS_RANDOM_DATA), + "::", + stringify!(ulServerRandomLen) + ) + ); +} +impl Default for CK_WTLS_RANDOM_DATA { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_WTLS_RANDOM_DATA_PTR = *mut CK_WTLS_RANDOM_DATA; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_WTLS_MASTER_KEY_DERIVE_PARAMS { + pub DigestMechanism: CK_MECHANISM_TYPE, + 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::(), + 48usize, + concat!("Size of: ", stringify!(CK_WTLS_MASTER_KEY_DERIVE_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + 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 }, + 40usize, + concat!( + "Offset of field: ", + stringify!(CK_WTLS_MASTER_KEY_DERIVE_PARAMS), + "::", + stringify!(pVersion) + ) + ); +} +impl Default for CK_WTLS_MASTER_KEY_DERIVE_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_WTLS_MASTER_KEY_DERIVE_PARAMS_PTR = *mut CK_WTLS_MASTER_KEY_DERIVE_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_WTLS_PRF_PARAMS { + pub DigestMechanism: CK_MECHANISM_TYPE, + pub pSeed: CK_BYTE_PTR, + pub ulSeedLen: CK_ULONG, + pub pLabel: CK_BYTE_PTR, + pub ulLabelLen: CK_ULONG, + 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::(), + 56usize, + concat!("Size of: ", stringify!(CK_WTLS_PRF_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + 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 }, + 16usize, + 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 }, + 24usize, + 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 }, + 32usize, + 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 }, + 40usize, + 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 }, + 48usize, + concat!( + "Offset of field: ", + stringify!(CK_WTLS_PRF_PARAMS), + "::", + stringify!(pulOutputLen) + ) + ); +} +impl Default for CK_WTLS_PRF_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_WTLS_PRF_PARAMS_PTR = *mut CK_WTLS_PRF_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_WTLS_KEY_MAT_OUT { + pub hMacSecret: CK_OBJECT_HANDLE, + 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::(), + 24usize, + concat!("Size of: ", stringify!(CK_WTLS_KEY_MAT_OUT)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + 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 }, + 16usize, + concat!( + "Offset of field: ", + stringify!(CK_WTLS_KEY_MAT_OUT), + "::", + stringify!(pIV) + ) + ); +} +impl Default for CK_WTLS_KEY_MAT_OUT { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_WTLS_KEY_MAT_OUT_PTR = *mut CK_WTLS_KEY_MAT_OUT; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_WTLS_KEY_MAT_PARAMS { + pub DigestMechanism: CK_MECHANISM_TYPE, + pub ulMacSizeInBits: CK_ULONG, + pub ulKeySizeInBits: CK_ULONG, + pub ulIVSizeInBits: CK_ULONG, + pub ulSequenceNumber: CK_ULONG, + pub bIsExport: CK_BBOOL, + 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::(), + 88usize, + concat!("Size of: ", stringify!(CK_WTLS_KEY_MAT_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + 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 }, + 16usize, + 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 }, + 24usize, + 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 }, + 32usize, + 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 }, + 40usize, + 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 }, + 48usize, + 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 }, + 80usize, + concat!( + "Offset of field: ", + stringify!(CK_WTLS_KEY_MAT_PARAMS), + "::", + stringify!(pReturnedKeyMaterial) + ) + ); +} +impl Default for CK_WTLS_KEY_MAT_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_WTLS_KEY_MAT_PARAMS_PTR = *mut CK_WTLS_KEY_MAT_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_CMS_SIG_PARAMS { + pub certificateHandle: CK_OBJECT_HANDLE, + pub pSigningMechanism: CK_MECHANISM_PTR, + pub pDigestMechanism: CK_MECHANISM_PTR, + pub pContentType: CK_UTF8CHAR_PTR, + pub pRequestedAttributes: CK_BYTE_PTR, + pub ulRequestedAttributesLen: CK_ULONG, + 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::(), + 64usize, + concat!("Size of: ", stringify!(CK_CMS_SIG_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + 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 }, + 16usize, + 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 }, + 24usize, + 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 }, + 32usize, + 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 }, + 40usize, + 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 }, + 48usize, + 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 }, + 56usize, + concat!( + "Offset of field: ", + stringify!(CK_CMS_SIG_PARAMS), + "::", + stringify!(ulRequiredAttributesLen) + ) + ); +} +impl Default for CK_CMS_SIG_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_CMS_SIG_PARAMS_PTR = *mut CK_CMS_SIG_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +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::(), + 16usize, + concat!("Size of: ", stringify!(CK_KEY_DERIVATION_STRING_DATA)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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) + ) + ); +} +impl Default for CK_KEY_DERIVATION_STRING_DATA { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_KEY_DERIVATION_STRING_DATA_PTR = *mut CK_KEY_DERIVATION_STRING_DATA; +pub type CK_EXTRACT_PARAMS = CK_ULONG; +pub type CK_EXTRACT_PARAMS_PTR = *mut CK_EXTRACT_PARAMS; +pub type CK_PKCS5_PBKD2_PSEUDO_RANDOM_FUNCTION_TYPE = CK_ULONG; +pub type CK_PKCS5_PBKD2_PSEUDO_RANDOM_FUNCTION_TYPE_PTR = + *mut CK_PKCS5_PBKD2_PSEUDO_RANDOM_FUNCTION_TYPE; +pub type CK_PKCS5_PBKDF2_SALT_SOURCE_TYPE = CK_ULONG; +pub type CK_PKCS5_PBKDF2_SALT_SOURCE_TYPE_PTR = *mut CK_PKCS5_PBKDF2_SALT_SOURCE_TYPE; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_PKCS5_PBKD2_PARAMS { + pub saltSource: CK_PKCS5_PBKDF2_SALT_SOURCE_TYPE, + pub pSaltSourceData: CK_VOID_PTR, + pub ulSaltSourceDataLen: CK_ULONG, + pub iterations: CK_ULONG, + pub prf: CK_PKCS5_PBKD2_PSEUDO_RANDOM_FUNCTION_TYPE, + pub pPrfData: CK_VOID_PTR, + pub ulPrfDataLen: CK_ULONG, + 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::(), + 72usize, + concat!("Size of: ", stringify!(CK_PKCS5_PBKD2_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + 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 }, + 16usize, + 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 }, + 24usize, + 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 }, + 32usize, + 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 }, + 40usize, + 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 }, + 48usize, + 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 }, + 56usize, + 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 }, + 64usize, + concat!( + "Offset of field: ", + stringify!(CK_PKCS5_PBKD2_PARAMS), + "::", + stringify!(ulPasswordLen) + ) + ); +} +impl Default for CK_PKCS5_PBKD2_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_PKCS5_PBKD2_PARAMS_PTR = *mut CK_PKCS5_PBKD2_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_PKCS5_PBKD2_PARAMS2 { + pub saltSource: CK_PKCS5_PBKDF2_SALT_SOURCE_TYPE, + pub pSaltSourceData: CK_VOID_PTR, + pub ulSaltSourceDataLen: CK_ULONG, + pub iterations: CK_ULONG, + pub prf: CK_PKCS5_PBKD2_PSEUDO_RANDOM_FUNCTION_TYPE, + pub pPrfData: CK_VOID_PTR, + pub ulPrfDataLen: CK_ULONG, + 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::(), + 72usize, + concat!("Size of: ", stringify!(CK_PKCS5_PBKD2_PARAMS2)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + 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 }, + 16usize, + 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 }, + 24usize, + 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 }, + 32usize, + 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 }, + 40usize, + 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 }, + 48usize, + 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 }, + 56usize, + 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 }, + 64usize, + concat!( + "Offset of field: ", + stringify!(CK_PKCS5_PBKD2_PARAMS2), + "::", + stringify!(ulPasswordLen) + ) + ); +} +impl Default for CK_PKCS5_PBKD2_PARAMS2 { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_PKCS5_PBKD2_PARAMS2_PTR = *mut CK_PKCS5_PBKD2_PARAMS2; +pub type CK_OTP_PARAM_TYPE = CK_ULONG; +pub type CK_PARAM_TYPE = CK_OTP_PARAM_TYPE; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_OTP_PARAM { + pub type_: CK_OTP_PARAM_TYPE, + 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::(), + 24usize, + concat!("Size of: ", stringify!(CK_OTP_PARAM)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + concat!( + "Offset of field: ", + stringify!(CK_OTP_PARAM), + "::", + stringify!(pValue) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ulValueLen) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(CK_OTP_PARAM), + "::", + stringify!(ulValueLen) + ) + ); +} +impl Default for CK_OTP_PARAM { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_OTP_PARAM_PTR = *mut CK_OTP_PARAM; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +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::(), + 16usize, + concat!("Size of: ", stringify!(CK_OTP_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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) + ) + ); +} +impl Default for CK_OTP_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_OTP_PARAMS_PTR = *mut CK_OTP_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +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::(), + 16usize, + concat!("Size of: ", stringify!(CK_OTP_SIGNATURE_INFO)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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) + ) + ); +} +impl Default for CK_OTP_SIGNATURE_INFO { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_OTP_SIGNATURE_INFO_PTR = *mut CK_OTP_SIGNATURE_INFO; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_KIP_PARAMS { + pub pMechanism: CK_MECHANISM_PTR, + pub hKey: CK_OBJECT_HANDLE, + 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::(), + 32usize, + concat!("Size of: ", stringify!(CK_KIP_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 16usize, + concat!( + "Offset of field: ", + stringify!(CK_KIP_PARAMS), + "::", + stringify!(pSeed) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ulSeedLen) as usize - ptr as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(CK_KIP_PARAMS), + "::", + stringify!(ulSeedLen) + ) + ); +} +impl Default for CK_KIP_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_KIP_PARAMS_PTR = *mut CK_KIP_PARAMS; +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +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::(), + 24usize, + concat!("Size of: ", stringify!(CK_AES_CTR_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + concat!( + "Offset of field: ", + stringify!(CK_AES_CTR_PARAMS), + "::", + stringify!(cb) + ) + ); +} +pub type CK_AES_CTR_PARAMS_PTR = *mut CK_AES_CTR_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_GCM_PARAMS { + pub pIv: CK_BYTE_PTR, + pub ulIvLen: CK_ULONG, + pub ulIvBits: CK_ULONG, + pub pAAD: CK_BYTE_PTR, + 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::(), + 48usize, + concat!("Size of: ", stringify!(CK_GCM_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 16usize, + concat!( + "Offset of field: ", + stringify!(CK_GCM_PARAMS), + "::", + stringify!(ulIvBits) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pAAD) as usize - ptr as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(CK_GCM_PARAMS), + "::", + stringify!(pAAD) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ulAADLen) as usize - ptr as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(CK_GCM_PARAMS), + "::", + stringify!(ulAADLen) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ulTagBits) as usize - ptr as usize }, + 40usize, + concat!( + "Offset of field: ", + stringify!(CK_GCM_PARAMS), + "::", + stringify!(ulTagBits) + ) + ); +} +impl Default for CK_GCM_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_GCM_PARAMS_PTR = *mut CK_GCM_PARAMS; +pub type CK_GENERATOR_FUNCTION = CK_ULONG; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_GCM_MESSAGE_PARAMS { + pub pIv: CK_BYTE_PTR, + pub ulIvLen: CK_ULONG, + pub ulIvFixedBits: CK_ULONG, + pub ivGenerator: CK_GENERATOR_FUNCTION, + 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::(), + 48usize, + concat!("Size of: ", stringify!(CK_GCM_MESSAGE_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 16usize, + 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 }, + 24usize, + 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 }, + 32usize, + 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 }, + 40usize, + concat!( + "Offset of field: ", + stringify!(CK_GCM_MESSAGE_PARAMS), + "::", + stringify!(ulTagBits) + ) + ); +} +impl Default for CK_GCM_MESSAGE_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_GCM_MESSAGE_PARAMS_PTR = CK_GCM_MESSAGE_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_CCM_PARAMS { + pub ulDataLen: CK_ULONG, + pub pNonce: CK_BYTE_PTR, + pub ulNonceLen: CK_ULONG, + pub pAAD: CK_BYTE_PTR, + 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::(), + 48usize, + concat!("Size of: ", stringify!(CK_CCM_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + concat!( + "Offset of field: ", + stringify!(CK_CCM_PARAMS), + "::", + stringify!(pNonce) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ulNonceLen) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(CK_CCM_PARAMS), + "::", + stringify!(ulNonceLen) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pAAD) as usize - ptr as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(CK_CCM_PARAMS), + "::", + stringify!(pAAD) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ulAADLen) as usize - ptr as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(CK_CCM_PARAMS), + "::", + stringify!(ulAADLen) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ulMACLen) as usize - ptr as usize }, + 40usize, + concat!( + "Offset of field: ", + stringify!(CK_CCM_PARAMS), + "::", + stringify!(ulMACLen) + ) + ); +} +impl Default for CK_CCM_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_CCM_PARAMS_PTR = *mut CK_CCM_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_CCM_MESSAGE_PARAMS { + pub ulDataLen: CK_ULONG, + pub pNonce: CK_BYTE_PTR, + pub ulNonceLen: CK_ULONG, + pub ulNonceFixedBits: CK_ULONG, + pub nonceGenerator: CK_GENERATOR_FUNCTION, + 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::(), + 56usize, + concat!("Size of: ", stringify!(CK_CCM_MESSAGE_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + 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 }, + 16usize, + 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 }, + 24usize, + 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 }, + 32usize, + 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 }, + 40usize, + 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 }, + 48usize, + concat!( + "Offset of field: ", + stringify!(CK_CCM_MESSAGE_PARAMS), + "::", + stringify!(ulMACLen) + ) + ); +} +impl Default for CK_CCM_MESSAGE_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_CCM_MESSAGE_PARAMS_PTR = CK_CCM_MESSAGE_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_AES_GCM_PARAMS { + pub pIv: CK_BYTE_PTR, + pub ulIvLen: CK_ULONG, + pub ulIvBits: CK_ULONG, + pub pAAD: CK_BYTE_PTR, + 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::(), + 48usize, + concat!("Size of: ", stringify!(CK_AES_GCM_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 16usize, + 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 }, + 24usize, + 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 }, + 32usize, + 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 }, + 40usize, + concat!( + "Offset of field: ", + stringify!(CK_AES_GCM_PARAMS), + "::", + stringify!(ulTagBits) + ) + ); +} +impl Default for CK_AES_GCM_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_AES_GCM_PARAMS_PTR = *mut CK_AES_GCM_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_AES_CCM_PARAMS { + pub ulDataLen: CK_ULONG, + pub pNonce: CK_BYTE_PTR, + pub ulNonceLen: CK_ULONG, + pub pAAD: CK_BYTE_PTR, + 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::(), + 48usize, + concat!("Size of: ", stringify!(CK_AES_CCM_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + 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 }, + 16usize, + 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 }, + 24usize, + 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 }, + 32usize, + 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 }, + 40usize, + concat!( + "Offset of field: ", + stringify!(CK_AES_CCM_PARAMS), + "::", + stringify!(ulMACLen) + ) + ); +} +impl Default for CK_AES_CCM_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_AES_CCM_PARAMS_PTR = *mut CK_AES_CCM_PARAMS; +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +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::(), + 24usize, + concat!("Size of: ", stringify!(CK_CAMELLIA_CTR_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + concat!( + "Offset of field: ", + stringify!(CK_CAMELLIA_CTR_PARAMS), + "::", + stringify!(cb) + ) + ); +} +pub type CK_CAMELLIA_CTR_PARAMS_PTR = *mut CK_CAMELLIA_CTR_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_CAMELLIA_CBC_ENCRYPT_DATA_PARAMS { + pub iv: [CK_BYTE; 16usize], + 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::(), + 32usize, + concat!("Size of: ", stringify!(CK_CAMELLIA_CBC_ENCRYPT_DATA_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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) + ) + ); +} +impl Default for CK_CAMELLIA_CBC_ENCRYPT_DATA_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_CAMELLIA_CBC_ENCRYPT_DATA_PARAMS_PTR = *mut CK_CAMELLIA_CBC_ENCRYPT_DATA_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_ARIA_CBC_ENCRYPT_DATA_PARAMS { + pub iv: [CK_BYTE; 16usize], + 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::(), + 32usize, + concat!("Size of: ", stringify!(CK_ARIA_CBC_ENCRYPT_DATA_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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) + ) + ); +} +impl Default for CK_ARIA_CBC_ENCRYPT_DATA_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_ARIA_CBC_ENCRYPT_DATA_PARAMS_PTR = *mut CK_ARIA_CBC_ENCRYPT_DATA_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_DSA_PARAMETER_GEN_PARAM { + pub hash: CK_MECHANISM_TYPE, + pub pSeed: CK_BYTE_PTR, + 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::(), + 32usize, + concat!("Size of: ", stringify!(CK_DSA_PARAMETER_GEN_PARAM)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + 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 }, + 16usize, + 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 }, + 24usize, + concat!( + "Offset of field: ", + stringify!(CK_DSA_PARAMETER_GEN_PARAM), + "::", + stringify!(ulIndex) + ) + ); +} +impl Default for CK_DSA_PARAMETER_GEN_PARAM { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_DSA_PARAMETER_GEN_PARAM_PTR = *mut CK_DSA_PARAMETER_GEN_PARAM; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_ECDH_AES_KEY_WRAP_PARAMS { + pub ulAESKeyBits: CK_ULONG, + pub kdf: CK_EC_KDF_TYPE, + 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::(), + 32usize, + concat!("Size of: ", stringify!(CK_ECDH_AES_KEY_WRAP_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + 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 }, + 16usize, + 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 }, + 24usize, + concat!( + "Offset of field: ", + stringify!(CK_ECDH_AES_KEY_WRAP_PARAMS), + "::", + stringify!(pSharedData) + ) + ); +} +impl Default for CK_ECDH_AES_KEY_WRAP_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_ECDH_AES_KEY_WRAP_PARAMS_PTR = *mut CK_ECDH_AES_KEY_WRAP_PARAMS; +pub type CK_JAVA_MIDP_SECURITY_DOMAIN = CK_ULONG; +pub type CK_CERTIFICATE_CATEGORY = CK_ULONG; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +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::(), + 16usize, + concat!("Size of: ", stringify!(CK_RSA_AES_KEY_WRAP_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + concat!( + "Offset of field: ", + stringify!(CK_RSA_AES_KEY_WRAP_PARAMS), + "::", + stringify!(pOAEPParams) + ) + ); +} +impl Default for CK_RSA_AES_KEY_WRAP_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_RSA_AES_KEY_WRAP_PARAMS_PTR = *mut CK_RSA_AES_KEY_WRAP_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_TLS12_MASTER_KEY_DERIVE_PARAMS { + pub RandomInfo: CK_SSL3_RANDOM_DATA, + 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::(), + 48usize, + concat!("Size of: ", stringify!(CK_TLS12_MASTER_KEY_DERIVE_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 32usize, + 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 }, + 40usize, + concat!( + "Offset of field: ", + stringify!(CK_TLS12_MASTER_KEY_DERIVE_PARAMS), + "::", + stringify!(prfHashMechanism) + ) + ); +} +impl Default for CK_TLS12_MASTER_KEY_DERIVE_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_TLS12_MASTER_KEY_DERIVE_PARAMS_PTR = *mut CK_TLS12_MASTER_KEY_DERIVE_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_TLS12_KEY_MAT_PARAMS { + pub ulMacSizeInBits: CK_ULONG, + pub ulKeySizeInBits: CK_ULONG, + pub ulIVSizeInBits: CK_ULONG, + pub bIsExport: CK_BBOOL, + pub RandomInfo: CK_SSL3_RANDOM_DATA, + 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::(), + 80usize, + concat!("Size of: ", stringify!(CK_TLS12_KEY_MAT_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + 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 }, + 16usize, + 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 }, + 24usize, + 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 }, + 32usize, + 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 }, + 64usize, + 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 }, + 72usize, + concat!( + "Offset of field: ", + stringify!(CK_TLS12_KEY_MAT_PARAMS), + "::", + stringify!(prfHashMechanism) + ) + ); +} +impl Default for CK_TLS12_KEY_MAT_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_TLS12_KEY_MAT_PARAMS_PTR = *mut CK_TLS12_KEY_MAT_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_TLS_KDF_PARAMS { + pub prfMechanism: CK_MECHANISM_TYPE, + pub pLabel: CK_BYTE_PTR, + pub ulLabelLength: CK_ULONG, + pub RandomInfo: CK_SSL3_RANDOM_DATA, + 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::(), + 72usize, + concat!("Size of: ", stringify!(CK_TLS_KDF_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + 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 }, + 16usize, + 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 }, + 24usize, + 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 }, + 56usize, + 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 }, + 64usize, + concat!( + "Offset of field: ", + stringify!(CK_TLS_KDF_PARAMS), + "::", + stringify!(ulContextDataLength) + ) + ); +} +impl Default for CK_TLS_KDF_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_TLS_KDF_PARAMS_PTR = *mut CK_TLS_KDF_PARAMS; +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct CK_TLS_MAC_PARAMS { + pub prfHashMechanism: CK_MECHANISM_TYPE, + 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::(), + 24usize, + concat!("Size of: ", stringify!(CK_TLS_MAC_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + 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 }, + 16usize, + concat!( + "Offset of field: ", + stringify!(CK_TLS_MAC_PARAMS), + "::", + stringify!(ulServerOrClient) + ) + ); +} +pub type CK_TLS_MAC_PARAMS_PTR = *mut CK_TLS_MAC_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_GOSTR3410_DERIVE_PARAMS { + pub kdf: CK_EC_KDF_TYPE, + pub pPublicData: CK_BYTE_PTR, + pub ulPublicDataLen: CK_ULONG, + 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::(), + 40usize, + concat!("Size of: ", stringify!(CK_GOSTR3410_DERIVE_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + 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 }, + 16usize, + 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 }, + 24usize, + 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 }, + 32usize, + concat!( + "Offset of field: ", + stringify!(CK_GOSTR3410_DERIVE_PARAMS), + "::", + stringify!(ulUKMLen) + ) + ); +} +impl Default for CK_GOSTR3410_DERIVE_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_GOSTR3410_DERIVE_PARAMS_PTR = *mut CK_GOSTR3410_DERIVE_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_GOSTR3410_KEY_WRAP_PARAMS { + pub pWrapOID: CK_BYTE_PTR, + pub ulWrapOIDLen: CK_ULONG, + pub pUKM: CK_BYTE_PTR, + 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::(), + 40usize, + concat!("Size of: ", stringify!(CK_GOSTR3410_KEY_WRAP_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 16usize, + 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 }, + 24usize, + 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 }, + 32usize, + concat!( + "Offset of field: ", + stringify!(CK_GOSTR3410_KEY_WRAP_PARAMS), + "::", + stringify!(hKey) + ) + ); +} +impl Default for CK_GOSTR3410_KEY_WRAP_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_GOSTR3410_KEY_WRAP_PARAMS_PTR = *mut CK_GOSTR3410_KEY_WRAP_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_SEED_CBC_ENCRYPT_DATA_PARAMS { + pub iv: [CK_BYTE; 16usize], + 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::(), + 32usize, + concat!("Size of: ", stringify!(CK_SEED_CBC_ENCRYPT_DATA_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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) + ) + ); +} +impl Default for CK_SEED_CBC_ENCRYPT_DATA_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_SEED_CBC_ENCRYPT_DATA_PARAMS_PTR = *mut CK_SEED_CBC_ENCRYPT_DATA_PARAMS; +pub type CK_PROFILE_ID = CK_ULONG; +pub type CK_PRF_DATA_TYPE = CK_ULONG; +pub type CK_SP800_108_PRF_TYPE = CK_MECHANISM_TYPE; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_PRF_DATA_PARAM { + pub type_: CK_PRF_DATA_TYPE, + 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::(), + 24usize, + concat!("Size of: ", stringify!(CK_PRF_DATA_PARAM)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + 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 }, + 16usize, + concat!( + "Offset of field: ", + stringify!(CK_PRF_DATA_PARAM), + "::", + stringify!(ulValueLen) + ) + ); +} +impl Default for CK_PRF_DATA_PARAM { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_PRF_DATA_PARAM_PTR = *mut CK_PRF_DATA_PARAM; +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +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::(), + 16usize, + concat!("Size of: ", stringify!(CK_SP800_108_COUNTER_FORMAT)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + concat!( + "Offset of field: ", + stringify!(CK_SP800_108_COUNTER_FORMAT), + "::", + stringify!(ulWidthInBits) + ) + ); +} +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)] +#[derive(Debug, Default, Copy, Clone)] +pub struct CK_SP800_108_DKM_LENGTH_FORMAT { + pub dkmLengthMethod: CK_SP800_108_DKM_LENGTH_METHOD, + 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::(), + 24usize, + concat!("Size of: ", stringify!(CK_SP800_108_DKM_LENGTH_FORMAT)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + 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 }, + 16usize, + concat!( + "Offset of field: ", + stringify!(CK_SP800_108_DKM_LENGTH_FORMAT), + "::", + stringify!(ulWidthInBits) + ) + ); +} +pub type CK_SP800_108_DKM_LENGTH_FORMAT_PTR = *mut CK_SP800_108_DKM_LENGTH_FORMAT; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_DERIVED_KEY { + pub pTemplate: CK_ATTRIBUTE_PTR, + 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::(), + 24usize, + concat!("Size of: ", stringify!(CK_DERIVED_KEY)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 16usize, + concat!( + "Offset of field: ", + stringify!(CK_DERIVED_KEY), + "::", + stringify!(phKey) + ) + ); +} +impl Default for CK_DERIVED_KEY { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_DERIVED_KEY_PTR = *mut CK_DERIVED_KEY; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_SP800_108_KDF_PARAMS { + pub prfType: CK_SP800_108_PRF_TYPE, + pub ulNumberOfDataParams: CK_ULONG, + pub pDataParams: CK_PRF_DATA_PARAM_PTR, + pub ulAdditionalDerivedKeys: CK_ULONG, + pub pAdditionalDerivedKeys: CK_DERIVED_KEY, +} +#[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::(), + 56usize, + concat!("Size of: ", stringify!(CK_SP800_108_KDF_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + 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 }, + 16usize, + 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 }, + 24usize, + 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 }, + 32usize, + concat!( + "Offset of field: ", + stringify!(CK_SP800_108_KDF_PARAMS), + "::", + stringify!(pAdditionalDerivedKeys) + ) + ); +} +impl Default for CK_SP800_108_KDF_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_SP800_108_KDF_PARAMS_PTR = *mut CK_SP800_108_KDF_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_SP800_108_FEEDBACK_KDF_PARAMS { + pub prfType: CK_SP800_108_PRF_TYPE, + pub ulNumberOfDataParams: CK_ULONG, + pub pDataParams: CK_PRF_DATA_PARAM_PTR, + pub ulIVLen: CK_ULONG, + pub pIV: CK_BYTE_PTR, + pub ulAdditionalDerivedKeys: CK_ULONG, + pub pAdditionalDerivedKeys: CK_DERIVED_KEY, +} +#[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::(), + 72usize, + concat!("Size of: ", stringify!(CK_SP800_108_FEEDBACK_KDF_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + 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 }, + 16usize, + 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 }, + 24usize, + 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 }, + 32usize, + 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 }, + 40usize, + 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 }, + 48usize, + concat!( + "Offset of field: ", + stringify!(CK_SP800_108_FEEDBACK_KDF_PARAMS), + "::", + stringify!(pAdditionalDerivedKeys) + ) + ); +} +impl Default for CK_SP800_108_FEEDBACK_KDF_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_SP800_108_FEEDBACK_KDF_PARAMS_PTR = *mut CK_SP800_108_FEEDBACK_KDF_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_EDDSA_PARAMS { + pub phFlag: CK_BBOOL, + 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::(), + 24usize, + concat!("Size of: ", stringify!(CK_EDDSA_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + concat!( + "Offset of field: ", + stringify!(CK_EDDSA_PARAMS), + "::", + stringify!(ulContextDataLen) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pContextData) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(CK_EDDSA_PARAMS), + "::", + stringify!(pContextData) + ) + ); +} +impl Default for CK_EDDSA_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_EDDSA_PARAMS_PTR = *mut CK_EDDSA_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_CHACHA20_PARAMS { + pub pBlockCounter: CK_BYTE_PTR, + pub blockCounterBits: CK_ULONG, + 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::(), + 32usize, + concat!("Size of: ", stringify!(CK_CHACHA20_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 16usize, + concat!( + "Offset of field: ", + stringify!(CK_CHACHA20_PARAMS), + "::", + stringify!(pNonce) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ulNonceBits) as usize - ptr as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(CK_CHACHA20_PARAMS), + "::", + stringify!(ulNonceBits) + ) + ); +} +impl Default for CK_CHACHA20_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_SALSA20_PARAMS { + pub pBlockCounter: CK_BYTE_PTR, + 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::(), + 24usize, + concat!("Size of: ", stringify!(CK_SALSA20_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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) + ) + ); +} +impl Default for CK_SALSA20_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_SALSA20_CHACHA20_POLY1305_PARAMS { + pub pNonce: CK_BYTE_PTR, + pub ulNonceLen: CK_ULONG, + 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::(), + 32usize, + concat!("Size of: ", stringify!(CK_SALSA20_CHACHA20_POLY1305_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 16usize, + 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 }, + 24usize, + concat!( + "Offset of field: ", + stringify!(CK_SALSA20_CHACHA20_POLY1305_PARAMS), + "::", + stringify!(ulAADLen) + ) + ); +} +impl Default for CK_SALSA20_CHACHA20_POLY1305_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_SALSA20_CHACHA20_POLY1305_PARAMS_PTR = *mut CK_SALSA20_CHACHA20_POLY1305_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_SALSA20_CHACHA20_POLY1305_MSG_PARAMS { + pub pNonce: CK_BYTE_PTR, + 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::(), + 24usize, + concat!( + "Size of: ", + stringify!(CK_SALSA20_CHACHA20_POLY1305_MSG_PARAMS) + ) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 16usize, + concat!( + "Offset of field: ", + stringify!(CK_SALSA20_CHACHA20_POLY1305_MSG_PARAMS), + "::", + stringify!(pTag) + ) + ); +} +impl Default for CK_SALSA20_CHACHA20_POLY1305_MSG_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_SALSA20_CHACHA20_POLY1305_MSG_PARAMS_PTR = *mut CK_SALSA20_CHACHA20_POLY1305_MSG_PARAMS; +pub type CK_X3DH_KDF_TYPE = CK_ULONG; +pub type CK_X3DH_KDF_TYPE_PTR = *mut CK_X3DH_KDF_TYPE; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_X3DH_INITIATE_PARAMS { + pub kdf: CK_X3DH_KDF_TYPE, + pub pPeer_identity: CK_OBJECT_HANDLE, + pub pPeer_prekey: CK_OBJECT_HANDLE, + pub pPrekey_signature: CK_BYTE_PTR, + pub pOnetime_key: CK_BYTE_PTR, + 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::(), + 56usize, + concat!("Size of: ", stringify!(CK_X3DH_INITIATE_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + 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 }, + 16usize, + 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 }, + 24usize, + 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 }, + 32usize, + 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 }, + 40usize, + 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 }, + 48usize, + concat!( + "Offset of field: ", + stringify!(CK_X3DH_INITIATE_PARAMS), + "::", + stringify!(pOwn_ephemeral) + ) + ); +} +impl Default for CK_X3DH_INITIATE_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_X3DH_RESPOND_PARAMS { + pub kdf: CK_X3DH_KDF_TYPE, + pub pIdentity_id: CK_BYTE_PTR, + pub pPrekey_id: CK_BYTE_PTR, + pub pOnetime_id: CK_BYTE_PTR, + 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::(), + 48usize, + concat!("Size of: ", stringify!(CK_X3DH_RESPOND_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + 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 }, + 16usize, + 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 }, + 24usize, + 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 }, + 32usize, + 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 }, + 40usize, + concat!( + "Offset of field: ", + stringify!(CK_X3DH_RESPOND_PARAMS), + "::", + stringify!(pInitiator_ephemeral) + ) + ); +} +impl Default for CK_X3DH_RESPOND_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_X2RATCHET_KDF_TYPE = CK_ULONG; +pub type CK_X2RATCHET_KDF_TYPE_PTR = *mut CK_X2RATCHET_KDF_TYPE; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_X2RATCHET_INITIALIZE_PARAMS { + pub sk: CK_BYTE_PTR, + pub peer_public_prekey: CK_OBJECT_HANDLE, + pub peer_public_identity: CK_OBJECT_HANDLE, + pub own_public_identity: CK_OBJECT_HANDLE, + pub bEncryptedHeader: CK_BBOOL, + pub eCurve: CK_ULONG, + 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::(), + 64usize, + concat!("Size of: ", stringify!(CK_X2RATCHET_INITIALIZE_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 16usize, + 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 }, + 24usize, + 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 }, + 32usize, + 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 }, + 40usize, + 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 }, + 48usize, + 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 }, + 56usize, + concat!( + "Offset of field: ", + stringify!(CK_X2RATCHET_INITIALIZE_PARAMS), + "::", + stringify!(kdfMechanism) + ) + ); +} +impl Default for CK_X2RATCHET_INITIALIZE_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_X2RATCHET_INITIALIZE_PARAMS_PTR = *mut CK_X2RATCHET_INITIALIZE_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_X2RATCHET_RESPOND_PARAMS { + pub sk: CK_BYTE_PTR, + pub own_prekey: CK_OBJECT_HANDLE, + pub initiator_identity: CK_OBJECT_HANDLE, + pub own_public_identity: CK_OBJECT_HANDLE, + pub bEncryptedHeader: CK_BBOOL, + pub eCurve: CK_ULONG, + 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::(), + 64usize, + concat!("Size of: ", stringify!(CK_X2RATCHET_RESPOND_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 16usize, + 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 }, + 24usize, + 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 }, + 32usize, + 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 }, + 40usize, + 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 }, + 48usize, + 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 }, + 56usize, + concat!( + "Offset of field: ", + stringify!(CK_X2RATCHET_RESPOND_PARAMS), + "::", + stringify!(kdfMechanism) + ) + ); +} +impl Default for CK_X2RATCHET_RESPOND_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_X2RATCHET_RESPOND_PARAMS_PTR = *mut CK_X2RATCHET_RESPOND_PARAMS; +pub type CK_XEDDSA_HASH_TYPE = CK_ULONG; +pub type CK_XEDDSA_HASH_TYPE_PTR = *mut CK_XEDDSA_HASH_TYPE; +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +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::(), + 8usize, + concat!("Size of: ", stringify!(CK_XEDDSA_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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) + ) + ); +} +pub type CK_XEDDSA_PARAMS_PTR = *mut CK_XEDDSA_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CK_HKDF_PARAMS { + pub bExtract: CK_BBOOL, + pub bExpand: CK_BBOOL, + pub prfHashMechanism: CK_MECHANISM_TYPE, + pub ulSaltType: CK_ULONG, + pub pSalt: CK_BYTE_PTR, + pub ulSaltLen: CK_ULONG, + pub hSaltKey: CK_ULONG, + 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::(), + 64usize, + concat!("Size of: ", stringify!(CK_HKDF_PARAMS)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + concat!( + "Offset of field: ", + stringify!(CK_HKDF_PARAMS), + "::", + stringify!(prfHashMechanism) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ulSaltType) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(CK_HKDF_PARAMS), + "::", + stringify!(ulSaltType) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pSalt) as usize - ptr as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(CK_HKDF_PARAMS), + "::", + stringify!(pSalt) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ulSaltLen) as usize - ptr as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(CK_HKDF_PARAMS), + "::", + stringify!(ulSaltLen) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).hSaltKey) as usize - ptr as usize }, + 40usize, + concat!( + "Offset of field: ", + stringify!(CK_HKDF_PARAMS), + "::", + stringify!(hSaltKey) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pInfo) as usize - ptr as usize }, + 48usize, + concat!( + "Offset of field: ", + stringify!(CK_HKDF_PARAMS), + "::", + stringify!(pInfo) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ulInfoLen) as usize - ptr as usize }, + 56usize, + concat!( + "Offset of field: ", + stringify!(CK_HKDF_PARAMS), + "::", + stringify!(ulInfoLen) + ) + ); +} +impl Default for CK_HKDF_PARAMS { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type CK_C_Initialize = + ::std::option::Option CK_RV>; +pub type CK_C_Finalize = + ::std::option::Option CK_RV>; +pub type CK_C_GetInfo = ::std::option::Option CK_RV>; +pub type CK_C_GetFunctionList = + ::std::option::Option CK_RV>; +pub type CK_C_GetSlotList = ::std::option::Option< unsafe extern "C" fn( - flags: CK_FLAGS, - slot: *mut CK_SLOT_ID, - pReserved: *mut ::std::os::raw::c_void, + tokenPresent: CK_BBOOL, + pSlotList: CK_SLOT_ID_PTR, + pulCount: CK_ULONG_PTR, ) -> CK_RV, >; +pub type CK_C_GetSlotInfo = ::std::option::Option< + unsafe extern "C" fn(slotID: CK_SLOT_ID, pInfo: CK_SLOT_INFO_PTR) -> CK_RV, +>; +pub type CK_C_GetTokenInfo = ::std::option::Option< + unsafe extern "C" fn(slotID: CK_SLOT_ID, pInfo: CK_TOKEN_INFO_PTR) -> CK_RV, +>; pub type CK_C_GetMechanismList = ::std::option::Option< unsafe extern "C" fn( slotID: CK_SLOT_ID, - mechanism_list: *mut CK_MECHANISM_TYPE, - ulCount: *mut ::std::os::raw::c_ulong, + pMechanismList: CK_MECHANISM_TYPE_PTR, + pulCount: CK_ULONG_PTR, ) -> CK_RV, >; pub type CK_C_GetMechanismInfo = ::std::option::Option< unsafe extern "C" fn( slotID: CK_SLOT_ID, type_: CK_MECHANISM_TYPE, - info: *mut _CK_MECHANISM_INFO, + pInfo: CK_MECHANISM_INFO_PTR, ) -> CK_RV, >; pub type CK_C_InitToken = ::std::option::Option< unsafe extern "C" fn( slotID: CK_SLOT_ID, - pin: *mut ::std::os::raw::c_uchar, - pin_len: ::std::os::raw::c_ulong, - label: *mut ::std::os::raw::c_uchar, + pPin: CK_UTF8CHAR_PTR, + ulPinLen: CK_ULONG, + pLabel: CK_UTF8CHAR_PTR, ) -> CK_RV, >; pub type CK_C_InitPIN = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - pin: *mut ::std::os::raw::c_uchar, - pin_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pPin: CK_UTF8CHAR_PTR, + ulPinLen: CK_ULONG, ) -> CK_RV, >; pub type CK_C_SetPIN = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - old_pin: *mut ::std::os::raw::c_uchar, - old_len: ::std::os::raw::c_ulong, - new_pin: *mut ::std::os::raw::c_uchar, - new_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pOldPin: CK_UTF8CHAR_PTR, + ulOldLen: CK_ULONG, + pNewPin: CK_UTF8CHAR_PTR, + ulNewLen: CK_ULONG, ) -> CK_RV, >; pub type CK_C_OpenSession = ::std::option::Option< unsafe extern "C" fn( slotID: CK_SLOT_ID, flags: CK_FLAGS, - application: *mut ::std::os::raw::c_void, - notify: CK_NOTIFY, - session: *mut CK_SESSION_HANDLE, + pApplication: CK_VOID_PTR, + Notify: CK_NOTIFY, + phSession: CK_SESSION_HANDLE_PTR, ) -> CK_RV, >; pub type CK_C_CloseSession = - ::std::option::Option CK_RV>; + ::std::option::Option CK_RV>; pub type CK_C_CloseAllSessions = ::std::option::Option CK_RV>; pub type CK_C_GetSessionInfo = ::std::option::Option< - unsafe extern "C" fn(session: CK_SESSION_HANDLE, info: *mut _CK_SESSION_INFO) -> CK_RV, + unsafe extern "C" fn(hSession: CK_SESSION_HANDLE, pInfo: CK_SESSION_INFO_PTR) -> CK_RV, >; pub type CK_C_GetOperationState = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - operation_state: *mut ::std::os::raw::c_uchar, - operation_state_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pOperationState: CK_BYTE_PTR, + pulOperationStateLen: CK_ULONG_PTR, ) -> CK_RV, >; pub type CK_C_SetOperationState = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - operation_state: *mut ::std::os::raw::c_uchar, - operation_state_len: ::std::os::raw::c_ulong, - encryption_key: CK_OBJECT_HANDLE, - authentiation_key: CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pOperationState: CK_BYTE_PTR, + ulOperationStateLen: CK_ULONG, + hEncryptionKey: CK_OBJECT_HANDLE, + hAuthenticationKey: CK_OBJECT_HANDLE, ) -> CK_RV, >; pub type CK_C_Login = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - user_type: CK_USER_TYPE, - pin: *mut ::std::os::raw::c_uchar, - pin_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + userType: CK_USER_TYPE, + pPin: CK_UTF8CHAR_PTR, + ulPinLen: CK_ULONG, ) -> CK_RV, >; pub type CK_C_Logout = - ::std::option::Option CK_RV>; + ::std::option::Option CK_RV>; pub type CK_C_CreateObject = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - templ: *mut _CK_ATTRIBUTE, - ulCount: ::std::os::raw::c_ulong, - object: *mut CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pTemplate: CK_ATTRIBUTE_PTR, + ulCount: CK_ULONG, + phObject: CK_OBJECT_HANDLE_PTR, ) -> CK_RV, >; pub type CK_C_CopyObject = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - object: CK_OBJECT_HANDLE, - templ: *mut _CK_ATTRIBUTE, - ulCount: ::std::os::raw::c_ulong, - new_object: *mut CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + hObject: CK_OBJECT_HANDLE, + pTemplate: CK_ATTRIBUTE_PTR, + ulCount: CK_ULONG, + phNewObject: CK_OBJECT_HANDLE_PTR, ) -> CK_RV, >; pub type CK_C_DestroyObject = ::std::option::Option< - unsafe extern "C" fn(session: CK_SESSION_HANDLE, object: CK_OBJECT_HANDLE) -> CK_RV, + unsafe extern "C" fn(hSession: CK_SESSION_HANDLE, hObject: CK_OBJECT_HANDLE) -> CK_RV, >; pub type CK_C_GetObjectSize = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - object: CK_OBJECT_HANDLE, - size: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + hObject: CK_OBJECT_HANDLE, + pulSize: CK_ULONG_PTR, ) -> CK_RV, >; pub type CK_C_GetAttributeValue = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - object: CK_OBJECT_HANDLE, - templ: *mut _CK_ATTRIBUTE, - ulCount: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + hObject: CK_OBJECT_HANDLE, + pTemplate: CK_ATTRIBUTE_PTR, + ulCount: CK_ULONG, ) -> CK_RV, >; pub type CK_C_SetAttributeValue = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - object: CK_OBJECT_HANDLE, - templ: *mut _CK_ATTRIBUTE, - ulCount: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + hObject: CK_OBJECT_HANDLE, + pTemplate: CK_ATTRIBUTE_PTR, + ulCount: CK_ULONG, ) -> CK_RV, >; pub type CK_C_FindObjectsInit = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - templ: *mut _CK_ATTRIBUTE, - ulCount: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pTemplate: CK_ATTRIBUTE_PTR, + ulCount: CK_ULONG, ) -> CK_RV, >; pub type CK_C_FindObjects = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - object: *mut CK_OBJECT_HANDLE, - max_object_count: ::std::os::raw::c_ulong, - object_count: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + phObject: CK_OBJECT_HANDLE_PTR, + ulMaxObjectCount: CK_ULONG, + pulObjectCount: CK_ULONG_PTR, ) -> CK_RV, >; pub type CK_C_FindObjectsFinal = - ::std::option::Option CK_RV>; + ::std::option::Option CK_RV>; pub type CK_C_EncryptInit = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - key: CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, ) -> CK_RV, >; pub type CK_C_Encrypt = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - data: *mut ::std::os::raw::c_uchar, - data_len: ::std::os::raw::c_ulong, - encrypted_data: *mut ::std::os::raw::c_uchar, - encrypted_data_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pEncryptedData: CK_BYTE_PTR, + pulEncryptedDataLen: CK_ULONG_PTR, ) -> CK_RV, >; pub type CK_C_EncryptUpdate = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - part: *mut ::std::os::raw::c_uchar, - part_len: ::std::os::raw::c_ulong, - encrypted_part: *mut ::std::os::raw::c_uchar, - encrypted_part_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pPart: CK_BYTE_PTR, + ulPartLen: CK_ULONG, + pEncryptedPart: CK_BYTE_PTR, + pulEncryptedPartLen: CK_ULONG_PTR, ) -> CK_RV, >; pub type CK_C_EncryptFinal = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - last_encrypted_part: *mut ::std::os::raw::c_uchar, - last_encrypted_part_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pLastEncryptedPart: CK_BYTE_PTR, + pulLastEncryptedPartLen: CK_ULONG_PTR, ) -> CK_RV, >; pub type CK_C_DecryptInit = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - key: CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, ) -> CK_RV, >; pub type CK_C_Decrypt = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - encrypted_data: *mut ::std::os::raw::c_uchar, - encrypted_data_len: ::std::os::raw::c_ulong, - data: *mut ::std::os::raw::c_uchar, - data_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pEncryptedData: CK_BYTE_PTR, + ulEncryptedDataLen: CK_ULONG, + pData: CK_BYTE_PTR, + pulDataLen: CK_ULONG_PTR, ) -> CK_RV, >; pub type CK_C_DecryptUpdate = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - encrypted_part: *mut ::std::os::raw::c_uchar, - encrypted_part_len: ::std::os::raw::c_ulong, - part: *mut ::std::os::raw::c_uchar, - part_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pEncryptedPart: CK_BYTE_PTR, + ulEncryptedPartLen: CK_ULONG, + pPart: CK_BYTE_PTR, + pulPartLen: CK_ULONG_PTR, ) -> CK_RV, >; pub type CK_C_DecryptFinal = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - last_part: *mut ::std::os::raw::c_uchar, - last_part_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pLastPart: CK_BYTE_PTR, + pulLastPartLen: CK_ULONG_PTR, ) -> CK_RV, >; pub type CK_C_DigestInit = ::std::option::Option< - unsafe extern "C" fn(session: CK_SESSION_HANDLE, mechanism: *mut _CK_MECHANISM) -> CK_RV, + unsafe extern "C" fn(hSession: CK_SESSION_HANDLE, pMechanism: CK_MECHANISM_PTR) -> CK_RV, >; pub type CK_C_Digest = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - data: *mut ::std::os::raw::c_uchar, - data_len: ::std::os::raw::c_ulong, - digest: *mut ::std::os::raw::c_uchar, - digest_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pDigest: CK_BYTE_PTR, + pulDigestLen: CK_ULONG_PTR, ) -> CK_RV, >; pub type CK_C_DigestUpdate = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - part: *mut ::std::os::raw::c_uchar, - part_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pPart: CK_BYTE_PTR, + ulPartLen: CK_ULONG, ) -> CK_RV, >; pub type CK_C_DigestKey = ::std::option::Option< - unsafe extern "C" fn(session: CK_SESSION_HANDLE, key: CK_OBJECT_HANDLE) -> CK_RV, + unsafe extern "C" fn(hSession: CK_SESSION_HANDLE, hKey: CK_OBJECT_HANDLE) -> CK_RV, >; pub type CK_C_DigestFinal = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - digest: *mut ::std::os::raw::c_uchar, - digest_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pDigest: CK_BYTE_PTR, + pulDigestLen: CK_ULONG_PTR, ) -> CK_RV, >; pub type CK_C_SignInit = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - key: CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, ) -> CK_RV, >; pub type CK_C_Sign = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - data: *mut ::std::os::raw::c_uchar, - data_len: ::std::os::raw::c_ulong, - signature: *mut ::std::os::raw::c_uchar, - signature_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + pulSignatureLen: CK_ULONG_PTR, ) -> CK_RV, >; pub type CK_C_SignUpdate = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - part: *mut ::std::os::raw::c_uchar, - part_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pPart: CK_BYTE_PTR, + ulPartLen: CK_ULONG, ) -> CK_RV, >; pub type CK_C_SignFinal = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - signature: *mut ::std::os::raw::c_uchar, - signature_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pSignature: CK_BYTE_PTR, + pulSignatureLen: CK_ULONG_PTR, ) -> CK_RV, >; pub type CK_C_SignRecoverInit = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - key: CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, ) -> CK_RV, >; pub type CK_C_SignRecover = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - data: *mut ::std::os::raw::c_uchar, - data_len: ::std::os::raw::c_ulong, - signature: *mut ::std::os::raw::c_uchar, - signature_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + pulSignatureLen: CK_ULONG_PTR, ) -> CK_RV, >; pub type CK_C_VerifyInit = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - key: CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, ) -> CK_RV, >; pub type CK_C_Verify = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - data: *mut ::std::os::raw::c_uchar, - data_len: ::std::os::raw::c_ulong, - signature: *mut ::std::os::raw::c_uchar, - signature_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + ulSignatureLen: CK_ULONG, ) -> CK_RV, >; pub type CK_C_VerifyUpdate = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - part: *mut ::std::os::raw::c_uchar, - part_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pPart: CK_BYTE_PTR, + ulPartLen: CK_ULONG, ) -> CK_RV, >; pub type CK_C_VerifyFinal = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - signature: *mut ::std::os::raw::c_uchar, - signature_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pSignature: CK_BYTE_PTR, + ulSignatureLen: CK_ULONG, ) -> CK_RV, >; pub type CK_C_VerifyRecoverInit = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - key: CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, ) -> CK_RV, >; pub type CK_C_VerifyRecover = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - signature: *mut ::std::os::raw::c_uchar, - signature_len: ::std::os::raw::c_ulong, - data: *mut ::std::os::raw::c_uchar, - data_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pSignature: CK_BYTE_PTR, + ulSignatureLen: CK_ULONG, + pData: CK_BYTE_PTR, + pulDataLen: CK_ULONG_PTR, ) -> CK_RV, >; pub type CK_C_DigestEncryptUpdate = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - part: *mut ::std::os::raw::c_uchar, - part_len: ::std::os::raw::c_ulong, - encrypted_part: *mut ::std::os::raw::c_uchar, - encrypted_part_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pPart: CK_BYTE_PTR, + ulPartLen: CK_ULONG, + pEncryptedPart: CK_BYTE_PTR, + pulEncryptedPartLen: CK_ULONG_PTR, ) -> CK_RV, >; pub type CK_C_DecryptDigestUpdate = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - encrypted_part: *mut ::std::os::raw::c_uchar, - encrypted_part_len: ::std::os::raw::c_ulong, - part: *mut ::std::os::raw::c_uchar, - part_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pEncryptedPart: CK_BYTE_PTR, + ulEncryptedPartLen: CK_ULONG, + pPart: CK_BYTE_PTR, + pulPartLen: CK_ULONG_PTR, ) -> CK_RV, >; pub type CK_C_SignEncryptUpdate = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - part: *mut ::std::os::raw::c_uchar, - part_len: ::std::os::raw::c_ulong, - encrypted_part: *mut ::std::os::raw::c_uchar, - encrypted_part_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pPart: CK_BYTE_PTR, + ulPartLen: CK_ULONG, + pEncryptedPart: CK_BYTE_PTR, + pulEncryptedPartLen: CK_ULONG_PTR, ) -> CK_RV, >; pub type CK_C_DecryptVerifyUpdate = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - encrypted_part: *mut ::std::os::raw::c_uchar, - encrypted_part_len: ::std::os::raw::c_ulong, - part: *mut ::std::os::raw::c_uchar, - part_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pEncryptedPart: CK_BYTE_PTR, + ulEncryptedPartLen: CK_ULONG, + pPart: CK_BYTE_PTR, + pulPartLen: CK_ULONG_PTR, ) -> CK_RV, >; pub type CK_C_GenerateKey = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - templ: *mut _CK_ATTRIBUTE, - ulCount: ::std::os::raw::c_ulong, - key: *mut CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + pTemplate: CK_ATTRIBUTE_PTR, + ulCount: CK_ULONG, + phKey: CK_OBJECT_HANDLE_PTR, ) -> CK_RV, >; pub type CK_C_GenerateKeyPair = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - public_key_template: *mut _CK_ATTRIBUTE, - public_key_attribute_count: ::std::os::raw::c_ulong, - private_key_template: *mut _CK_ATTRIBUTE, - private_key_attribute_count: ::std::os::raw::c_ulong, - public_key: *mut CK_OBJECT_HANDLE, - private_key: *mut CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + pPublicKeyTemplate: CK_ATTRIBUTE_PTR, + ulPublicKeyAttributeCount: CK_ULONG, + pPrivateKeyTemplate: CK_ATTRIBUTE_PTR, + ulPrivateKeyAttributeCount: CK_ULONG, + phPublicKey: CK_OBJECT_HANDLE_PTR, + phPrivateKey: CK_OBJECT_HANDLE_PTR, ) -> CK_RV, >; pub type CK_C_WrapKey = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - wrapping_key: CK_OBJECT_HANDLE, - key: CK_OBJECT_HANDLE, - wrapped_key: *mut ::std::os::raw::c_uchar, - wrapped_key_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hWrappingKey: CK_OBJECT_HANDLE, + hKey: CK_OBJECT_HANDLE, + pWrappedKey: CK_BYTE_PTR, + pulWrappedKeyLen: CK_ULONG_PTR, ) -> CK_RV, >; pub type CK_C_UnwrapKey = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - unwrapping_key: CK_OBJECT_HANDLE, - wrapped_key: *mut ::std::os::raw::c_uchar, - wrapped_key_len: ::std::os::raw::c_ulong, - templ: *mut _CK_ATTRIBUTE, - attribute_count: ::std::os::raw::c_ulong, - key: *mut CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hUnwrappingKey: CK_OBJECT_HANDLE, + pWrappedKey: CK_BYTE_PTR, + ulWrappedKeyLen: CK_ULONG, + pTemplate: CK_ATTRIBUTE_PTR, + ulAttributeCount: CK_ULONG, + phKey: CK_OBJECT_HANDLE_PTR, ) -> CK_RV, >; pub type CK_C_DeriveKey = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - base_key: CK_OBJECT_HANDLE, - templ: *mut _CK_ATTRIBUTE, - attribute_count: ::std::os::raw::c_ulong, - key: *mut CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hBaseKey: CK_OBJECT_HANDLE, + pTemplate: CK_ATTRIBUTE_PTR, + ulAttributeCount: CK_ULONG, + phKey: CK_OBJECT_HANDLE_PTR, ) -> CK_RV, >; pub type CK_C_SeedRandom = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - seed: *mut ::std::os::raw::c_uchar, - seed_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pSeed: CK_BYTE_PTR, + ulSeedLen: CK_ULONG, ) -> CK_RV, >; pub type CK_C_GenerateRandom = ::std::option::Option< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - random_data: *mut ::std::os::raw::c_uchar, - random_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + RandomData: CK_BYTE_PTR, + ulRandomLen: CK_ULONG, ) -> CK_RV, >; pub type CK_C_GetFunctionStatus = - ::std::option::Option CK_RV>; + ::std::option::Option CK_RV>; pub type CK_C_CancelFunction = - ::std::option::Option CK_RV>; + ::std::option::Option CK_RV>; +pub type CK_C_WaitForSlotEvent = ::std::option::Option< + unsafe extern "C" fn(flags: CK_FLAGS, pSlot: CK_SLOT_ID_PTR, pRserved: CK_VOID_PTR) -> CK_RV, +>; +pub type CK_C_GetInterfaceList = ::std::option::Option< + unsafe extern "C" fn(pInterfacesList: CK_INTERFACE_PTR, pulCount: CK_ULONG_PTR) -> CK_RV, +>; +pub type CK_C_GetInterface = ::std::option::Option< + unsafe extern "C" fn( + pInterfaceName: CK_UTF8CHAR_PTR, + pVersion: CK_VERSION_PTR, + ppInterface: CK_INTERFACE_PTR_PTR, + flags: CK_FLAGS, + ) -> CK_RV, +>; +pub type CK_C_LoginUser = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + userType: CK_USER_TYPE, + pPin: CK_UTF8CHAR_PTR, + ulPinLen: CK_ULONG, + pUsername: CK_UTF8CHAR_PTR, + ulUsernameLen: CK_ULONG, + ) -> CK_RV, +>; +pub type CK_C_SessionCancel = ::std::option::Option< + unsafe extern "C" fn(hSession: CK_SESSION_HANDLE, flags: CK_FLAGS) -> CK_RV, +>; +pub type CK_C_MessageEncryptInit = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, + ) -> CK_RV, +>; +pub type CK_C_EncryptMessage = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pAssociatedData: CK_BYTE_PTR, + ulAssociatedDataLen: CK_ULONG, + pPlaintext: CK_BYTE_PTR, + ulPlaintextLen: CK_ULONG, + pCiphertext: CK_BYTE_PTR, + pulCiphertextLen: CK_ULONG_PTR, + ) -> CK_RV, +>; +pub type CK_C_EncryptMessageBegin = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pAssociatedData: CK_BYTE_PTR, + ulAssociatedDataLen: CK_ULONG, + ) -> CK_RV, +>; +pub type CK_C_EncryptMessageNext = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pPlaintextPart: CK_BYTE_PTR, + ulPlaintextPartLen: CK_ULONG, + pCiphertextPart: CK_BYTE_PTR, + pulCiphertextPartLen: CK_ULONG_PTR, + flags: CK_FLAGS, + ) -> CK_RV, +>; +pub type CK_C_MessageEncryptFinal = + ::std::option::Option CK_RV>; +pub type CK_C_MessageDecryptInit = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, + ) -> CK_RV, +>; +pub type CK_C_DecryptMessage = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pAssociatedData: CK_BYTE_PTR, + ulAssociatedDataLen: CK_ULONG, + pCiphertext: CK_BYTE_PTR, + ulCiphertextLen: CK_ULONG, + pPlaintext: CK_BYTE_PTR, + pulPlaintextLen: CK_ULONG_PTR, + ) -> CK_RV, +>; +pub type CK_C_DecryptMessageBegin = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pAssociatedData: CK_BYTE_PTR, + ulAssociatedDataLen: CK_ULONG, + ) -> CK_RV, +>; +pub type CK_C_DecryptMessageNext = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pCiphertext: CK_BYTE_PTR, + ulCiphertextLen: CK_ULONG, + pPlaintext: CK_BYTE_PTR, + pulPlaintextLen: CK_ULONG_PTR, + flags: CK_FLAGS, + ) -> CK_RV, +>; +pub type CK_C_MessageDecryptFinal = + ::std::option::Option CK_RV>; +pub type CK_C_MessageSignInit = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, + ) -> CK_RV, +>; +pub type CK_C_SignMessage = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + pulSignatureLen: CK_ULONG_PTR, + ) -> CK_RV, +>; +pub type CK_C_SignMessageBegin = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + ) -> CK_RV, +>; +pub type CK_C_SignMessageNext = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + pulSignatureLen: CK_ULONG_PTR, + ) -> CK_RV, +>; +pub type CK_C_MessageSignFinal = + ::std::option::Option CK_RV>; +pub type CK_C_MessageVerifyInit = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, + ) -> CK_RV, +>; +pub type CK_C_VerifyMessage = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + ulSignatureLen: CK_ULONG, + ) -> CK_RV, +>; +pub type CK_C_VerifyMessageBegin = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + ) -> CK_RV, +>; +pub type CK_C_VerifyMessageNext = ::std::option::Option< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + ulSignatureLen: CK_ULONG, + ) -> CK_RV, +>; +pub type CK_C_MessageVerifyFinal = + ::std::option::Option CK_RV>; +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct CK_FUNCTION_LIST_3_0 { + pub version: CK_VERSION, + pub C_Initialize: CK_C_Initialize, + pub C_Finalize: CK_C_Finalize, + pub C_GetInfo: CK_C_GetInfo, + pub C_GetFunctionList: CK_C_GetFunctionList, + pub C_GetSlotList: CK_C_GetSlotList, + pub C_GetSlotInfo: CK_C_GetSlotInfo, + pub C_GetTokenInfo: CK_C_GetTokenInfo, + pub C_GetMechanismList: CK_C_GetMechanismList, + pub C_GetMechanismInfo: CK_C_GetMechanismInfo, + pub C_InitToken: CK_C_InitToken, + pub C_InitPIN: CK_C_InitPIN, + pub C_SetPIN: CK_C_SetPIN, + pub C_OpenSession: CK_C_OpenSession, + pub C_CloseSession: CK_C_CloseSession, + pub C_CloseAllSessions: CK_C_CloseAllSessions, + pub C_GetSessionInfo: CK_C_GetSessionInfo, + pub C_GetOperationState: CK_C_GetOperationState, + pub C_SetOperationState: CK_C_SetOperationState, + pub C_Login: CK_C_Login, + pub C_Logout: CK_C_Logout, + pub C_CreateObject: CK_C_CreateObject, + pub C_CopyObject: CK_C_CopyObject, + pub C_DestroyObject: CK_C_DestroyObject, + pub C_GetObjectSize: CK_C_GetObjectSize, + pub C_GetAttributeValue: CK_C_GetAttributeValue, + pub C_SetAttributeValue: CK_C_SetAttributeValue, + pub C_FindObjectsInit: CK_C_FindObjectsInit, + pub C_FindObjects: CK_C_FindObjects, + pub C_FindObjectsFinal: CK_C_FindObjectsFinal, + pub C_EncryptInit: CK_C_EncryptInit, + pub C_Encrypt: CK_C_Encrypt, + pub C_EncryptUpdate: CK_C_EncryptUpdate, + pub C_EncryptFinal: CK_C_EncryptFinal, + pub C_DecryptInit: CK_C_DecryptInit, + pub C_Decrypt: CK_C_Decrypt, + pub C_DecryptUpdate: CK_C_DecryptUpdate, + pub C_DecryptFinal: CK_C_DecryptFinal, + pub C_DigestInit: CK_C_DigestInit, + pub C_Digest: CK_C_Digest, + pub C_DigestUpdate: CK_C_DigestUpdate, + pub C_DigestKey: CK_C_DigestKey, + pub C_DigestFinal: CK_C_DigestFinal, + pub C_SignInit: CK_C_SignInit, + pub C_Sign: CK_C_Sign, + pub C_SignUpdate: CK_C_SignUpdate, + pub C_SignFinal: CK_C_SignFinal, + pub C_SignRecoverInit: CK_C_SignRecoverInit, + pub C_SignRecover: CK_C_SignRecover, + pub C_VerifyInit: CK_C_VerifyInit, + pub C_Verify: CK_C_Verify, + pub C_VerifyUpdate: CK_C_VerifyUpdate, + pub C_VerifyFinal: CK_C_VerifyFinal, + pub C_VerifyRecoverInit: CK_C_VerifyRecoverInit, + pub C_VerifyRecover: CK_C_VerifyRecover, + pub C_DigestEncryptUpdate: CK_C_DigestEncryptUpdate, + pub C_DecryptDigestUpdate: CK_C_DecryptDigestUpdate, + pub C_SignEncryptUpdate: CK_C_SignEncryptUpdate, + pub C_DecryptVerifyUpdate: CK_C_DecryptVerifyUpdate, + pub C_GenerateKey: CK_C_GenerateKey, + pub C_GenerateKeyPair: CK_C_GenerateKeyPair, + pub C_WrapKey: CK_C_WrapKey, + pub C_UnwrapKey: CK_C_UnwrapKey, + pub C_DeriveKey: CK_C_DeriveKey, + pub C_SeedRandom: CK_C_SeedRandom, + pub C_GenerateRandom: CK_C_GenerateRandom, + pub C_GetFunctionStatus: CK_C_GetFunctionStatus, + pub C_CancelFunction: CK_C_CancelFunction, + pub C_WaitForSlotEvent: CK_C_WaitForSlotEvent, + pub C_GetInterfaceList: CK_C_GetInterfaceList, + pub C_GetInterface: CK_C_GetInterface, + pub C_LoginUser: CK_C_LoginUser, + pub C_SessionCancel: CK_C_SessionCancel, + pub C_MessageEncryptInit: CK_C_MessageEncryptInit, + pub C_EncryptMessage: CK_C_EncryptMessage, + pub C_EncryptMessageBegin: CK_C_EncryptMessageBegin, + pub C_EncryptMessageNext: CK_C_EncryptMessageNext, + pub C_MessageEncryptFinal: CK_C_MessageEncryptFinal, + pub C_MessageDecryptInit: CK_C_MessageDecryptInit, + pub C_DecryptMessage: CK_C_DecryptMessage, + pub C_DecryptMessageBegin: CK_C_DecryptMessageBegin, + pub C_DecryptMessageNext: CK_C_DecryptMessageNext, + pub C_MessageDecryptFinal: CK_C_MessageDecryptFinal, + pub C_MessageSignInit: CK_C_MessageSignInit, + pub C_SignMessage: CK_C_SignMessage, + pub C_SignMessageBegin: CK_C_SignMessageBegin, + pub C_SignMessageNext: CK_C_SignMessageNext, + pub C_MessageSignFinal: CK_C_MessageSignFinal, + pub C_MessageVerifyInit: CK_C_MessageVerifyInit, + pub C_VerifyMessage: CK_C_VerifyMessage, + pub C_VerifyMessageBegin: CK_C_VerifyMessageBegin, + 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::(), + 744usize, + concat!("Size of: ", stringify!(CK_FUNCTION_LIST_3_0)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + 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 }, + 8usize, + 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 }, + 16usize, + 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 }, + 24usize, + 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 }, + 32usize, + 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 }, + 40usize, + 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 }, + 48usize, + 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 }, + 56usize, + 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 }, + 64usize, + 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 }, + 72usize, + 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 }, + 80usize, + 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 }, + 88usize, + 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 }, + 96usize, + 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 }, + 104usize, + 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 }, + 112usize, + 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 }, + 120usize, + 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 }, + 128usize, + 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 }, + 136usize, + 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 }, + 144usize, + 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 }, + 152usize, + 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 }, + 160usize, + 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 }, + 168usize, + 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 }, + 176usize, + 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 }, + 184usize, + 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 }, + 192usize, + 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 }, + 200usize, + 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 }, + 208usize, + 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 }, + 216usize, + 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 }, + 224usize, + 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 }, + 232usize, + 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 }, + 240usize, + 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 }, + 248usize, + 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 }, + 256usize, + 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 }, + 264usize, + 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 }, + 272usize, + 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 }, + 280usize, + 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 }, + 288usize, + 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 }, + 296usize, + 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 }, + 304usize, + 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 }, + 312usize, + 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 }, + 320usize, + 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 }, + 328usize, + 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 }, + 336usize, + 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 }, + 344usize, + 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 }, + 352usize, + 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 }, + 360usize, + 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 }, + 368usize, + 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 }, + 376usize, + 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 }, + 384usize, + 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 }, + 392usize, + 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 }, + 400usize, + 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 }, + 408usize, + 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 }, + 416usize, + 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 }, + 424usize, + 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 }, + 432usize, + 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 }, + 440usize, + 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 }, + 448usize, + 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 }, + 456usize, + 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 }, + 464usize, + 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 }, + 472usize, + 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 }, + 480usize, + 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 }, + 488usize, + 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 }, + 496usize, + 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 }, + 504usize, + 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 }, + 512usize, + 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 }, + 520usize, + 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 }, + 528usize, + 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 }, + 536usize, + 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 }, + 544usize, + 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 }, + 552usize, + 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 }, + 560usize, + 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 }, + 568usize, + 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 }, + 576usize, + 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 }, + 584usize, + 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 }, + 592usize, + 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 }, + 600usize, + 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 }, + 608usize, + 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 }, + 616usize, + 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 }, + 624usize, + 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 }, + 632usize, + 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 }, + 640usize, + 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 }, + 648usize, + 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 }, + 656usize, + 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 }, + 664usize, + 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 }, + 672usize, + 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 }, + 680usize, + 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 }, + 688usize, + 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 }, + 696usize, + 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 }, + 704usize, + 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 }, + 712usize, + 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 }, + 720usize, + 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 }, + 728usize, + 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 }, + 736usize, + concat!( + "Offset of field: ", + stringify!(CK_FUNCTION_LIST_3_0), + "::", + stringify!(C_MessageVerifyFinal) + ) + ); +} #[repr(C)] #[derive(Debug, Default, Copy, Clone)] -pub struct _CK_FUNCTION_LIST { - pub version: _CK_VERSION, +pub struct CK_FUNCTION_LIST { + pub version: CK_VERSION, pub C_Initialize: CK_C_Initialize, pub C_Finalize: CK_C_Finalize, pub C_GetInfo: CK_C_GetInfo, @@ -2647,25 +9810,25 @@ pub struct _CK_FUNCTION_LIST { pub C_WaitForSlotEvent: CK_C_WaitForSlotEvent, } #[test] -fn bindgen_test_layout__CK_FUNCTION_LIST() { - const UNINIT: ::std::mem::MaybeUninit<_CK_FUNCTION_LIST> = ::std::mem::MaybeUninit::uninit(); +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::<_CK_FUNCTION_LIST>(), + ::std::mem::size_of::(), 552usize, - concat!("Size of: ", stringify!(_CK_FUNCTION_LIST)) + concat!("Size of: ", stringify!(CK_FUNCTION_LIST)) ); assert_eq!( - ::std::mem::align_of::<_CK_FUNCTION_LIST>(), + ::std::mem::align_of::(), 8usize, - concat!("Alignment of ", stringify!(_CK_FUNCTION_LIST)) + 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!(CK_FUNCTION_LIST), "::", stringify!(version) ) @@ -2675,7 +9838,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 8usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_Initialize) ) @@ -2685,7 +9848,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 16usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_Finalize) ) @@ -2695,7 +9858,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 24usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_GetInfo) ) @@ -2705,7 +9868,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 32usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_GetFunctionList) ) @@ -2715,7 +9878,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 40usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_GetSlotList) ) @@ -2725,7 +9888,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 48usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_GetSlotInfo) ) @@ -2735,7 +9898,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 56usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_GetTokenInfo) ) @@ -2745,7 +9908,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 64usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_GetMechanismList) ) @@ -2755,7 +9918,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 72usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_GetMechanismInfo) ) @@ -2765,7 +9928,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 80usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_InitToken) ) @@ -2775,7 +9938,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 88usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_InitPIN) ) @@ -2785,7 +9948,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 96usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_SetPIN) ) @@ -2795,7 +9958,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 104usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_OpenSession) ) @@ -2805,7 +9968,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 112usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_CloseSession) ) @@ -2815,7 +9978,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 120usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_CloseAllSessions) ) @@ -2825,7 +9988,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 128usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_GetSessionInfo) ) @@ -2835,7 +9998,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 136usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_GetOperationState) ) @@ -2845,7 +10008,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 144usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_SetOperationState) ) @@ -2855,7 +10018,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 152usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_Login) ) @@ -2865,7 +10028,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 160usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_Logout) ) @@ -2875,7 +10038,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 168usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_CreateObject) ) @@ -2885,7 +10048,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 176usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_CopyObject) ) @@ -2895,7 +10058,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 184usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_DestroyObject) ) @@ -2905,7 +10068,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 192usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_GetObjectSize) ) @@ -2915,7 +10078,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 200usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_GetAttributeValue) ) @@ -2925,7 +10088,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 208usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_SetAttributeValue) ) @@ -2935,7 +10098,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 216usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_FindObjectsInit) ) @@ -2945,7 +10108,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 224usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_FindObjects) ) @@ -2955,7 +10118,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 232usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_FindObjectsFinal) ) @@ -2965,7 +10128,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 240usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_EncryptInit) ) @@ -2975,7 +10138,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 248usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_Encrypt) ) @@ -2985,7 +10148,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 256usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_EncryptUpdate) ) @@ -2995,7 +10158,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 264usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_EncryptFinal) ) @@ -3005,7 +10168,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 272usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_DecryptInit) ) @@ -3015,7 +10178,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 280usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_Decrypt) ) @@ -3025,7 +10188,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 288usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_DecryptUpdate) ) @@ -3035,7 +10198,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 296usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_DecryptFinal) ) @@ -3045,7 +10208,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 304usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_DigestInit) ) @@ -3055,7 +10218,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 312usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_Digest) ) @@ -3065,7 +10228,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 320usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_DigestUpdate) ) @@ -3075,7 +10238,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 328usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_DigestKey) ) @@ -3085,7 +10248,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 336usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_DigestFinal) ) @@ -3095,7 +10258,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 344usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_SignInit) ) @@ -3105,7 +10268,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 352usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_Sign) ) @@ -3115,7 +10278,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 360usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_SignUpdate) ) @@ -3125,7 +10288,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 368usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_SignFinal) ) @@ -3135,7 +10298,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 376usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_SignRecoverInit) ) @@ -3145,7 +10308,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 384usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_SignRecover) ) @@ -3155,7 +10318,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 392usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_VerifyInit) ) @@ -3165,7 +10328,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 400usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_Verify) ) @@ -3175,7 +10338,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 408usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_VerifyUpdate) ) @@ -3185,7 +10348,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 416usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_VerifyFinal) ) @@ -3195,7 +10358,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 424usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_VerifyRecoverInit) ) @@ -3205,7 +10368,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 432usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_VerifyRecover) ) @@ -3215,7 +10378,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 440usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_DigestEncryptUpdate) ) @@ -3225,7 +10388,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 448usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_DecryptDigestUpdate) ) @@ -3235,7 +10398,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 456usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_SignEncryptUpdate) ) @@ -3245,7 +10408,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 464usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_DecryptVerifyUpdate) ) @@ -3255,7 +10418,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 472usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_GenerateKey) ) @@ -3265,7 +10428,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 480usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_GenerateKeyPair) ) @@ -3275,7 +10438,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 488usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_WrapKey) ) @@ -3285,7 +10448,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 496usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_UnwrapKey) ) @@ -3295,7 +10458,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 504usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_DeriveKey) ) @@ -3305,7 +10468,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 512usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_SeedRandom) ) @@ -3315,7 +10478,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 520usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_GenerateRandom) ) @@ -3325,7 +10488,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 528usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_GetFunctionStatus) ) @@ -3335,7 +10498,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 536usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), + stringify!(CK_FUNCTION_LIST), "::", stringify!(C_CancelFunction) ) @@ -3345,223 +10508,45 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { 544usize, concat!( "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), - "::", - stringify!(C_WaitForSlotEvent) - ) - ); -} -pub type CK_CREATEMUTEX = - ::std::option::Option CK_RV>; -pub type CK_DESTROYMUTEX = - ::std::option::Option CK_RV>; -pub type CK_LOCKMUTEX = - ::std::option::Option CK_RV>; -pub type CK_UNLOCKMUTEX = - ::std::option::Option CK_RV>; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct _CK_C_INITIALIZE_ARGS { - pub CreateMutex: CK_CREATEMUTEX, - pub DestroyMutex: CK_DESTROYMUTEX, - pub LockMutex: CK_LOCKMUTEX, - pub UnlockMutex: CK_UNLOCKMUTEX, - pub flags: CK_FLAGS, - pub pReserved: *mut ::std::os::raw::c_void, -} -#[test] -fn bindgen_test_layout__CK_C_INITIALIZE_ARGS() { - const UNINIT: ::std::mem::MaybeUninit<_CK_C_INITIALIZE_ARGS> = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<_CK_C_INITIALIZE_ARGS>(), - 48usize, - concat!("Size of: ", stringify!(_CK_C_INITIALIZE_ARGS)) - ); - assert_eq!( - ::std::mem::align_of::<_CK_C_INITIALIZE_ARGS>(), - 8usize, - 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 }, - 40usize, - concat!( - "Offset of field: ", - stringify!(_CK_C_INITIALIZE_ARGS), + stringify!(CK_FUNCTION_LIST), "::", - stringify!(pReserved) - ) - ); -} -impl Default for _CK_C_INITIALIZE_ARGS { - fn default() -> Self { - let mut s = ::std::mem::MaybeUninit::::uninit(); - unsafe { - ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -pub type CK_BYTE = ::std::os::raw::c_uchar; -pub type CK_CHAR = ::std::os::raw::c_uchar; -pub type CK_UTF8CHAR = ::std::os::raw::c_uchar; -pub type CK_BBOOL = ::std::os::raw::c_uchar; -pub type CK_ULONG = ::std::os::raw::c_ulong; -pub type CK_LONG = ::std::os::raw::c_long; -pub type CK_BYTE_PTR = *mut CK_BYTE; -pub type CK_CHAR_PTR = *mut CK_CHAR; -pub type CK_UTF8CHAR_PTR = *mut CK_UTF8CHAR; -pub type CK_ULONG_PTR = *mut CK_ULONG; -pub type CK_VOID_PTR = *mut ::std::os::raw::c_void; -pub type CK_VOID_PTR_PTR = *mut *mut ::std::os::raw::c_void; -pub type CK_VERSION = _CK_VERSION; -pub type CK_VERSION_PTR = *mut _CK_VERSION; -pub type CK_INFO = _CK_INFO; -pub type CK_INFO_PTR = *mut _CK_INFO; -pub type CK_SLOT_ID_PTR = *mut CK_SLOT_ID; -pub type CK_SLOT_INFO = _CK_SLOT_INFO; -pub type CK_SLOT_INFO_PTR = *mut _CK_SLOT_INFO; -pub type CK_TOKEN_INFO = _CK_TOKEN_INFO; -pub type CK_TOKEN_INFO_PTR = *mut _CK_TOKEN_INFO; -pub type CK_SESSION_HANDLE_PTR = *mut CK_SESSION_HANDLE; -pub type CK_SESSION_INFO = _CK_SESSION_INFO; -pub type CK_SESSION_INFO_PTR = *mut _CK_SESSION_INFO; -pub type CK_OBJECT_HANDLE_PTR = *mut CK_OBJECT_HANDLE; -pub type CK_OBJECT_CLASS_PTR = *mut CK_OBJECT_CLASS; -pub type CK_ATTRIBUTE = _CK_ATTRIBUTE; -pub type CK_ATTRIBUTE_PTR = *mut _CK_ATTRIBUTE; -pub type CK_DATE = _CK_DATE; -pub type CK_DATE_PTR = *mut _CK_DATE; -pub type CK_MECHANISM_TYPE_PTR = *mut CK_MECHANISM_TYPE; -pub type CK_MECHANISM = _CK_MECHANISM; -pub type CK_MECHANISM_PTR = *mut _CK_MECHANISM; -pub type CK_MECHANISM_INFO = _CK_MECHANISM_INFO; -pub type CK_MECHANISM_INFO_PTR = *mut _CK_MECHANISM_INFO; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct ck_otp_mechanism_info { - _unused: [u8; 0], -} -pub type CK_OTP_MECHANISM_INFO = ck_otp_mechanism_info; -pub type CK_OTP_MECHANISM_INFO_PTR = *mut ck_otp_mechanism_info; -pub type CK_FUNCTION_LIST = _CK_FUNCTION_LIST; -pub type CK_FUNCTION_LIST_PTR = *mut _CK_FUNCTION_LIST; -pub type CK_FUNCTION_LIST_PTR_PTR = *mut *mut _CK_FUNCTION_LIST; -pub type CK_C_INITIALIZE_ARGS = _CK_C_INITIALIZE_ARGS; -pub type CK_C_INITIALIZE_ARGS_PTR = *mut _CK_C_INITIALIZE_ARGS; -pub type CK_RSA_PKCS_PSS_PARAMS = ck_rsa_pkcs_pss_params; -pub type CK_RSA_PKCS_PSS_PARAMS_PTR = *mut ck_rsa_pkcs_pss_params; -pub type CK_RSA_PKCS_OAEP_PARAMS = ck_rsa_pkcs_oaep_params; -pub type CK_RSA_PKCS_OAEP_PARAMS_PTR = *mut ck_rsa_pkcs_oaep_params; -pub type CK_AES_CTR_PARAMS = ck_aes_ctr_params; -pub type CK_AES_CTR_PARAMS_PTR = *mut ck_aes_ctr_params; -pub type CK_GCM_PARAMS = ck_gcm_params; -pub type CK_GCM_PARAMS_PTR = *mut ck_gcm_params; -pub type CK_ECDH1_DERIVE_PARAMS = ck_ecdh1_derive_params; -pub type CK_ECDH1_DERIVE_PARAMS_PTR = *mut ck_ecdh1_derive_params; -pub type CK_KEY_DERIVATION_STRING_DATA = ck_key_derivation_string_data; -pub type CK_KEY_DERIVATION_STRING_DATA_PTR = *mut ck_key_derivation_string_data; -pub type CK_DES_CBC_ENCRYPT_DATA_PARAMS = ck_des_cbc_encrypt_data_params; -pub type CK_DES_CBC_ENCRYPT_DATA_PARAMS_PTR = *mut ck_des_cbc_encrypt_data_params; -pub type CK_AES_CBC_ENCRYPT_DATA_PARAMS = ck_aes_cbc_encrypt_data_params; -pub type CK_AES_CBC_ENCRYPT_DATA_PARAMS_PTR = *mut ck_aes_cbc_encrypt_data_params; + stringify!(C_WaitForSlotEvent) + ) + ); +} extern crate libloading; pub struct Pkcs11 { __library: ::libloading::Library, - pub C_Initialize: Result< - unsafe extern "C" fn(init_args: *mut ::std::os::raw::c_void) -> CK_RV, - ::libloading::Error, - >, - pub C_Finalize: Result< - unsafe extern "C" fn(pReserved: *mut ::std::os::raw::c_void) -> CK_RV, - ::libloading::Error, - >, - pub C_GetInfo: Result CK_RV, ::libloading::Error>, + pub C_Initialize: + Result CK_RV, ::libloading::Error>, + pub C_Finalize: + Result CK_RV, ::libloading::Error>, + pub C_GetInfo: Result CK_RV, ::libloading::Error>, pub C_GetFunctionList: Result< - unsafe extern "C" fn(function_list: *mut *mut _CK_FUNCTION_LIST) -> CK_RV, + unsafe extern "C" fn(ppFunctionList: CK_FUNCTION_LIST_PTR_PTR) -> CK_RV, ::libloading::Error, >, pub C_GetSlotList: Result< unsafe extern "C" fn( - token_present: ::std::os::raw::c_uchar, - slot_list: *mut CK_SLOT_ID, - ulCount: *mut ::std::os::raw::c_ulong, + tokenPresent: CK_BBOOL, + pSlotList: CK_SLOT_ID_PTR, + pulCount: CK_ULONG_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_GetSlotInfo: Result< - unsafe extern "C" fn(slotID: CK_SLOT_ID, info: *mut _CK_SLOT_INFO) -> CK_RV, + unsafe extern "C" fn(slotID: CK_SLOT_ID, pInfo: CK_SLOT_INFO_PTR) -> CK_RV, ::libloading::Error, >, pub C_GetTokenInfo: Result< - unsafe extern "C" fn(slotID: CK_SLOT_ID, info: *mut _CK_TOKEN_INFO) -> CK_RV, - ::libloading::Error, - >, - pub C_WaitForSlotEvent: Result< - unsafe extern "C" fn( - flags: CK_FLAGS, - slot: *mut CK_SLOT_ID, - pReserved: *mut ::std::os::raw::c_void, - ) -> CK_RV, + unsafe extern "C" fn(slotID: CK_SLOT_ID, pInfo: CK_TOKEN_INFO_PTR) -> CK_RV, ::libloading::Error, >, pub C_GetMechanismList: Result< unsafe extern "C" fn( slotID: CK_SLOT_ID, - mechanism_list: *mut CK_MECHANISM_TYPE, - ulCount: *mut ::std::os::raw::c_ulong, + pMechanismList: CK_MECHANISM_TYPE_PTR, + pulCount: CK_ULONG_PTR, ) -> CK_RV, ::libloading::Error, >, @@ -3569,34 +10554,34 @@ pub struct Pkcs11 { unsafe extern "C" fn( slotID: CK_SLOT_ID, type_: CK_MECHANISM_TYPE, - info: *mut _CK_MECHANISM_INFO, + pInfo: CK_MECHANISM_INFO_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_InitToken: Result< unsafe extern "C" fn( slotID: CK_SLOT_ID, - pin: *mut ::std::os::raw::c_uchar, - pin_len: ::std::os::raw::c_ulong, - label: *mut ::std::os::raw::c_uchar, + pPin: CK_UTF8CHAR_PTR, + ulPinLen: CK_ULONG, + pLabel: CK_UTF8CHAR_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_InitPIN: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - pin: *mut ::std::os::raw::c_uchar, - pin_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pPin: CK_UTF8CHAR_PTR, + ulPinLen: CK_ULONG, ) -> CK_RV, ::libloading::Error, >, pub C_SetPIN: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - old_pin: *mut ::std::os::raw::c_uchar, - old_len: ::std::os::raw::c_ulong, - new_pin: *mut ::std::os::raw::c_uchar, - new_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pOldPin: CK_UTF8CHAR_PTR, + ulOldLen: CK_ULONG, + pNewPin: CK_UTF8CHAR_PTR, + ulNewLen: CK_ULONG, ) -> CK_RV, ::libloading::Error, >, @@ -3604,445 +10589,659 @@ pub struct Pkcs11 { unsafe extern "C" fn( slotID: CK_SLOT_ID, flags: CK_FLAGS, - application: *mut ::std::os::raw::c_void, - notify: CK_NOTIFY, - session: *mut CK_SESSION_HANDLE, + pApplication: CK_VOID_PTR, + Notify: CK_NOTIFY, + phSession: CK_SESSION_HANDLE_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_CloseSession: - Result CK_RV, ::libloading::Error>, + Result CK_RV, ::libloading::Error>, pub C_CloseAllSessions: Result CK_RV, ::libloading::Error>, pub C_GetSessionInfo: Result< - unsafe extern "C" fn(session: CK_SESSION_HANDLE, info: *mut _CK_SESSION_INFO) -> CK_RV, + unsafe extern "C" fn(hSession: CK_SESSION_HANDLE, pInfo: CK_SESSION_INFO_PTR) -> CK_RV, ::libloading::Error, >, pub C_GetOperationState: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - operation_state: *mut ::std::os::raw::c_uchar, - operation_state_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pOperationState: CK_BYTE_PTR, + pulOperationStateLen: CK_ULONG_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_SetOperationState: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - operation_state: *mut ::std::os::raw::c_uchar, - operation_state_len: ::std::os::raw::c_ulong, - encryption_key: CK_OBJECT_HANDLE, - authentiation_key: CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pOperationState: CK_BYTE_PTR, + ulOperationStateLen: CK_ULONG, + hEncryptionKey: CK_OBJECT_HANDLE, + hAuthenticationKey: CK_OBJECT_HANDLE, ) -> CK_RV, ::libloading::Error, >, pub C_Login: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - user_type: CK_USER_TYPE, - pin: *mut ::std::os::raw::c_uchar, - pin_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + userType: CK_USER_TYPE, + pPin: CK_UTF8CHAR_PTR, + ulPinLen: CK_ULONG, ) -> CK_RV, ::libloading::Error, >, pub C_Logout: - Result CK_RV, ::libloading::Error>, + Result CK_RV, ::libloading::Error>, pub C_CreateObject: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - templ: *mut _CK_ATTRIBUTE, - ulCount: ::std::os::raw::c_ulong, - object: *mut CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pTemplate: CK_ATTRIBUTE_PTR, + ulCount: CK_ULONG, + phObject: CK_OBJECT_HANDLE_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_CopyObject: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - object: CK_OBJECT_HANDLE, - templ: *mut _CK_ATTRIBUTE, - ulCount: ::std::os::raw::c_ulong, - new_object: *mut CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + hObject: CK_OBJECT_HANDLE, + pTemplate: CK_ATTRIBUTE_PTR, + ulCount: CK_ULONG, + phNewObject: CK_OBJECT_HANDLE_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_DestroyObject: Result< - unsafe extern "C" fn(session: CK_SESSION_HANDLE, object: CK_OBJECT_HANDLE) -> CK_RV, + unsafe extern "C" fn(hSession: CK_SESSION_HANDLE, hObject: CK_OBJECT_HANDLE) -> CK_RV, ::libloading::Error, >, pub C_GetObjectSize: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - object: CK_OBJECT_HANDLE, - size: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + hObject: CK_OBJECT_HANDLE, + pulSize: CK_ULONG_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_GetAttributeValue: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - object: CK_OBJECT_HANDLE, - templ: *mut _CK_ATTRIBUTE, - ulCount: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + hObject: CK_OBJECT_HANDLE, + pTemplate: CK_ATTRIBUTE_PTR, + ulCount: CK_ULONG, ) -> CK_RV, ::libloading::Error, >, pub C_SetAttributeValue: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - object: CK_OBJECT_HANDLE, - templ: *mut _CK_ATTRIBUTE, - ulCount: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + hObject: CK_OBJECT_HANDLE, + pTemplate: CK_ATTRIBUTE_PTR, + ulCount: CK_ULONG, ) -> CK_RV, ::libloading::Error, >, pub C_FindObjectsInit: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - templ: *mut _CK_ATTRIBUTE, - ulCount: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pTemplate: CK_ATTRIBUTE_PTR, + ulCount: CK_ULONG, ) -> CK_RV, ::libloading::Error, >, pub C_FindObjects: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - object: *mut CK_OBJECT_HANDLE, - max_object_count: ::std::os::raw::c_ulong, - object_count: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + phObject: CK_OBJECT_HANDLE_PTR, + ulMaxObjectCount: CK_ULONG, + pulObjectCount: CK_ULONG_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_FindObjectsFinal: - Result CK_RV, ::libloading::Error>, + Result CK_RV, ::libloading::Error>, pub C_EncryptInit: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - key: CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, ) -> CK_RV, ::libloading::Error, >, pub C_Encrypt: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - data: *mut ::std::os::raw::c_uchar, - data_len: ::std::os::raw::c_ulong, - encrypted_data: *mut ::std::os::raw::c_uchar, - encrypted_data_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pEncryptedData: CK_BYTE_PTR, + pulEncryptedDataLen: CK_ULONG_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_EncryptUpdate: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - part: *mut ::std::os::raw::c_uchar, - part_len: ::std::os::raw::c_ulong, - encrypted_part: *mut ::std::os::raw::c_uchar, - encrypted_part_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pPart: CK_BYTE_PTR, + ulPartLen: CK_ULONG, + pEncryptedPart: CK_BYTE_PTR, + pulEncryptedPartLen: CK_ULONG_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_EncryptFinal: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - last_encrypted_part: *mut ::std::os::raw::c_uchar, - last_encrypted_part_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pLastEncryptedPart: CK_BYTE_PTR, + pulLastEncryptedPartLen: CK_ULONG_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_DecryptInit: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - key: CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, ) -> CK_RV, ::libloading::Error, >, pub C_Decrypt: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - encrypted_data: *mut ::std::os::raw::c_uchar, - encrypted_data_len: ::std::os::raw::c_ulong, - data: *mut ::std::os::raw::c_uchar, - data_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pEncryptedData: CK_BYTE_PTR, + ulEncryptedDataLen: CK_ULONG, + pData: CK_BYTE_PTR, + pulDataLen: CK_ULONG_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_DecryptUpdate: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - encrypted_part: *mut ::std::os::raw::c_uchar, - encrypted_part_len: ::std::os::raw::c_ulong, - part: *mut ::std::os::raw::c_uchar, - part_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pEncryptedPart: CK_BYTE_PTR, + ulEncryptedPartLen: CK_ULONG, + pPart: CK_BYTE_PTR, + pulPartLen: CK_ULONG_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_DecryptFinal: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - last_part: *mut ::std::os::raw::c_uchar, - last_part_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pLastPart: CK_BYTE_PTR, + pulLastPartLen: CK_ULONG_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_DigestInit: Result< - unsafe extern "C" fn(session: CK_SESSION_HANDLE, mechanism: *mut _CK_MECHANISM) -> CK_RV, + unsafe extern "C" fn(hSession: CK_SESSION_HANDLE, pMechanism: CK_MECHANISM_PTR) -> CK_RV, ::libloading::Error, >, pub C_Digest: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - data: *mut ::std::os::raw::c_uchar, - data_len: ::std::os::raw::c_ulong, - digest: *mut ::std::os::raw::c_uchar, - digest_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pDigest: CK_BYTE_PTR, + pulDigestLen: CK_ULONG_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_DigestUpdate: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - part: *mut ::std::os::raw::c_uchar, - part_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pPart: CK_BYTE_PTR, + ulPartLen: CK_ULONG, ) -> CK_RV, ::libloading::Error, >, pub C_DigestKey: Result< - unsafe extern "C" fn(session: CK_SESSION_HANDLE, key: CK_OBJECT_HANDLE) -> CK_RV, + unsafe extern "C" fn(hSession: CK_SESSION_HANDLE, hKey: CK_OBJECT_HANDLE) -> CK_RV, ::libloading::Error, >, pub C_DigestFinal: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - digest: *mut ::std::os::raw::c_uchar, - digest_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pDigest: CK_BYTE_PTR, + pulDigestLen: CK_ULONG_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_SignInit: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - key: CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, ) -> CK_RV, ::libloading::Error, >, pub C_Sign: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - data: *mut ::std::os::raw::c_uchar, - data_len: ::std::os::raw::c_ulong, - signature: *mut ::std::os::raw::c_uchar, - signature_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + pulSignatureLen: CK_ULONG_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_SignUpdate: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - part: *mut ::std::os::raw::c_uchar, - part_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pPart: CK_BYTE_PTR, + ulPartLen: CK_ULONG, ) -> CK_RV, ::libloading::Error, >, pub C_SignFinal: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - signature: *mut ::std::os::raw::c_uchar, - signature_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pSignature: CK_BYTE_PTR, + pulSignatureLen: CK_ULONG_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_SignRecoverInit: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - key: CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, ) -> CK_RV, ::libloading::Error, >, pub C_SignRecover: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - data: *mut ::std::os::raw::c_uchar, - data_len: ::std::os::raw::c_ulong, - signature: *mut ::std::os::raw::c_uchar, - signature_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + pulSignatureLen: CK_ULONG_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_VerifyInit: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - key: CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, ) -> CK_RV, ::libloading::Error, >, pub C_Verify: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - data: *mut ::std::os::raw::c_uchar, - data_len: ::std::os::raw::c_ulong, - signature: *mut ::std::os::raw::c_uchar, - signature_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + ulSignatureLen: CK_ULONG, ) -> CK_RV, ::libloading::Error, >, pub C_VerifyUpdate: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - part: *mut ::std::os::raw::c_uchar, - part_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pPart: CK_BYTE_PTR, + ulPartLen: CK_ULONG, ) -> CK_RV, ::libloading::Error, >, pub C_VerifyFinal: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - signature: *mut ::std::os::raw::c_uchar, - signature_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pSignature: CK_BYTE_PTR, + ulSignatureLen: CK_ULONG, ) -> CK_RV, ::libloading::Error, >, pub C_VerifyRecoverInit: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - key: CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, ) -> CK_RV, ::libloading::Error, >, pub C_VerifyRecover: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - signature: *mut ::std::os::raw::c_uchar, - signature_len: ::std::os::raw::c_ulong, - data: *mut ::std::os::raw::c_uchar, - data_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pSignature: CK_BYTE_PTR, + ulSignatureLen: CK_ULONG, + pData: CK_BYTE_PTR, + pulDataLen: CK_ULONG_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_DigestEncryptUpdate: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - part: *mut ::std::os::raw::c_uchar, - part_len: ::std::os::raw::c_ulong, - encrypted_part: *mut ::std::os::raw::c_uchar, - encrypted_part_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pPart: CK_BYTE_PTR, + ulPartLen: CK_ULONG, + pEncryptedPart: CK_BYTE_PTR, + pulEncryptedPartLen: CK_ULONG_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_DecryptDigestUpdate: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - encrypted_part: *mut ::std::os::raw::c_uchar, - encrypted_part_len: ::std::os::raw::c_ulong, - part: *mut ::std::os::raw::c_uchar, - part_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pEncryptedPart: CK_BYTE_PTR, + ulEncryptedPartLen: CK_ULONG, + pPart: CK_BYTE_PTR, + pulPartLen: CK_ULONG_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_SignEncryptUpdate: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - part: *mut ::std::os::raw::c_uchar, - part_len: ::std::os::raw::c_ulong, - encrypted_part: *mut ::std::os::raw::c_uchar, - encrypted_part_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pPart: CK_BYTE_PTR, + ulPartLen: CK_ULONG, + pEncryptedPart: CK_BYTE_PTR, + pulEncryptedPartLen: CK_ULONG_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_DecryptVerifyUpdate: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - encrypted_part: *mut ::std::os::raw::c_uchar, - encrypted_part_len: ::std::os::raw::c_ulong, - part: *mut ::std::os::raw::c_uchar, - part_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pEncryptedPart: CK_BYTE_PTR, + ulEncryptedPartLen: CK_ULONG, + pPart: CK_BYTE_PTR, + pulPartLen: CK_ULONG_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_GenerateKey: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - templ: *mut _CK_ATTRIBUTE, - ulCount: ::std::os::raw::c_ulong, - key: *mut CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + pTemplate: CK_ATTRIBUTE_PTR, + ulCount: CK_ULONG, + phKey: CK_OBJECT_HANDLE_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_GenerateKeyPair: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - public_key_template: *mut _CK_ATTRIBUTE, - public_key_attribute_count: ::std::os::raw::c_ulong, - private_key_template: *mut _CK_ATTRIBUTE, - private_key_attribute_count: ::std::os::raw::c_ulong, - public_key: *mut CK_OBJECT_HANDLE, - private_key: *mut CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + pPublicKeyTemplate: CK_ATTRIBUTE_PTR, + ulPublicKeyAttributeCount: CK_ULONG, + pPrivateKeyTemplate: CK_ATTRIBUTE_PTR, + ulPrivateKeyAttributeCount: CK_ULONG, + phPublicKey: CK_OBJECT_HANDLE_PTR, + phPrivateKey: CK_OBJECT_HANDLE_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_WrapKey: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - wrapping_key: CK_OBJECT_HANDLE, - key: CK_OBJECT_HANDLE, - wrapped_key: *mut ::std::os::raw::c_uchar, - wrapped_key_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hWrappingKey: CK_OBJECT_HANDLE, + hKey: CK_OBJECT_HANDLE, + pWrappedKey: CK_BYTE_PTR, + pulWrappedKeyLen: CK_ULONG_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_UnwrapKey: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - unwrapping_key: CK_OBJECT_HANDLE, - wrapped_key: *mut ::std::os::raw::c_uchar, - wrapped_key_len: ::std::os::raw::c_ulong, - templ: *mut _CK_ATTRIBUTE, - attribute_count: ::std::os::raw::c_ulong, - key: *mut CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hUnwrappingKey: CK_OBJECT_HANDLE, + pWrappedKey: CK_BYTE_PTR, + ulWrappedKeyLen: CK_ULONG, + pTemplate: CK_ATTRIBUTE_PTR, + ulAttributeCount: CK_ULONG, + phKey: CK_OBJECT_HANDLE_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_DeriveKey: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - base_key: CK_OBJECT_HANDLE, - templ: *mut _CK_ATTRIBUTE, - attribute_count: ::std::os::raw::c_ulong, - key: *mut CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hBaseKey: CK_OBJECT_HANDLE, + pTemplate: CK_ATTRIBUTE_PTR, + ulAttributeCount: CK_ULONG, + phKey: CK_OBJECT_HANDLE_PTR, ) -> CK_RV, ::libloading::Error, >, pub C_SeedRandom: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - seed: *mut ::std::os::raw::c_uchar, - seed_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pSeed: CK_BYTE_PTR, + ulSeedLen: CK_ULONG, ) -> CK_RV, ::libloading::Error, >, pub C_GenerateRandom: Result< unsafe extern "C" fn( - session: CK_SESSION_HANDLE, - random_data: *mut ::std::os::raw::c_uchar, - random_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + RandomData: CK_BYTE_PTR, + ulRandomLen: CK_ULONG, ) -> CK_RV, ::libloading::Error, >, pub C_GetFunctionStatus: - Result CK_RV, ::libloading::Error>, + Result CK_RV, ::libloading::Error>, pub C_CancelFunction: - Result CK_RV, ::libloading::Error>, + Result CK_RV, ::libloading::Error>, + pub C_WaitForSlotEvent: Result< + unsafe extern "C" fn( + flags: CK_FLAGS, + pSlot: CK_SLOT_ID_PTR, + pRserved: CK_VOID_PTR, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_GetInterfaceList: Result< + unsafe extern "C" fn(pInterfacesList: CK_INTERFACE_PTR, pulCount: CK_ULONG_PTR) -> CK_RV, + ::libloading::Error, + >, + pub C_GetInterface: Result< + unsafe extern "C" fn( + pInterfaceName: CK_UTF8CHAR_PTR, + pVersion: CK_VERSION_PTR, + ppInterface: CK_INTERFACE_PTR_PTR, + flags: CK_FLAGS, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_LoginUser: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + userType: CK_USER_TYPE, + pPin: CK_UTF8CHAR_PTR, + ulPinLen: CK_ULONG, + pUsername: CK_UTF8CHAR_PTR, + ulUsernameLen: CK_ULONG, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_SessionCancel: Result< + unsafe extern "C" fn(hSession: CK_SESSION_HANDLE, flags: CK_FLAGS) -> CK_RV, + ::libloading::Error, + >, + pub C_MessageEncryptInit: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_EncryptMessage: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pAssociatedData: CK_BYTE_PTR, + ulAssociatedDataLen: CK_ULONG, + pPlaintext: CK_BYTE_PTR, + ulPlaintextLen: CK_ULONG, + pCiphertext: CK_BYTE_PTR, + pulCiphertextLen: CK_ULONG_PTR, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_EncryptMessageBegin: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pAssociatedData: CK_BYTE_PTR, + ulAssociatedDataLen: CK_ULONG, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_EncryptMessageNext: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pPlaintextPart: CK_BYTE_PTR, + ulPlaintextPartLen: CK_ULONG, + pCiphertextPart: CK_BYTE_PTR, + pulCiphertextPartLen: CK_ULONG_PTR, + flags: CK_FLAGS, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_MessageEncryptFinal: + Result CK_RV, ::libloading::Error>, + pub C_MessageDecryptInit: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_DecryptMessage: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pAssociatedData: CK_BYTE_PTR, + ulAssociatedDataLen: CK_ULONG, + pCiphertext: CK_BYTE_PTR, + ulCiphertextLen: CK_ULONG, + pPlaintext: CK_BYTE_PTR, + pulPlaintextLen: CK_ULONG_PTR, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_DecryptMessageBegin: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pAssociatedData: CK_BYTE_PTR, + ulAssociatedDataLen: CK_ULONG, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_DecryptMessageNext: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pCiphertext: CK_BYTE_PTR, + ulCiphertextLen: CK_ULONG, + pPlaintext: CK_BYTE_PTR, + pulPlaintextLen: CK_ULONG_PTR, + flags: CK_FLAGS, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_MessageDecryptFinal: + Result CK_RV, ::libloading::Error>, + pub C_MessageSignInit: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_SignMessage: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + pulSignatureLen: CK_ULONG_PTR, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_SignMessageBegin: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_SignMessageNext: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + pulSignatureLen: CK_ULONG_PTR, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_MessageSignFinal: + Result CK_RV, ::libloading::Error>, + pub C_MessageVerifyInit: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_VerifyMessage: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + ulSignatureLen: CK_ULONG, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_VerifyMessageBegin: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_VerifyMessageNext: Result< + unsafe extern "C" fn( + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + ulSignatureLen: CK_ULONG, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_MessageVerifyFinal: + Result CK_RV, ::libloading::Error>, } impl Pkcs11 { pub unsafe fn new

(path: P) -> Result @@ -4064,7 +11263,6 @@ impl Pkcs11 { let C_GetSlotList = __library.get(b"C_GetSlotList\0").map(|sym| *sym); let C_GetSlotInfo = __library.get(b"C_GetSlotInfo\0").map(|sym| *sym); let C_GetTokenInfo = __library.get(b"C_GetTokenInfo\0").map(|sym| *sym); - let C_WaitForSlotEvent = __library.get(b"C_WaitForSlotEvent\0").map(|sym| *sym); let C_GetMechanismList = __library.get(b"C_GetMechanismList\0").map(|sym| *sym); let C_GetMechanismInfo = __library.get(b"C_GetMechanismInfo\0").map(|sym| *sym); let C_InitToken = __library.get(b"C_InitToken\0").map(|sym| *sym); @@ -4125,6 +11323,31 @@ impl Pkcs11 { let C_GenerateRandom = __library.get(b"C_GenerateRandom\0").map(|sym| *sym); let C_GetFunctionStatus = __library.get(b"C_GetFunctionStatus\0").map(|sym| *sym); let C_CancelFunction = __library.get(b"C_CancelFunction\0").map(|sym| *sym); + let C_WaitForSlotEvent = __library.get(b"C_WaitForSlotEvent\0").map(|sym| *sym); + let C_GetInterfaceList = __library.get(b"C_GetInterfaceList\0").map(|sym| *sym); + let C_GetInterface = __library.get(b"C_GetInterface\0").map(|sym| *sym); + let C_LoginUser = __library.get(b"C_LoginUser\0").map(|sym| *sym); + let C_SessionCancel = __library.get(b"C_SessionCancel\0").map(|sym| *sym); + let C_MessageEncryptInit = __library.get(b"C_MessageEncryptInit\0").map(|sym| *sym); + let C_EncryptMessage = __library.get(b"C_EncryptMessage\0").map(|sym| *sym); + let C_EncryptMessageBegin = __library.get(b"C_EncryptMessageBegin\0").map(|sym| *sym); + let C_EncryptMessageNext = __library.get(b"C_EncryptMessageNext\0").map(|sym| *sym); + let C_MessageEncryptFinal = __library.get(b"C_MessageEncryptFinal\0").map(|sym| *sym); + let C_MessageDecryptInit = __library.get(b"C_MessageDecryptInit\0").map(|sym| *sym); + let C_DecryptMessage = __library.get(b"C_DecryptMessage\0").map(|sym| *sym); + let C_DecryptMessageBegin = __library.get(b"C_DecryptMessageBegin\0").map(|sym| *sym); + let C_DecryptMessageNext = __library.get(b"C_DecryptMessageNext\0").map(|sym| *sym); + let C_MessageDecryptFinal = __library.get(b"C_MessageDecryptFinal\0").map(|sym| *sym); + let C_MessageSignInit = __library.get(b"C_MessageSignInit\0").map(|sym| *sym); + let C_SignMessage = __library.get(b"C_SignMessage\0").map(|sym| *sym); + let C_SignMessageBegin = __library.get(b"C_SignMessageBegin\0").map(|sym| *sym); + let C_SignMessageNext = __library.get(b"C_SignMessageNext\0").map(|sym| *sym); + let C_MessageSignFinal = __library.get(b"C_MessageSignFinal\0").map(|sym| *sym); + let C_MessageVerifyInit = __library.get(b"C_MessageVerifyInit\0").map(|sym| *sym); + let C_VerifyMessage = __library.get(b"C_VerifyMessage\0").map(|sym| *sym); + let C_VerifyMessageBegin = __library.get(b"C_VerifyMessageBegin\0").map(|sym| *sym); + let C_VerifyMessageNext = __library.get(b"C_VerifyMessageNext\0").map(|sym| *sym); + let C_MessageVerifyFinal = __library.get(b"C_MessageVerifyFinal\0").map(|sym| *sym); Ok(Pkcs11 { __library, C_Initialize, @@ -4134,7 +11357,6 @@ impl Pkcs11 { C_GetSlotList, C_GetSlotInfo, C_GetTokenInfo, - C_WaitForSlotEvent, C_GetMechanismList, C_GetMechanismInfo, C_InitToken, @@ -4195,146 +11417,164 @@ impl Pkcs11 { C_GenerateRandom, C_GetFunctionStatus, C_CancelFunction, + C_WaitForSlotEvent, + C_GetInterfaceList, + C_GetInterface, + C_LoginUser, + C_SessionCancel, + C_MessageEncryptInit, + C_EncryptMessage, + C_EncryptMessageBegin, + C_EncryptMessageNext, + C_MessageEncryptFinal, + C_MessageDecryptInit, + C_DecryptMessage, + C_DecryptMessageBegin, + C_DecryptMessageNext, + C_MessageDecryptFinal, + C_MessageSignInit, + C_SignMessage, + C_SignMessageBegin, + C_SignMessageNext, + C_MessageSignFinal, + C_MessageVerifyInit, + C_VerifyMessage, + C_VerifyMessageBegin, + C_VerifyMessageNext, + C_MessageVerifyFinal, }) } - pub unsafe fn C_Initialize(&self, init_args: *mut ::std::os::raw::c_void) -> CK_RV { + pub unsafe fn C_Initialize(&self, pInitArgs: CK_VOID_PTR) -> CK_RV { (self .C_Initialize .as_ref() - .expect("Expected function, got error."))(init_args) + .expect("Expected function, got error."))(pInitArgs) } - pub unsafe fn C_Finalize(&self, pReserved: *mut ::std::os::raw::c_void) -> CK_RV { + pub unsafe fn C_Finalize(&self, pReserved: CK_VOID_PTR) -> CK_RV { (self .C_Finalize .as_ref() .expect("Expected function, got error."))(pReserved) } - pub unsafe fn C_GetInfo(&self, info: *mut _CK_INFO) -> CK_RV { + pub unsafe fn C_GetInfo(&self, pInfo: CK_INFO_PTR) -> CK_RV { (self .C_GetInfo .as_ref() - .expect("Expected function, got error."))(info) + .expect("Expected function, got error."))(pInfo) } - pub unsafe fn C_GetFunctionList(&self, function_list: *mut *mut _CK_FUNCTION_LIST) -> CK_RV { + pub unsafe fn C_GetFunctionList(&self, ppFunctionList: CK_FUNCTION_LIST_PTR_PTR) -> CK_RV { (self .C_GetFunctionList .as_ref() - .expect("Expected function, got error."))(function_list) + .expect("Expected function, got error."))(ppFunctionList) } pub unsafe fn C_GetSlotList( &self, - token_present: ::std::os::raw::c_uchar, - slot_list: *mut CK_SLOT_ID, - ulCount: *mut ::std::os::raw::c_ulong, + tokenPresent: CK_BBOOL, + pSlotList: CK_SLOT_ID_PTR, + pulCount: CK_ULONG_PTR, ) -> CK_RV { (self .C_GetSlotList .as_ref() - .expect("Expected function, got error."))(token_present, slot_list, ulCount) + .expect("Expected function, got error."))(tokenPresent, pSlotList, pulCount) } - pub unsafe fn C_GetSlotInfo(&self, slotID: CK_SLOT_ID, info: *mut _CK_SLOT_INFO) -> CK_RV { + pub unsafe fn C_GetSlotInfo(&self, slotID: CK_SLOT_ID, pInfo: CK_SLOT_INFO_PTR) -> CK_RV { (self .C_GetSlotInfo .as_ref() - .expect("Expected function, got error."))(slotID, info) + .expect("Expected function, got error."))(slotID, pInfo) } - pub unsafe fn C_GetTokenInfo(&self, slotID: CK_SLOT_ID, info: *mut _CK_TOKEN_INFO) -> CK_RV { + pub unsafe fn C_GetTokenInfo(&self, slotID: CK_SLOT_ID, pInfo: CK_TOKEN_INFO_PTR) -> CK_RV { (self .C_GetTokenInfo .as_ref() - .expect("Expected function, got error."))(slotID, info) - } - pub unsafe fn C_WaitForSlotEvent( - &self, - flags: CK_FLAGS, - slot: *mut CK_SLOT_ID, - pReserved: *mut ::std::os::raw::c_void, - ) -> CK_RV { - (self - .C_WaitForSlotEvent - .as_ref() - .expect("Expected function, got error."))(flags, slot, pReserved) + .expect("Expected function, got error."))(slotID, pInfo) } pub unsafe fn C_GetMechanismList( &self, slotID: CK_SLOT_ID, - mechanism_list: *mut CK_MECHANISM_TYPE, - ulCount: *mut ::std::os::raw::c_ulong, + pMechanismList: CK_MECHANISM_TYPE_PTR, + pulCount: CK_ULONG_PTR, ) -> CK_RV { (self .C_GetMechanismList .as_ref() - .expect("Expected function, got error."))(slotID, mechanism_list, ulCount) + .expect("Expected function, got error."))(slotID, pMechanismList, pulCount) } pub unsafe fn C_GetMechanismInfo( &self, slotID: CK_SLOT_ID, type_: CK_MECHANISM_TYPE, - info: *mut _CK_MECHANISM_INFO, + pInfo: CK_MECHANISM_INFO_PTR, ) -> CK_RV { (self .C_GetMechanismInfo .as_ref() - .expect("Expected function, got error."))(slotID, type_, info) + .expect("Expected function, got error."))(slotID, type_, pInfo) } pub unsafe fn C_InitToken( &self, slotID: CK_SLOT_ID, - pin: *mut ::std::os::raw::c_uchar, - pin_len: ::std::os::raw::c_ulong, - label: *mut ::std::os::raw::c_uchar, + pPin: CK_UTF8CHAR_PTR, + ulPinLen: CK_ULONG, + pLabel: CK_UTF8CHAR_PTR, ) -> CK_RV { (self .C_InitToken .as_ref() - .expect("Expected function, got error."))(slotID, pin, pin_len, label) + .expect("Expected function, got error."))(slotID, pPin, ulPinLen, pLabel) } pub unsafe fn C_InitPIN( &self, - session: CK_SESSION_HANDLE, - pin: *mut ::std::os::raw::c_uchar, - pin_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pPin: CK_UTF8CHAR_PTR, + ulPinLen: CK_ULONG, ) -> CK_RV { (self .C_InitPIN .as_ref() - .expect("Expected function, got error."))(session, pin, pin_len) + .expect("Expected function, got error."))(hSession, pPin, ulPinLen) } pub unsafe fn C_SetPIN( &self, - session: CK_SESSION_HANDLE, - old_pin: *mut ::std::os::raw::c_uchar, - old_len: ::std::os::raw::c_ulong, - new_pin: *mut ::std::os::raw::c_uchar, - new_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pOldPin: CK_UTF8CHAR_PTR, + ulOldLen: CK_ULONG, + pNewPin: CK_UTF8CHAR_PTR, + ulNewLen: CK_ULONG, ) -> CK_RV { (self .C_SetPIN .as_ref() .expect("Expected function, got error."))( - session, old_pin, old_len, new_pin, new_len + hSession, pOldPin, ulOldLen, pNewPin, ulNewLen, ) } pub unsafe fn C_OpenSession( &self, slotID: CK_SLOT_ID, flags: CK_FLAGS, - application: *mut ::std::os::raw::c_void, - notify: CK_NOTIFY, - session: *mut CK_SESSION_HANDLE, + pApplication: CK_VOID_PTR, + Notify: CK_NOTIFY, + phSession: CK_SESSION_HANDLE_PTR, ) -> CK_RV { (self .C_OpenSession .as_ref() .expect("Expected function, got error."))( - slotID, flags, application, notify, session + slotID, + flags, + pApplication, + Notify, + phSession, ) } - pub unsafe fn C_CloseSession(&self, session: CK_SESSION_HANDLE) -> CK_RV { + pub unsafe fn C_CloseSession(&self, hSession: CK_SESSION_HANDLE) -> CK_RV { (self .C_CloseSession .as_ref() - .expect("Expected function, got error."))(session) + .expect("Expected function, got error."))(hSession) } pub unsafe fn C_CloseAllSessions(&self, slotID: CK_SLOT_ID) -> CK_RV { (self @@ -4344,723 +11584,1119 @@ impl Pkcs11 { } pub unsafe fn C_GetSessionInfo( &self, - session: CK_SESSION_HANDLE, - info: *mut _CK_SESSION_INFO, + hSession: CK_SESSION_HANDLE, + pInfo: CK_SESSION_INFO_PTR, ) -> CK_RV { (self .C_GetSessionInfo .as_ref() - .expect("Expected function, got error."))(session, info) + .expect("Expected function, got error."))(hSession, pInfo) } pub unsafe fn C_GetOperationState( &self, - session: CK_SESSION_HANDLE, - operation_state: *mut ::std::os::raw::c_uchar, - operation_state_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pOperationState: CK_BYTE_PTR, + pulOperationStateLen: CK_ULONG_PTR, ) -> CK_RV { (self .C_GetOperationState .as_ref() .expect("Expected function, got error."))( - session, operation_state, operation_state_len + hSession, + pOperationState, + pulOperationStateLen, ) } pub unsafe fn C_SetOperationState( &self, - session: CK_SESSION_HANDLE, - operation_state: *mut ::std::os::raw::c_uchar, - operation_state_len: ::std::os::raw::c_ulong, - encryption_key: CK_OBJECT_HANDLE, - authentiation_key: CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pOperationState: CK_BYTE_PTR, + ulOperationStateLen: CK_ULONG, + hEncryptionKey: CK_OBJECT_HANDLE, + hAuthenticationKey: CK_OBJECT_HANDLE, ) -> CK_RV { (self .C_SetOperationState .as_ref() .expect("Expected function, got error."))( - session, - operation_state, - operation_state_len, - encryption_key, - authentiation_key, + hSession, + pOperationState, + ulOperationStateLen, + hEncryptionKey, + hAuthenticationKey, ) } pub unsafe fn C_Login( &self, - session: CK_SESSION_HANDLE, - user_type: CK_USER_TYPE, - pin: *mut ::std::os::raw::c_uchar, - pin_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + userType: CK_USER_TYPE, + pPin: CK_UTF8CHAR_PTR, + ulPinLen: CK_ULONG, ) -> CK_RV { (self .C_Login .as_ref() - .expect("Expected function, got error."))(session, user_type, pin, pin_len) + .expect("Expected function, got error."))(hSession, userType, pPin, ulPinLen) } - pub unsafe fn C_Logout(&self, session: CK_SESSION_HANDLE) -> CK_RV { + pub unsafe fn C_Logout(&self, hSession: CK_SESSION_HANDLE) -> CK_RV { (self .C_Logout .as_ref() - .expect("Expected function, got error."))(session) + .expect("Expected function, got error."))(hSession) } pub unsafe fn C_CreateObject( &self, - session: CK_SESSION_HANDLE, - templ: *mut _CK_ATTRIBUTE, - ulCount: ::std::os::raw::c_ulong, - object: *mut CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pTemplate: CK_ATTRIBUTE_PTR, + ulCount: CK_ULONG, + phObject: CK_OBJECT_HANDLE_PTR, ) -> CK_RV { (self .C_CreateObject .as_ref() - .expect("Expected function, got error."))(session, templ, ulCount, object) + .expect("Expected function, got error."))(hSession, pTemplate, ulCount, phObject) } pub unsafe fn C_CopyObject( &self, - session: CK_SESSION_HANDLE, - object: CK_OBJECT_HANDLE, - templ: *mut _CK_ATTRIBUTE, - ulCount: ::std::os::raw::c_ulong, - new_object: *mut CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + hObject: CK_OBJECT_HANDLE, + pTemplate: CK_ATTRIBUTE_PTR, + ulCount: CK_ULONG, + phNewObject: CK_OBJECT_HANDLE_PTR, ) -> CK_RV { (self .C_CopyObject .as_ref() .expect("Expected function, got error."))( - session, object, templ, ulCount, new_object + hSession, + hObject, + pTemplate, + ulCount, + phNewObject, ) } pub unsafe fn C_DestroyObject( &self, - session: CK_SESSION_HANDLE, - object: CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + hObject: CK_OBJECT_HANDLE, ) -> CK_RV { (self .C_DestroyObject .as_ref() - .expect("Expected function, got error."))(session, object) + .expect("Expected function, got error."))(hSession, hObject) } pub unsafe fn C_GetObjectSize( &self, - session: CK_SESSION_HANDLE, - object: CK_OBJECT_HANDLE, - size: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + hObject: CK_OBJECT_HANDLE, + pulSize: CK_ULONG_PTR, ) -> CK_RV { (self .C_GetObjectSize .as_ref() - .expect("Expected function, got error."))(session, object, size) + .expect("Expected function, got error."))(hSession, hObject, pulSize) } pub unsafe fn C_GetAttributeValue( &self, - session: CK_SESSION_HANDLE, - object: CK_OBJECT_HANDLE, - templ: *mut _CK_ATTRIBUTE, - ulCount: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + hObject: CK_OBJECT_HANDLE, + pTemplate: CK_ATTRIBUTE_PTR, + ulCount: CK_ULONG, ) -> CK_RV { (self .C_GetAttributeValue .as_ref() - .expect("Expected function, got error."))(session, object, templ, ulCount) + .expect("Expected function, got error."))(hSession, hObject, pTemplate, ulCount) } pub unsafe fn C_SetAttributeValue( &self, - session: CK_SESSION_HANDLE, - object: CK_OBJECT_HANDLE, - templ: *mut _CK_ATTRIBUTE, - ulCount: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + hObject: CK_OBJECT_HANDLE, + pTemplate: CK_ATTRIBUTE_PTR, + ulCount: CK_ULONG, ) -> CK_RV { (self .C_SetAttributeValue .as_ref() - .expect("Expected function, got error."))(session, object, templ, ulCount) + .expect("Expected function, got error."))(hSession, hObject, pTemplate, ulCount) } pub unsafe fn C_FindObjectsInit( &self, - session: CK_SESSION_HANDLE, - templ: *mut _CK_ATTRIBUTE, - ulCount: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pTemplate: CK_ATTRIBUTE_PTR, + ulCount: CK_ULONG, ) -> CK_RV { (self .C_FindObjectsInit .as_ref() - .expect("Expected function, got error."))(session, templ, ulCount) + .expect("Expected function, got error."))(hSession, pTemplate, ulCount) } pub unsafe fn C_FindObjects( &self, - session: CK_SESSION_HANDLE, - object: *mut CK_OBJECT_HANDLE, - max_object_count: ::std::os::raw::c_ulong, - object_count: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + phObject: CK_OBJECT_HANDLE_PTR, + ulMaxObjectCount: CK_ULONG, + pulObjectCount: CK_ULONG_PTR, ) -> CK_RV { (self .C_FindObjects .as_ref() .expect("Expected function, got error."))( - session, - object, - max_object_count, - object_count, + hSession, + phObject, + ulMaxObjectCount, + pulObjectCount, ) } - pub unsafe fn C_FindObjectsFinal(&self, session: CK_SESSION_HANDLE) -> CK_RV { + pub unsafe fn C_FindObjectsFinal(&self, hSession: CK_SESSION_HANDLE) -> CK_RV { (self .C_FindObjectsFinal .as_ref() - .expect("Expected function, got error."))(session) + .expect("Expected function, got error."))(hSession) } pub unsafe fn C_EncryptInit( &self, - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - key: CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, ) -> CK_RV { (self .C_EncryptInit .as_ref() - .expect("Expected function, got error."))(session, mechanism, key) + .expect("Expected function, got error."))(hSession, pMechanism, hKey) } pub unsafe fn C_Encrypt( &self, - session: CK_SESSION_HANDLE, - data: *mut ::std::os::raw::c_uchar, - data_len: ::std::os::raw::c_ulong, - encrypted_data: *mut ::std::os::raw::c_uchar, - encrypted_data_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pEncryptedData: CK_BYTE_PTR, + pulEncryptedDataLen: CK_ULONG_PTR, ) -> CK_RV { (self .C_Encrypt .as_ref() .expect("Expected function, got error."))( - session, - data, - data_len, - encrypted_data, - encrypted_data_len, + hSession, + pData, + ulDataLen, + pEncryptedData, + pulEncryptedDataLen, ) } pub unsafe fn C_EncryptUpdate( &self, - session: CK_SESSION_HANDLE, - part: *mut ::std::os::raw::c_uchar, - part_len: ::std::os::raw::c_ulong, - encrypted_part: *mut ::std::os::raw::c_uchar, - encrypted_part_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pPart: CK_BYTE_PTR, + ulPartLen: CK_ULONG, + pEncryptedPart: CK_BYTE_PTR, + pulEncryptedPartLen: CK_ULONG_PTR, ) -> CK_RV { (self .C_EncryptUpdate .as_ref() .expect("Expected function, got error."))( - session, - part, - part_len, - encrypted_part, - encrypted_part_len, + hSession, + pPart, + ulPartLen, + pEncryptedPart, + pulEncryptedPartLen, ) } pub unsafe fn C_EncryptFinal( &self, - session: CK_SESSION_HANDLE, - last_encrypted_part: *mut ::std::os::raw::c_uchar, - last_encrypted_part_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pLastEncryptedPart: CK_BYTE_PTR, + pulLastEncryptedPartLen: CK_ULONG_PTR, ) -> CK_RV { (self .C_EncryptFinal .as_ref() .expect("Expected function, got error."))( - session, - last_encrypted_part, - last_encrypted_part_len, + hSession, + pLastEncryptedPart, + pulLastEncryptedPartLen, ) } pub unsafe fn C_DecryptInit( &self, - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - key: CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, ) -> CK_RV { (self .C_DecryptInit .as_ref() - .expect("Expected function, got error."))(session, mechanism, key) + .expect("Expected function, got error."))(hSession, pMechanism, hKey) } pub unsafe fn C_Decrypt( &self, - session: CK_SESSION_HANDLE, - encrypted_data: *mut ::std::os::raw::c_uchar, - encrypted_data_len: ::std::os::raw::c_ulong, - data: *mut ::std::os::raw::c_uchar, - data_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pEncryptedData: CK_BYTE_PTR, + ulEncryptedDataLen: CK_ULONG, + pData: CK_BYTE_PTR, + pulDataLen: CK_ULONG_PTR, ) -> CK_RV { (self .C_Decrypt .as_ref() .expect("Expected function, got error."))( - session, - encrypted_data, - encrypted_data_len, - data, - data_len, + hSession, + pEncryptedData, + ulEncryptedDataLen, + pData, + pulDataLen, ) } pub unsafe fn C_DecryptUpdate( &self, - session: CK_SESSION_HANDLE, - encrypted_part: *mut ::std::os::raw::c_uchar, - encrypted_part_len: ::std::os::raw::c_ulong, - part: *mut ::std::os::raw::c_uchar, - part_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pEncryptedPart: CK_BYTE_PTR, + ulEncryptedPartLen: CK_ULONG, + pPart: CK_BYTE_PTR, + pulPartLen: CK_ULONG_PTR, ) -> CK_RV { (self .C_DecryptUpdate .as_ref() .expect("Expected function, got error."))( - session, - encrypted_part, - encrypted_part_len, - part, - part_len, + hSession, + pEncryptedPart, + ulEncryptedPartLen, + pPart, + pulPartLen, ) } pub unsafe fn C_DecryptFinal( &self, - session: CK_SESSION_HANDLE, - last_part: *mut ::std::os::raw::c_uchar, - last_part_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pLastPart: CK_BYTE_PTR, + pulLastPartLen: CK_ULONG_PTR, ) -> CK_RV { (self .C_DecryptFinal .as_ref() - .expect("Expected function, got error."))(session, last_part, last_part_len) + .expect("Expected function, got error."))(hSession, pLastPart, pulLastPartLen) } pub unsafe fn C_DigestInit( &self, - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, ) -> CK_RV { (self .C_DigestInit .as_ref() - .expect("Expected function, got error."))(session, mechanism) + .expect("Expected function, got error."))(hSession, pMechanism) } pub unsafe fn C_Digest( &self, - session: CK_SESSION_HANDLE, - data: *mut ::std::os::raw::c_uchar, - data_len: ::std::os::raw::c_ulong, - digest: *mut ::std::os::raw::c_uchar, - digest_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pDigest: CK_BYTE_PTR, + pulDigestLen: CK_ULONG_PTR, ) -> CK_RV { (self .C_Digest .as_ref() .expect("Expected function, got error."))( - session, data, data_len, digest, digest_len + hSession, + pData, + ulDataLen, + pDigest, + pulDigestLen, ) } pub unsafe fn C_DigestUpdate( &self, - session: CK_SESSION_HANDLE, - part: *mut ::std::os::raw::c_uchar, - part_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pPart: CK_BYTE_PTR, + ulPartLen: CK_ULONG, ) -> CK_RV { (self .C_DigestUpdate .as_ref() - .expect("Expected function, got error."))(session, part, part_len) + .expect("Expected function, got error."))(hSession, pPart, ulPartLen) } - pub unsafe fn C_DigestKey(&self, session: CK_SESSION_HANDLE, key: CK_OBJECT_HANDLE) -> CK_RV { + pub unsafe fn C_DigestKey(&self, hSession: CK_SESSION_HANDLE, hKey: CK_OBJECT_HANDLE) -> CK_RV { (self .C_DigestKey .as_ref() - .expect("Expected function, got error."))(session, key) + .expect("Expected function, got error."))(hSession, hKey) } pub unsafe fn C_DigestFinal( &self, - session: CK_SESSION_HANDLE, - digest: *mut ::std::os::raw::c_uchar, - digest_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pDigest: CK_BYTE_PTR, + pulDigestLen: CK_ULONG_PTR, ) -> CK_RV { (self .C_DigestFinal .as_ref() - .expect("Expected function, got error."))(session, digest, digest_len) + .expect("Expected function, got error."))(hSession, pDigest, pulDigestLen) } pub unsafe fn C_SignInit( &self, - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - key: CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, ) -> CK_RV { (self .C_SignInit .as_ref() - .expect("Expected function, got error."))(session, mechanism, key) + .expect("Expected function, got error."))(hSession, pMechanism, hKey) } pub unsafe fn C_Sign( &self, - session: CK_SESSION_HANDLE, - data: *mut ::std::os::raw::c_uchar, - data_len: ::std::os::raw::c_ulong, - signature: *mut ::std::os::raw::c_uchar, - signature_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + pulSignatureLen: CK_ULONG_PTR, ) -> CK_RV { (self.C_Sign.as_ref().expect("Expected function, got error."))( - session, - data, - data_len, - signature, - signature_len, + hSession, + pData, + ulDataLen, + pSignature, + pulSignatureLen, ) } pub unsafe fn C_SignUpdate( &self, - session: CK_SESSION_HANDLE, - part: *mut ::std::os::raw::c_uchar, - part_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pPart: CK_BYTE_PTR, + ulPartLen: CK_ULONG, ) -> CK_RV { (self .C_SignUpdate .as_ref() - .expect("Expected function, got error."))(session, part, part_len) + .expect("Expected function, got error."))(hSession, pPart, ulPartLen) } pub unsafe fn C_SignFinal( &self, - session: CK_SESSION_HANDLE, - signature: *mut ::std::os::raw::c_uchar, - signature_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pSignature: CK_BYTE_PTR, + pulSignatureLen: CK_ULONG_PTR, ) -> CK_RV { (self .C_SignFinal .as_ref() - .expect("Expected function, got error."))(session, signature, signature_len) + .expect("Expected function, got error."))(hSession, pSignature, pulSignatureLen) } pub unsafe fn C_SignRecoverInit( &self, - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - key: CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, ) -> CK_RV { (self .C_SignRecoverInit .as_ref() - .expect("Expected function, got error."))(session, mechanism, key) + .expect("Expected function, got error."))(hSession, pMechanism, hKey) } pub unsafe fn C_SignRecover( &self, - session: CK_SESSION_HANDLE, - data: *mut ::std::os::raw::c_uchar, - data_len: ::std::os::raw::c_ulong, - signature: *mut ::std::os::raw::c_uchar, - signature_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + pulSignatureLen: CK_ULONG_PTR, ) -> CK_RV { (self .C_SignRecover .as_ref() .expect("Expected function, got error."))( - session, - data, - data_len, - signature, - signature_len, + hSession, + pData, + ulDataLen, + pSignature, + pulSignatureLen, ) } pub unsafe fn C_VerifyInit( &self, - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - key: CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, ) -> CK_RV { (self .C_VerifyInit .as_ref() - .expect("Expected function, got error."))(session, mechanism, key) + .expect("Expected function, got error."))(hSession, pMechanism, hKey) } pub unsafe fn C_Verify( &self, - session: CK_SESSION_HANDLE, - data: *mut ::std::os::raw::c_uchar, - data_len: ::std::os::raw::c_ulong, - signature: *mut ::std::os::raw::c_uchar, - signature_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + ulSignatureLen: CK_ULONG, ) -> CK_RV { (self .C_Verify .as_ref() .expect("Expected function, got error."))( - session, - data, - data_len, - signature, - signature_len, + hSession, + pData, + ulDataLen, + pSignature, + ulSignatureLen, ) } pub unsafe fn C_VerifyUpdate( &self, - session: CK_SESSION_HANDLE, - part: *mut ::std::os::raw::c_uchar, - part_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pPart: CK_BYTE_PTR, + ulPartLen: CK_ULONG, ) -> CK_RV { (self .C_VerifyUpdate .as_ref() - .expect("Expected function, got error."))(session, part, part_len) + .expect("Expected function, got error."))(hSession, pPart, ulPartLen) } pub unsafe fn C_VerifyFinal( &self, - session: CK_SESSION_HANDLE, - signature: *mut ::std::os::raw::c_uchar, - signature_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pSignature: CK_BYTE_PTR, + ulSignatureLen: CK_ULONG, ) -> CK_RV { (self .C_VerifyFinal .as_ref() - .expect("Expected function, got error."))(session, signature, signature_len) + .expect("Expected function, got error."))(hSession, pSignature, ulSignatureLen) } pub unsafe fn C_VerifyRecoverInit( &self, - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - key: CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, ) -> CK_RV { (self .C_VerifyRecoverInit .as_ref() - .expect("Expected function, got error."))(session, mechanism, key) + .expect("Expected function, got error."))(hSession, pMechanism, hKey) } pub unsafe fn C_VerifyRecover( &self, - session: CK_SESSION_HANDLE, - signature: *mut ::std::os::raw::c_uchar, - signature_len: ::std::os::raw::c_ulong, - data: *mut ::std::os::raw::c_uchar, - data_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pSignature: CK_BYTE_PTR, + ulSignatureLen: CK_ULONG, + pData: CK_BYTE_PTR, + pulDataLen: CK_ULONG_PTR, ) -> CK_RV { (self .C_VerifyRecover .as_ref() .expect("Expected function, got error."))( - session, - signature, - signature_len, - data, - data_len, + hSession, + pSignature, + ulSignatureLen, + pData, + pulDataLen, ) } pub unsafe fn C_DigestEncryptUpdate( &self, - session: CK_SESSION_HANDLE, - part: *mut ::std::os::raw::c_uchar, - part_len: ::std::os::raw::c_ulong, - encrypted_part: *mut ::std::os::raw::c_uchar, - encrypted_part_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pPart: CK_BYTE_PTR, + ulPartLen: CK_ULONG, + pEncryptedPart: CK_BYTE_PTR, + pulEncryptedPartLen: CK_ULONG_PTR, ) -> CK_RV { (self .C_DigestEncryptUpdate .as_ref() .expect("Expected function, got error."))( - session, - part, - part_len, - encrypted_part, - encrypted_part_len, + hSession, + pPart, + ulPartLen, + pEncryptedPart, + pulEncryptedPartLen, ) } pub unsafe fn C_DecryptDigestUpdate( &self, - session: CK_SESSION_HANDLE, - encrypted_part: *mut ::std::os::raw::c_uchar, - encrypted_part_len: ::std::os::raw::c_ulong, - part: *mut ::std::os::raw::c_uchar, - part_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pEncryptedPart: CK_BYTE_PTR, + ulEncryptedPartLen: CK_ULONG, + pPart: CK_BYTE_PTR, + pulPartLen: CK_ULONG_PTR, ) -> CK_RV { (self .C_DecryptDigestUpdate .as_ref() .expect("Expected function, got error."))( - session, - encrypted_part, - encrypted_part_len, - part, - part_len, + hSession, + pEncryptedPart, + ulEncryptedPartLen, + pPart, + pulPartLen, ) } pub unsafe fn C_SignEncryptUpdate( &self, - session: CK_SESSION_HANDLE, - part: *mut ::std::os::raw::c_uchar, - part_len: ::std::os::raw::c_ulong, - encrypted_part: *mut ::std::os::raw::c_uchar, - encrypted_part_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pPart: CK_BYTE_PTR, + ulPartLen: CK_ULONG, + pEncryptedPart: CK_BYTE_PTR, + pulEncryptedPartLen: CK_ULONG_PTR, ) -> CK_RV { (self .C_SignEncryptUpdate .as_ref() .expect("Expected function, got error."))( - session, - part, - part_len, - encrypted_part, - encrypted_part_len, + hSession, + pPart, + ulPartLen, + pEncryptedPart, + pulEncryptedPartLen, ) } pub unsafe fn C_DecryptVerifyUpdate( &self, - session: CK_SESSION_HANDLE, - encrypted_part: *mut ::std::os::raw::c_uchar, - encrypted_part_len: ::std::os::raw::c_ulong, - part: *mut ::std::os::raw::c_uchar, - part_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pEncryptedPart: CK_BYTE_PTR, + ulEncryptedPartLen: CK_ULONG, + pPart: CK_BYTE_PTR, + pulPartLen: CK_ULONG_PTR, ) -> CK_RV { (self .C_DecryptVerifyUpdate .as_ref() .expect("Expected function, got error."))( - session, - encrypted_part, - encrypted_part_len, - part, - part_len, + hSession, + pEncryptedPart, + ulEncryptedPartLen, + pPart, + pulPartLen, ) } pub unsafe fn C_GenerateKey( &self, - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - templ: *mut _CK_ATTRIBUTE, - ulCount: ::std::os::raw::c_ulong, - key: *mut CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + pTemplate: CK_ATTRIBUTE_PTR, + ulCount: CK_ULONG, + phKey: CK_OBJECT_HANDLE_PTR, ) -> CK_RV { (self .C_GenerateKey .as_ref() .expect("Expected function, got error."))( - session, mechanism, templ, ulCount, key + hSession, pMechanism, pTemplate, ulCount, phKey, ) } pub unsafe fn C_GenerateKeyPair( &self, - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - public_key_template: *mut _CK_ATTRIBUTE, - public_key_attribute_count: ::std::os::raw::c_ulong, - private_key_template: *mut _CK_ATTRIBUTE, - private_key_attribute_count: ::std::os::raw::c_ulong, - public_key: *mut CK_OBJECT_HANDLE, - private_key: *mut CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + pPublicKeyTemplate: CK_ATTRIBUTE_PTR, + ulPublicKeyAttributeCount: CK_ULONG, + pPrivateKeyTemplate: CK_ATTRIBUTE_PTR, + ulPrivateKeyAttributeCount: CK_ULONG, + phPublicKey: CK_OBJECT_HANDLE_PTR, + phPrivateKey: CK_OBJECT_HANDLE_PTR, ) -> CK_RV { (self .C_GenerateKeyPair .as_ref() .expect("Expected function, got error."))( - session, - mechanism, - public_key_template, - public_key_attribute_count, - private_key_template, - private_key_attribute_count, - public_key, - private_key, + hSession, + pMechanism, + pPublicKeyTemplate, + ulPublicKeyAttributeCount, + pPrivateKeyTemplate, + ulPrivateKeyAttributeCount, + phPublicKey, + phPrivateKey, ) } pub unsafe fn C_WrapKey( &self, - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - wrapping_key: CK_OBJECT_HANDLE, - key: CK_OBJECT_HANDLE, - wrapped_key: *mut ::std::os::raw::c_uchar, - wrapped_key_len: *mut ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hWrappingKey: CK_OBJECT_HANDLE, + hKey: CK_OBJECT_HANDLE, + pWrappedKey: CK_BYTE_PTR, + pulWrappedKeyLen: CK_ULONG_PTR, ) -> CK_RV { (self .C_WrapKey .as_ref() .expect("Expected function, got error."))( - session, - mechanism, - wrapping_key, - key, - wrapped_key, - wrapped_key_len, + hSession, + pMechanism, + hWrappingKey, + hKey, + pWrappedKey, + pulWrappedKeyLen, ) } pub unsafe fn C_UnwrapKey( &self, - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - unwrapping_key: CK_OBJECT_HANDLE, - wrapped_key: *mut ::std::os::raw::c_uchar, - wrapped_key_len: ::std::os::raw::c_ulong, - templ: *mut _CK_ATTRIBUTE, - attribute_count: ::std::os::raw::c_ulong, - key: *mut CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hUnwrappingKey: CK_OBJECT_HANDLE, + pWrappedKey: CK_BYTE_PTR, + ulWrappedKeyLen: CK_ULONG, + pTemplate: CK_ATTRIBUTE_PTR, + ulAttributeCount: CK_ULONG, + phKey: CK_OBJECT_HANDLE_PTR, ) -> CK_RV { (self .C_UnwrapKey .as_ref() .expect("Expected function, got error."))( - session, - mechanism, - unwrapping_key, - wrapped_key, - wrapped_key_len, - templ, - attribute_count, - key, + hSession, + pMechanism, + hUnwrappingKey, + pWrappedKey, + ulWrappedKeyLen, + pTemplate, + ulAttributeCount, + phKey, ) } pub unsafe fn C_DeriveKey( &self, - session: CK_SESSION_HANDLE, - mechanism: *mut _CK_MECHANISM, - base_key: CK_OBJECT_HANDLE, - templ: *mut _CK_ATTRIBUTE, - attribute_count: ::std::os::raw::c_ulong, - key: *mut CK_OBJECT_HANDLE, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hBaseKey: CK_OBJECT_HANDLE, + pTemplate: CK_ATTRIBUTE_PTR, + ulAttributeCount: CK_ULONG, + phKey: CK_OBJECT_HANDLE_PTR, ) -> CK_RV { (self .C_DeriveKey .as_ref() .expect("Expected function, got error."))( - session, - mechanism, - base_key, - templ, - attribute_count, - key, + hSession, + pMechanism, + hBaseKey, + pTemplate, + ulAttributeCount, + phKey, ) } pub unsafe fn C_SeedRandom( &self, - session: CK_SESSION_HANDLE, - seed: *mut ::std::os::raw::c_uchar, - seed_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + pSeed: CK_BYTE_PTR, + ulSeedLen: CK_ULONG, ) -> CK_RV { (self .C_SeedRandom .as_ref() - .expect("Expected function, got error."))(session, seed, seed_len) + .expect("Expected function, got error."))(hSession, pSeed, ulSeedLen) } pub unsafe fn C_GenerateRandom( &self, - session: CK_SESSION_HANDLE, - random_data: *mut ::std::os::raw::c_uchar, - random_len: ::std::os::raw::c_ulong, + hSession: CK_SESSION_HANDLE, + RandomData: CK_BYTE_PTR, + ulRandomLen: CK_ULONG, ) -> CK_RV { (self .C_GenerateRandom .as_ref() - .expect("Expected function, got error."))(session, random_data, random_len) + .expect("Expected function, got error."))(hSession, RandomData, ulRandomLen) } - pub unsafe fn C_GetFunctionStatus(&self, session: CK_SESSION_HANDLE) -> CK_RV { + pub unsafe fn C_GetFunctionStatus(&self, hSession: CK_SESSION_HANDLE) -> CK_RV { (self .C_GetFunctionStatus .as_ref() - .expect("Expected function, got error."))(session) + .expect("Expected function, got error."))(hSession) } - pub unsafe fn C_CancelFunction(&self, session: CK_SESSION_HANDLE) -> CK_RV { + pub unsafe fn C_CancelFunction(&self, hSession: CK_SESSION_HANDLE) -> CK_RV { (self .C_CancelFunction .as_ref() - .expect("Expected function, got error."))(session) + .expect("Expected function, got error."))(hSession) + } + pub unsafe fn C_WaitForSlotEvent( + &self, + flags: CK_FLAGS, + pSlot: CK_SLOT_ID_PTR, + pRserved: CK_VOID_PTR, + ) -> CK_RV { + (self + .C_WaitForSlotEvent + .as_ref() + .expect("Expected function, got error."))(flags, pSlot, pRserved) + } + pub unsafe fn C_GetInterfaceList( + &self, + pInterfacesList: CK_INTERFACE_PTR, + pulCount: CK_ULONG_PTR, + ) -> CK_RV { + (self + .C_GetInterfaceList + .as_ref() + .expect("Expected function, got error."))(pInterfacesList, pulCount) + } + pub unsafe fn C_GetInterface( + &self, + pInterfaceName: CK_UTF8CHAR_PTR, + pVersion: CK_VERSION_PTR, + ppInterface: CK_INTERFACE_PTR_PTR, + flags: CK_FLAGS, + ) -> CK_RV { + (self + .C_GetInterface + .as_ref() + .expect("Expected function, got error."))( + pInterfaceName, pVersion, ppInterface, flags + ) + } + pub unsafe fn C_LoginUser( + &self, + hSession: CK_SESSION_HANDLE, + userType: CK_USER_TYPE, + pPin: CK_UTF8CHAR_PTR, + ulPinLen: CK_ULONG, + pUsername: CK_UTF8CHAR_PTR, + ulUsernameLen: CK_ULONG, + ) -> CK_RV { + (self + .C_LoginUser + .as_ref() + .expect("Expected function, got error."))( + hSession, + userType, + pPin, + ulPinLen, + pUsername, + ulUsernameLen, + ) + } + pub unsafe fn C_SessionCancel(&self, hSession: CK_SESSION_HANDLE, flags: CK_FLAGS) -> CK_RV { + (self + .C_SessionCancel + .as_ref() + .expect("Expected function, got error."))(hSession, flags) + } + pub unsafe fn C_MessageEncryptInit( + &self, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, + ) -> CK_RV { + (self + .C_MessageEncryptInit + .as_ref() + .expect("Expected function, got error."))(hSession, pMechanism, hKey) + } + pub unsafe fn C_EncryptMessage( + &self, + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pAssociatedData: CK_BYTE_PTR, + ulAssociatedDataLen: CK_ULONG, + pPlaintext: CK_BYTE_PTR, + ulPlaintextLen: CK_ULONG, + pCiphertext: CK_BYTE_PTR, + pulCiphertextLen: CK_ULONG_PTR, + ) -> CK_RV { + (self + .C_EncryptMessage + .as_ref() + .expect("Expected function, got error."))( + hSession, + pParameter, + ulParameterLen, + pAssociatedData, + ulAssociatedDataLen, + pPlaintext, + ulPlaintextLen, + pCiphertext, + pulCiphertextLen, + ) + } + pub unsafe fn C_EncryptMessageBegin( + &self, + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pAssociatedData: CK_BYTE_PTR, + ulAssociatedDataLen: CK_ULONG, + ) -> CK_RV { + (self + .C_EncryptMessageBegin + .as_ref() + .expect("Expected function, got error."))( + hSession, + pParameter, + ulParameterLen, + pAssociatedData, + ulAssociatedDataLen, + ) + } + pub unsafe fn C_EncryptMessageNext( + &self, + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pPlaintextPart: CK_BYTE_PTR, + ulPlaintextPartLen: CK_ULONG, + pCiphertextPart: CK_BYTE_PTR, + pulCiphertextPartLen: CK_ULONG_PTR, + flags: CK_FLAGS, + ) -> CK_RV { + (self + .C_EncryptMessageNext + .as_ref() + .expect("Expected function, got error."))( + hSession, + pParameter, + ulParameterLen, + pPlaintextPart, + ulPlaintextPartLen, + pCiphertextPart, + pulCiphertextPartLen, + flags, + ) + } + pub unsafe fn C_MessageEncryptFinal(&self, hSession: CK_SESSION_HANDLE) -> CK_RV { + (self + .C_MessageEncryptFinal + .as_ref() + .expect("Expected function, got error."))(hSession) + } + pub unsafe fn C_MessageDecryptInit( + &self, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, + ) -> CK_RV { + (self + .C_MessageDecryptInit + .as_ref() + .expect("Expected function, got error."))(hSession, pMechanism, hKey) + } + pub unsafe fn C_DecryptMessage( + &self, + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pAssociatedData: CK_BYTE_PTR, + ulAssociatedDataLen: CK_ULONG, + pCiphertext: CK_BYTE_PTR, + ulCiphertextLen: CK_ULONG, + pPlaintext: CK_BYTE_PTR, + pulPlaintextLen: CK_ULONG_PTR, + ) -> CK_RV { + (self + .C_DecryptMessage + .as_ref() + .expect("Expected function, got error."))( + hSession, + pParameter, + ulParameterLen, + pAssociatedData, + ulAssociatedDataLen, + pCiphertext, + ulCiphertextLen, + pPlaintext, + pulPlaintextLen, + ) + } + pub unsafe fn C_DecryptMessageBegin( + &self, + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pAssociatedData: CK_BYTE_PTR, + ulAssociatedDataLen: CK_ULONG, + ) -> CK_RV { + (self + .C_DecryptMessageBegin + .as_ref() + .expect("Expected function, got error."))( + hSession, + pParameter, + ulParameterLen, + pAssociatedData, + ulAssociatedDataLen, + ) + } + pub unsafe fn C_DecryptMessageNext( + &self, + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pCiphertext: CK_BYTE_PTR, + ulCiphertextLen: CK_ULONG, + pPlaintext: CK_BYTE_PTR, + pulPlaintextLen: CK_ULONG_PTR, + flags: CK_FLAGS, + ) -> CK_RV { + (self + .C_DecryptMessageNext + .as_ref() + .expect("Expected function, got error."))( + hSession, + pParameter, + ulParameterLen, + pCiphertext, + ulCiphertextLen, + pPlaintext, + pulPlaintextLen, + flags, + ) + } + pub unsafe fn C_MessageDecryptFinal(&self, hSession: CK_SESSION_HANDLE) -> CK_RV { + (self + .C_MessageDecryptFinal + .as_ref() + .expect("Expected function, got error."))(hSession) + } + pub unsafe fn C_MessageSignInit( + &self, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, + ) -> CK_RV { + (self + .C_MessageSignInit + .as_ref() + .expect("Expected function, got error."))(hSession, pMechanism, hKey) + } + pub unsafe fn C_SignMessage( + &self, + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + pulSignatureLen: CK_ULONG_PTR, + ) -> CK_RV { + (self + .C_SignMessage + .as_ref() + .expect("Expected function, got error."))( + hSession, + pParameter, + ulParameterLen, + pData, + ulDataLen, + pSignature, + pulSignatureLen, + ) + } + pub unsafe fn C_SignMessageBegin( + &self, + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + ) -> CK_RV { + (self + .C_SignMessageBegin + .as_ref() + .expect("Expected function, got error."))(hSession, pParameter, ulParameterLen) + } + pub unsafe fn C_SignMessageNext( + &self, + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + pulSignatureLen: CK_ULONG_PTR, + ) -> CK_RV { + (self + .C_SignMessageNext + .as_ref() + .expect("Expected function, got error."))( + hSession, + pParameter, + ulParameterLen, + pData, + ulDataLen, + pSignature, + pulSignatureLen, + ) + } + pub unsafe fn C_MessageSignFinal(&self, hSession: CK_SESSION_HANDLE) -> CK_RV { + (self + .C_MessageSignFinal + .as_ref() + .expect("Expected function, got error."))(hSession) + } + pub unsafe fn C_MessageVerifyInit( + &self, + hSession: CK_SESSION_HANDLE, + pMechanism: CK_MECHANISM_PTR, + hKey: CK_OBJECT_HANDLE, + ) -> CK_RV { + (self + .C_MessageVerifyInit + .as_ref() + .expect("Expected function, got error."))(hSession, pMechanism, hKey) + } + pub unsafe fn C_VerifyMessage( + &self, + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + ulSignatureLen: CK_ULONG, + ) -> CK_RV { + (self + .C_VerifyMessage + .as_ref() + .expect("Expected function, got error."))( + hSession, + pParameter, + ulParameterLen, + pData, + ulDataLen, + pSignature, + ulSignatureLen, + ) + } + pub unsafe fn C_VerifyMessageBegin( + &self, + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + ) -> CK_RV { + (self + .C_VerifyMessageBegin + .as_ref() + .expect("Expected function, got error."))(hSession, pParameter, ulParameterLen) + } + pub unsafe fn C_VerifyMessageNext( + &self, + hSession: CK_SESSION_HANDLE, + pParameter: CK_VOID_PTR, + ulParameterLen: CK_ULONG, + pData: CK_BYTE_PTR, + ulDataLen: CK_ULONG, + pSignature: CK_BYTE_PTR, + ulSignatureLen: CK_ULONG, + ) -> CK_RV { + (self + .C_VerifyMessageNext + .as_ref() + .expect("Expected function, got error."))( + hSession, + pParameter, + ulParameterLen, + pData, + ulDataLen, + pSignature, + ulSignatureLen, + ) + } + pub unsafe fn C_MessageVerifyFinal(&self, hSession: CK_SESSION_HANDLE) -> CK_RV { + (self + .C_MessageVerifyFinal + .as_ref() + .expect("Expected function, got error."))(hSession) } } diff --git a/cryptoki-sys/src/lib.rs b/cryptoki-sys/src/lib.rs index f9cc6cc9..bb85ba94 100644 --- a/cryptoki-sys/src/lib.rs +++ b/cryptoki-sys/src/lib.rs @@ -105,26 +105,67 @@ include!(concat!( "/src/bindings/x86_64-unknown-freebsd.rs" )); +// For supported targets: use the generated and committed bindings. +#[cfg(not(any( + feature = "generate-bindings", + all(target_arch = "x86_64", target_os = "linux"), + all(target_arch = "x86", target_os = "linux"), + all(target_arch = "powerpc64", target_os = "linux"), + all(target_arch = "aarch64", target_os = "linux"), + all(target_arch = "arm", target_os = "linux"), + all(target_arch = "x86_64", target_os = "macos"), + all(target_arch = "aarch64", target_os = "macos"), + all(target_arch = "x86_64", target_os = "windows"), + all(target_arch = "x86_64", target_os = "freebsd"), +)))] +include!(concat!( + env!("CARGO_MANIFEST_DIR"), + "/src/bindings/generic.rs" +)); + // If the "generate-bindings" feature is on, use the generated bindings. #[cfg(feature = "generate-bindings")] include!(concat!(env!("OUT_DIR"), "/pkcs11_bindings.rs")); -/// Typedefs and defines for the CKM_X9_42_DH_KEY_PAIR_GEN and the -/// CKM_X9_42_DH_PARAMETER_GEN mechanisms -pub type CK_X9_42_DH_KDF_TYPE = CK_ULONG; -pub type CK_X9_42_DH_KDF_TYPE_PTR = *mut CK_X9_42_DH_KDF_TYPE; - -pub type CK_EC_KDF_TYPE = CK_ULONG; - -// The values below are defined in pkcs11.h with `#define` macros. As a result, bindgen cannot -// generate bindings for them. They are included here for completeness. -pub const CKA_WRAP_TEMPLATE: CK_ATTRIBUTE_TYPE = CKF_ARRAY_ATTRIBUTE | 0x00000211; -pub const CKA_UNWRAP_TEMPLATE: CK_ATTRIBUTE_TYPE = CKF_ARRAY_ATTRIBUTE | 0x00000212; -pub const CKA_DERIVE_TEMPLATE: CK_ATTRIBUTE_TYPE = CKF_ARRAY_ATTRIBUTE | 0x00000213; -pub const CKA_ALLOWED_MECHANISMS: CK_ATTRIBUTE_TYPE = CKF_ARRAY_ATTRIBUTE | 0x00000600; +// this value is defined in pkcs11t.h as ~0 +// bindgen converts that into a platform specific numeric value pub const CK_UNAVAILABLE_INFORMATION: CK_ULONG = !0; -pub const CKF_EXTENSION: CK_FLAGS = 0x80000000; -pub const CKK_EC_MONTGOMERY: CK_KEY_TYPE = 0x00000041; -pub const CKR_VENDOR_DEFINED: CK_RV = 0x80000000; -pub const CKR_CURVE_NOT_SUPPORTED: CK_RV = 0x00000140; -pub const CKM_VENDOR_DEFINED: CK_MECHANISM_TYPE = 0x80000000; + +#[deprecated = "Use CK_ATTRIBUTE"] +pub type _CK_ATTRIBUTE = CK_ATTRIBUTE; +#[deprecated = "Use CK_C_INITIALIZE_ARGS"] +pub type _CK_C_INITIALIZE_ARGS = CK_C_INITIALIZE_ARGS; +#[deprecated = "Use CK_DATE"] +pub type _CK_DATE = CK_DATE; +#[deprecated = "Use CK_FUNCTION_LIST"] +pub type _CK_FUNCTION_LIST = CK_FUNCTION_LIST; +#[deprecated = "Use CK_INFO"] +pub type _CK_INFO = CK_INFO; +#[deprecated = "Use CK_MECHANISM"] +pub type _CK_MECHANISM = CK_MECHANISM; +#[deprecated = "Use CK_MECHANISM_INFO"] +pub type _CK_MECHANISM_INFO = CK_MECHANISM_INFO; +#[deprecated = "Use CK_SESSION_INFO"] +pub type _CK_SESSION_INFO = CK_SESSION_INFO; +#[deprecated = "Use CK_SLOT_INFO"] +pub type _CK_SLOT_INFO = CK_SLOT_INFO; +#[deprecated = "Use CK_TOKEN_INFO"] +pub type _CK_TOKEN_INFO = CK_TOKEN_INFO; +#[deprecated = "Use CK_VERSION"] +pub type _CK_VERSION = CK_VERSION; +#[deprecated = "Use CK_AES_CBC_ENCRYPT_DATA_PARAMS"] +pub type ck_aes_cbc_encrypt_data_params = CK_AES_CBC_ENCRYPT_DATA_PARAMS; +#[deprecated = "Use CK_AES_CTR_PARAMS"] +pub type ck_aes_ctr_params = CK_AES_CTR_PARAMS; +#[deprecated = "Use CK_DES_CBC_ENCRYPT_DATA_PARAMS"] +pub type ck_des_cbc_encrypt_data_params = CK_DES_CBC_ENCRYPT_DATA_PARAMS; +#[deprecated = "Use CK_ECDH1_DERIVE_PARAMS"] +pub type ck_ecdh1_derive_params = CK_ECDH1_DERIVE_PARAMS; +#[deprecated = "Use CK_GCM_PARAMS"] +pub type ck_gcm_params = CK_GCM_PARAMS; +#[deprecated = "Use CK_KEY_DERIVATION_STRING_DATA"] +pub type ck_key_derivation_string_data = CK_KEY_DERIVATION_STRING_DATA; +#[deprecated = "Use CK_RSA_PKCS_OAEP_PARAMS"] +pub type ck_rsa_pkcs_oaep_params = CK_RSA_PKCS_OAEP_PARAMS; +#[deprecated = "Use CK_RSA_PKCS_PSS_PARAMS"] +pub type ck_rsa_pkcs_pss_params = CK_RSA_PKCS_PSS_PARAMS; diff --git a/cryptoki-sys/vendor/README.md b/cryptoki-sys/vendor/README.md new file mode 100644 index 00000000..d08888d4 --- /dev/null +++ b/cryptoki-sys/vendor/README.md @@ -0,0 +1,7 @@ +Vendor + +These are downloaded from http://docs.oasis-open.org/pkcs11/pkcs11-base/v3.0/os/include/pkcs11-v3.0: + +```shell +wget http://docs.oasis-open.org/pkcs11/pkcs11-base/v3.0/os/include/pkcs11-v3.0/pkcs11{,f,t}.h +``` diff --git a/cryptoki-sys/vendor/pkcs11.h b/cryptoki-sys/vendor/pkcs11.h new file mode 100644 index 00000000..6807f80f --- /dev/null +++ b/cryptoki-sys/vendor/pkcs11.h @@ -0,0 +1,243 @@ +/* Copyright (c) OASIS Open 2016-2020. All Rights Reserved. + * Distributed under the terms of the OASIS IPR Policy, + * [http://www.oasis-open.org/policies-guidelines/ipr], AS-IS, WITHOUT ANY + * IMPLIED OR EXPRESS WARRANTY; there is no warranty of MERCHANTABILITY, FITNESS FOR A + * PARTICULAR PURPOSE or NONINFRINGEMENT of the rights of others. + */ + +#ifndef _PKCS11_H_ +#define _PKCS11_H_ 1 + +#ifdef __cplusplus +extern "C" { +#endif + +/* Before including this file (pkcs11.h) (or pkcs11t.h by + * itself), 5 platform-specific macros must be defined. These + * macros are described below, and typical definitions for them + * are also given. Be advised that these definitions can depend + * on both the platform and the compiler used (and possibly also + * on whether a Cryptoki library is linked statically or + * dynamically). + * + * In addition to defining these 5 macros, the packing convention + * for Cryptoki structures should be set. The Cryptoki + * convention on packing is that structures should be 1-byte + * aligned. + * + * If you're using Windows this might be done by using the following + * preprocessor directive before including pkcs11.h or pkcs11t.h: + * + * #pragma pack(push, cryptoki, 1) + * + * and using the following preprocessor directive after including + * pkcs11.h or pkcs11t.h: + * + * #pragma pack(pop, cryptoki) + * + * In a UNIX environment, you're on your own for this. You might + * not need to do (or be able to do!) anything. + * + * + * Now for the macros: + * + * + * 1. CK_PTR: The indirection string for making a pointer to an + * object. It can be used like this: + * + * typedef CK_BYTE CK_PTR CK_BYTE_PTR; + * + * If you're using windows, it might be defined by: + * + * #define CK_PTR * + * + * In a typical UNIX environment, it might be defined by: + * + * #define CK_PTR * + * + * + * 2. CK_DECLARE_FUNCTION(returnType, name): A macro which makes + * an importable Cryptoki library function declaration out of a + * return type and a function name. It should be used in the + * following fashion: + * + * extern CK_DECLARE_FUNCTION(CK_RV, C_Initialize)( + * CK_VOID_PTR pReserved + * ); + * + * If you're using Windows to declare a function in a Win32 cryptoki .dll, + * it might be defined by: + * + * #define CK_DECLARE_FUNCTION(returnType, name) \ + * returnType __declspec(dllimport) name + * + * In a UNIX environment, it might be defined by: + * + * #define CK_DECLARE_FUNCTION(returnType, name) \ + * returnType name + * + * + * 3. CK_DECLARE_FUNCTION_POINTER(returnType, name): A macro + * which makes a Cryptoki API function pointer declaration or + * function pointer type declaration out of a return type and a + * function name. It should be used in the following fashion: + * + * // Define funcPtr to be a pointer to a Cryptoki API function + * // taking arguments args and returning CK_RV. + * CK_DECLARE_FUNCTION_POINTER(CK_RV, funcPtr)(args); + * + * or + * + * // Define funcPtrType to be the type of a pointer to a + * // Cryptoki API function taking arguments args and returning + * // CK_RV, and then define funcPtr to be a variable of type + * // funcPtrType. + * typedef CK_DECLARE_FUNCTION_POINTER(CK_RV, funcPtrType)(args); + * funcPtrType funcPtr; + * + * If you're using Windows to access + * functions in a Win32 Cryptoki .dll, in might be defined by: + * + * #define CK_DECLARE_FUNCTION_POINTER(returnType, name) \ + * returnType __declspec(dllimport) (* name) + * + * In a UNIX environment, it might be defined by: + * + * #define CK_DECLARE_FUNCTION_POINTER(returnType, name) \ + * returnType (* name) + * + * + * 4. CK_CALLBACK_FUNCTION(returnType, name): A macro which makes + * a function pointer type for an application callback out of + * a return type for the callback and a name for the callback. + * It should be used in the following fashion: + * + * CK_CALLBACK_FUNCTION(CK_RV, myCallback)(args); + * + * to declare a function pointer, myCallback, to a callback + * which takes arguments args and returns a CK_RV. It can also + * be used like this: + * + * typedef CK_CALLBACK_FUNCTION(CK_RV, myCallbackType)(args); + * myCallbackType myCallback; + * + * If you're using Windows, it might be defined by: + * + * #define CK_CALLBACK_FUNCTION(returnType, name) \ + * returnType (* name) + * + * In a UNIX environment, it might be defined by: + * + * #define CK_CALLBACK_FUNCTION(returnType, name) \ + * returnType (* name) + * + * + * 5. NULL_PTR: This macro is the value of a NULL pointer. + * + * In any ANSI/ISO C environment (and in many others as well), + * this should best be defined by + * + * #ifndef NULL_PTR + * #define NULL_PTR 0 + * #endif + */ + + +/* All the various Cryptoki types and #define'd values are in the + * file pkcs11t.h. + */ +#include "pkcs11t.h" + +#define __PASTE(x,y) x##y + + +/* ============================================================== + * Define the "extern" form of all the entry points. + * ============================================================== + */ + +#define CK_NEED_ARG_LIST 1 +#define CK_PKCS11_FUNCTION_INFO(name) \ + extern CK_DECLARE_FUNCTION(CK_RV, name) + +/* pkcs11f.h has all the information about the Cryptoki + * function prototypes. + */ +#include "pkcs11f.h" + +#undef CK_NEED_ARG_LIST +#undef CK_PKCS11_FUNCTION_INFO + + +/* ============================================================== + * Define the typedef form of all the entry points. That is, for + * each Cryptoki function C_XXX, define a type CK_C_XXX which is + * a pointer to that kind of function. + * ============================================================== + */ + +#define CK_NEED_ARG_LIST 1 +#define CK_PKCS11_FUNCTION_INFO(name) \ + typedef CK_DECLARE_FUNCTION_POINTER(CK_RV, __PASTE(CK_,name)) + +/* pkcs11f.h has all the information about the Cryptoki + * function prototypes. + */ +#include "pkcs11f.h" + +#undef CK_NEED_ARG_LIST +#undef CK_PKCS11_FUNCTION_INFO + + +/* ============================================================== + * Define structed vector of entry points. A CK_FUNCTION_LIST + * contains a CK_VERSION indicating a library's Cryptoki version + * and then a whole slew of function pointers to the routines in + * the library. This type was declared, but not defined, in + * pkcs11t.h. + * ============================================================== + */ + +#define CK_PKCS11_FUNCTION_INFO(name) \ + __PASTE(CK_,name) name; + +/* Create the 3.0 Function list */ +struct CK_FUNCTION_LIST_3_0 { + + CK_VERSION version; /* Cryptoki version */ + +/* Pile all the function pointers into the CK_FUNCTION_LIST. */ +/* pkcs11f.h has all the information about the Cryptoki + * function prototypes. + */ +#include "pkcs11f.h" + +}; + +#define CK_PKCS11_2_0_ONLY 1 + +/* Continue to define the old CK_FUNCTION_LIST */ +struct CK_FUNCTION_LIST { + + CK_VERSION version; /* Cryptoki version */ + +/* Pile all the function pointers into the CK_FUNCTION_LIST. */ +/* pkcs11f.h has all the information about the Cryptoki + * function prototypes. + */ +#include "pkcs11f.h" + +}; + +#undef CK_PKCS11_FUNCTION_INFO +#undef CK_PKCS11_2_0_ONLY + + +#undef __PASTE + +#ifdef __cplusplus +} +#endif + +#endif /* _PKCS11_H_ */ + diff --git a/cryptoki-sys/vendor/pkcs11f.h b/cryptoki-sys/vendor/pkcs11f.h new file mode 100644 index 00000000..43b0cbe2 --- /dev/null +++ b/cryptoki-sys/vendor/pkcs11f.h @@ -0,0 +1,1192 @@ +/* Copyright (c) OASIS Open 2016-2020. All Rights Reserved. + * /Distributed under the terms of the OASIS IPR Policy, + * [http://www.oasis-open.org/policies-guidelines/ipr], AS-IS, WITHOUT ANY + * IMPLIED OR EXPRESS WARRANTY; there is no warranty of MERCHANTABILITY, FITNESS FOR A + * PARTICULAR PURPOSE or NONINFRINGEMENT of the rights of others. + */ + +/* This header file contains pretty much everything about all the + * Cryptoki function prototypes. Because this information is + * used for more than just declaring function prototypes, the + * order of the functions appearing herein is important, and + * should not be altered. + */ + +/* General-purpose */ + +/* C_Initialize initializes the Cryptoki library. */ +CK_PKCS11_FUNCTION_INFO(C_Initialize) +#ifdef CK_NEED_ARG_LIST +( + CK_VOID_PTR pInitArgs /* if this is not NULL_PTR, it gets + * cast to CK_C_INITIALIZE_ARGS_PTR + * and dereferenced + */ +); +#endif + + +/* C_Finalize indicates that an application is done with the + * Cryptoki library. + */ +CK_PKCS11_FUNCTION_INFO(C_Finalize) +#ifdef CK_NEED_ARG_LIST +( + CK_VOID_PTR pReserved /* reserved. Should be NULL_PTR */ +); +#endif + + +/* C_GetInfo returns general information about Cryptoki. */ +CK_PKCS11_FUNCTION_INFO(C_GetInfo) +#ifdef CK_NEED_ARG_LIST +( + CK_INFO_PTR pInfo /* location that receives information */ +); +#endif + + +/* C_GetFunctionList returns the function list. */ +CK_PKCS11_FUNCTION_INFO(C_GetFunctionList) +#ifdef CK_NEED_ARG_LIST +( + CK_FUNCTION_LIST_PTR_PTR ppFunctionList /* receives pointer to + * function list + */ +); +#endif + + + +/* Slot and token management */ + +/* C_GetSlotList obtains a list of slots in the system. */ +CK_PKCS11_FUNCTION_INFO(C_GetSlotList) +#ifdef CK_NEED_ARG_LIST +( + CK_BBOOL tokenPresent, /* only slots with tokens */ + CK_SLOT_ID_PTR pSlotList, /* receives array of slot IDs */ + CK_ULONG_PTR pulCount /* receives number of slots */ +); +#endif + + +/* C_GetSlotInfo obtains information about a particular slot in + * the system. + */ +CK_PKCS11_FUNCTION_INFO(C_GetSlotInfo) +#ifdef CK_NEED_ARG_LIST +( + CK_SLOT_ID slotID, /* the ID of the slot */ + CK_SLOT_INFO_PTR pInfo /* receives the slot information */ +); +#endif + + +/* C_GetTokenInfo obtains information about a particular token + * in the system. + */ +CK_PKCS11_FUNCTION_INFO(C_GetTokenInfo) +#ifdef CK_NEED_ARG_LIST +( + CK_SLOT_ID slotID, /* ID of the token's slot */ + CK_TOKEN_INFO_PTR pInfo /* receives the token information */ +); +#endif + + +/* C_GetMechanismList obtains a list of mechanism types + * supported by a token. + */ +CK_PKCS11_FUNCTION_INFO(C_GetMechanismList) +#ifdef CK_NEED_ARG_LIST +( + CK_SLOT_ID slotID, /* ID of token's slot */ + CK_MECHANISM_TYPE_PTR pMechanismList, /* gets mech. array */ + CK_ULONG_PTR pulCount /* gets # of mechs. */ +); +#endif + + +/* C_GetMechanismInfo obtains information about a particular + * mechanism possibly supported by a token. + */ +CK_PKCS11_FUNCTION_INFO(C_GetMechanismInfo) +#ifdef CK_NEED_ARG_LIST +( + CK_SLOT_ID slotID, /* ID of the token's slot */ + CK_MECHANISM_TYPE type, /* type of mechanism */ + CK_MECHANISM_INFO_PTR pInfo /* receives mechanism info */ +); +#endif + + +/* C_InitToken initializes a token. */ +CK_PKCS11_FUNCTION_INFO(C_InitToken) +#ifdef CK_NEED_ARG_LIST +( + CK_SLOT_ID slotID, /* ID of the token's slot */ + CK_UTF8CHAR_PTR pPin, /* the SO's initial PIN */ + CK_ULONG ulPinLen, /* length in bytes of the PIN */ + CK_UTF8CHAR_PTR pLabel /* 32-byte token label (blank padded) */ +); +#endif + + +/* C_InitPIN initializes the normal user's PIN. */ +CK_PKCS11_FUNCTION_INFO(C_InitPIN) +#ifdef CK_NEED_ARG_LIST +( + CK_SESSION_HANDLE hSession, /* the session's handle */ + CK_UTF8CHAR_PTR pPin, /* the normal user's PIN */ + CK_ULONG ulPinLen /* length in bytes of the PIN */ +); +#endif + + +/* C_SetPIN modifies the PIN of the user who is logged in. */ +CK_PKCS11_FUNCTION_INFO(C_SetPIN) +#ifdef CK_NEED_ARG_LIST +( + CK_SESSION_HANDLE hSession, /* the session's handle */ + CK_UTF8CHAR_PTR pOldPin, /* the old PIN */ + CK_ULONG ulOldLen, /* length of the old PIN */ + CK_UTF8CHAR_PTR pNewPin, /* the new PIN */ + CK_ULONG ulNewLen /* length of the new PIN */ +); +#endif + + + +/* Session management */ + +/* C_OpenSession opens a session between an application and a + * token. + */ +CK_PKCS11_FUNCTION_INFO(C_OpenSession) +#ifdef CK_NEED_ARG_LIST +( + CK_SLOT_ID slotID, /* the slot's ID */ + CK_FLAGS flags, /* from CK_SESSION_INFO */ + CK_VOID_PTR pApplication, /* passed to callback */ + CK_NOTIFY Notify, /* callback function */ + CK_SESSION_HANDLE_PTR phSession /* gets session handle */ +); +#endif + + +/* C_CloseSession closes a session between an application and a + * token. + */ +CK_PKCS11_FUNCTION_INFO(C_CloseSession) +#ifdef CK_NEED_ARG_LIST +( + CK_SESSION_HANDLE hSession /* the session's handle */ +); +#endif + + +/* C_CloseAllSessions closes all sessions with a token. */ +CK_PKCS11_FUNCTION_INFO(C_CloseAllSessions) +#ifdef CK_NEED_ARG_LIST +( + CK_SLOT_ID slotID /* the token's slot */ +); +#endif + + +/* C_GetSessionInfo obtains information about the session. */ +CK_PKCS11_FUNCTION_INFO(C_GetSessionInfo) +#ifdef CK_NEED_ARG_LIST +( + CK_SESSION_HANDLE hSession, /* the session's handle */ + CK_SESSION_INFO_PTR pInfo /* receives session info */ +); +#endif + + +/* C_GetOperationState obtains the state of the cryptographic operation + * in a session. + */ +CK_PKCS11_FUNCTION_INFO(C_GetOperationState) +#ifdef CK_NEED_ARG_LIST +( + CK_SESSION_HANDLE hSession, /* session's handle */ + CK_BYTE_PTR pOperationState, /* gets state */ + CK_ULONG_PTR pulOperationStateLen /* gets state length */ +); +#endif + + +/* C_SetOperationState restores the state of the cryptographic + * operation in a session. + */ +CK_PKCS11_FUNCTION_INFO(C_SetOperationState) +#ifdef CK_NEED_ARG_LIST +( + CK_SESSION_HANDLE hSession, /* session's handle */ + CK_BYTE_PTR pOperationState, /* holds state */ + CK_ULONG ulOperationStateLen, /* holds state length */ + CK_OBJECT_HANDLE hEncryptionKey, /* en/decryption key */ + CK_OBJECT_HANDLE hAuthenticationKey /* sign/verify key */ +); +#endif + + +/* C_Login logs a user into a token. */ +CK_PKCS11_FUNCTION_INFO(C_Login) +#ifdef CK_NEED_ARG_LIST +( + CK_SESSION_HANDLE hSession, /* the session's handle */ + CK_USER_TYPE userType, /* the user type */ + CK_UTF8CHAR_PTR pPin, /* the user's PIN */ + CK_ULONG ulPinLen /* the length of the PIN */ +); +#endif + + +/* C_Logout logs a user out from a token. */ +CK_PKCS11_FUNCTION_INFO(C_Logout) +#ifdef CK_NEED_ARG_LIST +( + CK_SESSION_HANDLE hSession /* the session's handle */ +); +#endif + + + +/* Object management */ + +/* C_CreateObject creates a new object. */ +CK_PKCS11_FUNCTION_INFO(C_CreateObject) +#ifdef CK_NEED_ARG_LIST +( + CK_SESSION_HANDLE hSession, /* the session's handle */ + CK_ATTRIBUTE_PTR pTemplate, /* the object's template */ + CK_ULONG ulCount, /* attributes in template */ + CK_OBJECT_HANDLE_PTR phObject /* gets new object's handle. */ +); +#endif + + +/* C_CopyObject copies an object, creating a new object for the + * copy. + */ +CK_PKCS11_FUNCTION_INFO(C_CopyObject) +#ifdef CK_NEED_ARG_LIST +( + CK_SESSION_HANDLE hSession, /* the session's handle */ + CK_OBJECT_HANDLE hObject, /* the object's handle */ + CK_ATTRIBUTE_PTR pTemplate, /* template for new object */ + CK_ULONG ulCount, /* attributes in template */ + CK_OBJECT_HANDLE_PTR phNewObject /* receives handle of copy */ +); +#endif + + +/* C_DestroyObject destroys an object. */ +CK_PKCS11_FUNCTION_INFO(C_DestroyObject) +#ifdef CK_NEED_ARG_LIST +( + CK_SESSION_HANDLE hSession, /* the session's handle */ + CK_OBJECT_HANDLE hObject /* the object's handle */ +); +#endif + + +/* C_GetObjectSize gets the size of an object in bytes. */ +CK_PKCS11_FUNCTION_INFO(C_GetObjectSize) +#ifdef CK_NEED_ARG_LIST +( + CK_SESSION_HANDLE hSession, /* the session's handle */ + CK_OBJECT_HANDLE hObject, /* the object's handle */ + CK_ULONG_PTR pulSize /* receives size of object */ +); +#endif + + +/* C_GetAttributeValue obtains the value of one or more object + * attributes. + */ +CK_PKCS11_FUNCTION_INFO(C_GetAttributeValue) +#ifdef CK_NEED_ARG_LIST +( + CK_SESSION_HANDLE hSession, /* the session's handle */ + CK_OBJECT_HANDLE hObject, /* the object's handle */ + CK_ATTRIBUTE_PTR pTemplate, /* specifies attrs; gets vals */ + CK_ULONG ulCount /* attributes in template */ +); +#endif + + +/* C_SetAttributeValue modifies the value of one or more object + * attributes. + */ +CK_PKCS11_FUNCTION_INFO(C_SetAttributeValue) +#ifdef CK_NEED_ARG_LIST +( + CK_SESSION_HANDLE hSession, /* the session's handle */ + CK_OBJECT_HANDLE hObject, /* the object's handle */ + CK_ATTRIBUTE_PTR pTemplate, /* specifies attrs and values */ + CK_ULONG ulCount /* attributes in template */ +); +#endif + + +/* C_FindObjectsInit initializes a search for token and session + * objects that match a template. + */ +CK_PKCS11_FUNCTION_INFO(C_FindObjectsInit) +#ifdef CK_NEED_ARG_LIST +( + CK_SESSION_HANDLE hSession, /* the session's handle */ + CK_ATTRIBUTE_PTR pTemplate, /* attribute values to match */ + CK_ULONG ulCount /* attrs in search template */ +); +#endif + + +/* C_FindObjects continues a search for token and session + * objects that match a template, obtaining additional object + * handles. + */ +CK_PKCS11_FUNCTION_INFO(C_FindObjects) +#ifdef CK_NEED_ARG_LIST +( + CK_SESSION_HANDLE hSession, /* session's handle */ + CK_OBJECT_HANDLE_PTR phObject, /* gets obj. handles */ + CK_ULONG ulMaxObjectCount, /* max handles to get */ + CK_ULONG_PTR pulObjectCount /* actual # returned */ +); +#endif + + +/* C_FindObjectsFinal finishes a search for token and session + * objects. + */ +CK_PKCS11_FUNCTION_INFO(C_FindObjectsFinal) +#ifdef CK_NEED_ARG_LIST +( + CK_SESSION_HANDLE hSession /* the session's handle */ +); +#endif + + + +/* Encryption and decryption */ + +/* C_EncryptInit initializes an encryption operation. */ +CK_PKCS11_FUNCTION_INFO(C_EncryptInit) +#ifdef CK_NEED_ARG_LIST +( + CK_SESSION_HANDLE hSession, /* the session's handle */ + CK_MECHANISM_PTR pMechanism, /* the encryption mechanism */ + CK_OBJECT_HANDLE hKey /* handle of encryption key */ +); +#endif + + +/* C_Encrypt encrypts single-part data. */ +CK_PKCS11_FUNCTION_INFO(C_Encrypt) +#ifdef CK_NEED_ARG_LIST +( + CK_SESSION_HANDLE hSession, /* session's handle */ + CK_BYTE_PTR pData, /* the plaintext data */ + CK_ULONG ulDataLen, /* bytes of plaintext */ + CK_BYTE_PTR pEncryptedData, /* gets ciphertext */ + CK_ULONG_PTR pulEncryptedDataLen /* gets c-text size */ +); +#endif + + +/* C_EncryptUpdate continues a multiple-part encryption + * operation. + */ +CK_PKCS11_FUNCTION_INFO(C_EncryptUpdate) +#ifdef CK_NEED_ARG_LIST +( + CK_SESSION_HANDLE hSession, /* session's handle */ + CK_BYTE_PTR pPart, /* the plaintext data */ + CK_ULONG ulPartLen, /* plaintext data len */ + CK_BYTE_PTR pEncryptedPart, /* gets ciphertext */ + CK_ULONG_PTR pulEncryptedPartLen /* gets c-text size */ +); +#endif + + +/* C_EncryptFinal finishes a multiple-part encryption + * operation. + */ +CK_PKCS11_FUNCTION_INFO(C_EncryptFinal) +#ifdef CK_NEED_ARG_LIST +( + CK_SESSION_HANDLE hSession, /* session handle */ + CK_BYTE_PTR pLastEncryptedPart, /* last c-text */ + CK_ULONG_PTR pulLastEncryptedPartLen /* gets last size */ +); +#endif + + +/* C_DecryptInit initializes a decryption operation. */ +CK_PKCS11_FUNCTION_INFO(C_DecryptInit) +#ifdef CK_NEED_ARG_LIST +( + CK_SESSION_HANDLE hSession, /* the session's handle */ + CK_MECHANISM_PTR pMechanism, /* the decryption mechanism */ + CK_OBJECT_HANDLE hKey /* handle of decryption key */ +); +#endif + + +/* C_Decrypt decrypts encrypted data in a single part. */ +CK_PKCS11_FUNCTION_INFO(C_Decrypt) +#ifdef CK_NEED_ARG_LIST +( + CK_SESSION_HANDLE hSession, /* session's handle */ + CK_BYTE_PTR pEncryptedData, /* ciphertext */ + CK_ULONG ulEncryptedDataLen, /* ciphertext length */ + CK_BYTE_PTR pData, /* gets plaintext */ + CK_ULONG_PTR pulDataLen /* gets p-text size */ +); +#endif + + +/* C_DecryptUpdate continues a multiple-part decryption + * operation. + */ +CK_PKCS11_FUNCTION_INFO(C_DecryptUpdate) +#ifdef CK_NEED_ARG_LIST +( + CK_SESSION_HANDLE hSession, /* session's handle */ + CK_BYTE_PTR pEncryptedPart, /* encrypted data */ + CK_ULONG ulEncryptedPartLen, /* input length */ + CK_BYTE_PTR pPart, /* gets plaintext */ + CK_ULONG_PTR pulPartLen /* p-text size */ +); +#endif + + +/* C_DecryptFinal finishes a multiple-part decryption + * operation. + */ +CK_PKCS11_FUNCTION_INFO(C_DecryptFinal) +#ifdef CK_NEED_ARG_LIST +( + CK_SESSION_HANDLE hSession, /* the session's handle */ + CK_BYTE_PTR pLastPart, /* gets plaintext */ + CK_ULONG_PTR pulLastPartLen /* p-text size */ +); +#endif + + + +/* Message digesting */ + +/* C_DigestInit initializes a message-digesting operation. */ +CK_PKCS11_FUNCTION_INFO(C_DigestInit) +#ifdef CK_NEED_ARG_LIST +( + CK_SESSION_HANDLE hSession, /* the session's handle */ + CK_MECHANISM_PTR pMechanism /* the digesting mechanism */ +); +#endif + + +/* C_Digest digests data in a single part. */ +CK_PKCS11_FUNCTION_INFO(C_Digest) +#ifdef CK_NEED_ARG_LIST +( + CK_SESSION_HANDLE hSession, /* the session's handle */ + CK_BYTE_PTR pData, /* data to be digested */ + CK_ULONG ulDataLen, /* bytes of data to digest */ + CK_BYTE_PTR pDigest, /* gets the message digest */ + CK_ULONG_PTR pulDigestLen /* gets digest length */ +); +#endif + + +/* C_DigestUpdate continues a multiple-part message-digesting + * operation. + */ +CK_PKCS11_FUNCTION_INFO(C_DigestUpdate) +#ifdef CK_NEED_ARG_LIST +( + CK_SESSION_HANDLE hSession, /* the session's handle */ + CK_BYTE_PTR pPart, /* data to be digested */ + CK_ULONG ulPartLen /* bytes of data to be digested */ +); +#endif + + +/* C_DigestKey continues a multi-part message-digesting + * operation, by digesting the value of a secret key as part of + * the data already digested. + */ +CK_PKCS11_FUNCTION_INFO(C_DigestKey) +#ifdef CK_NEED_ARG_LIST +( + CK_SESSION_HANDLE hSession, /* the session's handle */ + CK_OBJECT_HANDLE hKey /* secret key to digest */ +); +#endif + + +/* C_DigestFinal finishes a multiple-part message-digesting + * operation. + */ +CK_PKCS11_FUNCTION_INFO(C_DigestFinal) +#ifdef CK_NEED_ARG_LIST +( + CK_SESSION_HANDLE hSession, /* the session's handle */ + CK_BYTE_PTR pDigest, /* gets the message digest */ + CK_ULONG_PTR pulDigestLen /* gets byte count of digest */ +); +#endif + + + +/* Signing and MACing */ + +/* C_SignInit initializes a signature (private key encryption) + * operation, where the signature is (will be) an appendix to + * the data, and plaintext cannot be recovered from the + * signature. + */ +CK_PKCS11_FUNCTION_INFO(C_SignInit) +#ifdef CK_NEED_ARG_LIST +( + CK_SESSION_HANDLE hSession, /* the session's handle */ + CK_MECHANISM_PTR pMechanism, /* the signature mechanism */ + CK_OBJECT_HANDLE hKey /* handle of signature key */ +); +#endif + + +/* C_Sign signs (encrypts with private key) data in a single + * part, where the signature is (will be) an appendix to the + * data, and plaintext cannot be recovered from the signature. + */ +CK_PKCS11_FUNCTION_INFO(C_Sign) +#ifdef CK_NEED_ARG_LIST +( + CK_SESSION_HANDLE hSession, /* the session's handle */ + CK_BYTE_PTR pData, /* the data to sign */ + CK_ULONG ulDataLen, /* count of bytes to sign */ + CK_BYTE_PTR pSignature, /* gets the signature */ + CK_ULONG_PTR pulSignatureLen /* gets signature length */ +); +#endif + + +/* C_SignUpdate continues a multiple-part signature operation, + * where the signature is (will be) an appendix to the data, + * and plaintext cannot be recovered from the signature. + */ +CK_PKCS11_FUNCTION_INFO(C_SignUpdate) +#ifdef CK_NEED_ARG_LIST +( + CK_SESSION_HANDLE hSession, /* the session's handle */ + CK_BYTE_PTR pPart, /* the data to sign */ + CK_ULONG ulPartLen /* count of bytes to sign */ +); +#endif + + +/* C_SignFinal finishes a multiple-part signature operation, + * returning the signature. + */ +CK_PKCS11_FUNCTION_INFO(C_SignFinal) +#ifdef CK_NEED_ARG_LIST +( + CK_SESSION_HANDLE hSession, /* the session's handle */ + CK_BYTE_PTR pSignature, /* gets the signature */ + CK_ULONG_PTR pulSignatureLen /* gets signature length */ +); +#endif + + +/* C_SignRecoverInit initializes a signature operation, where + * the data can be recovered from the signature. + */ +CK_PKCS11_FUNCTION_INFO(C_SignRecoverInit) +#ifdef CK_NEED_ARG_LIST +( + CK_SESSION_HANDLE hSession, /* the session's handle */ + CK_MECHANISM_PTR pMechanism, /* the signature mechanism */ + CK_OBJECT_HANDLE hKey /* handle of the signature key */ +); +#endif + + +/* C_SignRecover signs data in a single operation, where the + * data can be recovered from the signature. + */ +CK_PKCS11_FUNCTION_INFO(C_SignRecover) +#ifdef CK_NEED_ARG_LIST +( + CK_SESSION_HANDLE hSession, /* the session's handle */ + CK_BYTE_PTR pData, /* the data to sign */ + CK_ULONG ulDataLen, /* count of bytes to sign */ + CK_BYTE_PTR pSignature, /* gets the signature */ + CK_ULONG_PTR pulSignatureLen /* gets signature length */ +); +#endif + + + +/* Verifying signatures and MACs */ + +/* C_VerifyInit initializes a verification operation, where the + * signature is an appendix to the data, and plaintext cannot + * cannot be recovered from the signature (e.g. DSA). + */ +CK_PKCS11_FUNCTION_INFO(C_VerifyInit) +#ifdef CK_NEED_ARG_LIST +( + CK_SESSION_HANDLE hSession, /* the session's handle */ + CK_MECHANISM_PTR pMechanism, /* the verification mechanism */ + CK_OBJECT_HANDLE hKey /* verification key */ +); +#endif + + +/* C_Verify verifies a signature in a single-part operation, + * where the signature is an appendix to the data, and plaintext + * cannot be recovered from the signature. + */ +CK_PKCS11_FUNCTION_INFO(C_Verify) +#ifdef CK_NEED_ARG_LIST +( + CK_SESSION_HANDLE hSession, /* the session's handle */ + CK_BYTE_PTR pData, /* signed data */ + CK_ULONG ulDataLen, /* length of signed data */ + CK_BYTE_PTR pSignature, /* signature */ + CK_ULONG ulSignatureLen /* signature length*/ +); +#endif + + +/* C_VerifyUpdate continues a multiple-part verification + * operation, where the signature is an appendix to the data, + * and plaintext cannot be recovered from the signature. + */ +CK_PKCS11_FUNCTION_INFO(C_VerifyUpdate) +#ifdef CK_NEED_ARG_LIST +( + CK_SESSION_HANDLE hSession, /* the session's handle */ + CK_BYTE_PTR pPart, /* signed data */ + CK_ULONG ulPartLen /* length of signed data */ +); +#endif + + +/* C_VerifyFinal finishes a multiple-part verification + * operation, checking the signature. + */ +CK_PKCS11_FUNCTION_INFO(C_VerifyFinal) +#ifdef CK_NEED_ARG_LIST +( + CK_SESSION_HANDLE hSession, /* the session's handle */ + CK_BYTE_PTR pSignature, /* signature to verify */ + CK_ULONG ulSignatureLen /* signature length */ +); +#endif + + +/* C_VerifyRecoverInit initializes a signature verification + * operation, where the data is recovered from the signature. + */ +CK_PKCS11_FUNCTION_INFO(C_VerifyRecoverInit) +#ifdef CK_NEED_ARG_LIST +( + CK_SESSION_HANDLE hSession, /* the session's handle */ + CK_MECHANISM_PTR pMechanism, /* the verification mechanism */ + CK_OBJECT_HANDLE hKey /* verification key */ +); +#endif + + +/* C_VerifyRecover verifies a signature in a single-part + * operation, where the data is recovered from the signature. + */ +CK_PKCS11_FUNCTION_INFO(C_VerifyRecover) +#ifdef CK_NEED_ARG_LIST +( + CK_SESSION_HANDLE hSession, /* the session's handle */ + CK_BYTE_PTR pSignature, /* signature to verify */ + CK_ULONG ulSignatureLen, /* signature length */ + CK_BYTE_PTR pData, /* gets signed data */ + CK_ULONG_PTR pulDataLen /* gets signed data len */ +); +#endif + + + +/* Dual-function cryptographic operations */ + +/* C_DigestEncryptUpdate continues a multiple-part digesting + * and encryption operation. + */ +CK_PKCS11_FUNCTION_INFO(C_DigestEncryptUpdate) +#ifdef CK_NEED_ARG_LIST +( + CK_SESSION_HANDLE hSession, /* session's handle */ + CK_BYTE_PTR pPart, /* the plaintext data */ + CK_ULONG ulPartLen, /* plaintext length */ + CK_BYTE_PTR pEncryptedPart, /* gets ciphertext */ + CK_ULONG_PTR pulEncryptedPartLen /* gets c-text length */ +); +#endif + + +/* C_DecryptDigestUpdate continues a multiple-part decryption and + * digesting operation. + */ +CK_PKCS11_FUNCTION_INFO(C_DecryptDigestUpdate) +#ifdef CK_NEED_ARG_LIST +( + CK_SESSION_HANDLE hSession, /* session's handle */ + CK_BYTE_PTR pEncryptedPart, /* ciphertext */ + CK_ULONG ulEncryptedPartLen, /* ciphertext length */ + CK_BYTE_PTR pPart, /* gets plaintext */ + CK_ULONG_PTR pulPartLen /* gets plaintext len */ +); +#endif + + +/* C_SignEncryptUpdate continues a multiple-part signing and + * encryption operation. + */ +CK_PKCS11_FUNCTION_INFO(C_SignEncryptUpdate) +#ifdef CK_NEED_ARG_LIST +( + CK_SESSION_HANDLE hSession, /* session's handle */ + CK_BYTE_PTR pPart, /* the plaintext data */ + CK_ULONG ulPartLen, /* plaintext length */ + CK_BYTE_PTR pEncryptedPart, /* gets ciphertext */ + CK_ULONG_PTR pulEncryptedPartLen /* gets c-text length */ +); +#endif + + +/* C_DecryptVerifyUpdate continues a multiple-part decryption and + * verify operation. + */ +CK_PKCS11_FUNCTION_INFO(C_DecryptVerifyUpdate) +#ifdef CK_NEED_ARG_LIST +( + CK_SESSION_HANDLE hSession, /* session's handle */ + CK_BYTE_PTR pEncryptedPart, /* ciphertext */ + CK_ULONG ulEncryptedPartLen, /* ciphertext length */ + CK_BYTE_PTR pPart, /* gets plaintext */ + CK_ULONG_PTR pulPartLen /* gets p-text length */ +); +#endif + + + +/* Key management */ + +/* C_GenerateKey generates a secret key, creating a new key + * object. + */ +CK_PKCS11_FUNCTION_INFO(C_GenerateKey) +#ifdef CK_NEED_ARG_LIST +( + CK_SESSION_HANDLE hSession, /* the session's handle */ + CK_MECHANISM_PTR pMechanism, /* key generation mech. */ + CK_ATTRIBUTE_PTR pTemplate, /* template for new key */ + CK_ULONG ulCount, /* # of attrs in template */ + CK_OBJECT_HANDLE_PTR phKey /* gets handle of new key */ +); +#endif + + +/* C_GenerateKeyPair generates a public-key/private-key pair, + * creating new key objects. + */ +CK_PKCS11_FUNCTION_INFO(C_GenerateKeyPair) +#ifdef CK_NEED_ARG_LIST +( + CK_SESSION_HANDLE hSession, /* session handle */ + CK_MECHANISM_PTR pMechanism, /* key-gen mech. */ + CK_ATTRIBUTE_PTR pPublicKeyTemplate, /* template for pub. key */ + CK_ULONG ulPublicKeyAttributeCount, /* # pub. attrs. */ + CK_ATTRIBUTE_PTR pPrivateKeyTemplate, /* template for priv. key */ + CK_ULONG ulPrivateKeyAttributeCount, /* # priv. attrs. */ + CK_OBJECT_HANDLE_PTR phPublicKey, /* gets pub. key handle */ + CK_OBJECT_HANDLE_PTR phPrivateKey /* gets priv. key handle */ +); +#endif + + +/* C_WrapKey wraps (i.e., encrypts) a key. */ +CK_PKCS11_FUNCTION_INFO(C_WrapKey) +#ifdef CK_NEED_ARG_LIST +( + CK_SESSION_HANDLE hSession, /* the session's handle */ + CK_MECHANISM_PTR pMechanism, /* the wrapping mechanism */ + CK_OBJECT_HANDLE hWrappingKey, /* wrapping key */ + CK_OBJECT_HANDLE hKey, /* key to be wrapped */ + CK_BYTE_PTR pWrappedKey, /* gets wrapped key */ + CK_ULONG_PTR pulWrappedKeyLen /* gets wrapped key size */ +); +#endif + + +/* C_UnwrapKey unwraps (decrypts) a wrapped key, creating a new + * key object. + */ +CK_PKCS11_FUNCTION_INFO(C_UnwrapKey) +#ifdef CK_NEED_ARG_LIST +( + CK_SESSION_HANDLE hSession, /* session's handle */ + CK_MECHANISM_PTR pMechanism, /* unwrapping mech. */ + CK_OBJECT_HANDLE hUnwrappingKey, /* unwrapping key */ + CK_BYTE_PTR pWrappedKey, /* the wrapped key */ + CK_ULONG ulWrappedKeyLen, /* wrapped key len */ + CK_ATTRIBUTE_PTR pTemplate, /* new key template */ + CK_ULONG ulAttributeCount, /* template length */ + CK_OBJECT_HANDLE_PTR phKey /* gets new handle */ +); +#endif + + +/* C_DeriveKey derives a key from a base key, creating a new key + * object. + */ +CK_PKCS11_FUNCTION_INFO(C_DeriveKey) +#ifdef CK_NEED_ARG_LIST +( + CK_SESSION_HANDLE hSession, /* session's handle */ + CK_MECHANISM_PTR pMechanism, /* key deriv. mech. */ + CK_OBJECT_HANDLE hBaseKey, /* base key */ + CK_ATTRIBUTE_PTR pTemplate, /* new key template */ + CK_ULONG ulAttributeCount, /* template length */ + CK_OBJECT_HANDLE_PTR phKey /* gets new handle */ +); +#endif + + + +/* Random number generation */ + +/* C_SeedRandom mixes additional seed material into the token's + * random number generator. + */ +CK_PKCS11_FUNCTION_INFO(C_SeedRandom) +#ifdef CK_NEED_ARG_LIST +( + CK_SESSION_HANDLE hSession, /* the session's handle */ + CK_BYTE_PTR pSeed, /* the seed material */ + CK_ULONG ulSeedLen /* length of seed material */ +); +#endif + + +/* C_GenerateRandom generates random data. */ +CK_PKCS11_FUNCTION_INFO(C_GenerateRandom) +#ifdef CK_NEED_ARG_LIST +( + CK_SESSION_HANDLE hSession, /* the session's handle */ + CK_BYTE_PTR RandomData, /* receives the random data */ + CK_ULONG ulRandomLen /* # of bytes to generate */ +); +#endif + + + +/* Parallel function management */ + +/* C_GetFunctionStatus is a legacy function; it obtains an + * updated status of a function running in parallel with an + * application. + */ +CK_PKCS11_FUNCTION_INFO(C_GetFunctionStatus) +#ifdef CK_NEED_ARG_LIST +( + CK_SESSION_HANDLE hSession /* the session's handle */ +); +#endif + + +/* C_CancelFunction is a legacy function; it cancels a function + * running in parallel. + */ +CK_PKCS11_FUNCTION_INFO(C_CancelFunction) +#ifdef CK_NEED_ARG_LIST +( + CK_SESSION_HANDLE hSession /* the session's handle */ +); +#endif + + +/* C_WaitForSlotEvent waits for a slot event (token insertion, + * removal, etc.) to occur. + */ +CK_PKCS11_FUNCTION_INFO(C_WaitForSlotEvent) +#ifdef CK_NEED_ARG_LIST +( + CK_FLAGS flags, /* blocking/nonblocking flag */ + CK_SLOT_ID_PTR pSlot, /* location that receives the slot ID */ + CK_VOID_PTR pRserved /* reserved. Should be NULL_PTR */ +); +#endif + +#ifndef CK_PKCS11_2_0_ONLY +/* C_GetInterfaceList returns all the interfaces supported by the module*/ +CK_PKCS11_FUNCTION_INFO(C_GetInterfaceList) +#ifdef CK_NEED_ARG_LIST +( + CK_INTERFACE_PTR pInterfacesList, /* returned interfaces */ + CK_ULONG_PTR pulCount /* number of interfaces returned */ +); +#endif + +/* C_GetInterface returns a specific interface from the module. */ +CK_PKCS11_FUNCTION_INFO(C_GetInterface) +#ifdef CK_NEED_ARG_LIST +( + CK_UTF8CHAR_PTR pInterfaceName, /* name of the interface */ + CK_VERSION_PTR pVersion, /* version of the interface */ + CK_INTERFACE_PTR_PTR ppInterface, /* returned interface */ + CK_FLAGS flags /* flags controlling the semantics + * of the interface */ +); +#endif + +CK_PKCS11_FUNCTION_INFO(C_LoginUser) +#ifdef CK_NEED_ARG_LIST +( + CK_SESSION_HANDLE hSession, /* the session's handle */ + CK_USER_TYPE userType, /* the user type */ + CK_UTF8CHAR_PTR pPin, /* the user's PIN */ + CK_ULONG ulPinLen, /* the length of the PIN */ + CK_UTF8CHAR_PTR pUsername, /* the user's name */ + CK_ULONG ulUsernameLen /*the length of the user's name */ +); +#endif + +CK_PKCS11_FUNCTION_INFO(C_SessionCancel) +#ifdef CK_NEED_ARG_LIST +( + CK_SESSION_HANDLE hSession, /* the session's handle */ + CK_FLAGS flags /* flags control which sessions are cancelled */ +); +#endif + +CK_PKCS11_FUNCTION_INFO(C_MessageEncryptInit) +#ifdef CK_NEED_ARG_LIST +( + CK_SESSION_HANDLE hSession, /* the session's handle */ + CK_MECHANISM_PTR pMechanism, /* the encryption mechanism */ + CK_OBJECT_HANDLE hKey /* handle of encryption key */ +); +#endif + +CK_PKCS11_FUNCTION_INFO(C_EncryptMessage) +#ifdef CK_NEED_ARG_LIST +( + CK_SESSION_HANDLE hSession, /* the session's handle */ + CK_VOID_PTR pParameter, /* message specific parameter */ + CK_ULONG ulParameterLen, /* length of message specific parameter */ + CK_BYTE_PTR pAssociatedData, /* AEAD Associated data */ + CK_ULONG ulAssociatedDataLen, /* AEAD Associated data length */ + CK_BYTE_PTR pPlaintext, /* plain text */ + CK_ULONG ulPlaintextLen, /* plain text length */ + CK_BYTE_PTR pCiphertext, /* gets cipher text */ + CK_ULONG_PTR pulCiphertextLen /* gets cipher text length */ +); +#endif + +CK_PKCS11_FUNCTION_INFO(C_EncryptMessageBegin) +#ifdef CK_NEED_ARG_LIST +( + CK_SESSION_HANDLE hSession, /* the session's handle */ + CK_VOID_PTR pParameter, /* message specific parameter */ + CK_ULONG ulParameterLen, /* length of message specific parameter */ + CK_BYTE_PTR pAssociatedData, /* AEAD Associated data */ + CK_ULONG ulAssociatedDataLen /* AEAD Associated data length */ +); +#endif + +CK_PKCS11_FUNCTION_INFO(C_EncryptMessageNext) +#ifdef CK_NEED_ARG_LIST +( + CK_SESSION_HANDLE hSession, /* the session's handle */ + CK_VOID_PTR pParameter, /* message specific parameter */ + CK_ULONG ulParameterLen, /* length of message specific parameter */ + CK_BYTE_PTR pPlaintextPart, /* plain text */ + CK_ULONG ulPlaintextPartLen, /* plain text length */ + CK_BYTE_PTR pCiphertextPart, /* gets cipher text */ + CK_ULONG_PTR pulCiphertextPartLen, /* gets cipher text length */ + CK_FLAGS flags /* multi mode flag */ +); +#endif + +CK_PKCS11_FUNCTION_INFO(C_MessageEncryptFinal) +#ifdef CK_NEED_ARG_LIST +( + CK_SESSION_HANDLE hSession /* the session's handle */ +); +#endif + +CK_PKCS11_FUNCTION_INFO(C_MessageDecryptInit) +#ifdef CK_NEED_ARG_LIST +( + CK_SESSION_HANDLE hSession, /* the session's handle */ + CK_MECHANISM_PTR pMechanism, /* the decryption mechanism */ + CK_OBJECT_HANDLE hKey /* handle of decryption key */ +); +#endif + +CK_PKCS11_FUNCTION_INFO(C_DecryptMessage) +#ifdef CK_NEED_ARG_LIST +( + CK_SESSION_HANDLE hSession, /* the session's handle */ + CK_VOID_PTR pParameter, /* message specific parameter */ + CK_ULONG ulParameterLen, /* length of message specific parameter */ + CK_BYTE_PTR pAssociatedData, /* AEAD Associated data */ + CK_ULONG ulAssociatedDataLen, /* AEAD Associated data length */ + CK_BYTE_PTR pCiphertext, /* cipher text */ + CK_ULONG ulCiphertextLen, /* cipher text length */ + CK_BYTE_PTR pPlaintext, /* gets plain text */ + CK_ULONG_PTR pulPlaintextLen /* gets plain text length */ +); +#endif + +CK_PKCS11_FUNCTION_INFO(C_DecryptMessageBegin) +#ifdef CK_NEED_ARG_LIST +( + CK_SESSION_HANDLE hSession, /* the session's handle */ + CK_VOID_PTR pParameter, /* message specific parameter */ + CK_ULONG ulParameterLen, /* length of message specific parameter */ + CK_BYTE_PTR pAssociatedData, /* AEAD Associated data */ + CK_ULONG ulAssociatedDataLen /* AEAD Associated data length */ +); +#endif + +CK_PKCS11_FUNCTION_INFO(C_DecryptMessageNext) +#ifdef CK_NEED_ARG_LIST +( + CK_SESSION_HANDLE hSession, /* the session's handle */ + CK_VOID_PTR pParameter, /* message specific parameter */ + CK_ULONG ulParameterLen, /* length of message specific parameter */ + CK_BYTE_PTR pCiphertext, /* cipher text */ + CK_ULONG ulCiphertextLen, /* cipher text length */ + CK_BYTE_PTR pPlaintext, /* gets plain text */ + CK_ULONG_PTR pulPlaintextLen, /* gets plain text length */ + CK_FLAGS flags /* multi mode flag */ +); +#endif + +CK_PKCS11_FUNCTION_INFO(C_MessageDecryptFinal) +#ifdef CK_NEED_ARG_LIST +( + CK_SESSION_HANDLE hSession /* the session's handle */ +); +#endif + +CK_PKCS11_FUNCTION_INFO(C_MessageSignInit) +#ifdef CK_NEED_ARG_LIST +( + CK_SESSION_HANDLE hSession, /* the session's handle */ + CK_MECHANISM_PTR pMechanism, /* the signing mechanism */ + CK_OBJECT_HANDLE hKey /* handle of signing key */ +); +#endif + +CK_PKCS11_FUNCTION_INFO(C_SignMessage) +#ifdef CK_NEED_ARG_LIST +( + CK_SESSION_HANDLE hSession, /* the session's handle */ + CK_VOID_PTR pParameter, /* message specific parameter */ + CK_ULONG ulParameterLen, /* length of message specific parameter */ + CK_BYTE_PTR pData, /* data to sign */ + CK_ULONG ulDataLen, /* data to sign length */ + CK_BYTE_PTR pSignature, /* gets signature */ + CK_ULONG_PTR pulSignatureLen /* gets signature length */ +); +#endif + +CK_PKCS11_FUNCTION_INFO(C_SignMessageBegin) +#ifdef CK_NEED_ARG_LIST +( + CK_SESSION_HANDLE hSession, /* the session's handle */ + CK_VOID_PTR pParameter, /* message specific parameter */ + CK_ULONG ulParameterLen /* length of message specific parameter */ +); +#endif + +CK_PKCS11_FUNCTION_INFO(C_SignMessageNext) +#ifdef CK_NEED_ARG_LIST +( + CK_SESSION_HANDLE hSession, /* the session's handle */ + CK_VOID_PTR pParameter, /* message specific parameter */ + CK_ULONG ulParameterLen, /* length of message specific parameter */ + CK_BYTE_PTR pData, /* data to sign */ + CK_ULONG ulDataLen, /* data to sign length */ + CK_BYTE_PTR pSignature, /* gets signature */ + CK_ULONG_PTR pulSignatureLen /* gets signature length */ +); +#endif + +CK_PKCS11_FUNCTION_INFO(C_MessageSignFinal) +#ifdef CK_NEED_ARG_LIST +( + CK_SESSION_HANDLE hSession /* the session's handle */ +); +#endif + +CK_PKCS11_FUNCTION_INFO(C_MessageVerifyInit) +#ifdef CK_NEED_ARG_LIST +( + CK_SESSION_HANDLE hSession, /* the session's handle */ + CK_MECHANISM_PTR pMechanism, /* the signing mechanism */ + CK_OBJECT_HANDLE hKey /* handle of signing key */ +); +#endif + +CK_PKCS11_FUNCTION_INFO(C_VerifyMessage) +#ifdef CK_NEED_ARG_LIST +( + CK_SESSION_HANDLE hSession, /* the session's handle */ + CK_VOID_PTR pParameter, /* message specific parameter */ + CK_ULONG ulParameterLen, /* length of message specific parameter */ + CK_BYTE_PTR pData, /* data to sign */ + CK_ULONG ulDataLen, /* data to sign length */ + CK_BYTE_PTR pSignature, /* signature */ + CK_ULONG ulSignatureLen /* signature length */ +); +#endif + +CK_PKCS11_FUNCTION_INFO(C_VerifyMessageBegin) +#ifdef CK_NEED_ARG_LIST +( + CK_SESSION_HANDLE hSession, /* the session's handle */ + CK_VOID_PTR pParameter, /* message specific parameter */ + CK_ULONG ulParameterLen /* length of message specific parameter */ +); +#endif + +CK_PKCS11_FUNCTION_INFO(C_VerifyMessageNext) +#ifdef CK_NEED_ARG_LIST +( + CK_SESSION_HANDLE hSession, /* the session's handle */ + CK_VOID_PTR pParameter, /* message specific parameter */ + CK_ULONG ulParameterLen, /* length of message specific parameter */ + CK_BYTE_PTR pData, /* data to sign */ + CK_ULONG ulDataLen, /* data to sign length */ + CK_BYTE_PTR pSignature, /* signature */ + CK_ULONG ulSignatureLen /* signature length */ +); +#endif + +CK_PKCS11_FUNCTION_INFO(C_MessageVerifyFinal) +#ifdef CK_NEED_ARG_LIST +( + CK_SESSION_HANDLE hSession /* the session's handle */ +); +#endif + +#endif /* CK_PKCS11_2_0_ONLY */ diff --git a/cryptoki-sys/vendor/pkcs11t.h b/cryptoki-sys/vendor/pkcs11t.h new file mode 100644 index 00000000..0a72ce61 --- /dev/null +++ b/cryptoki-sys/vendor/pkcs11t.h @@ -0,0 +1,2399 @@ +/* Copyright (c) OASIS Open 2016-2020. All Rights Reserved. + * Distributed under the terms of the OASIS IPR Policy, + * [http://www.oasis-open.org/policies-guidelines/ipr], AS-IS, WITHOUT ANY + * IMPLIED OR EXPRESS WARRANTY; there is no warranty of MERCHANTABILITY, FITNESS FOR A + * PARTICULAR PURPOSE or NONINFRINGEMENT of the rights of others. + */ + + +/* See top of pkcs11.h for information about the macros that + * must be defined and the structure-packing conventions that + * must be set before including this file. + */ + +#ifndef _PKCS11T_H_ +#define _PKCS11T_H_ 1 + +#define CRYPTOKI_VERSION_MAJOR 3 +#define CRYPTOKI_VERSION_MINOR 0 +#define CRYPTOKI_VERSION_AMENDMENT 0 + +#define CK_TRUE 1 +#define CK_FALSE 0 + +#ifndef CK_DISABLE_TRUE_FALSE +#ifndef FALSE +#define FALSE CK_FALSE +#endif +#ifndef TRUE +#define TRUE CK_TRUE +#endif +#endif + +/* an unsigned 8-bit value */ +typedef unsigned char CK_BYTE; + +/* an unsigned 8-bit character */ +typedef CK_BYTE CK_CHAR; + +/* an 8-bit UTF-8 character */ +typedef CK_BYTE CK_UTF8CHAR; + +/* a BYTE-sized Boolean flag */ +typedef CK_BYTE CK_BBOOL; + +/* an unsigned value, at least 32 bits long */ +typedef unsigned long int CK_ULONG; + +/* a signed value, the same size as a CK_ULONG */ +typedef long int CK_LONG; + +/* at least 32 bits; each bit is a Boolean flag */ +typedef CK_ULONG CK_FLAGS; + + +/* some special values for certain CK_ULONG variables */ +#define CK_UNAVAILABLE_INFORMATION (~0UL) +#define CK_EFFECTIVELY_INFINITE 0UL + + +typedef CK_BYTE CK_PTR CK_BYTE_PTR; +typedef CK_CHAR CK_PTR CK_CHAR_PTR; +typedef CK_UTF8CHAR CK_PTR CK_UTF8CHAR_PTR; +typedef CK_ULONG CK_PTR CK_ULONG_PTR; +typedef void CK_PTR CK_VOID_PTR; + +/* Pointer to a CK_VOID_PTR-- i.e., pointer to pointer to void */ +typedef CK_VOID_PTR CK_PTR CK_VOID_PTR_PTR; + + +/* The following value is always invalid if used as a session + * handle or object handle + */ +#define CK_INVALID_HANDLE 0UL + + +typedef struct CK_VERSION { + CK_BYTE major; /* integer portion of version number */ + CK_BYTE minor; /* 1/100ths portion of version number */ +} CK_VERSION; + +typedef CK_VERSION CK_PTR CK_VERSION_PTR; + + +typedef struct CK_INFO { + CK_VERSION cryptokiVersion; /* Cryptoki interface ver */ + CK_UTF8CHAR manufacturerID[32]; /* blank padded */ + CK_FLAGS flags; /* must be zero */ + CK_UTF8CHAR libraryDescription[32]; /* blank padded */ + CK_VERSION libraryVersion; /* version of library */ +} CK_INFO; + +typedef CK_INFO CK_PTR CK_INFO_PTR; + + +/* CK_NOTIFICATION enumerates the types of notifications that + * Cryptoki provides to an application + */ +typedef CK_ULONG CK_NOTIFICATION; +#define CKN_SURRENDER 0UL +#define CKN_OTP_CHANGED 1UL + +typedef CK_ULONG CK_SLOT_ID; + +typedef CK_SLOT_ID CK_PTR CK_SLOT_ID_PTR; + + +/* CK_SLOT_INFO provides information about a slot */ +typedef struct CK_SLOT_INFO { + CK_UTF8CHAR slotDescription[64]; /* blank padded */ + CK_UTF8CHAR manufacturerID[32]; /* blank padded */ + CK_FLAGS flags; + + CK_VERSION hardwareVersion; /* version of hardware */ + CK_VERSION firmwareVersion; /* version of firmware */ +} CK_SLOT_INFO; + +/* flags: bit flags that provide capabilities of the slot + * Bit Flag Mask Meaning + */ +#define CKF_TOKEN_PRESENT 0x00000001UL /* a token is there */ +#define CKF_REMOVABLE_DEVICE 0x00000002UL /* removable devices*/ +#define CKF_HW_SLOT 0x00000004UL /* hardware slot */ + +typedef CK_SLOT_INFO CK_PTR CK_SLOT_INFO_PTR; + + +/* CK_TOKEN_INFO provides information about a token */ +typedef struct CK_TOKEN_INFO { + CK_UTF8CHAR label[32]; /* blank padded */ + CK_UTF8CHAR manufacturerID[32]; /* blank padded */ + CK_UTF8CHAR model[16]; /* blank padded */ + CK_CHAR serialNumber[16]; /* blank padded */ + CK_FLAGS flags; /* see below */ + + CK_ULONG ulMaxSessionCount; /* max open sessions */ + CK_ULONG ulSessionCount; /* sess. now open */ + CK_ULONG ulMaxRwSessionCount; /* max R/W sessions */ + CK_ULONG ulRwSessionCount; /* R/W sess. now open */ + CK_ULONG ulMaxPinLen; /* in bytes */ + CK_ULONG ulMinPinLen; /* in bytes */ + CK_ULONG ulTotalPublicMemory; /* in bytes */ + CK_ULONG ulFreePublicMemory; /* in bytes */ + CK_ULONG ulTotalPrivateMemory; /* in bytes */ + CK_ULONG ulFreePrivateMemory; /* in bytes */ + CK_VERSION hardwareVersion; /* version of hardware */ + CK_VERSION firmwareVersion; /* version of firmware */ + CK_CHAR utcTime[16]; /* time */ +} CK_TOKEN_INFO; + +/* The flags parameter is defined as follows: + * Bit Flag Mask Meaning + */ +#define CKF_RNG 0x00000001UL /* has random # generator */ +#define CKF_WRITE_PROTECTED 0x00000002UL /* token is write-protected */ +#define CKF_LOGIN_REQUIRED 0x00000004UL /* user must login */ +#define CKF_USER_PIN_INITIALIZED 0x00000008UL /* normal user's PIN is set */ + +/* CKF_RESTORE_KEY_NOT_NEEDED. If it is set, + * that means that *every* time the state of cryptographic + * operations of a session is successfully saved, all keys + * needed to continue those operations are stored in the state + */ +#define CKF_RESTORE_KEY_NOT_NEEDED 0x00000020UL + +/* CKF_CLOCK_ON_TOKEN. If it is set, that means + * that the token has some sort of clock. The time on that + * clock is returned in the token info structure + */ +#define CKF_CLOCK_ON_TOKEN 0x00000040UL + +/* CKF_PROTECTED_AUTHENTICATION_PATH. If it is + * set, that means that there is some way for the user to login + * without sending a PIN through the Cryptoki library itself + */ +#define CKF_PROTECTED_AUTHENTICATION_PATH 0x00000100UL + +/* CKF_DUAL_CRYPTO_OPERATIONS. If it is true, + * that means that a single session with the token can perform + * dual simultaneous cryptographic operations (digest and + * encrypt; decrypt and digest; sign and encrypt; and decrypt + * and sign) + */ +#define CKF_DUAL_CRYPTO_OPERATIONS 0x00000200UL + +/* CKF_TOKEN_INITIALIZED. If it is true, the + * token has been initialized using C_InitializeToken or an + * equivalent mechanism outside the scope of PKCS #11. + * Calling C_InitializeToken when this flag is set will cause + * the token to be reinitialized. + */ +#define CKF_TOKEN_INITIALIZED 0x00000400UL + +/* CKF_SECONDARY_AUTHENTICATION. If it is + * true, the token supports secondary authentication for + * private key objects. + */ +#define CKF_SECONDARY_AUTHENTICATION 0x00000800UL + +/* CKF_USER_PIN_COUNT_LOW. If it is true, an + * incorrect user login PIN has been entered at least once + * since the last successful authentication. + */ +#define CKF_USER_PIN_COUNT_LOW 0x00010000UL + +/* CKF_USER_PIN_FINAL_TRY. If it is true, + * supplying an incorrect user PIN will it to become locked. + */ +#define CKF_USER_PIN_FINAL_TRY 0x00020000UL + +/* CKF_USER_PIN_LOCKED. If it is true, the + * user PIN has been locked. User login to the token is not + * possible. + */ +#define CKF_USER_PIN_LOCKED 0x00040000UL + +/* CKF_USER_PIN_TO_BE_CHANGED. If it is true, + * the user PIN value is the default value set by token + * initialization or manufacturing, or the PIN has been + * expired by the card. + */ +#define CKF_USER_PIN_TO_BE_CHANGED 0x00080000UL + +/* CKF_SO_PIN_COUNT_LOW. If it is true, an + * incorrect SO login PIN has been entered at least once since + * the last successful authentication. + */ +#define CKF_SO_PIN_COUNT_LOW 0x00100000UL + +/* CKF_SO_PIN_FINAL_TRY. If it is true, + * supplying an incorrect SO PIN will it to become locked. + */ +#define CKF_SO_PIN_FINAL_TRY 0x00200000UL + +/* CKF_SO_PIN_LOCKED. If it is true, the SO + * PIN has been locked. SO login to the token is not possible. + */ +#define CKF_SO_PIN_LOCKED 0x00400000UL + +/* CKF_SO_PIN_TO_BE_CHANGED. If it is true, + * the SO PIN value is the default value set by token + * initialization or manufacturing, or the PIN has been + * expired by the card. + */ +#define CKF_SO_PIN_TO_BE_CHANGED 0x00800000UL + +#define CKF_ERROR_STATE 0x01000000UL + +typedef CK_TOKEN_INFO CK_PTR CK_TOKEN_INFO_PTR; + + +/* CK_SESSION_HANDLE is a Cryptoki-assigned value that + * identifies a session + */ +typedef CK_ULONG CK_SESSION_HANDLE; + +typedef CK_SESSION_HANDLE CK_PTR CK_SESSION_HANDLE_PTR; + + +/* CK_USER_TYPE enumerates the types of Cryptoki users */ +typedef CK_ULONG CK_USER_TYPE; +/* Security Officer */ +#define CKU_SO 0UL +/* Normal user */ +#define CKU_USER 1UL +/* Context specific */ +#define CKU_CONTEXT_SPECIFIC 2UL + +/* CK_STATE enumerates the session states */ +typedef CK_ULONG CK_STATE; +#define CKS_RO_PUBLIC_SESSION 0UL +#define CKS_RO_USER_FUNCTIONS 1UL +#define CKS_RW_PUBLIC_SESSION 2UL +#define CKS_RW_USER_FUNCTIONS 3UL +#define CKS_RW_SO_FUNCTIONS 4UL + +/* CK_SESSION_INFO provides information about a session */ +typedef struct CK_SESSION_INFO { + CK_SLOT_ID slotID; + CK_STATE state; + CK_FLAGS flags; /* see below */ + CK_ULONG ulDeviceError; /* device-dependent error code */ +} CK_SESSION_INFO; + +/* The flags are defined in the following table: + * Bit Flag Mask Meaning + */ +#define CKF_RW_SESSION 0x00000002UL /* session is r/w */ +#define CKF_SERIAL_SESSION 0x00000004UL /* no parallel */ + +typedef CK_SESSION_INFO CK_PTR CK_SESSION_INFO_PTR; + + +/* CK_OBJECT_HANDLE is a token-specific identifier for an + * object + */ +typedef CK_ULONG CK_OBJECT_HANDLE; + +typedef CK_OBJECT_HANDLE CK_PTR CK_OBJECT_HANDLE_PTR; + + +/* CK_OBJECT_CLASS is a value that identifies the classes (or + * types) of objects that Cryptoki recognizes. It is defined + * as follows: + */ +typedef CK_ULONG CK_OBJECT_CLASS; + +/* The following classes of objects are defined: */ +#define CKO_DATA 0x00000000UL +#define CKO_CERTIFICATE 0x00000001UL +#define CKO_PUBLIC_KEY 0x00000002UL +#define CKO_PRIVATE_KEY 0x00000003UL +#define CKO_SECRET_KEY 0x00000004UL +#define CKO_HW_FEATURE 0x00000005UL +#define CKO_DOMAIN_PARAMETERS 0x00000006UL +#define CKO_MECHANISM 0x00000007UL +#define CKO_OTP_KEY 0x00000008UL +#define CKO_PROFILE 0x00000009UL + +#define CKO_VENDOR_DEFINED 0x80000000UL + +typedef CK_OBJECT_CLASS CK_PTR CK_OBJECT_CLASS_PTR; + +/* Profile ID's */ +#define CKP_INVALID_ID 0x00000000UL +#define CKP_BASELINE_PROVIDER 0x00000001UL +#define CKP_EXTENDED_PROVIDER 0x00000002UL +#define CKP_AUTHENTICATION_TOKEN 0x00000003UL +#define CKP_PUBLIC_CERTIFICATES_TOKEN 0x00000004UL +#define CKP_VENDOR_DEFINED 0x80000000UL + +/* CK_HW_FEATURE_TYPE is a value that identifies the hardware feature type + * of an object with CK_OBJECT_CLASS equal to CKO_HW_FEATURE. + */ +typedef CK_ULONG CK_HW_FEATURE_TYPE; + +/* The following hardware feature types are defined */ +#define CKH_MONOTONIC_COUNTER 0x00000001UL +#define CKH_CLOCK 0x00000002UL +#define CKH_USER_INTERFACE 0x00000003UL +#define CKH_VENDOR_DEFINED 0x80000000UL + +/* CK_KEY_TYPE is a value that identifies a key type */ +typedef CK_ULONG CK_KEY_TYPE; + +/* the following key types are defined: */ +#define CKK_RSA 0x00000000UL +#define CKK_DSA 0x00000001UL +#define CKK_DH 0x00000002UL +#define CKK_ECDSA 0x00000003UL /* Deprecated */ +#define CKK_EC 0x00000003UL +#define CKK_X9_42_DH 0x00000004UL +#define CKK_KEA 0x00000005UL +#define CKK_GENERIC_SECRET 0x00000010UL +#define CKK_RC2 0x00000011UL +#define CKK_RC4 0x00000012UL +#define CKK_DES 0x00000013UL +#define CKK_DES2 0x00000014UL +#define CKK_DES3 0x00000015UL +#define CKK_CAST 0x00000016UL +#define CKK_CAST3 0x00000017UL +#define CKK_CAST5 0x00000018UL /* Deprecated */ +#define CKK_CAST128 0x00000018UL +#define CKK_RC5 0x00000019UL +#define CKK_IDEA 0x0000001AUL +#define CKK_SKIPJACK 0x0000001BUL +#define CKK_BATON 0x0000001CUL +#define CKK_JUNIPER 0x0000001DUL +#define CKK_CDMF 0x0000001EUL +#define CKK_AES 0x0000001FUL +#define CKK_BLOWFISH 0x00000020UL +#define CKK_TWOFISH 0x00000021UL +#define CKK_SECURID 0x00000022UL +#define CKK_HOTP 0x00000023UL +#define CKK_ACTI 0x00000024UL +#define CKK_CAMELLIA 0x00000025UL +#define CKK_ARIA 0x00000026UL + +/* the following definitions were added in the 2.30 header file, + * but never defined in the spec. */ +#define CKK_MD5_HMAC 0x00000027UL +#define CKK_SHA_1_HMAC 0x00000028UL +#define CKK_RIPEMD128_HMAC 0x00000029UL +#define CKK_RIPEMD160_HMAC 0x0000002AUL +#define CKK_SHA256_HMAC 0x0000002BUL +#define CKK_SHA384_HMAC 0x0000002CUL +#define CKK_SHA512_HMAC 0x0000002DUL +#define CKK_SHA224_HMAC 0x0000002EUL + +#define CKK_SEED 0x0000002FUL +#define CKK_GOSTR3410 0x00000030UL +#define CKK_GOSTR3411 0x00000031UL +#define CKK_GOST28147 0x00000032UL +#define CKK_CHACHA20 0x00000033UL +#define CKK_POLY1305 0x00000034UL +#define CKK_AES_XTS 0x00000035UL +#define CKK_SHA3_224_HMAC 0x00000036UL +#define CKK_SHA3_256_HMAC 0x00000037UL +#define CKK_SHA3_384_HMAC 0x00000038UL +#define CKK_SHA3_512_HMAC 0x00000039UL +#define CKK_BLAKE2B_160_HMAC 0x0000003aUL +#define CKK_BLAKE2B_256_HMAC 0x0000003bUL +#define CKK_BLAKE2B_384_HMAC 0x0000003cUL +#define CKK_BLAKE2B_512_HMAC 0x0000003dUL +#define CKK_SALSA20 0x0000003eUL +#define CKK_X2RATCHET 0x0000003fUL +#define CKK_EC_EDWARDS 0x00000040UL +#define CKK_EC_MONTGOMERY 0x00000041UL +#define CKK_HKDF 0x00000042UL + +#define CKK_VENDOR_DEFINED 0x80000000UL + + +/* CK_CERTIFICATE_TYPE is a value that identifies a certificate + * type + */ +typedef CK_ULONG CK_CERTIFICATE_TYPE; + +#define CK_CERTIFICATE_CATEGORY_UNSPECIFIED 0UL +#define CK_CERTIFICATE_CATEGORY_TOKEN_USER 1UL +#define CK_CERTIFICATE_CATEGORY_AUTHORITY 2UL +#define CK_CERTIFICATE_CATEGORY_OTHER_ENTITY 3UL + +#define CK_SECURITY_DOMAIN_UNSPECIFIED 0UL +#define CK_SECURITY_DOMAIN_MANUFACTURER 1UL +#define CK_SECURITY_DOMAIN_OPERATOR 2UL +#define CK_SECURITY_DOMAIN_THIRD_PARTY 3UL + + +/* The following certificate types are defined: */ +#define CKC_X_509 0x00000000UL +#define CKC_X_509_ATTR_CERT 0x00000001UL +#define CKC_WTLS 0x00000002UL +#define CKC_VENDOR_DEFINED 0x80000000UL + + +/* CK_ATTRIBUTE_TYPE is a value that identifies an attribute + * type + */ +typedef CK_ULONG CK_ATTRIBUTE_TYPE; + +/* The CKF_ARRAY_ATTRIBUTE flag identifies an attribute which + * consists of an array of values. + */ +#define CKF_ARRAY_ATTRIBUTE 0x40000000UL + +/* The following OTP-related defines relate to the CKA_OTP_FORMAT attribute */ +#define CK_OTP_FORMAT_DECIMAL 0UL +#define CK_OTP_FORMAT_HEXADECIMAL 1UL +#define CK_OTP_FORMAT_ALPHANUMERIC 2UL +#define CK_OTP_FORMAT_BINARY 3UL + +/* The following OTP-related defines relate to the CKA_OTP_..._REQUIREMENT + * attributes + */ +#define CK_OTP_PARAM_IGNORED 0UL +#define CK_OTP_PARAM_OPTIONAL 1UL +#define CK_OTP_PARAM_MANDATORY 2UL + +/* The following attribute types are defined: */ +#define CKA_CLASS 0x00000000UL +#define CKA_TOKEN 0x00000001UL +#define CKA_PRIVATE 0x00000002UL +#define CKA_LABEL 0x00000003UL +#define CKA_UNIQUE_ID 0x00000004UL +#define CKA_APPLICATION 0x00000010UL +#define CKA_VALUE 0x00000011UL +#define CKA_OBJECT_ID 0x00000012UL +#define CKA_CERTIFICATE_TYPE 0x00000080UL +#define CKA_ISSUER 0x00000081UL +#define CKA_SERIAL_NUMBER 0x00000082UL +#define CKA_AC_ISSUER 0x00000083UL +#define CKA_OWNER 0x00000084UL +#define CKA_ATTR_TYPES 0x00000085UL +#define CKA_TRUSTED 0x00000086UL +#define CKA_CERTIFICATE_CATEGORY 0x00000087UL +#define CKA_JAVA_MIDP_SECURITY_DOMAIN 0x00000088UL +#define CKA_URL 0x00000089UL +#define CKA_HASH_OF_SUBJECT_PUBLIC_KEY 0x0000008AUL +#define CKA_HASH_OF_ISSUER_PUBLIC_KEY 0x0000008BUL +#define CKA_NAME_HASH_ALGORITHM 0x0000008CUL +#define CKA_CHECK_VALUE 0x00000090UL + +#define CKA_KEY_TYPE 0x00000100UL +#define CKA_SUBJECT 0x00000101UL +#define CKA_ID 0x00000102UL +#define CKA_SENSITIVE 0x00000103UL +#define CKA_ENCRYPT 0x00000104UL +#define CKA_DECRYPT 0x00000105UL +#define CKA_WRAP 0x00000106UL +#define CKA_UNWRAP 0x00000107UL +#define CKA_SIGN 0x00000108UL +#define CKA_SIGN_RECOVER 0x00000109UL +#define CKA_VERIFY 0x0000010AUL +#define CKA_VERIFY_RECOVER 0x0000010BUL +#define CKA_DERIVE 0x0000010CUL +#define CKA_START_DATE 0x00000110UL +#define CKA_END_DATE 0x00000111UL +#define CKA_MODULUS 0x00000120UL +#define CKA_MODULUS_BITS 0x00000121UL +#define CKA_PUBLIC_EXPONENT 0x00000122UL +#define CKA_PRIVATE_EXPONENT 0x00000123UL +#define CKA_PRIME_1 0x00000124UL +#define CKA_PRIME_2 0x00000125UL +#define CKA_EXPONENT_1 0x00000126UL +#define CKA_EXPONENT_2 0x00000127UL +#define CKA_COEFFICIENT 0x00000128UL +#define CKA_PUBLIC_KEY_INFO 0x00000129UL +#define CKA_PRIME 0x00000130UL +#define CKA_SUBPRIME 0x00000131UL +#define CKA_BASE 0x00000132UL + +#define CKA_PRIME_BITS 0x00000133UL +#define CKA_SUBPRIME_BITS 0x00000134UL +#define CKA_SUB_PRIME_BITS CKA_SUBPRIME_BITS + +#define CKA_VALUE_BITS 0x00000160UL +#define CKA_VALUE_LEN 0x00000161UL +#define CKA_EXTRACTABLE 0x00000162UL +#define CKA_LOCAL 0x00000163UL +#define CKA_NEVER_EXTRACTABLE 0x00000164UL +#define CKA_ALWAYS_SENSITIVE 0x00000165UL +#define CKA_KEY_GEN_MECHANISM 0x00000166UL + +#define CKA_MODIFIABLE 0x00000170UL +#define CKA_COPYABLE 0x00000171UL + +#define CKA_DESTROYABLE 0x00000172UL + +#define CKA_ECDSA_PARAMS 0x00000180UL /* Deprecated */ +#define CKA_EC_PARAMS 0x00000180UL + +#define CKA_EC_POINT 0x00000181UL + +#define CKA_SECONDARY_AUTH 0x00000200UL /* Deprecated */ +#define CKA_AUTH_PIN_FLAGS 0x00000201UL /* Deprecated */ + +#define CKA_ALWAYS_AUTHENTICATE 0x00000202UL + +#define CKA_WRAP_WITH_TRUSTED 0x00000210UL +#define CKA_WRAP_TEMPLATE (CKF_ARRAY_ATTRIBUTE|0x00000211UL) +#define CKA_UNWRAP_TEMPLATE (CKF_ARRAY_ATTRIBUTE|0x00000212UL) +#define CKA_DERIVE_TEMPLATE (CKF_ARRAY_ATTRIBUTE|0x00000213UL) + +#define CKA_OTP_FORMAT 0x00000220UL +#define CKA_OTP_LENGTH 0x00000221UL +#define CKA_OTP_TIME_INTERVAL 0x00000222UL +#define CKA_OTP_USER_FRIENDLY_MODE 0x00000223UL +#define CKA_OTP_CHALLENGE_REQUIREMENT 0x00000224UL +#define CKA_OTP_TIME_REQUIREMENT 0x00000225UL +#define CKA_OTP_COUNTER_REQUIREMENT 0x00000226UL +#define CKA_OTP_PIN_REQUIREMENT 0x00000227UL +#define CKA_OTP_COUNTER 0x0000022EUL +#define CKA_OTP_TIME 0x0000022FUL +#define CKA_OTP_USER_IDENTIFIER 0x0000022AUL +#define CKA_OTP_SERVICE_IDENTIFIER 0x0000022BUL +#define CKA_OTP_SERVICE_LOGO 0x0000022CUL +#define CKA_OTP_SERVICE_LOGO_TYPE 0x0000022DUL + +#define CKA_GOSTR3410_PARAMS 0x00000250UL +#define CKA_GOSTR3411_PARAMS 0x00000251UL +#define CKA_GOST28147_PARAMS 0x00000252UL + +#define CKA_HW_FEATURE_TYPE 0x00000300UL +#define CKA_RESET_ON_INIT 0x00000301UL +#define CKA_HAS_RESET 0x00000302UL + +#define CKA_PIXEL_X 0x00000400UL +#define CKA_PIXEL_Y 0x00000401UL +#define CKA_RESOLUTION 0x00000402UL +#define CKA_CHAR_ROWS 0x00000403UL +#define CKA_CHAR_COLUMNS 0x00000404UL +#define CKA_COLOR 0x00000405UL +#define CKA_BITS_PER_PIXEL 0x00000406UL +#define CKA_CHAR_SETS 0x00000480UL +#define CKA_ENCODING_METHODS 0x00000481UL +#define CKA_MIME_TYPES 0x00000482UL +#define CKA_MECHANISM_TYPE 0x00000500UL +#define CKA_REQUIRED_CMS_ATTRIBUTES 0x00000501UL +#define CKA_DEFAULT_CMS_ATTRIBUTES 0x00000502UL +#define CKA_SUPPORTED_CMS_ATTRIBUTES 0x00000503UL +#define CKA_ALLOWED_MECHANISMS (CKF_ARRAY_ATTRIBUTE|0x00000600UL) +#define CKA_PROFILE_ID 0x00000601UL + +#define CKA_VENDOR_DEFINED 0x80000000UL + +/* CK_ATTRIBUTE is a structure that includes the type, length + * and value of an attribute + */ +typedef struct CK_ATTRIBUTE { + CK_ATTRIBUTE_TYPE type; + CK_VOID_PTR pValue; + CK_ULONG ulValueLen; /* in bytes */ +} CK_ATTRIBUTE; + +typedef CK_ATTRIBUTE CK_PTR CK_ATTRIBUTE_PTR; + +/* CK_DATE is a structure that defines a date */ +typedef struct CK_DATE{ + CK_CHAR year[4]; /* the year ("1900" - "9999") */ + CK_CHAR month[2]; /* the month ("01" - "12") */ + CK_CHAR day[2]; /* the day ("01" - "31") */ +} CK_DATE; + + +/* CK_MECHANISM_TYPE is a value that identifies a mechanism + * type + */ +typedef CK_ULONG CK_MECHANISM_TYPE; + +/* the following mechanism types are defined: */ +#define CKM_RSA_PKCS_KEY_PAIR_GEN 0x00000000UL +#define CKM_RSA_PKCS 0x00000001UL +#define CKM_RSA_9796 0x00000002UL +#define CKM_RSA_X_509 0x00000003UL + +#define CKM_MD2_RSA_PKCS 0x00000004UL +#define CKM_MD5_RSA_PKCS 0x00000005UL +#define CKM_SHA1_RSA_PKCS 0x00000006UL + +#define CKM_RIPEMD128_RSA_PKCS 0x00000007UL +#define CKM_RIPEMD160_RSA_PKCS 0x00000008UL +#define CKM_RSA_PKCS_OAEP 0x00000009UL + +#define CKM_RSA_X9_31_KEY_PAIR_GEN 0x0000000AUL +#define CKM_RSA_X9_31 0x0000000BUL +#define CKM_SHA1_RSA_X9_31 0x0000000CUL +#define CKM_RSA_PKCS_PSS 0x0000000DUL +#define CKM_SHA1_RSA_PKCS_PSS 0x0000000EUL + +#define CKM_DSA_KEY_PAIR_GEN 0x00000010UL +#define CKM_DSA 0x00000011UL +#define CKM_DSA_SHA1 0x00000012UL +#define CKM_DSA_SHA224 0x00000013UL +#define CKM_DSA_SHA256 0x00000014UL +#define CKM_DSA_SHA384 0x00000015UL +#define CKM_DSA_SHA512 0x00000016UL +#define CKM_DSA_SHA3_224 0x00000018UL +#define CKM_DSA_SHA3_256 0x00000019UL +#define CKM_DSA_SHA3_384 0x0000001AUL +#define CKM_DSA_SHA3_512 0x0000001BUL + +#define CKM_DH_PKCS_KEY_PAIR_GEN 0x00000020UL +#define CKM_DH_PKCS_DERIVE 0x00000021UL + +#define CKM_X9_42_DH_KEY_PAIR_GEN 0x00000030UL +#define CKM_X9_42_DH_DERIVE 0x00000031UL +#define CKM_X9_42_DH_HYBRID_DERIVE 0x00000032UL +#define CKM_X9_42_MQV_DERIVE 0x00000033UL + +#define CKM_SHA256_RSA_PKCS 0x00000040UL +#define CKM_SHA384_RSA_PKCS 0x00000041UL +#define CKM_SHA512_RSA_PKCS 0x00000042UL +#define CKM_SHA256_RSA_PKCS_PSS 0x00000043UL +#define CKM_SHA384_RSA_PKCS_PSS 0x00000044UL +#define CKM_SHA512_RSA_PKCS_PSS 0x00000045UL + +#define CKM_SHA224_RSA_PKCS 0x00000046UL +#define CKM_SHA224_RSA_PKCS_PSS 0x00000047UL + +#define CKM_SHA512_224 0x00000048UL +#define CKM_SHA512_224_HMAC 0x00000049UL +#define CKM_SHA512_224_HMAC_GENERAL 0x0000004AUL +#define CKM_SHA512_224_KEY_DERIVATION 0x0000004BUL +#define CKM_SHA512_256 0x0000004CUL +#define CKM_SHA512_256_HMAC 0x0000004DUL +#define CKM_SHA512_256_HMAC_GENERAL 0x0000004EUL +#define CKM_SHA512_256_KEY_DERIVATION 0x0000004FUL + +#define CKM_SHA512_T 0x00000050UL +#define CKM_SHA512_T_HMAC 0x00000051UL +#define CKM_SHA512_T_HMAC_GENERAL 0x00000052UL +#define CKM_SHA512_T_KEY_DERIVATION 0x00000053UL + +#define CKM_SHA3_256_RSA_PKCS 0x00000060UL +#define CKM_SHA3_384_RSA_PKCS 0x00000061UL +#define CKM_SHA3_512_RSA_PKCS 0x00000062UL +#define CKM_SHA3_256_RSA_PKCS_PSS 0x00000063UL +#define CKM_SHA3_384_RSA_PKCS_PSS 0x00000064UL +#define CKM_SHA3_512_RSA_PKCS_PSS 0x00000065UL +#define CKM_SHA3_224_RSA_PKCS 0x00000066UL +#define CKM_SHA3_224_RSA_PKCS_PSS 0x00000067UL + +#define CKM_RC2_KEY_GEN 0x00000100UL +#define CKM_RC2_ECB 0x00000101UL +#define CKM_RC2_CBC 0x00000102UL +#define CKM_RC2_MAC 0x00000103UL + +#define CKM_RC2_MAC_GENERAL 0x00000104UL +#define CKM_RC2_CBC_PAD 0x00000105UL + +#define CKM_RC4_KEY_GEN 0x00000110UL +#define CKM_RC4 0x00000111UL +#define CKM_DES_KEY_GEN 0x00000120UL +#define CKM_DES_ECB 0x00000121UL +#define CKM_DES_CBC 0x00000122UL +#define CKM_DES_MAC 0x00000123UL + +#define CKM_DES_MAC_GENERAL 0x00000124UL +#define CKM_DES_CBC_PAD 0x00000125UL + +#define CKM_DES2_KEY_GEN 0x00000130UL +#define CKM_DES3_KEY_GEN 0x00000131UL +#define CKM_DES3_ECB 0x00000132UL +#define CKM_DES3_CBC 0x00000133UL +#define CKM_DES3_MAC 0x00000134UL + +#define CKM_DES3_MAC_GENERAL 0x00000135UL +#define CKM_DES3_CBC_PAD 0x00000136UL +#define CKM_DES3_CMAC_GENERAL 0x00000137UL +#define CKM_DES3_CMAC 0x00000138UL +#define CKM_CDMF_KEY_GEN 0x00000140UL +#define CKM_CDMF_ECB 0x00000141UL +#define CKM_CDMF_CBC 0x00000142UL +#define CKM_CDMF_MAC 0x00000143UL +#define CKM_CDMF_MAC_GENERAL 0x00000144UL +#define CKM_CDMF_CBC_PAD 0x00000145UL + +#define CKM_DES_OFB64 0x00000150UL +#define CKM_DES_OFB8 0x00000151UL +#define CKM_DES_CFB64 0x00000152UL +#define CKM_DES_CFB8 0x00000153UL + +#define CKM_MD2 0x00000200UL + +#define CKM_MD2_HMAC 0x00000201UL +#define CKM_MD2_HMAC_GENERAL 0x00000202UL + +#define CKM_MD5 0x00000210UL + +#define CKM_MD5_HMAC 0x00000211UL +#define CKM_MD5_HMAC_GENERAL 0x00000212UL + +#define CKM_SHA_1 0x00000220UL + +#define CKM_SHA_1_HMAC 0x00000221UL +#define CKM_SHA_1_HMAC_GENERAL 0x00000222UL + +#define CKM_RIPEMD128 0x00000230UL +#define CKM_RIPEMD128_HMAC 0x00000231UL +#define CKM_RIPEMD128_HMAC_GENERAL 0x00000232UL +#define CKM_RIPEMD160 0x00000240UL +#define CKM_RIPEMD160_HMAC 0x00000241UL +#define CKM_RIPEMD160_HMAC_GENERAL 0x00000242UL + +#define CKM_SHA256 0x00000250UL +#define CKM_SHA256_HMAC 0x00000251UL +#define CKM_SHA256_HMAC_GENERAL 0x00000252UL +#define CKM_SHA224 0x00000255UL +#define CKM_SHA224_HMAC 0x00000256UL +#define CKM_SHA224_HMAC_GENERAL 0x00000257UL +#define CKM_SHA384 0x00000260UL +#define CKM_SHA384_HMAC 0x00000261UL +#define CKM_SHA384_HMAC_GENERAL 0x00000262UL +#define CKM_SHA512 0x00000270UL +#define CKM_SHA512_HMAC 0x00000271UL +#define CKM_SHA512_HMAC_GENERAL 0x00000272UL +#define CKM_SECURID_KEY_GEN 0x00000280UL +#define CKM_SECURID 0x00000282UL +#define CKM_HOTP_KEY_GEN 0x00000290UL +#define CKM_HOTP 0x00000291UL +#define CKM_ACTI 0x000002A0UL +#define CKM_ACTI_KEY_GEN 0x000002A1UL + +#define CKM_SHA3_256 0x000002B0UL +#define CKM_SHA3_256_HMAC 0x000002B1UL +#define CKM_SHA3_256_HMAC_GENERAL 0x000002B2UL +#define CKM_SHA3_256_KEY_GEN 0x000002B3UL +#define CKM_SHA3_224 0x000002B5UL +#define CKM_SHA3_224_HMAC 0x000002B6UL +#define CKM_SHA3_224_HMAC_GENERAL 0x000002B7UL +#define CKM_SHA3_224_KEY_GEN 0x000002B8UL +#define CKM_SHA3_384 0x000002C0UL +#define CKM_SHA3_384_HMAC 0x000002C1UL +#define CKM_SHA3_384_HMAC_GENERAL 0x000002C2UL +#define CKM_SHA3_384_KEY_GEN 0x000002C3UL +#define CKM_SHA3_512 0x000002D0UL +#define CKM_SHA3_512_HMAC 0x000002D1UL +#define CKM_SHA3_512_HMAC_GENERAL 0x000002D2UL +#define CKM_SHA3_512_KEY_GEN 0x000002D3UL + + +#define CKM_CAST_KEY_GEN 0x00000300UL +#define CKM_CAST_ECB 0x00000301UL +#define CKM_CAST_CBC 0x00000302UL +#define CKM_CAST_MAC 0x00000303UL +#define CKM_CAST_MAC_GENERAL 0x00000304UL +#define CKM_CAST_CBC_PAD 0x00000305UL +#define CKM_CAST3_KEY_GEN 0x00000310UL +#define CKM_CAST3_ECB 0x00000311UL +#define CKM_CAST3_CBC 0x00000312UL +#define CKM_CAST3_MAC 0x00000313UL +#define CKM_CAST3_MAC_GENERAL 0x00000314UL +#define CKM_CAST3_CBC_PAD 0x00000315UL +/* Note that CAST128 and CAST5 are the same algorithm */ +#define CKM_CAST5_KEY_GEN 0x00000320UL +#define CKM_CAST128_KEY_GEN 0x00000320UL +#define CKM_CAST5_ECB 0x00000321UL +#define CKM_CAST128_ECB 0x00000321UL +#define CKM_CAST5_CBC 0x00000322UL /* Deprecated */ +#define CKM_CAST128_CBC 0x00000322UL +#define CKM_CAST5_MAC 0x00000323UL /* Deprecated */ +#define CKM_CAST128_MAC 0x00000323UL +#define CKM_CAST5_MAC_GENERAL 0x00000324UL /* Deprecated */ +#define CKM_CAST128_MAC_GENERAL 0x00000324UL +#define CKM_CAST5_CBC_PAD 0x00000325UL /* Deprecated */ +#define CKM_CAST128_CBC_PAD 0x00000325UL +#define CKM_RC5_KEY_GEN 0x00000330UL +#define CKM_RC5_ECB 0x00000331UL +#define CKM_RC5_CBC 0x00000332UL +#define CKM_RC5_MAC 0x00000333UL +#define CKM_RC5_MAC_GENERAL 0x00000334UL +#define CKM_RC5_CBC_PAD 0x00000335UL +#define CKM_IDEA_KEY_GEN 0x00000340UL +#define CKM_IDEA_ECB 0x00000341UL +#define CKM_IDEA_CBC 0x00000342UL +#define CKM_IDEA_MAC 0x00000343UL +#define CKM_IDEA_MAC_GENERAL 0x00000344UL +#define CKM_IDEA_CBC_PAD 0x00000345UL +#define CKM_GENERIC_SECRET_KEY_GEN 0x00000350UL +#define CKM_CONCATENATE_BASE_AND_KEY 0x00000360UL +#define CKM_CONCATENATE_BASE_AND_DATA 0x00000362UL +#define CKM_CONCATENATE_DATA_AND_BASE 0x00000363UL +#define CKM_XOR_BASE_AND_DATA 0x00000364UL +#define CKM_EXTRACT_KEY_FROM_KEY 0x00000365UL +#define CKM_SSL3_PRE_MASTER_KEY_GEN 0x00000370UL +#define CKM_SSL3_MASTER_KEY_DERIVE 0x00000371UL +#define CKM_SSL3_KEY_AND_MAC_DERIVE 0x00000372UL + +#define CKM_SSL3_MASTER_KEY_DERIVE_DH 0x00000373UL +#define CKM_TLS_PRE_MASTER_KEY_GEN 0x00000374UL +#define CKM_TLS_MASTER_KEY_DERIVE 0x00000375UL +#define CKM_TLS_KEY_AND_MAC_DERIVE 0x00000376UL +#define CKM_TLS_MASTER_KEY_DERIVE_DH 0x00000377UL + +#define CKM_TLS_PRF 0x00000378UL + +#define CKM_SSL3_MD5_MAC 0x00000380UL +#define CKM_SSL3_SHA1_MAC 0x00000381UL +#define CKM_MD5_KEY_DERIVATION 0x00000390UL +#define CKM_MD2_KEY_DERIVATION 0x00000391UL +#define CKM_SHA1_KEY_DERIVATION 0x00000392UL + +#define CKM_SHA256_KEY_DERIVATION 0x00000393UL +#define CKM_SHA384_KEY_DERIVATION 0x00000394UL +#define CKM_SHA512_KEY_DERIVATION 0x00000395UL +#define CKM_SHA224_KEY_DERIVATION 0x00000396UL +#define CKM_SHA3_256_KEY_DERIVE 0x00000397UL +#define CKM_SHA3_224_KEY_DERIVE 0x00000398UL +#define CKM_SHA3_384_KEY_DERIVE 0x00000399UL +#define CKM_SHA3_512_KEY_DERIVE 0x0000039AUL +#define CKM_SHAKE_128_KEY_DERIVE 0x0000039BUL +#define CKM_SHAKE_256_KEY_DERIVE 0x0000039CUL + +#define CKM_PBE_MD2_DES_CBC 0x000003A0UL +#define CKM_PBE_MD5_DES_CBC 0x000003A1UL +#define CKM_PBE_MD5_CAST_CBC 0x000003A2UL +#define CKM_PBE_MD5_CAST3_CBC 0x000003A3UL +#define CKM_PBE_MD5_CAST5_CBC 0x000003A4UL /* Deprecated */ +#define CKM_PBE_MD5_CAST128_CBC 0x000003A4UL +#define CKM_PBE_SHA1_CAST5_CBC 0x000003A5UL /* Deprecated */ +#define CKM_PBE_SHA1_CAST128_CBC 0x000003A5UL +#define CKM_PBE_SHA1_RC4_128 0x000003A6UL +#define CKM_PBE_SHA1_RC4_40 0x000003A7UL +#define CKM_PBE_SHA1_DES3_EDE_CBC 0x000003A8UL +#define CKM_PBE_SHA1_DES2_EDE_CBC 0x000003A9UL +#define CKM_PBE_SHA1_RC2_128_CBC 0x000003AAUL +#define CKM_PBE_SHA1_RC2_40_CBC 0x000003ABUL + +#define CKM_PKCS5_PBKD2 0x000003B0UL + +#define CKM_PBA_SHA1_WITH_SHA1_HMAC 0x000003C0UL + +#define CKM_WTLS_PRE_MASTER_KEY_GEN 0x000003D0UL +#define CKM_WTLS_MASTER_KEY_DERIVE 0x000003D1UL +#define CKM_WTLS_MASTER_KEY_DERIVE_DH_ECC 0x000003D2UL +#define CKM_WTLS_PRF 0x000003D3UL +#define CKM_WTLS_SERVER_KEY_AND_MAC_DERIVE 0x000003D4UL +#define CKM_WTLS_CLIENT_KEY_AND_MAC_DERIVE 0x000003D5UL + +#define CKM_TLS10_MAC_SERVER 0x000003D6UL +#define CKM_TLS10_MAC_CLIENT 0x000003D7UL +#define CKM_TLS12_MAC 0x000003D8UL +#define CKM_TLS12_KDF 0x000003D9UL +#define CKM_TLS12_MASTER_KEY_DERIVE 0x000003E0UL +#define CKM_TLS12_KEY_AND_MAC_DERIVE 0x000003E1UL +#define CKM_TLS12_MASTER_KEY_DERIVE_DH 0x000003E2UL +#define CKM_TLS12_KEY_SAFE_DERIVE 0x000003E3UL +#define CKM_TLS_MAC 0x000003E4UL +#define CKM_TLS_KDF 0x000003E5UL + +#define CKM_KEY_WRAP_LYNKS 0x00000400UL +#define CKM_KEY_WRAP_SET_OAEP 0x00000401UL + +#define CKM_CMS_SIG 0x00000500UL +#define CKM_KIP_DERIVE 0x00000510UL +#define CKM_KIP_WRAP 0x00000511UL +#define CKM_KIP_MAC 0x00000512UL + +#define CKM_CAMELLIA_KEY_GEN 0x00000550UL +#define CKM_CAMELLIA_ECB 0x00000551UL +#define CKM_CAMELLIA_CBC 0x00000552UL +#define CKM_CAMELLIA_MAC 0x00000553UL +#define CKM_CAMELLIA_MAC_GENERAL 0x00000554UL +#define CKM_CAMELLIA_CBC_PAD 0x00000555UL +#define CKM_CAMELLIA_ECB_ENCRYPT_DATA 0x00000556UL +#define CKM_CAMELLIA_CBC_ENCRYPT_DATA 0x00000557UL +#define CKM_CAMELLIA_CTR 0x00000558UL + +#define CKM_ARIA_KEY_GEN 0x00000560UL +#define CKM_ARIA_ECB 0x00000561UL +#define CKM_ARIA_CBC 0x00000562UL +#define CKM_ARIA_MAC 0x00000563UL +#define CKM_ARIA_MAC_GENERAL 0x00000564UL +#define CKM_ARIA_CBC_PAD 0x00000565UL +#define CKM_ARIA_ECB_ENCRYPT_DATA 0x00000566UL +#define CKM_ARIA_CBC_ENCRYPT_DATA 0x00000567UL + +#define CKM_SEED_KEY_GEN 0x00000650UL +#define CKM_SEED_ECB 0x00000651UL +#define CKM_SEED_CBC 0x00000652UL +#define CKM_SEED_MAC 0x00000653UL +#define CKM_SEED_MAC_GENERAL 0x00000654UL +#define CKM_SEED_CBC_PAD 0x00000655UL +#define CKM_SEED_ECB_ENCRYPT_DATA 0x00000656UL +#define CKM_SEED_CBC_ENCRYPT_DATA 0x00000657UL + +#define CKM_SKIPJACK_KEY_GEN 0x00001000UL +#define CKM_SKIPJACK_ECB64 0x00001001UL +#define CKM_SKIPJACK_CBC64 0x00001002UL +#define CKM_SKIPJACK_OFB64 0x00001003UL +#define CKM_SKIPJACK_CFB64 0x00001004UL +#define CKM_SKIPJACK_CFB32 0x00001005UL +#define CKM_SKIPJACK_CFB16 0x00001006UL +#define CKM_SKIPJACK_CFB8 0x00001007UL +#define CKM_SKIPJACK_WRAP 0x00001008UL +#define CKM_SKIPJACK_PRIVATE_WRAP 0x00001009UL +#define CKM_SKIPJACK_RELAYX 0x0000100aUL +#define CKM_KEA_KEY_PAIR_GEN 0x00001010UL +#define CKM_KEA_KEY_DERIVE 0x00001011UL +#define CKM_KEA_DERIVE 0x00001012UL +#define CKM_FORTEZZA_TIMESTAMP 0x00001020UL +#define CKM_BATON_KEY_GEN 0x00001030UL +#define CKM_BATON_ECB128 0x00001031UL +#define CKM_BATON_ECB96 0x00001032UL +#define CKM_BATON_CBC128 0x00001033UL +#define CKM_BATON_COUNTER 0x00001034UL +#define CKM_BATON_SHUFFLE 0x00001035UL +#define CKM_BATON_WRAP 0x00001036UL + +#define CKM_ECDSA_KEY_PAIR_GEN 0x00001040UL /* Deprecated */ +#define CKM_EC_KEY_PAIR_GEN 0x00001040UL + +#define CKM_ECDSA 0x00001041UL +#define CKM_ECDSA_SHA1 0x00001042UL +#define CKM_ECDSA_SHA224 0x00001043UL +#define CKM_ECDSA_SHA256 0x00001044UL +#define CKM_ECDSA_SHA384 0x00001045UL +#define CKM_ECDSA_SHA512 0x00001046UL + +#define CKM_ECDH1_DERIVE 0x00001050UL +#define CKM_ECDH1_COFACTOR_DERIVE 0x00001051UL +#define CKM_ECMQV_DERIVE 0x00001052UL + +#define CKM_ECDH_AES_KEY_WRAP 0x00001053UL +#define CKM_RSA_AES_KEY_WRAP 0x00001054UL + +#define CKM_JUNIPER_KEY_GEN 0x00001060UL +#define CKM_JUNIPER_ECB128 0x00001061UL +#define CKM_JUNIPER_CBC128 0x00001062UL +#define CKM_JUNIPER_COUNTER 0x00001063UL +#define CKM_JUNIPER_SHUFFLE 0x00001064UL +#define CKM_JUNIPER_WRAP 0x00001065UL +#define CKM_FASTHASH 0x00001070UL + +#define CKM_AES_XTS 0x00001071UL +#define CKM_AES_XTS_KEY_GEN 0x00001072UL +#define CKM_AES_KEY_GEN 0x00001080UL +#define CKM_AES_ECB 0x00001081UL +#define CKM_AES_CBC 0x00001082UL +#define CKM_AES_MAC 0x00001083UL +#define CKM_AES_MAC_GENERAL 0x00001084UL +#define CKM_AES_CBC_PAD 0x00001085UL +#define CKM_AES_CTR 0x00001086UL +#define CKM_AES_GCM 0x00001087UL +#define CKM_AES_CCM 0x00001088UL +#define CKM_AES_CTS 0x00001089UL +#define CKM_AES_CMAC 0x0000108AUL +#define CKM_AES_CMAC_GENERAL 0x0000108BUL + +#define CKM_AES_XCBC_MAC 0x0000108CUL +#define CKM_AES_XCBC_MAC_96 0x0000108DUL +#define CKM_AES_GMAC 0x0000108EUL + +#define CKM_BLOWFISH_KEY_GEN 0x00001090UL +#define CKM_BLOWFISH_CBC 0x00001091UL +#define CKM_TWOFISH_KEY_GEN 0x00001092UL +#define CKM_TWOFISH_CBC 0x00001093UL +#define CKM_BLOWFISH_CBC_PAD 0x00001094UL +#define CKM_TWOFISH_CBC_PAD 0x00001095UL + +#define CKM_DES_ECB_ENCRYPT_DATA 0x00001100UL +#define CKM_DES_CBC_ENCRYPT_DATA 0x00001101UL +#define CKM_DES3_ECB_ENCRYPT_DATA 0x00001102UL +#define CKM_DES3_CBC_ENCRYPT_DATA 0x00001103UL +#define CKM_AES_ECB_ENCRYPT_DATA 0x00001104UL +#define CKM_AES_CBC_ENCRYPT_DATA 0x00001105UL + +#define CKM_GOSTR3410_KEY_PAIR_GEN 0x00001200UL +#define CKM_GOSTR3410 0x00001201UL +#define CKM_GOSTR3410_WITH_GOSTR3411 0x00001202UL +#define CKM_GOSTR3410_KEY_WRAP 0x00001203UL +#define CKM_GOSTR3410_DERIVE 0x00001204UL +#define CKM_GOSTR3411 0x00001210UL +#define CKM_GOSTR3411_HMAC 0x00001211UL +#define CKM_GOST28147_KEY_GEN 0x00001220UL +#define CKM_GOST28147_ECB 0x00001221UL +#define CKM_GOST28147 0x00001222UL +#define CKM_GOST28147_MAC 0x00001223UL +#define CKM_GOST28147_KEY_WRAP 0x00001224UL +#define CKM_CHACHA20_KEY_GEN 0x00001225UL +#define CKM_CHACHA20 0x00001226UL +#define CKM_POLY1305_KEY_GEN 0x00001227UL +#define CKM_POLY1305 0x00001228UL +#define CKM_DSA_PARAMETER_GEN 0x00002000UL +#define CKM_DH_PKCS_PARAMETER_GEN 0x00002001UL +#define CKM_X9_42_DH_PARAMETER_GEN 0x00002002UL +#define CKM_DSA_PROBABLISTIC_PARAMETER_GEN 0x00002003UL +#define CKM_DSA_SHAWE_TAYLOR_PARAMETER_GEN 0x00002004UL + +#define CKM_AES_OFB 0x00002104UL +#define CKM_AES_CFB64 0x00002105UL +#define CKM_AES_CFB8 0x00002106UL +#define CKM_AES_CFB128 0x00002107UL + +#define CKM_AES_CFB1 0x00002108UL +#define CKM_AES_KEY_WRAP 0x00002109UL /* WAS: 0x00001090 */ +#define CKM_AES_KEY_WRAP_PAD 0x0000210AUL /* WAS: 0x00001091 */ +#define CKM_AES_KEY_WRAP_KWP 0x0000210BUL + +#define CKM_RSA_PKCS_TPM_1_1 0x00004001UL +#define CKM_RSA_PKCS_OAEP_TPM_1_1 0x00004002UL + +#define CKM_SHA_1_KEY_GEN 0x00004003UL +#define CKM_SHA224_KEY_GEN 0x00004004UL +#define CKM_SHA256_KEY_GEN 0x00004005UL +#define CKM_SHA384_KEY_GEN 0x00004006UL +#define CKM_SHA512_KEY_GEN 0x00004007UL +#define CKM_SHA512_224_KEY_GEN 0x00004008UL +#define CKM_SHA512_256_KEY_GEN 0x00004009UL +#define CKM_SHA512_T_KEY_GEN 0x0000400aUL +#define CKM_NULL 0x0000400bUL +#define CKM_BLAKE2B_160 0x0000400cUL +#define CKM_BLAKE2B_160_HMAC 0x0000400dUL +#define CKM_BLAKE2B_160_HMAC_GENERAL 0x0000400eUL +#define CKM_BLAKE2B_160_KEY_DERIVE 0x0000400fUL +#define CKM_BLAKE2B_160_KEY_GEN 0x00004010UL +#define CKM_BLAKE2B_256 0x00004011UL +#define CKM_BLAKE2B_256_HMAC 0x00004012UL +#define CKM_BLAKE2B_256_HMAC_GENERAL 0x00004013UL +#define CKM_BLAKE2B_256_KEY_DERIVE 0x00004014UL +#define CKM_BLAKE2B_256_KEY_GEN 0x00004015UL +#define CKM_BLAKE2B_384 0x00004016UL +#define CKM_BLAKE2B_384_HMAC 0x00004017UL +#define CKM_BLAKE2B_384_HMAC_GENERAL 0x00004018UL +#define CKM_BLAKE2B_384_KEY_DERIVE 0x00004019UL +#define CKM_BLAKE2B_384_KEY_GEN 0x0000401aUL +#define CKM_BLAKE2B_512 0x0000401bUL +#define CKM_BLAKE2B_512_HMAC 0x0000401cUL +#define CKM_BLAKE2B_512_HMAC_GENERAL 0x0000401dUL +#define CKM_BLAKE2B_512_KEY_DERIVE 0x0000401eUL +#define CKM_BLAKE2B_512_KEY_GEN 0x0000401fUL +#define CKM_SALSA20 0x00004020UL +#define CKM_CHACHA20_POLY1305 0x00004021UL +#define CKM_SALSA20_POLY1305 0x00004022UL +#define CKM_X3DH_INITIALIZE 0x00004023UL +#define CKM_X3DH_RESPOND 0x00004024UL +#define CKM_X2RATCHET_INITIALIZE 0x00004025UL +#define CKM_X2RATCHET_RESPOND 0x00004026UL +#define CKM_X2RATCHET_ENCRYPT 0x00004027UL +#define CKM_X2RATCHET_DECRYPT 0x00004028UL +#define CKM_XEDDSA 0x00004029UL +#define CKM_HKDF_DERIVE 0x0000402aUL +#define CKM_HKDF_DATA 0x0000402bUL +#define CKM_HKDF_KEY_GEN 0x0000402cUL + +#define CKM_ECDSA_SHA3_224 0x00001047UL +#define CKM_ECDSA_SHA3_256 0x00001048UL +#define CKM_ECDSA_SHA3_384 0x00001049UL +#define CKM_ECDSA_SHA3_512 0x0000104aUL +#define CKM_EC_EDWARDS_KEY_PAIR_GEN 0x00001055UL +#define CKM_EC_MONTGOMERY_KEY_PAIR_GEN 0x00001056UL +#define CKM_EDDSA 0x00001057UL +#define CKM_SP800_108_COUNTER_KDF 0x000003acUL +#define CKM_SP800_108_FEEDBACK_KDF 0x000003adUL +#define CKM_SP800_108_DOUBLE_PIPELINE_KDF 0x000003aeUL + +#define CKM_VENDOR_DEFINED 0x80000000UL + +typedef CK_MECHANISM_TYPE CK_PTR CK_MECHANISM_TYPE_PTR; + + +/* CK_MECHANISM is a structure that specifies a particular + * mechanism + */ +typedef struct CK_MECHANISM { + CK_MECHANISM_TYPE mechanism; + CK_VOID_PTR pParameter; + CK_ULONG ulParameterLen; /* in bytes */ +} CK_MECHANISM; + +typedef CK_MECHANISM CK_PTR CK_MECHANISM_PTR; + + +/* CK_MECHANISM_INFO provides information about a particular + * mechanism + */ +typedef struct CK_MECHANISM_INFO { + CK_ULONG ulMinKeySize; + CK_ULONG ulMaxKeySize; + CK_FLAGS flags; +} CK_MECHANISM_INFO; + +/* The flags are defined as follows: + * Bit Flag Mask Meaning */ +#define CKF_HW 0x00000001UL /* performed by HW */ + +/* Specify whether or not a mechanism can be used for a particular task */ +#define CKF_MESSAGE_ENCRYPT 0x00000002UL +#define CKF_MESSAGE_DECRYPT 0x00000004UL +#define CKF_MESSAGE_SIGN 0x00000008UL +#define CKF_MESSAGE_VERIFY 0x00000010UL +#define CKF_MULTI_MESSGE 0x00000020UL +#define CKF_FIND_OBJECTS 0x00000040UL + +#define CKF_ENCRYPT 0x00000100UL +#define CKF_DECRYPT 0x00000200UL +#define CKF_DIGEST 0x00000400UL +#define CKF_SIGN 0x00000800UL +#define CKF_SIGN_RECOVER 0x00001000UL +#define CKF_VERIFY 0x00002000UL +#define CKF_VERIFY_RECOVER 0x00004000UL +#define CKF_GENERATE 0x00008000UL +#define CKF_GENERATE_KEY_PAIR 0x00010000UL +#define CKF_WRAP 0x00020000UL +#define CKF_UNWRAP 0x00040000UL +#define CKF_DERIVE 0x00080000UL + +/* Describe a token's EC capabilities not available in mechanism + * information. + */ +#define CKF_EC_F_P 0x00100000UL +#define CKF_EC_F_2M 0x00200000UL +#define CKF_EC_ECPARAMETERS 0x00400000UL +#define CKF_EC_OID 0x00800000UL +#define CKF_EC_NAMEDCURVE CKF_EC_OID /* deprecated since PKCS#11 3.00 */ +#define CKF_EC_UNCOMPRESS 0x01000000UL +#define CKF_EC_COMPRESS 0x02000000UL +#define CKF_EC_CURVENAME 0x04000000UL + +#define CKF_EXTENSION 0x80000000UL + +typedef CK_MECHANISM_INFO CK_PTR CK_MECHANISM_INFO_PTR; + +/* CK_RV is a value that identifies the return value of a + * Cryptoki function + */ +typedef CK_ULONG CK_RV; + +#define CKR_OK 0x00000000UL +#define CKR_CANCEL 0x00000001UL +#define CKR_HOST_MEMORY 0x00000002UL +#define CKR_SLOT_ID_INVALID 0x00000003UL + +#define CKR_GENERAL_ERROR 0x00000005UL +#define CKR_FUNCTION_FAILED 0x00000006UL + +#define CKR_ARGUMENTS_BAD 0x00000007UL +#define CKR_NO_EVENT 0x00000008UL +#define CKR_NEED_TO_CREATE_THREADS 0x00000009UL +#define CKR_CANT_LOCK 0x0000000AUL + +#define CKR_ATTRIBUTE_READ_ONLY 0x00000010UL +#define CKR_ATTRIBUTE_SENSITIVE 0x00000011UL +#define CKR_ATTRIBUTE_TYPE_INVALID 0x00000012UL +#define CKR_ATTRIBUTE_VALUE_INVALID 0x00000013UL + +#define CKR_ACTION_PROHIBITED 0x0000001BUL + +#define CKR_DATA_INVALID 0x00000020UL +#define CKR_DATA_LEN_RANGE 0x00000021UL +#define CKR_DEVICE_ERROR 0x00000030UL +#define CKR_DEVICE_MEMORY 0x00000031UL +#define CKR_DEVICE_REMOVED 0x00000032UL +#define CKR_ENCRYPTED_DATA_INVALID 0x00000040UL +#define CKR_ENCRYPTED_DATA_LEN_RANGE 0x00000041UL +#define CKR_AEAD_DECRYPT_FAILED 0x00000042UL +#define CKR_FUNCTION_CANCELED 0x00000050UL +#define CKR_FUNCTION_NOT_PARALLEL 0x00000051UL + +#define CKR_FUNCTION_NOT_SUPPORTED 0x00000054UL + +#define CKR_KEY_HANDLE_INVALID 0x00000060UL + +#define CKR_KEY_SIZE_RANGE 0x00000062UL +#define CKR_KEY_TYPE_INCONSISTENT 0x00000063UL + +#define CKR_KEY_NOT_NEEDED 0x00000064UL +#define CKR_KEY_CHANGED 0x00000065UL +#define CKR_KEY_NEEDED 0x00000066UL +#define CKR_KEY_INDIGESTIBLE 0x00000067UL +#define CKR_KEY_FUNCTION_NOT_PERMITTED 0x00000068UL +#define CKR_KEY_NOT_WRAPPABLE 0x00000069UL +#define CKR_KEY_UNEXTRACTABLE 0x0000006AUL + +#define CKR_MECHANISM_INVALID 0x00000070UL +#define CKR_MECHANISM_PARAM_INVALID 0x00000071UL + +#define CKR_OBJECT_HANDLE_INVALID 0x00000082UL +#define CKR_OPERATION_ACTIVE 0x00000090UL +#define CKR_OPERATION_NOT_INITIALIZED 0x00000091UL +#define CKR_PIN_INCORRECT 0x000000A0UL +#define CKR_PIN_INVALID 0x000000A1UL +#define CKR_PIN_LEN_RANGE 0x000000A2UL + +#define CKR_PIN_EXPIRED 0x000000A3UL +#define CKR_PIN_LOCKED 0x000000A4UL + +#define CKR_SESSION_CLOSED 0x000000B0UL +#define CKR_SESSION_COUNT 0x000000B1UL +#define CKR_SESSION_HANDLE_INVALID 0x000000B3UL +#define CKR_SESSION_PARALLEL_NOT_SUPPORTED 0x000000B4UL +#define CKR_SESSION_READ_ONLY 0x000000B5UL +#define CKR_SESSION_EXISTS 0x000000B6UL + +#define CKR_SESSION_READ_ONLY_EXISTS 0x000000B7UL +#define CKR_SESSION_READ_WRITE_SO_EXISTS 0x000000B8UL + +#define CKR_SIGNATURE_INVALID 0x000000C0UL +#define CKR_SIGNATURE_LEN_RANGE 0x000000C1UL +#define CKR_TEMPLATE_INCOMPLETE 0x000000D0UL +#define CKR_TEMPLATE_INCONSISTENT 0x000000D1UL +#define CKR_TOKEN_NOT_PRESENT 0x000000E0UL +#define CKR_TOKEN_NOT_RECOGNIZED 0x000000E1UL +#define CKR_TOKEN_WRITE_PROTECTED 0x000000E2UL +#define CKR_UNWRAPPING_KEY_HANDLE_INVALID 0x000000F0UL +#define CKR_UNWRAPPING_KEY_SIZE_RANGE 0x000000F1UL +#define CKR_UNWRAPPING_KEY_TYPE_INCONSISTENT 0x000000F2UL +#define CKR_USER_ALREADY_LOGGED_IN 0x00000100UL +#define CKR_USER_NOT_LOGGED_IN 0x00000101UL +#define CKR_USER_PIN_NOT_INITIALIZED 0x00000102UL +#define CKR_USER_TYPE_INVALID 0x00000103UL + +#define CKR_USER_ANOTHER_ALREADY_LOGGED_IN 0x00000104UL +#define CKR_USER_TOO_MANY_TYPES 0x00000105UL + +#define CKR_WRAPPED_KEY_INVALID 0x00000110UL +#define CKR_WRAPPED_KEY_LEN_RANGE 0x00000112UL +#define CKR_WRAPPING_KEY_HANDLE_INVALID 0x00000113UL +#define CKR_WRAPPING_KEY_SIZE_RANGE 0x00000114UL +#define CKR_WRAPPING_KEY_TYPE_INCONSISTENT 0x00000115UL +#define CKR_RANDOM_SEED_NOT_SUPPORTED 0x00000120UL + +#define CKR_RANDOM_NO_RNG 0x00000121UL + +#define CKR_DOMAIN_PARAMS_INVALID 0x00000130UL + +#define CKR_CURVE_NOT_SUPPORTED 0x00000140UL + +#define CKR_BUFFER_TOO_SMALL 0x00000150UL +#define CKR_SAVED_STATE_INVALID 0x00000160UL +#define CKR_INFORMATION_SENSITIVE 0x00000170UL +#define CKR_STATE_UNSAVEABLE 0x00000180UL + +#define CKR_CRYPTOKI_NOT_INITIALIZED 0x00000190UL +#define CKR_CRYPTOKI_ALREADY_INITIALIZED 0x00000191UL +#define CKR_MUTEX_BAD 0x000001A0UL +#define CKR_MUTEX_NOT_LOCKED 0x000001A1UL + +#define CKR_NEW_PIN_MODE 0x000001B0UL +#define CKR_NEXT_OTP 0x000001B1UL + +#define CKR_EXCEEDED_MAX_ITERATIONS 0x000001B5UL +#define CKR_FIPS_SELF_TEST_FAILED 0x000001B6UL +#define CKR_LIBRARY_LOAD_FAILED 0x000001B7UL +#define CKR_PIN_TOO_WEAK 0x000001B8UL +#define CKR_PUBLIC_KEY_INVALID 0x000001B9UL + +#define CKR_FUNCTION_REJECTED 0x00000200UL +#define CKR_TOKEN_RESOURCE_EXCEEDED 0x00000201UL + +#define CKR_VENDOR_DEFINED 0x80000000UL + + +/* CK_NOTIFY is an application callback that processes events */ +typedef CK_CALLBACK_FUNCTION(CK_RV, CK_NOTIFY)( + CK_SESSION_HANDLE hSession, /* the session's handle */ + CK_NOTIFICATION event, + CK_VOID_PTR pApplication /* passed to C_OpenSession */ +); + + +/* CK_FUNCTION_LIST is a structure holding a Cryptoki spec + * version and pointers of appropriate types to all the + * Cryptoki functions + */ +typedef struct CK_FUNCTION_LIST CK_FUNCTION_LIST; +typedef struct CK_FUNCTION_LIST_3_0 CK_FUNCTION_LIST_3_0; + +typedef CK_FUNCTION_LIST CK_PTR CK_FUNCTION_LIST_PTR; +typedef CK_FUNCTION_LIST_3_0 CK_PTR CK_FUNCTION_LIST_3_0_PTR; + +typedef CK_FUNCTION_LIST_PTR CK_PTR CK_FUNCTION_LIST_PTR_PTR; +typedef CK_FUNCTION_LIST_3_0_PTR CK_PTR CK_FUNCTION_LIST_3_0_PTR_PTR; + +typedef struct CK_INTERFACE { + CK_CHAR *pInterfaceName; + CK_VOID_PTR pFunctionList; + CK_FLAGS flags; +} CK_INTERFACE; + +typedef CK_INTERFACE CK_PTR CK_INTERFACE_PTR; +typedef CK_INTERFACE_PTR CK_PTR CK_INTERFACE_PTR_PTR; + +#define CKF_END_OF_MESSAGE 0x00000001UL + + +/* CK_CREATEMUTEX is an application callback for creating a + * mutex object + */ +typedef CK_CALLBACK_FUNCTION(CK_RV, CK_CREATEMUTEX)( + CK_VOID_PTR_PTR ppMutex /* location to receive ptr to mutex */ +); + + +/* CK_DESTROYMUTEX is an application callback for destroying a + * mutex object + */ +typedef CK_CALLBACK_FUNCTION(CK_RV, CK_DESTROYMUTEX)( + CK_VOID_PTR pMutex /* pointer to mutex */ +); + + +/* CK_LOCKMUTEX is an application callback for locking a mutex */ +typedef CK_CALLBACK_FUNCTION(CK_RV, CK_LOCKMUTEX)( + CK_VOID_PTR pMutex /* pointer to mutex */ +); + + +/* CK_UNLOCKMUTEX is an application callback for unlocking a + * mutex + */ +typedef CK_CALLBACK_FUNCTION(CK_RV, CK_UNLOCKMUTEX)( + CK_VOID_PTR pMutex /* pointer to mutex */ +); + +/* Get functionlist flags */ +#define CKF_INTERFACE_FORK_SAFE 0x00000001UL + +/* CK_C_INITIALIZE_ARGS provides the optional arguments to + * C_Initialize + */ +typedef struct CK_C_INITIALIZE_ARGS { + CK_CREATEMUTEX CreateMutex; + CK_DESTROYMUTEX DestroyMutex; + CK_LOCKMUTEX LockMutex; + CK_UNLOCKMUTEX UnlockMutex; + CK_FLAGS flags; + CK_VOID_PTR pReserved; +} CK_C_INITIALIZE_ARGS; + +/* flags: bit flags that provide capabilities of the slot + * Bit Flag Mask Meaning + */ +#define CKF_LIBRARY_CANT_CREATE_OS_THREADS 0x00000001UL +#define CKF_OS_LOCKING_OK 0x00000002UL + +typedef CK_C_INITIALIZE_ARGS CK_PTR CK_C_INITIALIZE_ARGS_PTR; + + + +/* additional flags for parameters to functions */ + +/* CKF_DONT_BLOCK is for the function C_WaitForSlotEvent */ +#define CKF_DONT_BLOCK 1 + +/* CK_RSA_PKCS_MGF_TYPE is used to indicate the Message + * Generation Function (MGF) applied to a message block when + * formatting a message block for the PKCS #1 OAEP encryption + * scheme. + */ +typedef CK_ULONG CK_RSA_PKCS_MGF_TYPE; + +typedef CK_RSA_PKCS_MGF_TYPE CK_PTR CK_RSA_PKCS_MGF_TYPE_PTR; + +/* The following MGFs are defined */ +#define CKG_MGF1_SHA1 0x00000001UL +#define CKG_MGF1_SHA256 0x00000002UL +#define CKG_MGF1_SHA384 0x00000003UL +#define CKG_MGF1_SHA512 0x00000004UL +#define CKG_MGF1_SHA224 0x00000005UL + +/* CK_RSA_PKCS_OAEP_SOURCE_TYPE is used to indicate the source + * of the encoding parameter when formatting a message block + * for the PKCS #1 OAEP encryption scheme. + */ +typedef CK_ULONG CK_RSA_PKCS_OAEP_SOURCE_TYPE; + +typedef CK_RSA_PKCS_OAEP_SOURCE_TYPE CK_PTR CK_RSA_PKCS_OAEP_SOURCE_TYPE_PTR; + +/* The following encoding parameter sources are defined */ +#define CKZ_DATA_SPECIFIED 0x00000001UL + +/* CK_RSA_PKCS_OAEP_PARAMS provides the parameters to the + * CKM_RSA_PKCS_OAEP mechanism. + */ +typedef struct CK_RSA_PKCS_OAEP_PARAMS { + CK_MECHANISM_TYPE hashAlg; + CK_RSA_PKCS_MGF_TYPE mgf; + CK_RSA_PKCS_OAEP_SOURCE_TYPE source; + CK_VOID_PTR pSourceData; + CK_ULONG ulSourceDataLen; +} CK_RSA_PKCS_OAEP_PARAMS; + +typedef CK_RSA_PKCS_OAEP_PARAMS CK_PTR CK_RSA_PKCS_OAEP_PARAMS_PTR; + +/* CK_RSA_PKCS_PSS_PARAMS provides the parameters to the + * CKM_RSA_PKCS_PSS mechanism(s). + */ +typedef struct CK_RSA_PKCS_PSS_PARAMS { + CK_MECHANISM_TYPE hashAlg; + CK_RSA_PKCS_MGF_TYPE mgf; + CK_ULONG sLen; +} CK_RSA_PKCS_PSS_PARAMS; + +typedef CK_RSA_PKCS_PSS_PARAMS CK_PTR CK_RSA_PKCS_PSS_PARAMS_PTR; + +typedef CK_ULONG CK_EC_KDF_TYPE; + +/* The following EC Key Derivation Functions are defined */ +#define CKD_NULL 0x00000001UL +#define CKD_SHA1_KDF 0x00000002UL + +/* The following X9.42 DH key derivation functions are defined */ +#define CKD_SHA1_KDF_ASN1 0x00000003UL +#define CKD_SHA1_KDF_CONCATENATE 0x00000004UL +#define CKD_SHA224_KDF 0x00000005UL +#define CKD_SHA256_KDF 0x00000006UL +#define CKD_SHA384_KDF 0x00000007UL +#define CKD_SHA512_KDF 0x00000008UL +#define CKD_CPDIVERSIFY_KDF 0x00000009UL +#define CKD_SHA3_224_KDF 0x0000000AUL +#define CKD_SHA3_256_KDF 0x0000000BUL +#define CKD_SHA3_384_KDF 0x0000000CUL +#define CKD_SHA3_512_KDF 0x0000000DUL +#define CKD_SHA1_KDF_SP800 0x0000000EUL +#define CKD_SHA224_KDF_SP800 0x0000000FUL +#define CKD_SHA256_KDF_SP800 0x00000010UL +#define CKD_SHA384_KDF_SP800 0x00000011UL +#define CKD_SHA512_KDF_SP800 0x00000012UL +#define CKD_SHA3_224_KDF_SP800 0x00000013UL +#define CKD_SHA3_256_KDF_SP800 0x00000014UL +#define CKD_SHA3_384_KDF_SP800 0x00000015UL +#define CKD_SHA3_512_KDF_SP800 0x00000016UL +#define CKD_BLAKE2B_160_KDF 0x00000017UL +#define CKD_BLAKE2B_256_KDF 0x00000018UL +#define CKD_BLAKE2B_384_KDF 0x00000019UL +#define CKD_BLAKE2B_512_KDF 0x0000001aUL + +/* CK_ECDH1_DERIVE_PARAMS provides the parameters to the + * CKM_ECDH1_DERIVE and CKM_ECDH1_COFACTOR_DERIVE mechanisms, + * where each party contributes one key pair. + */ +typedef struct CK_ECDH1_DERIVE_PARAMS { + CK_EC_KDF_TYPE kdf; + CK_ULONG ulSharedDataLen; + CK_BYTE_PTR pSharedData; + CK_ULONG ulPublicDataLen; + CK_BYTE_PTR pPublicData; +} CK_ECDH1_DERIVE_PARAMS; + +typedef CK_ECDH1_DERIVE_PARAMS CK_PTR CK_ECDH1_DERIVE_PARAMS_PTR; + +/* + * CK_ECDH2_DERIVE_PARAMS provides the parameters to the + * CKM_ECMQV_DERIVE mechanism, where each party contributes two key pairs. + */ +typedef struct CK_ECDH2_DERIVE_PARAMS { + CK_EC_KDF_TYPE kdf; + CK_ULONG ulSharedDataLen; + CK_BYTE_PTR pSharedData; + CK_ULONG ulPublicDataLen; + CK_BYTE_PTR pPublicData; + CK_ULONG ulPrivateDataLen; + CK_OBJECT_HANDLE hPrivateData; + CK_ULONG ulPublicDataLen2; + CK_BYTE_PTR pPublicData2; +} CK_ECDH2_DERIVE_PARAMS; + +typedef CK_ECDH2_DERIVE_PARAMS CK_PTR CK_ECDH2_DERIVE_PARAMS_PTR; + +typedef struct CK_ECMQV_DERIVE_PARAMS { + CK_EC_KDF_TYPE kdf; + CK_ULONG ulSharedDataLen; + CK_BYTE_PTR pSharedData; + CK_ULONG ulPublicDataLen; + CK_BYTE_PTR pPublicData; + CK_ULONG ulPrivateDataLen; + CK_OBJECT_HANDLE hPrivateData; + CK_ULONG ulPublicDataLen2; + CK_BYTE_PTR pPublicData2; + CK_OBJECT_HANDLE publicKey; +} CK_ECMQV_DERIVE_PARAMS; + +typedef CK_ECMQV_DERIVE_PARAMS CK_PTR CK_ECMQV_DERIVE_PARAMS_PTR; + +/* Typedefs and defines for the CKM_X9_42_DH_KEY_PAIR_GEN and the + * CKM_X9_42_DH_PARAMETER_GEN mechanisms + */ +typedef CK_ULONG CK_X9_42_DH_KDF_TYPE; +typedef CK_X9_42_DH_KDF_TYPE CK_PTR CK_X9_42_DH_KDF_TYPE_PTR; + +/* CK_X9_42_DH1_DERIVE_PARAMS provides the parameters to the + * CKM_X9_42_DH_DERIVE key derivation mechanism, where each party + * contributes one key pair + */ +typedef struct CK_X9_42_DH1_DERIVE_PARAMS { + CK_X9_42_DH_KDF_TYPE kdf; + CK_ULONG ulOtherInfoLen; + CK_BYTE_PTR pOtherInfo; + CK_ULONG ulPublicDataLen; + CK_BYTE_PTR pPublicData; +} CK_X9_42_DH1_DERIVE_PARAMS; + +typedef struct CK_X9_42_DH1_DERIVE_PARAMS CK_PTR CK_X9_42_DH1_DERIVE_PARAMS_PTR; + +/* CK_X9_42_DH2_DERIVE_PARAMS provides the parameters to the + * CKM_X9_42_DH_HYBRID_DERIVE and CKM_X9_42_MQV_DERIVE key derivation + * mechanisms, where each party contributes two key pairs + */ +typedef struct CK_X9_42_DH2_DERIVE_PARAMS { + CK_X9_42_DH_KDF_TYPE kdf; + CK_ULONG ulOtherInfoLen; + CK_BYTE_PTR pOtherInfo; + CK_ULONG ulPublicDataLen; + CK_BYTE_PTR pPublicData; + CK_ULONG ulPrivateDataLen; + CK_OBJECT_HANDLE hPrivateData; + CK_ULONG ulPublicDataLen2; + CK_BYTE_PTR pPublicData2; +} CK_X9_42_DH2_DERIVE_PARAMS; + +typedef CK_X9_42_DH2_DERIVE_PARAMS CK_PTR CK_X9_42_DH2_DERIVE_PARAMS_PTR; + +typedef struct CK_X9_42_MQV_DERIVE_PARAMS { + CK_X9_42_DH_KDF_TYPE kdf; + CK_ULONG ulOtherInfoLen; + CK_BYTE_PTR pOtherInfo; + CK_ULONG ulPublicDataLen; + CK_BYTE_PTR pPublicData; + CK_ULONG ulPrivateDataLen; + CK_OBJECT_HANDLE hPrivateData; + CK_ULONG ulPublicDataLen2; + CK_BYTE_PTR pPublicData2; + CK_OBJECT_HANDLE publicKey; +} CK_X9_42_MQV_DERIVE_PARAMS; + +typedef CK_X9_42_MQV_DERIVE_PARAMS CK_PTR CK_X9_42_MQV_DERIVE_PARAMS_PTR; + +/* CK_KEA_DERIVE_PARAMS provides the parameters to the + * CKM_KEA_DERIVE mechanism + */ +typedef struct CK_KEA_DERIVE_PARAMS { + CK_BBOOL isSender; + CK_ULONG ulRandomLen; + CK_BYTE_PTR pRandomA; + CK_BYTE_PTR pRandomB; + CK_ULONG ulPublicDataLen; + CK_BYTE_PTR pPublicData; +} CK_KEA_DERIVE_PARAMS; + +typedef CK_KEA_DERIVE_PARAMS CK_PTR CK_KEA_DERIVE_PARAMS_PTR; + + +/* CK_RC2_PARAMS provides the parameters to the CKM_RC2_ECB and + * CKM_RC2_MAC mechanisms. An instance of CK_RC2_PARAMS just + * holds the effective keysize + */ +typedef CK_ULONG CK_RC2_PARAMS; + +typedef CK_RC2_PARAMS CK_PTR CK_RC2_PARAMS_PTR; + + +/* CK_RC2_CBC_PARAMS provides the parameters to the CKM_RC2_CBC + * mechanism + */ +typedef struct CK_RC2_CBC_PARAMS { + CK_ULONG ulEffectiveBits; /* effective bits (1-1024) */ + CK_BYTE iv[8]; /* IV for CBC mode */ +} CK_RC2_CBC_PARAMS; + +typedef CK_RC2_CBC_PARAMS CK_PTR CK_RC2_CBC_PARAMS_PTR; + + +/* CK_RC2_MAC_GENERAL_PARAMS provides the parameters for the + * CKM_RC2_MAC_GENERAL mechanism + */ +typedef struct CK_RC2_MAC_GENERAL_PARAMS { + CK_ULONG ulEffectiveBits; /* effective bits (1-1024) */ + CK_ULONG ulMacLength; /* Length of MAC in bytes */ +} CK_RC2_MAC_GENERAL_PARAMS; + +typedef CK_RC2_MAC_GENERAL_PARAMS CK_PTR \ + CK_RC2_MAC_GENERAL_PARAMS_PTR; + + +/* CK_RC5_PARAMS provides the parameters to the CKM_RC5_ECB and + * CKM_RC5_MAC mechanisms + */ +typedef struct CK_RC5_PARAMS { + CK_ULONG ulWordsize; /* wordsize in bits */ + CK_ULONG ulRounds; /* number of rounds */ +} CK_RC5_PARAMS; + +typedef CK_RC5_PARAMS CK_PTR CK_RC5_PARAMS_PTR; + + +/* CK_RC5_CBC_PARAMS provides the parameters to the CKM_RC5_CBC + * mechanism + */ +typedef struct CK_RC5_CBC_PARAMS { + CK_ULONG ulWordsize; /* wordsize in bits */ + CK_ULONG ulRounds; /* number of rounds */ + CK_BYTE_PTR pIv; /* pointer to IV */ + CK_ULONG ulIvLen; /* length of IV in bytes */ +} CK_RC5_CBC_PARAMS; + +typedef CK_RC5_CBC_PARAMS CK_PTR CK_RC5_CBC_PARAMS_PTR; + + +/* CK_RC5_MAC_GENERAL_PARAMS provides the parameters for the + * CKM_RC5_MAC_GENERAL mechanism + */ +typedef struct CK_RC5_MAC_GENERAL_PARAMS { + CK_ULONG ulWordsize; /* wordsize in bits */ + CK_ULONG ulRounds; /* number of rounds */ + CK_ULONG ulMacLength; /* Length of MAC in bytes */ +} CK_RC5_MAC_GENERAL_PARAMS; + +typedef CK_RC5_MAC_GENERAL_PARAMS CK_PTR \ + CK_RC5_MAC_GENERAL_PARAMS_PTR; + +/* CK_MAC_GENERAL_PARAMS provides the parameters to most block + * ciphers' MAC_GENERAL mechanisms. Its value is the length of + * the MAC + */ +typedef CK_ULONG CK_MAC_GENERAL_PARAMS; + +typedef CK_MAC_GENERAL_PARAMS CK_PTR CK_MAC_GENERAL_PARAMS_PTR; + +typedef struct CK_DES_CBC_ENCRYPT_DATA_PARAMS { + CK_BYTE iv[8]; + CK_BYTE_PTR pData; + CK_ULONG length; +} CK_DES_CBC_ENCRYPT_DATA_PARAMS; + +typedef CK_DES_CBC_ENCRYPT_DATA_PARAMS CK_PTR CK_DES_CBC_ENCRYPT_DATA_PARAMS_PTR; + +typedef struct CK_AES_CBC_ENCRYPT_DATA_PARAMS { + CK_BYTE iv[16]; + CK_BYTE_PTR pData; + CK_ULONG length; +} CK_AES_CBC_ENCRYPT_DATA_PARAMS; + +typedef CK_AES_CBC_ENCRYPT_DATA_PARAMS CK_PTR CK_AES_CBC_ENCRYPT_DATA_PARAMS_PTR; + +/* CK_SKIPJACK_PRIVATE_WRAP_PARAMS provides the parameters to the + * CKM_SKIPJACK_PRIVATE_WRAP mechanism + */ +typedef struct CK_SKIPJACK_PRIVATE_WRAP_PARAMS { + CK_ULONG ulPasswordLen; + CK_BYTE_PTR pPassword; + CK_ULONG ulPublicDataLen; + CK_BYTE_PTR pPublicData; + CK_ULONG ulPAndGLen; + CK_ULONG ulQLen; + CK_ULONG ulRandomLen; + CK_BYTE_PTR pRandomA; + CK_BYTE_PTR pPrimeP; + CK_BYTE_PTR pBaseG; + CK_BYTE_PTR pSubprimeQ; +} CK_SKIPJACK_PRIVATE_WRAP_PARAMS; + +typedef CK_SKIPJACK_PRIVATE_WRAP_PARAMS CK_PTR \ + CK_SKIPJACK_PRIVATE_WRAP_PARAMS_PTR; + + +/* CK_SKIPJACK_RELAYX_PARAMS provides the parameters to the + * CKM_SKIPJACK_RELAYX mechanism + */ +typedef struct CK_SKIPJACK_RELAYX_PARAMS { + CK_ULONG ulOldWrappedXLen; + CK_BYTE_PTR pOldWrappedX; + CK_ULONG ulOldPasswordLen; + CK_BYTE_PTR pOldPassword; + CK_ULONG ulOldPublicDataLen; + CK_BYTE_PTR pOldPublicData; + CK_ULONG ulOldRandomLen; + CK_BYTE_PTR pOldRandomA; + CK_ULONG ulNewPasswordLen; + CK_BYTE_PTR pNewPassword; + CK_ULONG ulNewPublicDataLen; + CK_BYTE_PTR pNewPublicData; + CK_ULONG ulNewRandomLen; + CK_BYTE_PTR pNewRandomA; +} CK_SKIPJACK_RELAYX_PARAMS; + +typedef CK_SKIPJACK_RELAYX_PARAMS CK_PTR \ + CK_SKIPJACK_RELAYX_PARAMS_PTR; + + +typedef struct CK_PBE_PARAMS { + CK_BYTE_PTR pInitVector; + CK_UTF8CHAR_PTR pPassword; + CK_ULONG ulPasswordLen; + CK_BYTE_PTR pSalt; + CK_ULONG ulSaltLen; + CK_ULONG ulIteration; +} CK_PBE_PARAMS; + +typedef CK_PBE_PARAMS CK_PTR CK_PBE_PARAMS_PTR; + + +/* CK_KEY_WRAP_SET_OAEP_PARAMS provides the parameters to the + * CKM_KEY_WRAP_SET_OAEP mechanism + */ +typedef struct CK_KEY_WRAP_SET_OAEP_PARAMS { + CK_BYTE bBC; /* block contents byte */ + CK_BYTE_PTR pX; /* extra data */ + CK_ULONG ulXLen; /* length of extra data in bytes */ +} CK_KEY_WRAP_SET_OAEP_PARAMS; + +typedef CK_KEY_WRAP_SET_OAEP_PARAMS CK_PTR CK_KEY_WRAP_SET_OAEP_PARAMS_PTR; + +typedef struct CK_SSL3_RANDOM_DATA { + CK_BYTE_PTR pClientRandom; + CK_ULONG ulClientRandomLen; + CK_BYTE_PTR pServerRandom; + CK_ULONG ulServerRandomLen; +} CK_SSL3_RANDOM_DATA; + + +typedef struct CK_SSL3_MASTER_KEY_DERIVE_PARAMS { + CK_SSL3_RANDOM_DATA RandomInfo; + CK_VERSION_PTR pVersion; +} CK_SSL3_MASTER_KEY_DERIVE_PARAMS; + +typedef struct CK_SSL3_MASTER_KEY_DERIVE_PARAMS CK_PTR \ + CK_SSL3_MASTER_KEY_DERIVE_PARAMS_PTR; + +typedef struct CK_SSL3_KEY_MAT_OUT { + CK_OBJECT_HANDLE hClientMacSecret; + CK_OBJECT_HANDLE hServerMacSecret; + CK_OBJECT_HANDLE hClientKey; + CK_OBJECT_HANDLE hServerKey; + CK_BYTE_PTR pIVClient; + CK_BYTE_PTR pIVServer; +} CK_SSL3_KEY_MAT_OUT; + +typedef CK_SSL3_KEY_MAT_OUT CK_PTR CK_SSL3_KEY_MAT_OUT_PTR; + + +typedef struct CK_SSL3_KEY_MAT_PARAMS { + CK_ULONG ulMacSizeInBits; + CK_ULONG ulKeySizeInBits; + CK_ULONG ulIVSizeInBits; + CK_BBOOL bIsExport; + CK_SSL3_RANDOM_DATA RandomInfo; + CK_SSL3_KEY_MAT_OUT_PTR pReturnedKeyMaterial; +} CK_SSL3_KEY_MAT_PARAMS; + +typedef CK_SSL3_KEY_MAT_PARAMS CK_PTR CK_SSL3_KEY_MAT_PARAMS_PTR; + +typedef struct CK_TLS_PRF_PARAMS { + CK_BYTE_PTR pSeed; + CK_ULONG ulSeedLen; + CK_BYTE_PTR pLabel; + CK_ULONG ulLabelLen; + CK_BYTE_PTR pOutput; + CK_ULONG_PTR pulOutputLen; +} CK_TLS_PRF_PARAMS; + +typedef CK_TLS_PRF_PARAMS CK_PTR CK_TLS_PRF_PARAMS_PTR; + +typedef struct CK_WTLS_RANDOM_DATA { + CK_BYTE_PTR pClientRandom; + CK_ULONG ulClientRandomLen; + CK_BYTE_PTR pServerRandom; + CK_ULONG ulServerRandomLen; +} CK_WTLS_RANDOM_DATA; + +typedef CK_WTLS_RANDOM_DATA CK_PTR CK_WTLS_RANDOM_DATA_PTR; + +typedef struct CK_WTLS_MASTER_KEY_DERIVE_PARAMS { + CK_MECHANISM_TYPE DigestMechanism; + CK_WTLS_RANDOM_DATA RandomInfo; + CK_BYTE_PTR pVersion; +} CK_WTLS_MASTER_KEY_DERIVE_PARAMS; + +typedef CK_WTLS_MASTER_KEY_DERIVE_PARAMS CK_PTR \ + CK_WTLS_MASTER_KEY_DERIVE_PARAMS_PTR; + +typedef struct CK_WTLS_PRF_PARAMS { + CK_MECHANISM_TYPE DigestMechanism; + CK_BYTE_PTR pSeed; + CK_ULONG ulSeedLen; + CK_BYTE_PTR pLabel; + CK_ULONG ulLabelLen; + CK_BYTE_PTR pOutput; + CK_ULONG_PTR pulOutputLen; +} CK_WTLS_PRF_PARAMS; + +typedef CK_WTLS_PRF_PARAMS CK_PTR CK_WTLS_PRF_PARAMS_PTR; + +typedef struct CK_WTLS_KEY_MAT_OUT { + CK_OBJECT_HANDLE hMacSecret; + CK_OBJECT_HANDLE hKey; + CK_BYTE_PTR pIV; +} CK_WTLS_KEY_MAT_OUT; + +typedef CK_WTLS_KEY_MAT_OUT CK_PTR CK_WTLS_KEY_MAT_OUT_PTR; + +typedef struct CK_WTLS_KEY_MAT_PARAMS { + CK_MECHANISM_TYPE DigestMechanism; + CK_ULONG ulMacSizeInBits; + CK_ULONG ulKeySizeInBits; + CK_ULONG ulIVSizeInBits; + CK_ULONG ulSequenceNumber; + CK_BBOOL bIsExport; + CK_WTLS_RANDOM_DATA RandomInfo; + CK_WTLS_KEY_MAT_OUT_PTR pReturnedKeyMaterial; +} CK_WTLS_KEY_MAT_PARAMS; + +typedef CK_WTLS_KEY_MAT_PARAMS CK_PTR CK_WTLS_KEY_MAT_PARAMS_PTR; + +typedef struct CK_CMS_SIG_PARAMS { + CK_OBJECT_HANDLE certificateHandle; + CK_MECHANISM_PTR pSigningMechanism; + CK_MECHANISM_PTR pDigestMechanism; + CK_UTF8CHAR_PTR pContentType; + CK_BYTE_PTR pRequestedAttributes; + CK_ULONG ulRequestedAttributesLen; + CK_BYTE_PTR pRequiredAttributes; + CK_ULONG ulRequiredAttributesLen; +} CK_CMS_SIG_PARAMS; + +typedef CK_CMS_SIG_PARAMS CK_PTR CK_CMS_SIG_PARAMS_PTR; + +typedef struct CK_KEY_DERIVATION_STRING_DATA { + CK_BYTE_PTR pData; + CK_ULONG ulLen; +} CK_KEY_DERIVATION_STRING_DATA; + +typedef CK_KEY_DERIVATION_STRING_DATA CK_PTR \ + CK_KEY_DERIVATION_STRING_DATA_PTR; + + +/* The CK_EXTRACT_PARAMS is used for the + * CKM_EXTRACT_KEY_FROM_KEY mechanism. It specifies which bit + * of the base key should be used as the first bit of the + * derived key + */ +typedef CK_ULONG CK_EXTRACT_PARAMS; + +typedef CK_EXTRACT_PARAMS CK_PTR CK_EXTRACT_PARAMS_PTR; + +/* CK_PKCS5_PBKD2_PSEUDO_RANDOM_FUNCTION_TYPE is used to + * indicate the Pseudo-Random Function (PRF) used to generate + * key bits using PKCS #5 PBKDF2. + */ +typedef CK_ULONG CK_PKCS5_PBKD2_PSEUDO_RANDOM_FUNCTION_TYPE; + +typedef CK_PKCS5_PBKD2_PSEUDO_RANDOM_FUNCTION_TYPE CK_PTR \ + CK_PKCS5_PBKD2_PSEUDO_RANDOM_FUNCTION_TYPE_PTR; + +#define CKP_PKCS5_PBKD2_HMAC_SHA1 0x00000001UL +#define CKP_PKCS5_PBKD2_HMAC_GOSTR3411 0x00000002UL +#define CKP_PKCS5_PBKD2_HMAC_SHA224 0x00000003UL +#define CKP_PKCS5_PBKD2_HMAC_SHA256 0x00000004UL +#define CKP_PKCS5_PBKD2_HMAC_SHA384 0x00000005UL +#define CKP_PKCS5_PBKD2_HMAC_SHA512 0x00000006UL +#define CKP_PKCS5_PBKD2_HMAC_SHA512_224 0x00000007UL +#define CKP_PKCS5_PBKD2_HMAC_SHA512_256 0x00000008UL + +/* CK_PKCS5_PBKDF2_SALT_SOURCE_TYPE is used to indicate the + * source of the salt value when deriving a key using PKCS #5 + * PBKDF2. + */ +typedef CK_ULONG CK_PKCS5_PBKDF2_SALT_SOURCE_TYPE; + +typedef CK_PKCS5_PBKDF2_SALT_SOURCE_TYPE CK_PTR \ + CK_PKCS5_PBKDF2_SALT_SOURCE_TYPE_PTR; + +/* The following salt value sources are defined in PKCS #5 v2.0. */ +#define CKZ_SALT_SPECIFIED 0x00000001UL + +/* CK_PKCS5_PBKD2_PARAMS is a structure that provides the + * parameters to the CKM_PKCS5_PBKD2 mechanism. + */ +typedef struct CK_PKCS5_PBKD2_PARAMS { + CK_PKCS5_PBKDF2_SALT_SOURCE_TYPE saltSource; + CK_VOID_PTR pSaltSourceData; + CK_ULONG ulSaltSourceDataLen; + CK_ULONG iterations; + CK_PKCS5_PBKD2_PSEUDO_RANDOM_FUNCTION_TYPE prf; + CK_VOID_PTR pPrfData; + CK_ULONG ulPrfDataLen; + CK_UTF8CHAR_PTR pPassword; + CK_ULONG_PTR ulPasswordLen; +} CK_PKCS5_PBKD2_PARAMS; + +typedef CK_PKCS5_PBKD2_PARAMS CK_PTR CK_PKCS5_PBKD2_PARAMS_PTR; + +/* CK_PKCS5_PBKD2_PARAMS2 is a corrected version of the CK_PKCS5_PBKD2_PARAMS + * structure that provides the parameters to the CKM_PKCS5_PBKD2 mechanism + * noting that the ulPasswordLen field is a CK_ULONG and not a CK_ULONG_PTR. + */ +typedef struct CK_PKCS5_PBKD2_PARAMS2 { + CK_PKCS5_PBKDF2_SALT_SOURCE_TYPE saltSource; + CK_VOID_PTR pSaltSourceData; + CK_ULONG ulSaltSourceDataLen; + CK_ULONG iterations; + CK_PKCS5_PBKD2_PSEUDO_RANDOM_FUNCTION_TYPE prf; + CK_VOID_PTR pPrfData; + CK_ULONG ulPrfDataLen; + CK_UTF8CHAR_PTR pPassword; + CK_ULONG ulPasswordLen; +} CK_PKCS5_PBKD2_PARAMS2; + +typedef CK_PKCS5_PBKD2_PARAMS2 CK_PTR CK_PKCS5_PBKD2_PARAMS2_PTR; + +typedef CK_ULONG CK_OTP_PARAM_TYPE; +typedef CK_OTP_PARAM_TYPE CK_PARAM_TYPE; /* backward compatibility */ + +typedef struct CK_OTP_PARAM { + CK_OTP_PARAM_TYPE type; + CK_VOID_PTR pValue; + CK_ULONG ulValueLen; +} CK_OTP_PARAM; + +typedef CK_OTP_PARAM CK_PTR CK_OTP_PARAM_PTR; + +typedef struct CK_OTP_PARAMS { + CK_OTP_PARAM_PTR pParams; + CK_ULONG ulCount; +} CK_OTP_PARAMS; + +typedef CK_OTP_PARAMS CK_PTR CK_OTP_PARAMS_PTR; + +typedef struct CK_OTP_SIGNATURE_INFO { + CK_OTP_PARAM_PTR pParams; + CK_ULONG ulCount; +} CK_OTP_SIGNATURE_INFO; + +typedef CK_OTP_SIGNATURE_INFO CK_PTR CK_OTP_SIGNATURE_INFO_PTR; + +#define CK_OTP_VALUE 0UL +#define CK_OTP_PIN 1UL +#define CK_OTP_CHALLENGE 2UL +#define CK_OTP_TIME 3UL +#define CK_OTP_COUNTER 4UL +#define CK_OTP_FLAGS 5UL +#define CK_OTP_OUTPUT_LENGTH 6UL +#define CK_OTP_OUTPUT_FORMAT 7UL + +#define CKF_NEXT_OTP 0x00000001UL +#define CKF_EXCLUDE_TIME 0x00000002UL +#define CKF_EXCLUDE_COUNTER 0x00000004UL +#define CKF_EXCLUDE_CHALLENGE 0x00000008UL +#define CKF_EXCLUDE_PIN 0x00000010UL +#define CKF_USER_FRIENDLY_OTP 0x00000020UL + +typedef struct CK_KIP_PARAMS { + CK_MECHANISM_PTR pMechanism; + CK_OBJECT_HANDLE hKey; + CK_BYTE_PTR pSeed; + CK_ULONG ulSeedLen; +} CK_KIP_PARAMS; + +typedef CK_KIP_PARAMS CK_PTR CK_KIP_PARAMS_PTR; + +typedef struct CK_AES_CTR_PARAMS { + CK_ULONG ulCounterBits; + CK_BYTE cb[16]; +} CK_AES_CTR_PARAMS; + +typedef CK_AES_CTR_PARAMS CK_PTR CK_AES_CTR_PARAMS_PTR; + +typedef struct CK_GCM_PARAMS { + CK_BYTE_PTR pIv; + CK_ULONG ulIvLen; + CK_ULONG ulIvBits; + CK_BYTE_PTR pAAD; + CK_ULONG ulAADLen; + CK_ULONG ulTagBits; +} CK_GCM_PARAMS; + +typedef CK_GCM_PARAMS CK_PTR CK_GCM_PARAMS_PTR; + +typedef CK_ULONG CK_GENERATOR_FUNCTION; +#define CKG_NO_GENERATE 0x00000000UL +#define CKG_GENERATE 0x00000001UL +#define CKG_GENERATE_COUNTER 0x00000002UL +#define CKG_GENERATE_RANDOM 0x00000003UL + +typedef struct CK_GCM_MESSAGE_PARAMS { + CK_BYTE_PTR pIv; + CK_ULONG ulIvLen; + CK_ULONG ulIvFixedBits; + CK_GENERATOR_FUNCTION ivGenerator; + CK_BYTE_PTR pTag; + CK_ULONG ulTagBits; +} CK_GCM_MESSAGE_PARAMS; + +typedef CK_GCM_MESSAGE_PARAMS CK_GCM_MESSAGE_PARAMS_PTR; + +typedef struct CK_CCM_PARAMS { + CK_ULONG ulDataLen; + CK_BYTE_PTR pNonce; + CK_ULONG ulNonceLen; + CK_BYTE_PTR pAAD; + CK_ULONG ulAADLen; + CK_ULONG ulMACLen; +} CK_CCM_PARAMS; + +typedef CK_CCM_PARAMS CK_PTR CK_CCM_PARAMS_PTR; + +typedef struct CK_CCM_MESSAGE_PARAMS { + CK_ULONG ulDataLen; /*plaintext or ciphertext*/ + CK_BYTE_PTR pNonce; + CK_ULONG ulNonceLen; + CK_ULONG ulNonceFixedBits; + CK_GENERATOR_FUNCTION nonceGenerator; + CK_BYTE_PTR pMAC; + CK_ULONG ulMACLen; +} CK_CCM_MESSAGE_PARAMS; + +typedef CK_CCM_MESSAGE_PARAMS CK_CCM_MESSAGE_PARAMS_PTR; + +/* Deprecated. Use CK_GCM_PARAMS */ +typedef struct CK_AES_GCM_PARAMS { + CK_BYTE_PTR pIv; + CK_ULONG ulIvLen; + CK_ULONG ulIvBits; + CK_BYTE_PTR pAAD; + CK_ULONG ulAADLen; + CK_ULONG ulTagBits; +} CK_AES_GCM_PARAMS; + +typedef CK_AES_GCM_PARAMS CK_PTR CK_AES_GCM_PARAMS_PTR; + +/* Deprecated. Use CK_CCM_PARAMS */ +typedef struct CK_AES_CCM_PARAMS { + CK_ULONG ulDataLen; + CK_BYTE_PTR pNonce; + CK_ULONG ulNonceLen; + CK_BYTE_PTR pAAD; + CK_ULONG ulAADLen; + CK_ULONG ulMACLen; +} CK_AES_CCM_PARAMS; + +typedef CK_AES_CCM_PARAMS CK_PTR CK_AES_CCM_PARAMS_PTR; + +typedef struct CK_CAMELLIA_CTR_PARAMS { + CK_ULONG ulCounterBits; + CK_BYTE cb[16]; +} CK_CAMELLIA_CTR_PARAMS; + +typedef CK_CAMELLIA_CTR_PARAMS CK_PTR CK_CAMELLIA_CTR_PARAMS_PTR; + +typedef struct CK_CAMELLIA_CBC_ENCRYPT_DATA_PARAMS { + CK_BYTE iv[16]; + CK_BYTE_PTR pData; + CK_ULONG length; +} CK_CAMELLIA_CBC_ENCRYPT_DATA_PARAMS; + +typedef CK_CAMELLIA_CBC_ENCRYPT_DATA_PARAMS CK_PTR \ + CK_CAMELLIA_CBC_ENCRYPT_DATA_PARAMS_PTR; + +typedef struct CK_ARIA_CBC_ENCRYPT_DATA_PARAMS { + CK_BYTE iv[16]; + CK_BYTE_PTR pData; + CK_ULONG length; +} CK_ARIA_CBC_ENCRYPT_DATA_PARAMS; + +typedef CK_ARIA_CBC_ENCRYPT_DATA_PARAMS CK_PTR \ + CK_ARIA_CBC_ENCRYPT_DATA_PARAMS_PTR; + +typedef struct CK_DSA_PARAMETER_GEN_PARAM { + CK_MECHANISM_TYPE hash; + CK_BYTE_PTR pSeed; + CK_ULONG ulSeedLen; + CK_ULONG ulIndex; +} CK_DSA_PARAMETER_GEN_PARAM; + +typedef CK_DSA_PARAMETER_GEN_PARAM CK_PTR CK_DSA_PARAMETER_GEN_PARAM_PTR; + +typedef struct CK_ECDH_AES_KEY_WRAP_PARAMS { + CK_ULONG ulAESKeyBits; + CK_EC_KDF_TYPE kdf; + CK_ULONG ulSharedDataLen; + CK_BYTE_PTR pSharedData; +} CK_ECDH_AES_KEY_WRAP_PARAMS; + +typedef CK_ECDH_AES_KEY_WRAP_PARAMS CK_PTR CK_ECDH_AES_KEY_WRAP_PARAMS_PTR; + +typedef CK_ULONG CK_JAVA_MIDP_SECURITY_DOMAIN; + +typedef CK_ULONG CK_CERTIFICATE_CATEGORY; + +typedef struct CK_RSA_AES_KEY_WRAP_PARAMS { + CK_ULONG ulAESKeyBits; + CK_RSA_PKCS_OAEP_PARAMS_PTR pOAEPParams; +} CK_RSA_AES_KEY_WRAP_PARAMS; + +typedef CK_RSA_AES_KEY_WRAP_PARAMS CK_PTR CK_RSA_AES_KEY_WRAP_PARAMS_PTR; + +typedef struct CK_TLS12_MASTER_KEY_DERIVE_PARAMS { + CK_SSL3_RANDOM_DATA RandomInfo; + CK_VERSION_PTR pVersion; + CK_MECHANISM_TYPE prfHashMechanism; +} CK_TLS12_MASTER_KEY_DERIVE_PARAMS; + +typedef CK_TLS12_MASTER_KEY_DERIVE_PARAMS CK_PTR \ + CK_TLS12_MASTER_KEY_DERIVE_PARAMS_PTR; + +typedef struct CK_TLS12_KEY_MAT_PARAMS { + CK_ULONG ulMacSizeInBits; + CK_ULONG ulKeySizeInBits; + CK_ULONG ulIVSizeInBits; + CK_BBOOL bIsExport; + CK_SSL3_RANDOM_DATA RandomInfo; + CK_SSL3_KEY_MAT_OUT_PTR pReturnedKeyMaterial; + CK_MECHANISM_TYPE prfHashMechanism; +} CK_TLS12_KEY_MAT_PARAMS; + +typedef CK_TLS12_KEY_MAT_PARAMS CK_PTR CK_TLS12_KEY_MAT_PARAMS_PTR; + +typedef struct CK_TLS_KDF_PARAMS { + CK_MECHANISM_TYPE prfMechanism; + CK_BYTE_PTR pLabel; + CK_ULONG ulLabelLength; + CK_SSL3_RANDOM_DATA RandomInfo; + CK_BYTE_PTR pContextData; + CK_ULONG ulContextDataLength; +} CK_TLS_KDF_PARAMS; + +typedef CK_TLS_KDF_PARAMS CK_PTR CK_TLS_KDF_PARAMS_PTR; + +typedef struct CK_TLS_MAC_PARAMS { + CK_MECHANISM_TYPE prfHashMechanism; + CK_ULONG ulMacLength; + CK_ULONG ulServerOrClient; +} CK_TLS_MAC_PARAMS; + +typedef CK_TLS_MAC_PARAMS CK_PTR CK_TLS_MAC_PARAMS_PTR; + +typedef struct CK_GOSTR3410_DERIVE_PARAMS { + CK_EC_KDF_TYPE kdf; + CK_BYTE_PTR pPublicData; + CK_ULONG ulPublicDataLen; + CK_BYTE_PTR pUKM; + CK_ULONG ulUKMLen; +} CK_GOSTR3410_DERIVE_PARAMS; + +typedef CK_GOSTR3410_DERIVE_PARAMS CK_PTR CK_GOSTR3410_DERIVE_PARAMS_PTR; + +typedef struct CK_GOSTR3410_KEY_WRAP_PARAMS { + CK_BYTE_PTR pWrapOID; + CK_ULONG ulWrapOIDLen; + CK_BYTE_PTR pUKM; + CK_ULONG ulUKMLen; + CK_OBJECT_HANDLE hKey; +} CK_GOSTR3410_KEY_WRAP_PARAMS; + +typedef CK_GOSTR3410_KEY_WRAP_PARAMS CK_PTR CK_GOSTR3410_KEY_WRAP_PARAMS_PTR; + +typedef struct CK_SEED_CBC_ENCRYPT_DATA_PARAMS { + CK_BYTE iv[16]; + CK_BYTE_PTR pData; + CK_ULONG length; +} CK_SEED_CBC_ENCRYPT_DATA_PARAMS; + +typedef CK_SEED_CBC_ENCRYPT_DATA_PARAMS CK_PTR \ + CK_SEED_CBC_ENCRYPT_DATA_PARAMS_PTR; + +/* + * New PKCS 11 v3.0 data structures. + */ + +typedef CK_ULONG CK_PROFILE_ID; + +/* Typedefs for Flexible KDF */ +typedef CK_ULONG CK_PRF_DATA_TYPE; +typedef CK_MECHANISM_TYPE CK_SP800_108_PRF_TYPE; +#define CK_SP800_108_ITERATION_VARIABLE 0x00000001UL +#define CK_SP800_108_OPTIONAL_COUNTER 0x00000002UL +#define CK_SP800_108_DKM_LENGTH 0x00000003UL +#define CK_SP800_108_BYTE_ARRAY 0x00000004UL + +typedef struct CK_PRF_DATA_PARAM +{ + CK_PRF_DATA_TYPE type; + CK_VOID_PTR pValue; + CK_ULONG ulValueLen; +} CK_PRF_DATA_PARAM; + +typedef CK_PRF_DATA_PARAM CK_PTR CK_PRF_DATA_PARAM_PTR; + + +typedef struct CK_SP800_108_COUNTER_FORMAT +{ + CK_BBOOL bLittleEndian; + CK_ULONG ulWidthInBits; +} CK_SP800_108_COUNTER_FORMAT; + +typedef CK_SP800_108_COUNTER_FORMAT CK_PTR CK_SP800_108_COUNTER_FORMAT_PTR; + +typedef CK_ULONG CK_SP800_108_DKM_LENGTH_METHOD; + +typedef struct CK_SP800_108_DKM_LENGTH_FORMAT +{ + CK_SP800_108_DKM_LENGTH_METHOD dkmLengthMethod; + CK_BBOOL bLittleEndian; + CK_ULONG ulWidthInBits; +} CK_SP800_108_DKM_LENGTH_FORMAT; + +typedef CK_SP800_108_DKM_LENGTH_FORMAT \ + CK_PTR CK_SP800_108_DKM_LENGTH_FORMAT_PTR; + +typedef struct CK_DERIVED_KEY +{ + CK_ATTRIBUTE_PTR pTemplate; + CK_ULONG ulAttributeCount; + CK_OBJECT_HANDLE_PTR phKey; +} CK_DERIVED_KEY; + +typedef CK_DERIVED_KEY CK_PTR CK_DERIVED_KEY_PTR; + +typedef struct CK_SP800_108_KDF_PARAMS +{ + CK_SP800_108_PRF_TYPE prfType; + CK_ULONG ulNumberOfDataParams; + CK_PRF_DATA_PARAM_PTR pDataParams; + CK_ULONG ulAdditionalDerivedKeys; + CK_DERIVED_KEY pAdditionalDerivedKeys; +} CK_SP800_108_KDF_PARAMS; + +typedef CK_SP800_108_KDF_PARAMS CK_PTR CK_SP800_108_KDF_PARAMS_PTR; + +typedef struct CK_SP800_108_FEEDBACK_KDF_PARAMS +{ + CK_SP800_108_PRF_TYPE prfType; + CK_ULONG ulNumberOfDataParams; + CK_PRF_DATA_PARAM_PTR pDataParams; + CK_ULONG ulIVLen; + CK_BYTE_PTR pIV; + CK_ULONG ulAdditionalDerivedKeys; + CK_DERIVED_KEY pAdditionalDerivedKeys; +} CK_SP800_108_FEEDBACK_KDF_PARAMS; + +typedef CK_SP800_108_FEEDBACK_KDF_PARAMS \ + CK_PTR CK_SP800_108_FEEDBACK_KDF_PARAMS_PTR; + +/* EDDSA */ +typedef struct CK_EDDSA_PARAMS { + CK_BBOOL phFlag; + CK_ULONG ulContextDataLen; + CK_BYTE_PTR pContextData; +} CK_EDDSA_PARAMS; + +typedef CK_EDDSA_PARAMS CK_PTR CK_EDDSA_PARAMS_PTR; + +/* Extended ChaCha20/Salsa20 support*/ +typedef struct CK_CHACHA20_PARAMS { + CK_BYTE_PTR pBlockCounter; + CK_ULONG blockCounterBits; + CK_BYTE_PTR pNonce; + CK_ULONG ulNonceBits; +} CK_CHACHA20_PARAMS; + +/* need typedef CK_CHACHA20_PARAMS CK_PTR CK_CHACHA20_PARAMS_PTR? */ + +typedef struct CK_SALSA20_PARAMS { + CK_BYTE_PTR pBlockCounter; + CK_BYTE_PTR pNonce; + CK_ULONG ulNonceBits; +} CK_SALSA20_PARAMS; + +/* need typedef CK_CHACHA20_PARAMS CK_PTR CK_CHACHA20_PARAMS_PTR? */ + +typedef struct CK_SALSA20_CHACHA20_POLY1305_PARAMS { + CK_BYTE_PTR pNonce; + CK_ULONG ulNonceLen; + CK_BYTE_PTR pAAD; + CK_ULONG ulAADLen; +} CK_SALSA20_CHACHA20_POLY1305_PARAMS; + +typedef CK_SALSA20_CHACHA20_POLY1305_PARAMS \ + CK_PTR CK_SALSA20_CHACHA20_POLY1305_PARAMS_PTR; + +typedef struct CK_SALSA20_CHACHA20_POLY1305_MSG_PARAMS { + CK_BYTE_PTR pNonce; + CK_ULONG ulNonceLen; + CK_BYTE_PTR pTag; +} CK_SALSA20_CHACHA20_POLY1305_MSG_PARAMS; + +typedef CK_SALSA20_CHACHA20_POLY1305_MSG_PARAMS \ + CK_PTR CK_SALSA20_CHACHA20_POLY1305_MSG_PARAMS_PTR; + +typedef CK_ULONG CK_X3DH_KDF_TYPE; +typedef CK_X3DH_KDF_TYPE CK_PTR CK_X3DH_KDF_TYPE_PTR; + +/* X3dh, ratchet */ +typedef struct CK_X3DH_INITIATE_PARAMS { + CK_X3DH_KDF_TYPE kdf; + CK_OBJECT_HANDLE pPeer_identity; + CK_OBJECT_HANDLE pPeer_prekey; + CK_BYTE_PTR pPrekey_signature; + CK_BYTE_PTR pOnetime_key; + CK_OBJECT_HANDLE pOwn_identity; + CK_OBJECT_HANDLE pOwn_ephemeral; +} CK_X3DH_INITIATE_PARAMS; + +typedef struct CK_X3DH_RESPOND_PARAMS { + CK_X3DH_KDF_TYPE kdf; + CK_BYTE_PTR pIdentity_id; + CK_BYTE_PTR pPrekey_id; + CK_BYTE_PTR pOnetime_id; + CK_OBJECT_HANDLE pInitiator_identity; + CK_BYTE_PTR pInitiator_ephemeral; +} CK_X3DH_RESPOND_PARAMS; + +typedef CK_ULONG CK_X2RATCHET_KDF_TYPE; +typedef CK_X2RATCHET_KDF_TYPE CK_PTR CK_X2RATCHET_KDF_TYPE_PTR; + +typedef struct CK_X2RATCHET_INITIALIZE_PARAMS { + CK_BYTE_PTR sk; + CK_OBJECT_HANDLE peer_public_prekey; + CK_OBJECT_HANDLE peer_public_identity; + CK_OBJECT_HANDLE own_public_identity; + CK_BBOOL bEncryptedHeader; + CK_ULONG eCurve; + CK_MECHANISM_TYPE aeadMechanism; + CK_X2RATCHET_KDF_TYPE kdfMechanism; +} CK_X2RATCHET_INITIALIZE_PARAMS; + +typedef CK_X2RATCHET_INITIALIZE_PARAMS \ + CK_PTR CK_X2RATCHET_INITIALIZE_PARAMS_PTR; + +typedef struct CK_X2RATCHET_RESPOND_PARAMS { + CK_BYTE_PTR sk; + CK_OBJECT_HANDLE own_prekey; + CK_OBJECT_HANDLE initiator_identity; + CK_OBJECT_HANDLE own_public_identity; + CK_BBOOL bEncryptedHeader; + CK_ULONG eCurve; + CK_MECHANISM_TYPE aeadMechanism; + CK_X2RATCHET_KDF_TYPE kdfMechanism; +} CK_X2RATCHET_RESPOND_PARAMS; +typedef CK_X2RATCHET_RESPOND_PARAMS \ + CK_PTR CK_X2RATCHET_RESPOND_PARAMS_PTR; + +typedef CK_ULONG CK_XEDDSA_HASH_TYPE; +typedef CK_XEDDSA_HASH_TYPE CK_PTR CK_XEDDSA_HASH_TYPE_PTR; + +/* XEDDSA */ +typedef struct CK_XEDDSA_PARAMS { + CK_XEDDSA_HASH_TYPE hash; +} CK_XEDDSA_PARAMS; +typedef CK_XEDDSA_PARAMS CK_PTR CK_XEDDSA_PARAMS_PTR; + +typedef struct CK_HKDF_PARAMS { + CK_BOOL bExtract; + CK_BOOL bExpand; + CK_MECHANISM_TYPE prfHashMechanism; + CK_ULONG ulSaltType; + CK_BYTE_PTR pSalt; + CK_ULONG ulSaltLen; + CK_HANDLE hSaltKey; + CK_BYTE_PTR pInfo; + CK_ULONG ulInfoLen; +} CK_HKDF_PARAMS; + +#define CKF_HKDF_SALT_NULL 0x00000001UL +#define CKF_HKDF_SALT_DATA 0x00000002UL +#define CKF_HKDF_SALT_KEY 0x00000004UL + +#endif /* _PKCS11T_H_ */ + diff --git a/cryptoki/src/context/mod.rs b/cryptoki/src/context/mod.rs index 5587a4fb..4b8a71e1 100644 --- a/cryptoki/src/context/mod.rs +++ b/cryptoki/src/context/mod.rs @@ -37,7 +37,7 @@ pub(crate) struct Pkcs11Impl { // Even if this field is never read, it is needed for the pointers in function_list to remain // valid. _pkcs11_lib: cryptoki_sys::Pkcs11, - pub(crate) function_list: cryptoki_sys::_CK_FUNCTION_LIST, + pub(crate) function_list: cryptoki_sys::CK_FUNCTION_LIST, } impl fmt::Debug for Pkcs11Impl {