blob: 30f904fe4ebafd5a53fac7e4f7008db92583678c [file] [log] [blame]
// 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)]
#![allow(non_camel_case_types)]
#![allow(non_snake_case)]
#![allow(non_upper_case_globals)]
#[link(name = "crypto_0_4_0")]
extern "C" {}
/* automatically generated by rust-bindgen */
#[repr(C)]
#[derive(Copy, Clone, Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct __BindgenBitfieldUnit<Storage, Align> {
storage: Storage,
align: [Align; 0],
}
impl<Storage, Align> __BindgenBitfieldUnit<Storage, Align> {
#[inline]
pub const fn new(storage: Storage) -> Self {
Self { storage, align: [] }
}
}
impl<Storage, Align> __BindgenBitfieldUnit<Storage, Align>
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_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 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 __uint8_t = ::std::os::raw::c_uchar;
pub type __uint32_t = ::std::os::raw::c_uint;
pub type __uint64_t = ::std::os::raw::c_ulong;
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 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;
#[repr(C)]
#[derive(Copy, Clone)]
pub union crypto_mutex_st {
pub alignment: f64,
pub padding: [u8; 56usize],
_bindgen_union_align: [u64; 7usize],
}
#[test]
fn bindgen_test_layout_crypto_mutex_st() {
assert_eq!(
::std::mem::size_of::<crypto_mutex_st>(),
56usize,
concat!("Size of: ", stringify!(crypto_mutex_st))
);
assert_eq!(
::std::mem::align_of::<crypto_mutex_st>(),
8usize,
concat!("Alignment of ", stringify!(crypto_mutex_st))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<crypto_mutex_st>())).alignment as *const _ as usize },
0usize,
concat!("Offset of field: ", stringify!(crypto_mutex_st), "::", stringify!(alignment))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<crypto_mutex_st>())).padding as *const _ as usize },
0usize,
concat!("Offset of field: ", stringify!(crypto_mutex_st), "::", stringify!(padding))
);
}
pub type CRYPTO_MUTEX = crypto_mutex_st;
pub type CRYPTO_refcount_t = u32;
extern "C" {
#[link_name = "__RUST_MUNDANE_0_4_0_BN_init"]
pub fn BN_init(bn: *mut BIGNUM);
}
extern "C" {
#[link_name = "__RUST_MUNDANE_0_4_0_BN_free"]
pub fn BN_free(bn: *mut BIGNUM);
}
extern "C" {
#[link_name = "__RUST_MUNDANE_0_4_0_BN_set_u64"]
pub fn BN_set_u64(bn: *mut BIGNUM, value: u64) -> ::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::<bn_gencb_st>(),
16usize,
concat!("Size of: ", stringify!(bn_gencb_st))
);
assert_eq!(
::std::mem::align_of::<bn_gencb_st>(),
8usize,
concat!("Alignment of ", stringify!(bn_gencb_st))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<bn_gencb_st>())).arg as *const _ as usize },
0usize,
concat!("Offset of field: ", stringify!(bn_gencb_st), "::", stringify!(arg))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<bn_gencb_st>())).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::<bignum_st>(),
24usize,
concat!("Size of: ", stringify!(bignum_st))
);
assert_eq!(
::std::mem::align_of::<bignum_st>(),
8usize,
concat!("Alignment of ", stringify!(bignum_st))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<bignum_st>())).d as *const _ as usize },
0usize,
concat!("Offset of field: ", stringify!(bignum_st), "::", stringify!(d))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<bignum_st>())).width as *const _ as usize },
8usize,
concat!("Offset of field: ", stringify!(bignum_st), "::", stringify!(width))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<bignum_st>())).dmax as *const _ as usize },
12usize,
concat!("Offset of field: ", stringify!(bignum_st), "::", stringify!(dmax))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<bignum_st>())).neg as *const _ as usize },
16usize,
concat!("Offset of field: ", stringify!(bignum_st), "::", stringify!(neg))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<bignum_st>())).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::<bn_mont_ctx_st>(),
64usize,
concat!("Size of: ", stringify!(bn_mont_ctx_st))
);
assert_eq!(
::std::mem::align_of::<bn_mont_ctx_st>(),
8usize,
concat!("Alignment of ", stringify!(bn_mont_ctx_st))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<bn_mont_ctx_st>())).RR as *const _ as usize },
0usize,
concat!("Offset of field: ", stringify!(bn_mont_ctx_st), "::", stringify!(RR))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<bn_mont_ctx_st>())).N as *const _ as usize },
24usize,
concat!("Offset of field: ", stringify!(bn_mont_ctx_st), "::", stringify!(N))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<bn_mont_ctx_st>())).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: usize,
}
#[test]
fn bindgen_test_layout_cbs_st() {
assert_eq!(::std::mem::size_of::<cbs_st>(), 16usize, concat!("Size of: ", stringify!(cbs_st)));
assert_eq!(
::std::mem::align_of::<cbs_st>(),
8usize,
concat!("Alignment of ", stringify!(cbs_st))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<cbs_st>())).data as *const _ as usize },
0usize,
concat!("Offset of field: ", stringify!(cbs_st), "::", stringify!(data))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<cbs_st>())).len as *const _ as usize },
8usize,
concat!("Offset of field: ", stringify!(cbs_st), "::", stringify!(len))
);
}
extern "C" {
#[link_name = "__RUST_MUNDANE_0_4_0_CBS_init"]
pub fn CBS_init(cbs: *mut CBS, data: *const u8, len: usize);
}
extern "C" {
#[link_name = "__RUST_MUNDANE_0_4_0_CBS_len"]
pub fn CBS_len(cbs: *const CBS) -> usize;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct cbb_buffer_st {
pub buf: *mut u8,
pub len: usize,
pub cap: usize,
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::<cbb_buffer_st>(),
32usize,
concat!("Size of: ", stringify!(cbb_buffer_st))
);
assert_eq!(
::std::mem::align_of::<cbb_buffer_st>(),
8usize,
concat!("Alignment of ", stringify!(cbb_buffer_st))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<cbb_buffer_st>())).buf as *const _ as usize },
0usize,
concat!("Offset of field: ", stringify!(cbb_buffer_st), "::", stringify!(buf))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<cbb_buffer_st>())).len as *const _ as usize },
8usize,
concat!("Offset of field: ", stringify!(cbb_buffer_st), "::", stringify!(len))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<cbb_buffer_st>())).cap as *const _ as usize },
16usize,
concat!("Offset of field: ", stringify!(cbb_buffer_st), "::", stringify!(cap))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<cbb_buffer_st>())).can_resize as *const _ as usize },
24usize,
concat!("Offset of field: ", stringify!(cbb_buffer_st), "::", stringify!(can_resize))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<cbb_buffer_st>())).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: usize,
pub pending_len_len: u8,
pub pending_is_asn1: ::std::os::raw::c_char,
pub is_top_level: ::std::os::raw::c_char,
}
#[test]
fn bindgen_test_layout_cbb_st() {
assert_eq!(::std::mem::size_of::<cbb_st>(), 32usize, concat!("Size of: ", stringify!(cbb_st)));
assert_eq!(
::std::mem::align_of::<cbb_st>(),
8usize,
concat!("Alignment of ", stringify!(cbb_st))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<cbb_st>())).base as *const _ as usize },
0usize,
concat!("Offset of field: ", stringify!(cbb_st), "::", stringify!(base))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<cbb_st>())).child as *const _ as usize },
8usize,
concat!("Offset of field: ", stringify!(cbb_st), "::", stringify!(child))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<cbb_st>())).offset as *const _ as usize },
16usize,
concat!("Offset of field: ", stringify!(cbb_st), "::", stringify!(offset))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<cbb_st>())).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::<cbb_st>())).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::<cbb_st>())).is_top_level as *const _ as usize },
26usize,
concat!("Offset of field: ", stringify!(cbb_st), "::", stringify!(is_top_level))
);
}
extern "C" {
#[link_name = "__RUST_MUNDANE_0_4_0_CBB_init"]
pub fn CBB_init(cbb: *mut CBB, initial_capacity: usize) -> ::std::os::raw::c_int;
}
extern "C" {
#[link_name = "__RUST_MUNDANE_0_4_0_CBB_cleanup"]
pub fn CBB_cleanup(cbb: *mut CBB);
}
extern "C" {
#[link_name = "__RUST_MUNDANE_0_4_0_CBB_data"]
pub fn CBB_data(cbb: *const CBB) -> *const u8;
}
extern "C" {
#[link_name = "__RUST_MUNDANE_0_4_0_CBB_len"]
pub fn CBB_len(cbb: *const CBB) -> usize;
}
extern "C" {
#[link_name = "__RUST_MUNDANE_0_4_0_ED25519_keypair"]
pub fn ED25519_keypair(out_public_key: *mut u8, out_private_key: *mut u8);
}
extern "C" {
#[link_name = "__RUST_MUNDANE_0_4_0_ED25519_sign"]
pub fn ED25519_sign(
out_sig: *mut u8,
message: *const u8,
message_len: usize,
private_key: *const u8,
) -> ::std::os::raw::c_int;
}
extern "C" {
#[link_name = "__RUST_MUNDANE_0_4_0_ED25519_verify"]
pub fn ED25519_verify(
message: *const u8,
message_len: usize,
signature: *const u8,
public_key: *const u8,
) -> ::std::os::raw::c_int;
}
extern "C" {
#[link_name = "__RUST_MUNDANE_0_4_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_4_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_4_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_4_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::<openssl_method_common_st>(),
8usize,
concat!("Size of: ", stringify!(openssl_method_common_st))
);
assert_eq!(
::std::mem::align_of::<openssl_method_common_st>(),
4usize,
concat!("Alignment of ", stringify!(openssl_method_common_st))
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<openssl_method_common_st>())).references as *const _ as usize
},
0usize,
concat!(
"Offset of field: ",
stringify!(openssl_method_common_st),
"::",
stringify!(references)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<openssl_method_common_st>())).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::<crypto_ex_data_st>(),
8usize,
concat!("Size of: ", stringify!(crypto_ex_data_st))
);
assert_eq!(
::std::mem::align_of::<crypto_ex_data_st>(),
8usize,
concat!("Alignment of ", stringify!(crypto_ex_data_st))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<crypto_ex_data_st>())).sk as *const _ as usize },
0usize,
concat!("Offset of field: ", stringify!(crypto_ex_data_st), "::", stringify!(sk))
);
}
extern "C" {
#[link_name = "__RUST_MUNDANE_0_4_0_EC_KEY_new"]
pub fn EC_KEY_new() -> *mut EC_KEY;
}
extern "C" {
#[link_name = "__RUST_MUNDANE_0_4_0_EC_KEY_free"]
pub fn EC_KEY_free(key: *mut EC_KEY);
}
extern "C" {
#[link_name = "__RUST_MUNDANE_0_4_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_4_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_4_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_4_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_4_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_4_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_4_0_ECDSA_sign"]
pub fn ECDSA_sign(
type_: ::std::os::raw::c_int,
digest: *const u8,
digest_len: usize,
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_4_0_ECDSA_verify"]
pub fn ECDSA_verify(
type_: ::std::os::raw::c_int,
digest: *const u8,
digest_len: usize,
sig: *const u8,
sig_len: usize,
key: *const EC_KEY,
) -> ::std::os::raw::c_int;
}
extern "C" {
#[link_name = "__RUST_MUNDANE_0_4_0_ECDSA_size"]
pub fn ECDSA_size(key: *const EC_KEY) -> usize;
}
pub type ERR_print_errors_callback_t = ::std::option::Option<
unsafe extern "C" fn(
str: *const ::std::os::raw::c_char,
len: usize,
ctx: *mut ::std::os::raw::c_void,
) -> ::std::os::raw::c_int,
>;
extern "C" {
#[link_name = "__RUST_MUNDANE_0_4_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_4_0_EVP_sha1"]
pub fn EVP_sha1() -> *const EVP_MD;
}
extern "C" {
#[link_name = "__RUST_MUNDANE_0_4_0_EVP_sha256"]
pub fn EVP_sha256() -> *const EVP_MD;
}
extern "C" {
#[link_name = "__RUST_MUNDANE_0_4_0_EVP_sha384"]
pub fn EVP_sha384() -> *const EVP_MD;
}
extern "C" {
#[link_name = "__RUST_MUNDANE_0_4_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::<env_md_ctx_st>(),
32usize,
concat!("Size of: ", stringify!(env_md_ctx_st))
);
assert_eq!(
::std::mem::align_of::<env_md_ctx_st>(),
8usize,
concat!("Alignment of ", stringify!(env_md_ctx_st))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<env_md_ctx_st>())).digest as *const _ as usize },
0usize,
concat!("Offset of field: ", stringify!(env_md_ctx_st), "::", stringify!(digest))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<env_md_ctx_st>())).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::<env_md_ctx_st>())).pctx as *const _ as usize },
16usize,
concat!("Offset of field: ", stringify!(env_md_ctx_st), "::", stringify!(pctx))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<env_md_ctx_st>())).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_4_0_EVP_PKEY_new"]
pub fn EVP_PKEY_new() -> *mut EVP_PKEY;
}
extern "C" {
#[link_name = "__RUST_MUNDANE_0_4_0_EVP_PKEY_free"]
pub fn EVP_PKEY_free(pkey: *mut EVP_PKEY);
}
extern "C" {
#[link_name = "__RUST_MUNDANE_0_4_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_4_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_4_0_EVP_PKEY_get1_RSA"]
pub fn EVP_PKEY_get1_RSA(pkey: *const EVP_PKEY) -> *mut RSA;
}
extern "C" {
#[link_name = "__RUST_MUNDANE_0_4_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_4_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_4_0_EVP_parse_public_key"]
pub fn EVP_parse_public_key(cbs: *mut CBS) -> *mut EVP_PKEY;
}
extern "C" {
#[link_name = "__RUST_MUNDANE_0_4_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_4_0_PKCS5_PBKDF2_HMAC"]
pub fn PKCS5_PBKDF2_HMAC(
password: *const ::std::os::raw::c_char,
password_len: usize,
salt: *const u8,
salt_len: usize,
iterations: ::std::os::raw::c_uint,
digest: *const EVP_MD,
key_len: usize,
out_key: *mut u8,
) -> ::std::os::raw::c_int;
}
extern "C" {
#[link_name = "__RUST_MUNDANE_0_4_0_EVP_PBE_scrypt"]
pub fn EVP_PBE_scrypt(
password: *const ::std::os::raw::c_char,
password_len: usize,
salt: *const u8,
salt_len: usize,
N: u64,
r: u64,
p: u64,
max_mem: usize,
out_key: *mut u8,
key_len: usize,
) -> ::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,
_bindgen_union_align: u64,
}
#[test]
fn bindgen_test_layout_evp_pkey_st__bindgen_ty_1() {
assert_eq!(
::std::mem::size_of::<evp_pkey_st__bindgen_ty_1>(),
8usize,
concat!("Size of: ", stringify!(evp_pkey_st__bindgen_ty_1))
);
assert_eq!(
::std::mem::align_of::<evp_pkey_st__bindgen_ty_1>(),
8usize,
concat!("Alignment of ", stringify!(evp_pkey_st__bindgen_ty_1))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<evp_pkey_st__bindgen_ty_1>())).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::<evp_pkey_st__bindgen_ty_1>())).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::<evp_pkey_st__bindgen_ty_1>())).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::<evp_pkey_st__bindgen_ty_1>())).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::<evp_pkey_st__bindgen_ty_1>())).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::<evp_pkey_st>(),
24usize,
concat!("Size of: ", stringify!(evp_pkey_st))
);
assert_eq!(
::std::mem::align_of::<evp_pkey_st>(),
8usize,
concat!("Alignment of ", stringify!(evp_pkey_st))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<evp_pkey_st>())).references as *const _ as usize },
0usize,
concat!("Offset of field: ", stringify!(evp_pkey_st), "::", stringify!(references))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<evp_pkey_st>())).type_ as *const _ as usize },
4usize,
concat!("Offset of field: ", stringify!(evp_pkey_st), "::", stringify!(type_))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<evp_pkey_st>())).pkey as *const _ as usize },
8usize,
concat!("Offset of field: ", stringify!(evp_pkey_st), "::", stringify!(pkey))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<evp_pkey_st>())).ameth as *const _ as usize },
16usize,
concat!("Offset of field: ", stringify!(evp_pkey_st), "::", stringify!(ameth))
);
}
extern "C" {
#[link_name = "__RUST_MUNDANE_0_4_0_HMAC_CTX_init"]
pub fn HMAC_CTX_init(ctx: *mut HMAC_CTX);
}
extern "C" {
#[link_name = "__RUST_MUNDANE_0_4_0_HMAC_CTX_cleanup"]
pub fn HMAC_CTX_cleanup(ctx: *mut HMAC_CTX);
}
extern "C" {
#[link_name = "__RUST_MUNDANE_0_4_0_HMAC_Init_ex"]
pub fn HMAC_Init_ex(
ctx: *mut HMAC_CTX,
key: *const ::std::os::raw::c_void,
key_len: usize,
md: *const EVP_MD,
impl_: *mut ENGINE,
) -> ::std::os::raw::c_int;
}
extern "C" {
#[link_name = "__RUST_MUNDANE_0_4_0_HMAC_Update"]
pub fn HMAC_Update(
ctx: *mut HMAC_CTX,
data: *const u8,
data_len: usize,
) -> ::std::os::raw::c_int;
}
extern "C" {
#[link_name = "__RUST_MUNDANE_0_4_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_4_0_HMAC_size"]
pub fn HMAC_size(ctx: *const HMAC_CTX) -> usize;
}
extern "C" {
#[link_name = "__RUST_MUNDANE_0_4_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::<hmac_ctx_st>(),
104usize,
concat!("Size of: ", stringify!(hmac_ctx_st))
);
assert_eq!(
::std::mem::align_of::<hmac_ctx_st>(),
8usize,
concat!("Alignment of ", stringify!(hmac_ctx_st))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<hmac_ctx_st>())).md as *const _ as usize },
0usize,
concat!("Offset of field: ", stringify!(hmac_ctx_st), "::", stringify!(md))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<hmac_ctx_st>())).md_ctx as *const _ as usize },
8usize,
concat!("Offset of field: ", stringify!(hmac_ctx_st), "::", stringify!(md_ctx))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<hmac_ctx_st>())).i_ctx as *const _ as usize },
40usize,
concat!("Offset of field: ", stringify!(hmac_ctx_st), "::", stringify!(i_ctx))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<hmac_ctx_st>())).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_4_0_CRYPTO_memcmp"]
pub fn CRYPTO_memcmp(
a: *const ::std::os::raw::c_void,
b: *const ::std::os::raw::c_void,
len: usize,
) -> ::std::os::raw::c_int;
}
extern "C" {
#[link_name = "__RUST_MUNDANE_0_4_0_RAND_bytes"]
pub fn RAND_bytes(buf: *mut u8, len: usize) -> ::std::os::raw::c_int;
}
extern "C" {
#[link_name = "__RUST_MUNDANE_0_4_0_RSA_new"]
pub fn RSA_new() -> *mut RSA;
}
extern "C" {
#[link_name = "__RUST_MUNDANE_0_4_0_RSA_free"]
pub fn RSA_free(rsa: *mut RSA);
}
extern "C" {
#[link_name = "__RUST_MUNDANE_0_4_0_RSA_up_ref"]
pub fn RSA_up_ref(rsa: *mut RSA) -> ::std::os::raw::c_int;
}
extern "C" {
#[link_name = "__RUST_MUNDANE_0_4_0_RSA_bits"]
pub fn RSA_bits(rsa: *const RSA) -> ::std::os::raw::c_uint;
}
extern "C" {
#[link_name = "__RUST_MUNDANE_0_4_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_4_0_RSA_sign"]
pub fn RSA_sign(
hash_nid: ::std::os::raw::c_int,
in_: *const u8,
in_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_4_0_RSA_sign_pss_mgf1"]
pub fn RSA_sign_pss_mgf1(
rsa: *mut RSA,
out_len: *mut usize,
out: *mut u8,
max_out: usize,
in_: *const u8,
in_len: usize,
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_4_0_RSA_verify"]
pub fn RSA_verify(
hash_nid: ::std::os::raw::c_int,
msg: *const u8,
msg_len: usize,
sig: *const u8,
sig_len: usize,
rsa: *mut RSA,
) -> ::std::os::raw::c_int;
}
extern "C" {
#[link_name = "__RUST_MUNDANE_0_4_0_RSA_verify_pss_mgf1"]
pub fn RSA_verify_pss_mgf1(
rsa: *mut RSA,
msg: *const u8,
msg_len: usize,
md: *const EVP_MD,
mgf1_md: *const EVP_MD,
salt_len: ::std::os::raw::c_int,
sig: *const u8,
sig_len: usize,
) -> ::std::os::raw::c_int;
}
extern "C" {
#[link_name = "__RUST_MUNDANE_0_4_0_RSA_size"]
pub fn RSA_size(rsa: *const RSA) -> ::std::os::raw::c_uint;
}
extern "C" {
#[link_name = "__RUST_MUNDANE_0_4_0_RSA_parse_private_key"]
pub fn RSA_parse_private_key(cbs: *mut CBS) -> *mut RSA;
}
extern "C" {
#[link_name = "__RUST_MUNDANE_0_4_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<unsafe extern "C" fn(rsa: *mut RSA) -> ::std::os::raw::c_int>,
pub finish: ::std::option::Option<unsafe extern "C" fn(rsa: *mut RSA) -> ::std::os::raw::c_int>,
pub size: ::std::option::Option<unsafe extern "C" fn(rsa: *const RSA) -> usize>,
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 usize,
out: *mut u8,
max_out: usize,
in_: *const u8,
in_len: usize,
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 usize,
out: *mut u8,
max_out: usize,
in_: *const u8,
in_len: usize,
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: usize,
) -> ::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::<rsa_meth_st>(),
80usize,
concat!("Size of: ", stringify!(rsa_meth_st))
);
assert_eq!(
::std::mem::align_of::<rsa_meth_st>(),
8usize,
concat!("Alignment of ", stringify!(rsa_meth_st))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<rsa_meth_st>())).common as *const _ as usize },
0usize,
concat!("Offset of field: ", stringify!(rsa_meth_st), "::", stringify!(common))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<rsa_meth_st>())).app_data as *const _ as usize },
8usize,
concat!("Offset of field: ", stringify!(rsa_meth_st), "::", stringify!(app_data))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<rsa_meth_st>())).init as *const _ as usize },
16usize,
concat!("Offset of field: ", stringify!(rsa_meth_st), "::", stringify!(init))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<rsa_meth_st>())).finish as *const _ as usize },
24usize,
concat!("Offset of field: ", stringify!(rsa_meth_st), "::", stringify!(finish))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<rsa_meth_st>())).size as *const _ as usize },
32usize,
concat!("Offset of field: ", stringify!(rsa_meth_st), "::", stringify!(size))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<rsa_meth_st>())).sign as *const _ as usize },
40usize,
concat!("Offset of field: ", stringify!(rsa_meth_st), "::", stringify!(sign))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<rsa_meth_st>())).sign_raw as *const _ as usize },
48usize,
concat!("Offset of field: ", stringify!(rsa_meth_st), "::", stringify!(sign_raw))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<rsa_meth_st>())).decrypt as *const _ as usize },
56usize,
concat!("Offset of field: ", stringify!(rsa_meth_st), "::", stringify!(decrypt))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<rsa_meth_st>())).private_transform as *const _ as usize },
64usize,
concat!("Offset of field: ", stringify!(rsa_meth_st), "::", stringify!(private_transform))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<rsa_meth_st>())).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(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 _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize], u8>,
pub __bindgen_padding_0: [u8; 7usize],
}
#[test]
fn bindgen_test_layout_rsa_st() {
assert_eq!(::std::mem::size_of::<rsa_st>(), 232usize, concat!("Size of: ", stringify!(rsa_st)));
assert_eq!(
::std::mem::align_of::<rsa_st>(),
8usize,
concat!("Alignment of ", stringify!(rsa_st))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<rsa_st>())).meth as *const _ as usize },
0usize,
concat!("Offset of field: ", stringify!(rsa_st), "::", stringify!(meth))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<rsa_st>())).n as *const _ as usize },
8usize,
concat!("Offset of field: ", stringify!(rsa_st), "::", stringify!(n))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<rsa_st>())).e as *const _ as usize },
16usize,
concat!("Offset of field: ", stringify!(rsa_st), "::", stringify!(e))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<rsa_st>())).d as *const _ as usize },
24usize,
concat!("Offset of field: ", stringify!(rsa_st), "::", stringify!(d))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<rsa_st>())).p as *const _ as usize },
32usize,
concat!("Offset of field: ", stringify!(rsa_st), "::", stringify!(p))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<rsa_st>())).q as *const _ as usize },
40usize,
concat!("Offset of field: ", stringify!(rsa_st), "::", stringify!(q))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<rsa_st>())).dmp1 as *const _ as usize },
48usize,
concat!("Offset of field: ", stringify!(rsa_st), "::", stringify!(dmp1))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<rsa_st>())).dmq1 as *const _ as usize },
56usize,
concat!("Offset of field: ", stringify!(rsa_st), "::", stringify!(dmq1))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<rsa_st>())).iqmp as *const _ as usize },
64usize,
concat!("Offset of field: ", stringify!(rsa_st), "::", stringify!(iqmp))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<rsa_st>())).ex_data as *const _ as usize },
72usize,
concat!("Offset of field: ", stringify!(rsa_st), "::", stringify!(ex_data))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<rsa_st>())).references as *const _ as usize },
80usize,
concat!("Offset of field: ", stringify!(rsa_st), "::", stringify!(references))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<rsa_st>())).flags as *const _ as usize },
84usize,
concat!("Offset of field: ", stringify!(rsa_st), "::", stringify!(flags))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<rsa_st>())).lock as *const _ as usize },
88usize,
concat!("Offset of field: ", stringify!(rsa_st), "::", stringify!(lock))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<rsa_st>())).mont_n as *const _ as usize },
144usize,
concat!("Offset of field: ", stringify!(rsa_st), "::", stringify!(mont_n))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<rsa_st>())).mont_p as *const _ as usize },
152usize,
concat!("Offset of field: ", stringify!(rsa_st), "::", stringify!(mont_p))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<rsa_st>())).mont_q as *const _ as usize },
160usize,
concat!("Offset of field: ", stringify!(rsa_st), "::", stringify!(mont_q))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<rsa_st>())).d_fixed as *const _ as usize },
168usize,
concat!("Offset of field: ", stringify!(rsa_st), "::", stringify!(d_fixed))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<rsa_st>())).dmp1_fixed as *const _ as usize },
176usize,
concat!("Offset of field: ", stringify!(rsa_st), "::", stringify!(dmp1_fixed))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<rsa_st>())).dmq1_fixed as *const _ as usize },
184usize,
concat!("Offset of field: ", stringify!(rsa_st), "::", stringify!(dmq1_fixed))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<rsa_st>())).inv_small_mod_large_mont as *const _ as usize },
192usize,
concat!(
"Offset of field: ",
stringify!(rsa_st),
"::",
stringify!(inv_small_mod_large_mont)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<rsa_st>())).num_blindings as *const _ as usize },
200usize,
concat!("Offset of field: ", stringify!(rsa_st), "::", stringify!(num_blindings))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<rsa_st>())).blindings as *const _ as usize },
208usize,
concat!("Offset of field: ", stringify!(rsa_st), "::", stringify!(blindings))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<rsa_st>())).blindings_inuse as *const _ as usize },
216usize,
concat!("Offset of field: ", stringify!(rsa_st), "::", stringify!(blindings_inuse))
);
}
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], u8> {
let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize], u8> =
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_4_0_SHA1_Init"]
pub fn SHA1_Init(sha: *mut SHA_CTX) -> ::std::os::raw::c_int;
}
extern "C" {
#[link_name = "__RUST_MUNDANE_0_4_0_SHA1_Update"]
pub fn SHA1_Update(
sha: *mut SHA_CTX,
data: *const ::std::os::raw::c_void,
len: usize,
) -> ::std::os::raw::c_int;
}
extern "C" {
#[link_name = "__RUST_MUNDANE_0_4_0_SHA1_Final"]
pub fn SHA1_Final(md: *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,
_bindgen_union_align: [u32; 5usize],
}
#[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::<sha_state_st__bindgen_ty_1__bindgen_ty_1>(),
20usize,
concat!("Size of: ", stringify!(sha_state_st__bindgen_ty_1__bindgen_ty_1))
);
assert_eq!(
::std::mem::align_of::<sha_state_st__bindgen_ty_1__bindgen_ty_1>(),
4usize,
concat!("Alignment of ", stringify!(sha_state_st__bindgen_ty_1__bindgen_ty_1))
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<sha_state_st__bindgen_ty_1__bindgen_ty_1>())).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::<sha_state_st__bindgen_ty_1__bindgen_ty_1>())).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::<sha_state_st__bindgen_ty_1__bindgen_ty_1>())).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::<sha_state_st__bindgen_ty_1__bindgen_ty_1>())).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::<sha_state_st__bindgen_ty_1__bindgen_ty_1>())).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::<sha_state_st__bindgen_ty_1>(),
20usize,
concat!("Size of: ", stringify!(sha_state_st__bindgen_ty_1))
);
assert_eq!(
::std::mem::align_of::<sha_state_st__bindgen_ty_1>(),
4usize,
concat!("Alignment of ", stringify!(sha_state_st__bindgen_ty_1))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<sha_state_st__bindgen_ty_1>())).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::<sha_state_st>(),
96usize,
concat!("Size of: ", stringify!(sha_state_st))
);
assert_eq!(
::std::mem::align_of::<sha_state_st>(),
4usize,
concat!("Alignment of ", stringify!(sha_state_st))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<sha_state_st>())).Nl as *const _ as usize },
20usize,
concat!("Offset of field: ", stringify!(sha_state_st), "::", stringify!(Nl))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<sha_state_st>())).Nh as *const _ as usize },
24usize,
concat!("Offset of field: ", stringify!(sha_state_st), "::", stringify!(Nh))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<sha_state_st>())).data as *const _ as usize },
28usize,
concat!("Offset of field: ", stringify!(sha_state_st), "::", stringify!(data))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<sha_state_st>())).num as *const _ as usize },
92usize,
concat!("Offset of field: ", stringify!(sha_state_st), "::", stringify!(num))
);
}
extern "C" {
#[link_name = "__RUST_MUNDANE_0_4_0_SHA256_Init"]
pub fn SHA256_Init(sha: *mut SHA256_CTX) -> ::std::os::raw::c_int;
}
extern "C" {
#[link_name = "__RUST_MUNDANE_0_4_0_SHA256_Update"]
pub fn SHA256_Update(
sha: *mut SHA256_CTX,
data: *const ::std::os::raw::c_void,
len: usize,
) -> ::std::os::raw::c_int;
}
extern "C" {
#[link_name = "__RUST_MUNDANE_0_4_0_SHA256_Final"]
pub fn SHA256_Final(md: *mut u8, sha: *mut SHA256_CTX) -> ::std::os::raw::c_int;
}
#[repr(C)]
#[derive(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::<sha256_state_st>(),
112usize,
concat!("Size of: ", stringify!(sha256_state_st))
);
assert_eq!(
::std::mem::align_of::<sha256_state_st>(),
4usize,
concat!("Alignment of ", stringify!(sha256_state_st))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<sha256_state_st>())).h as *const _ as usize },
0usize,
concat!("Offset of field: ", stringify!(sha256_state_st), "::", stringify!(h))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<sha256_state_st>())).Nl as *const _ as usize },
32usize,
concat!("Offset of field: ", stringify!(sha256_state_st), "::", stringify!(Nl))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<sha256_state_st>())).Nh as *const _ as usize },
36usize,
concat!("Offset of field: ", stringify!(sha256_state_st), "::", stringify!(Nh))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<sha256_state_st>())).data as *const _ as usize },
40usize,
concat!("Offset of field: ", stringify!(sha256_state_st), "::", stringify!(data))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<sha256_state_st>())).num as *const _ as usize },
104usize,
concat!("Offset of field: ", stringify!(sha256_state_st), "::", stringify!(num))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<sha256_state_st>())).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_4_0_SHA384_Init"]
pub fn SHA384_Init(sha: *mut SHA512_CTX) -> ::std::os::raw::c_int;
}
extern "C" {
#[link_name = "__RUST_MUNDANE_0_4_0_SHA384_Update"]
pub fn SHA384_Update(
sha: *mut SHA512_CTX,
data: *const ::std::os::raw::c_void,
len: usize,
) -> ::std::os::raw::c_int;
}
extern "C" {
#[link_name = "__RUST_MUNDANE_0_4_0_SHA384_Final"]
pub fn SHA384_Final(md: *mut u8, sha: *mut SHA512_CTX) -> ::std::os::raw::c_int;
}
extern "C" {
#[link_name = "__RUST_MUNDANE_0_4_0_SHA512_Init"]
pub fn SHA512_Init(sha: *mut SHA512_CTX) -> ::std::os::raw::c_int;
}
extern "C" {
#[link_name = "__RUST_MUNDANE_0_4_0_SHA512_Update"]
pub fn SHA512_Update(
sha: *mut SHA512_CTX,
data: *const ::std::os::raw::c_void,
len: usize,
) -> ::std::os::raw::c_int;
}
extern "C" {
#[link_name = "__RUST_MUNDANE_0_4_0_SHA512_Final"]
pub fn SHA512_Final(md: *mut u8, sha: *mut SHA512_CTX) -> ::std::os::raw::c_int;
}
#[repr(C)]
#[derive(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::<sha512_state_st>(),
216usize,
concat!("Size of: ", stringify!(sha512_state_st))
);
assert_eq!(
::std::mem::align_of::<sha512_state_st>(),
8usize,
concat!("Alignment of ", stringify!(sha512_state_st))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<sha512_state_st>())).h as *const _ as usize },
0usize,
concat!("Offset of field: ", stringify!(sha512_state_st), "::", stringify!(h))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<sha512_state_st>())).Nl as *const _ as usize },
64usize,
concat!("Offset of field: ", stringify!(sha512_state_st), "::", stringify!(Nl))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<sha512_state_st>())).Nh as *const _ as usize },
72usize,
concat!("Offset of field: ", stringify!(sha512_state_st), "::", stringify!(Nh))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<sha512_state_st>())).p as *const _ as usize },
80usize,
concat!("Offset of field: ", stringify!(sha512_state_st), "::", stringify!(p))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<sha512_state_st>())).num as *const _ as usize },
208usize,
concat!("Offset of field: ", stringify!(sha512_state_st), "::", stringify!(num))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<sha512_state_st>())).md_len as *const _ as usize },
212usize,
concat!("Offset of field: ", stringify!(sha512_state_st), "::", stringify!(md_len))
);
}