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