1use super::super::*;
2
3extern "C" {
4 pub fn DH_new() -> *mut DH;
5 pub fn DH_free(dh: *mut DH);
6 pub fn DH_check(dh: *const DH, codes: *mut c_int) -> c_int;
7
8 #[cfg(not(libressl382))]
9 pub fn DH_generate_parameters(
10 prime_len: c_int,
11 generator: c_int,
12 callback: Option<extern "C" fn(c_int, c_int, *mut c_void)>,
13 cb_arg: *mut c_void,
14 ) -> *mut DH;
15
16 pub fn DH_generate_parameters_ex(
17 dh: *mut DH,
18 prime_len: c_int,
19 generator: c_int,
20 cb: *mut BN_GENCB,
21 ) -> c_int;
22
23 pub fn DH_generate_key(dh: *mut DH) -> c_int;
24 pub fn DH_compute_key(key: *mut c_uchar, pub_key: *const BIGNUM, dh: *mut DH) -> c_int;
25 pub fn DH_size(dh: *const DH) -> c_int;
26
27 pub fn d2i_DHparams(k: *mut *mut DH, pp: *mut *const c_uchar, length: c_long) -> *mut DH;
28 pub fn i2d_DHparams(dh: *const DH, pp: *mut *mut c_uchar) -> c_int;
29
30 #[cfg(ossl102)]
31 pub fn DH_get_1024_160() -> *mut DH;
32 #[cfg(ossl102)]
33 pub fn DH_get_2048_224() -> *mut DH;
34 #[cfg(ossl102)]
35 pub fn DH_get_2048_256() -> *mut DH;
36
37 #[cfg(any(ossl110, libressl270))]
38 pub fn DH_set0_pqg(dh: *mut DH, p: *mut BIGNUM, q: *mut BIGNUM, g: *mut BIGNUM) -> c_int;
39 #[cfg(any(ossl110, libressl270))]
40 pub fn DH_get0_pqg(
41 dh: *const DH,
42 p: *mut *const BIGNUM,
43 q: *mut *const BIGNUM,
44 g: *mut *const BIGNUM,
45 );
46
47 #[cfg(any(ossl110, libressl270))]
48 pub fn DH_set0_key(dh: *mut DH, pub_key: *mut BIGNUM, priv_key: *mut BIGNUM) -> c_int;
49
50 #[cfg(any(ossl110, libressl270))]
51 pub fn DH_get0_key(dh: *const DH, pub_key: *mut *const BIGNUM, priv_key: *mut *const BIGNUM);
52}
53