#include
int DH_generate_key(DH *dh);
int DH_compute_key(unsigned char *key, BIGNUM *pub_key, DH *dh);
_D_H___g_e_n_e_r_a_t_e___k_e_y_(_) expects ddhh to contain the shared parameters ddhh-->>pp and ddhh-->>gg. It generates a random private DH value unless ddhh-->>pprriivv__kkeeyy is already set, and computes the corresponding public value ddhh-->>ppuubb__kkeeyy, which can then be published.
_D_H___c_o_m_p_u_t_e___k_e_y_(_) computes the shared secret from the private DH value in ddhh and the other party's public value in ppuubb__kkeeyy and stores it in kkeeyy. kkeeyy must point to DDHH__ssiizzee((ddhh)) bytes of memory.
_D_H___c_o_m_p_u_t_e___k_e_y_(_) returns the size of the shared secret on success, -1 on error.
The error codes can be obtained by _E_R_R___g_e_t___e_r_r_o_r(3).