// Copyright 2018 Google LLC // // Use of this source code is governed by an MIT-style // license that can be found in the LICENSE file or at // https://opensource.org/licenses/MIT. // Some symbols are only used with certain features enabled, so we need to // suppress the unused warning when those features aren't enabled. #![allow(unused)] // Only necessary for test_symbol_conflict.sh, which exposes these symbols // through Mundane's public interface. #![allow(missing_docs)] // TODO(https://github.com/rust-lang/rust-bindgen/issues/1651): Remove this // once rustc doesn't think that bindgen's tests are causing UB. #![cfg_attr(test, allow(deref_nullptr))] #![allow(non_camel_case_types)] #![allow(non_snake_case)] #![allow(non_upper_case_globals)] #![allow(clippy::all)] #[link(name = "crypto_0_5_0")] extern "C" {} /* automatically generated by rust-bindgen 0.59.2 */ #[repr(C)] #[derive(Copy, Clone, Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd)] pub struct __BindgenBitfieldUnit { storage: Storage, } impl __BindgenBitfieldUnit { #[inline] pub const fn new(storage: Storage) -> Self { Self { storage } } } impl __BindgenBitfieldUnit where Storage: AsRef<[u8]> + AsMut<[u8]>, { #[inline] pub fn get_bit(&self, index: usize) -> bool { debug_assert!(index / 8 < self.storage.as_ref().len()); let byte_index = index / 8; let byte = self.storage.as_ref()[byte_index]; let bit_index = if cfg!(target_endian = "big") { 7 - (index % 8) } else { index % 8 }; let mask = 1 << bit_index; byte & mask == mask } #[inline] pub fn set_bit(&mut self, index: usize, val: bool) { debug_assert!(index / 8 < self.storage.as_ref().len()); let byte_index = index / 8; let byte = &mut self.storage.as_mut()[byte_index]; let bit_index = if cfg!(target_endian = "big") { 7 - (index % 8) } else { index % 8 }; let mask = 1 << bit_index; if val { *byte |= mask; } else { *byte &= !mask; } } #[inline] pub fn get(&self, bit_offset: usize, bit_width: u8) -> u64 { debug_assert!(bit_width <= 64); debug_assert!(bit_offset / 8 < self.storage.as_ref().len()); debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len()); let mut val = 0; for i in 0..(bit_width as usize) { if self.get_bit(i + bit_offset) { let index = if cfg!(target_endian = "big") { bit_width as usize - 1 - i } else { i }; val |= 1 << index; } } val } #[inline] pub fn set(&mut self, bit_offset: usize, bit_width: u8, val: u64) { debug_assert!(bit_width <= 64); debug_assert!(bit_offset / 8 < self.storage.as_ref().len()); debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len()); for i in 0..(bit_width as usize) { let mask = 1 << i; let val_bit_is_set = val & mask == mask; let index = if cfg!(target_endian = "big") { bit_width as usize - 1 - i } else { i }; self.set_bit(index + bit_offset, val_bit_is_set); } } } pub const ED25519_PRIVATE_KEY_LEN: u32 = 64; pub const ED25519_PUBLIC_KEY_LEN: u32 = 32; pub const ED25519_SIGNATURE_LEN: u32 = 64; pub const NID_md5: u32 = 4; pub const NID_sha1: u32 = 64; pub const NID_X9_62_prime256v1: u32 = 415; pub const NID_sha256: u32 = 672; pub const NID_sha384: u32 = 673; pub const NID_sha512: u32 = 674; pub const NID_secp384r1: u32 = 715; pub const NID_secp521r1: u32 = 716; pub const MD5_DIGEST_LENGTH: u32 = 16; pub const RSA_F4: u32 = 65537; pub const SHA_DIGEST_LENGTH: u32 = 20; pub const SHA256_DIGEST_LENGTH: u32 = 32; pub const SHA384_DIGEST_LENGTH: u32 = 48; pub const SHA512_DIGEST_LENGTH: u32 = 64; pub type size_t = ::std::os::raw::c_ulong; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct _opaque_pthread_rwlock_t { pub __sig: ::std::os::raw::c_long, pub __opaque: [::std::os::raw::c_char; 192usize], } #[test] fn bindgen_test_layout__opaque_pthread_rwlock_t() { assert_eq!( ::std::mem::size_of::<_opaque_pthread_rwlock_t>(), 200usize, concat!("Size of: ", stringify!(_opaque_pthread_rwlock_t)) ); assert_eq!( ::std::mem::align_of::<_opaque_pthread_rwlock_t>(), 8usize, concat!("Alignment of ", stringify!(_opaque_pthread_rwlock_t)) ); assert_eq!( unsafe { &(*(::std::ptr::null::<_opaque_pthread_rwlock_t>())).__sig as *const _ as usize }, 0usize, concat!("Offset of field: ", stringify!(_opaque_pthread_rwlock_t), "::", stringify!(__sig)) ); assert_eq!( unsafe { &(*(::std::ptr::null::<_opaque_pthread_rwlock_t>())).__opaque as *const _ as usize }, 8usize, concat!( "Offset of field: ", stringify!(_opaque_pthread_rwlock_t), "::", stringify!(__opaque) ) ); } pub type __darwin_pthread_rwlock_t = _opaque_pthread_rwlock_t; pub type pthread_rwlock_t = __darwin_pthread_rwlock_t; pub type BIGNUM = bignum_st; pub type BN_GENCB = bn_gencb_st; pub type BN_MONT_CTX = bn_mont_ctx_st; pub type CBB = cbb_st; pub type CBS = cbs_st; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct dh_st { _unused: [u8; 0], } pub type DH = dh_st; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct dsa_st { _unused: [u8; 0], } pub type DSA = dsa_st; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct ec_group_st { _unused: [u8; 0], } pub type EC_GROUP = ec_group_st; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct ec_key_st { _unused: [u8; 0], } pub type EC_KEY = ec_key_st; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct engine_st { _unused: [u8; 0], } pub type ENGINE = engine_st; pub type EVP_MD_CTX = env_md_ctx_st; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct env_md_st { _unused: [u8; 0], } pub type EVP_MD = env_md_st; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct evp_pkey_asn1_method_st { _unused: [u8; 0], } pub type EVP_PKEY_ASN1_METHOD = evp_pkey_asn1_method_st; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct evp_pkey_ctx_st { _unused: [u8; 0], } pub type EVP_PKEY_CTX = evp_pkey_ctx_st; pub type EVP_PKEY = evp_pkey_st; pub type HMAC_CTX = hmac_ctx_st; pub type MD5_CTX = md5_state_st; pub type RC4_KEY = rc4_key_st; pub type RSA_METHOD = rsa_meth_st; pub type RSA = rsa_st; pub type SHA256_CTX = sha256_state_st; pub type SHA512_CTX = sha512_state_st; pub type SHA_CTX = sha_state_st; pub type CRYPTO_MUTEX = pthread_rwlock_t; pub type CRYPTO_refcount_t = u32; extern "C" { #[link_name = "__RUST_MUNDANE_0_5_0_BN_init"] pub fn BN_init(bn: *mut BIGNUM); } extern "C" { #[link_name = "__RUST_MUNDANE_0_5_0_BN_free"] pub fn BN_free(bn: *mut BIGNUM); } extern "C" { #[link_name = "__RUST_MUNDANE_0_5_0_BN_num_bytes"] pub fn BN_num_bytes(bn: *const BIGNUM) -> ::std::os::raw::c_uint; } extern "C" { #[link_name = "__RUST_MUNDANE_0_5_0_BN_set_u64"] pub fn BN_set_u64(bn: *mut BIGNUM, value: u64) -> ::std::os::raw::c_int; } extern "C" { #[link_name = "__RUST_MUNDANE_0_5_0_BN_bn2bin_padded"] pub fn BN_bn2bin_padded(out: *mut u8, len: size_t, in_: *const BIGNUM) -> ::std::os::raw::c_int; } #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct bn_gencb_st { pub arg: *mut ::std::os::raw::c_void, pub callback: ::std::option::Option< unsafe extern "C" fn( event: ::std::os::raw::c_int, n: ::std::os::raw::c_int, arg1: *mut bn_gencb_st, ) -> ::std::os::raw::c_int, >, } #[test] fn bindgen_test_layout_bn_gencb_st() { assert_eq!( ::std::mem::size_of::(), 16usize, concat!("Size of: ", stringify!(bn_gencb_st)) ); assert_eq!( ::std::mem::align_of::(), 8usize, concat!("Alignment of ", stringify!(bn_gencb_st)) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).arg as *const _ as usize }, 0usize, concat!("Offset of field: ", stringify!(bn_gencb_st), "::", stringify!(arg)) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).callback as *const _ as usize }, 8usize, concat!("Offset of field: ", stringify!(bn_gencb_st), "::", stringify!(callback)) ); } #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct bignum_st { pub d: *mut u64, pub width: ::std::os::raw::c_int, pub dmax: ::std::os::raw::c_int, pub neg: ::std::os::raw::c_int, pub flags: ::std::os::raw::c_int, } #[test] fn bindgen_test_layout_bignum_st() { assert_eq!( ::std::mem::size_of::(), 24usize, concat!("Size of: ", stringify!(bignum_st)) ); assert_eq!( ::std::mem::align_of::(), 8usize, concat!("Alignment of ", stringify!(bignum_st)) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).d as *const _ as usize }, 0usize, concat!("Offset of field: ", stringify!(bignum_st), "::", stringify!(d)) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).width as *const _ as usize }, 8usize, concat!("Offset of field: ", stringify!(bignum_st), "::", stringify!(width)) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).dmax as *const _ as usize }, 12usize, concat!("Offset of field: ", stringify!(bignum_st), "::", stringify!(dmax)) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).neg as *const _ as usize }, 16usize, concat!("Offset of field: ", stringify!(bignum_st), "::", stringify!(neg)) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).flags as *const _ as usize }, 20usize, concat!("Offset of field: ", stringify!(bignum_st), "::", stringify!(flags)) ); } #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct bn_mont_ctx_st { pub RR: BIGNUM, pub N: BIGNUM, pub n0: [u64; 2usize], } #[test] fn bindgen_test_layout_bn_mont_ctx_st() { assert_eq!( ::std::mem::size_of::(), 64usize, concat!("Size of: ", stringify!(bn_mont_ctx_st)) ); assert_eq!( ::std::mem::align_of::(), 8usize, concat!("Alignment of ", stringify!(bn_mont_ctx_st)) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).RR as *const _ as usize }, 0usize, concat!("Offset of field: ", stringify!(bn_mont_ctx_st), "::", stringify!(RR)) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).N as *const _ as usize }, 24usize, concat!("Offset of field: ", stringify!(bn_mont_ctx_st), "::", stringify!(N)) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).n0 as *const _ as usize }, 48usize, concat!("Offset of field: ", stringify!(bn_mont_ctx_st), "::", stringify!(n0)) ); } #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct cbs_st { pub data: *const u8, pub len: size_t, } #[test] fn bindgen_test_layout_cbs_st() { assert_eq!(::std::mem::size_of::(), 16usize, concat!("Size of: ", stringify!(cbs_st))); assert_eq!( ::std::mem::align_of::(), 8usize, concat!("Alignment of ", stringify!(cbs_st)) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).data as *const _ as usize }, 0usize, concat!("Offset of field: ", stringify!(cbs_st), "::", stringify!(data)) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).len as *const _ as usize }, 8usize, concat!("Offset of field: ", stringify!(cbs_st), "::", stringify!(len)) ); } extern "C" { #[link_name = "__RUST_MUNDANE_0_5_0_CBS_init"] pub fn CBS_init(cbs: *mut CBS, data: *const u8, len: size_t); } extern "C" { #[link_name = "__RUST_MUNDANE_0_5_0_CBS_len"] pub fn CBS_len(cbs: *const CBS) -> size_t; } #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct cbb_buffer_st { pub buf: *mut u8, pub len: size_t, pub cap: size_t, pub can_resize: ::std::os::raw::c_char, pub error: ::std::os::raw::c_char, } #[test] fn bindgen_test_layout_cbb_buffer_st() { assert_eq!( ::std::mem::size_of::(), 32usize, concat!("Size of: ", stringify!(cbb_buffer_st)) ); assert_eq!( ::std::mem::align_of::(), 8usize, concat!("Alignment of ", stringify!(cbb_buffer_st)) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).buf as *const _ as usize }, 0usize, concat!("Offset of field: ", stringify!(cbb_buffer_st), "::", stringify!(buf)) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).len as *const _ as usize }, 8usize, concat!("Offset of field: ", stringify!(cbb_buffer_st), "::", stringify!(len)) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).cap as *const _ as usize }, 16usize, concat!("Offset of field: ", stringify!(cbb_buffer_st), "::", stringify!(cap)) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).can_resize as *const _ as usize }, 24usize, concat!("Offset of field: ", stringify!(cbb_buffer_st), "::", stringify!(can_resize)) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).error as *const _ as usize }, 25usize, concat!("Offset of field: ", stringify!(cbb_buffer_st), "::", stringify!(error)) ); } #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct cbb_st { pub base: *mut cbb_buffer_st, pub child: *mut CBB, pub offset: size_t, pub pending_len_len: u8, pub pending_is_asn1: ::std::os::raw::c_char, pub is_child: ::std::os::raw::c_char, } #[test] fn bindgen_test_layout_cbb_st() { assert_eq!(::std::mem::size_of::(), 32usize, concat!("Size of: ", stringify!(cbb_st))); assert_eq!( ::std::mem::align_of::(), 8usize, concat!("Alignment of ", stringify!(cbb_st)) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).base as *const _ as usize }, 0usize, concat!("Offset of field: ", stringify!(cbb_st), "::", stringify!(base)) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).child as *const _ as usize }, 8usize, concat!("Offset of field: ", stringify!(cbb_st), "::", stringify!(child)) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).offset as *const _ as usize }, 16usize, concat!("Offset of field: ", stringify!(cbb_st), "::", stringify!(offset)) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).pending_len_len as *const _ as usize }, 24usize, concat!("Offset of field: ", stringify!(cbb_st), "::", stringify!(pending_len_len)) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).pending_is_asn1 as *const _ as usize }, 25usize, concat!("Offset of field: ", stringify!(cbb_st), "::", stringify!(pending_is_asn1)) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).is_child as *const _ as usize }, 26usize, concat!("Offset of field: ", stringify!(cbb_st), "::", stringify!(is_child)) ); } extern "C" { #[link_name = "__RUST_MUNDANE_0_5_0_CBB_init"] pub fn CBB_init(cbb: *mut CBB, initial_capacity: size_t) -> ::std::os::raw::c_int; } extern "C" { #[link_name = "__RUST_MUNDANE_0_5_0_CBB_cleanup"] pub fn CBB_cleanup(cbb: *mut CBB); } extern "C" { #[link_name = "__RUST_MUNDANE_0_5_0_CBB_data"] pub fn CBB_data(cbb: *const CBB) -> *const u8; } extern "C" { #[link_name = "__RUST_MUNDANE_0_5_0_CBB_len"] pub fn CBB_len(cbb: *const CBB) -> size_t; } extern "C" { #[link_name = "__RUST_MUNDANE_0_5_0_ED25519_keypair"] pub fn ED25519_keypair(out_public_key: *mut u8, out_private_key: *mut u8); } extern "C" { #[link_name = "__RUST_MUNDANE_0_5_0_ED25519_sign"] pub fn ED25519_sign( out_sig: *mut u8, message: *const u8, message_len: size_t, private_key: *const u8, ) -> ::std::os::raw::c_int; } extern "C" { #[link_name = "__RUST_MUNDANE_0_5_0_ED25519_verify"] pub fn ED25519_verify( message: *const u8, message_len: size_t, signature: *const u8, public_key: *const u8, ) -> ::std::os::raw::c_int; } extern "C" { #[link_name = "__RUST_MUNDANE_0_5_0_ED25519_keypair_from_seed"] pub fn ED25519_keypair_from_seed( out_public_key: *mut u8, out_private_key: *mut u8, seed: *const u8, ); } extern "C" { #[link_name = "__RUST_MUNDANE_0_5_0_EC_GROUP_new_by_curve_name"] pub fn EC_GROUP_new_by_curve_name(nid: ::std::os::raw::c_int) -> *mut EC_GROUP; } extern "C" { #[link_name = "__RUST_MUNDANE_0_5_0_EC_GROUP_get_curve_name"] pub fn EC_GROUP_get_curve_name(group: *const EC_GROUP) -> ::std::os::raw::c_int; } extern "C" { #[link_name = "__RUST_MUNDANE_0_5_0_EC_curve_nid2nist"] pub fn EC_curve_nid2nist(nid: ::std::os::raw::c_int) -> *const ::std::os::raw::c_char; } #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct openssl_method_common_st { pub references: ::std::os::raw::c_int, pub is_static: ::std::os::raw::c_char, } #[test] fn bindgen_test_layout_openssl_method_common_st() { assert_eq!( ::std::mem::size_of::(), 8usize, concat!("Size of: ", stringify!(openssl_method_common_st)) ); assert_eq!( ::std::mem::align_of::(), 4usize, concat!("Alignment of ", stringify!(openssl_method_common_st)) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).references as *const _ as usize }, 0usize, concat!( "Offset of field: ", stringify!(openssl_method_common_st), "::", stringify!(references) ) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).is_static as *const _ as usize }, 4usize, concat!( "Offset of field: ", stringify!(openssl_method_common_st), "::", stringify!(is_static) ) ); } #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct stack_st_void { _unused: [u8; 0], } pub type CRYPTO_EX_DATA = crypto_ex_data_st; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct crypto_ex_data_st { pub sk: *mut stack_st_void, } #[test] fn bindgen_test_layout_crypto_ex_data_st() { assert_eq!( ::std::mem::size_of::(), 8usize, concat!("Size of: ", stringify!(crypto_ex_data_st)) ); assert_eq!( ::std::mem::align_of::(), 8usize, concat!("Alignment of ", stringify!(crypto_ex_data_st)) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).sk as *const _ as usize }, 0usize, concat!("Offset of field: ", stringify!(crypto_ex_data_st), "::", stringify!(sk)) ); } extern "C" { #[link_name = "__RUST_MUNDANE_0_5_0_EC_KEY_new"] pub fn EC_KEY_new() -> *mut EC_KEY; } extern "C" { #[link_name = "__RUST_MUNDANE_0_5_0_EC_KEY_free"] pub fn EC_KEY_free(key: *mut EC_KEY); } extern "C" { #[link_name = "__RUST_MUNDANE_0_5_0_EC_KEY_up_ref"] pub fn EC_KEY_up_ref(key: *mut EC_KEY) -> ::std::os::raw::c_int; } extern "C" { #[link_name = "__RUST_MUNDANE_0_5_0_EC_KEY_get0_group"] pub fn EC_KEY_get0_group(key: *const EC_KEY) -> *const EC_GROUP; } extern "C" { #[link_name = "__RUST_MUNDANE_0_5_0_EC_KEY_set_group"] pub fn EC_KEY_set_group(key: *mut EC_KEY, group: *const EC_GROUP) -> ::std::os::raw::c_int; } extern "C" { #[link_name = "__RUST_MUNDANE_0_5_0_EC_KEY_generate_key"] pub fn EC_KEY_generate_key(key: *mut EC_KEY) -> ::std::os::raw::c_int; } extern "C" { #[link_name = "__RUST_MUNDANE_0_5_0_EC_KEY_parse_private_key"] pub fn EC_KEY_parse_private_key(cbs: *mut CBS, group: *const EC_GROUP) -> *mut EC_KEY; } extern "C" { #[link_name = "__RUST_MUNDANE_0_5_0_EC_KEY_marshal_private_key"] pub fn EC_KEY_marshal_private_key( cbb: *mut CBB, key: *const EC_KEY, enc_flags: ::std::os::raw::c_uint, ) -> ::std::os::raw::c_int; } extern "C" { #[link_name = "__RUST_MUNDANE_0_5_0_ECDSA_sign"] pub fn ECDSA_sign( type_: ::std::os::raw::c_int, digest: *const u8, digest_len: size_t, sig: *mut u8, sig_len: *mut ::std::os::raw::c_uint, key: *const EC_KEY, ) -> ::std::os::raw::c_int; } extern "C" { #[link_name = "__RUST_MUNDANE_0_5_0_ECDSA_verify"] pub fn ECDSA_verify( type_: ::std::os::raw::c_int, digest: *const u8, digest_len: size_t, sig: *const u8, sig_len: size_t, key: *const EC_KEY, ) -> ::std::os::raw::c_int; } extern "C" { #[link_name = "__RUST_MUNDANE_0_5_0_ECDSA_size"] pub fn ECDSA_size(key: *const EC_KEY) -> size_t; } pub type ERR_print_errors_callback_t = ::std::option::Option< unsafe extern "C" fn( str_: *const ::std::os::raw::c_char, len: size_t, ctx: *mut ::std::os::raw::c_void, ) -> ::std::os::raw::c_int, >; extern "C" { #[link_name = "__RUST_MUNDANE_0_5_0_ERR_print_errors_cb"] pub fn ERR_print_errors_cb( callback: ERR_print_errors_callback_t, ctx: *mut ::std::os::raw::c_void, ); } extern "C" { #[link_name = "__RUST_MUNDANE_0_5_0_EVP_md5"] pub fn EVP_md5() -> *const EVP_MD; } extern "C" { #[link_name = "__RUST_MUNDANE_0_5_0_EVP_sha1"] pub fn EVP_sha1() -> *const EVP_MD; } extern "C" { #[link_name = "__RUST_MUNDANE_0_5_0_EVP_sha256"] pub fn EVP_sha256() -> *const EVP_MD; } extern "C" { #[link_name = "__RUST_MUNDANE_0_5_0_EVP_sha384"] pub fn EVP_sha384() -> *const EVP_MD; } extern "C" { #[link_name = "__RUST_MUNDANE_0_5_0_EVP_sha512"] pub fn EVP_sha512() -> *const EVP_MD; } #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct evp_md_pctx_ops { _unused: [u8; 0], } #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct env_md_ctx_st { pub digest: *const EVP_MD, pub md_data: *mut ::std::os::raw::c_void, pub pctx: *mut EVP_PKEY_CTX, pub pctx_ops: *const evp_md_pctx_ops, } #[test] fn bindgen_test_layout_env_md_ctx_st() { assert_eq!( ::std::mem::size_of::(), 32usize, concat!("Size of: ", stringify!(env_md_ctx_st)) ); assert_eq!( ::std::mem::align_of::(), 8usize, concat!("Alignment of ", stringify!(env_md_ctx_st)) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).digest as *const _ as usize }, 0usize, concat!("Offset of field: ", stringify!(env_md_ctx_st), "::", stringify!(digest)) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).md_data as *const _ as usize }, 8usize, concat!("Offset of field: ", stringify!(env_md_ctx_st), "::", stringify!(md_data)) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).pctx as *const _ as usize }, 16usize, concat!("Offset of field: ", stringify!(env_md_ctx_st), "::", stringify!(pctx)) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).pctx_ops as *const _ as usize }, 24usize, concat!("Offset of field: ", stringify!(env_md_ctx_st), "::", stringify!(pctx_ops)) ); } extern "C" { #[link_name = "__RUST_MUNDANE_0_5_0_EVP_PKEY_new"] pub fn EVP_PKEY_new() -> *mut EVP_PKEY; } extern "C" { #[link_name = "__RUST_MUNDANE_0_5_0_EVP_PKEY_free"] pub fn EVP_PKEY_free(pkey: *mut EVP_PKEY); } extern "C" { #[link_name = "__RUST_MUNDANE_0_5_0_EVP_PKEY_up_ref"] pub fn EVP_PKEY_up_ref(pkey: *mut EVP_PKEY) -> ::std::os::raw::c_int; } extern "C" { #[link_name = "__RUST_MUNDANE_0_5_0_EVP_PKEY_assign_RSA"] pub fn EVP_PKEY_assign_RSA(pkey: *mut EVP_PKEY, key: *mut RSA) -> ::std::os::raw::c_int; } extern "C" { #[link_name = "__RUST_MUNDANE_0_5_0_EVP_PKEY_get1_RSA"] pub fn EVP_PKEY_get1_RSA(pkey: *const EVP_PKEY) -> *mut RSA; } extern "C" { #[link_name = "__RUST_MUNDANE_0_5_0_EVP_PKEY_assign_EC_KEY"] pub fn EVP_PKEY_assign_EC_KEY(pkey: *mut EVP_PKEY, key: *mut EC_KEY) -> ::std::os::raw::c_int; } extern "C" { #[link_name = "__RUST_MUNDANE_0_5_0_EVP_PKEY_get1_EC_KEY"] pub fn EVP_PKEY_get1_EC_KEY(pkey: *const EVP_PKEY) -> *mut EC_KEY; } extern "C" { #[link_name = "__RUST_MUNDANE_0_5_0_EVP_parse_public_key"] pub fn EVP_parse_public_key(cbs: *mut CBS) -> *mut EVP_PKEY; } extern "C" { #[link_name = "__RUST_MUNDANE_0_5_0_EVP_marshal_public_key"] pub fn EVP_marshal_public_key(cbb: *mut CBB, key: *const EVP_PKEY) -> ::std::os::raw::c_int; } extern "C" { #[link_name = "__RUST_MUNDANE_0_5_0_PKCS5_PBKDF2_HMAC"] pub fn PKCS5_PBKDF2_HMAC( password: *const ::std::os::raw::c_char, password_len: size_t, salt: *const u8, salt_len: size_t, iterations: ::std::os::raw::c_uint, digest: *const EVP_MD, key_len: size_t, out_key: *mut u8, ) -> ::std::os::raw::c_int; } extern "C" { #[link_name = "__RUST_MUNDANE_0_5_0_EVP_PBE_scrypt"] pub fn EVP_PBE_scrypt( password: *const ::std::os::raw::c_char, password_len: size_t, salt: *const u8, salt_len: size_t, N: u64, r: u64, p: u64, max_mem: size_t, out_key: *mut u8, key_len: size_t, ) -> ::std::os::raw::c_int; } #[repr(C)] #[derive(Copy, Clone)] pub struct evp_pkey_st { pub references: CRYPTO_refcount_t, pub type_: ::std::os::raw::c_int, pub pkey: evp_pkey_st__bindgen_ty_1, pub ameth: *const EVP_PKEY_ASN1_METHOD, } #[repr(C)] #[derive(Copy, Clone)] pub union evp_pkey_st__bindgen_ty_1 { pub ptr: *mut ::std::os::raw::c_void, pub rsa: *mut RSA, pub dsa: *mut DSA, pub dh: *mut DH, pub ec: *mut EC_KEY, } #[test] fn bindgen_test_layout_evp_pkey_st__bindgen_ty_1() { assert_eq!( ::std::mem::size_of::(), 8usize, concat!("Size of: ", stringify!(evp_pkey_st__bindgen_ty_1)) ); assert_eq!( ::std::mem::align_of::(), 8usize, concat!("Alignment of ", stringify!(evp_pkey_st__bindgen_ty_1)) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).ptr as *const _ as usize }, 0usize, concat!("Offset of field: ", stringify!(evp_pkey_st__bindgen_ty_1), "::", stringify!(ptr)) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).rsa as *const _ as usize }, 0usize, concat!("Offset of field: ", stringify!(evp_pkey_st__bindgen_ty_1), "::", stringify!(rsa)) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).dsa as *const _ as usize }, 0usize, concat!("Offset of field: ", stringify!(evp_pkey_st__bindgen_ty_1), "::", stringify!(dsa)) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).dh as *const _ as usize }, 0usize, concat!("Offset of field: ", stringify!(evp_pkey_st__bindgen_ty_1), "::", stringify!(dh)) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).ec as *const _ as usize }, 0usize, concat!("Offset of field: ", stringify!(evp_pkey_st__bindgen_ty_1), "::", stringify!(ec)) ); } #[test] fn bindgen_test_layout_evp_pkey_st() { assert_eq!( ::std::mem::size_of::(), 24usize, concat!("Size of: ", stringify!(evp_pkey_st)) ); assert_eq!( ::std::mem::align_of::(), 8usize, concat!("Alignment of ", stringify!(evp_pkey_st)) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).references as *const _ as usize }, 0usize, concat!("Offset of field: ", stringify!(evp_pkey_st), "::", stringify!(references)) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).type_ as *const _ as usize }, 4usize, concat!("Offset of field: ", stringify!(evp_pkey_st), "::", stringify!(type_)) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).pkey as *const _ as usize }, 8usize, concat!("Offset of field: ", stringify!(evp_pkey_st), "::", stringify!(pkey)) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).ameth as *const _ as usize }, 16usize, concat!("Offset of field: ", stringify!(evp_pkey_st), "::", stringify!(ameth)) ); } extern "C" { #[link_name = "__RUST_MUNDANE_0_5_0_HMAC_CTX_init"] pub fn HMAC_CTX_init(ctx: *mut HMAC_CTX); } extern "C" { #[link_name = "__RUST_MUNDANE_0_5_0_HMAC_CTX_cleanup"] pub fn HMAC_CTX_cleanup(ctx: *mut HMAC_CTX); } extern "C" { #[link_name = "__RUST_MUNDANE_0_5_0_HMAC_Init_ex"] pub fn HMAC_Init_ex( ctx: *mut HMAC_CTX, key: *const ::std::os::raw::c_void, key_len: size_t, md: *const EVP_MD, impl_: *mut ENGINE, ) -> ::std::os::raw::c_int; } extern "C" { #[link_name = "__RUST_MUNDANE_0_5_0_HMAC_Update"] pub fn HMAC_Update( ctx: *mut HMAC_CTX, data: *const u8, data_len: size_t, ) -> ::std::os::raw::c_int; } extern "C" { #[link_name = "__RUST_MUNDANE_0_5_0_HMAC_Final"] pub fn HMAC_Final( ctx: *mut HMAC_CTX, out: *mut u8, out_len: *mut ::std::os::raw::c_uint, ) -> ::std::os::raw::c_int; } extern "C" { #[link_name = "__RUST_MUNDANE_0_5_0_HMAC_size"] pub fn HMAC_size(ctx: *const HMAC_CTX) -> size_t; } extern "C" { #[link_name = "__RUST_MUNDANE_0_5_0_HMAC_CTX_copy"] pub fn HMAC_CTX_copy(dest: *mut HMAC_CTX, src: *const HMAC_CTX) -> ::std::os::raw::c_int; } #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct hmac_ctx_st { pub md: *const EVP_MD, pub md_ctx: EVP_MD_CTX, pub i_ctx: EVP_MD_CTX, pub o_ctx: EVP_MD_CTX, } #[test] fn bindgen_test_layout_hmac_ctx_st() { assert_eq!( ::std::mem::size_of::(), 104usize, concat!("Size of: ", stringify!(hmac_ctx_st)) ); assert_eq!( ::std::mem::align_of::(), 8usize, concat!("Alignment of ", stringify!(hmac_ctx_st)) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).md as *const _ as usize }, 0usize, concat!("Offset of field: ", stringify!(hmac_ctx_st), "::", stringify!(md)) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).md_ctx as *const _ as usize }, 8usize, concat!("Offset of field: ", stringify!(hmac_ctx_st), "::", stringify!(md_ctx)) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).i_ctx as *const _ as usize }, 40usize, concat!("Offset of field: ", stringify!(hmac_ctx_st), "::", stringify!(i_ctx)) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).o_ctx as *const _ as usize }, 72usize, concat!("Offset of field: ", stringify!(hmac_ctx_st), "::", stringify!(o_ctx)) ); } extern "C" { #[link_name = "__RUST_MUNDANE_0_5_0_MD5_Init"] pub fn MD5_Init(md5: *mut MD5_CTX) -> ::std::os::raw::c_int; } extern "C" { #[link_name = "__RUST_MUNDANE_0_5_0_MD5_Update"] pub fn MD5_Update( md5: *mut MD5_CTX, data: *const ::std::os::raw::c_void, len: size_t, ) -> ::std::os::raw::c_int; } extern "C" { #[link_name = "__RUST_MUNDANE_0_5_0_MD5_Final"] pub fn MD5_Final(out: *mut u8, md5: *mut MD5_CTX) -> ::std::os::raw::c_int; } extern "C" { #[link_name = "__RUST_MUNDANE_0_5_0_MD5_Transform"] pub fn MD5_Transform(md5: *mut MD5_CTX, block: *const u8); } #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct md5_state_st { pub h: [u32; 4usize], pub Nl: u32, pub Nh: u32, pub data: [u8; 64usize], pub num: ::std::os::raw::c_uint, } #[test] fn bindgen_test_layout_md5_state_st() { assert_eq!( ::std::mem::size_of::(), 92usize, concat!("Size of: ", stringify!(md5_state_st)) ); assert_eq!( ::std::mem::align_of::(), 4usize, concat!("Alignment of ", stringify!(md5_state_st)) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).h as *const _ as usize }, 0usize, concat!("Offset of field: ", stringify!(md5_state_st), "::", stringify!(h)) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).Nl as *const _ as usize }, 16usize, concat!("Offset of field: ", stringify!(md5_state_st), "::", stringify!(Nl)) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).Nh as *const _ as usize }, 20usize, concat!("Offset of field: ", stringify!(md5_state_st), "::", stringify!(Nh)) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).data as *const _ as usize }, 24usize, concat!("Offset of field: ", stringify!(md5_state_st), "::", stringify!(data)) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).num as *const _ as usize }, 88usize, concat!("Offset of field: ", stringify!(md5_state_st), "::", stringify!(num)) ); } extern "C" { #[link_name = "__RUST_MUNDANE_0_5_0_CRYPTO_memcmp"] pub fn CRYPTO_memcmp( a: *const ::std::os::raw::c_void, b: *const ::std::os::raw::c_void, len: size_t, ) -> ::std::os::raw::c_int; } extern "C" { #[link_name = "__RUST_MUNDANE_0_5_0_RAND_bytes"] pub fn RAND_bytes(buf: *mut u8, len: size_t) -> ::std::os::raw::c_int; } #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct rc4_key_st { pub x: u32, pub y: u32, pub data: [u32; 256usize], } #[test] fn bindgen_test_layout_rc4_key_st() { assert_eq!( ::std::mem::size_of::(), 1032usize, concat!("Size of: ", stringify!(rc4_key_st)) ); assert_eq!( ::std::mem::align_of::(), 4usize, concat!("Alignment of ", stringify!(rc4_key_st)) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).x as *const _ as usize }, 0usize, concat!("Offset of field: ", stringify!(rc4_key_st), "::", stringify!(x)) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).y as *const _ as usize }, 4usize, concat!("Offset of field: ", stringify!(rc4_key_st), "::", stringify!(y)) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).data as *const _ as usize }, 8usize, concat!("Offset of field: ", stringify!(rc4_key_st), "::", stringify!(data)) ); } extern "C" { #[link_name = "__RUST_MUNDANE_0_5_0_RC4_set_key"] pub fn RC4_set_key(rc4key: *mut RC4_KEY, len: ::std::os::raw::c_uint, key: *const u8); } extern "C" { #[link_name = "__RUST_MUNDANE_0_5_0_RC4"] pub fn RC4(key: *mut RC4_KEY, len: size_t, in_: *const u8, out: *mut u8); } extern "C" { #[link_name = "__RUST_MUNDANE_0_5_0_RSA_new"] pub fn RSA_new() -> *mut RSA; } extern "C" { #[link_name = "__RUST_MUNDANE_0_5_0_RSA_free"] pub fn RSA_free(rsa: *mut RSA); } extern "C" { #[link_name = "__RUST_MUNDANE_0_5_0_RSA_up_ref"] pub fn RSA_up_ref(rsa: *mut RSA) -> ::std::os::raw::c_int; } extern "C" { #[link_name = "__RUST_MUNDANE_0_5_0_RSA_bits"] pub fn RSA_bits(rsa: *const RSA) -> ::std::os::raw::c_uint; } extern "C" { #[link_name = "__RUST_MUNDANE_0_5_0_RSA_get0_n"] pub fn RSA_get0_n(rsa: *const RSA) -> *const BIGNUM; } extern "C" { #[link_name = "__RUST_MUNDANE_0_5_0_RSA_get0_e"] pub fn RSA_get0_e(rsa: *const RSA) -> *const BIGNUM; } extern "C" { #[link_name = "__RUST_MUNDANE_0_5_0_RSA_generate_key_ex"] pub fn RSA_generate_key_ex( rsa: *mut RSA, bits: ::std::os::raw::c_int, e: *const BIGNUM, cb: *mut BN_GENCB, ) -> ::std::os::raw::c_int; } extern "C" { #[link_name = "__RUST_MUNDANE_0_5_0_RSA_sign"] pub fn RSA_sign( hash_nid: ::std::os::raw::c_int, digest: *const u8, digest_len: ::std::os::raw::c_uint, out: *mut u8, out_len: *mut ::std::os::raw::c_uint, rsa: *mut RSA, ) -> ::std::os::raw::c_int; } extern "C" { #[link_name = "__RUST_MUNDANE_0_5_0_RSA_sign_pss_mgf1"] pub fn RSA_sign_pss_mgf1( rsa: *mut RSA, out_len: *mut size_t, out: *mut u8, max_out: size_t, digest: *const u8, digest_len: size_t, md: *const EVP_MD, mgf1_md: *const EVP_MD, salt_len: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int; } extern "C" { #[link_name = "__RUST_MUNDANE_0_5_0_RSA_verify"] pub fn RSA_verify( hash_nid: ::std::os::raw::c_int, digest: *const u8, digest_len: size_t, sig: *const u8, sig_len: size_t, rsa: *mut RSA, ) -> ::std::os::raw::c_int; } extern "C" { #[link_name = "__RUST_MUNDANE_0_5_0_RSA_verify_pss_mgf1"] pub fn RSA_verify_pss_mgf1( rsa: *mut RSA, digest: *const u8, digest_len: size_t, md: *const EVP_MD, mgf1_md: *const EVP_MD, salt_len: ::std::os::raw::c_int, sig: *const u8, sig_len: size_t, ) -> ::std::os::raw::c_int; } extern "C" { #[link_name = "__RUST_MUNDANE_0_5_0_RSA_size"] pub fn RSA_size(rsa: *const RSA) -> ::std::os::raw::c_uint; } extern "C" { #[link_name = "__RUST_MUNDANE_0_5_0_RSA_parse_private_key"] pub fn RSA_parse_private_key(cbs: *mut CBS) -> *mut RSA; } extern "C" { #[link_name = "__RUST_MUNDANE_0_5_0_RSA_marshal_private_key"] pub fn RSA_marshal_private_key(cbb: *mut CBB, rsa: *const RSA) -> ::std::os::raw::c_int; } #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct rsa_meth_st { pub common: openssl_method_common_st, pub app_data: *mut ::std::os::raw::c_void, pub init: ::std::option::Option ::std::os::raw::c_int>, pub finish: ::std::option::Option ::std::os::raw::c_int>, pub size: ::std::option::Option size_t>, pub sign: ::std::option::Option< unsafe extern "C" fn( type_: ::std::os::raw::c_int, m: *const u8, m_length: ::std::os::raw::c_uint, sigret: *mut u8, siglen: *mut ::std::os::raw::c_uint, rsa: *const RSA, ) -> ::std::os::raw::c_int, >, pub sign_raw: ::std::option::Option< unsafe extern "C" fn( rsa: *mut RSA, out_len: *mut size_t, out: *mut u8, max_out: size_t, in_: *const u8, in_len: size_t, padding: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int, >, pub decrypt: ::std::option::Option< unsafe extern "C" fn( rsa: *mut RSA, out_len: *mut size_t, out: *mut u8, max_out: size_t, in_: *const u8, in_len: size_t, padding: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int, >, pub private_transform: ::std::option::Option< unsafe extern "C" fn( rsa: *mut RSA, out: *mut u8, in_: *const u8, len: size_t, ) -> ::std::os::raw::c_int, >, pub flags: ::std::os::raw::c_int, } #[test] fn bindgen_test_layout_rsa_meth_st() { assert_eq!( ::std::mem::size_of::(), 80usize, concat!("Size of: ", stringify!(rsa_meth_st)) ); assert_eq!( ::std::mem::align_of::(), 8usize, concat!("Alignment of ", stringify!(rsa_meth_st)) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).common as *const _ as usize }, 0usize, concat!("Offset of field: ", stringify!(rsa_meth_st), "::", stringify!(common)) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).app_data as *const _ as usize }, 8usize, concat!("Offset of field: ", stringify!(rsa_meth_st), "::", stringify!(app_data)) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).init as *const _ as usize }, 16usize, concat!("Offset of field: ", stringify!(rsa_meth_st), "::", stringify!(init)) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).finish as *const _ as usize }, 24usize, concat!("Offset of field: ", stringify!(rsa_meth_st), "::", stringify!(finish)) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).size as *const _ as usize }, 32usize, concat!("Offset of field: ", stringify!(rsa_meth_st), "::", stringify!(size)) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).sign as *const _ as usize }, 40usize, concat!("Offset of field: ", stringify!(rsa_meth_st), "::", stringify!(sign)) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).sign_raw as *const _ as usize }, 48usize, concat!("Offset of field: ", stringify!(rsa_meth_st), "::", stringify!(sign_raw)) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).decrypt as *const _ as usize }, 56usize, concat!("Offset of field: ", stringify!(rsa_meth_st), "::", stringify!(decrypt)) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).private_transform as *const _ as usize }, 64usize, concat!("Offset of field: ", stringify!(rsa_meth_st), "::", stringify!(private_transform)) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).flags as *const _ as usize }, 72usize, concat!("Offset of field: ", stringify!(rsa_meth_st), "::", stringify!(flags)) ); } #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct bn_blinding_st { _unused: [u8; 0], } pub type BN_BLINDING = bn_blinding_st; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct rsa_st { pub meth: *mut RSA_METHOD, pub n: *mut BIGNUM, pub e: *mut BIGNUM, pub d: *mut BIGNUM, pub p: *mut BIGNUM, pub q: *mut BIGNUM, pub dmp1: *mut BIGNUM, pub dmq1: *mut BIGNUM, pub iqmp: *mut BIGNUM, pub ex_data: CRYPTO_EX_DATA, pub references: CRYPTO_refcount_t, pub flags: ::std::os::raw::c_int, pub lock: CRYPTO_MUTEX, pub mont_n: *mut BN_MONT_CTX, pub mont_p: *mut BN_MONT_CTX, pub mont_q: *mut BN_MONT_CTX, pub d_fixed: *mut BIGNUM, pub dmp1_fixed: *mut BIGNUM, pub dmq1_fixed: *mut BIGNUM, pub inv_small_mod_large_mont: *mut BIGNUM, pub num_blindings: ::std::os::raw::c_uint, pub blindings: *mut *mut BN_BLINDING, pub blindings_inuse: *mut ::std::os::raw::c_uchar, pub blinding_fork_generation: u64, pub _bitfield_align_1: [u8; 0], pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize]>, pub __bindgen_padding_0: [u8; 7usize], } #[test] fn bindgen_test_layout_rsa_st() { assert_eq!(::std::mem::size_of::(), 384usize, concat!("Size of: ", stringify!(rsa_st))); assert_eq!( ::std::mem::align_of::(), 8usize, concat!("Alignment of ", stringify!(rsa_st)) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).meth as *const _ as usize }, 0usize, concat!("Offset of field: ", stringify!(rsa_st), "::", stringify!(meth)) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).n as *const _ as usize }, 8usize, concat!("Offset of field: ", stringify!(rsa_st), "::", stringify!(n)) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).e as *const _ as usize }, 16usize, concat!("Offset of field: ", stringify!(rsa_st), "::", stringify!(e)) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).d as *const _ as usize }, 24usize, concat!("Offset of field: ", stringify!(rsa_st), "::", stringify!(d)) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).p as *const _ as usize }, 32usize, concat!("Offset of field: ", stringify!(rsa_st), "::", stringify!(p)) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).q as *const _ as usize }, 40usize, concat!("Offset of field: ", stringify!(rsa_st), "::", stringify!(q)) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).dmp1 as *const _ as usize }, 48usize, concat!("Offset of field: ", stringify!(rsa_st), "::", stringify!(dmp1)) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).dmq1 as *const _ as usize }, 56usize, concat!("Offset of field: ", stringify!(rsa_st), "::", stringify!(dmq1)) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).iqmp as *const _ as usize }, 64usize, concat!("Offset of field: ", stringify!(rsa_st), "::", stringify!(iqmp)) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).ex_data as *const _ as usize }, 72usize, concat!("Offset of field: ", stringify!(rsa_st), "::", stringify!(ex_data)) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).references as *const _ as usize }, 80usize, concat!("Offset of field: ", stringify!(rsa_st), "::", stringify!(references)) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).flags as *const _ as usize }, 84usize, concat!("Offset of field: ", stringify!(rsa_st), "::", stringify!(flags)) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).lock as *const _ as usize }, 88usize, concat!("Offset of field: ", stringify!(rsa_st), "::", stringify!(lock)) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).mont_n as *const _ as usize }, 288usize, concat!("Offset of field: ", stringify!(rsa_st), "::", stringify!(mont_n)) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).mont_p as *const _ as usize }, 296usize, concat!("Offset of field: ", stringify!(rsa_st), "::", stringify!(mont_p)) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).mont_q as *const _ as usize }, 304usize, concat!("Offset of field: ", stringify!(rsa_st), "::", stringify!(mont_q)) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).d_fixed as *const _ as usize }, 312usize, concat!("Offset of field: ", stringify!(rsa_st), "::", stringify!(d_fixed)) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).dmp1_fixed as *const _ as usize }, 320usize, concat!("Offset of field: ", stringify!(rsa_st), "::", stringify!(dmp1_fixed)) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).dmq1_fixed as *const _ as usize }, 328usize, concat!("Offset of field: ", stringify!(rsa_st), "::", stringify!(dmq1_fixed)) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).inv_small_mod_large_mont as *const _ as usize }, 336usize, concat!( "Offset of field: ", stringify!(rsa_st), "::", stringify!(inv_small_mod_large_mont) ) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).num_blindings as *const _ as usize }, 344usize, concat!("Offset of field: ", stringify!(rsa_st), "::", stringify!(num_blindings)) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).blindings as *const _ as usize }, 352usize, concat!("Offset of field: ", stringify!(rsa_st), "::", stringify!(blindings)) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).blindings_inuse as *const _ as usize }, 360usize, concat!("Offset of field: ", stringify!(rsa_st), "::", stringify!(blindings_inuse)) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).blinding_fork_generation as *const _ as usize }, 368usize, concat!( "Offset of field: ", stringify!(rsa_st), "::", stringify!(blinding_fork_generation) ) ); } impl rsa_st { #[inline] pub fn private_key_frozen(&self) -> ::std::os::raw::c_uint { unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u32) } } #[inline] pub fn set_private_key_frozen(&mut self, val: ::std::os::raw::c_uint) { unsafe { let val: u32 = ::std::mem::transmute(val); self._bitfield_1.set(0usize, 1u8, val as u64) } } #[inline] pub fn new_bitfield_1( private_key_frozen: ::std::os::raw::c_uint, ) -> __BindgenBitfieldUnit<[u8; 1usize]> { let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize]> = Default::default(); __bindgen_bitfield_unit.set(0usize, 1u8, { let private_key_frozen: u32 = unsafe { ::std::mem::transmute(private_key_frozen) }; private_key_frozen as u64 }); __bindgen_bitfield_unit } } extern "C" { #[link_name = "__RUST_MUNDANE_0_5_0_SHA1_Init"] pub fn SHA1_Init(sha: *mut SHA_CTX) -> ::std::os::raw::c_int; } extern "C" { #[link_name = "__RUST_MUNDANE_0_5_0_SHA1_Update"] pub fn SHA1_Update( sha: *mut SHA_CTX, data: *const ::std::os::raw::c_void, len: size_t, ) -> ::std::os::raw::c_int; } extern "C" { #[link_name = "__RUST_MUNDANE_0_5_0_SHA1_Final"] pub fn SHA1_Final(out: *mut u8, sha: *mut SHA_CTX) -> ::std::os::raw::c_int; } #[repr(C)] #[derive(Copy, Clone)] pub struct sha_state_st { pub __bindgen_anon_1: sha_state_st__bindgen_ty_1, pub Nl: u32, pub Nh: u32, pub data: [u8; 64usize], pub num: ::std::os::raw::c_uint, } #[repr(C)] #[derive(Copy, Clone)] pub union sha_state_st__bindgen_ty_1 { pub h: [u32; 5usize], pub __bindgen_anon_1: sha_state_st__bindgen_ty_1__bindgen_ty_1, } #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct sha_state_st__bindgen_ty_1__bindgen_ty_1 { pub h0: u32, pub h1: u32, pub h2: u32, pub h3: u32, pub h4: u32, } #[test] fn bindgen_test_layout_sha_state_st__bindgen_ty_1__bindgen_ty_1() { assert_eq!( ::std::mem::size_of::(), 20usize, concat!("Size of: ", stringify!(sha_state_st__bindgen_ty_1__bindgen_ty_1)) ); assert_eq!( ::std::mem::align_of::(), 4usize, concat!("Alignment of ", stringify!(sha_state_st__bindgen_ty_1__bindgen_ty_1)) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).h0 as *const _ as usize }, 0usize, concat!( "Offset of field: ", stringify!(sha_state_st__bindgen_ty_1__bindgen_ty_1), "::", stringify!(h0) ) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).h1 as *const _ as usize }, 4usize, concat!( "Offset of field: ", stringify!(sha_state_st__bindgen_ty_1__bindgen_ty_1), "::", stringify!(h1) ) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).h2 as *const _ as usize }, 8usize, concat!( "Offset of field: ", stringify!(sha_state_st__bindgen_ty_1__bindgen_ty_1), "::", stringify!(h2) ) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).h3 as *const _ as usize }, 12usize, concat!( "Offset of field: ", stringify!(sha_state_st__bindgen_ty_1__bindgen_ty_1), "::", stringify!(h3) ) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).h4 as *const _ as usize }, 16usize, concat!( "Offset of field: ", stringify!(sha_state_st__bindgen_ty_1__bindgen_ty_1), "::", stringify!(h4) ) ); } #[test] fn bindgen_test_layout_sha_state_st__bindgen_ty_1() { assert_eq!( ::std::mem::size_of::(), 20usize, concat!("Size of: ", stringify!(sha_state_st__bindgen_ty_1)) ); assert_eq!( ::std::mem::align_of::(), 4usize, concat!("Alignment of ", stringify!(sha_state_st__bindgen_ty_1)) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).h as *const _ as usize }, 0usize, concat!("Offset of field: ", stringify!(sha_state_st__bindgen_ty_1), "::", stringify!(h)) ); } #[test] fn bindgen_test_layout_sha_state_st() { assert_eq!( ::std::mem::size_of::(), 96usize, concat!("Size of: ", stringify!(sha_state_st)) ); assert_eq!( ::std::mem::align_of::(), 4usize, concat!("Alignment of ", stringify!(sha_state_st)) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).Nl as *const _ as usize }, 20usize, concat!("Offset of field: ", stringify!(sha_state_st), "::", stringify!(Nl)) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).Nh as *const _ as usize }, 24usize, concat!("Offset of field: ", stringify!(sha_state_st), "::", stringify!(Nh)) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).data as *const _ as usize }, 28usize, concat!("Offset of field: ", stringify!(sha_state_st), "::", stringify!(data)) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).num as *const _ as usize }, 92usize, concat!("Offset of field: ", stringify!(sha_state_st), "::", stringify!(num)) ); } extern "C" { #[link_name = "__RUST_MUNDANE_0_5_0_SHA256_Init"] pub fn SHA256_Init(sha: *mut SHA256_CTX) -> ::std::os::raw::c_int; } extern "C" { #[link_name = "__RUST_MUNDANE_0_5_0_SHA256_Update"] pub fn SHA256_Update( sha: *mut SHA256_CTX, data: *const ::std::os::raw::c_void, len: size_t, ) -> ::std::os::raw::c_int; } extern "C" { #[link_name = "__RUST_MUNDANE_0_5_0_SHA256_Final"] pub fn SHA256_Final(out: *mut u8, sha: *mut SHA256_CTX) -> ::std::os::raw::c_int; } #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct sha256_state_st { pub h: [u32; 8usize], pub Nl: u32, pub Nh: u32, pub data: [u8; 64usize], pub num: ::std::os::raw::c_uint, pub md_len: ::std::os::raw::c_uint, } #[test] fn bindgen_test_layout_sha256_state_st() { assert_eq!( ::std::mem::size_of::(), 112usize, concat!("Size of: ", stringify!(sha256_state_st)) ); assert_eq!( ::std::mem::align_of::(), 4usize, concat!("Alignment of ", stringify!(sha256_state_st)) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).h as *const _ as usize }, 0usize, concat!("Offset of field: ", stringify!(sha256_state_st), "::", stringify!(h)) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).Nl as *const _ as usize }, 32usize, concat!("Offset of field: ", stringify!(sha256_state_st), "::", stringify!(Nl)) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).Nh as *const _ as usize }, 36usize, concat!("Offset of field: ", stringify!(sha256_state_st), "::", stringify!(Nh)) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).data as *const _ as usize }, 40usize, concat!("Offset of field: ", stringify!(sha256_state_st), "::", stringify!(data)) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).num as *const _ as usize }, 104usize, concat!("Offset of field: ", stringify!(sha256_state_st), "::", stringify!(num)) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).md_len as *const _ as usize }, 108usize, concat!("Offset of field: ", stringify!(sha256_state_st), "::", stringify!(md_len)) ); } extern "C" { #[link_name = "__RUST_MUNDANE_0_5_0_SHA384_Init"] pub fn SHA384_Init(sha: *mut SHA512_CTX) -> ::std::os::raw::c_int; } extern "C" { #[link_name = "__RUST_MUNDANE_0_5_0_SHA384_Update"] pub fn SHA384_Update( sha: *mut SHA512_CTX, data: *const ::std::os::raw::c_void, len: size_t, ) -> ::std::os::raw::c_int; } extern "C" { #[link_name = "__RUST_MUNDANE_0_5_0_SHA384_Final"] pub fn SHA384_Final(out: *mut u8, sha: *mut SHA512_CTX) -> ::std::os::raw::c_int; } extern "C" { #[link_name = "__RUST_MUNDANE_0_5_0_SHA512_Init"] pub fn SHA512_Init(sha: *mut SHA512_CTX) -> ::std::os::raw::c_int; } extern "C" { #[link_name = "__RUST_MUNDANE_0_5_0_SHA512_Update"] pub fn SHA512_Update( sha: *mut SHA512_CTX, data: *const ::std::os::raw::c_void, len: size_t, ) -> ::std::os::raw::c_int; } extern "C" { #[link_name = "__RUST_MUNDANE_0_5_0_SHA512_Final"] pub fn SHA512_Final(out: *mut u8, sha: *mut SHA512_CTX) -> ::std::os::raw::c_int; } #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct sha512_state_st { pub h: [u64; 8usize], pub Nl: u64, pub Nh: u64, pub p: [u8; 128usize], pub num: ::std::os::raw::c_uint, pub md_len: ::std::os::raw::c_uint, } #[test] fn bindgen_test_layout_sha512_state_st() { assert_eq!( ::std::mem::size_of::(), 216usize, concat!("Size of: ", stringify!(sha512_state_st)) ); assert_eq!( ::std::mem::align_of::(), 8usize, concat!("Alignment of ", stringify!(sha512_state_st)) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).h as *const _ as usize }, 0usize, concat!("Offset of field: ", stringify!(sha512_state_st), "::", stringify!(h)) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).Nl as *const _ as usize }, 64usize, concat!("Offset of field: ", stringify!(sha512_state_st), "::", stringify!(Nl)) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).Nh as *const _ as usize }, 72usize, concat!("Offset of field: ", stringify!(sha512_state_st), "::", stringify!(Nh)) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).p as *const _ as usize }, 80usize, concat!("Offset of field: ", stringify!(sha512_state_st), "::", stringify!(p)) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).num as *const _ as usize }, 208usize, concat!("Offset of field: ", stringify!(sha512_state_st), "::", stringify!(num)) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).md_len as *const _ as usize }, 212usize, concat!("Offset of field: ", stringify!(sha512_state_st), "::", stringify!(md_len)) ); }