1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
/* automatically generated by rust-bindgen */

pub const randombytes_SEEDBYTES : :: std :: os :: raw :: c_uint = 32 ; pub const hydro_hash_BYTES : :: std :: os :: raw :: c_uint = 32 ; pub const hydro_hash_BYTES_MAX : :: std :: os :: raw :: c_uint = 65535 ; pub const hydro_hash_BYTES_MIN : :: std :: os :: raw :: c_uint = 16 ; pub const hydro_hash_CONTEXTBYTES : :: std :: os :: raw :: c_uint = 8 ; pub const hydro_hash_KEYBYTES : :: std :: os :: raw :: c_uint = 32 ; pub const hydro_hash_KEYBYTES_MAX : :: std :: os :: raw :: c_uint = 32 ; pub const hydro_hash_KEYBYTES_MIN : :: std :: os :: raw :: c_uint = 16 ; pub const hydro_secretbox_CONTEXTBYTES : :: std :: os :: raw :: c_uint = 8 ; pub const hydro_secretbox_HEADERBYTES : :: std :: os :: raw :: c_uint = 36 ; pub const hydro_secretbox_KEYBYTES : :: std :: os :: raw :: c_uint = 32 ; pub const hydro_secretbox_PROBEBYTES : :: std :: os :: raw :: c_uint = 16 ; pub const hydro_kdf_CONTEXTBYTES : :: std :: os :: raw :: c_uint = 8 ; pub const hydro_kdf_KEYBYTES : :: std :: os :: raw :: c_uint = 32 ; pub const hydro_kdf_BYTES_MAX : :: std :: os :: raw :: c_uint = 65535 ; pub const hydro_kdf_BYTES_MIN : :: std :: os :: raw :: c_uint = 16 ; pub const hydro_sign_BYTES : :: std :: os :: raw :: c_uint = 64 ; pub const hydro_sign_CONTEXTBYTES : :: std :: os :: raw :: c_uint = 8 ; pub const hydro_sign_PUBLICKEYBYTES : :: std :: os :: raw :: c_uint = 32 ; pub const hydro_sign_SECRETKEYBYTES : :: std :: os :: raw :: c_uint = 64 ; pub const hydro_sign_SEEDBYTES : :: std :: os :: raw :: c_uint = 32 ; pub const hydro_kx_SESSIONKEYBYTES : :: std :: os :: raw :: c_uint = 32 ; pub const hydro_kx_PUBLICKEYBYTES : :: std :: os :: raw :: c_uint = 32 ; pub const hydro_kx_SECRETKEYBYTES : :: std :: os :: raw :: c_uint = 32 ; pub const hydro_kx_PSKBYTES : :: std :: os :: raw :: c_uint = 32 ; pub const hydro_kx_SEEDBYTES : :: std :: os :: raw :: c_uint = 32 ; pub const hydro_kx_RESPONSE1BYTES : :: std :: os :: raw :: c_uint = 32 ; pub const hydro_kx_RESPONSE2BYTES : :: std :: os :: raw :: c_uint = 80 ; pub const hydro_kx_RESPONSE3BYTES : :: std :: os :: raw :: c_uint = 48 ; pub const hydro_pwhash_CONTEXTBYTES : :: std :: os :: raw :: c_uint = 8 ; pub const hydro_pwhash_MASTERKEYBYTES : :: std :: os :: raw :: c_uint = 32 ; pub const hydro_pwhash_STOREDBYTES : :: std :: os :: raw :: c_uint = 128 ; extern "C" {
 pub fn hydro_init ( ) -> :: std :: os :: raw :: c_int ; 
} extern "C" {
 pub fn randombytes_random ( ) -> u32 ; 
} extern "C" {
 pub fn randombytes_uniform ( upper_bound : u32 , ) -> u32 ; 
} extern "C" {
 pub fn randombytes_buf ( out : * mut :: std :: os :: raw :: c_void , out_len : usize , ) ; 
} extern "C" {
 pub fn randombytes_buf_deterministic ( out : * mut :: std :: os :: raw :: c_void , out_len : usize , seed : * const u8 , ) ; 
} # [ repr ( C ) ] # [ derive ( Debug , Default , Copy , Clone , PartialEq , Eq ) ] pub struct hydro_hash_state { pub state : [ u32 ; 12usize ] , pub buf_off : u8 , pub align : [ u8 ; 3usize ] , } # [ test ] fn bindgen_test_layout_hydro_hash_state ( ) { assert_eq ! ( :: std :: mem :: size_of :: < hydro_hash_state > ( ) , 52usize , concat ! ( "Size of: " , stringify ! ( hydro_hash_state ) ) ) ; assert_eq ! ( :: std :: mem :: align_of :: < hydro_hash_state > ( ) , 4usize , concat ! ( "Alignment of " , stringify ! ( hydro_hash_state ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < hydro_hash_state > ( ) ) ) . state as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( hydro_hash_state ) , "::" , stringify ! ( state ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < hydro_hash_state > ( ) ) ) . buf_off as * const _ as usize } , 48usize , concat ! ( "Offset of field: " , stringify ! ( hydro_hash_state ) , "::" , stringify ! ( buf_off ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < hydro_hash_state > ( ) ) ) . align as * const _ as usize } , 49usize , concat ! ( "Offset of field: " , stringify ! ( hydro_hash_state ) , "::" , stringify ! ( align ) ) ) ; } extern "C" {
 pub fn hydro_hash_keygen ( key : * mut u8 , key_len : usize , ) ; 
} extern "C" {
 pub fn hydro_hash_init ( state : * mut hydro_hash_state , ctx : * const :: std :: os :: raw :: c_char , key : * const u8 , key_len : usize , ) -> :: std :: os :: raw :: c_int ; 
} extern "C" {
 pub fn hydro_hash_update ( state : * mut hydro_hash_state , in_ : * const :: std :: os :: raw :: c_void , in_len : usize , ) -> :: std :: os :: raw :: c_int ; 
} extern "C" {
 pub fn hydro_hash_final ( state : * mut hydro_hash_state , out : * mut u8 , out_len : usize , ) -> :: std :: os :: raw :: c_int ; 
} extern "C" {
 pub fn hydro_hash_hash ( out : * mut u8 , out_len : usize , in_ : * const :: std :: os :: raw :: c_void , in_len : usize , ctx : * const :: std :: os :: raw :: c_char , key : * const u8 , key_len : usize , ) -> :: std :: os :: raw :: c_int ; 
} extern "C" {
 pub fn hydro_secretbox_keygen ( key : * mut u8 , ) ; 
} extern "C" {
 pub fn hydro_secretbox_encrypt ( c : * mut u8 , m_ : * const :: std :: os :: raw :: c_void , mlen : usize , msg_id : u64 , ctx : * const :: std :: os :: raw :: c_char , key : * const u8 , ) -> :: std :: os :: raw :: c_int ; 
} extern "C" {
 pub fn hydro_secretbox_decrypt ( m_ : * mut :: std :: os :: raw :: c_void , c : * const u8 , clen : usize , msg_id : u64 , ctx : * const :: std :: os :: raw :: c_char , key : * const u8 , ) -> :: std :: os :: raw :: c_int ; 
} extern "C" {
 pub fn hydro_secretbox_probe_create ( probe : * mut u8 , c : * const u8 , c_len : usize , ctx : * const :: std :: os :: raw :: c_char , key : * const u8 , ) ; 
} extern "C" {
 pub fn hydro_secretbox_probe_verify ( probe : * const u8 , c : * const u8 , c_len : usize , ctx : * const :: std :: os :: raw :: c_char , key : * const u8 , ) -> :: std :: os :: raw :: c_int ; 
} extern "C" {
 pub fn hydro_kdf_keygen ( key : * mut u8 , ) ; 
} extern "C" {
 pub fn hydro_kdf_derive_from_key ( subkey : * mut u8 , subkey_len : usize , subkey_id : u64 , ctx : * const :: std :: os :: raw :: c_char , key : * const u8 , ) -> :: std :: os :: raw :: c_int ; 
} # [ repr ( C ) ] # [ derive ( Debug , Default , Copy , Clone , PartialEq , Eq ) ] pub struct hydro_sign_state { pub hash_st : hydro_hash_state , } # [ test ] fn bindgen_test_layout_hydro_sign_state ( ) { assert_eq ! ( :: std :: mem :: size_of :: < hydro_sign_state > ( ) , 52usize , concat ! ( "Size of: " , stringify ! ( hydro_sign_state ) ) ) ; assert_eq ! ( :: std :: mem :: align_of :: < hydro_sign_state > ( ) , 4usize , concat ! ( "Alignment of " , stringify ! ( hydro_sign_state ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < hydro_sign_state > ( ) ) ) . hash_st as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( hydro_sign_state ) , "::" , stringify ! ( hash_st ) ) ) ; } # [ repr ( C ) ] # [ derive ( Copy , Clone ) ] pub struct hydro_sign_keypair { pub pk : [ u8 ; 32usize ] , pub sk : [ u8 ; 64usize ] , } # [ test ] fn bindgen_test_layout_hydro_sign_keypair ( ) { assert_eq ! ( :: std :: mem :: size_of :: < hydro_sign_keypair > ( ) , 96usize , concat ! ( "Size of: " , stringify ! ( hydro_sign_keypair ) ) ) ; assert_eq ! ( :: std :: mem :: align_of :: < hydro_sign_keypair > ( ) , 1usize , concat ! ( "Alignment of " , stringify ! ( hydro_sign_keypair ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < hydro_sign_keypair > ( ) ) ) . pk as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( hydro_sign_keypair ) , "::" , stringify ! ( pk ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < hydro_sign_keypair > ( ) ) ) . sk as * const _ as usize } , 32usize , concat ! ( "Offset of field: " , stringify ! ( hydro_sign_keypair ) , "::" , stringify ! ( sk ) ) ) ; } impl Default for hydro_sign_keypair { fn default ( ) -> Self { unsafe { :: std :: mem :: zeroed ( ) } } } extern "C" {
 pub fn hydro_sign_keygen ( kp : * mut hydro_sign_keypair , ) ; 
} extern "C" {
 pub fn hydro_sign_keygen_deterministic ( kp : * mut hydro_sign_keypair , seed : * const u8 , ) ; 
} extern "C" {
 pub fn hydro_sign_init ( state : * mut hydro_sign_state , ctx : * const :: std :: os :: raw :: c_char , ) -> :: std :: os :: raw :: c_int ; 
} extern "C" {
 pub fn hydro_sign_update ( state : * mut hydro_sign_state , m_ : * const :: std :: os :: raw :: c_void , mlen : usize , ) -> :: std :: os :: raw :: c_int ; 
} extern "C" {
 pub fn hydro_sign_final_create ( state : * mut hydro_sign_state , csig : * mut u8 , sk : * const u8 , ) -> :: std :: os :: raw :: c_int ; 
} extern "C" {
 pub fn hydro_sign_final_verify ( state : * mut hydro_sign_state , csig : * const u8 , pk : * const u8 , ) -> :: std :: os :: raw :: c_int ; 
} extern "C" {
 pub fn hydro_sign_create ( csig : * mut u8 , m_ : * const :: std :: os :: raw :: c_void , mlen : usize , ctx : * const :: std :: os :: raw :: c_char , sk : * const u8 , ) -> :: std :: os :: raw :: c_int ; 
} extern "C" {
 pub fn hydro_sign_verify ( csig : * const u8 , m_ : * const :: std :: os :: raw :: c_void , mlen : usize , ctx : * const :: std :: os :: raw :: c_char , pk : * const u8 , ) -> :: std :: os :: raw :: c_int ; 
} # [ repr ( C ) ] # [ derive ( Debug , Default , Copy , Clone , PartialEq , Eq ) ] pub struct hydro_kx_keypair { pub pk : [ u8 ; 32usize ] , pub sk : [ u8 ; 32usize ] , } # [ test ] fn bindgen_test_layout_hydro_kx_keypair ( ) { assert_eq ! ( :: std :: mem :: size_of :: < hydro_kx_keypair > ( ) , 64usize , concat ! ( "Size of: " , stringify ! ( hydro_kx_keypair ) ) ) ; assert_eq ! ( :: std :: mem :: align_of :: < hydro_kx_keypair > ( ) , 1usize , concat ! ( "Alignment of " , stringify ! ( hydro_kx_keypair ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < hydro_kx_keypair > ( ) ) ) . pk as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( hydro_kx_keypair ) , "::" , stringify ! ( pk ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < hydro_kx_keypair > ( ) ) ) . sk as * const _ as usize } , 32usize , concat ! ( "Offset of field: " , stringify ! ( hydro_kx_keypair ) , "::" , stringify ! ( sk ) ) ) ; } # [ repr ( C ) ] # [ derive ( Debug , Default , Copy , Clone , PartialEq , Eq ) ] pub struct hydro_kx_session_keypair { pub rx : [ u8 ; 32usize ] , pub tx : [ u8 ; 32usize ] , } # [ test ] fn bindgen_test_layout_hydro_kx_session_keypair ( ) { assert_eq ! ( :: std :: mem :: size_of :: < hydro_kx_session_keypair > ( ) , 64usize , concat ! ( "Size of: " , stringify ! ( hydro_kx_session_keypair ) ) ) ; assert_eq ! ( :: std :: mem :: align_of :: < hydro_kx_session_keypair > ( ) , 1usize , concat ! ( "Alignment of " , stringify ! ( hydro_kx_session_keypair ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < hydro_kx_session_keypair > ( ) ) ) . rx as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( hydro_kx_session_keypair ) , "::" , stringify ! ( rx ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < hydro_kx_session_keypair > ( ) ) ) . tx as * const _ as usize } , 32usize , concat ! ( "Offset of field: " , stringify ! ( hydro_kx_session_keypair ) , "::" , stringify ! ( tx ) ) ) ; } # [ repr ( C ) ] # [ derive ( Debug , Default , Copy , Clone , PartialEq , Eq ) ] pub struct hydro_kx_state { pub eph_kp : hydro_kx_keypair , pub h : [ u8 ; 32usize ] , pub ck : [ u8 ; 32usize ] , pub k : [ u8 ; 32usize ] , } # [ test ] fn bindgen_test_layout_hydro_kx_state ( ) { assert_eq ! ( :: std :: mem :: size_of :: < hydro_kx_state > ( ) , 160usize , concat ! ( "Size of: " , stringify ! ( hydro_kx_state ) ) ) ; assert_eq ! ( :: std :: mem :: align_of :: < hydro_kx_state > ( ) , 1usize , concat ! ( "Alignment of " , stringify ! ( hydro_kx_state ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < hydro_kx_state > ( ) ) ) . eph_kp as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( hydro_kx_state ) , "::" , stringify ! ( eph_kp ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < hydro_kx_state > ( ) ) ) . h as * const _ as usize } , 64usize , concat ! ( "Offset of field: " , stringify ! ( hydro_kx_state ) , "::" , stringify ! ( h ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < hydro_kx_state > ( ) ) ) . ck as * const _ as usize } , 96usize , concat ! ( "Offset of field: " , stringify ! ( hydro_kx_state ) , "::" , stringify ! ( ck ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < hydro_kx_state > ( ) ) ) . k as * const _ as usize } , 128usize , concat ! ( "Offset of field: " , stringify ! ( hydro_kx_state ) , "::" , stringify ! ( k ) ) ) ; } extern "C" {
 pub fn hydro_kx_keygen ( static_kp : * mut hydro_kx_keypair , ) ; 
} extern "C" {
 pub fn hydro_kx_keygen_deterministic ( static_kp : * mut hydro_kx_keypair , seed : * const u8 , ) ; 
} extern "C" {
 pub fn hydro_kx_xx_1 ( state : * mut hydro_kx_state , response1 : * mut u8 , psk : * const u8 , ) -> :: std :: os :: raw :: c_int ; 
} extern "C" {
 pub fn hydro_kx_xx_2 ( state : * mut hydro_kx_state , response2 : * mut u8 , response1 : * const u8 , psk : * const u8 , static_kp : * const hydro_kx_keypair , ) -> :: std :: os :: raw :: c_int ; 
} extern "C" {
 pub fn hydro_kx_xx_3 ( state : * mut hydro_kx_state , kp : * mut hydro_kx_session_keypair , response3 : * mut u8 , peer_static_pk : * mut u8 , response2 : * const u8 , psk : * const u8 , static_kp : * const hydro_kx_keypair , ) -> :: std :: os :: raw :: c_int ; 
} extern "C" {
 pub fn hydro_kx_xx_4 ( state : * mut hydro_kx_state , kp : * mut hydro_kx_session_keypair , peer_static_pk : * mut u8 , response3 : * const u8 , psk : * const u8 , ) -> :: std :: os :: raw :: c_int ; 
} extern "C" {
 pub fn hydro_pwhash_keygen ( master_key : * mut u8 , ) ; 
} extern "C" {
 pub fn hydro_pwhash_deterministic ( h : * mut u8 , h_len : usize , passwd : * const :: std :: os :: raw :: c_char , passwd_len : usize , ctx : * const :: std :: os :: raw :: c_char , master_key : * const u8 , opslimit : u64 , memlimit : usize , threads : u8 , ) -> :: std :: os :: raw :: c_int ; 
} extern "C" {
 pub fn hydro_pwhash_create ( stored : * mut u8 , passwd : * const :: std :: os :: raw :: c_char , passwd_len : usize , master_key : * const u8 , opslimit : u64 , memlimit : usize , threads : u8 , ) -> :: std :: os :: raw :: c_int ; 
} extern "C" {
 pub fn hydro_pwhash_verify ( stored : * const u8 , passwd : * const :: std :: os :: raw :: c_char , passwd_len : usize , master_key : * const u8 , opslimit_max : u64 , memlimit_max : usize , threads_max : u8 , ) -> :: std :: os :: raw :: c_int ; 
} extern "C" {
 pub fn hydro_pwhash_derive_static_key ( static_key : * mut u8 , static_key_len : usize , stored : * const u8 , passwd : * const :: std :: os :: raw :: c_char , passwd_len : usize , ctx : * const :: std :: os :: raw :: c_char , master_key : * const u8 , opslimit_max : u64 , memlimit_max : usize , threads_max : u8 , ) -> :: std :: os :: raw :: c_int ; 
} extern "C" {
 pub fn hydro_pwhash_reencrypt ( stored : * mut u8 , master_key : * const u8 , new_master_key : * const u8 , ) -> :: std :: os :: raw :: c_int ; 
} extern "C" {
 pub fn hydro_memzero ( pnt : * mut :: std :: os :: raw :: c_void , len : usize , ) ; 
} extern "C" {
 pub fn hydro_increment ( n : * mut u8 , len : usize , ) ; 
} extern "C" {
 pub fn hydro_equal ( b1_ : * const :: std :: os :: raw :: c_void , b2_ : * const :: std :: os :: raw :: c_void , len : usize , ) -> bool ; 
} extern "C" {
 pub fn hydro_compare ( b1_ : * const u8 , b2_ : * const u8 , len : usize , ) -> :: std :: os :: raw :: c_int ; 
} extern "C" {
 pub fn hydro_bin2hex ( hex : * mut :: std :: os :: raw :: c_char , hex_maxlen : usize , bin : * const u8 , bin_len : usize , ) -> * mut :: std :: os :: raw :: c_char ; 
} extern "C" {
 pub fn hydro_hex2bin ( bin : * mut u8 , bin_maxlen : usize , hex : * const :: std :: os :: raw :: c_char , hex_len : usize , ignore : * const :: std :: os :: raw :: c_char , bin_len : * mut usize , hex_end : * mut * const :: std :: os :: raw :: c_char , ) -> :: std :: os :: raw :: c_int ; 
} extern "C" {
 pub fn hydro_pad ( padded_buflen_p : * mut usize , buf : * mut :: std :: os :: raw :: c_uchar , unpadded_buflen : usize , blocksize : usize , max_buflen : usize , ) -> :: std :: os :: raw :: c_int ; 
} extern "C" {
 pub fn hydro_unpad ( unpadded_buflen_p : * mut usize , buf : * const :: std :: os :: raw :: c_uchar , padded_buflen : usize , blocksize : usize , ) -> :: std :: os :: raw :: c_int ; 
}