From a53a81a0c487ec5106b1ea574c98403f0e261dc3 Mon Sep 17 00:00:00 2001 From: Gowtham Suresh Kumar Date: Wed, 8 Mar 2023 13:42:55 +0000 Subject: [PATCH 1/6] Bump bindgen version Signed-off-by: Gowtham Suresh Kumar --- cryptoki-sys/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cryptoki-sys/Cargo.toml b/cryptoki-sys/Cargo.toml index adf0e120..a08549ad 100644 --- a/cryptoki-sys/Cargo.toml +++ b/cryptoki-sys/Cargo.toml @@ -12,7 +12,7 @@ repository = "https://github.com/parallaxsecond/rust-cryptoki" documentation = "https://docs.rs/crate/cryptoki" [build-dependencies] -bindgen = { version = "0.59.1", optional = true } +bindgen = { version = "0.63.0", optional = true } target-lexicon = "0.12.0" [dependencies] From f995ce8c616029ce99b1c549c9f2275f61dec454 Mon Sep 17 00:00:00 2001 From: Gowtham Suresh Kumar Date: Fri, 10 Mar 2023 09:25:05 +0000 Subject: [PATCH 2/6] Remove definitions which can now be generated by bindgen 0.63.0 lib.rs has definitions which were not generated by older bindgen versions. This can now be removed as bindgen 0.63 can generate it automatically. Signed-off-by: Gowtham Suresh Kumar --- cryptoki-sys/src/lib.rs | 697 +--------------------------------------- 1 file changed, 4 insertions(+), 693 deletions(-) diff --git a/cryptoki-sys/src/lib.rs b/cryptoki-sys/src/lib.rs index 8305e4c6..c987fe3c 100644 --- a/cryptoki-sys/src/lib.rs +++ b/cryptoki-sys/src/lib.rs @@ -1,4 +1,4 @@ -// Copyright 2021 Contributors to the Parsec project. +// Copyright 2021,2023 Contributors to the Parsec project. // SPDX-License-Identifier: Apache-2.0 #![allow(non_upper_case_globals)] #![allow(non_camel_case_types)] @@ -117,702 +117,13 @@ 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 CKN_SURRENDER: CK_NOTIFICATION = 0; -pub const CKF_TOKEN_PRESENT: CK_FLAGS = 0x00000001; -pub const CKF_REMOVABLE_DEVICE: CK_FLAGS = 0x00000002; -pub const CKF_HW_SLOT: CK_FLAGS = 0x00000004; -pub const CKF_ARRAY_ATTRIBUTE: CK_FLAGS = 0x40000000; 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; -pub const CKF_RNG: CK_FLAGS = 0x00000001; -pub const CKF_WRITE_PROTECTED: CK_FLAGS = 0x00000002; -pub const CKF_LOGIN_REQUIRED: CK_FLAGS = 0x00000004; -pub const CKF_USER_PIN_INITIALIZED: CK_FLAGS = 0x00000008; -pub const CKF_RESTORE_KEY_NOT_NEEDED: CK_FLAGS = 0x00000020; -pub const CKF_CLOCK_ON_TOKEN: CK_FLAGS = 0x00000040; -pub const CKF_PROTECTED_AUTHENTICATION_PATH: CK_FLAGS = 0x00000100; -pub const CKF_DUAL_CRYPTO_OPERATIONS: CK_FLAGS = 0x00000200; -pub const CKF_TOKEN_INITIALIZED: CK_FLAGS = 0x00000400; -pub const CKF_SECONDARY_AUTHENTICATION: CK_FLAGS = 0x00000800; -pub const CKF_USER_PIN_COUNT_LOW: CK_FLAGS = 0x00010000; -pub const CKF_USER_PIN_FINAL_TRY: CK_FLAGS = 0x00020000; -pub const CKF_USER_PIN_LOCKED: CK_FLAGS = 0x00040000; -pub const CKF_USER_PIN_TO_BE_CHANGED: CK_FLAGS = 0x00080000; -pub const CKF_SO_PIN_COUNT_LOW: CK_FLAGS = 0x00100000; -pub const CKF_SO_PIN_FINAL_TRY: CK_FLAGS = 0x00200000; -pub const CKF_SO_PIN_LOCKED: CK_FLAGS = 0x00400000; -pub const CKF_SO_PIN_TO_BE_CHANGED: CK_FLAGS = 0x00800000; -pub const CKF_ERROR_STATE: CK_FLAGS = 0x01000000; pub const CK_UNAVAILABLE_INFORMATION: CK_ULONG = !0; -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; -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 = 0x00000002; -pub const CKF_SERIAL_SESSION: CK_FLAGS = 0x00000004; -pub const CKO_DATA: CK_OBJECT_CLASS = 0x00000000; -pub const CKO_CERTIFICATE: CK_OBJECT_CLASS = 0x00000001; -pub const CKO_PUBLIC_KEY: CK_OBJECT_CLASS = 0x00000002; -pub const CKO_PRIVATE_KEY: CK_OBJECT_CLASS = 0x00000003; -pub const CKO_SECRET_KEY: CK_OBJECT_CLASS = 0x00000004; -pub const CKO_HW_FEATURE: CK_OBJECT_CLASS = 0x00000005; -pub const CKO_DOMAIN_PARAMETERS: CK_OBJECT_CLASS = 0x00000006; -pub const CKO_MECHANISM: CK_OBJECT_CLASS = 0x00000007; -pub const CKO_OTP_KEY: CK_OBJECT_CLASS = 0x00000008; -pub const CKO_VENDOR_DEFINED: CK_OBJECT_CLASS = 0x80000000; -pub const CKH_MONOTONIC_COUNTER: CK_HW_FEATURE_TYPE = 0x00000001; -pub const CKH_CLOCK: CK_HW_FEATURE_TYPE = 0x00000002; -pub const CKH_USER_INTERFACE: CK_HW_FEATURE_TYPE = 0x00000003; -pub const CKH_VENDOR_DEFINED: CK_HW_FEATURE_TYPE = 0x80000000; -pub const CKK_RSA: CK_KEY_TYPE = 0x00000000; -pub const CKK_DSA: CK_KEY_TYPE = 0x00000001; -pub const CKK_DH: CK_KEY_TYPE = 0x00000002; -pub const CKK_ECDSA: CK_KEY_TYPE = CKK_EC; -pub const CKK_EC: CK_KEY_TYPE = 0x00000003; -pub const CKK_X9_42_DH: CK_KEY_TYPE = 0x00000004; -pub const CKK_KEA: CK_KEY_TYPE = 0x00000005; -pub const CKK_GENERIC_SECRET: CK_KEY_TYPE = 0x00000010; -pub const CKK_RC2: CK_KEY_TYPE = 0x00000011; -pub const CKK_RC4: CK_KEY_TYPE = 0x00000012; -pub const CKK_DES: CK_KEY_TYPE = 0x00000013; -pub const CKK_DES2: CK_KEY_TYPE = 0x00000014; -pub const CKK_DES3: CK_KEY_TYPE = 0x00000015; -pub const CKK_CAST: CK_KEY_TYPE = 0x00000016; -pub const CKK_CAST3: CK_KEY_TYPE = 0x00000017; -pub const CKK_CAST5: CK_KEY_TYPE = CKK_CAST128; -pub const CKK_CAST128: CK_KEY_TYPE = 0x00000018; -pub const CKK_RC5: CK_KEY_TYPE = 0x00000019; -pub const CKK_IDEA: CK_KEY_TYPE = 0x0000001A; -pub const CKK_SKIPJACK: CK_KEY_TYPE = 0x0000001B; -pub const CKK_BATON: CK_KEY_TYPE = 0x0000001C; -pub const CKK_JUNIPER: CK_KEY_TYPE = 0x0000001D; -pub const CKK_CDMF: CK_KEY_TYPE = 0x0000001E; -pub const CKK_AES: CK_KEY_TYPE = 0x0000001F; -pub const CKK_BLOWFISH: CK_KEY_TYPE = 0x00000020; -pub const CKK_TWOFISH: CK_KEY_TYPE = 0x00000021; -pub const CKK_SECURID: CK_KEY_TYPE = 0x00000022; -pub const CKK_HOTP: CK_KEY_TYPE = 0x00000023; -pub const CKK_ACTI: CK_KEY_TYPE = 0x00000024; -pub const CKK_CAMELLIA: CK_KEY_TYPE = 0x00000025; -pub const CKK_ARIA: CK_KEY_TYPE = 0x00000026; -pub const CKK_MD5_HMAC: CK_KEY_TYPE = 0x00000027; -pub const CKK_SHA_1_HMAC: CK_KEY_TYPE = 0x00000028; -pub const CKK_RIPEMD128_HMAC: CK_KEY_TYPE = 0x00000029; -pub const CKK_RIPEMD160_HMAC: CK_KEY_TYPE = 0x0000002A; -pub const CKK_SHA256_HMAC: CK_KEY_TYPE = 0x0000002B; -pub const CKK_SHA384_HMAC: CK_KEY_TYPE = 0x0000002C; -pub const CKK_SHA512_HMAC: CK_KEY_TYPE = 0x0000002D; -pub const CKK_SHA224_HMAC: CK_KEY_TYPE = 0x0000002E; -pub const CKK_SEED: CK_KEY_TYPE = 0x0000002F; -pub const CKK_GOSTR3410: CK_KEY_TYPE = 0x00000030; -pub const CKK_GOSTR3411: CK_KEY_TYPE = 0x00000031; -pub const CKK_GOST28147: CK_KEY_TYPE = 0x00000032; -pub const CKK_EC_EDWARDS: CK_KEY_TYPE = 0x00000040; -pub const CKK_EC_MONTGOMERY: CK_KEY_TYPE = 0x00000041; -pub const CKK_VENDOR_DEFINED: CK_KEY_TYPE = 0x80000000; -pub const CKC_X_509: CK_CERTIFICATE_TYPE = 0x00000000; -pub const CKC_X_509_ATTR_CERT: CK_CERTIFICATE_TYPE = 0x00000001; -pub const CKC_WTLS: CK_CERTIFICATE_TYPE = 0x00000002; -pub const CKC_VENDOR_DEFINED: CK_CERTIFICATE_TYPE = 0x80000000; -pub const CKA_CLASS: CK_ATTRIBUTE_TYPE = 0x00000000; -pub const CKA_TOKEN: CK_ATTRIBUTE_TYPE = 0x00000001; -pub const CKA_PRIVATE: CK_ATTRIBUTE_TYPE = 0x00000002; -pub const CKA_LABEL: CK_ATTRIBUTE_TYPE = 0x00000003; -pub const CKA_APPLICATION: CK_ATTRIBUTE_TYPE = 0x00000010; -pub const CKA_VALUE: CK_ATTRIBUTE_TYPE = 0x00000011; -pub const CKA_OBJECT_ID: CK_ATTRIBUTE_TYPE = 0x00000012; -pub const CKA_CERTIFICATE_TYPE: CK_ATTRIBUTE_TYPE = 0x00000080; -pub const CKA_ISSUER: CK_ATTRIBUTE_TYPE = 0x00000081; -pub const CKA_SERIAL_NUMBER: CK_ATTRIBUTE_TYPE = 0x00000082; -pub const CKA_AC_ISSUER: CK_ATTRIBUTE_TYPE = 0x00000083; -pub const CKA_OWNER: CK_ATTRIBUTE_TYPE = 0x00000084; -pub const CKA_ATTR_TYPES: CK_ATTRIBUTE_TYPE = 0x00000085; -pub const CKA_TRUSTED: CK_ATTRIBUTE_TYPE = 0x00000086; -pub const CKA_CERTIFICATE_CATEGORY: CK_ATTRIBUTE_TYPE = 0x00000087; -pub const CKA_JAVA_MIDP_SECURITY_DOMAIN: CK_ATTRIBUTE_TYPE = 0x00000088; -pub const CKA_URL: CK_ATTRIBUTE_TYPE = 0x00000089; -pub const CKA_HASH_OF_SUBJECT_PUBLIC_KEY: CK_ATTRIBUTE_TYPE = 0x0000008A; -pub const CKA_HASH_OF_ISSUER_PUBLIC_KEY: CK_ATTRIBUTE_TYPE = 0x0000008B; -pub const CKA_NAME_HASH_ALGORITHM: CK_ATTRIBUTE_TYPE = 0x0000008C; -pub const CKA_CHECK_VALUE: CK_ATTRIBUTE_TYPE = 0x00000090; -pub const CKA_KEY_TYPE: CK_ATTRIBUTE_TYPE = 0x00000100; -pub const CKA_SUBJECT: CK_ATTRIBUTE_TYPE = 0x00000101; -pub const CKA_ID: CK_ATTRIBUTE_TYPE = 0x00000102; -pub const CKA_SENSITIVE: CK_ATTRIBUTE_TYPE = 0x00000103; -pub const CKA_ENCRYPT: CK_ATTRIBUTE_TYPE = 0x00000104; -pub const CKA_DECRYPT: CK_ATTRIBUTE_TYPE = 0x00000105; -pub const CKA_WRAP: CK_ATTRIBUTE_TYPE = 0x00000106; -pub const CKA_UNWRAP: CK_ATTRIBUTE_TYPE = 0x00000107; -pub const CKA_SIGN: CK_ATTRIBUTE_TYPE = 0x00000108; -pub const CKA_SIGN_RECOVER: CK_ATTRIBUTE_TYPE = 0x00000109; -pub const CKA_VERIFY: CK_ATTRIBUTE_TYPE = 0x0000010A; -pub const CKA_VERIFY_RECOVER: CK_ATTRIBUTE_TYPE = 0x0000010B; -pub const CKA_DERIVE: CK_ATTRIBUTE_TYPE = 0x0000010C; -pub const CKA_START_DATE: CK_ATTRIBUTE_TYPE = 0x00000110; -pub const CKA_END_DATE: CK_ATTRIBUTE_TYPE = 0x00000111; -pub const CKA_MODULUS: CK_ATTRIBUTE_TYPE = 0x00000120; -pub const CKA_MODULUS_BITS: CK_ATTRIBUTE_TYPE = 0x00000121; -pub const CKA_PUBLIC_EXPONENT: CK_ATTRIBUTE_TYPE = 0x00000122; -pub const CKA_PRIVATE_EXPONENT: CK_ATTRIBUTE_TYPE = 0x00000123; -pub const CKA_PRIME_1: CK_ATTRIBUTE_TYPE = 0x00000124; -pub const CKA_PRIME_2: CK_ATTRIBUTE_TYPE = 0x00000125; -pub const CKA_EXPONENT_1: CK_ATTRIBUTE_TYPE = 0x00000126; -pub const CKA_EXPONENT_2: CK_ATTRIBUTE_TYPE = 0x00000127; -pub const CKA_COEFFICIENT: CK_ATTRIBUTE_TYPE = 0x00000128; -pub const CKA_PUBLIC_KEY_INFO: CK_ATTRIBUTE_TYPE = 0x00000129; -pub const CKA_PRIME: CK_ATTRIBUTE_TYPE = 0x00000130; -pub const CKA_SUBPRIME: CK_ATTRIBUTE_TYPE = 0x00000131; -pub const CKA_BASE: CK_ATTRIBUTE_TYPE = 0x00000132; -pub const CKA_PRIME_BITS: CK_ATTRIBUTE_TYPE = 0x00000133; -pub const CKA_SUBPRIME_BITS: CK_ATTRIBUTE_TYPE = 0x00000134; -pub const CKA_SUB_PRIME_BITS: CK_ATTRIBUTE_TYPE = CKA_SUBPRIME_BITS; -pub const CKA_VALUE_BITS: CK_ATTRIBUTE_TYPE = 0x00000160; -pub const CKA_VALUE_LEN: CK_ATTRIBUTE_TYPE = 0x00000161; -pub const CKA_EXTRACTABLE: CK_ATTRIBUTE_TYPE = 0x00000162; -pub const CKA_LOCAL: CK_ATTRIBUTE_TYPE = 0x00000163; -pub const CKA_NEVER_EXTRACTABLE: CK_ATTRIBUTE_TYPE = 0x00000164; -pub const CKA_ALWAYS_SENSITIVE: CK_ATTRIBUTE_TYPE = 0x00000165; -pub const CKA_KEY_GEN_MECHANISM: CK_ATTRIBUTE_TYPE = 0x00000166; -pub const CKA_MODIFIABLE: CK_ATTRIBUTE_TYPE = 0x00000170; -pub const CKA_COPYABLE: CK_ATTRIBUTE_TYPE = 0x00000171; -pub const CKA_DESTROYABLE: CK_ATTRIBUTE_TYPE = 0x00000172; -pub const CKA_ECDSA_PARAMS: CK_ATTRIBUTE_TYPE = CKA_EC_PARAMS; -pub const CKA_EC_PARAMS: CK_ATTRIBUTE_TYPE = 0x00000180; -pub const CKA_EC_POINT: CK_ATTRIBUTE_TYPE = 0x00000181; -pub const CKA_SECONDARY_AUTH: CK_ATTRIBUTE_TYPE = 0x00000200; /* Deprecated */ -pub const CKA_AUTH_PIN_FLAGS: CK_ATTRIBUTE_TYPE = 0x00000201; /* Deprecated */ -pub const CKA_ALWAYS_AUTHENTICATE: CK_ATTRIBUTE_TYPE = 0x00000202; -pub const CKA_WRAP_WITH_TRUSTED: CK_ATTRIBUTE_TYPE = 0x00000210; -pub const CKA_OTP_FORMAT: CK_ATTRIBUTE_TYPE = 0x00000220; -pub const CKA_OTP_LENGTH: CK_ATTRIBUTE_TYPE = 0x00000221; -pub const CKA_OTP_TIME_INTERVAL: CK_ATTRIBUTE_TYPE = 0x00000222; -pub const CKA_OTP_USER_FRIENDLY_MODE: CK_ATTRIBUTE_TYPE = 0x00000223; -pub const CKA_OTP_CHALLENGE_REQUIREMENT: CK_ATTRIBUTE_TYPE = 0x00000224; -pub const CKA_OTP_TIME_REQUIREMENT: CK_ATTRIBUTE_TYPE = 0x00000225; -pub const CKA_OTP_COUNTER_REQUIREMENT: CK_ATTRIBUTE_TYPE = 0x00000226; -pub const CKA_OTP_PIN_REQUIREMENT: CK_ATTRIBUTE_TYPE = 0x00000227; -pub const CKA_OTP_USER_IDENTIFIER: CK_ATTRIBUTE_TYPE = 0x0000022A; -pub const CKA_OTP_SERVICE_IDENTIFIER: CK_ATTRIBUTE_TYPE = 0x0000022B; -pub const CKA_OTP_SERVICE_LOGO: CK_ATTRIBUTE_TYPE = 0x0000022C; -pub const CKA_OTP_SERVICE_LOGO_TYPE: CK_ATTRIBUTE_TYPE = 0x0000022D; -pub const CKA_OTP_COUNTER: CK_ATTRIBUTE_TYPE = 0x0000022E; -pub const CKA_OTP_TIME: CK_ATTRIBUTE_TYPE = 0x0000022F; -pub const CKA_GOSTR3410_PARAMS: CK_ATTRIBUTE_TYPE = 0x00000250; -pub const CKA_GOSTR3411_PARAMS: CK_ATTRIBUTE_TYPE = 0x00000251; -pub const CKA_GOST28147_PARAMS: CK_ATTRIBUTE_TYPE = 0x00000252; -pub const CKA_HW_FEATURE_TYPE: CK_ATTRIBUTE_TYPE = 0x00000300; -pub const CKA_RESET_ON_INIT: CK_ATTRIBUTE_TYPE = 0x00000301; -pub const CKA_HAS_RESET: CK_ATTRIBUTE_TYPE = 0x00000302; -pub const CKA_PIXEL_X: CK_ATTRIBUTE_TYPE = 0x00000400; -pub const CKA_PIXEL_Y: CK_ATTRIBUTE_TYPE = 0x00000401; -pub const CKA_RESOLUTION: CK_ATTRIBUTE_TYPE = 0x00000402; -pub const CKA_CHAR_ROWS: CK_ATTRIBUTE_TYPE = 0x00000403; -pub const CKA_CHAR_COLUMNS: CK_ATTRIBUTE_TYPE = 0x00000404; -pub const CKA_COLOR: CK_ATTRIBUTE_TYPE = 0x00000405; -pub const CKA_BITS_PER_PIXEL: CK_ATTRIBUTE_TYPE = 0x00000406; -pub const CKA_CHAR_SETS: CK_ATTRIBUTE_TYPE = 0x00000480; -pub const CKA_ENCODING_METHODS: CK_ATTRIBUTE_TYPE = 0x00000481; -pub const CKA_MIME_TYPES: CK_ATTRIBUTE_TYPE = 0x00000482; -pub const CKA_MECHANISM_TYPE: CK_ATTRIBUTE_TYPE = 0x00000500; -pub const CKA_REQUIRED_CMS_ATTRIBUTES: CK_ATTRIBUTE_TYPE = 0x00000501; -pub const CKA_DEFAULT_CMS_ATTRIBUTES: CK_ATTRIBUTE_TYPE = 0x00000502; -pub const CKA_SUPPORTED_CMS_ATTRIBUTES: CK_ATTRIBUTE_TYPE = 0x00000503; -pub const CKA_VENDOR_DEFINED: CK_ATTRIBUTE_TYPE = 0x80000000; -pub const CKM_RSA_PKCS_KEY_PAIR_GEN: CK_MECHANISM_TYPE = 0x00000000; -pub const CKM_RSA_PKCS: CK_MECHANISM_TYPE = 0x00000001; -pub const CKM_RSA_9796: CK_MECHANISM_TYPE = 0x00000002; -pub const CKM_RSA_X_509: CK_MECHANISM_TYPE = 0x00000003; -pub const CKM_MD2_RSA_PKCS: CK_MECHANISM_TYPE = 0x00000004; -pub const CKM_MD5_RSA_PKCS: CK_MECHANISM_TYPE = 0x00000005; -pub const CKM_SHA1_RSA_PKCS: CK_MECHANISM_TYPE = 0x00000006; -pub const CKM_RIPEMD128_RSA_PKCS: CK_MECHANISM_TYPE = 0x00000007; -pub const CKM_RIPEMD160_RSA_PKCS: CK_MECHANISM_TYPE = 0x00000008; -pub const CKM_RSA_PKCS_OAEP: CK_MECHANISM_TYPE = 0x00000009; -pub const CKM_RSA_X9_31_KEY_PAIR_GEN: CK_MECHANISM_TYPE = 0x0000000A; -pub const CKM_RSA_X9_31: CK_MECHANISM_TYPE = 0x0000000B; -pub const CKM_SHA1_RSA_X9_31: CK_MECHANISM_TYPE = 0x0000000C; -pub const CKM_RSA_PKCS_PSS: CK_MECHANISM_TYPE = 0x0000000D; -pub const CKM_SHA1_RSA_PKCS_PSS: CK_MECHANISM_TYPE = 0x0000000E; -pub const CKM_DSA_KEY_PAIR_GEN: CK_MECHANISM_TYPE = 0x00000010; -pub const CKM_DSA: CK_MECHANISM_TYPE = 0x00000011; -pub const CKM_DSA_SHA1: CK_MECHANISM_TYPE = 0x00000012; -pub const CKM_DSA_SHA224: CK_MECHANISM_TYPE = 0x00000013; -pub const CKM_DSA_SHA256: CK_MECHANISM_TYPE = 0x00000014; -pub const CKM_DSA_SHA384: CK_MECHANISM_TYPE = 0x00000015; -pub const CKM_DSA_SHA512: CK_MECHANISM_TYPE = 0x00000016; -pub const CKM_DH_PKCS_KEY_PAIR_GEN: CK_MECHANISM_TYPE = 0x00000020; -pub const CKM_DH_PKCS_DERIVE: CK_MECHANISM_TYPE = 0x00000021; -pub const CKM_X9_42_DH_KEY_PAIR_GEN: CK_MECHANISM_TYPE = 0x00000030; -pub const CKM_X9_42_DH_DERIVE: CK_MECHANISM_TYPE = 0x00000031; -pub const CKM_X9_42_DH_HYBRID_DERIVE: CK_MECHANISM_TYPE = 0x00000032; -pub const CKM_X9_42_MQV_DERIVE: CK_MECHANISM_TYPE = 0x00000033; -pub const CKM_SHA256_RSA_PKCS: CK_MECHANISM_TYPE = 0x00000040; -pub const CKM_SHA384_RSA_PKCS: CK_MECHANISM_TYPE = 0x00000041; -pub const CKM_SHA512_RSA_PKCS: CK_MECHANISM_TYPE = 0x00000042; -pub const CKM_SHA256_RSA_PKCS_PSS: CK_MECHANISM_TYPE = 0x00000043; -pub const CKM_SHA384_RSA_PKCS_PSS: CK_MECHANISM_TYPE = 0x00000044; -pub const CKM_SHA512_RSA_PKCS_PSS: CK_MECHANISM_TYPE = 0x00000045; -pub const CKM_SHA512_224: CK_MECHANISM_TYPE = 0x00000048; -pub const CKM_SHA512_224_HMAC: CK_MECHANISM_TYPE = 0x00000049; -pub const CKM_SHA512_224_HMAC_GENERAL: CK_MECHANISM_TYPE = 0x0000004A; -pub const CKM_SHA512_224_KEY_DERIVATION: CK_MECHANISM_TYPE = 0x0000004B; -pub const CKM_SHA512_256: CK_MECHANISM_TYPE = 0x0000004C; -pub const CKM_SHA512_256_HMAC: CK_MECHANISM_TYPE = 0x0000004D; -pub const CKM_SHA512_256_HMAC_GENERAL: CK_MECHANISM_TYPE = 0x0000004E; -pub const CKM_SHA512_256_KEY_DERIVATION: CK_MECHANISM_TYPE = 0x0000004F; -pub const CKM_SHA512_T: CK_MECHANISM_TYPE = 0x00000050; -pub const CKM_SHA512_T_HMAC: CK_MECHANISM_TYPE = 0x00000051; -pub const CKM_SHA512_T_HMAC_GENERAL: CK_MECHANISM_TYPE = 0x00000052; -pub const CKM_SHA512_T_KEY_DERIVATION: CK_MECHANISM_TYPE = 0x00000053; -pub const CKM_RC2_KEY_GEN: CK_MECHANISM_TYPE = 0x00000100; -pub const CKM_RC2_ECB: CK_MECHANISM_TYPE = 0x00000101; -pub const CKM_RC2_CBC: CK_MECHANISM_TYPE = 0x00000102; -pub const CKM_RC2_MAC: CK_MECHANISM_TYPE = 0x00000103; -pub const CKM_RC2_MAC_GENERAL: CK_MECHANISM_TYPE = 0x00000104; -pub const CKM_RC2_CBC_PAD: CK_MECHANISM_TYPE = 0x00000105; -pub const CKM_RC4_KEY_GEN: CK_MECHANISM_TYPE = 0x00000110; -pub const CKM_RC4: CK_MECHANISM_TYPE = 0x00000111; -pub const CKM_DES_KEY_GEN: CK_MECHANISM_TYPE = 0x00000120; -pub const CKM_DES_ECB: CK_MECHANISM_TYPE = 0x00000121; -pub const CKM_DES_CBC: CK_MECHANISM_TYPE = 0x00000122; -pub const CKM_DES_MAC: CK_MECHANISM_TYPE = 0x00000123; -pub const CKM_DES_MAC_GENERAL: CK_MECHANISM_TYPE = 0x00000124; -pub const CKM_DES_CBC_PAD: CK_MECHANISM_TYPE = 0x00000125; -pub const CKM_DES2_KEY_GEN: CK_MECHANISM_TYPE = 0x00000130; -pub const CKM_DES3_KEY_GEN: CK_MECHANISM_TYPE = 0x00000131; -pub const CKM_DES3_ECB: CK_MECHANISM_TYPE = 0x00000132; -pub const CKM_DES3_CBC: CK_MECHANISM_TYPE = 0x00000133; -pub const CKM_DES3_MAC: CK_MECHANISM_TYPE = 0x00000134; -pub const CKM_DES3_MAC_GENERAL: CK_MECHANISM_TYPE = 0x00000135; -pub const CKM_DES3_CBC_PAD: CK_MECHANISM_TYPE = 0x00000136; -pub const CKM_DES3_CMAC_GENERAL: CK_MECHANISM_TYPE = 0x00000137; -pub const CKM_DES3_CMAC: CK_MECHANISM_TYPE = 0x00000138; -pub const CKM_CDMF_KEY_GEN: CK_MECHANISM_TYPE = 0x00000140; -pub const CKM_CDMF_ECB: CK_MECHANISM_TYPE = 0x00000141; -pub const CKM_CDMF_CBC: CK_MECHANISM_TYPE = 0x00000142; -pub const CKM_CDMF_MAC: CK_MECHANISM_TYPE = 0x00000143; -pub const CKM_CDMF_MAC_GENERAL: CK_MECHANISM_TYPE = 0x00000144; -pub const CKM_CDMF_CBC_PAD: CK_MECHANISM_TYPE = 0x00000145; -pub const CKM_DES_OFB64: CK_MECHANISM_TYPE = 0x00000150; -pub const CKM_DES_OFB8: CK_MECHANISM_TYPE = 0x00000151; -pub const CKM_DES_CFB64: CK_MECHANISM_TYPE = 0x00000152; -pub const CKM_DES_CFB8: CK_MECHANISM_TYPE = 0x00000153; -pub const CKM_MD2: CK_MECHANISM_TYPE = 0x00000200; -pub const CKM_MD2_HMAC: CK_MECHANISM_TYPE = 0x00000201; -pub const CKM_MD2_HMAC_GENERAL: CK_MECHANISM_TYPE = 0x00000202; -pub const CKM_MD5: CK_MECHANISM_TYPE = 0x00000210; -pub const CKM_MD5_HMAC: CK_MECHANISM_TYPE = 0x00000211; -pub const CKM_MD5_HMAC_GENERAL: CK_MECHANISM_TYPE = 0x00000212; -pub const CKM_SHA_1: CK_MECHANISM_TYPE = 0x00000220; -pub const CKM_SHA_1_HMAC: CK_MECHANISM_TYPE = 0x00000221; -pub const CKM_SHA_1_HMAC_GENERAL: CK_MECHANISM_TYPE = 0x00000222; -pub const CKM_RIPEMD128: CK_MECHANISM_TYPE = 0x00000230; -pub const CKM_RIPEMD128_HMAC: CK_MECHANISM_TYPE = 0x00000231; -pub const CKM_RIPEMD128_HMAC_GENERAL: CK_MECHANISM_TYPE = 0x00000232; -pub const CKM_RIPEMD160: CK_MECHANISM_TYPE = 0x00000240; -pub const CKM_RIPEMD160_HMAC: CK_MECHANISM_TYPE = 0x00000241; -pub const CKM_RIPEMD160_HMAC_GENERAL: CK_MECHANISM_TYPE = 0x00000242; -pub const CKM_SHA256: CK_MECHANISM_TYPE = 0x00000250; -pub const CKM_SHA256_HMAC: CK_MECHANISM_TYPE = 0x00000251; -pub const CKM_SHA256_HMAC_GENERAL: CK_MECHANISM_TYPE = 0x00000252; -pub const CKM_SHA384: CK_MECHANISM_TYPE = 0x00000260; -pub const CKM_SHA384_HMAC: CK_MECHANISM_TYPE = 0x00000261; -pub const CKM_SHA384_HMAC_GENERAL: CK_MECHANISM_TYPE = 0x00000262; -pub const CKM_SHA512: CK_MECHANISM_TYPE = 0x00000270; -pub const CKM_SHA512_HMAC: CK_MECHANISM_TYPE = 0x00000271; -pub const CKM_SHA512_HMAC_GENERAL: CK_MECHANISM_TYPE = 0x00000272; -pub const CKM_SECURID_KEY_GEN: CK_MECHANISM_TYPE = 0x00000280; -pub const CKM_SECURID: CK_MECHANISM_TYPE = 0x00000282; -pub const CKM_HOTP_KEY_GEN: CK_MECHANISM_TYPE = 0x00000290; -pub const CKM_HOTP: CK_MECHANISM_TYPE = 0x00000291; -pub const CKM_ACTI: CK_MECHANISM_TYPE = 0x000002A0; -pub const CKM_ACTI_KEY_GEN: CK_MECHANISM_TYPE = 0x000002A1; -pub const CKM_CAST_KEY_GEN: CK_MECHANISM_TYPE = 0x00000300; -pub const CKM_CAST_ECB: CK_MECHANISM_TYPE = 0x00000301; -pub const CKM_CAST_CBC: CK_MECHANISM_TYPE = 0x00000302; -pub const CKM_CAST_MAC: CK_MECHANISM_TYPE = 0x00000303; -pub const CKM_CAST_MAC_GENERAL: CK_MECHANISM_TYPE = 0x00000304; -pub const CKM_CAST_CBC_PAD: CK_MECHANISM_TYPE = 0x00000305; -pub const CKM_CAST3_KEY_GEN: CK_MECHANISM_TYPE = 0x00000310; -pub const CKM_CAST3_ECB: CK_MECHANISM_TYPE = 0x00000311; -pub const CKM_CAST3_CBC: CK_MECHANISM_TYPE = 0x00000312; -pub const CKM_CAST3_MAC: CK_MECHANISM_TYPE = 0x00000313; -pub const CKM_CAST3_MAC_GENERAL: CK_MECHANISM_TYPE = 0x00000314; -pub const CKM_CAST3_CBC_PAD: CK_MECHANISM_TYPE = 0x00000315; -pub const CKM_CAST5_KEY_GEN: CK_MECHANISM_TYPE = 0x00000320; -pub const CKM_CAST128_KEY_GEN: CK_MECHANISM_TYPE = 0x00000320; -pub const CKM_CAST5_ECB: CK_MECHANISM_TYPE = 0x00000321; -pub const CKM_CAST128_ECB: CK_MECHANISM_TYPE = 0x00000321; -pub const CKM_CAST5_CBC: CK_MECHANISM_TYPE = CKM_CAST128_CBC; -pub const CKM_CAST128_CBC: CK_MECHANISM_TYPE = 0x00000322; -pub const CKM_CAST5_MAC: CK_MECHANISM_TYPE = CKM_CAST128_MAC; -pub const CKM_CAST128_MAC: CK_MECHANISM_TYPE = 0x00000323; -pub const CKM_CAST5_MAC_GENERAL: CK_MECHANISM_TYPE = CKM_CAST128_MAC_GENERAL; -pub const CKM_CAST128_MAC_GENERAL: CK_MECHANISM_TYPE = 0x00000324; -pub const CKM_CAST5_CBC_PAD: CK_MECHANISM_TYPE = CKM_CAST128_CBC_PAD; -pub const CKM_CAST128_CBC_PAD: CK_MECHANISM_TYPE = 0x00000325; -pub const CKM_RC5_KEY_GEN: CK_MECHANISM_TYPE = 0x00000330; -pub const CKM_RC5_ECB: CK_MECHANISM_TYPE = 0x00000331; -pub const CKM_RC5_CBC: CK_MECHANISM_TYPE = 0x00000332; -pub const CKM_RC5_MAC: CK_MECHANISM_TYPE = 0x00000333; -pub const CKM_RC5_MAC_GENERAL: CK_MECHANISM_TYPE = 0x00000334; -pub const CKM_RC5_CBC_PAD: CK_MECHANISM_TYPE = 0x00000335; -pub const CKM_IDEA_KEY_GEN: CK_MECHANISM_TYPE = 0x00000340; -pub const CKM_IDEA_ECB: CK_MECHANISM_TYPE = 0x00000341; -pub const CKM_IDEA_CBC: CK_MECHANISM_TYPE = 0x00000342; -pub const CKM_IDEA_MAC: CK_MECHANISM_TYPE = 0x00000343; -pub const CKM_IDEA_MAC_GENERAL: CK_MECHANISM_TYPE = 0x00000344; -pub const CKM_IDEA_CBC_PAD: CK_MECHANISM_TYPE = 0x00000345; -pub const CKM_GENERIC_SECRET_KEY_GEN: CK_MECHANISM_TYPE = 0x00000350; -pub const CKM_CONCATENATE_BASE_AND_KEY: CK_MECHANISM_TYPE = 0x00000360; -pub const CKM_CONCATENATE_BASE_AND_DATA: CK_MECHANISM_TYPE = 0x00000362; -pub const CKM_CONCATENATE_DATA_AND_BASE: CK_MECHANISM_TYPE = 0x00000363; -pub const CKM_XOR_BASE_AND_DATA: CK_MECHANISM_TYPE = 0x00000364; -pub const CKM_EXTRACT_KEY_FROM_KEY: CK_MECHANISM_TYPE = 0x00000365; -pub const CKM_SSL3_PRE_MASTER_KEY_GEN: CK_MECHANISM_TYPE = 0x00000370; -pub const CKM_SSL3_MASTER_KEY_DERIVE: CK_MECHANISM_TYPE = 0x00000371; -pub const CKM_SSL3_KEY_AND_MAC_DERIVE: CK_MECHANISM_TYPE = 0x00000372; -pub const CKM_SSL3_MASTER_KEY_DERIVE_DH: CK_MECHANISM_TYPE = 0x00000373; -pub const CKM_TLS_PRE_MASTER_KEY_GEN: CK_MECHANISM_TYPE = 0x00000374; -pub const CKM_TLS_MASTER_KEY_DERIVE: CK_MECHANISM_TYPE = 0x00000375; -pub const CKM_TLS_KEY_AND_MAC_DERIVE: CK_MECHANISM_TYPE = 0x00000376; -pub const CKM_TLS_MASTER_KEY_DERIVE_DH: CK_MECHANISM_TYPE = 0x00000377; -pub const CKM_TLS_PRF: CK_MECHANISM_TYPE = 0x00000378; -pub const CKM_SSL3_MD5_MAC: CK_MECHANISM_TYPE = 0x00000380; -pub const CKM_SSL3_SHA1_MAC: CK_MECHANISM_TYPE = 0x00000381; -pub const CKM_MD5_KEY_DERIVATION: CK_MECHANISM_TYPE = 0x00000390; -pub const CKM_MD2_KEY_DERIVATION: CK_MECHANISM_TYPE = 0x00000391; -pub const CKM_SHA1_KEY_DERIVATION: CK_MECHANISM_TYPE = 0x00000392; -pub const CKM_SHA256_KEY_DERIVATION: CK_MECHANISM_TYPE = 0x00000393; -pub const CKM_SHA384_KEY_DERIVATION: CK_MECHANISM_TYPE = 0x00000394; -pub const CKM_SHA512_KEY_DERIVATION: CK_MECHANISM_TYPE = 0x00000395; -pub const CKM_PBE_MD2_DES_CBC: CK_MECHANISM_TYPE = 0x000003A0; -pub const CKM_PBE_MD5_DES_CBC: CK_MECHANISM_TYPE = 0x000003A1; -pub const CKM_PBE_MD5_CAST_CBC: CK_MECHANISM_TYPE = 0x000003A2; -pub const CKM_PBE_MD5_CAST3_CBC: CK_MECHANISM_TYPE = 0x000003A3; -pub const CKM_PBE_MD5_CAST5_CBC: CK_MECHANISM_TYPE = CKM_PBE_MD5_CAST128_CBC; -pub const CKM_PBE_MD5_CAST128_CBC: CK_MECHANISM_TYPE = 0x000003A4; -pub const CKM_PBE_SHA1_CAST5_CBC: CK_MECHANISM_TYPE = CKM_PBE_SHA1_CAST128_CBC; -pub const CKM_PBE_SHA1_CAST128_CBC: CK_MECHANISM_TYPE = 0x000003A5; -pub const CKM_PBE_SHA1_RC4_128: CK_MECHANISM_TYPE = 0x000003A6; -pub const CKM_PBE_SHA1_RC4_40: CK_MECHANISM_TYPE = 0x000003A7; -pub const CKM_PBE_SHA1_DES3_EDE_CBC: CK_MECHANISM_TYPE = 0x000003A8; -pub const CKM_PBE_SHA1_DES2_EDE_CBC: CK_MECHANISM_TYPE = 0x000003A9; -pub const CKM_PBE_SHA1_RC2_128_CBC: CK_MECHANISM_TYPE = 0x000003AA; -pub const CKM_PBE_SHA1_RC2_40_CBC: CK_MECHANISM_TYPE = 0x000003AB; -pub const CKM_PKCS5_PBKD2: CK_MECHANISM_TYPE = 0x000003B0; -pub const CKM_PBA_SHA1_WITH_SHA1_HMAC: CK_MECHANISM_TYPE = 0x000003C0; -pub const CKM_WTLS_PRE_MASTER_KEY_GEN: CK_MECHANISM_TYPE = 0x000003D0; -pub const CKM_WTLS_MASTER_KEY_DERIVE: CK_MECHANISM_TYPE = 0x000003D1; -pub const CKM_WTLS_MASTER_KEY_DERIVE_DH_ECC: CK_MECHANISM_TYPE = 0x000003D2; -pub const CKM_WTLS_PRF: CK_MECHANISM_TYPE = 0x000003D3; -pub const CKM_WTLS_SERVER_KEY_AND_MAC_DERIVE: CK_MECHANISM_TYPE = 0x000003D4; -pub const CKM_WTLS_CLIENT_KEY_AND_MAC_DERIVE: CK_MECHANISM_TYPE = 0x000003D5; -pub const CKM_TLS10_MAC_SERVER: CK_MECHANISM_TYPE = 0x000003D6; -pub const CKM_TLS10_MAC_CLIENT: CK_MECHANISM_TYPE = 0x000003D7; -pub const CKM_TLS12_MAC: CK_MECHANISM_TYPE = 0x000003D8; -pub const CKM_TLS12_KDF: CK_MECHANISM_TYPE = 0x000003D9; -pub const CKM_TLS12_MASTER_KEY_DERIVE: CK_MECHANISM_TYPE = 0x000003E0; -pub const CKM_TLS12_KEY_AND_MAC_DERIVE: CK_MECHANISM_TYPE = 0x000003E1; -pub const CKM_TLS12_MASTER_KEY_DERIVE_DH: CK_MECHANISM_TYPE = 0x000003E2; -pub const CKM_TLS12_KEY_SAFE_DERIVE: CK_MECHANISM_TYPE = 0x000003E3; -pub const CKM_TLS_MAC: CK_MECHANISM_TYPE = 0x000003E4; -pub const CKM_TLS_KDF: CK_MECHANISM_TYPE = 0x000003E5; -pub const CKM_KEY_WRAP_LYNKS: CK_MECHANISM_TYPE = 0x00000400; -pub const CKM_KEY_WRAP_SET_OAEP: CK_MECHANISM_TYPE = 0x00000401; -pub const CKM_CMS_SIG: CK_MECHANISM_TYPE = 0x00000500; -pub const CKM_KIP_DERIVE: CK_MECHANISM_TYPE = 0x00000510; -pub const CKM_KIP_WRAP: CK_MECHANISM_TYPE = 0x00000511; -pub const CKM_KIP_MAC: CK_MECHANISM_TYPE = 0x00000512; -pub const CKM_CAMELLIA_KEY_GEN: CK_MECHANISM_TYPE = 0x00000550; -pub const CKM_CAMELLIA_CTR: CK_MECHANISM_TYPE = 0x00000558; -pub const CKM_ARIA_KEY_GEN: CK_MECHANISM_TYPE = 0x00000560; -pub const CKM_ARIA_ECB: CK_MECHANISM_TYPE = 0x00000561; -pub const CKM_ARIA_CBC: CK_MECHANISM_TYPE = 0x00000562; -pub const CKM_ARIA_MAC: CK_MECHANISM_TYPE = 0x00000563; -pub const CKM_ARIA_MAC_GENERAL: CK_MECHANISM_TYPE = 0x00000564; -pub const CKM_ARIA_CBC_PAD: CK_MECHANISM_TYPE = 0x00000565; -pub const CKM_ARIA_ECB_ENCRYPT_DATA: CK_MECHANISM_TYPE = 0x00000566; -pub const CKM_ARIA_CBC_ENCRYPT_DATA: CK_MECHANISM_TYPE = 0x00000567; -pub const CKM_SEED_KEY_GEN: CK_MECHANISM_TYPE = 0x00000650; -pub const CKM_SEED_ECB: CK_MECHANISM_TYPE = 0x00000651; -pub const CKM_SEED_CBC: CK_MECHANISM_TYPE = 0x00000652; -pub const CKM_SEED_MAC: CK_MECHANISM_TYPE = 0x00000653; -pub const CKM_SEED_MAC_GENERAL: CK_MECHANISM_TYPE = 0x00000654; -pub const CKM_SEED_CBC_PAD: CK_MECHANISM_TYPE = 0x00000655; -pub const CKM_SEED_ECB_ENCRYPT_DATA: CK_MECHANISM_TYPE = 0x00000656; -pub const CKM_SEED_CBC_ENCRYPT_DATA: CK_MECHANISM_TYPE = 0x00000657; -pub const CKM_SKIPJACK_KEY_GEN: CK_MECHANISM_TYPE = 0x00001000; -pub const CKM_SKIPJACK_ECB64: CK_MECHANISM_TYPE = 0x00001001; -pub const CKM_SKIPJACK_CBC64: CK_MECHANISM_TYPE = 0x00001002; -pub const CKM_SKIPJACK_OFB64: CK_MECHANISM_TYPE = 0x00001003; -pub const CKM_SKIPJACK_CFB64: CK_MECHANISM_TYPE = 0x00001004; -pub const CKM_SKIPJACK_CFB32: CK_MECHANISM_TYPE = 0x00001005; -pub const CKM_SKIPJACK_CFB16: CK_MECHANISM_TYPE = 0x00001006; -pub const CKM_SKIPJACK_CFB8: CK_MECHANISM_TYPE = 0x00001007; -pub const CKM_SKIPJACK_WRAP: CK_MECHANISM_TYPE = 0x00001008; -pub const CKM_SKIPJACK_PRIVATE_WRAP: CK_MECHANISM_TYPE = 0x00001009; -pub const CKM_SKIPJACK_RELAYX: CK_MECHANISM_TYPE = 0x0000100a; -pub const CKM_KEA_KEY_PAIR_GEN: CK_MECHANISM_TYPE = 0x00001010; -pub const CKM_KEA_KEY_DERIVE: CK_MECHANISM_TYPE = 0x00001011; -pub const CKM_FORTEZZA_TIMESTAMP: CK_MECHANISM_TYPE = 0x00001020; -pub const CKM_BATON_KEY_GEN: CK_MECHANISM_TYPE = 0x00001030; -pub const CKM_BATON_ECB128: CK_MECHANISM_TYPE = 0x00001031; -pub const CKM_BATON_ECB96: CK_MECHANISM_TYPE = 0x00001032; -pub const CKM_BATON_CBC128: CK_MECHANISM_TYPE = 0x00001033; -pub const CKM_BATON_COUNTER: CK_MECHANISM_TYPE = 0x00001034; -pub const CKM_BATON_SHUFFLE: CK_MECHANISM_TYPE = 0x00001035; -pub const CKM_BATON_WRAP: CK_MECHANISM_TYPE = 0x00001036; -pub const CKM_ECDSA_KEY_PAIR_GEN: CK_MECHANISM_TYPE = CKM_EC_KEY_PAIR_GEN; -pub const CKM_EC_KEY_PAIR_GEN: CK_MECHANISM_TYPE = 0x00001040; -pub const CKM_ECDSA: CK_MECHANISM_TYPE = 0x00001041; -pub const CKM_ECDSA_SHA1: CK_MECHANISM_TYPE = 0x00001042; -pub const CKM_ECDSA_SHA224: CK_MECHANISM_TYPE = 0x00001043; -pub const CKM_ECDSA_SHA256: CK_MECHANISM_TYPE = 0x00001044; -pub const CKM_ECDSA_SHA384: CK_MECHANISM_TYPE = 0x00001045; -pub const CKM_ECDSA_SHA512: CK_MECHANISM_TYPE = 0x00001046; -pub const CKM_ECDH1_DERIVE: CK_MECHANISM_TYPE = 0x00001050; -pub const CKM_ECDH1_COFACTOR_DERIVE: CK_MECHANISM_TYPE = 0x00001051; -pub const CKM_ECMQV_DERIVE: CK_MECHANISM_TYPE = 0x00001052; -pub const CKM_ECDH_AES_KEY_WRAP: CK_MECHANISM_TYPE = 0x00001053; -pub const CKM_RSA_AES_KEY_WRAP: CK_MECHANISM_TYPE = 0x00001054; -pub const CKM_JUNIPER_KEY_GEN: CK_MECHANISM_TYPE = 0x00001060; -pub const CKM_JUNIPER_ECB128: CK_MECHANISM_TYPE = 0x00001061; -pub const CKM_JUNIPER_CBC128: CK_MECHANISM_TYPE = 0x00001062; -pub const CKM_JUNIPER_COUNTER: CK_MECHANISM_TYPE = 0x00001063; -pub const CKM_JUNIPER_SHUFFLE: CK_MECHANISM_TYPE = 0x00001064; -pub const CKM_JUNIPER_WRAP: CK_MECHANISM_TYPE = 0x00001065; -pub const CKM_FASTHASH: CK_MECHANISM_TYPE = 0x00001070; -pub const CKM_AES_KEY_GEN: CK_MECHANISM_TYPE = 0x00001080; -pub const CKM_AES_ECB: CK_MECHANISM_TYPE = 0x00001081; -pub const CKM_AES_CBC: CK_MECHANISM_TYPE = 0x00001082; -pub const CKM_AES_MAC: CK_MECHANISM_TYPE = 0x00001083; -pub const CKM_AES_MAC_GENERAL: CK_MECHANISM_TYPE = 0x00001084; -pub const CKM_AES_CBC_PAD: CK_MECHANISM_TYPE = 0x00001085; -pub const CKM_AES_CTR: CK_MECHANISM_TYPE = 0x00001086; -pub const CKM_AES_GCM: CK_MECHANISM_TYPE = 0x00001087; -pub const CKM_AES_CCM: CK_MECHANISM_TYPE = 0x00001088; -pub const CKM_AES_CTS: CK_MECHANISM_TYPE = 0x00001089; -pub const CKM_AES_CMAC: CK_MECHANISM_TYPE = 0x0000108A; -pub const CKM_AES_CMAC_GENERAL: CK_MECHANISM_TYPE = 0x0000108B; -pub const CKM_AES_XCBC_MAC: CK_MECHANISM_TYPE = 0x0000108C; -pub const CKM_AES_XCBC_MAC_96: CK_MECHANISM_TYPE = 0x0000108D; -pub const CKM_AES_GMAC: CK_MECHANISM_TYPE = 0x0000108E; -pub const CKM_BLOWFISH_KEY_GEN: CK_MECHANISM_TYPE = 0x00001090; -pub const CKM_BLOWFISH_CBC: CK_MECHANISM_TYPE = 0x00001091; -pub const CKM_TWOFISH_KEY_GEN: CK_MECHANISM_TYPE = 0x00001092; -pub const CKM_TWOFISH_CBC: CK_MECHANISM_TYPE = 0x00001093; -pub const CKM_BLOWFISH_CBC_PAD: CK_MECHANISM_TYPE = 0x00001094; -pub const CKM_TWOFISH_CBC_PAD: CK_MECHANISM_TYPE = 0x00001095; -pub const CKM_DES_ECB_ENCRYPT_DATA: CK_MECHANISM_TYPE = 0x00001100; -pub const CKM_DES_CBC_ENCRYPT_DATA: CK_MECHANISM_TYPE = 0x00001101; -pub const CKM_DES3_ECB_ENCRYPT_DATA: CK_MECHANISM_TYPE = 0x00001102; -pub const CKM_DES3_CBC_ENCRYPT_DATA: CK_MECHANISM_TYPE = 0x00001103; -pub const CKM_AES_ECB_ENCRYPT_DATA: CK_MECHANISM_TYPE = 0x00001104; -pub const CKM_AES_CBC_ENCRYPT_DATA: CK_MECHANISM_TYPE = 0x00001105; -pub const CKM_GOSTR3410_KEY_PAIR_GEN: CK_MECHANISM_TYPE = 0x00001200; -pub const CKM_GOSTR3410: CK_MECHANISM_TYPE = 0x00001201; -pub const CKM_GOSTR3410_WITH_GOSTR3411: CK_MECHANISM_TYPE = 0x00001202; -pub const CKM_GOSTR3410_KEY_WRAP: CK_MECHANISM_TYPE = 0x00001203; -pub const CKM_GOSTR3410_DERIVE: CK_MECHANISM_TYPE = 0x00001204; -pub const CKM_GOSTR3411: CK_MECHANISM_TYPE = 0x00001210; -pub const CKM_GOSTR3411_HMAC: CK_MECHANISM_TYPE = 0x00001211; -pub const CKM_GOST28147_KEY_GEN: CK_MECHANISM_TYPE = 0x00001220; -pub const CKM_GOST28147_ECB: CK_MECHANISM_TYPE = 0x00001221; -pub const CKM_GOST28147: CK_MECHANISM_TYPE = 0x00001222; -pub const CKM_GOST28147_MAC: CK_MECHANISM_TYPE = 0x00001223; -pub const CKM_GOST28147_KEY_WRAP: CK_MECHANISM_TYPE = 0x00001224; -pub const CKM_DSA_PARAMETER_GEN: CK_MECHANISM_TYPE = 0x00002000; -pub const CKM_DH_PKCS_PARAMETER_GEN: CK_MECHANISM_TYPE = 0x00002001; -pub const CKM_X9_42_DH_PARAMETER_GEN: CK_MECHANISM_TYPE = 0x00002002; -pub const CKM_DSA_PROBABLISTIC_PARAMETER_GEN: CK_MECHANISM_TYPE = 0x00002003; -pub const CKM_DSA_SHAWE_TAYLOR_PARAMETER_GEN: CK_MECHANISM_TYPE = 0x00002004; -pub const CKM_AES_OFB: CK_MECHANISM_TYPE = 0x00002104; -pub const CKM_AES_CFB64: CK_MECHANISM_TYPE = 0x00002105; -pub const CKM_AES_CFB8: CK_MECHANISM_TYPE = 0x00002106; -pub const CKM_AES_CFB128: CK_MECHANISM_TYPE = 0x00002107; -pub const CKM_AES_CFB1: CK_MECHANISM_TYPE = 0x00002108; -pub const CKM_VENDOR_DEFINED: CK_MECHANISM_TYPE = 0x80000000; -pub const CKM_SHA224: CK_MECHANISM_TYPE = 0x00000255; -pub const CKM_SHA224_HMAC: CK_MECHANISM_TYPE = 0x00000256; -pub const CKM_SHA224_HMAC_GENERAL: CK_MECHANISM_TYPE = 0x00000257; -pub const CKM_SHA224_RSA_PKCS: CK_MECHANISM_TYPE = 0x00000046; -pub const CKM_SHA224_RSA_PKCS_PSS: CK_MECHANISM_TYPE = 0x00000047; -pub const CKM_SHA224_KEY_DERIVATION: CK_MECHANISM_TYPE = 0x00000396; -pub const CKM_CAMELLIA_ECB: CK_MECHANISM_TYPE = 0x00000551; -pub const CKM_CAMELLIA_CBC: CK_MECHANISM_TYPE = 0x00000552; -pub const CKM_CAMELLIA_MAC: CK_MECHANISM_TYPE = 0x00000553; -pub const CKM_CAMELLIA_MAC_GENERAL: CK_MECHANISM_TYPE = 0x00000554; -pub const CKM_CAMELLIA_CBC_PAD: CK_MECHANISM_TYPE = 0x00000555; -pub const CKM_CAMELLIA_ECB_ENCRYPT_DATA: CK_MECHANISM_TYPE = 0x00000556; -pub const CKM_CAMELLIA_CBC_ENCRYPT_DATA: CK_MECHANISM_TYPE = 0x00000557; -pub const CKM_AES_KEY_WRAP: CK_MECHANISM_TYPE = 0x00002109; -pub const CKM_AES_KEY_WRAP_PAD: CK_MECHANISM_TYPE = 0x0000210A; -pub const CKM_RSA_PKCS_TPM_1_1: CK_MECHANISM_TYPE = 0x00004001; -pub const CKM_RSA_PKCS_OAEP_TPM_1_1: CK_MECHANISM_TYPE = 0x00004002; -pub const CKM_EC_EDWARDS_KEY_PAIR_GEN: CK_MECHANISM_TYPE = 0x00001055; -pub const CKM_EC_MONTGOMERY_KEY_PAIR_GEN: CK_MECHANISM_TYPE = 0x00001056; -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 CKF_NEXT_OTP: CK_FLAGS = 0x00000001; -pub const CKF_EXCLUDE_TIME: CK_FLAGS = 0x00000002; -pub const CKF_EXCLUDE_COUNTER: CK_FLAGS = 0x00000004; -pub const CKF_EXCLUDE_CHALLENGE: CK_FLAGS = 0x00000008; -pub const CKF_EXCLUDE_PIN: CK_FLAGS = 0x00000010; -pub const CKF_USER_FRIENDLY_OTP: CK_FLAGS = 0x00000020; -pub const CKN_OTP_CHANGED: CK_NOTIFICATION = 1; -pub const CKG_MGF1_SHA1: CK_RSA_PKCS_MGF_TYPE = 0x00000001; -pub const CKG_MGF1_SHA224: CK_RSA_PKCS_MGF_TYPE = 0x00000005; -pub const CKG_MGF1_SHA256: CK_RSA_PKCS_MGF_TYPE = 0x00000002; -pub const CKG_MGF1_SHA384: CK_RSA_PKCS_MGF_TYPE = 0x00000003; -pub const CKG_MGF1_SHA512: CK_RSA_PKCS_MGF_TYPE = 0x00000004; -pub const CKD_NULL: CK_EC_KDF_TYPE = 0x00000001; -pub const CKD_SHA1_KDF: CK_EC_KDF_TYPE = 0x00000002; -pub const CKD_SHA1_KDF_ASN1: CK_X9_42_DH_KDF_TYPE = 0x00000003; -pub const CKD_SHA1_KDF_CONCATENATE: CK_X9_42_DH_KDF_TYPE = 0x00000004; -pub const CKD_SHA224_KDF: CK_X9_42_DH_KDF_TYPE = 0x00000005; -pub const CKD_SHA256_KDF: CK_X9_42_DH_KDF_TYPE = 0x00000006; -pub const CKD_SHA384_KDF: CK_X9_42_DH_KDF_TYPE = 0x00000007; -pub const CKD_SHA512_KDF: CK_X9_42_DH_KDF_TYPE = 0x00000008; -pub const CKD_CPDIVERSIFY_KDF: CK_X9_42_DH_KDF_TYPE = 0x00000009; -pub const CKF_HW: CK_FLAGS = 0x00000001; /* performed by HW */ -pub const CKF_ENCRYPT: CK_FLAGS = 0x00000100; -pub const CKF_DECRYPT: CK_FLAGS = 0x00000200; -pub const CKF_DIGEST: CK_FLAGS = 0x00000400; -pub const CKF_SIGN: CK_FLAGS = 0x00000800; -pub const CKF_SIGN_RECOVER: CK_FLAGS = 0x00001000; -pub const CKF_VERIFY: CK_FLAGS = 0x00002000; -pub const CKF_VERIFY_RECOVER: CK_FLAGS = 0x00004000; -pub const CKF_GENERATE: CK_FLAGS = 0x00008000; -pub const CKF_GENERATE_KEY_PAIR: CK_FLAGS = 0x00010000; -pub const CKF_WRAP: CK_FLAGS = 0x00020000; -pub const CKF_UNWRAP: CK_FLAGS = 0x00040000; -pub const CKF_DERIVE: CK_FLAGS = 0x00080000; pub const CKF_EXTENSION: CK_FLAGS = 0x80000000; -pub const CKF_EC_F_P: CK_FLAGS = 0x00100000; -pub const CKF_EC_F_2M: CK_FLAGS = 0x00200000; -pub const CKF_EC_ECPARAMETERS: CK_FLAGS = 0x00400000; -pub const CKF_EC_NAMEDCURVE: CK_FLAGS = 0x00800000; -pub const CKF_EC_UNCOMPRESS: CK_FLAGS = 0x01000000; -pub const CKF_EC_COMPRESS: CK_FLAGS = 0x02000000; -pub const CKF_DONT_BLOCK: CK_FLAGS = 1; -pub const CKF_LIBRARY_CANT_CREATE_OS_THREADS: CK_FLAGS = 0x00000001; -pub const CKF_OS_LOCKING_OK: CK_FLAGS = 0x00000002; -pub const CKR_OK: CK_RV = 0x00000000; -pub const CKR_CANCEL: CK_RV = 0x00000001; -pub const CKR_HOST_MEMORY: CK_RV = 0x00000002; -pub const CKR_SLOT_ID_INVALID: CK_RV = 0x00000003; -pub const CKR_GENERAL_ERROR: CK_RV = 0x00000005; -pub const CKR_FUNCTION_FAILED: CK_RV = 0x00000006; -pub const CKR_ARGUMENTS_BAD: CK_RV = 0x00000007; -pub const CKR_NO_EVENT: CK_RV = 0x00000008; -pub const CKR_NEED_TO_CREATE_THREADS: CK_RV = 0x00000009; -pub const CKR_CANT_LOCK: CK_RV = 0x0000000A; -pub const CKR_ATTRIBUTE_READ_ONLY: CK_RV = 0x00000010; -pub const CKR_ATTRIBUTE_SENSITIVE: CK_RV = 0x00000011; -pub const CKR_ATTRIBUTE_TYPE_INVALID: CK_RV = 0x00000012; -pub const CKR_ATTRIBUTE_VALUE_INVALID: CK_RV = 0x00000013; -pub const CKR_ACTION_PROHIBITED: CK_RV = 0x0000001B; -pub const CKR_DATA_INVALID: CK_RV = 0x00000020; -pub const CKR_DATA_LEN_RANGE: CK_RV = 0x00000021; -pub const CKR_DEVICE_ERROR: CK_RV = 0x00000030; -pub const CKR_DEVICE_MEMORY: CK_RV = 0x00000031; -pub const CKR_DEVICE_REMOVED: CK_RV = 0x00000032; -pub const CKR_ENCRYPTED_DATA_INVALID: CK_RV = 0x00000040; -pub const CKR_ENCRYPTED_DATA_LEN_RANGE: CK_RV = 0x00000041; -pub const CKR_FUNCTION_CANCELED: CK_RV = 0x00000050; -pub const CKR_FUNCTION_NOT_PARALLEL: CK_RV = 0x00000051; -pub const CKR_FUNCTION_NOT_SUPPORTED: CK_RV = 0x00000054; -pub const CKR_CURVE_NOT_SUPPORTED: CK_RV = 0x00000140; -pub const CKR_KEY_HANDLE_INVALID: CK_RV = 0x00000060; -pub const CKR_KEY_SIZE_RANGE: CK_RV = 0x00000062; -pub const CKR_KEY_TYPE_INCONSISTENT: CK_RV = 0x00000063; -pub const CKR_KEY_NOT_NEEDED: CK_RV = 0x00000064; -pub const CKR_KEY_CHANGED: CK_RV = 0x00000065; -pub const CKR_KEY_NEEDED: CK_RV = 0x00000066; -pub const CKR_KEY_INDIGESTIBLE: CK_RV = 0x00000067; -pub const CKR_KEY_FUNCTION_NOT_PERMITTED: CK_RV = 0x00000068; -pub const CKR_KEY_NOT_WRAPPABLE: CK_RV = 0x00000069; -pub const CKR_KEY_UNEXTRACTABLE: CK_RV = 0x0000006A; -pub const CKR_MECHANISM_INVALID: CK_RV = 0x00000070; -pub const CKR_MECHANISM_PARAM_INVALID: CK_RV = 0x00000071; -pub const CKR_OBJECT_HANDLE_INVALID: CK_RV = 0x00000082; -pub const CKR_OPERATION_ACTIVE: CK_RV = 0x00000090; -pub const CKR_OPERATION_NOT_INITIALIZED: CK_RV = 0x00000091; -pub const CKR_PIN_INCORRECT: CK_RV = 0x000000A0; -pub const CKR_PIN_INVALID: CK_RV = 0x000000A1; -pub const CKR_PIN_LEN_RANGE: CK_RV = 0x000000A2; -pub const CKR_PIN_EXPIRED: CK_RV = 0x000000A3; -pub const CKR_PIN_LOCKED: CK_RV = 0x000000A4; -pub const CKR_SESSION_CLOSED: CK_RV = 0x000000B0; -pub const CKR_SESSION_COUNT: CK_RV = 0x000000B1; -pub const CKR_SESSION_HANDLE_INVALID: CK_RV = 0x000000B3; -pub const CKR_SESSION_PARALLEL_NOT_SUPPORTED: CK_RV = 0x000000B4; -pub const CKR_SESSION_READ_ONLY: CK_RV = 0x000000B5; -pub const CKR_SESSION_EXISTS: CK_RV = 0x000000B6; -pub const CKR_SESSION_READ_ONLY_EXISTS: CK_RV = 0x000000B7; -pub const CKR_SESSION_READ_WRITE_SO_EXISTS: CK_RV = 0x000000B8; -pub const CKR_SIGNATURE_INVALID: CK_RV = 0x000000C0; -pub const CKR_SIGNATURE_LEN_RANGE: CK_RV = 0x000000C1; -pub const CKR_TEMPLATE_INCOMPLETE: CK_RV = 0x000000D0; -pub const CKR_TEMPLATE_INCONSISTENT: CK_RV = 0x000000D1; -pub const CKR_TOKEN_NOT_PRESENT: CK_RV = 0x000000E0; -pub const CKR_TOKEN_NOT_RECOGNIZED: CK_RV = 0x000000E1; -pub const CKR_TOKEN_WRITE_PROTECTED: CK_RV = 0x000000E2; -pub const CKR_UNWRAPPING_KEY_HANDLE_INVALID: CK_RV = 0x000000F0; -pub const CKR_UNWRAPPING_KEY_SIZE_RANGE: CK_RV = 0x000000F1; -pub const CKR_UNWRAPPING_KEY_TYPE_INCONSISTENT: CK_RV = 0x000000F2; -pub const CKR_USER_ALREADY_LOGGED_IN: CK_RV = 0x00000100; -pub const CKR_USER_NOT_LOGGED_IN: CK_RV = 0x00000101; -pub const CKR_USER_PIN_NOT_INITIALIZED: CK_RV = 0x00000102; -pub const CKR_USER_TYPE_INVALID: CK_RV = 0x00000103; -pub const CKR_USER_ANOTHER_ALREADY_LOGGED_IN: CK_RV = 0x00000104; -pub const CKR_USER_TOO_MANY_TYPES: CK_RV = 0x00000105; -pub const CKR_WRAPPED_KEY_INVALID: CK_RV = 0x00000110; -pub const CKR_WRAPPED_KEY_LEN_RANGE: CK_RV = 0x00000112; -pub const CKR_WRAPPING_KEY_HANDLE_INVALID: CK_RV = 0x00000113; -pub const CKR_WRAPPING_KEY_SIZE_RANGE: CK_RV = 0x00000114; -pub const CKR_WRAPPING_KEY_TYPE_INCONSISTENT: CK_RV = 0x00000115; -pub const CKR_RANDOM_SEED_NOT_SUPPORTED: CK_RV = 0x00000120; -pub const CKR_RANDOM_NO_RNG: CK_RV = 0x00000121; -pub const CKR_DOMAIN_PARAMS_INVALID: CK_RV = 0x00000130; -pub const CKR_BUFFER_TOO_SMALL: CK_RV = 0x00000150; -pub const CKR_SAVED_STATE_INVALID: CK_RV = 0x00000160; -pub const CKR_INFORMATION_SENSITIVE: CK_RV = 0x00000170; -pub const CKR_STATE_UNSAVEABLE: CK_RV = 0x00000180; -pub const CKR_CRYPTOKI_NOT_INITIALIZED: CK_RV = 0x00000190; -pub const CKR_CRYPTOKI_ALREADY_INITIALIZED: CK_RV = 0x00000191; -pub const CKR_MUTEX_BAD: CK_RV = 0x000001A0; -pub const CKR_MUTEX_NOT_LOCKED: CK_RV = 0x000001A1; -pub const CKR_NEW_PIN_MODE: CK_RV = 0x000001B0; -pub const CKR_NEXT_OTP: CK_RV = 0x000001B1; -pub const CKR_EXCEEDED_MAX_ITERATIONS: CK_RV = 0x000001B5; -pub const CKR_FIPS_SELF_TEST_FAILED: CK_RV = 0x000001B6; -pub const CKR_LIBRARY_LOAD_FAILED: CK_RV = 0x000001B7; -pub const CKR_PIN_TOO_WEAK: CK_RV = 0x000001B8; -pub const CKR_PUBLIC_KEY_INVALID: CK_RV = 0x000001B9; -pub const CKR_FUNCTION_REJECTED: CK_RV = 0x00000200; +pub const CKK_EC_MONTGOMERY: CK_KEY_TYPE = 0x00000041; pub const CKR_VENDOR_DEFINED: CK_RV = 0x80000000; -pub const CKZ_DATA_SPECIFIED: CK_RSA_PKCS_OAEP_SOURCE_TYPE = 0x00000001; -pub const CK_FALSE: CK_BBOOL = 0; -pub const CK_TRUE: CK_BBOOL = 1; +pub const CKR_CURVE_NOT_SUPPORTED: CK_RV = 0x00000140; +pub const CKM_VENDOR_DEFINED: CK_MECHANISM_TYPE = 0x80000000; From adc05a9f8076a0c21fa2057000f24737d09e57f3 Mon Sep 17 00:00:00 2001 From: Gowtham Suresh Kumar Date: Fri, 10 Mar 2023 09:28:02 +0000 Subject: [PATCH 3/6] Configure callbacks for bindgen The bindgen 0.63.0 version needs callbacks configured as the generated bindings has wrong types. Signed-off-by: Gowtham Suresh Kumar --- cryptoki-sys/build.rs | 103 +++++++++++++++++++++++++++++++----------- 1 file changed, 76 insertions(+), 27 deletions(-) diff --git a/cryptoki-sys/build.rs b/cryptoki-sys/build.rs index 7c06b0d0..47fb3946 100644 --- a/cryptoki-sys/build.rs +++ b/cryptoki-sys/build.rs @@ -1,9 +1,9 @@ -// Copyright 2021 Contributors to the Parsec project. +// Copyright 2021,2023 Contributors to the Parsec project. // SPDX-License-Identifier: Apache-2.0 fn main() { #[cfg(feature = "generate-bindings")] { - generate_bindings(); + generate::generate_bindings(); } #[cfg(not(feature = "generate-bindings"))] @@ -33,30 +33,79 @@ fn main() { // Only on a specific feature #[cfg(feature = "generate-bindings")] -fn generate_bindings() { - let bindings = bindgen::Builder::default() - .header("pkcs11.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("*") - // See this issue: https://github.com/parallaxsecond/rust-cryptoki/issues/12 - .blocklist_type("max_align_t") - // 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(bindgen::CargoCallbacks)) - .generate() - .expect("Unable to generate bindings"); +mod generate { + use bindgen::callbacks; + #[derive(Debug)] + pub struct CargoCallbacks; - // 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")) - .expect("Couldn't write bindings!"); + impl callbacks::ParseCallbacks for CargoCallbacks { + fn int_macro(&self, name: &str, _: i64) -> Option { + let prefixes = [ + ("CK_", "CK_ULONG"), + ("CKA_", "CK_ATTRIBUTE_TYPE"), + ("CKC_", "CK_CERTIFICATE_TYPE"), + ("CKD_", "CK_EC_KDF_TYPE"), + ("CKF_", "CK_FLAGS"), + ("CKG_MGF1_", "CK_RSA_PKCS_MGF_TYPE"), + ("CKH_", "CK_HW_FEATURE_TYPE"), + ("CKK_", "CK_KEY_TYPE"), + ("CKM_", "CK_MECHANISM_TYPE"), + ("CKN_", "CK_NOTIFICATION"), + ("CKO_", "CK_OBJECT_CLASS"), + ("CKP_", "CK_PROFILE_ID"), + ("CKR_", "CK_RV"), + ("CKS_", "CK_STATE"), + ("CKU_", "CK_USER_TYPE"), + ("CKZ_", "CK_RSA_PKCS_OAEP_SOURCE_TYPE"), + ("CRYPTOKI_VERSION_", "CK_BYTE"), + ]; + + if ["CK_TRUE", "CK_FALSE"].contains(&name) { + Some(callbacks::IntKind::Custom { + name: "CK_BBOOL", + is_signed: false, + }) + } else { + let mut result = None; + for (prefix, variable) in &prefixes { + if name.starts_with(prefix) { + result = Some(callbacks::IntKind::Custom { + name: variable, + is_signed: false, + }) + } + } + result + } + } + } + + pub fn generate_bindings() { + let bindings = bindgen::Builder::default() + .header("pkcs11.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") + // 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"); + + // 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")) + .expect("Couldn't write bindings!"); + } } From 9d2a795a28d072fae078896518616472cde86aff Mon Sep 17 00:00:00 2001 From: Gowtham Suresh Kumar Date: Fri, 10 Mar 2023 10:58:14 +0000 Subject: [PATCH 4/6] Fix regenerate_bindings.sh The print argument causes the script to fail by passing unnecessary string to the pipe. Signed-off-by: Gowtham Suresh Kumar --- cryptoki-sys/regenerate_bindings.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cryptoki-sys/regenerate_bindings.sh b/cryptoki-sys/regenerate_bindings.sh index 8e44691e..cfb4b47b 100755 --- a/cryptoki-sys/regenerate_bindings.sh +++ b/cryptoki-sys/regenerate_bindings.sh @@ -17,7 +17,7 @@ for target in $targets; do fi cargo build --target "$target" --features generate-bindings - find ../target/"$target"/ -print0 -name "pkcs11_bindings.rs" | xargs -I '{}' cp '{}' src/bindings/"$target".rs + find ../target/"$target"/ -name "pkcs11_bindings.rs" | xargs -I '{}' cp '{}' src/bindings/"$target".rs if [ "$TARGET_INSTALLED" == "$target" ]; then rustup target remove "$target" From 8e9da11ace7bfff0d13091fea69ba325322e4ec8 Mon Sep 17 00:00:00 2001 From: Gowtham Suresh Kumar Date: Fri, 10 Mar 2023 18:31:11 +0000 Subject: [PATCH 5/6] Generate bindings for various architectures The regenerate_bindings.sh is used to automatically generate the bindings for architectures listed in "targets" variable. Signed-off-by: Gowtham Suresh Kumar --- cryptoki-sys/regenerate_bindings.sh | 2 +- .../src/bindings/aarch64-apple-darwin.rs | 2688 ++++++++- .../src/bindings/aarch64-unknown-linux-gnu.rs | 2688 ++++++++- .../src/bindings/arm-unknown-linux-gnueabi.rs | 2688 ++++++++- .../src/bindings/i686-unknown-linux-gnu.rs | 2688 ++++++++- .../bindings/powerpc64-unknown-linux-gnu.rs | 2688 ++++++++- .../src/bindings/x86_64-apple-darwin.rs | 2688 ++++++++- .../src/bindings/x86_64-pc-windows-msvc.rs | 5066 +++++++++++++++++ .../src/bindings/x86_64-unknown-freebsd.rs | 2688 ++++++++- .../src/bindings/x86_64-unknown-linux-gnu.rs | 2688 ++++++++- cryptoki-sys/src/bindings/x86_64-windows.rs | 3113 ---------- cryptoki-sys/src/lib.rs | 2 +- 12 files changed, 24380 insertions(+), 5307 deletions(-) create mode 100644 cryptoki-sys/src/bindings/x86_64-pc-windows-msvc.rs delete mode 100644 cryptoki-sys/src/bindings/x86_64-windows.rs diff --git a/cryptoki-sys/regenerate_bindings.sh b/cryptoki-sys/regenerate_bindings.sh index cfb4b47b..afc8d468 100755 --- a/cryptoki-sys/regenerate_bindings.sh +++ b/cryptoki-sys/regenerate_bindings.sh @@ -5,7 +5,7 @@ set -xeuf -o pipefail -targets="aarch64-unknown-linux-gnu arm-unknown-linux-gnueabi i686-unknown-linux-gnu powerpc64-unknown-linux-gnu x86_64-unknown-linux-gnu x86_64-apple-darwin aarch64-apple-darwin x86_64-unknown-freebsd" +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= for target in $targets; do diff --git a/cryptoki-sys/src/bindings/aarch64-apple-darwin.rs b/cryptoki-sys/src/bindings/aarch64-apple-darwin.rs index e8699a8b..6800365c 100644 --- a/cryptoki-sys/src/bindings/aarch64-apple-darwin.rs +++ b/cryptoki-sys/src/bindings/aarch64-apple-darwin.rs @@ -1,5 +1,691 @@ -/* automatically generated by rust-bindgen 0.59.2 */ +/* 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 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 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; +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 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 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_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_EC_EDWARDS: CK_KEY_TYPE = 64; +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 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_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_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_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_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; +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 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_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_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_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_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_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_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_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_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_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_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_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_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_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 CKF_HW: CK_FLAGS = 1; +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_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 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_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_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 = 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_FUNCTION_REJECTED: CK_RV = 512; +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; #[repr(C)] #[derive(Debug, Default, Copy, Clone)] @@ -9,6 +695,8 @@ pub struct _CK_VERSION { } #[test] fn bindgen_test_layout__CK_VERSION() { + const UNINIT: ::std::mem::MaybeUninit<_CK_VERSION> = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<_CK_VERSION>(), 2usize, @@ -20,7 +708,7 @@ fn bindgen_test_layout__CK_VERSION() { concat!("Alignment of ", stringify!(_CK_VERSION)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_VERSION>())).major as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).major) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -30,7 +718,7 @@ fn bindgen_test_layout__CK_VERSION() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_VERSION>())).minor as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).minor) as usize - ptr as usize }, 1usize, concat!( "Offset of field: ", @@ -51,6 +739,8 @@ pub struct _CK_INFO { } #[test] fn bindgen_test_layout__CK_INFO() { + const UNINIT: ::std::mem::MaybeUninit<_CK_INFO> = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<_CK_INFO>(), 88usize, @@ -62,7 +752,7 @@ fn bindgen_test_layout__CK_INFO() { concat!("Alignment of ", stringify!(_CK_INFO)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_INFO>())).cryptokiVersion as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).cryptokiVersion) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -72,7 +762,7 @@ fn bindgen_test_layout__CK_INFO() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_INFO>())).manufacturerID as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).manufacturerID) as usize - ptr as usize }, 2usize, concat!( "Offset of field: ", @@ -82,7 +772,7 @@ fn bindgen_test_layout__CK_INFO() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_INFO>())).flags as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).flags) as usize - ptr as usize }, 40usize, concat!( "Offset of field: ", @@ -92,7 +782,7 @@ fn bindgen_test_layout__CK_INFO() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_INFO>())).libraryDescription as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).libraryDescription) as usize - ptr as usize }, 48usize, concat!( "Offset of field: ", @@ -102,7 +792,7 @@ fn bindgen_test_layout__CK_INFO() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_INFO>())).libraryVersion as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).libraryVersion) as usize - ptr as usize }, 80usize, concat!( "Offset of field: ", @@ -113,6 +803,7 @@ fn bindgen_test_layout__CK_INFO() { ); } 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; #[repr(C)] #[derive(Debug, Copy, Clone)] @@ -125,6 +816,8 @@ pub struct _CK_SLOT_INFO { } #[test] fn bindgen_test_layout__CK_SLOT_INFO() { + const UNINIT: ::std::mem::MaybeUninit<_CK_SLOT_INFO> = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<_CK_SLOT_INFO>(), 112usize, @@ -136,7 +829,7 @@ fn bindgen_test_layout__CK_SLOT_INFO() { concat!("Alignment of ", stringify!(_CK_SLOT_INFO)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_SLOT_INFO>())).slotDescription as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).slotDescription) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -146,7 +839,7 @@ fn bindgen_test_layout__CK_SLOT_INFO() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_SLOT_INFO>())).manufacturerID as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).manufacturerID) as usize - ptr as usize }, 64usize, concat!( "Offset of field: ", @@ -156,7 +849,7 @@ fn bindgen_test_layout__CK_SLOT_INFO() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_SLOT_INFO>())).flags as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).flags) as usize - ptr as usize }, 96usize, concat!( "Offset of field: ", @@ -166,7 +859,7 @@ fn bindgen_test_layout__CK_SLOT_INFO() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_SLOT_INFO>())).hardwareVersion as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).hardwareVersion) as usize - ptr as usize }, 104usize, concat!( "Offset of field: ", @@ -176,7 +869,7 @@ fn bindgen_test_layout__CK_SLOT_INFO() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_SLOT_INFO>())).firmwareVersion as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).firmwareVersion) as usize - ptr as usize }, 106usize, concat!( "Offset of field: ", @@ -195,6 +888,10 @@ 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; #[repr(C)] #[derive(Debug, Default, Copy, Clone)] pub struct _CK_TOKEN_INFO { @@ -219,6 +916,8 @@ pub struct _CK_TOKEN_INFO { } #[test] fn bindgen_test_layout__CK_TOKEN_INFO() { + const UNINIT: ::std::mem::MaybeUninit<_CK_TOKEN_INFO> = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<_CK_TOKEN_INFO>(), 208usize, @@ -230,7 +929,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { concat!("Alignment of ", stringify!(_CK_TOKEN_INFO)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_TOKEN_INFO>())).label as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).label) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -240,7 +939,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_TOKEN_INFO>())).manufacturerID as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).manufacturerID) as usize - ptr as usize }, 32usize, concat!( "Offset of field: ", @@ -250,7 +949,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_TOKEN_INFO>())).model as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).model) as usize - ptr as usize }, 64usize, concat!( "Offset of field: ", @@ -260,7 +959,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_TOKEN_INFO>())).serialNumber as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).serialNumber) as usize - ptr as usize }, 80usize, concat!( "Offset of field: ", @@ -270,7 +969,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_TOKEN_INFO>())).flags as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).flags) as usize - ptr as usize }, 96usize, concat!( "Offset of field: ", @@ -280,9 +979,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_TOKEN_INFO>())).ulMaxSessionCount as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).ulMaxSessionCount) as usize - ptr as usize }, 104usize, concat!( "Offset of field: ", @@ -292,7 +989,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_TOKEN_INFO>())).ulSessionCount as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ulSessionCount) as usize - ptr as usize }, 112usize, concat!( "Offset of field: ", @@ -302,9 +999,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_TOKEN_INFO>())).ulMaxRwSessionCount as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).ulMaxRwSessionCount) as usize - ptr as usize }, 120usize, concat!( "Offset of field: ", @@ -314,7 +1009,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_TOKEN_INFO>())).ulRwSessionCount as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ulRwSessionCount) as usize - ptr as usize }, 128usize, concat!( "Offset of field: ", @@ -324,7 +1019,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_TOKEN_INFO>())).ulMaxPinLen as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ulMaxPinLen) as usize - ptr as usize }, 136usize, concat!( "Offset of field: ", @@ -334,7 +1029,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_TOKEN_INFO>())).ulMinPinLen as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ulMinPinLen) as usize - ptr as usize }, 144usize, concat!( "Offset of field: ", @@ -344,9 +1039,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_TOKEN_INFO>())).ulTotalPublicMemory as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).ulTotalPublicMemory) as usize - ptr as usize }, 152usize, concat!( "Offset of field: ", @@ -356,9 +1049,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_TOKEN_INFO>())).ulFreePublicMemory as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).ulFreePublicMemory) as usize - ptr as usize }, 160usize, concat!( "Offset of field: ", @@ -368,9 +1059,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_TOKEN_INFO>())).ulTotalPrivateMemory as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).ulTotalPrivateMemory) as usize - ptr as usize }, 168usize, concat!( "Offset of field: ", @@ -380,9 +1069,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_TOKEN_INFO>())).ulFreePrivateMemory as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).ulFreePrivateMemory) as usize - ptr as usize }, 176usize, concat!( "Offset of field: ", @@ -392,7 +1079,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_TOKEN_INFO>())).hardwareVersion as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).hardwareVersion) as usize - ptr as usize }, 184usize, concat!( "Offset of field: ", @@ -402,7 +1089,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_TOKEN_INFO>())).firmwareVersion as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).firmwareVersion) as usize - ptr as usize }, 186usize, concat!( "Offset of field: ", @@ -412,7 +1099,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_TOKEN_INFO>())).utcTime as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).utcTime) as usize - ptr as usize }, 188usize, concat!( "Offset of field: ", @@ -435,6 +1122,8 @@ pub struct _CK_SESSION_INFO { } #[test] fn bindgen_test_layout__CK_SESSION_INFO() { + const UNINIT: ::std::mem::MaybeUninit<_CK_SESSION_INFO> = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<_CK_SESSION_INFO>(), 32usize, @@ -446,7 +1135,7 @@ fn bindgen_test_layout__CK_SESSION_INFO() { concat!("Alignment of ", stringify!(_CK_SESSION_INFO)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_SESSION_INFO>())).slotID as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).slotID) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -456,7 +1145,7 @@ fn bindgen_test_layout__CK_SESSION_INFO() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_SESSION_INFO>())).state as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).state) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -466,7 +1155,7 @@ fn bindgen_test_layout__CK_SESSION_INFO() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_SESSION_INFO>())).flags as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).flags) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", @@ -476,7 +1165,7 @@ fn bindgen_test_layout__CK_SESSION_INFO() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_SESSION_INFO>())).ulDeviceError as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ulDeviceError) as usize - ptr as usize }, 24usize, concat!( "Offset of field: ", @@ -501,6 +1190,8 @@ pub struct _CK_ATTRIBUTE { } #[test] fn bindgen_test_layout__CK_ATTRIBUTE() { + const UNINIT: ::std::mem::MaybeUninit<_CK_ATTRIBUTE> = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<_CK_ATTRIBUTE>(), 24usize, @@ -512,7 +1203,7 @@ fn bindgen_test_layout__CK_ATTRIBUTE() { concat!("Alignment of ", stringify!(_CK_ATTRIBUTE)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_ATTRIBUTE>())).type_ as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).type_) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -522,7 +1213,7 @@ fn bindgen_test_layout__CK_ATTRIBUTE() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_ATTRIBUTE>())).pValue as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).pValue) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -532,7 +1223,7 @@ fn bindgen_test_layout__CK_ATTRIBUTE() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_ATTRIBUTE>())).ulValueLen as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ulValueLen) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", @@ -560,6 +1251,8 @@ pub struct _CK_DATE { } #[test] fn bindgen_test_layout__CK_DATE() { + const UNINIT: ::std::mem::MaybeUninit<_CK_DATE> = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<_CK_DATE>(), 8usize, @@ -571,7 +1264,7 @@ fn bindgen_test_layout__CK_DATE() { concat!("Alignment of ", stringify!(_CK_DATE)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_DATE>())).year as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).year) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -581,7 +1274,7 @@ fn bindgen_test_layout__CK_DATE() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_DATE>())).month as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).month) as usize - ptr as usize }, 4usize, concat!( "Offset of field: ", @@ -591,7 +1284,7 @@ fn bindgen_test_layout__CK_DATE() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_DATE>())).day as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).day) as usize - ptr as usize }, 6usize, concat!( "Offset of field: ", @@ -611,6 +1304,8 @@ pub struct _CK_MECHANISM { } #[test] fn bindgen_test_layout__CK_MECHANISM() { + const UNINIT: ::std::mem::MaybeUninit<_CK_MECHANISM> = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<_CK_MECHANISM>(), 24usize, @@ -622,7 +1317,7 @@ fn bindgen_test_layout__CK_MECHANISM() { concat!("Alignment of ", stringify!(_CK_MECHANISM)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_MECHANISM>())).mechanism as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).mechanism) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -632,7 +1327,7 @@ fn bindgen_test_layout__CK_MECHANISM() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_MECHANISM>())).pParameter as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).pParameter) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -642,7 +1337,7 @@ fn bindgen_test_layout__CK_MECHANISM() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_MECHANISM>())).ulParameterLen as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ulParameterLen) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", @@ -670,6 +1365,8 @@ pub struct _CK_MECHANISM_INFO { } #[test] fn bindgen_test_layout__CK_MECHANISM_INFO() { + const UNINIT: ::std::mem::MaybeUninit<_CK_MECHANISM_INFO> = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<_CK_MECHANISM_INFO>(), 24usize, @@ -681,7 +1378,7 @@ fn bindgen_test_layout__CK_MECHANISM_INFO() { concat!("Alignment of ", stringify!(_CK_MECHANISM_INFO)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_MECHANISM_INFO>())).ulMinKeySize as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ulMinKeySize) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -691,7 +1388,7 @@ fn bindgen_test_layout__CK_MECHANISM_INFO() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_MECHANISM_INFO>())).ulMaxKeySize as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ulMaxKeySize) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -701,7 +1398,7 @@ fn bindgen_test_layout__CK_MECHANISM_INFO() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_MECHANISM_INFO>())).flags as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).flags) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", @@ -721,6 +1418,8 @@ pub struct CK_OTP_PARAM { } #[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, @@ -732,7 +1431,7 @@ fn bindgen_test_layout_CK_OTP_PARAM() { concat!("Alignment of ", stringify!(CK_OTP_PARAM)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).type_ as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).type_) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -742,7 +1441,7 @@ fn bindgen_test_layout_CK_OTP_PARAM() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).pValue as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).pValue) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -752,7 +1451,7 @@ fn bindgen_test_layout_CK_OTP_PARAM() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).ulValueLen as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ulValueLen) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", @@ -779,6 +1478,8 @@ pub struct CK_OTP_PARAMS { } #[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, @@ -790,7 +1491,7 @@ fn bindgen_test_layout_CK_OTP_PARAMS() { concat!("Alignment of ", stringify!(CK_OTP_PARAMS)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).pParams as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).pParams) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -800,7 +1501,7 @@ fn bindgen_test_layout_CK_OTP_PARAMS() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).ulCount as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ulCount) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -827,6 +1528,9 @@ pub struct CK_OTP_SIGNATURE_INFO { } #[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, @@ -838,7 +1542,7 @@ fn bindgen_test_layout_CK_OTP_SIGNATURE_INFO() { concat!("Alignment of ", stringify!(CK_OTP_SIGNATURE_INFO)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).pParams as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).pParams) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -848,7 +1552,7 @@ fn bindgen_test_layout_CK_OTP_SIGNATURE_INFO() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).ulCount as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ulCount) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -877,6 +1581,9 @@ pub struct ck_rsa_pkcs_pss_params { } #[test] fn bindgen_test_layout_ck_rsa_pkcs_pss_params() { + const UNINIT: ::std::mem::MaybeUninit = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), 24usize, @@ -888,7 +1595,7 @@ fn bindgen_test_layout_ck_rsa_pkcs_pss_params() { concat!("Alignment of ", stringify!(ck_rsa_pkcs_pss_params)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).hashAlg as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).hashAlg) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -898,7 +1605,7 @@ fn bindgen_test_layout_ck_rsa_pkcs_pss_params() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).mgf as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).mgf) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -908,7 +1615,7 @@ fn bindgen_test_layout_ck_rsa_pkcs_pss_params() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).sLen as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).sLen) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", @@ -930,6 +1637,9 @@ pub struct ck_rsa_pkcs_oaep_params { } #[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, @@ -941,7 +1651,7 @@ fn bindgen_test_layout_ck_rsa_pkcs_oaep_params() { concat!("Alignment of ", stringify!(ck_rsa_pkcs_oaep_params)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).hashAlg as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).hashAlg) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -951,7 +1661,7 @@ fn bindgen_test_layout_ck_rsa_pkcs_oaep_params() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).mgf as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).mgf) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -961,7 +1671,7 @@ fn bindgen_test_layout_ck_rsa_pkcs_oaep_params() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).source as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).source) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", @@ -971,9 +1681,7 @@ fn bindgen_test_layout_ck_rsa_pkcs_oaep_params() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).pSourceData as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).pSourceData) as usize - ptr as usize }, 24usize, concat!( "Offset of field: ", @@ -983,9 +1691,7 @@ fn bindgen_test_layout_ck_rsa_pkcs_oaep_params() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).ulSourceDataLen as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).ulSourceDataLen) as usize - ptr as usize }, 32usize, concat!( "Offset of field: ", @@ -1012,6 +1718,8 @@ pub struct ck_aes_ctr_params { } #[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, @@ -1023,7 +1731,7 @@ fn bindgen_test_layout_ck_aes_ctr_params() { concat!("Alignment of ", stringify!(ck_aes_ctr_params)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).ulCounterBits as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ulCounterBits) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -1033,7 +1741,7 @@ fn bindgen_test_layout_ck_aes_ctr_params() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).cb as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).cb) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -1055,6 +1763,8 @@ pub struct ck_gcm_params { } #[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, @@ -1066,7 +1776,7 @@ fn bindgen_test_layout_ck_gcm_params() { concat!("Alignment of ", stringify!(ck_gcm_params)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).pIv as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).pIv) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -1076,7 +1786,7 @@ fn bindgen_test_layout_ck_gcm_params() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).ulIvLen as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ulIvLen) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -1086,7 +1796,7 @@ fn bindgen_test_layout_ck_gcm_params() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).ulIvBits as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ulIvBits) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", @@ -1096,7 +1806,7 @@ fn bindgen_test_layout_ck_gcm_params() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).pAAD as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).pAAD) as usize - ptr as usize }, 24usize, concat!( "Offset of field: ", @@ -1106,7 +1816,7 @@ fn bindgen_test_layout_ck_gcm_params() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).ulAADLen as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ulAADLen) as usize - ptr as usize }, 32usize, concat!( "Offset of field: ", @@ -1116,7 +1826,7 @@ fn bindgen_test_layout_ck_gcm_params() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).ulTagBits as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ulTagBits) as usize - ptr as usize }, 40usize, concat!( "Offset of field: ", @@ -1147,6 +1857,9 @@ pub struct ck_ecdh1_derive_params { } #[test] fn bindgen_test_layout_ck_ecdh1_derive_params() { + const UNINIT: ::std::mem::MaybeUninit = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), 40usize, @@ -1158,7 +1871,7 @@ fn bindgen_test_layout_ck_ecdh1_derive_params() { concat!("Alignment of ", stringify!(ck_ecdh1_derive_params)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).kdf as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).kdf) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -1168,9 +1881,7 @@ fn bindgen_test_layout_ck_ecdh1_derive_params() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).ulSharedDataLen as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).ulSharedDataLen) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -1180,9 +1891,7 @@ fn bindgen_test_layout_ck_ecdh1_derive_params() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).pSharedData as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).pSharedData) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", @@ -1192,9 +1901,7 @@ fn bindgen_test_layout_ck_ecdh1_derive_params() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).ulPublicDataLen as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).ulPublicDataLen) as usize - ptr as usize }, 24usize, concat!( "Offset of field: ", @@ -1204,9 +1911,7 @@ fn bindgen_test_layout_ck_ecdh1_derive_params() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).pPublicData as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).pPublicData) as usize - ptr as usize }, 32usize, concat!( "Offset of field: ", @@ -1233,6 +1938,9 @@ pub struct ck_key_derivation_string_data { } #[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, @@ -1244,9 +1952,7 @@ fn bindgen_test_layout_ck_key_derivation_string_data() { concat!("Alignment of ", stringify!(ck_key_derivation_string_data)) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).pData as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).pData) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -1256,9 +1962,7 @@ fn bindgen_test_layout_ck_key_derivation_string_data() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).ulLen as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).ulLen) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -1286,6 +1990,9 @@ pub struct ck_des_cbc_encrypt_data_params { } #[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, @@ -1297,9 +2004,7 @@ fn bindgen_test_layout_ck_des_cbc_encrypt_data_params() { concat!("Alignment of ", stringify!(ck_des_cbc_encrypt_data_params)) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).iv as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).iv) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -1309,9 +2014,7 @@ fn bindgen_test_layout_ck_des_cbc_encrypt_data_params() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).pData as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).pData) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -1321,9 +2024,7 @@ fn bindgen_test_layout_ck_des_cbc_encrypt_data_params() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).length as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).length) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", @@ -1351,6 +2052,9 @@ pub struct ck_aes_cbc_encrypt_data_params { } #[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, @@ -1362,9 +2066,7 @@ fn bindgen_test_layout_ck_aes_cbc_encrypt_data_params() { concat!("Alignment of ", stringify!(ck_aes_cbc_encrypt_data_params)) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).iv as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).iv) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -1374,9 +2076,7 @@ fn bindgen_test_layout_ck_aes_cbc_encrypt_data_params() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).pData as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).pData) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", @@ -1386,9 +2086,7 @@ fn bindgen_test_layout_ck_aes_cbc_encrypt_data_params() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).length as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).length) as usize - ptr as usize }, 24usize, concat!( "Offset of field: ", @@ -1950,6 +2648,8 @@ pub struct _CK_FUNCTION_LIST { } #[test] fn bindgen_test_layout__CK_FUNCTION_LIST() { + const UNINIT: ::std::mem::MaybeUninit<_CK_FUNCTION_LIST> = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<_CK_FUNCTION_LIST>(), 552usize, @@ -1961,7 +2661,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { concat!("Alignment of ", stringify!(_CK_FUNCTION_LIST)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).version as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).version) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -1971,7 +2671,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_Initialize as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_Initialize) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -1981,7 +2681,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_Finalize as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_Finalize) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", @@ -1991,7 +2691,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_GetInfo as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_GetInfo) as usize - ptr as usize }, 24usize, concat!( "Offset of field: ", @@ -2001,9 +2701,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_GetFunctionList as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_GetFunctionList) as usize - ptr as usize }, 32usize, concat!( "Offset of field: ", @@ -2013,7 +2711,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_GetSlotList as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_GetSlotList) as usize - ptr as usize }, 40usize, concat!( "Offset of field: ", @@ -2023,7 +2721,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_GetSlotInfo as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_GetSlotInfo) as usize - ptr as usize }, 48usize, concat!( "Offset of field: ", @@ -2033,9 +2731,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_GetTokenInfo as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_GetTokenInfo) as usize - ptr as usize }, 56usize, concat!( "Offset of field: ", @@ -2045,9 +2741,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_GetMechanismList as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_GetMechanismList) as usize - ptr as usize }, 64usize, concat!( "Offset of field: ", @@ -2057,9 +2751,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_GetMechanismInfo as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_GetMechanismInfo) as usize - ptr as usize }, 72usize, concat!( "Offset of field: ", @@ -2069,7 +2761,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_InitToken as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_InitToken) as usize - ptr as usize }, 80usize, concat!( "Offset of field: ", @@ -2079,7 +2771,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_InitPIN as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_InitPIN) as usize - ptr as usize }, 88usize, concat!( "Offset of field: ", @@ -2089,7 +2781,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_SetPIN as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_SetPIN) as usize - ptr as usize }, 96usize, concat!( "Offset of field: ", @@ -2099,7 +2791,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_OpenSession as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_OpenSession) as usize - ptr as usize }, 104usize, concat!( "Offset of field: ", @@ -2109,9 +2801,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_CloseSession as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_CloseSession) as usize - ptr as usize }, 112usize, concat!( "Offset of field: ", @@ -2121,9 +2811,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_CloseAllSessions as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_CloseAllSessions) as usize - ptr as usize }, 120usize, concat!( "Offset of field: ", @@ -2133,9 +2821,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_GetSessionInfo as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_GetSessionInfo) as usize - ptr as usize }, 128usize, concat!( "Offset of field: ", @@ -2145,9 +2831,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_GetOperationState as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_GetOperationState) as usize - ptr as usize }, 136usize, concat!( "Offset of field: ", @@ -2157,9 +2841,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_SetOperationState as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_SetOperationState) as usize - ptr as usize }, 144usize, concat!( "Offset of field: ", @@ -2169,7 +2851,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_Login as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_Login) as usize - ptr as usize }, 152usize, concat!( "Offset of field: ", @@ -2179,7 +2861,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_Logout as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_Logout) as usize - ptr as usize }, 160usize, concat!( "Offset of field: ", @@ -2189,9 +2871,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_CreateObject as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_CreateObject) as usize - ptr as usize }, 168usize, concat!( "Offset of field: ", @@ -2201,7 +2881,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_CopyObject as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_CopyObject) as usize - ptr as usize }, 176usize, concat!( "Offset of field: ", @@ -2211,9 +2891,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_DestroyObject as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_DestroyObject) as usize - ptr as usize }, 184usize, concat!( "Offset of field: ", @@ -2223,9 +2901,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_GetObjectSize as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_GetObjectSize) as usize - ptr as usize }, 192usize, concat!( "Offset of field: ", @@ -2235,9 +2911,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_GetAttributeValue as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_GetAttributeValue) as usize - ptr as usize }, 200usize, concat!( "Offset of field: ", @@ -2247,9 +2921,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_SetAttributeValue as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_SetAttributeValue) as usize - ptr as usize }, 208usize, concat!( "Offset of field: ", @@ -2259,9 +2931,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_FindObjectsInit as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_FindObjectsInit) as usize - ptr as usize }, 216usize, concat!( "Offset of field: ", @@ -2271,7 +2941,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_FindObjects as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_FindObjects) as usize - ptr as usize }, 224usize, concat!( "Offset of field: ", @@ -2281,9 +2951,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_FindObjectsFinal as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_FindObjectsFinal) as usize - ptr as usize }, 232usize, concat!( "Offset of field: ", @@ -2293,7 +2961,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_EncryptInit as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_EncryptInit) as usize - ptr as usize }, 240usize, concat!( "Offset of field: ", @@ -2303,7 +2971,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_Encrypt as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_Encrypt) as usize - ptr as usize }, 248usize, concat!( "Offset of field: ", @@ -2313,9 +2981,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_EncryptUpdate as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_EncryptUpdate) as usize - ptr as usize }, 256usize, concat!( "Offset of field: ", @@ -2325,9 +2991,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_EncryptFinal as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_EncryptFinal) as usize - ptr as usize }, 264usize, concat!( "Offset of field: ", @@ -2337,7 +3001,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_DecryptInit as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_DecryptInit) as usize - ptr as usize }, 272usize, concat!( "Offset of field: ", @@ -2347,7 +3011,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_Decrypt as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_Decrypt) as usize - ptr as usize }, 280usize, concat!( "Offset of field: ", @@ -2357,9 +3021,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_DecryptUpdate as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_DecryptUpdate) as usize - ptr as usize }, 288usize, concat!( "Offset of field: ", @@ -2369,9 +3031,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_DecryptFinal as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_DecryptFinal) as usize - ptr as usize }, 296usize, concat!( "Offset of field: ", @@ -2381,7 +3041,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_DigestInit as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_DigestInit) as usize - ptr as usize }, 304usize, concat!( "Offset of field: ", @@ -2391,7 +3051,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_Digest as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_Digest) as usize - ptr as usize }, 312usize, concat!( "Offset of field: ", @@ -2401,9 +3061,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_DigestUpdate as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_DigestUpdate) as usize - ptr as usize }, 320usize, concat!( "Offset of field: ", @@ -2413,7 +3071,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_DigestKey as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_DigestKey) as usize - ptr as usize }, 328usize, concat!( "Offset of field: ", @@ -2423,7 +3081,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_DigestFinal as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_DigestFinal) as usize - ptr as usize }, 336usize, concat!( "Offset of field: ", @@ -2433,7 +3091,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_SignInit as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_SignInit) as usize - ptr as usize }, 344usize, concat!( "Offset of field: ", @@ -2443,7 +3101,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_Sign as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_Sign) as usize - ptr as usize }, 352usize, concat!( "Offset of field: ", @@ -2453,7 +3111,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_SignUpdate as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_SignUpdate) as usize - ptr as usize }, 360usize, concat!( "Offset of field: ", @@ -2463,7 +3121,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_SignFinal as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_SignFinal) as usize - ptr as usize }, 368usize, concat!( "Offset of field: ", @@ -2473,9 +3131,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_SignRecoverInit as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_SignRecoverInit) as usize - ptr as usize }, 376usize, concat!( "Offset of field: ", @@ -2485,7 +3141,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_SignRecover as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_SignRecover) as usize - ptr as usize }, 384usize, concat!( "Offset of field: ", @@ -2495,7 +3151,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_VerifyInit as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_VerifyInit) as usize - ptr as usize }, 392usize, concat!( "Offset of field: ", @@ -2505,7 +3161,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_Verify as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_Verify) as usize - ptr as usize }, 400usize, concat!( "Offset of field: ", @@ -2515,9 +3171,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_VerifyUpdate as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_VerifyUpdate) as usize - ptr as usize }, 408usize, concat!( "Offset of field: ", @@ -2527,7 +3181,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_VerifyFinal as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_VerifyFinal) as usize - ptr as usize }, 416usize, concat!( "Offset of field: ", @@ -2537,9 +3191,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_VerifyRecoverInit as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_VerifyRecoverInit) as usize - ptr as usize }, 424usize, concat!( "Offset of field: ", @@ -2549,9 +3201,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_VerifyRecover as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_VerifyRecover) as usize - ptr as usize }, 432usize, concat!( "Offset of field: ", @@ -2561,9 +3211,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_DigestEncryptUpdate as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_DigestEncryptUpdate) as usize - ptr as usize }, 440usize, concat!( "Offset of field: ", @@ -2573,9 +3221,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_DecryptDigestUpdate as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_DecryptDigestUpdate) as usize - ptr as usize }, 448usize, concat!( "Offset of field: ", @@ -2585,9 +3231,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_SignEncryptUpdate as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_SignEncryptUpdate) as usize - ptr as usize }, 456usize, concat!( "Offset of field: ", @@ -2597,9 +3241,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_DecryptVerifyUpdate as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_DecryptVerifyUpdate) as usize - ptr as usize }, 464usize, concat!( "Offset of field: ", @@ -2609,7 +3251,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_GenerateKey as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_GenerateKey) as usize - ptr as usize }, 472usize, concat!( "Offset of field: ", @@ -2619,9 +3261,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_GenerateKeyPair as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_GenerateKeyPair) as usize - ptr as usize }, 480usize, concat!( "Offset of field: ", @@ -2631,7 +3271,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_WrapKey as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_WrapKey) as usize - ptr as usize }, 488usize, concat!( "Offset of field: ", @@ -2641,7 +3281,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_UnwrapKey as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_UnwrapKey) as usize - ptr as usize }, 496usize, concat!( "Offset of field: ", @@ -2651,7 +3291,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_DeriveKey as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_DeriveKey) as usize - ptr as usize }, 504usize, concat!( "Offset of field: ", @@ -2661,7 +3301,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_SeedRandom as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_SeedRandom) as usize - ptr as usize }, 512usize, concat!( "Offset of field: ", @@ -2671,9 +3311,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_GenerateRandom as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_GenerateRandom) as usize - ptr as usize }, 520usize, concat!( "Offset of field: ", @@ -2683,9 +3321,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_GetFunctionStatus as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_GetFunctionStatus) as usize - ptr as usize }, 528usize, concat!( "Offset of field: ", @@ -2695,9 +3331,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_CancelFunction as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_CancelFunction) as usize - ptr as usize }, 536usize, concat!( "Offset of field: ", @@ -2707,9 +3341,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_WaitForSlotEvent as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_WaitForSlotEvent) as usize - ptr as usize }, 544usize, concat!( "Offset of field: ", @@ -2739,6 +3371,9 @@ pub struct _CK_C_INITIALIZE_ARGS { } #[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, @@ -2750,9 +3385,7 @@ fn bindgen_test_layout__CK_C_INITIALIZE_ARGS() { concat!("Alignment of ", stringify!(_CK_C_INITIALIZE_ARGS)) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_C_INITIALIZE_ARGS>())).CreateMutex as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).CreateMutex) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -2762,9 +3395,7 @@ fn bindgen_test_layout__CK_C_INITIALIZE_ARGS() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_C_INITIALIZE_ARGS>())).DestroyMutex as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).DestroyMutex) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -2774,7 +3405,7 @@ fn bindgen_test_layout__CK_C_INITIALIZE_ARGS() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_C_INITIALIZE_ARGS>())).LockMutex as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).LockMutex) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", @@ -2784,9 +3415,7 @@ fn bindgen_test_layout__CK_C_INITIALIZE_ARGS() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_C_INITIALIZE_ARGS>())).UnlockMutex as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).UnlockMutex) as usize - ptr as usize }, 24usize, concat!( "Offset of field: ", @@ -2796,7 +3425,7 @@ fn bindgen_test_layout__CK_C_INITIALIZE_ARGS() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_C_INITIALIZE_ARGS>())).flags as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).flags) as usize - ptr as usize }, 32usize, concat!( "Offset of field: ", @@ -2806,7 +3435,7 @@ fn bindgen_test_layout__CK_C_INITIALIZE_ARGS() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_C_INITIALIZE_ARGS>())).pReserved as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).pReserved) as usize - ptr as usize }, 40usize, concat!( "Offset of field: ", @@ -2825,8 +3454,6 @@ impl Default for _CK_C_INITIALIZE_ARGS { } } } -pub type size_t = ::std::os::raw::c_ulong; -pub type wchar_t = ::std::os::raw::c_int; 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; @@ -2893,10 +3520,529 @@ pub type CK_AES_CBC_ENCRYPT_DATA_PARAMS_PTR = *mut ck_aes_cbc_encrypt_data_param 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_GetFunctionList: Result< unsafe extern "C" fn(function_list: *mut *mut _CK_FUNCTION_LIST) -> 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, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_GetSlotInfo: Result< + unsafe extern "C" fn(slotID: CK_SLOT_ID, info: *mut _CK_SLOT_INFO) -> 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, + ::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, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_GetMechanismInfo: Result< + unsafe extern "C" fn( + slotID: CK_SLOT_ID, + type_: CK_MECHANISM_TYPE, + info: *mut _CK_MECHANISM_INFO, + ) -> 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, + ) -> 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, + ) -> 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, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_OpenSession: Result< + 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, + ::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(session: CK_SESSION_HANDLE, info: *mut _CK_SESSION_INFO) -> 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, + ) -> 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, + ) -> 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, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_Logout: + 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, + ) -> 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, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_DestroyObject: Result< + unsafe extern "C" fn(session: CK_SESSION_HANDLE, object: 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, + ) -> 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, + ) -> 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, + ) -> 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, + ) -> 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, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_FindObjectsFinal: + 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, + ) -> 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, + ) -> 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, + ) -> 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, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_DecryptInit: Result< + unsafe extern "C" fn( + session: CK_SESSION_HANDLE, + mechanism: *mut _CK_MECHANISM, + key: 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, + ) -> 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, + ) -> 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, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_DigestInit: Result< + unsafe extern "C" fn(session: CK_SESSION_HANDLE, mechanism: *mut _CK_MECHANISM) -> 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, + ) -> 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, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_DigestKey: Result< + unsafe extern "C" fn(session: CK_SESSION_HANDLE, key: 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, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_SignInit: Result< + unsafe extern "C" fn( + session: CK_SESSION_HANDLE, + mechanism: *mut _CK_MECHANISM, + key: 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, + ) -> 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, + ) -> 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, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_SignRecoverInit: Result< + unsafe extern "C" fn( + session: CK_SESSION_HANDLE, + mechanism: *mut _CK_MECHANISM, + key: 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, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_VerifyInit: Result< + unsafe extern "C" fn( + session: CK_SESSION_HANDLE, + mechanism: *mut _CK_MECHANISM, + key: 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, + ) -> 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, + ) -> 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, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_VerifyRecoverInit: Result< + unsafe extern "C" fn( + session: CK_SESSION_HANDLE, + mechanism: *mut _CK_MECHANISM, + key: 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, + ) -> 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, + ) -> 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, + ) -> 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, + ) -> 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, + ) -> 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, + ) -> 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, + ) -> 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, + ) -> 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, + ) -> 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, + ) -> 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, + ) -> 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, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_GetFunctionStatus: + Result CK_RV, ::libloading::Error>, + pub C_CancelFunction: + Result CK_RV, ::libloading::Error>, } impl Pkcs11 { pub unsafe fn new

(path: P) -> Result @@ -2911,16 +4057,1010 @@ impl Pkcs11 { 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_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); + 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); Ok(Pkcs11 { __library, + C_Initialize, + C_Finalize, + C_GetInfo, C_GetFunctionList, + C_GetSlotList, + C_GetSlotInfo, + C_GetTokenInfo, + C_WaitForSlotEvent, + 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, }) } + pub unsafe fn C_Initialize(&self, init_args: *mut ::std::os::raw::c_void) -> CK_RV { + (self + .C_Initialize + .as_ref() + .expect("Expected function, got error."))(init_args) + } + pub unsafe fn C_Finalize(&self, pReserved: *mut ::std::os::raw::c_void) -> 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 { + (self + .C_GetInfo + .as_ref() + .expect("Expected function, got error."))(info) + } pub unsafe fn C_GetFunctionList(&self, function_list: *mut *mut _CK_FUNCTION_LIST) -> CK_RV { (self .C_GetFunctionList .as_ref() .expect("Expected function, got error."))(function_list) } + 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, + ) -> CK_RV { + (self + .C_GetSlotList + .as_ref() + .expect("Expected function, got error."))(token_present, slot_list, ulCount) + } + pub unsafe fn C_GetSlotInfo(&self, slotID: CK_SLOT_ID, info: *mut _CK_SLOT_INFO) -> CK_RV { + (self + .C_GetSlotInfo + .as_ref() + .expect("Expected function, got error."))(slotID, info) + } + pub unsafe fn C_GetTokenInfo(&self, slotID: CK_SLOT_ID, info: *mut _CK_TOKEN_INFO) -> 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) + } + pub unsafe fn C_GetMechanismList( + &self, + slotID: CK_SLOT_ID, + mechanism_list: *mut CK_MECHANISM_TYPE, + ulCount: *mut ::std::os::raw::c_ulong, + ) -> CK_RV { + (self + .C_GetMechanismList + .as_ref() + .expect("Expected function, got error."))(slotID, mechanism_list, ulCount) + } + pub unsafe fn C_GetMechanismInfo( + &self, + slotID: CK_SLOT_ID, + type_: CK_MECHANISM_TYPE, + info: *mut _CK_MECHANISM_INFO, + ) -> CK_RV { + (self + .C_GetMechanismInfo + .as_ref() + .expect("Expected function, got error."))(slotID, type_, info) + } + 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, + ) -> CK_RV { + (self + .C_InitToken + .as_ref() + .expect("Expected function, got error."))(slotID, pin, pin_len, label) + } + pub unsafe fn C_InitPIN( + &self, + session: CK_SESSION_HANDLE, + pin: *mut ::std::os::raw::c_uchar, + pin_len: ::std::os::raw::c_ulong, + ) -> CK_RV { + (self + .C_InitPIN + .as_ref() + .expect("Expected function, got error."))(session, pin, pin_len) + } + 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, + ) -> CK_RV { + (self + .C_SetPIN + .as_ref() + .expect("Expected function, got error."))( + session, old_pin, old_len, new_pin, new_len + ) + } + 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, + ) -> CK_RV { + (self + .C_OpenSession + .as_ref() + .expect("Expected function, got error."))( + slotID, flags, application, notify, session + ) + } + pub unsafe fn C_CloseSession(&self, session: CK_SESSION_HANDLE) -> CK_RV { + (self + .C_CloseSession + .as_ref() + .expect("Expected function, got error."))(session) + } + 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, + session: CK_SESSION_HANDLE, + info: *mut _CK_SESSION_INFO, + ) -> CK_RV { + (self + .C_GetSessionInfo + .as_ref() + .expect("Expected function, got error."))(session, info) + } + 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, + ) -> CK_RV { + (self + .C_GetOperationState + .as_ref() + .expect("Expected function, got error."))( + session, operation_state, operation_state_len + ) + } + 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, + ) -> CK_RV { + (self + .C_SetOperationState + .as_ref() + .expect("Expected function, got error."))( + session, + operation_state, + operation_state_len, + encryption_key, + authentiation_key, + ) + } + 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, + ) -> CK_RV { + (self + .C_Login + .as_ref() + .expect("Expected function, got error."))(session, user_type, pin, pin_len) + } + pub unsafe fn C_Logout(&self, session: CK_SESSION_HANDLE) -> CK_RV { + (self + .C_Logout + .as_ref() + .expect("Expected function, got error."))(session) + } + 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, + ) -> CK_RV { + (self + .C_CreateObject + .as_ref() + .expect("Expected function, got error."))(session, templ, ulCount, object) + } + 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, + ) -> CK_RV { + (self + .C_CopyObject + .as_ref() + .expect("Expected function, got error."))( + session, object, templ, ulCount, new_object + ) + } + pub unsafe fn C_DestroyObject( + &self, + session: CK_SESSION_HANDLE, + object: CK_OBJECT_HANDLE, + ) -> CK_RV { + (self + .C_DestroyObject + .as_ref() + .expect("Expected function, got error."))(session, object) + } + pub unsafe fn C_GetObjectSize( + &self, + session: CK_SESSION_HANDLE, + object: CK_OBJECT_HANDLE, + size: *mut ::std::os::raw::c_ulong, + ) -> CK_RV { + (self + .C_GetObjectSize + .as_ref() + .expect("Expected function, got error."))(session, object, size) + } + pub unsafe fn C_GetAttributeValue( + &self, + session: CK_SESSION_HANDLE, + object: CK_OBJECT_HANDLE, + templ: *mut _CK_ATTRIBUTE, + ulCount: ::std::os::raw::c_ulong, + ) -> CK_RV { + (self + .C_GetAttributeValue + .as_ref() + .expect("Expected function, got error."))(session, object, templ, 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, + ) -> CK_RV { + (self + .C_SetAttributeValue + .as_ref() + .expect("Expected function, got error."))(session, object, templ, ulCount) + } + pub unsafe fn C_FindObjectsInit( + &self, + session: CK_SESSION_HANDLE, + templ: *mut _CK_ATTRIBUTE, + ulCount: ::std::os::raw::c_ulong, + ) -> CK_RV { + (self + .C_FindObjectsInit + .as_ref() + .expect("Expected function, got error."))(session, templ, 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, + ) -> CK_RV { + (self + .C_FindObjects + .as_ref() + .expect("Expected function, got error."))( + session, + object, + max_object_count, + object_count, + ) + } + pub unsafe fn C_FindObjectsFinal(&self, session: CK_SESSION_HANDLE) -> CK_RV { + (self + .C_FindObjectsFinal + .as_ref() + .expect("Expected function, got error."))(session) + } + pub unsafe fn C_EncryptInit( + &self, + session: CK_SESSION_HANDLE, + mechanism: *mut _CK_MECHANISM, + key: CK_OBJECT_HANDLE, + ) -> CK_RV { + (self + .C_EncryptInit + .as_ref() + .expect("Expected function, got error."))(session, mechanism, key) + } + 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, + ) -> CK_RV { + (self + .C_Encrypt + .as_ref() + .expect("Expected function, got error."))( + session, + data, + data_len, + encrypted_data, + encrypted_data_len, + ) + } + 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, + ) -> CK_RV { + (self + .C_EncryptUpdate + .as_ref() + .expect("Expected function, got error."))( + session, + part, + part_len, + encrypted_part, + encrypted_part_len, + ) + } + 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, + ) -> CK_RV { + (self + .C_EncryptFinal + .as_ref() + .expect("Expected function, got error."))( + session, + last_encrypted_part, + last_encrypted_part_len, + ) + } + pub unsafe fn C_DecryptInit( + &self, + session: CK_SESSION_HANDLE, + mechanism: *mut _CK_MECHANISM, + key: CK_OBJECT_HANDLE, + ) -> CK_RV { + (self + .C_DecryptInit + .as_ref() + .expect("Expected function, got error."))(session, mechanism, key) + } + 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, + ) -> CK_RV { + (self + .C_Decrypt + .as_ref() + .expect("Expected function, got error."))( + session, + encrypted_data, + encrypted_data_len, + data, + data_len, + ) + } + 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, + ) -> CK_RV { + (self + .C_DecryptUpdate + .as_ref() + .expect("Expected function, got error."))( + session, + encrypted_part, + encrypted_part_len, + part, + part_len, + ) + } + 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, + ) -> CK_RV { + (self + .C_DecryptFinal + .as_ref() + .expect("Expected function, got error."))(session, last_part, last_part_len) + } + pub unsafe fn C_DigestInit( + &self, + session: CK_SESSION_HANDLE, + mechanism: *mut _CK_MECHANISM, + ) -> CK_RV { + (self + .C_DigestInit + .as_ref() + .expect("Expected function, got error."))(session, mechanism) + } + 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, + ) -> CK_RV { + (self + .C_Digest + .as_ref() + .expect("Expected function, got error."))( + session, data, data_len, digest, digest_len + ) + } + pub unsafe fn C_DigestUpdate( + &self, + session: CK_SESSION_HANDLE, + part: *mut ::std::os::raw::c_uchar, + part_len: ::std::os::raw::c_ulong, + ) -> CK_RV { + (self + .C_DigestUpdate + .as_ref() + .expect("Expected function, got error."))(session, part, part_len) + } + pub unsafe fn C_DigestKey(&self, session: CK_SESSION_HANDLE, key: CK_OBJECT_HANDLE) -> CK_RV { + (self + .C_DigestKey + .as_ref() + .expect("Expected function, got error."))(session, key) + } + 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, + ) -> CK_RV { + (self + .C_DigestFinal + .as_ref() + .expect("Expected function, got error."))(session, digest, digest_len) + } + pub unsafe fn C_SignInit( + &self, + session: CK_SESSION_HANDLE, + mechanism: *mut _CK_MECHANISM, + key: CK_OBJECT_HANDLE, + ) -> CK_RV { + (self + .C_SignInit + .as_ref() + .expect("Expected function, got error."))(session, mechanism, key) + } + 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, + ) -> CK_RV { + (self.C_Sign.as_ref().expect("Expected function, got error."))( + session, + data, + data_len, + signature, + signature_len, + ) + } + pub unsafe fn C_SignUpdate( + &self, + session: CK_SESSION_HANDLE, + part: *mut ::std::os::raw::c_uchar, + part_len: ::std::os::raw::c_ulong, + ) -> CK_RV { + (self + .C_SignUpdate + .as_ref() + .expect("Expected function, got error."))(session, part, part_len) + } + 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, + ) -> CK_RV { + (self + .C_SignFinal + .as_ref() + .expect("Expected function, got error."))(session, signature, signature_len) + } + pub unsafe fn C_SignRecoverInit( + &self, + session: CK_SESSION_HANDLE, + mechanism: *mut _CK_MECHANISM, + key: CK_OBJECT_HANDLE, + ) -> CK_RV { + (self + .C_SignRecoverInit + .as_ref() + .expect("Expected function, got error."))(session, mechanism, key) + } + 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, + ) -> CK_RV { + (self + .C_SignRecover + .as_ref() + .expect("Expected function, got error."))( + session, + data, + data_len, + signature, + signature_len, + ) + } + pub unsafe fn C_VerifyInit( + &self, + session: CK_SESSION_HANDLE, + mechanism: *mut _CK_MECHANISM, + key: CK_OBJECT_HANDLE, + ) -> CK_RV { + (self + .C_VerifyInit + .as_ref() + .expect("Expected function, got error."))(session, mechanism, key) + } + 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, + ) -> CK_RV { + (self + .C_Verify + .as_ref() + .expect("Expected function, got error."))( + session, + data, + data_len, + signature, + signature_len, + ) + } + pub unsafe fn C_VerifyUpdate( + &self, + session: CK_SESSION_HANDLE, + part: *mut ::std::os::raw::c_uchar, + part_len: ::std::os::raw::c_ulong, + ) -> CK_RV { + (self + .C_VerifyUpdate + .as_ref() + .expect("Expected function, got error."))(session, part, part_len) + } + pub unsafe fn C_VerifyFinal( + &self, + session: CK_SESSION_HANDLE, + signature: *mut ::std::os::raw::c_uchar, + signature_len: ::std::os::raw::c_ulong, + ) -> CK_RV { + (self + .C_VerifyFinal + .as_ref() + .expect("Expected function, got error."))(session, signature, signature_len) + } + pub unsafe fn C_VerifyRecoverInit( + &self, + session: CK_SESSION_HANDLE, + mechanism: *mut _CK_MECHANISM, + key: CK_OBJECT_HANDLE, + ) -> CK_RV { + (self + .C_VerifyRecoverInit + .as_ref() + .expect("Expected function, got error."))(session, mechanism, key) + } + 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, + ) -> CK_RV { + (self + .C_VerifyRecover + .as_ref() + .expect("Expected function, got error."))( + session, + signature, + signature_len, + data, + data_len, + ) + } + 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, + ) -> CK_RV { + (self + .C_DigestEncryptUpdate + .as_ref() + .expect("Expected function, got error."))( + session, + part, + part_len, + encrypted_part, + encrypted_part_len, + ) + } + 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, + ) -> CK_RV { + (self + .C_DecryptDigestUpdate + .as_ref() + .expect("Expected function, got error."))( + session, + encrypted_part, + encrypted_part_len, + part, + part_len, + ) + } + 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, + ) -> CK_RV { + (self + .C_SignEncryptUpdate + .as_ref() + .expect("Expected function, got error."))( + session, + part, + part_len, + encrypted_part, + encrypted_part_len, + ) + } + 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, + ) -> CK_RV { + (self + .C_DecryptVerifyUpdate + .as_ref() + .expect("Expected function, got error."))( + session, + encrypted_part, + encrypted_part_len, + part, + part_len, + ) + } + 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, + ) -> CK_RV { + (self + .C_GenerateKey + .as_ref() + .expect("Expected function, got error."))( + session, mechanism, templ, ulCount, key + ) + } + 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, + ) -> 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, + ) + } + 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, + ) -> CK_RV { + (self + .C_WrapKey + .as_ref() + .expect("Expected function, got error."))( + session, + mechanism, + wrapping_key, + key, + wrapped_key, + wrapped_key_len, + ) + } + 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, + ) -> 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, + ) + } + 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, + ) -> CK_RV { + (self + .C_DeriveKey + .as_ref() + .expect("Expected function, got error."))( + session, + mechanism, + base_key, + templ, + attribute_count, + key, + ) + } + pub unsafe fn C_SeedRandom( + &self, + session: CK_SESSION_HANDLE, + seed: *mut ::std::os::raw::c_uchar, + seed_len: ::std::os::raw::c_ulong, + ) -> CK_RV { + (self + .C_SeedRandom + .as_ref() + .expect("Expected function, got error."))(session, seed, seed_len) + } + 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, + ) -> CK_RV { + (self + .C_GenerateRandom + .as_ref() + .expect("Expected function, got error."))(session, random_data, random_len) + } + pub unsafe fn C_GetFunctionStatus(&self, session: CK_SESSION_HANDLE) -> CK_RV { + (self + .C_GetFunctionStatus + .as_ref() + .expect("Expected function, got error."))(session) + } + pub unsafe fn C_CancelFunction(&self, session: CK_SESSION_HANDLE) -> CK_RV { + (self + .C_CancelFunction + .as_ref() + .expect("Expected function, got error."))(session) + } } diff --git a/cryptoki-sys/src/bindings/aarch64-unknown-linux-gnu.rs b/cryptoki-sys/src/bindings/aarch64-unknown-linux-gnu.rs index 4264453a..6800365c 100644 --- a/cryptoki-sys/src/bindings/aarch64-unknown-linux-gnu.rs +++ b/cryptoki-sys/src/bindings/aarch64-unknown-linux-gnu.rs @@ -1,5 +1,691 @@ -/* automatically generated by rust-bindgen 0.59.2 */ +/* 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 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 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; +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 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 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_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_EC_EDWARDS: CK_KEY_TYPE = 64; +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 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_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_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_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_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; +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 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_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_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_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_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_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_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_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_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_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_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_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_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_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 CKF_HW: CK_FLAGS = 1; +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_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 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_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_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 = 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_FUNCTION_REJECTED: CK_RV = 512; +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; #[repr(C)] #[derive(Debug, Default, Copy, Clone)] @@ -9,6 +695,8 @@ pub struct _CK_VERSION { } #[test] fn bindgen_test_layout__CK_VERSION() { + const UNINIT: ::std::mem::MaybeUninit<_CK_VERSION> = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<_CK_VERSION>(), 2usize, @@ -20,7 +708,7 @@ fn bindgen_test_layout__CK_VERSION() { concat!("Alignment of ", stringify!(_CK_VERSION)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_VERSION>())).major as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).major) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -30,7 +718,7 @@ fn bindgen_test_layout__CK_VERSION() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_VERSION>())).minor as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).minor) as usize - ptr as usize }, 1usize, concat!( "Offset of field: ", @@ -51,6 +739,8 @@ pub struct _CK_INFO { } #[test] fn bindgen_test_layout__CK_INFO() { + const UNINIT: ::std::mem::MaybeUninit<_CK_INFO> = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<_CK_INFO>(), 88usize, @@ -62,7 +752,7 @@ fn bindgen_test_layout__CK_INFO() { concat!("Alignment of ", stringify!(_CK_INFO)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_INFO>())).cryptokiVersion as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).cryptokiVersion) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -72,7 +762,7 @@ fn bindgen_test_layout__CK_INFO() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_INFO>())).manufacturerID as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).manufacturerID) as usize - ptr as usize }, 2usize, concat!( "Offset of field: ", @@ -82,7 +772,7 @@ fn bindgen_test_layout__CK_INFO() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_INFO>())).flags as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).flags) as usize - ptr as usize }, 40usize, concat!( "Offset of field: ", @@ -92,7 +782,7 @@ fn bindgen_test_layout__CK_INFO() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_INFO>())).libraryDescription as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).libraryDescription) as usize - ptr as usize }, 48usize, concat!( "Offset of field: ", @@ -102,7 +792,7 @@ fn bindgen_test_layout__CK_INFO() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_INFO>())).libraryVersion as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).libraryVersion) as usize - ptr as usize }, 80usize, concat!( "Offset of field: ", @@ -113,6 +803,7 @@ fn bindgen_test_layout__CK_INFO() { ); } 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; #[repr(C)] #[derive(Debug, Copy, Clone)] @@ -125,6 +816,8 @@ pub struct _CK_SLOT_INFO { } #[test] fn bindgen_test_layout__CK_SLOT_INFO() { + const UNINIT: ::std::mem::MaybeUninit<_CK_SLOT_INFO> = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<_CK_SLOT_INFO>(), 112usize, @@ -136,7 +829,7 @@ fn bindgen_test_layout__CK_SLOT_INFO() { concat!("Alignment of ", stringify!(_CK_SLOT_INFO)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_SLOT_INFO>())).slotDescription as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).slotDescription) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -146,7 +839,7 @@ fn bindgen_test_layout__CK_SLOT_INFO() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_SLOT_INFO>())).manufacturerID as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).manufacturerID) as usize - ptr as usize }, 64usize, concat!( "Offset of field: ", @@ -156,7 +849,7 @@ fn bindgen_test_layout__CK_SLOT_INFO() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_SLOT_INFO>())).flags as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).flags) as usize - ptr as usize }, 96usize, concat!( "Offset of field: ", @@ -166,7 +859,7 @@ fn bindgen_test_layout__CK_SLOT_INFO() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_SLOT_INFO>())).hardwareVersion as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).hardwareVersion) as usize - ptr as usize }, 104usize, concat!( "Offset of field: ", @@ -176,7 +869,7 @@ fn bindgen_test_layout__CK_SLOT_INFO() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_SLOT_INFO>())).firmwareVersion as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).firmwareVersion) as usize - ptr as usize }, 106usize, concat!( "Offset of field: ", @@ -195,6 +888,10 @@ 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; #[repr(C)] #[derive(Debug, Default, Copy, Clone)] pub struct _CK_TOKEN_INFO { @@ -219,6 +916,8 @@ pub struct _CK_TOKEN_INFO { } #[test] fn bindgen_test_layout__CK_TOKEN_INFO() { + const UNINIT: ::std::mem::MaybeUninit<_CK_TOKEN_INFO> = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<_CK_TOKEN_INFO>(), 208usize, @@ -230,7 +929,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { concat!("Alignment of ", stringify!(_CK_TOKEN_INFO)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_TOKEN_INFO>())).label as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).label) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -240,7 +939,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_TOKEN_INFO>())).manufacturerID as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).manufacturerID) as usize - ptr as usize }, 32usize, concat!( "Offset of field: ", @@ -250,7 +949,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_TOKEN_INFO>())).model as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).model) as usize - ptr as usize }, 64usize, concat!( "Offset of field: ", @@ -260,7 +959,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_TOKEN_INFO>())).serialNumber as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).serialNumber) as usize - ptr as usize }, 80usize, concat!( "Offset of field: ", @@ -270,7 +969,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_TOKEN_INFO>())).flags as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).flags) as usize - ptr as usize }, 96usize, concat!( "Offset of field: ", @@ -280,9 +979,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_TOKEN_INFO>())).ulMaxSessionCount as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).ulMaxSessionCount) as usize - ptr as usize }, 104usize, concat!( "Offset of field: ", @@ -292,7 +989,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_TOKEN_INFO>())).ulSessionCount as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ulSessionCount) as usize - ptr as usize }, 112usize, concat!( "Offset of field: ", @@ -302,9 +999,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_TOKEN_INFO>())).ulMaxRwSessionCount as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).ulMaxRwSessionCount) as usize - ptr as usize }, 120usize, concat!( "Offset of field: ", @@ -314,7 +1009,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_TOKEN_INFO>())).ulRwSessionCount as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ulRwSessionCount) as usize - ptr as usize }, 128usize, concat!( "Offset of field: ", @@ -324,7 +1019,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_TOKEN_INFO>())).ulMaxPinLen as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ulMaxPinLen) as usize - ptr as usize }, 136usize, concat!( "Offset of field: ", @@ -334,7 +1029,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_TOKEN_INFO>())).ulMinPinLen as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ulMinPinLen) as usize - ptr as usize }, 144usize, concat!( "Offset of field: ", @@ -344,9 +1039,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_TOKEN_INFO>())).ulTotalPublicMemory as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).ulTotalPublicMemory) as usize - ptr as usize }, 152usize, concat!( "Offset of field: ", @@ -356,9 +1049,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_TOKEN_INFO>())).ulFreePublicMemory as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).ulFreePublicMemory) as usize - ptr as usize }, 160usize, concat!( "Offset of field: ", @@ -368,9 +1059,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_TOKEN_INFO>())).ulTotalPrivateMemory as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).ulTotalPrivateMemory) as usize - ptr as usize }, 168usize, concat!( "Offset of field: ", @@ -380,9 +1069,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_TOKEN_INFO>())).ulFreePrivateMemory as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).ulFreePrivateMemory) as usize - ptr as usize }, 176usize, concat!( "Offset of field: ", @@ -392,7 +1079,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_TOKEN_INFO>())).hardwareVersion as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).hardwareVersion) as usize - ptr as usize }, 184usize, concat!( "Offset of field: ", @@ -402,7 +1089,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_TOKEN_INFO>())).firmwareVersion as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).firmwareVersion) as usize - ptr as usize }, 186usize, concat!( "Offset of field: ", @@ -412,7 +1099,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_TOKEN_INFO>())).utcTime as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).utcTime) as usize - ptr as usize }, 188usize, concat!( "Offset of field: ", @@ -435,6 +1122,8 @@ pub struct _CK_SESSION_INFO { } #[test] fn bindgen_test_layout__CK_SESSION_INFO() { + const UNINIT: ::std::mem::MaybeUninit<_CK_SESSION_INFO> = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<_CK_SESSION_INFO>(), 32usize, @@ -446,7 +1135,7 @@ fn bindgen_test_layout__CK_SESSION_INFO() { concat!("Alignment of ", stringify!(_CK_SESSION_INFO)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_SESSION_INFO>())).slotID as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).slotID) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -456,7 +1145,7 @@ fn bindgen_test_layout__CK_SESSION_INFO() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_SESSION_INFO>())).state as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).state) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -466,7 +1155,7 @@ fn bindgen_test_layout__CK_SESSION_INFO() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_SESSION_INFO>())).flags as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).flags) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", @@ -476,7 +1165,7 @@ fn bindgen_test_layout__CK_SESSION_INFO() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_SESSION_INFO>())).ulDeviceError as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ulDeviceError) as usize - ptr as usize }, 24usize, concat!( "Offset of field: ", @@ -501,6 +1190,8 @@ pub struct _CK_ATTRIBUTE { } #[test] fn bindgen_test_layout__CK_ATTRIBUTE() { + const UNINIT: ::std::mem::MaybeUninit<_CK_ATTRIBUTE> = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<_CK_ATTRIBUTE>(), 24usize, @@ -512,7 +1203,7 @@ fn bindgen_test_layout__CK_ATTRIBUTE() { concat!("Alignment of ", stringify!(_CK_ATTRIBUTE)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_ATTRIBUTE>())).type_ as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).type_) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -522,7 +1213,7 @@ fn bindgen_test_layout__CK_ATTRIBUTE() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_ATTRIBUTE>())).pValue as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).pValue) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -532,7 +1223,7 @@ fn bindgen_test_layout__CK_ATTRIBUTE() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_ATTRIBUTE>())).ulValueLen as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ulValueLen) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", @@ -560,6 +1251,8 @@ pub struct _CK_DATE { } #[test] fn bindgen_test_layout__CK_DATE() { + const UNINIT: ::std::mem::MaybeUninit<_CK_DATE> = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<_CK_DATE>(), 8usize, @@ -571,7 +1264,7 @@ fn bindgen_test_layout__CK_DATE() { concat!("Alignment of ", stringify!(_CK_DATE)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_DATE>())).year as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).year) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -581,7 +1274,7 @@ fn bindgen_test_layout__CK_DATE() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_DATE>())).month as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).month) as usize - ptr as usize }, 4usize, concat!( "Offset of field: ", @@ -591,7 +1284,7 @@ fn bindgen_test_layout__CK_DATE() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_DATE>())).day as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).day) as usize - ptr as usize }, 6usize, concat!( "Offset of field: ", @@ -611,6 +1304,8 @@ pub struct _CK_MECHANISM { } #[test] fn bindgen_test_layout__CK_MECHANISM() { + const UNINIT: ::std::mem::MaybeUninit<_CK_MECHANISM> = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<_CK_MECHANISM>(), 24usize, @@ -622,7 +1317,7 @@ fn bindgen_test_layout__CK_MECHANISM() { concat!("Alignment of ", stringify!(_CK_MECHANISM)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_MECHANISM>())).mechanism as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).mechanism) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -632,7 +1327,7 @@ fn bindgen_test_layout__CK_MECHANISM() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_MECHANISM>())).pParameter as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).pParameter) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -642,7 +1337,7 @@ fn bindgen_test_layout__CK_MECHANISM() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_MECHANISM>())).ulParameterLen as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ulParameterLen) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", @@ -670,6 +1365,8 @@ pub struct _CK_MECHANISM_INFO { } #[test] fn bindgen_test_layout__CK_MECHANISM_INFO() { + const UNINIT: ::std::mem::MaybeUninit<_CK_MECHANISM_INFO> = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<_CK_MECHANISM_INFO>(), 24usize, @@ -681,7 +1378,7 @@ fn bindgen_test_layout__CK_MECHANISM_INFO() { concat!("Alignment of ", stringify!(_CK_MECHANISM_INFO)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_MECHANISM_INFO>())).ulMinKeySize as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ulMinKeySize) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -691,7 +1388,7 @@ fn bindgen_test_layout__CK_MECHANISM_INFO() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_MECHANISM_INFO>())).ulMaxKeySize as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ulMaxKeySize) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -701,7 +1398,7 @@ fn bindgen_test_layout__CK_MECHANISM_INFO() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_MECHANISM_INFO>())).flags as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).flags) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", @@ -721,6 +1418,8 @@ pub struct CK_OTP_PARAM { } #[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, @@ -732,7 +1431,7 @@ fn bindgen_test_layout_CK_OTP_PARAM() { concat!("Alignment of ", stringify!(CK_OTP_PARAM)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).type_ as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).type_) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -742,7 +1441,7 @@ fn bindgen_test_layout_CK_OTP_PARAM() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).pValue as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).pValue) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -752,7 +1451,7 @@ fn bindgen_test_layout_CK_OTP_PARAM() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).ulValueLen as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ulValueLen) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", @@ -779,6 +1478,8 @@ pub struct CK_OTP_PARAMS { } #[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, @@ -790,7 +1491,7 @@ fn bindgen_test_layout_CK_OTP_PARAMS() { concat!("Alignment of ", stringify!(CK_OTP_PARAMS)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).pParams as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).pParams) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -800,7 +1501,7 @@ fn bindgen_test_layout_CK_OTP_PARAMS() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).ulCount as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ulCount) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -827,6 +1528,9 @@ pub struct CK_OTP_SIGNATURE_INFO { } #[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, @@ -838,7 +1542,7 @@ fn bindgen_test_layout_CK_OTP_SIGNATURE_INFO() { concat!("Alignment of ", stringify!(CK_OTP_SIGNATURE_INFO)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).pParams as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).pParams) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -848,7 +1552,7 @@ fn bindgen_test_layout_CK_OTP_SIGNATURE_INFO() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).ulCount as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ulCount) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -877,6 +1581,9 @@ pub struct ck_rsa_pkcs_pss_params { } #[test] fn bindgen_test_layout_ck_rsa_pkcs_pss_params() { + const UNINIT: ::std::mem::MaybeUninit = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), 24usize, @@ -888,7 +1595,7 @@ fn bindgen_test_layout_ck_rsa_pkcs_pss_params() { concat!("Alignment of ", stringify!(ck_rsa_pkcs_pss_params)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).hashAlg as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).hashAlg) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -898,7 +1605,7 @@ fn bindgen_test_layout_ck_rsa_pkcs_pss_params() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).mgf as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).mgf) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -908,7 +1615,7 @@ fn bindgen_test_layout_ck_rsa_pkcs_pss_params() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).sLen as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).sLen) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", @@ -930,6 +1637,9 @@ pub struct ck_rsa_pkcs_oaep_params { } #[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, @@ -941,7 +1651,7 @@ fn bindgen_test_layout_ck_rsa_pkcs_oaep_params() { concat!("Alignment of ", stringify!(ck_rsa_pkcs_oaep_params)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).hashAlg as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).hashAlg) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -951,7 +1661,7 @@ fn bindgen_test_layout_ck_rsa_pkcs_oaep_params() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).mgf as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).mgf) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -961,7 +1671,7 @@ fn bindgen_test_layout_ck_rsa_pkcs_oaep_params() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).source as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).source) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", @@ -971,9 +1681,7 @@ fn bindgen_test_layout_ck_rsa_pkcs_oaep_params() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).pSourceData as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).pSourceData) as usize - ptr as usize }, 24usize, concat!( "Offset of field: ", @@ -983,9 +1691,7 @@ fn bindgen_test_layout_ck_rsa_pkcs_oaep_params() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).ulSourceDataLen as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).ulSourceDataLen) as usize - ptr as usize }, 32usize, concat!( "Offset of field: ", @@ -1012,6 +1718,8 @@ pub struct ck_aes_ctr_params { } #[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, @@ -1023,7 +1731,7 @@ fn bindgen_test_layout_ck_aes_ctr_params() { concat!("Alignment of ", stringify!(ck_aes_ctr_params)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).ulCounterBits as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ulCounterBits) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -1033,7 +1741,7 @@ fn bindgen_test_layout_ck_aes_ctr_params() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).cb as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).cb) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -1055,6 +1763,8 @@ pub struct ck_gcm_params { } #[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, @@ -1066,7 +1776,7 @@ fn bindgen_test_layout_ck_gcm_params() { concat!("Alignment of ", stringify!(ck_gcm_params)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).pIv as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).pIv) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -1076,7 +1786,7 @@ fn bindgen_test_layout_ck_gcm_params() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).ulIvLen as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ulIvLen) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -1086,7 +1796,7 @@ fn bindgen_test_layout_ck_gcm_params() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).ulIvBits as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ulIvBits) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", @@ -1096,7 +1806,7 @@ fn bindgen_test_layout_ck_gcm_params() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).pAAD as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).pAAD) as usize - ptr as usize }, 24usize, concat!( "Offset of field: ", @@ -1106,7 +1816,7 @@ fn bindgen_test_layout_ck_gcm_params() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).ulAADLen as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ulAADLen) as usize - ptr as usize }, 32usize, concat!( "Offset of field: ", @@ -1116,7 +1826,7 @@ fn bindgen_test_layout_ck_gcm_params() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).ulTagBits as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ulTagBits) as usize - ptr as usize }, 40usize, concat!( "Offset of field: ", @@ -1147,6 +1857,9 @@ pub struct ck_ecdh1_derive_params { } #[test] fn bindgen_test_layout_ck_ecdh1_derive_params() { + const UNINIT: ::std::mem::MaybeUninit = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), 40usize, @@ -1158,7 +1871,7 @@ fn bindgen_test_layout_ck_ecdh1_derive_params() { concat!("Alignment of ", stringify!(ck_ecdh1_derive_params)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).kdf as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).kdf) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -1168,9 +1881,7 @@ fn bindgen_test_layout_ck_ecdh1_derive_params() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).ulSharedDataLen as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).ulSharedDataLen) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -1180,9 +1891,7 @@ fn bindgen_test_layout_ck_ecdh1_derive_params() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).pSharedData as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).pSharedData) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", @@ -1192,9 +1901,7 @@ fn bindgen_test_layout_ck_ecdh1_derive_params() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).ulPublicDataLen as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).ulPublicDataLen) as usize - ptr as usize }, 24usize, concat!( "Offset of field: ", @@ -1204,9 +1911,7 @@ fn bindgen_test_layout_ck_ecdh1_derive_params() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).pPublicData as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).pPublicData) as usize - ptr as usize }, 32usize, concat!( "Offset of field: ", @@ -1233,6 +1938,9 @@ pub struct ck_key_derivation_string_data { } #[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, @@ -1244,9 +1952,7 @@ fn bindgen_test_layout_ck_key_derivation_string_data() { concat!("Alignment of ", stringify!(ck_key_derivation_string_data)) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).pData as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).pData) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -1256,9 +1962,7 @@ fn bindgen_test_layout_ck_key_derivation_string_data() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).ulLen as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).ulLen) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -1286,6 +1990,9 @@ pub struct ck_des_cbc_encrypt_data_params { } #[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, @@ -1297,9 +2004,7 @@ fn bindgen_test_layout_ck_des_cbc_encrypt_data_params() { concat!("Alignment of ", stringify!(ck_des_cbc_encrypt_data_params)) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).iv as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).iv) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -1309,9 +2014,7 @@ fn bindgen_test_layout_ck_des_cbc_encrypt_data_params() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).pData as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).pData) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -1321,9 +2024,7 @@ fn bindgen_test_layout_ck_des_cbc_encrypt_data_params() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).length as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).length) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", @@ -1351,6 +2052,9 @@ pub struct ck_aes_cbc_encrypt_data_params { } #[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, @@ -1362,9 +2066,7 @@ fn bindgen_test_layout_ck_aes_cbc_encrypt_data_params() { concat!("Alignment of ", stringify!(ck_aes_cbc_encrypt_data_params)) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).iv as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).iv) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -1374,9 +2076,7 @@ fn bindgen_test_layout_ck_aes_cbc_encrypt_data_params() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).pData as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).pData) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", @@ -1386,9 +2086,7 @@ fn bindgen_test_layout_ck_aes_cbc_encrypt_data_params() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).length as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).length) as usize - ptr as usize }, 24usize, concat!( "Offset of field: ", @@ -1950,6 +2648,8 @@ pub struct _CK_FUNCTION_LIST { } #[test] fn bindgen_test_layout__CK_FUNCTION_LIST() { + const UNINIT: ::std::mem::MaybeUninit<_CK_FUNCTION_LIST> = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<_CK_FUNCTION_LIST>(), 552usize, @@ -1961,7 +2661,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { concat!("Alignment of ", stringify!(_CK_FUNCTION_LIST)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).version as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).version) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -1971,7 +2671,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_Initialize as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_Initialize) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -1981,7 +2681,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_Finalize as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_Finalize) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", @@ -1991,7 +2691,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_GetInfo as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_GetInfo) as usize - ptr as usize }, 24usize, concat!( "Offset of field: ", @@ -2001,9 +2701,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_GetFunctionList as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_GetFunctionList) as usize - ptr as usize }, 32usize, concat!( "Offset of field: ", @@ -2013,7 +2711,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_GetSlotList as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_GetSlotList) as usize - ptr as usize }, 40usize, concat!( "Offset of field: ", @@ -2023,7 +2721,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_GetSlotInfo as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_GetSlotInfo) as usize - ptr as usize }, 48usize, concat!( "Offset of field: ", @@ -2033,9 +2731,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_GetTokenInfo as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_GetTokenInfo) as usize - ptr as usize }, 56usize, concat!( "Offset of field: ", @@ -2045,9 +2741,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_GetMechanismList as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_GetMechanismList) as usize - ptr as usize }, 64usize, concat!( "Offset of field: ", @@ -2057,9 +2751,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_GetMechanismInfo as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_GetMechanismInfo) as usize - ptr as usize }, 72usize, concat!( "Offset of field: ", @@ -2069,7 +2761,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_InitToken as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_InitToken) as usize - ptr as usize }, 80usize, concat!( "Offset of field: ", @@ -2079,7 +2771,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_InitPIN as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_InitPIN) as usize - ptr as usize }, 88usize, concat!( "Offset of field: ", @@ -2089,7 +2781,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_SetPIN as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_SetPIN) as usize - ptr as usize }, 96usize, concat!( "Offset of field: ", @@ -2099,7 +2791,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_OpenSession as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_OpenSession) as usize - ptr as usize }, 104usize, concat!( "Offset of field: ", @@ -2109,9 +2801,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_CloseSession as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_CloseSession) as usize - ptr as usize }, 112usize, concat!( "Offset of field: ", @@ -2121,9 +2811,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_CloseAllSessions as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_CloseAllSessions) as usize - ptr as usize }, 120usize, concat!( "Offset of field: ", @@ -2133,9 +2821,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_GetSessionInfo as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_GetSessionInfo) as usize - ptr as usize }, 128usize, concat!( "Offset of field: ", @@ -2145,9 +2831,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_GetOperationState as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_GetOperationState) as usize - ptr as usize }, 136usize, concat!( "Offset of field: ", @@ -2157,9 +2841,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_SetOperationState as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_SetOperationState) as usize - ptr as usize }, 144usize, concat!( "Offset of field: ", @@ -2169,7 +2851,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_Login as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_Login) as usize - ptr as usize }, 152usize, concat!( "Offset of field: ", @@ -2179,7 +2861,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_Logout as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_Logout) as usize - ptr as usize }, 160usize, concat!( "Offset of field: ", @@ -2189,9 +2871,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_CreateObject as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_CreateObject) as usize - ptr as usize }, 168usize, concat!( "Offset of field: ", @@ -2201,7 +2881,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_CopyObject as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_CopyObject) as usize - ptr as usize }, 176usize, concat!( "Offset of field: ", @@ -2211,9 +2891,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_DestroyObject as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_DestroyObject) as usize - ptr as usize }, 184usize, concat!( "Offset of field: ", @@ -2223,9 +2901,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_GetObjectSize as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_GetObjectSize) as usize - ptr as usize }, 192usize, concat!( "Offset of field: ", @@ -2235,9 +2911,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_GetAttributeValue as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_GetAttributeValue) as usize - ptr as usize }, 200usize, concat!( "Offset of field: ", @@ -2247,9 +2921,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_SetAttributeValue as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_SetAttributeValue) as usize - ptr as usize }, 208usize, concat!( "Offset of field: ", @@ -2259,9 +2931,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_FindObjectsInit as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_FindObjectsInit) as usize - ptr as usize }, 216usize, concat!( "Offset of field: ", @@ -2271,7 +2941,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_FindObjects as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_FindObjects) as usize - ptr as usize }, 224usize, concat!( "Offset of field: ", @@ -2281,9 +2951,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_FindObjectsFinal as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_FindObjectsFinal) as usize - ptr as usize }, 232usize, concat!( "Offset of field: ", @@ -2293,7 +2961,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_EncryptInit as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_EncryptInit) as usize - ptr as usize }, 240usize, concat!( "Offset of field: ", @@ -2303,7 +2971,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_Encrypt as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_Encrypt) as usize - ptr as usize }, 248usize, concat!( "Offset of field: ", @@ -2313,9 +2981,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_EncryptUpdate as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_EncryptUpdate) as usize - ptr as usize }, 256usize, concat!( "Offset of field: ", @@ -2325,9 +2991,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_EncryptFinal as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_EncryptFinal) as usize - ptr as usize }, 264usize, concat!( "Offset of field: ", @@ -2337,7 +3001,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_DecryptInit as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_DecryptInit) as usize - ptr as usize }, 272usize, concat!( "Offset of field: ", @@ -2347,7 +3011,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_Decrypt as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_Decrypt) as usize - ptr as usize }, 280usize, concat!( "Offset of field: ", @@ -2357,9 +3021,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_DecryptUpdate as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_DecryptUpdate) as usize - ptr as usize }, 288usize, concat!( "Offset of field: ", @@ -2369,9 +3031,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_DecryptFinal as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_DecryptFinal) as usize - ptr as usize }, 296usize, concat!( "Offset of field: ", @@ -2381,7 +3041,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_DigestInit as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_DigestInit) as usize - ptr as usize }, 304usize, concat!( "Offset of field: ", @@ -2391,7 +3051,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_Digest as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_Digest) as usize - ptr as usize }, 312usize, concat!( "Offset of field: ", @@ -2401,9 +3061,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_DigestUpdate as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_DigestUpdate) as usize - ptr as usize }, 320usize, concat!( "Offset of field: ", @@ -2413,7 +3071,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_DigestKey as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_DigestKey) as usize - ptr as usize }, 328usize, concat!( "Offset of field: ", @@ -2423,7 +3081,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_DigestFinal as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_DigestFinal) as usize - ptr as usize }, 336usize, concat!( "Offset of field: ", @@ -2433,7 +3091,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_SignInit as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_SignInit) as usize - ptr as usize }, 344usize, concat!( "Offset of field: ", @@ -2443,7 +3101,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_Sign as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_Sign) as usize - ptr as usize }, 352usize, concat!( "Offset of field: ", @@ -2453,7 +3111,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_SignUpdate as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_SignUpdate) as usize - ptr as usize }, 360usize, concat!( "Offset of field: ", @@ -2463,7 +3121,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_SignFinal as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_SignFinal) as usize - ptr as usize }, 368usize, concat!( "Offset of field: ", @@ -2473,9 +3131,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_SignRecoverInit as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_SignRecoverInit) as usize - ptr as usize }, 376usize, concat!( "Offset of field: ", @@ -2485,7 +3141,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_SignRecover as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_SignRecover) as usize - ptr as usize }, 384usize, concat!( "Offset of field: ", @@ -2495,7 +3151,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_VerifyInit as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_VerifyInit) as usize - ptr as usize }, 392usize, concat!( "Offset of field: ", @@ -2505,7 +3161,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_Verify as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_Verify) as usize - ptr as usize }, 400usize, concat!( "Offset of field: ", @@ -2515,9 +3171,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_VerifyUpdate as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_VerifyUpdate) as usize - ptr as usize }, 408usize, concat!( "Offset of field: ", @@ -2527,7 +3181,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_VerifyFinal as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_VerifyFinal) as usize - ptr as usize }, 416usize, concat!( "Offset of field: ", @@ -2537,9 +3191,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_VerifyRecoverInit as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_VerifyRecoverInit) as usize - ptr as usize }, 424usize, concat!( "Offset of field: ", @@ -2549,9 +3201,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_VerifyRecover as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_VerifyRecover) as usize - ptr as usize }, 432usize, concat!( "Offset of field: ", @@ -2561,9 +3211,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_DigestEncryptUpdate as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_DigestEncryptUpdate) as usize - ptr as usize }, 440usize, concat!( "Offset of field: ", @@ -2573,9 +3221,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_DecryptDigestUpdate as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_DecryptDigestUpdate) as usize - ptr as usize }, 448usize, concat!( "Offset of field: ", @@ -2585,9 +3231,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_SignEncryptUpdate as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_SignEncryptUpdate) as usize - ptr as usize }, 456usize, concat!( "Offset of field: ", @@ -2597,9 +3241,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_DecryptVerifyUpdate as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_DecryptVerifyUpdate) as usize - ptr as usize }, 464usize, concat!( "Offset of field: ", @@ -2609,7 +3251,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_GenerateKey as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_GenerateKey) as usize - ptr as usize }, 472usize, concat!( "Offset of field: ", @@ -2619,9 +3261,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_GenerateKeyPair as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_GenerateKeyPair) as usize - ptr as usize }, 480usize, concat!( "Offset of field: ", @@ -2631,7 +3271,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_WrapKey as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_WrapKey) as usize - ptr as usize }, 488usize, concat!( "Offset of field: ", @@ -2641,7 +3281,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_UnwrapKey as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_UnwrapKey) as usize - ptr as usize }, 496usize, concat!( "Offset of field: ", @@ -2651,7 +3291,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_DeriveKey as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_DeriveKey) as usize - ptr as usize }, 504usize, concat!( "Offset of field: ", @@ -2661,7 +3301,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_SeedRandom as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_SeedRandom) as usize - ptr as usize }, 512usize, concat!( "Offset of field: ", @@ -2671,9 +3311,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_GenerateRandom as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_GenerateRandom) as usize - ptr as usize }, 520usize, concat!( "Offset of field: ", @@ -2683,9 +3321,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_GetFunctionStatus as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_GetFunctionStatus) as usize - ptr as usize }, 528usize, concat!( "Offset of field: ", @@ -2695,9 +3331,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_CancelFunction as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_CancelFunction) as usize - ptr as usize }, 536usize, concat!( "Offset of field: ", @@ -2707,9 +3341,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_WaitForSlotEvent as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_WaitForSlotEvent) as usize - ptr as usize }, 544usize, concat!( "Offset of field: ", @@ -2739,6 +3371,9 @@ pub struct _CK_C_INITIALIZE_ARGS { } #[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, @@ -2750,9 +3385,7 @@ fn bindgen_test_layout__CK_C_INITIALIZE_ARGS() { concat!("Alignment of ", stringify!(_CK_C_INITIALIZE_ARGS)) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_C_INITIALIZE_ARGS>())).CreateMutex as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).CreateMutex) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -2762,9 +3395,7 @@ fn bindgen_test_layout__CK_C_INITIALIZE_ARGS() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_C_INITIALIZE_ARGS>())).DestroyMutex as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).DestroyMutex) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -2774,7 +3405,7 @@ fn bindgen_test_layout__CK_C_INITIALIZE_ARGS() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_C_INITIALIZE_ARGS>())).LockMutex as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).LockMutex) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", @@ -2784,9 +3415,7 @@ fn bindgen_test_layout__CK_C_INITIALIZE_ARGS() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_C_INITIALIZE_ARGS>())).UnlockMutex as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).UnlockMutex) as usize - ptr as usize }, 24usize, concat!( "Offset of field: ", @@ -2796,7 +3425,7 @@ fn bindgen_test_layout__CK_C_INITIALIZE_ARGS() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_C_INITIALIZE_ARGS>())).flags as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).flags) as usize - ptr as usize }, 32usize, concat!( "Offset of field: ", @@ -2806,7 +3435,7 @@ fn bindgen_test_layout__CK_C_INITIALIZE_ARGS() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_C_INITIALIZE_ARGS>())).pReserved as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).pReserved) as usize - ptr as usize }, 40usize, concat!( "Offset of field: ", @@ -2825,8 +3454,6 @@ impl Default for _CK_C_INITIALIZE_ARGS { } } } -pub type size_t = ::std::os::raw::c_ulong; -pub type wchar_t = ::std::os::raw::c_uint; 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; @@ -2893,10 +3520,529 @@ pub type CK_AES_CBC_ENCRYPT_DATA_PARAMS_PTR = *mut ck_aes_cbc_encrypt_data_param 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_GetFunctionList: Result< unsafe extern "C" fn(function_list: *mut *mut _CK_FUNCTION_LIST) -> 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, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_GetSlotInfo: Result< + unsafe extern "C" fn(slotID: CK_SLOT_ID, info: *mut _CK_SLOT_INFO) -> 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, + ::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, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_GetMechanismInfo: Result< + unsafe extern "C" fn( + slotID: CK_SLOT_ID, + type_: CK_MECHANISM_TYPE, + info: *mut _CK_MECHANISM_INFO, + ) -> 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, + ) -> 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, + ) -> 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, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_OpenSession: Result< + 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, + ::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(session: CK_SESSION_HANDLE, info: *mut _CK_SESSION_INFO) -> 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, + ) -> 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, + ) -> 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, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_Logout: + 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, + ) -> 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, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_DestroyObject: Result< + unsafe extern "C" fn(session: CK_SESSION_HANDLE, object: 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, + ) -> 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, + ) -> 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, + ) -> 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, + ) -> 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, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_FindObjectsFinal: + 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, + ) -> 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, + ) -> 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, + ) -> 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, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_DecryptInit: Result< + unsafe extern "C" fn( + session: CK_SESSION_HANDLE, + mechanism: *mut _CK_MECHANISM, + key: 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, + ) -> 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, + ) -> 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, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_DigestInit: Result< + unsafe extern "C" fn(session: CK_SESSION_HANDLE, mechanism: *mut _CK_MECHANISM) -> 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, + ) -> 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, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_DigestKey: Result< + unsafe extern "C" fn(session: CK_SESSION_HANDLE, key: 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, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_SignInit: Result< + unsafe extern "C" fn( + session: CK_SESSION_HANDLE, + mechanism: *mut _CK_MECHANISM, + key: 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, + ) -> 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, + ) -> 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, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_SignRecoverInit: Result< + unsafe extern "C" fn( + session: CK_SESSION_HANDLE, + mechanism: *mut _CK_MECHANISM, + key: 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, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_VerifyInit: Result< + unsafe extern "C" fn( + session: CK_SESSION_HANDLE, + mechanism: *mut _CK_MECHANISM, + key: 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, + ) -> 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, + ) -> 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, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_VerifyRecoverInit: Result< + unsafe extern "C" fn( + session: CK_SESSION_HANDLE, + mechanism: *mut _CK_MECHANISM, + key: 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, + ) -> 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, + ) -> 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, + ) -> 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, + ) -> 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, + ) -> 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, + ) -> 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, + ) -> 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, + ) -> 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, + ) -> 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, + ) -> 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, + ) -> 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, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_GetFunctionStatus: + Result CK_RV, ::libloading::Error>, + pub C_CancelFunction: + Result CK_RV, ::libloading::Error>, } impl Pkcs11 { pub unsafe fn new

(path: P) -> Result @@ -2911,16 +4057,1010 @@ impl Pkcs11 { 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_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); + 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); Ok(Pkcs11 { __library, + C_Initialize, + C_Finalize, + C_GetInfo, C_GetFunctionList, + C_GetSlotList, + C_GetSlotInfo, + C_GetTokenInfo, + C_WaitForSlotEvent, + 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, }) } + pub unsafe fn C_Initialize(&self, init_args: *mut ::std::os::raw::c_void) -> CK_RV { + (self + .C_Initialize + .as_ref() + .expect("Expected function, got error."))(init_args) + } + pub unsafe fn C_Finalize(&self, pReserved: *mut ::std::os::raw::c_void) -> 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 { + (self + .C_GetInfo + .as_ref() + .expect("Expected function, got error."))(info) + } pub unsafe fn C_GetFunctionList(&self, function_list: *mut *mut _CK_FUNCTION_LIST) -> CK_RV { (self .C_GetFunctionList .as_ref() .expect("Expected function, got error."))(function_list) } + 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, + ) -> CK_RV { + (self + .C_GetSlotList + .as_ref() + .expect("Expected function, got error."))(token_present, slot_list, ulCount) + } + pub unsafe fn C_GetSlotInfo(&self, slotID: CK_SLOT_ID, info: *mut _CK_SLOT_INFO) -> CK_RV { + (self + .C_GetSlotInfo + .as_ref() + .expect("Expected function, got error."))(slotID, info) + } + pub unsafe fn C_GetTokenInfo(&self, slotID: CK_SLOT_ID, info: *mut _CK_TOKEN_INFO) -> 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) + } + pub unsafe fn C_GetMechanismList( + &self, + slotID: CK_SLOT_ID, + mechanism_list: *mut CK_MECHANISM_TYPE, + ulCount: *mut ::std::os::raw::c_ulong, + ) -> CK_RV { + (self + .C_GetMechanismList + .as_ref() + .expect("Expected function, got error."))(slotID, mechanism_list, ulCount) + } + pub unsafe fn C_GetMechanismInfo( + &self, + slotID: CK_SLOT_ID, + type_: CK_MECHANISM_TYPE, + info: *mut _CK_MECHANISM_INFO, + ) -> CK_RV { + (self + .C_GetMechanismInfo + .as_ref() + .expect("Expected function, got error."))(slotID, type_, info) + } + 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, + ) -> CK_RV { + (self + .C_InitToken + .as_ref() + .expect("Expected function, got error."))(slotID, pin, pin_len, label) + } + pub unsafe fn C_InitPIN( + &self, + session: CK_SESSION_HANDLE, + pin: *mut ::std::os::raw::c_uchar, + pin_len: ::std::os::raw::c_ulong, + ) -> CK_RV { + (self + .C_InitPIN + .as_ref() + .expect("Expected function, got error."))(session, pin, pin_len) + } + 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, + ) -> CK_RV { + (self + .C_SetPIN + .as_ref() + .expect("Expected function, got error."))( + session, old_pin, old_len, new_pin, new_len + ) + } + 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, + ) -> CK_RV { + (self + .C_OpenSession + .as_ref() + .expect("Expected function, got error."))( + slotID, flags, application, notify, session + ) + } + pub unsafe fn C_CloseSession(&self, session: CK_SESSION_HANDLE) -> CK_RV { + (self + .C_CloseSession + .as_ref() + .expect("Expected function, got error."))(session) + } + 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, + session: CK_SESSION_HANDLE, + info: *mut _CK_SESSION_INFO, + ) -> CK_RV { + (self + .C_GetSessionInfo + .as_ref() + .expect("Expected function, got error."))(session, info) + } + 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, + ) -> CK_RV { + (self + .C_GetOperationState + .as_ref() + .expect("Expected function, got error."))( + session, operation_state, operation_state_len + ) + } + 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, + ) -> CK_RV { + (self + .C_SetOperationState + .as_ref() + .expect("Expected function, got error."))( + session, + operation_state, + operation_state_len, + encryption_key, + authentiation_key, + ) + } + 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, + ) -> CK_RV { + (self + .C_Login + .as_ref() + .expect("Expected function, got error."))(session, user_type, pin, pin_len) + } + pub unsafe fn C_Logout(&self, session: CK_SESSION_HANDLE) -> CK_RV { + (self + .C_Logout + .as_ref() + .expect("Expected function, got error."))(session) + } + 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, + ) -> CK_RV { + (self + .C_CreateObject + .as_ref() + .expect("Expected function, got error."))(session, templ, ulCount, object) + } + 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, + ) -> CK_RV { + (self + .C_CopyObject + .as_ref() + .expect("Expected function, got error."))( + session, object, templ, ulCount, new_object + ) + } + pub unsafe fn C_DestroyObject( + &self, + session: CK_SESSION_HANDLE, + object: CK_OBJECT_HANDLE, + ) -> CK_RV { + (self + .C_DestroyObject + .as_ref() + .expect("Expected function, got error."))(session, object) + } + pub unsafe fn C_GetObjectSize( + &self, + session: CK_SESSION_HANDLE, + object: CK_OBJECT_HANDLE, + size: *mut ::std::os::raw::c_ulong, + ) -> CK_RV { + (self + .C_GetObjectSize + .as_ref() + .expect("Expected function, got error."))(session, object, size) + } + pub unsafe fn C_GetAttributeValue( + &self, + session: CK_SESSION_HANDLE, + object: CK_OBJECT_HANDLE, + templ: *mut _CK_ATTRIBUTE, + ulCount: ::std::os::raw::c_ulong, + ) -> CK_RV { + (self + .C_GetAttributeValue + .as_ref() + .expect("Expected function, got error."))(session, object, templ, 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, + ) -> CK_RV { + (self + .C_SetAttributeValue + .as_ref() + .expect("Expected function, got error."))(session, object, templ, ulCount) + } + pub unsafe fn C_FindObjectsInit( + &self, + session: CK_SESSION_HANDLE, + templ: *mut _CK_ATTRIBUTE, + ulCount: ::std::os::raw::c_ulong, + ) -> CK_RV { + (self + .C_FindObjectsInit + .as_ref() + .expect("Expected function, got error."))(session, templ, 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, + ) -> CK_RV { + (self + .C_FindObjects + .as_ref() + .expect("Expected function, got error."))( + session, + object, + max_object_count, + object_count, + ) + } + pub unsafe fn C_FindObjectsFinal(&self, session: CK_SESSION_HANDLE) -> CK_RV { + (self + .C_FindObjectsFinal + .as_ref() + .expect("Expected function, got error."))(session) + } + pub unsafe fn C_EncryptInit( + &self, + session: CK_SESSION_HANDLE, + mechanism: *mut _CK_MECHANISM, + key: CK_OBJECT_HANDLE, + ) -> CK_RV { + (self + .C_EncryptInit + .as_ref() + .expect("Expected function, got error."))(session, mechanism, key) + } + 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, + ) -> CK_RV { + (self + .C_Encrypt + .as_ref() + .expect("Expected function, got error."))( + session, + data, + data_len, + encrypted_data, + encrypted_data_len, + ) + } + 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, + ) -> CK_RV { + (self + .C_EncryptUpdate + .as_ref() + .expect("Expected function, got error."))( + session, + part, + part_len, + encrypted_part, + encrypted_part_len, + ) + } + 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, + ) -> CK_RV { + (self + .C_EncryptFinal + .as_ref() + .expect("Expected function, got error."))( + session, + last_encrypted_part, + last_encrypted_part_len, + ) + } + pub unsafe fn C_DecryptInit( + &self, + session: CK_SESSION_HANDLE, + mechanism: *mut _CK_MECHANISM, + key: CK_OBJECT_HANDLE, + ) -> CK_RV { + (self + .C_DecryptInit + .as_ref() + .expect("Expected function, got error."))(session, mechanism, key) + } + 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, + ) -> CK_RV { + (self + .C_Decrypt + .as_ref() + .expect("Expected function, got error."))( + session, + encrypted_data, + encrypted_data_len, + data, + data_len, + ) + } + 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, + ) -> CK_RV { + (self + .C_DecryptUpdate + .as_ref() + .expect("Expected function, got error."))( + session, + encrypted_part, + encrypted_part_len, + part, + part_len, + ) + } + 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, + ) -> CK_RV { + (self + .C_DecryptFinal + .as_ref() + .expect("Expected function, got error."))(session, last_part, last_part_len) + } + pub unsafe fn C_DigestInit( + &self, + session: CK_SESSION_HANDLE, + mechanism: *mut _CK_MECHANISM, + ) -> CK_RV { + (self + .C_DigestInit + .as_ref() + .expect("Expected function, got error."))(session, mechanism) + } + 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, + ) -> CK_RV { + (self + .C_Digest + .as_ref() + .expect("Expected function, got error."))( + session, data, data_len, digest, digest_len + ) + } + pub unsafe fn C_DigestUpdate( + &self, + session: CK_SESSION_HANDLE, + part: *mut ::std::os::raw::c_uchar, + part_len: ::std::os::raw::c_ulong, + ) -> CK_RV { + (self + .C_DigestUpdate + .as_ref() + .expect("Expected function, got error."))(session, part, part_len) + } + pub unsafe fn C_DigestKey(&self, session: CK_SESSION_HANDLE, key: CK_OBJECT_HANDLE) -> CK_RV { + (self + .C_DigestKey + .as_ref() + .expect("Expected function, got error."))(session, key) + } + 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, + ) -> CK_RV { + (self + .C_DigestFinal + .as_ref() + .expect("Expected function, got error."))(session, digest, digest_len) + } + pub unsafe fn C_SignInit( + &self, + session: CK_SESSION_HANDLE, + mechanism: *mut _CK_MECHANISM, + key: CK_OBJECT_HANDLE, + ) -> CK_RV { + (self + .C_SignInit + .as_ref() + .expect("Expected function, got error."))(session, mechanism, key) + } + 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, + ) -> CK_RV { + (self.C_Sign.as_ref().expect("Expected function, got error."))( + session, + data, + data_len, + signature, + signature_len, + ) + } + pub unsafe fn C_SignUpdate( + &self, + session: CK_SESSION_HANDLE, + part: *mut ::std::os::raw::c_uchar, + part_len: ::std::os::raw::c_ulong, + ) -> CK_RV { + (self + .C_SignUpdate + .as_ref() + .expect("Expected function, got error."))(session, part, part_len) + } + 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, + ) -> CK_RV { + (self + .C_SignFinal + .as_ref() + .expect("Expected function, got error."))(session, signature, signature_len) + } + pub unsafe fn C_SignRecoverInit( + &self, + session: CK_SESSION_HANDLE, + mechanism: *mut _CK_MECHANISM, + key: CK_OBJECT_HANDLE, + ) -> CK_RV { + (self + .C_SignRecoverInit + .as_ref() + .expect("Expected function, got error."))(session, mechanism, key) + } + 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, + ) -> CK_RV { + (self + .C_SignRecover + .as_ref() + .expect("Expected function, got error."))( + session, + data, + data_len, + signature, + signature_len, + ) + } + pub unsafe fn C_VerifyInit( + &self, + session: CK_SESSION_HANDLE, + mechanism: *mut _CK_MECHANISM, + key: CK_OBJECT_HANDLE, + ) -> CK_RV { + (self + .C_VerifyInit + .as_ref() + .expect("Expected function, got error."))(session, mechanism, key) + } + 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, + ) -> CK_RV { + (self + .C_Verify + .as_ref() + .expect("Expected function, got error."))( + session, + data, + data_len, + signature, + signature_len, + ) + } + pub unsafe fn C_VerifyUpdate( + &self, + session: CK_SESSION_HANDLE, + part: *mut ::std::os::raw::c_uchar, + part_len: ::std::os::raw::c_ulong, + ) -> CK_RV { + (self + .C_VerifyUpdate + .as_ref() + .expect("Expected function, got error."))(session, part, part_len) + } + pub unsafe fn C_VerifyFinal( + &self, + session: CK_SESSION_HANDLE, + signature: *mut ::std::os::raw::c_uchar, + signature_len: ::std::os::raw::c_ulong, + ) -> CK_RV { + (self + .C_VerifyFinal + .as_ref() + .expect("Expected function, got error."))(session, signature, signature_len) + } + pub unsafe fn C_VerifyRecoverInit( + &self, + session: CK_SESSION_HANDLE, + mechanism: *mut _CK_MECHANISM, + key: CK_OBJECT_HANDLE, + ) -> CK_RV { + (self + .C_VerifyRecoverInit + .as_ref() + .expect("Expected function, got error."))(session, mechanism, key) + } + 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, + ) -> CK_RV { + (self + .C_VerifyRecover + .as_ref() + .expect("Expected function, got error."))( + session, + signature, + signature_len, + data, + data_len, + ) + } + 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, + ) -> CK_RV { + (self + .C_DigestEncryptUpdate + .as_ref() + .expect("Expected function, got error."))( + session, + part, + part_len, + encrypted_part, + encrypted_part_len, + ) + } + 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, + ) -> CK_RV { + (self + .C_DecryptDigestUpdate + .as_ref() + .expect("Expected function, got error."))( + session, + encrypted_part, + encrypted_part_len, + part, + part_len, + ) + } + 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, + ) -> CK_RV { + (self + .C_SignEncryptUpdate + .as_ref() + .expect("Expected function, got error."))( + session, + part, + part_len, + encrypted_part, + encrypted_part_len, + ) + } + 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, + ) -> CK_RV { + (self + .C_DecryptVerifyUpdate + .as_ref() + .expect("Expected function, got error."))( + session, + encrypted_part, + encrypted_part_len, + part, + part_len, + ) + } + 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, + ) -> CK_RV { + (self + .C_GenerateKey + .as_ref() + .expect("Expected function, got error."))( + session, mechanism, templ, ulCount, key + ) + } + 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, + ) -> 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, + ) + } + 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, + ) -> CK_RV { + (self + .C_WrapKey + .as_ref() + .expect("Expected function, got error."))( + session, + mechanism, + wrapping_key, + key, + wrapped_key, + wrapped_key_len, + ) + } + 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, + ) -> 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, + ) + } + 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, + ) -> CK_RV { + (self + .C_DeriveKey + .as_ref() + .expect("Expected function, got error."))( + session, + mechanism, + base_key, + templ, + attribute_count, + key, + ) + } + pub unsafe fn C_SeedRandom( + &self, + session: CK_SESSION_HANDLE, + seed: *mut ::std::os::raw::c_uchar, + seed_len: ::std::os::raw::c_ulong, + ) -> CK_RV { + (self + .C_SeedRandom + .as_ref() + .expect("Expected function, got error."))(session, seed, seed_len) + } + 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, + ) -> CK_RV { + (self + .C_GenerateRandom + .as_ref() + .expect("Expected function, got error."))(session, random_data, random_len) + } + pub unsafe fn C_GetFunctionStatus(&self, session: CK_SESSION_HANDLE) -> CK_RV { + (self + .C_GetFunctionStatus + .as_ref() + .expect("Expected function, got error."))(session) + } + pub unsafe fn C_CancelFunction(&self, session: CK_SESSION_HANDLE) -> CK_RV { + (self + .C_CancelFunction + .as_ref() + .expect("Expected function, got error."))(session) + } } diff --git a/cryptoki-sys/src/bindings/arm-unknown-linux-gnueabi.rs b/cryptoki-sys/src/bindings/arm-unknown-linux-gnueabi.rs index 74afe82d..df429e9c 100644 --- a/cryptoki-sys/src/bindings/arm-unknown-linux-gnueabi.rs +++ b/cryptoki-sys/src/bindings/arm-unknown-linux-gnueabi.rs @@ -1,5 +1,691 @@ -/* automatically generated by rust-bindgen 0.59.2 */ +/* 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 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 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; +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 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 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_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_EC_EDWARDS: CK_KEY_TYPE = 64; +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 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_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_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_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_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; +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 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_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_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_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_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_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_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_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_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_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_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_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_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_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 CKF_HW: CK_FLAGS = 1; +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_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 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_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_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 = 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_FUNCTION_REJECTED: CK_RV = 512; +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; #[repr(C)] #[derive(Debug, Default, Copy, Clone)] @@ -9,6 +695,8 @@ pub struct _CK_VERSION { } #[test] fn bindgen_test_layout__CK_VERSION() { + const UNINIT: ::std::mem::MaybeUninit<_CK_VERSION> = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<_CK_VERSION>(), 2usize, @@ -20,7 +708,7 @@ fn bindgen_test_layout__CK_VERSION() { concat!("Alignment of ", stringify!(_CK_VERSION)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_VERSION>())).major as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).major) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -30,7 +718,7 @@ fn bindgen_test_layout__CK_VERSION() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_VERSION>())).minor as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).minor) as usize - ptr as usize }, 1usize, concat!( "Offset of field: ", @@ -51,6 +739,8 @@ pub struct _CK_INFO { } #[test] fn bindgen_test_layout__CK_INFO() { + const UNINIT: ::std::mem::MaybeUninit<_CK_INFO> = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<_CK_INFO>(), 76usize, @@ -62,7 +752,7 @@ fn bindgen_test_layout__CK_INFO() { concat!("Alignment of ", stringify!(_CK_INFO)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_INFO>())).cryptokiVersion as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).cryptokiVersion) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -72,7 +762,7 @@ fn bindgen_test_layout__CK_INFO() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_INFO>())).manufacturerID as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).manufacturerID) as usize - ptr as usize }, 2usize, concat!( "Offset of field: ", @@ -82,7 +772,7 @@ fn bindgen_test_layout__CK_INFO() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_INFO>())).flags as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).flags) as usize - ptr as usize }, 36usize, concat!( "Offset of field: ", @@ -92,7 +782,7 @@ fn bindgen_test_layout__CK_INFO() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_INFO>())).libraryDescription as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).libraryDescription) as usize - ptr as usize }, 40usize, concat!( "Offset of field: ", @@ -102,7 +792,7 @@ fn bindgen_test_layout__CK_INFO() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_INFO>())).libraryVersion as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).libraryVersion) as usize - ptr as usize }, 72usize, concat!( "Offset of field: ", @@ -113,6 +803,7 @@ fn bindgen_test_layout__CK_INFO() { ); } 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; #[repr(C)] #[derive(Debug, Copy, Clone)] @@ -125,6 +816,8 @@ pub struct _CK_SLOT_INFO { } #[test] fn bindgen_test_layout__CK_SLOT_INFO() { + const UNINIT: ::std::mem::MaybeUninit<_CK_SLOT_INFO> = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<_CK_SLOT_INFO>(), 104usize, @@ -136,7 +829,7 @@ fn bindgen_test_layout__CK_SLOT_INFO() { concat!("Alignment of ", stringify!(_CK_SLOT_INFO)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_SLOT_INFO>())).slotDescription as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).slotDescription) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -146,7 +839,7 @@ fn bindgen_test_layout__CK_SLOT_INFO() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_SLOT_INFO>())).manufacturerID as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).manufacturerID) as usize - ptr as usize }, 64usize, concat!( "Offset of field: ", @@ -156,7 +849,7 @@ fn bindgen_test_layout__CK_SLOT_INFO() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_SLOT_INFO>())).flags as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).flags) as usize - ptr as usize }, 96usize, concat!( "Offset of field: ", @@ -166,7 +859,7 @@ fn bindgen_test_layout__CK_SLOT_INFO() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_SLOT_INFO>())).hardwareVersion as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).hardwareVersion) as usize - ptr as usize }, 100usize, concat!( "Offset of field: ", @@ -176,7 +869,7 @@ fn bindgen_test_layout__CK_SLOT_INFO() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_SLOT_INFO>())).firmwareVersion as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).firmwareVersion) as usize - ptr as usize }, 102usize, concat!( "Offset of field: ", @@ -195,6 +888,10 @@ 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; #[repr(C)] #[derive(Debug, Default, Copy, Clone)] pub struct _CK_TOKEN_INFO { @@ -219,6 +916,8 @@ pub struct _CK_TOKEN_INFO { } #[test] fn bindgen_test_layout__CK_TOKEN_INFO() { + const UNINIT: ::std::mem::MaybeUninit<_CK_TOKEN_INFO> = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<_CK_TOKEN_INFO>(), 160usize, @@ -230,7 +929,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { concat!("Alignment of ", stringify!(_CK_TOKEN_INFO)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_TOKEN_INFO>())).label as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).label) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -240,7 +939,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_TOKEN_INFO>())).manufacturerID as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).manufacturerID) as usize - ptr as usize }, 32usize, concat!( "Offset of field: ", @@ -250,7 +949,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_TOKEN_INFO>())).model as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).model) as usize - ptr as usize }, 64usize, concat!( "Offset of field: ", @@ -260,7 +959,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_TOKEN_INFO>())).serialNumber as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).serialNumber) as usize - ptr as usize }, 80usize, concat!( "Offset of field: ", @@ -270,7 +969,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_TOKEN_INFO>())).flags as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).flags) as usize - ptr as usize }, 96usize, concat!( "Offset of field: ", @@ -280,9 +979,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_TOKEN_INFO>())).ulMaxSessionCount as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).ulMaxSessionCount) as usize - ptr as usize }, 100usize, concat!( "Offset of field: ", @@ -292,7 +989,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_TOKEN_INFO>())).ulSessionCount as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ulSessionCount) as usize - ptr as usize }, 104usize, concat!( "Offset of field: ", @@ -302,9 +999,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_TOKEN_INFO>())).ulMaxRwSessionCount as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).ulMaxRwSessionCount) as usize - ptr as usize }, 108usize, concat!( "Offset of field: ", @@ -314,7 +1009,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_TOKEN_INFO>())).ulRwSessionCount as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ulRwSessionCount) as usize - ptr as usize }, 112usize, concat!( "Offset of field: ", @@ -324,7 +1019,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_TOKEN_INFO>())).ulMaxPinLen as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ulMaxPinLen) as usize - ptr as usize }, 116usize, concat!( "Offset of field: ", @@ -334,7 +1029,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_TOKEN_INFO>())).ulMinPinLen as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ulMinPinLen) as usize - ptr as usize }, 120usize, concat!( "Offset of field: ", @@ -344,9 +1039,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_TOKEN_INFO>())).ulTotalPublicMemory as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).ulTotalPublicMemory) as usize - ptr as usize }, 124usize, concat!( "Offset of field: ", @@ -356,9 +1049,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_TOKEN_INFO>())).ulFreePublicMemory as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).ulFreePublicMemory) as usize - ptr as usize }, 128usize, concat!( "Offset of field: ", @@ -368,9 +1059,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_TOKEN_INFO>())).ulTotalPrivateMemory as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).ulTotalPrivateMemory) as usize - ptr as usize }, 132usize, concat!( "Offset of field: ", @@ -380,9 +1069,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_TOKEN_INFO>())).ulFreePrivateMemory as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).ulFreePrivateMemory) as usize - ptr as usize }, 136usize, concat!( "Offset of field: ", @@ -392,7 +1079,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_TOKEN_INFO>())).hardwareVersion as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).hardwareVersion) as usize - ptr as usize }, 140usize, concat!( "Offset of field: ", @@ -402,7 +1089,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_TOKEN_INFO>())).firmwareVersion as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).firmwareVersion) as usize - ptr as usize }, 142usize, concat!( "Offset of field: ", @@ -412,7 +1099,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_TOKEN_INFO>())).utcTime as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).utcTime) as usize - ptr as usize }, 144usize, concat!( "Offset of field: ", @@ -435,6 +1122,8 @@ pub struct _CK_SESSION_INFO { } #[test] fn bindgen_test_layout__CK_SESSION_INFO() { + const UNINIT: ::std::mem::MaybeUninit<_CK_SESSION_INFO> = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<_CK_SESSION_INFO>(), 16usize, @@ -446,7 +1135,7 @@ fn bindgen_test_layout__CK_SESSION_INFO() { concat!("Alignment of ", stringify!(_CK_SESSION_INFO)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_SESSION_INFO>())).slotID as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).slotID) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -456,7 +1145,7 @@ fn bindgen_test_layout__CK_SESSION_INFO() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_SESSION_INFO>())).state as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).state) as usize - ptr as usize }, 4usize, concat!( "Offset of field: ", @@ -466,7 +1155,7 @@ fn bindgen_test_layout__CK_SESSION_INFO() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_SESSION_INFO>())).flags as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).flags) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -476,7 +1165,7 @@ fn bindgen_test_layout__CK_SESSION_INFO() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_SESSION_INFO>())).ulDeviceError as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ulDeviceError) as usize - ptr as usize }, 12usize, concat!( "Offset of field: ", @@ -501,6 +1190,8 @@ pub struct _CK_ATTRIBUTE { } #[test] fn bindgen_test_layout__CK_ATTRIBUTE() { + const UNINIT: ::std::mem::MaybeUninit<_CK_ATTRIBUTE> = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<_CK_ATTRIBUTE>(), 12usize, @@ -512,7 +1203,7 @@ fn bindgen_test_layout__CK_ATTRIBUTE() { concat!("Alignment of ", stringify!(_CK_ATTRIBUTE)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_ATTRIBUTE>())).type_ as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).type_) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -522,7 +1213,7 @@ fn bindgen_test_layout__CK_ATTRIBUTE() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_ATTRIBUTE>())).pValue as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).pValue) as usize - ptr as usize }, 4usize, concat!( "Offset of field: ", @@ -532,7 +1223,7 @@ fn bindgen_test_layout__CK_ATTRIBUTE() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_ATTRIBUTE>())).ulValueLen as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ulValueLen) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -560,6 +1251,8 @@ pub struct _CK_DATE { } #[test] fn bindgen_test_layout__CK_DATE() { + const UNINIT: ::std::mem::MaybeUninit<_CK_DATE> = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<_CK_DATE>(), 8usize, @@ -571,7 +1264,7 @@ fn bindgen_test_layout__CK_DATE() { concat!("Alignment of ", stringify!(_CK_DATE)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_DATE>())).year as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).year) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -581,7 +1274,7 @@ fn bindgen_test_layout__CK_DATE() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_DATE>())).month as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).month) as usize - ptr as usize }, 4usize, concat!( "Offset of field: ", @@ -591,7 +1284,7 @@ fn bindgen_test_layout__CK_DATE() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_DATE>())).day as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).day) as usize - ptr as usize }, 6usize, concat!( "Offset of field: ", @@ -611,6 +1304,8 @@ pub struct _CK_MECHANISM { } #[test] fn bindgen_test_layout__CK_MECHANISM() { + const UNINIT: ::std::mem::MaybeUninit<_CK_MECHANISM> = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<_CK_MECHANISM>(), 12usize, @@ -622,7 +1317,7 @@ fn bindgen_test_layout__CK_MECHANISM() { concat!("Alignment of ", stringify!(_CK_MECHANISM)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_MECHANISM>())).mechanism as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).mechanism) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -632,7 +1327,7 @@ fn bindgen_test_layout__CK_MECHANISM() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_MECHANISM>())).pParameter as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).pParameter) as usize - ptr as usize }, 4usize, concat!( "Offset of field: ", @@ -642,7 +1337,7 @@ fn bindgen_test_layout__CK_MECHANISM() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_MECHANISM>())).ulParameterLen as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ulParameterLen) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -670,6 +1365,8 @@ pub struct _CK_MECHANISM_INFO { } #[test] fn bindgen_test_layout__CK_MECHANISM_INFO() { + const UNINIT: ::std::mem::MaybeUninit<_CK_MECHANISM_INFO> = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<_CK_MECHANISM_INFO>(), 12usize, @@ -681,7 +1378,7 @@ fn bindgen_test_layout__CK_MECHANISM_INFO() { concat!("Alignment of ", stringify!(_CK_MECHANISM_INFO)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_MECHANISM_INFO>())).ulMinKeySize as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ulMinKeySize) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -691,7 +1388,7 @@ fn bindgen_test_layout__CK_MECHANISM_INFO() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_MECHANISM_INFO>())).ulMaxKeySize as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ulMaxKeySize) as usize - ptr as usize }, 4usize, concat!( "Offset of field: ", @@ -701,7 +1398,7 @@ fn bindgen_test_layout__CK_MECHANISM_INFO() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_MECHANISM_INFO>())).flags as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).flags) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -721,6 +1418,8 @@ pub struct CK_OTP_PARAM { } #[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, @@ -732,7 +1431,7 @@ fn bindgen_test_layout_CK_OTP_PARAM() { concat!("Alignment of ", stringify!(CK_OTP_PARAM)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).type_ as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).type_) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -742,7 +1441,7 @@ fn bindgen_test_layout_CK_OTP_PARAM() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).pValue as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).pValue) as usize - ptr as usize }, 4usize, concat!( "Offset of field: ", @@ -752,7 +1451,7 @@ fn bindgen_test_layout_CK_OTP_PARAM() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).ulValueLen as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ulValueLen) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -779,6 +1478,8 @@ pub struct CK_OTP_PARAMS { } #[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, @@ -790,7 +1491,7 @@ fn bindgen_test_layout_CK_OTP_PARAMS() { concat!("Alignment of ", stringify!(CK_OTP_PARAMS)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).pParams as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).pParams) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -800,7 +1501,7 @@ fn bindgen_test_layout_CK_OTP_PARAMS() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).ulCount as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ulCount) as usize - ptr as usize }, 4usize, concat!( "Offset of field: ", @@ -827,6 +1528,9 @@ pub struct CK_OTP_SIGNATURE_INFO { } #[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, @@ -838,7 +1542,7 @@ fn bindgen_test_layout_CK_OTP_SIGNATURE_INFO() { concat!("Alignment of ", stringify!(CK_OTP_SIGNATURE_INFO)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).pParams as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).pParams) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -848,7 +1552,7 @@ fn bindgen_test_layout_CK_OTP_SIGNATURE_INFO() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).ulCount as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ulCount) as usize - ptr as usize }, 4usize, concat!( "Offset of field: ", @@ -877,6 +1581,9 @@ pub struct ck_rsa_pkcs_pss_params { } #[test] fn bindgen_test_layout_ck_rsa_pkcs_pss_params() { + const UNINIT: ::std::mem::MaybeUninit = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), 12usize, @@ -888,7 +1595,7 @@ fn bindgen_test_layout_ck_rsa_pkcs_pss_params() { concat!("Alignment of ", stringify!(ck_rsa_pkcs_pss_params)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).hashAlg as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).hashAlg) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -898,7 +1605,7 @@ fn bindgen_test_layout_ck_rsa_pkcs_pss_params() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).mgf as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).mgf) as usize - ptr as usize }, 4usize, concat!( "Offset of field: ", @@ -908,7 +1615,7 @@ fn bindgen_test_layout_ck_rsa_pkcs_pss_params() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).sLen as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).sLen) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -930,6 +1637,9 @@ pub struct ck_rsa_pkcs_oaep_params { } #[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, @@ -941,7 +1651,7 @@ fn bindgen_test_layout_ck_rsa_pkcs_oaep_params() { concat!("Alignment of ", stringify!(ck_rsa_pkcs_oaep_params)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).hashAlg as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).hashAlg) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -951,7 +1661,7 @@ fn bindgen_test_layout_ck_rsa_pkcs_oaep_params() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).mgf as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).mgf) as usize - ptr as usize }, 4usize, concat!( "Offset of field: ", @@ -961,7 +1671,7 @@ fn bindgen_test_layout_ck_rsa_pkcs_oaep_params() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).source as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).source) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -971,9 +1681,7 @@ fn bindgen_test_layout_ck_rsa_pkcs_oaep_params() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).pSourceData as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).pSourceData) as usize - ptr as usize }, 12usize, concat!( "Offset of field: ", @@ -983,9 +1691,7 @@ fn bindgen_test_layout_ck_rsa_pkcs_oaep_params() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).ulSourceDataLen as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).ulSourceDataLen) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", @@ -1012,6 +1718,8 @@ pub struct ck_aes_ctr_params { } #[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, @@ -1023,7 +1731,7 @@ fn bindgen_test_layout_ck_aes_ctr_params() { concat!("Alignment of ", stringify!(ck_aes_ctr_params)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).ulCounterBits as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ulCounterBits) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -1033,7 +1741,7 @@ fn bindgen_test_layout_ck_aes_ctr_params() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).cb as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).cb) as usize - ptr as usize }, 4usize, concat!( "Offset of field: ", @@ -1055,6 +1763,8 @@ pub struct ck_gcm_params { } #[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, @@ -1066,7 +1776,7 @@ fn bindgen_test_layout_ck_gcm_params() { concat!("Alignment of ", stringify!(ck_gcm_params)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).pIv as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).pIv) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -1076,7 +1786,7 @@ fn bindgen_test_layout_ck_gcm_params() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).ulIvLen as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ulIvLen) as usize - ptr as usize }, 4usize, concat!( "Offset of field: ", @@ -1086,7 +1796,7 @@ fn bindgen_test_layout_ck_gcm_params() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).ulIvBits as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ulIvBits) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -1096,7 +1806,7 @@ fn bindgen_test_layout_ck_gcm_params() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).pAAD as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).pAAD) as usize - ptr as usize }, 12usize, concat!( "Offset of field: ", @@ -1106,7 +1816,7 @@ fn bindgen_test_layout_ck_gcm_params() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).ulAADLen as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ulAADLen) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", @@ -1116,7 +1826,7 @@ fn bindgen_test_layout_ck_gcm_params() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).ulTagBits as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ulTagBits) as usize - ptr as usize }, 20usize, concat!( "Offset of field: ", @@ -1147,6 +1857,9 @@ pub struct ck_ecdh1_derive_params { } #[test] fn bindgen_test_layout_ck_ecdh1_derive_params() { + const UNINIT: ::std::mem::MaybeUninit = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), 20usize, @@ -1158,7 +1871,7 @@ fn bindgen_test_layout_ck_ecdh1_derive_params() { concat!("Alignment of ", stringify!(ck_ecdh1_derive_params)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).kdf as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).kdf) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -1168,9 +1881,7 @@ fn bindgen_test_layout_ck_ecdh1_derive_params() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).ulSharedDataLen as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).ulSharedDataLen) as usize - ptr as usize }, 4usize, concat!( "Offset of field: ", @@ -1180,9 +1891,7 @@ fn bindgen_test_layout_ck_ecdh1_derive_params() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).pSharedData as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).pSharedData) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -1192,9 +1901,7 @@ fn bindgen_test_layout_ck_ecdh1_derive_params() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).ulPublicDataLen as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).ulPublicDataLen) as usize - ptr as usize }, 12usize, concat!( "Offset of field: ", @@ -1204,9 +1911,7 @@ fn bindgen_test_layout_ck_ecdh1_derive_params() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).pPublicData as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).pPublicData) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", @@ -1233,6 +1938,9 @@ pub struct ck_key_derivation_string_data { } #[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, @@ -1244,9 +1952,7 @@ fn bindgen_test_layout_ck_key_derivation_string_data() { concat!("Alignment of ", stringify!(ck_key_derivation_string_data)) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).pData as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).pData) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -1256,9 +1962,7 @@ fn bindgen_test_layout_ck_key_derivation_string_data() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).ulLen as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).ulLen) as usize - ptr as usize }, 4usize, concat!( "Offset of field: ", @@ -1286,6 +1990,9 @@ pub struct ck_des_cbc_encrypt_data_params { } #[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, @@ -1297,9 +2004,7 @@ fn bindgen_test_layout_ck_des_cbc_encrypt_data_params() { concat!("Alignment of ", stringify!(ck_des_cbc_encrypt_data_params)) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).iv as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).iv) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -1309,9 +2014,7 @@ fn bindgen_test_layout_ck_des_cbc_encrypt_data_params() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).pData as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).pData) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -1321,9 +2024,7 @@ fn bindgen_test_layout_ck_des_cbc_encrypt_data_params() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).length as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).length) as usize - ptr as usize }, 12usize, concat!( "Offset of field: ", @@ -1351,6 +2052,9 @@ pub struct ck_aes_cbc_encrypt_data_params { } #[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, @@ -1362,9 +2066,7 @@ fn bindgen_test_layout_ck_aes_cbc_encrypt_data_params() { concat!("Alignment of ", stringify!(ck_aes_cbc_encrypt_data_params)) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).iv as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).iv) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -1374,9 +2076,7 @@ fn bindgen_test_layout_ck_aes_cbc_encrypt_data_params() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).pData as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).pData) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", @@ -1386,9 +2086,7 @@ fn bindgen_test_layout_ck_aes_cbc_encrypt_data_params() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).length as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).length) as usize - ptr as usize }, 20usize, concat!( "Offset of field: ", @@ -1950,6 +2648,8 @@ pub struct _CK_FUNCTION_LIST { } #[test] fn bindgen_test_layout__CK_FUNCTION_LIST() { + const UNINIT: ::std::mem::MaybeUninit<_CK_FUNCTION_LIST> = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<_CK_FUNCTION_LIST>(), 276usize, @@ -1961,7 +2661,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { concat!("Alignment of ", stringify!(_CK_FUNCTION_LIST)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).version as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).version) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -1971,7 +2671,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_Initialize as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_Initialize) as usize - ptr as usize }, 4usize, concat!( "Offset of field: ", @@ -1981,7 +2681,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_Finalize as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_Finalize) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -1991,7 +2691,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_GetInfo as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_GetInfo) as usize - ptr as usize }, 12usize, concat!( "Offset of field: ", @@ -2001,9 +2701,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_GetFunctionList as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_GetFunctionList) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", @@ -2013,7 +2711,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_GetSlotList as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_GetSlotList) as usize - ptr as usize }, 20usize, concat!( "Offset of field: ", @@ -2023,7 +2721,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_GetSlotInfo as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_GetSlotInfo) as usize - ptr as usize }, 24usize, concat!( "Offset of field: ", @@ -2033,9 +2731,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_GetTokenInfo as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_GetTokenInfo) as usize - ptr as usize }, 28usize, concat!( "Offset of field: ", @@ -2045,9 +2741,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_GetMechanismList as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_GetMechanismList) as usize - ptr as usize }, 32usize, concat!( "Offset of field: ", @@ -2057,9 +2751,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_GetMechanismInfo as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_GetMechanismInfo) as usize - ptr as usize }, 36usize, concat!( "Offset of field: ", @@ -2069,7 +2761,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_InitToken as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_InitToken) as usize - ptr as usize }, 40usize, concat!( "Offset of field: ", @@ -2079,7 +2771,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_InitPIN as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_InitPIN) as usize - ptr as usize }, 44usize, concat!( "Offset of field: ", @@ -2089,7 +2781,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_SetPIN as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_SetPIN) as usize - ptr as usize }, 48usize, concat!( "Offset of field: ", @@ -2099,7 +2791,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_OpenSession as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_OpenSession) as usize - ptr as usize }, 52usize, concat!( "Offset of field: ", @@ -2109,9 +2801,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_CloseSession as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_CloseSession) as usize - ptr as usize }, 56usize, concat!( "Offset of field: ", @@ -2121,9 +2811,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_CloseAllSessions as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_CloseAllSessions) as usize - ptr as usize }, 60usize, concat!( "Offset of field: ", @@ -2133,9 +2821,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_GetSessionInfo as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_GetSessionInfo) as usize - ptr as usize }, 64usize, concat!( "Offset of field: ", @@ -2145,9 +2831,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_GetOperationState as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_GetOperationState) as usize - ptr as usize }, 68usize, concat!( "Offset of field: ", @@ -2157,9 +2841,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_SetOperationState as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_SetOperationState) as usize - ptr as usize }, 72usize, concat!( "Offset of field: ", @@ -2169,7 +2851,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_Login as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_Login) as usize - ptr as usize }, 76usize, concat!( "Offset of field: ", @@ -2179,7 +2861,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_Logout as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_Logout) as usize - ptr as usize }, 80usize, concat!( "Offset of field: ", @@ -2189,9 +2871,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_CreateObject as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_CreateObject) as usize - ptr as usize }, 84usize, concat!( "Offset of field: ", @@ -2201,7 +2881,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_CopyObject as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_CopyObject) as usize - ptr as usize }, 88usize, concat!( "Offset of field: ", @@ -2211,9 +2891,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_DestroyObject as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_DestroyObject) as usize - ptr as usize }, 92usize, concat!( "Offset of field: ", @@ -2223,9 +2901,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_GetObjectSize as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_GetObjectSize) as usize - ptr as usize }, 96usize, concat!( "Offset of field: ", @@ -2235,9 +2911,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_GetAttributeValue as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_GetAttributeValue) as usize - ptr as usize }, 100usize, concat!( "Offset of field: ", @@ -2247,9 +2921,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_SetAttributeValue as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_SetAttributeValue) as usize - ptr as usize }, 104usize, concat!( "Offset of field: ", @@ -2259,9 +2931,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_FindObjectsInit as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_FindObjectsInit) as usize - ptr as usize }, 108usize, concat!( "Offset of field: ", @@ -2271,7 +2941,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_FindObjects as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_FindObjects) as usize - ptr as usize }, 112usize, concat!( "Offset of field: ", @@ -2281,9 +2951,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_FindObjectsFinal as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_FindObjectsFinal) as usize - ptr as usize }, 116usize, concat!( "Offset of field: ", @@ -2293,7 +2961,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_EncryptInit as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_EncryptInit) as usize - ptr as usize }, 120usize, concat!( "Offset of field: ", @@ -2303,7 +2971,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_Encrypt as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_Encrypt) as usize - ptr as usize }, 124usize, concat!( "Offset of field: ", @@ -2313,9 +2981,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_EncryptUpdate as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_EncryptUpdate) as usize - ptr as usize }, 128usize, concat!( "Offset of field: ", @@ -2325,9 +2991,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_EncryptFinal as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_EncryptFinal) as usize - ptr as usize }, 132usize, concat!( "Offset of field: ", @@ -2337,7 +3001,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_DecryptInit as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_DecryptInit) as usize - ptr as usize }, 136usize, concat!( "Offset of field: ", @@ -2347,7 +3011,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_Decrypt as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_Decrypt) as usize - ptr as usize }, 140usize, concat!( "Offset of field: ", @@ -2357,9 +3021,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_DecryptUpdate as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_DecryptUpdate) as usize - ptr as usize }, 144usize, concat!( "Offset of field: ", @@ -2369,9 +3031,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_DecryptFinal as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_DecryptFinal) as usize - ptr as usize }, 148usize, concat!( "Offset of field: ", @@ -2381,7 +3041,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_DigestInit as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_DigestInit) as usize - ptr as usize }, 152usize, concat!( "Offset of field: ", @@ -2391,7 +3051,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_Digest as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_Digest) as usize - ptr as usize }, 156usize, concat!( "Offset of field: ", @@ -2401,9 +3061,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_DigestUpdate as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_DigestUpdate) as usize - ptr as usize }, 160usize, concat!( "Offset of field: ", @@ -2413,7 +3071,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_DigestKey as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_DigestKey) as usize - ptr as usize }, 164usize, concat!( "Offset of field: ", @@ -2423,7 +3081,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_DigestFinal as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_DigestFinal) as usize - ptr as usize }, 168usize, concat!( "Offset of field: ", @@ -2433,7 +3091,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_SignInit as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_SignInit) as usize - ptr as usize }, 172usize, concat!( "Offset of field: ", @@ -2443,7 +3101,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_Sign as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_Sign) as usize - ptr as usize }, 176usize, concat!( "Offset of field: ", @@ -2453,7 +3111,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_SignUpdate as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_SignUpdate) as usize - ptr as usize }, 180usize, concat!( "Offset of field: ", @@ -2463,7 +3121,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_SignFinal as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_SignFinal) as usize - ptr as usize }, 184usize, concat!( "Offset of field: ", @@ -2473,9 +3131,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_SignRecoverInit as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_SignRecoverInit) as usize - ptr as usize }, 188usize, concat!( "Offset of field: ", @@ -2485,7 +3141,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_SignRecover as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_SignRecover) as usize - ptr as usize }, 192usize, concat!( "Offset of field: ", @@ -2495,7 +3151,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_VerifyInit as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_VerifyInit) as usize - ptr as usize }, 196usize, concat!( "Offset of field: ", @@ -2505,7 +3161,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_Verify as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_Verify) as usize - ptr as usize }, 200usize, concat!( "Offset of field: ", @@ -2515,9 +3171,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_VerifyUpdate as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_VerifyUpdate) as usize - ptr as usize }, 204usize, concat!( "Offset of field: ", @@ -2527,7 +3181,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_VerifyFinal as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_VerifyFinal) as usize - ptr as usize }, 208usize, concat!( "Offset of field: ", @@ -2537,9 +3191,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_VerifyRecoverInit as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_VerifyRecoverInit) as usize - ptr as usize }, 212usize, concat!( "Offset of field: ", @@ -2549,9 +3201,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_VerifyRecover as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_VerifyRecover) as usize - ptr as usize }, 216usize, concat!( "Offset of field: ", @@ -2561,9 +3211,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_DigestEncryptUpdate as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_DigestEncryptUpdate) as usize - ptr as usize }, 220usize, concat!( "Offset of field: ", @@ -2573,9 +3221,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_DecryptDigestUpdate as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_DecryptDigestUpdate) as usize - ptr as usize }, 224usize, concat!( "Offset of field: ", @@ -2585,9 +3231,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_SignEncryptUpdate as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_SignEncryptUpdate) as usize - ptr as usize }, 228usize, concat!( "Offset of field: ", @@ -2597,9 +3241,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_DecryptVerifyUpdate as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_DecryptVerifyUpdate) as usize - ptr as usize }, 232usize, concat!( "Offset of field: ", @@ -2609,7 +3251,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_GenerateKey as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_GenerateKey) as usize - ptr as usize }, 236usize, concat!( "Offset of field: ", @@ -2619,9 +3261,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_GenerateKeyPair as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_GenerateKeyPair) as usize - ptr as usize }, 240usize, concat!( "Offset of field: ", @@ -2631,7 +3271,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_WrapKey as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_WrapKey) as usize - ptr as usize }, 244usize, concat!( "Offset of field: ", @@ -2641,7 +3281,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_UnwrapKey as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_UnwrapKey) as usize - ptr as usize }, 248usize, concat!( "Offset of field: ", @@ -2651,7 +3291,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_DeriveKey as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_DeriveKey) as usize - ptr as usize }, 252usize, concat!( "Offset of field: ", @@ -2661,7 +3301,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_SeedRandom as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_SeedRandom) as usize - ptr as usize }, 256usize, concat!( "Offset of field: ", @@ -2671,9 +3311,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_GenerateRandom as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_GenerateRandom) as usize - ptr as usize }, 260usize, concat!( "Offset of field: ", @@ -2683,9 +3321,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_GetFunctionStatus as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_GetFunctionStatus) as usize - ptr as usize }, 264usize, concat!( "Offset of field: ", @@ -2695,9 +3331,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_CancelFunction as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_CancelFunction) as usize - ptr as usize }, 268usize, concat!( "Offset of field: ", @@ -2707,9 +3341,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_WaitForSlotEvent as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_WaitForSlotEvent) as usize - ptr as usize }, 272usize, concat!( "Offset of field: ", @@ -2739,6 +3371,9 @@ pub struct _CK_C_INITIALIZE_ARGS { } #[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, @@ -2750,9 +3385,7 @@ fn bindgen_test_layout__CK_C_INITIALIZE_ARGS() { concat!("Alignment of ", stringify!(_CK_C_INITIALIZE_ARGS)) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_C_INITIALIZE_ARGS>())).CreateMutex as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).CreateMutex) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -2762,9 +3395,7 @@ fn bindgen_test_layout__CK_C_INITIALIZE_ARGS() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_C_INITIALIZE_ARGS>())).DestroyMutex as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).DestroyMutex) as usize - ptr as usize }, 4usize, concat!( "Offset of field: ", @@ -2774,7 +3405,7 @@ fn bindgen_test_layout__CK_C_INITIALIZE_ARGS() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_C_INITIALIZE_ARGS>())).LockMutex as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).LockMutex) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -2784,9 +3415,7 @@ fn bindgen_test_layout__CK_C_INITIALIZE_ARGS() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_C_INITIALIZE_ARGS>())).UnlockMutex as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).UnlockMutex) as usize - ptr as usize }, 12usize, concat!( "Offset of field: ", @@ -2796,7 +3425,7 @@ fn bindgen_test_layout__CK_C_INITIALIZE_ARGS() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_C_INITIALIZE_ARGS>())).flags as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).flags) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", @@ -2806,7 +3435,7 @@ fn bindgen_test_layout__CK_C_INITIALIZE_ARGS() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_C_INITIALIZE_ARGS>())).pReserved as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).pReserved) as usize - ptr as usize }, 20usize, concat!( "Offset of field: ", @@ -2825,8 +3454,6 @@ impl Default for _CK_C_INITIALIZE_ARGS { } } } -pub type size_t = ::std::os::raw::c_uint; -pub type wchar_t = ::std::os::raw::c_uint; 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; @@ -2893,10 +3520,529 @@ pub type CK_AES_CBC_ENCRYPT_DATA_PARAMS_PTR = *mut ck_aes_cbc_encrypt_data_param 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_GetFunctionList: Result< unsafe extern "C" fn(function_list: *mut *mut _CK_FUNCTION_LIST) -> 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, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_GetSlotInfo: Result< + unsafe extern "C" fn(slotID: CK_SLOT_ID, info: *mut _CK_SLOT_INFO) -> 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, + ::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, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_GetMechanismInfo: Result< + unsafe extern "C" fn( + slotID: CK_SLOT_ID, + type_: CK_MECHANISM_TYPE, + info: *mut _CK_MECHANISM_INFO, + ) -> 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, + ) -> 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, + ) -> 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, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_OpenSession: Result< + 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, + ::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(session: CK_SESSION_HANDLE, info: *mut _CK_SESSION_INFO) -> 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, + ) -> 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, + ) -> 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, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_Logout: + 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, + ) -> 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, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_DestroyObject: Result< + unsafe extern "C" fn(session: CK_SESSION_HANDLE, object: 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, + ) -> 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, + ) -> 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, + ) -> 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, + ) -> 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, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_FindObjectsFinal: + 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, + ) -> 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, + ) -> 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, + ) -> 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, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_DecryptInit: Result< + unsafe extern "C" fn( + session: CK_SESSION_HANDLE, + mechanism: *mut _CK_MECHANISM, + key: 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, + ) -> 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, + ) -> 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, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_DigestInit: Result< + unsafe extern "C" fn(session: CK_SESSION_HANDLE, mechanism: *mut _CK_MECHANISM) -> 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, + ) -> 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, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_DigestKey: Result< + unsafe extern "C" fn(session: CK_SESSION_HANDLE, key: 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, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_SignInit: Result< + unsafe extern "C" fn( + session: CK_SESSION_HANDLE, + mechanism: *mut _CK_MECHANISM, + key: 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, + ) -> 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, + ) -> 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, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_SignRecoverInit: Result< + unsafe extern "C" fn( + session: CK_SESSION_HANDLE, + mechanism: *mut _CK_MECHANISM, + key: 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, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_VerifyInit: Result< + unsafe extern "C" fn( + session: CK_SESSION_HANDLE, + mechanism: *mut _CK_MECHANISM, + key: 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, + ) -> 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, + ) -> 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, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_VerifyRecoverInit: Result< + unsafe extern "C" fn( + session: CK_SESSION_HANDLE, + mechanism: *mut _CK_MECHANISM, + key: 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, + ) -> 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, + ) -> 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, + ) -> 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, + ) -> 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, + ) -> 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, + ) -> 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, + ) -> 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, + ) -> 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, + ) -> 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, + ) -> 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, + ) -> 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, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_GetFunctionStatus: + Result CK_RV, ::libloading::Error>, + pub C_CancelFunction: + Result CK_RV, ::libloading::Error>, } impl Pkcs11 { pub unsafe fn new

(path: P) -> Result @@ -2911,16 +4057,1010 @@ impl Pkcs11 { 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_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); + 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); Ok(Pkcs11 { __library, + C_Initialize, + C_Finalize, + C_GetInfo, C_GetFunctionList, + C_GetSlotList, + C_GetSlotInfo, + C_GetTokenInfo, + C_WaitForSlotEvent, + 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, }) } + pub unsafe fn C_Initialize(&self, init_args: *mut ::std::os::raw::c_void) -> CK_RV { + (self + .C_Initialize + .as_ref() + .expect("Expected function, got error."))(init_args) + } + pub unsafe fn C_Finalize(&self, pReserved: *mut ::std::os::raw::c_void) -> 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 { + (self + .C_GetInfo + .as_ref() + .expect("Expected function, got error."))(info) + } pub unsafe fn C_GetFunctionList(&self, function_list: *mut *mut _CK_FUNCTION_LIST) -> CK_RV { (self .C_GetFunctionList .as_ref() .expect("Expected function, got error."))(function_list) } + 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, + ) -> CK_RV { + (self + .C_GetSlotList + .as_ref() + .expect("Expected function, got error."))(token_present, slot_list, ulCount) + } + pub unsafe fn C_GetSlotInfo(&self, slotID: CK_SLOT_ID, info: *mut _CK_SLOT_INFO) -> CK_RV { + (self + .C_GetSlotInfo + .as_ref() + .expect("Expected function, got error."))(slotID, info) + } + pub unsafe fn C_GetTokenInfo(&self, slotID: CK_SLOT_ID, info: *mut _CK_TOKEN_INFO) -> 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) + } + pub unsafe fn C_GetMechanismList( + &self, + slotID: CK_SLOT_ID, + mechanism_list: *mut CK_MECHANISM_TYPE, + ulCount: *mut ::std::os::raw::c_ulong, + ) -> CK_RV { + (self + .C_GetMechanismList + .as_ref() + .expect("Expected function, got error."))(slotID, mechanism_list, ulCount) + } + pub unsafe fn C_GetMechanismInfo( + &self, + slotID: CK_SLOT_ID, + type_: CK_MECHANISM_TYPE, + info: *mut _CK_MECHANISM_INFO, + ) -> CK_RV { + (self + .C_GetMechanismInfo + .as_ref() + .expect("Expected function, got error."))(slotID, type_, info) + } + 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, + ) -> CK_RV { + (self + .C_InitToken + .as_ref() + .expect("Expected function, got error."))(slotID, pin, pin_len, label) + } + pub unsafe fn C_InitPIN( + &self, + session: CK_SESSION_HANDLE, + pin: *mut ::std::os::raw::c_uchar, + pin_len: ::std::os::raw::c_ulong, + ) -> CK_RV { + (self + .C_InitPIN + .as_ref() + .expect("Expected function, got error."))(session, pin, pin_len) + } + 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, + ) -> CK_RV { + (self + .C_SetPIN + .as_ref() + .expect("Expected function, got error."))( + session, old_pin, old_len, new_pin, new_len + ) + } + 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, + ) -> CK_RV { + (self + .C_OpenSession + .as_ref() + .expect("Expected function, got error."))( + slotID, flags, application, notify, session + ) + } + pub unsafe fn C_CloseSession(&self, session: CK_SESSION_HANDLE) -> CK_RV { + (self + .C_CloseSession + .as_ref() + .expect("Expected function, got error."))(session) + } + 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, + session: CK_SESSION_HANDLE, + info: *mut _CK_SESSION_INFO, + ) -> CK_RV { + (self + .C_GetSessionInfo + .as_ref() + .expect("Expected function, got error."))(session, info) + } + 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, + ) -> CK_RV { + (self + .C_GetOperationState + .as_ref() + .expect("Expected function, got error."))( + session, operation_state, operation_state_len + ) + } + 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, + ) -> CK_RV { + (self + .C_SetOperationState + .as_ref() + .expect("Expected function, got error."))( + session, + operation_state, + operation_state_len, + encryption_key, + authentiation_key, + ) + } + 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, + ) -> CK_RV { + (self + .C_Login + .as_ref() + .expect("Expected function, got error."))(session, user_type, pin, pin_len) + } + pub unsafe fn C_Logout(&self, session: CK_SESSION_HANDLE) -> CK_RV { + (self + .C_Logout + .as_ref() + .expect("Expected function, got error."))(session) + } + 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, + ) -> CK_RV { + (self + .C_CreateObject + .as_ref() + .expect("Expected function, got error."))(session, templ, ulCount, object) + } + 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, + ) -> CK_RV { + (self + .C_CopyObject + .as_ref() + .expect("Expected function, got error."))( + session, object, templ, ulCount, new_object + ) + } + pub unsafe fn C_DestroyObject( + &self, + session: CK_SESSION_HANDLE, + object: CK_OBJECT_HANDLE, + ) -> CK_RV { + (self + .C_DestroyObject + .as_ref() + .expect("Expected function, got error."))(session, object) + } + pub unsafe fn C_GetObjectSize( + &self, + session: CK_SESSION_HANDLE, + object: CK_OBJECT_HANDLE, + size: *mut ::std::os::raw::c_ulong, + ) -> CK_RV { + (self + .C_GetObjectSize + .as_ref() + .expect("Expected function, got error."))(session, object, size) + } + pub unsafe fn C_GetAttributeValue( + &self, + session: CK_SESSION_HANDLE, + object: CK_OBJECT_HANDLE, + templ: *mut _CK_ATTRIBUTE, + ulCount: ::std::os::raw::c_ulong, + ) -> CK_RV { + (self + .C_GetAttributeValue + .as_ref() + .expect("Expected function, got error."))(session, object, templ, 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, + ) -> CK_RV { + (self + .C_SetAttributeValue + .as_ref() + .expect("Expected function, got error."))(session, object, templ, ulCount) + } + pub unsafe fn C_FindObjectsInit( + &self, + session: CK_SESSION_HANDLE, + templ: *mut _CK_ATTRIBUTE, + ulCount: ::std::os::raw::c_ulong, + ) -> CK_RV { + (self + .C_FindObjectsInit + .as_ref() + .expect("Expected function, got error."))(session, templ, 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, + ) -> CK_RV { + (self + .C_FindObjects + .as_ref() + .expect("Expected function, got error."))( + session, + object, + max_object_count, + object_count, + ) + } + pub unsafe fn C_FindObjectsFinal(&self, session: CK_SESSION_HANDLE) -> CK_RV { + (self + .C_FindObjectsFinal + .as_ref() + .expect("Expected function, got error."))(session) + } + pub unsafe fn C_EncryptInit( + &self, + session: CK_SESSION_HANDLE, + mechanism: *mut _CK_MECHANISM, + key: CK_OBJECT_HANDLE, + ) -> CK_RV { + (self + .C_EncryptInit + .as_ref() + .expect("Expected function, got error."))(session, mechanism, key) + } + 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, + ) -> CK_RV { + (self + .C_Encrypt + .as_ref() + .expect("Expected function, got error."))( + session, + data, + data_len, + encrypted_data, + encrypted_data_len, + ) + } + 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, + ) -> CK_RV { + (self + .C_EncryptUpdate + .as_ref() + .expect("Expected function, got error."))( + session, + part, + part_len, + encrypted_part, + encrypted_part_len, + ) + } + 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, + ) -> CK_RV { + (self + .C_EncryptFinal + .as_ref() + .expect("Expected function, got error."))( + session, + last_encrypted_part, + last_encrypted_part_len, + ) + } + pub unsafe fn C_DecryptInit( + &self, + session: CK_SESSION_HANDLE, + mechanism: *mut _CK_MECHANISM, + key: CK_OBJECT_HANDLE, + ) -> CK_RV { + (self + .C_DecryptInit + .as_ref() + .expect("Expected function, got error."))(session, mechanism, key) + } + 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, + ) -> CK_RV { + (self + .C_Decrypt + .as_ref() + .expect("Expected function, got error."))( + session, + encrypted_data, + encrypted_data_len, + data, + data_len, + ) + } + 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, + ) -> CK_RV { + (self + .C_DecryptUpdate + .as_ref() + .expect("Expected function, got error."))( + session, + encrypted_part, + encrypted_part_len, + part, + part_len, + ) + } + 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, + ) -> CK_RV { + (self + .C_DecryptFinal + .as_ref() + .expect("Expected function, got error."))(session, last_part, last_part_len) + } + pub unsafe fn C_DigestInit( + &self, + session: CK_SESSION_HANDLE, + mechanism: *mut _CK_MECHANISM, + ) -> CK_RV { + (self + .C_DigestInit + .as_ref() + .expect("Expected function, got error."))(session, mechanism) + } + 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, + ) -> CK_RV { + (self + .C_Digest + .as_ref() + .expect("Expected function, got error."))( + session, data, data_len, digest, digest_len + ) + } + pub unsafe fn C_DigestUpdate( + &self, + session: CK_SESSION_HANDLE, + part: *mut ::std::os::raw::c_uchar, + part_len: ::std::os::raw::c_ulong, + ) -> CK_RV { + (self + .C_DigestUpdate + .as_ref() + .expect("Expected function, got error."))(session, part, part_len) + } + pub unsafe fn C_DigestKey(&self, session: CK_SESSION_HANDLE, key: CK_OBJECT_HANDLE) -> CK_RV { + (self + .C_DigestKey + .as_ref() + .expect("Expected function, got error."))(session, key) + } + 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, + ) -> CK_RV { + (self + .C_DigestFinal + .as_ref() + .expect("Expected function, got error."))(session, digest, digest_len) + } + pub unsafe fn C_SignInit( + &self, + session: CK_SESSION_HANDLE, + mechanism: *mut _CK_MECHANISM, + key: CK_OBJECT_HANDLE, + ) -> CK_RV { + (self + .C_SignInit + .as_ref() + .expect("Expected function, got error."))(session, mechanism, key) + } + 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, + ) -> CK_RV { + (self.C_Sign.as_ref().expect("Expected function, got error."))( + session, + data, + data_len, + signature, + signature_len, + ) + } + pub unsafe fn C_SignUpdate( + &self, + session: CK_SESSION_HANDLE, + part: *mut ::std::os::raw::c_uchar, + part_len: ::std::os::raw::c_ulong, + ) -> CK_RV { + (self + .C_SignUpdate + .as_ref() + .expect("Expected function, got error."))(session, part, part_len) + } + 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, + ) -> CK_RV { + (self + .C_SignFinal + .as_ref() + .expect("Expected function, got error."))(session, signature, signature_len) + } + pub unsafe fn C_SignRecoverInit( + &self, + session: CK_SESSION_HANDLE, + mechanism: *mut _CK_MECHANISM, + key: CK_OBJECT_HANDLE, + ) -> CK_RV { + (self + .C_SignRecoverInit + .as_ref() + .expect("Expected function, got error."))(session, mechanism, key) + } + 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, + ) -> CK_RV { + (self + .C_SignRecover + .as_ref() + .expect("Expected function, got error."))( + session, + data, + data_len, + signature, + signature_len, + ) + } + pub unsafe fn C_VerifyInit( + &self, + session: CK_SESSION_HANDLE, + mechanism: *mut _CK_MECHANISM, + key: CK_OBJECT_HANDLE, + ) -> CK_RV { + (self + .C_VerifyInit + .as_ref() + .expect("Expected function, got error."))(session, mechanism, key) + } + 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, + ) -> CK_RV { + (self + .C_Verify + .as_ref() + .expect("Expected function, got error."))( + session, + data, + data_len, + signature, + signature_len, + ) + } + pub unsafe fn C_VerifyUpdate( + &self, + session: CK_SESSION_HANDLE, + part: *mut ::std::os::raw::c_uchar, + part_len: ::std::os::raw::c_ulong, + ) -> CK_RV { + (self + .C_VerifyUpdate + .as_ref() + .expect("Expected function, got error."))(session, part, part_len) + } + pub unsafe fn C_VerifyFinal( + &self, + session: CK_SESSION_HANDLE, + signature: *mut ::std::os::raw::c_uchar, + signature_len: ::std::os::raw::c_ulong, + ) -> CK_RV { + (self + .C_VerifyFinal + .as_ref() + .expect("Expected function, got error."))(session, signature, signature_len) + } + pub unsafe fn C_VerifyRecoverInit( + &self, + session: CK_SESSION_HANDLE, + mechanism: *mut _CK_MECHANISM, + key: CK_OBJECT_HANDLE, + ) -> CK_RV { + (self + .C_VerifyRecoverInit + .as_ref() + .expect("Expected function, got error."))(session, mechanism, key) + } + 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, + ) -> CK_RV { + (self + .C_VerifyRecover + .as_ref() + .expect("Expected function, got error."))( + session, + signature, + signature_len, + data, + data_len, + ) + } + 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, + ) -> CK_RV { + (self + .C_DigestEncryptUpdate + .as_ref() + .expect("Expected function, got error."))( + session, + part, + part_len, + encrypted_part, + encrypted_part_len, + ) + } + 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, + ) -> CK_RV { + (self + .C_DecryptDigestUpdate + .as_ref() + .expect("Expected function, got error."))( + session, + encrypted_part, + encrypted_part_len, + part, + part_len, + ) + } + 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, + ) -> CK_RV { + (self + .C_SignEncryptUpdate + .as_ref() + .expect("Expected function, got error."))( + session, + part, + part_len, + encrypted_part, + encrypted_part_len, + ) + } + 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, + ) -> CK_RV { + (self + .C_DecryptVerifyUpdate + .as_ref() + .expect("Expected function, got error."))( + session, + encrypted_part, + encrypted_part_len, + part, + part_len, + ) + } + 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, + ) -> CK_RV { + (self + .C_GenerateKey + .as_ref() + .expect("Expected function, got error."))( + session, mechanism, templ, ulCount, key + ) + } + 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, + ) -> 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, + ) + } + 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, + ) -> CK_RV { + (self + .C_WrapKey + .as_ref() + .expect("Expected function, got error."))( + session, + mechanism, + wrapping_key, + key, + wrapped_key, + wrapped_key_len, + ) + } + 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, + ) -> 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, + ) + } + 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, + ) -> CK_RV { + (self + .C_DeriveKey + .as_ref() + .expect("Expected function, got error."))( + session, + mechanism, + base_key, + templ, + attribute_count, + key, + ) + } + pub unsafe fn C_SeedRandom( + &self, + session: CK_SESSION_HANDLE, + seed: *mut ::std::os::raw::c_uchar, + seed_len: ::std::os::raw::c_ulong, + ) -> CK_RV { + (self + .C_SeedRandom + .as_ref() + .expect("Expected function, got error."))(session, seed, seed_len) + } + 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, + ) -> CK_RV { + (self + .C_GenerateRandom + .as_ref() + .expect("Expected function, got error."))(session, random_data, random_len) + } + pub unsafe fn C_GetFunctionStatus(&self, session: CK_SESSION_HANDLE) -> CK_RV { + (self + .C_GetFunctionStatus + .as_ref() + .expect("Expected function, got error."))(session) + } + pub unsafe fn C_CancelFunction(&self, session: CK_SESSION_HANDLE) -> CK_RV { + (self + .C_CancelFunction + .as_ref() + .expect("Expected function, got error."))(session) + } } diff --git a/cryptoki-sys/src/bindings/i686-unknown-linux-gnu.rs b/cryptoki-sys/src/bindings/i686-unknown-linux-gnu.rs index 29b5186b..df429e9c 100644 --- a/cryptoki-sys/src/bindings/i686-unknown-linux-gnu.rs +++ b/cryptoki-sys/src/bindings/i686-unknown-linux-gnu.rs @@ -1,5 +1,691 @@ -/* automatically generated by rust-bindgen 0.59.2 */ +/* 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 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 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; +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 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 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_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_EC_EDWARDS: CK_KEY_TYPE = 64; +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 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_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_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_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_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; +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 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_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_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_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_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_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_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_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_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_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_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_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_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_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 CKF_HW: CK_FLAGS = 1; +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_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 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_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_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 = 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_FUNCTION_REJECTED: CK_RV = 512; +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; #[repr(C)] #[derive(Debug, Default, Copy, Clone)] @@ -9,6 +695,8 @@ pub struct _CK_VERSION { } #[test] fn bindgen_test_layout__CK_VERSION() { + const UNINIT: ::std::mem::MaybeUninit<_CK_VERSION> = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<_CK_VERSION>(), 2usize, @@ -20,7 +708,7 @@ fn bindgen_test_layout__CK_VERSION() { concat!("Alignment of ", stringify!(_CK_VERSION)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_VERSION>())).major as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).major) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -30,7 +718,7 @@ fn bindgen_test_layout__CK_VERSION() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_VERSION>())).minor as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).minor) as usize - ptr as usize }, 1usize, concat!( "Offset of field: ", @@ -51,6 +739,8 @@ pub struct _CK_INFO { } #[test] fn bindgen_test_layout__CK_INFO() { + const UNINIT: ::std::mem::MaybeUninit<_CK_INFO> = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<_CK_INFO>(), 76usize, @@ -62,7 +752,7 @@ fn bindgen_test_layout__CK_INFO() { concat!("Alignment of ", stringify!(_CK_INFO)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_INFO>())).cryptokiVersion as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).cryptokiVersion) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -72,7 +762,7 @@ fn bindgen_test_layout__CK_INFO() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_INFO>())).manufacturerID as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).manufacturerID) as usize - ptr as usize }, 2usize, concat!( "Offset of field: ", @@ -82,7 +772,7 @@ fn bindgen_test_layout__CK_INFO() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_INFO>())).flags as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).flags) as usize - ptr as usize }, 36usize, concat!( "Offset of field: ", @@ -92,7 +782,7 @@ fn bindgen_test_layout__CK_INFO() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_INFO>())).libraryDescription as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).libraryDescription) as usize - ptr as usize }, 40usize, concat!( "Offset of field: ", @@ -102,7 +792,7 @@ fn bindgen_test_layout__CK_INFO() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_INFO>())).libraryVersion as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).libraryVersion) as usize - ptr as usize }, 72usize, concat!( "Offset of field: ", @@ -113,6 +803,7 @@ fn bindgen_test_layout__CK_INFO() { ); } 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; #[repr(C)] #[derive(Debug, Copy, Clone)] @@ -125,6 +816,8 @@ pub struct _CK_SLOT_INFO { } #[test] fn bindgen_test_layout__CK_SLOT_INFO() { + const UNINIT: ::std::mem::MaybeUninit<_CK_SLOT_INFO> = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<_CK_SLOT_INFO>(), 104usize, @@ -136,7 +829,7 @@ fn bindgen_test_layout__CK_SLOT_INFO() { concat!("Alignment of ", stringify!(_CK_SLOT_INFO)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_SLOT_INFO>())).slotDescription as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).slotDescription) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -146,7 +839,7 @@ fn bindgen_test_layout__CK_SLOT_INFO() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_SLOT_INFO>())).manufacturerID as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).manufacturerID) as usize - ptr as usize }, 64usize, concat!( "Offset of field: ", @@ -156,7 +849,7 @@ fn bindgen_test_layout__CK_SLOT_INFO() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_SLOT_INFO>())).flags as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).flags) as usize - ptr as usize }, 96usize, concat!( "Offset of field: ", @@ -166,7 +859,7 @@ fn bindgen_test_layout__CK_SLOT_INFO() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_SLOT_INFO>())).hardwareVersion as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).hardwareVersion) as usize - ptr as usize }, 100usize, concat!( "Offset of field: ", @@ -176,7 +869,7 @@ fn bindgen_test_layout__CK_SLOT_INFO() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_SLOT_INFO>())).firmwareVersion as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).firmwareVersion) as usize - ptr as usize }, 102usize, concat!( "Offset of field: ", @@ -195,6 +888,10 @@ 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; #[repr(C)] #[derive(Debug, Default, Copy, Clone)] pub struct _CK_TOKEN_INFO { @@ -219,6 +916,8 @@ pub struct _CK_TOKEN_INFO { } #[test] fn bindgen_test_layout__CK_TOKEN_INFO() { + const UNINIT: ::std::mem::MaybeUninit<_CK_TOKEN_INFO> = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<_CK_TOKEN_INFO>(), 160usize, @@ -230,7 +929,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { concat!("Alignment of ", stringify!(_CK_TOKEN_INFO)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_TOKEN_INFO>())).label as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).label) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -240,7 +939,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_TOKEN_INFO>())).manufacturerID as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).manufacturerID) as usize - ptr as usize }, 32usize, concat!( "Offset of field: ", @@ -250,7 +949,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_TOKEN_INFO>())).model as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).model) as usize - ptr as usize }, 64usize, concat!( "Offset of field: ", @@ -260,7 +959,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_TOKEN_INFO>())).serialNumber as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).serialNumber) as usize - ptr as usize }, 80usize, concat!( "Offset of field: ", @@ -270,7 +969,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_TOKEN_INFO>())).flags as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).flags) as usize - ptr as usize }, 96usize, concat!( "Offset of field: ", @@ -280,9 +979,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_TOKEN_INFO>())).ulMaxSessionCount as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).ulMaxSessionCount) as usize - ptr as usize }, 100usize, concat!( "Offset of field: ", @@ -292,7 +989,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_TOKEN_INFO>())).ulSessionCount as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ulSessionCount) as usize - ptr as usize }, 104usize, concat!( "Offset of field: ", @@ -302,9 +999,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_TOKEN_INFO>())).ulMaxRwSessionCount as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).ulMaxRwSessionCount) as usize - ptr as usize }, 108usize, concat!( "Offset of field: ", @@ -314,7 +1009,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_TOKEN_INFO>())).ulRwSessionCount as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ulRwSessionCount) as usize - ptr as usize }, 112usize, concat!( "Offset of field: ", @@ -324,7 +1019,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_TOKEN_INFO>())).ulMaxPinLen as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ulMaxPinLen) as usize - ptr as usize }, 116usize, concat!( "Offset of field: ", @@ -334,7 +1029,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_TOKEN_INFO>())).ulMinPinLen as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ulMinPinLen) as usize - ptr as usize }, 120usize, concat!( "Offset of field: ", @@ -344,9 +1039,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_TOKEN_INFO>())).ulTotalPublicMemory as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).ulTotalPublicMemory) as usize - ptr as usize }, 124usize, concat!( "Offset of field: ", @@ -356,9 +1049,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_TOKEN_INFO>())).ulFreePublicMemory as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).ulFreePublicMemory) as usize - ptr as usize }, 128usize, concat!( "Offset of field: ", @@ -368,9 +1059,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_TOKEN_INFO>())).ulTotalPrivateMemory as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).ulTotalPrivateMemory) as usize - ptr as usize }, 132usize, concat!( "Offset of field: ", @@ -380,9 +1069,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_TOKEN_INFO>())).ulFreePrivateMemory as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).ulFreePrivateMemory) as usize - ptr as usize }, 136usize, concat!( "Offset of field: ", @@ -392,7 +1079,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_TOKEN_INFO>())).hardwareVersion as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).hardwareVersion) as usize - ptr as usize }, 140usize, concat!( "Offset of field: ", @@ -402,7 +1089,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_TOKEN_INFO>())).firmwareVersion as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).firmwareVersion) as usize - ptr as usize }, 142usize, concat!( "Offset of field: ", @@ -412,7 +1099,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_TOKEN_INFO>())).utcTime as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).utcTime) as usize - ptr as usize }, 144usize, concat!( "Offset of field: ", @@ -435,6 +1122,8 @@ pub struct _CK_SESSION_INFO { } #[test] fn bindgen_test_layout__CK_SESSION_INFO() { + const UNINIT: ::std::mem::MaybeUninit<_CK_SESSION_INFO> = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<_CK_SESSION_INFO>(), 16usize, @@ -446,7 +1135,7 @@ fn bindgen_test_layout__CK_SESSION_INFO() { concat!("Alignment of ", stringify!(_CK_SESSION_INFO)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_SESSION_INFO>())).slotID as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).slotID) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -456,7 +1145,7 @@ fn bindgen_test_layout__CK_SESSION_INFO() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_SESSION_INFO>())).state as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).state) as usize - ptr as usize }, 4usize, concat!( "Offset of field: ", @@ -466,7 +1155,7 @@ fn bindgen_test_layout__CK_SESSION_INFO() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_SESSION_INFO>())).flags as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).flags) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -476,7 +1165,7 @@ fn bindgen_test_layout__CK_SESSION_INFO() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_SESSION_INFO>())).ulDeviceError as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ulDeviceError) as usize - ptr as usize }, 12usize, concat!( "Offset of field: ", @@ -501,6 +1190,8 @@ pub struct _CK_ATTRIBUTE { } #[test] fn bindgen_test_layout__CK_ATTRIBUTE() { + const UNINIT: ::std::mem::MaybeUninit<_CK_ATTRIBUTE> = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<_CK_ATTRIBUTE>(), 12usize, @@ -512,7 +1203,7 @@ fn bindgen_test_layout__CK_ATTRIBUTE() { concat!("Alignment of ", stringify!(_CK_ATTRIBUTE)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_ATTRIBUTE>())).type_ as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).type_) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -522,7 +1213,7 @@ fn bindgen_test_layout__CK_ATTRIBUTE() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_ATTRIBUTE>())).pValue as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).pValue) as usize - ptr as usize }, 4usize, concat!( "Offset of field: ", @@ -532,7 +1223,7 @@ fn bindgen_test_layout__CK_ATTRIBUTE() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_ATTRIBUTE>())).ulValueLen as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ulValueLen) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -560,6 +1251,8 @@ pub struct _CK_DATE { } #[test] fn bindgen_test_layout__CK_DATE() { + const UNINIT: ::std::mem::MaybeUninit<_CK_DATE> = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<_CK_DATE>(), 8usize, @@ -571,7 +1264,7 @@ fn bindgen_test_layout__CK_DATE() { concat!("Alignment of ", stringify!(_CK_DATE)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_DATE>())).year as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).year) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -581,7 +1274,7 @@ fn bindgen_test_layout__CK_DATE() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_DATE>())).month as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).month) as usize - ptr as usize }, 4usize, concat!( "Offset of field: ", @@ -591,7 +1284,7 @@ fn bindgen_test_layout__CK_DATE() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_DATE>())).day as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).day) as usize - ptr as usize }, 6usize, concat!( "Offset of field: ", @@ -611,6 +1304,8 @@ pub struct _CK_MECHANISM { } #[test] fn bindgen_test_layout__CK_MECHANISM() { + const UNINIT: ::std::mem::MaybeUninit<_CK_MECHANISM> = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<_CK_MECHANISM>(), 12usize, @@ -622,7 +1317,7 @@ fn bindgen_test_layout__CK_MECHANISM() { concat!("Alignment of ", stringify!(_CK_MECHANISM)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_MECHANISM>())).mechanism as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).mechanism) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -632,7 +1327,7 @@ fn bindgen_test_layout__CK_MECHANISM() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_MECHANISM>())).pParameter as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).pParameter) as usize - ptr as usize }, 4usize, concat!( "Offset of field: ", @@ -642,7 +1337,7 @@ fn bindgen_test_layout__CK_MECHANISM() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_MECHANISM>())).ulParameterLen as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ulParameterLen) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -670,6 +1365,8 @@ pub struct _CK_MECHANISM_INFO { } #[test] fn bindgen_test_layout__CK_MECHANISM_INFO() { + const UNINIT: ::std::mem::MaybeUninit<_CK_MECHANISM_INFO> = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<_CK_MECHANISM_INFO>(), 12usize, @@ -681,7 +1378,7 @@ fn bindgen_test_layout__CK_MECHANISM_INFO() { concat!("Alignment of ", stringify!(_CK_MECHANISM_INFO)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_MECHANISM_INFO>())).ulMinKeySize as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ulMinKeySize) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -691,7 +1388,7 @@ fn bindgen_test_layout__CK_MECHANISM_INFO() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_MECHANISM_INFO>())).ulMaxKeySize as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ulMaxKeySize) as usize - ptr as usize }, 4usize, concat!( "Offset of field: ", @@ -701,7 +1398,7 @@ fn bindgen_test_layout__CK_MECHANISM_INFO() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_MECHANISM_INFO>())).flags as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).flags) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -721,6 +1418,8 @@ pub struct CK_OTP_PARAM { } #[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, @@ -732,7 +1431,7 @@ fn bindgen_test_layout_CK_OTP_PARAM() { concat!("Alignment of ", stringify!(CK_OTP_PARAM)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).type_ as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).type_) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -742,7 +1441,7 @@ fn bindgen_test_layout_CK_OTP_PARAM() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).pValue as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).pValue) as usize - ptr as usize }, 4usize, concat!( "Offset of field: ", @@ -752,7 +1451,7 @@ fn bindgen_test_layout_CK_OTP_PARAM() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).ulValueLen as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ulValueLen) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -779,6 +1478,8 @@ pub struct CK_OTP_PARAMS { } #[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, @@ -790,7 +1491,7 @@ fn bindgen_test_layout_CK_OTP_PARAMS() { concat!("Alignment of ", stringify!(CK_OTP_PARAMS)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).pParams as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).pParams) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -800,7 +1501,7 @@ fn bindgen_test_layout_CK_OTP_PARAMS() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).ulCount as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ulCount) as usize - ptr as usize }, 4usize, concat!( "Offset of field: ", @@ -827,6 +1528,9 @@ pub struct CK_OTP_SIGNATURE_INFO { } #[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, @@ -838,7 +1542,7 @@ fn bindgen_test_layout_CK_OTP_SIGNATURE_INFO() { concat!("Alignment of ", stringify!(CK_OTP_SIGNATURE_INFO)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).pParams as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).pParams) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -848,7 +1552,7 @@ fn bindgen_test_layout_CK_OTP_SIGNATURE_INFO() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).ulCount as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ulCount) as usize - ptr as usize }, 4usize, concat!( "Offset of field: ", @@ -877,6 +1581,9 @@ pub struct ck_rsa_pkcs_pss_params { } #[test] fn bindgen_test_layout_ck_rsa_pkcs_pss_params() { + const UNINIT: ::std::mem::MaybeUninit = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), 12usize, @@ -888,7 +1595,7 @@ fn bindgen_test_layout_ck_rsa_pkcs_pss_params() { concat!("Alignment of ", stringify!(ck_rsa_pkcs_pss_params)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).hashAlg as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).hashAlg) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -898,7 +1605,7 @@ fn bindgen_test_layout_ck_rsa_pkcs_pss_params() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).mgf as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).mgf) as usize - ptr as usize }, 4usize, concat!( "Offset of field: ", @@ -908,7 +1615,7 @@ fn bindgen_test_layout_ck_rsa_pkcs_pss_params() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).sLen as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).sLen) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -930,6 +1637,9 @@ pub struct ck_rsa_pkcs_oaep_params { } #[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, @@ -941,7 +1651,7 @@ fn bindgen_test_layout_ck_rsa_pkcs_oaep_params() { concat!("Alignment of ", stringify!(ck_rsa_pkcs_oaep_params)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).hashAlg as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).hashAlg) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -951,7 +1661,7 @@ fn bindgen_test_layout_ck_rsa_pkcs_oaep_params() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).mgf as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).mgf) as usize - ptr as usize }, 4usize, concat!( "Offset of field: ", @@ -961,7 +1671,7 @@ fn bindgen_test_layout_ck_rsa_pkcs_oaep_params() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).source as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).source) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -971,9 +1681,7 @@ fn bindgen_test_layout_ck_rsa_pkcs_oaep_params() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).pSourceData as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).pSourceData) as usize - ptr as usize }, 12usize, concat!( "Offset of field: ", @@ -983,9 +1691,7 @@ fn bindgen_test_layout_ck_rsa_pkcs_oaep_params() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).ulSourceDataLen as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).ulSourceDataLen) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", @@ -1012,6 +1718,8 @@ pub struct ck_aes_ctr_params { } #[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, @@ -1023,7 +1731,7 @@ fn bindgen_test_layout_ck_aes_ctr_params() { concat!("Alignment of ", stringify!(ck_aes_ctr_params)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).ulCounterBits as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ulCounterBits) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -1033,7 +1741,7 @@ fn bindgen_test_layout_ck_aes_ctr_params() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).cb as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).cb) as usize - ptr as usize }, 4usize, concat!( "Offset of field: ", @@ -1055,6 +1763,8 @@ pub struct ck_gcm_params { } #[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, @@ -1066,7 +1776,7 @@ fn bindgen_test_layout_ck_gcm_params() { concat!("Alignment of ", stringify!(ck_gcm_params)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).pIv as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).pIv) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -1076,7 +1786,7 @@ fn bindgen_test_layout_ck_gcm_params() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).ulIvLen as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ulIvLen) as usize - ptr as usize }, 4usize, concat!( "Offset of field: ", @@ -1086,7 +1796,7 @@ fn bindgen_test_layout_ck_gcm_params() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).ulIvBits as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ulIvBits) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -1096,7 +1806,7 @@ fn bindgen_test_layout_ck_gcm_params() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).pAAD as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).pAAD) as usize - ptr as usize }, 12usize, concat!( "Offset of field: ", @@ -1106,7 +1816,7 @@ fn bindgen_test_layout_ck_gcm_params() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).ulAADLen as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ulAADLen) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", @@ -1116,7 +1826,7 @@ fn bindgen_test_layout_ck_gcm_params() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).ulTagBits as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ulTagBits) as usize - ptr as usize }, 20usize, concat!( "Offset of field: ", @@ -1147,6 +1857,9 @@ pub struct ck_ecdh1_derive_params { } #[test] fn bindgen_test_layout_ck_ecdh1_derive_params() { + const UNINIT: ::std::mem::MaybeUninit = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), 20usize, @@ -1158,7 +1871,7 @@ fn bindgen_test_layout_ck_ecdh1_derive_params() { concat!("Alignment of ", stringify!(ck_ecdh1_derive_params)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).kdf as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).kdf) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -1168,9 +1881,7 @@ fn bindgen_test_layout_ck_ecdh1_derive_params() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).ulSharedDataLen as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).ulSharedDataLen) as usize - ptr as usize }, 4usize, concat!( "Offset of field: ", @@ -1180,9 +1891,7 @@ fn bindgen_test_layout_ck_ecdh1_derive_params() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).pSharedData as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).pSharedData) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -1192,9 +1901,7 @@ fn bindgen_test_layout_ck_ecdh1_derive_params() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).ulPublicDataLen as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).ulPublicDataLen) as usize - ptr as usize }, 12usize, concat!( "Offset of field: ", @@ -1204,9 +1911,7 @@ fn bindgen_test_layout_ck_ecdh1_derive_params() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).pPublicData as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).pPublicData) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", @@ -1233,6 +1938,9 @@ pub struct ck_key_derivation_string_data { } #[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, @@ -1244,9 +1952,7 @@ fn bindgen_test_layout_ck_key_derivation_string_data() { concat!("Alignment of ", stringify!(ck_key_derivation_string_data)) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).pData as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).pData) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -1256,9 +1962,7 @@ fn bindgen_test_layout_ck_key_derivation_string_data() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).ulLen as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).ulLen) as usize - ptr as usize }, 4usize, concat!( "Offset of field: ", @@ -1286,6 +1990,9 @@ pub struct ck_des_cbc_encrypt_data_params { } #[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, @@ -1297,9 +2004,7 @@ fn bindgen_test_layout_ck_des_cbc_encrypt_data_params() { concat!("Alignment of ", stringify!(ck_des_cbc_encrypt_data_params)) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).iv as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).iv) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -1309,9 +2014,7 @@ fn bindgen_test_layout_ck_des_cbc_encrypt_data_params() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).pData as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).pData) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -1321,9 +2024,7 @@ fn bindgen_test_layout_ck_des_cbc_encrypt_data_params() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).length as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).length) as usize - ptr as usize }, 12usize, concat!( "Offset of field: ", @@ -1351,6 +2052,9 @@ pub struct ck_aes_cbc_encrypt_data_params { } #[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, @@ -1362,9 +2066,7 @@ fn bindgen_test_layout_ck_aes_cbc_encrypt_data_params() { concat!("Alignment of ", stringify!(ck_aes_cbc_encrypt_data_params)) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).iv as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).iv) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -1374,9 +2076,7 @@ fn bindgen_test_layout_ck_aes_cbc_encrypt_data_params() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).pData as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).pData) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", @@ -1386,9 +2086,7 @@ fn bindgen_test_layout_ck_aes_cbc_encrypt_data_params() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).length as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).length) as usize - ptr as usize }, 20usize, concat!( "Offset of field: ", @@ -1950,6 +2648,8 @@ pub struct _CK_FUNCTION_LIST { } #[test] fn bindgen_test_layout__CK_FUNCTION_LIST() { + const UNINIT: ::std::mem::MaybeUninit<_CK_FUNCTION_LIST> = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<_CK_FUNCTION_LIST>(), 276usize, @@ -1961,7 +2661,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { concat!("Alignment of ", stringify!(_CK_FUNCTION_LIST)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).version as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).version) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -1971,7 +2671,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_Initialize as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_Initialize) as usize - ptr as usize }, 4usize, concat!( "Offset of field: ", @@ -1981,7 +2681,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_Finalize as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_Finalize) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -1991,7 +2691,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_GetInfo as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_GetInfo) as usize - ptr as usize }, 12usize, concat!( "Offset of field: ", @@ -2001,9 +2701,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_GetFunctionList as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_GetFunctionList) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", @@ -2013,7 +2711,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_GetSlotList as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_GetSlotList) as usize - ptr as usize }, 20usize, concat!( "Offset of field: ", @@ -2023,7 +2721,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_GetSlotInfo as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_GetSlotInfo) as usize - ptr as usize }, 24usize, concat!( "Offset of field: ", @@ -2033,9 +2731,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_GetTokenInfo as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_GetTokenInfo) as usize - ptr as usize }, 28usize, concat!( "Offset of field: ", @@ -2045,9 +2741,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_GetMechanismList as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_GetMechanismList) as usize - ptr as usize }, 32usize, concat!( "Offset of field: ", @@ -2057,9 +2751,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_GetMechanismInfo as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_GetMechanismInfo) as usize - ptr as usize }, 36usize, concat!( "Offset of field: ", @@ -2069,7 +2761,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_InitToken as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_InitToken) as usize - ptr as usize }, 40usize, concat!( "Offset of field: ", @@ -2079,7 +2771,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_InitPIN as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_InitPIN) as usize - ptr as usize }, 44usize, concat!( "Offset of field: ", @@ -2089,7 +2781,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_SetPIN as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_SetPIN) as usize - ptr as usize }, 48usize, concat!( "Offset of field: ", @@ -2099,7 +2791,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_OpenSession as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_OpenSession) as usize - ptr as usize }, 52usize, concat!( "Offset of field: ", @@ -2109,9 +2801,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_CloseSession as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_CloseSession) as usize - ptr as usize }, 56usize, concat!( "Offset of field: ", @@ -2121,9 +2811,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_CloseAllSessions as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_CloseAllSessions) as usize - ptr as usize }, 60usize, concat!( "Offset of field: ", @@ -2133,9 +2821,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_GetSessionInfo as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_GetSessionInfo) as usize - ptr as usize }, 64usize, concat!( "Offset of field: ", @@ -2145,9 +2831,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_GetOperationState as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_GetOperationState) as usize - ptr as usize }, 68usize, concat!( "Offset of field: ", @@ -2157,9 +2841,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_SetOperationState as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_SetOperationState) as usize - ptr as usize }, 72usize, concat!( "Offset of field: ", @@ -2169,7 +2851,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_Login as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_Login) as usize - ptr as usize }, 76usize, concat!( "Offset of field: ", @@ -2179,7 +2861,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_Logout as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_Logout) as usize - ptr as usize }, 80usize, concat!( "Offset of field: ", @@ -2189,9 +2871,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_CreateObject as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_CreateObject) as usize - ptr as usize }, 84usize, concat!( "Offset of field: ", @@ -2201,7 +2881,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_CopyObject as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_CopyObject) as usize - ptr as usize }, 88usize, concat!( "Offset of field: ", @@ -2211,9 +2891,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_DestroyObject as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_DestroyObject) as usize - ptr as usize }, 92usize, concat!( "Offset of field: ", @@ -2223,9 +2901,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_GetObjectSize as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_GetObjectSize) as usize - ptr as usize }, 96usize, concat!( "Offset of field: ", @@ -2235,9 +2911,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_GetAttributeValue as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_GetAttributeValue) as usize - ptr as usize }, 100usize, concat!( "Offset of field: ", @@ -2247,9 +2921,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_SetAttributeValue as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_SetAttributeValue) as usize - ptr as usize }, 104usize, concat!( "Offset of field: ", @@ -2259,9 +2931,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_FindObjectsInit as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_FindObjectsInit) as usize - ptr as usize }, 108usize, concat!( "Offset of field: ", @@ -2271,7 +2941,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_FindObjects as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_FindObjects) as usize - ptr as usize }, 112usize, concat!( "Offset of field: ", @@ -2281,9 +2951,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_FindObjectsFinal as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_FindObjectsFinal) as usize - ptr as usize }, 116usize, concat!( "Offset of field: ", @@ -2293,7 +2961,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_EncryptInit as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_EncryptInit) as usize - ptr as usize }, 120usize, concat!( "Offset of field: ", @@ -2303,7 +2971,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_Encrypt as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_Encrypt) as usize - ptr as usize }, 124usize, concat!( "Offset of field: ", @@ -2313,9 +2981,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_EncryptUpdate as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_EncryptUpdate) as usize - ptr as usize }, 128usize, concat!( "Offset of field: ", @@ -2325,9 +2991,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_EncryptFinal as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_EncryptFinal) as usize - ptr as usize }, 132usize, concat!( "Offset of field: ", @@ -2337,7 +3001,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_DecryptInit as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_DecryptInit) as usize - ptr as usize }, 136usize, concat!( "Offset of field: ", @@ -2347,7 +3011,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_Decrypt as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_Decrypt) as usize - ptr as usize }, 140usize, concat!( "Offset of field: ", @@ -2357,9 +3021,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_DecryptUpdate as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_DecryptUpdate) as usize - ptr as usize }, 144usize, concat!( "Offset of field: ", @@ -2369,9 +3031,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_DecryptFinal as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_DecryptFinal) as usize - ptr as usize }, 148usize, concat!( "Offset of field: ", @@ -2381,7 +3041,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_DigestInit as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_DigestInit) as usize - ptr as usize }, 152usize, concat!( "Offset of field: ", @@ -2391,7 +3051,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_Digest as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_Digest) as usize - ptr as usize }, 156usize, concat!( "Offset of field: ", @@ -2401,9 +3061,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_DigestUpdate as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_DigestUpdate) as usize - ptr as usize }, 160usize, concat!( "Offset of field: ", @@ -2413,7 +3071,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_DigestKey as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_DigestKey) as usize - ptr as usize }, 164usize, concat!( "Offset of field: ", @@ -2423,7 +3081,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_DigestFinal as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_DigestFinal) as usize - ptr as usize }, 168usize, concat!( "Offset of field: ", @@ -2433,7 +3091,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_SignInit as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_SignInit) as usize - ptr as usize }, 172usize, concat!( "Offset of field: ", @@ -2443,7 +3101,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_Sign as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_Sign) as usize - ptr as usize }, 176usize, concat!( "Offset of field: ", @@ -2453,7 +3111,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_SignUpdate as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_SignUpdate) as usize - ptr as usize }, 180usize, concat!( "Offset of field: ", @@ -2463,7 +3121,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_SignFinal as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_SignFinal) as usize - ptr as usize }, 184usize, concat!( "Offset of field: ", @@ -2473,9 +3131,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_SignRecoverInit as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_SignRecoverInit) as usize - ptr as usize }, 188usize, concat!( "Offset of field: ", @@ -2485,7 +3141,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_SignRecover as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_SignRecover) as usize - ptr as usize }, 192usize, concat!( "Offset of field: ", @@ -2495,7 +3151,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_VerifyInit as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_VerifyInit) as usize - ptr as usize }, 196usize, concat!( "Offset of field: ", @@ -2505,7 +3161,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_Verify as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_Verify) as usize - ptr as usize }, 200usize, concat!( "Offset of field: ", @@ -2515,9 +3171,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_VerifyUpdate as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_VerifyUpdate) as usize - ptr as usize }, 204usize, concat!( "Offset of field: ", @@ -2527,7 +3181,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_VerifyFinal as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_VerifyFinal) as usize - ptr as usize }, 208usize, concat!( "Offset of field: ", @@ -2537,9 +3191,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_VerifyRecoverInit as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_VerifyRecoverInit) as usize - ptr as usize }, 212usize, concat!( "Offset of field: ", @@ -2549,9 +3201,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_VerifyRecover as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_VerifyRecover) as usize - ptr as usize }, 216usize, concat!( "Offset of field: ", @@ -2561,9 +3211,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_DigestEncryptUpdate as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_DigestEncryptUpdate) as usize - ptr as usize }, 220usize, concat!( "Offset of field: ", @@ -2573,9 +3221,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_DecryptDigestUpdate as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_DecryptDigestUpdate) as usize - ptr as usize }, 224usize, concat!( "Offset of field: ", @@ -2585,9 +3231,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_SignEncryptUpdate as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_SignEncryptUpdate) as usize - ptr as usize }, 228usize, concat!( "Offset of field: ", @@ -2597,9 +3241,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_DecryptVerifyUpdate as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_DecryptVerifyUpdate) as usize - ptr as usize }, 232usize, concat!( "Offset of field: ", @@ -2609,7 +3251,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_GenerateKey as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_GenerateKey) as usize - ptr as usize }, 236usize, concat!( "Offset of field: ", @@ -2619,9 +3261,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_GenerateKeyPair as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_GenerateKeyPair) as usize - ptr as usize }, 240usize, concat!( "Offset of field: ", @@ -2631,7 +3271,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_WrapKey as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_WrapKey) as usize - ptr as usize }, 244usize, concat!( "Offset of field: ", @@ -2641,7 +3281,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_UnwrapKey as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_UnwrapKey) as usize - ptr as usize }, 248usize, concat!( "Offset of field: ", @@ -2651,7 +3291,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_DeriveKey as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_DeriveKey) as usize - ptr as usize }, 252usize, concat!( "Offset of field: ", @@ -2661,7 +3301,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_SeedRandom as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_SeedRandom) as usize - ptr as usize }, 256usize, concat!( "Offset of field: ", @@ -2671,9 +3311,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_GenerateRandom as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_GenerateRandom) as usize - ptr as usize }, 260usize, concat!( "Offset of field: ", @@ -2683,9 +3321,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_GetFunctionStatus as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_GetFunctionStatus) as usize - ptr as usize }, 264usize, concat!( "Offset of field: ", @@ -2695,9 +3331,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_CancelFunction as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_CancelFunction) as usize - ptr as usize }, 268usize, concat!( "Offset of field: ", @@ -2707,9 +3341,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_WaitForSlotEvent as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_WaitForSlotEvent) as usize - ptr as usize }, 272usize, concat!( "Offset of field: ", @@ -2739,6 +3371,9 @@ pub struct _CK_C_INITIALIZE_ARGS { } #[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, @@ -2750,9 +3385,7 @@ fn bindgen_test_layout__CK_C_INITIALIZE_ARGS() { concat!("Alignment of ", stringify!(_CK_C_INITIALIZE_ARGS)) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_C_INITIALIZE_ARGS>())).CreateMutex as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).CreateMutex) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -2762,9 +3395,7 @@ fn bindgen_test_layout__CK_C_INITIALIZE_ARGS() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_C_INITIALIZE_ARGS>())).DestroyMutex as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).DestroyMutex) as usize - ptr as usize }, 4usize, concat!( "Offset of field: ", @@ -2774,7 +3405,7 @@ fn bindgen_test_layout__CK_C_INITIALIZE_ARGS() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_C_INITIALIZE_ARGS>())).LockMutex as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).LockMutex) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -2784,9 +3415,7 @@ fn bindgen_test_layout__CK_C_INITIALIZE_ARGS() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_C_INITIALIZE_ARGS>())).UnlockMutex as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).UnlockMutex) as usize - ptr as usize }, 12usize, concat!( "Offset of field: ", @@ -2796,7 +3425,7 @@ fn bindgen_test_layout__CK_C_INITIALIZE_ARGS() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_C_INITIALIZE_ARGS>())).flags as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).flags) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", @@ -2806,7 +3435,7 @@ fn bindgen_test_layout__CK_C_INITIALIZE_ARGS() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_C_INITIALIZE_ARGS>())).pReserved as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).pReserved) as usize - ptr as usize }, 20usize, concat!( "Offset of field: ", @@ -2825,8 +3454,6 @@ impl Default for _CK_C_INITIALIZE_ARGS { } } } -pub type size_t = ::std::os::raw::c_uint; -pub type wchar_t = ::std::os::raw::c_int; 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; @@ -2893,10 +3520,529 @@ pub type CK_AES_CBC_ENCRYPT_DATA_PARAMS_PTR = *mut ck_aes_cbc_encrypt_data_param 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_GetFunctionList: Result< unsafe extern "C" fn(function_list: *mut *mut _CK_FUNCTION_LIST) -> 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, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_GetSlotInfo: Result< + unsafe extern "C" fn(slotID: CK_SLOT_ID, info: *mut _CK_SLOT_INFO) -> 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, + ::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, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_GetMechanismInfo: Result< + unsafe extern "C" fn( + slotID: CK_SLOT_ID, + type_: CK_MECHANISM_TYPE, + info: *mut _CK_MECHANISM_INFO, + ) -> 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, + ) -> 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, + ) -> 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, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_OpenSession: Result< + 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, + ::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(session: CK_SESSION_HANDLE, info: *mut _CK_SESSION_INFO) -> 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, + ) -> 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, + ) -> 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, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_Logout: + 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, + ) -> 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, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_DestroyObject: Result< + unsafe extern "C" fn(session: CK_SESSION_HANDLE, object: 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, + ) -> 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, + ) -> 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, + ) -> 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, + ) -> 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, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_FindObjectsFinal: + 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, + ) -> 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, + ) -> 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, + ) -> 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, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_DecryptInit: Result< + unsafe extern "C" fn( + session: CK_SESSION_HANDLE, + mechanism: *mut _CK_MECHANISM, + key: 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, + ) -> 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, + ) -> 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, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_DigestInit: Result< + unsafe extern "C" fn(session: CK_SESSION_HANDLE, mechanism: *mut _CK_MECHANISM) -> 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, + ) -> 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, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_DigestKey: Result< + unsafe extern "C" fn(session: CK_SESSION_HANDLE, key: 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, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_SignInit: Result< + unsafe extern "C" fn( + session: CK_SESSION_HANDLE, + mechanism: *mut _CK_MECHANISM, + key: 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, + ) -> 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, + ) -> 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, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_SignRecoverInit: Result< + unsafe extern "C" fn( + session: CK_SESSION_HANDLE, + mechanism: *mut _CK_MECHANISM, + key: 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, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_VerifyInit: Result< + unsafe extern "C" fn( + session: CK_SESSION_HANDLE, + mechanism: *mut _CK_MECHANISM, + key: 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, + ) -> 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, + ) -> 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, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_VerifyRecoverInit: Result< + unsafe extern "C" fn( + session: CK_SESSION_HANDLE, + mechanism: *mut _CK_MECHANISM, + key: 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, + ) -> 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, + ) -> 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, + ) -> 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, + ) -> 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, + ) -> 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, + ) -> 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, + ) -> 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, + ) -> 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, + ) -> 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, + ) -> 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, + ) -> 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, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_GetFunctionStatus: + Result CK_RV, ::libloading::Error>, + pub C_CancelFunction: + Result CK_RV, ::libloading::Error>, } impl Pkcs11 { pub unsafe fn new

(path: P) -> Result @@ -2911,16 +4057,1010 @@ impl Pkcs11 { 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_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); + 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); Ok(Pkcs11 { __library, + C_Initialize, + C_Finalize, + C_GetInfo, C_GetFunctionList, + C_GetSlotList, + C_GetSlotInfo, + C_GetTokenInfo, + C_WaitForSlotEvent, + 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, }) } + pub unsafe fn C_Initialize(&self, init_args: *mut ::std::os::raw::c_void) -> CK_RV { + (self + .C_Initialize + .as_ref() + .expect("Expected function, got error."))(init_args) + } + pub unsafe fn C_Finalize(&self, pReserved: *mut ::std::os::raw::c_void) -> 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 { + (self + .C_GetInfo + .as_ref() + .expect("Expected function, got error."))(info) + } pub unsafe fn C_GetFunctionList(&self, function_list: *mut *mut _CK_FUNCTION_LIST) -> CK_RV { (self .C_GetFunctionList .as_ref() .expect("Expected function, got error."))(function_list) } + 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, + ) -> CK_RV { + (self + .C_GetSlotList + .as_ref() + .expect("Expected function, got error."))(token_present, slot_list, ulCount) + } + pub unsafe fn C_GetSlotInfo(&self, slotID: CK_SLOT_ID, info: *mut _CK_SLOT_INFO) -> CK_RV { + (self + .C_GetSlotInfo + .as_ref() + .expect("Expected function, got error."))(slotID, info) + } + pub unsafe fn C_GetTokenInfo(&self, slotID: CK_SLOT_ID, info: *mut _CK_TOKEN_INFO) -> 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) + } + pub unsafe fn C_GetMechanismList( + &self, + slotID: CK_SLOT_ID, + mechanism_list: *mut CK_MECHANISM_TYPE, + ulCount: *mut ::std::os::raw::c_ulong, + ) -> CK_RV { + (self + .C_GetMechanismList + .as_ref() + .expect("Expected function, got error."))(slotID, mechanism_list, ulCount) + } + pub unsafe fn C_GetMechanismInfo( + &self, + slotID: CK_SLOT_ID, + type_: CK_MECHANISM_TYPE, + info: *mut _CK_MECHANISM_INFO, + ) -> CK_RV { + (self + .C_GetMechanismInfo + .as_ref() + .expect("Expected function, got error."))(slotID, type_, info) + } + 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, + ) -> CK_RV { + (self + .C_InitToken + .as_ref() + .expect("Expected function, got error."))(slotID, pin, pin_len, label) + } + pub unsafe fn C_InitPIN( + &self, + session: CK_SESSION_HANDLE, + pin: *mut ::std::os::raw::c_uchar, + pin_len: ::std::os::raw::c_ulong, + ) -> CK_RV { + (self + .C_InitPIN + .as_ref() + .expect("Expected function, got error."))(session, pin, pin_len) + } + 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, + ) -> CK_RV { + (self + .C_SetPIN + .as_ref() + .expect("Expected function, got error."))( + session, old_pin, old_len, new_pin, new_len + ) + } + 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, + ) -> CK_RV { + (self + .C_OpenSession + .as_ref() + .expect("Expected function, got error."))( + slotID, flags, application, notify, session + ) + } + pub unsafe fn C_CloseSession(&self, session: CK_SESSION_HANDLE) -> CK_RV { + (self + .C_CloseSession + .as_ref() + .expect("Expected function, got error."))(session) + } + 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, + session: CK_SESSION_HANDLE, + info: *mut _CK_SESSION_INFO, + ) -> CK_RV { + (self + .C_GetSessionInfo + .as_ref() + .expect("Expected function, got error."))(session, info) + } + 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, + ) -> CK_RV { + (self + .C_GetOperationState + .as_ref() + .expect("Expected function, got error."))( + session, operation_state, operation_state_len + ) + } + 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, + ) -> CK_RV { + (self + .C_SetOperationState + .as_ref() + .expect("Expected function, got error."))( + session, + operation_state, + operation_state_len, + encryption_key, + authentiation_key, + ) + } + 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, + ) -> CK_RV { + (self + .C_Login + .as_ref() + .expect("Expected function, got error."))(session, user_type, pin, pin_len) + } + pub unsafe fn C_Logout(&self, session: CK_SESSION_HANDLE) -> CK_RV { + (self + .C_Logout + .as_ref() + .expect("Expected function, got error."))(session) + } + 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, + ) -> CK_RV { + (self + .C_CreateObject + .as_ref() + .expect("Expected function, got error."))(session, templ, ulCount, object) + } + 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, + ) -> CK_RV { + (self + .C_CopyObject + .as_ref() + .expect("Expected function, got error."))( + session, object, templ, ulCount, new_object + ) + } + pub unsafe fn C_DestroyObject( + &self, + session: CK_SESSION_HANDLE, + object: CK_OBJECT_HANDLE, + ) -> CK_RV { + (self + .C_DestroyObject + .as_ref() + .expect("Expected function, got error."))(session, object) + } + pub unsafe fn C_GetObjectSize( + &self, + session: CK_SESSION_HANDLE, + object: CK_OBJECT_HANDLE, + size: *mut ::std::os::raw::c_ulong, + ) -> CK_RV { + (self + .C_GetObjectSize + .as_ref() + .expect("Expected function, got error."))(session, object, size) + } + pub unsafe fn C_GetAttributeValue( + &self, + session: CK_SESSION_HANDLE, + object: CK_OBJECT_HANDLE, + templ: *mut _CK_ATTRIBUTE, + ulCount: ::std::os::raw::c_ulong, + ) -> CK_RV { + (self + .C_GetAttributeValue + .as_ref() + .expect("Expected function, got error."))(session, object, templ, 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, + ) -> CK_RV { + (self + .C_SetAttributeValue + .as_ref() + .expect("Expected function, got error."))(session, object, templ, ulCount) + } + pub unsafe fn C_FindObjectsInit( + &self, + session: CK_SESSION_HANDLE, + templ: *mut _CK_ATTRIBUTE, + ulCount: ::std::os::raw::c_ulong, + ) -> CK_RV { + (self + .C_FindObjectsInit + .as_ref() + .expect("Expected function, got error."))(session, templ, 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, + ) -> CK_RV { + (self + .C_FindObjects + .as_ref() + .expect("Expected function, got error."))( + session, + object, + max_object_count, + object_count, + ) + } + pub unsafe fn C_FindObjectsFinal(&self, session: CK_SESSION_HANDLE) -> CK_RV { + (self + .C_FindObjectsFinal + .as_ref() + .expect("Expected function, got error."))(session) + } + pub unsafe fn C_EncryptInit( + &self, + session: CK_SESSION_HANDLE, + mechanism: *mut _CK_MECHANISM, + key: CK_OBJECT_HANDLE, + ) -> CK_RV { + (self + .C_EncryptInit + .as_ref() + .expect("Expected function, got error."))(session, mechanism, key) + } + 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, + ) -> CK_RV { + (self + .C_Encrypt + .as_ref() + .expect("Expected function, got error."))( + session, + data, + data_len, + encrypted_data, + encrypted_data_len, + ) + } + 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, + ) -> CK_RV { + (self + .C_EncryptUpdate + .as_ref() + .expect("Expected function, got error."))( + session, + part, + part_len, + encrypted_part, + encrypted_part_len, + ) + } + 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, + ) -> CK_RV { + (self + .C_EncryptFinal + .as_ref() + .expect("Expected function, got error."))( + session, + last_encrypted_part, + last_encrypted_part_len, + ) + } + pub unsafe fn C_DecryptInit( + &self, + session: CK_SESSION_HANDLE, + mechanism: *mut _CK_MECHANISM, + key: CK_OBJECT_HANDLE, + ) -> CK_RV { + (self + .C_DecryptInit + .as_ref() + .expect("Expected function, got error."))(session, mechanism, key) + } + 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, + ) -> CK_RV { + (self + .C_Decrypt + .as_ref() + .expect("Expected function, got error."))( + session, + encrypted_data, + encrypted_data_len, + data, + data_len, + ) + } + 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, + ) -> CK_RV { + (self + .C_DecryptUpdate + .as_ref() + .expect("Expected function, got error."))( + session, + encrypted_part, + encrypted_part_len, + part, + part_len, + ) + } + 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, + ) -> CK_RV { + (self + .C_DecryptFinal + .as_ref() + .expect("Expected function, got error."))(session, last_part, last_part_len) + } + pub unsafe fn C_DigestInit( + &self, + session: CK_SESSION_HANDLE, + mechanism: *mut _CK_MECHANISM, + ) -> CK_RV { + (self + .C_DigestInit + .as_ref() + .expect("Expected function, got error."))(session, mechanism) + } + 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, + ) -> CK_RV { + (self + .C_Digest + .as_ref() + .expect("Expected function, got error."))( + session, data, data_len, digest, digest_len + ) + } + pub unsafe fn C_DigestUpdate( + &self, + session: CK_SESSION_HANDLE, + part: *mut ::std::os::raw::c_uchar, + part_len: ::std::os::raw::c_ulong, + ) -> CK_RV { + (self + .C_DigestUpdate + .as_ref() + .expect("Expected function, got error."))(session, part, part_len) + } + pub unsafe fn C_DigestKey(&self, session: CK_SESSION_HANDLE, key: CK_OBJECT_HANDLE) -> CK_RV { + (self + .C_DigestKey + .as_ref() + .expect("Expected function, got error."))(session, key) + } + 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, + ) -> CK_RV { + (self + .C_DigestFinal + .as_ref() + .expect("Expected function, got error."))(session, digest, digest_len) + } + pub unsafe fn C_SignInit( + &self, + session: CK_SESSION_HANDLE, + mechanism: *mut _CK_MECHANISM, + key: CK_OBJECT_HANDLE, + ) -> CK_RV { + (self + .C_SignInit + .as_ref() + .expect("Expected function, got error."))(session, mechanism, key) + } + 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, + ) -> CK_RV { + (self.C_Sign.as_ref().expect("Expected function, got error."))( + session, + data, + data_len, + signature, + signature_len, + ) + } + pub unsafe fn C_SignUpdate( + &self, + session: CK_SESSION_HANDLE, + part: *mut ::std::os::raw::c_uchar, + part_len: ::std::os::raw::c_ulong, + ) -> CK_RV { + (self + .C_SignUpdate + .as_ref() + .expect("Expected function, got error."))(session, part, part_len) + } + 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, + ) -> CK_RV { + (self + .C_SignFinal + .as_ref() + .expect("Expected function, got error."))(session, signature, signature_len) + } + pub unsafe fn C_SignRecoverInit( + &self, + session: CK_SESSION_HANDLE, + mechanism: *mut _CK_MECHANISM, + key: CK_OBJECT_HANDLE, + ) -> CK_RV { + (self + .C_SignRecoverInit + .as_ref() + .expect("Expected function, got error."))(session, mechanism, key) + } + 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, + ) -> CK_RV { + (self + .C_SignRecover + .as_ref() + .expect("Expected function, got error."))( + session, + data, + data_len, + signature, + signature_len, + ) + } + pub unsafe fn C_VerifyInit( + &self, + session: CK_SESSION_HANDLE, + mechanism: *mut _CK_MECHANISM, + key: CK_OBJECT_HANDLE, + ) -> CK_RV { + (self + .C_VerifyInit + .as_ref() + .expect("Expected function, got error."))(session, mechanism, key) + } + 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, + ) -> CK_RV { + (self + .C_Verify + .as_ref() + .expect("Expected function, got error."))( + session, + data, + data_len, + signature, + signature_len, + ) + } + pub unsafe fn C_VerifyUpdate( + &self, + session: CK_SESSION_HANDLE, + part: *mut ::std::os::raw::c_uchar, + part_len: ::std::os::raw::c_ulong, + ) -> CK_RV { + (self + .C_VerifyUpdate + .as_ref() + .expect("Expected function, got error."))(session, part, part_len) + } + pub unsafe fn C_VerifyFinal( + &self, + session: CK_SESSION_HANDLE, + signature: *mut ::std::os::raw::c_uchar, + signature_len: ::std::os::raw::c_ulong, + ) -> CK_RV { + (self + .C_VerifyFinal + .as_ref() + .expect("Expected function, got error."))(session, signature, signature_len) + } + pub unsafe fn C_VerifyRecoverInit( + &self, + session: CK_SESSION_HANDLE, + mechanism: *mut _CK_MECHANISM, + key: CK_OBJECT_HANDLE, + ) -> CK_RV { + (self + .C_VerifyRecoverInit + .as_ref() + .expect("Expected function, got error."))(session, mechanism, key) + } + 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, + ) -> CK_RV { + (self + .C_VerifyRecover + .as_ref() + .expect("Expected function, got error."))( + session, + signature, + signature_len, + data, + data_len, + ) + } + 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, + ) -> CK_RV { + (self + .C_DigestEncryptUpdate + .as_ref() + .expect("Expected function, got error."))( + session, + part, + part_len, + encrypted_part, + encrypted_part_len, + ) + } + 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, + ) -> CK_RV { + (self + .C_DecryptDigestUpdate + .as_ref() + .expect("Expected function, got error."))( + session, + encrypted_part, + encrypted_part_len, + part, + part_len, + ) + } + 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, + ) -> CK_RV { + (self + .C_SignEncryptUpdate + .as_ref() + .expect("Expected function, got error."))( + session, + part, + part_len, + encrypted_part, + encrypted_part_len, + ) + } + 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, + ) -> CK_RV { + (self + .C_DecryptVerifyUpdate + .as_ref() + .expect("Expected function, got error."))( + session, + encrypted_part, + encrypted_part_len, + part, + part_len, + ) + } + 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, + ) -> CK_RV { + (self + .C_GenerateKey + .as_ref() + .expect("Expected function, got error."))( + session, mechanism, templ, ulCount, key + ) + } + 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, + ) -> 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, + ) + } + 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, + ) -> CK_RV { + (self + .C_WrapKey + .as_ref() + .expect("Expected function, got error."))( + session, + mechanism, + wrapping_key, + key, + wrapped_key, + wrapped_key_len, + ) + } + 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, + ) -> 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, + ) + } + 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, + ) -> CK_RV { + (self + .C_DeriveKey + .as_ref() + .expect("Expected function, got error."))( + session, + mechanism, + base_key, + templ, + attribute_count, + key, + ) + } + pub unsafe fn C_SeedRandom( + &self, + session: CK_SESSION_HANDLE, + seed: *mut ::std::os::raw::c_uchar, + seed_len: ::std::os::raw::c_ulong, + ) -> CK_RV { + (self + .C_SeedRandom + .as_ref() + .expect("Expected function, got error."))(session, seed, seed_len) + } + 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, + ) -> CK_RV { + (self + .C_GenerateRandom + .as_ref() + .expect("Expected function, got error."))(session, random_data, random_len) + } + pub unsafe fn C_GetFunctionStatus(&self, session: CK_SESSION_HANDLE) -> CK_RV { + (self + .C_GetFunctionStatus + .as_ref() + .expect("Expected function, got error."))(session) + } + pub unsafe fn C_CancelFunction(&self, session: CK_SESSION_HANDLE) -> CK_RV { + (self + .C_CancelFunction + .as_ref() + .expect("Expected function, got error."))(session) + } } diff --git a/cryptoki-sys/src/bindings/powerpc64-unknown-linux-gnu.rs b/cryptoki-sys/src/bindings/powerpc64-unknown-linux-gnu.rs index e8699a8b..6800365c 100644 --- a/cryptoki-sys/src/bindings/powerpc64-unknown-linux-gnu.rs +++ b/cryptoki-sys/src/bindings/powerpc64-unknown-linux-gnu.rs @@ -1,5 +1,691 @@ -/* automatically generated by rust-bindgen 0.59.2 */ +/* 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 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 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; +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 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 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_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_EC_EDWARDS: CK_KEY_TYPE = 64; +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 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_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_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_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_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; +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 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_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_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_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_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_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_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_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_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_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_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_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_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_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 CKF_HW: CK_FLAGS = 1; +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_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 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_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_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 = 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_FUNCTION_REJECTED: CK_RV = 512; +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; #[repr(C)] #[derive(Debug, Default, Copy, Clone)] @@ -9,6 +695,8 @@ pub struct _CK_VERSION { } #[test] fn bindgen_test_layout__CK_VERSION() { + const UNINIT: ::std::mem::MaybeUninit<_CK_VERSION> = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<_CK_VERSION>(), 2usize, @@ -20,7 +708,7 @@ fn bindgen_test_layout__CK_VERSION() { concat!("Alignment of ", stringify!(_CK_VERSION)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_VERSION>())).major as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).major) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -30,7 +718,7 @@ fn bindgen_test_layout__CK_VERSION() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_VERSION>())).minor as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).minor) as usize - ptr as usize }, 1usize, concat!( "Offset of field: ", @@ -51,6 +739,8 @@ pub struct _CK_INFO { } #[test] fn bindgen_test_layout__CK_INFO() { + const UNINIT: ::std::mem::MaybeUninit<_CK_INFO> = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<_CK_INFO>(), 88usize, @@ -62,7 +752,7 @@ fn bindgen_test_layout__CK_INFO() { concat!("Alignment of ", stringify!(_CK_INFO)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_INFO>())).cryptokiVersion as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).cryptokiVersion) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -72,7 +762,7 @@ fn bindgen_test_layout__CK_INFO() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_INFO>())).manufacturerID as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).manufacturerID) as usize - ptr as usize }, 2usize, concat!( "Offset of field: ", @@ -82,7 +772,7 @@ fn bindgen_test_layout__CK_INFO() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_INFO>())).flags as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).flags) as usize - ptr as usize }, 40usize, concat!( "Offset of field: ", @@ -92,7 +782,7 @@ fn bindgen_test_layout__CK_INFO() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_INFO>())).libraryDescription as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).libraryDescription) as usize - ptr as usize }, 48usize, concat!( "Offset of field: ", @@ -102,7 +792,7 @@ fn bindgen_test_layout__CK_INFO() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_INFO>())).libraryVersion as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).libraryVersion) as usize - ptr as usize }, 80usize, concat!( "Offset of field: ", @@ -113,6 +803,7 @@ fn bindgen_test_layout__CK_INFO() { ); } 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; #[repr(C)] #[derive(Debug, Copy, Clone)] @@ -125,6 +816,8 @@ pub struct _CK_SLOT_INFO { } #[test] fn bindgen_test_layout__CK_SLOT_INFO() { + const UNINIT: ::std::mem::MaybeUninit<_CK_SLOT_INFO> = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<_CK_SLOT_INFO>(), 112usize, @@ -136,7 +829,7 @@ fn bindgen_test_layout__CK_SLOT_INFO() { concat!("Alignment of ", stringify!(_CK_SLOT_INFO)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_SLOT_INFO>())).slotDescription as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).slotDescription) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -146,7 +839,7 @@ fn bindgen_test_layout__CK_SLOT_INFO() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_SLOT_INFO>())).manufacturerID as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).manufacturerID) as usize - ptr as usize }, 64usize, concat!( "Offset of field: ", @@ -156,7 +849,7 @@ fn bindgen_test_layout__CK_SLOT_INFO() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_SLOT_INFO>())).flags as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).flags) as usize - ptr as usize }, 96usize, concat!( "Offset of field: ", @@ -166,7 +859,7 @@ fn bindgen_test_layout__CK_SLOT_INFO() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_SLOT_INFO>())).hardwareVersion as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).hardwareVersion) as usize - ptr as usize }, 104usize, concat!( "Offset of field: ", @@ -176,7 +869,7 @@ fn bindgen_test_layout__CK_SLOT_INFO() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_SLOT_INFO>())).firmwareVersion as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).firmwareVersion) as usize - ptr as usize }, 106usize, concat!( "Offset of field: ", @@ -195,6 +888,10 @@ 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; #[repr(C)] #[derive(Debug, Default, Copy, Clone)] pub struct _CK_TOKEN_INFO { @@ -219,6 +916,8 @@ pub struct _CK_TOKEN_INFO { } #[test] fn bindgen_test_layout__CK_TOKEN_INFO() { + const UNINIT: ::std::mem::MaybeUninit<_CK_TOKEN_INFO> = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<_CK_TOKEN_INFO>(), 208usize, @@ -230,7 +929,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { concat!("Alignment of ", stringify!(_CK_TOKEN_INFO)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_TOKEN_INFO>())).label as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).label) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -240,7 +939,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_TOKEN_INFO>())).manufacturerID as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).manufacturerID) as usize - ptr as usize }, 32usize, concat!( "Offset of field: ", @@ -250,7 +949,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_TOKEN_INFO>())).model as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).model) as usize - ptr as usize }, 64usize, concat!( "Offset of field: ", @@ -260,7 +959,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_TOKEN_INFO>())).serialNumber as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).serialNumber) as usize - ptr as usize }, 80usize, concat!( "Offset of field: ", @@ -270,7 +969,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_TOKEN_INFO>())).flags as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).flags) as usize - ptr as usize }, 96usize, concat!( "Offset of field: ", @@ -280,9 +979,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_TOKEN_INFO>())).ulMaxSessionCount as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).ulMaxSessionCount) as usize - ptr as usize }, 104usize, concat!( "Offset of field: ", @@ -292,7 +989,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_TOKEN_INFO>())).ulSessionCount as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ulSessionCount) as usize - ptr as usize }, 112usize, concat!( "Offset of field: ", @@ -302,9 +999,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_TOKEN_INFO>())).ulMaxRwSessionCount as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).ulMaxRwSessionCount) as usize - ptr as usize }, 120usize, concat!( "Offset of field: ", @@ -314,7 +1009,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_TOKEN_INFO>())).ulRwSessionCount as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ulRwSessionCount) as usize - ptr as usize }, 128usize, concat!( "Offset of field: ", @@ -324,7 +1019,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_TOKEN_INFO>())).ulMaxPinLen as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ulMaxPinLen) as usize - ptr as usize }, 136usize, concat!( "Offset of field: ", @@ -334,7 +1029,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_TOKEN_INFO>())).ulMinPinLen as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ulMinPinLen) as usize - ptr as usize }, 144usize, concat!( "Offset of field: ", @@ -344,9 +1039,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_TOKEN_INFO>())).ulTotalPublicMemory as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).ulTotalPublicMemory) as usize - ptr as usize }, 152usize, concat!( "Offset of field: ", @@ -356,9 +1049,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_TOKEN_INFO>())).ulFreePublicMemory as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).ulFreePublicMemory) as usize - ptr as usize }, 160usize, concat!( "Offset of field: ", @@ -368,9 +1059,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_TOKEN_INFO>())).ulTotalPrivateMemory as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).ulTotalPrivateMemory) as usize - ptr as usize }, 168usize, concat!( "Offset of field: ", @@ -380,9 +1069,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_TOKEN_INFO>())).ulFreePrivateMemory as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).ulFreePrivateMemory) as usize - ptr as usize }, 176usize, concat!( "Offset of field: ", @@ -392,7 +1079,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_TOKEN_INFO>())).hardwareVersion as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).hardwareVersion) as usize - ptr as usize }, 184usize, concat!( "Offset of field: ", @@ -402,7 +1089,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_TOKEN_INFO>())).firmwareVersion as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).firmwareVersion) as usize - ptr as usize }, 186usize, concat!( "Offset of field: ", @@ -412,7 +1099,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_TOKEN_INFO>())).utcTime as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).utcTime) as usize - ptr as usize }, 188usize, concat!( "Offset of field: ", @@ -435,6 +1122,8 @@ pub struct _CK_SESSION_INFO { } #[test] fn bindgen_test_layout__CK_SESSION_INFO() { + const UNINIT: ::std::mem::MaybeUninit<_CK_SESSION_INFO> = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<_CK_SESSION_INFO>(), 32usize, @@ -446,7 +1135,7 @@ fn bindgen_test_layout__CK_SESSION_INFO() { concat!("Alignment of ", stringify!(_CK_SESSION_INFO)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_SESSION_INFO>())).slotID as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).slotID) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -456,7 +1145,7 @@ fn bindgen_test_layout__CK_SESSION_INFO() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_SESSION_INFO>())).state as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).state) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -466,7 +1155,7 @@ fn bindgen_test_layout__CK_SESSION_INFO() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_SESSION_INFO>())).flags as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).flags) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", @@ -476,7 +1165,7 @@ fn bindgen_test_layout__CK_SESSION_INFO() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_SESSION_INFO>())).ulDeviceError as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ulDeviceError) as usize - ptr as usize }, 24usize, concat!( "Offset of field: ", @@ -501,6 +1190,8 @@ pub struct _CK_ATTRIBUTE { } #[test] fn bindgen_test_layout__CK_ATTRIBUTE() { + const UNINIT: ::std::mem::MaybeUninit<_CK_ATTRIBUTE> = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<_CK_ATTRIBUTE>(), 24usize, @@ -512,7 +1203,7 @@ fn bindgen_test_layout__CK_ATTRIBUTE() { concat!("Alignment of ", stringify!(_CK_ATTRIBUTE)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_ATTRIBUTE>())).type_ as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).type_) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -522,7 +1213,7 @@ fn bindgen_test_layout__CK_ATTRIBUTE() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_ATTRIBUTE>())).pValue as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).pValue) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -532,7 +1223,7 @@ fn bindgen_test_layout__CK_ATTRIBUTE() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_ATTRIBUTE>())).ulValueLen as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ulValueLen) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", @@ -560,6 +1251,8 @@ pub struct _CK_DATE { } #[test] fn bindgen_test_layout__CK_DATE() { + const UNINIT: ::std::mem::MaybeUninit<_CK_DATE> = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<_CK_DATE>(), 8usize, @@ -571,7 +1264,7 @@ fn bindgen_test_layout__CK_DATE() { concat!("Alignment of ", stringify!(_CK_DATE)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_DATE>())).year as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).year) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -581,7 +1274,7 @@ fn bindgen_test_layout__CK_DATE() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_DATE>())).month as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).month) as usize - ptr as usize }, 4usize, concat!( "Offset of field: ", @@ -591,7 +1284,7 @@ fn bindgen_test_layout__CK_DATE() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_DATE>())).day as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).day) as usize - ptr as usize }, 6usize, concat!( "Offset of field: ", @@ -611,6 +1304,8 @@ pub struct _CK_MECHANISM { } #[test] fn bindgen_test_layout__CK_MECHANISM() { + const UNINIT: ::std::mem::MaybeUninit<_CK_MECHANISM> = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<_CK_MECHANISM>(), 24usize, @@ -622,7 +1317,7 @@ fn bindgen_test_layout__CK_MECHANISM() { concat!("Alignment of ", stringify!(_CK_MECHANISM)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_MECHANISM>())).mechanism as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).mechanism) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -632,7 +1327,7 @@ fn bindgen_test_layout__CK_MECHANISM() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_MECHANISM>())).pParameter as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).pParameter) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -642,7 +1337,7 @@ fn bindgen_test_layout__CK_MECHANISM() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_MECHANISM>())).ulParameterLen as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ulParameterLen) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", @@ -670,6 +1365,8 @@ pub struct _CK_MECHANISM_INFO { } #[test] fn bindgen_test_layout__CK_MECHANISM_INFO() { + const UNINIT: ::std::mem::MaybeUninit<_CK_MECHANISM_INFO> = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<_CK_MECHANISM_INFO>(), 24usize, @@ -681,7 +1378,7 @@ fn bindgen_test_layout__CK_MECHANISM_INFO() { concat!("Alignment of ", stringify!(_CK_MECHANISM_INFO)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_MECHANISM_INFO>())).ulMinKeySize as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ulMinKeySize) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -691,7 +1388,7 @@ fn bindgen_test_layout__CK_MECHANISM_INFO() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_MECHANISM_INFO>())).ulMaxKeySize as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ulMaxKeySize) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -701,7 +1398,7 @@ fn bindgen_test_layout__CK_MECHANISM_INFO() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_MECHANISM_INFO>())).flags as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).flags) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", @@ -721,6 +1418,8 @@ pub struct CK_OTP_PARAM { } #[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, @@ -732,7 +1431,7 @@ fn bindgen_test_layout_CK_OTP_PARAM() { concat!("Alignment of ", stringify!(CK_OTP_PARAM)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).type_ as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).type_) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -742,7 +1441,7 @@ fn bindgen_test_layout_CK_OTP_PARAM() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).pValue as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).pValue) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -752,7 +1451,7 @@ fn bindgen_test_layout_CK_OTP_PARAM() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).ulValueLen as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ulValueLen) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", @@ -779,6 +1478,8 @@ pub struct CK_OTP_PARAMS { } #[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, @@ -790,7 +1491,7 @@ fn bindgen_test_layout_CK_OTP_PARAMS() { concat!("Alignment of ", stringify!(CK_OTP_PARAMS)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).pParams as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).pParams) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -800,7 +1501,7 @@ fn bindgen_test_layout_CK_OTP_PARAMS() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).ulCount as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ulCount) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -827,6 +1528,9 @@ pub struct CK_OTP_SIGNATURE_INFO { } #[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, @@ -838,7 +1542,7 @@ fn bindgen_test_layout_CK_OTP_SIGNATURE_INFO() { concat!("Alignment of ", stringify!(CK_OTP_SIGNATURE_INFO)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).pParams as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).pParams) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -848,7 +1552,7 @@ fn bindgen_test_layout_CK_OTP_SIGNATURE_INFO() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).ulCount as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ulCount) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -877,6 +1581,9 @@ pub struct ck_rsa_pkcs_pss_params { } #[test] fn bindgen_test_layout_ck_rsa_pkcs_pss_params() { + const UNINIT: ::std::mem::MaybeUninit = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), 24usize, @@ -888,7 +1595,7 @@ fn bindgen_test_layout_ck_rsa_pkcs_pss_params() { concat!("Alignment of ", stringify!(ck_rsa_pkcs_pss_params)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).hashAlg as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).hashAlg) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -898,7 +1605,7 @@ fn bindgen_test_layout_ck_rsa_pkcs_pss_params() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).mgf as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).mgf) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -908,7 +1615,7 @@ fn bindgen_test_layout_ck_rsa_pkcs_pss_params() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).sLen as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).sLen) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", @@ -930,6 +1637,9 @@ pub struct ck_rsa_pkcs_oaep_params { } #[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, @@ -941,7 +1651,7 @@ fn bindgen_test_layout_ck_rsa_pkcs_oaep_params() { concat!("Alignment of ", stringify!(ck_rsa_pkcs_oaep_params)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).hashAlg as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).hashAlg) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -951,7 +1661,7 @@ fn bindgen_test_layout_ck_rsa_pkcs_oaep_params() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).mgf as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).mgf) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -961,7 +1671,7 @@ fn bindgen_test_layout_ck_rsa_pkcs_oaep_params() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).source as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).source) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", @@ -971,9 +1681,7 @@ fn bindgen_test_layout_ck_rsa_pkcs_oaep_params() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).pSourceData as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).pSourceData) as usize - ptr as usize }, 24usize, concat!( "Offset of field: ", @@ -983,9 +1691,7 @@ fn bindgen_test_layout_ck_rsa_pkcs_oaep_params() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).ulSourceDataLen as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).ulSourceDataLen) as usize - ptr as usize }, 32usize, concat!( "Offset of field: ", @@ -1012,6 +1718,8 @@ pub struct ck_aes_ctr_params { } #[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, @@ -1023,7 +1731,7 @@ fn bindgen_test_layout_ck_aes_ctr_params() { concat!("Alignment of ", stringify!(ck_aes_ctr_params)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).ulCounterBits as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ulCounterBits) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -1033,7 +1741,7 @@ fn bindgen_test_layout_ck_aes_ctr_params() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).cb as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).cb) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -1055,6 +1763,8 @@ pub struct ck_gcm_params { } #[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, @@ -1066,7 +1776,7 @@ fn bindgen_test_layout_ck_gcm_params() { concat!("Alignment of ", stringify!(ck_gcm_params)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).pIv as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).pIv) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -1076,7 +1786,7 @@ fn bindgen_test_layout_ck_gcm_params() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).ulIvLen as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ulIvLen) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -1086,7 +1796,7 @@ fn bindgen_test_layout_ck_gcm_params() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).ulIvBits as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ulIvBits) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", @@ -1096,7 +1806,7 @@ fn bindgen_test_layout_ck_gcm_params() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).pAAD as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).pAAD) as usize - ptr as usize }, 24usize, concat!( "Offset of field: ", @@ -1106,7 +1816,7 @@ fn bindgen_test_layout_ck_gcm_params() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).ulAADLen as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ulAADLen) as usize - ptr as usize }, 32usize, concat!( "Offset of field: ", @@ -1116,7 +1826,7 @@ fn bindgen_test_layout_ck_gcm_params() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).ulTagBits as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ulTagBits) as usize - ptr as usize }, 40usize, concat!( "Offset of field: ", @@ -1147,6 +1857,9 @@ pub struct ck_ecdh1_derive_params { } #[test] fn bindgen_test_layout_ck_ecdh1_derive_params() { + const UNINIT: ::std::mem::MaybeUninit = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), 40usize, @@ -1158,7 +1871,7 @@ fn bindgen_test_layout_ck_ecdh1_derive_params() { concat!("Alignment of ", stringify!(ck_ecdh1_derive_params)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).kdf as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).kdf) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -1168,9 +1881,7 @@ fn bindgen_test_layout_ck_ecdh1_derive_params() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).ulSharedDataLen as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).ulSharedDataLen) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -1180,9 +1891,7 @@ fn bindgen_test_layout_ck_ecdh1_derive_params() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).pSharedData as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).pSharedData) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", @@ -1192,9 +1901,7 @@ fn bindgen_test_layout_ck_ecdh1_derive_params() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).ulPublicDataLen as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).ulPublicDataLen) as usize - ptr as usize }, 24usize, concat!( "Offset of field: ", @@ -1204,9 +1911,7 @@ fn bindgen_test_layout_ck_ecdh1_derive_params() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).pPublicData as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).pPublicData) as usize - ptr as usize }, 32usize, concat!( "Offset of field: ", @@ -1233,6 +1938,9 @@ pub struct ck_key_derivation_string_data { } #[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, @@ -1244,9 +1952,7 @@ fn bindgen_test_layout_ck_key_derivation_string_data() { concat!("Alignment of ", stringify!(ck_key_derivation_string_data)) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).pData as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).pData) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -1256,9 +1962,7 @@ fn bindgen_test_layout_ck_key_derivation_string_data() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).ulLen as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).ulLen) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -1286,6 +1990,9 @@ pub struct ck_des_cbc_encrypt_data_params { } #[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, @@ -1297,9 +2004,7 @@ fn bindgen_test_layout_ck_des_cbc_encrypt_data_params() { concat!("Alignment of ", stringify!(ck_des_cbc_encrypt_data_params)) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).iv as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).iv) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -1309,9 +2014,7 @@ fn bindgen_test_layout_ck_des_cbc_encrypt_data_params() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).pData as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).pData) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -1321,9 +2024,7 @@ fn bindgen_test_layout_ck_des_cbc_encrypt_data_params() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).length as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).length) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", @@ -1351,6 +2052,9 @@ pub struct ck_aes_cbc_encrypt_data_params { } #[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, @@ -1362,9 +2066,7 @@ fn bindgen_test_layout_ck_aes_cbc_encrypt_data_params() { concat!("Alignment of ", stringify!(ck_aes_cbc_encrypt_data_params)) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).iv as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).iv) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -1374,9 +2076,7 @@ fn bindgen_test_layout_ck_aes_cbc_encrypt_data_params() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).pData as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).pData) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", @@ -1386,9 +2086,7 @@ fn bindgen_test_layout_ck_aes_cbc_encrypt_data_params() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).length as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).length) as usize - ptr as usize }, 24usize, concat!( "Offset of field: ", @@ -1950,6 +2648,8 @@ pub struct _CK_FUNCTION_LIST { } #[test] fn bindgen_test_layout__CK_FUNCTION_LIST() { + const UNINIT: ::std::mem::MaybeUninit<_CK_FUNCTION_LIST> = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<_CK_FUNCTION_LIST>(), 552usize, @@ -1961,7 +2661,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { concat!("Alignment of ", stringify!(_CK_FUNCTION_LIST)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).version as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).version) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -1971,7 +2671,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_Initialize as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_Initialize) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -1981,7 +2681,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_Finalize as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_Finalize) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", @@ -1991,7 +2691,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_GetInfo as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_GetInfo) as usize - ptr as usize }, 24usize, concat!( "Offset of field: ", @@ -2001,9 +2701,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_GetFunctionList as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_GetFunctionList) as usize - ptr as usize }, 32usize, concat!( "Offset of field: ", @@ -2013,7 +2711,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_GetSlotList as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_GetSlotList) as usize - ptr as usize }, 40usize, concat!( "Offset of field: ", @@ -2023,7 +2721,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_GetSlotInfo as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_GetSlotInfo) as usize - ptr as usize }, 48usize, concat!( "Offset of field: ", @@ -2033,9 +2731,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_GetTokenInfo as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_GetTokenInfo) as usize - ptr as usize }, 56usize, concat!( "Offset of field: ", @@ -2045,9 +2741,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_GetMechanismList as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_GetMechanismList) as usize - ptr as usize }, 64usize, concat!( "Offset of field: ", @@ -2057,9 +2751,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_GetMechanismInfo as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_GetMechanismInfo) as usize - ptr as usize }, 72usize, concat!( "Offset of field: ", @@ -2069,7 +2761,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_InitToken as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_InitToken) as usize - ptr as usize }, 80usize, concat!( "Offset of field: ", @@ -2079,7 +2771,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_InitPIN as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_InitPIN) as usize - ptr as usize }, 88usize, concat!( "Offset of field: ", @@ -2089,7 +2781,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_SetPIN as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_SetPIN) as usize - ptr as usize }, 96usize, concat!( "Offset of field: ", @@ -2099,7 +2791,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_OpenSession as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_OpenSession) as usize - ptr as usize }, 104usize, concat!( "Offset of field: ", @@ -2109,9 +2801,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_CloseSession as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_CloseSession) as usize - ptr as usize }, 112usize, concat!( "Offset of field: ", @@ -2121,9 +2811,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_CloseAllSessions as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_CloseAllSessions) as usize - ptr as usize }, 120usize, concat!( "Offset of field: ", @@ -2133,9 +2821,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_GetSessionInfo as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_GetSessionInfo) as usize - ptr as usize }, 128usize, concat!( "Offset of field: ", @@ -2145,9 +2831,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_GetOperationState as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_GetOperationState) as usize - ptr as usize }, 136usize, concat!( "Offset of field: ", @@ -2157,9 +2841,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_SetOperationState as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_SetOperationState) as usize - ptr as usize }, 144usize, concat!( "Offset of field: ", @@ -2169,7 +2851,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_Login as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_Login) as usize - ptr as usize }, 152usize, concat!( "Offset of field: ", @@ -2179,7 +2861,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_Logout as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_Logout) as usize - ptr as usize }, 160usize, concat!( "Offset of field: ", @@ -2189,9 +2871,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_CreateObject as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_CreateObject) as usize - ptr as usize }, 168usize, concat!( "Offset of field: ", @@ -2201,7 +2881,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_CopyObject as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_CopyObject) as usize - ptr as usize }, 176usize, concat!( "Offset of field: ", @@ -2211,9 +2891,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_DestroyObject as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_DestroyObject) as usize - ptr as usize }, 184usize, concat!( "Offset of field: ", @@ -2223,9 +2901,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_GetObjectSize as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_GetObjectSize) as usize - ptr as usize }, 192usize, concat!( "Offset of field: ", @@ -2235,9 +2911,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_GetAttributeValue as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_GetAttributeValue) as usize - ptr as usize }, 200usize, concat!( "Offset of field: ", @@ -2247,9 +2921,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_SetAttributeValue as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_SetAttributeValue) as usize - ptr as usize }, 208usize, concat!( "Offset of field: ", @@ -2259,9 +2931,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_FindObjectsInit as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_FindObjectsInit) as usize - ptr as usize }, 216usize, concat!( "Offset of field: ", @@ -2271,7 +2941,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_FindObjects as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_FindObjects) as usize - ptr as usize }, 224usize, concat!( "Offset of field: ", @@ -2281,9 +2951,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_FindObjectsFinal as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_FindObjectsFinal) as usize - ptr as usize }, 232usize, concat!( "Offset of field: ", @@ -2293,7 +2961,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_EncryptInit as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_EncryptInit) as usize - ptr as usize }, 240usize, concat!( "Offset of field: ", @@ -2303,7 +2971,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_Encrypt as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_Encrypt) as usize - ptr as usize }, 248usize, concat!( "Offset of field: ", @@ -2313,9 +2981,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_EncryptUpdate as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_EncryptUpdate) as usize - ptr as usize }, 256usize, concat!( "Offset of field: ", @@ -2325,9 +2991,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_EncryptFinal as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_EncryptFinal) as usize - ptr as usize }, 264usize, concat!( "Offset of field: ", @@ -2337,7 +3001,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_DecryptInit as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_DecryptInit) as usize - ptr as usize }, 272usize, concat!( "Offset of field: ", @@ -2347,7 +3011,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_Decrypt as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_Decrypt) as usize - ptr as usize }, 280usize, concat!( "Offset of field: ", @@ -2357,9 +3021,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_DecryptUpdate as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_DecryptUpdate) as usize - ptr as usize }, 288usize, concat!( "Offset of field: ", @@ -2369,9 +3031,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_DecryptFinal as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_DecryptFinal) as usize - ptr as usize }, 296usize, concat!( "Offset of field: ", @@ -2381,7 +3041,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_DigestInit as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_DigestInit) as usize - ptr as usize }, 304usize, concat!( "Offset of field: ", @@ -2391,7 +3051,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_Digest as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_Digest) as usize - ptr as usize }, 312usize, concat!( "Offset of field: ", @@ -2401,9 +3061,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_DigestUpdate as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_DigestUpdate) as usize - ptr as usize }, 320usize, concat!( "Offset of field: ", @@ -2413,7 +3071,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_DigestKey as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_DigestKey) as usize - ptr as usize }, 328usize, concat!( "Offset of field: ", @@ -2423,7 +3081,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_DigestFinal as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_DigestFinal) as usize - ptr as usize }, 336usize, concat!( "Offset of field: ", @@ -2433,7 +3091,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_SignInit as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_SignInit) as usize - ptr as usize }, 344usize, concat!( "Offset of field: ", @@ -2443,7 +3101,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_Sign as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_Sign) as usize - ptr as usize }, 352usize, concat!( "Offset of field: ", @@ -2453,7 +3111,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_SignUpdate as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_SignUpdate) as usize - ptr as usize }, 360usize, concat!( "Offset of field: ", @@ -2463,7 +3121,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_SignFinal as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_SignFinal) as usize - ptr as usize }, 368usize, concat!( "Offset of field: ", @@ -2473,9 +3131,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_SignRecoverInit as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_SignRecoverInit) as usize - ptr as usize }, 376usize, concat!( "Offset of field: ", @@ -2485,7 +3141,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_SignRecover as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_SignRecover) as usize - ptr as usize }, 384usize, concat!( "Offset of field: ", @@ -2495,7 +3151,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_VerifyInit as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_VerifyInit) as usize - ptr as usize }, 392usize, concat!( "Offset of field: ", @@ -2505,7 +3161,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_Verify as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_Verify) as usize - ptr as usize }, 400usize, concat!( "Offset of field: ", @@ -2515,9 +3171,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_VerifyUpdate as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_VerifyUpdate) as usize - ptr as usize }, 408usize, concat!( "Offset of field: ", @@ -2527,7 +3181,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_VerifyFinal as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_VerifyFinal) as usize - ptr as usize }, 416usize, concat!( "Offset of field: ", @@ -2537,9 +3191,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_VerifyRecoverInit as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_VerifyRecoverInit) as usize - ptr as usize }, 424usize, concat!( "Offset of field: ", @@ -2549,9 +3201,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_VerifyRecover as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_VerifyRecover) as usize - ptr as usize }, 432usize, concat!( "Offset of field: ", @@ -2561,9 +3211,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_DigestEncryptUpdate as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_DigestEncryptUpdate) as usize - ptr as usize }, 440usize, concat!( "Offset of field: ", @@ -2573,9 +3221,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_DecryptDigestUpdate as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_DecryptDigestUpdate) as usize - ptr as usize }, 448usize, concat!( "Offset of field: ", @@ -2585,9 +3231,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_SignEncryptUpdate as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_SignEncryptUpdate) as usize - ptr as usize }, 456usize, concat!( "Offset of field: ", @@ -2597,9 +3241,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_DecryptVerifyUpdate as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_DecryptVerifyUpdate) as usize - ptr as usize }, 464usize, concat!( "Offset of field: ", @@ -2609,7 +3251,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_GenerateKey as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_GenerateKey) as usize - ptr as usize }, 472usize, concat!( "Offset of field: ", @@ -2619,9 +3261,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_GenerateKeyPair as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_GenerateKeyPair) as usize - ptr as usize }, 480usize, concat!( "Offset of field: ", @@ -2631,7 +3271,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_WrapKey as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_WrapKey) as usize - ptr as usize }, 488usize, concat!( "Offset of field: ", @@ -2641,7 +3281,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_UnwrapKey as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_UnwrapKey) as usize - ptr as usize }, 496usize, concat!( "Offset of field: ", @@ -2651,7 +3291,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_DeriveKey as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_DeriveKey) as usize - ptr as usize }, 504usize, concat!( "Offset of field: ", @@ -2661,7 +3301,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_SeedRandom as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_SeedRandom) as usize - ptr as usize }, 512usize, concat!( "Offset of field: ", @@ -2671,9 +3311,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_GenerateRandom as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_GenerateRandom) as usize - ptr as usize }, 520usize, concat!( "Offset of field: ", @@ -2683,9 +3321,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_GetFunctionStatus as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_GetFunctionStatus) as usize - ptr as usize }, 528usize, concat!( "Offset of field: ", @@ -2695,9 +3331,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_CancelFunction as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_CancelFunction) as usize - ptr as usize }, 536usize, concat!( "Offset of field: ", @@ -2707,9 +3341,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_WaitForSlotEvent as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_WaitForSlotEvent) as usize - ptr as usize }, 544usize, concat!( "Offset of field: ", @@ -2739,6 +3371,9 @@ pub struct _CK_C_INITIALIZE_ARGS { } #[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, @@ -2750,9 +3385,7 @@ fn bindgen_test_layout__CK_C_INITIALIZE_ARGS() { concat!("Alignment of ", stringify!(_CK_C_INITIALIZE_ARGS)) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_C_INITIALIZE_ARGS>())).CreateMutex as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).CreateMutex) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -2762,9 +3395,7 @@ fn bindgen_test_layout__CK_C_INITIALIZE_ARGS() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_C_INITIALIZE_ARGS>())).DestroyMutex as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).DestroyMutex) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -2774,7 +3405,7 @@ fn bindgen_test_layout__CK_C_INITIALIZE_ARGS() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_C_INITIALIZE_ARGS>())).LockMutex as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).LockMutex) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", @@ -2784,9 +3415,7 @@ fn bindgen_test_layout__CK_C_INITIALIZE_ARGS() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_C_INITIALIZE_ARGS>())).UnlockMutex as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).UnlockMutex) as usize - ptr as usize }, 24usize, concat!( "Offset of field: ", @@ -2796,7 +3425,7 @@ fn bindgen_test_layout__CK_C_INITIALIZE_ARGS() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_C_INITIALIZE_ARGS>())).flags as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).flags) as usize - ptr as usize }, 32usize, concat!( "Offset of field: ", @@ -2806,7 +3435,7 @@ fn bindgen_test_layout__CK_C_INITIALIZE_ARGS() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_C_INITIALIZE_ARGS>())).pReserved as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).pReserved) as usize - ptr as usize }, 40usize, concat!( "Offset of field: ", @@ -2825,8 +3454,6 @@ impl Default for _CK_C_INITIALIZE_ARGS { } } } -pub type size_t = ::std::os::raw::c_ulong; -pub type wchar_t = ::std::os::raw::c_int; 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; @@ -2893,10 +3520,529 @@ pub type CK_AES_CBC_ENCRYPT_DATA_PARAMS_PTR = *mut ck_aes_cbc_encrypt_data_param 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_GetFunctionList: Result< unsafe extern "C" fn(function_list: *mut *mut _CK_FUNCTION_LIST) -> 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, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_GetSlotInfo: Result< + unsafe extern "C" fn(slotID: CK_SLOT_ID, info: *mut _CK_SLOT_INFO) -> 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, + ::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, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_GetMechanismInfo: Result< + unsafe extern "C" fn( + slotID: CK_SLOT_ID, + type_: CK_MECHANISM_TYPE, + info: *mut _CK_MECHANISM_INFO, + ) -> 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, + ) -> 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, + ) -> 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, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_OpenSession: Result< + 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, + ::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(session: CK_SESSION_HANDLE, info: *mut _CK_SESSION_INFO) -> 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, + ) -> 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, + ) -> 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, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_Logout: + 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, + ) -> 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, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_DestroyObject: Result< + unsafe extern "C" fn(session: CK_SESSION_HANDLE, object: 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, + ) -> 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, + ) -> 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, + ) -> 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, + ) -> 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, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_FindObjectsFinal: + 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, + ) -> 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, + ) -> 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, + ) -> 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, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_DecryptInit: Result< + unsafe extern "C" fn( + session: CK_SESSION_HANDLE, + mechanism: *mut _CK_MECHANISM, + key: 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, + ) -> 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, + ) -> 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, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_DigestInit: Result< + unsafe extern "C" fn(session: CK_SESSION_HANDLE, mechanism: *mut _CK_MECHANISM) -> 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, + ) -> 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, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_DigestKey: Result< + unsafe extern "C" fn(session: CK_SESSION_HANDLE, key: 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, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_SignInit: Result< + unsafe extern "C" fn( + session: CK_SESSION_HANDLE, + mechanism: *mut _CK_MECHANISM, + key: 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, + ) -> 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, + ) -> 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, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_SignRecoverInit: Result< + unsafe extern "C" fn( + session: CK_SESSION_HANDLE, + mechanism: *mut _CK_MECHANISM, + key: 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, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_VerifyInit: Result< + unsafe extern "C" fn( + session: CK_SESSION_HANDLE, + mechanism: *mut _CK_MECHANISM, + key: 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, + ) -> 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, + ) -> 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, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_VerifyRecoverInit: Result< + unsafe extern "C" fn( + session: CK_SESSION_HANDLE, + mechanism: *mut _CK_MECHANISM, + key: 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, + ) -> 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, + ) -> 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, + ) -> 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, + ) -> 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, + ) -> 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, + ) -> 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, + ) -> 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, + ) -> 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, + ) -> 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, + ) -> 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, + ) -> 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, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_GetFunctionStatus: + Result CK_RV, ::libloading::Error>, + pub C_CancelFunction: + Result CK_RV, ::libloading::Error>, } impl Pkcs11 { pub unsafe fn new

(path: P) -> Result @@ -2911,16 +4057,1010 @@ impl Pkcs11 { 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_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); + 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); Ok(Pkcs11 { __library, + C_Initialize, + C_Finalize, + C_GetInfo, C_GetFunctionList, + C_GetSlotList, + C_GetSlotInfo, + C_GetTokenInfo, + C_WaitForSlotEvent, + 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, }) } + pub unsafe fn C_Initialize(&self, init_args: *mut ::std::os::raw::c_void) -> CK_RV { + (self + .C_Initialize + .as_ref() + .expect("Expected function, got error."))(init_args) + } + pub unsafe fn C_Finalize(&self, pReserved: *mut ::std::os::raw::c_void) -> 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 { + (self + .C_GetInfo + .as_ref() + .expect("Expected function, got error."))(info) + } pub unsafe fn C_GetFunctionList(&self, function_list: *mut *mut _CK_FUNCTION_LIST) -> CK_RV { (self .C_GetFunctionList .as_ref() .expect("Expected function, got error."))(function_list) } + 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, + ) -> CK_RV { + (self + .C_GetSlotList + .as_ref() + .expect("Expected function, got error."))(token_present, slot_list, ulCount) + } + pub unsafe fn C_GetSlotInfo(&self, slotID: CK_SLOT_ID, info: *mut _CK_SLOT_INFO) -> CK_RV { + (self + .C_GetSlotInfo + .as_ref() + .expect("Expected function, got error."))(slotID, info) + } + pub unsafe fn C_GetTokenInfo(&self, slotID: CK_SLOT_ID, info: *mut _CK_TOKEN_INFO) -> 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) + } + pub unsafe fn C_GetMechanismList( + &self, + slotID: CK_SLOT_ID, + mechanism_list: *mut CK_MECHANISM_TYPE, + ulCount: *mut ::std::os::raw::c_ulong, + ) -> CK_RV { + (self + .C_GetMechanismList + .as_ref() + .expect("Expected function, got error."))(slotID, mechanism_list, ulCount) + } + pub unsafe fn C_GetMechanismInfo( + &self, + slotID: CK_SLOT_ID, + type_: CK_MECHANISM_TYPE, + info: *mut _CK_MECHANISM_INFO, + ) -> CK_RV { + (self + .C_GetMechanismInfo + .as_ref() + .expect("Expected function, got error."))(slotID, type_, info) + } + 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, + ) -> CK_RV { + (self + .C_InitToken + .as_ref() + .expect("Expected function, got error."))(slotID, pin, pin_len, label) + } + pub unsafe fn C_InitPIN( + &self, + session: CK_SESSION_HANDLE, + pin: *mut ::std::os::raw::c_uchar, + pin_len: ::std::os::raw::c_ulong, + ) -> CK_RV { + (self + .C_InitPIN + .as_ref() + .expect("Expected function, got error."))(session, pin, pin_len) + } + 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, + ) -> CK_RV { + (self + .C_SetPIN + .as_ref() + .expect("Expected function, got error."))( + session, old_pin, old_len, new_pin, new_len + ) + } + 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, + ) -> CK_RV { + (self + .C_OpenSession + .as_ref() + .expect("Expected function, got error."))( + slotID, flags, application, notify, session + ) + } + pub unsafe fn C_CloseSession(&self, session: CK_SESSION_HANDLE) -> CK_RV { + (self + .C_CloseSession + .as_ref() + .expect("Expected function, got error."))(session) + } + 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, + session: CK_SESSION_HANDLE, + info: *mut _CK_SESSION_INFO, + ) -> CK_RV { + (self + .C_GetSessionInfo + .as_ref() + .expect("Expected function, got error."))(session, info) + } + 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, + ) -> CK_RV { + (self + .C_GetOperationState + .as_ref() + .expect("Expected function, got error."))( + session, operation_state, operation_state_len + ) + } + 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, + ) -> CK_RV { + (self + .C_SetOperationState + .as_ref() + .expect("Expected function, got error."))( + session, + operation_state, + operation_state_len, + encryption_key, + authentiation_key, + ) + } + 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, + ) -> CK_RV { + (self + .C_Login + .as_ref() + .expect("Expected function, got error."))(session, user_type, pin, pin_len) + } + pub unsafe fn C_Logout(&self, session: CK_SESSION_HANDLE) -> CK_RV { + (self + .C_Logout + .as_ref() + .expect("Expected function, got error."))(session) + } + 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, + ) -> CK_RV { + (self + .C_CreateObject + .as_ref() + .expect("Expected function, got error."))(session, templ, ulCount, object) + } + 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, + ) -> CK_RV { + (self + .C_CopyObject + .as_ref() + .expect("Expected function, got error."))( + session, object, templ, ulCount, new_object + ) + } + pub unsafe fn C_DestroyObject( + &self, + session: CK_SESSION_HANDLE, + object: CK_OBJECT_HANDLE, + ) -> CK_RV { + (self + .C_DestroyObject + .as_ref() + .expect("Expected function, got error."))(session, object) + } + pub unsafe fn C_GetObjectSize( + &self, + session: CK_SESSION_HANDLE, + object: CK_OBJECT_HANDLE, + size: *mut ::std::os::raw::c_ulong, + ) -> CK_RV { + (self + .C_GetObjectSize + .as_ref() + .expect("Expected function, got error."))(session, object, size) + } + pub unsafe fn C_GetAttributeValue( + &self, + session: CK_SESSION_HANDLE, + object: CK_OBJECT_HANDLE, + templ: *mut _CK_ATTRIBUTE, + ulCount: ::std::os::raw::c_ulong, + ) -> CK_RV { + (self + .C_GetAttributeValue + .as_ref() + .expect("Expected function, got error."))(session, object, templ, 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, + ) -> CK_RV { + (self + .C_SetAttributeValue + .as_ref() + .expect("Expected function, got error."))(session, object, templ, ulCount) + } + pub unsafe fn C_FindObjectsInit( + &self, + session: CK_SESSION_HANDLE, + templ: *mut _CK_ATTRIBUTE, + ulCount: ::std::os::raw::c_ulong, + ) -> CK_RV { + (self + .C_FindObjectsInit + .as_ref() + .expect("Expected function, got error."))(session, templ, 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, + ) -> CK_RV { + (self + .C_FindObjects + .as_ref() + .expect("Expected function, got error."))( + session, + object, + max_object_count, + object_count, + ) + } + pub unsafe fn C_FindObjectsFinal(&self, session: CK_SESSION_HANDLE) -> CK_RV { + (self + .C_FindObjectsFinal + .as_ref() + .expect("Expected function, got error."))(session) + } + pub unsafe fn C_EncryptInit( + &self, + session: CK_SESSION_HANDLE, + mechanism: *mut _CK_MECHANISM, + key: CK_OBJECT_HANDLE, + ) -> CK_RV { + (self + .C_EncryptInit + .as_ref() + .expect("Expected function, got error."))(session, mechanism, key) + } + 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, + ) -> CK_RV { + (self + .C_Encrypt + .as_ref() + .expect("Expected function, got error."))( + session, + data, + data_len, + encrypted_data, + encrypted_data_len, + ) + } + 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, + ) -> CK_RV { + (self + .C_EncryptUpdate + .as_ref() + .expect("Expected function, got error."))( + session, + part, + part_len, + encrypted_part, + encrypted_part_len, + ) + } + 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, + ) -> CK_RV { + (self + .C_EncryptFinal + .as_ref() + .expect("Expected function, got error."))( + session, + last_encrypted_part, + last_encrypted_part_len, + ) + } + pub unsafe fn C_DecryptInit( + &self, + session: CK_SESSION_HANDLE, + mechanism: *mut _CK_MECHANISM, + key: CK_OBJECT_HANDLE, + ) -> CK_RV { + (self + .C_DecryptInit + .as_ref() + .expect("Expected function, got error."))(session, mechanism, key) + } + 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, + ) -> CK_RV { + (self + .C_Decrypt + .as_ref() + .expect("Expected function, got error."))( + session, + encrypted_data, + encrypted_data_len, + data, + data_len, + ) + } + 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, + ) -> CK_RV { + (self + .C_DecryptUpdate + .as_ref() + .expect("Expected function, got error."))( + session, + encrypted_part, + encrypted_part_len, + part, + part_len, + ) + } + 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, + ) -> CK_RV { + (self + .C_DecryptFinal + .as_ref() + .expect("Expected function, got error."))(session, last_part, last_part_len) + } + pub unsafe fn C_DigestInit( + &self, + session: CK_SESSION_HANDLE, + mechanism: *mut _CK_MECHANISM, + ) -> CK_RV { + (self + .C_DigestInit + .as_ref() + .expect("Expected function, got error."))(session, mechanism) + } + 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, + ) -> CK_RV { + (self + .C_Digest + .as_ref() + .expect("Expected function, got error."))( + session, data, data_len, digest, digest_len + ) + } + pub unsafe fn C_DigestUpdate( + &self, + session: CK_SESSION_HANDLE, + part: *mut ::std::os::raw::c_uchar, + part_len: ::std::os::raw::c_ulong, + ) -> CK_RV { + (self + .C_DigestUpdate + .as_ref() + .expect("Expected function, got error."))(session, part, part_len) + } + pub unsafe fn C_DigestKey(&self, session: CK_SESSION_HANDLE, key: CK_OBJECT_HANDLE) -> CK_RV { + (self + .C_DigestKey + .as_ref() + .expect("Expected function, got error."))(session, key) + } + 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, + ) -> CK_RV { + (self + .C_DigestFinal + .as_ref() + .expect("Expected function, got error."))(session, digest, digest_len) + } + pub unsafe fn C_SignInit( + &self, + session: CK_SESSION_HANDLE, + mechanism: *mut _CK_MECHANISM, + key: CK_OBJECT_HANDLE, + ) -> CK_RV { + (self + .C_SignInit + .as_ref() + .expect("Expected function, got error."))(session, mechanism, key) + } + 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, + ) -> CK_RV { + (self.C_Sign.as_ref().expect("Expected function, got error."))( + session, + data, + data_len, + signature, + signature_len, + ) + } + pub unsafe fn C_SignUpdate( + &self, + session: CK_SESSION_HANDLE, + part: *mut ::std::os::raw::c_uchar, + part_len: ::std::os::raw::c_ulong, + ) -> CK_RV { + (self + .C_SignUpdate + .as_ref() + .expect("Expected function, got error."))(session, part, part_len) + } + 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, + ) -> CK_RV { + (self + .C_SignFinal + .as_ref() + .expect("Expected function, got error."))(session, signature, signature_len) + } + pub unsafe fn C_SignRecoverInit( + &self, + session: CK_SESSION_HANDLE, + mechanism: *mut _CK_MECHANISM, + key: CK_OBJECT_HANDLE, + ) -> CK_RV { + (self + .C_SignRecoverInit + .as_ref() + .expect("Expected function, got error."))(session, mechanism, key) + } + 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, + ) -> CK_RV { + (self + .C_SignRecover + .as_ref() + .expect("Expected function, got error."))( + session, + data, + data_len, + signature, + signature_len, + ) + } + pub unsafe fn C_VerifyInit( + &self, + session: CK_SESSION_HANDLE, + mechanism: *mut _CK_MECHANISM, + key: CK_OBJECT_HANDLE, + ) -> CK_RV { + (self + .C_VerifyInit + .as_ref() + .expect("Expected function, got error."))(session, mechanism, key) + } + 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, + ) -> CK_RV { + (self + .C_Verify + .as_ref() + .expect("Expected function, got error."))( + session, + data, + data_len, + signature, + signature_len, + ) + } + pub unsafe fn C_VerifyUpdate( + &self, + session: CK_SESSION_HANDLE, + part: *mut ::std::os::raw::c_uchar, + part_len: ::std::os::raw::c_ulong, + ) -> CK_RV { + (self + .C_VerifyUpdate + .as_ref() + .expect("Expected function, got error."))(session, part, part_len) + } + pub unsafe fn C_VerifyFinal( + &self, + session: CK_SESSION_HANDLE, + signature: *mut ::std::os::raw::c_uchar, + signature_len: ::std::os::raw::c_ulong, + ) -> CK_RV { + (self + .C_VerifyFinal + .as_ref() + .expect("Expected function, got error."))(session, signature, signature_len) + } + pub unsafe fn C_VerifyRecoverInit( + &self, + session: CK_SESSION_HANDLE, + mechanism: *mut _CK_MECHANISM, + key: CK_OBJECT_HANDLE, + ) -> CK_RV { + (self + .C_VerifyRecoverInit + .as_ref() + .expect("Expected function, got error."))(session, mechanism, key) + } + 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, + ) -> CK_RV { + (self + .C_VerifyRecover + .as_ref() + .expect("Expected function, got error."))( + session, + signature, + signature_len, + data, + data_len, + ) + } + 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, + ) -> CK_RV { + (self + .C_DigestEncryptUpdate + .as_ref() + .expect("Expected function, got error."))( + session, + part, + part_len, + encrypted_part, + encrypted_part_len, + ) + } + 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, + ) -> CK_RV { + (self + .C_DecryptDigestUpdate + .as_ref() + .expect("Expected function, got error."))( + session, + encrypted_part, + encrypted_part_len, + part, + part_len, + ) + } + 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, + ) -> CK_RV { + (self + .C_SignEncryptUpdate + .as_ref() + .expect("Expected function, got error."))( + session, + part, + part_len, + encrypted_part, + encrypted_part_len, + ) + } + 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, + ) -> CK_RV { + (self + .C_DecryptVerifyUpdate + .as_ref() + .expect("Expected function, got error."))( + session, + encrypted_part, + encrypted_part_len, + part, + part_len, + ) + } + 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, + ) -> CK_RV { + (self + .C_GenerateKey + .as_ref() + .expect("Expected function, got error."))( + session, mechanism, templ, ulCount, key + ) + } + 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, + ) -> 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, + ) + } + 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, + ) -> CK_RV { + (self + .C_WrapKey + .as_ref() + .expect("Expected function, got error."))( + session, + mechanism, + wrapping_key, + key, + wrapped_key, + wrapped_key_len, + ) + } + 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, + ) -> 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, + ) + } + 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, + ) -> CK_RV { + (self + .C_DeriveKey + .as_ref() + .expect("Expected function, got error."))( + session, + mechanism, + base_key, + templ, + attribute_count, + key, + ) + } + pub unsafe fn C_SeedRandom( + &self, + session: CK_SESSION_HANDLE, + seed: *mut ::std::os::raw::c_uchar, + seed_len: ::std::os::raw::c_ulong, + ) -> CK_RV { + (self + .C_SeedRandom + .as_ref() + .expect("Expected function, got error."))(session, seed, seed_len) + } + 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, + ) -> CK_RV { + (self + .C_GenerateRandom + .as_ref() + .expect("Expected function, got error."))(session, random_data, random_len) + } + pub unsafe fn C_GetFunctionStatus(&self, session: CK_SESSION_HANDLE) -> CK_RV { + (self + .C_GetFunctionStatus + .as_ref() + .expect("Expected function, got error."))(session) + } + pub unsafe fn C_CancelFunction(&self, session: CK_SESSION_HANDLE) -> CK_RV { + (self + .C_CancelFunction + .as_ref() + .expect("Expected function, got error."))(session) + } } diff --git a/cryptoki-sys/src/bindings/x86_64-apple-darwin.rs b/cryptoki-sys/src/bindings/x86_64-apple-darwin.rs index e8699a8b..6800365c 100644 --- a/cryptoki-sys/src/bindings/x86_64-apple-darwin.rs +++ b/cryptoki-sys/src/bindings/x86_64-apple-darwin.rs @@ -1,5 +1,691 @@ -/* automatically generated by rust-bindgen 0.59.2 */ +/* 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 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 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; +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 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 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_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_EC_EDWARDS: CK_KEY_TYPE = 64; +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 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_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_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_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_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; +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 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_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_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_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_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_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_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_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_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_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_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_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_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_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 CKF_HW: CK_FLAGS = 1; +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_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 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_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_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 = 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_FUNCTION_REJECTED: CK_RV = 512; +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; #[repr(C)] #[derive(Debug, Default, Copy, Clone)] @@ -9,6 +695,8 @@ pub struct _CK_VERSION { } #[test] fn bindgen_test_layout__CK_VERSION() { + const UNINIT: ::std::mem::MaybeUninit<_CK_VERSION> = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<_CK_VERSION>(), 2usize, @@ -20,7 +708,7 @@ fn bindgen_test_layout__CK_VERSION() { concat!("Alignment of ", stringify!(_CK_VERSION)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_VERSION>())).major as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).major) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -30,7 +718,7 @@ fn bindgen_test_layout__CK_VERSION() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_VERSION>())).minor as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).minor) as usize - ptr as usize }, 1usize, concat!( "Offset of field: ", @@ -51,6 +739,8 @@ pub struct _CK_INFO { } #[test] fn bindgen_test_layout__CK_INFO() { + const UNINIT: ::std::mem::MaybeUninit<_CK_INFO> = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<_CK_INFO>(), 88usize, @@ -62,7 +752,7 @@ fn bindgen_test_layout__CK_INFO() { concat!("Alignment of ", stringify!(_CK_INFO)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_INFO>())).cryptokiVersion as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).cryptokiVersion) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -72,7 +762,7 @@ fn bindgen_test_layout__CK_INFO() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_INFO>())).manufacturerID as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).manufacturerID) as usize - ptr as usize }, 2usize, concat!( "Offset of field: ", @@ -82,7 +772,7 @@ fn bindgen_test_layout__CK_INFO() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_INFO>())).flags as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).flags) as usize - ptr as usize }, 40usize, concat!( "Offset of field: ", @@ -92,7 +782,7 @@ fn bindgen_test_layout__CK_INFO() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_INFO>())).libraryDescription as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).libraryDescription) as usize - ptr as usize }, 48usize, concat!( "Offset of field: ", @@ -102,7 +792,7 @@ fn bindgen_test_layout__CK_INFO() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_INFO>())).libraryVersion as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).libraryVersion) as usize - ptr as usize }, 80usize, concat!( "Offset of field: ", @@ -113,6 +803,7 @@ fn bindgen_test_layout__CK_INFO() { ); } 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; #[repr(C)] #[derive(Debug, Copy, Clone)] @@ -125,6 +816,8 @@ pub struct _CK_SLOT_INFO { } #[test] fn bindgen_test_layout__CK_SLOT_INFO() { + const UNINIT: ::std::mem::MaybeUninit<_CK_SLOT_INFO> = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<_CK_SLOT_INFO>(), 112usize, @@ -136,7 +829,7 @@ fn bindgen_test_layout__CK_SLOT_INFO() { concat!("Alignment of ", stringify!(_CK_SLOT_INFO)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_SLOT_INFO>())).slotDescription as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).slotDescription) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -146,7 +839,7 @@ fn bindgen_test_layout__CK_SLOT_INFO() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_SLOT_INFO>())).manufacturerID as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).manufacturerID) as usize - ptr as usize }, 64usize, concat!( "Offset of field: ", @@ -156,7 +849,7 @@ fn bindgen_test_layout__CK_SLOT_INFO() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_SLOT_INFO>())).flags as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).flags) as usize - ptr as usize }, 96usize, concat!( "Offset of field: ", @@ -166,7 +859,7 @@ fn bindgen_test_layout__CK_SLOT_INFO() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_SLOT_INFO>())).hardwareVersion as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).hardwareVersion) as usize - ptr as usize }, 104usize, concat!( "Offset of field: ", @@ -176,7 +869,7 @@ fn bindgen_test_layout__CK_SLOT_INFO() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_SLOT_INFO>())).firmwareVersion as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).firmwareVersion) as usize - ptr as usize }, 106usize, concat!( "Offset of field: ", @@ -195,6 +888,10 @@ 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; #[repr(C)] #[derive(Debug, Default, Copy, Clone)] pub struct _CK_TOKEN_INFO { @@ -219,6 +916,8 @@ pub struct _CK_TOKEN_INFO { } #[test] fn bindgen_test_layout__CK_TOKEN_INFO() { + const UNINIT: ::std::mem::MaybeUninit<_CK_TOKEN_INFO> = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<_CK_TOKEN_INFO>(), 208usize, @@ -230,7 +929,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { concat!("Alignment of ", stringify!(_CK_TOKEN_INFO)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_TOKEN_INFO>())).label as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).label) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -240,7 +939,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_TOKEN_INFO>())).manufacturerID as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).manufacturerID) as usize - ptr as usize }, 32usize, concat!( "Offset of field: ", @@ -250,7 +949,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_TOKEN_INFO>())).model as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).model) as usize - ptr as usize }, 64usize, concat!( "Offset of field: ", @@ -260,7 +959,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_TOKEN_INFO>())).serialNumber as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).serialNumber) as usize - ptr as usize }, 80usize, concat!( "Offset of field: ", @@ -270,7 +969,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_TOKEN_INFO>())).flags as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).flags) as usize - ptr as usize }, 96usize, concat!( "Offset of field: ", @@ -280,9 +979,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_TOKEN_INFO>())).ulMaxSessionCount as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).ulMaxSessionCount) as usize - ptr as usize }, 104usize, concat!( "Offset of field: ", @@ -292,7 +989,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_TOKEN_INFO>())).ulSessionCount as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ulSessionCount) as usize - ptr as usize }, 112usize, concat!( "Offset of field: ", @@ -302,9 +999,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_TOKEN_INFO>())).ulMaxRwSessionCount as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).ulMaxRwSessionCount) as usize - ptr as usize }, 120usize, concat!( "Offset of field: ", @@ -314,7 +1009,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_TOKEN_INFO>())).ulRwSessionCount as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ulRwSessionCount) as usize - ptr as usize }, 128usize, concat!( "Offset of field: ", @@ -324,7 +1019,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_TOKEN_INFO>())).ulMaxPinLen as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ulMaxPinLen) as usize - ptr as usize }, 136usize, concat!( "Offset of field: ", @@ -334,7 +1029,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_TOKEN_INFO>())).ulMinPinLen as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ulMinPinLen) as usize - ptr as usize }, 144usize, concat!( "Offset of field: ", @@ -344,9 +1039,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_TOKEN_INFO>())).ulTotalPublicMemory as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).ulTotalPublicMemory) as usize - ptr as usize }, 152usize, concat!( "Offset of field: ", @@ -356,9 +1049,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_TOKEN_INFO>())).ulFreePublicMemory as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).ulFreePublicMemory) as usize - ptr as usize }, 160usize, concat!( "Offset of field: ", @@ -368,9 +1059,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_TOKEN_INFO>())).ulTotalPrivateMemory as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).ulTotalPrivateMemory) as usize - ptr as usize }, 168usize, concat!( "Offset of field: ", @@ -380,9 +1069,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_TOKEN_INFO>())).ulFreePrivateMemory as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).ulFreePrivateMemory) as usize - ptr as usize }, 176usize, concat!( "Offset of field: ", @@ -392,7 +1079,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_TOKEN_INFO>())).hardwareVersion as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).hardwareVersion) as usize - ptr as usize }, 184usize, concat!( "Offset of field: ", @@ -402,7 +1089,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_TOKEN_INFO>())).firmwareVersion as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).firmwareVersion) as usize - ptr as usize }, 186usize, concat!( "Offset of field: ", @@ -412,7 +1099,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_TOKEN_INFO>())).utcTime as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).utcTime) as usize - ptr as usize }, 188usize, concat!( "Offset of field: ", @@ -435,6 +1122,8 @@ pub struct _CK_SESSION_INFO { } #[test] fn bindgen_test_layout__CK_SESSION_INFO() { + const UNINIT: ::std::mem::MaybeUninit<_CK_SESSION_INFO> = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<_CK_SESSION_INFO>(), 32usize, @@ -446,7 +1135,7 @@ fn bindgen_test_layout__CK_SESSION_INFO() { concat!("Alignment of ", stringify!(_CK_SESSION_INFO)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_SESSION_INFO>())).slotID as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).slotID) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -456,7 +1145,7 @@ fn bindgen_test_layout__CK_SESSION_INFO() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_SESSION_INFO>())).state as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).state) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -466,7 +1155,7 @@ fn bindgen_test_layout__CK_SESSION_INFO() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_SESSION_INFO>())).flags as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).flags) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", @@ -476,7 +1165,7 @@ fn bindgen_test_layout__CK_SESSION_INFO() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_SESSION_INFO>())).ulDeviceError as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ulDeviceError) as usize - ptr as usize }, 24usize, concat!( "Offset of field: ", @@ -501,6 +1190,8 @@ pub struct _CK_ATTRIBUTE { } #[test] fn bindgen_test_layout__CK_ATTRIBUTE() { + const UNINIT: ::std::mem::MaybeUninit<_CK_ATTRIBUTE> = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<_CK_ATTRIBUTE>(), 24usize, @@ -512,7 +1203,7 @@ fn bindgen_test_layout__CK_ATTRIBUTE() { concat!("Alignment of ", stringify!(_CK_ATTRIBUTE)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_ATTRIBUTE>())).type_ as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).type_) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -522,7 +1213,7 @@ fn bindgen_test_layout__CK_ATTRIBUTE() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_ATTRIBUTE>())).pValue as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).pValue) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -532,7 +1223,7 @@ fn bindgen_test_layout__CK_ATTRIBUTE() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_ATTRIBUTE>())).ulValueLen as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ulValueLen) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", @@ -560,6 +1251,8 @@ pub struct _CK_DATE { } #[test] fn bindgen_test_layout__CK_DATE() { + const UNINIT: ::std::mem::MaybeUninit<_CK_DATE> = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<_CK_DATE>(), 8usize, @@ -571,7 +1264,7 @@ fn bindgen_test_layout__CK_DATE() { concat!("Alignment of ", stringify!(_CK_DATE)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_DATE>())).year as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).year) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -581,7 +1274,7 @@ fn bindgen_test_layout__CK_DATE() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_DATE>())).month as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).month) as usize - ptr as usize }, 4usize, concat!( "Offset of field: ", @@ -591,7 +1284,7 @@ fn bindgen_test_layout__CK_DATE() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_DATE>())).day as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).day) as usize - ptr as usize }, 6usize, concat!( "Offset of field: ", @@ -611,6 +1304,8 @@ pub struct _CK_MECHANISM { } #[test] fn bindgen_test_layout__CK_MECHANISM() { + const UNINIT: ::std::mem::MaybeUninit<_CK_MECHANISM> = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<_CK_MECHANISM>(), 24usize, @@ -622,7 +1317,7 @@ fn bindgen_test_layout__CK_MECHANISM() { concat!("Alignment of ", stringify!(_CK_MECHANISM)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_MECHANISM>())).mechanism as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).mechanism) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -632,7 +1327,7 @@ fn bindgen_test_layout__CK_MECHANISM() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_MECHANISM>())).pParameter as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).pParameter) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -642,7 +1337,7 @@ fn bindgen_test_layout__CK_MECHANISM() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_MECHANISM>())).ulParameterLen as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ulParameterLen) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", @@ -670,6 +1365,8 @@ pub struct _CK_MECHANISM_INFO { } #[test] fn bindgen_test_layout__CK_MECHANISM_INFO() { + const UNINIT: ::std::mem::MaybeUninit<_CK_MECHANISM_INFO> = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<_CK_MECHANISM_INFO>(), 24usize, @@ -681,7 +1378,7 @@ fn bindgen_test_layout__CK_MECHANISM_INFO() { concat!("Alignment of ", stringify!(_CK_MECHANISM_INFO)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_MECHANISM_INFO>())).ulMinKeySize as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ulMinKeySize) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -691,7 +1388,7 @@ fn bindgen_test_layout__CK_MECHANISM_INFO() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_MECHANISM_INFO>())).ulMaxKeySize as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ulMaxKeySize) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -701,7 +1398,7 @@ fn bindgen_test_layout__CK_MECHANISM_INFO() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_MECHANISM_INFO>())).flags as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).flags) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", @@ -721,6 +1418,8 @@ pub struct CK_OTP_PARAM { } #[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, @@ -732,7 +1431,7 @@ fn bindgen_test_layout_CK_OTP_PARAM() { concat!("Alignment of ", stringify!(CK_OTP_PARAM)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).type_ as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).type_) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -742,7 +1441,7 @@ fn bindgen_test_layout_CK_OTP_PARAM() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).pValue as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).pValue) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -752,7 +1451,7 @@ fn bindgen_test_layout_CK_OTP_PARAM() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).ulValueLen as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ulValueLen) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", @@ -779,6 +1478,8 @@ pub struct CK_OTP_PARAMS { } #[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, @@ -790,7 +1491,7 @@ fn bindgen_test_layout_CK_OTP_PARAMS() { concat!("Alignment of ", stringify!(CK_OTP_PARAMS)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).pParams as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).pParams) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -800,7 +1501,7 @@ fn bindgen_test_layout_CK_OTP_PARAMS() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).ulCount as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ulCount) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -827,6 +1528,9 @@ pub struct CK_OTP_SIGNATURE_INFO { } #[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, @@ -838,7 +1542,7 @@ fn bindgen_test_layout_CK_OTP_SIGNATURE_INFO() { concat!("Alignment of ", stringify!(CK_OTP_SIGNATURE_INFO)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).pParams as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).pParams) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -848,7 +1552,7 @@ fn bindgen_test_layout_CK_OTP_SIGNATURE_INFO() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).ulCount as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ulCount) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -877,6 +1581,9 @@ pub struct ck_rsa_pkcs_pss_params { } #[test] fn bindgen_test_layout_ck_rsa_pkcs_pss_params() { + const UNINIT: ::std::mem::MaybeUninit = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), 24usize, @@ -888,7 +1595,7 @@ fn bindgen_test_layout_ck_rsa_pkcs_pss_params() { concat!("Alignment of ", stringify!(ck_rsa_pkcs_pss_params)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).hashAlg as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).hashAlg) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -898,7 +1605,7 @@ fn bindgen_test_layout_ck_rsa_pkcs_pss_params() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).mgf as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).mgf) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -908,7 +1615,7 @@ fn bindgen_test_layout_ck_rsa_pkcs_pss_params() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).sLen as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).sLen) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", @@ -930,6 +1637,9 @@ pub struct ck_rsa_pkcs_oaep_params { } #[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, @@ -941,7 +1651,7 @@ fn bindgen_test_layout_ck_rsa_pkcs_oaep_params() { concat!("Alignment of ", stringify!(ck_rsa_pkcs_oaep_params)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).hashAlg as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).hashAlg) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -951,7 +1661,7 @@ fn bindgen_test_layout_ck_rsa_pkcs_oaep_params() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).mgf as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).mgf) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -961,7 +1671,7 @@ fn bindgen_test_layout_ck_rsa_pkcs_oaep_params() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).source as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).source) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", @@ -971,9 +1681,7 @@ fn bindgen_test_layout_ck_rsa_pkcs_oaep_params() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).pSourceData as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).pSourceData) as usize - ptr as usize }, 24usize, concat!( "Offset of field: ", @@ -983,9 +1691,7 @@ fn bindgen_test_layout_ck_rsa_pkcs_oaep_params() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).ulSourceDataLen as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).ulSourceDataLen) as usize - ptr as usize }, 32usize, concat!( "Offset of field: ", @@ -1012,6 +1718,8 @@ pub struct ck_aes_ctr_params { } #[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, @@ -1023,7 +1731,7 @@ fn bindgen_test_layout_ck_aes_ctr_params() { concat!("Alignment of ", stringify!(ck_aes_ctr_params)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).ulCounterBits as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ulCounterBits) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -1033,7 +1741,7 @@ fn bindgen_test_layout_ck_aes_ctr_params() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).cb as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).cb) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -1055,6 +1763,8 @@ pub struct ck_gcm_params { } #[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, @@ -1066,7 +1776,7 @@ fn bindgen_test_layout_ck_gcm_params() { concat!("Alignment of ", stringify!(ck_gcm_params)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).pIv as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).pIv) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -1076,7 +1786,7 @@ fn bindgen_test_layout_ck_gcm_params() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).ulIvLen as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ulIvLen) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -1086,7 +1796,7 @@ fn bindgen_test_layout_ck_gcm_params() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).ulIvBits as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ulIvBits) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", @@ -1096,7 +1806,7 @@ fn bindgen_test_layout_ck_gcm_params() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).pAAD as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).pAAD) as usize - ptr as usize }, 24usize, concat!( "Offset of field: ", @@ -1106,7 +1816,7 @@ fn bindgen_test_layout_ck_gcm_params() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).ulAADLen as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ulAADLen) as usize - ptr as usize }, 32usize, concat!( "Offset of field: ", @@ -1116,7 +1826,7 @@ fn bindgen_test_layout_ck_gcm_params() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).ulTagBits as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ulTagBits) as usize - ptr as usize }, 40usize, concat!( "Offset of field: ", @@ -1147,6 +1857,9 @@ pub struct ck_ecdh1_derive_params { } #[test] fn bindgen_test_layout_ck_ecdh1_derive_params() { + const UNINIT: ::std::mem::MaybeUninit = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), 40usize, @@ -1158,7 +1871,7 @@ fn bindgen_test_layout_ck_ecdh1_derive_params() { concat!("Alignment of ", stringify!(ck_ecdh1_derive_params)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).kdf as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).kdf) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -1168,9 +1881,7 @@ fn bindgen_test_layout_ck_ecdh1_derive_params() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).ulSharedDataLen as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).ulSharedDataLen) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -1180,9 +1891,7 @@ fn bindgen_test_layout_ck_ecdh1_derive_params() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).pSharedData as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).pSharedData) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", @@ -1192,9 +1901,7 @@ fn bindgen_test_layout_ck_ecdh1_derive_params() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).ulPublicDataLen as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).ulPublicDataLen) as usize - ptr as usize }, 24usize, concat!( "Offset of field: ", @@ -1204,9 +1911,7 @@ fn bindgen_test_layout_ck_ecdh1_derive_params() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).pPublicData as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).pPublicData) as usize - ptr as usize }, 32usize, concat!( "Offset of field: ", @@ -1233,6 +1938,9 @@ pub struct ck_key_derivation_string_data { } #[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, @@ -1244,9 +1952,7 @@ fn bindgen_test_layout_ck_key_derivation_string_data() { concat!("Alignment of ", stringify!(ck_key_derivation_string_data)) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).pData as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).pData) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -1256,9 +1962,7 @@ fn bindgen_test_layout_ck_key_derivation_string_data() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).ulLen as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).ulLen) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -1286,6 +1990,9 @@ pub struct ck_des_cbc_encrypt_data_params { } #[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, @@ -1297,9 +2004,7 @@ fn bindgen_test_layout_ck_des_cbc_encrypt_data_params() { concat!("Alignment of ", stringify!(ck_des_cbc_encrypt_data_params)) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).iv as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).iv) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -1309,9 +2014,7 @@ fn bindgen_test_layout_ck_des_cbc_encrypt_data_params() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).pData as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).pData) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -1321,9 +2024,7 @@ fn bindgen_test_layout_ck_des_cbc_encrypt_data_params() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).length as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).length) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", @@ -1351,6 +2052,9 @@ pub struct ck_aes_cbc_encrypt_data_params { } #[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, @@ -1362,9 +2066,7 @@ fn bindgen_test_layout_ck_aes_cbc_encrypt_data_params() { concat!("Alignment of ", stringify!(ck_aes_cbc_encrypt_data_params)) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).iv as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).iv) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -1374,9 +2076,7 @@ fn bindgen_test_layout_ck_aes_cbc_encrypt_data_params() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).pData as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).pData) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", @@ -1386,9 +2086,7 @@ fn bindgen_test_layout_ck_aes_cbc_encrypt_data_params() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).length as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).length) as usize - ptr as usize }, 24usize, concat!( "Offset of field: ", @@ -1950,6 +2648,8 @@ pub struct _CK_FUNCTION_LIST { } #[test] fn bindgen_test_layout__CK_FUNCTION_LIST() { + const UNINIT: ::std::mem::MaybeUninit<_CK_FUNCTION_LIST> = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<_CK_FUNCTION_LIST>(), 552usize, @@ -1961,7 +2661,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { concat!("Alignment of ", stringify!(_CK_FUNCTION_LIST)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).version as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).version) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -1971,7 +2671,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_Initialize as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_Initialize) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -1981,7 +2681,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_Finalize as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_Finalize) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", @@ -1991,7 +2691,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_GetInfo as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_GetInfo) as usize - ptr as usize }, 24usize, concat!( "Offset of field: ", @@ -2001,9 +2701,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_GetFunctionList as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_GetFunctionList) as usize - ptr as usize }, 32usize, concat!( "Offset of field: ", @@ -2013,7 +2711,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_GetSlotList as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_GetSlotList) as usize - ptr as usize }, 40usize, concat!( "Offset of field: ", @@ -2023,7 +2721,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_GetSlotInfo as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_GetSlotInfo) as usize - ptr as usize }, 48usize, concat!( "Offset of field: ", @@ -2033,9 +2731,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_GetTokenInfo as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_GetTokenInfo) as usize - ptr as usize }, 56usize, concat!( "Offset of field: ", @@ -2045,9 +2741,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_GetMechanismList as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_GetMechanismList) as usize - ptr as usize }, 64usize, concat!( "Offset of field: ", @@ -2057,9 +2751,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_GetMechanismInfo as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_GetMechanismInfo) as usize - ptr as usize }, 72usize, concat!( "Offset of field: ", @@ -2069,7 +2761,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_InitToken as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_InitToken) as usize - ptr as usize }, 80usize, concat!( "Offset of field: ", @@ -2079,7 +2771,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_InitPIN as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_InitPIN) as usize - ptr as usize }, 88usize, concat!( "Offset of field: ", @@ -2089,7 +2781,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_SetPIN as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_SetPIN) as usize - ptr as usize }, 96usize, concat!( "Offset of field: ", @@ -2099,7 +2791,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_OpenSession as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_OpenSession) as usize - ptr as usize }, 104usize, concat!( "Offset of field: ", @@ -2109,9 +2801,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_CloseSession as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_CloseSession) as usize - ptr as usize }, 112usize, concat!( "Offset of field: ", @@ -2121,9 +2811,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_CloseAllSessions as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_CloseAllSessions) as usize - ptr as usize }, 120usize, concat!( "Offset of field: ", @@ -2133,9 +2821,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_GetSessionInfo as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_GetSessionInfo) as usize - ptr as usize }, 128usize, concat!( "Offset of field: ", @@ -2145,9 +2831,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_GetOperationState as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_GetOperationState) as usize - ptr as usize }, 136usize, concat!( "Offset of field: ", @@ -2157,9 +2841,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_SetOperationState as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_SetOperationState) as usize - ptr as usize }, 144usize, concat!( "Offset of field: ", @@ -2169,7 +2851,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_Login as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_Login) as usize - ptr as usize }, 152usize, concat!( "Offset of field: ", @@ -2179,7 +2861,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_Logout as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_Logout) as usize - ptr as usize }, 160usize, concat!( "Offset of field: ", @@ -2189,9 +2871,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_CreateObject as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_CreateObject) as usize - ptr as usize }, 168usize, concat!( "Offset of field: ", @@ -2201,7 +2881,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_CopyObject as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_CopyObject) as usize - ptr as usize }, 176usize, concat!( "Offset of field: ", @@ -2211,9 +2891,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_DestroyObject as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_DestroyObject) as usize - ptr as usize }, 184usize, concat!( "Offset of field: ", @@ -2223,9 +2901,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_GetObjectSize as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_GetObjectSize) as usize - ptr as usize }, 192usize, concat!( "Offset of field: ", @@ -2235,9 +2911,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_GetAttributeValue as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_GetAttributeValue) as usize - ptr as usize }, 200usize, concat!( "Offset of field: ", @@ -2247,9 +2921,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_SetAttributeValue as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_SetAttributeValue) as usize - ptr as usize }, 208usize, concat!( "Offset of field: ", @@ -2259,9 +2931,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_FindObjectsInit as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_FindObjectsInit) as usize - ptr as usize }, 216usize, concat!( "Offset of field: ", @@ -2271,7 +2941,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_FindObjects as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_FindObjects) as usize - ptr as usize }, 224usize, concat!( "Offset of field: ", @@ -2281,9 +2951,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_FindObjectsFinal as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_FindObjectsFinal) as usize - ptr as usize }, 232usize, concat!( "Offset of field: ", @@ -2293,7 +2961,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_EncryptInit as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_EncryptInit) as usize - ptr as usize }, 240usize, concat!( "Offset of field: ", @@ -2303,7 +2971,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_Encrypt as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_Encrypt) as usize - ptr as usize }, 248usize, concat!( "Offset of field: ", @@ -2313,9 +2981,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_EncryptUpdate as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_EncryptUpdate) as usize - ptr as usize }, 256usize, concat!( "Offset of field: ", @@ -2325,9 +2991,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_EncryptFinal as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_EncryptFinal) as usize - ptr as usize }, 264usize, concat!( "Offset of field: ", @@ -2337,7 +3001,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_DecryptInit as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_DecryptInit) as usize - ptr as usize }, 272usize, concat!( "Offset of field: ", @@ -2347,7 +3011,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_Decrypt as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_Decrypt) as usize - ptr as usize }, 280usize, concat!( "Offset of field: ", @@ -2357,9 +3021,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_DecryptUpdate as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_DecryptUpdate) as usize - ptr as usize }, 288usize, concat!( "Offset of field: ", @@ -2369,9 +3031,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_DecryptFinal as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_DecryptFinal) as usize - ptr as usize }, 296usize, concat!( "Offset of field: ", @@ -2381,7 +3041,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_DigestInit as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_DigestInit) as usize - ptr as usize }, 304usize, concat!( "Offset of field: ", @@ -2391,7 +3051,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_Digest as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_Digest) as usize - ptr as usize }, 312usize, concat!( "Offset of field: ", @@ -2401,9 +3061,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_DigestUpdate as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_DigestUpdate) as usize - ptr as usize }, 320usize, concat!( "Offset of field: ", @@ -2413,7 +3071,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_DigestKey as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_DigestKey) as usize - ptr as usize }, 328usize, concat!( "Offset of field: ", @@ -2423,7 +3081,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_DigestFinal as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_DigestFinal) as usize - ptr as usize }, 336usize, concat!( "Offset of field: ", @@ -2433,7 +3091,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_SignInit as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_SignInit) as usize - ptr as usize }, 344usize, concat!( "Offset of field: ", @@ -2443,7 +3101,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_Sign as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_Sign) as usize - ptr as usize }, 352usize, concat!( "Offset of field: ", @@ -2453,7 +3111,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_SignUpdate as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_SignUpdate) as usize - ptr as usize }, 360usize, concat!( "Offset of field: ", @@ -2463,7 +3121,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_SignFinal as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_SignFinal) as usize - ptr as usize }, 368usize, concat!( "Offset of field: ", @@ -2473,9 +3131,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_SignRecoverInit as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_SignRecoverInit) as usize - ptr as usize }, 376usize, concat!( "Offset of field: ", @@ -2485,7 +3141,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_SignRecover as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_SignRecover) as usize - ptr as usize }, 384usize, concat!( "Offset of field: ", @@ -2495,7 +3151,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_VerifyInit as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_VerifyInit) as usize - ptr as usize }, 392usize, concat!( "Offset of field: ", @@ -2505,7 +3161,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_Verify as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_Verify) as usize - ptr as usize }, 400usize, concat!( "Offset of field: ", @@ -2515,9 +3171,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_VerifyUpdate as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_VerifyUpdate) as usize - ptr as usize }, 408usize, concat!( "Offset of field: ", @@ -2527,7 +3181,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_VerifyFinal as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_VerifyFinal) as usize - ptr as usize }, 416usize, concat!( "Offset of field: ", @@ -2537,9 +3191,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_VerifyRecoverInit as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_VerifyRecoverInit) as usize - ptr as usize }, 424usize, concat!( "Offset of field: ", @@ -2549,9 +3201,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_VerifyRecover as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_VerifyRecover) as usize - ptr as usize }, 432usize, concat!( "Offset of field: ", @@ -2561,9 +3211,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_DigestEncryptUpdate as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_DigestEncryptUpdate) as usize - ptr as usize }, 440usize, concat!( "Offset of field: ", @@ -2573,9 +3221,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_DecryptDigestUpdate as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_DecryptDigestUpdate) as usize - ptr as usize }, 448usize, concat!( "Offset of field: ", @@ -2585,9 +3231,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_SignEncryptUpdate as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_SignEncryptUpdate) as usize - ptr as usize }, 456usize, concat!( "Offset of field: ", @@ -2597,9 +3241,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_DecryptVerifyUpdate as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_DecryptVerifyUpdate) as usize - ptr as usize }, 464usize, concat!( "Offset of field: ", @@ -2609,7 +3251,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_GenerateKey as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_GenerateKey) as usize - ptr as usize }, 472usize, concat!( "Offset of field: ", @@ -2619,9 +3261,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_GenerateKeyPair as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_GenerateKeyPair) as usize - ptr as usize }, 480usize, concat!( "Offset of field: ", @@ -2631,7 +3271,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_WrapKey as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_WrapKey) as usize - ptr as usize }, 488usize, concat!( "Offset of field: ", @@ -2641,7 +3281,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_UnwrapKey as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_UnwrapKey) as usize - ptr as usize }, 496usize, concat!( "Offset of field: ", @@ -2651,7 +3291,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_DeriveKey as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_DeriveKey) as usize - ptr as usize }, 504usize, concat!( "Offset of field: ", @@ -2661,7 +3301,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_SeedRandom as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_SeedRandom) as usize - ptr as usize }, 512usize, concat!( "Offset of field: ", @@ -2671,9 +3311,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_GenerateRandom as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_GenerateRandom) as usize - ptr as usize }, 520usize, concat!( "Offset of field: ", @@ -2683,9 +3321,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_GetFunctionStatus as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_GetFunctionStatus) as usize - ptr as usize }, 528usize, concat!( "Offset of field: ", @@ -2695,9 +3331,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_CancelFunction as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_CancelFunction) as usize - ptr as usize }, 536usize, concat!( "Offset of field: ", @@ -2707,9 +3341,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_WaitForSlotEvent as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_WaitForSlotEvent) as usize - ptr as usize }, 544usize, concat!( "Offset of field: ", @@ -2739,6 +3371,9 @@ pub struct _CK_C_INITIALIZE_ARGS { } #[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, @@ -2750,9 +3385,7 @@ fn bindgen_test_layout__CK_C_INITIALIZE_ARGS() { concat!("Alignment of ", stringify!(_CK_C_INITIALIZE_ARGS)) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_C_INITIALIZE_ARGS>())).CreateMutex as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).CreateMutex) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -2762,9 +3395,7 @@ fn bindgen_test_layout__CK_C_INITIALIZE_ARGS() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_C_INITIALIZE_ARGS>())).DestroyMutex as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).DestroyMutex) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -2774,7 +3405,7 @@ fn bindgen_test_layout__CK_C_INITIALIZE_ARGS() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_C_INITIALIZE_ARGS>())).LockMutex as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).LockMutex) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", @@ -2784,9 +3415,7 @@ fn bindgen_test_layout__CK_C_INITIALIZE_ARGS() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_C_INITIALIZE_ARGS>())).UnlockMutex as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).UnlockMutex) as usize - ptr as usize }, 24usize, concat!( "Offset of field: ", @@ -2796,7 +3425,7 @@ fn bindgen_test_layout__CK_C_INITIALIZE_ARGS() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_C_INITIALIZE_ARGS>())).flags as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).flags) as usize - ptr as usize }, 32usize, concat!( "Offset of field: ", @@ -2806,7 +3435,7 @@ fn bindgen_test_layout__CK_C_INITIALIZE_ARGS() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_C_INITIALIZE_ARGS>())).pReserved as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).pReserved) as usize - ptr as usize }, 40usize, concat!( "Offset of field: ", @@ -2825,8 +3454,6 @@ impl Default for _CK_C_INITIALIZE_ARGS { } } } -pub type size_t = ::std::os::raw::c_ulong; -pub type wchar_t = ::std::os::raw::c_int; 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; @@ -2893,10 +3520,529 @@ pub type CK_AES_CBC_ENCRYPT_DATA_PARAMS_PTR = *mut ck_aes_cbc_encrypt_data_param 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_GetFunctionList: Result< unsafe extern "C" fn(function_list: *mut *mut _CK_FUNCTION_LIST) -> 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, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_GetSlotInfo: Result< + unsafe extern "C" fn(slotID: CK_SLOT_ID, info: *mut _CK_SLOT_INFO) -> 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, + ::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, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_GetMechanismInfo: Result< + unsafe extern "C" fn( + slotID: CK_SLOT_ID, + type_: CK_MECHANISM_TYPE, + info: *mut _CK_MECHANISM_INFO, + ) -> 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, + ) -> 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, + ) -> 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, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_OpenSession: Result< + 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, + ::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(session: CK_SESSION_HANDLE, info: *mut _CK_SESSION_INFO) -> 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, + ) -> 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, + ) -> 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, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_Logout: + 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, + ) -> 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, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_DestroyObject: Result< + unsafe extern "C" fn(session: CK_SESSION_HANDLE, object: 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, + ) -> 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, + ) -> 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, + ) -> 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, + ) -> 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, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_FindObjectsFinal: + 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, + ) -> 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, + ) -> 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, + ) -> 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, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_DecryptInit: Result< + unsafe extern "C" fn( + session: CK_SESSION_HANDLE, + mechanism: *mut _CK_MECHANISM, + key: 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, + ) -> 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, + ) -> 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, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_DigestInit: Result< + unsafe extern "C" fn(session: CK_SESSION_HANDLE, mechanism: *mut _CK_MECHANISM) -> 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, + ) -> 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, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_DigestKey: Result< + unsafe extern "C" fn(session: CK_SESSION_HANDLE, key: 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, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_SignInit: Result< + unsafe extern "C" fn( + session: CK_SESSION_HANDLE, + mechanism: *mut _CK_MECHANISM, + key: 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, + ) -> 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, + ) -> 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, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_SignRecoverInit: Result< + unsafe extern "C" fn( + session: CK_SESSION_HANDLE, + mechanism: *mut _CK_MECHANISM, + key: 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, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_VerifyInit: Result< + unsafe extern "C" fn( + session: CK_SESSION_HANDLE, + mechanism: *mut _CK_MECHANISM, + key: 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, + ) -> 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, + ) -> 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, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_VerifyRecoverInit: Result< + unsafe extern "C" fn( + session: CK_SESSION_HANDLE, + mechanism: *mut _CK_MECHANISM, + key: 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, + ) -> 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, + ) -> 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, + ) -> 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, + ) -> 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, + ) -> 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, + ) -> 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, + ) -> 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, + ) -> 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, + ) -> 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, + ) -> 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, + ) -> 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, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_GetFunctionStatus: + Result CK_RV, ::libloading::Error>, + pub C_CancelFunction: + Result CK_RV, ::libloading::Error>, } impl Pkcs11 { pub unsafe fn new

(path: P) -> Result @@ -2911,16 +4057,1010 @@ impl Pkcs11 { 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_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); + 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); Ok(Pkcs11 { __library, + C_Initialize, + C_Finalize, + C_GetInfo, C_GetFunctionList, + C_GetSlotList, + C_GetSlotInfo, + C_GetTokenInfo, + C_WaitForSlotEvent, + 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, }) } + pub unsafe fn C_Initialize(&self, init_args: *mut ::std::os::raw::c_void) -> CK_RV { + (self + .C_Initialize + .as_ref() + .expect("Expected function, got error."))(init_args) + } + pub unsafe fn C_Finalize(&self, pReserved: *mut ::std::os::raw::c_void) -> 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 { + (self + .C_GetInfo + .as_ref() + .expect("Expected function, got error."))(info) + } pub unsafe fn C_GetFunctionList(&self, function_list: *mut *mut _CK_FUNCTION_LIST) -> CK_RV { (self .C_GetFunctionList .as_ref() .expect("Expected function, got error."))(function_list) } + 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, + ) -> CK_RV { + (self + .C_GetSlotList + .as_ref() + .expect("Expected function, got error."))(token_present, slot_list, ulCount) + } + pub unsafe fn C_GetSlotInfo(&self, slotID: CK_SLOT_ID, info: *mut _CK_SLOT_INFO) -> CK_RV { + (self + .C_GetSlotInfo + .as_ref() + .expect("Expected function, got error."))(slotID, info) + } + pub unsafe fn C_GetTokenInfo(&self, slotID: CK_SLOT_ID, info: *mut _CK_TOKEN_INFO) -> 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) + } + pub unsafe fn C_GetMechanismList( + &self, + slotID: CK_SLOT_ID, + mechanism_list: *mut CK_MECHANISM_TYPE, + ulCount: *mut ::std::os::raw::c_ulong, + ) -> CK_RV { + (self + .C_GetMechanismList + .as_ref() + .expect("Expected function, got error."))(slotID, mechanism_list, ulCount) + } + pub unsafe fn C_GetMechanismInfo( + &self, + slotID: CK_SLOT_ID, + type_: CK_MECHANISM_TYPE, + info: *mut _CK_MECHANISM_INFO, + ) -> CK_RV { + (self + .C_GetMechanismInfo + .as_ref() + .expect("Expected function, got error."))(slotID, type_, info) + } + 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, + ) -> CK_RV { + (self + .C_InitToken + .as_ref() + .expect("Expected function, got error."))(slotID, pin, pin_len, label) + } + pub unsafe fn C_InitPIN( + &self, + session: CK_SESSION_HANDLE, + pin: *mut ::std::os::raw::c_uchar, + pin_len: ::std::os::raw::c_ulong, + ) -> CK_RV { + (self + .C_InitPIN + .as_ref() + .expect("Expected function, got error."))(session, pin, pin_len) + } + 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, + ) -> CK_RV { + (self + .C_SetPIN + .as_ref() + .expect("Expected function, got error."))( + session, old_pin, old_len, new_pin, new_len + ) + } + 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, + ) -> CK_RV { + (self + .C_OpenSession + .as_ref() + .expect("Expected function, got error."))( + slotID, flags, application, notify, session + ) + } + pub unsafe fn C_CloseSession(&self, session: CK_SESSION_HANDLE) -> CK_RV { + (self + .C_CloseSession + .as_ref() + .expect("Expected function, got error."))(session) + } + 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, + session: CK_SESSION_HANDLE, + info: *mut _CK_SESSION_INFO, + ) -> CK_RV { + (self + .C_GetSessionInfo + .as_ref() + .expect("Expected function, got error."))(session, info) + } + 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, + ) -> CK_RV { + (self + .C_GetOperationState + .as_ref() + .expect("Expected function, got error."))( + session, operation_state, operation_state_len + ) + } + 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, + ) -> CK_RV { + (self + .C_SetOperationState + .as_ref() + .expect("Expected function, got error."))( + session, + operation_state, + operation_state_len, + encryption_key, + authentiation_key, + ) + } + 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, + ) -> CK_RV { + (self + .C_Login + .as_ref() + .expect("Expected function, got error."))(session, user_type, pin, pin_len) + } + pub unsafe fn C_Logout(&self, session: CK_SESSION_HANDLE) -> CK_RV { + (self + .C_Logout + .as_ref() + .expect("Expected function, got error."))(session) + } + 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, + ) -> CK_RV { + (self + .C_CreateObject + .as_ref() + .expect("Expected function, got error."))(session, templ, ulCount, object) + } + 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, + ) -> CK_RV { + (self + .C_CopyObject + .as_ref() + .expect("Expected function, got error."))( + session, object, templ, ulCount, new_object + ) + } + pub unsafe fn C_DestroyObject( + &self, + session: CK_SESSION_HANDLE, + object: CK_OBJECT_HANDLE, + ) -> CK_RV { + (self + .C_DestroyObject + .as_ref() + .expect("Expected function, got error."))(session, object) + } + pub unsafe fn C_GetObjectSize( + &self, + session: CK_SESSION_HANDLE, + object: CK_OBJECT_HANDLE, + size: *mut ::std::os::raw::c_ulong, + ) -> CK_RV { + (self + .C_GetObjectSize + .as_ref() + .expect("Expected function, got error."))(session, object, size) + } + pub unsafe fn C_GetAttributeValue( + &self, + session: CK_SESSION_HANDLE, + object: CK_OBJECT_HANDLE, + templ: *mut _CK_ATTRIBUTE, + ulCount: ::std::os::raw::c_ulong, + ) -> CK_RV { + (self + .C_GetAttributeValue + .as_ref() + .expect("Expected function, got error."))(session, object, templ, 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, + ) -> CK_RV { + (self + .C_SetAttributeValue + .as_ref() + .expect("Expected function, got error."))(session, object, templ, ulCount) + } + pub unsafe fn C_FindObjectsInit( + &self, + session: CK_SESSION_HANDLE, + templ: *mut _CK_ATTRIBUTE, + ulCount: ::std::os::raw::c_ulong, + ) -> CK_RV { + (self + .C_FindObjectsInit + .as_ref() + .expect("Expected function, got error."))(session, templ, 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, + ) -> CK_RV { + (self + .C_FindObjects + .as_ref() + .expect("Expected function, got error."))( + session, + object, + max_object_count, + object_count, + ) + } + pub unsafe fn C_FindObjectsFinal(&self, session: CK_SESSION_HANDLE) -> CK_RV { + (self + .C_FindObjectsFinal + .as_ref() + .expect("Expected function, got error."))(session) + } + pub unsafe fn C_EncryptInit( + &self, + session: CK_SESSION_HANDLE, + mechanism: *mut _CK_MECHANISM, + key: CK_OBJECT_HANDLE, + ) -> CK_RV { + (self + .C_EncryptInit + .as_ref() + .expect("Expected function, got error."))(session, mechanism, key) + } + 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, + ) -> CK_RV { + (self + .C_Encrypt + .as_ref() + .expect("Expected function, got error."))( + session, + data, + data_len, + encrypted_data, + encrypted_data_len, + ) + } + 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, + ) -> CK_RV { + (self + .C_EncryptUpdate + .as_ref() + .expect("Expected function, got error."))( + session, + part, + part_len, + encrypted_part, + encrypted_part_len, + ) + } + 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, + ) -> CK_RV { + (self + .C_EncryptFinal + .as_ref() + .expect("Expected function, got error."))( + session, + last_encrypted_part, + last_encrypted_part_len, + ) + } + pub unsafe fn C_DecryptInit( + &self, + session: CK_SESSION_HANDLE, + mechanism: *mut _CK_MECHANISM, + key: CK_OBJECT_HANDLE, + ) -> CK_RV { + (self + .C_DecryptInit + .as_ref() + .expect("Expected function, got error."))(session, mechanism, key) + } + 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, + ) -> CK_RV { + (self + .C_Decrypt + .as_ref() + .expect("Expected function, got error."))( + session, + encrypted_data, + encrypted_data_len, + data, + data_len, + ) + } + 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, + ) -> CK_RV { + (self + .C_DecryptUpdate + .as_ref() + .expect("Expected function, got error."))( + session, + encrypted_part, + encrypted_part_len, + part, + part_len, + ) + } + 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, + ) -> CK_RV { + (self + .C_DecryptFinal + .as_ref() + .expect("Expected function, got error."))(session, last_part, last_part_len) + } + pub unsafe fn C_DigestInit( + &self, + session: CK_SESSION_HANDLE, + mechanism: *mut _CK_MECHANISM, + ) -> CK_RV { + (self + .C_DigestInit + .as_ref() + .expect("Expected function, got error."))(session, mechanism) + } + 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, + ) -> CK_RV { + (self + .C_Digest + .as_ref() + .expect("Expected function, got error."))( + session, data, data_len, digest, digest_len + ) + } + pub unsafe fn C_DigestUpdate( + &self, + session: CK_SESSION_HANDLE, + part: *mut ::std::os::raw::c_uchar, + part_len: ::std::os::raw::c_ulong, + ) -> CK_RV { + (self + .C_DigestUpdate + .as_ref() + .expect("Expected function, got error."))(session, part, part_len) + } + pub unsafe fn C_DigestKey(&self, session: CK_SESSION_HANDLE, key: CK_OBJECT_HANDLE) -> CK_RV { + (self + .C_DigestKey + .as_ref() + .expect("Expected function, got error."))(session, key) + } + 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, + ) -> CK_RV { + (self + .C_DigestFinal + .as_ref() + .expect("Expected function, got error."))(session, digest, digest_len) + } + pub unsafe fn C_SignInit( + &self, + session: CK_SESSION_HANDLE, + mechanism: *mut _CK_MECHANISM, + key: CK_OBJECT_HANDLE, + ) -> CK_RV { + (self + .C_SignInit + .as_ref() + .expect("Expected function, got error."))(session, mechanism, key) + } + 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, + ) -> CK_RV { + (self.C_Sign.as_ref().expect("Expected function, got error."))( + session, + data, + data_len, + signature, + signature_len, + ) + } + pub unsafe fn C_SignUpdate( + &self, + session: CK_SESSION_HANDLE, + part: *mut ::std::os::raw::c_uchar, + part_len: ::std::os::raw::c_ulong, + ) -> CK_RV { + (self + .C_SignUpdate + .as_ref() + .expect("Expected function, got error."))(session, part, part_len) + } + 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, + ) -> CK_RV { + (self + .C_SignFinal + .as_ref() + .expect("Expected function, got error."))(session, signature, signature_len) + } + pub unsafe fn C_SignRecoverInit( + &self, + session: CK_SESSION_HANDLE, + mechanism: *mut _CK_MECHANISM, + key: CK_OBJECT_HANDLE, + ) -> CK_RV { + (self + .C_SignRecoverInit + .as_ref() + .expect("Expected function, got error."))(session, mechanism, key) + } + 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, + ) -> CK_RV { + (self + .C_SignRecover + .as_ref() + .expect("Expected function, got error."))( + session, + data, + data_len, + signature, + signature_len, + ) + } + pub unsafe fn C_VerifyInit( + &self, + session: CK_SESSION_HANDLE, + mechanism: *mut _CK_MECHANISM, + key: CK_OBJECT_HANDLE, + ) -> CK_RV { + (self + .C_VerifyInit + .as_ref() + .expect("Expected function, got error."))(session, mechanism, key) + } + 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, + ) -> CK_RV { + (self + .C_Verify + .as_ref() + .expect("Expected function, got error."))( + session, + data, + data_len, + signature, + signature_len, + ) + } + pub unsafe fn C_VerifyUpdate( + &self, + session: CK_SESSION_HANDLE, + part: *mut ::std::os::raw::c_uchar, + part_len: ::std::os::raw::c_ulong, + ) -> CK_RV { + (self + .C_VerifyUpdate + .as_ref() + .expect("Expected function, got error."))(session, part, part_len) + } + pub unsafe fn C_VerifyFinal( + &self, + session: CK_SESSION_HANDLE, + signature: *mut ::std::os::raw::c_uchar, + signature_len: ::std::os::raw::c_ulong, + ) -> CK_RV { + (self + .C_VerifyFinal + .as_ref() + .expect("Expected function, got error."))(session, signature, signature_len) + } + pub unsafe fn C_VerifyRecoverInit( + &self, + session: CK_SESSION_HANDLE, + mechanism: *mut _CK_MECHANISM, + key: CK_OBJECT_HANDLE, + ) -> CK_RV { + (self + .C_VerifyRecoverInit + .as_ref() + .expect("Expected function, got error."))(session, mechanism, key) + } + 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, + ) -> CK_RV { + (self + .C_VerifyRecover + .as_ref() + .expect("Expected function, got error."))( + session, + signature, + signature_len, + data, + data_len, + ) + } + 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, + ) -> CK_RV { + (self + .C_DigestEncryptUpdate + .as_ref() + .expect("Expected function, got error."))( + session, + part, + part_len, + encrypted_part, + encrypted_part_len, + ) + } + 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, + ) -> CK_RV { + (self + .C_DecryptDigestUpdate + .as_ref() + .expect("Expected function, got error."))( + session, + encrypted_part, + encrypted_part_len, + part, + part_len, + ) + } + 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, + ) -> CK_RV { + (self + .C_SignEncryptUpdate + .as_ref() + .expect("Expected function, got error."))( + session, + part, + part_len, + encrypted_part, + encrypted_part_len, + ) + } + 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, + ) -> CK_RV { + (self + .C_DecryptVerifyUpdate + .as_ref() + .expect("Expected function, got error."))( + session, + encrypted_part, + encrypted_part_len, + part, + part_len, + ) + } + 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, + ) -> CK_RV { + (self + .C_GenerateKey + .as_ref() + .expect("Expected function, got error."))( + session, mechanism, templ, ulCount, key + ) + } + 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, + ) -> 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, + ) + } + 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, + ) -> CK_RV { + (self + .C_WrapKey + .as_ref() + .expect("Expected function, got error."))( + session, + mechanism, + wrapping_key, + key, + wrapped_key, + wrapped_key_len, + ) + } + 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, + ) -> 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, + ) + } + 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, + ) -> CK_RV { + (self + .C_DeriveKey + .as_ref() + .expect("Expected function, got error."))( + session, + mechanism, + base_key, + templ, + attribute_count, + key, + ) + } + pub unsafe fn C_SeedRandom( + &self, + session: CK_SESSION_HANDLE, + seed: *mut ::std::os::raw::c_uchar, + seed_len: ::std::os::raw::c_ulong, + ) -> CK_RV { + (self + .C_SeedRandom + .as_ref() + .expect("Expected function, got error."))(session, seed, seed_len) + } + 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, + ) -> CK_RV { + (self + .C_GenerateRandom + .as_ref() + .expect("Expected function, got error."))(session, random_data, random_len) + } + pub unsafe fn C_GetFunctionStatus(&self, session: CK_SESSION_HANDLE) -> CK_RV { + (self + .C_GetFunctionStatus + .as_ref() + .expect("Expected function, got error."))(session) + } + pub unsafe fn C_CancelFunction(&self, session: CK_SESSION_HANDLE) -> CK_RV { + (self + .C_CancelFunction + .as_ref() + .expect("Expected function, got error."))(session) + } } diff --git a/cryptoki-sys/src/bindings/x86_64-pc-windows-msvc.rs b/cryptoki-sys/src/bindings/x86_64-pc-windows-msvc.rs new file mode 100644 index 00000000..618e8917 --- /dev/null +++ b/cryptoki-sys/src/bindings/x86_64-pc-windows-msvc.rs @@ -0,0 +1,5066 @@ +/* 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 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 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; +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 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 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_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_EC_EDWARDS: CK_KEY_TYPE = 64; +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 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_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_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_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_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; +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 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_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_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_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_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_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_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_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_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_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_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_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_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_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 CKF_HW: CK_FLAGS = 1; +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_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 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_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_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 = 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_FUNCTION_REJECTED: CK_RV = 512; +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; +#[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, +} +#[test] +fn bindgen_test_layout__CK_VERSION() { + const UNINIT: ::std::mem::MaybeUninit<_CK_VERSION> = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::<_CK_VERSION>(), + 2usize, + concat!("Size of: ", stringify!(_CK_VERSION)) + ); + assert_eq!( + ::std::mem::align_of::<_CK_VERSION>(), + 1usize, + concat!("Alignment of ", stringify!(_CK_VERSION)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).major) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(_CK_VERSION), + "::", + stringify!(major) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).minor) as usize - ptr as usize }, + 1usize, + concat!( + "Offset of field: ", + stringify!(_CK_VERSION), + "::", + stringify!(minor) + ) + ); +} +#[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 flags: CK_FLAGS, + pub libraryDescription: [::std::os::raw::c_uchar; 32usize], + pub libraryVersion: _CK_VERSION, +} +#[test] +fn bindgen_test_layout__CK_INFO() { + const UNINIT: ::std::mem::MaybeUninit<_CK_INFO> = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::<_CK_INFO>(), + 72usize, + concat!("Size of: ", stringify!(_CK_INFO)) + ); + assert_eq!( + ::std::mem::align_of::<_CK_INFO>(), + 1usize, + concat!("Alignment of ", stringify!(_CK_INFO)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).cryptokiVersion) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(_CK_INFO), + "::", + stringify!(cryptokiVersion) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).manufacturerID) as usize - ptr as usize }, + 2usize, + concat!( + "Offset of field: ", + stringify!(_CK_INFO), + "::", + stringify!(manufacturerID) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).flags) as usize - ptr as usize }, + 34usize, + concat!( + "Offset of field: ", + stringify!(_CK_INFO), + "::", + stringify!(flags) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).libraryDescription) as usize - ptr as usize }, + 38usize, + concat!( + "Offset of field: ", + stringify!(_CK_INFO), + "::", + stringify!(libraryDescription) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).libraryVersion) as usize - ptr as usize }, + 70usize, + concat!( + "Offset of field: ", + stringify!(_CK_INFO), + "::", + stringify!(libraryVersion) + ) + ); +} +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; +#[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 flags: CK_FLAGS, + 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(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::<_CK_SLOT_INFO>(), + 104usize, + concat!("Size of: ", stringify!(_CK_SLOT_INFO)) + ); + assert_eq!( + ::std::mem::align_of::<_CK_SLOT_INFO>(), + 1usize, + concat!("Alignment of ", stringify!(_CK_SLOT_INFO)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).slotDescription) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(_CK_SLOT_INFO), + "::", + stringify!(slotDescription) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).manufacturerID) as usize - ptr as usize }, + 64usize, + concat!( + "Offset of field: ", + stringify!(_CK_SLOT_INFO), + "::", + stringify!(manufacturerID) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).flags) as usize - ptr as usize }, + 96usize, + concat!( + "Offset of field: ", + stringify!(_CK_SLOT_INFO), + "::", + stringify!(flags) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).hardwareVersion) as usize - ptr as usize }, + 100usize, + concat!( + "Offset of field: ", + stringify!(_CK_SLOT_INFO), + "::", + stringify!(hardwareVersion) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).firmwareVersion) as usize - ptr as usize }, + 102usize, + concat!( + "Offset of field: ", + stringify!(_CK_SLOT_INFO), + "::", + stringify!(firmwareVersion) + ) + ); +} +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 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; +#[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 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], +} +#[test] +fn bindgen_test_layout__CK_TOKEN_INFO() { + const UNINIT: ::std::mem::MaybeUninit<_CK_TOKEN_INFO> = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::<_CK_TOKEN_INFO>(), + 160usize, + concat!("Size of: ", stringify!(_CK_TOKEN_INFO)) + ); + assert_eq!( + ::std::mem::align_of::<_CK_TOKEN_INFO>(), + 1usize, + concat!("Alignment of ", stringify!(_CK_TOKEN_INFO)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).label) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(_CK_TOKEN_INFO), + "::", + stringify!(label) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).manufacturerID) as usize - ptr as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(_CK_TOKEN_INFO), + "::", + stringify!(manufacturerID) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).model) as usize - ptr as usize }, + 64usize, + concat!( + "Offset of field: ", + stringify!(_CK_TOKEN_INFO), + "::", + stringify!(model) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).serialNumber) as usize - ptr as usize }, + 80usize, + concat!( + "Offset of field: ", + stringify!(_CK_TOKEN_INFO), + "::", + stringify!(serialNumber) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).flags) as usize - ptr as usize }, + 96usize, + concat!( + "Offset of field: ", + stringify!(_CK_TOKEN_INFO), + "::", + stringify!(flags) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ulMaxSessionCount) as usize - ptr as usize }, + 100usize, + concat!( + "Offset of field: ", + stringify!(_CK_TOKEN_INFO), + "::", + stringify!(ulMaxSessionCount) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ulSessionCount) as usize - ptr as usize }, + 104usize, + concat!( + "Offset of field: ", + stringify!(_CK_TOKEN_INFO), + "::", + stringify!(ulSessionCount) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ulMaxRwSessionCount) as usize - ptr as usize }, + 108usize, + concat!( + "Offset of field: ", + stringify!(_CK_TOKEN_INFO), + "::", + stringify!(ulMaxRwSessionCount) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ulRwSessionCount) as usize - ptr as usize }, + 112usize, + concat!( + "Offset of field: ", + stringify!(_CK_TOKEN_INFO), + "::", + stringify!(ulRwSessionCount) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ulMaxPinLen) as usize - ptr as usize }, + 116usize, + concat!( + "Offset of field: ", + stringify!(_CK_TOKEN_INFO), + "::", + stringify!(ulMaxPinLen) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ulMinPinLen) as usize - ptr as usize }, + 120usize, + concat!( + "Offset of field: ", + stringify!(_CK_TOKEN_INFO), + "::", + stringify!(ulMinPinLen) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ulTotalPublicMemory) as usize - ptr as usize }, + 124usize, + concat!( + "Offset of field: ", + stringify!(_CK_TOKEN_INFO), + "::", + stringify!(ulTotalPublicMemory) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ulFreePublicMemory) as usize - ptr as usize }, + 128usize, + concat!( + "Offset of field: ", + stringify!(_CK_TOKEN_INFO), + "::", + stringify!(ulFreePublicMemory) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ulTotalPrivateMemory) as usize - ptr as usize }, + 132usize, + concat!( + "Offset of field: ", + stringify!(_CK_TOKEN_INFO), + "::", + stringify!(ulTotalPrivateMemory) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ulFreePrivateMemory) as usize - ptr as usize }, + 136usize, + concat!( + "Offset of field: ", + stringify!(_CK_TOKEN_INFO), + "::", + stringify!(ulFreePrivateMemory) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).hardwareVersion) as usize - ptr as usize }, + 140usize, + concat!( + "Offset of field: ", + stringify!(_CK_TOKEN_INFO), + "::", + stringify!(hardwareVersion) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).firmwareVersion) as usize - ptr as usize }, + 142usize, + concat!( + "Offset of field: ", + stringify!(_CK_TOKEN_INFO), + "::", + stringify!(firmwareVersion) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).utcTime) as usize - ptr as usize }, + 144usize, + concat!( + "Offset of field: ", + stringify!(_CK_TOKEN_INFO), + "::", + stringify!(utcTime) + ) + ); +} +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; +#[repr(C, 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: ::std::os::raw::c_ulong, +} +#[test] +fn bindgen_test_layout__CK_SESSION_INFO() { + const UNINIT: ::std::mem::MaybeUninit<_CK_SESSION_INFO> = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::<_CK_SESSION_INFO>(), + 16usize, + concat!("Size of: ", stringify!(_CK_SESSION_INFO)) + ); + assert_eq!( + ::std::mem::align_of::<_CK_SESSION_INFO>(), + 1usize, + concat!("Alignment of ", stringify!(_CK_SESSION_INFO)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).slotID) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(_CK_SESSION_INFO), + "::", + stringify!(slotID) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).state) as usize - ptr as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(_CK_SESSION_INFO), + "::", + stringify!(state) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).flags) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(_CK_SESSION_INFO), + "::", + stringify!(flags) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ulDeviceError) as usize - ptr as usize }, + 12usize, + concat!( + "Offset of field: ", + stringify!(_CK_SESSION_INFO), + "::", + stringify!(ulDeviceError) + ) + ); +} +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; +#[repr(C, packed)] +#[derive(Debug, Copy, Clone)] +pub struct _CK_ATTRIBUTE { + pub type_: CK_ATTRIBUTE_TYPE, + pub pValue: *mut ::std::os::raw::c_void, + pub ulValueLen: ::std::os::raw::c_ulong, +} +#[test] +fn bindgen_test_layout__CK_ATTRIBUTE() { + const UNINIT: ::std::mem::MaybeUninit<_CK_ATTRIBUTE> = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::<_CK_ATTRIBUTE>(), + 16usize, + concat!("Size of: ", stringify!(_CK_ATTRIBUTE)) + ); + assert_eq!( + ::std::mem::align_of::<_CK_ATTRIBUTE>(), + 1usize, + concat!("Alignment of ", stringify!(_CK_ATTRIBUTE)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).type_) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(_CK_ATTRIBUTE), + "::", + stringify!(type_) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pValue) as usize - ptr as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(_CK_ATTRIBUTE), + "::", + stringify!(pValue) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ulValueLen) as usize - ptr as usize }, + 12usize, + concat!( + "Offset of field: ", + stringify!(_CK_ATTRIBUTE), + "::", + stringify!(ulValueLen) + ) + ); +} +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() + } + } +} +#[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], +} +#[test] +fn bindgen_test_layout__CK_DATE() { + const UNINIT: ::std::mem::MaybeUninit<_CK_DATE> = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::<_CK_DATE>(), + 8usize, + concat!("Size of: ", stringify!(_CK_DATE)) + ); + assert_eq!( + ::std::mem::align_of::<_CK_DATE>(), + 1usize, + concat!("Alignment of ", stringify!(_CK_DATE)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).year) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(_CK_DATE), + "::", + stringify!(year) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).month) as usize - ptr as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(_CK_DATE), + "::", + stringify!(month) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).day) as usize - ptr as usize }, + 6usize, + concat!( + "Offset of field: ", + stringify!(_CK_DATE), + "::", + stringify!(day) + ) + ); +} +pub type CK_MECHANISM_TYPE = ::std::os::raw::c_ulong; +#[repr(C, packed)] +#[derive(Debug, Copy, Clone)] +pub struct _CK_MECHANISM { + pub mechanism: CK_MECHANISM_TYPE, + pub pParameter: *mut ::std::os::raw::c_void, + pub ulParameterLen: ::std::os::raw::c_ulong, +} +#[test] +fn bindgen_test_layout__CK_MECHANISM() { + const UNINIT: ::std::mem::MaybeUninit<_CK_MECHANISM> = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::<_CK_MECHANISM>(), + 16usize, + concat!("Size of: ", stringify!(_CK_MECHANISM)) + ); + assert_eq!( + ::std::mem::align_of::<_CK_MECHANISM>(), + 1usize, + concat!("Alignment of ", stringify!(_CK_MECHANISM)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).mechanism) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(_CK_MECHANISM), + "::", + stringify!(mechanism) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pParameter) as usize - ptr as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(_CK_MECHANISM), + "::", + stringify!(pParameter) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ulParameterLen) as usize - ptr as usize }, + 12usize, + concat!( + "Offset of field: ", + stringify!(_CK_MECHANISM), + "::", + stringify!(ulParameterLen) + ) + ); +} +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() + } + } +} +#[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 flags: CK_FLAGS, +} +#[test] +fn bindgen_test_layout__CK_MECHANISM_INFO() { + const UNINIT: ::std::mem::MaybeUninit<_CK_MECHANISM_INFO> = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::<_CK_MECHANISM_INFO>(), + 12usize, + concat!("Size of: ", stringify!(_CK_MECHANISM_INFO)) + ); + assert_eq!( + ::std::mem::align_of::<_CK_MECHANISM_INFO>(), + 1usize, + concat!("Alignment of ", stringify!(_CK_MECHANISM_INFO)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ulMinKeySize) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(_CK_MECHANISM_INFO), + "::", + stringify!(ulMinKeySize) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ulMaxKeySize) as usize - ptr as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(_CK_MECHANISM_INFO), + "::", + stringify!(ulMaxKeySize) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).flags) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(_CK_MECHANISM_INFO), + "::", + stringify!(flags) + ) + ); +} +pub type CK_PARAM_TYPE = ::std::os::raw::c_ulong; +#[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, +} +#[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() + } + } +} +#[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, +} +#[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() + } + } +} +#[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)) + ); + 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_RSA_PKCS_MGF_TYPE = ::std::os::raw::c_ulong; +#[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: ::std::os::raw::c_ulong, +} +#[test] +fn bindgen_test_layout_ck_rsa_pkcs_pss_params() { + const UNINIT: ::std::mem::MaybeUninit = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 12usize, + concat!("Size of: ", stringify!(ck_rsa_pkcs_pss_params)) + ); + assert_eq!( + ::std::mem::align_of::(), + 1usize, + concat!("Alignment of ", stringify!(ck_rsa_pkcs_pss_params)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).hashAlg) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(ck_rsa_pkcs_pss_params), + "::", + stringify!(hashAlg) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).mgf) as usize - ptr as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(ck_rsa_pkcs_pss_params), + "::", + stringify!(mgf) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).sLen) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(ck_rsa_pkcs_pss_params), + "::", + stringify!(sLen) + ) + ); +} +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, +} +#[test] +fn bindgen_test_layout_ck_rsa_pkcs_oaep_params() { + const UNINIT: ::std::mem::MaybeUninit = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 24usize, + concat!("Size of: ", stringify!(ck_rsa_pkcs_oaep_params)) + ); + assert_eq!( + ::std::mem::align_of::(), + 1usize, + concat!("Alignment of ", stringify!(ck_rsa_pkcs_oaep_params)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).hashAlg) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(ck_rsa_pkcs_oaep_params), + "::", + stringify!(hashAlg) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).mgf) as usize - ptr as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(ck_rsa_pkcs_oaep_params), + "::", + stringify!(mgf) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).source) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(ck_rsa_pkcs_oaep_params), + "::", + stringify!(source) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pSourceData) as usize - ptr as usize }, + 12usize, + concat!( + "Offset of field: ", + stringify!(ck_rsa_pkcs_oaep_params), + "::", + stringify!(pSourceData) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ulSourceDataLen) as usize - ptr as usize }, + 20usize, + concat!( + "Offset of field: ", + stringify!(ck_rsa_pkcs_oaep_params), + "::", + stringify!(ulSourceDataLen) + ) + ); +} +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() + } + } +} +#[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], +} +#[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) + ) + ); +} +#[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)) + ); + 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_ec_kdf_t = ::std::os::raw::c_ulong; +#[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, +} +#[test] +fn bindgen_test_layout_ck_ecdh1_derive_params() { + const UNINIT: ::std::mem::MaybeUninit = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 28usize, + concat!("Size of: ", stringify!(ck_ecdh1_derive_params)) + ); + assert_eq!( + ::std::mem::align_of::(), + 1usize, + concat!("Alignment of ", stringify!(ck_ecdh1_derive_params)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).kdf) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(ck_ecdh1_derive_params), + "::", + stringify!(kdf) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ulSharedDataLen) as usize - ptr as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(ck_ecdh1_derive_params), + "::", + stringify!(ulSharedDataLen) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pSharedData) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(ck_ecdh1_derive_params), + "::", + stringify!(pSharedData) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ulPublicDataLen) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(ck_ecdh1_derive_params), + "::", + stringify!(ulPublicDataLen) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pPublicData) as usize - ptr as usize }, + 20usize, + concat!( + "Offset of field: ", + stringify!(ck_ecdh1_derive_params), + "::", + stringify!(pPublicData) + ) + ); +} +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)) + ); + 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() + } + } +} +#[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, +} +#[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() + } + } +} +#[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, +} +#[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_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_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, + ) -> 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, + ) -> 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, + ) -> CK_RV, +>; +pub type CK_C_GetFunctionStatus = + ::std::option::Option CK_RV>; +pub type CK_C_CancelFunction = + ::std::option::Option CK_RV>; +#[repr(C, 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, +} +#[test] +fn bindgen_test_layout__CK_FUNCTION_LIST() { + const UNINIT: ::std::mem::MaybeUninit<_CK_FUNCTION_LIST> = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::<_CK_FUNCTION_LIST>(), + 546usize, + concat!("Size of: ", stringify!(_CK_FUNCTION_LIST)) + ); + assert_eq!( + ::std::mem::align_of::<_CK_FUNCTION_LIST>(), + 1usize, + concat!("Alignment of ", stringify!(_CK_FUNCTION_LIST)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).version) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(_CK_FUNCTION_LIST), + "::", + stringify!(version) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).C_Initialize) as usize - ptr as usize }, + 2usize, + concat!( + "Offset of field: ", + stringify!(_CK_FUNCTION_LIST), + "::", + stringify!(C_Initialize) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).C_Finalize) as usize - ptr as usize }, + 10usize, + concat!( + "Offset of field: ", + stringify!(_CK_FUNCTION_LIST), + "::", + stringify!(C_Finalize) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).C_GetInfo) as usize - ptr as usize }, + 18usize, + concat!( + "Offset of field: ", + stringify!(_CK_FUNCTION_LIST), + "::", + stringify!(C_GetInfo) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).C_GetFunctionList) as usize - ptr as usize }, + 26usize, + concat!( + "Offset of field: ", + stringify!(_CK_FUNCTION_LIST), + "::", + stringify!(C_GetFunctionList) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).C_GetSlotList) as usize - ptr as usize }, + 34usize, + concat!( + "Offset of field: ", + stringify!(_CK_FUNCTION_LIST), + "::", + stringify!(C_GetSlotList) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).C_GetSlotInfo) as usize - ptr as usize }, + 42usize, + concat!( + "Offset of field: ", + stringify!(_CK_FUNCTION_LIST), + "::", + stringify!(C_GetSlotInfo) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).C_GetTokenInfo) as usize - ptr as usize }, + 50usize, + concat!( + "Offset of field: ", + stringify!(_CK_FUNCTION_LIST), + "::", + stringify!(C_GetTokenInfo) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).C_GetMechanismList) as usize - ptr as usize }, + 58usize, + concat!( + "Offset of field: ", + stringify!(_CK_FUNCTION_LIST), + "::", + stringify!(C_GetMechanismList) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).C_GetMechanismInfo) as usize - ptr as usize }, + 66usize, + concat!( + "Offset of field: ", + stringify!(_CK_FUNCTION_LIST), + "::", + stringify!(C_GetMechanismInfo) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).C_InitToken) as usize - ptr as usize }, + 74usize, + concat!( + "Offset of field: ", + stringify!(_CK_FUNCTION_LIST), + "::", + stringify!(C_InitToken) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).C_InitPIN) as usize - ptr as usize }, + 82usize, + concat!( + "Offset of field: ", + stringify!(_CK_FUNCTION_LIST), + "::", + stringify!(C_InitPIN) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).C_SetPIN) as usize - ptr as usize }, + 90usize, + concat!( + "Offset of field: ", + stringify!(_CK_FUNCTION_LIST), + "::", + stringify!(C_SetPIN) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).C_OpenSession) as usize - ptr as usize }, + 98usize, + concat!( + "Offset of field: ", + stringify!(_CK_FUNCTION_LIST), + "::", + stringify!(C_OpenSession) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).C_CloseSession) as usize - ptr as usize }, + 106usize, + concat!( + "Offset of field: ", + stringify!(_CK_FUNCTION_LIST), + "::", + stringify!(C_CloseSession) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).C_CloseAllSessions) as usize - ptr as usize }, + 114usize, + concat!( + "Offset of field: ", + stringify!(_CK_FUNCTION_LIST), + "::", + stringify!(C_CloseAllSessions) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).C_GetSessionInfo) as usize - ptr as usize }, + 122usize, + concat!( + "Offset of field: ", + stringify!(_CK_FUNCTION_LIST), + "::", + stringify!(C_GetSessionInfo) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).C_GetOperationState) as usize - ptr as usize }, + 130usize, + concat!( + "Offset of field: ", + stringify!(_CK_FUNCTION_LIST), + "::", + stringify!(C_GetOperationState) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).C_SetOperationState) as usize - ptr as usize }, + 138usize, + concat!( + "Offset of field: ", + stringify!(_CK_FUNCTION_LIST), + "::", + stringify!(C_SetOperationState) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).C_Login) as usize - ptr as usize }, + 146usize, + concat!( + "Offset of field: ", + stringify!(_CK_FUNCTION_LIST), + "::", + stringify!(C_Login) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).C_Logout) as usize - ptr as usize }, + 154usize, + concat!( + "Offset of field: ", + stringify!(_CK_FUNCTION_LIST), + "::", + stringify!(C_Logout) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).C_CreateObject) as usize - ptr as usize }, + 162usize, + concat!( + "Offset of field: ", + stringify!(_CK_FUNCTION_LIST), + "::", + stringify!(C_CreateObject) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).C_CopyObject) as usize - ptr as usize }, + 170usize, + concat!( + "Offset of field: ", + stringify!(_CK_FUNCTION_LIST), + "::", + stringify!(C_CopyObject) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).C_DestroyObject) as usize - ptr as usize }, + 178usize, + concat!( + "Offset of field: ", + stringify!(_CK_FUNCTION_LIST), + "::", + stringify!(C_DestroyObject) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).C_GetObjectSize) as usize - ptr as usize }, + 186usize, + concat!( + "Offset of field: ", + stringify!(_CK_FUNCTION_LIST), + "::", + stringify!(C_GetObjectSize) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).C_GetAttributeValue) as usize - ptr as usize }, + 194usize, + concat!( + "Offset of field: ", + stringify!(_CK_FUNCTION_LIST), + "::", + stringify!(C_GetAttributeValue) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).C_SetAttributeValue) as usize - ptr as usize }, + 202usize, + concat!( + "Offset of field: ", + stringify!(_CK_FUNCTION_LIST), + "::", + stringify!(C_SetAttributeValue) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).C_FindObjectsInit) as usize - ptr as usize }, + 210usize, + concat!( + "Offset of field: ", + stringify!(_CK_FUNCTION_LIST), + "::", + stringify!(C_FindObjectsInit) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).C_FindObjects) as usize - ptr as usize }, + 218usize, + concat!( + "Offset of field: ", + stringify!(_CK_FUNCTION_LIST), + "::", + stringify!(C_FindObjects) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).C_FindObjectsFinal) as usize - ptr as usize }, + 226usize, + concat!( + "Offset of field: ", + stringify!(_CK_FUNCTION_LIST), + "::", + stringify!(C_FindObjectsFinal) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).C_EncryptInit) as usize - ptr as usize }, + 234usize, + concat!( + "Offset of field: ", + stringify!(_CK_FUNCTION_LIST), + "::", + stringify!(C_EncryptInit) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).C_Encrypt) as usize - ptr as usize }, + 242usize, + concat!( + "Offset of field: ", + stringify!(_CK_FUNCTION_LIST), + "::", + stringify!(C_Encrypt) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).C_EncryptUpdate) as usize - ptr as usize }, + 250usize, + concat!( + "Offset of field: ", + stringify!(_CK_FUNCTION_LIST), + "::", + stringify!(C_EncryptUpdate) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).C_EncryptFinal) as usize - ptr as usize }, + 258usize, + concat!( + "Offset of field: ", + stringify!(_CK_FUNCTION_LIST), + "::", + stringify!(C_EncryptFinal) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).C_DecryptInit) as usize - ptr as usize }, + 266usize, + concat!( + "Offset of field: ", + stringify!(_CK_FUNCTION_LIST), + "::", + stringify!(C_DecryptInit) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).C_Decrypt) as usize - ptr as usize }, + 274usize, + concat!( + "Offset of field: ", + stringify!(_CK_FUNCTION_LIST), + "::", + stringify!(C_Decrypt) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).C_DecryptUpdate) as usize - ptr as usize }, + 282usize, + concat!( + "Offset of field: ", + stringify!(_CK_FUNCTION_LIST), + "::", + stringify!(C_DecryptUpdate) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).C_DecryptFinal) as usize - ptr as usize }, + 290usize, + concat!( + "Offset of field: ", + stringify!(_CK_FUNCTION_LIST), + "::", + stringify!(C_DecryptFinal) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).C_DigestInit) as usize - ptr as usize }, + 298usize, + concat!( + "Offset of field: ", + stringify!(_CK_FUNCTION_LIST), + "::", + stringify!(C_DigestInit) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).C_Digest) as usize - ptr as usize }, + 306usize, + concat!( + "Offset of field: ", + stringify!(_CK_FUNCTION_LIST), + "::", + stringify!(C_Digest) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).C_DigestUpdate) as usize - ptr as usize }, + 314usize, + concat!( + "Offset of field: ", + stringify!(_CK_FUNCTION_LIST), + "::", + stringify!(C_DigestUpdate) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).C_DigestKey) as usize - ptr as usize }, + 322usize, + concat!( + "Offset of field: ", + stringify!(_CK_FUNCTION_LIST), + "::", + stringify!(C_DigestKey) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).C_DigestFinal) as usize - ptr as usize }, + 330usize, + concat!( + "Offset of field: ", + stringify!(_CK_FUNCTION_LIST), + "::", + stringify!(C_DigestFinal) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).C_SignInit) as usize - ptr as usize }, + 338usize, + concat!( + "Offset of field: ", + stringify!(_CK_FUNCTION_LIST), + "::", + stringify!(C_SignInit) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).C_Sign) as usize - ptr as usize }, + 346usize, + concat!( + "Offset of field: ", + stringify!(_CK_FUNCTION_LIST), + "::", + stringify!(C_Sign) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).C_SignUpdate) as usize - ptr as usize }, + 354usize, + concat!( + "Offset of field: ", + stringify!(_CK_FUNCTION_LIST), + "::", + stringify!(C_SignUpdate) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).C_SignFinal) as usize - ptr as usize }, + 362usize, + concat!( + "Offset of field: ", + stringify!(_CK_FUNCTION_LIST), + "::", + stringify!(C_SignFinal) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).C_SignRecoverInit) as usize - ptr as usize }, + 370usize, + concat!( + "Offset of field: ", + stringify!(_CK_FUNCTION_LIST), + "::", + stringify!(C_SignRecoverInit) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).C_SignRecover) as usize - ptr as usize }, + 378usize, + concat!( + "Offset of field: ", + stringify!(_CK_FUNCTION_LIST), + "::", + stringify!(C_SignRecover) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).C_VerifyInit) as usize - ptr as usize }, + 386usize, + concat!( + "Offset of field: ", + stringify!(_CK_FUNCTION_LIST), + "::", + stringify!(C_VerifyInit) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).C_Verify) as usize - ptr as usize }, + 394usize, + concat!( + "Offset of field: ", + stringify!(_CK_FUNCTION_LIST), + "::", + stringify!(C_Verify) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).C_VerifyUpdate) as usize - ptr as usize }, + 402usize, + concat!( + "Offset of field: ", + stringify!(_CK_FUNCTION_LIST), + "::", + stringify!(C_VerifyUpdate) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).C_VerifyFinal) as usize - ptr as usize }, + 410usize, + concat!( + "Offset of field: ", + stringify!(_CK_FUNCTION_LIST), + "::", + stringify!(C_VerifyFinal) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).C_VerifyRecoverInit) as usize - ptr as usize }, + 418usize, + concat!( + "Offset of field: ", + stringify!(_CK_FUNCTION_LIST), + "::", + stringify!(C_VerifyRecoverInit) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).C_VerifyRecover) as usize - ptr as usize }, + 426usize, + concat!( + "Offset of field: ", + stringify!(_CK_FUNCTION_LIST), + "::", + stringify!(C_VerifyRecover) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).C_DigestEncryptUpdate) as usize - ptr as usize }, + 434usize, + concat!( + "Offset of field: ", + stringify!(_CK_FUNCTION_LIST), + "::", + stringify!(C_DigestEncryptUpdate) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).C_DecryptDigestUpdate) as usize - ptr as usize }, + 442usize, + concat!( + "Offset of field: ", + stringify!(_CK_FUNCTION_LIST), + "::", + stringify!(C_DecryptDigestUpdate) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).C_SignEncryptUpdate) as usize - ptr as usize }, + 450usize, + concat!( + "Offset of field: ", + stringify!(_CK_FUNCTION_LIST), + "::", + stringify!(C_SignEncryptUpdate) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).C_DecryptVerifyUpdate) as usize - ptr as usize }, + 458usize, + concat!( + "Offset of field: ", + stringify!(_CK_FUNCTION_LIST), + "::", + stringify!(C_DecryptVerifyUpdate) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).C_GenerateKey) as usize - ptr as usize }, + 466usize, + concat!( + "Offset of field: ", + stringify!(_CK_FUNCTION_LIST), + "::", + stringify!(C_GenerateKey) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).C_GenerateKeyPair) as usize - ptr as usize }, + 474usize, + concat!( + "Offset of field: ", + stringify!(_CK_FUNCTION_LIST), + "::", + stringify!(C_GenerateKeyPair) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).C_WrapKey) as usize - ptr as usize }, + 482usize, + concat!( + "Offset of field: ", + stringify!(_CK_FUNCTION_LIST), + "::", + stringify!(C_WrapKey) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).C_UnwrapKey) as usize - ptr as usize }, + 490usize, + concat!( + "Offset of field: ", + stringify!(_CK_FUNCTION_LIST), + "::", + stringify!(C_UnwrapKey) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).C_DeriveKey) as usize - ptr as usize }, + 498usize, + concat!( + "Offset of field: ", + stringify!(_CK_FUNCTION_LIST), + "::", + stringify!(C_DeriveKey) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).C_SeedRandom) as usize - ptr as usize }, + 506usize, + concat!( + "Offset of field: ", + stringify!(_CK_FUNCTION_LIST), + "::", + stringify!(C_SeedRandom) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).C_GenerateRandom) as usize - ptr as usize }, + 514usize, + concat!( + "Offset of field: ", + stringify!(_CK_FUNCTION_LIST), + "::", + stringify!(C_GenerateRandom) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).C_GetFunctionStatus) as usize - ptr as usize }, + 522usize, + concat!( + "Offset of field: ", + stringify!(_CK_FUNCTION_LIST), + "::", + stringify!(C_GetFunctionStatus) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).C_CancelFunction) as usize - ptr as usize }, + 530usize, + concat!( + "Offset of field: ", + stringify!(_CK_FUNCTION_LIST), + "::", + stringify!(C_CancelFunction) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).C_WaitForSlotEvent) as usize - ptr as usize }, + 538usize, + concat!( + "Offset of field: ", + stringify!(_CK_FUNCTION_LIST), + "::", + stringify!(C_WaitForSlotEvent) + ) + ); +} +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!(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; +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_GetFunctionList: Result< + unsafe extern "C" fn(function_list: *mut *mut _CK_FUNCTION_LIST) -> 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, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_GetSlotInfo: Result< + unsafe extern "C" fn(slotID: CK_SLOT_ID, info: *mut _CK_SLOT_INFO) -> 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, + ::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, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_GetMechanismInfo: Result< + unsafe extern "C" fn( + slotID: CK_SLOT_ID, + type_: CK_MECHANISM_TYPE, + info: *mut _CK_MECHANISM_INFO, + ) -> 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, + ) -> 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, + ) -> 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, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_OpenSession: Result< + 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, + ::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(session: CK_SESSION_HANDLE, info: *mut _CK_SESSION_INFO) -> 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, + ) -> 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, + ) -> 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, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_Logout: + 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, + ) -> 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, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_DestroyObject: Result< + unsafe extern "C" fn(session: CK_SESSION_HANDLE, object: 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, + ) -> 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, + ) -> 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, + ) -> 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, + ) -> 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, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_FindObjectsFinal: + 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, + ) -> 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, + ) -> 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, + ) -> 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, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_DecryptInit: Result< + unsafe extern "C" fn( + session: CK_SESSION_HANDLE, + mechanism: *mut _CK_MECHANISM, + key: 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, + ) -> 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, + ) -> 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, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_DigestInit: Result< + unsafe extern "C" fn(session: CK_SESSION_HANDLE, mechanism: *mut _CK_MECHANISM) -> 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, + ) -> 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, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_DigestKey: Result< + unsafe extern "C" fn(session: CK_SESSION_HANDLE, key: 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, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_SignInit: Result< + unsafe extern "C" fn( + session: CK_SESSION_HANDLE, + mechanism: *mut _CK_MECHANISM, + key: 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, + ) -> 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, + ) -> 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, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_SignRecoverInit: Result< + unsafe extern "C" fn( + session: CK_SESSION_HANDLE, + mechanism: *mut _CK_MECHANISM, + key: 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, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_VerifyInit: Result< + unsafe extern "C" fn( + session: CK_SESSION_HANDLE, + mechanism: *mut _CK_MECHANISM, + key: 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, + ) -> 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, + ) -> 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, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_VerifyRecoverInit: Result< + unsafe extern "C" fn( + session: CK_SESSION_HANDLE, + mechanism: *mut _CK_MECHANISM, + key: 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, + ) -> 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, + ) -> 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, + ) -> 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, + ) -> 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, + ) -> 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, + ) -> 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, + ) -> 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, + ) -> 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, + ) -> 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, + ) -> 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, + ) -> 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, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_GetFunctionStatus: + Result CK_RV, ::libloading::Error>, + pub C_CancelFunction: + 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_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); + 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); + Ok(Pkcs11 { + __library, + C_Initialize, + C_Finalize, + C_GetInfo, + C_GetFunctionList, + C_GetSlotList, + C_GetSlotInfo, + C_GetTokenInfo, + C_WaitForSlotEvent, + 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, + }) + } + pub unsafe fn C_Initialize(&self, init_args: *mut ::std::os::raw::c_void) -> CK_RV { + (self + .C_Initialize + .as_ref() + .expect("Expected function, got error."))(init_args) + } + pub unsafe fn C_Finalize(&self, pReserved: *mut ::std::os::raw::c_void) -> 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 { + (self + .C_GetInfo + .as_ref() + .expect("Expected function, got error."))(info) + } + pub unsafe fn C_GetFunctionList(&self, function_list: *mut *mut _CK_FUNCTION_LIST) -> CK_RV { + (self + .C_GetFunctionList + .as_ref() + .expect("Expected function, got error."))(function_list) + } + 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, + ) -> CK_RV { + (self + .C_GetSlotList + .as_ref() + .expect("Expected function, got error."))(token_present, slot_list, ulCount) + } + pub unsafe fn C_GetSlotInfo(&self, slotID: CK_SLOT_ID, info: *mut _CK_SLOT_INFO) -> CK_RV { + (self + .C_GetSlotInfo + .as_ref() + .expect("Expected function, got error."))(slotID, info) + } + pub unsafe fn C_GetTokenInfo(&self, slotID: CK_SLOT_ID, info: *mut _CK_TOKEN_INFO) -> 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) + } + pub unsafe fn C_GetMechanismList( + &self, + slotID: CK_SLOT_ID, + mechanism_list: *mut CK_MECHANISM_TYPE, + ulCount: *mut ::std::os::raw::c_ulong, + ) -> CK_RV { + (self + .C_GetMechanismList + .as_ref() + .expect("Expected function, got error."))(slotID, mechanism_list, ulCount) + } + pub unsafe fn C_GetMechanismInfo( + &self, + slotID: CK_SLOT_ID, + type_: CK_MECHANISM_TYPE, + info: *mut _CK_MECHANISM_INFO, + ) -> CK_RV { + (self + .C_GetMechanismInfo + .as_ref() + .expect("Expected function, got error."))(slotID, type_, info) + } + 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, + ) -> CK_RV { + (self + .C_InitToken + .as_ref() + .expect("Expected function, got error."))(slotID, pin, pin_len, label) + } + pub unsafe fn C_InitPIN( + &self, + session: CK_SESSION_HANDLE, + pin: *mut ::std::os::raw::c_uchar, + pin_len: ::std::os::raw::c_ulong, + ) -> CK_RV { + (self + .C_InitPIN + .as_ref() + .expect("Expected function, got error."))(session, pin, pin_len) + } + 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, + ) -> CK_RV { + (self + .C_SetPIN + .as_ref() + .expect("Expected function, got error."))( + session, old_pin, old_len, new_pin, new_len + ) + } + 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, + ) -> CK_RV { + (self + .C_OpenSession + .as_ref() + .expect("Expected function, got error."))( + slotID, flags, application, notify, session + ) + } + pub unsafe fn C_CloseSession(&self, session: CK_SESSION_HANDLE) -> CK_RV { + (self + .C_CloseSession + .as_ref() + .expect("Expected function, got error."))(session) + } + 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, + session: CK_SESSION_HANDLE, + info: *mut _CK_SESSION_INFO, + ) -> CK_RV { + (self + .C_GetSessionInfo + .as_ref() + .expect("Expected function, got error."))(session, info) + } + 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, + ) -> CK_RV { + (self + .C_GetOperationState + .as_ref() + .expect("Expected function, got error."))( + session, operation_state, operation_state_len + ) + } + 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, + ) -> CK_RV { + (self + .C_SetOperationState + .as_ref() + .expect("Expected function, got error."))( + session, + operation_state, + operation_state_len, + encryption_key, + authentiation_key, + ) + } + 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, + ) -> CK_RV { + (self + .C_Login + .as_ref() + .expect("Expected function, got error."))(session, user_type, pin, pin_len) + } + pub unsafe fn C_Logout(&self, session: CK_SESSION_HANDLE) -> CK_RV { + (self + .C_Logout + .as_ref() + .expect("Expected function, got error."))(session) + } + 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, + ) -> CK_RV { + (self + .C_CreateObject + .as_ref() + .expect("Expected function, got error."))(session, templ, ulCount, object) + } + 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, + ) -> CK_RV { + (self + .C_CopyObject + .as_ref() + .expect("Expected function, got error."))( + session, object, templ, ulCount, new_object + ) + } + pub unsafe fn C_DestroyObject( + &self, + session: CK_SESSION_HANDLE, + object: CK_OBJECT_HANDLE, + ) -> CK_RV { + (self + .C_DestroyObject + .as_ref() + .expect("Expected function, got error."))(session, object) + } + pub unsafe fn C_GetObjectSize( + &self, + session: CK_SESSION_HANDLE, + object: CK_OBJECT_HANDLE, + size: *mut ::std::os::raw::c_ulong, + ) -> CK_RV { + (self + .C_GetObjectSize + .as_ref() + .expect("Expected function, got error."))(session, object, size) + } + pub unsafe fn C_GetAttributeValue( + &self, + session: CK_SESSION_HANDLE, + object: CK_OBJECT_HANDLE, + templ: *mut _CK_ATTRIBUTE, + ulCount: ::std::os::raw::c_ulong, + ) -> CK_RV { + (self + .C_GetAttributeValue + .as_ref() + .expect("Expected function, got error."))(session, object, templ, 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, + ) -> CK_RV { + (self + .C_SetAttributeValue + .as_ref() + .expect("Expected function, got error."))(session, object, templ, ulCount) + } + pub unsafe fn C_FindObjectsInit( + &self, + session: CK_SESSION_HANDLE, + templ: *mut _CK_ATTRIBUTE, + ulCount: ::std::os::raw::c_ulong, + ) -> CK_RV { + (self + .C_FindObjectsInit + .as_ref() + .expect("Expected function, got error."))(session, templ, 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, + ) -> CK_RV { + (self + .C_FindObjects + .as_ref() + .expect("Expected function, got error."))( + session, + object, + max_object_count, + object_count, + ) + } + pub unsafe fn C_FindObjectsFinal(&self, session: CK_SESSION_HANDLE) -> CK_RV { + (self + .C_FindObjectsFinal + .as_ref() + .expect("Expected function, got error."))(session) + } + pub unsafe fn C_EncryptInit( + &self, + session: CK_SESSION_HANDLE, + mechanism: *mut _CK_MECHANISM, + key: CK_OBJECT_HANDLE, + ) -> CK_RV { + (self + .C_EncryptInit + .as_ref() + .expect("Expected function, got error."))(session, mechanism, key) + } + 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, + ) -> CK_RV { + (self + .C_Encrypt + .as_ref() + .expect("Expected function, got error."))( + session, + data, + data_len, + encrypted_data, + encrypted_data_len, + ) + } + 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, + ) -> CK_RV { + (self + .C_EncryptUpdate + .as_ref() + .expect("Expected function, got error."))( + session, + part, + part_len, + encrypted_part, + encrypted_part_len, + ) + } + 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, + ) -> CK_RV { + (self + .C_EncryptFinal + .as_ref() + .expect("Expected function, got error."))( + session, + last_encrypted_part, + last_encrypted_part_len, + ) + } + pub unsafe fn C_DecryptInit( + &self, + session: CK_SESSION_HANDLE, + mechanism: *mut _CK_MECHANISM, + key: CK_OBJECT_HANDLE, + ) -> CK_RV { + (self + .C_DecryptInit + .as_ref() + .expect("Expected function, got error."))(session, mechanism, key) + } + 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, + ) -> CK_RV { + (self + .C_Decrypt + .as_ref() + .expect("Expected function, got error."))( + session, + encrypted_data, + encrypted_data_len, + data, + data_len, + ) + } + 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, + ) -> CK_RV { + (self + .C_DecryptUpdate + .as_ref() + .expect("Expected function, got error."))( + session, + encrypted_part, + encrypted_part_len, + part, + part_len, + ) + } + 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, + ) -> CK_RV { + (self + .C_DecryptFinal + .as_ref() + .expect("Expected function, got error."))(session, last_part, last_part_len) + } + pub unsafe fn C_DigestInit( + &self, + session: CK_SESSION_HANDLE, + mechanism: *mut _CK_MECHANISM, + ) -> CK_RV { + (self + .C_DigestInit + .as_ref() + .expect("Expected function, got error."))(session, mechanism) + } + 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, + ) -> CK_RV { + (self + .C_Digest + .as_ref() + .expect("Expected function, got error."))( + session, data, data_len, digest, digest_len + ) + } + pub unsafe fn C_DigestUpdate( + &self, + session: CK_SESSION_HANDLE, + part: *mut ::std::os::raw::c_uchar, + part_len: ::std::os::raw::c_ulong, + ) -> CK_RV { + (self + .C_DigestUpdate + .as_ref() + .expect("Expected function, got error."))(session, part, part_len) + } + pub unsafe fn C_DigestKey(&self, session: CK_SESSION_HANDLE, key: CK_OBJECT_HANDLE) -> CK_RV { + (self + .C_DigestKey + .as_ref() + .expect("Expected function, got error."))(session, key) + } + 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, + ) -> CK_RV { + (self + .C_DigestFinal + .as_ref() + .expect("Expected function, got error."))(session, digest, digest_len) + } + pub unsafe fn C_SignInit( + &self, + session: CK_SESSION_HANDLE, + mechanism: *mut _CK_MECHANISM, + key: CK_OBJECT_HANDLE, + ) -> CK_RV { + (self + .C_SignInit + .as_ref() + .expect("Expected function, got error."))(session, mechanism, key) + } + 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, + ) -> CK_RV { + (self.C_Sign.as_ref().expect("Expected function, got error."))( + session, + data, + data_len, + signature, + signature_len, + ) + } + pub unsafe fn C_SignUpdate( + &self, + session: CK_SESSION_HANDLE, + part: *mut ::std::os::raw::c_uchar, + part_len: ::std::os::raw::c_ulong, + ) -> CK_RV { + (self + .C_SignUpdate + .as_ref() + .expect("Expected function, got error."))(session, part, part_len) + } + 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, + ) -> CK_RV { + (self + .C_SignFinal + .as_ref() + .expect("Expected function, got error."))(session, signature, signature_len) + } + pub unsafe fn C_SignRecoverInit( + &self, + session: CK_SESSION_HANDLE, + mechanism: *mut _CK_MECHANISM, + key: CK_OBJECT_HANDLE, + ) -> CK_RV { + (self + .C_SignRecoverInit + .as_ref() + .expect("Expected function, got error."))(session, mechanism, key) + } + 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, + ) -> CK_RV { + (self + .C_SignRecover + .as_ref() + .expect("Expected function, got error."))( + session, + data, + data_len, + signature, + signature_len, + ) + } + pub unsafe fn C_VerifyInit( + &self, + session: CK_SESSION_HANDLE, + mechanism: *mut _CK_MECHANISM, + key: CK_OBJECT_HANDLE, + ) -> CK_RV { + (self + .C_VerifyInit + .as_ref() + .expect("Expected function, got error."))(session, mechanism, key) + } + 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, + ) -> CK_RV { + (self + .C_Verify + .as_ref() + .expect("Expected function, got error."))( + session, + data, + data_len, + signature, + signature_len, + ) + } + pub unsafe fn C_VerifyUpdate( + &self, + session: CK_SESSION_HANDLE, + part: *mut ::std::os::raw::c_uchar, + part_len: ::std::os::raw::c_ulong, + ) -> CK_RV { + (self + .C_VerifyUpdate + .as_ref() + .expect("Expected function, got error."))(session, part, part_len) + } + pub unsafe fn C_VerifyFinal( + &self, + session: CK_SESSION_HANDLE, + signature: *mut ::std::os::raw::c_uchar, + signature_len: ::std::os::raw::c_ulong, + ) -> CK_RV { + (self + .C_VerifyFinal + .as_ref() + .expect("Expected function, got error."))(session, signature, signature_len) + } + pub unsafe fn C_VerifyRecoverInit( + &self, + session: CK_SESSION_HANDLE, + mechanism: *mut _CK_MECHANISM, + key: CK_OBJECT_HANDLE, + ) -> CK_RV { + (self + .C_VerifyRecoverInit + .as_ref() + .expect("Expected function, got error."))(session, mechanism, key) + } + 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, + ) -> CK_RV { + (self + .C_VerifyRecover + .as_ref() + .expect("Expected function, got error."))( + session, + signature, + signature_len, + data, + data_len, + ) + } + 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, + ) -> CK_RV { + (self + .C_DigestEncryptUpdate + .as_ref() + .expect("Expected function, got error."))( + session, + part, + part_len, + encrypted_part, + encrypted_part_len, + ) + } + 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, + ) -> CK_RV { + (self + .C_DecryptDigestUpdate + .as_ref() + .expect("Expected function, got error."))( + session, + encrypted_part, + encrypted_part_len, + part, + part_len, + ) + } + 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, + ) -> CK_RV { + (self + .C_SignEncryptUpdate + .as_ref() + .expect("Expected function, got error."))( + session, + part, + part_len, + encrypted_part, + encrypted_part_len, + ) + } + 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, + ) -> CK_RV { + (self + .C_DecryptVerifyUpdate + .as_ref() + .expect("Expected function, got error."))( + session, + encrypted_part, + encrypted_part_len, + part, + part_len, + ) + } + 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, + ) -> CK_RV { + (self + .C_GenerateKey + .as_ref() + .expect("Expected function, got error."))( + session, mechanism, templ, ulCount, key + ) + } + 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, + ) -> 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, + ) + } + 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, + ) -> CK_RV { + (self + .C_WrapKey + .as_ref() + .expect("Expected function, got error."))( + session, + mechanism, + wrapping_key, + key, + wrapped_key, + wrapped_key_len, + ) + } + 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, + ) -> 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, + ) + } + 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, + ) -> CK_RV { + (self + .C_DeriveKey + .as_ref() + .expect("Expected function, got error."))( + session, + mechanism, + base_key, + templ, + attribute_count, + key, + ) + } + pub unsafe fn C_SeedRandom( + &self, + session: CK_SESSION_HANDLE, + seed: *mut ::std::os::raw::c_uchar, + seed_len: ::std::os::raw::c_ulong, + ) -> CK_RV { + (self + .C_SeedRandom + .as_ref() + .expect("Expected function, got error."))(session, seed, seed_len) + } + 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, + ) -> CK_RV { + (self + .C_GenerateRandom + .as_ref() + .expect("Expected function, got error."))(session, random_data, random_len) + } + pub unsafe fn C_GetFunctionStatus(&self, session: CK_SESSION_HANDLE) -> CK_RV { + (self + .C_GetFunctionStatus + .as_ref() + .expect("Expected function, got error."))(session) + } + pub unsafe fn C_CancelFunction(&self, session: CK_SESSION_HANDLE) -> CK_RV { + (self + .C_CancelFunction + .as_ref() + .expect("Expected function, got error."))(session) + } +} diff --git a/cryptoki-sys/src/bindings/x86_64-unknown-freebsd.rs b/cryptoki-sys/src/bindings/x86_64-unknown-freebsd.rs index e8699a8b..6800365c 100644 --- a/cryptoki-sys/src/bindings/x86_64-unknown-freebsd.rs +++ b/cryptoki-sys/src/bindings/x86_64-unknown-freebsd.rs @@ -1,5 +1,691 @@ -/* automatically generated by rust-bindgen 0.59.2 */ +/* 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 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 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; +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 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 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_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_EC_EDWARDS: CK_KEY_TYPE = 64; +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 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_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_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_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_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; +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 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_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_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_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_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_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_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_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_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_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_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_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_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_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 CKF_HW: CK_FLAGS = 1; +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_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 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_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_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 = 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_FUNCTION_REJECTED: CK_RV = 512; +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; #[repr(C)] #[derive(Debug, Default, Copy, Clone)] @@ -9,6 +695,8 @@ pub struct _CK_VERSION { } #[test] fn bindgen_test_layout__CK_VERSION() { + const UNINIT: ::std::mem::MaybeUninit<_CK_VERSION> = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<_CK_VERSION>(), 2usize, @@ -20,7 +708,7 @@ fn bindgen_test_layout__CK_VERSION() { concat!("Alignment of ", stringify!(_CK_VERSION)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_VERSION>())).major as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).major) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -30,7 +718,7 @@ fn bindgen_test_layout__CK_VERSION() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_VERSION>())).minor as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).minor) as usize - ptr as usize }, 1usize, concat!( "Offset of field: ", @@ -51,6 +739,8 @@ pub struct _CK_INFO { } #[test] fn bindgen_test_layout__CK_INFO() { + const UNINIT: ::std::mem::MaybeUninit<_CK_INFO> = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<_CK_INFO>(), 88usize, @@ -62,7 +752,7 @@ fn bindgen_test_layout__CK_INFO() { concat!("Alignment of ", stringify!(_CK_INFO)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_INFO>())).cryptokiVersion as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).cryptokiVersion) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -72,7 +762,7 @@ fn bindgen_test_layout__CK_INFO() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_INFO>())).manufacturerID as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).manufacturerID) as usize - ptr as usize }, 2usize, concat!( "Offset of field: ", @@ -82,7 +772,7 @@ fn bindgen_test_layout__CK_INFO() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_INFO>())).flags as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).flags) as usize - ptr as usize }, 40usize, concat!( "Offset of field: ", @@ -92,7 +782,7 @@ fn bindgen_test_layout__CK_INFO() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_INFO>())).libraryDescription as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).libraryDescription) as usize - ptr as usize }, 48usize, concat!( "Offset of field: ", @@ -102,7 +792,7 @@ fn bindgen_test_layout__CK_INFO() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_INFO>())).libraryVersion as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).libraryVersion) as usize - ptr as usize }, 80usize, concat!( "Offset of field: ", @@ -113,6 +803,7 @@ fn bindgen_test_layout__CK_INFO() { ); } 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; #[repr(C)] #[derive(Debug, Copy, Clone)] @@ -125,6 +816,8 @@ pub struct _CK_SLOT_INFO { } #[test] fn bindgen_test_layout__CK_SLOT_INFO() { + const UNINIT: ::std::mem::MaybeUninit<_CK_SLOT_INFO> = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<_CK_SLOT_INFO>(), 112usize, @@ -136,7 +829,7 @@ fn bindgen_test_layout__CK_SLOT_INFO() { concat!("Alignment of ", stringify!(_CK_SLOT_INFO)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_SLOT_INFO>())).slotDescription as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).slotDescription) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -146,7 +839,7 @@ fn bindgen_test_layout__CK_SLOT_INFO() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_SLOT_INFO>())).manufacturerID as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).manufacturerID) as usize - ptr as usize }, 64usize, concat!( "Offset of field: ", @@ -156,7 +849,7 @@ fn bindgen_test_layout__CK_SLOT_INFO() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_SLOT_INFO>())).flags as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).flags) as usize - ptr as usize }, 96usize, concat!( "Offset of field: ", @@ -166,7 +859,7 @@ fn bindgen_test_layout__CK_SLOT_INFO() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_SLOT_INFO>())).hardwareVersion as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).hardwareVersion) as usize - ptr as usize }, 104usize, concat!( "Offset of field: ", @@ -176,7 +869,7 @@ fn bindgen_test_layout__CK_SLOT_INFO() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_SLOT_INFO>())).firmwareVersion as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).firmwareVersion) as usize - ptr as usize }, 106usize, concat!( "Offset of field: ", @@ -195,6 +888,10 @@ 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; #[repr(C)] #[derive(Debug, Default, Copy, Clone)] pub struct _CK_TOKEN_INFO { @@ -219,6 +916,8 @@ pub struct _CK_TOKEN_INFO { } #[test] fn bindgen_test_layout__CK_TOKEN_INFO() { + const UNINIT: ::std::mem::MaybeUninit<_CK_TOKEN_INFO> = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<_CK_TOKEN_INFO>(), 208usize, @@ -230,7 +929,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { concat!("Alignment of ", stringify!(_CK_TOKEN_INFO)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_TOKEN_INFO>())).label as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).label) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -240,7 +939,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_TOKEN_INFO>())).manufacturerID as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).manufacturerID) as usize - ptr as usize }, 32usize, concat!( "Offset of field: ", @@ -250,7 +949,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_TOKEN_INFO>())).model as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).model) as usize - ptr as usize }, 64usize, concat!( "Offset of field: ", @@ -260,7 +959,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_TOKEN_INFO>())).serialNumber as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).serialNumber) as usize - ptr as usize }, 80usize, concat!( "Offset of field: ", @@ -270,7 +969,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_TOKEN_INFO>())).flags as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).flags) as usize - ptr as usize }, 96usize, concat!( "Offset of field: ", @@ -280,9 +979,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_TOKEN_INFO>())).ulMaxSessionCount as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).ulMaxSessionCount) as usize - ptr as usize }, 104usize, concat!( "Offset of field: ", @@ -292,7 +989,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_TOKEN_INFO>())).ulSessionCount as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ulSessionCount) as usize - ptr as usize }, 112usize, concat!( "Offset of field: ", @@ -302,9 +999,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_TOKEN_INFO>())).ulMaxRwSessionCount as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).ulMaxRwSessionCount) as usize - ptr as usize }, 120usize, concat!( "Offset of field: ", @@ -314,7 +1009,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_TOKEN_INFO>())).ulRwSessionCount as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ulRwSessionCount) as usize - ptr as usize }, 128usize, concat!( "Offset of field: ", @@ -324,7 +1019,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_TOKEN_INFO>())).ulMaxPinLen as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ulMaxPinLen) as usize - ptr as usize }, 136usize, concat!( "Offset of field: ", @@ -334,7 +1029,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_TOKEN_INFO>())).ulMinPinLen as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ulMinPinLen) as usize - ptr as usize }, 144usize, concat!( "Offset of field: ", @@ -344,9 +1039,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_TOKEN_INFO>())).ulTotalPublicMemory as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).ulTotalPublicMemory) as usize - ptr as usize }, 152usize, concat!( "Offset of field: ", @@ -356,9 +1049,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_TOKEN_INFO>())).ulFreePublicMemory as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).ulFreePublicMemory) as usize - ptr as usize }, 160usize, concat!( "Offset of field: ", @@ -368,9 +1059,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_TOKEN_INFO>())).ulTotalPrivateMemory as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).ulTotalPrivateMemory) as usize - ptr as usize }, 168usize, concat!( "Offset of field: ", @@ -380,9 +1069,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_TOKEN_INFO>())).ulFreePrivateMemory as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).ulFreePrivateMemory) as usize - ptr as usize }, 176usize, concat!( "Offset of field: ", @@ -392,7 +1079,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_TOKEN_INFO>())).hardwareVersion as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).hardwareVersion) as usize - ptr as usize }, 184usize, concat!( "Offset of field: ", @@ -402,7 +1089,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_TOKEN_INFO>())).firmwareVersion as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).firmwareVersion) as usize - ptr as usize }, 186usize, concat!( "Offset of field: ", @@ -412,7 +1099,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_TOKEN_INFO>())).utcTime as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).utcTime) as usize - ptr as usize }, 188usize, concat!( "Offset of field: ", @@ -435,6 +1122,8 @@ pub struct _CK_SESSION_INFO { } #[test] fn bindgen_test_layout__CK_SESSION_INFO() { + const UNINIT: ::std::mem::MaybeUninit<_CK_SESSION_INFO> = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<_CK_SESSION_INFO>(), 32usize, @@ -446,7 +1135,7 @@ fn bindgen_test_layout__CK_SESSION_INFO() { concat!("Alignment of ", stringify!(_CK_SESSION_INFO)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_SESSION_INFO>())).slotID as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).slotID) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -456,7 +1145,7 @@ fn bindgen_test_layout__CK_SESSION_INFO() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_SESSION_INFO>())).state as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).state) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -466,7 +1155,7 @@ fn bindgen_test_layout__CK_SESSION_INFO() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_SESSION_INFO>())).flags as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).flags) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", @@ -476,7 +1165,7 @@ fn bindgen_test_layout__CK_SESSION_INFO() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_SESSION_INFO>())).ulDeviceError as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ulDeviceError) as usize - ptr as usize }, 24usize, concat!( "Offset of field: ", @@ -501,6 +1190,8 @@ pub struct _CK_ATTRIBUTE { } #[test] fn bindgen_test_layout__CK_ATTRIBUTE() { + const UNINIT: ::std::mem::MaybeUninit<_CK_ATTRIBUTE> = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<_CK_ATTRIBUTE>(), 24usize, @@ -512,7 +1203,7 @@ fn bindgen_test_layout__CK_ATTRIBUTE() { concat!("Alignment of ", stringify!(_CK_ATTRIBUTE)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_ATTRIBUTE>())).type_ as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).type_) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -522,7 +1213,7 @@ fn bindgen_test_layout__CK_ATTRIBUTE() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_ATTRIBUTE>())).pValue as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).pValue) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -532,7 +1223,7 @@ fn bindgen_test_layout__CK_ATTRIBUTE() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_ATTRIBUTE>())).ulValueLen as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ulValueLen) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", @@ -560,6 +1251,8 @@ pub struct _CK_DATE { } #[test] fn bindgen_test_layout__CK_DATE() { + const UNINIT: ::std::mem::MaybeUninit<_CK_DATE> = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<_CK_DATE>(), 8usize, @@ -571,7 +1264,7 @@ fn bindgen_test_layout__CK_DATE() { concat!("Alignment of ", stringify!(_CK_DATE)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_DATE>())).year as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).year) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -581,7 +1274,7 @@ fn bindgen_test_layout__CK_DATE() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_DATE>())).month as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).month) as usize - ptr as usize }, 4usize, concat!( "Offset of field: ", @@ -591,7 +1284,7 @@ fn bindgen_test_layout__CK_DATE() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_DATE>())).day as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).day) as usize - ptr as usize }, 6usize, concat!( "Offset of field: ", @@ -611,6 +1304,8 @@ pub struct _CK_MECHANISM { } #[test] fn bindgen_test_layout__CK_MECHANISM() { + const UNINIT: ::std::mem::MaybeUninit<_CK_MECHANISM> = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<_CK_MECHANISM>(), 24usize, @@ -622,7 +1317,7 @@ fn bindgen_test_layout__CK_MECHANISM() { concat!("Alignment of ", stringify!(_CK_MECHANISM)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_MECHANISM>())).mechanism as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).mechanism) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -632,7 +1327,7 @@ fn bindgen_test_layout__CK_MECHANISM() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_MECHANISM>())).pParameter as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).pParameter) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -642,7 +1337,7 @@ fn bindgen_test_layout__CK_MECHANISM() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_MECHANISM>())).ulParameterLen as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ulParameterLen) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", @@ -670,6 +1365,8 @@ pub struct _CK_MECHANISM_INFO { } #[test] fn bindgen_test_layout__CK_MECHANISM_INFO() { + const UNINIT: ::std::mem::MaybeUninit<_CK_MECHANISM_INFO> = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<_CK_MECHANISM_INFO>(), 24usize, @@ -681,7 +1378,7 @@ fn bindgen_test_layout__CK_MECHANISM_INFO() { concat!("Alignment of ", stringify!(_CK_MECHANISM_INFO)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_MECHANISM_INFO>())).ulMinKeySize as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ulMinKeySize) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -691,7 +1388,7 @@ fn bindgen_test_layout__CK_MECHANISM_INFO() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_MECHANISM_INFO>())).ulMaxKeySize as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ulMaxKeySize) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -701,7 +1398,7 @@ fn bindgen_test_layout__CK_MECHANISM_INFO() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_MECHANISM_INFO>())).flags as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).flags) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", @@ -721,6 +1418,8 @@ pub struct CK_OTP_PARAM { } #[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, @@ -732,7 +1431,7 @@ fn bindgen_test_layout_CK_OTP_PARAM() { concat!("Alignment of ", stringify!(CK_OTP_PARAM)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).type_ as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).type_) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -742,7 +1441,7 @@ fn bindgen_test_layout_CK_OTP_PARAM() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).pValue as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).pValue) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -752,7 +1451,7 @@ fn bindgen_test_layout_CK_OTP_PARAM() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).ulValueLen as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ulValueLen) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", @@ -779,6 +1478,8 @@ pub struct CK_OTP_PARAMS { } #[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, @@ -790,7 +1491,7 @@ fn bindgen_test_layout_CK_OTP_PARAMS() { concat!("Alignment of ", stringify!(CK_OTP_PARAMS)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).pParams as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).pParams) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -800,7 +1501,7 @@ fn bindgen_test_layout_CK_OTP_PARAMS() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).ulCount as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ulCount) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -827,6 +1528,9 @@ pub struct CK_OTP_SIGNATURE_INFO { } #[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, @@ -838,7 +1542,7 @@ fn bindgen_test_layout_CK_OTP_SIGNATURE_INFO() { concat!("Alignment of ", stringify!(CK_OTP_SIGNATURE_INFO)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).pParams as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).pParams) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -848,7 +1552,7 @@ fn bindgen_test_layout_CK_OTP_SIGNATURE_INFO() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).ulCount as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ulCount) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -877,6 +1581,9 @@ pub struct ck_rsa_pkcs_pss_params { } #[test] fn bindgen_test_layout_ck_rsa_pkcs_pss_params() { + const UNINIT: ::std::mem::MaybeUninit = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), 24usize, @@ -888,7 +1595,7 @@ fn bindgen_test_layout_ck_rsa_pkcs_pss_params() { concat!("Alignment of ", stringify!(ck_rsa_pkcs_pss_params)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).hashAlg as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).hashAlg) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -898,7 +1605,7 @@ fn bindgen_test_layout_ck_rsa_pkcs_pss_params() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).mgf as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).mgf) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -908,7 +1615,7 @@ fn bindgen_test_layout_ck_rsa_pkcs_pss_params() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).sLen as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).sLen) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", @@ -930,6 +1637,9 @@ pub struct ck_rsa_pkcs_oaep_params { } #[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, @@ -941,7 +1651,7 @@ fn bindgen_test_layout_ck_rsa_pkcs_oaep_params() { concat!("Alignment of ", stringify!(ck_rsa_pkcs_oaep_params)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).hashAlg as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).hashAlg) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -951,7 +1661,7 @@ fn bindgen_test_layout_ck_rsa_pkcs_oaep_params() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).mgf as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).mgf) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -961,7 +1671,7 @@ fn bindgen_test_layout_ck_rsa_pkcs_oaep_params() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).source as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).source) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", @@ -971,9 +1681,7 @@ fn bindgen_test_layout_ck_rsa_pkcs_oaep_params() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).pSourceData as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).pSourceData) as usize - ptr as usize }, 24usize, concat!( "Offset of field: ", @@ -983,9 +1691,7 @@ fn bindgen_test_layout_ck_rsa_pkcs_oaep_params() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).ulSourceDataLen as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).ulSourceDataLen) as usize - ptr as usize }, 32usize, concat!( "Offset of field: ", @@ -1012,6 +1718,8 @@ pub struct ck_aes_ctr_params { } #[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, @@ -1023,7 +1731,7 @@ fn bindgen_test_layout_ck_aes_ctr_params() { concat!("Alignment of ", stringify!(ck_aes_ctr_params)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).ulCounterBits as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ulCounterBits) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -1033,7 +1741,7 @@ fn bindgen_test_layout_ck_aes_ctr_params() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).cb as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).cb) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -1055,6 +1763,8 @@ pub struct ck_gcm_params { } #[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, @@ -1066,7 +1776,7 @@ fn bindgen_test_layout_ck_gcm_params() { concat!("Alignment of ", stringify!(ck_gcm_params)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).pIv as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).pIv) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -1076,7 +1786,7 @@ fn bindgen_test_layout_ck_gcm_params() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).ulIvLen as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ulIvLen) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -1086,7 +1796,7 @@ fn bindgen_test_layout_ck_gcm_params() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).ulIvBits as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ulIvBits) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", @@ -1096,7 +1806,7 @@ fn bindgen_test_layout_ck_gcm_params() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).pAAD as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).pAAD) as usize - ptr as usize }, 24usize, concat!( "Offset of field: ", @@ -1106,7 +1816,7 @@ fn bindgen_test_layout_ck_gcm_params() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).ulAADLen as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ulAADLen) as usize - ptr as usize }, 32usize, concat!( "Offset of field: ", @@ -1116,7 +1826,7 @@ fn bindgen_test_layout_ck_gcm_params() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).ulTagBits as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ulTagBits) as usize - ptr as usize }, 40usize, concat!( "Offset of field: ", @@ -1147,6 +1857,9 @@ pub struct ck_ecdh1_derive_params { } #[test] fn bindgen_test_layout_ck_ecdh1_derive_params() { + const UNINIT: ::std::mem::MaybeUninit = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), 40usize, @@ -1158,7 +1871,7 @@ fn bindgen_test_layout_ck_ecdh1_derive_params() { concat!("Alignment of ", stringify!(ck_ecdh1_derive_params)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).kdf as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).kdf) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -1168,9 +1881,7 @@ fn bindgen_test_layout_ck_ecdh1_derive_params() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).ulSharedDataLen as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).ulSharedDataLen) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -1180,9 +1891,7 @@ fn bindgen_test_layout_ck_ecdh1_derive_params() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).pSharedData as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).pSharedData) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", @@ -1192,9 +1901,7 @@ fn bindgen_test_layout_ck_ecdh1_derive_params() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).ulPublicDataLen as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).ulPublicDataLen) as usize - ptr as usize }, 24usize, concat!( "Offset of field: ", @@ -1204,9 +1911,7 @@ fn bindgen_test_layout_ck_ecdh1_derive_params() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).pPublicData as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).pPublicData) as usize - ptr as usize }, 32usize, concat!( "Offset of field: ", @@ -1233,6 +1938,9 @@ pub struct ck_key_derivation_string_data { } #[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, @@ -1244,9 +1952,7 @@ fn bindgen_test_layout_ck_key_derivation_string_data() { concat!("Alignment of ", stringify!(ck_key_derivation_string_data)) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).pData as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).pData) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -1256,9 +1962,7 @@ fn bindgen_test_layout_ck_key_derivation_string_data() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).ulLen as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).ulLen) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -1286,6 +1990,9 @@ pub struct ck_des_cbc_encrypt_data_params { } #[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, @@ -1297,9 +2004,7 @@ fn bindgen_test_layout_ck_des_cbc_encrypt_data_params() { concat!("Alignment of ", stringify!(ck_des_cbc_encrypt_data_params)) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).iv as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).iv) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -1309,9 +2014,7 @@ fn bindgen_test_layout_ck_des_cbc_encrypt_data_params() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).pData as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).pData) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -1321,9 +2024,7 @@ fn bindgen_test_layout_ck_des_cbc_encrypt_data_params() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).length as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).length) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", @@ -1351,6 +2052,9 @@ pub struct ck_aes_cbc_encrypt_data_params { } #[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, @@ -1362,9 +2066,7 @@ fn bindgen_test_layout_ck_aes_cbc_encrypt_data_params() { concat!("Alignment of ", stringify!(ck_aes_cbc_encrypt_data_params)) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).iv as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).iv) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -1374,9 +2076,7 @@ fn bindgen_test_layout_ck_aes_cbc_encrypt_data_params() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).pData as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).pData) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", @@ -1386,9 +2086,7 @@ fn bindgen_test_layout_ck_aes_cbc_encrypt_data_params() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).length as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).length) as usize - ptr as usize }, 24usize, concat!( "Offset of field: ", @@ -1950,6 +2648,8 @@ pub struct _CK_FUNCTION_LIST { } #[test] fn bindgen_test_layout__CK_FUNCTION_LIST() { + const UNINIT: ::std::mem::MaybeUninit<_CK_FUNCTION_LIST> = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<_CK_FUNCTION_LIST>(), 552usize, @@ -1961,7 +2661,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { concat!("Alignment of ", stringify!(_CK_FUNCTION_LIST)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).version as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).version) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -1971,7 +2671,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_Initialize as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_Initialize) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -1981,7 +2681,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_Finalize as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_Finalize) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", @@ -1991,7 +2691,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_GetInfo as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_GetInfo) as usize - ptr as usize }, 24usize, concat!( "Offset of field: ", @@ -2001,9 +2701,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_GetFunctionList as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_GetFunctionList) as usize - ptr as usize }, 32usize, concat!( "Offset of field: ", @@ -2013,7 +2711,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_GetSlotList as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_GetSlotList) as usize - ptr as usize }, 40usize, concat!( "Offset of field: ", @@ -2023,7 +2721,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_GetSlotInfo as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_GetSlotInfo) as usize - ptr as usize }, 48usize, concat!( "Offset of field: ", @@ -2033,9 +2731,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_GetTokenInfo as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_GetTokenInfo) as usize - ptr as usize }, 56usize, concat!( "Offset of field: ", @@ -2045,9 +2741,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_GetMechanismList as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_GetMechanismList) as usize - ptr as usize }, 64usize, concat!( "Offset of field: ", @@ -2057,9 +2751,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_GetMechanismInfo as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_GetMechanismInfo) as usize - ptr as usize }, 72usize, concat!( "Offset of field: ", @@ -2069,7 +2761,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_InitToken as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_InitToken) as usize - ptr as usize }, 80usize, concat!( "Offset of field: ", @@ -2079,7 +2771,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_InitPIN as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_InitPIN) as usize - ptr as usize }, 88usize, concat!( "Offset of field: ", @@ -2089,7 +2781,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_SetPIN as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_SetPIN) as usize - ptr as usize }, 96usize, concat!( "Offset of field: ", @@ -2099,7 +2791,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_OpenSession as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_OpenSession) as usize - ptr as usize }, 104usize, concat!( "Offset of field: ", @@ -2109,9 +2801,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_CloseSession as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_CloseSession) as usize - ptr as usize }, 112usize, concat!( "Offset of field: ", @@ -2121,9 +2811,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_CloseAllSessions as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_CloseAllSessions) as usize - ptr as usize }, 120usize, concat!( "Offset of field: ", @@ -2133,9 +2821,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_GetSessionInfo as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_GetSessionInfo) as usize - ptr as usize }, 128usize, concat!( "Offset of field: ", @@ -2145,9 +2831,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_GetOperationState as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_GetOperationState) as usize - ptr as usize }, 136usize, concat!( "Offset of field: ", @@ -2157,9 +2841,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_SetOperationState as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_SetOperationState) as usize - ptr as usize }, 144usize, concat!( "Offset of field: ", @@ -2169,7 +2851,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_Login as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_Login) as usize - ptr as usize }, 152usize, concat!( "Offset of field: ", @@ -2179,7 +2861,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_Logout as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_Logout) as usize - ptr as usize }, 160usize, concat!( "Offset of field: ", @@ -2189,9 +2871,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_CreateObject as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_CreateObject) as usize - ptr as usize }, 168usize, concat!( "Offset of field: ", @@ -2201,7 +2881,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_CopyObject as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_CopyObject) as usize - ptr as usize }, 176usize, concat!( "Offset of field: ", @@ -2211,9 +2891,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_DestroyObject as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_DestroyObject) as usize - ptr as usize }, 184usize, concat!( "Offset of field: ", @@ -2223,9 +2901,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_GetObjectSize as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_GetObjectSize) as usize - ptr as usize }, 192usize, concat!( "Offset of field: ", @@ -2235,9 +2911,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_GetAttributeValue as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_GetAttributeValue) as usize - ptr as usize }, 200usize, concat!( "Offset of field: ", @@ -2247,9 +2921,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_SetAttributeValue as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_SetAttributeValue) as usize - ptr as usize }, 208usize, concat!( "Offset of field: ", @@ -2259,9 +2931,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_FindObjectsInit as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_FindObjectsInit) as usize - ptr as usize }, 216usize, concat!( "Offset of field: ", @@ -2271,7 +2941,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_FindObjects as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_FindObjects) as usize - ptr as usize }, 224usize, concat!( "Offset of field: ", @@ -2281,9 +2951,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_FindObjectsFinal as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_FindObjectsFinal) as usize - ptr as usize }, 232usize, concat!( "Offset of field: ", @@ -2293,7 +2961,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_EncryptInit as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_EncryptInit) as usize - ptr as usize }, 240usize, concat!( "Offset of field: ", @@ -2303,7 +2971,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_Encrypt as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_Encrypt) as usize - ptr as usize }, 248usize, concat!( "Offset of field: ", @@ -2313,9 +2981,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_EncryptUpdate as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_EncryptUpdate) as usize - ptr as usize }, 256usize, concat!( "Offset of field: ", @@ -2325,9 +2991,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_EncryptFinal as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_EncryptFinal) as usize - ptr as usize }, 264usize, concat!( "Offset of field: ", @@ -2337,7 +3001,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_DecryptInit as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_DecryptInit) as usize - ptr as usize }, 272usize, concat!( "Offset of field: ", @@ -2347,7 +3011,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_Decrypt as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_Decrypt) as usize - ptr as usize }, 280usize, concat!( "Offset of field: ", @@ -2357,9 +3021,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_DecryptUpdate as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_DecryptUpdate) as usize - ptr as usize }, 288usize, concat!( "Offset of field: ", @@ -2369,9 +3031,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_DecryptFinal as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_DecryptFinal) as usize - ptr as usize }, 296usize, concat!( "Offset of field: ", @@ -2381,7 +3041,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_DigestInit as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_DigestInit) as usize - ptr as usize }, 304usize, concat!( "Offset of field: ", @@ -2391,7 +3051,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_Digest as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_Digest) as usize - ptr as usize }, 312usize, concat!( "Offset of field: ", @@ -2401,9 +3061,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_DigestUpdate as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_DigestUpdate) as usize - ptr as usize }, 320usize, concat!( "Offset of field: ", @@ -2413,7 +3071,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_DigestKey as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_DigestKey) as usize - ptr as usize }, 328usize, concat!( "Offset of field: ", @@ -2423,7 +3081,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_DigestFinal as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_DigestFinal) as usize - ptr as usize }, 336usize, concat!( "Offset of field: ", @@ -2433,7 +3091,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_SignInit as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_SignInit) as usize - ptr as usize }, 344usize, concat!( "Offset of field: ", @@ -2443,7 +3101,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_Sign as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_Sign) as usize - ptr as usize }, 352usize, concat!( "Offset of field: ", @@ -2453,7 +3111,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_SignUpdate as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_SignUpdate) as usize - ptr as usize }, 360usize, concat!( "Offset of field: ", @@ -2463,7 +3121,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_SignFinal as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_SignFinal) as usize - ptr as usize }, 368usize, concat!( "Offset of field: ", @@ -2473,9 +3131,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_SignRecoverInit as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_SignRecoverInit) as usize - ptr as usize }, 376usize, concat!( "Offset of field: ", @@ -2485,7 +3141,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_SignRecover as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_SignRecover) as usize - ptr as usize }, 384usize, concat!( "Offset of field: ", @@ -2495,7 +3151,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_VerifyInit as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_VerifyInit) as usize - ptr as usize }, 392usize, concat!( "Offset of field: ", @@ -2505,7 +3161,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_Verify as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_Verify) as usize - ptr as usize }, 400usize, concat!( "Offset of field: ", @@ -2515,9 +3171,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_VerifyUpdate as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_VerifyUpdate) as usize - ptr as usize }, 408usize, concat!( "Offset of field: ", @@ -2527,7 +3181,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_VerifyFinal as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_VerifyFinal) as usize - ptr as usize }, 416usize, concat!( "Offset of field: ", @@ -2537,9 +3191,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_VerifyRecoverInit as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_VerifyRecoverInit) as usize - ptr as usize }, 424usize, concat!( "Offset of field: ", @@ -2549,9 +3201,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_VerifyRecover as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_VerifyRecover) as usize - ptr as usize }, 432usize, concat!( "Offset of field: ", @@ -2561,9 +3211,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_DigestEncryptUpdate as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_DigestEncryptUpdate) as usize - ptr as usize }, 440usize, concat!( "Offset of field: ", @@ -2573,9 +3221,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_DecryptDigestUpdate as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_DecryptDigestUpdate) as usize - ptr as usize }, 448usize, concat!( "Offset of field: ", @@ -2585,9 +3231,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_SignEncryptUpdate as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_SignEncryptUpdate) as usize - ptr as usize }, 456usize, concat!( "Offset of field: ", @@ -2597,9 +3241,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_DecryptVerifyUpdate as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_DecryptVerifyUpdate) as usize - ptr as usize }, 464usize, concat!( "Offset of field: ", @@ -2609,7 +3251,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_GenerateKey as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_GenerateKey) as usize - ptr as usize }, 472usize, concat!( "Offset of field: ", @@ -2619,9 +3261,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_GenerateKeyPair as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_GenerateKeyPair) as usize - ptr as usize }, 480usize, concat!( "Offset of field: ", @@ -2631,7 +3271,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_WrapKey as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_WrapKey) as usize - ptr as usize }, 488usize, concat!( "Offset of field: ", @@ -2641,7 +3281,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_UnwrapKey as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_UnwrapKey) as usize - ptr as usize }, 496usize, concat!( "Offset of field: ", @@ -2651,7 +3291,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_DeriveKey as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_DeriveKey) as usize - ptr as usize }, 504usize, concat!( "Offset of field: ", @@ -2661,7 +3301,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_SeedRandom as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_SeedRandom) as usize - ptr as usize }, 512usize, concat!( "Offset of field: ", @@ -2671,9 +3311,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_GenerateRandom as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_GenerateRandom) as usize - ptr as usize }, 520usize, concat!( "Offset of field: ", @@ -2683,9 +3321,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_GetFunctionStatus as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_GetFunctionStatus) as usize - ptr as usize }, 528usize, concat!( "Offset of field: ", @@ -2695,9 +3331,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_CancelFunction as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_CancelFunction) as usize - ptr as usize }, 536usize, concat!( "Offset of field: ", @@ -2707,9 +3341,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_WaitForSlotEvent as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_WaitForSlotEvent) as usize - ptr as usize }, 544usize, concat!( "Offset of field: ", @@ -2739,6 +3371,9 @@ pub struct _CK_C_INITIALIZE_ARGS { } #[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, @@ -2750,9 +3385,7 @@ fn bindgen_test_layout__CK_C_INITIALIZE_ARGS() { concat!("Alignment of ", stringify!(_CK_C_INITIALIZE_ARGS)) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_C_INITIALIZE_ARGS>())).CreateMutex as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).CreateMutex) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -2762,9 +3395,7 @@ fn bindgen_test_layout__CK_C_INITIALIZE_ARGS() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_C_INITIALIZE_ARGS>())).DestroyMutex as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).DestroyMutex) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -2774,7 +3405,7 @@ fn bindgen_test_layout__CK_C_INITIALIZE_ARGS() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_C_INITIALIZE_ARGS>())).LockMutex as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).LockMutex) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", @@ -2784,9 +3415,7 @@ fn bindgen_test_layout__CK_C_INITIALIZE_ARGS() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_C_INITIALIZE_ARGS>())).UnlockMutex as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).UnlockMutex) as usize - ptr as usize }, 24usize, concat!( "Offset of field: ", @@ -2796,7 +3425,7 @@ fn bindgen_test_layout__CK_C_INITIALIZE_ARGS() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_C_INITIALIZE_ARGS>())).flags as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).flags) as usize - ptr as usize }, 32usize, concat!( "Offset of field: ", @@ -2806,7 +3435,7 @@ fn bindgen_test_layout__CK_C_INITIALIZE_ARGS() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_C_INITIALIZE_ARGS>())).pReserved as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).pReserved) as usize - ptr as usize }, 40usize, concat!( "Offset of field: ", @@ -2825,8 +3454,6 @@ impl Default for _CK_C_INITIALIZE_ARGS { } } } -pub type size_t = ::std::os::raw::c_ulong; -pub type wchar_t = ::std::os::raw::c_int; 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; @@ -2893,10 +3520,529 @@ pub type CK_AES_CBC_ENCRYPT_DATA_PARAMS_PTR = *mut ck_aes_cbc_encrypt_data_param 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_GetFunctionList: Result< unsafe extern "C" fn(function_list: *mut *mut _CK_FUNCTION_LIST) -> 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, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_GetSlotInfo: Result< + unsafe extern "C" fn(slotID: CK_SLOT_ID, info: *mut _CK_SLOT_INFO) -> 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, + ::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, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_GetMechanismInfo: Result< + unsafe extern "C" fn( + slotID: CK_SLOT_ID, + type_: CK_MECHANISM_TYPE, + info: *mut _CK_MECHANISM_INFO, + ) -> 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, + ) -> 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, + ) -> 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, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_OpenSession: Result< + 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, + ::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(session: CK_SESSION_HANDLE, info: *mut _CK_SESSION_INFO) -> 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, + ) -> 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, + ) -> 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, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_Logout: + 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, + ) -> 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, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_DestroyObject: Result< + unsafe extern "C" fn(session: CK_SESSION_HANDLE, object: 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, + ) -> 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, + ) -> 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, + ) -> 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, + ) -> 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, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_FindObjectsFinal: + 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, + ) -> 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, + ) -> 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, + ) -> 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, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_DecryptInit: Result< + unsafe extern "C" fn( + session: CK_SESSION_HANDLE, + mechanism: *mut _CK_MECHANISM, + key: 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, + ) -> 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, + ) -> 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, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_DigestInit: Result< + unsafe extern "C" fn(session: CK_SESSION_HANDLE, mechanism: *mut _CK_MECHANISM) -> 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, + ) -> 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, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_DigestKey: Result< + unsafe extern "C" fn(session: CK_SESSION_HANDLE, key: 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, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_SignInit: Result< + unsafe extern "C" fn( + session: CK_SESSION_HANDLE, + mechanism: *mut _CK_MECHANISM, + key: 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, + ) -> 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, + ) -> 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, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_SignRecoverInit: Result< + unsafe extern "C" fn( + session: CK_SESSION_HANDLE, + mechanism: *mut _CK_MECHANISM, + key: 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, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_VerifyInit: Result< + unsafe extern "C" fn( + session: CK_SESSION_HANDLE, + mechanism: *mut _CK_MECHANISM, + key: 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, + ) -> 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, + ) -> 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, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_VerifyRecoverInit: Result< + unsafe extern "C" fn( + session: CK_SESSION_HANDLE, + mechanism: *mut _CK_MECHANISM, + key: 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, + ) -> 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, + ) -> 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, + ) -> 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, + ) -> 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, + ) -> 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, + ) -> 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, + ) -> 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, + ) -> 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, + ) -> 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, + ) -> 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, + ) -> 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, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_GetFunctionStatus: + Result CK_RV, ::libloading::Error>, + pub C_CancelFunction: + Result CK_RV, ::libloading::Error>, } impl Pkcs11 { pub unsafe fn new

(path: P) -> Result @@ -2911,16 +4057,1010 @@ impl Pkcs11 { 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_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); + 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); Ok(Pkcs11 { __library, + C_Initialize, + C_Finalize, + C_GetInfo, C_GetFunctionList, + C_GetSlotList, + C_GetSlotInfo, + C_GetTokenInfo, + C_WaitForSlotEvent, + 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, }) } + pub unsafe fn C_Initialize(&self, init_args: *mut ::std::os::raw::c_void) -> CK_RV { + (self + .C_Initialize + .as_ref() + .expect("Expected function, got error."))(init_args) + } + pub unsafe fn C_Finalize(&self, pReserved: *mut ::std::os::raw::c_void) -> 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 { + (self + .C_GetInfo + .as_ref() + .expect("Expected function, got error."))(info) + } pub unsafe fn C_GetFunctionList(&self, function_list: *mut *mut _CK_FUNCTION_LIST) -> CK_RV { (self .C_GetFunctionList .as_ref() .expect("Expected function, got error."))(function_list) } + 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, + ) -> CK_RV { + (self + .C_GetSlotList + .as_ref() + .expect("Expected function, got error."))(token_present, slot_list, ulCount) + } + pub unsafe fn C_GetSlotInfo(&self, slotID: CK_SLOT_ID, info: *mut _CK_SLOT_INFO) -> CK_RV { + (self + .C_GetSlotInfo + .as_ref() + .expect("Expected function, got error."))(slotID, info) + } + pub unsafe fn C_GetTokenInfo(&self, slotID: CK_SLOT_ID, info: *mut _CK_TOKEN_INFO) -> 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) + } + pub unsafe fn C_GetMechanismList( + &self, + slotID: CK_SLOT_ID, + mechanism_list: *mut CK_MECHANISM_TYPE, + ulCount: *mut ::std::os::raw::c_ulong, + ) -> CK_RV { + (self + .C_GetMechanismList + .as_ref() + .expect("Expected function, got error."))(slotID, mechanism_list, ulCount) + } + pub unsafe fn C_GetMechanismInfo( + &self, + slotID: CK_SLOT_ID, + type_: CK_MECHANISM_TYPE, + info: *mut _CK_MECHANISM_INFO, + ) -> CK_RV { + (self + .C_GetMechanismInfo + .as_ref() + .expect("Expected function, got error."))(slotID, type_, info) + } + 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, + ) -> CK_RV { + (self + .C_InitToken + .as_ref() + .expect("Expected function, got error."))(slotID, pin, pin_len, label) + } + pub unsafe fn C_InitPIN( + &self, + session: CK_SESSION_HANDLE, + pin: *mut ::std::os::raw::c_uchar, + pin_len: ::std::os::raw::c_ulong, + ) -> CK_RV { + (self + .C_InitPIN + .as_ref() + .expect("Expected function, got error."))(session, pin, pin_len) + } + 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, + ) -> CK_RV { + (self + .C_SetPIN + .as_ref() + .expect("Expected function, got error."))( + session, old_pin, old_len, new_pin, new_len + ) + } + 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, + ) -> CK_RV { + (self + .C_OpenSession + .as_ref() + .expect("Expected function, got error."))( + slotID, flags, application, notify, session + ) + } + pub unsafe fn C_CloseSession(&self, session: CK_SESSION_HANDLE) -> CK_RV { + (self + .C_CloseSession + .as_ref() + .expect("Expected function, got error."))(session) + } + 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, + session: CK_SESSION_HANDLE, + info: *mut _CK_SESSION_INFO, + ) -> CK_RV { + (self + .C_GetSessionInfo + .as_ref() + .expect("Expected function, got error."))(session, info) + } + 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, + ) -> CK_RV { + (self + .C_GetOperationState + .as_ref() + .expect("Expected function, got error."))( + session, operation_state, operation_state_len + ) + } + 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, + ) -> CK_RV { + (self + .C_SetOperationState + .as_ref() + .expect("Expected function, got error."))( + session, + operation_state, + operation_state_len, + encryption_key, + authentiation_key, + ) + } + 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, + ) -> CK_RV { + (self + .C_Login + .as_ref() + .expect("Expected function, got error."))(session, user_type, pin, pin_len) + } + pub unsafe fn C_Logout(&self, session: CK_SESSION_HANDLE) -> CK_RV { + (self + .C_Logout + .as_ref() + .expect("Expected function, got error."))(session) + } + 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, + ) -> CK_RV { + (self + .C_CreateObject + .as_ref() + .expect("Expected function, got error."))(session, templ, ulCount, object) + } + 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, + ) -> CK_RV { + (self + .C_CopyObject + .as_ref() + .expect("Expected function, got error."))( + session, object, templ, ulCount, new_object + ) + } + pub unsafe fn C_DestroyObject( + &self, + session: CK_SESSION_HANDLE, + object: CK_OBJECT_HANDLE, + ) -> CK_RV { + (self + .C_DestroyObject + .as_ref() + .expect("Expected function, got error."))(session, object) + } + pub unsafe fn C_GetObjectSize( + &self, + session: CK_SESSION_HANDLE, + object: CK_OBJECT_HANDLE, + size: *mut ::std::os::raw::c_ulong, + ) -> CK_RV { + (self + .C_GetObjectSize + .as_ref() + .expect("Expected function, got error."))(session, object, size) + } + pub unsafe fn C_GetAttributeValue( + &self, + session: CK_SESSION_HANDLE, + object: CK_OBJECT_HANDLE, + templ: *mut _CK_ATTRIBUTE, + ulCount: ::std::os::raw::c_ulong, + ) -> CK_RV { + (self + .C_GetAttributeValue + .as_ref() + .expect("Expected function, got error."))(session, object, templ, 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, + ) -> CK_RV { + (self + .C_SetAttributeValue + .as_ref() + .expect("Expected function, got error."))(session, object, templ, ulCount) + } + pub unsafe fn C_FindObjectsInit( + &self, + session: CK_SESSION_HANDLE, + templ: *mut _CK_ATTRIBUTE, + ulCount: ::std::os::raw::c_ulong, + ) -> CK_RV { + (self + .C_FindObjectsInit + .as_ref() + .expect("Expected function, got error."))(session, templ, 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, + ) -> CK_RV { + (self + .C_FindObjects + .as_ref() + .expect("Expected function, got error."))( + session, + object, + max_object_count, + object_count, + ) + } + pub unsafe fn C_FindObjectsFinal(&self, session: CK_SESSION_HANDLE) -> CK_RV { + (self + .C_FindObjectsFinal + .as_ref() + .expect("Expected function, got error."))(session) + } + pub unsafe fn C_EncryptInit( + &self, + session: CK_SESSION_HANDLE, + mechanism: *mut _CK_MECHANISM, + key: CK_OBJECT_HANDLE, + ) -> CK_RV { + (self + .C_EncryptInit + .as_ref() + .expect("Expected function, got error."))(session, mechanism, key) + } + 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, + ) -> CK_RV { + (self + .C_Encrypt + .as_ref() + .expect("Expected function, got error."))( + session, + data, + data_len, + encrypted_data, + encrypted_data_len, + ) + } + 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, + ) -> CK_RV { + (self + .C_EncryptUpdate + .as_ref() + .expect("Expected function, got error."))( + session, + part, + part_len, + encrypted_part, + encrypted_part_len, + ) + } + 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, + ) -> CK_RV { + (self + .C_EncryptFinal + .as_ref() + .expect("Expected function, got error."))( + session, + last_encrypted_part, + last_encrypted_part_len, + ) + } + pub unsafe fn C_DecryptInit( + &self, + session: CK_SESSION_HANDLE, + mechanism: *mut _CK_MECHANISM, + key: CK_OBJECT_HANDLE, + ) -> CK_RV { + (self + .C_DecryptInit + .as_ref() + .expect("Expected function, got error."))(session, mechanism, key) + } + 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, + ) -> CK_RV { + (self + .C_Decrypt + .as_ref() + .expect("Expected function, got error."))( + session, + encrypted_data, + encrypted_data_len, + data, + data_len, + ) + } + 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, + ) -> CK_RV { + (self + .C_DecryptUpdate + .as_ref() + .expect("Expected function, got error."))( + session, + encrypted_part, + encrypted_part_len, + part, + part_len, + ) + } + 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, + ) -> CK_RV { + (self + .C_DecryptFinal + .as_ref() + .expect("Expected function, got error."))(session, last_part, last_part_len) + } + pub unsafe fn C_DigestInit( + &self, + session: CK_SESSION_HANDLE, + mechanism: *mut _CK_MECHANISM, + ) -> CK_RV { + (self + .C_DigestInit + .as_ref() + .expect("Expected function, got error."))(session, mechanism) + } + 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, + ) -> CK_RV { + (self + .C_Digest + .as_ref() + .expect("Expected function, got error."))( + session, data, data_len, digest, digest_len + ) + } + pub unsafe fn C_DigestUpdate( + &self, + session: CK_SESSION_HANDLE, + part: *mut ::std::os::raw::c_uchar, + part_len: ::std::os::raw::c_ulong, + ) -> CK_RV { + (self + .C_DigestUpdate + .as_ref() + .expect("Expected function, got error."))(session, part, part_len) + } + pub unsafe fn C_DigestKey(&self, session: CK_SESSION_HANDLE, key: CK_OBJECT_HANDLE) -> CK_RV { + (self + .C_DigestKey + .as_ref() + .expect("Expected function, got error."))(session, key) + } + 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, + ) -> CK_RV { + (self + .C_DigestFinal + .as_ref() + .expect("Expected function, got error."))(session, digest, digest_len) + } + pub unsafe fn C_SignInit( + &self, + session: CK_SESSION_HANDLE, + mechanism: *mut _CK_MECHANISM, + key: CK_OBJECT_HANDLE, + ) -> CK_RV { + (self + .C_SignInit + .as_ref() + .expect("Expected function, got error."))(session, mechanism, key) + } + 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, + ) -> CK_RV { + (self.C_Sign.as_ref().expect("Expected function, got error."))( + session, + data, + data_len, + signature, + signature_len, + ) + } + pub unsafe fn C_SignUpdate( + &self, + session: CK_SESSION_HANDLE, + part: *mut ::std::os::raw::c_uchar, + part_len: ::std::os::raw::c_ulong, + ) -> CK_RV { + (self + .C_SignUpdate + .as_ref() + .expect("Expected function, got error."))(session, part, part_len) + } + 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, + ) -> CK_RV { + (self + .C_SignFinal + .as_ref() + .expect("Expected function, got error."))(session, signature, signature_len) + } + pub unsafe fn C_SignRecoverInit( + &self, + session: CK_SESSION_HANDLE, + mechanism: *mut _CK_MECHANISM, + key: CK_OBJECT_HANDLE, + ) -> CK_RV { + (self + .C_SignRecoverInit + .as_ref() + .expect("Expected function, got error."))(session, mechanism, key) + } + 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, + ) -> CK_RV { + (self + .C_SignRecover + .as_ref() + .expect("Expected function, got error."))( + session, + data, + data_len, + signature, + signature_len, + ) + } + pub unsafe fn C_VerifyInit( + &self, + session: CK_SESSION_HANDLE, + mechanism: *mut _CK_MECHANISM, + key: CK_OBJECT_HANDLE, + ) -> CK_RV { + (self + .C_VerifyInit + .as_ref() + .expect("Expected function, got error."))(session, mechanism, key) + } + 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, + ) -> CK_RV { + (self + .C_Verify + .as_ref() + .expect("Expected function, got error."))( + session, + data, + data_len, + signature, + signature_len, + ) + } + pub unsafe fn C_VerifyUpdate( + &self, + session: CK_SESSION_HANDLE, + part: *mut ::std::os::raw::c_uchar, + part_len: ::std::os::raw::c_ulong, + ) -> CK_RV { + (self + .C_VerifyUpdate + .as_ref() + .expect("Expected function, got error."))(session, part, part_len) + } + pub unsafe fn C_VerifyFinal( + &self, + session: CK_SESSION_HANDLE, + signature: *mut ::std::os::raw::c_uchar, + signature_len: ::std::os::raw::c_ulong, + ) -> CK_RV { + (self + .C_VerifyFinal + .as_ref() + .expect("Expected function, got error."))(session, signature, signature_len) + } + pub unsafe fn C_VerifyRecoverInit( + &self, + session: CK_SESSION_HANDLE, + mechanism: *mut _CK_MECHANISM, + key: CK_OBJECT_HANDLE, + ) -> CK_RV { + (self + .C_VerifyRecoverInit + .as_ref() + .expect("Expected function, got error."))(session, mechanism, key) + } + 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, + ) -> CK_RV { + (self + .C_VerifyRecover + .as_ref() + .expect("Expected function, got error."))( + session, + signature, + signature_len, + data, + data_len, + ) + } + 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, + ) -> CK_RV { + (self + .C_DigestEncryptUpdate + .as_ref() + .expect("Expected function, got error."))( + session, + part, + part_len, + encrypted_part, + encrypted_part_len, + ) + } + 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, + ) -> CK_RV { + (self + .C_DecryptDigestUpdate + .as_ref() + .expect("Expected function, got error."))( + session, + encrypted_part, + encrypted_part_len, + part, + part_len, + ) + } + 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, + ) -> CK_RV { + (self + .C_SignEncryptUpdate + .as_ref() + .expect("Expected function, got error."))( + session, + part, + part_len, + encrypted_part, + encrypted_part_len, + ) + } + 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, + ) -> CK_RV { + (self + .C_DecryptVerifyUpdate + .as_ref() + .expect("Expected function, got error."))( + session, + encrypted_part, + encrypted_part_len, + part, + part_len, + ) + } + 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, + ) -> CK_RV { + (self + .C_GenerateKey + .as_ref() + .expect("Expected function, got error."))( + session, mechanism, templ, ulCount, key + ) + } + 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, + ) -> 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, + ) + } + 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, + ) -> CK_RV { + (self + .C_WrapKey + .as_ref() + .expect("Expected function, got error."))( + session, + mechanism, + wrapping_key, + key, + wrapped_key, + wrapped_key_len, + ) + } + 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, + ) -> 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, + ) + } + 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, + ) -> CK_RV { + (self + .C_DeriveKey + .as_ref() + .expect("Expected function, got error."))( + session, + mechanism, + base_key, + templ, + attribute_count, + key, + ) + } + pub unsafe fn C_SeedRandom( + &self, + session: CK_SESSION_HANDLE, + seed: *mut ::std::os::raw::c_uchar, + seed_len: ::std::os::raw::c_ulong, + ) -> CK_RV { + (self + .C_SeedRandom + .as_ref() + .expect("Expected function, got error."))(session, seed, seed_len) + } + 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, + ) -> CK_RV { + (self + .C_GenerateRandom + .as_ref() + .expect("Expected function, got error."))(session, random_data, random_len) + } + pub unsafe fn C_GetFunctionStatus(&self, session: CK_SESSION_HANDLE) -> CK_RV { + (self + .C_GetFunctionStatus + .as_ref() + .expect("Expected function, got error."))(session) + } + pub unsafe fn C_CancelFunction(&self, session: CK_SESSION_HANDLE) -> CK_RV { + (self + .C_CancelFunction + .as_ref() + .expect("Expected function, got error."))(session) + } } 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 e8699a8b..6800365c 100644 --- a/cryptoki-sys/src/bindings/x86_64-unknown-linux-gnu.rs +++ b/cryptoki-sys/src/bindings/x86_64-unknown-linux-gnu.rs @@ -1,5 +1,691 @@ -/* automatically generated by rust-bindgen 0.59.2 */ +/* 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 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 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; +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 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 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_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_EC_EDWARDS: CK_KEY_TYPE = 64; +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 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_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_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_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_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; +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 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_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_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_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_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_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_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_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_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_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_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_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_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_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 CKF_HW: CK_FLAGS = 1; +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_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 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_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_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 = 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_FUNCTION_REJECTED: CK_RV = 512; +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; #[repr(C)] #[derive(Debug, Default, Copy, Clone)] @@ -9,6 +695,8 @@ pub struct _CK_VERSION { } #[test] fn bindgen_test_layout__CK_VERSION() { + const UNINIT: ::std::mem::MaybeUninit<_CK_VERSION> = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<_CK_VERSION>(), 2usize, @@ -20,7 +708,7 @@ fn bindgen_test_layout__CK_VERSION() { concat!("Alignment of ", stringify!(_CK_VERSION)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_VERSION>())).major as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).major) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -30,7 +718,7 @@ fn bindgen_test_layout__CK_VERSION() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_VERSION>())).minor as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).minor) as usize - ptr as usize }, 1usize, concat!( "Offset of field: ", @@ -51,6 +739,8 @@ pub struct _CK_INFO { } #[test] fn bindgen_test_layout__CK_INFO() { + const UNINIT: ::std::mem::MaybeUninit<_CK_INFO> = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<_CK_INFO>(), 88usize, @@ -62,7 +752,7 @@ fn bindgen_test_layout__CK_INFO() { concat!("Alignment of ", stringify!(_CK_INFO)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_INFO>())).cryptokiVersion as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).cryptokiVersion) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -72,7 +762,7 @@ fn bindgen_test_layout__CK_INFO() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_INFO>())).manufacturerID as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).manufacturerID) as usize - ptr as usize }, 2usize, concat!( "Offset of field: ", @@ -82,7 +772,7 @@ fn bindgen_test_layout__CK_INFO() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_INFO>())).flags as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).flags) as usize - ptr as usize }, 40usize, concat!( "Offset of field: ", @@ -92,7 +782,7 @@ fn bindgen_test_layout__CK_INFO() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_INFO>())).libraryDescription as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).libraryDescription) as usize - ptr as usize }, 48usize, concat!( "Offset of field: ", @@ -102,7 +792,7 @@ fn bindgen_test_layout__CK_INFO() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_INFO>())).libraryVersion as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).libraryVersion) as usize - ptr as usize }, 80usize, concat!( "Offset of field: ", @@ -113,6 +803,7 @@ fn bindgen_test_layout__CK_INFO() { ); } 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; #[repr(C)] #[derive(Debug, Copy, Clone)] @@ -125,6 +816,8 @@ pub struct _CK_SLOT_INFO { } #[test] fn bindgen_test_layout__CK_SLOT_INFO() { + const UNINIT: ::std::mem::MaybeUninit<_CK_SLOT_INFO> = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<_CK_SLOT_INFO>(), 112usize, @@ -136,7 +829,7 @@ fn bindgen_test_layout__CK_SLOT_INFO() { concat!("Alignment of ", stringify!(_CK_SLOT_INFO)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_SLOT_INFO>())).slotDescription as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).slotDescription) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -146,7 +839,7 @@ fn bindgen_test_layout__CK_SLOT_INFO() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_SLOT_INFO>())).manufacturerID as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).manufacturerID) as usize - ptr as usize }, 64usize, concat!( "Offset of field: ", @@ -156,7 +849,7 @@ fn bindgen_test_layout__CK_SLOT_INFO() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_SLOT_INFO>())).flags as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).flags) as usize - ptr as usize }, 96usize, concat!( "Offset of field: ", @@ -166,7 +859,7 @@ fn bindgen_test_layout__CK_SLOT_INFO() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_SLOT_INFO>())).hardwareVersion as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).hardwareVersion) as usize - ptr as usize }, 104usize, concat!( "Offset of field: ", @@ -176,7 +869,7 @@ fn bindgen_test_layout__CK_SLOT_INFO() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_SLOT_INFO>())).firmwareVersion as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).firmwareVersion) as usize - ptr as usize }, 106usize, concat!( "Offset of field: ", @@ -195,6 +888,10 @@ 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; #[repr(C)] #[derive(Debug, Default, Copy, Clone)] pub struct _CK_TOKEN_INFO { @@ -219,6 +916,8 @@ pub struct _CK_TOKEN_INFO { } #[test] fn bindgen_test_layout__CK_TOKEN_INFO() { + const UNINIT: ::std::mem::MaybeUninit<_CK_TOKEN_INFO> = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<_CK_TOKEN_INFO>(), 208usize, @@ -230,7 +929,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { concat!("Alignment of ", stringify!(_CK_TOKEN_INFO)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_TOKEN_INFO>())).label as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).label) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -240,7 +939,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_TOKEN_INFO>())).manufacturerID as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).manufacturerID) as usize - ptr as usize }, 32usize, concat!( "Offset of field: ", @@ -250,7 +949,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_TOKEN_INFO>())).model as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).model) as usize - ptr as usize }, 64usize, concat!( "Offset of field: ", @@ -260,7 +959,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_TOKEN_INFO>())).serialNumber as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).serialNumber) as usize - ptr as usize }, 80usize, concat!( "Offset of field: ", @@ -270,7 +969,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_TOKEN_INFO>())).flags as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).flags) as usize - ptr as usize }, 96usize, concat!( "Offset of field: ", @@ -280,9 +979,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_TOKEN_INFO>())).ulMaxSessionCount as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).ulMaxSessionCount) as usize - ptr as usize }, 104usize, concat!( "Offset of field: ", @@ -292,7 +989,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_TOKEN_INFO>())).ulSessionCount as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ulSessionCount) as usize - ptr as usize }, 112usize, concat!( "Offset of field: ", @@ -302,9 +999,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_TOKEN_INFO>())).ulMaxRwSessionCount as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).ulMaxRwSessionCount) as usize - ptr as usize }, 120usize, concat!( "Offset of field: ", @@ -314,7 +1009,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_TOKEN_INFO>())).ulRwSessionCount as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ulRwSessionCount) as usize - ptr as usize }, 128usize, concat!( "Offset of field: ", @@ -324,7 +1019,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_TOKEN_INFO>())).ulMaxPinLen as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ulMaxPinLen) as usize - ptr as usize }, 136usize, concat!( "Offset of field: ", @@ -334,7 +1029,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_TOKEN_INFO>())).ulMinPinLen as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ulMinPinLen) as usize - ptr as usize }, 144usize, concat!( "Offset of field: ", @@ -344,9 +1039,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_TOKEN_INFO>())).ulTotalPublicMemory as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).ulTotalPublicMemory) as usize - ptr as usize }, 152usize, concat!( "Offset of field: ", @@ -356,9 +1049,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_TOKEN_INFO>())).ulFreePublicMemory as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).ulFreePublicMemory) as usize - ptr as usize }, 160usize, concat!( "Offset of field: ", @@ -368,9 +1059,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_TOKEN_INFO>())).ulTotalPrivateMemory as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).ulTotalPrivateMemory) as usize - ptr as usize }, 168usize, concat!( "Offset of field: ", @@ -380,9 +1069,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_TOKEN_INFO>())).ulFreePrivateMemory as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).ulFreePrivateMemory) as usize - ptr as usize }, 176usize, concat!( "Offset of field: ", @@ -392,7 +1079,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_TOKEN_INFO>())).hardwareVersion as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).hardwareVersion) as usize - ptr as usize }, 184usize, concat!( "Offset of field: ", @@ -402,7 +1089,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_TOKEN_INFO>())).firmwareVersion as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).firmwareVersion) as usize - ptr as usize }, 186usize, concat!( "Offset of field: ", @@ -412,7 +1099,7 @@ fn bindgen_test_layout__CK_TOKEN_INFO() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_TOKEN_INFO>())).utcTime as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).utcTime) as usize - ptr as usize }, 188usize, concat!( "Offset of field: ", @@ -435,6 +1122,8 @@ pub struct _CK_SESSION_INFO { } #[test] fn bindgen_test_layout__CK_SESSION_INFO() { + const UNINIT: ::std::mem::MaybeUninit<_CK_SESSION_INFO> = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<_CK_SESSION_INFO>(), 32usize, @@ -446,7 +1135,7 @@ fn bindgen_test_layout__CK_SESSION_INFO() { concat!("Alignment of ", stringify!(_CK_SESSION_INFO)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_SESSION_INFO>())).slotID as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).slotID) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -456,7 +1145,7 @@ fn bindgen_test_layout__CK_SESSION_INFO() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_SESSION_INFO>())).state as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).state) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -466,7 +1155,7 @@ fn bindgen_test_layout__CK_SESSION_INFO() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_SESSION_INFO>())).flags as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).flags) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", @@ -476,7 +1165,7 @@ fn bindgen_test_layout__CK_SESSION_INFO() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_SESSION_INFO>())).ulDeviceError as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ulDeviceError) as usize - ptr as usize }, 24usize, concat!( "Offset of field: ", @@ -501,6 +1190,8 @@ pub struct _CK_ATTRIBUTE { } #[test] fn bindgen_test_layout__CK_ATTRIBUTE() { + const UNINIT: ::std::mem::MaybeUninit<_CK_ATTRIBUTE> = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<_CK_ATTRIBUTE>(), 24usize, @@ -512,7 +1203,7 @@ fn bindgen_test_layout__CK_ATTRIBUTE() { concat!("Alignment of ", stringify!(_CK_ATTRIBUTE)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_ATTRIBUTE>())).type_ as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).type_) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -522,7 +1213,7 @@ fn bindgen_test_layout__CK_ATTRIBUTE() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_ATTRIBUTE>())).pValue as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).pValue) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -532,7 +1223,7 @@ fn bindgen_test_layout__CK_ATTRIBUTE() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_ATTRIBUTE>())).ulValueLen as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ulValueLen) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", @@ -560,6 +1251,8 @@ pub struct _CK_DATE { } #[test] fn bindgen_test_layout__CK_DATE() { + const UNINIT: ::std::mem::MaybeUninit<_CK_DATE> = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<_CK_DATE>(), 8usize, @@ -571,7 +1264,7 @@ fn bindgen_test_layout__CK_DATE() { concat!("Alignment of ", stringify!(_CK_DATE)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_DATE>())).year as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).year) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -581,7 +1274,7 @@ fn bindgen_test_layout__CK_DATE() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_DATE>())).month as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).month) as usize - ptr as usize }, 4usize, concat!( "Offset of field: ", @@ -591,7 +1284,7 @@ fn bindgen_test_layout__CK_DATE() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_DATE>())).day as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).day) as usize - ptr as usize }, 6usize, concat!( "Offset of field: ", @@ -611,6 +1304,8 @@ pub struct _CK_MECHANISM { } #[test] fn bindgen_test_layout__CK_MECHANISM() { + const UNINIT: ::std::mem::MaybeUninit<_CK_MECHANISM> = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<_CK_MECHANISM>(), 24usize, @@ -622,7 +1317,7 @@ fn bindgen_test_layout__CK_MECHANISM() { concat!("Alignment of ", stringify!(_CK_MECHANISM)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_MECHANISM>())).mechanism as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).mechanism) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -632,7 +1327,7 @@ fn bindgen_test_layout__CK_MECHANISM() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_MECHANISM>())).pParameter as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).pParameter) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -642,7 +1337,7 @@ fn bindgen_test_layout__CK_MECHANISM() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_MECHANISM>())).ulParameterLen as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ulParameterLen) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", @@ -670,6 +1365,8 @@ pub struct _CK_MECHANISM_INFO { } #[test] fn bindgen_test_layout__CK_MECHANISM_INFO() { + const UNINIT: ::std::mem::MaybeUninit<_CK_MECHANISM_INFO> = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<_CK_MECHANISM_INFO>(), 24usize, @@ -681,7 +1378,7 @@ fn bindgen_test_layout__CK_MECHANISM_INFO() { concat!("Alignment of ", stringify!(_CK_MECHANISM_INFO)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_MECHANISM_INFO>())).ulMinKeySize as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ulMinKeySize) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -691,7 +1388,7 @@ fn bindgen_test_layout__CK_MECHANISM_INFO() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_MECHANISM_INFO>())).ulMaxKeySize as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ulMaxKeySize) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -701,7 +1398,7 @@ fn bindgen_test_layout__CK_MECHANISM_INFO() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_MECHANISM_INFO>())).flags as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).flags) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", @@ -721,6 +1418,8 @@ pub struct CK_OTP_PARAM { } #[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, @@ -732,7 +1431,7 @@ fn bindgen_test_layout_CK_OTP_PARAM() { concat!("Alignment of ", stringify!(CK_OTP_PARAM)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).type_ as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).type_) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -742,7 +1441,7 @@ fn bindgen_test_layout_CK_OTP_PARAM() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).pValue as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).pValue) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -752,7 +1451,7 @@ fn bindgen_test_layout_CK_OTP_PARAM() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).ulValueLen as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ulValueLen) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", @@ -779,6 +1478,8 @@ pub struct CK_OTP_PARAMS { } #[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, @@ -790,7 +1491,7 @@ fn bindgen_test_layout_CK_OTP_PARAMS() { concat!("Alignment of ", stringify!(CK_OTP_PARAMS)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).pParams as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).pParams) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -800,7 +1501,7 @@ fn bindgen_test_layout_CK_OTP_PARAMS() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).ulCount as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ulCount) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -827,6 +1528,9 @@ pub struct CK_OTP_SIGNATURE_INFO { } #[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, @@ -838,7 +1542,7 @@ fn bindgen_test_layout_CK_OTP_SIGNATURE_INFO() { concat!("Alignment of ", stringify!(CK_OTP_SIGNATURE_INFO)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).pParams as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).pParams) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -848,7 +1552,7 @@ fn bindgen_test_layout_CK_OTP_SIGNATURE_INFO() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).ulCount as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ulCount) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -877,6 +1581,9 @@ pub struct ck_rsa_pkcs_pss_params { } #[test] fn bindgen_test_layout_ck_rsa_pkcs_pss_params() { + const UNINIT: ::std::mem::MaybeUninit = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), 24usize, @@ -888,7 +1595,7 @@ fn bindgen_test_layout_ck_rsa_pkcs_pss_params() { concat!("Alignment of ", stringify!(ck_rsa_pkcs_pss_params)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).hashAlg as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).hashAlg) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -898,7 +1605,7 @@ fn bindgen_test_layout_ck_rsa_pkcs_pss_params() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).mgf as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).mgf) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -908,7 +1615,7 @@ fn bindgen_test_layout_ck_rsa_pkcs_pss_params() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).sLen as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).sLen) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", @@ -930,6 +1637,9 @@ pub struct ck_rsa_pkcs_oaep_params { } #[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, @@ -941,7 +1651,7 @@ fn bindgen_test_layout_ck_rsa_pkcs_oaep_params() { concat!("Alignment of ", stringify!(ck_rsa_pkcs_oaep_params)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).hashAlg as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).hashAlg) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -951,7 +1661,7 @@ fn bindgen_test_layout_ck_rsa_pkcs_oaep_params() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).mgf as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).mgf) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -961,7 +1671,7 @@ fn bindgen_test_layout_ck_rsa_pkcs_oaep_params() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).source as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).source) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", @@ -971,9 +1681,7 @@ fn bindgen_test_layout_ck_rsa_pkcs_oaep_params() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).pSourceData as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).pSourceData) as usize - ptr as usize }, 24usize, concat!( "Offset of field: ", @@ -983,9 +1691,7 @@ fn bindgen_test_layout_ck_rsa_pkcs_oaep_params() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).ulSourceDataLen as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).ulSourceDataLen) as usize - ptr as usize }, 32usize, concat!( "Offset of field: ", @@ -1012,6 +1718,8 @@ pub struct ck_aes_ctr_params { } #[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, @@ -1023,7 +1731,7 @@ fn bindgen_test_layout_ck_aes_ctr_params() { concat!("Alignment of ", stringify!(ck_aes_ctr_params)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).ulCounterBits as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ulCounterBits) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -1033,7 +1741,7 @@ fn bindgen_test_layout_ck_aes_ctr_params() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).cb as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).cb) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -1055,6 +1763,8 @@ pub struct ck_gcm_params { } #[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, @@ -1066,7 +1776,7 @@ fn bindgen_test_layout_ck_gcm_params() { concat!("Alignment of ", stringify!(ck_gcm_params)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).pIv as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).pIv) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -1076,7 +1786,7 @@ fn bindgen_test_layout_ck_gcm_params() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).ulIvLen as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ulIvLen) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -1086,7 +1796,7 @@ fn bindgen_test_layout_ck_gcm_params() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).ulIvBits as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ulIvBits) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", @@ -1096,7 +1806,7 @@ fn bindgen_test_layout_ck_gcm_params() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).pAAD as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).pAAD) as usize - ptr as usize }, 24usize, concat!( "Offset of field: ", @@ -1106,7 +1816,7 @@ fn bindgen_test_layout_ck_gcm_params() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).ulAADLen as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ulAADLen) as usize - ptr as usize }, 32usize, concat!( "Offset of field: ", @@ -1116,7 +1826,7 @@ fn bindgen_test_layout_ck_gcm_params() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).ulTagBits as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).ulTagBits) as usize - ptr as usize }, 40usize, concat!( "Offset of field: ", @@ -1147,6 +1857,9 @@ pub struct ck_ecdh1_derive_params { } #[test] fn bindgen_test_layout_ck_ecdh1_derive_params() { + const UNINIT: ::std::mem::MaybeUninit = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), 40usize, @@ -1158,7 +1871,7 @@ fn bindgen_test_layout_ck_ecdh1_derive_params() { concat!("Alignment of ", stringify!(ck_ecdh1_derive_params)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::())).kdf as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).kdf) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -1168,9 +1881,7 @@ fn bindgen_test_layout_ck_ecdh1_derive_params() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).ulSharedDataLen as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).ulSharedDataLen) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -1180,9 +1891,7 @@ fn bindgen_test_layout_ck_ecdh1_derive_params() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).pSharedData as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).pSharedData) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", @@ -1192,9 +1901,7 @@ fn bindgen_test_layout_ck_ecdh1_derive_params() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).ulPublicDataLen as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).ulPublicDataLen) as usize - ptr as usize }, 24usize, concat!( "Offset of field: ", @@ -1204,9 +1911,7 @@ fn bindgen_test_layout_ck_ecdh1_derive_params() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).pPublicData as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).pPublicData) as usize - ptr as usize }, 32usize, concat!( "Offset of field: ", @@ -1233,6 +1938,9 @@ pub struct ck_key_derivation_string_data { } #[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, @@ -1244,9 +1952,7 @@ fn bindgen_test_layout_ck_key_derivation_string_data() { concat!("Alignment of ", stringify!(ck_key_derivation_string_data)) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).pData as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).pData) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -1256,9 +1962,7 @@ fn bindgen_test_layout_ck_key_derivation_string_data() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).ulLen as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).ulLen) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -1286,6 +1990,9 @@ pub struct ck_des_cbc_encrypt_data_params { } #[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, @@ -1297,9 +2004,7 @@ fn bindgen_test_layout_ck_des_cbc_encrypt_data_params() { concat!("Alignment of ", stringify!(ck_des_cbc_encrypt_data_params)) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).iv as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).iv) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -1309,9 +2014,7 @@ fn bindgen_test_layout_ck_des_cbc_encrypt_data_params() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).pData as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).pData) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -1321,9 +2024,7 @@ fn bindgen_test_layout_ck_des_cbc_encrypt_data_params() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).length as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).length) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", @@ -1351,6 +2052,9 @@ pub struct ck_aes_cbc_encrypt_data_params { } #[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, @@ -1362,9 +2066,7 @@ fn bindgen_test_layout_ck_aes_cbc_encrypt_data_params() { concat!("Alignment of ", stringify!(ck_aes_cbc_encrypt_data_params)) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).iv as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).iv) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -1374,9 +2076,7 @@ fn bindgen_test_layout_ck_aes_cbc_encrypt_data_params() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).pData as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).pData) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", @@ -1386,9 +2086,7 @@ fn bindgen_test_layout_ck_aes_cbc_encrypt_data_params() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::())).length as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).length) as usize - ptr as usize }, 24usize, concat!( "Offset of field: ", @@ -1950,6 +2648,8 @@ pub struct _CK_FUNCTION_LIST { } #[test] fn bindgen_test_layout__CK_FUNCTION_LIST() { + const UNINIT: ::std::mem::MaybeUninit<_CK_FUNCTION_LIST> = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<_CK_FUNCTION_LIST>(), 552usize, @@ -1961,7 +2661,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { concat!("Alignment of ", stringify!(_CK_FUNCTION_LIST)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).version as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).version) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -1971,7 +2671,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_Initialize as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_Initialize) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -1981,7 +2681,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_Finalize as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_Finalize) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", @@ -1991,7 +2691,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_GetInfo as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_GetInfo) as usize - ptr as usize }, 24usize, concat!( "Offset of field: ", @@ -2001,9 +2701,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_GetFunctionList as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_GetFunctionList) as usize - ptr as usize }, 32usize, concat!( "Offset of field: ", @@ -2013,7 +2711,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_GetSlotList as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_GetSlotList) as usize - ptr as usize }, 40usize, concat!( "Offset of field: ", @@ -2023,7 +2721,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_GetSlotInfo as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_GetSlotInfo) as usize - ptr as usize }, 48usize, concat!( "Offset of field: ", @@ -2033,9 +2731,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_GetTokenInfo as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_GetTokenInfo) as usize - ptr as usize }, 56usize, concat!( "Offset of field: ", @@ -2045,9 +2741,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_GetMechanismList as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_GetMechanismList) as usize - ptr as usize }, 64usize, concat!( "Offset of field: ", @@ -2057,9 +2751,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_GetMechanismInfo as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_GetMechanismInfo) as usize - ptr as usize }, 72usize, concat!( "Offset of field: ", @@ -2069,7 +2761,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_InitToken as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_InitToken) as usize - ptr as usize }, 80usize, concat!( "Offset of field: ", @@ -2079,7 +2771,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_InitPIN as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_InitPIN) as usize - ptr as usize }, 88usize, concat!( "Offset of field: ", @@ -2089,7 +2781,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_SetPIN as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_SetPIN) as usize - ptr as usize }, 96usize, concat!( "Offset of field: ", @@ -2099,7 +2791,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_OpenSession as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_OpenSession) as usize - ptr as usize }, 104usize, concat!( "Offset of field: ", @@ -2109,9 +2801,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_CloseSession as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_CloseSession) as usize - ptr as usize }, 112usize, concat!( "Offset of field: ", @@ -2121,9 +2811,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_CloseAllSessions as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_CloseAllSessions) as usize - ptr as usize }, 120usize, concat!( "Offset of field: ", @@ -2133,9 +2821,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_GetSessionInfo as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_GetSessionInfo) as usize - ptr as usize }, 128usize, concat!( "Offset of field: ", @@ -2145,9 +2831,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_GetOperationState as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_GetOperationState) as usize - ptr as usize }, 136usize, concat!( "Offset of field: ", @@ -2157,9 +2841,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_SetOperationState as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_SetOperationState) as usize - ptr as usize }, 144usize, concat!( "Offset of field: ", @@ -2169,7 +2851,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_Login as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_Login) as usize - ptr as usize }, 152usize, concat!( "Offset of field: ", @@ -2179,7 +2861,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_Logout as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_Logout) as usize - ptr as usize }, 160usize, concat!( "Offset of field: ", @@ -2189,9 +2871,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_CreateObject as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_CreateObject) as usize - ptr as usize }, 168usize, concat!( "Offset of field: ", @@ -2201,7 +2881,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_CopyObject as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_CopyObject) as usize - ptr as usize }, 176usize, concat!( "Offset of field: ", @@ -2211,9 +2891,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_DestroyObject as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_DestroyObject) as usize - ptr as usize }, 184usize, concat!( "Offset of field: ", @@ -2223,9 +2901,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_GetObjectSize as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_GetObjectSize) as usize - ptr as usize }, 192usize, concat!( "Offset of field: ", @@ -2235,9 +2911,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_GetAttributeValue as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_GetAttributeValue) as usize - ptr as usize }, 200usize, concat!( "Offset of field: ", @@ -2247,9 +2921,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_SetAttributeValue as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_SetAttributeValue) as usize - ptr as usize }, 208usize, concat!( "Offset of field: ", @@ -2259,9 +2931,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_FindObjectsInit as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_FindObjectsInit) as usize - ptr as usize }, 216usize, concat!( "Offset of field: ", @@ -2271,7 +2941,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_FindObjects as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_FindObjects) as usize - ptr as usize }, 224usize, concat!( "Offset of field: ", @@ -2281,9 +2951,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_FindObjectsFinal as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_FindObjectsFinal) as usize - ptr as usize }, 232usize, concat!( "Offset of field: ", @@ -2293,7 +2961,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_EncryptInit as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_EncryptInit) as usize - ptr as usize }, 240usize, concat!( "Offset of field: ", @@ -2303,7 +2971,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_Encrypt as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_Encrypt) as usize - ptr as usize }, 248usize, concat!( "Offset of field: ", @@ -2313,9 +2981,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_EncryptUpdate as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_EncryptUpdate) as usize - ptr as usize }, 256usize, concat!( "Offset of field: ", @@ -2325,9 +2991,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_EncryptFinal as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_EncryptFinal) as usize - ptr as usize }, 264usize, concat!( "Offset of field: ", @@ -2337,7 +3001,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_DecryptInit as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_DecryptInit) as usize - ptr as usize }, 272usize, concat!( "Offset of field: ", @@ -2347,7 +3011,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_Decrypt as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_Decrypt) as usize - ptr as usize }, 280usize, concat!( "Offset of field: ", @@ -2357,9 +3021,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_DecryptUpdate as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_DecryptUpdate) as usize - ptr as usize }, 288usize, concat!( "Offset of field: ", @@ -2369,9 +3031,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_DecryptFinal as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_DecryptFinal) as usize - ptr as usize }, 296usize, concat!( "Offset of field: ", @@ -2381,7 +3041,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_DigestInit as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_DigestInit) as usize - ptr as usize }, 304usize, concat!( "Offset of field: ", @@ -2391,7 +3051,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_Digest as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_Digest) as usize - ptr as usize }, 312usize, concat!( "Offset of field: ", @@ -2401,9 +3061,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_DigestUpdate as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_DigestUpdate) as usize - ptr as usize }, 320usize, concat!( "Offset of field: ", @@ -2413,7 +3071,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_DigestKey as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_DigestKey) as usize - ptr as usize }, 328usize, concat!( "Offset of field: ", @@ -2423,7 +3081,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_DigestFinal as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_DigestFinal) as usize - ptr as usize }, 336usize, concat!( "Offset of field: ", @@ -2433,7 +3091,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_SignInit as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_SignInit) as usize - ptr as usize }, 344usize, concat!( "Offset of field: ", @@ -2443,7 +3101,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_Sign as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_Sign) as usize - ptr as usize }, 352usize, concat!( "Offset of field: ", @@ -2453,7 +3111,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_SignUpdate as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_SignUpdate) as usize - ptr as usize }, 360usize, concat!( "Offset of field: ", @@ -2463,7 +3121,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_SignFinal as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_SignFinal) as usize - ptr as usize }, 368usize, concat!( "Offset of field: ", @@ -2473,9 +3131,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_SignRecoverInit as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_SignRecoverInit) as usize - ptr as usize }, 376usize, concat!( "Offset of field: ", @@ -2485,7 +3141,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_SignRecover as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_SignRecover) as usize - ptr as usize }, 384usize, concat!( "Offset of field: ", @@ -2495,7 +3151,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_VerifyInit as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_VerifyInit) as usize - ptr as usize }, 392usize, concat!( "Offset of field: ", @@ -2505,7 +3161,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_Verify as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_Verify) as usize - ptr as usize }, 400usize, concat!( "Offset of field: ", @@ -2515,9 +3171,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_VerifyUpdate as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_VerifyUpdate) as usize - ptr as usize }, 408usize, concat!( "Offset of field: ", @@ -2527,7 +3181,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_VerifyFinal as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_VerifyFinal) as usize - ptr as usize }, 416usize, concat!( "Offset of field: ", @@ -2537,9 +3191,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_VerifyRecoverInit as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_VerifyRecoverInit) as usize - ptr as usize }, 424usize, concat!( "Offset of field: ", @@ -2549,9 +3201,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_VerifyRecover as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_VerifyRecover) as usize - ptr as usize }, 432usize, concat!( "Offset of field: ", @@ -2561,9 +3211,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_DigestEncryptUpdate as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_DigestEncryptUpdate) as usize - ptr as usize }, 440usize, concat!( "Offset of field: ", @@ -2573,9 +3221,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_DecryptDigestUpdate as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_DecryptDigestUpdate) as usize - ptr as usize }, 448usize, concat!( "Offset of field: ", @@ -2585,9 +3231,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_SignEncryptUpdate as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_SignEncryptUpdate) as usize - ptr as usize }, 456usize, concat!( "Offset of field: ", @@ -2597,9 +3241,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_DecryptVerifyUpdate as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_DecryptVerifyUpdate) as usize - ptr as usize }, 464usize, concat!( "Offset of field: ", @@ -2609,7 +3251,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_GenerateKey as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_GenerateKey) as usize - ptr as usize }, 472usize, concat!( "Offset of field: ", @@ -2619,9 +3261,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_GenerateKeyPair as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_GenerateKeyPair) as usize - ptr as usize }, 480usize, concat!( "Offset of field: ", @@ -2631,7 +3271,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_WrapKey as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_WrapKey) as usize - ptr as usize }, 488usize, concat!( "Offset of field: ", @@ -2641,7 +3281,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_UnwrapKey as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_UnwrapKey) as usize - ptr as usize }, 496usize, concat!( "Offset of field: ", @@ -2651,7 +3291,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_DeriveKey as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_DeriveKey) as usize - ptr as usize }, 504usize, concat!( "Offset of field: ", @@ -2661,7 +3301,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_SeedRandom as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).C_SeedRandom) as usize - ptr as usize }, 512usize, concat!( "Offset of field: ", @@ -2671,9 +3311,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_GenerateRandom as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_GenerateRandom) as usize - ptr as usize }, 520usize, concat!( "Offset of field: ", @@ -2683,9 +3321,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_GetFunctionStatus as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_GetFunctionStatus) as usize - ptr as usize }, 528usize, concat!( "Offset of field: ", @@ -2695,9 +3331,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_CancelFunction as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_CancelFunction) as usize - ptr as usize }, 536usize, concat!( "Offset of field: ", @@ -2707,9 +3341,7 @@ fn bindgen_test_layout__CK_FUNCTION_LIST() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_WaitForSlotEvent as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).C_WaitForSlotEvent) as usize - ptr as usize }, 544usize, concat!( "Offset of field: ", @@ -2739,6 +3371,9 @@ pub struct _CK_C_INITIALIZE_ARGS { } #[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, @@ -2750,9 +3385,7 @@ fn bindgen_test_layout__CK_C_INITIALIZE_ARGS() { concat!("Alignment of ", stringify!(_CK_C_INITIALIZE_ARGS)) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_C_INITIALIZE_ARGS>())).CreateMutex as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).CreateMutex) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", @@ -2762,9 +3395,7 @@ fn bindgen_test_layout__CK_C_INITIALIZE_ARGS() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_C_INITIALIZE_ARGS>())).DestroyMutex as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).DestroyMutex) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", @@ -2774,7 +3405,7 @@ fn bindgen_test_layout__CK_C_INITIALIZE_ARGS() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_C_INITIALIZE_ARGS>())).LockMutex as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).LockMutex) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", @@ -2784,9 +3415,7 @@ fn bindgen_test_layout__CK_C_INITIALIZE_ARGS() { ) ); assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_C_INITIALIZE_ARGS>())).UnlockMutex as *const _ as usize - }, + unsafe { ::std::ptr::addr_of!((*ptr).UnlockMutex) as usize - ptr as usize }, 24usize, concat!( "Offset of field: ", @@ -2796,7 +3425,7 @@ fn bindgen_test_layout__CK_C_INITIALIZE_ARGS() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_C_INITIALIZE_ARGS>())).flags as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).flags) as usize - ptr as usize }, 32usize, concat!( "Offset of field: ", @@ -2806,7 +3435,7 @@ fn bindgen_test_layout__CK_C_INITIALIZE_ARGS() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_C_INITIALIZE_ARGS>())).pReserved as *const _ as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).pReserved) as usize - ptr as usize }, 40usize, concat!( "Offset of field: ", @@ -2825,8 +3454,6 @@ impl Default for _CK_C_INITIALIZE_ARGS { } } } -pub type size_t = ::std::os::raw::c_ulong; -pub type wchar_t = ::std::os::raw::c_int; 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; @@ -2893,10 +3520,529 @@ pub type CK_AES_CBC_ENCRYPT_DATA_PARAMS_PTR = *mut ck_aes_cbc_encrypt_data_param 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_GetFunctionList: Result< unsafe extern "C" fn(function_list: *mut *mut _CK_FUNCTION_LIST) -> 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, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_GetSlotInfo: Result< + unsafe extern "C" fn(slotID: CK_SLOT_ID, info: *mut _CK_SLOT_INFO) -> 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, + ::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, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_GetMechanismInfo: Result< + unsafe extern "C" fn( + slotID: CK_SLOT_ID, + type_: CK_MECHANISM_TYPE, + info: *mut _CK_MECHANISM_INFO, + ) -> 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, + ) -> 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, + ) -> 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, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_OpenSession: Result< + 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, + ::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(session: CK_SESSION_HANDLE, info: *mut _CK_SESSION_INFO) -> 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, + ) -> 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, + ) -> 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, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_Logout: + 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, + ) -> 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, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_DestroyObject: Result< + unsafe extern "C" fn(session: CK_SESSION_HANDLE, object: 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, + ) -> 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, + ) -> 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, + ) -> 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, + ) -> 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, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_FindObjectsFinal: + 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, + ) -> 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, + ) -> 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, + ) -> 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, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_DecryptInit: Result< + unsafe extern "C" fn( + session: CK_SESSION_HANDLE, + mechanism: *mut _CK_MECHANISM, + key: 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, + ) -> 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, + ) -> 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, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_DigestInit: Result< + unsafe extern "C" fn(session: CK_SESSION_HANDLE, mechanism: *mut _CK_MECHANISM) -> 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, + ) -> 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, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_DigestKey: Result< + unsafe extern "C" fn(session: CK_SESSION_HANDLE, key: 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, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_SignInit: Result< + unsafe extern "C" fn( + session: CK_SESSION_HANDLE, + mechanism: *mut _CK_MECHANISM, + key: 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, + ) -> 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, + ) -> 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, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_SignRecoverInit: Result< + unsafe extern "C" fn( + session: CK_SESSION_HANDLE, + mechanism: *mut _CK_MECHANISM, + key: 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, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_VerifyInit: Result< + unsafe extern "C" fn( + session: CK_SESSION_HANDLE, + mechanism: *mut _CK_MECHANISM, + key: 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, + ) -> 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, + ) -> 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, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_VerifyRecoverInit: Result< + unsafe extern "C" fn( + session: CK_SESSION_HANDLE, + mechanism: *mut _CK_MECHANISM, + key: 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, + ) -> 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, + ) -> 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, + ) -> 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, + ) -> 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, + ) -> 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, + ) -> 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, + ) -> 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, + ) -> 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, + ) -> 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, + ) -> 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, + ) -> 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, + ) -> CK_RV, + ::libloading::Error, + >, + pub C_GetFunctionStatus: + Result CK_RV, ::libloading::Error>, + pub C_CancelFunction: + Result CK_RV, ::libloading::Error>, } impl Pkcs11 { pub unsafe fn new

(path: P) -> Result @@ -2911,16 +4057,1010 @@ impl Pkcs11 { 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_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); + 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); Ok(Pkcs11 { __library, + C_Initialize, + C_Finalize, + C_GetInfo, C_GetFunctionList, + C_GetSlotList, + C_GetSlotInfo, + C_GetTokenInfo, + C_WaitForSlotEvent, + 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, }) } + pub unsafe fn C_Initialize(&self, init_args: *mut ::std::os::raw::c_void) -> CK_RV { + (self + .C_Initialize + .as_ref() + .expect("Expected function, got error."))(init_args) + } + pub unsafe fn C_Finalize(&self, pReserved: *mut ::std::os::raw::c_void) -> 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 { + (self + .C_GetInfo + .as_ref() + .expect("Expected function, got error."))(info) + } pub unsafe fn C_GetFunctionList(&self, function_list: *mut *mut _CK_FUNCTION_LIST) -> CK_RV { (self .C_GetFunctionList .as_ref() .expect("Expected function, got error."))(function_list) } + 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, + ) -> CK_RV { + (self + .C_GetSlotList + .as_ref() + .expect("Expected function, got error."))(token_present, slot_list, ulCount) + } + pub unsafe fn C_GetSlotInfo(&self, slotID: CK_SLOT_ID, info: *mut _CK_SLOT_INFO) -> CK_RV { + (self + .C_GetSlotInfo + .as_ref() + .expect("Expected function, got error."))(slotID, info) + } + pub unsafe fn C_GetTokenInfo(&self, slotID: CK_SLOT_ID, info: *mut _CK_TOKEN_INFO) -> 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) + } + pub unsafe fn C_GetMechanismList( + &self, + slotID: CK_SLOT_ID, + mechanism_list: *mut CK_MECHANISM_TYPE, + ulCount: *mut ::std::os::raw::c_ulong, + ) -> CK_RV { + (self + .C_GetMechanismList + .as_ref() + .expect("Expected function, got error."))(slotID, mechanism_list, ulCount) + } + pub unsafe fn C_GetMechanismInfo( + &self, + slotID: CK_SLOT_ID, + type_: CK_MECHANISM_TYPE, + info: *mut _CK_MECHANISM_INFO, + ) -> CK_RV { + (self + .C_GetMechanismInfo + .as_ref() + .expect("Expected function, got error."))(slotID, type_, info) + } + 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, + ) -> CK_RV { + (self + .C_InitToken + .as_ref() + .expect("Expected function, got error."))(slotID, pin, pin_len, label) + } + pub unsafe fn C_InitPIN( + &self, + session: CK_SESSION_HANDLE, + pin: *mut ::std::os::raw::c_uchar, + pin_len: ::std::os::raw::c_ulong, + ) -> CK_RV { + (self + .C_InitPIN + .as_ref() + .expect("Expected function, got error."))(session, pin, pin_len) + } + 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, + ) -> CK_RV { + (self + .C_SetPIN + .as_ref() + .expect("Expected function, got error."))( + session, old_pin, old_len, new_pin, new_len + ) + } + 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, + ) -> CK_RV { + (self + .C_OpenSession + .as_ref() + .expect("Expected function, got error."))( + slotID, flags, application, notify, session + ) + } + pub unsafe fn C_CloseSession(&self, session: CK_SESSION_HANDLE) -> CK_RV { + (self + .C_CloseSession + .as_ref() + .expect("Expected function, got error."))(session) + } + 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, + session: CK_SESSION_HANDLE, + info: *mut _CK_SESSION_INFO, + ) -> CK_RV { + (self + .C_GetSessionInfo + .as_ref() + .expect("Expected function, got error."))(session, info) + } + 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, + ) -> CK_RV { + (self + .C_GetOperationState + .as_ref() + .expect("Expected function, got error."))( + session, operation_state, operation_state_len + ) + } + 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, + ) -> CK_RV { + (self + .C_SetOperationState + .as_ref() + .expect("Expected function, got error."))( + session, + operation_state, + operation_state_len, + encryption_key, + authentiation_key, + ) + } + 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, + ) -> CK_RV { + (self + .C_Login + .as_ref() + .expect("Expected function, got error."))(session, user_type, pin, pin_len) + } + pub unsafe fn C_Logout(&self, session: CK_SESSION_HANDLE) -> CK_RV { + (self + .C_Logout + .as_ref() + .expect("Expected function, got error."))(session) + } + 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, + ) -> CK_RV { + (self + .C_CreateObject + .as_ref() + .expect("Expected function, got error."))(session, templ, ulCount, object) + } + 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, + ) -> CK_RV { + (self + .C_CopyObject + .as_ref() + .expect("Expected function, got error."))( + session, object, templ, ulCount, new_object + ) + } + pub unsafe fn C_DestroyObject( + &self, + session: CK_SESSION_HANDLE, + object: CK_OBJECT_HANDLE, + ) -> CK_RV { + (self + .C_DestroyObject + .as_ref() + .expect("Expected function, got error."))(session, object) + } + pub unsafe fn C_GetObjectSize( + &self, + session: CK_SESSION_HANDLE, + object: CK_OBJECT_HANDLE, + size: *mut ::std::os::raw::c_ulong, + ) -> CK_RV { + (self + .C_GetObjectSize + .as_ref() + .expect("Expected function, got error."))(session, object, size) + } + pub unsafe fn C_GetAttributeValue( + &self, + session: CK_SESSION_HANDLE, + object: CK_OBJECT_HANDLE, + templ: *mut _CK_ATTRIBUTE, + ulCount: ::std::os::raw::c_ulong, + ) -> CK_RV { + (self + .C_GetAttributeValue + .as_ref() + .expect("Expected function, got error."))(session, object, templ, 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, + ) -> CK_RV { + (self + .C_SetAttributeValue + .as_ref() + .expect("Expected function, got error."))(session, object, templ, ulCount) + } + pub unsafe fn C_FindObjectsInit( + &self, + session: CK_SESSION_HANDLE, + templ: *mut _CK_ATTRIBUTE, + ulCount: ::std::os::raw::c_ulong, + ) -> CK_RV { + (self + .C_FindObjectsInit + .as_ref() + .expect("Expected function, got error."))(session, templ, 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, + ) -> CK_RV { + (self + .C_FindObjects + .as_ref() + .expect("Expected function, got error."))( + session, + object, + max_object_count, + object_count, + ) + } + pub unsafe fn C_FindObjectsFinal(&self, session: CK_SESSION_HANDLE) -> CK_RV { + (self + .C_FindObjectsFinal + .as_ref() + .expect("Expected function, got error."))(session) + } + pub unsafe fn C_EncryptInit( + &self, + session: CK_SESSION_HANDLE, + mechanism: *mut _CK_MECHANISM, + key: CK_OBJECT_HANDLE, + ) -> CK_RV { + (self + .C_EncryptInit + .as_ref() + .expect("Expected function, got error."))(session, mechanism, key) + } + 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, + ) -> CK_RV { + (self + .C_Encrypt + .as_ref() + .expect("Expected function, got error."))( + session, + data, + data_len, + encrypted_data, + encrypted_data_len, + ) + } + 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, + ) -> CK_RV { + (self + .C_EncryptUpdate + .as_ref() + .expect("Expected function, got error."))( + session, + part, + part_len, + encrypted_part, + encrypted_part_len, + ) + } + 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, + ) -> CK_RV { + (self + .C_EncryptFinal + .as_ref() + .expect("Expected function, got error."))( + session, + last_encrypted_part, + last_encrypted_part_len, + ) + } + pub unsafe fn C_DecryptInit( + &self, + session: CK_SESSION_HANDLE, + mechanism: *mut _CK_MECHANISM, + key: CK_OBJECT_HANDLE, + ) -> CK_RV { + (self + .C_DecryptInit + .as_ref() + .expect("Expected function, got error."))(session, mechanism, key) + } + 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, + ) -> CK_RV { + (self + .C_Decrypt + .as_ref() + .expect("Expected function, got error."))( + session, + encrypted_data, + encrypted_data_len, + data, + data_len, + ) + } + 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, + ) -> CK_RV { + (self + .C_DecryptUpdate + .as_ref() + .expect("Expected function, got error."))( + session, + encrypted_part, + encrypted_part_len, + part, + part_len, + ) + } + 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, + ) -> CK_RV { + (self + .C_DecryptFinal + .as_ref() + .expect("Expected function, got error."))(session, last_part, last_part_len) + } + pub unsafe fn C_DigestInit( + &self, + session: CK_SESSION_HANDLE, + mechanism: *mut _CK_MECHANISM, + ) -> CK_RV { + (self + .C_DigestInit + .as_ref() + .expect("Expected function, got error."))(session, mechanism) + } + 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, + ) -> CK_RV { + (self + .C_Digest + .as_ref() + .expect("Expected function, got error."))( + session, data, data_len, digest, digest_len + ) + } + pub unsafe fn C_DigestUpdate( + &self, + session: CK_SESSION_HANDLE, + part: *mut ::std::os::raw::c_uchar, + part_len: ::std::os::raw::c_ulong, + ) -> CK_RV { + (self + .C_DigestUpdate + .as_ref() + .expect("Expected function, got error."))(session, part, part_len) + } + pub unsafe fn C_DigestKey(&self, session: CK_SESSION_HANDLE, key: CK_OBJECT_HANDLE) -> CK_RV { + (self + .C_DigestKey + .as_ref() + .expect("Expected function, got error."))(session, key) + } + 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, + ) -> CK_RV { + (self + .C_DigestFinal + .as_ref() + .expect("Expected function, got error."))(session, digest, digest_len) + } + pub unsafe fn C_SignInit( + &self, + session: CK_SESSION_HANDLE, + mechanism: *mut _CK_MECHANISM, + key: CK_OBJECT_HANDLE, + ) -> CK_RV { + (self + .C_SignInit + .as_ref() + .expect("Expected function, got error."))(session, mechanism, key) + } + 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, + ) -> CK_RV { + (self.C_Sign.as_ref().expect("Expected function, got error."))( + session, + data, + data_len, + signature, + signature_len, + ) + } + pub unsafe fn C_SignUpdate( + &self, + session: CK_SESSION_HANDLE, + part: *mut ::std::os::raw::c_uchar, + part_len: ::std::os::raw::c_ulong, + ) -> CK_RV { + (self + .C_SignUpdate + .as_ref() + .expect("Expected function, got error."))(session, part, part_len) + } + 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, + ) -> CK_RV { + (self + .C_SignFinal + .as_ref() + .expect("Expected function, got error."))(session, signature, signature_len) + } + pub unsafe fn C_SignRecoverInit( + &self, + session: CK_SESSION_HANDLE, + mechanism: *mut _CK_MECHANISM, + key: CK_OBJECT_HANDLE, + ) -> CK_RV { + (self + .C_SignRecoverInit + .as_ref() + .expect("Expected function, got error."))(session, mechanism, key) + } + 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, + ) -> CK_RV { + (self + .C_SignRecover + .as_ref() + .expect("Expected function, got error."))( + session, + data, + data_len, + signature, + signature_len, + ) + } + pub unsafe fn C_VerifyInit( + &self, + session: CK_SESSION_HANDLE, + mechanism: *mut _CK_MECHANISM, + key: CK_OBJECT_HANDLE, + ) -> CK_RV { + (self + .C_VerifyInit + .as_ref() + .expect("Expected function, got error."))(session, mechanism, key) + } + 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, + ) -> CK_RV { + (self + .C_Verify + .as_ref() + .expect("Expected function, got error."))( + session, + data, + data_len, + signature, + signature_len, + ) + } + pub unsafe fn C_VerifyUpdate( + &self, + session: CK_SESSION_HANDLE, + part: *mut ::std::os::raw::c_uchar, + part_len: ::std::os::raw::c_ulong, + ) -> CK_RV { + (self + .C_VerifyUpdate + .as_ref() + .expect("Expected function, got error."))(session, part, part_len) + } + pub unsafe fn C_VerifyFinal( + &self, + session: CK_SESSION_HANDLE, + signature: *mut ::std::os::raw::c_uchar, + signature_len: ::std::os::raw::c_ulong, + ) -> CK_RV { + (self + .C_VerifyFinal + .as_ref() + .expect("Expected function, got error."))(session, signature, signature_len) + } + pub unsafe fn C_VerifyRecoverInit( + &self, + session: CK_SESSION_HANDLE, + mechanism: *mut _CK_MECHANISM, + key: CK_OBJECT_HANDLE, + ) -> CK_RV { + (self + .C_VerifyRecoverInit + .as_ref() + .expect("Expected function, got error."))(session, mechanism, key) + } + 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, + ) -> CK_RV { + (self + .C_VerifyRecover + .as_ref() + .expect("Expected function, got error."))( + session, + signature, + signature_len, + data, + data_len, + ) + } + 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, + ) -> CK_RV { + (self + .C_DigestEncryptUpdate + .as_ref() + .expect("Expected function, got error."))( + session, + part, + part_len, + encrypted_part, + encrypted_part_len, + ) + } + 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, + ) -> CK_RV { + (self + .C_DecryptDigestUpdate + .as_ref() + .expect("Expected function, got error."))( + session, + encrypted_part, + encrypted_part_len, + part, + part_len, + ) + } + 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, + ) -> CK_RV { + (self + .C_SignEncryptUpdate + .as_ref() + .expect("Expected function, got error."))( + session, + part, + part_len, + encrypted_part, + encrypted_part_len, + ) + } + 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, + ) -> CK_RV { + (self + .C_DecryptVerifyUpdate + .as_ref() + .expect("Expected function, got error."))( + session, + encrypted_part, + encrypted_part_len, + part, + part_len, + ) + } + 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, + ) -> CK_RV { + (self + .C_GenerateKey + .as_ref() + .expect("Expected function, got error."))( + session, mechanism, templ, ulCount, key + ) + } + 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, + ) -> 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, + ) + } + 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, + ) -> CK_RV { + (self + .C_WrapKey + .as_ref() + .expect("Expected function, got error."))( + session, + mechanism, + wrapping_key, + key, + wrapped_key, + wrapped_key_len, + ) + } + 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, + ) -> 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, + ) + } + 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, + ) -> CK_RV { + (self + .C_DeriveKey + .as_ref() + .expect("Expected function, got error."))( + session, + mechanism, + base_key, + templ, + attribute_count, + key, + ) + } + pub unsafe fn C_SeedRandom( + &self, + session: CK_SESSION_HANDLE, + seed: *mut ::std::os::raw::c_uchar, + seed_len: ::std::os::raw::c_ulong, + ) -> CK_RV { + (self + .C_SeedRandom + .as_ref() + .expect("Expected function, got error."))(session, seed, seed_len) + } + 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, + ) -> CK_RV { + (self + .C_GenerateRandom + .as_ref() + .expect("Expected function, got error."))(session, random_data, random_len) + } + pub unsafe fn C_GetFunctionStatus(&self, session: CK_SESSION_HANDLE) -> CK_RV { + (self + .C_GetFunctionStatus + .as_ref() + .expect("Expected function, got error."))(session) + } + pub unsafe fn C_CancelFunction(&self, session: CK_SESSION_HANDLE) -> CK_RV { + (self + .C_CancelFunction + .as_ref() + .expect("Expected function, got error."))(session) + } } diff --git a/cryptoki-sys/src/bindings/x86_64-windows.rs b/cryptoki-sys/src/bindings/x86_64-windows.rs deleted file mode 100644 index 43188621..00000000 --- a/cryptoki-sys/src/bindings/x86_64-windows.rs +++ /dev/null @@ -1,3113 +0,0 @@ -/* automatically generated by rust-bindgen 0.59.1 */ - -pub type CK_FLAGS = ::std::os::raw::c_ulong; -#[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, -} -#[test] -fn bindgen_test_layout__CK_VERSION() { - assert_eq!( - ::std::mem::size_of::<_CK_VERSION>(), - 2usize, - concat!("Size of: ", stringify!(_CK_VERSION)) - ); - assert_eq!( - ::std::mem::align_of::<_CK_VERSION>(), - 1usize, - concat!("Alignment of ", stringify!(_CK_VERSION)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_VERSION>())).major as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_CK_VERSION), - "::", - stringify!(major) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_VERSION>())).minor as *const _ as usize }, - 1usize, - concat!( - "Offset of field: ", - stringify!(_CK_VERSION), - "::", - stringify!(minor) - ) - ); -} -#[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 flags: CK_FLAGS, - pub libraryDescription: [::std::os::raw::c_uchar; 32usize], - pub libraryVersion: _CK_VERSION, -} -#[test] -fn bindgen_test_layout__CK_INFO() { - assert_eq!( - ::std::mem::size_of::<_CK_INFO>(), - 72usize, - concat!("Size of: ", stringify!(_CK_INFO)) - ); - assert_eq!( - ::std::mem::align_of::<_CK_INFO>(), - 1usize, - concat!("Alignment of ", stringify!(_CK_INFO)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_INFO>())).cryptokiVersion as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_CK_INFO), - "::", - stringify!(cryptokiVersion) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_INFO>())).manufacturerID as *const _ as usize }, - 2usize, - concat!( - "Offset of field: ", - stringify!(_CK_INFO), - "::", - stringify!(manufacturerID) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_INFO>())).flags as *const _ as usize }, - 34usize, - concat!( - "Offset of field: ", - stringify!(_CK_INFO), - "::", - stringify!(flags) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_INFO>())).libraryDescription as *const _ as usize }, - 38usize, - concat!( - "Offset of field: ", - stringify!(_CK_INFO), - "::", - stringify!(libraryDescription) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_INFO>())).libraryVersion as *const _ as usize }, - 70usize, - concat!( - "Offset of field: ", - stringify!(_CK_INFO), - "::", - stringify!(libraryVersion) - ) - ); -} -pub type CK_NOTIFICATION = ::std::os::raw::c_ulong; -pub type CK_SLOT_ID = ::std::os::raw::c_ulong; -#[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 flags: CK_FLAGS, - pub hardwareVersion: _CK_VERSION, - pub firmwareVersion: _CK_VERSION, -} -#[test] -fn bindgen_test_layout__CK_SLOT_INFO() { - assert_eq!( - ::std::mem::size_of::<_CK_SLOT_INFO>(), - 104usize, - concat!("Size of: ", stringify!(_CK_SLOT_INFO)) - ); - assert_eq!( - ::std::mem::align_of::<_CK_SLOT_INFO>(), - 1usize, - concat!("Alignment of ", stringify!(_CK_SLOT_INFO)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_SLOT_INFO>())).slotDescription as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_CK_SLOT_INFO), - "::", - stringify!(slotDescription) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_SLOT_INFO>())).manufacturerID as *const _ as usize }, - 64usize, - concat!( - "Offset of field: ", - stringify!(_CK_SLOT_INFO), - "::", - stringify!(manufacturerID) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_SLOT_INFO>())).flags as *const _ as usize }, - 96usize, - concat!( - "Offset of field: ", - stringify!(_CK_SLOT_INFO), - "::", - stringify!(flags) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_SLOT_INFO>())).hardwareVersion as *const _ as usize }, - 100usize, - concat!( - "Offset of field: ", - stringify!(_CK_SLOT_INFO), - "::", - stringify!(hardwareVersion) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_SLOT_INFO>())).firmwareVersion as *const _ as usize }, - 102usize, - concat!( - "Offset of field: ", - stringify!(_CK_SLOT_INFO), - "::", - stringify!(firmwareVersion) - ) - ); -} -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() - } - } -} -#[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 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], -} -#[test] -fn bindgen_test_layout__CK_TOKEN_INFO() { - assert_eq!( - ::std::mem::size_of::<_CK_TOKEN_INFO>(), - 160usize, - concat!("Size of: ", stringify!(_CK_TOKEN_INFO)) - ); - assert_eq!( - ::std::mem::align_of::<_CK_TOKEN_INFO>(), - 1usize, - concat!("Alignment of ", stringify!(_CK_TOKEN_INFO)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_TOKEN_INFO>())).label as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_CK_TOKEN_INFO), - "::", - stringify!(label) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_TOKEN_INFO>())).manufacturerID as *const _ as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(_CK_TOKEN_INFO), - "::", - stringify!(manufacturerID) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_TOKEN_INFO>())).model as *const _ as usize }, - 64usize, - concat!( - "Offset of field: ", - stringify!(_CK_TOKEN_INFO), - "::", - stringify!(model) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_TOKEN_INFO>())).serialNumber as *const _ as usize }, - 80usize, - concat!( - "Offset of field: ", - stringify!(_CK_TOKEN_INFO), - "::", - stringify!(serialNumber) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_TOKEN_INFO>())).flags as *const _ as usize }, - 96usize, - concat!( - "Offset of field: ", - stringify!(_CK_TOKEN_INFO), - "::", - stringify!(flags) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_TOKEN_INFO>())).ulMaxSessionCount as *const _ as usize - }, - 100usize, - concat!( - "Offset of field: ", - stringify!(_CK_TOKEN_INFO), - "::", - stringify!(ulMaxSessionCount) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_TOKEN_INFO>())).ulSessionCount as *const _ as usize }, - 104usize, - concat!( - "Offset of field: ", - stringify!(_CK_TOKEN_INFO), - "::", - stringify!(ulSessionCount) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_TOKEN_INFO>())).ulMaxRwSessionCount as *const _ as usize - }, - 108usize, - concat!( - "Offset of field: ", - stringify!(_CK_TOKEN_INFO), - "::", - stringify!(ulMaxRwSessionCount) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_TOKEN_INFO>())).ulRwSessionCount as *const _ as usize }, - 112usize, - concat!( - "Offset of field: ", - stringify!(_CK_TOKEN_INFO), - "::", - stringify!(ulRwSessionCount) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_TOKEN_INFO>())).ulMaxPinLen as *const _ as usize }, - 116usize, - concat!( - "Offset of field: ", - stringify!(_CK_TOKEN_INFO), - "::", - stringify!(ulMaxPinLen) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_TOKEN_INFO>())).ulMinPinLen as *const _ as usize }, - 120usize, - concat!( - "Offset of field: ", - stringify!(_CK_TOKEN_INFO), - "::", - stringify!(ulMinPinLen) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_TOKEN_INFO>())).ulTotalPublicMemory as *const _ as usize - }, - 124usize, - concat!( - "Offset of field: ", - stringify!(_CK_TOKEN_INFO), - "::", - stringify!(ulTotalPublicMemory) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_TOKEN_INFO>())).ulFreePublicMemory as *const _ as usize - }, - 128usize, - concat!( - "Offset of field: ", - stringify!(_CK_TOKEN_INFO), - "::", - stringify!(ulFreePublicMemory) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_TOKEN_INFO>())).ulTotalPrivateMemory as *const _ as usize - }, - 132usize, - concat!( - "Offset of field: ", - stringify!(_CK_TOKEN_INFO), - "::", - stringify!(ulTotalPrivateMemory) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_TOKEN_INFO>())).ulFreePrivateMemory as *const _ as usize - }, - 136usize, - concat!( - "Offset of field: ", - stringify!(_CK_TOKEN_INFO), - "::", - stringify!(ulFreePrivateMemory) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_TOKEN_INFO>())).hardwareVersion as *const _ as usize }, - 140usize, - concat!( - "Offset of field: ", - stringify!(_CK_TOKEN_INFO), - "::", - stringify!(hardwareVersion) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_TOKEN_INFO>())).firmwareVersion as *const _ as usize }, - 142usize, - concat!( - "Offset of field: ", - stringify!(_CK_TOKEN_INFO), - "::", - stringify!(firmwareVersion) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_TOKEN_INFO>())).utcTime as *const _ as usize }, - 144usize, - concat!( - "Offset of field: ", - 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; -#[repr(C, 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: ::std::os::raw::c_ulong, -} -#[test] -fn bindgen_test_layout__CK_SESSION_INFO() { - assert_eq!( - ::std::mem::size_of::<_CK_SESSION_INFO>(), - 16usize, - concat!("Size of: ", stringify!(_CK_SESSION_INFO)) - ); - assert_eq!( - ::std::mem::align_of::<_CK_SESSION_INFO>(), - 1usize, - concat!("Alignment of ", stringify!(_CK_SESSION_INFO)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_SESSION_INFO>())).slotID as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_CK_SESSION_INFO), - "::", - stringify!(slotID) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_SESSION_INFO>())).state as *const _ as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(_CK_SESSION_INFO), - "::", - stringify!(state) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_SESSION_INFO>())).flags as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(_CK_SESSION_INFO), - "::", - stringify!(flags) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_SESSION_INFO>())).ulDeviceError as *const _ as usize }, - 12usize, - concat!( - "Offset of field: ", - 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; -#[repr(C, packed)] -#[derive(Debug, Copy, Clone)] -pub struct _CK_ATTRIBUTE { - pub type_: CK_ATTRIBUTE_TYPE, - pub pValue: *mut ::std::os::raw::c_void, - pub ulValueLen: ::std::os::raw::c_ulong, -} -#[test] -fn bindgen_test_layout__CK_ATTRIBUTE() { - assert_eq!( - ::std::mem::size_of::<_CK_ATTRIBUTE>(), - 16usize, - concat!("Size of: ", stringify!(_CK_ATTRIBUTE)) - ); - assert_eq!( - ::std::mem::align_of::<_CK_ATTRIBUTE>(), - 1usize, - concat!("Alignment of ", stringify!(_CK_ATTRIBUTE)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_ATTRIBUTE>())).type_ as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_CK_ATTRIBUTE), - "::", - stringify!(type_) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_ATTRIBUTE>())).pValue as *const _ as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(_CK_ATTRIBUTE), - "::", - stringify!(pValue) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_ATTRIBUTE>())).ulValueLen as *const _ as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(_CK_ATTRIBUTE), - "::", - stringify!(ulValueLen) - ) - ); -} -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() - } - } -} -#[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], -} -#[test] -fn bindgen_test_layout__CK_DATE() { - assert_eq!( - ::std::mem::size_of::<_CK_DATE>(), - 8usize, - concat!("Size of: ", stringify!(_CK_DATE)) - ); - assert_eq!( - ::std::mem::align_of::<_CK_DATE>(), - 1usize, - concat!("Alignment of ", stringify!(_CK_DATE)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_DATE>())).year as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_CK_DATE), - "::", - stringify!(year) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_DATE>())).month as *const _ as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(_CK_DATE), - "::", - stringify!(month) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_DATE>())).day as *const _ as usize }, - 6usize, - concat!( - "Offset of field: ", - stringify!(_CK_DATE), - "::", - stringify!(day) - ) - ); -} -pub type CK_MECHANISM_TYPE = ::std::os::raw::c_ulong; -#[repr(C, packed)] -#[derive(Debug, Copy, Clone)] -pub struct _CK_MECHANISM { - pub mechanism: CK_MECHANISM_TYPE, - pub pParameter: *mut ::std::os::raw::c_void, - pub ulParameterLen: ::std::os::raw::c_ulong, -} -#[test] -fn bindgen_test_layout__CK_MECHANISM() { - assert_eq!( - ::std::mem::size_of::<_CK_MECHANISM>(), - 16usize, - concat!("Size of: ", stringify!(_CK_MECHANISM)) - ); - assert_eq!( - ::std::mem::align_of::<_CK_MECHANISM>(), - 1usize, - concat!("Alignment of ", stringify!(_CK_MECHANISM)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_MECHANISM>())).mechanism as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_CK_MECHANISM), - "::", - stringify!(mechanism) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_MECHANISM>())).pParameter as *const _ as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(_CK_MECHANISM), - "::", - stringify!(pParameter) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_MECHANISM>())).ulParameterLen as *const _ as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(_CK_MECHANISM), - "::", - stringify!(ulParameterLen) - ) - ); -} -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() - } - } -} -#[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 flags: CK_FLAGS, -} -#[test] -fn bindgen_test_layout__CK_MECHANISM_INFO() { - assert_eq!( - ::std::mem::size_of::<_CK_MECHANISM_INFO>(), - 12usize, - concat!("Size of: ", stringify!(_CK_MECHANISM_INFO)) - ); - assert_eq!( - ::std::mem::align_of::<_CK_MECHANISM_INFO>(), - 1usize, - concat!("Alignment of ", stringify!(_CK_MECHANISM_INFO)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_MECHANISM_INFO>())).ulMinKeySize as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_CK_MECHANISM_INFO), - "::", - stringify!(ulMinKeySize) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_MECHANISM_INFO>())).ulMaxKeySize as *const _ as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(_CK_MECHANISM_INFO), - "::", - stringify!(ulMaxKeySize) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_MECHANISM_INFO>())).flags as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(_CK_MECHANISM_INFO), - "::", - stringify!(flags) - ) - ); -} -pub type CK_PARAM_TYPE = ::std::os::raw::c_ulong; -#[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, -} -#[test] -fn bindgen_test_layout_CK_OTP_PARAM() { - 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::null::())).type_ as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(CK_OTP_PARAM), - "::", - stringify!(type_) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).pValue as *const _ as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(CK_OTP_PARAM), - "::", - stringify!(pValue) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).ulValueLen as *const _ 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() - } - } -} -#[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, -} -#[test] -fn bindgen_test_layout_CK_OTP_PARAMS() { - 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::null::())).pParams as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(CK_OTP_PARAMS), - "::", - stringify!(pParams) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).ulCount as *const _ 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() - } - } -} -#[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() { - 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::null::())).pParams as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(CK_OTP_SIGNATURE_INFO), - "::", - stringify!(pParams) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).ulCount as *const _ 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_RSA_PKCS_MGF_TYPE = ::std::os::raw::c_ulong; -#[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: ::std::os::raw::c_ulong, -} -#[test] -fn bindgen_test_layout_ck_rsa_pkcs_pss_params() { - assert_eq!( - ::std::mem::size_of::(), - 12usize, - concat!("Size of: ", stringify!(ck_rsa_pkcs_pss_params)) - ); - assert_eq!( - ::std::mem::align_of::(), - 1usize, - concat!("Alignment of ", stringify!(ck_rsa_pkcs_pss_params)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).hashAlg as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(ck_rsa_pkcs_pss_params), - "::", - stringify!(hashAlg) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).mgf as *const _ as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(ck_rsa_pkcs_pss_params), - "::", - stringify!(mgf) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).sLen as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(ck_rsa_pkcs_pss_params), - "::", - stringify!(sLen) - ) - ); -} -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, -} -#[test] -fn bindgen_test_layout_ck_rsa_pkcs_oaep_params() { - assert_eq!( - ::std::mem::size_of::(), - 24usize, - concat!("Size of: ", stringify!(ck_rsa_pkcs_oaep_params)) - ); - assert_eq!( - ::std::mem::align_of::(), - 1usize, - concat!("Alignment of ", stringify!(ck_rsa_pkcs_oaep_params)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).hashAlg as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(ck_rsa_pkcs_oaep_params), - "::", - stringify!(hashAlg) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).mgf as *const _ as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(ck_rsa_pkcs_oaep_params), - "::", - stringify!(mgf) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).source as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(ck_rsa_pkcs_oaep_params), - "::", - stringify!(source) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).pSourceData as *const _ as usize - }, - 12usize, - concat!( - "Offset of field: ", - stringify!(ck_rsa_pkcs_oaep_params), - "::", - stringify!(pSourceData) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).ulSourceDataLen as *const _ 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() - } - } -} -#[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], -} -#[test] -fn bindgen_test_layout_ck_aes_ctr_params() { - 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::null::())).ulCounterBits as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(ck_aes_ctr_params), - "::", - stringify!(ulCounterBits) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).cb as *const _ as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(ck_aes_ctr_params), - "::", - stringify!(cb) - ) - ); -} -#[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() { - 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::null::())).pIv as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(ck_gcm_params), - "::", - stringify!(pIv) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).ulIvLen as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(ck_gcm_params), - "::", - stringify!(ulIvLen) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).ulIvBits as *const _ as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(ck_gcm_params), - "::", - stringify!(ulIvBits) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).pAAD as *const _ as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(ck_gcm_params), - "::", - stringify!(pAAD) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).ulAADLen as *const _ as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(ck_gcm_params), - "::", - stringify!(ulAADLen) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).ulTagBits as *const _ 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_ec_kdf_t = ::std::os::raw::c_ulong; -#[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, -} -#[test] -fn bindgen_test_layout_ck_ecdh1_derive_params() { - assert_eq!( - ::std::mem::size_of::(), - 28usize, - concat!("Size of: ", stringify!(ck_ecdh1_derive_params)) - ); - assert_eq!( - ::std::mem::align_of::(), - 1usize, - concat!("Alignment of ", stringify!(ck_ecdh1_derive_params)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).kdf as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(ck_ecdh1_derive_params), - "::", - stringify!(kdf) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).ulSharedDataLen as *const _ as usize - }, - 4usize, - concat!( - "Offset of field: ", - stringify!(ck_ecdh1_derive_params), - "::", - stringify!(ulSharedDataLen) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).pSharedData as *const _ as usize - }, - 8usize, - concat!( - "Offset of field: ", - stringify!(ck_ecdh1_derive_params), - "::", - stringify!(pSharedData) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).ulPublicDataLen as *const _ as usize - }, - 16usize, - concat!( - "Offset of field: ", - stringify!(ck_ecdh1_derive_params), - "::", - stringify!(ulPublicDataLen) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).pPublicData as *const _ as usize - }, - 20usize, - concat!( - "Offset of field: ", - stringify!(ck_ecdh1_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() { - 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::null::())).pData as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(ck_key_derivation_string_data), - "::", - stringify!(pData) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).ulLen as *const _ 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() - } - } -} -#[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, -} -#[test] -fn bindgen_test_layout_ck_des_cbc_encrypt_data_params() { - 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::null::())).iv as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(ck_des_cbc_encrypt_data_params), - "::", - stringify!(iv) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).pData as *const _ as usize - }, - 8usize, - concat!( - "Offset of field: ", - stringify!(ck_des_cbc_encrypt_data_params), - "::", - stringify!(pData) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).length as *const _ 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() - } - } -} -#[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, -} -#[test] -fn bindgen_test_layout_ck_aes_cbc_encrypt_data_params() { - 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::null::())).iv as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(ck_aes_cbc_encrypt_data_params), - "::", - stringify!(iv) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).pData as *const _ as usize - }, - 16usize, - concat!( - "Offset of field: ", - stringify!(ck_aes_cbc_encrypt_data_params), - "::", - stringify!(pData) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).length as *const _ 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_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_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, - ) -> 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, - ) -> 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, - ) -> CK_RV, ->; -pub type CK_C_GetFunctionStatus = - ::std::option::Option CK_RV>; -pub type CK_C_CancelFunction = - ::std::option::Option CK_RV>; -#[repr(C, 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, -} -#[test] -fn bindgen_test_layout__CK_FUNCTION_LIST() { - assert_eq!( - ::std::mem::size_of::<_CK_FUNCTION_LIST>(), - 546usize, - concat!("Size of: ", stringify!(_CK_FUNCTION_LIST)) - ); - assert_eq!( - ::std::mem::align_of::<_CK_FUNCTION_LIST>(), - 1usize, - concat!("Alignment of ", stringify!(_CK_FUNCTION_LIST)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).version as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), - "::", - stringify!(version) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_Initialize as *const _ as usize }, - 2usize, - concat!( - "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), - "::", - stringify!(C_Initialize) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_Finalize as *const _ as usize }, - 10usize, - concat!( - "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), - "::", - stringify!(C_Finalize) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_GetInfo as *const _ as usize }, - 18usize, - concat!( - "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), - "::", - stringify!(C_GetInfo) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_GetFunctionList as *const _ as usize - }, - 26usize, - concat!( - "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), - "::", - stringify!(C_GetFunctionList) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_GetSlotList as *const _ as usize }, - 34usize, - concat!( - "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), - "::", - stringify!(C_GetSlotList) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_GetSlotInfo as *const _ as usize }, - 42usize, - concat!( - "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), - "::", - stringify!(C_GetSlotInfo) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_GetTokenInfo as *const _ as usize - }, - 50usize, - concat!( - "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), - "::", - stringify!(C_GetTokenInfo) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_GetMechanismList as *const _ as usize - }, - 58usize, - concat!( - "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), - "::", - stringify!(C_GetMechanismList) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_GetMechanismInfo as *const _ as usize - }, - 66usize, - concat!( - "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), - "::", - stringify!(C_GetMechanismInfo) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_InitToken as *const _ as usize }, - 74usize, - concat!( - "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), - "::", - stringify!(C_InitToken) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_InitPIN as *const _ as usize }, - 82usize, - concat!( - "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), - "::", - stringify!(C_InitPIN) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_SetPIN as *const _ as usize }, - 90usize, - concat!( - "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), - "::", - stringify!(C_SetPIN) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_OpenSession as *const _ as usize }, - 98usize, - concat!( - "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), - "::", - stringify!(C_OpenSession) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_CloseSession as *const _ as usize - }, - 106usize, - concat!( - "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), - "::", - stringify!(C_CloseSession) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_CloseAllSessions as *const _ as usize - }, - 114usize, - concat!( - "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), - "::", - stringify!(C_CloseAllSessions) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_GetSessionInfo as *const _ as usize - }, - 122usize, - concat!( - "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), - "::", - stringify!(C_GetSessionInfo) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_GetOperationState as *const _ as usize - }, - 130usize, - concat!( - "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), - "::", - stringify!(C_GetOperationState) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_SetOperationState as *const _ as usize - }, - 138usize, - concat!( - "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), - "::", - stringify!(C_SetOperationState) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_Login as *const _ as usize }, - 146usize, - concat!( - "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), - "::", - stringify!(C_Login) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_Logout as *const _ as usize }, - 154usize, - concat!( - "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), - "::", - stringify!(C_Logout) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_CreateObject as *const _ as usize - }, - 162usize, - concat!( - "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), - "::", - stringify!(C_CreateObject) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_CopyObject as *const _ as usize }, - 170usize, - concat!( - "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), - "::", - stringify!(C_CopyObject) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_DestroyObject as *const _ as usize - }, - 178usize, - concat!( - "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), - "::", - stringify!(C_DestroyObject) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_GetObjectSize as *const _ as usize - }, - 186usize, - concat!( - "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), - "::", - stringify!(C_GetObjectSize) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_GetAttributeValue as *const _ as usize - }, - 194usize, - concat!( - "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), - "::", - stringify!(C_GetAttributeValue) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_SetAttributeValue as *const _ as usize - }, - 202usize, - concat!( - "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), - "::", - stringify!(C_SetAttributeValue) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_FindObjectsInit as *const _ as usize - }, - 210usize, - concat!( - "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), - "::", - stringify!(C_FindObjectsInit) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_FindObjects as *const _ as usize }, - 218usize, - concat!( - "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), - "::", - stringify!(C_FindObjects) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_FindObjectsFinal as *const _ as usize - }, - 226usize, - concat!( - "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), - "::", - stringify!(C_FindObjectsFinal) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_EncryptInit as *const _ as usize }, - 234usize, - concat!( - "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), - "::", - stringify!(C_EncryptInit) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_Encrypt as *const _ as usize }, - 242usize, - concat!( - "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), - "::", - stringify!(C_Encrypt) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_EncryptUpdate as *const _ as usize - }, - 250usize, - concat!( - "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), - "::", - stringify!(C_EncryptUpdate) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_EncryptFinal as *const _ as usize - }, - 258usize, - concat!( - "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), - "::", - stringify!(C_EncryptFinal) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_DecryptInit as *const _ as usize }, - 266usize, - concat!( - "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), - "::", - stringify!(C_DecryptInit) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_Decrypt as *const _ as usize }, - 274usize, - concat!( - "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), - "::", - stringify!(C_Decrypt) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_DecryptUpdate as *const _ as usize - }, - 282usize, - concat!( - "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), - "::", - stringify!(C_DecryptUpdate) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_DecryptFinal as *const _ as usize - }, - 290usize, - concat!( - "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), - "::", - stringify!(C_DecryptFinal) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_DigestInit as *const _ as usize }, - 298usize, - concat!( - "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), - "::", - stringify!(C_DigestInit) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_Digest as *const _ as usize }, - 306usize, - concat!( - "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), - "::", - stringify!(C_Digest) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_DigestUpdate as *const _ as usize - }, - 314usize, - concat!( - "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), - "::", - stringify!(C_DigestUpdate) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_DigestKey as *const _ as usize }, - 322usize, - concat!( - "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), - "::", - stringify!(C_DigestKey) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_DigestFinal as *const _ as usize }, - 330usize, - concat!( - "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), - "::", - stringify!(C_DigestFinal) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_SignInit as *const _ as usize }, - 338usize, - concat!( - "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), - "::", - stringify!(C_SignInit) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_Sign as *const _ as usize }, - 346usize, - concat!( - "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), - "::", - stringify!(C_Sign) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_SignUpdate as *const _ as usize }, - 354usize, - concat!( - "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), - "::", - stringify!(C_SignUpdate) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_SignFinal as *const _ as usize }, - 362usize, - concat!( - "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), - "::", - stringify!(C_SignFinal) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_SignRecoverInit as *const _ as usize - }, - 370usize, - concat!( - "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), - "::", - stringify!(C_SignRecoverInit) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_SignRecover as *const _ as usize }, - 378usize, - concat!( - "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), - "::", - stringify!(C_SignRecover) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_VerifyInit as *const _ as usize }, - 386usize, - concat!( - "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), - "::", - stringify!(C_VerifyInit) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_Verify as *const _ as usize }, - 394usize, - concat!( - "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), - "::", - stringify!(C_Verify) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_VerifyUpdate as *const _ as usize - }, - 402usize, - concat!( - "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), - "::", - stringify!(C_VerifyUpdate) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_VerifyFinal as *const _ as usize }, - 410usize, - concat!( - "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), - "::", - stringify!(C_VerifyFinal) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_VerifyRecoverInit as *const _ as usize - }, - 418usize, - concat!( - "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), - "::", - stringify!(C_VerifyRecoverInit) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_VerifyRecover as *const _ as usize - }, - 426usize, - concat!( - "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), - "::", - stringify!(C_VerifyRecover) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_DigestEncryptUpdate as *const _ as usize - }, - 434usize, - concat!( - "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), - "::", - stringify!(C_DigestEncryptUpdate) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_DecryptDigestUpdate as *const _ as usize - }, - 442usize, - concat!( - "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), - "::", - stringify!(C_DecryptDigestUpdate) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_SignEncryptUpdate as *const _ as usize - }, - 450usize, - concat!( - "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), - "::", - stringify!(C_SignEncryptUpdate) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_DecryptVerifyUpdate as *const _ as usize - }, - 458usize, - concat!( - "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), - "::", - stringify!(C_DecryptVerifyUpdate) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_GenerateKey as *const _ as usize }, - 466usize, - concat!( - "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), - "::", - stringify!(C_GenerateKey) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_GenerateKeyPair as *const _ as usize - }, - 474usize, - concat!( - "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), - "::", - stringify!(C_GenerateKeyPair) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_WrapKey as *const _ as usize }, - 482usize, - concat!( - "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), - "::", - stringify!(C_WrapKey) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_UnwrapKey as *const _ as usize }, - 490usize, - concat!( - "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), - "::", - stringify!(C_UnwrapKey) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_DeriveKey as *const _ as usize }, - 498usize, - concat!( - "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), - "::", - stringify!(C_DeriveKey) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_SeedRandom as *const _ as usize }, - 506usize, - concat!( - "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), - "::", - stringify!(C_SeedRandom) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_GenerateRandom as *const _ as usize - }, - 514usize, - concat!( - "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), - "::", - stringify!(C_GenerateRandom) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_GetFunctionStatus as *const _ as usize - }, - 522usize, - concat!( - "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), - "::", - stringify!(C_GetFunctionStatus) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_CancelFunction as *const _ as usize - }, - 530usize, - concat!( - "Offset of field: ", - stringify!(_CK_FUNCTION_LIST), - "::", - stringify!(C_CancelFunction) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_FUNCTION_LIST>())).C_WaitForSlotEvent as *const _ as usize - }, - 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() { - 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::null::<_CK_C_INITIALIZE_ARGS>())).CreateMutex as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_CK_C_INITIALIZE_ARGS), - "::", - stringify!(CreateMutex) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_C_INITIALIZE_ARGS>())).DestroyMutex as *const _ as usize - }, - 8usize, - concat!( - "Offset of field: ", - stringify!(_CK_C_INITIALIZE_ARGS), - "::", - stringify!(DestroyMutex) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_C_INITIALIZE_ARGS>())).LockMutex as *const _ as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(_CK_C_INITIALIZE_ARGS), - "::", - stringify!(LockMutex) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<_CK_C_INITIALIZE_ARGS>())).UnlockMutex as *const _ as usize - }, - 24usize, - concat!( - "Offset of field: ", - stringify!(_CK_C_INITIALIZE_ARGS), - "::", - stringify!(UnlockMutex) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_C_INITIALIZE_ARGS>())).flags as *const _ as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(_CK_C_INITIALIZE_ARGS), - "::", - stringify!(flags) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_CK_C_INITIALIZE_ARGS>())).pReserved as *const _ as usize }, - 36usize, - concat!( - "Offset of field: ", - stringify!(_CK_C_INITIALIZE_ARGS), - "::", - 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 va_list = *mut ::std::os::raw::c_char; -pub type size_t = ::std::os::raw::c_ulonglong; -pub type __vcrt_bool = bool; -pub type wchar_t = ::std::os::raw::c_ushort; -pub type __crt_bool = bool; -pub type errno_t = ::std::os::raw::c_int; -pub type wint_t = ::std::os::raw::c_ushort; -pub type wctype_t = ::std::os::raw::c_ushort; -pub type __time32_t = ::std::os::raw::c_long; -pub type __time64_t = ::std::os::raw::c_longlong; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct __crt_locale_data_public { - pub _locale_pctype: *const ::std::os::raw::c_ushort, - pub _locale_mb_cur_max: ::std::os::raw::c_int, - pub _locale_lc_codepage: ::std::os::raw::c_uint, -} -#[test] -fn bindgen_test_layout___crt_locale_data_public() { - assert_eq!( - ::std::mem::size_of::<__crt_locale_data_public>(), - 16usize, - concat!("Size of: ", stringify!(__crt_locale_data_public)) - ); - assert_eq!( - ::std::mem::align_of::<__crt_locale_data_public>(), - 8usize, - concat!("Alignment of ", stringify!(__crt_locale_data_public)) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__crt_locale_data_public>()))._locale_pctype as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(__crt_locale_data_public), - "::", - stringify!(_locale_pctype) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__crt_locale_data_public>()))._locale_mb_cur_max as *const _ - as usize - }, - 8usize, - concat!( - "Offset of field: ", - stringify!(__crt_locale_data_public), - "::", - stringify!(_locale_mb_cur_max) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__crt_locale_data_public>()))._locale_lc_codepage as *const _ - as usize - }, - 12usize, - concat!( - "Offset of field: ", - stringify!(__crt_locale_data_public), - "::", - stringify!(_locale_lc_codepage) - ) - ); -} -impl Default for __crt_locale_data_public { - 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 __crt_locale_pointers { - pub locinfo: *mut __crt_locale_data, - pub mbcinfo: *mut __crt_multibyte_data, -} -#[test] -fn bindgen_test_layout___crt_locale_pointers() { - assert_eq!( - ::std::mem::size_of::<__crt_locale_pointers>(), - 16usize, - concat!("Size of: ", stringify!(__crt_locale_pointers)) - ); - assert_eq!( - ::std::mem::align_of::<__crt_locale_pointers>(), - 8usize, - concat!("Alignment of ", stringify!(__crt_locale_pointers)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<__crt_locale_pointers>())).locinfo as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(__crt_locale_pointers), - "::", - stringify!(locinfo) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<__crt_locale_pointers>())).mbcinfo as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(__crt_locale_pointers), - "::", - stringify!(mbcinfo) - ) - ); -} -impl Default for __crt_locale_pointers { - fn default() -> Self { - let mut s = ::std::mem::MaybeUninit::::uninit(); - unsafe { - ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -pub type _locale_t = *mut __crt_locale_pointers; -#[repr(C)] -#[derive(Debug, Default, Copy, Clone)] -pub struct _Mbstatet { - pub _Wchar: ::std::os::raw::c_ulong, - pub _Byte: ::std::os::raw::c_ushort, - pub _State: ::std::os::raw::c_ushort, -} -#[test] -fn bindgen_test_layout__Mbstatet() { - assert_eq!( - ::std::mem::size_of::<_Mbstatet>(), - 8usize, - concat!("Size of: ", stringify!(_Mbstatet)) - ); - assert_eq!( - ::std::mem::align_of::<_Mbstatet>(), - 4usize, - concat!("Alignment of ", stringify!(_Mbstatet)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_Mbstatet>()))._Wchar as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_Mbstatet), - "::", - stringify!(_Wchar) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_Mbstatet>()))._Byte as *const _ as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(_Mbstatet), - "::", - stringify!(_Byte) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_Mbstatet>()))._State as *const _ as usize }, - 6usize, - concat!( - "Offset of field: ", - stringify!(_Mbstatet), - "::", - stringify!(_State) - ) - ); -} -pub type mbstate_t = _Mbstatet; -pub type time_t = __time64_t; -pub type rsize_t = size_t; -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; -#[repr(C)] -#[derive(Debug, Default, Copy, Clone)] -pub struct __crt_locale_data { - pub _address: u8, -} -#[repr(C)] -#[derive(Debug, Default, Copy, Clone)] -pub struct __crt_multibyte_data { - pub _address: u8, -} -extern crate libloading; -pub struct Pkcs11 { - __library: ::libloading::Library, - pub C_GetFunctionList: Result< - unsafe extern "C" fn(function_list: *mut *mut _CK_FUNCTION_LIST) -> 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_GetFunctionList = __library.get(b"C_GetFunctionList\0").map(|sym| *sym); - Ok(Pkcs11 { - __library, - C_GetFunctionList, - }) - } - pub unsafe fn C_GetFunctionList(&self, function_list: *mut *mut _CK_FUNCTION_LIST) -> CK_RV { - (self - .C_GetFunctionList - .as_ref() - .expect("Expected function, got error."))(function_list) - } -} diff --git a/cryptoki-sys/src/lib.rs b/cryptoki-sys/src/lib.rs index c987fe3c..5f30d5d2 100644 --- a/cryptoki-sys/src/lib.rs +++ b/cryptoki-sys/src/lib.rs @@ -91,7 +91,7 @@ include!(concat!( ))] include!(concat!( env!("CARGO_MANIFEST_DIR"), - "/src/bindings/x86_64-windows.rs" + "/src/bindings/x86_64-pc-windows-msvc.rs" )); #[cfg(all( From a923ea1510d3543a8103049e6fd66a789e621cc5 Mon Sep 17 00:00:00 2001 From: Gowtham Suresh Kumar Date: Mon, 13 Mar 2023 11:07:04 +0000 Subject: [PATCH 6/6] Allow clippy warning for auto generated files Some of the generated functions has many arguments which is causing clippy issues. This patch allows the warning. Signed-off-by: Gowtham Suresh Kumar --- cryptoki-sys/src/lib.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/cryptoki-sys/src/lib.rs b/cryptoki-sys/src/lib.rs index 5f30d5d2..f9cc6cc9 100644 --- a/cryptoki-sys/src/lib.rs +++ b/cryptoki-sys/src/lib.rs @@ -6,6 +6,7 @@ #![allow(clippy::redundant_field_names)] #![allow(clippy::missing_safety_doc)] #![allow(clippy::string_lit_as_bytes)] +#![allow(clippy::too_many_arguments)] // Public items exportedby this crate should match the C style #![allow(clippy::upper_case_acronyms)] // Suppress warnings from bindgen-generated code